-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Treemap in infinite loop when valueAccessor
returns zero
#642
Comments
valueAccessor
of 0valueAccessor
of 0
@wylieconlon thanks for the note. Partition accessors were designed with referentially transparent functions in mind - how does this situation arise in the code? Are you using a closure that changes the value depending on previous invocations, and is there expectation for this? If possible, I'd like to avoid the materialization of the accessor-mapped input as the first step, as it'd be extra code, and often, performance overhead, which is why it'd be good to see if you have a need for stateful "accessors" or there can be a pure function that reproduces the issue. |
@monfera I was reproducing this in Lens, where depending on the query results we sometimes get data with 0s in it. So yes, this is reproduceable without a random data set- you could instead change some of the sample objects in the storybook to include 0s. |
Renaming this as more than one layer is not a prerequisite |
valueAccessor
of 0valueAccessor
returns zero
Ignore not only negative values but also zero values. fix #642
🎉 This issue has been resolved in version 19.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [19.1.2](elastic/elastic-charts@v19.1.1...v19.1.2) (2020-05-04) ### Bug Fixes * **partition:** elimination of zero values ([opensearch-project#658](elastic/elastic-charts#658)) ([6e7b3dd](elastic/elastic-charts@6e7b3dd)), closes [opensearch-project#642](elastic/elastic-charts#642)
This is a bug in the treemap only, not in the sunburst chart. To reproduce:
valueAccessor={(d: Datum) => Math.random() < 0.7 ? d.exportVal as number : 0}
When I change the exact same chart to
partitionLayout: PartitionLayout.sunburst
, the chart renders.The text was updated successfully, but these errors were encountered: