@operato/chart 7.0.37 → 7.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/src/editors/configurer.d.ts +4 -2
- package/dist/src/editors/configurer.js +27 -14
- package/dist/src/editors/configurer.js.map +1 -1
- package/dist/src/editors/input-chart-abstract.d.ts +0 -26
- package/dist/src/editors/input-chart-abstract.js +1 -607
- package/dist/src/editors/input-chart-abstract.js.map +1 -1
- package/dist/src/editors/input-chart-styles.js +27 -0
- package/dist/src/editors/input-chart-styles.js.map +1 -1
- package/dist/src/editors/ox-input-chart-hbar.d.ts +1 -1
- package/dist/src/editors/ox-input-chart-hbar.js +2 -69
- package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-mixed.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-mixed.js +2 -2
- package/dist/src/editors/ox-input-chart-mixed.js.map +1 -1
- package/dist/src/editors/ox-input-chart-pie.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-pie.js +3 -1
- package/dist/src/editors/ox-input-chart-pie.js.map +1 -1
- package/dist/src/editors/ox-input-chart-radar.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-radar.js +2 -2
- package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-timeseries.d.ts +2 -0
- package/dist/src/editors/ox-input-chart-timeseries.js +9 -3
- package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
- package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
- package/dist/src/editors/templates/annotations.d.ts +23 -0
- package/dist/src/editors/templates/annotations.js +270 -0
- package/dist/src/editors/templates/annotations.js.map +1 -0
- package/dist/src/editors/templates/display-value.d.ts +12 -0
- package/dist/src/editors/templates/display-value.js +105 -0
- package/dist/src/editors/templates/display-value.js.map +1 -0
- package/dist/src/editors/templates/series.d.ts +31 -0
- package/dist/src/editors/templates/series.js +277 -0
- package/dist/src/editors/templates/series.js.map +1 -0
- package/dist/src/scichart/ox-scichart.js +4 -3
- package/dist/src/scichart/ox-scichart.js.map +1 -1
- package/dist/src/scichart/scichart-builder.js +25 -7
- package/dist/src/scichart/scichart-builder.js.map +1 -1
- package/dist/stories/common.d.ts +2 -2
- package/dist/stories/common.js +6 -3
- package/dist/stories/common.js.map +1 -1
- package/dist/stories/ox-input-chart-timeseries.stories.js +2 -2
- package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/editors/configurer.ts +28 -15
- package/src/editors/input-chart-abstract.ts +1 -655
- package/src/editors/input-chart-styles.ts +27 -0
- package/src/editors/ox-input-chart-hbar.ts +3 -73
- package/src/editors/ox-input-chart-mixed.ts +2 -2
- package/src/editors/ox-input-chart-pie.ts +3 -2
- package/src/editors/ox-input-chart-radar.ts +3 -2
- package/src/editors/ox-input-chart-timeseries.ts +10 -3
- package/src/editors/ox-property-editor-chart.ts +1 -1
- package/src/editors/templates/annotations.ts +287 -0
- package/src/editors/templates/display-value.ts +110 -0
- package/src/editors/templates/series.ts +304 -0
- package/src/scichart/ox-scichart.ts +7 -3
- package/src/scichart/scichart-builder.ts +30 -6
- package/stories/common.ts +6 -3
- package/stories/ox-input-chart-timeseries.stories.ts +2 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import '@operato/i18n/ox-i18n.js';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { property
|
|
5
|
-
import { keyed } from 'lit/directives/keyed.js';
|
|
4
|
+
import { property } from 'lit/decorators.js';
|
|
6
5
|
import { random as randomColor, TinyColor } from '@ctrl/tinycolor';
|
|
7
6
|
import { InputChartStyles } from './input-chart-styles';
|
|
8
7
|
import { Configurer } from './configurer';
|
|
@@ -68,108 +67,6 @@ export class InputChartAbstract extends OxFormField {
|
|
|
68
67
|
super.connectedCallback();
|
|
69
68
|
this.renderRoot.addEventListener('change', this.onValuesChanged.bind(this));
|
|
70
69
|
}
|
|
71
|
-
firstUpdated(_changedProperties) {
|
|
72
|
-
this.seriesTabContainer?.addEventListener('scroll', e => {
|
|
73
|
-
this._onTabScroll(e, 'series');
|
|
74
|
-
});
|
|
75
|
-
this.annotationsTabContainer?.addEventListener('scroll', e => {
|
|
76
|
-
this._onTabScroll(e, 'annotations');
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
get seriesTabContainer() {
|
|
80
|
-
return this.seriesTabs;
|
|
81
|
-
}
|
|
82
|
-
get annotationsTabContainer() {
|
|
83
|
-
return this.annotationsTabs;
|
|
84
|
-
}
|
|
85
|
-
displayValueTemplate() {
|
|
86
|
-
const configurer = this.configurer;
|
|
87
|
-
return html `
|
|
88
|
-
<label for="value-format"> <ox-i18n msgid="label.value-format">Value Format</ox-i18n> </label>
|
|
89
|
-
<input
|
|
90
|
-
id="value-format"
|
|
91
|
-
type="text"
|
|
92
|
-
value-key="series.valueFormat"
|
|
93
|
-
.value=${configurer.series.valueFormat || ''}
|
|
94
|
-
list="format-list"
|
|
95
|
-
/>
|
|
96
|
-
<datalist id="format-list">
|
|
97
|
-
<option value="#,###."></option>
|
|
98
|
-
<option value="#,###.#"></option>
|
|
99
|
-
<option value="#,###.0"></option>
|
|
100
|
-
<option value="#,##0.#"></option>
|
|
101
|
-
<option value="#,##0.0"></option>
|
|
102
|
-
<option value="#,##0.0%"></option>
|
|
103
|
-
</datalist>
|
|
104
|
-
|
|
105
|
-
<label for="value-prefix"> <ox-i18n msgid="label.value-prefix">Value Prefix</ox-i18n> </label>
|
|
106
|
-
<input
|
|
107
|
-
id="value-prefix"
|
|
108
|
-
type="text"
|
|
109
|
-
value-key="series.valuePrefix"
|
|
110
|
-
.value=${configurer.series.valuePrefix || ''}
|
|
111
|
-
/>
|
|
112
|
-
|
|
113
|
-
<label for="value-suffix"> <ox-i18n msgid="label.value-suffix">Value Suffix</ox-i18n> </label>
|
|
114
|
-
<input
|
|
115
|
-
id="value-suffix"
|
|
116
|
-
type="text"
|
|
117
|
-
value-key="series.valueSuffix"
|
|
118
|
-
.value=${configurer.series.valueSuffix || ''}
|
|
119
|
-
/>
|
|
120
|
-
|
|
121
|
-
<input
|
|
122
|
-
id="display-value"
|
|
123
|
-
type="checkbox"
|
|
124
|
-
value-key="series.displayValue"
|
|
125
|
-
?checked=${!!configurer.series.displayValue}
|
|
126
|
-
/>
|
|
127
|
-
<label for="display-value"> <ox-i18n msgid="label.value-display">Value Display</ox-i18n> </label>
|
|
128
|
-
|
|
129
|
-
${configurer.series.displayValue
|
|
130
|
-
? html `
|
|
131
|
-
<label for="font-color"> <ox-i18n msgid="label.font-color">Font Color</ox-i18n> </label>
|
|
132
|
-
<ox-input-color
|
|
133
|
-
id="font-color"
|
|
134
|
-
value-key="series.defaultFontColor"
|
|
135
|
-
.value=${configurer.series.defaultFontColor || '#000'}
|
|
136
|
-
></ox-input-color>
|
|
137
|
-
<label for="font-size"> <ox-i18n msgid="label.font-size">Font Size</ox-i18n> </label>
|
|
138
|
-
<input
|
|
139
|
-
id="font-size"
|
|
140
|
-
type="number"
|
|
141
|
-
value-key="series.defaultFontSize"
|
|
142
|
-
value=${configurer.series.defaultFontSize || 10}
|
|
143
|
-
/>
|
|
144
|
-
<label for="data-label-anchor"> <ox-i18n msgid="label.data-label-anchor">Position</ox-i18n> </label>
|
|
145
|
-
<select
|
|
146
|
-
id="data-label-anchor"
|
|
147
|
-
value-key="series.dataLabelAnchor"
|
|
148
|
-
.value=${configurer.series.dataLabelAnchor || 'center'}
|
|
149
|
-
>
|
|
150
|
-
<option value=""></option>
|
|
151
|
-
<option value="start">Start</option>
|
|
152
|
-
<option value="center">Center</option>
|
|
153
|
-
<option value="end">End</option>
|
|
154
|
-
</select>
|
|
155
|
-
<label for="data-label-offset"> <ox-i18n msgid="label.data-label-offset">Offset</ox-i18n> </label>
|
|
156
|
-
<input
|
|
157
|
-
id="data-label-offset"
|
|
158
|
-
type="number"
|
|
159
|
-
value-key="series.dataLabelOffset"
|
|
160
|
-
value=${configurer.series.dataLabelOffset || 0}
|
|
161
|
-
/>
|
|
162
|
-
<label for="data-label-rotation"> <ox-i18n msgid="label.data-label-rotation">Rotation</ox-i18n> </label>
|
|
163
|
-
<input
|
|
164
|
-
id="data-label-rotation"
|
|
165
|
-
type="number"
|
|
166
|
-
value-key="series.dataLabelRotation"
|
|
167
|
-
value=${configurer.series.dataLabelRotation || 0}
|
|
168
|
-
/>
|
|
169
|
-
`
|
|
170
|
-
: html ``}
|
|
171
|
-
`;
|
|
172
|
-
}
|
|
173
70
|
subTemplate() {
|
|
174
71
|
return html ``;
|
|
175
72
|
}
|
|
@@ -262,67 +159,6 @@ export class InputChartAbstract extends OxFormField {
|
|
|
262
159
|
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
263
160
|
this.requestUpdate();
|
|
264
161
|
}
|
|
265
|
-
onTapAddSeriesTab(e) {
|
|
266
|
-
const configurer = this.configurer;
|
|
267
|
-
if (!configurer.config.data.datasets)
|
|
268
|
-
return;
|
|
269
|
-
const lastSeriesIndex = configurer.config.data.datasets.length;
|
|
270
|
-
const chartType = configurer.series.type || configurer.config.type;
|
|
271
|
-
const color = configurer.datasets[lastSeriesIndex - 1]?.backgroundColor;
|
|
272
|
-
const lastSeriesColor = new TinyColor(Array.isArray(color) ? color[0] : color);
|
|
273
|
-
const seriesModel = this._getSeriesModel({
|
|
274
|
-
chartType: chartType,
|
|
275
|
-
datasetsLength: lastSeriesIndex,
|
|
276
|
-
lastSeriesColor
|
|
277
|
-
});
|
|
278
|
-
configurer.config.data.datasets.push(seriesModel);
|
|
279
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
280
|
-
configurer.setCurrentSeriesIndex(lastSeriesIndex);
|
|
281
|
-
this.value = { ...this.configurer.value };
|
|
282
|
-
}
|
|
283
|
-
onTapRemoveCurrentSeriesTab(index) {
|
|
284
|
-
const configurer = this.configurer;
|
|
285
|
-
if (!configurer.config.data.datasets) {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
this.configurer.data.datasets.splice(index, 1);
|
|
289
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
290
|
-
configurer.setCurrentSeriesIndex(Math.max(0, configurer.currentSeriesIndex - 1));
|
|
291
|
-
this.requestUpdate();
|
|
292
|
-
}
|
|
293
|
-
onTapAddAnnotation(e) {
|
|
294
|
-
const configurer = this.configurer;
|
|
295
|
-
const lastAnnotationIndex = configurer.annotations.length;
|
|
296
|
-
configurer.annotations.push({ type: 'line', x1: 0, y1: 0 });
|
|
297
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
298
|
-
configurer.setCurrentAnnotationIndex(lastAnnotationIndex);
|
|
299
|
-
this.value = { ...this.configurer.value };
|
|
300
|
-
}
|
|
301
|
-
onTapRemoveCurrentAnnotation(index) {
|
|
302
|
-
const configurer = this.configurer;
|
|
303
|
-
if (!configurer.annotations) {
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
configurer.annotations.splice(index, 1);
|
|
307
|
-
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
308
|
-
configurer.setCurrentAnnotationIndex(Math.max(0, configurer.currentAnnotationIndex - 1));
|
|
309
|
-
this.requestUpdate();
|
|
310
|
-
}
|
|
311
|
-
_getSeriesModel({ chartType, datasetsLength, lastSeriesColor }) {
|
|
312
|
-
const addSeriesOption = {
|
|
313
|
-
label: `series ${datasetsLength + 1}`,
|
|
314
|
-
data: [],
|
|
315
|
-
borderWidth: 1,
|
|
316
|
-
dataKey: '',
|
|
317
|
-
yAxisID: 'left',
|
|
318
|
-
color: randomColor({
|
|
319
|
-
hue: lastSeriesColor.toHsv().h
|
|
320
|
-
}).toRgbString(),
|
|
321
|
-
stack: ''
|
|
322
|
-
};
|
|
323
|
-
addSeriesOption.type = addSeriesOption.chartType = chartType;
|
|
324
|
-
return addSeriesOption;
|
|
325
|
-
}
|
|
326
162
|
_getElementValue(element) {
|
|
327
163
|
switch (element.tagName) {
|
|
328
164
|
case 'INPUT':
|
|
@@ -338,430 +174,6 @@ export class InputChartAbstract extends OxFormField {
|
|
|
338
174
|
return element.value;
|
|
339
175
|
}
|
|
340
176
|
}
|
|
341
|
-
annotationsTabTemplate() {
|
|
342
|
-
const configurer = this.configurer;
|
|
343
|
-
const currentAnnotation = configurer.annotations[configurer.currentAnnotationIndex] || {};
|
|
344
|
-
return keyed(configurer.currentAnnotationIndex, html `
|
|
345
|
-
<div id="annotations-properties-container" fullwidth>
|
|
346
|
-
<div id="annotations-tab-header">
|
|
347
|
-
<md-icon
|
|
348
|
-
id="annotations-tab-nav-left-button"
|
|
349
|
-
@tap=${(e) => {
|
|
350
|
-
this._onTabScrollNavLeft(e, 'annotations');
|
|
351
|
-
}}
|
|
352
|
-
disabled
|
|
353
|
-
>chevron_left</md-icon
|
|
354
|
-
>
|
|
355
|
-
<div
|
|
356
|
-
id="annotations-tabs"
|
|
357
|
-
@change=${(e) => {
|
|
358
|
-
configurer.setCurrentAnnotationIndex(e.target.activeTabIndex);
|
|
359
|
-
}}
|
|
360
|
-
active-tab-index=${configurer.currentAnnotationIndex}
|
|
361
|
-
fit-container
|
|
362
|
-
>
|
|
363
|
-
${configurer.annotations.map((annotation, index) => html `
|
|
364
|
-
<div
|
|
365
|
-
data-annotation=${index + 1}
|
|
366
|
-
data-tab-index=${index}
|
|
367
|
-
tab
|
|
368
|
-
?selected=${index == configurer.currentAnnotationIndex}
|
|
369
|
-
@click=${(e) => {
|
|
370
|
-
const target = e.target;
|
|
371
|
-
this.configurer.setCurrentAnnotationIndex(Number(target.getAttribute('data-tab-index')));
|
|
372
|
-
this.value = { ...this.configurer.value };
|
|
373
|
-
}}
|
|
374
|
-
>
|
|
375
|
-
${index + 1}
|
|
376
|
-
${!configurer.annotations ||
|
|
377
|
-
(configurer.annotations.length != 1 && configurer.currentAnnotationIndex == index)
|
|
378
|
-
? html `
|
|
379
|
-
<md-icon @tap=${(e) => this.onTapRemoveCurrentAnnotation(index)}> close </md-icon>
|
|
380
|
-
`
|
|
381
|
-
: html ``}
|
|
382
|
-
</div>
|
|
383
|
-
`)}
|
|
384
|
-
</div>
|
|
385
|
-
<md-icon
|
|
386
|
-
id="annotations-tab-nav-right-button"
|
|
387
|
-
@click=${(e) => {
|
|
388
|
-
this._onTabScrollNavRight(e, 'annotations');
|
|
389
|
-
}}
|
|
390
|
-
disabled
|
|
391
|
-
>chevron_right</md-icon
|
|
392
|
-
>
|
|
393
|
-
</div>
|
|
394
|
-
<div id="add-annotation-button-container">
|
|
395
|
-
<md-icon id="add-annotation-button" @tap=${(e) => this.onTapAddAnnotation(e)}>add</md-icon>
|
|
396
|
-
</div>
|
|
397
|
-
|
|
398
|
-
<div class="tab-content">
|
|
399
|
-
<label for="annotation-type"> <ox-i18n msgid="label.chart-annotation-type">Type</ox-i18n> </label>
|
|
400
|
-
<select
|
|
401
|
-
id="annotation-type"
|
|
402
|
-
class="select-content"
|
|
403
|
-
value-key="annotation.type"
|
|
404
|
-
.value=${currentAnnotation.type || ''}
|
|
405
|
-
>
|
|
406
|
-
<option value=""> </option>
|
|
407
|
-
<option value="line">Line</option>
|
|
408
|
-
<option value="text">Text</option>
|
|
409
|
-
<option value="box">Box</option>
|
|
410
|
-
<option value="horizontalLine">Horizontal Line</option>
|
|
411
|
-
<option value="verticalLine">Vertical Line</option>
|
|
412
|
-
</select>
|
|
413
|
-
|
|
414
|
-
<label for="annotation-x1">X1</label>
|
|
415
|
-
<input
|
|
416
|
-
id="annotation-x1"
|
|
417
|
-
type="number"
|
|
418
|
-
value-key="annotation.x1"
|
|
419
|
-
.value=${String(currentAnnotation.x1 || 0)}
|
|
420
|
-
/>
|
|
421
|
-
|
|
422
|
-
<label for="annotation-y1">Y1</label>
|
|
423
|
-
<input
|
|
424
|
-
id="annotation-y1"
|
|
425
|
-
type="number"
|
|
426
|
-
value-key="annotation.y1"
|
|
427
|
-
.value=${String(currentAnnotation.y1 || 0)}
|
|
428
|
-
/>
|
|
429
|
-
|
|
430
|
-
<label for="annotation-x2">X2</label>
|
|
431
|
-
<input
|
|
432
|
-
id="annotation-x2"
|
|
433
|
-
type="number"
|
|
434
|
-
value-key="annotation.x2"
|
|
435
|
-
.value=${String(currentAnnotation.x2 || 0)}
|
|
436
|
-
/>
|
|
437
|
-
|
|
438
|
-
<label for="annotation-y2">Y2</label>
|
|
439
|
-
<input
|
|
440
|
-
id="annotation-y2"
|
|
441
|
-
type="number"
|
|
442
|
-
value-key="annotation.y2"
|
|
443
|
-
.value=${String(currentAnnotation.y2 || 0)}
|
|
444
|
-
/>
|
|
445
|
-
|
|
446
|
-
<label for="annotation-stroke"> <ox-i18n msgid="label.stroke-style">Stroke Style</ox-i18n> </label>
|
|
447
|
-
<ox-input-color
|
|
448
|
-
id="annotation-stroke"
|
|
449
|
-
value-key="annotation.stroke"
|
|
450
|
-
.value=${currentAnnotation.stroke}
|
|
451
|
-
></ox-input-color>
|
|
452
|
-
|
|
453
|
-
<label for="annotation-stroke-thickness">
|
|
454
|
-
<ox-i18n msgid="label.stroke-thickness">Stroke Thickness</ox-i18n>
|
|
455
|
-
</label>
|
|
456
|
-
<input
|
|
457
|
-
id="annotation-stroke-thickness"
|
|
458
|
-
type="number"
|
|
459
|
-
value-key="annotation.strokeThickness"
|
|
460
|
-
.value=${String(currentAnnotation.strokeThickness || 1)}
|
|
461
|
-
/>
|
|
462
|
-
|
|
463
|
-
<label for="annotation-fill"> <ox-i18n msgid="label.fill">Fill</ox-i18n> </label>
|
|
464
|
-
<ox-input-color
|
|
465
|
-
id="annotation-fill"
|
|
466
|
-
value-key="annotation.fill"
|
|
467
|
-
.value=${currentAnnotation.fill}
|
|
468
|
-
></ox-input-color>
|
|
469
|
-
|
|
470
|
-
<label for="annotation-text"> <ox-i18n msgid="label.annotation-text">Text</ox-i18n> </label>
|
|
471
|
-
<input
|
|
472
|
-
id="annotation-text"
|
|
473
|
-
type="text"
|
|
474
|
-
value-key="annotation.text"
|
|
475
|
-
.value=${currentAnnotation.text || ''}
|
|
476
|
-
/>
|
|
477
|
-
|
|
478
|
-
<label for="annotation-horizontal-anchor">
|
|
479
|
-
<ox-i18n msgid="label.horizontal-anchor">Horizontal Anchor</ox-i18n>
|
|
480
|
-
</label>
|
|
481
|
-
<select
|
|
482
|
-
id="annotation-horizontal-anchor"
|
|
483
|
-
class="select-content"
|
|
484
|
-
value-key="annotation.horizontalAnchorPoint"
|
|
485
|
-
.value=${currentAnnotation.horizontalAnchorPoint || ''}
|
|
486
|
-
>
|
|
487
|
-
<option value=""> </option>
|
|
488
|
-
<option value="Left">Left</option>
|
|
489
|
-
<option value="Center">Center</option>
|
|
490
|
-
<option value="Right">Right</option>
|
|
491
|
-
</select>
|
|
492
|
-
|
|
493
|
-
<label for="annotation-vertical-anchor">
|
|
494
|
-
<ox-i18n msgid="label.vertical-anchor">Vertical Anchor</ox-i18n>
|
|
495
|
-
</label>
|
|
496
|
-
<select
|
|
497
|
-
id="annotation-vertical-anchor"
|
|
498
|
-
class="select-content"
|
|
499
|
-
value-key="annotation.verticalAnchorPoint"
|
|
500
|
-
.value=${currentAnnotation.verticalAnchorPoint || ''}
|
|
501
|
-
>
|
|
502
|
-
<option value=""> </option>
|
|
503
|
-
<option value="Top">Top</option>
|
|
504
|
-
<option value="Center">Center</option>
|
|
505
|
-
<option value="Bottom">Bottom</option>
|
|
506
|
-
</select>
|
|
507
|
-
|
|
508
|
-
<label for="annotation-x-coordinate-mode">X Coordinate Mode</label>
|
|
509
|
-
<select
|
|
510
|
-
id="annotation-x-coordinate-mode"
|
|
511
|
-
class="select-content"
|
|
512
|
-
value-key="annotation.xCoordinateMode"
|
|
513
|
-
.value=${currentAnnotation.xCoordinateMode || 'DataValue'}
|
|
514
|
-
>
|
|
515
|
-
<option value=""> </option>
|
|
516
|
-
<option value="DataValue">DataValue</option>
|
|
517
|
-
<option value="Pixel">Pixel</option>
|
|
518
|
-
<option value="Relative">Relative</option>
|
|
519
|
-
</select>
|
|
520
|
-
|
|
521
|
-
<label for="annotation-y-coordinate-mode">Y Coordinate Mode</label>
|
|
522
|
-
<select
|
|
523
|
-
id="annotation-y-coordinate-mode"
|
|
524
|
-
class="select-content"
|
|
525
|
-
value-key="annotation.yCoordinateMode"
|
|
526
|
-
.value=${currentAnnotation.yCoordinateMode || 'DataValue'}
|
|
527
|
-
>
|
|
528
|
-
<option value=""> </option>
|
|
529
|
-
<option value="DataValue">DataValue</option>
|
|
530
|
-
<option value="Pixel">Pixel</option>
|
|
531
|
-
<option value="Relative">Relative</option>
|
|
532
|
-
</select>
|
|
533
|
-
</div>
|
|
534
|
-
</div>
|
|
535
|
-
`);
|
|
536
|
-
}
|
|
537
|
-
multiSeriesTabTemplate() {
|
|
538
|
-
const configurer = this.configurer;
|
|
539
|
-
return keyed(configurer.currentSeriesIndex, html `
|
|
540
|
-
<div id="series-properties-container" fullwidth>
|
|
541
|
-
<div id="series-tab-header">
|
|
542
|
-
<md-icon
|
|
543
|
-
id="series-tab-nav-left-button"
|
|
544
|
-
@tap=${(e) => {
|
|
545
|
-
this._onTabScrollNavLeft(e, 'series');
|
|
546
|
-
}}
|
|
547
|
-
disabled
|
|
548
|
-
>chevron_left</md-icon
|
|
549
|
-
>
|
|
550
|
-
<div
|
|
551
|
-
id="series-tabs"
|
|
552
|
-
@change=${(e) => {
|
|
553
|
-
// configurer.currentSeriesIndex = (e.target as any).activeTabIndex
|
|
554
|
-
configurer.setCurrentSeriesIndex(e.target.activeTabIndex);
|
|
555
|
-
}}
|
|
556
|
-
active-tab-index=${configurer.currentSeriesIndex}
|
|
557
|
-
fit-container
|
|
558
|
-
>
|
|
559
|
-
${configurer.datasets.map((dataset, index) => html `
|
|
560
|
-
<div
|
|
561
|
-
data-series=${index + 1}
|
|
562
|
-
data-tab-index=${index}
|
|
563
|
-
tab
|
|
564
|
-
?selected=${index == configurer.currentSeriesIndex}
|
|
565
|
-
@click=${(e) => {
|
|
566
|
-
const target = e.target;
|
|
567
|
-
this.configurer.setCurrentSeriesIndex(Number(target.getAttribute('data-tab-index')));
|
|
568
|
-
this.value = { ...this.configurer.value };
|
|
569
|
-
}}
|
|
570
|
-
>
|
|
571
|
-
${index + 1}
|
|
572
|
-
${!configurer.datasets ||
|
|
573
|
-
(configurer.datasets.length != 1 && configurer.currentSeriesIndex == index)
|
|
574
|
-
? html ` <md-icon @tap=${(e) => this.onTapRemoveCurrentSeriesTab(index)}> close </md-icon> `
|
|
575
|
-
: html ``}
|
|
576
|
-
</div>
|
|
577
|
-
`)}
|
|
578
|
-
</div>
|
|
579
|
-
<md-icon
|
|
580
|
-
id="series-tab-nav-right-button"
|
|
581
|
-
@click=${(e) => {
|
|
582
|
-
this._onTabScrollNavRight(e, 'series');
|
|
583
|
-
}}
|
|
584
|
-
disabled
|
|
585
|
-
>chevron_right</md-icon
|
|
586
|
-
>
|
|
587
|
-
</div>
|
|
588
|
-
<div id="add-series-button-container">
|
|
589
|
-
<md-icon id="add-series-button" @tap=${(e) => this.onTapAddSeriesTab(e)}>add</md-icon>
|
|
590
|
-
</div>
|
|
591
|
-
|
|
592
|
-
<div class="tab-content">
|
|
593
|
-
<label for="data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
|
594
|
-
<input id="data-key" type="text" value-key="dataKey" .value=${configurer.dataKey || ''} />
|
|
595
|
-
|
|
596
|
-
${this.chartType == 'line' || this.chartType == 'bar'
|
|
597
|
-
? html `
|
|
598
|
-
<label for="series-type"> <ox-i18n msgid="label.series-type">Type</ox-i18n> </label>
|
|
599
|
-
<select
|
|
600
|
-
id="series-type"
|
|
601
|
-
class="select-content"
|
|
602
|
-
value-key="series.type"
|
|
603
|
-
.value=${configurer.series.type || ''}
|
|
604
|
-
>
|
|
605
|
-
<option value="bar" selected>Bar</option>
|
|
606
|
-
<option value="line">Line</option>
|
|
607
|
-
</select>
|
|
608
|
-
`
|
|
609
|
-
: html ``}
|
|
610
|
-
|
|
611
|
-
<label for="series-label"> <ox-i18n msgid="label.label">Label</ox-i18n> </label>
|
|
612
|
-
<input id="series-label" type="text" value-key="series.label" .value=${configurer.series.label || ''} />
|
|
613
|
-
|
|
614
|
-
${configurer.series.type == 'line'
|
|
615
|
-
? html `
|
|
616
|
-
<label for="series-line-tension"> <ox-i18n msgid="label.line-tension">Line Tension</ox-i18n> </label>
|
|
617
|
-
<select
|
|
618
|
-
id="series-line-tension"
|
|
619
|
-
class="select-content"
|
|
620
|
-
value-key="series.lineTension"
|
|
621
|
-
.value=${String(configurer.series.lineTension || 0)}
|
|
622
|
-
>
|
|
623
|
-
<option value="0.4">Smooth</option>
|
|
624
|
-
<option value="0">Angled</option>
|
|
625
|
-
</select>
|
|
626
|
-
`
|
|
627
|
-
: html ``}
|
|
628
|
-
${configurer.series.type == 'line'
|
|
629
|
-
? html `
|
|
630
|
-
<label for="series-border-width"> <ox-i18n msgid="label.border-width">Border Width</ox-i18n> </label>
|
|
631
|
-
<input
|
|
632
|
-
id="series-border-width"
|
|
633
|
-
type="number"
|
|
634
|
-
value-key="series.borderWidth"
|
|
635
|
-
.value=${String(configurer.series.borderWidth || 0)}
|
|
636
|
-
/>
|
|
637
|
-
`
|
|
638
|
-
: html ``}
|
|
639
|
-
|
|
640
|
-
<label for="series-color"> <ox-i18n msgid="label.color">Color</ox-i18n> </label>
|
|
641
|
-
<ox-input-color id="series-color" value-key="color" .value=${configurer.color}></ox-input-color>
|
|
642
|
-
|
|
643
|
-
${configurer.series.type == 'line'
|
|
644
|
-
? html `
|
|
645
|
-
<label for="series-point-style"> <ox-i18n msgid="label.point-shape">Point Shape</ox-i18n> </label>
|
|
646
|
-
<select
|
|
647
|
-
id="series-point-style"
|
|
648
|
-
class="select-content"
|
|
649
|
-
value-key="series.pointStyle"
|
|
650
|
-
.value=${configurer.series.pointStyle || ''}
|
|
651
|
-
>
|
|
652
|
-
<option value=""> </option>
|
|
653
|
-
<option value="circle">⚬</option>
|
|
654
|
-
<option value="triangle">▵</option>
|
|
655
|
-
<option value="rect">□</option>
|
|
656
|
-
<option value="rectRot">◇</option>
|
|
657
|
-
<option value="cross">+</option>
|
|
658
|
-
<option value="crossRot">⨉</option>
|
|
659
|
-
<option value="star">✱</option>
|
|
660
|
-
<option value="line">―</option>
|
|
661
|
-
<option value="dash">┄</option>
|
|
662
|
-
</select>
|
|
663
|
-
|
|
664
|
-
<label for="series-point-radius"> <ox-i18n msgid="label.point-size">Point Size</ox-i18n> </label>
|
|
665
|
-
<input
|
|
666
|
-
id="series-point-radius"
|
|
667
|
-
type="number"
|
|
668
|
-
value-key="series.pointRadius"
|
|
669
|
-
.value=${String(configurer.series.pointRadius || 0)}
|
|
670
|
-
/>
|
|
671
|
-
`
|
|
672
|
-
: html ``} <label for="series-stack"> <ox-i18n msgid="label.stack-group">Stack group</ox-i18n> </label>
|
|
673
|
-
<input id="series-stack" type="text" value-key="series.stack" .value=${configurer.series.stack || ''} />
|
|
674
|
-
${configurer.series.type == 'line'
|
|
675
|
-
? html `
|
|
676
|
-
<input id="seires-fill" type="checkbox" value-key="series.fill" ?checked=${configurer.series.fill} />
|
|
677
|
-
<label for="seires-fill"> <ox-i18n msgid="label.fill">Fill</ox-i18n> </label>
|
|
678
|
-
`
|
|
679
|
-
: html ``}
|
|
680
|
-
${configurer.multiAxis
|
|
681
|
-
? html `
|
|
682
|
-
<label for="series-y-axis-id"> <ox-i18n msgid="label.target-axis">Target Axis</ox-i18n> </label>
|
|
683
|
-
<select
|
|
684
|
-
id="series-y-axis-id"
|
|
685
|
-
class="select-content"
|
|
686
|
-
value-key="series.yAxisID"
|
|
687
|
-
.value=${configurer.series.yAxisID || ''}
|
|
688
|
-
>
|
|
689
|
-
<option value="left">Left</option>
|
|
690
|
-
<option value="right">Right</option>
|
|
691
|
-
</select>
|
|
692
|
-
`
|
|
693
|
-
: html ``}
|
|
694
|
-
${this.displayValueTemplate()}
|
|
695
|
-
</div>
|
|
696
|
-
</div>
|
|
697
|
-
`);
|
|
698
|
-
}
|
|
699
|
-
_onTabScroll(e, type) {
|
|
700
|
-
let tabContainer;
|
|
701
|
-
let tabNavLeftButton;
|
|
702
|
-
let tabNavRightButton;
|
|
703
|
-
if (type === 'series') {
|
|
704
|
-
tabContainer = this.seriesTabContainer;
|
|
705
|
-
tabNavLeftButton = this.seriesTabNavLeftButton;
|
|
706
|
-
tabNavRightButton = this.seriesTabNavRightButton;
|
|
707
|
-
}
|
|
708
|
-
else {
|
|
709
|
-
tabContainer = this.annotationsTabContainer;
|
|
710
|
-
tabNavLeftButton = this.annotationsTabNavLeftButton;
|
|
711
|
-
tabNavRightButton = this.annotationsTabNavRightButton;
|
|
712
|
-
}
|
|
713
|
-
if (!tabContainer) {
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
if (tabContainer.clientWidth == tabContainer.scrollWidth) {
|
|
717
|
-
tabNavLeftButton.setAttribute('disabled', '');
|
|
718
|
-
tabNavRightButton.setAttribute('disabled', '');
|
|
719
|
-
}
|
|
720
|
-
// left-end
|
|
721
|
-
else if (tabContainer.scrollLeft == 0) {
|
|
722
|
-
tabNavLeftButton.setAttribute('disabled', '');
|
|
723
|
-
tabNavRightButton.removeAttribute('disabled');
|
|
724
|
-
}
|
|
725
|
-
// right-end
|
|
726
|
-
else if (tabContainer.scrollLeft + tabContainer.clientWidth >= tabContainer.scrollWidth) {
|
|
727
|
-
tabNavLeftButton.removeAttribute('disabled');
|
|
728
|
-
tabNavRightButton.setAttribute('disabled', '');
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
tabNavLeftButton.removeAttribute('disabled');
|
|
732
|
-
tabNavRightButton.removeAttribute('disabled');
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
_onTabScrollNavLeft(e, type) {
|
|
736
|
-
let tabContainer;
|
|
737
|
-
if (type === 'series') {
|
|
738
|
-
tabContainer = this.seriesTabContainer;
|
|
739
|
-
}
|
|
740
|
-
else {
|
|
741
|
-
tabContainer = this.annotationsTabContainer;
|
|
742
|
-
}
|
|
743
|
-
if (!tabContainer) {
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
tabContainer.style.scrollBehavior = 'smooth';
|
|
747
|
-
tabContainer.scrollLeft -= tabContainer.clientWidth;
|
|
748
|
-
tabContainer.style.scrollBehavior = 'auto';
|
|
749
|
-
}
|
|
750
|
-
_onTabScrollNavRight(e, type) {
|
|
751
|
-
let tabContainer;
|
|
752
|
-
if (type === 'series') {
|
|
753
|
-
tabContainer = this.seriesTabContainer;
|
|
754
|
-
}
|
|
755
|
-
else {
|
|
756
|
-
tabContainer = this.annotationsTabContainer;
|
|
757
|
-
}
|
|
758
|
-
if (!tabContainer) {
|
|
759
|
-
return;
|
|
760
|
-
}
|
|
761
|
-
tabContainer.style.scrollBehavior = 'smooth';
|
|
762
|
-
tabContainer.scrollLeft += tabContainer.clientWidth;
|
|
763
|
-
tabContainer.style.scrollBehavior = 'auto';
|
|
764
|
-
}
|
|
765
177
|
}
|
|
766
178
|
__decorate([
|
|
767
179
|
property({ type: Object })
|
|
@@ -769,22 +181,4 @@ __decorate([
|
|
|
769
181
|
__decorate([
|
|
770
182
|
property({ type: String, attribute: 'chart-type' })
|
|
771
183
|
], InputChartAbstract.prototype, "chartType", void 0);
|
|
772
|
-
__decorate([
|
|
773
|
-
query('#annotations-tabs')
|
|
774
|
-
], InputChartAbstract.prototype, "annotationsTabs", void 0);
|
|
775
|
-
__decorate([
|
|
776
|
-
query('#annotations-tab-nav-left-button')
|
|
777
|
-
], InputChartAbstract.prototype, "annotationsTabNavLeftButton", void 0);
|
|
778
|
-
__decorate([
|
|
779
|
-
query('#annotations-tab-nav-right-button')
|
|
780
|
-
], InputChartAbstract.prototype, "annotationsTabNavRightButton", void 0);
|
|
781
|
-
__decorate([
|
|
782
|
-
query('#series-tabs')
|
|
783
|
-
], InputChartAbstract.prototype, "seriesTabs", void 0);
|
|
784
|
-
__decorate([
|
|
785
|
-
query('#series-tab-nav-left-button')
|
|
786
|
-
], InputChartAbstract.prototype, "seriesTabNavLeftButton", void 0);
|
|
787
|
-
__decorate([
|
|
788
|
-
query('#series-tab-nav-right-button')
|
|
789
|
-
], InputChartAbstract.prototype, "seriesTabNavRightButton", void 0);
|
|
790
184
|
//# sourceMappingURL=input-chart-abstract.js.map
|