@operato/scene-chartjs 0.0.5
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 +17 -0
- package/LICENSE +21 -0
- package/README.md +21 -0
- package/assets/bar-chart.png +0 -0
- package/assets/doughnut-chart.png +0 -0
- package/assets/horizontal-bar-chart.png +0 -0
- package/assets/line-chart.png +0 -0
- package/assets/mixed-chart.png +0 -0
- package/assets/pie-chart.png +0 -0
- package/assets/polar-area-chart.png +0 -0
- package/assets/radar-chart.png +0 -0
- package/demo/bar.html +266 -0
- package/demo/chartjs.html +73 -0
- package/demo/index.html +547 -0
- package/demo/legend.html +267 -0
- package/demo/things-scene-chartjs.html +7 -0
- package/dist/chartjs.d.ts +27 -0
- package/dist/chartjs.js +109 -0
- package/dist/chartjs.js.map +1 -0
- package/dist/config-converter.d.ts +1 -0
- package/dist/config-converter.js +343 -0
- package/dist/config-converter.js.map +1 -0
- package/dist/editors/index.d.ts +5 -0
- package/dist/editors/index.js +11 -0
- package/dist/editors/index.js.map +1 -0
- package/dist/editors/property-editor-chartjs-abstract.d.ts +44 -0
- package/dist/editors/property-editor-chartjs-abstract.js +250 -0
- package/dist/editors/property-editor-chartjs-abstract.js.map +1 -0
- package/dist/editors/property-editor-chartjs-hbar.d.ts +9 -0
- package/dist/editors/property-editor-chartjs-hbar.js +160 -0
- package/dist/editors/property-editor-chartjs-hbar.js.map +1 -0
- package/dist/editors/property-editor-chartjs-mixed.d.ts +20 -0
- package/dist/editors/property-editor-chartjs-mixed.js +193 -0
- package/dist/editors/property-editor-chartjs-mixed.js.map +1 -0
- package/dist/editors/property-editor-chartjs-multi-series-abstract.d.ts +31 -0
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js +373 -0
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js.map +1 -0
- package/dist/editors/property-editor-chartjs-pie.d.ts +14 -0
- package/dist/editors/property-editor-chartjs-pie.js +70 -0
- package/dist/editors/property-editor-chartjs-pie.js.map +1 -0
- package/dist/editors/property-editor-chartjs-radar.d.ts +10 -0
- package/dist/editors/property-editor-chartjs-radar.js +42 -0
- package/dist/editors/property-editor-chartjs-radar.js.map +1 -0
- package/dist/editors/property-editor-chartjs-styles.d.ts +1 -0
- package/dist/editors/property-editor-chartjs-styles.js +165 -0
- package/dist/editors/property-editor-chartjs-styles.js.map +1 -0
- package/dist/editors/property-editor-chartjs.d.ts +14 -0
- package/dist/editors/property-editor-chartjs.js +83 -0
- package/dist/editors/property-editor-chartjs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/ox-chart.d.ts +20 -0
- package/dist/ox-chart.js +137 -0
- package/dist/ox-chart.js.map +1 -0
- package/dist/plugins/chart-series-highlight.d.ts +5 -0
- package/dist/plugins/chart-series-highlight.js +37 -0
- package/dist/plugins/chart-series-highlight.js.map +1 -0
- package/dist/plugins/chartjs-plugin-data-binder.d.ts +5 -0
- package/dist/plugins/chartjs-plugin-data-binder.js +111 -0
- package/dist/plugins/chartjs-plugin-data-binder.js.map +1 -0
- package/helps/scene/component/chartjs.ko.md +332 -0
- package/helps/scene/component/chartjs.md +333 -0
- package/helps/scene/component/chartjs.zh.md +331 -0
- package/helps/scene/images/chart-bar-01.png +0 -0
- package/helps/scene/images/chart-bar-02.png +0 -0
- package/helps/scene/images/chart-bar-03.png +0 -0
- package/helps/scene/images/chart-bar-08.png +0 -0
- package/helps/scene/images/chart-bar-12.png +0 -0
- package/helps/scene/images/chart-data-01.png +0 -0
- package/helps/scene/images/chart-data-04.png +0 -0
- package/helps/scene/images/chart-doughnut-01.png +0 -0
- package/helps/scene/images/chart-horizontal-bar-01.png +0 -0
- package/helps/scene/images/chart-line-01.png +0 -0
- package/helps/scene/images/chart-mix-01.png +0 -0
- package/helps/scene/images/chart-mix-02.png +0 -0
- package/helps/scene/images/chart-pie-01.png +0 -0
- package/helps/scene/images/chart-polar-01.png +0 -0
- package/helps/scene/images/chart-radar-01.png +0 -0
- package/package.json +78 -0
- package/src/chartjs.ts +134 -0
- package/src/config-converter.ts +401 -0
- package/src/editors/index.ts +11 -0
- package/src/editors/property-editor-chartjs-abstract.ts +301 -0
- package/src/editors/property-editor-chartjs-hbar.ts +163 -0
- package/src/editors/property-editor-chartjs-mixed.ts +204 -0
- package/src/editors/property-editor-chartjs-multi-series-abstract.ts +393 -0
- package/src/editors/property-editor-chartjs-pie.ts +79 -0
- package/src/editors/property-editor-chartjs-radar.ts +43 -0
- package/src/editors/property-editor-chartjs-styles.ts +165 -0
- package/src/editors/property-editor-chartjs.ts +88 -0
- package/src/index.ts +7 -0
- package/src/ox-chart.ts +150 -0
- package/src/plugins/chart-series-highlight.ts +43 -0
- package/src/plugins/chartjs-plugin-data-binder.ts +138 -0
- package/src/scene-chart.d.ts +152 -0
- package/templates/bar-chart.js +124 -0
- package/templates/doughnut-chart.js +58 -0
- package/templates/horizontal-bar-chart.js +121 -0
- package/templates/index.js +22 -0
- package/templates/line-chart.js +155 -0
- package/templates/mixed-chart.js +152 -0
- package/templates/pie-chart.js +58 -0
- package/templates/polar-area-chart.js +92 -0
- package/templates/radar-chart.js +98 -0
- package/test/basic-test.html +61 -0
- package/test/index.html +20 -0
- package/things-scene.config.js +7 -0
- package/translations/en.json +5 -0
- package/translations/ko.json +5 -0
- package/translations/ms.json +5 -0
- package/translations/zh.json +5 -0
- package/tsconfig.json +22 -0
- package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,193 @@
|
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
/*
|
3
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
4
|
+
*/
|
5
|
+
import '@polymer/iron-icon/iron-icon';
|
6
|
+
import '@polymer/iron-pages/iron-pages';
|
7
|
+
import '@polymer/paper-button/paper-button';
|
8
|
+
import '@polymer/paper-icon-button/paper-icon-button';
|
9
|
+
import '@polymer/paper-tabs/paper-tabs';
|
10
|
+
import { html } from 'lit';
|
11
|
+
import { customElement } from 'lit/decorators.js';
|
12
|
+
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
|
13
|
+
let PropertyEditorChartJSMixed = class PropertyEditorChartJSMixed extends PropertyEditorChartJSMultiSeriesAbstract {
|
14
|
+
constructor() {
|
15
|
+
super();
|
16
|
+
this.value = {
|
17
|
+
options: {
|
18
|
+
legend: {},
|
19
|
+
scales: {
|
20
|
+
xAxes: [
|
21
|
+
{
|
22
|
+
ticks: {}
|
23
|
+
}
|
24
|
+
],
|
25
|
+
yAxes: [
|
26
|
+
{
|
27
|
+
ticks: {}
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
data: {
|
33
|
+
datasets: []
|
34
|
+
}
|
35
|
+
};
|
36
|
+
}
|
37
|
+
get xAxes0() {
|
38
|
+
return this.scales.xAxes[0];
|
39
|
+
}
|
40
|
+
set xAxes0(xAxes0) {
|
41
|
+
this.scales.xAxes[0] = xAxes0;
|
42
|
+
}
|
43
|
+
get yAxes0() {
|
44
|
+
return this.scales.yAxes[0];
|
45
|
+
}
|
46
|
+
set yAxes0(yAxes0) {
|
47
|
+
this.scales.yAxes[0] = yAxes0;
|
48
|
+
}
|
49
|
+
get yAxes1() {
|
50
|
+
return this.scales.yAxes[1];
|
51
|
+
}
|
52
|
+
set yAxes1(yAxes1) {
|
53
|
+
this.scales.yAxes[1] = yAxes1;
|
54
|
+
}
|
55
|
+
get multiAxis() {
|
56
|
+
return this.value.options.multiAxis;
|
57
|
+
}
|
58
|
+
set multiAxis(multiAxis) {
|
59
|
+
this.value.options.multiAxis = multiAxis;
|
60
|
+
}
|
61
|
+
editorTemplate(props) {
|
62
|
+
return html `
|
63
|
+
<input type="checkbox" value-key="multiAxis" .checked=${this.multiAxis} />
|
64
|
+
<label> <i18n-msg msgid="label.multi-axis">Multi Axis</i18n-msg> </label>
|
65
|
+
|
66
|
+
<legend><i18n-msg msgid="label.series">Series</i18n-msg></legend>
|
67
|
+
|
68
|
+
<div fullwidth>${this.multiSeriesTabTemplate()}</div>
|
69
|
+
|
70
|
+
<legend><i18n-msg msgid="label.x-axes">X Axes</i18n-msg></legend>
|
71
|
+
|
72
|
+
<label> <i18n-msg msgid="label.data-key">Data Key</i18n-msg> </label>
|
73
|
+
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
74
|
+
|
75
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
76
|
+
<input type="text" value-key="xAxes0.axisTitle" .value=${this.xAxes0.axisTitle || ''} />
|
77
|
+
|
78
|
+
${this._hasBarSeries(this.value)
|
79
|
+
? html `
|
80
|
+
<label><i18n-msg msgid="label.bar-spacing">Bar Spacing</i18n-msg></label>
|
81
|
+
<input
|
82
|
+
type="number"
|
83
|
+
min="0"
|
84
|
+
max="1"
|
85
|
+
step="0.1"
|
86
|
+
value-key="xAxes0.barSpacing"
|
87
|
+
.value=${this.xAxes0.barSpacing || NaN}
|
88
|
+
/>
|
89
|
+
<label><i18n-msg msgid="label.tick-spacing">Tick Spacing</i18n-msg></label>
|
90
|
+
<input
|
91
|
+
type="number"
|
92
|
+
min="0"
|
93
|
+
max="1"
|
94
|
+
step="0.1"
|
95
|
+
value-key="xAxes0.categorySpacing"
|
96
|
+
.value=${this.xAxes0.categorySpacing || NaN}
|
97
|
+
/>
|
98
|
+
`
|
99
|
+
: html ``}
|
100
|
+
|
101
|
+
<input type="checkbox" value-key="value.options.xGridLine" .checked=${props.value.options.xGridLine} />
|
102
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
103
|
+
|
104
|
+
<input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
|
105
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
106
|
+
|
107
|
+
<legend><i18n-msg msgid="label.y-axes">Y Axes</i18n-msg></legend>
|
108
|
+
|
109
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
110
|
+
<input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
|
111
|
+
|
112
|
+
<input type="checkbox" value-key="yAxes0.ticks.autoMin" .checked=${this.yAxes0.ticks.autoMin} />
|
113
|
+
<label> <i18n-msg msgid="label.axis-min-auto">Min Auto</i18n-msg> </label>
|
114
|
+
|
115
|
+
<input type="checkbox" value-key="yAxes0.ticks.autoMax" .checked=${this.yAxes0.ticks.autoMax} />
|
116
|
+
<label> <i18n-msg msgid="label.axis-max-auto">Max Auto</i18n-msg> </label>
|
117
|
+
|
118
|
+
${!this.yAxes0.ticks.autoMin
|
119
|
+
? html `
|
120
|
+
<label> <i18n-msg msgid="label.axis-min">Min</i18n-msg> </label>
|
121
|
+
<input type="number" value-key="yAxes0.ticks.min" .value=${this.yAxes0.ticks.min} />
|
122
|
+
`
|
123
|
+
: html ``}
|
124
|
+
${!this.yAxes0.ticks.autoMax
|
125
|
+
? html `
|
126
|
+
<label> <i18n-msg msgid="label.axis-max">Max</i18n-msg> </label>
|
127
|
+
<input type="number" value-key="yAxes0.ticks.max" .value=${this.yAxes0.ticks.max} />
|
128
|
+
`
|
129
|
+
: html ``}
|
130
|
+
|
131
|
+
<label> <i18n-msg msgid="label.axis-step-size">StepSize</i18n-msg> </label>
|
132
|
+
<input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
|
133
|
+
|
134
|
+
<input type="checkbox" value-key="value.options.yGridLine" .checked=${props.value.options.yGridLine} />
|
135
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
136
|
+
|
137
|
+
<input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
|
138
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
139
|
+
|
140
|
+
${props.value.options.multiAxis
|
141
|
+
? html `
|
142
|
+
<legend><i18n-msg msgid="label.y-2nd-axes">Y 2nd Axes</i18n-msg></legend>
|
143
|
+
|
144
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
145
|
+
<input type="text" value-key="yAxes1.axisTitle" .value=${this.yAxes1.axisTitle || ''} />
|
146
|
+
|
147
|
+
<input type="checkbox" value-key="yAxes1.ticks.autoMin" .checked=${this.yAxes1.ticks.autoMin} />
|
148
|
+
<label> <i18n-msg msgid="label.axis-min-auto">Min Auto</i18n-msg> </label>
|
149
|
+
|
150
|
+
<input type="checkbox" value-key="yAxes1.ticks.autoMax" .checked=${this.yAxes1.ticks.autoMax} />
|
151
|
+
<label> <i18n-msg msgid="label.axis-max-auto">Max Auto</i18n-msg> </label>
|
152
|
+
|
153
|
+
${!this.yAxes1.ticks.autoMin
|
154
|
+
? html `
|
155
|
+
<label> <i18n-msg msgid="label.axis-min">Min</i18n-msg> </label>
|
156
|
+
<input type="number" value-key="yAxes1.ticks.min" .value=${this.yAxes1.ticks.min} />
|
157
|
+
`
|
158
|
+
: html ``}
|
159
|
+
${!this.yAxes1.ticks.autoMax
|
160
|
+
? html `
|
161
|
+
<label> <i18n-msg msgid="label.axis-max">Max</i18n-msg> </label>
|
162
|
+
<input type="number" value-key="yAxes1.ticks.max" .value=${this.yAxes1.ticks.max} />
|
163
|
+
`
|
164
|
+
: html ``}
|
165
|
+
|
166
|
+
<label> <i18n-msg msgid="label.axis-step-size">StepSize</i18n-msg> </label>
|
167
|
+
<input type="number" value-key="yAxes1.ticks.stepSize" .value=${this.yAxes1.ticks.stepSize} />
|
168
|
+
|
169
|
+
<input
|
170
|
+
type="checkbox"
|
171
|
+
value-key="value.options.y2ndGridLine"
|
172
|
+
.checked=${props.value.options.y2ndGridLine}
|
173
|
+
/>
|
174
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
175
|
+
|
176
|
+
<input type="checkbox" value-key="yAxes1.ticks.display" .checked=${this.yAxes1.ticks.display} />
|
177
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
178
|
+
`
|
179
|
+
: html ``}
|
180
|
+
`;
|
181
|
+
}
|
182
|
+
_hasBarSeries(chart) {
|
183
|
+
var hasBarSeries = false;
|
184
|
+
hasBarSeries = chart.data.datasets.some((s) => s.type == 'bar');
|
185
|
+
return hasBarSeries;
|
186
|
+
}
|
187
|
+
};
|
188
|
+
PropertyEditorChartJSMixed.styles = PropertyEditorChartJSMultiSeriesAbstract.styles;
|
189
|
+
PropertyEditorChartJSMixed = __decorate([
|
190
|
+
customElement('property-editor-chartjs-mixed')
|
191
|
+
], PropertyEditorChartJSMixed);
|
192
|
+
export default PropertyEditorChartJSMixed;
|
193
|
+
//# sourceMappingURL=property-editor-chartjs-mixed.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"property-editor-chartjs-mixed.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-mixed.ts"],"names":[],"mappings":"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","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport '@polymer/iron-icon/iron-icon'\nimport '@polymer/iron-pages/iron-pages'\nimport '@polymer/paper-button/paper-button'\nimport '@polymer/paper-icon-button/paper-icon-button'\nimport '@polymer/paper-tabs/paper-tabs'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'\n\n@customElement('property-editor-chartjs-mixed')\nexport default class PropertyEditorChartJSMixed extends PropertyEditorChartJSMultiSeriesAbstract {\n static styles = PropertyEditorChartJSMultiSeriesAbstract.styles\n\n constructor() {\n super()\n\n this.value = {\n options: {\n legend: {},\n scales: {\n xAxes: [\n {\n ticks: {}\n }\n ],\n yAxes: [\n {\n ticks: {}\n }\n ]\n }\n },\n data: {\n datasets: []\n }\n }\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.value.options.multiAxis\n }\n\n set multiAxis(multiAxis) {\n this.value.options.multiAxis = multiAxis\n }\n\n editorTemplate(props: any) {\n return html`\n <input type=\"checkbox\" value-key=\"multiAxis\" .checked=${this.multiAxis} />\n <label> <i18n-msg msgid=\"label.multi-axis\">Multi Axis</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.series\">Series</i18n-msg></legend>\n\n <div fullwidth>${this.multiSeriesTabTemplate()}</div>\n\n <legend><i18n-msg msgid=\"label.x-axes\">X Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.data-key\">Data Key</i18n-msg> </label>\n <input type=\"text\" value-key=\"labelDataKey\" .value=${this.labelDataKey} />\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"xAxes0.axisTitle\" .value=${this.xAxes0.axisTitle || ''} />\n\n ${this._hasBarSeries(this.value)\n ? html`\n <label><i18n-msg msgid=\"label.bar-spacing\">Bar Spacing</i18n-msg></label>\n <input\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.barSpacing\"\n .value=${this.xAxes0.barSpacing || NaN}\n />\n <label><i18n-msg msgid=\"label.tick-spacing\">Tick Spacing</i18n-msg></label>\n <input\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"xAxes0.categorySpacing\"\n .value=${this.xAxes0.categorySpacing || NaN}\n />\n `\n : html``}\n\n <input type=\"checkbox\" value-key=\"value.options.xGridLine\" .checked=${props.value.options.xGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.display\" .checked=${this.xAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n <legend><i18n-msg msgid=\"label.y-axes\">Y Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes0.axisTitle\" .value=${this.yAxes0.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMin\" .checked=${this.yAxes0.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.autoMax\" .checked=${this.yAxes0.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes0.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.min\" .value=${this.yAxes0.ticks.min} />\n `\n : html``}\n ${!this.yAxes0.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.max\" .value=${this.yAxes0.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.stepSize\" .value=${this.yAxes0.ticks.stepSize} />\n\n <input type=\"checkbox\" value-key=\"value.options.yGridLine\" .checked=${props.value.options.yGridLine} />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.display\" .checked=${this.yAxes0.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n\n ${props.value.options.multiAxis\n ? html`\n <legend><i18n-msg msgid=\"label.y-2nd-axes\">Y 2nd Axes</i18n-msg></legend>\n\n <label> <i18n-msg msgid=\"label.title\">Title</i18n-msg> </label>\n <input type=\"text\" value-key=\"yAxes1.axisTitle\" .value=${this.yAxes1.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMin\" .checked=${this.yAxes1.ticks.autoMin} />\n <label> <i18n-msg msgid=\"label.axis-min-auto\">Min Auto</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.autoMax\" .checked=${this.yAxes1.ticks.autoMax} />\n <label> <i18n-msg msgid=\"label.axis-max-auto\">Max Auto</i18n-msg> </label>\n\n ${!this.yAxes1.ticks.autoMin\n ? html`\n <label> <i18n-msg msgid=\"label.axis-min\">Min</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.min\" .value=${this.yAxes1.ticks.min} />\n `\n : html``}\n ${!this.yAxes1.ticks.autoMax\n ? html`\n <label> <i18n-msg msgid=\"label.axis-max\">Max</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.max\" .value=${this.yAxes1.ticks.max} />\n `\n : html``}\n\n <label> <i18n-msg msgid=\"label.axis-step-size\">StepSize</i18n-msg> </label>\n <input type=\"number\" value-key=\"yAxes1.ticks.stepSize\" .value=${this.yAxes1.ticks.stepSize} />\n\n <input\n type=\"checkbox\"\n value-key=\"value.options.y2ndGridLine\"\n .checked=${props.value.options.y2ndGridLine}\n />\n <label> <i18n-msg msgid=\"label.grid-line\">Grid Line</i18n-msg> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes1.ticks.display\" .checked=${this.yAxes1.ticks.display} />\n <label> <i18n-msg msgid=\"label.display-tick\">Display Tick</i18n-msg> </label>\n `\n : html``}\n `\n }\n\n _hasBarSeries(chart: any) {\n var hasBarSeries = false\n hasBarSeries = chart.data.datasets.some((s: any) => s.type == 'bar')\n\n return hasBarSeries\n }\n}\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import '@polymer/iron-icon/iron-icon';
|
2
|
+
import '@polymer/iron-pages/iron-pages';
|
3
|
+
import '@polymer/paper-button/paper-button';
|
4
|
+
import '@polymer/paper-icon-button/paper-icon-button';
|
5
|
+
import '@polymer/paper-tabs/paper-tabs';
|
6
|
+
import { PaperIconButtonElement } from '@polymer/paper-icon-button/paper-icon-button';
|
7
|
+
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract';
|
8
|
+
export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {
|
9
|
+
static styles: import("lit").CSSResult[];
|
10
|
+
constructor();
|
11
|
+
tabs: HTMLElement;
|
12
|
+
tabNavLeftButton: PaperIconButtonElement;
|
13
|
+
tabNavRightButton: PaperIconButtonElement;
|
14
|
+
get color(): any;
|
15
|
+
set color(color: any);
|
16
|
+
get xAxes0(): any;
|
17
|
+
set xAxes0(xAxes0: any);
|
18
|
+
get yAxes0(): any;
|
19
|
+
set yAxes0(yAxes0: any);
|
20
|
+
get yAxes1(): any;
|
21
|
+
set yAxes1(yAxes1: any);
|
22
|
+
get multiAxis(): any;
|
23
|
+
set multiAxis(multiAxis: any);
|
24
|
+
get tabContainer(): HTMLElement | null | undefined;
|
25
|
+
firstUpdated(): void;
|
26
|
+
editorTemplate(props: any): import("lit-html").TemplateResult<1>;
|
27
|
+
multiSeriesTabTemplate(): import("lit-html").TemplateResult<1>;
|
28
|
+
_onTabScroll(e: Event): void;
|
29
|
+
_onTabScrollNavLeft(e: Event): void;
|
30
|
+
_onTabScrollNavRight(e: Event): void;
|
31
|
+
}
|
@@ -0,0 +1,373 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
3
|
+
*/
|
4
|
+
import { __decorate } from "tslib";
|
5
|
+
import '@polymer/iron-icon/iron-icon';
|
6
|
+
import '@polymer/iron-pages/iron-pages';
|
7
|
+
import '@polymer/paper-button/paper-button';
|
8
|
+
import '@polymer/paper-icon-button/paper-icon-button';
|
9
|
+
import '@polymer/paper-tabs/paper-tabs';
|
10
|
+
import { css, html } from 'lit';
|
11
|
+
import { query } from 'lit/decorators.js';
|
12
|
+
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract';
|
13
|
+
export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {
|
14
|
+
constructor() {
|
15
|
+
super();
|
16
|
+
this.value = {
|
17
|
+
options: {
|
18
|
+
legend: {},
|
19
|
+
scales: {
|
20
|
+
xAxes: [
|
21
|
+
{
|
22
|
+
ticks: {}
|
23
|
+
}
|
24
|
+
],
|
25
|
+
yAxes: [
|
26
|
+
{
|
27
|
+
ticks: {}
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
data: {
|
33
|
+
datasets: []
|
34
|
+
}
|
35
|
+
};
|
36
|
+
}
|
37
|
+
get color() {
|
38
|
+
var oldVersionColor = this.series.backgroundColor;
|
39
|
+
if (this.series.type == 'line')
|
40
|
+
oldVersionColor = this.series.borderColor;
|
41
|
+
if (this.series.type == 'radar')
|
42
|
+
oldVersionColor = this.series.borderColor;
|
43
|
+
return this.series.color || oldVersionColor;
|
44
|
+
}
|
45
|
+
set color(color) {
|
46
|
+
this.series.color = color;
|
47
|
+
delete this.series.backgroundColor;
|
48
|
+
delete this.series.borderColor;
|
49
|
+
}
|
50
|
+
get xAxes0() {
|
51
|
+
return this.scales.xAxes[0];
|
52
|
+
}
|
53
|
+
set xAxes0(xAxes0) {
|
54
|
+
this.scales.xAxes[0] = xAxes0;
|
55
|
+
}
|
56
|
+
get yAxes0() {
|
57
|
+
return this.scales.yAxes[0];
|
58
|
+
}
|
59
|
+
set yAxes0(yAxes0) {
|
60
|
+
this.scales.yAxes[0] = yAxes0;
|
61
|
+
}
|
62
|
+
get yAxes1() {
|
63
|
+
return this.scales.yAxes[1];
|
64
|
+
}
|
65
|
+
set yAxes1(yAxes1) {
|
66
|
+
this.scales.yAxes[1] = yAxes1;
|
67
|
+
}
|
68
|
+
get multiAxis() {
|
69
|
+
return this.value.options.multiAxis;
|
70
|
+
}
|
71
|
+
set multiAxis(multiAxis) {
|
72
|
+
this.value.options.multiAxis = multiAxis;
|
73
|
+
}
|
74
|
+
get tabContainer() {
|
75
|
+
var _a;
|
76
|
+
return (_a = this.tabs.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#tabsContainer');
|
77
|
+
}
|
78
|
+
firstUpdated() {
|
79
|
+
var _a;
|
80
|
+
(_a = this.tabContainer) === null || _a === void 0 ? void 0 : _a.addEventListener('scroll', e => {
|
81
|
+
this._onTabScroll(e);
|
82
|
+
});
|
83
|
+
}
|
84
|
+
editorTemplate(props) {
|
85
|
+
return html `
|
86
|
+
<input type="checkbox" value-key="multiAxis" .checked=${this.multiAxis} />
|
87
|
+
<label> <i18n-msg msgid="label.multi-axis">Multi Axis</i18n-msg> </label>
|
88
|
+
|
89
|
+
<legend><i18n-msg msgid="label.series">Series</i18n-msg></legend>
|
90
|
+
|
91
|
+
${this.multiSeriesTabTemplate()}
|
92
|
+
|
93
|
+
<legend><i18n-msg msgid="label.x-axes">X Axes</i18n-msg></legend>
|
94
|
+
|
95
|
+
<label> <i18n-msg msgid="label.data-key">Data Key</i18n-msg> </label>
|
96
|
+
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
97
|
+
|
98
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
99
|
+
<input type="text" value-key="xAxes0.axisTitle" .value=${this.xAxes0.axisTitle || ''} />
|
100
|
+
|
101
|
+
<label> <i18n-msg msgid="label.thickness">Thickness</i18n-msg> </label>
|
102
|
+
<input type="number" value-key="xAxes0.barPercentage" .value=${this.xAxes0.barPercentage} />
|
103
|
+
|
104
|
+
<input type="checkbox" value-key="value.options.xGridLine" .checked=${this.value.options.xGridLine} />
|
105
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
106
|
+
|
107
|
+
<input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
|
108
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
109
|
+
|
110
|
+
<legend><i18n-msg msgid="label.y-axes">Y Axes</i18n-msg></legend>
|
111
|
+
|
112
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
113
|
+
<input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
|
114
|
+
|
115
|
+
<input type="checkbox" value-key="yAxes0.ticks.autoMin" .checked=${this.yAxes0.ticks.autoMin} />
|
116
|
+
<label> <i18n-msg msgid="label.axis-min-auto">Min Auto</i18n-msg> </label>
|
117
|
+
|
118
|
+
<input type="checkbox" value-key="yAxes0.ticks.autoMax" .checked=${this.yAxes0.ticks.autoMax} />
|
119
|
+
<label> <i18n-msg msgid="label.axis-max-auto">Max Auto</i18n-msg> </label>
|
120
|
+
|
121
|
+
${!this.yAxes0.ticks.autoMin
|
122
|
+
? html `
|
123
|
+
<label> <i18n-msg msgid="label.axis-min">Min</i18n-msg> </label>
|
124
|
+
<input type="number" value-key="yAxes0.ticks.min" .value=${this.yAxes0.ticks.min} />
|
125
|
+
`
|
126
|
+
: html ``}
|
127
|
+
${!this.yAxes0.ticks.autoMax
|
128
|
+
? html `
|
129
|
+
<label> <i18n-msg msgid="label.axis-max">Max</i18n-msg> </label>
|
130
|
+
<input type="number" value-key="yAxes0.ticks.max" .value=${this.yAxes0.ticks.max} />
|
131
|
+
`
|
132
|
+
: html ``}
|
133
|
+
|
134
|
+
<label> <i18n-msg msgid="label.axis-step-size">StepSize</i18n-msg> </label>
|
135
|
+
<input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
|
136
|
+
|
137
|
+
<input type="checkbox" value-key="value.options.yGridLine" .checked=${this.value.options.yGridLine} />
|
138
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
139
|
+
|
140
|
+
<input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
|
141
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
142
|
+
|
143
|
+
${this.value.options.multiAxis
|
144
|
+
? html `
|
145
|
+
<legend><i18n-msg msgid="label.y-2nd-axes">Y 2nd Axes</i18n-msg></legend>
|
146
|
+
|
147
|
+
<label> <i18n-msg msgid="label.title">Title</i18n-msg> </label>
|
148
|
+
<input type="text" value-key="yAxes1.axisTitle" .value=${this.yAxes1.axisTitle || ''} />
|
149
|
+
|
150
|
+
<input type="checkbox" value-key="yAxes1.ticks.autoMin" .checked=${this.yAxes1.ticks.autoMin} />
|
151
|
+
<label> <i18n-msg msgid="label.axis-min-auto">Min Auto</i18n-msg> </label>
|
152
|
+
|
153
|
+
<input type="checkbox" value-key="yAxes1.ticks.autoMax" .checked=${this.yAxes1.ticks.autoMax} />
|
154
|
+
<label> <i18n-msg msgid="label.axis-max-auto">Max Auto</i18n-msg> </label>
|
155
|
+
|
156
|
+
${!this.yAxes1.ticks.autoMin
|
157
|
+
? html `
|
158
|
+
<label> <i18n-msg msgid="label.axis-min">Min</i18n-msg> </label>
|
159
|
+
<input type="number" value-key="yAxes1.ticks.min" .value=${this.yAxes1.ticks.min} />
|
160
|
+
`
|
161
|
+
: html ``}
|
162
|
+
${!this.yAxes1.ticks.autoMax
|
163
|
+
? html `
|
164
|
+
<label> <i18n-msg msgid="label.axis-max">Max</i18n-msg> </label>
|
165
|
+
<input type="number" value-key="yAxes1.ticks.max" .value=${this.yAxes1.ticks.max} />
|
166
|
+
`
|
167
|
+
: html ``}
|
168
|
+
|
169
|
+
<label> <i18n-msg msgid="label.axis-step-size">StepSize</i18n-msg> </label>
|
170
|
+
<input type="number" value-key="yAxes1.ticks.stepSize" .value=${this.yAxes1.ticks.stepSize} />
|
171
|
+
|
172
|
+
<input type="checkbox" value-key="value.options.y2ndGridLine" .checked=${this.value.options.y2ndGridLine} />
|
173
|
+
<label> <i18n-msg msgid="label.grid-line">Grid Line</i18n-msg> </label>
|
174
|
+
|
175
|
+
<input type="checkbox" value-key="yAxes1.ticks.display" .checked=${this.yAxes1.ticks.display} />
|
176
|
+
<label> <i18n-msg msgid="label.display-tick">Display Tick</i18n-msg> </label>
|
177
|
+
`
|
178
|
+
: html ``}
|
179
|
+
`;
|
180
|
+
}
|
181
|
+
multiSeriesTabTemplate() {
|
182
|
+
return html `
|
183
|
+
<div id="series-properties-container" fullwidth>
|
184
|
+
<div id="tab-header">
|
185
|
+
<paper-icon-button
|
186
|
+
id="tab-nav-left-button"
|
187
|
+
icon="chevron-left"
|
188
|
+
@click=${(e) => {
|
189
|
+
this._onTabScrollNavLeft(e);
|
190
|
+
}}
|
191
|
+
disabled
|
192
|
+
></paper-icon-button>
|
193
|
+
<paper-tabs
|
194
|
+
id="tabs"
|
195
|
+
@iron-select=${(e) => (this.currentSeriesIndex = e.target.selected)}
|
196
|
+
.selected=${this.currentSeriesIndex}
|
197
|
+
no-bar
|
198
|
+
noink
|
199
|
+
scrollable
|
200
|
+
hide-scroll-buttons
|
201
|
+
fit-container
|
202
|
+
>
|
203
|
+
${this.datasets.map((dataset, index) => html `
|
204
|
+
<paper-tab data-series="${index + 1}" noink
|
205
|
+
>${index + 1}
|
206
|
+
${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)
|
207
|
+
? html `
|
208
|
+
<paper-icon-button icon="close" @tap=${(e) => this.onTapRemoveCurrentTab(e)}>
|
209
|
+
</paper-icon-button>
|
210
|
+
`
|
211
|
+
: html ``}
|
212
|
+
</paper-tab>
|
213
|
+
`)}
|
214
|
+
</paper-tabs>
|
215
|
+
<paper-icon-button
|
216
|
+
id="tab-nav-right-button"
|
217
|
+
icon="chevron-right"
|
218
|
+
@click=${(e) => {
|
219
|
+
this._onTabScrollNavRight(e);
|
220
|
+
}}
|
221
|
+
disabled
|
222
|
+
></paper-icon-button>
|
223
|
+
</div>
|
224
|
+
<div id="add-series-button-container">
|
225
|
+
<paper-icon-button
|
226
|
+
id="add-series-button"
|
227
|
+
icon="add"
|
228
|
+
@tap=${(e) => this.onTapAddTab(e)}
|
229
|
+
></paper-icon-button>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<iron-pages .selected=${this.currentSeriesIndex} .attr-for-selected="series-index">
|
233
|
+
${this.datasets.map((dataset, index) => html `
|
234
|
+
<div class="tab-content" series-index="${index}">
|
235
|
+
<label> <i18n-msg msgid="label.data-key">Data Key</i18n-msg> </label>
|
236
|
+
<input type="text" value-key="dataKey" .value=${this.dataKey} />
|
237
|
+
|
238
|
+
${this.value.type == 'bar'
|
239
|
+
? html `
|
240
|
+
<label> <i18n-msg msgid="label.type">type</i18n-msg> </label>
|
241
|
+
<select class="select-content" value-key="series.type" .value=${this.series.type}>
|
242
|
+
<option value="bar" selected>bar</option>
|
243
|
+
<option value="line">line</option>
|
244
|
+
</select>
|
245
|
+
`
|
246
|
+
: html ``}
|
247
|
+
|
248
|
+
<label> <i18n-msg msgid="label.label">label</i18n-msg> </label>
|
249
|
+
<input type="text" value-key="series.label" .value=${this.series.label} />
|
250
|
+
|
251
|
+
${this.series.type == 'line'
|
252
|
+
? html `
|
253
|
+
<label> <i18n-msg msgid="label.line-tension">line tension</i18n-msg> </label>
|
254
|
+
<select class="select-content" value-key="series.lineTension" .value=${this.series.lineTension}>
|
255
|
+
<option value="0.4">smooth</option>
|
256
|
+
<option value="0">angled</option>
|
257
|
+
</select>
|
258
|
+
`
|
259
|
+
: html ``}
|
260
|
+
${this.series.type == 'line'
|
261
|
+
? html `
|
262
|
+
<label> <i18n-msg msgid="label.border-width">border width</i18n-msg> </label>
|
263
|
+
<input type="number" value-key="series.borderWidth" .value=${this.series.borderWidth} />
|
264
|
+
`
|
265
|
+
: html ``}
|
266
|
+
|
267
|
+
<label> <i18n-msg msgid="label.color">color</i18n-msg> </label>
|
268
|
+
<things-editor-color value-key="color" .value=${this.color}></things-editor-color>
|
269
|
+
|
270
|
+
${this.series.type == 'line'
|
271
|
+
? html `
|
272
|
+
<label> <i18n-msg msgid="label.point-shape">point shape</i18n-msg> </label>
|
273
|
+
<select class="select-content" value-key="series.pointStyle" .value=${this.series.pointStyle}>
|
274
|
+
<option value="circle">⚬</option>
|
275
|
+
<option value="triangle">▵</option>
|
276
|
+
<option value="rect">□</option>
|
277
|
+
<option value="rectRot">◇</option>
|
278
|
+
<option value="cross">+</option>
|
279
|
+
<option value="crossRot">⨉</option>
|
280
|
+
<option value="star">✱</option>
|
281
|
+
<option value="line">―</option>
|
282
|
+
<option value="dash">┄</option>
|
283
|
+
</select>
|
284
|
+
|
285
|
+
<label> <i18n-msg msgid="label.point-size">point size</i18n-msg> </label>
|
286
|
+
<input type="number" value-key="series.pointRadius" .value=${this.series.pointRadius} />
|
287
|
+
`
|
288
|
+
: html ``} <label> <i18n-msg msgid="label.stack-group">Stack group</i18n-msg> </label>
|
289
|
+
<input type="text" value-key="series.stack" .value=${this.series.stack || ''} /> ${this.series.type ==
|
290
|
+
'line'
|
291
|
+
? html `
|
292
|
+
<input type="checkbox" value-key="series.fill" .checked=${this.series.fill} />
|
293
|
+
<label> <i18n-msg msgid="label.fill">fill</i18n-msg> </label>
|
294
|
+
`
|
295
|
+
: html ``}
|
296
|
+
${this.multiAxis
|
297
|
+
? html `
|
298
|
+
<label> <i18n-msg msgid="label.target-axis">target axis</i18n-msg> </label>
|
299
|
+
<select class="select-content" value-key="series.yAxisID" .value=${this.series.yAxisID}>
|
300
|
+
<option value="left">left</option>
|
301
|
+
<option value="right">right</option>
|
302
|
+
</select>
|
303
|
+
`
|
304
|
+
: html ``}
|
305
|
+
${this.displayValueTemplate()}
|
306
|
+
</div>
|
307
|
+
`)}
|
308
|
+
</iron-pages>
|
309
|
+
</div>
|
310
|
+
`;
|
311
|
+
}
|
312
|
+
_onTabScroll(e) {
|
313
|
+
if (!this.tabContainer) {
|
314
|
+
return;
|
315
|
+
}
|
316
|
+
if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
|
317
|
+
this.tabNavLeftButton.disabled = true;
|
318
|
+
this.tabNavRightButton.disabled = true;
|
319
|
+
}
|
320
|
+
// left-end
|
321
|
+
else if (this.tabContainer.scrollLeft == 0) {
|
322
|
+
this.tabNavLeftButton.disabled = true;
|
323
|
+
this.tabNavRightButton.disabled = false;
|
324
|
+
}
|
325
|
+
// right-end
|
326
|
+
else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
|
327
|
+
this.tabNavLeftButton.disabled = false;
|
328
|
+
this.tabNavRightButton.disabled = true;
|
329
|
+
}
|
330
|
+
else {
|
331
|
+
this.tabNavLeftButton.disabled = false;
|
332
|
+
this.tabNavRightButton.disabled = false;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
_onTabScrollNavLeft(e) {
|
336
|
+
if (!this.tabContainer) {
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
this.tabContainer.style.scrollBehavior = 'smooth';
|
340
|
+
this.tabContainer.scrollLeft -= this.tabContainer.clientWidth;
|
341
|
+
this.tabContainer.style.scrollBehavior = 'auto';
|
342
|
+
}
|
343
|
+
_onTabScrollNavRight(e) {
|
344
|
+
if (!this.tabContainer) {
|
345
|
+
return;
|
346
|
+
}
|
347
|
+
this.tabContainer.style.scrollBehavior = 'smooth';
|
348
|
+
this.tabContainer.scrollLeft += this.tabContainer.clientWidth;
|
349
|
+
this.tabContainer.style.scrollBehavior = 'auto';
|
350
|
+
}
|
351
|
+
}
|
352
|
+
PropertyEditorChartJSMultiSeriesAbstract.styles = [
|
353
|
+
...PropertyEditorChartJSAbstract.styles,
|
354
|
+
css `
|
355
|
+
paper-tabs {
|
356
|
+
background-color: rgb(204, 204, 204);
|
357
|
+
}
|
358
|
+
input[type='text'],
|
359
|
+
input[type='number'] {
|
360
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
361
|
+
}
|
362
|
+
`
|
363
|
+
];
|
364
|
+
__decorate([
|
365
|
+
query('#tabs')
|
366
|
+
], PropertyEditorChartJSMultiSeriesAbstract.prototype, "tabs", void 0);
|
367
|
+
__decorate([
|
368
|
+
query('#tab-nav-left-button')
|
369
|
+
], PropertyEditorChartJSMultiSeriesAbstract.prototype, "tabNavLeftButton", void 0);
|
370
|
+
__decorate([
|
371
|
+
query('#tab-nav-right-button')
|
372
|
+
], PropertyEditorChartJSMultiSeriesAbstract.prototype, "tabNavRightButton", void 0);
|
373
|
+
//# sourceMappingURL=property-editor-chartjs-multi-series-abstract.js.map
|