Function: withDataviz()
withDataviz(
bundle):ThemeBundle
Defined in: dataviz/withDataviz.ts:28
Extend a ThemeBundle with the dataviz token layer.
Applies core.dataviz (encoding primitives) and semantic.dataviz on top
of the bundle's base theme. Semantic color mappings reference core.colors.*
from the base theme, so brand-aligned dataviz palettes are automatic.
The dark-mode alternate (if any) is preserved as-is.
Parameters
| Parameter | Type | Description |
|---|---|---|
bundle | ThemeBundle | Bundle to extend (return value of createTheme). |
Returns
A new ThemeBundle with dataviz tokens included.
Example
import { createTheme } from '@ttoss/theme2';
import { withDataviz } from '@ttoss/theme2/dataviz';
export const myTheme = withDataviz(createTheme({
overrides: { core: { colors: { brand: { 500: '#FF0000' } } } },
}));