@operato/scene-chartjs 7.0.0 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -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 +6 -4
- 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,157 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js'
|
2
|
-
import '@material/web/button/elevated-button.js'
|
3
|
-
import '@material/web/tabs/tabs.js'
|
4
|
-
|
5
|
-
import '@operato/i18n/ox-i18n.js'
|
6
|
-
|
7
|
-
import { html } from 'lit'
|
8
|
-
import { customElement } from 'lit/decorators.js'
|
9
|
-
|
10
|
-
import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract'
|
11
|
-
|
12
|
-
@customElement('property-editor-chartjs-hbar')
|
13
|
-
export default class PropertyEditorChartJSHBar extends PropertyEditorChartJSMultiSeriesAbstract {
|
14
|
-
static styles = [...PropertyEditorChartJSMultiSeriesAbstract.styles]
|
15
|
-
|
16
|
-
editorTemplate() {
|
17
|
-
return html`
|
18
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
19
|
-
${this.multiSeriesTabTemplate()}
|
20
|
-
|
21
|
-
<legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
|
22
|
-
|
23
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
24
|
-
<input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
|
25
|
-
|
26
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
27
|
-
<input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
|
28
|
-
|
29
|
-
<label><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
|
30
|
-
<input
|
31
|
-
type="number"
|
32
|
-
min="0"
|
33
|
-
max="1"
|
34
|
-
step="0.1"
|
35
|
-
value-key="yAxes0.barSpacing"
|
36
|
-
.value=${this.yAxes0.barSpacing || NaN}
|
37
|
-
/>
|
38
|
-
<label><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
|
39
|
-
<input
|
40
|
-
type="number"
|
41
|
-
min="0"
|
42
|
-
max="1"
|
43
|
-
step="0.1"
|
44
|
-
value-key="yAxes0.categorySpacing"
|
45
|
-
.value=${this.yAxes0.categorySpacing || NaN}
|
46
|
-
/>
|
47
|
-
|
48
|
-
<input type="checkbox" value-key="value.options.xGridLine" .checked=${this.value.options.xGridLine} />
|
49
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
50
|
-
|
51
|
-
<input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
|
52
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
53
|
-
|
54
|
-
<legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
|
55
|
-
|
56
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
57
|
-
<input type="text" value-key="xAxes0.title" .value=${this.xAxes0.axisTitle || ''} />
|
58
|
-
|
59
|
-
<input type="checkbox" value-key="xAxes0.ticks.autoMin" .checked=${this.xAxes0.ticks.autoMin} />
|
60
|
-
<label> <ox-i18n msgid="label.axis-min-auto">Axis Min Auto</ox-i18n> </label>
|
61
|
-
|
62
|
-
<input type="checkbox" value-key="xAxes0.ticks.autoMax" .checked=${this.xAxes0.ticks.autoMax} />
|
63
|
-
<label> <ox-i18n msgid="label.axis-max-auto">Axis Max Auto</ox-i18n> </label>
|
64
|
-
|
65
|
-
${!this.xAxes0.ticks.autoMin
|
66
|
-
? html`
|
67
|
-
<label> <ox-i18n msgid="label.axis-min">Axis Min</ox-i18n> </label>
|
68
|
-
<input type="number" value-key="xAxes0.ticks.min" .value=${this.xAxes0.ticks.min} />
|
69
|
-
`
|
70
|
-
: html``}
|
71
|
-
${!this.xAxes0.ticks.autoMax
|
72
|
-
? html`
|
73
|
-
<label> <ox-i18n msgid="label.axis-max">Axis Max</ox-i18n> </label>
|
74
|
-
<input type="number" value-key="xAxes0.ticks.max" .value=${this.xAxes0.ticks.max} />
|
75
|
-
`
|
76
|
-
: html``}
|
77
|
-
|
78
|
-
<label> <ox-i18n msgid="label.axis-step-size">Axis Step Size</ox-i18n> </label>
|
79
|
-
<input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
|
80
|
-
|
81
|
-
<input type="checkbox" .checked=${this.value.options.yGridLine} />
|
82
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
83
|
-
|
84
|
-
<input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
|
85
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
86
|
-
`
|
87
|
-
}
|
88
|
-
|
89
|
-
multiSeriesTabTemplate() {
|
90
|
-
return html`
|
91
|
-
<div id="series-properties-container" fullwidth>
|
92
|
-
<div id="tab-header">
|
93
|
-
<md-icon
|
94
|
-
id="tab-nav-left-button"
|
95
|
-
@tap=${(e: Event) => {
|
96
|
-
this._onTabScrollNavLeft(e)
|
97
|
-
}}
|
98
|
-
disabled
|
99
|
-
>chevron_left</md-icon
|
100
|
-
>
|
101
|
-
<div
|
102
|
-
id="tabs"
|
103
|
-
@change=${(e: Event) => {
|
104
|
-
this.currentSeriesIndex = (e.target as any).activeTabIndex
|
105
|
-
}}
|
106
|
-
active-tab-index=${this.currentSeriesIndex}
|
107
|
-
fit-container
|
108
|
-
>
|
109
|
-
${this.datasets.map(
|
110
|
-
(dataset: any, index: number) => html`
|
111
|
-
<div
|
112
|
-
data-series=${index + 1}
|
113
|
-
data-tab-index=${index}
|
114
|
-
tab
|
115
|
-
?selected=${index == this.currentSeriesIndex}
|
116
|
-
@click=${(e: Event) => {
|
117
|
-
const target = e.target as HTMLDivElement
|
118
|
-
this.currentSeriesIndex = Number(target.getAttribute('data-tab-index'))
|
119
|
-
}}
|
120
|
-
>
|
121
|
-
${index + 1}
|
122
|
-
${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)
|
123
|
-
? html` <md-icon @tap="${(e: Event) => this.onTapRemoveCurrentTab(e)}"> close </md-icon> `
|
124
|
-
: html``}
|
125
|
-
</div>
|
126
|
-
`
|
127
|
-
)}
|
128
|
-
</div>
|
129
|
-
<md-icon
|
130
|
-
id="tab-nav-right-button"
|
131
|
-
@click=${(e: Event) => {
|
132
|
-
this._onTabScrollNavRight(e)
|
133
|
-
}}
|
134
|
-
disabled
|
135
|
-
>chevron_right</md-icon
|
136
|
-
>
|
137
|
-
</div>
|
138
|
-
<div id="add-series-button-container">
|
139
|
-
<md-icon id="add-series-button" @tap=${(e: Event) => this.onTapAddTab(e)}>add</md-icon>
|
140
|
-
</div>
|
141
|
-
|
142
|
-
<div class="tab-content">
|
143
|
-
<label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
144
|
-
<input type="text" value-key="dataKey" .value=${this.dataKey} />
|
145
|
-
<label> <ox-i18n msgid="label.label">Label</ox-i18n> </label>
|
146
|
-
<input type="text" value-key="series.label" .value=${this.series.label} />
|
147
|
-
<label> <ox-i18n msgid="label.color">Color</ox-i18n> </label>
|
148
|
-
<ox-input-color value-key="color" .value=${this.color}></ox-input-color>
|
149
|
-
<label> <ox-i18n msgid="label.stack-group">Stack Group</ox-i18n> </label>
|
150
|
-
<input type="text" value-key="series.stack" .value=${this.series.stack || ''} />
|
151
|
-
|
152
|
-
${this.displayValueTemplate()}
|
153
|
-
</div>
|
154
|
-
</div>
|
155
|
-
`
|
156
|
-
}
|
157
|
-
}
|
@@ -1,199 +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-mixed')
|
11
|
-
export default class PropertyEditorChartJSMixed extends PropertyEditorChartJSMultiSeriesAbstract {
|
12
|
-
static styles = PropertyEditorChartJSMultiSeriesAbstract.styles
|
13
|
-
|
14
|
-
constructor() {
|
15
|
-
super()
|
16
|
-
|
17
|
-
this.value = {
|
18
|
-
options: {
|
19
|
-
legend: {},
|
20
|
-
scales: {
|
21
|
-
xAxes: [
|
22
|
-
{
|
23
|
-
ticks: {}
|
24
|
-
}
|
25
|
-
],
|
26
|
-
yAxes: [
|
27
|
-
{
|
28
|
-
ticks: {}
|
29
|
-
}
|
30
|
-
]
|
31
|
-
}
|
32
|
-
},
|
33
|
-
data: {
|
34
|
-
datasets: []
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
38
|
-
|
39
|
-
get xAxes0() {
|
40
|
-
return this.scales.xAxes[0]
|
41
|
-
}
|
42
|
-
|
43
|
-
set xAxes0(xAxes0) {
|
44
|
-
this.scales.xAxes[0] = xAxes0
|
45
|
-
}
|
46
|
-
|
47
|
-
get yAxes0() {
|
48
|
-
return this.scales.yAxes[0]
|
49
|
-
}
|
50
|
-
|
51
|
-
set yAxes0(yAxes0) {
|
52
|
-
this.scales.yAxes[0] = yAxes0
|
53
|
-
}
|
54
|
-
|
55
|
-
get yAxes1() {
|
56
|
-
return this.scales.yAxes[1]
|
57
|
-
}
|
58
|
-
|
59
|
-
set yAxes1(yAxes1) {
|
60
|
-
this.scales.yAxes[1] = yAxes1
|
61
|
-
}
|
62
|
-
|
63
|
-
get multiAxis() {
|
64
|
-
return this.value.options.multiAxis
|
65
|
-
}
|
66
|
-
|
67
|
-
set multiAxis(multiAxis) {
|
68
|
-
this.value.options.multiAxis = multiAxis
|
69
|
-
}
|
70
|
-
|
71
|
-
editorTemplate(props: Properties) {
|
72
|
-
return html`
|
73
|
-
<input type="checkbox" value-key="multiAxis" .checked=${this.multiAxis} />
|
74
|
-
<label> <ox-i18n msgid="label.multi-axis">Multi Axis</ox-i18n> </label>
|
75
|
-
|
76
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
77
|
-
|
78
|
-
<div fullwidth>${this.multiSeriesTabTemplate()}</div>
|
79
|
-
|
80
|
-
<legend><ox-i18n msgid="label.x-axes">X 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
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
86
|
-
<input type="text" value-key="xAxes0.axisTitle" .value=${this.xAxes0.axisTitle || ''} />
|
87
|
-
|
88
|
-
${this._hasBarSeries(this.value)
|
89
|
-
? html`
|
90
|
-
<label><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
|
91
|
-
<input
|
92
|
-
type="number"
|
93
|
-
min="0"
|
94
|
-
max="1"
|
95
|
-
step="0.1"
|
96
|
-
value-key="xAxes0.barSpacing"
|
97
|
-
.value=${this.xAxes0.barSpacing || NaN}
|
98
|
-
/>
|
99
|
-
<label><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
|
100
|
-
<input
|
101
|
-
type="number"
|
102
|
-
min="0"
|
103
|
-
max="1"
|
104
|
-
step="0.1"
|
105
|
-
value-key="xAxes0.categorySpacing"
|
106
|
-
.value=${this.xAxes0.categorySpacing || NaN}
|
107
|
-
/>
|
108
|
-
`
|
109
|
-
: html``}
|
110
|
-
|
111
|
-
<input type="checkbox" value-key="value.options.xGridLine" .checked=${props.value.options.xGridLine} />
|
112
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
113
|
-
|
114
|
-
<input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
|
115
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
116
|
-
|
117
|
-
<legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
|
118
|
-
|
119
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
120
|
-
<input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
|
121
|
-
|
122
|
-
<input type="checkbox" value-key="yAxes0.ticks.autoMin" .checked=${this.yAxes0.ticks.autoMin} />
|
123
|
-
<label> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
124
|
-
|
125
|
-
<input type="checkbox" value-key="yAxes0.ticks.autoMax" .checked=${this.yAxes0.ticks.autoMax} />
|
126
|
-
<label> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
127
|
-
|
128
|
-
${!this.yAxes0.ticks.autoMin
|
129
|
-
? html`
|
130
|
-
<label> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
131
|
-
<input type="number" value-key="yAxes0.ticks.min" .value=${this.yAxes0.ticks.min} />
|
132
|
-
`
|
133
|
-
: html``}
|
134
|
-
${!this.yAxes0.ticks.autoMax
|
135
|
-
? html`
|
136
|
-
<label> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
137
|
-
<input type="number" value-key="yAxes0.ticks.max" .value=${this.yAxes0.ticks.max} />
|
138
|
-
`
|
139
|
-
: html``}
|
140
|
-
|
141
|
-
<label> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
142
|
-
<input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
|
143
|
-
|
144
|
-
<input type="checkbox" value-key="value.options.yGridLine" .checked=${props.value.options.yGridLine} />
|
145
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
146
|
-
|
147
|
-
<input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
|
148
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
149
|
-
|
150
|
-
${props.value.options.multiAxis
|
151
|
-
? html`
|
152
|
-
<legend><ox-i18n msgid="label.y-2nd-axes">Y 2nd Axes</ox-i18n></legend>
|
153
|
-
|
154
|
-
<label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
155
|
-
<input type="text" value-key="yAxes1.axisTitle" .value=${this.yAxes1.axisTitle || ''} />
|
156
|
-
|
157
|
-
<input type="checkbox" value-key="yAxes1.ticks.autoMin" .checked=${this.yAxes1.ticks.autoMin} />
|
158
|
-
<label> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
159
|
-
|
160
|
-
<input type="checkbox" value-key="yAxes1.ticks.autoMax" .checked=${this.yAxes1.ticks.autoMax} />
|
161
|
-
<label> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
162
|
-
|
163
|
-
${!this.yAxes1.ticks.autoMin
|
164
|
-
? html`
|
165
|
-
<label> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
166
|
-
<input type="number" value-key="yAxes1.ticks.min" .value=${this.yAxes1.ticks.min} />
|
167
|
-
`
|
168
|
-
: html``}
|
169
|
-
${!this.yAxes1.ticks.autoMax
|
170
|
-
? html`
|
171
|
-
<label> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
172
|
-
<input type="number" value-key="yAxes1.ticks.max" .value=${this.yAxes1.ticks.max} />
|
173
|
-
`
|
174
|
-
: html``}
|
175
|
-
|
176
|
-
<label> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
177
|
-
<input type="number" value-key="yAxes1.ticks.stepSize" .value=${this.yAxes1.ticks.stepSize} />
|
178
|
-
|
179
|
-
<input
|
180
|
-
type="checkbox"
|
181
|
-
value-key="value.options.y2ndGridLine"
|
182
|
-
.checked=${props.value.options.y2ndGridLine}
|
183
|
-
/>
|
184
|
-
<label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
185
|
-
|
186
|
-
<input type="checkbox" value-key="yAxes1.ticks.display" .checked=${this.yAxes1.ticks.display} />
|
187
|
-
<label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
188
|
-
`
|
189
|
-
: html``}
|
190
|
-
`
|
191
|
-
}
|
192
|
-
|
193
|
-
_hasBarSeries(chart: any) {
|
194
|
-
var hasBarSeries = false
|
195
|
-
hasBarSeries = chart.data.datasets.some((s: any) => s.type == 'bar')
|
196
|
-
|
197
|
-
return hasBarSeries
|
198
|
-
}
|
199
|
-
}
|