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(ui-core): implement drilldown #17883

Closed
wants to merge 7 commits into from
Closed

feat(ui-core): implement drilldown #17883

wants to merge 7 commits into from

Conversation

EvilDrW
Copy link

@EvilDrW EvilDrW commented Dec 28, 2021

Add hierarchical traversability to pie charts and bar charts.

SUMMARY

This is an attempt at bringing #14688 and apache-superset/superset-ui#1120 up-to-date with the latest Superset mono repo and extending the feature to work both with echarts/pie and nvd3/distbar.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

See video on #14688

TESTING INSTRUCTIONS

Create either a bar chart or pie chart. In the chart editor, select "ENABLE DRILL DOWN." Add multiple columns to the "GROUP BY" field that have a natural hierarchy to them and ensure the order of columns listed reflects the intended hierarchy. Add an appropriate metric (usually COUNT(id) or similar). Observe that only the first column in the hierarchy is reflected in the rendered chart. Observe that clicking one field in the chart adds the selected field to the applied filters and that the second column in the "GROUP BY" hierarchy is now displayed. Observe that selecting a field when the chart is at its deepest level in the hierarchy clears all selected filters and returns the chart to the original state. Observe that saving the chart and adding it to a dashboard results in identical functionality as described above.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: DASHBOARD_DRILL_DOWN
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@EvilDrW EvilDrW mentioned this pull request Dec 28, 2021
8 tasks
@Vygo
Copy link

Vygo commented Dec 28, 2021

Super excited about this feature, any chance we can it in the next release?

@codecov
Copy link

codecov bot commented Dec 29, 2021

Codecov Report

Merging #17883 (b945c9b) into master (b82da5c) will decrease coverage by 0.13%.
The diff coverage is 43.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17883      +/-   ##
==========================================
- Coverage   67.17%   67.03%   -0.14%     
==========================================
  Files        1609     1612       +3     
  Lines       64796    64978     +182     
  Branches     6855     6888      +33     
==========================================
+ Hits        43528    43561      +33     
- Misses      19412    19543     +131     
- Partials     1856     1874      +18     
Flag Coverage Δ
hive 81.81% <100.00%> (+0.01%) ⬆️
javascript 53.69% <36.59%> (-0.22%) ⬇️
mysql 82.19% <100.00%> (+0.01%) ⬆️
postgres 82.24% <100.00%> (+0.01%) ⬆️
presto 82.11% <100.00%> (+0.01%) ⬆️
python 82.73% <100.00%> (+0.01%) ⬆️
sqlite 81.92% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...d/packages/superset-ui-chart-controls/src/types.ts 100.00% <ø> (ø)
.../superset-ui-core/src/query/types/QueryFormData.ts 100.00% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...ns/legacy-plugin-chart-horizon/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
...acy-plugin-chart-paired-t-test/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
...gin-chart-parallel-coordinates/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
...legacy-plugin-chart-partition/src/controlPanel.tsx 25.00% <0.00%> (-8.34%) ⬇️
...egacy-plugin-chart-pivot-table/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
...gins/legacy-plugin-chart-rose/src/controlPanel.tsx 50.00% <0.00%> (-50.00%) ⬇️
...ns/legacy-plugin-chart-treemap/src/controlPanel.ts 50.00% <0.00%> (-50.00%) ⬇️
... and 90 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b82da5c...b945c9b. Read the comment docs.

@EvilDrW EvilDrW changed the title implement drilldown feat(ui-core): implement drilldown Dec 29, 2021
@villebro
Copy link
Member

villebro commented Jan 4, 2022

As excited as I am about this feature, I think we need to do SIP for this to ensure that we don't end up painting ourselves into a corner by making changes that will become difficult to maintain going forward. For context, the original POC was met with some concern in offline discussions, primarily around what additional changes we would need to introduce to make drill down/drill through functionality in a future proof way without adding technical debt. @EvilDrW would you be open to spearheading a SIP to kickstart the discussion for adding drilldown functionality to Superset? This way we could have a transparent discussion where all parties could be heard, and could also make sure this feature could be rolled out incrementally with a clear implementation plan.

@EvilDrW
Copy link
Author

EvilDrW commented Jan 4, 2022

#17927

@EvilDrW EvilDrW closed this Jan 11, 2022
@rajatency
Copy link

@EvilDrW I am trying to implement this for the purpose of POC. How can I add this to other types of charts as well, apart from pie chart and bar chart? Also, I see I can add multiple group-by to pie chart and use this drill down feature, but how will this be visible in bar charts?

@alfgai
Copy link

alfgai commented Aug 3, 2022

hi everyone!
Is this option already available? i've installed Apache using docker a week ago and I don't have "enable drill-down" checkbox.

@ajaykumarparashar11
Copy link

@EvilDrW is this code available in the latest master branch? if yes then how can i enable this, if not then can you please guide me to implement this in the current latest master branch, so that i can use this feature for now?

@namalashivacharan123
Copy link

@EvilDrW is this code available in the latest master branch? if yes then how can i enable this, if not then can you please guide me to implement this in the current latest master branch, so that i can use this feature for now?

@EvilDrW is this code available in the latest master branch? if yes then how can i enable this, if not then can you please guide me to implement this in the current latest master branch, so that i can use this feature for now?

Did you find any answer..?

marlomorales added a commit to SplitDragon/superset that referenced this pull request Mar 24, 2023
@sundar68
Copy link

Does anyone tried this drilldown on table chart. If yes, Can you please explain me.

@rusackas
Copy link
Member

Drill By (flexible exploration) is Superset's preferred solution over Drill Down (strict hierarchy). It's available in Preset and OSS Superset: https://preset.io/blog/drill-by/

@sundar68
Copy link

@EvilDrW
Can you please help me on how to update dashboard native filters from inside the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet