@deephaven/chart 0.53.1-layout-manager.4 → 0.54.0
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.css +4 -0
- package/dist/Chart.css.map +1 -1
- package/dist/Chart.d.ts +12 -1
- package/dist/Chart.d.ts.map +1 -1
- package/dist/Chart.js +96 -9
- package/dist/Chart.js.map +1 -1
- package/dist/ChartModel.d.ts +2 -0
- package/dist/ChartModel.d.ts.map +1 -1
- package/dist/ChartModel.js +6 -0
- package/dist/ChartModel.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/ChartTestUtils.d.ts +2 -1
- package/dist/ChartTestUtils.d.ts.map +1 -1
- package/dist/ChartTestUtils.js +4 -2
- package/dist/ChartTestUtils.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/DownsamplingError.d.ts +5 -0
- package/dist/DownsamplingError.d.ts.map +1 -0
- package/dist/DownsamplingError.js +11 -0
- package/dist/DownsamplingError.js.map +1 -0
- package/dist/FigureChartModel.d.ts +4 -3
- package/dist/FigureChartModel.d.ts.map +1 -1
- package/dist/FigureChartModel.js +15 -11
- 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 +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -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
package/dist/ChartModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","_defineProperty","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"],"sources":["../src/ChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport type { Layout, Data } from 'plotly.js';\nimport { FilterColumnMap, FilterMap } from './ChartUtils';\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(dh: DhType) {\n this.dh = dh;\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\n\n dh: DhType;\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<Data>[] {\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: FilterMap): 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"],"mappings":";;;AAAA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","dh","_defineProperty","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","fireError","EVENT_ERROR"],"sources":["../src/ChartModel.ts"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\n\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { Formatter } from '@deephaven/jsapi-utils';\nimport type { Layout, Data } from 'plotly.js';\nimport { FilterColumnMap, FilterMap } from './ChartUtils';\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 static EVENT_ERROR = 'ChartModel.EVENT_ERROR';\n\n constructor(dh: DhType) {\n this.dh = dh;\n this.listeners = [];\n this.isDownsamplingDisabled = false;\n }\n\n dh: DhType;\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<Data>[] {\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: FilterMap): 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 fireError(detail: string[]): void {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_ERROR, { detail }));\n }\n}\n\nexport default ChartModel;\n"],"mappings":";;;AAAA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;EAmBfC,WAAWA,CAACC,EAAU,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IACtB,IAAI,CAACD,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACE,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,sBAAsB,GAAG,KAAK;EACrC;EAcAC,OAAOA,CAAA,EAAoB;IACzB,OAAO,EAAE;EACX;EAEAC,eAAeA,CAAA,EAAW;IACxB,OAAO,EAAE;EACX;EAEAC,SAASA,CAAA,EAAoB;IAC3B,OAAO,CAAC,CAAC;EACX;EAEAC,kBAAkBA,CAAA,EAAoB;IACpC,OAAO,IAAIC,GAAG,CAAC,CAAC;EAClB;EAE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AU,6BAOmB,oCAAoC;AAAAG,eAAA,CAPjEH,UAAU,8BASoB,qCAAqC;AAAAG,eAAA,CATnEH,UAAU,4BAWkB,mCAAmC;AAAAG,eAAA,CAX/DH,UAAU,4BAakB,mCAAmC;AAAAG,eAAA,CAb/DH,UAAU,wBAec,+BAA+B;AAAAG,eAAA,CAfvDH,UAAU,iBAiBO,wBAAwB;AA4I/C,eAAeA,UAAU"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';
|
|
2
2
|
import { ChartModelSettings } from './ChartUtils';
|
|
3
|
+
import { ChartTheme } from './ChartTheme';
|
|
3
4
|
import ChartModel from './ChartModel';
|
|
4
5
|
declare class ChartModelFactory {
|
|
5
6
|
/**
|
|
@@ -13,29 +14,12 @@ declare class ChartModelFactory {
|
|
|
13
14
|
* @param settings.xAxis The column name to use for the x-axis
|
|
14
15
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
15
16
|
* @param table The table to build the model for
|
|
16
|
-
* @param theme The theme for the figure
|
|
17
|
+
* @param theme The theme for the figure
|
|
17
18
|
* @returns The ChartModel Promise representing the figure
|
|
18
19
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
19
20
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
20
21
|
*/
|
|
21
|
-
static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme
|
|
22
|
-
paper_bgcolor: string;
|
|
23
|
-
plot_bgcolor: string;
|
|
24
|
-
title_color: string;
|
|
25
|
-
colorway: string;
|
|
26
|
-
gridcolor: string;
|
|
27
|
-
linecolor: string;
|
|
28
|
-
zerolinecolor: string;
|
|
29
|
-
activecolor: string;
|
|
30
|
-
rangebgcolor: string;
|
|
31
|
-
area_color: string;
|
|
32
|
-
trend_color: string;
|
|
33
|
-
line_color: string;
|
|
34
|
-
error_band_line_color: string;
|
|
35
|
-
error_band_fill_color: string;
|
|
36
|
-
ohlc_increasing: string;
|
|
37
|
-
ohlc_decreasing: string;
|
|
38
|
-
}>): Promise<ChartModel>;
|
|
22
|
+
static makeModelFromSettings(dh: DhType, settings: ChartModelSettings, table: Table, theme: ChartTheme): Promise<ChartModel>;
|
|
39
23
|
/**
|
|
40
24
|
* Creates a model from the settings provided.
|
|
41
25
|
* Tries to create a Figure in the API with it.
|
|
@@ -61,29 +45,12 @@ declare class ChartModelFactory {
|
|
|
61
45
|
* @param settings.xAxis The column name to use for the x-axis
|
|
62
46
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
63
47
|
* @param figure The figure to build the model for
|
|
64
|
-
* @param theme The theme for the figure
|
|
48
|
+
* @param theme The theme for the figure
|
|
65
49
|
* @returns The FigureChartModel representing the figure
|
|
66
50
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
67
51
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
68
52
|
*/
|
|
69
|
-
static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme
|
|
70
|
-
paper_bgcolor: string;
|
|
71
|
-
plot_bgcolor: string;
|
|
72
|
-
title_color: string;
|
|
73
|
-
colorway: string;
|
|
74
|
-
gridcolor: string;
|
|
75
|
-
linecolor: string;
|
|
76
|
-
zerolinecolor: string;
|
|
77
|
-
activecolor: string;
|
|
78
|
-
rangebgcolor: string;
|
|
79
|
-
area_color: string;
|
|
80
|
-
trend_color: string;
|
|
81
|
-
line_color: string;
|
|
82
|
-
error_band_line_color: string;
|
|
83
|
-
error_band_fill_color: string;
|
|
84
|
-
ohlc_increasing: string;
|
|
85
|
-
ohlc_decreasing: string;
|
|
86
|
-
}>): Promise<ChartModel>;
|
|
53
|
+
static makeModel(dh: DhType, settings: ChartModelSettings | undefined, figure: Figure, theme: ChartTheme): Promise<ChartModel>;
|
|
87
54
|
}
|
|
88
55
|
export default ChartModelFactory;
|
|
89
56
|
//# sourceMappingURL=ChartModelFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,cAAM,iBAAiB;IACrB;;;;;;;;;;;;;;;OAeG;WACU,qBAAqB,CAChC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;IAStB;;;;;;;;;;;;OAYG;WACU,sBAAsB,CACjC,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,KAAK,GACX,OAAO,CAAC,MAAM,CAAC;IAelB;;;;;;;;;;;;;;;OAeG;WACU,SAAS,CACpB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,kBAAkB,GAAG,SAAS,EACxC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,UAAU,CAAC;CAGvB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,7 +2,6 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
2
2
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
3
3
|
import ChartUtils from "./ChartUtils.js";
|
|
4
4
|
import FigureChartModel from "./FigureChartModel.js";
|
|
5
|
-
import ChartTheme from "./ChartTheme.js";
|
|
6
5
|
class ChartModelFactory {
|
|
7
6
|
/**
|
|
8
7
|
* Creates a model from the settings provided.
|
|
@@ -15,17 +14,15 @@ class ChartModelFactory {
|
|
|
15
14
|
* @param settings.xAxis The column name to use for the x-axis
|
|
16
15
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
17
16
|
* @param table The table to build the model for
|
|
18
|
-
* @param theme The theme for the figure
|
|
17
|
+
* @param theme The theme for the figure
|
|
19
18
|
* @returns The ChartModel Promise representing the figure
|
|
20
19
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
21
20
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
22
21
|
*/
|
|
23
|
-
static makeModelFromSettings(dh, settings, table) {
|
|
24
|
-
var _arguments = arguments;
|
|
22
|
+
static makeModelFromSettings(dh, settings, table, theme) {
|
|
25
23
|
return _asyncToGenerator(function* () {
|
|
26
|
-
var theme = _arguments.length > 3 && _arguments[3] !== undefined ? _arguments[3] : ChartTheme;
|
|
27
24
|
var figure = yield ChartModelFactory.makeFigureFromSettings(dh, settings, table);
|
|
28
|
-
return new FigureChartModel(dh, figure,
|
|
25
|
+
return new FigureChartModel(dh, figure, theme, settings);
|
|
29
26
|
})();
|
|
30
27
|
}
|
|
31
28
|
|
|
@@ -67,16 +64,14 @@ class ChartModelFactory {
|
|
|
67
64
|
* @param settings.xAxis The column name to use for the x-axis
|
|
68
65
|
* @param [settings.hiddenSeries] Array of hidden series names
|
|
69
66
|
* @param figure The figure to build the model for
|
|
70
|
-
* @param theme The theme for the figure
|
|
67
|
+
* @param theme The theme for the figure
|
|
71
68
|
* @returns The FigureChartModel representing the figure
|
|
72
69
|
* CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
|
|
73
70
|
* This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
|
|
74
71
|
*/
|
|
75
|
-
static makeModel(dh, settings, figure) {
|
|
76
|
-
var _arguments2 = arguments;
|
|
72
|
+
static makeModel(dh, settings, figure, theme) {
|
|
77
73
|
return _asyncToGenerator(function* () {
|
|
78
|
-
|
|
79
|
-
return new FigureChartModel(dh, figure, settings, theme);
|
|
74
|
+
return new FigureChartModel(dh, figure, theme, settings);
|
|
80
75
|
})();
|
|
81
76
|
}
|
|
82
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","
|
|
1
|
+
{"version":3,"file":"ChartModelFactory.js","names":["ChartUtils","FigureChartModel","ChartModelFactory","makeModelFromSettings","dh","settings","table","theme","_asyncToGenerator","figure","makeFigureFromSettings","tableCopy","copy","applyCustomColumns","customColumns","applyFilter","filter","applySort","sort","plot","Figure","create","makeFigureSettings","makeModel"],"sources":["../src/ChartModelFactory.ts"],"sourcesContent":["import type { dh as DhType, Figure, Table } from '@deephaven/jsapi-types';\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 dh JSAPI instance\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\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 dh: DhType,\n settings: ChartModelSettings,\n table: Table,\n theme: ChartTheme\n ): Promise<ChartModel> {\n const figure = await ChartModelFactory.makeFigureFromSettings(\n dh,\n settings,\n table\n );\n return new FigureChartModel(dh, figure, theme, settings);\n }\n\n /**\n * Creates a model from the settings provided.\n * Tries to create a Figure in the API with it.\n * @param dh DH JSAPI instance\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 dh: DhType,\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 table 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 new ChartUtils(dh).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 dh DH JSAPI instance\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\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 dh: DhType,\n settings: ChartModelSettings | undefined,\n figure: Figure,\n theme: ChartTheme\n ): Promise<ChartModel> {\n return new FigureChartModel(dh, figure, theme, settings);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;OACOA,UAAU;AAAA,OACVC,gBAAgB;AAIvB,MAAMC,iBAAiB,CAAC;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaC,qBAAqBA,CAChCC,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACZC,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,IAAMC,MAAM,SAASP,iBAAiB,CAACQ,sBAAsB,CAC3DN,EAAE,EACFC,QAAQ,EACRC,KACF,CAAC;MACD,OAAO,IAAIL,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaK,sBAAsBA,CACjCN,EAAU,EACVC,QAA4B,EAC5BC,KAAY,EACK;IAAA,OAAAE,iBAAA;MACjB;MACA;MACA;MACA;MACA,IAAMG,SAAS,SAASL,KAAK,CAACM,IAAI,CAAC,CAAC;MACpCD,SAAS,CAACE,kBAAkB,CAACP,KAAK,CAACQ,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACT,KAAK,CAACU,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACX,KAAK,CAACY,IAAI,CAAC;MAE/B,OAAOd,EAAE,CAACe,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1B,IAAIrB,UAAU,CAACI,EAAE,CAAC,CAACkB,kBAAkB,CAACjB,QAAQ,EAAEM,SAAS,CAC3D,CAAC;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAASA,CACpBnB,EAAU,EACVC,QAAwC,EACxCI,MAAc,EACdF,KAAiB,EACI;IAAA,OAAAC,iBAAA;MACrB,OAAO,IAAIP,gBAAgB,CAACG,EAAE,EAAEK,MAAM,EAAEF,KAAK,EAAEF,QAAQ,CAAC;IAAC;EAC3D;AACF;AAEA,eAAeH,iBAAiB"}
|
package/dist/ChartTestUtils.d.ts
CHANGED
|
@@ -36,11 +36,12 @@ declare class ChartTestUtils {
|
|
|
36
36
|
row?: number;
|
|
37
37
|
column?: number;
|
|
38
38
|
}): Chart;
|
|
39
|
-
makeFigure({ title, charts, rows, cols, }?: {
|
|
39
|
+
makeFigure({ title, charts, rows, cols, errors, }?: {
|
|
40
40
|
title?: string | undefined;
|
|
41
41
|
charts?: Chart[] | undefined;
|
|
42
42
|
rows?: number | undefined;
|
|
43
43
|
cols?: number | undefined;
|
|
44
|
+
errors?: never[] | undefined;
|
|
44
45
|
}): Figure;
|
|
45
46
|
}
|
|
46
47
|
export default ChartTestUtils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTestUtils.d.ts","sourceRoot":"","sources":["../src/ChartTestUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,EAAE,IAAI,MAAM,EACZ,MAAM,EACN,MAAM,EACN,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,cAAM,cAAc;IAClB,MAAM,CAAC,mBAAmB,SAAiB;IAE3C,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,eAAe,SAAY;IAElC,MAAM,CAAC,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,MAAM,EAAE,CAAC;QAClB,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;QACd,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;KACZ,GAAG,KAAK;IAcd,UAAU,CAAC,EACT,KAAgB,EAChB,MAA2B,EAC3B,IAAQ,EACR,IAAQ,EACR,MAAW,GACZ;;;;;;KAAK,GAAG,MAAM;CAUhB;AAED,eAAe,cAAc,CAAC"}
|
package/dist/ChartTestUtils.js
CHANGED
|
@@ -98,14 +98,16 @@ class ChartTestUtils {
|
|
|
98
98
|
title = 'Figure',
|
|
99
99
|
charts = [this.makeChart()],
|
|
100
100
|
rows = 1,
|
|
101
|
-
cols = 1
|
|
101
|
+
cols = 1,
|
|
102
|
+
errors = []
|
|
102
103
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
103
104
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
105
|
return new this.dh.plot.Figure({
|
|
105
106
|
title,
|
|
106
107
|
charts,
|
|
107
108
|
rows,
|
|
108
|
-
cols
|
|
109
|
+
cols,
|
|
110
|
+
errors
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTestUtils.js","names":["ChartTestUtils","constructor","dh","_defineProperty","makeAxis","label","type","undefined","position","formatType","formatPattern","log","arguments","length","Axis","plot","AxisType","X","AxisPosition","BOTTOM","FORMAT_TYPE_NUMBER","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","_ref","axis","SeriesDataSource","makeDefaultSources","axes","map","makeSeries","name","DEFAULT_SERIES_NAME","plotStyle","sources","lineColor","shapeColor","Series","SeriesPlotStyle","SCATTER","makeChart","title","DEFAULT_CHART_TITLE","series","showLegend","rowspan","colspan","row","column","Chart","makeFigure","charts","rows","cols","Figure"],"sources":["../src/ChartTestUtils.ts"],"sourcesContent":["import type {\n Axis,\n AxisFormatType,\n AxisPosition,\n AxisType,\n Chart,\n dh as DhType,\n Figure,\n Series,\n SeriesDataSource,\n} from '@deephaven/jsapi-types';\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 private dh: DhType;\n\n constructor(dh: DhType) {\n this.dh = dh;\n }\n\n makeAxis({\n label = 'Axis',\n type = undefined,\n position = undefined,\n formatType = undefined,\n formatPattern = '###,###0.00',\n log = false,\n }: {\n label?: string;\n type?: AxisType;\n position?: AxisPosition;\n formatType?: AxisFormatType;\n formatPattern?: string;\n log?: boolean;\n } = {}): Axis {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Axis({\n label,\n type: type ?? dh.plot.AxisType.X,\n position: position ?? dh.plot.AxisPosition.BOTTOM,\n formatType: formatType ?? dh.Axis.FORMAT_TYPE_NUMBER,\n formatPattern,\n log,\n });\n }\n\n makeDefaultAxes(): Axis[] {\n const { dh } = this;\n return [\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_X_TITLE,\n type: dh.plot.AxisType.X,\n }),\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_Y_TITLE,\n type: dh.plot.AxisType.Y,\n }),\n ];\n }\n\n makeSource({ axis = this.makeAxis() }: { axis: Axis }): SeriesDataSource {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).SeriesDataSource({ axis, type: axis.type });\n }\n\n makeDefaultSources(): SeriesDataSource[] {\n const axes = this.makeDefaultAxes();\n return axes.map(axis => this.makeSource({ axis }));\n }\n\n makeSeries({\n name = ChartTestUtils.DEFAULT_SERIES_NAME,\n plotStyle = null,\n sources = this.makeDefaultSources(),\n lineColor = null,\n shapeColor = null,\n } = {}): Series {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Series(\n name,\n plotStyle ?? dh.plot.SeriesPlotStyle.SCATTER,\n sources,\n lineColor,\n shapeColor\n );\n }\n\n makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [this.makeSeries()],\n axes = this.makeDefaultAxes(),\n showLegend = null,\n rowspan = 1,\n colspan = 1,\n row = 0,\n column = 0,\n }: {\n title?: string;\n series?: Series[];\n axes?: Axis[];\n showLegend?: boolean | null;\n rowspan?: number;\n colspan?: number;\n row?: number;\n column?: number;\n } = {}): Chart {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).Chart({\n title,\n series,\n axes,\n showLegend,\n row,\n column,\n rowspan,\n colspan,\n });\n }\n\n makeFigure({\n title = 'Figure',\n charts = [this.makeChart()],\n rows = 1,\n cols = 1,\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).plot.Figure({
|
|
1
|
+
{"version":3,"file":"ChartTestUtils.js","names":["ChartTestUtils","constructor","dh","_defineProperty","makeAxis","label","type","undefined","position","formatType","formatPattern","log","arguments","length","Axis","plot","AxisType","X","AxisPosition","BOTTOM","FORMAT_TYPE_NUMBER","makeDefaultAxes","DEFAULT_X_TITLE","DEFAULT_Y_TITLE","Y","makeSource","_ref","axis","SeriesDataSource","makeDefaultSources","axes","map","makeSeries","name","DEFAULT_SERIES_NAME","plotStyle","sources","lineColor","shapeColor","Series","SeriesPlotStyle","SCATTER","makeChart","title","DEFAULT_CHART_TITLE","series","showLegend","rowspan","colspan","row","column","Chart","makeFigure","charts","rows","cols","errors","Figure"],"sources":["../src/ChartTestUtils.ts"],"sourcesContent":["import type {\n Axis,\n AxisFormatType,\n AxisPosition,\n AxisType,\n Chart,\n dh as DhType,\n Figure,\n Series,\n SeriesDataSource,\n} from '@deephaven/jsapi-types';\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 private dh: DhType;\n\n constructor(dh: DhType) {\n this.dh = dh;\n }\n\n makeAxis({\n label = 'Axis',\n type = undefined,\n position = undefined,\n formatType = undefined,\n formatPattern = '###,###0.00',\n log = false,\n }: {\n label?: string;\n type?: AxisType;\n position?: AxisPosition;\n formatType?: AxisFormatType;\n formatPattern?: string;\n log?: boolean;\n } = {}): Axis {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Axis({\n label,\n type: type ?? dh.plot.AxisType.X,\n position: position ?? dh.plot.AxisPosition.BOTTOM,\n formatType: formatType ?? dh.Axis.FORMAT_TYPE_NUMBER,\n formatPattern,\n log,\n });\n }\n\n makeDefaultAxes(): Axis[] {\n const { dh } = this;\n return [\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_X_TITLE,\n type: dh.plot.AxisType.X,\n }),\n this.makeAxis({\n label: ChartTestUtils.DEFAULT_Y_TITLE,\n type: dh.plot.AxisType.Y,\n }),\n ];\n }\n\n makeSource({ axis = this.makeAxis() }: { axis: Axis }): SeriesDataSource {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).SeriesDataSource({ axis, type: axis.type });\n }\n\n makeDefaultSources(): SeriesDataSource[] {\n const axes = this.makeDefaultAxes();\n return axes.map(axis => this.makeSource({ axis }));\n }\n\n makeSeries({\n name = ChartTestUtils.DEFAULT_SERIES_NAME,\n plotStyle = null,\n sources = this.makeDefaultSources(),\n lineColor = null,\n shapeColor = null,\n } = {}): Series {\n const { dh } = this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (dh as any).Series(\n name,\n plotStyle ?? dh.plot.SeriesPlotStyle.SCATTER,\n sources,\n lineColor,\n shapeColor\n );\n }\n\n makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [this.makeSeries()],\n axes = this.makeDefaultAxes(),\n showLegend = null,\n rowspan = 1,\n colspan = 1,\n row = 0,\n column = 0,\n }: {\n title?: string;\n series?: Series[];\n axes?: Axis[];\n showLegend?: boolean | null;\n rowspan?: number;\n colspan?: number;\n row?: number;\n column?: number;\n } = {}): Chart {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).Chart({\n title,\n series,\n axes,\n showLegend,\n row,\n column,\n rowspan,\n colspan,\n });\n }\n\n makeFigure({\n title = 'Figure',\n charts = [this.makeChart()],\n rows = 1,\n cols = 1,\n errors = [],\n } = {}): Figure {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return new (this.dh as any).plot.Figure({\n title,\n charts,\n rows,\n cols,\n errors,\n });\n }\n}\n\nexport default ChartTestUtils;\n"],"mappings":";;;AAYA,MAAMA,cAAc,CAAC;EAWnBC,WAAWA,CAACC,EAAU,EAAE;IAAAC,eAAA;IACtB,IAAI,CAACD,EAAE,GAAGA,EAAE;EACd;EAEAE,QAAQA,CAAA,EAcM;IAAA,IAdL;MACPC,KAAK,GAAG,MAAM;MACdC,IAAI,GAAGC,SAAS;MAChBC,QAAQ,GAAGD,SAAS;MACpBE,UAAU,GAAGF,SAAS;MACtBG,aAAa,GAAG,aAAa;MAC7BC,GAAG,GAAG;IAQR,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAL,SAAA,GAAAK,SAAA,MAAG,CAAC,CAAC;IACJ,IAAM;MAAEV;IAAG,CAAC,GAAG,IAAI;IACnB;IACA,OAAO,IAAKA,EAAE,CAASY,IAAI,CAAC;MAC1BT,KAAK;MACLC,IAAI,EAAEA,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIJ,EAAE,CAACa,IAAI,CAACC,QAAQ,CAACC,CAAC;MAChCT,QAAQ,EAAEA,QAAQ,aAARA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;IACA,OAAO,IAAK,IAAI,CAACV,EAAE,CAASa,IAAI,CAAC0C,MAAM,CAAC;MACtCd,KAAK;MACLU,MAAM;MACNC,IAAI;MACJC,IAAI;MACJC;IACF,CAAC,CAAC;EACJ;AACF;AAACrD,eAAA,CApIKH,cAAc,yBACW,aAAa;AAAAG,eAAA,CADtCH,cAAc,qBAGO,QAAQ;AAAAG,eAAA,CAH7BH,cAAc,qBAKO,QAAQ;AAAAG,eAAA,CAL7BH,cAAc,yBAOW,UAAU;AA+HzC,eAAeA,cAAc"}
|
package/dist/ChartTheme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export interface ChartTheme {
|
|
2
2
|
paper_bgcolor: string;
|
|
3
3
|
plot_bgcolor: string;
|
|
4
4
|
title_color: string;
|
|
@@ -15,6 +15,7 @@ declare const _default: Readonly<{
|
|
|
15
15
|
error_band_fill_color: string;
|
|
16
16
|
ohlc_increasing: string;
|
|
17
17
|
ohlc_decreasing: string;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
18
|
+
}
|
|
19
|
+
export declare function defaultChartTheme(): Readonly<ChartTheme>;
|
|
20
|
+
export default defaultChartTheme;
|
|
20
21
|
//# 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.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iBAAiB,IAAI,QAAQ,CAAC,UAAU,CAAC,CAmCxD;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/ChartTheme.js
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { getExpressionRanges, resolveCssVariablesInRecord } from '@deephaven/components';
|
|
2
|
+
import Log from '@deephaven/log';
|
|
3
|
+
import { ColorUtils } from '@deephaven/utils';
|
|
4
|
+
import chartThemeRaw from "./ChartTheme.module.css";
|
|
5
|
+
var log = Log.module('ChartTheme');
|
|
6
|
+
export function defaultChartTheme() {
|
|
7
|
+
var _chartTheme$colorway;
|
|
8
|
+
var chartTheme = resolveCssVariablesInRecord(chartThemeRaw);
|
|
9
|
+
|
|
10
|
+
// The color normalization in `resolveCssVariablesInRecord` won't work for
|
|
11
|
+
// colorway since it is an array of colors. We need to explicitly normalize
|
|
12
|
+
// each color expression
|
|
13
|
+
chartTheme.colorway = getExpressionRanges((_chartTheme$colorway = chartTheme.colorway) !== null && _chartTheme$colorway !== void 0 ? _chartTheme$colorway : '').map(_ref => {
|
|
14
|
+
var [start, end] = _ref;
|
|
15
|
+
return ColorUtils.normalizeCssColor(chartTheme.colorway.substring(start, end + 1));
|
|
16
|
+
}).join(' ');
|
|
17
|
+
log.debug2('Chart theme:', chartThemeRaw);
|
|
18
|
+
log.debug2('Chart theme derived:', chartTheme);
|
|
19
|
+
return Object.freeze({
|
|
20
|
+
paper_bgcolor: chartTheme['paper-bgcolor'],
|
|
21
|
+
plot_bgcolor: chartTheme['plot-bgcolor'],
|
|
22
|
+
title_color: chartTheme['title-color'],
|
|
23
|
+
colorway: chartTheme.colorway,
|
|
24
|
+
gridcolor: chartTheme.gridcolor,
|
|
25
|
+
linecolor: chartTheme.linecolor,
|
|
26
|
+
zerolinecolor: chartTheme.zerolinecolor,
|
|
27
|
+
activecolor: chartTheme.activecolor,
|
|
28
|
+
rangebgcolor: chartTheme.rangebgcolor,
|
|
29
|
+
area_color: chartTheme['area-color'],
|
|
30
|
+
trend_color: chartTheme['trend-color'],
|
|
31
|
+
line_color: chartTheme['line-color'],
|
|
32
|
+
error_band_line_color: chartTheme['error-band-line-color'],
|
|
33
|
+
error_band_fill_color: chartTheme['error-band-fill-color'],
|
|
34
|
+
ohlc_increasing: chartTheme['ohlc-increasing'],
|
|
35
|
+
ohlc_decreasing: chartTheme['ohlc-decreasing']
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export default defaultChartTheme;
|
|
20
39
|
//# sourceMappingURL=ChartTheme.js.map
|
package/dist/ChartTheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTheme.js","names":["
|
|
1
|
+
{"version":3,"file":"ChartTheme.js","names":["getExpressionRanges","resolveCssVariablesInRecord","Log","ColorUtils","chartThemeRaw","log","module","defaultChartTheme","_chartTheme$colorway","chartTheme","colorway","map","_ref","start","end","normalizeCssColor","substring","join","debug2","Object","freeze","paper_bgcolor","plot_bgcolor","title_color","gridcolor","linecolor","zerolinecolor","activecolor","rangebgcolor","area_color","trend_color","line_color","error_band_line_color","error_band_fill_color","ohlc_increasing","ohlc_decreasing"],"sources":["../src/ChartTheme.ts"],"sourcesContent":["import {\n getExpressionRanges,\n resolveCssVariablesInRecord,\n} from '@deephaven/components';\nimport Log from '@deephaven/log';\nimport { ColorUtils } from '@deephaven/utils';\nimport chartThemeRaw from './ChartTheme.module.scss';\n\nconst log = Log.module('ChartTheme');\n\nexport interface ChartTheme {\n paper_bgcolor: string;\n plot_bgcolor: string;\n title_color: string;\n colorway: string;\n gridcolor: string;\n linecolor: string;\n zerolinecolor: string;\n activecolor: string;\n rangebgcolor: string;\n area_color: string;\n trend_color: string;\n line_color: string;\n error_band_line_color: string;\n error_band_fill_color: string;\n ohlc_increasing: string;\n ohlc_decreasing: string;\n}\n\nexport function defaultChartTheme(): Readonly<ChartTheme> {\n const chartTheme = resolveCssVariablesInRecord(chartThemeRaw);\n\n // The color normalization in `resolveCssVariablesInRecord` won't work for\n // colorway since it is an array of colors. We need to explicitly normalize\n // each color expression\n chartTheme.colorway = getExpressionRanges(chartTheme.colorway ?? '')\n .map(([start, end]) =>\n ColorUtils.normalizeCssColor(\n chartTheme.colorway.substring(start, end + 1)\n )\n )\n .join(' ');\n\n log.debug2('Chart theme:', chartThemeRaw);\n log.debug2('Chart theme derived:', chartTheme);\n\n return 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}\n\nexport default defaultChartTheme;\n"],"mappings":"AA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,UAAU,CAACmB,YAAY;IACrCC,UAAU,EAAEpB,UAAU,CAAC,YAAY,CAAC;IACpCqB,WAAW,EAAErB,UAAU,CAAC,aAAa,CAAC;IACtCsB,UAAU,EAAEtB,UAAU,CAAC,YAAY,CAAC;IACpCuB,qBAAqB,EAAEvB,UAAU,CAAC,uBAAuB,CAAC;IAC1DwB,qBAAqB,EAAExB,UAAU,CAAC,uBAAuB,CAAC;IAC1DyB,eAAe,EAAEzB,UAAU,CAAC,iBAAiB,CAAC;IAC9C0B,eAAe,EAAE1B,UAAU,CAAC,iBAAiB;EAC/C,CAAC,CAAC;AACJ;AAEA,eAAeF,iBAAiB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
2
|
/* stylelint-disable scss/at-import-no-partial-leading-underscore */
|
|
3
3
|
:export {
|
|
4
|
-
paper-bgcolor:
|
|
5
|
-
plot-bgcolor:
|
|
6
|
-
title-color:
|
|
7
|
-
colorway:
|
|
8
|
-
gridcolor:
|
|
9
|
-
linecolor:
|
|
10
|
-
zerolinecolor:
|
|
11
|
-
activecolor:
|
|
12
|
-
rangebgcolor:
|
|
13
|
-
area-color:
|
|
14
|
-
trend-color:
|
|
15
|
-
line-color:
|
|
16
|
-
error-band-line-color:
|
|
17
|
-
error-band-fill-color:
|
|
18
|
-
ohlc-increasing:
|
|
19
|
-
ohlc-decreasing:
|
|
4
|
+
paper-bgcolor: var(--dh-color-chart-bg);
|
|
5
|
+
plot-bgcolor: var(--dh-color-chart-plot-bg);
|
|
6
|
+
title-color: var(--dh-color-chart-title);
|
|
7
|
+
colorway: var(--dh-color-chart-colorway);
|
|
8
|
+
gridcolor: var(--dh-color-chart-grid);
|
|
9
|
+
linecolor: var(--dh-color-chart-axis-line);
|
|
10
|
+
zerolinecolor: var(--dh-color-chart-axis-line-zero);
|
|
11
|
+
activecolor: var(--dh-color-chart-active);
|
|
12
|
+
rangebgcolor: var(--dh-color-chart-range-bg);
|
|
13
|
+
area-color: var(--dh-color-chart-area);
|
|
14
|
+
trend-color: var(--dh-color-chart-trend);
|
|
15
|
+
line-color: var(--dh-color-chart-line-deprecated);
|
|
16
|
+
error-band-line-color: var(--dh-color-chart-error-band-line);
|
|
17
|
+
error-band-fill-color: var(--dh-color-chart-error-band-fill);
|
|
18
|
+
ohlc-increasing: var(--dh-color-chart-ohlc-increase);
|
|
19
|
+
ohlc-decreasing: var(--dh-color-chart-ohlc-decrease);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/*# sourceMappingURL=ChartTheme.module.css.map */
|
|
@@ -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"}
|