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

feat(plugin-chart-echarts): supports sunburst chart v2 [WIP] #21625

Merged
merged 4 commits into from Jan 16, 2023

Conversation

stephenLYZ
Copy link
Member

@stephenLYZ stephenLYZ commented Sep 28, 2022

SUMMARY

This PR supports sunburst chart v2 which is powered by echart.
Features:

  • Support the basic sunburst chart as v1
  • Support show total
  • Support label features, like showLabels/LabelFormat, etc
  • Support tooltip to show detail
  • Support DASHBOARD_CROSS_FILTERS

Todo:

  • Add thumbnail and example pictures
  • Support breadcrumbs?
  • Other requirements

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

base

image

show label

image

show total

image

tooltip

image

secondary metric

image

cross-filter

2022-09-29.12.13.56.mov

drill-to-detail

2022-09-29.12.14.36.mov

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #21625 (b921acb) into master (6d37e66) will decrease coverage by 0.12%.
The diff coverage is 16.29%.

@@            Coverage Diff             @@
##           master   #21625      +/-   ##
==========================================
- Coverage   67.13%   67.00%   -0.13%     
==========================================
  Files        1869     1876       +7     
  Lines       71656    71812     +156     
  Branches     7822     7863      +41     
==========================================
+ Hits        48103    48115      +12     
- Misses      21526    21671     +145     
+ Partials     2027     2026       -1     
Flag Coverage Δ
javascript 53.73% <16.29%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gin-chart-echarts/src/Sunburst/EchartsSunburst.tsx 0.00% <0.00%> (ø)
...ns/plugin-chart-echarts/src/Sunburst/buildQuery.ts 0.00% <0.00%> (ø)
...plugins/plugin-chart-echarts/src/Sunburst/index.ts 0.00% <0.00%> (ø)
...lugin-chart-echarts/src/Sunburst/transformProps.ts 0.00% <0.00%> (ø)
...gins/plugin-chart-echarts/src/Treemap/constants.ts 54.54% <ø> (ø)
.../plugins/plugin-chart-echarts/src/Treemap/types.ts 100.00% <ø> (ø)
...plugin-chart-echarts/src/Sunburst/controlPanel.tsx 28.57% <28.57%> (ø)
...plugin-chart-echarts/src/Treemap/transformProps.ts 50.87% <75.00%> (-1.37%) ⬇️
...gins/plugin-chart-echarts/src/utils/treeBuilder.ts 87.50% <87.50%> (ø)
...plugins/plugin-chart-echarts/src/Sunburst/types.ts 100.00% <100.00%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@stephenLYZ stephenLYZ added the viz:charts:sunburst Related to the Sunburst chart label Sep 29, 2022
Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool work @stephenLYZ! I left some first-pass comments.

@stephenLYZ
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@stephenLYZ Ephemeral environment spinning up at http://54.149.133.75:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @stephenLYZ ! 🚀 One minor comment about avoiding using deprecated controls. I also agree with @michael-s-molina's comment about using the theme object here wherever possible so we don't introduce more styling debt.

@villebro
Copy link
Member

@stephenLYZ one more thing - could we add at least one simple storybook?

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenLYZ Thanks for taking the new Sunburst chart! I have tested in my local. I was doing the first-round review.

  1. When the secondary metric is used, the color of the dimensions seems broken.

image

  1. the description of the Hierarchy should add some explanation that the first level of the hierarchy is the innermost circle.
    image

  2. Should use a query to get the Total value of the metric instead of the frontend calculating it? because there are some reasons(Javascript with int8/int16?) that caused incorrect total values.

Screen.Recording.2022-10-24.at.17.30.29.mov

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submitted a few commits to be able to merge this PR. I unregistered the chart from the available visualizations and will tackle the following open issues in another PR:

  • Add thumbnail and example pictures
  • Add a Storybook entry for the chart
  • When the secondary metric is used, the color of the dimensions seems broken.
  • Make the relationship between hierarchies and the circles more clear to the user
  • Use the callback function and return an HTML element for the tooltip
  • Improve the tooltip description to show the hierarchy names
  • Improve tooltip positioning as it is sometimes being cut off the screen
  • Fix the calculation of total values
  • Register the chart again so it's available for use

@michael-s-molina michael-s-molina merged commit b53941f into apache:master Jan 16, 2023
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XXL viz:charts:sunburst Related to the Sunburst chart 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants