endimonan opened a new pull request, #44794: URL: https://github.com/apache/superset/pull/44794
### SUMMARY Cartodiagram creates a separate color scale for each Pie chart, so different categories at different map locations reuse colors in Explore. Share one scale per Cartodiagram transformation through the optional `ChartProps.colorScale` property. Repeated categories keep their color across locations. Scoped to Explore with Pie charts. Existing Dashboard color mapping and standalone Pie behavior are preserved. Related to #33900; #39760 contains a separate Dashboard-oriented workaround. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF | Before: four categories, two colors | After: four categories, four colors | | --- | --- | |  |  | The captures also show pre-existing Pie clipping and absent basemap tiles. [Reproduction data and color comparison](https://github.com/endimonan/superset/blob/6e57ff255ea110d5b6528e89fcb3a1979f83d739/README.md). ### TESTING INSTRUCTIONS 1. Create the two-location dataset from #33900 and save a Pie chart grouped by `cat`, with `SUM(foo)` and its legend enabled. 2. Create a Cartodiagram using that Pie chart and `geom` as the geometry column. In Explore, verify four distinct legend colors. 3. Repeat a category at both locations and verify its color matches. Change and save the Pie palette, reselect the updated Pie in Cartodiagram, and verify the map uses it. Validated: 168 tests across 17 suites; pre-commit, including targeted TypeScript; browser reproduction with HTTP 200 and no JavaScript errors. Full `npm run type` could not complete because generated declaration files are missing locally. ### ADDITIONAL INFORMATION - [x] Has associated issue: #33900 - [ ] Required feature flags - [x] Changes UI - [ ] Includes DB Migration - [x] Introduces new feature or API: optional `ChartProps.colorScale` - [ ] Removes existing feature or API -- 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]
