This is a bug in the treemap only, not in the sunburst chart. To reproduce:
- Modify one of the 2-layer treemap examples to sometimes return 0 in the valueAccessor function, such as
valueAccessor={(d: Datum) => Math.random() < 0.7 ? d.exportVal as number : 0}
- Refresh the storybook
- You will see that the chart throws an infinite loop:
RangeError: Maximum call stack size exceeded
at Function.get [Symbol.species] ()
at Array.concat ()
at push../src/chart_types/partition_chart/layout/utils/treemap.ts.__spread
When I change the exact same chart to partitionLayout: PartitionLayout.sunburst, the chart renders.
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.