@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
@@ -1,430 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/i18n/ox-i18n.js'
3
-
4
- import { html } from 'lit'
5
- import { query } from 'lit/decorators.js'
6
-
7
- import { MdIcon } from '@material/web/icon/icon.js'
8
-
9
- import { InputChartAbstract } from './input-chart-abstract'
10
-
11
- export class InputChartMultiSeriesAbstract extends InputChartAbstract {
12
- static styles = [...InputChartAbstract.styles]
13
-
14
- @query('#tabs') tabs!: HTMLElement
15
- @query('#tab-nav-left-button') tabNavLeftButton!: MdIcon
16
- @query('#tab-nav-right-button') tabNavRightButton!: MdIcon
17
-
18
- get tabContainer(): HTMLElement | null | undefined {
19
- return this.tabs
20
- }
21
-
22
- firstUpdated() {
23
- this.tabContainer?.addEventListener('scroll', e => {
24
- this._onTabScroll(e)
25
- })
26
- }
27
-
28
- subTemplate() {
29
- const configurer = this.configurer
30
-
31
- return html`
32
- <input id="multi-axis" type="checkbox" value-key="multiAxis" ?checked=${configurer.multiAxis} />
33
- <label for="multi-axis"> <ox-i18n msgid="label.multi-axis">Multi Axis</ox-i18n> </label>
34
-
35
- <legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
36
-
37
- ${this.multiSeriesTabTemplate()}
38
-
39
- <legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
40
-
41
- <label for="label-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
42
- <input id="label-data-key" type="text" value-key="labelDataKey" .value=${configurer.labelDataKey || ''} />
43
-
44
- <label for="axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
45
- <input id="axis-title" type="text" value-key="xAxes0.axisTitle" .value=${configurer.xAxes0.axisTitle || ''} />
46
-
47
- <label for="x-axes0-thickness"> <ox-i18n msgid="label.thickness">Thickness</ox-i18n> </label>
48
- <input
49
- id="x-axes0-thickness"
50
- type="number"
51
- value-key="xAxes0.barPercentage"
52
- .value=${String(configurer.xAxes0.barPercentage || 0)}
53
- />
54
-
55
- <input
56
- for="grid-line"
57
- type="checkbox"
58
- value-key="value.options.xGridLine"
59
- ?checked=${configurer.config.options?.xGridLine}
60
- />
61
- <label id="grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
62
-
63
- <input
64
- for="x-axes0-ticks-display"
65
- type="checkbox"
66
- value-key="xAxes0.ticks.display"
67
- ?checked=${configurer.xAxes0.ticks?.display}
68
- />
69
- <label id="x-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
70
-
71
- <legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
72
-
73
- <label for="y-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
74
- <input
75
- id="y-axes0-axis-title"
76
- type="text"
77
- value-key="yAxes0.axisTitle"
78
- .value=${configurer.yAxes0.axisTitle || ''}
79
- />
80
-
81
- <input
82
- id="y-axes0-ticks-automin"
83
- type="checkbox"
84
- value-key="yAxes0.ticks.autoMin"
85
- ?checked=${configurer.yAxes0.ticks?.autoMin}
86
- />
87
- <label for="y-axes0-ticks-automin"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
88
-
89
- <input
90
- id="y-axes0-ticks-automax"
91
- type="checkbox"
92
- value-key="yAxes0.ticks.autoMax"
93
- ?checked=${configurer.yAxes0.ticks?.autoMax}
94
- />
95
- <label for="y-axes0-ticks-automax"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
96
-
97
- ${!configurer.yAxes0.ticks?.autoMin
98
- ? html`
99
- <label for="y-axes0-ticks-min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
100
- <input
101
- id="y-axes0-ticks-min"
102
- type="number"
103
- value-key="yAxes0.ticks.min"
104
- .value=${String(configurer.yAxes0.ticks?.min)}
105
- />
106
- `
107
- : html``}
108
- ${!configurer.yAxes0.ticks?.autoMax
109
- ? html`
110
- <label for="y-axes0-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
111
- <input
112
- id="y-axes0-ticks-max"
113
- type="number"
114
- value-key="yAxes0.ticks.max"
115
- .value=${String(configurer.yAxes0.ticks?.max)}
116
- />
117
- `
118
- : html``}
119
-
120
- <label for="y-axes0-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
121
- <input
122
- id="y-axes0-ticks-step-size"
123
- type="number"
124
- value-key="yAxes0.ticks.stepSize"
125
- .value=${String(configurer.yAxes0.ticks?.stepSize)}
126
- />
127
-
128
- <input
129
- id="y-grid-line"
130
- type="checkbox"
131
- value-key="value.options.yGridLine"
132
- ?checked=${configurer.config.options?.yGridLine}
133
- />
134
- <label for="y-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
135
-
136
- <input
137
- id="y-axes0-ticks-display"
138
- type="checkbox"
139
- value-key="yAxes0.ticks.display"
140
- ?checked=${configurer.yAxes0.ticks?.display}
141
- />
142
- <label for="y-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
143
-
144
- ${configurer.config.options?.multiAxis
145
- ? html`
146
- <legend><ox-i18n msgid="label.y-2nd-axes">Y 2nd Axes</ox-i18n></legend>
147
-
148
- <label for="y-axes1.axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
149
- <input
150
- id="y-axes1.axis-title"
151
- type="text"
152
- value-key="yAxes1.axisTitle"
153
- .value=${configurer.yAxes1.axisTitle || ''}
154
- />
155
-
156
- <input
157
- id="axis-min-auto"
158
- type="checkbox"
159
- value-key="yAxes1.ticks.autoMin"
160
- ?checked=${configurer.yAxes1.ticks?.autoMin}
161
- />
162
- <label for="axis-min-auto"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
163
-
164
- <input
165
- id="axis-max-auto"
166
- type="checkbox"
167
- value-key="yAxes1.ticks.autoMax"
168
- ?checked=${configurer.yAxes1.ticks?.autoMax}
169
- />
170
- <label for="axis-max-auto"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
171
-
172
- ${!configurer.yAxes1.ticks?.autoMin
173
- ? html`
174
- <label for="y-axes1.ticks.min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
175
- <input
176
- id="y-axes1.ticks.min"
177
- type="number"
178
- value-key="yAxes1.ticks.min"
179
- .value=${String(configurer.yAxes1.ticks?.min)}
180
- />
181
- `
182
- : html``}
183
- ${!configurer.yAxes1.ticks?.autoMax
184
- ? html`
185
- <label for="y-axes1-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
186
- <input
187
- id="y-axes1-ticks-max"
188
- type="number"
189
- value-key="yAxes1.ticks.max"
190
- .value=${String(configurer.yAxes1.ticks?.max)}
191
- />
192
- `
193
- : html``}
194
-
195
- <label for="y-axes1-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
196
- <input
197
- id="y-axes1-ticks-step-size"
198
- type="number"
199
- value-key="yAxes1.ticks.stepSize"
200
- .value=${String(configurer.yAxes1.ticks?.stepSize)}
201
- />
202
-
203
- <input
204
- id="y2nd-grid-line"
205
- type="checkbox"
206
- value-key="value.options.y2ndGridLine"
207
- ?checked=${configurer.config.options.y2ndGridLine}
208
- />
209
- <label for="y2nd-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
210
-
211
- <input
212
- id="y-axes1.ticks.display"
213
- type="checkbox"
214
- value-key="yAxes1.ticks.display"
215
- ?checked=${configurer.yAxes1.ticks?.display}
216
- />
217
- <label for="y-axes1.ticks.display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
218
- `
219
- : html``}
220
- `
221
- }
222
-
223
- multiSeriesTabTemplate() {
224
- const configurer = this.configurer
225
-
226
- return html`
227
- <div id="series-properties-container" fullwidth>
228
- <div id="tab-header">
229
- <md-icon
230
- id="tab-nav-left-button"
231
- @tap=${(e: Event) => {
232
- this._onTabScrollNavLeft(e)
233
- }}
234
- disabled
235
- >chevron_left</md-icon
236
- >
237
- <div
238
- id="tabs"
239
- @change=${(e: Event) => {
240
- configurer.currentSeriesIndex = (e.target as any).activeTabIndex
241
- }}
242
- active-tab-index=${configurer.currentSeriesIndex}
243
- fit-container
244
- >
245
- ${configurer.datasets.map(
246
- (dataset: any, index: number) => html`
247
- <div
248
- data-series=${index + 1}
249
- data-tab-index=${index}
250
- tab
251
- ?selected=${index == configurer.currentSeriesIndex}
252
- @click=${(e: Event) => {
253
- const target = e.target as HTMLDivElement
254
- this.configurer.setCurrentSeriesIndex(Number(target.getAttribute('data-tab-index')))
255
- this.value = { ...this.configurer.value }
256
- }}
257
- >
258
- ${index + 1}
259
- ${!configurer.datasets || (configurer.datasets.length != 1 && configurer.currentSeriesIndex == index)
260
- ? html` <md-icon @tap=${(e: Event) => this.onTapRemoveCurrentTab(index)}> close </md-icon> `
261
- : html``}
262
- </div>
263
- `
264
- )}
265
- </div>
266
- <md-icon
267
- id="tab-nav-right-button"
268
- @click=${(e: Event) => {
269
- this._onTabScrollNavRight(e)
270
- }}
271
- disabled
272
- >chevron_right</md-icon
273
- >
274
- </div>
275
- <div id="add-series-button-container">
276
- <md-icon id="add-series-button" @tap=${(e: Event) => this.onTapAddTab(e)}>add</md-icon>
277
- </div>
278
-
279
- <div class="tab-content">
280
- <label for="data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
281
- <input id="data-key" type="text" value-key="dataKey" .value=${configurer.dataKey || ''} />
282
-
283
- ${this.chartType == 'line' || this.chartType == 'bar'
284
- ? html`
285
- <label for="series-type"> <ox-i18n msgid="label.series-type">type</ox-i18n> </label>
286
- <select
287
- id="series-type"
288
- class="select-content"
289
- value-key="series.type"
290
- .value=${configurer.series.type || ''}
291
- >
292
- <option value="bar" selected>bar</option>
293
- <option value="line">line</option>
294
- </select>
295
- `
296
- : html``}
297
-
298
- <label for="series-label"> <ox-i18n msgid="label.label">label</ox-i18n> </label>
299
- <input id="series-label" type="text" value-key="series.label" .value=${configurer.series.label || ''} />
300
-
301
- ${configurer.series.type == 'line'
302
- ? html`
303
- <label for="series-line-tension"> <ox-i18n msgid="label.line-tension">line tension</ox-i18n> </label>
304
- <select
305
- id="series-line-tension"
306
- class="select-content"
307
- value-key="series.lineTension"
308
- .value=${String(configurer.series.lineTension || 0)}
309
- >
310
- <option value="0.4">smooth</option>
311
- <option value="0">angled</option>
312
- </select>
313
- `
314
- : html``}
315
- ${configurer.series.type == 'line'
316
- ? html`
317
- <label for="series-border-width"> <ox-i18n msgid="label.border-width">border width</ox-i18n> </label>
318
- <input
319
- id="series-border-width"
320
- type="number"
321
- value-key="series.borderWidth"
322
- .value=${String(configurer.series.borderWidth || 0)}
323
- />
324
- `
325
- : html``}
326
-
327
- <label for="series-color"> <ox-i18n msgid="label.color">color</ox-i18n> </label>
328
- <ox-input-color id="series-color" value-key="color" .value=${configurer.color}></ox-input-color>
329
-
330
- ${configurer.series.type == 'line'
331
- ? html`
332
- <label for="series-point-style"> <ox-i18n msgid="label.point-shape">point shape</ox-i18n> </label>
333
- <select
334
- id="series-point-style"
335
- class="select-content"
336
- value-key="series.pointStyle"
337
- .value=${configurer.series.pointStyle || ''}
338
- >
339
- <option value="">&nbsp;</option>
340
- <option value="circle">⚬</option>
341
- <option value="triangle">▵</option>
342
- <option value="rect">□</option>
343
- <option value="rectRot">◇</option>
344
- <option value="cross">+</option>
345
- <option value="crossRot">⨉</option>
346
- <option value="star">✱</option>
347
- <option value="line">―</option>
348
- <option value="dash">┄</option>
349
- </select>
350
-
351
- <label for="series-point-radius"> <ox-i18n msgid="label.point-size">point size</ox-i18n> </label>
352
- <input
353
- id="series-point-radius"
354
- type="number"
355
- value-key="series.pointRadius"
356
- .value=${String(configurer.series.pointRadius || 0)}
357
- />
358
- `
359
- : html``} <label for="series-stack"> <ox-i18n msgid="label.stack-group">Stack group</ox-i18n> </label>
360
- <input id="series-stack" type="text" value-key="series.stack" .value=${configurer.series.stack || ''} />
361
- ${configurer.series.type == 'line'
362
- ? html`
363
- <input id="seires-fill" type="checkbox" value-key="series.fill" ?checked=${configurer.series.fill} />
364
- <label for="seires-fill"> <ox-i18n msgid="label.fill">fill</ox-i18n> </label>
365
- `
366
- : html``}
367
- ${configurer.multiAxis
368
- ? html`
369
- <label for="series-y-axis-id"> <ox-i18n msgid="label.target-axis">target axis</ox-i18n> </label>
370
- <select
371
- id="series-y-axis-id"
372
- class="select-content"
373
- value-key="series.yAxisID"
374
- .value=${configurer.series.yAxisID || ''}
375
- >
376
- <option value="left">left</option>
377
- <option value="right">right</option>
378
- </select>
379
- `
380
- : html``}
381
- ${this.displayValueTemplate()}
382
- </div>
383
- </div>
384
- `
385
- }
386
-
387
- _onTabScroll(e: Event) {
388
- if (!this.tabContainer) {
389
- return
390
- }
391
-
392
- if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
393
- this.tabNavLeftButton.setAttribute('disabled', '')
394
- this.tabNavRightButton.setAttribute('disabled', '')
395
- }
396
- // left-end
397
- else if (this.tabContainer.scrollLeft == 0) {
398
- this.tabNavLeftButton.setAttribute('disabled', '')
399
- this.tabNavRightButton.removeAttribute('disabled')
400
- }
401
- // right-end
402
- else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
403
- this.tabNavLeftButton.removeAttribute('disabled')
404
- this.tabNavRightButton.setAttribute('disabled', '')
405
- } else {
406
- this.tabNavLeftButton.removeAttribute('disabled')
407
- this.tabNavRightButton.removeAttribute('disabled')
408
- }
409
- }
410
-
411
- _onTabScrollNavLeft(e: Event) {
412
- if (!this.tabContainer) {
413
- return
414
- }
415
-
416
- this.tabContainer.style.scrollBehavior = 'smooth'
417
- this.tabContainer.scrollLeft -= this.tabContainer.clientWidth
418
- this.tabContainer.style.scrollBehavior = 'auto'
419
- }
420
-
421
- _onTabScrollNavRight(e: Event) {
422
- if (!this.tabContainer) {
423
- return
424
- }
425
-
426
- this.tabContainer.style.scrollBehavior = 'smooth'
427
- this.tabContainer.scrollLeft += this.tabContainer.clientWidth
428
- this.tabContainer.style.scrollBehavior = 'auto'
429
- }
430
- }