@deephaven/chart 0.22.3-beta.15 → 0.22.3-beta.21

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.
@@ -1,7 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  /* eslint class-methods-use-this: "off" */
4
-
5
3
  /* eslint no-unused-vars: "off" */
6
4
 
7
5
  /**
@@ -12,158 +10,122 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
12
10
  class ChartModel {
13
11
  constructor() {
14
12
  _defineProperty(this, "listeners", void 0);
15
-
16
13
  _defineProperty(this, "formatter", void 0);
17
-
18
14
  _defineProperty(this, "rect", void 0);
19
-
20
15
  _defineProperty(this, "isDownsamplingDisabled", void 0);
21
-
22
16
  _defineProperty(this, "title", void 0);
23
-
24
17
  this.listeners = [];
25
18
  this.isDownsamplingDisabled = false;
26
19
  }
27
-
28
20
  getData() {
29
21
  return [];
30
22
  }
31
-
32
23
  getDefaultTitle() {
33
24
  return '';
34
25
  }
35
-
36
26
  getLayout() {
37
27
  return {};
38
28
  }
39
-
40
29
  getFilterColumnMap() {
41
30
  return new Map();
42
31
  }
43
-
44
32
  isFilterRequired() {
45
33
  return false;
46
- } // eslint-disable-next-line @typescript-eslint/no-empty-function
47
-
34
+ }
48
35
 
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
49
37
  setFilter(filter) {}
38
+
50
39
  /**
51
40
  * Close this model, clean up any underlying subscriptions
52
41
  */
53
42
  // eslint-disable-next-line @typescript-eslint/no-empty-function
54
-
55
-
56
43
  close() {}
44
+
57
45
  /**
58
46
  * Set the formatter to use when charting the data.
59
47
  * @param formatter The formatter to use to format the charting data
60
48
  */
61
-
62
-
63
49
  setFormatter(formatter) {
64
50
  this.formatter = formatter;
65
51
  }
52
+
66
53
  /**
67
54
  * Disable downsampling
68
55
  * @param isDownsamplingDisabled True if downsampling should be disabled
69
56
  */
70
-
71
-
72
57
  setDownsamplingDisabled(isDownsamplingDisabled) {
73
58
  this.isDownsamplingDisabled = isDownsamplingDisabled;
74
59
  }
60
+
75
61
  /**
76
62
  * Set the dimensions of the plot. May be needed to evaluate some of the percents
77
63
  * @param rect The bounding rectangle of the plot
78
64
  */
79
-
80
-
81
65
  setDimensions(rect) {
82
66
  this.rect = rect;
83
67
  }
84
-
85
68
  setTitle(title) {
86
69
  this.title = title;
87
70
  }
71
+
88
72
  /**
89
73
  * Subscribe to this ChartModel and start listening for all events.
90
74
  * @param callback Callback when an event occurs
91
75
  */
92
-
93
-
94
76
  subscribe(callback) {
95
77
  this.listeners.push(callback);
96
78
  }
97
-
98
79
  unsubscribe(callback) {
99
80
  this.listeners = this.listeners.filter(listener => listener !== callback);
100
81
  }
101
-
102
82
  fireEvent(event) {
103
83
  for (var i = 0; i < this.listeners.length; i += 1) {
104
84
  this.listeners[i](event);
105
85
  }
106
86
  }
107
-
108
87
  fireUpdate(data) {
109
88
  this.fireEvent(new CustomEvent(ChartModel.EVENT_UPDATED, {
110
89
  detail: data
111
90
  }));
112
91
  }
113
-
114
92
  fireDisconnect() {
115
93
  this.fireEvent(new CustomEvent(ChartModel.EVENT_DISCONNECT));
116
94
  }
117
-
118
95
  fireReconnect() {
119
96
  this.fireEvent(new CustomEvent(ChartModel.EVENT_RECONNECT));
120
97
  }
121
-
122
98
  fireDownsampleStart(detail) {
123
99
  this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLESTARTED, {
124
100
  detail
125
101
  }));
126
102
  }
127
-
128
103
  fireDownsampleFinish(detail) {
129
104
  this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFINISHED, {
130
105
  detail
131
106
  }));
132
107
  }
133
-
134
108
  fireDownsampleFail(detail) {
135
109
  this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLEFAILED, {
136
110
  detail
137
111
  }));
138
112
  }
139
-
140
113
  fireDownsampleNeeded(detail) {
141
114
  this.fireEvent(new CustomEvent(ChartModel.EVENT_DOWNSAMPLENEEDED, {
142
115
  detail
143
116
  }));
144
117
  }
145
-
146
118
  fireLoadFinished() {
147
119
  this.fireEvent(new CustomEvent(ChartModel.EVENT_LOADFINISHED));
148
120
  }
149
-
150
121
  }
151
-
152
122
  _defineProperty(ChartModel, "EVENT_UPDATED", 'ChartModel.EVENT_UPDATED');
153
-
154
123
  _defineProperty(ChartModel, "EVENT_DISCONNECT", 'ChartModel.EVENT_DISCONNECT');
155
-
156
124
  _defineProperty(ChartModel, "EVENT_RECONNECT", 'ChartModel.EVENT_RECONNECT');
157
-
158
125
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLESTARTED", 'ChartModel.EVENT_DOWNSAMPLESTARTED');
159
-
160
126
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLEFINISHED", 'ChartModel.EVENT_DOWNSAMPLEFINISHED');
161
-
162
127
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLEFAILED", 'ChartModel.EVENT_DOWNSAMPLEFAILED');
163
-
164
128
  _defineProperty(ChartModel, "EVENT_DOWNSAMPLENEEDED", 'ChartModel.EVENT_DOWNSAMPLENEEDED');
165
-
166
129
  _defineProperty(ChartModel, "EVENT_LOADFINISHED", 'ChartModel.EVENT_LOADFINISHED');
167
-
168
130
  export default ChartModel;
169
131
  //# sourceMappingURL=ChartModel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChartModel.js","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"],"sources":["../src/ChartModel.ts"],"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"],"mappings":";;AAAA;;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAN,CAAiB;EAiBfC,WAAW,GAAG;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IACZ,KAAKC,SAAL,GAAiB,EAAjB;IACA,KAAKC,sBAAL,GAA8B,KAA9B;EACD;;EAYDC,OAAO,GAAwB;IAC7B,OAAO,EAAP;EACD;;EAEDC,eAAe,GAAW;IACxB,OAAO,EAAP;EACD;;EAEDC,SAAS,GAAoB;IAC3B,OAAO,EAAP;EACD;;EAEDC,kBAAkB,GAAoB;IACpC,OAAO,IAAIC,GAAJ,EAAP;EACD;;EAEDC,gBAAgB,GAAY;IAC1B,OAAO,KAAP;EACD,CAlDc,CAoDf;;;EACAC,SAAS,CAACC,MAAD,EAAoC,CAAE;EAE/C;AACF;AACA;EACE;;;EACAC,KAAK,GAAS,CAAE;EAEhB;AACF;AACA;AACA;;;EACEC,YAAY,CAACC,SAAD,EAA6B;IACvC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;EAED;AACF;AACA;AACA;;;EACEC,uBAAuB,CAACZ,sBAAD,EAAwC;IAC7D,KAAKA,sBAAL,GAA8BA,sBAA9B;EACD;EAED;AACF;AACA;AACA;;;EACEa,aAAa,CAACC,IAAD,EAAsB;IACjC,KAAKA,IAAL,GAAYA,IAAZ;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAsB;IAC5B,KAAKA,KAAL,GAAaA,KAAb;EACD;EAED;AACF;AACA;AACA;;;EACEC,SAAS,CAACC,QAAD,EAA8C;IACrD,KAAKnB,SAAL,CAAeoB,IAAf,CAAoBD,QAApB;EACD;;EAEDE,WAAW,CAACF,QA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AA3B,EAAmD;MAAEZ;IAAF,CAAnD,CADF;EAGD;;EAEDa,gBAAgB,GAAS;IACvB,KAAKrB,SAAL,CAAe,IAAIM,WAAJ,CAAgB/B,UAAU,CAAC+C,kBAA3B,CAAf;EACD;;AAjJc;;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;;AAqI9B,eAAeA,UAAf"}
1
+ {"version":3,"file":"ChartModel.js","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"],"sources":["../src/ChartModel.ts"],"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"],"mappings":";AAAA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,CAAC;EAiBfC,WAAW,GAAG;IAAA;IAAA;IAAA;IAAA;IAAA;IACZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,sBAAsB,GAAG,KAAK;EACrC;EAYAC,OAAO,GAAwB;IAC7B,OAAO,EAAE;EACX;EAEAC,eAAe,GAAW;IACxB,OAAO,EAAE;EACX;EAEAC,SAAS,GAAoB;IAC3B,OAAO,CAAC,CAAC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gBAb/DA,UAAU,wBAec,+BAA+B;AAqI7D,eAAeA,UAAU"}
@@ -1,12 +1,9 @@
1
1
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
-
3
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); }); }; }
4
-
5
3
  import dh from '@deephaven/jsapi-shim';
6
4
  import ChartUtils from "./ChartUtils.js";
7
5
  import FigureChartModel from "./FigureChartModel.js";
8
6
  import ChartTheme from "./ChartTheme.js";
9
-
10
7
  class ChartModelFactory {
11
8
  /**
12
9
  * Creates a model from the settings provided.
@@ -31,6 +28,7 @@ class ChartModelFactory {
31
28
  return new FigureChartModel(figure, settings, theme);
32
29
  })();
33
30
  }
31
+
34
32
  /**
35
33
  * Creates a model from the settings provided.
36
34
  * Tries to create a Figure in the API with it.
@@ -43,8 +41,6 @@ class ChartModelFactory {
43
41
  * @param table The table to build the model for
44
42
  * @returns The Figure created with the settings provided
45
43
  */
46
-
47
-
48
44
  static makeFigureFromSettings(settings, table) {
49
45
  return _asyncToGenerator(function* () {
50
46
  // Copy the table first and then re-apply the filters from the original table
@@ -58,6 +54,7 @@ class ChartModelFactory {
58
54
  return dh.plot.Figure.create(ChartUtils.makeFigureSettings(settings, tableCopy));
59
55
  })();
60
56
  }
57
+
61
58
  /**
62
59
  * Creates a model from the settings provided.
63
60
  * Tries to create a Figure in the API with it.
@@ -73,8 +70,6 @@ class ChartModelFactory {
73
70
  * CRA sets tsconfig to type check JS based on jsdoc comments. It isn't able to figure out FigureChartModel extends ChartModel
74
71
  * This causes TS issues in 1 or 2 spots. Once this is TS it can be returned to just FigureChartModel
75
72
  */
76
-
77
-
78
73
  static makeModel(settings, figure) {
79
74
  var _arguments2 = arguments;
80
75
  return _asyncToGenerator(function* () {
@@ -82,8 +77,6 @@ class ChartModelFactory {
82
77
  return new FigureChartModel(figure, settings, theme);
83
78
  })();
84
79
  }
85
-
86
80
  }
87
-
88
81
  export default ChartModelFactory;
89
82
  //# sourceMappingURL=ChartModelFactory.js.map
@@ -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.ts"],"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"],"mappings":";;;;AAAA,OAAOA,EAAP,MAAkC,uBAAlC;OACOC,U;OACAC,gB;OACAC,U;;AAGP,MAAMC,iBAAN,CAAwB;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACoC,OAArBC,qBAAqB,CAChCC,QADgC,EAEhCC,KAFgC,EAIX;IAAA;IAAA;MAAA,IADrBC,KACqB,0EADbL,UACa;MACrB,IAAMM,MAAM,SAASL,iBAAiB,CAACM,sBAAlB,CACnBJ,QADmB,EAEnBC,KAFmB,CAArB;MAIA,OAAO,IAAIL,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IALqB;EAMtB;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACqC,OAAtBE,sBAAsB,CACjCJ,QADiC,EAEjCC,KAFiC,EAGhB;IAAA;MACjB;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;IAViB;EAalB;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;EACwB,OAATY,SAAS,CACpBjB,QADoB,EAEpBG,MAFoB,EAIC;IAAA;IAAA;MAAA,IADrBD,KACqB,6EADbL,UACa;MACrB,OAAO,IAAID,gBAAJ,CAAqBO,MAArB,EAA6BH,QAA7B,EAAuCE,KAAvC,CAAP;IADqB;EAEtB;;AA/EqB;;AAkFxB,eAAeJ,iBAAf"}
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.ts"],"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"],"mappings":";;AAAA,OAAOA,EAAE,MAAyB,uBAAuB;AAAC,OACnDC,UAAU;AAAA,OACVC,gBAAgB;AAAA,OAChBC,UAAU;AAGjB,MAAMC,iBAAiB,CAAC;EACtB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaC,qBAAqB,CAChCC,QAA4B,EAC5BC,KAAY,EAES;IAAA;IAAA;MAAA,IADrBC,KAAK,0EAAGL,UAAU;MAElB,IAAMM,MAAM,SAASL,iBAAiB,CAACM,sBAAsB,CAC3DJ,QAAQ,EACRC,KAAK,CACN;MACD,OAAO,IAAIL,gBAAgB,CAACO,MAAM,EAAEH,QAAQ,EAAEE,KAAK,CAAC;IAAC;EACvD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaE,sBAAsB,CACjCJ,QAA4B,EAC5BC,KAAY,EACK;IAAA;MACjB;MACA;MACA;MACA;MACA,IAAMI,SAAS,SAASJ,KAAK,CAACK,IAAI,EAAE;MACpCD,SAAS,CAACE,kBAAkB,CAACN,KAAK,CAACO,aAAa,CAAC;MACjDH,SAAS,CAACI,WAAW,CAACR,KAAK,CAACS,MAAM,CAAC;MACnCL,SAAS,CAACM,SAAS,CAACV,KAAK,CAACW,IAAI,CAAC;MAE/B,OAAOlB,EAAE,CAACmB,IAAI,CAACC,MAAM,CAACC,MAAM,CAC1BpB,UAAU,CAACqB,kBAAkB,CAAChB,QAAQ,EAAEK,SAAS,CAAC,CACnD;IAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAaY,SAAS,CACpBjB,QAA6C,EAC7CG,MAAc,EAEO;IAAA;IAAA;MAAA,IADrBD,KAAK,6EAAGL,UAAU;MAElB,OAAO,IAAID,gBAAgB,CAACO,MAAM,EAAEH,QAAQ,EAAEE,KAAK,CAAC;IAAC;EACvD;AACF;AAEA,eAAeJ,iBAAiB"}
@@ -1,7 +1,5 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
3
2
  import dh from '@deephaven/jsapi-shim';
4
-
5
3
  class ChartTestUtils {
6
4
  static makeAxis() {
7
5
  var {
@@ -22,7 +20,6 @@ class ChartTestUtils {
22
20
  log
23
21
  });
24
22
  }
25
-
26
23
  static makeDefaultAxes() {
27
24
  return [ChartTestUtils.makeAxis({
28
25
  label: ChartTestUtils.DEFAULT_X_TITLE,
@@ -32,7 +29,6 @@ class ChartTestUtils {
32
29
  type: dh.plot.AxisType.Y
33
30
  })];
34
31
  }
35
-
36
32
  static makeSource(_ref) {
37
33
  var {
38
34
  axis = ChartTestUtils.makeAxis()
@@ -43,14 +39,12 @@ class ChartTestUtils {
43
39
  type: axis.type
44
40
  });
45
41
  }
46
-
47
42
  static makeDefaultSources() {
48
43
  var axes = ChartTestUtils.makeDefaultAxes();
49
44
  return axes.map(axis => ChartTestUtils.makeSource({
50
45
  axis
51
46
  }));
52
47
  }
53
-
54
48
  static makeSeries() {
55
49
  var {
56
50
  name = ChartTestUtils.DEFAULT_SERIES_NAME,
@@ -62,7 +56,6 @@ class ChartTestUtils {
62
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
57
  return new dh.Series(name, plotStyle, sources, lineColor, shapeColor);
64
58
  }
65
-
66
59
  static makeChart() {
67
60
  var {
68
61
  title = ChartTestUtils.DEFAULT_CHART_TITLE,
@@ -76,7 +69,6 @@ class ChartTestUtils {
76
69
  axes
77
70
  });
78
71
  }
79
-
80
72
  static makeFigure() {
81
73
  var {
82
74
  title = 'Figure',
@@ -88,16 +80,10 @@ class ChartTestUtils {
88
80
  charts
89
81
  });
90
82
  }
91
-
92
83
  }
93
-
94
84
  _defineProperty(ChartTestUtils, "DEFAULT_CHART_TITLE", 'Chart Title');
95
-
96
85
  _defineProperty(ChartTestUtils, "DEFAULT_X_TITLE", 'X Axis');
97
-
98
86
  _defineProperty(ChartTestUtils, "DEFAULT_Y_TITLE", 'Y Axis');
99
-
100
87
  _defineProperty(ChartTestUtils, "DEFAULT_SERIES_NAME", 'MySeries');
101
-
102
88
  export default ChartTestUtils;
103
89
  //# sourceMappingURL=ChartTestUtils.js.map
@@ -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.ts"],"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"],"mappings":";;AAAA,OAAOA,EAAP,MAMO,uBANP;;AAQA,MAAMC,cAAN,CAAqB;EASJ,OAARC,QAAQ,GAOD;IAAA,IAPE;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,CAOF,uEAAV,EAAU;IACZ;IACA,OAAO,IAAKf,EAAD,CAAYY,IAAhB,CAAqB;MAC1BT,KAD0B;MAE1BC,IAF0B;MAG1BI,QAH0B;MAI1BG,UAJ0B;MAK1BG,aAL0B;MAM1BC;IAN0B,CAArB,CAAP;EAQD;;EAEqB,OAAfC,eAAe,GAAW;IAC/B,OAAO,CACLf,cAAc,CAACC,QAAf,CAAwB;MACtBC,KAAK,EAAEF,cAAc,CAACgB,eADA;MAEtBb,IAAI,EAAEJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBC;IAFD,CAAxB,CADK,EAKLN,cAAc,CAACC,QAAf,CAAwB;MACtBC,KAAK,EAAEF,cAAc,CAACiB,eADA;MAEtBd,IAAI,EAAEJ,EAAE,CAACK,IAAH,CAAQC,QAAR,CAAiBa;IAFD,CAAx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ACzC,cAAc,CAACmC,SAAf,EAAD;IAFO,CAGF,uEAAZ,EAAY;IACd;IACA,OAAO,IAAKpC,EAAD,CAAYK,IAAZ,CAAiBsC,MAArB,CAA4B;MAAEN,KAAF;MAASK;IAAT,CAA5B,CAAP;EACD;;AAvFkB;;gBAAfzC,c,yBACyB,a;;gBADzBA,c,qBAGqB,Q;;gBAHrBA,c,qBAKqB,Q;;gBALrBA,c,yBAOyB,U;;AAmF/B,eAAeA,cAAf"}
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.ts"],"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"],"mappings":";AAAA,OAAOA,EAAE,MAMF,uBAAuB;AAE9B,MAAMC,cAAc,CAAC;EASnB,OAAOC,QAAQ,GAOD;IAAA,IAPE;MACdC,KAAK,GAAG,MAAM;MACdC,IAAI,GAAGJ,EAAE,CAACK,IAAI,CAACC,QAAQ,CAACC,CAAC;MACzBC,QAAQ,GAAGR,EAAE,CAACK,IAAI,CAACI,YAAY,CAACC,MAAM;MACtCC,UAAU,GAAGX,EAAE,CAACY,IA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AG;IACf,CAAC,uEAAG,CAAC,CAAC;IACJ;IACA,OAAO,IAAKlC,EAAE,CAASmC,MAAM,CAC3BR,IAAI,EACJE,SAAS,EACTG,OAAO,EACPC,SAAS,EACTC,UAAU,CACX;EACH;EAEA,OAAOE,SAAS,GAID;IAAA,IAJE;MACfC,KAAK,GAAGpC,cAAc,CAACqC,mBAAmB;MAC1CC,MAAM,GAAG,CAACtC,cAAc,CAACyB,UAAU,EAAE,CAAC;MACtCF,IAAI,GAAGvB,cAAc,CAACe,eAAe;IACvC,CAAC,uEAAG,CAAC,CAAC;IACJ;IACA,OAAO,IAAKhB,EAAE,CAASwC,KAAK,CAAC;MAAEH,KAAK;MAAEE,MAAM;MAAEf;IAAK,CAAC,CAAC;EACvD;EAEA,OAAOiB,UAAU,GAGD;IAAA,IAHE;MAChBJ,KAAK,GAAG,QAAQ;MAChBK,MAAM,GAAG,CAACzC,cAAc,CAACmC,SAAS,EAAE;IACtC,CAAC,uEAAG,CAAC,CAAC;IACJ;IACA,OAAO,IAAKpC,EAAE,CAASK,IAAI,CAACsC,MAAM,CAAC;MAAEN,KAAK;MAAEK;IAAO,CAAC,CAAC;EACvD;AACF;AAAC,gBAxFKzC,cAAc,yBACW,aAAa;AAAA,gBADtCA,cAAc,qBAGO,QAAQ;AAAA,gBAH7BA,cAAc,qBAKO,QAAQ;AAAA,gBAL7BA,cAAc,yBAOW,UAAU;AAmFzC,eAAeA,cAAc"}
@@ -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.ts"],"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,"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.ts"],"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,UAAU;AAEjB,eAAeC,MAAM,CAACC,MAAM,CAAC;EAC3BC,aAAa,EAAEH,UAAU,CAAC,eAAe,CAAC;EAC1CI,YAAY,EAAEJ,UAAU,CAAC,cAAc,CAAC;EACxCK,WAAW,EAAEL,UAAU,CAAC,aAAa,CAAC;EACtCM,QAAQ,EAAEN,UAAU,CAACM,QAAQ;EAC7BC,SAAS,EAAEP,UAAU,CAACO,SAAS;EAC/BC,SAAS,EAAER,UAAU,CAACQ,SAAS;EAC/BC,aAAa,EAAET,UAAU,CAACS,aAAa;EACvCC,WAAW,EAAEV,UAAU,CAACU,WAAW;EACnCC,YAAY,EAAEX,UAAU,CAACW,YAAY;EACrCC,UAAU,EAAEZ,UAAU,CAAC,YAAY,CAAC;EACpCa,WAAW,EAAEb,UAAU,CAAC,aAAa,CAAC;EACtCc,UAAU,EAAEd,UAAU,CAAC,YAAY,CAAC;EACpCe,qBAAqB,EAAEf,UAAU,CAAC,uBAAuB,CAAC;EAC1DgB,qBAAqB,EAAEhB,UAAU,CAAC,uBAAuB,CAAC;EAC1DiB,eAAe,EAAEjB,UAAU,CAAC,iBAAiB,CAAC;EAC9CkB,eAAe,EAAElB,UAAU,CAAC,iBAAiB;AAC/C,CAAC,CAAC"}