-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Open
Labels
design:proposalDesign proposalsDesign proposalssipSuperset Improvement ProposalSuperset Improvement Proposalviz:charts:treemapRelated to the Treemap chartRelated to the Treemap chart
Description
[SIP] Add Palette Type Control to Treemap Chart
Motivation
Currently, Treemap charts in Superset always rely on categorical palettes.
There is no support for automatically switching to sequential palettes when metric values vary, and users have no explicit way to choose between sequential and categorical palettes.
This SIP proposes to improve the user experience by:
- Introducing automatic palette logic (via PR #36847, pending review).
- Exposing a new form control so users can override the behavior and explicitly select their preferred palette type.
Proposed Change
Add a new form control in Treemap chart settings:
- Palette Type (SelectControl)
- Options:
auto(default),sequential,categorical. - Default:
auto(preserves current behavior once PR fix(treemap): restore sequential coloring + remove label box, 1px gap (fixes #36807) #36847 is merged)
- Options:
Implementation details:
- Add control in
controlPanel.ts. - Update
transformProps.tsto respectformData.paletteType. - Extend Jest tests in
transformProps.test.tsto cover all three modes. - Default remains
autoto avoid breaking existing dashboards.
Screenshots/mocks:
- Dropdown in chart settings showing palette type options.
- Example Treemap with sequential palette vs categorical palette.
New or Changed Public Interfaces
- Chart Controls: New
paletteTypeoption in Treemap chart control panel. - Visualization Behavior: Treemap rendering logic updated to respect user choice.
- No changes to REST endpoints, CLI, or deployment.
New dependencies
- None. Uses existing
getSequentialSchemeRegistryandgetCategoricalSchemeRegistryutilities already in Superset.
Migration Plan and Compatibility
- No database migrations required.
- Default remains
auto, so existing dashboards continue to render identically. - Users can opt into sequential/categorical explicitly if desired.
Documentation
- Update Superset user documentation to include the new Palette Type option in Treemap chart settings.
- Add screenshots showing how to select sequential vs categorical palettes.
- Clarify that
autois the default and preserves existing behavior. - Update the Charts → Treemap section in Superset docs to reflect this new control.
Rejected Alternatives
- Keep only auto logic: Would improve defaults but still leave users without control.
- Expose only sequential palettes: Too restrictive; categorical palettes are still useful for discrete metrics.
- Custom palette editor: Out of scope for this SIP; more complex and requires separate discussion.
Metadata
Metadata
Assignees
Labels
design:proposalDesign proposalsDesign proposalssipSuperset Improvement ProposalSuperset Improvement Proposalviz:charts:treemapRelated to the Treemap chartRelated to the Treemap chart