Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/chart/src/ChartTheme.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@
ocean-color: var(--dh-color-chart-geo-ocean);
lake-color: var(--dh-color-chart-geo-lake);
river-color: var(--dh-color-chart-geo-river);

/* Indicator */
indicator-increasing: var(--dh-color-chart-indicator-increase);
indicator-decreasing: var(--dh-color-chart-indicator-decrease);
indicator-gauge: var(--dh-color-chart-indicator-gauge);
}
9 changes: 9 additions & 0 deletions packages/chart/src/ChartTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ export interface ChartTheme {
ocean_color: string;
lake_color: string;
river_color: string;

// Indicator
indicator_increasing: string;
indicator_decreasing: string;
indicator_gauge: string;
}

export function defaultChartTheme(): Readonly<ChartTheme> {
Expand Down Expand Up @@ -65,6 +70,10 @@ export function defaultChartTheme(): Readonly<ChartTheme> {
ocean_color: chartTheme['ocean-color'],
lake_color: chartTheme['lake-color'],
river_color: chartTheme['river-color'],
// Indicator
indicator_increasing: chartTheme['indicator-increasing'],
indicator_decreasing: chartTheme['indicator-decreasing'],
indicator_gauge: chartTheme['indicator-gauge'],
});
}

Expand Down
18 changes: 18 additions & 0 deletions packages/chart/src/ChartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
AxisType as PlotlyAxisType,
MarkerSymbol,
Template,
Delta,
} from 'plotly.js';
import { assertNotNull, bindAllMethods, type Range } from '@deephaven/utils';
import { type ChartTheme } from './ChartTheme';
Expand Down Expand Up @@ -2038,6 +2039,9 @@ class ChartUtils {
ohlc_increasing,
ohlc_decreasing,
title_color,
indicator_increasing,
indicator_decreasing,
indicator_gauge,
} = theme;

return {
Expand Down Expand Up @@ -2075,6 +2079,20 @@ class ChartUtils {
},
},
],
indicator: [
{
title: { font: { color: title_color } },
delta: {
decreasing: {
color: indicator_decreasing,
} as Delta['increasing'],
increasing: {
color: indicator_increasing,
} as Delta['decreasing'],
},
gauge: { bar: { color: indicator_gauge } },
},
],
},
/* eslint-enable camelcase */
layout: this.makeDefaultLayout(theme),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@
--dh-color-chart-geo-ocean: var(--dh-color-gray-300);
--dh-color-chart-geo-lake: var(--dh-color-blue-200);
--dh-color-chart-geo-river: var(--dh-color-blue-200);

/* Indicator */
--dh-color-chart-indicator-increase: var(--dh-color-visual-green);
--dh-color-chart-indicator-decrease: var(--dh-color-visual-red);
--dh-color-chart-indicator-gauge: var(--dh-color-green-1000);
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,9 @@
--dh-color-chart-geo-ocean: var(--dh-color-gray-300);
--dh-color-chart-geo-lake: var(--dh-color-blue-400);
--dh-color-chart-geo-river: var(--dh-color-blue-400);

/* Indicator */
--dh-color-chart-indicator-increase: var(--dh-color-visual-green);
--dh-color-chart-indicator-decrease: var(--dh-color-visual-red);
--dh-color-chart-indicator-gauge: var(--dh-color-green-1000);
}