hassaansaleem28 opened a new issue, #36848: URL: https://github.com/apache/superset/issues/36848
## [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: 1. Introducing automatic palette logic (via PR [#36847](https://github.com/apache/superset/pull/36847), pending review). 2. 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 #36847 is merged) Implementation details: - Add control in `controlPanel.ts`. - Update `transformProps.ts` to respect `formData.paletteType`. - Extend Jest tests in `transformProps.test.ts` to cover all three modes. - Default remains `auto` to 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 `paletteType` option 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 `getSequentialSchemeRegistry` and `getCategoricalSchemeRegistry` utilities 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 `auto` is 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. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
