@operato/scene-chartjs 7.0.1 → 7.0.2
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 +9 -0
- package/dist/config-converter.js +1 -1
- package/dist/config-converter.js.map +1 -1
- package/dist/editors/index.d.ts +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/editors/index.js.map +1 -1
- package/dist/ox-chart.js +1 -1
- package/dist/ox-chart.js.map +1 -1
- package/package.json +4 -2
- package/schema.graphql +76 -40
- package/src/config-converter.ts +1 -1
- package/src/editors/index.ts +2 -2
- package/src/ox-chart.ts +1 -1
- package/translations/en.json +2 -1
- package/translations/ja.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/ms.json +2 -1
- package/translations/zh.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/editors/property-editor-chartjs-abstract.d.ts +0 -50
- package/dist/editors/property-editor-chartjs-abstract.js +0 -273
- package/dist/editors/property-editor-chartjs-abstract.js.map +0 -1
- package/dist/editors/property-editor-chartjs-hbar.d.ts +0 -10
- package/dist/editors/property-editor-chartjs-hbar.js +0 -154
- package/dist/editors/property-editor-chartjs-hbar.js.map +0 -1
- package/dist/editors/property-editor-chartjs-mixed.d.ts +0 -17
- package/dist/editors/property-editor-chartjs-mixed.js +0 -186
- package/dist/editors/property-editor-chartjs-mixed.js.map +0 -1
- package/dist/editors/property-editor-chartjs-multi-series-abstract.d.ts +0 -29
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js +0 -363
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js.map +0 -1
- package/dist/editors/property-editor-chartjs-pie.d.ts +0 -18
- package/dist/editors/property-editor-chartjs-pie.js +0 -74
- package/dist/editors/property-editor-chartjs-pie.js.map +0 -1
- package/dist/editors/property-editor-chartjs-radar.d.ts +0 -8
- package/dist/editors/property-editor-chartjs-radar.js +0 -36
- package/dist/editors/property-editor-chartjs-radar.js.map +0 -1
- package/dist/editors/property-editor-chartjs-styles.d.ts +0 -1
- package/dist/editors/property-editor-chartjs-styles.js +0 -167
- package/dist/editors/property-editor-chartjs-styles.js.map +0 -1
- package/dist/editors/property-editor-chartjs.d.ts +0 -10
- package/dist/editors/property-editor-chartjs.js +0 -79
- package/dist/editors/property-editor-chartjs.js.map +0 -1
- package/src/editors/property-editor-chartjs-abstract.ts +0 -324
- package/src/editors/property-editor-chartjs-hbar.ts +0 -157
- package/src/editors/property-editor-chartjs-mixed.ts +0 -199
- package/src/editors/property-editor-chartjs-multi-series-abstract.ts +0 -382
- package/src/editors/property-editor-chartjs-pie.ts +0 -86
- package/src/editors/property-editor-chartjs-radar.ts +0 -39
- package/src/editors/property-editor-chartjs-styles.ts +0 -167
- package/src/editors/property-editor-chartjs.ts +0 -79
@@ -1,382 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js'
|
2
|
-
import '@operato/i18n/ox-i18n.js'
|
3
|
-
|
4
|
-
import { css, html } from 'lit'
|
5
|
-
import { query } from 'lit/decorators.js'
|
6
|
-
|
7
|
-
import { Properties } from '@hatiolab/things-scene'
|
8
|
-
import { MdIcon } from '@material/web/icon/icon.js'
|
9
|
-
|
10
|
-
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'
|
11
|
-
|
12
|
-
export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEditorChartJSAbstract {
|
13
|
-
static styles = [
|
14
|
-
...PropertyEditorChartJSAbstract.styles,
|
15
|
-
css`
|
16
|
-
md-tabs {
|
17
|
-
background-color: rgb(204, 204, 204);
|
18
|
-
}
|
19
|
-
input[type='text'],
|
20
|
-
input[type='number'] {
|
21
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
22
|
-
}
|
23
|
-
`
|
24
|
-
]
|
25
|
-
|
26
|
-
constructor() {
|
27
|
-
super()
|
28
|
-
|
29
|
-
this.value = {
|
30
|
-
options: {
|
31
|
-
legend: {},
|
32
|
-
scales: {
|
33
|
-
xAxes: [
|
34
|
-
{
|
35
|
-
ticks: {}
|
36
|
-
}
|
37
|
-
],
|
38
|
-
yAxes: [
|
39
|
-
{
|
40
|
-
ticks: {}
|
41
|
-
}
|
42
|
-
]
|
43
|
-
}
|
44
|
-
},
|
45
|
-
data: {
|
46
|
-
datasets: []
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
@query('#tabs') tabs!: HTMLElement
|
52
|
-
@query('#tab-nav-left-button') tabNavLeftButton!: MdIcon
|
53
|
-
@query('#tab-nav-right-button') tabNavRightButton!: MdIcon
|
54
|
-
|
55
|
-
get color() {
|
56
|
-
var oldVersionColor = this.series.backgroundColor
|
57
|
-
if (this.series.type == 'line') oldVersionColor = this.series.borderColor
|
58
|
-
if (this.series.type == 'radar') oldVersionColor = this.series.borderColor
|
59
|
-
return this.series.color || oldVersionColor
|
60
|
-
}
|
61
|
-
|
62
|
-
set color(color) {
|
63
|
-
this.series.color = color
|
64
|
-
delete this.series.backgroundColor
|
65
|
-
delete this.series.borderColor
|
66
|
-
}
|
67
|
-
|
68
|
-
get xAxes0() {
|
69
|
-
return this.scales.xAxes[0]
|
70
|
-
}
|
71
|
-
|
72
|
-
set xAxes0(xAxes0) {
|
73
|
-
this.scales.xAxes[0] = xAxes0
|
74
|
-
}
|
75
|
-
|
76
|
-
get yAxes0() {
|
77
|
-
return this.scales.yAxes[0]
|
78
|
-
}
|
79
|
-
|
80
|
-
set yAxes0(yAxes0) {
|
81
|
-
this.scales.yAxes[0] = yAxes0
|
82
|
-
}
|
83
|
-
|
84
|
-
get yAxes1() {
|
85
|
-
return this.scales.yAxes[1]
|
86
|
-
}
|
87
|
-
|
88
|
-
set yAxes1(yAxes1) {
|
89
|
-
this.scales.yAxes[1] = yAxes1
|
90
|
-
}
|
91
|
-
|
92
|
-
get multiAxis() {
|
93
|
-
return this.value.options.multiAxis
|
94
|
-
}
|
95
|
-
|
96
|
-
set multiAxis(multiAxis) {
|
97
|
-
this.value.options.multiAxis = multiAxis
|
98
|
-
}
|
99
|
-
|
100
|
-
get tabContainer(): HTMLElement | null | undefined {
|
101
|
-
return this.tabs
|
102
|
-
}
|
103
|
-
|
104
|
-
firstUpdated() {
|
105
|
-
super.firstUpdated()
|
106
|
-
|
107
|
-
this.tabContainer?.addEventListener('scroll', e => {
|
108
|
-
this._onTabScroll(e)
|
109
|
-
})
|
110
|
-
}
|
111
|
-
|
112
|
-
editorTemplate(props: Properties) {
|
113
|
-
return html`
|
114
|
-
<input type="checkbox" value-key="multiAxis" .checked=${this.multiAxis} />
|
115
|
-
<label> <ox-i18n msgid="label.multi-axis">Multi Axis</ox-i18n> </label>
|
116
|
-
|
117
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
118
|
-
|
119
|
-
${this.multiSeriesTabTemplate()}
|
120
|
-
|
121
|
-
<legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
|
122
|
-
|
123
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
124
|
-
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
125
|
-
|
126
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
127
|
-
<input type="text" value-key="xAxes0.axisTitle" .value=${this.xAxes0.axisTitle || ''} />
|
128
|
-
|
129
|
-
<label> <ox-i18n msgid="label.thickness">Thickness</ox-i18n> </label>
|
130
|
-
<input type="number" value-key="xAxes0.barPercentage" .value=${this.xAxes0.barPercentage} />
|
131
|
-
|
132
|
-
<input type="checkbox" value-key="value.options.xGridLine" .checked=${this.value.options.xGridLine} />
|
133
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
134
|
-
|
135
|
-
<input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
|
136
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
137
|
-
|
138
|
-
<legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
|
139
|
-
|
140
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
141
|
-
<input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
|
142
|
-
|
143
|
-
<input type="checkbox" value-key="yAxes0.ticks.autoMin" .checked=${this.yAxes0.ticks.autoMin} />
|
144
|
-
<label> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
145
|
-
|
146
|
-
<input type="checkbox" value-key="yAxes0.ticks.autoMax" .checked=${this.yAxes0.ticks.autoMax} />
|
147
|
-
<label> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
148
|
-
|
149
|
-
${!this.yAxes0.ticks.autoMin
|
150
|
-
? html`
|
151
|
-
<label> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
152
|
-
<input type="number" value-key="yAxes0.ticks.min" .value=${this.yAxes0.ticks.min} />
|
153
|
-
`
|
154
|
-
: html``}
|
155
|
-
${!this.yAxes0.ticks.autoMax
|
156
|
-
? html`
|
157
|
-
<label> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
158
|
-
<input type="number" value-key="yAxes0.ticks.max" .value=${this.yAxes0.ticks.max} />
|
159
|
-
`
|
160
|
-
: html``}
|
161
|
-
|
162
|
-
<label> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
163
|
-
<input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
|
164
|
-
|
165
|
-
<input type="checkbox" value-key="value.options.yGridLine" .checked=${this.value.options.yGridLine} />
|
166
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
167
|
-
|
168
|
-
<input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
|
169
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
170
|
-
|
171
|
-
${this.value.options.multiAxis
|
172
|
-
? html`
|
173
|
-
<legend><ox-i18n msgid="label.y-2nd-axes">Y 2nd Axes</ox-i18n></legend>
|
174
|
-
|
175
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
176
|
-
<input type="text" value-key="yAxes1.axisTitle" .value=${this.yAxes1.axisTitle || ''} />
|
177
|
-
|
178
|
-
<input type="checkbox" value-key="yAxes1.ticks.autoMin" .checked=${this.yAxes1.ticks.autoMin} />
|
179
|
-
<label> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
180
|
-
|
181
|
-
<input type="checkbox" value-key="yAxes1.ticks.autoMax" .checked=${this.yAxes1.ticks.autoMax} />
|
182
|
-
<label> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
183
|
-
|
184
|
-
${!this.yAxes1.ticks.autoMin
|
185
|
-
? html`
|
186
|
-
<label> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
187
|
-
<input type="number" value-key="yAxes1.ticks.min" .value=${this.yAxes1.ticks.min} />
|
188
|
-
`
|
189
|
-
: html``}
|
190
|
-
${!this.yAxes1.ticks.autoMax
|
191
|
-
? html`
|
192
|
-
<label> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
193
|
-
<input type="number" value-key="yAxes1.ticks.max" .value=${this.yAxes1.ticks.max} />
|
194
|
-
`
|
195
|
-
: html``}
|
196
|
-
|
197
|
-
<label> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
198
|
-
<input type="number" value-key="yAxes1.ticks.stepSize" .value=${this.yAxes1.ticks.stepSize} />
|
199
|
-
|
200
|
-
<input type="checkbox" value-key="value.options.y2ndGridLine" .checked=${this.value.options.y2ndGridLine} />
|
201
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
202
|
-
|
203
|
-
<input type="checkbox" value-key="yAxes1.ticks.display" .checked=${this.yAxes1.ticks.display} />
|
204
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
205
|
-
`
|
206
|
-
: html``}
|
207
|
-
`
|
208
|
-
}
|
209
|
-
|
210
|
-
multiSeriesTabTemplate() {
|
211
|
-
return html`
|
212
|
-
<div id="series-properties-container" fullwidth>
|
213
|
-
<div id="tab-header">
|
214
|
-
<md-icon
|
215
|
-
id="tab-nav-left-button"
|
216
|
-
@tap=${(e: Event) => {
|
217
|
-
this._onTabScrollNavLeft(e)
|
218
|
-
}}
|
219
|
-
disabled
|
220
|
-
>chevron_left</md-icon
|
221
|
-
>
|
222
|
-
<div
|
223
|
-
id="tabs"
|
224
|
-
@change=${(e: Event) => {
|
225
|
-
this.currentSeriesIndex = (e.target as any).activeTabIndex
|
226
|
-
}}
|
227
|
-
active-tab-index=${this.currentSeriesIndex}
|
228
|
-
fit-container
|
229
|
-
>
|
230
|
-
${this.datasets.map(
|
231
|
-
(dataset: any, index: number) => html`
|
232
|
-
<div
|
233
|
-
data-series=${index + 1}
|
234
|
-
data-tab-index=${index}
|
235
|
-
tab
|
236
|
-
?selected=${index == this.currentSeriesIndex}
|
237
|
-
@click=${(e: Event) => {
|
238
|
-
const target = e.target as HTMLDivElement
|
239
|
-
this.currentSeriesIndex = Number(target.getAttribute('data-tab-index'))
|
240
|
-
}}
|
241
|
-
>
|
242
|
-
${index + 1}
|
243
|
-
${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)
|
244
|
-
? html` <md-icon @tap="${(e: Event) => this.onTapRemoveCurrentTab(e)}"> close </md-icon> `
|
245
|
-
: html``}
|
246
|
-
</div>
|
247
|
-
`
|
248
|
-
)}
|
249
|
-
</div>
|
250
|
-
<md-icon
|
251
|
-
id="tab-nav-right-button"
|
252
|
-
@click=${(e: Event) => {
|
253
|
-
this._onTabScrollNavRight(e)
|
254
|
-
}}
|
255
|
-
disabled
|
256
|
-
>chevron_right</md-icon
|
257
|
-
>
|
258
|
-
</div>
|
259
|
-
<div id="add-series-button-container">
|
260
|
-
<md-icon id="add-series-button" @tap=${(e: Event) => this.onTapAddTab(e)}>add</md-icon>
|
261
|
-
</div>
|
262
|
-
|
263
|
-
<div class="tab-content">
|
264
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
265
|
-
<input type="text" value-key="dataKey" .value=${this.dataKey} />
|
266
|
-
|
267
|
-
${this.value.type == 'bar'
|
268
|
-
? html`
|
269
|
-
<label> <ox-i18n msgid="label.type">type</ox-i18n> </label>
|
270
|
-
<select class="select-content" value-key="series.type" .value=${this.series.type}>
|
271
|
-
<option value="bar" selected>bar</option>
|
272
|
-
<option value="line">line</option>
|
273
|
-
</select>
|
274
|
-
`
|
275
|
-
: html``}
|
276
|
-
|
277
|
-
<label> <ox-i18n msgid="label.label">label</ox-i18n> </label>
|
278
|
-
<input type="text" value-key="series.label" .value=${this.series.label} />
|
279
|
-
|
280
|
-
${this.series.type == 'line'
|
281
|
-
? html`
|
282
|
-
<label> <ox-i18n msgid="label.line-tension">line tension</ox-i18n> </label>
|
283
|
-
<select class="select-content" value-key="series.lineTension" .value=${this.series.lineTension}>
|
284
|
-
<option value="0.4">smooth</option>
|
285
|
-
<option value="0">angled</option>
|
286
|
-
</select>
|
287
|
-
`
|
288
|
-
: html``}
|
289
|
-
${this.series.type == 'line'
|
290
|
-
? html`
|
291
|
-
<label> <ox-i18n msgid="label.border-width">border width</ox-i18n> </label>
|
292
|
-
<input type="number" value-key="series.borderWidth" .value=${this.series.borderWidth} />
|
293
|
-
`
|
294
|
-
: html``}
|
295
|
-
|
296
|
-
<label> <ox-i18n msgid="label.color">color</ox-i18n> </label>
|
297
|
-
<ox-input-color value-key="color" .value=${this.color}></ox-input-color>
|
298
|
-
|
299
|
-
${this.series.type == 'line'
|
300
|
-
? html`
|
301
|
-
<label> <ox-i18n msgid="label.point-shape">point shape</ox-i18n> </label>
|
302
|
-
<select class="select-content" value-key="series.pointStyle" .value=${this.series.pointStyle}>
|
303
|
-
<option value="circle">⚬</option>
|
304
|
-
<option value="triangle">▵</option>
|
305
|
-
<option value="rect">□</option>
|
306
|
-
<option value="rectRot">◇</option>
|
307
|
-
<option value="cross">+</option>
|
308
|
-
<option value="crossRot">⨉</option>
|
309
|
-
<option value="star">✱</option>
|
310
|
-
<option value="line">―</option>
|
311
|
-
<option value="dash">┄</option>
|
312
|
-
</select>
|
313
|
-
|
314
|
-
<label> <ox-i18n msgid="label.point-size">point size</ox-i18n> </label>
|
315
|
-
<input type="number" value-key="series.pointRadius" .value=${this.series.pointRadius} />
|
316
|
-
`
|
317
|
-
: html``} <label> <ox-i18n msgid="label.stack-group">Stack group</ox-i18n> </label>
|
318
|
-
<input type="text" value-key="series.stack" .value=${this.series.stack || ''} /> ${this.series.type == 'line'
|
319
|
-
? html`
|
320
|
-
<input type="checkbox" value-key="series.fill" .checked=${this.series.fill} />
|
321
|
-
<label> <ox-i18n msgid="label.fill">fill</ox-i18n> </label>
|
322
|
-
`
|
323
|
-
: html``}
|
324
|
-
${this.multiAxis
|
325
|
-
? html`
|
326
|
-
<label> <ox-i18n msgid="label.target-axis">target axis</ox-i18n> </label>
|
327
|
-
<select class="select-content" value-key="series.yAxisID" .value=${this.series.yAxisID}>
|
328
|
-
<option value="left">left</option>
|
329
|
-
<option value="right">right</option>
|
330
|
-
</select>
|
331
|
-
`
|
332
|
-
: html``}
|
333
|
-
${this.displayValueTemplate()}
|
334
|
-
</div>
|
335
|
-
</div>
|
336
|
-
`
|
337
|
-
}
|
338
|
-
|
339
|
-
_onTabScroll(e: Event) {
|
340
|
-
if (!this.tabContainer) {
|
341
|
-
return
|
342
|
-
}
|
343
|
-
|
344
|
-
if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
|
345
|
-
this.tabNavLeftButton.setAttribute('disabled', '')
|
346
|
-
this.tabNavRightButton.setAttribute('disabled', '')
|
347
|
-
}
|
348
|
-
// left-end
|
349
|
-
else if (this.tabContainer.scrollLeft == 0) {
|
350
|
-
this.tabNavLeftButton.setAttribute('disabled', '')
|
351
|
-
this.tabNavRightButton.removeAttribute('disabled')
|
352
|
-
}
|
353
|
-
// right-end
|
354
|
-
else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
|
355
|
-
this.tabNavLeftButton.removeAttribute('disabled')
|
356
|
-
this.tabNavRightButton.setAttribute('disabled', '')
|
357
|
-
} else {
|
358
|
-
this.tabNavLeftButton.removeAttribute('disabled')
|
359
|
-
this.tabNavRightButton.removeAttribute('disabled')
|
360
|
-
}
|
361
|
-
}
|
362
|
-
|
363
|
-
_onTabScrollNavLeft(e: Event) {
|
364
|
-
if (!this.tabContainer) {
|
365
|
-
return
|
366
|
-
}
|
367
|
-
|
368
|
-
this.tabContainer.style.scrollBehavior = 'smooth'
|
369
|
-
this.tabContainer.scrollLeft -= this.tabContainer.clientWidth
|
370
|
-
this.tabContainer.style.scrollBehavior = 'auto'
|
371
|
-
}
|
372
|
-
|
373
|
-
_onTabScrollNavRight(e: Event) {
|
374
|
-
if (!this.tabContainer) {
|
375
|
-
return
|
376
|
-
}
|
377
|
-
|
378
|
-
this.tabContainer.style.scrollBehavior = 'smooth'
|
379
|
-
this.tabContainer.scrollLeft += this.tabContainer.clientWidth
|
380
|
-
this.tabContainer.style.scrollBehavior = 'auto'
|
381
|
-
}
|
382
|
-
}
|
@@ -1,86 +0,0 @@
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
2
|
-
|
3
|
-
import { Properties } from '@hatiolab/things-scene'
|
4
|
-
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'
|
5
|
-
import { customElement } from 'lit/decorators.js'
|
6
|
-
import { html } from 'lit'
|
7
|
-
|
8
|
-
@customElement('property-editor-chartjs-pie')
|
9
|
-
export default class PropertyEditorChartJSPie extends PropertyEditorChartJSAbstract {
|
10
|
-
static styles = PropertyEditorChartJSAbstract.styles
|
11
|
-
|
12
|
-
constructor() {
|
13
|
-
super()
|
14
|
-
|
15
|
-
this.value = {
|
16
|
-
options: {
|
17
|
-
legend: {}
|
18
|
-
},
|
19
|
-
data: {
|
20
|
-
datasets: []
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
this.currentSeriesIndex = 0
|
25
|
-
}
|
26
|
-
|
27
|
-
get valueFormat() {
|
28
|
-
return this.series.valueFormat
|
29
|
-
}
|
30
|
-
|
31
|
-
set valueFormat(valueFormat) {
|
32
|
-
this.series.valueFormat = valueFormat
|
33
|
-
}
|
34
|
-
|
35
|
-
get valuePrefix() {
|
36
|
-
return this.series.valuePrefix
|
37
|
-
}
|
38
|
-
|
39
|
-
set valuePrefix(valuePrefix) {
|
40
|
-
this.series.valuePrefix = valuePrefix
|
41
|
-
}
|
42
|
-
|
43
|
-
get valueSuffix() {
|
44
|
-
return this.series.valueSuffix
|
45
|
-
}
|
46
|
-
|
47
|
-
set valueSuffix(valueSuffix) {
|
48
|
-
this.series.valueSuffix = valueSuffix
|
49
|
-
}
|
50
|
-
|
51
|
-
get color() {
|
52
|
-
return this.series.color || this.series.backgroundColor
|
53
|
-
}
|
54
|
-
|
55
|
-
set color(color) {
|
56
|
-
this.series.color = color
|
57
|
-
delete this.series.backgroundColor
|
58
|
-
}
|
59
|
-
|
60
|
-
get displayValue() {
|
61
|
-
return this.series.displayValue
|
62
|
-
}
|
63
|
-
|
64
|
-
set displayValue(displayValue) {
|
65
|
-
this.series.displayValue = displayValue
|
66
|
-
}
|
67
|
-
|
68
|
-
editorTemplate(props: Properties) {
|
69
|
-
return html`
|
70
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
71
|
-
|
72
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
73
|
-
<input type="text" value-key="dataKey" .value=${this.series.dataKey} />
|
74
|
-
|
75
|
-
<label> <ox-i18n msgid="label.color">color</ox-i18n> </label>
|
76
|
-
<ox-input-multiple-colors value-key="color" .value=${this.color}></ox-input-multiple-colors>
|
77
|
-
|
78
|
-
${this.displayValueTemplate()}
|
79
|
-
|
80
|
-
<legend><ox-i18n msgid="label.axes">Axes</ox-i18n></legend>
|
81
|
-
|
82
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
83
|
-
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
84
|
-
`
|
85
|
-
}
|
86
|
-
}
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
2
|
-
|
3
|
-
import { html } from 'lit'
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
5
|
-
|
6
|
-
import { Properties } from '@hatiolab/things-scene'
|
7
|
-
|
8
|
-
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'
|
9
|
-
|
10
|
-
@customElement('property-editor-chartjs-radar')
|
11
|
-
export default class PropertyEditorChartJSRadar extends PropertyEditorChartJSMultiSeriesAbstract {
|
12
|
-
static styles = PropertyEditorChartJSMultiSeriesAbstract.styles
|
13
|
-
|
14
|
-
constructor() {
|
15
|
-
super()
|
16
|
-
|
17
|
-
this.value = {
|
18
|
-
options: {
|
19
|
-
legend: {}
|
20
|
-
},
|
21
|
-
data: {
|
22
|
-
datasets: []
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
editorTemplate(props: Properties) {
|
28
|
-
return html`
|
29
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
30
|
-
|
31
|
-
<div fullwidth>${this.multiSeriesTabTemplate()}</div>
|
32
|
-
|
33
|
-
<legend><ox-i18n msgid="label.axes">Axes</ox-i18n></legend>
|
34
|
-
|
35
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
36
|
-
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
37
|
-
`
|
38
|
-
}
|
39
|
-
}
|
@@ -1,167 +0,0 @@
|
|
1
|
-
import { css } from 'lit'
|
2
|
-
|
3
|
-
export const PropertyEditorChartJSStyles = css`
|
4
|
-
:host {
|
5
|
-
display: grid;
|
6
|
-
grid-template-columns: repeat(10, 1fr);
|
7
|
-
grid-gap: 5px;
|
8
|
-
}
|
9
|
-
|
10
|
-
:host > * {
|
11
|
-
box-sizing: border-box;
|
12
|
-
grid-column: span 7;
|
13
|
-
}
|
14
|
-
|
15
|
-
:host > label {
|
16
|
-
box-sizing: border-box;
|
17
|
-
grid-column: span 3;
|
18
|
-
}
|
19
|
-
|
20
|
-
:host > legend {
|
21
|
-
box-sizing: border-box;
|
22
|
-
grid-column: 1 / -1;
|
23
|
-
color: var(--md-sys-color-on-secondary-container, #e46c2e);
|
24
|
-
font: var(--property-sidebar-fieldset-legend, bold 13px var(--theme-font));
|
25
|
-
text-transform: capitalize;
|
26
|
-
}
|
27
|
-
|
28
|
-
#series-properties-container {
|
29
|
-
display: grid;
|
30
|
-
grid-template-columns: 1fr 25px;
|
31
|
-
align-items: center;
|
32
|
-
justify-content: center;
|
33
|
-
}
|
34
|
-
|
35
|
-
#series-properties-container > [tab-content] {
|
36
|
-
grid-column: span 2;
|
37
|
-
}
|
38
|
-
|
39
|
-
#tab-header {
|
40
|
-
display: grid;
|
41
|
-
grid-template-columns: 25px 1fr 25px;
|
42
|
-
grid-gap: 5px;
|
43
|
-
overflow: hidden;
|
44
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
45
|
-
border-bottom: 0;
|
46
|
-
background-color: var(--md-sys-color-surface-variant);
|
47
|
-
color: var(--md-sys-color-on-surface);
|
48
|
-
box-sizing: border-box;
|
49
|
-
padding-top: 3px;
|
50
|
-
align-items: center;
|
51
|
-
}
|
52
|
-
|
53
|
-
#tab-header > div {
|
54
|
-
height: 25px;
|
55
|
-
}
|
56
|
-
|
57
|
-
#tab-header md-icon[disabled] {
|
58
|
-
opacity: 0.1;
|
59
|
-
}
|
60
|
-
|
61
|
-
#tabs {
|
62
|
-
display: flex;
|
63
|
-
overflow: hidden;
|
64
|
-
}
|
65
|
-
|
66
|
-
#tab-header #tabs [tab] md-icon {
|
67
|
-
margin-left: 5px;
|
68
|
-
padding: 2px;
|
69
|
-
color: var(--md-sys-color-on-surface);
|
70
|
-
|
71
|
-
--md-icon-size: 12px;
|
72
|
-
}
|
73
|
-
|
74
|
-
#add-series-button-container {
|
75
|
-
height: 100%;
|
76
|
-
box-sizing: border-box;
|
77
|
-
align-items: center;
|
78
|
-
justify-content: center;
|
79
|
-
padding-top: 3px;
|
80
|
-
display: flex;
|
81
|
-
border-bottom: rgba(0, 0, 0, 0.2) 1px solid;
|
82
|
-
}
|
83
|
-
|
84
|
-
#add-series-button {
|
85
|
-
width: 20px;
|
86
|
-
height: 20px;
|
87
|
-
padding: 0;
|
88
|
-
color: var(--md-sys-color-on-secondary-container);
|
89
|
-
}
|
90
|
-
|
91
|
-
.tab-content {
|
92
|
-
grid-column: 1 / -1;
|
93
|
-
|
94
|
-
background-color: rgba(255, 255, 255, 0.5);
|
95
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
96
|
-
border-width: 0 1px 1px 1px;
|
97
|
-
padding: 5px;
|
98
|
-
display: grid;
|
99
|
-
grid-template-columns: repeat(10, 1fr);
|
100
|
-
grid-gap: 5px;
|
101
|
-
}
|
102
|
-
|
103
|
-
.tab-content > * {
|
104
|
-
box-sizing: border-box;
|
105
|
-
grid-column: span 7;
|
106
|
-
}
|
107
|
-
|
108
|
-
label,
|
109
|
-
.tab-content > label {
|
110
|
-
grid-column: span 3;
|
111
|
-
text-align: right;
|
112
|
-
color: var(--md-sys-color-on-secondary-container);
|
113
|
-
font-size: 0.8em;
|
114
|
-
line-height: 2;
|
115
|
-
text-transform: capitalize;
|
116
|
-
}
|
117
|
-
|
118
|
-
input,
|
119
|
-
select {
|
120
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
121
|
-
border-radius: var(--spacing-small);
|
122
|
-
}
|
123
|
-
|
124
|
-
input[type='checkbox'],
|
125
|
-
.tab-content > input[type='checkbox'] {
|
126
|
-
grid-column: span 4;
|
127
|
-
justify-self: end;
|
128
|
-
align-self: center;
|
129
|
-
}
|
130
|
-
|
131
|
-
input[type='checkbox'] + label,
|
132
|
-
.tab-content > input[type='checkbox'] + label {
|
133
|
-
grid-column: span 6;
|
134
|
-
|
135
|
-
text-align: left;
|
136
|
-
}
|
137
|
-
|
138
|
-
[fullwidth] {
|
139
|
-
grid-column: 1 / -1;
|
140
|
-
margin: 0;
|
141
|
-
border: 0;
|
142
|
-
}
|
143
|
-
|
144
|
-
div[tab] {
|
145
|
-
display: flex;
|
146
|
-
align-items: center;
|
147
|
-
background-color: rgba(0, 0, 0, 0.2);
|
148
|
-
border-width: 1px 1px 0 1px;
|
149
|
-
padding: 0 5px;
|
150
|
-
color: var(--md-sys-color-on-surface);
|
151
|
-
box-sizing: border-box;
|
152
|
-
min-width: 45px;
|
153
|
-
}
|
154
|
-
|
155
|
-
div[tab][disabled] {
|
156
|
-
background-color: rgba(0, 0, 0, 0.1);
|
157
|
-
}
|
158
|
-
|
159
|
-
div[tab]:last-child {
|
160
|
-
border-width: 0;
|
161
|
-
}
|
162
|
-
|
163
|
-
div[tab][selected] {
|
164
|
-
background-color: var(--md-sys-color-surface);
|
165
|
-
color: var(--md-sys-color-on-surface);
|
166
|
-
}
|
167
|
-
`
|