diff --git a/packages/chart/src/ChartTheme.module.scss b/packages/chart/src/ChartTheme.module.scss index d868524cfe..25e5a0612e 100644 --- a/packages/chart/src/ChartTheme.module.scss +++ b/packages/chart/src/ChartTheme.module.scss @@ -20,14 +20,4 @@ ocean-color: var(--dh-color-plotly-geo-ocean); lake-color: var(--dh-color-plotly-geo-lake); river-color: var(--dh-color-plotly-geo-river); - - /* These seem to be unused */ - activecolor: var(--dh-color-chart-active); - rangebgcolor: var(--dh-color-chart-range-bg); - - /* Only used in Styleguide via MockChartModel */ - area-color: var(--dh-color-chart-area); - trend-color: var(--dh-color-chart-trend); - line-color: var(--dh-color-chart-line-deprecated); - error-band-fill-color: var(--dh-color-chart-error-band-fill); } diff --git a/packages/chart/src/ChartTheme.ts b/packages/chart/src/ChartTheme.ts index 428b502884..5934bfef70 100644 --- a/packages/chart/src/ChartTheme.ts +++ b/packages/chart/src/ChartTheme.ts @@ -27,16 +27,6 @@ export interface ChartTheme { ocean_color: string; lake_color: string; river_color: string; - - // Only used in Styleguide via MockChartModel - area_color: string; - trend_color: string; - line_color: string; - error_band_fill_color: string; - - // These seem to be unused - activecolor: string; - rangebgcolor: string; } export function defaultChartTheme(): Readonly { @@ -64,13 +54,7 @@ export function defaultChartTheme(): Readonly { gridcolor: chartTheme.gridcolor, linecolor: chartTheme.linecolor, zerolinecolor: chartTheme.zerolinecolor, - activecolor: chartTheme.activecolor, - rangebgcolor: chartTheme.rangebgcolor, - area_color: chartTheme['area-color'], - trend_color: chartTheme['trend-color'], - line_color: chartTheme['line-color'], error_band_line_color: chartTheme['error-band-line-color'], - error_band_fill_color: chartTheme['error-band-fill-color'], ohlc_increasing: chartTheme['ohlc-increasing'], ohlc_decreasing: chartTheme['ohlc-decreasing'], // Geo diff --git a/packages/chart/src/ChartUtils.ts b/packages/chart/src/ChartUtils.ts index 8da59e56bb..d8f6e2a02d 100644 --- a/packages/chart/src/ChartUtils.ts +++ b/packages/chart/src/ChartUtils.ts @@ -1896,16 +1896,6 @@ class ChartUtils { // linecolor, // zerolinecolor, - /* Unused */ - // activecolor, - // rangebgcolor, - - /* Only used in MockChartModel */ - // area_color, - // trend_color, - // line_color, - // error_band_fill_color, - // Used by `getPlotlyErrorBars()` // error_band_line_color, diff --git a/packages/chart/src/MockChartModel.ts b/packages/chart/src/MockChartModel.ts index ccac27ac36..77fb3ec9fa 100644 --- a/packages/chart/src/MockChartModel.ts +++ b/packages/chart/src/MockChartModel.ts @@ -97,7 +97,6 @@ class MockChartModel extends ChartModel { fill: 'tozeroy', hoverinfo: 'all', line: { - color: MockChartModel.theme.area_color, width: 3, // area patten gets applied as hack in post render plot.ly callback + css }, @@ -116,7 +115,6 @@ class MockChartModel extends ChartModel { line: { width: 3, dash: 'dot', // trendlines should follow some sort of color convention + dots/dashed. Remember there can multiple - color: MockChartModel.theme.trend_color, // chroma(c.$green).brighten(1.2).hex() }, }; @@ -143,7 +141,6 @@ class MockChartModel extends ChartModel { mode: 'line' as PlotData['mode'], hoverinfo: 'skip', fill: 'toself', // there's some ordering bug with scattergl where if the areas traces are ordered after the lines they don't render - fillcolor: MockChartModel.theme.error_band_fill_color, line: { width: 0, color: MockChartModel.theme.error_band_line_color, @@ -161,7 +158,6 @@ class MockChartModel extends ChartModel { mode: 'line' as PlotData['mode'], hoverinfo: 'x+y+text+name' as PlotData['hoverinfo'], line: { - color: MockChartModel.theme.line_color, width: 3, }, }; diff --git a/packages/chart/src/__snapshots__/ChartTheme.test.ts.snap b/packages/chart/src/__snapshots__/ChartTheme.test.ts.snap index dc9485145d..167de67728 100644 --- a/packages/chart/src/__snapshots__/ChartTheme.test.ts.snap +++ b/packages/chart/src/__snapshots__/ChartTheme.test.ts.snap @@ -2,26 +2,20 @@ exports[`defaultChartTheme should create the default chart theme 1`] = ` { - "activecolor": "chartTheme['activecolor']", - "area_color": "chartTheme['area-color']", "coastline_color": "chartTheme['coastline-color']", "colorway": "chartTheme['colorway']", - "error_band_fill_color": "chartTheme['error-band-fill-color']", "error_band_line_color": "chartTheme['error-band-line-color']", "gridcolor": "chartTheme['gridcolor']", "lake_color": "chartTheme['lake-color']", "land_color": "chartTheme['land-color']", - "line_color": "chartTheme['line-color']", "linecolor": "chartTheme['linecolor']", "ocean_color": "chartTheme['ocean-color']", "ohlc_decreasing": "chartTheme['ohlc-decreasing']", "ohlc_increasing": "chartTheme['ohlc-increasing']", "paper_bgcolor": "chartTheme['paper-bgcolor']", "plot_bgcolor": "chartTheme['plot-bgcolor']", - "rangebgcolor": "chartTheme['rangebgcolor']", "river_color": "chartTheme['river-color']", "title_color": "chartTheme['title-color']", - "trend_color": "chartTheme['trend-color']", "zerolinecolor": "chartTheme['zerolinecolor']", } `; diff --git a/packages/components/src/theme/theme-dark/theme-dark-semantic-chart.css b/packages/components/src/theme/theme-dark/theme-dark-semantic-chart.css index 60a15b8f2d..165713392b 100644 --- a/packages/components/src/theme/theme-dark/theme-dark-semantic-chart.css +++ b/packages/components/src/theme/theme-dark/theme-dark-semantic-chart.css @@ -15,27 +15,14 @@ --dh-color-chart-grid: var(--dh-color-gray-400); --dh-color-chart-axis-line: var(--dh-color-gray-500); --dh-color-chart-axis-line-zero: var(--dh-color-gray-700); - --dh-color-chart-active: var(--dh-color-accent-600); - - --dh-color-chart-range-bg: hsla(var(--dh-color-gray-500-hsl) 0.7); - --dh-color-chart-area: var(--dh-color-visual-blue); - --dh-color-chart-trend: var(--dh-color-green-1200); /* Error band */ --dh-color-chart-error-band-line: var(--dh-color-green-1400); - --dh-color-chart-error-band-fill: hsla(var(--dh-color-green-1200-hsl), 0.1); /* OHLC */ --dh-color-chart-ohlc-increase: var(--dh-color-visual-green); --dh-color-chart-ohlc-decrease: var(--dh-color-visual-red); - /* - * This color shows up in the styleguide, but it doesn't seem to be consumed - * in production code. There has been discussion about it not being needed - * anymore. - */ - --dh-color-chart-line-deprecated: var(--dh-color-visual-green); - --dh-color-plotly-axis-text: var(--dh-color-gray-500); --dh-color-plotly-zoombox: hsla(var(--dh-color-true-black-hsl), 0.5); --dh-color-plotly-zoombox-corners-fill: var(--dh-color-white); diff --git a/packages/components/src/theme/theme-light/theme-light-semantic-chart.css b/packages/components/src/theme/theme-light/theme-light-semantic-chart.css index 60a15b8f2d..165713392b 100644 --- a/packages/components/src/theme/theme-light/theme-light-semantic-chart.css +++ b/packages/components/src/theme/theme-light/theme-light-semantic-chart.css @@ -15,27 +15,14 @@ --dh-color-chart-grid: var(--dh-color-gray-400); --dh-color-chart-axis-line: var(--dh-color-gray-500); --dh-color-chart-axis-line-zero: var(--dh-color-gray-700); - --dh-color-chart-active: var(--dh-color-accent-600); - - --dh-color-chart-range-bg: hsla(var(--dh-color-gray-500-hsl) 0.7); - --dh-color-chart-area: var(--dh-color-visual-blue); - --dh-color-chart-trend: var(--dh-color-green-1200); /* Error band */ --dh-color-chart-error-band-line: var(--dh-color-green-1400); - --dh-color-chart-error-band-fill: hsla(var(--dh-color-green-1200-hsl), 0.1); /* OHLC */ --dh-color-chart-ohlc-increase: var(--dh-color-visual-green); --dh-color-chart-ohlc-decrease: var(--dh-color-visual-red); - /* - * This color shows up in the styleguide, but it doesn't seem to be consumed - * in production code. There has been discussion about it not being needed - * anymore. - */ - --dh-color-chart-line-deprecated: var(--dh-color-visual-green); - --dh-color-plotly-axis-text: var(--dh-color-gray-500); --dh-color-plotly-zoombox: hsla(var(--dh-color-true-black-hsl), 0.5); --dh-color-plotly-zoombox-corners-fill: var(--dh-color-white);