Skip to content

onElementClick arguments for treemap are not the same as for pie #624

@wylieconlon

Description

@wylieconlon

I consider it a bug to have 2 different kinds of arguments for the onElementClick handler on the same Partition chart type. I reproduced this by adding a click handler to the storybook examples that contain 2 layers, on both sunburst and treemap:

<Settings onElementClick={args => console.log(args)} />

After doing this, I found that the shape of the arguments is pretty different in both cases:

Results on 2-layer pie chart:

[
  [
    {groupByRollup: "na", value: 1941791459288},
    {groupByRollup: "usa", value: 1502955976896}
  ],
  {specId: "spec_1", key: "spec{spec_1}"},
]

Results on 2-layer treemap chart:

[
  [
    [
      {groupByRollup: "na", value: 1941791459288}
    ],
    {specId: "spec_1", key: "spec{spec_1}"}
  ],
  [
    [
      {groupByRollup: "na", value: 1941791459288}
      {groupByRollup: "can", value: 263179112592}
    ],
    {specId: "spec_1", key: "spec{spec_1}"}
  ]
]

Metadata

Metadata

Assignees

Labels

:interactionsInteractions related issue: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