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}"}
]
]
I consider it a bug to have 2 different kinds of arguments for the
onElementClickhandler on the samePartitionchart type. I reproduced this by adding a click handler to the storybook examples that contain 2 layers, on both sunburst and treemap:After doing this, I found that the shape of the arguments is pretty different in both cases:
Results on 2-layer pie chart:
Results on 2-layer treemap chart: