@deephaven/chart 0.15.5-vite.12 → 0.15.6-beta.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.
- package/dist/Chart.d.ts +84 -85
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +56 -49
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModel.d.ts +30 -22
- package/dist/ChartModel.d.ts.map +1 -1
- package/dist/ChartModel.js +18 -9
- package/dist/ChartModel.js.map +1 -1
- package/dist/ChartModelFactory.d.ts +67 -43
- package/dist/ChartModelFactory.d.ts.map +1 -1
- package/dist/ChartModelFactory.js +27 -27
- package/dist/ChartModelFactory.js.map +1 -1
- package/dist/ChartTestUtils.d.ts +16 -15
- package/dist/ChartTestUtils.d.ts.map +1 -1
- package/dist/ChartTestUtils.js +5 -0
- package/dist/ChartTestUtils.js.map +1 -1
- package/dist/ChartTheme.d.ts +17 -17
- package/dist/ChartTheme.d.ts.map +1 -1
- package/dist/ChartTheme.js.map +1 -1
- package/dist/ChartUtils.d.ts +252 -225
- package/dist/ChartUtils.d.ts.map +1 -1
- package/dist/ChartUtils.js +219 -174
- package/dist/ChartUtils.js.map +1 -1
- package/dist/FigureChartModel.d.ts +70 -106
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +90 -36
- package/dist/FigureChartModel.js.map +1 -1
- package/dist/MockChartModel.d.ts +11 -209
- package/dist/MockChartModel.d.ts.map +1 -1
- package/dist/MockChartModel.js.map +1 -1
- package/dist/declaration.d.js +2 -0
- package/dist/declaration.d.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/isFigureChartModel.d.ts +4 -0
- package/dist/isFigureChartModel.d.ts.map +1 -0
- package/dist/isFigureChartModel.js +4 -0
- package/dist/isFigureChartModel.js.map +1 -0
- package/dist/plotly/Plot.js.map +1 -1
- package/dist/plotly/Plotly.d.ts +1 -0
- package/dist/plotly/Plotly.js.map +1 -1
- package/package.json +11 -8
package/dist/ChartModel.js
CHANGED
|
@@ -11,11 +11,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
11
11
|
*/
|
|
12
12
|
class ChartModel {
|
|
13
13
|
constructor() {
|
|
14
|
+
_defineProperty(this, "listeners", void 0);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "formatter", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "rect", void 0);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "isDownsamplingDisabled", void 0);
|
|
21
|
+
|
|
22
|
+
_defineProperty(this, "title", void 0);
|
|
23
|
+
|
|
14
24
|
this.listeners = [];
|
|
15
|
-
this.formatter = null;
|
|
16
|
-
this.rect = null;
|
|
17
25
|
this.isDownsamplingDisabled = false;
|
|
18
|
-
this.title = null;
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
getData() {
|
|
@@ -36,18 +43,20 @@ class ChartModel {
|
|
|
36
43
|
|
|
37
44
|
isFilterRequired() {
|
|
38
45
|
return false;
|
|
39
|
-
}
|
|
46
|
+
} // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
47
|
+
|
|
40
48
|
|
|
41
|
-
setFilter() {}
|
|
49
|
+
setFilter(filter) {}
|
|
42
50
|
/**
|
|
43
51
|
* Close this model, clean up any underlying subscriptions
|
|
44
52
|
*/
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
45
54
|
|
|
46
55
|
|
|
47
56
|
close() {}
|
|
48
57
|
/**
|
|
49
58
|
* Set the formatter to use when charting the data.
|
|
50
|
-
* @param
|
|
59
|
+
* @param formatter The formatter to use to format the charting data
|
|
51
60
|
*/
|
|
52
61
|
|
|
53
62
|
|
|
@@ -56,7 +65,7 @@ class ChartModel {
|
|
|
56
65
|
}
|
|
57
66
|
/**
|
|
58
67
|
* Disable downsampling
|
|
59
|
-
* @param
|
|
68
|
+
* @param isDownsamplingDisabled True if downsampling should be disabled
|
|
60
69
|
*/
|
|
61
70
|
|
|
62
71
|
|
|
@@ -65,7 +74,7 @@ class ChartModel {
|
|
|
65
74
|
}
|
|
66
75
|
/**
|
|
67
76
|
* Set the dimensions of the plot. May be needed to evaluate some of the percents
|
|
68
|
-
* @param
|
|
77
|
+
* @param rect The bounding rectangle of the plot
|
|
69
78
|
*/
|
|
70
79
|
|
|
71
80
|
|
|
@@ -78,7 +87,7 @@ class ChartModel {
|
|
|
78
87
|
}
|
|
79
88
|
/**
|
|
80
89
|
* Subscribe to this ChartModel and start listening for all events.
|
|
81
|
-
* @param
|
|
90
|
+
* @param callback Callback when an event occurs
|
|
82
91
|
*/
|
|
83
92
|
|
|
84
93
|
|
package/dist/ChartModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/ChartModel.ts"],"names":["ChartModel","constructor","listeners","isDownsamplingDisabled","getData","getDefaultTitle","getLayout","getFilterColumnMap","Map","isFilterRequired","setFilter","filter","close","setFormatter","formatter","setDownsamplingDisabled","setDimensions","rect","setTitle","title","subscribe","callback","push","unsubscribe","listener","fireEvent","event","i","length","fireUpdate","data","CustomEvent","EVENT_UPDATED","detail","fireDisconnect","EVENT_DISCONNECT","fireReconnect","EVENT_RECONNECT","fireDownsampleStart","EVENT_DOWNSAMPLESTARTED","fireDownsampleFinish","EVENT_DOWNSAMPLEFINISHED","fireDownsampleFail","EVENT_DOWNSAMPLEFAILED","fireDownsampleNeeded","EVENT_DOWNSAMPLENEEDED","fireLoadFinished","EVENT_LOADFINISHED"],"mappings":";;AAAA;;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAN,CAAiB;AAiBfC,EAAAA,WAAW,GAAG;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AACZ,SAAKC,SAAL,GAAiB,EAAjB;AACA,SAAKC,sBAAL,GAA8B,KAA9B;AACD;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GsB,6B;;gBAHtBA,U,qBAKqB,4B;;gBALrBA,U,6BAO6B,oC;;gBAP7BA,U,8BAS8B,qC;;gBAT9BA,U,4BAW4B,mC;;gBAX5BA,U,4BAa4B,mC;;gBAb5BA,U,wBAewB,+B;;AAqI9B,eAAeA,UAAf","sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport { Layout, PlotData } from 'plotly.js';\n\nexport type FilterColumnMap = Map<\n string,\n {\n name: string;\n type: string;\n }\n>;\n\nexport type ChartEvent = CustomEvent;\n/**\n * Model for a Chart\n * All of these methods should return very quickly.\n * If data needs to be loaded asynchronously, return something immediately, then trigger an event for the chart to refresh.\n */\nclass ChartModel {\n static EVENT_UPDATED = 'ChartModel.EVENT_UPDATED';\n\n static EVENT_DISCONNECT = 'ChartModel.EVENT_DISCONNECT';\n\n static EVENT_RECONNECT = 'ChartModel.EVENT_RECONNECT';\n\n static EVENT_DOWNSAMPLESTARTED = 'ChartModel.EVENT_DOWNSAMPLESTARTED';\n\n static EVENT_DOWNSAMPLEFINISHED = 'ChartModel.EVENT_DOWNSAMPLEFINISHED';\n\n static EVENT_DOWNSAMPLEFAILED = 'ChartModel.EVENT_DOWNSAMPLEFAILED';\n\n static EVENT_DOWNSAMPLENEEDED = 'ChartModel.EVENT_DOWNSAMPLENEEDED';\n\n static EVENT_LOADFINISHED = 'ChartModel.EVENT_LOADFINISHED';\n\n constructor() {\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\n\n listeners: ((event: ChartEvent) => void)[];\n\n formatter?: Formatter;\n\n rect?: DOMRect;\n\n isDownsamplingDisabled: boolean;\n\n title?: string;\n\n getData(): Partial<PlotData>[] {\n return [];\n }\n\n getDefaultTitle(): string {\n return '';\n }\n\n getLayout(): Partial<Layout> {\n return {};\n }\n\n getFilterColumnMap(): FilterColumnMap {\n return new Map();\n }\n\n isFilterRequired(): boolean {\n return false;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setFilter(filter: Map<string, string>): void {}\n\n /**\n * Close this model, clean up any underlying subscriptions\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n close(): void {}\n\n /**\n * Set the formatter to use when charting the data.\n * @param formatter The formatter to use to format the charting data\n */\n setFormatter(formatter: Formatter): void {\n this.formatter = formatter;\n }\n\n /**\n * Disable downsampling\n * @param isDownsamplingDisabled True if downsampling should be disabled\n */\n setDownsamplingDisabled(isDownsamplingDisabled: boolean): void {\n this.isDownsamplingDisabled = isDownsamplingDisabled;\n }\n\n /**\n * Set the dimensions of the plot. May be needed to evaluate some of the percents\n * @param rect The bounding rectangle of the plot\n */\n setDimensions(rect: DOMRect): void {\n this.rect = rect;\n }\n\n setTitle(title: string): void {\n this.title = title;\n }\n\n /**\n * Subscribe to this ChartModel and start listening for all events.\n * @param callback Callback when an event occurs\n */\n subscribe(callback: (event: ChartEvent) => void): void {\n this.listeners.push(callback);\n }\n\n unsubscribe(callback: (event: ChartEvent) => void): void {\n this.listeners = this.listeners.filter(listener => listener !== callback);\n }\n\n fireEvent(event: ChartEvent): void {\n for (let i = 0; i < this.listeners.length; i += 1) {\n this.listeners[i](event);\n }\n }\n\n fireUpdate(data: unknown): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, { detail: data }));\n }\n\n fireDisconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));\n }\n\n fireReconnect(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));\n }\n\n fireDownsampleStart(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, { detail })\n );\n }\n\n fireDownsampleFinish(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, { detail })\n );\n }\n\n fireDownsampleFail(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, { detail })\n );\n }\n\n fireDownsampleNeeded(detail: unknown): void {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, { detail })\n );\n }\n\n fireLoadFinished(): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));\n }\n}\n\nexport default ChartModel;\n"],"file":"ChartModel.js"}
|
|
@@ -1,62 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
import { Figure, Table } from '@deephaven/jsapi-shim';
|
|
2
|
+
import { ChartModelSettings } from './ChartUtils';
|
|
3
|
+
import ChartModel from './ChartModel';
|
|
2
4
|
declare class ChartModelFactory {
|
|
3
5
|
/**
|
|
4
6
|
* Creates a model from the settings provided.
|
|
5
7
|
* Tries to create a Figure in the API with it.
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @returns
|
|
8
|
+
* @param settings The chart builder settings
|
|
9
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
10
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
11
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
12
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
13
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
14
|
+
* @param table The table to build the model for
|
|
15
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
16
|
+
* @returns The ChartModel Promise representing the figure
|
|
15
17
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
16
18
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
17
19
|
*/
|
|
18
|
-
static makeModelFromSettings(settings: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
static makeModelFromSettings(settings: ChartModelSettings, table: Table, theme?: Readonly<{
|
|
21
|
+
paper_bgcolor: string;
|
|
22
|
+
plot_bgcolor: string;
|
|
23
|
+
title_color: string;
|
|
24
|
+
colorway: string;
|
|
25
|
+
gridcolor: string;
|
|
26
|
+
linecolor: string;
|
|
27
|
+
zerolinecolor: string;
|
|
28
|
+
activecolor: string;
|
|
29
|
+
rangebgcolor: string;
|
|
30
|
+
area_color: string;
|
|
31
|
+
trend_color: string;
|
|
32
|
+
line_color: string;
|
|
33
|
+
error_band_line_color: string;
|
|
34
|
+
error_band_fill_color: string;
|
|
35
|
+
ohlc_increasing: string;
|
|
36
|
+
ohlc_decreasing: string;
|
|
37
|
+
}>): Promise<ChartModel>;
|
|
25
38
|
/**
|
|
26
39
|
* Creates a model from the settings provided.
|
|
27
40
|
* Tries to create a Figure in the API with it.
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @returns
|
|
41
|
+
* @param settings The chart builder settings
|
|
42
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
43
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
44
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
45
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
46
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
47
|
+
* @param table The table to build the model for
|
|
48
|
+
* @returns The Figure created with the settings provided
|
|
36
49
|
*/
|
|
37
|
-
static makeFigureFromSettings(settings:
|
|
38
|
-
isLinked: boolean;
|
|
39
|
-
series: string[];
|
|
40
|
-
type: string;
|
|
41
|
-
xAxis: string;
|
|
42
|
-
hiddenSeries?: string[] | undefined;
|
|
43
|
-
}, table: dh.Table): Promise<dh.plot.Figure>;
|
|
50
|
+
static makeFigureFromSettings(settings: ChartModelSettings, table: Table): Promise<Figure>;
|
|
44
51
|
/**
|
|
45
52
|
* Creates a model from the settings provided.
|
|
46
53
|
* Tries to create a Figure in the API with it.
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @returns
|
|
54
|
+
* @param settings The chart builder settings
|
|
55
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
56
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
57
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
58
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
59
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
60
|
+
* @param figure The figure to build the model for
|
|
61
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
62
|
+
* @returns The FigureChartModel representing the figure
|
|
56
63
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
57
64
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
58
65
|
*/
|
|
59
|
-
static makeModel(settings:
|
|
66
|
+
static makeModel(settings: Record<string, unknown> | undefined, figure: Figure, theme?: Readonly<{
|
|
67
|
+
paper_bgcolor: string;
|
|
68
|
+
plot_bgcolor: string;
|
|
69
|
+
title_color: string;
|
|
70
|
+
colorway: string;
|
|
71
|
+
gridcolor: string;
|
|
72
|
+
linecolor: string;
|
|
73
|
+
zerolinecolor: string;
|
|
74
|
+
activecolor: string;
|
|
75
|
+
rangebgcolor: string;
|
|
76
|
+
area_color: string;
|
|
77
|
+
trend_color: string;
|
|
78
|
+
line_color: string;
|
|
79
|
+
error_band_line_color: string;
|
|
80
|
+
error_band_fill_color: string;
|
|
81
|
+
ohlc_increasing: string;
|
|
82
|
+
ohlc_decreasing: string;
|
|
83
|
+
}>): Promise<ChartModel>;
|
|
60
84
|
}
|
|
61
|
-
|
|
85
|
+
export default ChartModelFactory;
|
|
62
86
|
//# sourceMappingURL=ChartModelFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;OAcG;WACU,qBAAqB,CAChC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IAQtB;;;;;;;;;;;OAWG;WACU,sBAAsB,CACjC,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;OAcG;WACU,SAAS,CACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,MAAM,EAAE,MAAM,EACd,KAAK;;;;;;;;;;;;;;;;;MAAa,GACjB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -11,15 +11,15 @@ class ChartModelFactory {
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates a model from the settings provided.
|
|
13
13
|
* Tries to create a Figure in the API with it.
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @returns
|
|
14
|
+
* @param settings The chart builder settings
|
|
15
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
16
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
17
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
18
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
19
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
20
|
+
* @param table The table to build the model for
|
|
21
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
22
|
+
* @returns The ChartModel Promise representing the figure
|
|
23
23
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
24
24
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
25
25
|
*/
|
|
@@ -34,21 +34,21 @@ class ChartModelFactory {
|
|
|
34
34
|
/**
|
|
35
35
|
* Creates a model from the settings provided.
|
|
36
36
|
* Tries to create a Figure in the API with it.
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @param
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @returns
|
|
37
|
+
* @param settings The chart builder settings
|
|
38
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
39
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
40
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
41
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
42
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
43
|
+
* @param table The table to build the model for
|
|
44
|
+
* @returns The Figure created with the settings provided
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
static makeFigureFromSettings(settings, table) {
|
|
49
49
|
return _asyncToGenerator(function* () {
|
|
50
50
|
// Copy the table first and then re-apply the filters from the original table
|
|
51
|
-
// When we add
|
|
51
|
+
// When we add toable linking we'll want to listen to the original table and update
|
|
52
52
|
// the copied table with any changes that occur.
|
|
53
53
|
// The table gets owned by the Figure that gets created, which closes the table
|
|
54
54
|
var tableCopy = yield table.copy();
|
|
@@ -61,15 +61,15 @@ class ChartModelFactory {
|
|
|
61
61
|
/**
|
|
62
62
|
* Creates a model from the settings provided.
|
|
63
63
|
* Tries to create a Figure in the API with it.
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
70
|
-
* @param
|
|
71
|
-
* @param
|
|
72
|
-
* @returns
|
|
64
|
+
* @param settings The chart builder settings
|
|
65
|
+
* @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
|
|
66
|
+
* @param settings.series The column names to use for creating the series of this chart
|
|
67
|
+
* @param settings.type Chart builder type, from ChartBuilder.types
|
|
68
|
+
* @param settings.xAxis The column name to use for the x-axis
|
|
69
|
+
* @param [settings.hiddenSeries] Array of hidden series names
|
|
70
|
+
* @param figure The figure to build the model for
|
|
71
|
+
* @param theme The theme for the figure. Defaults to ChartTheme
|
|
72
|
+
* @returns The FigureChartModel representing the figure
|
|
73
73
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
74
74
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
75
75
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/ChartModelFactory.ts"],"names":["dh","ChartUtils","FigureChartModel","ChartTheme","ChartModelFactory","makeModelFromSettings","settings","table","theme","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAkC,uBAAlC;OACOC,U;OACAC,gB;OACAC,U;;AAGP,MAAMC,iBAAN,CAAwB;AACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACoC,SAArBC,qBAAqB,CAChCC,QADgC,EAEhCC,KAFgC,EAIX;AAAA;AAAA;AAAA,UADrBC,KACqB,0EADbL,UACa;AACrB,UAAMM,MAAM,SAASL,iBAAiB,CAACM,sBAAlB,CACnBJ,QADmB,EAEnBC,KAFmB,CAArB;AAIA,aAAO,IAAIL,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;AALqB;AAMtB;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACqC,SAAtBE,sBAAsB,CACjCJ,QADiC,EAEjCC,KAFiC,EAGhB;AAAA;AACjB;AACA;AACA;AACA;AACA,UAAMI,SAAS,SAASJ,KAAK,CAACK,IAAN,EAAxB;AACAD,MAAAA,SAAS,CAACE,kBAAV,CAA6BN,KAAK,CAACO,aAAnC;AACAH,MAAAA,SAAS,CAACI,WAAV,CAAsBR,KAAK,CAACS,MAA5B;AACAL,MAAAA,SAAS,CAACM,SAAV,CAAoBV,KAAK,CAACW,IAA1B;AAEA,aAAOlB,EAAE,CAACmB,IAAH,CAAQC,MAAR,CAAeC,MAAf,CACLpB,UAAU,CAACqB,kBAAX,CAA8BhB,QAA9B,EAAwCK,SAAxC,CADK,CAAP;AAViB;AAalB;AAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACwB,SAATY,SAAS,CACpBjB,QADoB,EAEpBG,MAFoB,EAIC;AAAA;AAAA;AAAA,UADrBD,KACqB,6EADbL,UACa;AACrB,aAAO,IAAID,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;AADqB;AAEtB;;AA/EqB;;AAkFxB,eAAeJ,iBAAf","sourcesContent":["import dh, { Figure, Table } from '@deephaven/jsapi-shim';\nimport ChartUtils, { ChartModelSettings } from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\nimport ChartModel from './ChartModel';\n\nclass ChartModelFactory {\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The ChartModel Promise representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModelFromSettings(\n settings: ChartModelSettings,\n table: Table,\n theme = ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n settings,\n table\n );\n return new FigureChartModel(figure, settings, theme);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param table The table to build the model for\n * @returns The Figure created with the settings provided\n */\n static async makeFigureFromSettings(\n settings: ChartModelSettings,\n table: Table\n ): Promise<Figure> {\n // Copy the table first and then re-apply the filters from the original table\n // When we add toable linking we'll want to listen to the original table and update\n // the copied table with any changes that occur.\n // The table gets owned by the Figure that gets created, which closes the table\n const tableCopy = await table.copy();\n tableCopy.applyCustomColumns(table.customColumns);\n tableCopy.applyFilter(table.filter);\n tableCopy.applySort(table.sort);\n\n return dh.plot.Figure.create(\n ChartUtils.makeFigureSettings(settings, tableCopy)\n );\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param settings The chart builder settings\n * @param settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param settings.series The column names to use for creating the series of this chart\n * @param settings.type Chart builder type, from ChartBuilder.types\n * @param settings.xAxis The column name to use for the x-axis\n * @param [settings.hiddenSeries] Array of hidden series names\n * @param figure The figure to build the model for\n * @param theme The theme for the figure. Defaults to ChartTheme\n * @returns The FigureChartModel representing the figure\n * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel\n * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel\n */\n static async makeModel(\n settings: Record<string, unknown> | undefined,\n figure: Figure,\n theme = ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"file":"ChartModelFactory.js"}
|
package/dist/ChartTestUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { Axis, Chart, Figure, Series, SeriesDataSource } from '@deephaven/jsapi-shim';
|
|
2
2
|
declare class ChartTestUtils {
|
|
3
3
|
static DEFAULT_CHART_TITLE: string;
|
|
4
4
|
static DEFAULT_X_TITLE: string;
|
|
@@ -8,30 +8,31 @@ declare class ChartTestUtils {
|
|
|
8
8
|
label?: string | undefined;
|
|
9
9
|
type?: import("@deephaven/jsapi-shim").AxisType | undefined;
|
|
10
10
|
position?: import("@deephaven/jsapi-shim").AxisPosition | undefined;
|
|
11
|
-
formatType?:
|
|
11
|
+
formatType?: unknown;
|
|
12
12
|
formatPattern?: string | undefined;
|
|
13
13
|
log?: boolean | undefined;
|
|
14
|
-
}):
|
|
15
|
-
static makeDefaultAxes():
|
|
16
|
-
static makeSource({ axis }: {
|
|
17
|
-
axis
|
|
18
|
-
}):
|
|
19
|
-
static makeDefaultSources():
|
|
14
|
+
}): Axis;
|
|
15
|
+
static makeDefaultAxes(): Axis[];
|
|
16
|
+
static makeSource({ axis, }: {
|
|
17
|
+
axis: Axis;
|
|
18
|
+
}): SeriesDataSource;
|
|
19
|
+
static makeDefaultSources(): SeriesDataSource[];
|
|
20
20
|
static makeSeries({ name, plotStyle, sources, lineColor, shapeColor, }?: {
|
|
21
21
|
name?: string | undefined;
|
|
22
22
|
plotStyle?: import("@deephaven/jsapi-shim").SeriesPlotStyle | undefined;
|
|
23
|
-
sources?:
|
|
23
|
+
sources?: SeriesDataSource[] | undefined;
|
|
24
24
|
lineColor?: null | undefined;
|
|
25
25
|
shapeColor?: null | undefined;
|
|
26
|
-
}):
|
|
26
|
+
}): Series;
|
|
27
27
|
static makeChart({ title, series, axes, }?: {
|
|
28
28
|
title?: string | undefined;
|
|
29
|
-
series?:
|
|
30
|
-
axes?:
|
|
31
|
-
}):
|
|
29
|
+
series?: Series[] | undefined;
|
|
30
|
+
axes?: Axis[] | undefined;
|
|
31
|
+
}): Chart;
|
|
32
32
|
static makeFigure({ title, charts, }?: {
|
|
33
33
|
title?: string | undefined;
|
|
34
|
-
charts?:
|
|
35
|
-
}):
|
|
34
|
+
charts?: Chart[] | undefined;
|
|
35
|
+
}): Figure;
|
|
36
36
|
}
|
|
37
|
+
export default ChartTestUtils;
|
|
37
38
|
//# sourceMappingURL=ChartTestUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTestUtils.d.ts","sourceRoot":"","sources":["../src/ChartTestUtils.
|
|
1
|
+
{"version":3,"file":"ChartTestUtils.d.ts","sourceRoot":"","sources":["../src/ChartTestUtils.ts"],"names":[],"mappings":"AAAA,OAAW,EACT,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAE/B,cAAM,cAAc;IAClB,MAAM,CAAC,mBAAmB,SAAiB;IAE3C,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,mBAAmB,SAAc;IAExC,MAAM,CAAC,QAAQ,CAAC,EACd,KAAc,EACd,IAAyB,EACzB,QAAsC,EACtC,UAAuC,EACvC,aAA6B,EAC7B,GAAW,GACZ;;;;;;;KAAK,GAAG,IAAI;IAYb,MAAM,CAAC,eAAe,IAAI,IAAI,EAAE;IAahC,MAAM,CAAC,UAAU,CAAC,EAChB,IAAgC,GACjC,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;KACZ,GAAG,gBAAgB;IAKpB,MAAM,CAAC,kBAAkB,IAAI,gBAAgB,EAAE;IAK/C,MAAM,CAAC,UAAU,CAAC,EAChB,IAAyC,EACzC,SAA2C,EAC3C,OAA6C,EAC7C,SAAgB,EAChB,UAAiB,GAClB;;;;;;KAAK,GAAG,MAAM;IAWf,MAAM,CAAC,SAAS,CAAC,EACf,KAA0C,EAC1C,MAAsC,EACtC,IAAuC,GACxC;;;;KAAK,GAAG,KAAK;IAKd,MAAM,CAAC,UAAU,CAAC,EAChB,KAAgB,EAChB,MAAqC,GACtC;;;KAAK,GAAG,MAAM;CAIhB;AAED,eAAe,cAAc,CAAC"}
|
package/dist/ChartTestUtils.js
CHANGED
|
@@ -12,6 +12,7 @@ class ChartTestUtils {
|
|
|
12
12
|
formatPattern = '###,###0.00',
|
|
13
13
|
log = false
|
|
14
14
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
16
|
return new dh.Axis({
|
|
16
17
|
label,
|
|
17
18
|
type,
|
|
@@ -36,6 +37,7 @@ class ChartTestUtils {
|
|
|
36
37
|
var {
|
|
37
38
|
axis = ChartTestUtils.makeAxis()
|
|
38
39
|
} = _ref;
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
39
41
|
return new dh.SeriesDataSource({
|
|
40
42
|
axis,
|
|
41
43
|
type: axis.type
|
|
@@ -57,6 +59,7 @@ class ChartTestUtils {
|
|
|
57
59
|
lineColor = null,
|
|
58
60
|
shapeColor = null
|
|
59
61
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
63
|
return new dh.Series(name, plotStyle, sources, lineColor, shapeColor);
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -66,6 +69,7 @@ class ChartTestUtils {
|
|
|
66
69
|
series = [ChartTestUtils.makeSeries()],
|
|
67
70
|
axes = ChartTestUtils.makeDefaultAxes()
|
|
68
71
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
73
|
return new dh.Chart({
|
|
70
74
|
title,
|
|
71
75
|
series,
|
|
@@ -78,6 +82,7 @@ class ChartTestUtils {
|
|
|
78
82
|
title = 'Figure',
|
|
79
83
|
charts = [ChartTestUtils.makeChart()]
|
|
80
84
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
86
|
return new dh.plot.Figure({
|
|
82
87
|
title,
|
|
83
88
|
charts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/ChartTestUtils.ts"],"names":["dh","ChartTestUtils","makeAxis","label","type","plot","AxisType","X","position","AxisPosition","BOTTOM","formatType","Axis","FORMAT_TYPE_NUMBER","formatPattern","log","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","axis","SeriesDataSource","makeDefaultSources","axes","map","makeSeries","name","DEFAULT_SERIES_NAME","plotStyle","SeriesPlotStyle","SCATTER","sources","lineColor","shapeColor","Series","makeChart","title","DEFAULT_CHART_TITLE","series","Chart","makeFigure","charts","Figure"],"mappings":";;AAAA,OAAOA,EAAP,MAMO,uBANP;;AAQA,MAAMC,cAAN,CAAqB;AASJ,SAAR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vFkB;;gBAAfzC,c,yBACyB,a;;gBADzBA,c,qBAGqB,Q;;gBAHrBA,c,qBAKqB,Q;;gBALrBA,c,yBAOyB,U;;AAmF/B,eAAeA,cAAf","sourcesContent":["import dh, {\n Axis,\n Chart,\n Figure,\n Series,\n SeriesDataSource,\n} from '@deephaven/jsapi-shim';\n\nclass ChartTestUtils {\n static DEFAULT_CHART_TITLE = 'Chart Title';\n\n static DEFAULT_X_TITLE = 'X Axis';\n\n static DEFAULT_Y_TITLE = 'Y Axis';\n\n static DEFAULT_SERIES_NAME = 'MySeries';\n\n static makeAxis({\n label = 'Axis',\n type = dh.plot.AxisType.X,\n position = dh.plot.AxisPosition.BOTTOM,\n formatType = dh.Axis.FORMAT_TYPE_NUMBER,\n formatPattern = '###,###0.00',\n log = false,\n } = {}): Axis {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Axis({\n label,\n type,\n position,\n formatType,\n formatPattern,\n log,\n });\n }\n\n static makeDefaultAxes(): Axis[] {\n return [\n ChartTestUtils.makeAxis({\n label: ChartTestUtils.DEFAULT_X_TITLE,\n type: dh.plot.AxisType.X,\n }),\n ChartTestUtils.makeAxis({\n label: ChartTestUtils.DEFAULT_Y_TITLE,\n type: dh.plot.AxisType.Y,\n }),\n ];\n }\n\n static makeSource({\n axis = ChartTestUtils.makeAxis(),\n }: {\n axis: Axis;\n }): SeriesDataSource {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).SeriesDataSource({ axis, type: axis.type });\n }\n\n static makeDefaultSources(): SeriesDataSource[] {\n const axes = ChartTestUtils.makeDefaultAxes();\n return axes.map(axis => ChartTestUtils.makeSource({ axis }));\n }\n\n static makeSeries({\n name = ChartTestUtils.DEFAULT_SERIES_NAME,\n plotStyle = dh.plot.SeriesPlotStyle.SCATTER,\n sources = ChartTestUtils.makeDefaultSources(),\n lineColor = null,\n shapeColor = null,\n } = {}): Series {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Series(\n name,\n plotStyle,\n sources,\n lineColor,\n shapeColor\n );\n }\n\n static makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [ChartTestUtils.makeSeries()],\n axes = ChartTestUtils.makeDefaultAxes(),\n } = {}): Chart {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Chart({ title, series, axes });\n }\n\n static makeFigure({\n title = 'Figure',\n charts = [ChartTestUtils.makeChart()],\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).plot.Figure({ title, charts });\n }\n}\n\nexport default ChartTestUtils;\n"],"file":"ChartTestUtils.js"}
|
package/dist/ChartTheme.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
declare
|
|
2
|
-
paper_bgcolor:
|
|
3
|
-
plot_bgcolor:
|
|
4
|
-
title_color:
|
|
5
|
-
colorway:
|
|
6
|
-
gridcolor:
|
|
7
|
-
linecolor:
|
|
8
|
-
zerolinecolor:
|
|
9
|
-
activecolor:
|
|
10
|
-
rangebgcolor:
|
|
11
|
-
area_color:
|
|
12
|
-
trend_color:
|
|
13
|
-
line_color:
|
|
14
|
-
error_band_line_color:
|
|
15
|
-
error_band_fill_color:
|
|
16
|
-
ohlc_increasing:
|
|
17
|
-
ohlc_decreasing:
|
|
1
|
+
declare const _default: Readonly<{
|
|
2
|
+
paper_bgcolor: string;
|
|
3
|
+
plot_bgcolor: string;
|
|
4
|
+
title_color: string;
|
|
5
|
+
colorway: string;
|
|
6
|
+
gridcolor: string;
|
|
7
|
+
linecolor: string;
|
|
8
|
+
zerolinecolor: string;
|
|
9
|
+
activecolor: string;
|
|
10
|
+
rangebgcolor: string;
|
|
11
|
+
area_color: string;
|
|
12
|
+
trend_color: string;
|
|
13
|
+
line_color: string;
|
|
14
|
+
error_band_line_color: string;
|
|
15
|
+
error_band_fill_color: string;
|
|
16
|
+
ohlc_increasing: string;
|
|
17
|
+
ohlc_decreasing: string;
|
|
18
18
|
}>;
|
|
19
19
|
export default _default;
|
|
20
20
|
//# sourceMappingURL=ChartTheme.d.ts.map
|
package/dist/ChartTheme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.
|
|
1
|
+
{"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,wBAiBG"}
|
package/dist/ChartTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/ChartTheme.ts"],"names":["ChartTheme","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","colorway","gridcolor","linecolor","zerolinecolor","activecolor","rangebgcolor","area_color","trend_color","line_color","error_band_line_color","error_band_fill_color","ohlc_increasing","ohlc_decreasing"],"mappings":"OAAOA,U;AAEP,eAAeC,MAAM,CAACC,MAAP,CAAc;AAC3BC,EAAAA,aAAa,EAAEH,UAAU,CAAC,eAAD,CADE;AAE3BI,EAAAA,YAAY,EAAEJ,UAAU,CAAC,cAAD,CAFG;AAG3BK,EAAAA,WAAW,EAAEL,UAAU,CAAC,aAAD,CAHI;AAI3BM,EAAAA,QAAQ,EAAEN,UAAU,CAACM,QAJM;AAK3BC,EAAAA,SAAS,EAAEP,UAAU,CAACO,SALK;AAM3BC,EAAAA,SAAS,EAAER,UAAU,CAACQ,SANK;AAO3BC,EAAAA,aAAa,EAAET,UAAU,CAACS,aAPC;AAQ3BC,EAAAA,WAAW,EAAEV,UAAU,CAACU,WARG;AAS3BC,EAAAA,YAAY,EAAEX,UAAU,CAACW,YATE;AAU3BC,EAAAA,UAAU,EAAEZ,UAAU,CAAC,YAAD,CAVK;AAW3Ba,EAAAA,WAAW,EAAEb,UAAU,CAAC,aAAD,CAXI;AAY3Bc,EAAAA,UAAU,EAAEd,UAAU,CAAC,YAAD,CAZK;AAa3Be,EAAAA,qBAAqB,EAAEf,UAAU,CAAC,uBAAD,CAbN;AAc3BgB,EAAAA,qBAAqB,EAAEhB,UAAU,CAAC,uBAAD,CAdN;AAe3BiB,EAAAA,eAAe,EAAEjB,UAAU,CAAC,iBAAD,CAfA;AAgB3BkB,EAAAA,eAAe,EAAElB,UAAU,CAAC,iBAAD;AAhBA,CAAd,CAAf","sourcesContent":["import ChartTheme from './ChartTheme.module.scss';\n\nexport default Object.freeze({\n paper_bgcolor: ChartTheme['paper-bgcolor'],\n plot_bgcolor: ChartTheme['plot-bgcolor'],\n title_color: ChartTheme['title-color'],\n colorway: ChartTheme.colorway,\n gridcolor: ChartTheme.gridcolor,\n linecolor: ChartTheme.linecolor,\n zerolinecolor: ChartTheme.zerolinecolor,\n activecolor: ChartTheme.activecolor,\n rangebgcolor: ChartTheme.rangebgcolor,\n area_color: ChartTheme['area-color'],\n trend_color: ChartTheme['trend-color'],\n line_color: ChartTheme['line-color'],\n error_band_line_color: ChartTheme['error-band-line-color'],\n error_band_fill_color: ChartTheme['error-band-fill-color'],\n ohlc_increasing: ChartTheme['ohlc-increasing'],\n ohlc_decreasing: ChartTheme['ohlc-decreasing'],\n});\n"],"file":"ChartTheme.js"}
|