@deephaven/chart 0.53.1-beta.2 → 0.53.1-beta.4
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.
- package/dist/Chart.d.ts +2 -0
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +15 -1
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModelFactory.d.ts +5 -38
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js +6 -11
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartTheme.d.ts +4 -3
- package/dist/ChartTheme.d.ts.map +1 -1
- package/dist/ChartTheme.js +38 -19
- package/dist/ChartTheme.js.map +1 -1
- package/dist/ChartTheme.module.css +16 -16
- package/dist/ChartTheme.module.css.map +1 -1
- package/dist/ChartThemeProvider.d.ts +9 -0
- package/dist/ChartThemeProvider.d.ts.map +1 -0
- package/dist/ChartThemeProvider.js +35 -0
- package/dist/ChartThemeProvider.js.map +1 -0
- package/dist/ChartUtils.d.ts +12 -129
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +19 -26
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +4 -3
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +7 -8
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +3 -0
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/MockChartModel.js +21 -11
- package/dist/MockChartModel.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/plotly/Plot.d.ts.map +1 -1
- package/dist/plotly/Plot.js +3 -8
- package/dist/plotly/Plot.js.map +1 -1
- package/dist/plotly/createPlotlyComponent.d.ts +4 -0
- package/dist/plotly/createPlotlyComponent.d.ts.map +1 -0
- package/dist/plotly/createPlotlyComponent.js +13 -0
- package/dist/plotly/createPlotlyComponent.js.map +1 -0
- package/dist/useChartTheme.d.ts +7 -0
- package/dist/useChartTheme.d.ts.map +1 -0
- package/dist/useChartTheme.js +10 -0
- package/dist/useChartTheme.js.map +1 -0
- package/package.json +11 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/ChartTheme.module.scss","../../../node_modules/@deephaven/components/scss/custom.scss"
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/ChartTheme.module.scss","../../../node_modules/@deephaven/components/scss/custom.scss"],"names":[],"mappings":"AAAA;ACAA;ADGA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA","file":"ChartTheme.module.css","sourcesContent":["/* stylelint-disable */\n@import '@deephaven/components/scss/custom.scss';\n\n:export {\n paper-bgcolor: var(--dh-color-chart-bg);\n plot-bgcolor: var(--dh-color-chart-plot-bg);\n title-color: var(--dh-color-chart-title);\n colorway: var(--dh-color-chart-colorway);\n gridcolor: var(--dh-color-chart-grid);\n linecolor: var(--dh-color-chart-axis-line);\n zerolinecolor: var(--dh-color-chart-axis-line-zero);\n activecolor: var(--dh-color-chart-active);\n rangebgcolor: var(--dh-color-chart-range-bg);\n area-color: var(--dh-color-chart-area);\n trend-color: var(--dh-color-chart-trend);\n line-color: var(--dh-color-chart-line-deprecated);\n error-band-line-color: var(--dh-color-chart-error-band-line);\n error-band-fill-color: var(--dh-color-chart-error-band-fill);\n ohlc-increasing: var(--dh-color-chart-ohlc-increase);\n ohlc-decreasing: var(--dh-color-chart-ohlc-decrease);\n}\n","/* stylelint-disable scss/at-import-no-partial-leading-underscore */\n// Consumers should be able to resolve bootstrap/ to node_modules/bootstrap\n\n//Make bootstrap functions available for use in overrides\n@import 'bootstrap/scss/_functions.scss';\n@import './bootstrap_overrides.scss';\n\n//_variable imports come after bootstrap default overrides,\n// makes all other variables and mixins from bootstrap available\n/// with just importing customer.scss\n@import 'bootstrap/scss/_variables.scss';\n@import 'bootstrap/scss/_mixins.scss';\n\n//New variables come after imports\n@import './new_variables.scss';\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChartTheme } from './ChartTheme';
|
|
3
|
+
export type ChartThemeContextValue = ChartTheme;
|
|
4
|
+
export declare const ChartThemeContext: import("react").Context<ChartTheme | null>;
|
|
5
|
+
export interface ChartThemeProviderProps {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function ChartThemeProvider({ children, }: ChartThemeProviderProps): JSX.Element;
|
|
9
|
+
//# sourceMappingURL=ChartThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartThemeProvider.d.ts","sourceRoot":"","sources":["../src/ChartThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEtE,OAA0B,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAEhD,eAAO,MAAM,iBAAiB,4CAE7B,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAKD,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,GACT,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAuBvC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createContext, useEffect, useState } from 'react';
|
|
2
|
+
import { useTheme } from '@deephaven/components';
|
|
3
|
+
import defaultChartTheme from "./ChartTheme.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var ChartThemeContext = /*#__PURE__*/createContext(null);
|
|
6
|
+
/*
|
|
7
|
+
* Provides a chart theme based on the active themes from the ThemeProvider.
|
|
8
|
+
*/
|
|
9
|
+
export function ChartThemeProvider(_ref) {
|
|
10
|
+
var {
|
|
11
|
+
children
|
|
12
|
+
} = _ref;
|
|
13
|
+
var {
|
|
14
|
+
activeThemes
|
|
15
|
+
} = useTheme();
|
|
16
|
+
var [chartTheme, setChartTheme] = useState(null);
|
|
17
|
+
|
|
18
|
+
// The `ThemeProvider` that supplies `activeThemes` also provides the corresponding
|
|
19
|
+
// CSS theme variables to the DOM by dynamically rendering <style> tags whenever
|
|
20
|
+
// the `activeThemes` change. Painting the latest CSS variables to the DOM may
|
|
21
|
+
// not happen until after `ChartThemeProvider` is rendered, but they should be
|
|
22
|
+
// available by the time the effect runs. Therefore, it is important to derive
|
|
23
|
+
// the chart theme in an effect instead of deriving in a `useMemo` to ensure
|
|
24
|
+
// we have the latest CSS variables.
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (activeThemes != null) {
|
|
27
|
+
setChartTheme(defaultChartTheme());
|
|
28
|
+
}
|
|
29
|
+
}, [activeThemes]);
|
|
30
|
+
return /*#__PURE__*/_jsx(ChartThemeContext.Provider, {
|
|
31
|
+
value: chartTheme,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ChartThemeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartThemeProvider.js","names":["createContext","useEffect","useState","useTheme","defaultChartTheme","jsx","_jsx","ChartThemeContext","ChartThemeProvider","_ref","children","activeThemes","chartTheme","setChartTheme","Provider","value"],"sources":["../src/ChartThemeProvider.tsx"],"sourcesContent":["import { createContext, ReactNode, useEffect, useState } from 'react';\nimport { useTheme } from '@deephaven/components';\nimport defaultChartTheme, { ChartTheme } from './ChartTheme';\n\nexport type ChartThemeContextValue = ChartTheme;\n\nexport const ChartThemeContext = createContext<ChartThemeContextValue | null>(\n null\n);\n\nexport interface ChartThemeProviderProps {\n children: ReactNode;\n}\n\n/*\n * Provides a chart theme based on the active themes from the ThemeProvider.\n */\nexport function ChartThemeProvider({\n children,\n}: ChartThemeProviderProps): JSX.Element {\n const { activeThemes } = useTheme();\n\n const [chartTheme, setChartTheme] = useState<ChartTheme | null>(null);\n\n // The `ThemeProvider` that supplies `activeThemes` also provides the corresponding\n // CSS theme variables to the DOM by dynamically rendering <style> tags whenever\n // the `activeThemes` change. Painting the latest CSS variables to the DOM may\n // not happen until after `ChartThemeProvider` is rendered, but they should be\n // available by the time the effect runs. Therefore, it is important to derive\n // the chart theme in an effect instead of deriving in a `useMemo` to ensure\n // we have the latest CSS variables.\n useEffect(() => {\n if (activeThemes != null) {\n setChartTheme(defaultChartTheme());\n }\n }, [activeThemes]);\n\n return (\n <ChartThemeContext.Provider value={chartTheme}>\n {children}\n </ChartThemeContext.Provider>\n );\n}\n"],"mappings":"AAAA,SAASA,aAAa,EAAaC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAASC,QAAQ,QAAQ,uBAAuB;AAAC,OAC1CC,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAIxB,OAAO,IAAMC,iBAAiB,gBAAGP,aAAa,CAC5C,IACF,CAAC;AAMD;AACA;AACA;AACA,OAAO,SAASQ,kBAAkBA,CAAAC,IAAA,EAEO;EAAA,IAFN;IACjCC;EACuB,CAAC,GAAAD,IAAA;EACxB,IAAM;IAAEE;EAAa,CAAC,GAAGR,QAAQ,CAAC,CAAC;EAEnC,IAAM,CAACS,UAAU,EAAEC,aAAa,CAAC,GAAGX,QAAQ,CAAoB,IAAI,CAAC;;EAErE;EACA;EACA;EACA;EACA;EACA;EACA;EACAD,SAAS,CAAC,MAAM;IACd,IAAIU,YAAY,IAAI,IAAI,EAAE;MACxBE,aAAa,CAACT,iBAAiB,CAAC,CAAC,CAAC;IACpC;EACF,CAAC,EAAE,CAACO,YAAY,CAAC,CAAC;EAElB,oBACEL,IAAA,CAACC,iBAAiB,CAACO,QAAQ;IAACC,KAAK,EAAEH,UAAW;IAAAF,QAAA,EAC3CA;EAAQ,CACiB,CAAC;AAEjC"}
|
package/dist/ChartUtils.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Formatter } from '@deephaven/jsapi-utils';
|
|
|
2
2
|
import type { Axis, AxisPosition, AxisType, Chart, dh as DhType, Figure, Holiday, Series, SeriesDataSource, SeriesPlotStyle, SourceType, TableTemplate, TimeZone } from '@deephaven/jsapi-types';
|
|
3
3
|
import type { Layout, PlotData, PlotType, Axis as PlotlyAxis, ErrorBar, LayoutAxis, MarkerSymbol } from 'plotly.js';
|
|
4
4
|
import { Range } from '@deephaven/utils';
|
|
5
|
-
import ChartTheme from './ChartTheme';
|
|
5
|
+
import { ChartTheme } from './ChartTheme';
|
|
6
6
|
export type FilterColumnMap = Map<string, {
|
|
7
7
|
name: string;
|
|
8
8
|
type: string;
|
|
@@ -83,27 +83,11 @@ declare class ChartUtils {
|
|
|
83
83
|
* @param x The main data array
|
|
84
84
|
* @param xLow The absolute low values
|
|
85
85
|
* @param xHigh
|
|
86
|
+
* @param theme Theme properties for the chart
|
|
86
87
|
*
|
|
87
88
|
* @returns The error_x object required by plotly, or null if none is required
|
|
88
89
|
*/
|
|
89
|
-
static getPlotlyErrorBars(x: number[], xLow: number[], xHigh: number[], theme
|
|
90
|
-
paper_bgcolor: string;
|
|
91
|
-
plot_bgcolor: string;
|
|
92
|
-
title_color: string;
|
|
93
|
-
colorway: string;
|
|
94
|
-
gridcolor: string;
|
|
95
|
-
linecolor: string;
|
|
96
|
-
zerolinecolor: string;
|
|
97
|
-
activecolor: string;
|
|
98
|
-
rangebgcolor: string;
|
|
99
|
-
area_color: string;
|
|
100
|
-
trend_color: string;
|
|
101
|
-
line_color: string;
|
|
102
|
-
error_band_line_color: string;
|
|
103
|
-
error_band_fill_color: string;
|
|
104
|
-
ohlc_increasing: string;
|
|
105
|
-
ohlc_decreasing: string;
|
|
106
|
-
}>): ErrorBar;
|
|
90
|
+
static getPlotlyErrorBars(x: number[], xLow: number[], xHigh: number[], theme: ChartTheme): ErrorBar;
|
|
107
91
|
static convertNumberPrefix(prefix: string): string;
|
|
108
92
|
static getPlotlyNumberFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis> | null;
|
|
109
93
|
/**
|
|
@@ -184,24 +168,7 @@ declare class ChartUtils {
|
|
|
184
168
|
* @param theme The theme to get colorway from
|
|
185
169
|
* @returns Colorway array for the theme
|
|
186
170
|
*/
|
|
187
|
-
static getColorwayFromTheme(theme
|
|
188
|
-
paper_bgcolor: string;
|
|
189
|
-
plot_bgcolor: string;
|
|
190
|
-
title_color: string;
|
|
191
|
-
colorway: string;
|
|
192
|
-
gridcolor: string;
|
|
193
|
-
linecolor: string;
|
|
194
|
-
zerolinecolor: string;
|
|
195
|
-
activecolor: string;
|
|
196
|
-
rangebgcolor: string;
|
|
197
|
-
area_color: string;
|
|
198
|
-
trend_color: string;
|
|
199
|
-
line_color: string;
|
|
200
|
-
error_band_line_color: string;
|
|
201
|
-
error_band_fill_color: string;
|
|
202
|
-
ohlc_increasing: string;
|
|
203
|
-
ohlc_decreasing: string;
|
|
204
|
-
}>): string[];
|
|
171
|
+
static getColorwayFromTheme(theme: ChartTheme): string[];
|
|
205
172
|
static titleFromSettings(settings: ChartModelSettings): string;
|
|
206
173
|
private dh;
|
|
207
174
|
private daysOfWeek;
|
|
@@ -242,26 +209,9 @@ declare class ChartUtils {
|
|
|
242
209
|
* @param theme The theme properties for the plot. See ChartTheme.js for an example
|
|
243
210
|
* @returns The series data (trace) object for use with plotly.
|
|
244
211
|
*/
|
|
245
|
-
makeSeriesDataFromSeries(series: Series, axisTypeMap: AxisTypeMap, seriesVisibility: boolean | 'legendonly', showLegend?: boolean | null
|
|
246
|
-
paper_bgcolor: string;
|
|
247
|
-
plot_bgcolor: string;
|
|
248
|
-
title_color: string;
|
|
249
|
-
colorway: string;
|
|
250
|
-
gridcolor: string;
|
|
251
|
-
linecolor: string;
|
|
252
|
-
zerolinecolor: string;
|
|
253
|
-
activecolor: string;
|
|
254
|
-
rangebgcolor: string;
|
|
255
|
-
area_color: string;
|
|
256
|
-
trend_color: string;
|
|
257
|
-
line_color: string;
|
|
258
|
-
error_band_line_color: string;
|
|
259
|
-
error_band_fill_color: string;
|
|
260
|
-
ohlc_increasing: string;
|
|
261
|
-
ohlc_decreasing: string;
|
|
262
|
-
}>): Partial<PlotData>;
|
|
212
|
+
makeSeriesDataFromSeries(series: Series, axisTypeMap: AxisTypeMap, seriesVisibility: boolean | 'legendonly', theme: ChartTheme, showLegend?: boolean | null): Partial<PlotData>;
|
|
263
213
|
addSourcesToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, sources: SeriesDataSource[], axisTypeMap: AxisTypeMap): void;
|
|
264
|
-
addStylingToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, theme
|
|
214
|
+
addStylingToSeriesData(seriesDataParam: Partial<PlotData>, plotStyle: SeriesPlotStyle, theme: ChartTheme, lineColor?: string | null, shapeColor?: string | null, shape?: string | null, shapeSize?: number | null, seriesVisibility?: 'legendonly' | boolean | null): void;
|
|
265
215
|
getChartType(plotStyle: SeriesPlotStyle, isBusinessTime: boolean): PlotType | undefined;
|
|
266
216
|
/**
|
|
267
217
|
* Return the plotly axis property name
|
|
@@ -277,29 +227,12 @@ declare class ChartUtils {
|
|
|
277
227
|
* Update the layout with all the axes information for the provided figure
|
|
278
228
|
* @param figure Figure to update the axes for
|
|
279
229
|
* @param layoutParam Layout object to update in place
|
|
230
|
+
* @param theme Theme used for displaying the plot
|
|
280
231
|
* @param chartAxisRangeParser Function to retrieve the axis range parser
|
|
281
232
|
* @param plotWidth Width of the plot in pixels
|
|
282
233
|
* @param plotHeight Height of the plot in pixels
|
|
283
|
-
* @param theme Theme used for displaying the plot
|
|
284
234
|
*/
|
|
285
|
-
updateFigureAxes(layoutParam: Partial<Layout>, figure: Figure, chartAxisRangeParser?: ChartAxisRangeParser, plotWidth?: number, plotHeight?: number
|
|
286
|
-
paper_bgcolor: string;
|
|
287
|
-
plot_bgcolor: string;
|
|
288
|
-
title_color: string;
|
|
289
|
-
colorway: string;
|
|
290
|
-
gridcolor: string;
|
|
291
|
-
linecolor: string;
|
|
292
|
-
zerolinecolor: string;
|
|
293
|
-
activecolor: string;
|
|
294
|
-
rangebgcolor: string;
|
|
295
|
-
area_color: string;
|
|
296
|
-
trend_color: string;
|
|
297
|
-
line_color: string;
|
|
298
|
-
error_band_line_color: string;
|
|
299
|
-
error_band_fill_color: string;
|
|
300
|
-
ohlc_increasing: string;
|
|
301
|
-
ohlc_decreasing: string;
|
|
302
|
-
}>): void;
|
|
235
|
+
updateFigureAxes(layoutParam: Partial<Layout>, figure: Figure, theme: ChartTheme, chartAxisRangeParser?: ChartAxisRangeParser, plotWidth?: number, plotHeight?: number): void;
|
|
303
236
|
getChartBounds(figure: Figure, chart: Chart, plotWidth: number, plotHeight: number): ChartBounds;
|
|
304
237
|
getPlotlyDateFormat(formatter: Formatter | null, columnType: string, formatPattern: string): Partial<LayoutAxis>;
|
|
305
238
|
/**
|
|
@@ -316,29 +249,13 @@ declare class ChartUtils {
|
|
|
316
249
|
* @param layoutParam The layout object to update
|
|
317
250
|
* @param chartAxes The chart axes to update the layout with
|
|
318
251
|
* @param figureAxes All figure axes to update the layout with
|
|
252
|
+
* @param theme Theme used for displaying the plot
|
|
319
253
|
* @param plotWidth The width of the plot to calculate the axis sizes for
|
|
320
254
|
* @param plotHeight The height of the plot to calculate the axis sizes for
|
|
321
255
|
* @param bounds The bounds for this set of axes
|
|
322
256
|
* @param axisRangeParser A function to retrieve the range parser for a given axis
|
|
323
257
|
*/
|
|
324
|
-
updateLayoutAxes(layoutParam: Partial<Layout>, chartAxes: Axis[], figureAxes: Axis[], plotWidth?: number, plotHeight?: number, bounds?: ChartBounds, axisRangeParser?: AxisRangeParser
|
|
325
|
-
paper_bgcolor: string;
|
|
326
|
-
plot_bgcolor: string;
|
|
327
|
-
title_color: string;
|
|
328
|
-
colorway: string;
|
|
329
|
-
gridcolor: string;
|
|
330
|
-
linecolor: string;
|
|
331
|
-
zerolinecolor: string;
|
|
332
|
-
activecolor: string;
|
|
333
|
-
rangebgcolor: string;
|
|
334
|
-
area_color: string;
|
|
335
|
-
trend_color: string;
|
|
336
|
-
line_color: string;
|
|
337
|
-
error_band_line_color: string;
|
|
338
|
-
error_band_fill_color: string;
|
|
339
|
-
ohlc_increasing: string;
|
|
340
|
-
ohlc_decreasing: string;
|
|
341
|
-
}>): void;
|
|
258
|
+
updateLayoutAxes(layoutParam: Partial<Layout>, chartAxes: Axis[], figureAxes: Axis[], theme: ChartTheme, plotWidth?: number, plotHeight?: number, bounds?: ChartBounds, axisRangeParser?: AxisRangeParser): void;
|
|
342
259
|
/**
|
|
343
260
|
* Remove any axes from the layout param that no longer belong to any series
|
|
344
261
|
* @param layoutParam Layout object to remove stale axes from
|
|
@@ -454,42 +371,8 @@ declare class ChartUtils {
|
|
|
454
371
|
* @param timeZone The time zone if applicable
|
|
455
372
|
*/
|
|
456
373
|
wrapValue(value: unknown, columnType: string, timeZone?: TimeZone | null): unknown;
|
|
457
|
-
makeLayoutAxis(type: AxisType, theme
|
|
458
|
-
|
|
459
|
-
plot_bgcolor: string;
|
|
460
|
-
title_color: string;
|
|
461
|
-
colorway: string;
|
|
462
|
-
gridcolor: string;
|
|
463
|
-
linecolor: string;
|
|
464
|
-
zerolinecolor: string;
|
|
465
|
-
activecolor: string;
|
|
466
|
-
rangebgcolor: string;
|
|
467
|
-
area_color: string;
|
|
468
|
-
trend_color: string;
|
|
469
|
-
line_color: string;
|
|
470
|
-
error_band_line_color: string;
|
|
471
|
-
error_band_fill_color: string;
|
|
472
|
-
ohlc_increasing: string;
|
|
473
|
-
ohlc_decreasing: string;
|
|
474
|
-
}>): Partial<LayoutAxis>;
|
|
475
|
-
makeDefaultLayout(theme?: Readonly<{
|
|
476
|
-
paper_bgcolor: string;
|
|
477
|
-
plot_bgcolor: string;
|
|
478
|
-
title_color: string;
|
|
479
|
-
colorway: string;
|
|
480
|
-
gridcolor: string;
|
|
481
|
-
linecolor: string;
|
|
482
|
-
zerolinecolor: string;
|
|
483
|
-
activecolor: string;
|
|
484
|
-
rangebgcolor: string;
|
|
485
|
-
area_color: string;
|
|
486
|
-
trend_color: string;
|
|
487
|
-
line_color: string;
|
|
488
|
-
error_band_line_color: string;
|
|
489
|
-
error_band_fill_color: string;
|
|
490
|
-
ohlc_increasing: string;
|
|
491
|
-
ohlc_decreasing: string;
|
|
492
|
-
}>): Partial<Layout>;
|
|
374
|
+
makeLayoutAxis(type: AxisType, theme: ChartTheme): Partial<LayoutAxis>;
|
|
375
|
+
makeDefaultLayout(theme: ChartTheme): Partial<Layout>;
|
|
493
376
|
/**
|
|
494
377
|
* Hydrate settings from a JSONable object
|
|
495
378
|
* @param settings Dehydrated settings
|
package/dist/ChartUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,KAAK,EAEL,EAAE,IAAI,MAAM,EACZ,MAAM,EACN,OAAO,EAEP,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,IAAI,IAAI,UAAU,EAClB,QAAQ,EACR,UAAU,EAGV,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAiB,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,UAAU,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartUtils.d.ts","sourceRoot":"","sources":["../src/ChartUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,IA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AC,GAAG;QAAE,IAAI,CAAC,EAAE,eAAe,CAAA;KAAE;CAUjE;AAED,eAAe,UAAU,CAAC"}
|
package/dist/ChartUtils.js
CHANGED
|
@@ -7,7 +7,6 @@ import Log from '@deephaven/log';
|
|
|
7
7
|
import { TableUtils } from '@deephaven/jsapi-utils';
|
|
8
8
|
import set from 'lodash.set';
|
|
9
9
|
import { assertNotNull } from '@deephaven/utils';
|
|
10
|
-
import ChartTheme from "./ChartTheme.js";
|
|
11
10
|
var log = Log.module('ChartUtils');
|
|
12
11
|
var BUSINESS_COLUMN_TYPE = 'io.deephaven.time.DateTime';
|
|
13
12
|
var MILLIS_PER_HOUR = 3600000;
|
|
@@ -31,11 +30,11 @@ class ChartUtils {
|
|
|
31
30
|
* @param x The main data array
|
|
32
31
|
* @param xLow The absolute low values
|
|
33
32
|
* @param xHigh
|
|
33
|
+
* @param theme Theme properties for the chart
|
|
34
34
|
*
|
|
35
35
|
* @returns The error_x object required by plotly, or null if none is required
|
|
36
36
|
*/
|
|
37
|
-
static getPlotlyErrorBars(x, xLow, xHigh) {
|
|
38
|
-
var theme = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ChartTheme;
|
|
37
|
+
static getPlotlyErrorBars(x, xLow, xHigh, theme) {
|
|
39
38
|
var array = xHigh.map((value, i) => value - x[i]);
|
|
40
39
|
var arrayminus = xLow.map((value, i) => x[i] - value);
|
|
41
40
|
return {
|
|
@@ -291,8 +290,7 @@ class ChartUtils {
|
|
|
291
290
|
* @param theme The theme to get colorway from
|
|
292
291
|
* @returns Colorway array for the theme
|
|
293
292
|
*/
|
|
294
|
-
static getColorwayFromTheme() {
|
|
295
|
-
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ChartTheme;
|
|
293
|
+
static getColorwayFromTheme(theme) {
|
|
296
294
|
var colorway = [];
|
|
297
295
|
if (theme.colorway) {
|
|
298
296
|
if (Array.isArray(theme.colorway)) {
|
|
@@ -603,9 +601,8 @@ class ChartUtils {
|
|
|
603
601
|
* @param theme The theme properties for the plot. See ChartTheme.js for an example
|
|
604
602
|
* @returns The series data (trace) object for use with plotly.
|
|
605
603
|
*/
|
|
606
|
-
makeSeriesDataFromSeries(series, axisTypeMap, seriesVisibility) {
|
|
607
|
-
var showLegend = arguments.length >
|
|
608
|
-
var theme = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ChartTheme;
|
|
604
|
+
makeSeriesDataFromSeries(series, axisTypeMap, seriesVisibility, theme) {
|
|
605
|
+
var showLegend = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
609
606
|
var {
|
|
610
607
|
name,
|
|
611
608
|
isLinesVisible,
|
|
@@ -650,8 +647,7 @@ class ChartUtils {
|
|
|
650
647
|
}
|
|
651
648
|
}
|
|
652
649
|
}
|
|
653
|
-
addStylingToSeriesData(seriesDataParam, plotStyle) {
|
|
654
|
-
var theme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ChartTheme;
|
|
650
|
+
addStylingToSeriesData(seriesDataParam, plotStyle, theme) {
|
|
655
651
|
var lineColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
656
652
|
var shapeColor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
657
653
|
var shape = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
|
|
@@ -803,22 +799,21 @@ class ChartUtils {
|
|
|
803
799
|
* Update the layout with all the axes information for the provided figure
|
|
804
800
|
* @param figure Figure to update the axes for
|
|
805
801
|
* @param layoutParam Layout object to update in place
|
|
802
|
+
* @param theme Theme used for displaying the plot
|
|
806
803
|
* @param chartAxisRangeParser Function to retrieve the axis range parser
|
|
807
804
|
* @param plotWidth Width of the plot in pixels
|
|
808
805
|
* @param plotHeight Height of the plot in pixels
|
|
809
|
-
* @param theme Theme used for displaying the plot
|
|
810
806
|
*/
|
|
811
|
-
updateFigureAxes(layoutParam, figure, chartAxisRangeParser) {
|
|
812
|
-
var plotWidth = arguments.length >
|
|
813
|
-
var plotHeight = arguments.length >
|
|
814
|
-
var theme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ChartTheme;
|
|
807
|
+
updateFigureAxes(layoutParam, figure, theme, chartAxisRangeParser) {
|
|
808
|
+
var plotWidth = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
809
|
+
var plotHeight = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
815
810
|
var layout = layoutParam;
|
|
816
811
|
var figureAxes = ChartUtils.getAllAxes(figure);
|
|
817
812
|
for (var i = 0; i < figure.charts.length; i += 1) {
|
|
818
813
|
var _chart3 = figure.charts[i];
|
|
819
814
|
var axisRangeParser = chartAxisRangeParser === null || chartAxisRangeParser === void 0 ? void 0 : chartAxisRangeParser(_chart3);
|
|
820
815
|
var bounds = this.getChartBounds(figure, _chart3, plotWidth, plotHeight);
|
|
821
|
-
this.updateLayoutAxes(layout, _chart3.axes, figureAxes, plotWidth, plotHeight, bounds, axisRangeParser
|
|
816
|
+
this.updateLayoutAxes(layout, _chart3.axes, figureAxes, theme, plotWidth, plotHeight, bounds, axisRangeParser);
|
|
822
817
|
}
|
|
823
818
|
this.removeStaleAxes(layout, figureAxes);
|
|
824
819
|
}
|
|
@@ -929,22 +924,22 @@ class ChartUtils {
|
|
|
929
924
|
* @param layoutParam The layout object to update
|
|
930
925
|
* @param chartAxes The chart axes to update the layout with
|
|
931
926
|
* @param figureAxes All figure axes to update the layout with
|
|
927
|
+
* @param theme Theme used for displaying the plot
|
|
932
928
|
* @param plotWidth The width of the plot to calculate the axis sizes for
|
|
933
929
|
* @param plotHeight The height of the plot to calculate the axis sizes for
|
|
934
930
|
* @param bounds The bounds for this set of axes
|
|
935
931
|
* @param axisRangeParser A function to retrieve the range parser for a given axis
|
|
936
932
|
*/
|
|
937
|
-
updateLayoutAxes(layoutParam, chartAxes, figureAxes) {
|
|
938
|
-
var plotWidth = arguments.length >
|
|
939
|
-
var plotHeight = arguments.length >
|
|
940
|
-
var bounds = arguments.length >
|
|
933
|
+
updateLayoutAxes(layoutParam, chartAxes, figureAxes, theme) {
|
|
934
|
+
var plotWidth = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
935
|
+
var plotHeight = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
|
936
|
+
var bounds = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {
|
|
941
937
|
left: 0,
|
|
942
938
|
top: 0,
|
|
943
939
|
right: 1,
|
|
944
940
|
bottom: 1
|
|
945
941
|
};
|
|
946
|
-
var axisRangeParser = arguments.length >
|
|
947
|
-
var theme = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : ChartTheme;
|
|
942
|
+
var axisRangeParser = arguments.length > 7 ? arguments[7] : undefined;
|
|
948
943
|
var {
|
|
949
944
|
dh
|
|
950
945
|
} = this;
|
|
@@ -1314,8 +1309,7 @@ class ChartUtils {
|
|
|
1314
1309
|
}
|
|
1315
1310
|
return value;
|
|
1316
1311
|
}
|
|
1317
|
-
makeLayoutAxis(type) {
|
|
1318
|
-
var theme = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ChartTheme;
|
|
1312
|
+
makeLayoutAxis(type, theme) {
|
|
1319
1313
|
var {
|
|
1320
1314
|
dh
|
|
1321
1315
|
} = this;
|
|
@@ -1352,8 +1346,7 @@ class ChartUtils {
|
|
|
1352
1346
|
}
|
|
1353
1347
|
return axis;
|
|
1354
1348
|
}
|
|
1355
|
-
makeDefaultLayout() {
|
|
1356
|
-
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ChartTheme;
|
|
1349
|
+
makeDefaultLayout(theme) {
|
|
1357
1350
|
var {
|
|
1358
1351
|
dh
|
|
1359
1352
|
} = this;
|