Skip to content

Commit

Permalink
Removed unused chart colors
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Jan 10, 2024
1 parent fe0ec49 commit b134874
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 72 deletions.
10 changes: 0 additions & 10 deletions packages/chart/src/ChartTheme.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
16 changes: 0 additions & 16 deletions packages/chart/src/ChartTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChartTheme> {
Expand Down Expand Up @@ -64,13 +54,7 @@ export function defaultChartTheme(): Readonly<ChartTheme> {
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
Expand Down
10 changes: 0 additions & 10 deletions packages/chart/src/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
4 changes: 0 additions & 4 deletions packages/chart/src/MockChartModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand All @@ -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()
},
};
Expand All @@ -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,
Expand All @@ -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,
},
};
Expand Down
6 changes: 0 additions & 6 deletions packages/chart/src/__snapshots__/ChartTheme.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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']",
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b134874

Please sign in to comment.