feat(legend): add checkbox to display or not ALL/INV button
SUMMARY
This PR introduces a new feature that allows users to toggle the visibility of the All/Invert buttons in the legend for ECharts-based visualizations.
Previously, these buttons were always displayed, but now users can enable or disable them through a new checkbox in the Chart Options panel.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
- Open Superset and create or edit a chart that uses ECharts.
- Navigate to the Chart Options panel.
- Locate the new Show All/Invert buttons in legend checkbox.
- Toggle the checkbox and observe whether the All/Invert buttons appear or disappear in the legend.
- Ensure that the feature works consistently across different charts that use ECharts.
- Check the browser console (
F12 > Console) for any unexpected errors related to legend rendering.
✅ Expected Outcome:
- When the checkbox is enabled, the All/Invert buttons should be visible in the legend.
- When the checkbox is disabled, the buttons should disappear while keeping the rest of the legend intact.
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] 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
@rusackas Processing your ephemeral environment request here. Action: up.
Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files
@rusackas Ephemeral environment spinning up at http://52.13.110.49:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
rusackas
@rusackas Thanks for your feedback, comments translated :P and thanks for pre-commit tips!
@rusackas HI, do you have any idea why there is error like this in jobs review (sharded-jest-tests(6)) please? FAIL src/features/databases/UploadDataModel/UploadDataModal.test.tsx (123.777 s)
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 80.85%. Comparing base (
76d897e) to head (20e8ed3). Report is 1955 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #32346 +/- ##
===========================================
+ Coverage 60.48% 80.85% +20.36%
===========================================
Files 1931 559 -1372
Lines 76236 49811 -26425
Branches 8568 4223 -4345
===========================================
- Hits 46114 40274 -5840
+ Misses 28017 9170 -18847
+ Partials 2105 367 -1738
| Flag | Coverage Δ | |
|---|---|---|
| hive | 47.86% <ø> (-1.30%) |
:arrow_down: |
| javascript | ? |
|
| mysql | 74.77% <ø> (?) |
|
| postgres | 74.80% <ø> (?) |
|
| presto | 52.59% <ø> (-1.22%) |
:arrow_down: |
| python | 80.83% <ø> (+17.33%) |
:arrow_up: |
| sqlite | 74.33% <ø> (?) |
|
| unit | 61.49% <ø> (+3.85%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Closing/reopening to kick-start CI again, and see where this gets stuck. Some tests used to be failing, so if we can't clear them from the CI side here, a rebase might resolve some. Let's see!
@rusackas Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments
@rusackas Ephemeral environment spinning up at http://54.149.249.109:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
Hmm... not sure why I'm not seeing the button on the ephemeral environment. Not sure whether that's due to the PR or the ephemeral build having issues, or me missing the mark 😅
@ERGO1995 can you check the ephemeral environment above and see if I'm taking crazy pills?
@ERGO1995 can you check the ephemeral environment above and see if I'm taking crazy pills?
No, you didn’t take any weird pills haha. Actually, I only made the change for the 'Histogram' chart type. But if it looks good for that one, I’ll start working on the others now :)! Because in the ephemeral environment, I do see the button for a histogram.
@rusackas Alright, i updated chart type that used "import { legendSection, showValueControl } from '../controls';" code. And only for echart type. I also noticed that for the BoxPlot type, we don’t handle any legend at all, even though we can display multiple metrics simultaneously. Is that normal or is it a bug?
Thanks fort the clarity on the histogram-only support. Supporting the other ECharts timeseries is a big win for consistency, for sure. Looks like a rebase is needed to resolve some conflicts (probably due to the giant Theming branch) but once those are cleared, I'll re-test and merge if it looks good! Thanks for continuing to help here.
Thanks fort the clarity on the histogram-only support. Supporting the other ECharts timeseries is a big win for consistency, for sure. Looks like a rebase is needed to resolve some conflicts (probably due to the giant Theming branch) but once those are cleared, I'll re-test and merge if it looks good! Thanks for continuing to help here.
Rebase done :)
Looks like we're getting closer, but pre-commit needs to be run.
Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files