* Resolves ThemeConfig from options, handling both string presets and custom configs.
()
| 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. |
no outgoing calls
no test coverage detected