@operato/chart 7.0.12 → 7.0.14

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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/src/editors/configurer.d.ts +10 -1
  3. package/dist/src/editors/configurer.js +62 -2
  4. package/dist/src/editors/configurer.js.map +1 -1
  5. package/dist/src/editors/input-chart-abstract.d.ts +18 -0
  6. package/dist/src/editors/input-chart-abstract.js +438 -1
  7. package/dist/src/editors/input-chart-abstract.js.map +1 -1
  8. package/dist/src/editors/input-chart-styles.js +18 -9
  9. package/dist/src/editors/input-chart-styles.js.map +1 -1
  10. package/dist/src/editors/ox-input-chart-hbar.d.ts +2 -2
  11. package/dist/src/editors/ox-input-chart-hbar.js +10 -10
  12. package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
  13. package/dist/src/editors/ox-input-chart-mixed.d.ts +2 -2
  14. package/dist/src/editors/ox-input-chart-mixed.js +3 -3
  15. package/dist/src/editors/ox-input-chart-mixed.js.map +1 -1
  16. package/dist/src/editors/ox-input-chart-radar.d.ts +2 -2
  17. package/dist/src/editors/ox-input-chart-radar.js +3 -3
  18. package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
  19. package/dist/src/editors/ox-input-chart-timeseries.d.ts +2 -2
  20. package/dist/src/editors/ox-input-chart-timeseries.js +6 -4
  21. package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
  22. package/dist/src/editors/ox-property-editor-chart.d.ts +1 -0
  23. package/dist/src/editors/ox-property-editor-chart.js +1 -0
  24. package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
  25. package/dist/src/scichart/scichart-builder.js +75 -5
  26. package/dist/src/scichart/scichart-builder.js.map +1 -1
  27. package/dist/stories/ox-input-chart-timeseries.stories.js +0 -4
  28. package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +2 -2
  31. package/src/editors/configurer.ts +73 -2
  32. package/src/editors/input-chart-abstract.ts +459 -2
  33. package/src/editors/input-chart-styles.ts +18 -9
  34. package/src/editors/ox-input-chart-hbar.ts +10 -10
  35. package/src/editors/ox-input-chart-mixed.ts +3 -3
  36. package/src/editors/ox-input-chart-radar.ts +3 -3
  37. package/src/editors/ox-input-chart-timeseries.ts +6 -4
  38. package/src/editors/ox-property-editor-chart.ts +1 -0
  39. package/src/scichart/scichart-builder.ts +89 -4
  40. package/src/types.d.ts +19 -0
  41. package/stories/ox-input-chart-timeseries.stories.ts +0 -4
  42. package/translations/en.json +24 -17
  43. package/translations/ja.json +25 -18
  44. package/translations/ko.json +11 -4
  45. package/translations/ms.json +25 -18
  46. package/translations/zh.json +30 -23
  47. package/dist/src/editors/input-chart-multi-series-abstract.d.ts +0 -17
  48. package/dist/src/editors/input-chart-multi-series-abstract.js +0 -419
  49. package/dist/src/editors/input-chart-multi-series-abstract.js.map +0 -1
  50. package/src/editors/input-chart-multi-series-abstract.ts +0 -430
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ### [7.0.14](https://github.com/hatiolab/operato/compare/v7.0.13...v7.0.14) (2024-07-13)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * annotations option for chart ([2bd9854](https://github.com/hatiolab/operato/commit/2bd9854df6cc2f6c26b77bc95a0e301e3f8eb6c4))
12
+ * annotations option for chart ([b00672b](https://github.com/hatiolab/operato/commit/b00672b7917309b27ce6250614455e9cff3f782f))
13
+
14
+
15
+
16
+ ### [7.0.13](https://github.com/hatiolab/operato/compare/v7.0.12...v7.0.13) (2024-07-13)
17
+
18
+
19
+ ### :bug: Bug Fix
20
+
21
+ * annotations option for chart ([1b73147](https://github.com/hatiolab/operato/commit/1b7314766fd7b3f7ae7367012b4bba3ed95b97b1))
22
+
23
+
24
+
6
25
  ### [7.0.12](https://github.com/hatiolab/operato/compare/v7.0.11...v7.0.12) (2024-07-11)
7
26
 
8
27
 
@@ -1,11 +1,15 @@
1
1
  export declare class Configurer {
2
2
  value: OperatoChart.ChartConfig;
3
3
  currentSeriesIndex: number;
4
+ currentAnnotationIndex: number;
4
5
  initializer: () => OperatoChart.ChartConfig;
5
6
  constructor(value: OperatoChart.ChartConfig | null, initializer: () => OperatoChart.ChartConfig);
6
7
  setCurrentSeriesIndex(currentSeriesIndex: number): void;
8
+ setCurrentAnnotationIndex(currentAnnotationIndex: number): void;
7
9
  get series(): OperatoChart.Dataset;
8
10
  set series(series: OperatoChart.Dataset);
11
+ get annotation(): OperatoChart.Annotation;
12
+ set annotation(annotation: OperatoChart.Annotation);
9
13
  get config(): OperatoChart.ChartConfig;
10
14
  get data(): OperatoChart.ChartData;
11
15
  set data(data: OperatoChart.ChartData);
@@ -47,8 +51,13 @@ export declare class Configurer {
47
51
  set valuePrefix(valuePrefix: string | undefined);
48
52
  get valueSuffix(): string | undefined;
49
53
  set valueSuffix(valueSuffix: string | undefined);
50
- get valueForamt(): string | undefined;
54
+ get valueFormat(): string | undefined;
51
55
  set valueFormat(valueFormat: string | undefined);
52
56
  get displayValue(): boolean | undefined;
53
57
  set displayValue(displayValue: boolean | undefined);
58
+ get annotations(): OperatoChart.Annotation[];
59
+ set annotations(annotations: OperatoChart.Annotation[]);
60
+ get currentAnnotation(): OperatoChart.Annotation;
61
+ addAnnotation(annotation: OperatoChart.Annotation): void;
62
+ removeAnnotation(index: number): void;
54
63
  }
@@ -1,6 +1,7 @@
1
1
  export class Configurer {
2
2
  constructor(value, initializer) {
3
3
  this.currentSeriesIndex = 0;
4
+ this.currentAnnotationIndex = 0;
4
5
  this.initializer = initializer;
5
6
  this.value = value || initializer.call(this);
6
7
  }
@@ -8,6 +9,10 @@ export class Configurer {
8
9
  this.currentSeriesIndex = currentSeriesIndex;
9
10
  this.series = this.datasets[this.currentSeriesIndex];
10
11
  }
12
+ setCurrentAnnotationIndex(currentAnnotationIndex) {
13
+ this.currentAnnotationIndex = currentAnnotationIndex;
14
+ this.series = this.datasets[this.currentAnnotationIndex];
15
+ }
11
16
  get series() {
12
17
  return this.datasets[this.currentSeriesIndex] || {};
13
18
  }
@@ -19,6 +24,17 @@ export class Configurer {
19
24
  this.datasets[this.currentSeriesIndex] = series;
20
25
  }
21
26
  }
27
+ get annotation() {
28
+ return this.annotations[this.currentAnnotationIndex] || {};
29
+ }
30
+ set annotation(annotation) {
31
+ if (!this.annotations) {
32
+ this.annotations = [annotation];
33
+ }
34
+ else {
35
+ this.annotations[this.currentAnnotationIndex] = annotation;
36
+ }
37
+ }
22
38
  get config() {
23
39
  if (!this.value) {
24
40
  this.value = this.initializer.call(this);
@@ -38,7 +54,7 @@ export class Configurer {
38
54
  return this.data.datasets;
39
55
  }
40
56
  set datasets(datasets) {
41
- this.datasets = datasets;
57
+ this.data.datasets = datasets;
42
58
  }
43
59
  set dataKey(key) {
44
60
  if (this.series) {
@@ -167,12 +183,21 @@ export class Configurer {
167
183
  return this.scales.yAxes[1];
168
184
  }
169
185
  set yAxes1(yAxes1) {
186
+ if (!this.scales.yAxes[1]) {
187
+ this.scales.yAxes[1] = {};
188
+ }
170
189
  this.scales.yAxes[1] = yAxes1;
171
190
  }
172
191
  get multiAxis() {
173
192
  return this.config.options.multiAxis;
174
193
  }
175
194
  set multiAxis(multiAxis) {
195
+ if (!multiAxis) {
196
+ this.scales.yAxes = [this.yAxes0];
197
+ }
198
+ else if (!this.yAxes1) {
199
+ this.yAxes1 = {};
200
+ }
176
201
  this.config.options.multiAxis = multiAxis;
177
202
  }
178
203
  get valuePrefix() {
@@ -187,7 +212,7 @@ export class Configurer {
187
212
  set valueSuffix(valueSuffix) {
188
213
  this.series.valueSuffix = valueSuffix;
189
214
  }
190
- get valueForamt() {
215
+ get valueFormat() {
191
216
  return this.series.valueFormat;
192
217
  }
193
218
  set valueFormat(valueFormat) {
@@ -199,5 +224,40 @@ export class Configurer {
199
224
  set displayValue(displayValue) {
200
225
  this.series.displayValue = displayValue;
201
226
  }
227
+ get annotations() {
228
+ if (!this.config.options) {
229
+ this.config.options = {};
230
+ }
231
+ if (!this.config.options.annotations) {
232
+ this.config.options.annotations = [];
233
+ }
234
+ return this.config.options.annotations;
235
+ }
236
+ set annotations(annotations) {
237
+ if (!this.config.options) {
238
+ this.config.options = {};
239
+ }
240
+ if (!this.config.options.annotations) {
241
+ this.config.options.annotations = [];
242
+ }
243
+ this.config.options.annotations = annotations;
244
+ }
245
+ get currentAnnotation() {
246
+ return this.annotations[this.currentAnnotationIndex];
247
+ }
248
+ addAnnotation(annotation) {
249
+ if (!this.config.options) {
250
+ this.config.options = {};
251
+ }
252
+ if (!this.config.options.annotations) {
253
+ this.config.options.annotations = [];
254
+ }
255
+ this.config.options.annotations.push(annotation);
256
+ }
257
+ removeAnnotation(index) {
258
+ if (this.config.options && this.config.options.annotations) {
259
+ this.config.options.annotations.splice(index, 1);
260
+ }
261
+ }
202
262
  }
203
263
  //# sourceMappingURL=configurer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configurer.js","sourceRoot":"","sources":["../../../src/editors/configurer.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAU;IAKrB,YAAY,KAAsC,EAAE,WAA2C;QAHxF,uBAAkB,GAAW,CAAC,CAAA;QAInC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED,qBAAqB,CAAC,kBAA0B;QAC9C,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAE,CAAA;IACvD,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAE,IAAI,EAAE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,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;IACvC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA;IAChC,CAAC;IAED,IAAI,WAAW,CAAC,WAA+B;QAC7C,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;IACvC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA;IAChC,CAAC;IAED,IAAI,WAAW,CAAC,WAA+B;QAC7C,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;IACvC,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA;IACjC,CAAC;IAED,IAAI,YAAY,CAAC,YAAY;QAC3B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAA;IACzC,CAAC;CACF","sourcesContent":["export class Configurer {\n public value: OperatoChart.ChartConfig\n public currentSeriesIndex: number = 0\n public initializer: () => OperatoChart.ChartConfig\n\n constructor(value: OperatoChart.ChartConfig | null, initializer: () => OperatoChart.ChartConfig) {\n this.initializer = initializer\n this.value = value || initializer.call(this)\n }\n\n setCurrentSeriesIndex(currentSeriesIndex: number) {\n this.currentSeriesIndex = currentSeriesIndex\n this.series = this.datasets[this.currentSeriesIndex]!\n }\n\n get series() {\n return this.datasets[this.currentSeriesIndex]! || {}\n }\n\n set series(series) {\n if (!this.data) {\n this.config.data = { datasets: [series] }\n } else {\n this.datasets[this.currentSeriesIndex] = series\n }\n }\n\n get config() {\n if (!this.value) {\n this.value = this.initializer.call(this)\n }\n return this.value\n }\n\n get data() {\n return this.config.data\n }\n\n set data(data) {\n this.config.data = data\n }\n\n get datasets() {\n if (!this.data.datasets) {\n this.data.datasets = []\n }\n return this.data.datasets\n }\n\n set datasets(datasets) {\n this.datasets = datasets\n }\n\n set dataKey(key) {\n if (this.series) {\n this.series!.dataKey = key\n }\n }\n\n get dataKey() {\n return this.series.dataKey\n }\n\n get legend() {\n !this.config.options && (this.config.options = {})\n return this.config.options.legend\n }\n\n set legend(legend) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.legend = legend\n }\n\n get theme() {\n return this.config.options && this.config.options.theme\n }\n\n set theme(theme) {\n !this.config.options && (this.config.options = {})\n this.config.options.theme = theme\n }\n\n get tooltip() {\n return !this.config.options || this.config.options.tooltip !== false\n }\n\n set tooltip(tooltip) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.tooltip = tooltip\n }\n\n get animation() {\n return !this.config.options || this.config.options.animation !== false\n }\n\n set animation(animation) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.animation = animation\n }\n\n get scales() {\n if (!this.config.options) {\n this.config.options = {}\n }\n return this.config.options.scales\n }\n\n set scales(scales) {\n !this.config.options && (this.config.options = {})\n this.config.options.scales = scales\n }\n\n get display() {\n return this.legend && this.legend.display\n }\n\n set display(display) {\n if (!this.legend) {\n this.legend = {}\n }\n this.legend.display = display\n }\n\n get position() {\n if (!this.legend) {\n this.legend = {}\n }\n return this.legend.position\n }\n\n set position(position) {\n if (!this.legend) {\n this.legend = {}\n }\n this.legend.position = position\n }\n\n get stacked() {\n if (!this.config.options) {\n this.config.options = {}\n }\n return this.config.options.stacked\n }\n\n set stacked(stacked) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.stacked = stacked\n }\n\n get labelDataKey() {\n return this.data && this.data.labelDataKey\n }\n\n set labelDataKey(labelDataKey) {\n this.data.labelDataKey = labelDataKey\n }\n\n set options(options) {\n this.config.options = options\n }\n\n get options() {\n return this.config.options\n }\n\n get color() {\n var oldVersionColor = this.series.backgroundColor\n if (this.series.type == 'line') oldVersionColor = this.series.borderColor\n if (this.series.type == 'radar') oldVersionColor = this.series.borderColor\n return this.series.color || oldVersionColor\n }\n\n set color(color) {\n this.series.color = color // Array.isArray(color) ? color[0] : color\n delete this.series.backgroundColor\n delete this.series.borderColor\n }\n\n get xAxes0() {\n return this.scales!.xAxes![0]\n }\n\n set xAxes0(xAxes0) {\n this.scales!.xAxes![0] = xAxes0\n }\n\n get yAxes0() {\n return this.scales!.yAxes![0]\n }\n\n set yAxes0(yAxes0) {\n this.scales!.yAxes![0] = yAxes0\n }\n\n get yAxes1() {\n return this.scales!.yAxes![1]\n }\n\n set yAxes1(yAxes1) {\n this.scales!.yAxes![1] = yAxes1\n }\n\n get multiAxis() {\n return this.config.options!.multiAxis\n }\n\n set multiAxis(multiAxis) {\n this.config.options!.multiAxis = multiAxis\n }\n\n get valuePrefix() {\n return this.series.valuePrefix\n }\n\n set valuePrefix(valuePrefix: string | undefined) {\n this.series.valuePrefix = valuePrefix\n }\n\n get valueSuffix() {\n return this.series.valueSuffix\n }\n\n set valueSuffix(valueSuffix: string | undefined) {\n this.series.valueSuffix = valueSuffix\n }\n\n get valueForamt() {\n return this.series.valueFormat\n }\n\n set valueFormat(valueFormat: string | undefined) {\n this.series.valueFormat = valueFormat\n }\n\n get displayValue() {\n return this.series.displayValue\n }\n\n set displayValue(displayValue) {\n this.series.displayValue = displayValue\n }\n}\n"]}
1
+ {"version":3,"file":"configurer.js","sourceRoot":"","sources":["../../../src/editors/configurer.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,UAAU;IAMrB,YAAY,KAAsC,EAAE,WAA2C;QAJxF,uBAAkB,GAAW,CAAC,CAAA;QAC9B,2BAAsB,GAAW,CAAC,CAAA;QAIvC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9C,CAAC;IAED,qBAAqB,CAAC,kBAA0B;QAC9C,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;QAC5C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAE,CAAA;IACvD,CAAC;IAED,yB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AmC;QAC/C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,EAAE,CAAA;QAC1B,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,GAAG,EAAE,CAAA;QACtC,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACnD,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3D,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAClD,CAAC;IACH,CAAC;CACF","sourcesContent":["import { ChartConfiguration } from 'chart.js'\n\nexport class Configurer {\n public value: OperatoChart.ChartConfig\n public currentSeriesIndex: number = 0\n public currentAnnotationIndex: number = 0\n public initializer: () => OperatoChart.ChartConfig\n\n constructor(value: OperatoChart.ChartConfig | null, initializer: () => OperatoChart.ChartConfig) {\n this.initializer = initializer\n this.value = value || initializer.call(this)\n }\n\n setCurrentSeriesIndex(currentSeriesIndex: number) {\n this.currentSeriesIndex = currentSeriesIndex\n this.series = this.datasets[this.currentSeriesIndex]!\n }\n\n setCurrentAnnotationIndex(currentAnnotationIndex: number) {\n this.currentAnnotationIndex = currentAnnotationIndex\n this.series = this.datasets[this.currentAnnotationIndex]!\n }\n\n get series() {\n return this.datasets[this.currentSeriesIndex]! || {}\n }\n\n set series(series) {\n if (!this.data) {\n this.config.data = { datasets: [series] }\n } else {\n this.datasets[this.currentSeriesIndex] = series\n }\n }\n\n get annotation() {\n return this.annotations[this.currentAnnotationIndex]! || {}\n }\n\n set annotation(annotation) {\n if (!this.annotations) {\n this.annotations = [annotation]\n } else {\n this.annotations[this.currentAnnotationIndex] = annotation\n }\n }\n\n get config() {\n if (!this.value) {\n this.value = this.initializer.call(this)\n }\n return this.value\n }\n\n get data() {\n return this.config.data\n }\n\n set data(data) {\n this.config.data = data\n }\n\n get datasets() {\n if (!this.data.datasets) {\n this.data.datasets = []\n }\n return this.data.datasets\n }\n\n set datasets(datasets) {\n this.data.datasets = datasets\n }\n\n set dataKey(key) {\n if (this.series) {\n this.series!.dataKey = key\n }\n }\n\n get dataKey() {\n return this.series.dataKey\n }\n\n get legend() {\n !this.config.options && (this.config.options = {})\n return this.config.options.legend\n }\n\n set legend(legend) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.legend = legend\n }\n\n get theme() {\n return this.config.options && this.config.options.theme\n }\n\n set theme(theme) {\n !this.config.options && (this.config.options = {})\n this.config.options.theme = theme\n }\n\n get tooltip() {\n return !this.config.options || this.config.options.tooltip !== false\n }\n\n set tooltip(tooltip) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.tooltip = tooltip\n }\n\n get animation() {\n return !this.config.options || this.config.options.animation !== false\n }\n\n set animation(animation) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.animation = animation\n }\n\n get scales() {\n if (!this.config.options) {\n this.config.options = {}\n }\n return this.config.options.scales\n }\n\n set scales(scales) {\n !this.config.options && (this.config.options = {})\n this.config.options.scales = scales\n }\n\n get display() {\n return this.legend && this.legend.display\n }\n\n set display(display) {\n if (!this.legend) {\n this.legend = {}\n }\n this.legend.display = display\n }\n\n get position() {\n if (!this.legend) {\n this.legend = {}\n }\n return this.legend.position\n }\n\n set position(position) {\n if (!this.legend) {\n this.legend = {}\n }\n this.legend.position = position\n }\n\n get stacked() {\n if (!this.config.options) {\n this.config.options = {}\n }\n return this.config.options.stacked\n }\n\n set stacked(stacked) {\n if (!this.config.options) {\n this.config.options = {}\n }\n this.config.options.stacked = stacked\n }\n\n get labelDataKey() {\n return this.data && this.data.labelDataKey\n }\n\n set labelDataKey(labelDataKey) {\n this.data.labelDataKey = labelDataKey\n }\n\n set options(options) {\n this.config.options = options\n }\n\n get options() {\n return this.config.options\n }\n\n get color() {\n var oldVersionColor = this.series.backgroundColor\n if (this.series.type == 'line') oldVersionColor = this.series.borderColor\n if (this.series.type == 'radar') oldVersionColor = this.series.borderColor\n return this.series.color || oldVersionColor\n }\n\n set color(color) {\n this.series.color = color // Array.isArray(color) ? color[0] : color\n delete this.series.backgroundColor\n delete this.series.borderColor\n }\n\n get xAxes0() {\n return this.scales!.xAxes![0]\n }\n\n set xAxes0(xAxes0) {\n this.scales!.xAxes![0] = xAxes0\n }\n\n get yAxes0() {\n return this.scales!.yAxes![0]\n }\n\n set yAxes0(yAxes0) {\n this.scales!.yAxes![0] = yAxes0\n }\n\n get yAxes1() {\n return this.scales!.yAxes![1]\n }\n\n set yAxes1(yAxes1) {\n if (!this.scales!.yAxes![1]) {\n this.scales!.yAxes![1] = {}\n }\n this.scales!.yAxes![1] = yAxes1\n }\n\n get multiAxis() {\n return this.config.options!.multiAxis\n }\n\n set multiAxis(multiAxis) {\n if (!multiAxis) {\n this.scales!.yAxes = [this.yAxes0]\n } else if (!this.yAxes1) {\n this.yAxes1 = {}\n }\n\n this.config.options!.multiAxis = multiAxis\n }\n\n get valuePrefix() {\n return this.series.valuePrefix\n }\n\n set valuePrefix(valuePrefix: string | undefined) {\n this.series.valuePrefix = valuePrefix\n }\n\n get valueSuffix() {\n return this.series.valueSuffix\n }\n\n set valueSuffix(valueSuffix: string | undefined) {\n this.series.valueSuffix = valueSuffix\n }\n\n get valueFormat() {\n return this.series.valueFormat\n }\n\n set valueFormat(valueFormat: string | undefined) {\n this.series.valueFormat = valueFormat\n }\n\n get displayValue() {\n return this.series.displayValue\n }\n\n set displayValue(displayValue) {\n this.series.displayValue = displayValue\n }\n\n get annotations(): OperatoChart.Annotation[] {\n if (!this.config.options) {\n this.config.options = {}\n }\n if (!this.config.options.annotations) {\n this.config.options.annotations = []\n }\n\n return this.config.options.annotations!\n }\n\n set annotations(annotations) {\n if (!this.config.options) {\n this.config.options = {}\n }\n if (!this.config.options.annotations) {\n this.config.options.annotations = []\n }\n this.config.options.annotations = annotations\n }\n\n get currentAnnotation() {\n return this.annotations[this.currentAnnotationIndex]\n }\n\n addAnnotation(annotation: OperatoChart.Annotation) {\n if (!this.config.options) {\n this.config.options = {}\n }\n if (!this.config.options.annotations) {\n this.config.options.annotations = []\n }\n\n this.config.options.annotations!.push(annotation)\n }\n\n removeAnnotation(index: number) {\n if (this.config.options && this.config.options.annotations) {\n this.config.options.annotations.splice(index, 1)\n }\n }\n}\n"]}
@@ -1,15 +1,26 @@
1
1
  import '@operato/i18n/ox-i18n.js';
2
+ import { PropertyValues } from 'lit';
2
3
  import { TinyColor } from '@ctrl/tinycolor';
4
+ import { MdIcon } from '@material/web/icon/icon.js';
3
5
  import { Configurer } from './configurer';
4
6
  import { OxFormField } from '@operato/input';
5
7
  export declare class InputChartAbstract extends OxFormField {
6
8
  static styles: import("lit").CSSResult[];
7
9
  value: OperatoChart.ChartConfig | null;
8
10
  chartType: OperatoChart.ChartType;
11
+ annotationsTabs: HTMLElement;
12
+ annotationsTabNavLeftButton: MdIcon;
13
+ annotationsTabNavRightButton: MdIcon;
14
+ seriesTabs: HTMLElement;
15
+ seriesTabNavLeftButton: MdIcon;
16
+ seriesTabNavRightButton: MdIcon;
9
17
  private _configurer?;
10
18
  get configurer(): Configurer;
11
19
  render(): import("lit-html").TemplateResult<1>;
12
20
  connectedCallback(): void;
21
+ protected firstUpdated(_changedProperties: PropertyValues): void;
22
+ get seriesTabContainer(): HTMLElement | null | undefined;
23
+ get annotationsTabContainer(): HTMLElement | null | undefined;
13
24
  displayValueTemplate(): import("lit-html").TemplateResult<1>;
14
25
  subTemplate(): import("lit-html").TemplateResult<1>;
15
26
  getDefaultDatasets(): OperatoChart.Dataset[];
@@ -19,10 +30,17 @@ export declare class InputChartAbstract extends OxFormField {
19
30
  onValuesChanged(e: Event): void;
20
31
  onTapAddTab(e: Event): void;
21
32
  onTapRemoveCurrentTab(index: number): void;
33
+ onTapAddAnnotation(e: Event): void;
34
+ onTapRemoveCurrentAnnotation(index: number): void;
22
35
  _getSeriesModel({ chartType, datasetsLength, lastSeriesColor }: {
23
36
  chartType: string;
24
37
  datasetsLength: number;
25
38
  lastSeriesColor: TinyColor;
26
39
  }): any;
27
40
  _getElementValue(element: HTMLElement): any;
41
+ annotationsTabTemplate(): import("lit-html").TemplateResult<1>;
42
+ multiSeriesTabTemplate(): import("lit-html").TemplateResult<1>;
43
+ _onTabScroll(e: Event, type: 'series' | 'annotations'): void;
44
+ _onTabScrollNavLeft(e: Event, type: 'series' | 'annotations'): void;
45
+ _onTabScrollNavRight(e: Event, type: 'series' | 'annotations'): void;
28
46
  }