Skip to content
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

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

Closed
wylieconlon opened this issue Apr 9, 2020 · 2 comments · Fixed by #636
Closed

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

wylieconlon opened this issue Apr 9, 2020 · 2 comments · Fixed by #636
Assignees
Labels
bug Something isn't working :interactions Interactions related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related released Issue released publicly

Comments

@wylieconlon
Copy link

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}"}
  ]
]
@wylieconlon wylieconlon added bug Something isn't working :interactions Interactions related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related labels Apr 9, 2020
@markov00
Copy link
Member

Thank you @wylieconlon, yes that is definitely a bug

@markov00 markov00 self-assigned this Apr 16, 2020
markov00 added a commit to markov00/elastic-charts that referenced this issue Apr 17, 2020
This commit align the shape of passed parameter of the onElementClick listener to the one passed by
a sunburst. For each single hovered shape (usually only one shape at time) it returns the values for
each layer of the treemap

fix elastic#624
markov00 added a commit that referenced this issue Apr 21, 2020
This commit align the shape of passed parameter of the onElementClick listener to the one passed by a sunburst. For each single hovered shape (usually only one shape at time) it returns the values for each layer of the treemap

fix #624
markov00 pushed a commit that referenced this issue Apr 22, 2020
# [18.4.0](v18.3.0...v18.4.0) (2020-04-22)

### Bug Fixes

* **partition:** single slice wrong text positioning ([#643](#643)) ([6298d36](6298d36)), closes [#637](#637)
* **treemap:** align onElementClick parameters to sunburst ([#636](#636)) ([2c1d224](2c1d224)), closes [#624](#624)

### Features

* allow colorVariant option for series specific color styles ([#630](#630)) ([e5a206d](e5a206d))
* **series:** BubbleSeries (alpha) and markSizeAccessor ([#559](#559)) ([3aa235e](3aa235e))
@markov00
Copy link
Member

🎉 This issue has been resolved in version 18.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Apr 22, 2020
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
# [18.4.0](elastic/elastic-charts@v18.3.0...v18.4.0) (2020-04-22)

### Bug Fixes

* **partition:** single slice wrong text positioning ([opensearch-project#643](elastic/elastic-charts#643)) ([f8b5b8a](elastic/elastic-charts@f8b5b8a)), closes [opensearch-project#637](elastic/elastic-charts#637)
* **treemap:** align onElementClick parameters to sunburst ([opensearch-project#636](elastic/elastic-charts#636)) ([8dd87bf](elastic/elastic-charts@8dd87bf)), closes [opensearch-project#624](elastic/elastic-charts#624)

### Features

* allow colorVariant option for series specific color styles ([opensearch-project#630](elastic/elastic-charts#630)) ([e2444ef](elastic/elastic-charts@e2444ef))
* **series:** BubbleSeries (alpha) and markSizeAccessor ([opensearch-project#559](elastic/elastic-charts#559)) ([85d9bda](elastic/elastic-charts@85d9bda))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working :interactions Interactions related issue :partition Partition/PieChart/Donut/Sunburst/Treemap chart related released Issue released publicly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants