MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / resolveThemeConfig

Method resolveThemeConfig

src/worker/ChartGPUWorkerProxy.ts:988–1020  ·  view source on GitHub ↗

* Resolves ThemeConfig from options, handling both string presets and custom configs.

()

Source from the content-addressed store, hash-verified

986 * Resolves ThemeConfig from options, handling both string presets and custom configs.
987 */
988 private resolveThemeConfig(): ThemeConfig {
989 const theme = this.cachedOptions.theme;
990
991 // Default theme values
992 const defaults: ThemeConfig = {
993 colorPalette: [],
994 backgroundColor: '#1a1a2e',
995 textColor: '#e0e0e0',
996 axisLineColor: 'rgba(224,224,224,0.2)',
997 axisTickColor: 'rgba(224,224,224,0.4)',
998 gridLineColor: 'rgba(224,224,224,0.1)',
999 fontFamily: 'system-ui, -apple-system, sans-serif',
1000 fontSize: 12,
1001 };
1002
1003 if (!theme || typeof theme === 'string') {
1004 // Theme is either undefined or a string preset ('dark' | 'light')
1005 // For now, just use defaults
1006 return defaults;
1007 }
1008
1009 // Theme is a custom ThemeConfig object - merge with defaults
1010 return {
1011 colorPalette: theme.colorPalette ?? defaults.colorPalette,
1012 backgroundColor: theme.backgroundColor ?? defaults.backgroundColor,
1013 textColor: theme.textColor ?? defaults.textColor,
1014 axisLineColor: theme.axisLineColor ?? defaults.axisLineColor,
1015 axisTickColor: theme.axisTickColor ?? defaults.axisTickColor,
1016 gridLineColor: theme.gridLineColor ?? defaults.gridLineColor,
1017 fontFamily: theme.fontFamily ?? defaults.fontFamily,
1018 fontSize: theme.fontSize ?? defaults.fontSize,
1019 };
1020 }
1021
1022 /**
1023 * Disposes all DOM overlays and cleans up RAF batching.

Callers 2

createOverlaysMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected