dosubot[bot] commented on issue #33900: URL: https://github.com/apache/superset/issues/33900#issuecomment-3004036775
<!-- Greeting --> Hi @jansule! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> Thanks for sharing the SQL snippet—this dataset is well-suited for reproducing the color collision issue in the cartodiagram plugin. Based on the current architecture, color assignment for labels in Superset depends on context: in dashboards, a shared color map (via LabelsColorMapSingleton) ensures consistent colors across charts, but in explore view or when embedding a single chart, each chart gets its own color map. This can lead to the same color being assigned to different labels, or a label getting different colors, as you observed. The cartodiagram plugin itself does not manage color state across its subcharts; it relies on the core color system, so color consistency is only guaranteed in dashboard context, not in explore or single chart views. Any fix would require either enhancing the plugin to coordinate color state or changes in the core color context handling for embedded charts. More details on the color mapping logic can be found in the implementation of [LabelsColorMapSingleton](https://github.com/apache/superset/blob/6876a1e6843cd1f28f4206ca2dd75342dfddcf26/superset-frontend/packages/superset-ui- core/src/color/LabelsColorMapSingleton.ts) and [CategoricalColorScale](https://github.com/apache/superset/blob/6876a1e6843cd1f28f4206ca2dd75342dfddcf26/superset-frontend/packages/superset-ui-core/src/color/CategoricalColorScale.ts). There are similar color consistency issues reported in other chart types, and this is a known architectural limitation at the moment. If you need to ensure unique colors across all subcharts in non-dashboard contexts, it would likely require a custom solution or plugin enhancement. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e95c195d-bf36-4596-8836-310f4ef062e4?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [! [Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/33900) -- 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]
