@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.
Files changed (44) hide show
  1. package/dist/Chart.d.ts +84 -85
  2. package/dist/Chart.d.ts.map +1 -1
  3. package/dist/Chart.js +56 -49
  4. package/dist/Chart.js.map +1 -1
  5. package/dist/ChartModel.d.ts +30 -22
  6. package/dist/ChartModel.d.ts.map +1 -1
  7. package/dist/ChartModel.js +18 -9
  8. package/dist/ChartModel.js.map +1 -1
  9. package/dist/ChartModelFactory.d.ts +67 -43
  10. package/dist/ChartModelFactory.d.ts.map +1 -1
  11. package/dist/ChartModelFactory.js +27 -27
  12. package/dist/ChartModelFactory.js.map +1 -1
  13. package/dist/ChartTestUtils.d.ts +16 -15
  14. package/dist/ChartTestUtils.d.ts.map +1 -1
  15. package/dist/ChartTestUtils.js +5 -0
  16. package/dist/ChartTestUtils.js.map +1 -1
  17. package/dist/ChartTheme.d.ts +17 -17
  18. package/dist/ChartTheme.d.ts.map +1 -1
  19. package/dist/ChartTheme.js.map +1 -1
  20. package/dist/ChartUtils.d.ts +252 -225
  21. package/dist/ChartUtils.d.ts.map +1 -1
  22. package/dist/ChartUtils.js +219 -174
  23. package/dist/ChartUtils.js.map +1 -1
  24. package/dist/FigureChartModel.d.ts +70 -106
  25. package/dist/FigureChartModel.d.ts.map +1 -1
  26. package/dist/FigureChartModel.js +90 -36
  27. package/dist/FigureChartModel.js.map +1 -1
  28. package/dist/MockChartModel.d.ts +11 -209
  29. package/dist/MockChartModel.d.ts.map +1 -1
  30. package/dist/MockChartModel.js.map +1 -1
  31. package/dist/declaration.d.js +2 -0
  32. package/dist/declaration.d.js.map +1 -0
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +2 -0
  36. package/dist/index.js.map +1 -1
  37. package/dist/isFigureChartModel.d.ts +4 -0
  38. package/dist/isFigureChartModel.d.ts.map +1 -0
  39. package/dist/isFigureChartModel.js +4 -0
  40. package/dist/isFigureChartModel.js.map +1 -0
  41. package/dist/plotly/Plot.js.map +1 -1
  42. package/dist/plotly/Plotly.d.ts +1 -0
  43. package/dist/plotly/Plotly.js.map +1 -1
  44. package/package.json +11 -8
@@ -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 {Formatter} formatter The formatter to use to format the charting data
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 {boolean} isDownsamplingDisabled True if downsampling should be disabled
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 {DOMRect} rect The bounding rectangle of the plot
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 {Function<Event>} callback Callback when an event occurs
90
+ * @param callback Callback when an event occurs
82
91
  */
83
92
 
84
93
 
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModel.js","names":["ChartModel","constructor","listeners","formatter","rect","isDownsamplingDisabled","title","getData","getDefaultTitle","getLayout","getFilterColumnMap","Map","isFilterRequired","setFilter","close","setFormatter","setDownsamplingDisabled","setDimensions","setTitle","subscribe","callback","push","unsubscribe","filter","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.js"],"sourcesContent":["/* eslint class-methods-use-this: \"off\" */\n/* eslint no-unused-vars: \"off\" */\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.formatter = null;\n this.rect = null;\n this.isDownsamplingDisabled = false;\n this.title = null;\n }\n\n getData() {\n return [];\n }\n\n getDefaultTitle() {\n return '';\n }\n\n getLayout() {\n return {};\n }\n\n getFilterColumnMap() {\n return new Map();\n }\n\n isFilterRequired() {\n return false;\n }\n\n setFilter() {}\n\n /**\n * Close this model, clean up any underlying subscriptions\n */\n close() {}\n\n /**\n * Set the formatter to use when charting the data.\n * @param {Formatter} formatter The formatter to use to format the charting data\n */\n setFormatter(formatter) {\n this.formatter = formatter;\n }\n\n /**\n * Disable downsampling\n * @param {boolean} isDownsamplingDisabled True if downsampling should be disabled\n */\n setDownsamplingDisabled(isDownsamplingDisabled) {\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 {DOMRect} rect The bounding rectangle of the plot\n */\n setDimensions(rect) {\n this.rect = rect;\n }\n\n setTitle(title) {\n this.title = title;\n }\n\n /**\n * Subscribe to this ChartModel and start listening for all events.\n * @param {Function<Event>} callback Callback when an event occurs\n */\n subscribe(callback) {\n this.listeners.push(callback);\n }\n\n unsubscribe(callback) {\n this.listeners = this.listeners.filter(listener => listener !== callback);\n }\n\n fireEvent(event) {\n for (let i = 0; i < this.listeners.length; i += 1) {\n this.listeners[i](event);\n }\n }\n\n fireUpdate(data) {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, { detail: data }));\n }\n\n fireDisconnect() {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));\n }\n\n fireReconnect() {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));\n }\n\n fireDownsampleStart(detail) {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, { detail })\n );\n }\n\n fireDownsampleFinish(detail) {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, { detail })\n );\n }\n\n fireDownsampleFail(detail) {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, { detail })\n );\n }\n\n fireDownsampleNeeded(detail) {\n this.fireEvent(\n new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, { detail })\n );\n }\n\n fireLoadFinished() {\n this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));\n }\n}\n\nexport default ChartModel;\n"],"mappings":";;AAAA;;AACA;;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAN,CAAiB;EAiBfC,WAAW,GAAG;IACZ,KAAKC,SAAL,GAAiB,EAAjB;IACA,KAAKC,SAAL,GAAiB,IAAjB;IACA,KAAKC,IAAL,GAAY,IAAZ;IACA,KAAKC,sBAAL,GAA8B,KAA9B;IACA,KAAKC,KAAL,GAAa,IAAb;EACD;;EAEDC,OAAO,GAAG;IACR,OAAO,EAAP;EACD;;EAEDC,eAAe,GAAG;IAChB,OAAO,EAAP;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,EAAP;EACD;;EAEDC,kBAAkB,GAAG;IACnB,OAAO,IAAIC,GAAJ,EAAP;EACD;;EAEDC,gBAAgB,GAAG;IACjB,OAAO,KAAP;EACD;;EAEDC,SAAS,GAAG,CAAE;EAEd;AACF;AACA;;;EACEC,KAAK,GAAG,CAAE;EAEV;AACF;AACA;AACA;;;EACEC,YAAY,CAACZ,SAAD,EAAY;IACtB,KAAKA,SAAL,GAAiBA,SAAjB;EACD;EAED;AACF;AACA;AACA;;;EACEa,uBAAuB,CAACX,sBAAD,EAAyB;IAC9C,KAAKA,sBAAL,GAA8BA,sBAA9B;EACD;EAED;AACF;AACA;AACA;;;EACEY,aAAa,CAACb,IAAD,EAAO;IAClB,KAAKA,IAAL,GAAYA,IAAZ;EACD;;EAEDc,QAAQ,CAACZ,KAAD,EAAQ;IACd,KAAKA,KAAL,GAAaA,KAAb;E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F,CAAnD,CADF;EAGD;;EAEDW,oBAAoB,CAACX,MAAD,EAAS;IAC3B,KAAKR,SAAL,CACE,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC6C,sBAA3B,EAAmD;MAAEZ;IAAF,CAAnD,CADF;EAGD;;EAEDa,gBAAgB,GAAG;IACjB,KAAKrB,SAAL,CAAe,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC+C,kBAA3B,CAAf;EACD;;AAxIc;;gBAAX/C,U,mBACmB,0B;;gBADnBA,U,sBAGsB,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;;AA4H9B,eAAeA,UAAf"}
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;;AAYDC,EAAAA,OAAO,GAAwB;AAC7B,WAAO,EA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,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
- export default ChartModelFactory;
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 {Object} settings The chart builder settings
7
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
8
- * @param {string[]} settings.series The column names to use for creating the series of this chart
9
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
10
- * @param {string} settings.xAxis The column name to use for the x-axis
11
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
12
- * @param {dh.Table} table The table to build the model for
13
- * @param {Object} theme The theme for the figure. Defaults to ChartTheme
14
- * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
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
- isLinked: boolean;
20
- series: string[];
21
- type: string;
22
- xAxis: string;
23
- hiddenSeries?: string[] | undefined;
24
- }, table: dh.Table, theme?: Object): Promise<ChartModel | FigureChartModel>;
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 {Object} settings The chart builder settings
29
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
30
- * @param {string[]} settings.series The column names to use for creating the series of this chart
31
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
32
- * @param {string} settings.xAxis The column name to use for the x-axis
33
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
34
- * @param {dh.Table} table The table to build the model for
35
- * @returns {Promise<dh.plot.Figure>} The Figure created with the settings provided
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 {Object|undefined} settings The chart builder settings
48
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
49
- * @param {string[]} settings.series The column names to use for creating the series of this chart
50
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
51
- * @param {string} settings.xAxis The column name to use for the x-axis
52
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
53
- * @param {dh.Figure} figure The figure to build the model for
54
- * @param {Object} theme The theme for the figure. Defaults to ChartTheme
55
- * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
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: Object | undefined, figure: dh.Figure, theme?: Object): Promise<ChartModel | FigureChartModel>;
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
- import FigureChartModel from "./FigureChartModel";
85
+ export default ChartModelFactory;
62
86
  //# sourceMappingURL=ChartModelFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModelFactory.d.ts","sourceRoot":"","sources":["../src/ChartModelFactory.js"],"names":[],"mappings":";AAKA;IACE;;;;;;;;;;;;;;OAcG;IACH;QAX6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACc,YAAY;gCAEhC,MAAM,GACJ,QAAQ,aAAa,gBAAgB,CAAC,CAUlD;IAED;;;;;;;;;;;OAWG;IACH;QAR6B,QAAQ,EAA1B,OAAO;QACY,MAAM,EAAzB,MAAM,EAAE;QACS,IAAI,EAArB,MAAM;QACW,KAAK,EAAtB,MAAM;QACc,YAAY;yBAE9B,uBAAuB,CAenC;IAED;;;;;;;;;;;;;;OAcG;IACH,2BAZW,MAAM,GAAC,SAAS,6BAOhB,MAAM,GACJ,QAAQ,aAAa,gBAAgB,CAAC,CAMlD;CACF"}
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 {Object} settings The chart builder settings
15
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
16
- * @param {string[]} settings.series The column names to use for creating the series of this chart
17
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
18
- * @param {string} settings.xAxis The column name to use for the x-axis
19
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
20
- * @param {dh.Table} table The table to build the model for
21
- * @param {Object} theme The theme for the figure. Defaults to ChartTheme
22
- * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
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 {Object} settings The chart builder settings
38
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
39
- * @param {string[]} settings.series The column names to use for creating the series of this chart
40
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
41
- * @param {string} settings.xAxis The column name to use for the x-axis
42
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
43
- * @param {dh.Table} table The table to build the model for
44
- * @returns {Promise<dh.plot.Figure>} The Figure created with the settings provided
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 table linking we'll want to listen to the original table and update
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 {Object|undefined} settings The chart builder settings
65
- * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated
66
- * @param {string[]} settings.series The column names to use for creating the series of this chart
67
- * @param {string} settings.type Chart builder type, from ChartBuilder.types
68
- * @param {string} settings.xAxis The column name to use for the x-axis
69
- * @param {string[]} [settings.hiddenSeries] Array of hidden series names
70
- * @param {dh.Figure} figure The figure to build the model for
71
- * @param {Object} theme The theme for the figure. Defaults to ChartTheme
72
- * @returns {Promise<ChartModel | FigureChartModel>} The FigureChartModel representing the figure
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,"file":"ChartModelFactory.js","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"],"sources":["../src/ChartModelFactory.js"],"sourcesContent":["import dh from '@deephaven/jsapi-shim';\nimport ChartUtils from './ChartUtils';\nimport FigureChartModel from './FigureChartModel';\nimport ChartTheme from './ChartTheme';\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 {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} [settings.hiddenSeries] Array of hidden series names\n * @param {dh.Table} table The table to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<ChartModel | FigureChartModel>} 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 makeModelFromSettings(settings, table, theme = ChartTheme) {\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 {Object} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} [settings.hiddenSeries] Array of hidden series names\n * @param {dh.Table} table The table to build the model for\n * @returns {Promise<dh.plot.Figure>} The Figure created with the settings provided\n */\n static async makeFigureFromSettings(settings, table) {\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 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 {Object|undefined} settings The chart builder settings\n * @param {boolean} settings.isLinked Whether the newly created chart should stay linked with the original table, update when filters are updated\n * @param {string[]} settings.series The column names to use for creating the series of this chart\n * @param {string} settings.type Chart builder type, from ChartBuilder.types\n * @param {string} settings.xAxis The column name to use for the x-axis\n * @param {string[]} [settings.hiddenSeries] Array of hidden series names\n * @param {dh.Figure} figure The figure to build the model for\n * @param {Object} theme The theme for the figure. Defaults to ChartTheme\n * @returns {Promise<ChartModel | FigureChartModel>} 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(settings, figure, theme = ChartTheme) {\n return new FigureChartModel(figure, settings, theme);\n }\n}\n\nexport default ChartModelFactory;\n"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAe,uBAAf;OACOC,U;OACAC,gB;OACAC,U;;AAEP,MAAMC,iBAAN,CAAwB;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACoC,OAArBC,qBAAqB,CAACC,QAAD,EAAWC,KAAX,EAAsC;IAAA;IAAA;MAAA,IAApBC,KAAoB,0EAAZL,UAAY;MACtE,IAAMM,MAAM,SAASL,iBAAiB,CAACM,sBAAlB,CACnBJ,QADmB,EAEnBC,KAFmB,CAArB;MAIA,OAAO,IAAIL,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IALsE;EAMvE;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACqC,OAAtBE,sBAAsB,CAACJ,QAAD,EAAWC,KAAX,EAAkB;IAAA;MACnD;MACA;MACA;MACA;MACA,IAAMI,SAAS,SAASJ,KAAK,CAACK,IAAN,EAAxB;MACAD,SAAS,CAACE,kBAAV,CAA6BN,KAAK,CAACO,aAAnC;MACAH,SAAS,CAACI,WAAV,CAAsBR,KAAK,CAACS,MAA5B;MACAL,SAAS,CAACM,SAAV,CAAoBV,KAAK,CAACW,IAA1B;MAEA,OAAOlB,EAAE,CAACmB,IAAH,CAAQC,MAAR,CAAeC,MAAf,CACLpB,UAAU,CAACqB,kBAAX,CAA8BhB,QAA9B,EAAwCK,SAAxC,CADK,CAAP;IAVmD;EAapD;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACwB,OAATY,SAAS,CAACjB,QAAD,EAAWG,MAAX,EAAuC;IAAA;IAAA;MAAA,IAApBD,KAAoB,6EAAZL,UAAY;MAC3D,OAAO,IAAID,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IAD2D;EAE5D;;AApEqB;;AAuExB,eAAeJ,iBAAf"}
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"}
@@ -1,4 +1,4 @@
1
- export default ChartTestUtils;
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?: any;
11
+ formatType?: unknown;
12
12
  formatPattern?: string | undefined;
13
13
  log?: boolean | undefined;
14
- }): any;
15
- static makeDefaultAxes(): any[];
16
- static makeSource({ axis }: {
17
- axis?: any;
18
- }): any;
19
- static makeDefaultSources(): any[];
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?: any[] | undefined;
23
+ sources?: SeriesDataSource[] | undefined;
24
24
  lineColor?: null | undefined;
25
25
  shapeColor?: null | undefined;
26
- }): any;
26
+ }): Series;
27
27
  static makeChart({ title, series, axes, }?: {
28
28
  title?: string | undefined;
29
- series?: any[] | undefined;
30
- axes?: any[] | undefined;
31
- }): any;
29
+ series?: Series[] | undefined;
30
+ axes?: Axis[] | undefined;
31
+ }): Chart;
32
32
  static makeFigure({ title, charts, }?: {
33
33
  title?: string | undefined;
34
- charts?: any[] | undefined;
35
- }): any;
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.js"],"names":[],"mappings":";AAEA;IACE,mCAA2C;IAE3C,+BAAkC;IAElC,+BAAkC;IAElC,mCAAwC;IAExC;;;;;;;YAgBC;IAED,gCAWC;IAED;;YAEC;IAED,mCAGC;IAED;;;;;;YAQC;IAED;;;;YAMC;IAED;;;YAKC;CACF"}
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"}
@@ -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,"file":"ChartTestUtils.js","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"],"sources":["../src/ChartTestUtils.js"],"sourcesContent":["import dh 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 } = {}) {\n return new dh.Axis({\n label,\n type,\n position,\n formatType,\n formatPattern,\n log,\n });\n }\n\n static makeDefaultAxes() {\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({ axis = ChartTestUtils.makeAxis() }) {\n return new dh.SeriesDataSource({ axis, type: axis.type });\n }\n\n static makeDefaultSources() {\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 } = {}) {\n return new dh.Series(name, plotStyle, sources, lineColor, shapeColor);\n }\n\n static makeChart({\n title = ChartTestUtils.DEFAULT_CHART_TITLE,\n series = [ChartTestUtils.makeSeries()],\n axes = ChartTestUtils.makeDefaultAxes(),\n } = {}) {\n return new dh.Chart({ title, series, axes });\n }\n\n static makeFigure({\n title = 'Figure',\n charts = [ChartTestUtils.makeChart()],\n } = {}) {\n return new dh.plot.Figure({ title, charts });\n }\n}\n\nexport default ChartTestUtils;\n"],"mappings":";;AAAA,OAAOA,EAAP,MAAe,uBAAf;;AAEA,MAAMC,cAAN,CAAqB;EASJ,OAARC,QAAQ,GAOP;IAAA,IAPQ;MACdC,KAAK,GAAG,MADM;MAEdC,IAAI,GAAGJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBC,CAFV;MAGdC,QAAQ,GAAGR,EAAE,CAACK,IAAH,CAAQI,YAAR,CAAqBC,MAHlB;MAIdC,UAAU,GAAGX,EAAE,CAACY,IAAH,CAAQC,kBAJP;MAKdC,aAAa,GAAG,aALF;MAMdC,GAAG,GAAG;IANQ,CA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,EAAE,CAACmC,MAAP,CAAcR,IAAd,EAAoBE,SAApB,EAA+BG,OAA/B,EAAwCC,SAAxC,EAAmDC,UAAnD,CAAP;EACD;;EAEe,OAATE,SAAS,GAIR;IAAA,IAJS;MACfC,KAAK,GAAGpC,cAAc,CAACqC,mBADR;MAEfC,MAAM,GAAG,CAACtC,cAAc,CAACyB,UAAf,EAAD,CAFM;MAGfF,IAAI,GAAGvB,cAAc,CAACe,eAAf;IAHQ,CAIT,uEAAJ,EAAI;IACN,OAAO,IAAIhB,EAAE,CAACwC,KAAP,CAAa;MAAEH,KAAF;MAASE,MAAT;MAAiBf;IAAjB,CAAb,CAAP;EACD;;EAEgB,OAAViB,UAAU,GAGT;IAAA,IAHU;MAChBJ,KAAK,GAAG,QADQ;MAEhBK,MAAM,GAAG,CAACzC,cAAc,CAACmC,SAAf,EAAD;IAFO,CAGV,uEAAJ,EAAI;IACN,OAAO,IAAIpC,EAAE,CAACK,IAAH,CAAQsC,MAAZ,CAAmB;MAAEN,KAAF;MAASK;IAAT,CAAnB,CAAP;EACD;;AAxEkB;;gBAAfzC,c,yBACyB,a;;gBADzBA,c,qBAGqB,Q;;gBAHrBA,c,qBAKqB,Q;;gBALrBA,c,yBAOyB,U;;AAoE/B,eAAeA,cAAf"}
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,SAARC,QAAQ,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AAfzC,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"}
@@ -1,20 +1,20 @@
1
- declare var _default: Readonly<{
2
- paper_bgcolor: any;
3
- plot_bgcolor: any;
4
- title_color: any;
5
- colorway: any;
6
- gridcolor: any;
7
- linecolor: any;
8
- zerolinecolor: any;
9
- activecolor: any;
10
- rangebgcolor: any;
11
- area_color: any;
12
- trend_color: any;
13
- line_color: any;
14
- error_band_line_color: any;
15
- error_band_fill_color: any;
16
- ohlc_increasing: any;
17
- ohlc_decreasing: any;
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
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ChartTheme.d.ts","sourceRoot":"","sources":["../src/ChartTheme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAEA,wBAiBG"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChartTheme.js","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"],"sources":["../src/ChartTheme.js"],"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"],"mappings":"OAAOA,U;AAEP,eAAeC,MAAM,CAACC,MAAP,CAAc;EAC3BC,aAAa,EAAEH,UAAU,CAAC,eAAD,CADE;EAE3BI,YAAY,EAAEJ,UAAU,CAAC,cAAD,CAFG;EAG3BK,WAAW,EAAEL,UAAU,CAAC,aAAD,CAHI;EAI3BM,QAAQ,EAAEN,UAAU,CAACM,QAJM;EAK3BC,SAAS,EAAEP,UAAU,CAACO,SALK;EAM3BC,SAAS,EAAER,UAAU,CAACQ,SANK;EAO3BC,aAAa,EAAET,UAAU,CAACS,aAPC;EAQ3BC,WAAW,EAAEV,UAAU,CAACU,WARG;EAS3BC,YAAY,EAAEX,UAAU,CAACW,YATE;EAU3BC,UAAU,EAAEZ,UAAU,CAAC,YAAD,CAVK;EAW3Ba,WAAW,EAAEb,UAAU,CAAC,aAAD,CAXI;EAY3Bc,UAAU,EAAEd,UAAU,CAAC,YAAD,CAZK;EAa3Be,qBAAqB,EAAEf,UAAU,CAAC,uBAAD,CAbN;EAc3BgB,qBAAqB,EAAEhB,UAAU,CAAC,uBAAD,CAdN;EAe3BiB,eAAe,EAAEjB,UAAU,CAAC,iBAAD,CAfA;EAgB3BkB,eAAe,EAAElB,UAAU,CAAC,iBAAD;AAhBA,CAAd,CAAf"}
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"}