Skip to content

feat(dashboard): chart customization/dynamic group by in dashboards#33831

Merged
geido merged 149 commits into
apache:masterfrom
LevisNgigi:group-by
Oct 14, 2025
Merged

feat(dashboard): chart customization/dynamic group by in dashboards#33831
geido merged 149 commits into
apache:masterfrom
LevisNgigi:group-by

Conversation

@LevisNgigi
Copy link
Copy Markdown
Contributor

@LevisNgigi LevisNgigi commented Jun 19, 2025

feat(dashboard): chart customization/dynamic group by in dashboards

SUMMARY

This PR introduces dashboard-level group by customization, allowing dashboard viewers to dynamically change how charts group data (e.g., by country, region, funder, etc.) directly from the dashboard, without editing the chart itself.

Key functionality:

Adds a Group By customization modal, similar to the existing native filters modal, where authors can configure one or more "group by" controls.

Supports selecting a dataset to group charts by.

Includes toggles for default values, required selection, and multi-select mode.

When configured, the selected group by values are injected into the chart’s form data, replacing the original groupby field.

Group by selections are broadcast to charts with matching datasets/columns, enabling dynamic drill-down or slice-and-dice capabilities.

Group By controls appear in the filter bar alongside native filters and behave similarly with filter cards and popovers.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

2025-07-29.16-07-52.mp4

TESTING INSTRUCTIONS

Open any dashboard and click the "Chart customization" option in the filter bar settings icon.
In the Chart Customization modal, fill in name:
Select a dataset.
you can save at this point
Optionally toggle:

Default value – pick a value that will be pre-applied.
Required – ensures a value must be selected to render charts.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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
  • [ x ] Introduces new feature or API
  • Removes existing feature or API

FEATURE_AG_GRID_TABLE_ENABLED=true
FEATURE_CHART_PLUGINS_EXPERIMENTAL=true

@korbit-ai
Copy link
Copy Markdown

korbit-ai Bot commented Jun 19, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.01%. Comparing base (96170e4) to head (615b1dd).
⚠️ Report is 68 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #33831       +/-   ##
===========================================
+ Coverage        0   72.01%   +72.01%     
===========================================
  Files           0      592      +592     
  Lines           0    43900    +43900     
  Branches        0     4719     +4719     
===========================================
+ Hits            0    31613    +31613     
- Misses          0    11048    +11048     
- Partials        0     1239     +1239     
Flag Coverage Δ
hive 46.27% <100.00%> (?)
mysql 70.89% <100.00%> (?)
postgres 70.94% <100.00%> (?)
presto 49.97% <100.00%> (?)
python 71.82% <100.00%> (?)
sqlite 70.54% <100.00%> (?)
unit 100.00% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread superset-frontend/src/dashboard/actions/dashboardInfo.ts Outdated
Comment thread superset-frontend/src/dashboard/actions/dashboardInfo.ts Outdated
Comment thread superset-frontend/src/dashboard/components/GroupByBadge/index.tsx Outdated
@LevisNgigi LevisNgigi marked this pull request as ready for review July 3, 2025 20:56
@korbit-ai
Copy link
Copy Markdown

korbit-ai Bot commented Jul 3, 2025

Korbit doesn't automatically review large (3000+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@dosubot dosubot Bot added change:frontend Requires changing the frontend dashboard:native-filters Related to the native filters of the Dashboard labels Jul 3, 2025
@mistercrunch
Copy link
Copy Markdown
Member

Curious whether we have designs upfront for this or whether we can get screenshots. Seems dashboard "Filters" might need to become "Interactivity" or "Filters & Interactive Controls" or something broader than just filters. Curious on how we restructure the Filter-focussed elements ...

Also thinking forward about integrating a similar "Metric-picker" interactive component that broadcast metric selection to multiple charts. Let's make sure the abstractions here will nicely support the metric picker and other future dashboard interactivity controls.

@LevisNgigi LevisNgigi closed this Jul 7, 2025
@LevisNgigi LevisNgigi reopened this Jul 7, 2025
@geido
Copy link
Copy Markdown
Member

geido commented Jul 7, 2025

Curious whether we have designs upfront for this or whether we can get screenshots. Seems dashboard "Filters" might need to become "Interactivity" or "Filters & Interactive Controls" or something broader than just filters. Curious on how we restructure the Filter-focussed elements ...

Also thinking forward about integrating a similar "Metric-picker" interactive component that broadcast metric selection to multiple charts. Let's make sure the abstractions here will nicely support the metric picker and other future dashboard interactivity controls.

cc @kasiazjc

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 7, 2025

@geido Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@LevisNgigi
Copy link
Copy Markdown
Contributor Author

Curious whether we have designs upfront for this or whether we can get screenshots. Seems dashboard "Filters" might need to become "Interactivity" or "Filters & Interactive Controls" or something broader than just filters. Curious on how we restructure the Filter-focussed elements ...

Also thinking forward about integrating a similar "Metric-picker" interactive component that broadcast metric selection to multiple charts. Let's make sure the abstractions here will nicely support the metric picker and other future dashboard interactivity controls.

yes we do have designs for this, will also be adding screenshots/video to the pr description.Designs are as as below:
gorup_by2
group_by

@mistercrunch
Copy link
Copy Markdown
Member

Oh I see the modal title is "Chart customization in dashboard". Not sure if it's the best name. @kasiazjc @yousoph what do you think of "Dashboard interactivity controls" (?) or "Dashboard Filters and interactive controls".

We need new naming / titles that include things beyond filters, but I'm guessing that 99%+ of the time it'll be used for dashboard filters so it may be good to keep "filter" in the naming.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 9, 2025

@geido Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 6, 2025

🎪 Showtime is building environment on GHA for e051fca

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 6, 2025

🎪 Showtime deployed environment on GHA for e051fca

Environment: http://35.88.172.118:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 9, 2025

🎪 Showtime is building environment on GHA for e051fca

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 9, 2025

🎪 Showtime deployed environment on GHA for e051fca

Environment: http://35.92.151.100:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

Comment thread superset-frontend/src/dashboard/components/GroupByBadge/index.tsx Outdated
Comment thread superset-extensions-cli/pyproject.toml Outdated
Comment thread superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx Outdated
Copy link
Copy Markdown
Member

@kgabryje kgabryje left a comment

Choose a reason for hiding this comment

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

I left a few non blocking comments, stamping as code owner

Copy link
Copy Markdown
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

Stamping to unblock merge. This PR has passed internal QA review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend dashboard:native-filters Related to the native filters of the Dashboard packages size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.