@operato/scene-chartjs 2.0.0-beta.0 → 2.0.0-beta.7
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/editors/property-editor-chartjs-abstract.d.ts +3 -3
- package/dist/editors/property-editor-chartjs-abstract.js +0 -8
- package/dist/editors/property-editor-chartjs-abstract.js.map +1 -1
- package/dist/editors/property-editor-chartjs-hbar.d.ts +3 -4
- package/dist/editors/property-editor-chartjs-hbar.js +38 -42
- package/dist/editors/property-editor-chartjs-hbar.js.map +1 -1
- package/dist/editors/property-editor-chartjs-mixed.d.ts +1 -1
- package/dist/editors/property-editor-chartjs-multi-series-abstract.d.ts +6 -8
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js +90 -97
- package/dist/editors/property-editor-chartjs-multi-series-abstract.js.map +1 -1
- package/dist/editors/property-editor-chartjs-pie.d.ts +1 -1
- package/dist/editors/property-editor-chartjs-radar.d.ts +1 -1
- package/dist/editors/property-editor-chartjs-styles.js +35 -29
- package/dist/editors/property-editor-chartjs-styles.js.map +1 -1
- package/dist/editors/property-editor-chartjs.d.ts +1 -1
- package/dist/editors/property-editor-chartjs.js +3 -1
- package/dist/editors/property-editor-chartjs.js.map +1 -1
- package/dist/ox-chart.d.ts +1 -1
- package/package.json +2 -4
- package/schema.graphql +61 -42
- package/src/editors/property-editor-chartjs-abstract.ts +0 -12
- package/src/editors/property-editor-chartjs-hbar.ts +38 -44
- package/src/editors/property-editor-chartjs-multi-series-abstract.ts +111 -120
- package/src/editors/property-editor-chartjs-styles.ts +35 -29
- package/src/editors/property-editor-chartjs.ts +3 -1
- package/tsconfig.tsbuildinfo +1 -1
@@ -1,14 +1,11 @@
|
|
1
|
-
import '@material/web/
|
2
|
-
import '@polymer/iron-pages/iron-pages'
|
3
|
-
import '@polymer/paper-tabs/paper-tabs'
|
4
|
-
|
1
|
+
import '@material/web/icon/icon.js'
|
5
2
|
import '@operato/i18n/ox-i18n.js'
|
6
3
|
|
7
4
|
import { css, html } from 'lit'
|
8
5
|
import { query } from 'lit/decorators.js'
|
9
6
|
|
10
7
|
import { Properties } from '@hatiolab/things-scene'
|
11
|
-
import {
|
8
|
+
import { MdIcon } from '@material/web/icon/icon.js'
|
12
9
|
|
13
10
|
import PropertyEditorChartJSAbstract from './property-editor-chartjs-abstract'
|
14
11
|
|
@@ -16,7 +13,7 @@ export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEd
|
|
16
13
|
static styles = [
|
17
14
|
...PropertyEditorChartJSAbstract.styles,
|
18
15
|
css`
|
19
|
-
|
16
|
+
md-tabs {
|
20
17
|
background-color: rgb(204, 204, 204);
|
21
18
|
}
|
22
19
|
input[type='text'],
|
@@ -52,8 +49,8 @@ export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEd
|
|
52
49
|
}
|
53
50
|
|
54
51
|
@query('#tabs') tabs!: HTMLElement
|
55
|
-
@query('#tab-nav-left-button') tabNavLeftButton!:
|
56
|
-
@query('#tab-nav-right-button') tabNavRightButton!:
|
52
|
+
@query('#tab-nav-left-button') tabNavLeftButton!: MdIcon
|
53
|
+
@query('#tab-nav-right-button') tabNavRightButton!: MdIcon
|
57
54
|
|
58
55
|
get color() {
|
59
56
|
var oldVersionColor = this.series.backgroundColor
|
@@ -101,7 +98,7 @@ export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEd
|
|
101
98
|
}
|
102
99
|
|
103
100
|
get tabContainer(): HTMLElement | null | undefined {
|
104
|
-
return this.tabs
|
101
|
+
return this.tabs
|
105
102
|
}
|
106
103
|
|
107
104
|
firstUpdated() {
|
@@ -214,133 +211,127 @@ export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEd
|
|
214
211
|
return html`
|
215
212
|
<div id="series-properties-container" fullwidth>
|
216
213
|
<div id="tab-header">
|
217
|
-
<md-
|
214
|
+
<md-icon
|
218
215
|
id="tab-nav-left-button"
|
219
|
-
@
|
216
|
+
@tap=${(e: Event) => {
|
220
217
|
this._onTabScrollNavLeft(e)
|
221
218
|
}}
|
222
219
|
disabled
|
223
|
-
|
220
|
+
>chevron_left</md-icon
|
224
221
|
>
|
225
|
-
<
|
222
|
+
<div
|
226
223
|
id="tabs"
|
227
|
-
@
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
scrollable
|
232
|
-
hide-scroll-buttons
|
224
|
+
@change=${(e: Event) => {
|
225
|
+
this.currentSeriesIndex = (e.target as any).activeTabIndex
|
226
|
+
}}
|
227
|
+
active-tab-index=${this.currentSeriesIndex}
|
233
228
|
fit-container
|
234
229
|
>
|
235
230
|
${this.datasets.map(
|
236
231
|
(dataset: any, index: number) => html`
|
237
|
-
<
|
238
|
-
|
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}
|
239
243
|
${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)
|
240
|
-
? html`
|
241
|
-
<md-elevated-button @tap=${(e: Event) => this.onTapRemoveCurrentTab(e)}>
|
242
|
-
<md-icon>close</md-icon>
|
243
|
-
</md-elevated-button>
|
244
|
-
`
|
244
|
+
? html` <md-icon @tap="${(e: Event) => this.onTapRemoveCurrentTab(e)}"> close </md-icon> `
|
245
245
|
: html``}
|
246
|
-
</
|
246
|
+
</div>
|
247
247
|
`
|
248
248
|
)}
|
249
|
-
</
|
250
|
-
<md-
|
249
|
+
</div>
|
250
|
+
<md-icon
|
251
251
|
id="tab-nav-right-button"
|
252
252
|
@click=${(e: Event) => {
|
253
253
|
this._onTabScrollNavRight(e)
|
254
254
|
}}
|
255
255
|
disabled
|
256
|
-
|
256
|
+
>chevron_right</md-icon
|
257
257
|
>
|
258
258
|
</div>
|
259
259
|
<div id="add-series-button-container">
|
260
|
-
<md-
|
261
|
-
><md-icon>add</md-icon></md-elevated-button
|
262
|
-
>
|
260
|
+
<md-icon id="add-series-button" @tap=${(e: Event) => this.onTapAddTab(e)}>add</md-icon>
|
263
261
|
</div>
|
264
262
|
|
265
|
-
<
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
<
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
`
|
338
|
-
: html``}
|
339
|
-
${this.displayValueTemplate()}
|
340
|
-
</div>
|
341
|
-
`
|
342
|
-
)}
|
343
|
-
</iron-pages>
|
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>
|
344
335
|
</div>
|
345
336
|
`
|
346
337
|
}
|
@@ -351,21 +342,21 @@ export default class PropertyEditorChartJSMultiSeriesAbstract extends PropertyEd
|
|
351
342
|
}
|
352
343
|
|
353
344
|
if (this.tabContainer.clientWidth == this.tabContainer.scrollWidth) {
|
354
|
-
this.tabNavLeftButton.disabled
|
355
|
-
this.tabNavRightButton.disabled
|
345
|
+
this.tabNavLeftButton.setAttribute('disabled', '')
|
346
|
+
this.tabNavRightButton.setAttribute('disabled', '')
|
356
347
|
}
|
357
348
|
// left-end
|
358
349
|
else if (this.tabContainer.scrollLeft == 0) {
|
359
|
-
this.tabNavLeftButton.disabled
|
360
|
-
this.tabNavRightButton.disabled
|
350
|
+
this.tabNavLeftButton.setAttribute('disabled', '')
|
351
|
+
this.tabNavRightButton.removeAttribute('disabled')
|
361
352
|
}
|
362
353
|
// right-end
|
363
354
|
else if (this.tabContainer.scrollLeft + this.tabContainer.clientWidth >= this.tabContainer.scrollWidth) {
|
364
|
-
this.tabNavLeftButton.disabled
|
365
|
-
this.tabNavRightButton.disabled
|
355
|
+
this.tabNavLeftButton.removeAttribute('disabled')
|
356
|
+
this.tabNavRightButton.setAttribute('disabled', '')
|
366
357
|
} else {
|
367
|
-
this.tabNavLeftButton.disabled
|
368
|
-
this.tabNavRightButton.disabled
|
358
|
+
this.tabNavLeftButton.removeAttribute('disabled')
|
359
|
+
this.tabNavRightButton.removeAttribute('disabled')
|
369
360
|
}
|
370
361
|
}
|
371
362
|
|
@@ -5,9 +5,6 @@ export const PropertyEditorChartJSStyles = css`
|
|
5
5
|
display: grid;
|
6
6
|
grid-template-columns: repeat(10, 1fr);
|
7
7
|
grid-gap: 5px;
|
8
|
-
|
9
|
-
--mdc-icon-button-size: 24px;
|
10
|
-
--mdc-icon-size: 24px;
|
11
8
|
}
|
12
9
|
|
13
10
|
:host > * {
|
@@ -23,7 +20,7 @@ export const PropertyEditorChartJSStyles = css`
|
|
23
20
|
:host > legend {
|
24
21
|
box-sizing: border-box;
|
25
22
|
grid-column: 1 / -1;
|
26
|
-
color: var(--
|
23
|
+
color: var(--md-sys-color-on-secondary-container, #e46c2e);
|
27
24
|
font: var(--property-sidebar-fieldset-legend, bold 13px var(--theme-font));
|
28
25
|
text-transform: capitalize;
|
29
26
|
}
|
@@ -35,7 +32,7 @@ export const PropertyEditorChartJSStyles = css`
|
|
35
32
|
justify-content: center;
|
36
33
|
}
|
37
34
|
|
38
|
-
#series-properties-container >
|
35
|
+
#series-properties-container > [tab-content] {
|
39
36
|
grid-column: span 2;
|
40
37
|
}
|
41
38
|
|
@@ -46,23 +43,32 @@ export const PropertyEditorChartJSStyles = css`
|
|
46
43
|
overflow: hidden;
|
47
44
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
48
45
|
border-bottom: 0;
|
49
|
-
background-color:
|
46
|
+
background-color: var(--md-sys-color-surface-variant);
|
47
|
+
color: var(--md-sys-color-on-surface);
|
50
48
|
box-sizing: border-box;
|
51
49
|
padding-top: 3px;
|
52
50
|
align-items: center;
|
53
51
|
}
|
54
52
|
|
55
|
-
#tab-header >
|
53
|
+
#tab-header > div {
|
56
54
|
height: 25px;
|
57
55
|
}
|
58
56
|
|
59
|
-
#tab-header
|
57
|
+
#tab-header md-icon[disabled] {
|
58
|
+
opacity: 0.1;
|
59
|
+
}
|
60
|
+
|
61
|
+
#tabs {
|
60
62
|
display: flex;
|
63
|
+
overflow: hidden;
|
64
|
+
}
|
65
|
+
|
66
|
+
#tab-header #tabs [tab] md-icon {
|
61
67
|
margin-left: 5px;
|
62
68
|
padding: 2px;
|
63
|
-
color:
|
69
|
+
color: var(--md-sys-color-on-surface);
|
64
70
|
|
65
|
-
--
|
71
|
+
--md-icon-size: 12px;
|
66
72
|
}
|
67
73
|
|
68
74
|
#add-series-button-container {
|
@@ -79,10 +85,12 @@ export const PropertyEditorChartJSStyles = css`
|
|
79
85
|
width: 20px;
|
80
86
|
height: 20px;
|
81
87
|
padding: 0;
|
82
|
-
color: var(--
|
88
|
+
color: var(--md-sys-color-on-secondary-container);
|
83
89
|
}
|
84
90
|
|
85
91
|
.tab-content {
|
92
|
+
grid-column: 1 / -1;
|
93
|
+
|
86
94
|
background-color: rgba(255, 255, 255, 0.5);
|
87
95
|
border: 1px solid rgba(0, 0, 0, 0.2);
|
88
96
|
border-width: 0 1px 1px 1px;
|
@@ -101,12 +109,18 @@ export const PropertyEditorChartJSStyles = css`
|
|
101
109
|
.tab-content > label {
|
102
110
|
grid-column: span 3;
|
103
111
|
text-align: right;
|
104
|
-
color: var(--
|
112
|
+
color: var(--md-sys-color-on-secondary-container);
|
105
113
|
font-size: 0.8em;
|
106
114
|
line-height: 2;
|
107
115
|
text-transform: capitalize;
|
108
116
|
}
|
109
117
|
|
118
|
+
input,
|
119
|
+
select {
|
120
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
121
|
+
border-radius: var(--spacing-small);
|
122
|
+
}
|
123
|
+
|
110
124
|
input[type='checkbox'],
|
111
125
|
.tab-content > input[type='checkbox'] {
|
112
126
|
grid-column: span 4;
|
@@ -127,35 +141,27 @@ export const PropertyEditorChartJSStyles = css`
|
|
127
141
|
border: 0;
|
128
142
|
}
|
129
143
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
input[type='text'] {
|
134
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
135
|
-
}
|
136
|
-
|
137
|
-
paper-tab {
|
144
|
+
div[tab] {
|
145
|
+
display: flex;
|
146
|
+
align-items: center;
|
138
147
|
background-color: rgba(0, 0, 0, 0.2);
|
139
|
-
background-color: #ccc;
|
140
148
|
border-width: 1px 1px 0 1px;
|
141
149
|
padding: 0 5px;
|
142
|
-
color:
|
143
|
-
font-size: 13px;
|
150
|
+
color: var(--md-sys-color-on-surface);
|
144
151
|
box-sizing: border-box;
|
145
152
|
min-width: 45px;
|
146
153
|
}
|
147
154
|
|
148
|
-
|
155
|
+
div[tab][disabled] {
|
149
156
|
background-color: rgba(0, 0, 0, 0.1);
|
150
157
|
}
|
151
158
|
|
152
|
-
|
159
|
+
div[tab]:last-child {
|
153
160
|
border-width: 0;
|
154
161
|
}
|
155
162
|
|
156
|
-
|
157
|
-
background-color:
|
158
|
-
|
159
|
-
color: #585858;
|
163
|
+
div[tab][selected] {
|
164
|
+
background-color: var(--md-sys-color-surface);
|
165
|
+
color: var(--md-sys-color-on-surface);
|
160
166
|
}
|
161
167
|
`
|
@@ -17,6 +17,8 @@ export default class ChartJSEditor extends OxPropertyEditor {
|
|
17
17
|
:host {
|
18
18
|
display: block;
|
19
19
|
padding: 5px;
|
20
|
+
|
21
|
+
--md-elevated-button-container-height: 20px;
|
20
22
|
}
|
21
23
|
|
22
24
|
#chart-type {
|
@@ -31,7 +33,7 @@ export default class ChartJSEditor extends OxPropertyEditor {
|
|
31
33
|
|
32
34
|
text-align: right;
|
33
35
|
|
34
|
-
color: var(--
|
36
|
+
color: var(--md-sys-color-on-secondary-container);
|
35
37
|
font-size: 0.8em;
|
36
38
|
line-height: 2;
|
37
39
|
text-transform: capitalize;
|