Skip to content

Treemap in infinite loop when valueAccessor returns zero #642

@wylieconlon

Description

@wylieconlon

This is a bug in the treemap only, not in the sunburst chart. To reproduce:

  1. 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}
  2. Refresh the storybook
  3. 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.

Metadata

Metadata

Assignees

Labels

:partitionPartition/PieChart/Donut/Sunburst/Treemap chart relatedbugSomething isn't workingreleasedIssue released publicly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions