@visactor/vseed 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,6 +50,8 @@ export type TokenThemeDefinition = {
50
50
  annotationTextColor?: string;
51
51
  annotationTextBackgroundColor?: string;
52
52
  annotationTextBackgroundOpacity?: number;
53
+ annotationAreaColor?: string;
54
+ annotationAreaColorOpacity?: number;
53
55
  };
54
56
  export type TokenThemeRegistry = Record<string, TokenThemeDefinition>;
55
57
  export type RegisterTokenThemeOptions = {
@@ -191,6 +191,8 @@ const getAnnotationPatch = (tokens)=>{
191
191
  },
192
192
  annotationArea: {
193
193
  textFontSize: tokens.labelFontSize,
194
+ areaColor: tokens.annotationAreaColor,
195
+ areaColorOpacity: tokens.annotationAreaColorOpacity,
194
196
  ...annotationTextPatch
195
197
  }
196
198
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theme/tokenTheme.js","sources":["../../../src/theme/tokenTheme.ts"],"sourcesContent":["import tinycolor from 'tinycolor2'\nimport type { Config, CustomThemeConfig } from 'src/types'\nimport { registerAll } from '../builder/register/all'\nimport { registerCustomTheme } from '../builder/register/theme'\nimport { darkTheme } from './dark'\nimport { lightTheme } from './light'\n\nexport type TokenThemeBase = 'light' | 'dark'\n\nexport type TokenThemeDefinition = {\n baseTheme: TokenThemeBase\n fontFamily?: string\n tableHeaderFontSize?: number\n tableBodyFontSize?: number\n labelFontSize?: number\n tooltipFontSize?: number\n axisFontSize?: number\n legendFontSize?: number\n playerFontSize?: number\n colorScheme: [string, string, ...string[]]\n linearColorScheme: [string, string]\n textPrimary: string\n textSecondary: string\n borderColor: string\n surfaceColor?: string\n surfaceBackgroundColor?: string\n accentColor?: string\n positiveColor?: string\n negativeColor?: string\n tooltipBackgroundColor: string\n tooltipBorderColor?: string\n axisLabelColor?: string\n axisTitleColor?: string\n axisGridColor?: string\n axisLineColor?: string\n labelColor?: string\n labelStroke?: string\n legendLabelColor?: string\n legendPagerIconColor?: string\n legendPagerIconDisableColor?: string\n playerRailColor?: string\n playerSliderHandleColor?: string\n playerSliderHandleBorderColor?: string\n tableBorderColor?: string\n tableBodyFontColor?: string\n tableHeaderFontColor?: string\n tableHeaderBackgroundColor?: string\n tableHoverBodyBackgroundColor?: string\n tableHoverBodyInlineBackgroundColor?: string\n tableHoverHeaderBackgroundColor?: string\n tableHoverHeaderInlineBackgroundColor?: string\n tableSelectedBorderColor?: string\n tableSelectedBackgroundColor?: string\n annotationLineColor?: string\n annotationLineStyle?: 'solid' | 'dashed' | 'dotted'\n annotationLineDash?: number[]\n annotationTextColor?: string\n annotationTextBackgroundColor?: string\n annotationTextBackgroundOpacity?: number\n}\n\nexport type TokenThemeRegistry = Record<string, TokenThemeDefinition>\n\nexport type RegisterTokenThemeOptions = {\n ensureRegisterAll?: boolean\n}\n\ntype ThemeConfigMap = NonNullable<CustomThemeConfig['config']>\ntype ThemeConfigKey = keyof ThemeConfigMap\n\nconst raceChartTypes: ThemeConfigKey[] = ['raceBar', 'raceColumn', 'raceScatter', 'raceLine', 'racePie', 'raceDonut']\n\nlet hasEnsuredRegisterAll = false\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nconst mergeThemeNode = <T>(base: T, patch: Partial<T>): T => {\n if (!isRecord(base) || !isRecord(patch)) {\n return patch as T\n }\n\n const result: Record<string, unknown> = { ...base }\n for (const [key, patchValue] of Object.entries(patch)) {\n if (patchValue === undefined) {\n continue\n }\n\n const currentValue = result[key]\n if (Array.isArray(patchValue)) {\n result[key] = [...patchValue]\n continue\n }\n\n if (isRecord(currentValue) && isRecord(patchValue)) {\n result[key] = mergeThemeNode(currentValue, patchValue)\n continue\n }\n\n result[key] = patchValue\n }\n\n return result as T\n}\n\nconst withAlpha = (color: string, alpha: number) => tinycolor(color).setAlpha(alpha).toRgbString()\n\nconst ensureRegisterAll = (options?: RegisterTokenThemeOptions) => {\n if (options?.ensureRegisterAll === false || hasEnsuredRegisterAll) {\n return\n }\n\n registerAll()\n hasEnsuredRegisterAll = true\n}\n\nconst getAccentColor = (tokens: TokenThemeDefinition) => tokens.accentColor || tokens.colorScheme[0]\n\nconst getAxisPatch = (tokens: TokenThemeDefinition) => ({\n label: {\n labelColor: tokens.axisLabelColor || tokens.textSecondary,\n labelFontSize: tokens.axisFontSize,\n },\n title: {\n titleColor: tokens.axisTitleColor || tokens.textSecondary,\n titleFontSize: tokens.axisFontSize,\n },\n grid: {\n gridColor: tokens.axisGridColor || tokens.borderColor,\n },\n tick: {\n tickColor: tokens.axisLineColor || tokens.borderColor,\n },\n line: {\n lineColor: tokens.axisLineColor || tokens.borderColor,\n },\n})\n\nconst getPivotGridPatch = (tokens: TokenThemeDefinition) => ({\n borderColor: tokens.tableBorderColor || tokens.borderColor,\n bodyFontSize: tokens.tableBodyFontSize,\n bodyFontColor: tokens.tableBodyFontColor || tokens.textPrimary,\n headerFontSize: tokens.tableHeaderFontSize,\n headerFontColor: tokens.tableHeaderFontColor || tokens.textPrimary,\n headerBackgroundColor: tokens.tableHeaderBackgroundColor || tokens.surfaceColor || 'transparent',\n hoverHeaderBackgroundColor: tokens.tableHoverHeaderBackgroundColor || withAlpha(getAccentColor(tokens), 0.18),\n hoverHeaderInlineBackgroundColor:\n tokens.tableHoverHeaderInlineBackgroundColor || withAlpha(getAccentColor(tokens), 0.08),\n titleFontColor: tokens.textPrimary,\n titleFontSize: tokens.tableHeaderFontSize,\n chartGridColor: tokens.axisGridColor || tokens.borderColor,\n axisLabelColor: tokens.axisLabelColor || tokens.textSecondary,\n axisLabelFontSize: tokens.axisFontSize,\n})\n\nconst getPlayerPatch = (tokens: TokenThemeDefinition) => {\n const accentColor = getAccentColor(tokens)\n\n return {\n fontFamily: tokens.fontFamily,\n fontSize: tokens.playerFontSize,\n railColor: tokens.playerRailColor || tokens.borderColor,\n trackColor: accentColor,\n sliderHandleColor: tokens.playerSliderHandleColor || tokens.surfaceColor || '#ffffff',\n sliderHandleBorderColor: tokens.playerSliderHandleBorderColor || accentColor,\n startButtonColor: accentColor,\n pauseButtonColor: accentColor,\n backwardButtonColor: accentColor,\n forwardButtonColor: accentColor,\n }\n}\n\nconst getTablePatch = (tokens: TokenThemeDefinition) => {\n const accentColor = getAccentColor(tokens)\n\n return {\n borderColor: tokens.tableBorderColor || tokens.borderColor,\n bodyFontSize: tokens.tableBodyFontSize,\n bodyFontFamily: tokens.fontFamily,\n bodyFontColor: tokens.tableBodyFontColor || tokens.textPrimary,\n headerFontSize: tokens.tableHeaderFontSize,\n headerFontFamily: tokens.fontFamily,\n headerFontColor: tokens.tableHeaderFontColor || tokens.textPrimary,\n headerBackgroundColor: tokens.tableHeaderBackgroundColor || tokens.surfaceColor || 'transparent',\n hoverBodyBackgroundColor: tokens.tableHoverBodyBackgroundColor || withAlpha(accentColor, 0.18),\n hoverBodyInlineBackgroundColor: tokens.tableHoverBodyInlineBackgroundColor || withAlpha(accentColor, 0.08),\n hoverHeaderBackgroundColor: tokens.tableHoverHeaderBackgroundColor || withAlpha(accentColor, 0.18),\n hoverHeaderInlineBackgroundColor: tokens.tableHoverHeaderInlineBackgroundColor || withAlpha(accentColor, 0.08),\n selectedBorderColor: tokens.tableSelectedBorderColor || accentColor,\n selectedBackgroundColor: tokens.tableSelectedBackgroundColor || withAlpha(accentColor, 0.12),\n backgroundColor: tokens.surfaceBackgroundColor || 'transparent',\n barAxisColor: tokens.axisLineColor || tokens.borderColor,\n backgroundColorScale: {\n minColor: tokens.linearColorScheme[0],\n maxColor: tokens.linearColorScheme[1],\n },\n }\n}\n\nconst getChartPatch = (tokens: TokenThemeDefinition) => ({\n backgroundColor: 'transparent',\n fontFamily: tokens.fontFamily,\n color: {\n colorScheme: [...tokens.colorScheme],\n linearColorScheme: [...tokens.linearColorScheme],\n positiveColor: tokens.positiveColor,\n negativeColor: tokens.negativeColor,\n },\n label: {\n labelFontSize: tokens.labelFontSize,\n labelColor: tokens.labelColor || tokens.textPrimary,\n labelStroke: tokens.labelStroke,\n },\n legend: {\n labelColor: tokens.legendLabelColor || tokens.textSecondary,\n labelFontSize: tokens.legendFontSize,\n pagerIconColor: tokens.legendPagerIconColor || tokens.textSecondary,\n pagerIconDisableColor: tokens.legendPagerIconDisableColor || tokens.borderColor,\n },\n tooltip: {\n backgroundColor: tokens.tooltipBackgroundColor,\n borderColor: tokens.tooltipBorderColor || tokens.borderColor,\n fontSize: tokens.tooltipFontSize,\n keyColor: tokens.textSecondary,\n valueColor: tokens.textPrimary,\n titleColor: tokens.textPrimary,\n },\n})\n\nconst getAnnotationLinePatch = (tokens: TokenThemeDefinition) => ({\n lineColor: tokens.annotationLineColor,\n lineStyle: tokens.annotationLineStyle,\n lineDash: tokens.annotationLineDash,\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundBorderColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n})\n\nconst getAnnotationTextPatch = (tokens: TokenThemeDefinition) => ({\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundBorderColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n})\n\nconst getAnnotationPatch = (tokens: TokenThemeDefinition) => {\n const annotationLinePatch = getAnnotationLinePatch(tokens)\n const annotationTextPatch = getAnnotationTextPatch(tokens)\n\n return {\n annotationPoint: {\n textFontSize: tokens.labelFontSize,\n ...annotationTextPatch,\n },\n annotationHorizontalLine: {\n textFontSize: tokens.labelFontSize,\n ...annotationLinePatch,\n },\n annotationVerticalLine: {\n textFontSize: tokens.labelFontSize,\n ...annotationLinePatch,\n },\n annotationDifferenceLine: {\n textFontSize: tokens.labelFontSize,\n lineColor: tokens.annotationLineColor,\n lineStyle: tokens.annotationLineStyle,\n lineDash: tokens.annotationLineDash,\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n },\n annotationArea: {\n textFontSize: tokens.labelFontSize,\n ...annotationTextPatch,\n },\n }\n}\n\nconst getRegressionLinePatch = (tokens: TokenThemeDefinition) => ({\n kdeRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n ecdfRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n linearRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n lowessRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n polynomialRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n logisticRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n})\n\nconst withAxesAndExtras = (\n chartType: ThemeConfigKey,\n chartConfig: NonNullable<ThemeConfigMap[ThemeConfigKey]>,\n tokens: TokenThemeDefinition,\n) => {\n let nextChartConfig = mergeThemeNode(chartConfig, getChartPatch(tokens))\n const chartRecord = nextChartConfig as Record<string, unknown>\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'xAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { xAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'yAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { yAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'primaryYAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { primaryYAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'secondaryYAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { secondaryYAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'pivotGrid')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { pivotGrid: getPivotGridPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'annotation')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { annotation: getAnnotationPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'regressionLine')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { regressionLine: getRegressionLinePatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (raceChartTypes.includes(chartType) && Object.prototype.hasOwnProperty.call(chartRecord, 'player')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { player: getPlayerPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n return nextChartConfig\n}\n\nexport const createTokenThemeConfig = (tokens: TokenThemeDefinition): CustomThemeConfig => {\n const baseTheme = tokens.baseTheme === 'dark' ? darkTheme() : lightTheme()\n const baseConfig = (baseTheme.config || {}) as ThemeConfigMap\n const nextConfig = {} as ThemeConfigMap\n\n for (const chartType of Object.keys(baseConfig) as ThemeConfigKey[]) {\n const chartConfig = baseConfig[chartType]\n if (!chartConfig) {\n continue\n }\n\n if (chartType === 'table' || chartType === 'pivotTable') {\n nextConfig[chartType] = mergeThemeNode(chartConfig, getTablePatch(tokens)) as ThemeConfigMap[ThemeConfigKey]\n continue\n }\n\n nextConfig[chartType] = withAxesAndExtras(chartType, chartConfig, tokens) as ThemeConfigMap[ThemeConfigKey]\n }\n\n return {\n config: nextConfig as Config,\n }\n}\n\nexport const registerTokenTheme = (\n themeName: string,\n tokens: TokenThemeDefinition,\n options?: RegisterTokenThemeOptions,\n) => {\n ensureRegisterAll(options)\n registerCustomTheme(themeName, createTokenThemeConfig(tokens))\n}\n\nexport const registerTokenThemes = (themes: TokenThemeRegistry, options?: RegisterTokenThemeOptions) => {\n ensureRegisterAll(options)\n\n for (const [themeName, tokens] of Object.entries(themes)) {\n registerCustomTheme(themeName, createTokenThemeConfig(tokens))\n }\n}\n"],"names":["raceChartTypes","hasEnsuredRegisterAll","isRecord","value","Array","mergeThemeNode","base","patch","result","key","patchValue","Object","undefined","currentValue","withAlpha","color","alpha","tinycolor","ensureRegisterAll","options","registerAll","getAccentColor","tokens","getAxisPatch","getPivotGridPatch","getPlayerPatch","accentColor","getTablePatch","getChartPatch","getAnnotationLinePatch","getAnnotationTextPatch","getAnnotationPatch","annotationLinePatch","annotationTextPatch","getRegressionLinePatch","withAxesAndExtras","chartType","chartConfig","nextChartConfig","chartRecord","createTokenThemeConfig","baseTheme","darkTheme","lightTheme","baseConfig","nextConfig","registerTokenTheme","themeName","registerCustomTheme","registerTokenThemes","themes"],"mappings":";;;;;AAsEA,MAAMA,iBAAmC;IAAC;IAAW;IAAc;IAAe;IAAY;IAAW;CAAY;AAErH,IAAIC,wBAAwB;AAE5B,MAAMC,WAAW,CAACC,QACT,AAAiB,YAAjB,OAAOA,SAAsBA,AAAU,SAAVA,SAAkB,CAACC,MAAM,OAAO,CAACD;AAGvE,MAAME,iBAAiB,CAAIC,MAASC;IAClC,IAAI,CAACL,SAASI,SAAS,CAACJ,SAASK,QAC/B,OAAOA;IAGT,MAAMC,SAAkC;QAAE,GAAGF,IAAI;IAAC;IAClD,KAAK,MAAM,CAACG,KAAKC,WAAW,IAAIC,OAAO,OAAO,CAACJ,OAAQ;QACrD,IAAIG,AAAeE,WAAfF,YACF;QAGF,MAAMG,eAAeL,MAAM,CAACC,IAAI;QAChC,IAAIL,MAAM,OAAO,CAACM,aAAa;YAC7BF,MAAM,CAACC,IAAI,GAAG;mBAAIC;aAAW;YAC7B;QACF;QAEA,IAAIR,SAASW,iBAAiBX,SAASQ,aAAa;YAClDF,MAAM,CAACC,IAAI,GAAGJ,eAAeQ,cAAcH;YAC3C;QACF;QAEAF,MAAM,CAACC,IAAI,GAAGC;IAChB;IAEA,OAAOF;AACT;AAEA,MAAMM,YAAY,CAACC,OAAeC,QAAkBC,WAAUF,OAAO,QAAQ,CAACC,OAAO,WAAW;AA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AD,kBAAkBC;IAClB6B,oBAAoBD,WAAWP,uBAAuBlB;AACxD;AAEO,MAAM2B,sBAAsB,CAACC,QAA4B/B;IAC9DD,kBAAkBC;IAElB,KAAK,MAAM,CAAC4B,WAAWzB,OAAO,IAAIX,OAAO,OAAO,CAACuC,QAC/CF,oBAAoBD,WAAWP,uBAAuBlB;AAE1D"}
1
+ {"version":3,"file":"theme/tokenTheme.js","sources":["../../../src/theme/tokenTheme.ts"],"sourcesContent":["import tinycolor from 'tinycolor2'\nimport type { Config, CustomThemeConfig } from 'src/types'\nimport { registerAll } from '../builder/register/all'\nimport { registerCustomTheme } from '../builder/register/theme'\nimport { darkTheme } from './dark'\nimport { lightTheme } from './light'\n\nexport type TokenThemeBase = 'light' | 'dark'\n\nexport type TokenThemeDefinition = {\n baseTheme: TokenThemeBase\n fontFamily?: string\n tableHeaderFontSize?: number\n tableBodyFontSize?: number\n labelFontSize?: number\n tooltipFontSize?: number\n axisFontSize?: number\n legendFontSize?: number\n playerFontSize?: number\n colorScheme: [string, string, ...string[]]\n linearColorScheme: [string, string]\n textPrimary: string\n textSecondary: string\n borderColor: string\n surfaceColor?: string\n surfaceBackgroundColor?: string\n accentColor?: string\n positiveColor?: string\n negativeColor?: string\n tooltipBackgroundColor: string\n tooltipBorderColor?: string\n axisLabelColor?: string\n axisTitleColor?: string\n axisGridColor?: string\n axisLineColor?: string\n labelColor?: string\n labelStroke?: string\n legendLabelColor?: string\n legendPagerIconColor?: string\n legendPagerIconDisableColor?: string\n playerRailColor?: string\n playerSliderHandleColor?: string\n playerSliderHandleBorderColor?: string\n tableBorderColor?: string\n tableBodyFontColor?: string\n tableHeaderFontColor?: string\n tableHeaderBackgroundColor?: string\n tableHoverBodyBackgroundColor?: string\n tableHoverBodyInlineBackgroundColor?: string\n tableHoverHeaderBackgroundColor?: string\n tableHoverHeaderInlineBackgroundColor?: string\n tableSelectedBorderColor?: string\n tableSelectedBackgroundColor?: string\n annotationLineColor?: string\n annotationLineStyle?: 'solid' | 'dashed' | 'dotted'\n annotationLineDash?: number[]\n annotationTextColor?: string\n annotationTextBackgroundColor?: string\n annotationTextBackgroundOpacity?: number\n annotationAreaColor?: string\n annotationAreaColorOpacity?: number\n}\n\nexport type TokenThemeRegistry = Record<string, TokenThemeDefinition>\n\nexport type RegisterTokenThemeOptions = {\n ensureRegisterAll?: boolean\n}\n\ntype ThemeConfigMap = NonNullable<CustomThemeConfig['config']>\ntype ThemeConfigKey = keyof ThemeConfigMap\n\nconst raceChartTypes: ThemeConfigKey[] = ['raceBar', 'raceColumn', 'raceScatter', 'raceLine', 'racePie', 'raceDonut']\n\nlet hasEnsuredRegisterAll = false\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nconst mergeThemeNode = <T>(base: T, patch: Partial<T>): T => {\n if (!isRecord(base) || !isRecord(patch)) {\n return patch as T\n }\n\n const result: Record<string, unknown> = { ...base }\n for (const [key, patchValue] of Object.entries(patch)) {\n if (patchValue === undefined) {\n continue\n }\n\n const currentValue = result[key]\n if (Array.isArray(patchValue)) {\n result[key] = [...patchValue]\n continue\n }\n\n if (isRecord(currentValue) && isRecord(patchValue)) {\n result[key] = mergeThemeNode(currentValue, patchValue)\n continue\n }\n\n result[key] = patchValue\n }\n\n return result as T\n}\n\nconst withAlpha = (color: string, alpha: number) => tinycolor(color).setAlpha(alpha).toRgbString()\n\nconst ensureRegisterAll = (options?: RegisterTokenThemeOptions) => {\n if (options?.ensureRegisterAll === false || hasEnsuredRegisterAll) {\n return\n }\n\n registerAll()\n hasEnsuredRegisterAll = true\n}\n\nconst getAccentColor = (tokens: TokenThemeDefinition) => tokens.accentColor || tokens.colorScheme[0]\n\nconst getAxisPatch = (tokens: TokenThemeDefinition) => ({\n label: {\n labelColor: tokens.axisLabelColor || tokens.textSecondary,\n labelFontSize: tokens.axisFontSize,\n },\n title: {\n titleColor: tokens.axisTitleColor || tokens.textSecondary,\n titleFontSize: tokens.axisFontSize,\n },\n grid: {\n gridColor: tokens.axisGridColor || tokens.borderColor,\n },\n tick: {\n tickColor: tokens.axisLineColor || tokens.borderColor,\n },\n line: {\n lineColor: tokens.axisLineColor || tokens.borderColor,\n },\n})\n\nconst getPivotGridPatch = (tokens: TokenThemeDefinition) => ({\n borderColor: tokens.tableBorderColor || tokens.borderColor,\n bodyFontSize: tokens.tableBodyFontSize,\n bodyFontColor: tokens.tableBodyFontColor || tokens.textPrimary,\n headerFontSize: tokens.tableHeaderFontSize,\n headerFontColor: tokens.tableHeaderFontColor || tokens.textPrimary,\n headerBackgroundColor: tokens.tableHeaderBackgroundColor || tokens.surfaceColor || 'transparent',\n hoverHeaderBackgroundColor: tokens.tableHoverHeaderBackgroundColor || withAlpha(getAccentColor(tokens), 0.18),\n hoverHeaderInlineBackgroundColor:\n tokens.tableHoverHeaderInlineBackgroundColor || withAlpha(getAccentColor(tokens), 0.08),\n titleFontColor: tokens.textPrimary,\n titleFontSize: tokens.tableHeaderFontSize,\n chartGridColor: tokens.axisGridColor || tokens.borderColor,\n axisLabelColor: tokens.axisLabelColor || tokens.textSecondary,\n axisLabelFontSize: tokens.axisFontSize,\n})\n\nconst getPlayerPatch = (tokens: TokenThemeDefinition) => {\n const accentColor = getAccentColor(tokens)\n\n return {\n fontFamily: tokens.fontFamily,\n fontSize: tokens.playerFontSize,\n railColor: tokens.playerRailColor || tokens.borderColor,\n trackColor: accentColor,\n sliderHandleColor: tokens.playerSliderHandleColor || tokens.surfaceColor || '#ffffff',\n sliderHandleBorderColor: tokens.playerSliderHandleBorderColor || accentColor,\n startButtonColor: accentColor,\n pauseButtonColor: accentColor,\n backwardButtonColor: accentColor,\n forwardButtonColor: accentColor,\n }\n}\n\nconst getTablePatch = (tokens: TokenThemeDefinition) => {\n const accentColor = getAccentColor(tokens)\n\n return {\n borderColor: tokens.tableBorderColor || tokens.borderColor,\n bodyFontSize: tokens.tableBodyFontSize,\n bodyFontFamily: tokens.fontFamily,\n bodyFontColor: tokens.tableBodyFontColor || tokens.textPrimary,\n headerFontSize: tokens.tableHeaderFontSize,\n headerFontFamily: tokens.fontFamily,\n headerFontColor: tokens.tableHeaderFontColor || tokens.textPrimary,\n headerBackgroundColor: tokens.tableHeaderBackgroundColor || tokens.surfaceColor || 'transparent',\n hoverBodyBackgroundColor: tokens.tableHoverBodyBackgroundColor || withAlpha(accentColor, 0.18),\n hoverBodyInlineBackgroundColor: tokens.tableHoverBodyInlineBackgroundColor || withAlpha(accentColor, 0.08),\n hoverHeaderBackgroundColor: tokens.tableHoverHeaderBackgroundColor || withAlpha(accentColor, 0.18),\n hoverHeaderInlineBackgroundColor: tokens.tableHoverHeaderInlineBackgroundColor || withAlpha(accentColor, 0.08),\n selectedBorderColor: tokens.tableSelectedBorderColor || accentColor,\n selectedBackgroundColor: tokens.tableSelectedBackgroundColor || withAlpha(accentColor, 0.12),\n backgroundColor: tokens.surfaceBackgroundColor || 'transparent',\n barAxisColor: tokens.axisLineColor || tokens.borderColor,\n backgroundColorScale: {\n minColor: tokens.linearColorScheme[0],\n maxColor: tokens.linearColorScheme[1],\n },\n }\n}\n\nconst getChartPatch = (tokens: TokenThemeDefinition) => ({\n backgroundColor: 'transparent',\n fontFamily: tokens.fontFamily,\n color: {\n colorScheme: [...tokens.colorScheme],\n linearColorScheme: [...tokens.linearColorScheme],\n positiveColor: tokens.positiveColor,\n negativeColor: tokens.negativeColor,\n },\n label: {\n labelFontSize: tokens.labelFontSize,\n labelColor: tokens.labelColor || tokens.textPrimary,\n labelStroke: tokens.labelStroke,\n },\n legend: {\n labelColor: tokens.legendLabelColor || tokens.textSecondary,\n labelFontSize: tokens.legendFontSize,\n pagerIconColor: tokens.legendPagerIconColor || tokens.textSecondary,\n pagerIconDisableColor: tokens.legendPagerIconDisableColor || tokens.borderColor,\n },\n tooltip: {\n backgroundColor: tokens.tooltipBackgroundColor,\n borderColor: tokens.tooltipBorderColor || tokens.borderColor,\n fontSize: tokens.tooltipFontSize,\n keyColor: tokens.textSecondary,\n valueColor: tokens.textPrimary,\n titleColor: tokens.textPrimary,\n },\n})\n\nconst getAnnotationLinePatch = (tokens: TokenThemeDefinition) => ({\n lineColor: tokens.annotationLineColor,\n lineStyle: tokens.annotationLineStyle,\n lineDash: tokens.annotationLineDash,\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundBorderColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n})\n\nconst getAnnotationTextPatch = (tokens: TokenThemeDefinition) => ({\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundBorderColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n})\n\nconst getAnnotationPatch = (tokens: TokenThemeDefinition) => {\n const annotationLinePatch = getAnnotationLinePatch(tokens)\n const annotationTextPatch = getAnnotationTextPatch(tokens)\n\n return {\n annotationPoint: {\n textFontSize: tokens.labelFontSize,\n ...annotationTextPatch,\n },\n annotationHorizontalLine: {\n textFontSize: tokens.labelFontSize,\n ...annotationLinePatch,\n },\n annotationVerticalLine: {\n textFontSize: tokens.labelFontSize,\n ...annotationLinePatch,\n },\n annotationDifferenceLine: {\n textFontSize: tokens.labelFontSize,\n lineColor: tokens.annotationLineColor,\n lineStyle: tokens.annotationLineStyle,\n lineDash: tokens.annotationLineDash,\n textColor: tokens.annotationTextColor,\n textBackgroundColor: tokens.annotationTextBackgroundColor,\n textBackgroundOpacity: tokens.annotationTextBackgroundOpacity,\n },\n annotationArea: {\n textFontSize: tokens.labelFontSize,\n areaColor: tokens.annotationAreaColor,\n areaColorOpacity: tokens.annotationAreaColorOpacity,\n ...annotationTextPatch,\n },\n }\n}\n\nconst getRegressionLinePatch = (tokens: TokenThemeDefinition) => ({\n kdeRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n ecdfRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n linearRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n lowessRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n polynomialRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n logisticRegressionLine: {\n textFontSize: tokens.labelFontSize,\n },\n})\n\nconst withAxesAndExtras = (\n chartType: ThemeConfigKey,\n chartConfig: NonNullable<ThemeConfigMap[ThemeConfigKey]>,\n tokens: TokenThemeDefinition,\n) => {\n let nextChartConfig = mergeThemeNode(chartConfig, getChartPatch(tokens))\n const chartRecord = nextChartConfig as Record<string, unknown>\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'xAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { xAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'yAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { yAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'primaryYAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { primaryYAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'secondaryYAxis')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { secondaryYAxis: getAxisPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'pivotGrid')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { pivotGrid: getPivotGridPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'annotation')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { annotation: getAnnotationPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (Object.prototype.hasOwnProperty.call(chartRecord, 'regressionLine')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { regressionLine: getRegressionLinePatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n if (raceChartTypes.includes(chartType) && Object.prototype.hasOwnProperty.call(chartRecord, 'player')) {\n nextChartConfig = mergeThemeNode(nextChartConfig, { player: getPlayerPatch(tokens) } as Partial<\n typeof nextChartConfig\n >)\n }\n\n return nextChartConfig\n}\n\nexport const createTokenThemeConfig = (tokens: TokenThemeDefinition): CustomThemeConfig => {\n const baseTheme = tokens.baseTheme === 'dark' ? darkTheme() : lightTheme()\n const baseConfig = (baseTheme.config || {}) as ThemeConfigMap\n const nextConfig = {} as ThemeConfigMap\n\n for (const chartType of Object.keys(baseConfig) as ThemeConfigKey[]) {\n const chartConfig = baseConfig[chartType]\n if (!chartConfig) {\n continue\n }\n\n if (chartType === 'table' || chartType === 'pivotTable') {\n nextConfig[chartType] = mergeThemeNode(chartConfig, getTablePatch(tokens)) as ThemeConfigMap[ThemeConfigKey]\n continue\n }\n\n nextConfig[chartType] = withAxesAndExtras(chartType, chartConfig, tokens) as ThemeConfigMap[ThemeConfigKey]\n }\n\n return {\n config: nextConfig as Config,\n }\n}\n\nexport const registerTokenTheme = (\n themeName: string,\n tokens: TokenThemeDefinition,\n options?: RegisterTokenThemeOptions,\n) => {\n ensureRegisterAll(options)\n registerCustomTheme(themeName, createTokenThemeConfig(tokens))\n}\n\nexport const registerTokenThemes = (themes: TokenThemeRegistry, options?: RegisterTokenThemeOptions) => {\n ensureRegisterAll(options)\n\n for (const [themeName, tokens] of Object.entries(themes)) {\n registerCustomTheme(themeName, createTokenThemeConfig(tokens))\n }\n}\n"],"names":["raceChartTypes","hasEnsuredRegisterAll","isRecord","value","Array","mergeThemeNode","base","patch","result","key","patchValue","Object","undefined","currentValue","withAlpha","color","alpha","tinycolor","ensureRegisterAll","options","registerAll","getAccentColor","tokens","getAxisPatch","getPivotGridPatch","getPlayerPatch","accentColor","getTablePatch","getChartPatch","getAnnotationLinePatch","getAnnotationTextPatch","getAnnotationPatch","annotationLinePatch","annotationTextPatch","getRegressionLinePatch","withAxesAndExtras","chartType","chartConfig","nextChartConfig","chartRecord","createTokenThemeConfig","baseTheme","darkTheme","lightTheme","baseConfig","nextConfig","registerTokenTheme","themeName","registerCustomTheme","registerTokenThemes","themes"],"mappings":";;;;;AAwEA,MAAMA,iBAAmC;IAAC;IAAW;IAAc;IAAe;IAAY;IAAW;CAAY;AAErH,IAAIC,wBAAwB;AAE5B,MAAMC,WAAW,CAACC,QACT,AAAiB,YAAjB,OAAOA,SAAsBA,AAAU,SAAVA,SAAkB,CAACC,MAAM,OAAO,CAACD;AAGvE,MAAME,iBAAiB,CAAIC,MAASC;IAClC,IAAI,CAACL,SAASI,SAAS,CAACJ,SAASK,QAC/B,OAAOA;IAGT,MAAMC,SAAkC;QAAE,GAAGF,IAAI;IAAC;IAClD,KAAK,MAAM,CAACG,KAAKC,WAAW,IAAIC,OAAO,OAAO,CAACJ,OAAQ;QACrD,IAAIG,AAAeE,WAAfF,YACF;QAGF,MAAMG,eAAeL,MAAM,CAACC,IAAI;QAChC,IAAIL,MAAM,OAAO,CAACM,aAAa;YAC7BF,MAAM,CAACC,IAAI,GAAG;mBAAIC;aAAW;YAC7B;QACF;QAEA,IAAIR,SAASW,iBAAiBX,SAASQ,aAAa;YAClDF,MAAM,CAACC,IAAI,GAAGJ,eAAeQ,cAAcH;YAC3C;QACF;QAEAF,MAAM,CAACC,IAAI,GAAGC;IAChB;IAEA,OAAOF;AACT;AAEA,MAAMM,YAAY,CAACC,OAAeC,QAAkBC,WAAUF,OAAO,QAAQ,CAACC,OAAO,WAAW;AAEhG,MAAME,oBAAoB,CAACC;IACzB,IAAIA,SAAS,sBAAsB,SAASlB,uBAC1C;IAGFmB;IACAnB,wBAAwB;AAC1B;AAEA,MAAMoB,iBAAiB,CAACC,SAAiCA,OAAO,WAAW,IAAIA,OAAO,WAAW,CAAC,EAAE;AAEpG,MAAMC,eAAe,CAACD,SAAkC;QACtD,OAAO;YACL,YAAYA,O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C/CF,oBAAoBD,WAAWP,uBAAuBlB;AAE1D"}
package/dist/umd/index.js CHANGED
@@ -31971,6 +31971,8 @@ self.R = R;
31971
31971
  },
31972
31972
  annotationArea: {
31973
31973
  textFontSize: tokens.labelFontSize,
31974
+ areaColor: tokens.annotationAreaColor,
31975
+ areaColorOpacity: tokens.annotationAreaColorOpacity,
31974
31976
  ...annotationTextPatch
31975
31977
  }
31976
31978
  };