Skip to content

feat(extensions): expose Superset categorical color schemes to extensions#39226

Draft
rusackas wants to merge 1 commit intomasterfrom
feat/extension-color-scheme-api
Draft

feat(extensions): expose Superset categorical color schemes to extensions#39226
rusackas wants to merge 1 commit intomasterfrom
feat/extension-color-scheme-api

Conversation

@rusackas
Copy link
Copy Markdown
Member

@rusackas rusackas commented Apr 9, 2026

Summary

  • Adds a colors module to @apache-superset/core exposing the host app's registered categorical color palettes to extensions
  • ExtensionsStartup injects the live CategoricalSchemeRegistry singleton at startup via registerCategoricalSchemeRegistry()
  • Extensions call colors.getCategoricalSchemeNames() / colors.getSchemeColors(name) through the federated module — same singleton, so all palettes registered by the host (Superset defaults, custom themes) are visible

This is a prerequisite for the Notebook extension's Mermaid palette selector, which lets users pick any Superset color scheme to drive Mermaid pie/diagram fills instead of a hardcoded fallback palette.

Note: This PR is intended to merge after #39171 (Tier 1+2 storage) lands, since both touch ExtensionsStartup.tsx and superset-core/src/index.ts.

Before/After

Before: Extensions had no way to access Superset's color palettes; the notebook extension used a hardcoded 8-color AntD palette for Mermaid diagrams.

After: Extensions can enumerate and read any registered Superset categorical color scheme. The Notebook extension shows a palette selector in the Mermaid cell header.

Test plan

  • superset-core builds cleanly (npm run build in packages/superset-core)
  • Pre-commit passes on changed files
  • colors.getCategoricalSchemeNames() returns an array of scheme names from within an extension
  • colors.getSchemeColors('supersetColors') returns the expected hex array

🤖 Generated with Claude Code

…ions

Add a `colors` module to superset-core that lets extensions read
Superset's registered categorical color palettes without taking a
direct dependency on @superset-ui/core.

Pattern: ExtensionsStartup injects the live CategoricalSchemeRegistry
singleton into superset-core at startup via
`registerCategoricalSchemeRegistry()`. Extensions then call
`colors.getCategoricalSchemeNames()` / `colors.getSchemeColors(name)`
through the federated `@apache-superset/core` module — the same
singleton, so palettes registered by the host are visible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 9, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 477c06d
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69d7df2b5db8ad0007e44d55
😎 Deploy Preview https://deploy-preview-39226--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants