rusackas opened a new pull request, #41490: URL: https://github.com/apache/superset/pull/41490
### SUMMARY Fixes #20459. When a deck.gl scatterplot configured with a categorical point color is added to a deck.gl **Multiple Layers** chart, the points all rendered in the default/fallback color even though the legend still showed the configured categorical palette. So the legend and the map disagreed. Root cause: a standalone scatterplot (and path/arc) chart resolves its per-feature colors inside `CategoricalDeckGLContainer` (its `addColor` step), which maps each `cat_color` through the categorical color scale before handing the data to the layer. The Multiple Layers chart, however, builds its sublayers by calling the raw `getLayer` functions directly in `Multi.tsx` (`createLayerFromData`), bypassing that container entirely. Without the color resolution step, the scatter `getLayer` just falls back to the fixed `color_picker` color, so the categorical colors were dropped. The fix extracts the color-resolution logic into a small shared util, `addColorToFeatures`, and: - reuses it inside `CategoricalDeckGLContainer` (no behavior change there, just de-duplication), and - applies it to color-aware sublayers (`deck_scatter`, `deck_path`, `deck_arc`) in the Multiple Layers chart before the layer is built, so the configured categorical/fixed/breakpoint colors are preserved. Non color-aware layers and layers without a `color_scheme_type` are left untouched, so this is scoped to the layers that actually consume per-feature colors. ### TESTING INSTRUCTIONS 1. Create a deck.gl Scatterplot chart and set Point Color to a Categorical color over some dimension. Save it. 2. Create a deck.gl Multiple Layers chart and add the scatterplot above. 3. Run it: the points on the map now match the categorical colors shown in the legend (previously they all rendered in the default color). Automated, test-first: - `Multi.color.test.tsx` pins the bug — it asserts two points with different categories get different resolved colors in the Multiple Layers chart. It fails on `master` (both points come back `[0,0,0,255]`) and passes with this change. - `addColor.test.ts` covers the extracted util (categorical/fixed/fallback/unknown-scheme cases). ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #20459 - [x] Changes UI -- 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]
