@operato/scene-chartjs 7.0.1 → 7.0.6

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/config-converter.js +2 -5
  3. package/dist/config-converter.js.map +1 -1
  4. package/dist/editors/index.d.ts +1 -1
  5. package/dist/editors/index.js +2 -2
  6. package/dist/editors/index.js.map +1 -1
  7. package/dist/ox-chart.js +1 -1
  8. package/dist/ox-chart.js.map +1 -1
  9. package/package.json +4 -2
  10. package/src/config-converter.ts +2 -6
  11. package/src/editors/index.ts +2 -2
  12. package/src/ox-chart.ts +1 -1
  13. package/translations/en.json +2 -1
  14. package/translations/ja.json +2 -1
  15. package/translations/ko.json +2 -1
  16. package/translations/ms.json +2 -1
  17. package/translations/zh.json +2 -1
  18. package/tsconfig.tsbuildinfo +1 -1
  19. package/dist/editors/property-editor-chartjs-abstract.d.ts +0 -50
  20. package/dist/editors/property-editor-chartjs-abstract.js +0 -273
  21. package/dist/editors/property-editor-chartjs-abstract.js.map +0 -1
  22. package/dist/editors/property-editor-chartjs-hbar.d.ts +0 -10
  23. package/dist/editors/property-editor-chartjs-hbar.js +0 -154
  24. package/dist/editors/property-editor-chartjs-hbar.js.map +0 -1
  25. package/dist/editors/property-editor-chartjs-mixed.d.ts +0 -17
  26. package/dist/editors/property-editor-chartjs-mixed.js +0 -186
  27. package/dist/editors/property-editor-chartjs-mixed.js.map +0 -1
  28. package/dist/editors/property-editor-chartjs-multi-series-abstract.d.ts +0 -29
  29. package/dist/editors/property-editor-chartjs-multi-series-abstract.js +0 -363
  30. package/dist/editors/property-editor-chartjs-multi-series-abstract.js.map +0 -1
  31. package/dist/editors/property-editor-chartjs-pie.d.ts +0 -18
  32. package/dist/editors/property-editor-chartjs-pie.js +0 -74
  33. package/dist/editors/property-editor-chartjs-pie.js.map +0 -1
  34. package/dist/editors/property-editor-chartjs-radar.d.ts +0 -8
  35. package/dist/editors/property-editor-chartjs-radar.js +0 -36
  36. package/dist/editors/property-editor-chartjs-radar.js.map +0 -1
  37. package/dist/editors/property-editor-chartjs-styles.d.ts +0 -1
  38. package/dist/editors/property-editor-chartjs-styles.js +0 -167
  39. package/dist/editors/property-editor-chartjs-styles.js.map +0 -1
  40. package/dist/editors/property-editor-chartjs.d.ts +0 -10
  41. package/dist/editors/property-editor-chartjs.js +0 -79
  42. package/dist/editors/property-editor-chartjs.js.map +0 -1
  43. package/src/editors/property-editor-chartjs-abstract.ts +0 -324
  44. package/src/editors/property-editor-chartjs-hbar.ts +0 -157
  45. package/src/editors/property-editor-chartjs-mixed.ts +0 -199
  46. package/src/editors/property-editor-chartjs-multi-series-abstract.ts +0 -382
  47. package/src/editors/property-editor-chartjs-pie.ts +0 -86
  48. package/src/editors/property-editor-chartjs-radar.ts +0 -39
  49. package/src/editors/property-editor-chartjs-styles.ts +0 -167
  50. package/src/editors/property-editor-chartjs.ts +0 -79
@@ -1,273 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import '@operato/i18n/ox-i18n.js';
3
- import { html, LitElement } from 'lit';
4
- import { property } from 'lit/decorators.js';
5
- import { random as randomColor, TinyColor } from '@ctrl/tinycolor';
6
- import { PropertyEditorChartJSStyles } from './property-editor-chartjs-styles';
7
- class PropertyEditorChartJSAbstract extends LitElement {
8
- constructor() {
9
- super(...arguments);
10
- this.value = {};
11
- this.currentSeriesIndex = 0;
12
- }
13
- render() {
14
- return html `
15
- <legend><ox-i18n msgid="label.chart">Chart</ox-i18n></legend>
16
-
17
- <label> <ox-i18n msgid="label.theme">theme</ox-i18n> </label>
18
- <select value-key="theme" class="select-content" .value=${this.theme}>
19
- <option value="dark">dark</option>
20
- <option value="light">light</option>
21
- </select>
22
-
23
- <input type="checkbox" value-key="tooltip" .checked=${this.tooltip} />
24
- <label> <ox-i18n msgid="label.tooltip">Tooltip</ox-i18n> </label>
25
-
26
- <input type="checkbox" value-key="animation" .checked=${this.animation} />
27
- <label> <ox-i18n msgid="label.animation">Animation</ox-i18n> </label>
28
-
29
- <input type="checkbox" value-key="display" .checked=${this.display} />
30
- <label> <ox-i18n msgid="label.legend">Legend</ox-i18n> </label>
31
-
32
- <input type="checkbox" value-key="stacked" .checked=${this.stacked} />
33
- <label> <ox-i18n msgid="label.stacked">Stacked</ox-i18n> </label>
34
-
35
- ${this.display
36
- ? html `
37
- <label> <ox-i18n msgid="label.position">Position</ox-i18n> </label>
38
- <select value-key="position" class="select-content" .value=${this.position}>
39
- <option value="top">top</option>
40
- <option value="right">right</option>
41
- <option value="bottom">bottom</option>
42
- <option value="left">left</option>
43
- </select>
44
- `
45
- : html ``}
46
- ${this.editorTemplate(this)}
47
- `;
48
- }
49
- firstUpdated() {
50
- this.renderRoot.addEventListener('change', this.onValuesChanged.bind(this));
51
- }
52
- displayValueTemplate() {
53
- return html `
54
- <label for="value-format"> <ox-i18n msgid="label.value-format">Value Format</ox-i18n> </label>
55
- <input type="text" value-key="series.valueFormat" .value=${this.series.valueFormat || ''} list="format-list" />
56
- <datalist id="format-list">
57
- <option value="#,###."></option>
58
- <option value="#,###.#"></option>
59
- <option value="#,###.0"></option>
60
- <option value="#,##0.#"></option>
61
- <option value="#,##0.0"></option>
62
- <option value="#,##0.0%"></option>
63
- </datalist>
64
-
65
- <label> <ox-i18n msgid="label.value-prefix">Value Prefix</ox-i18n> </label>
66
- <input type="text" value-key="series.valuePrefix" .value=${this.series.valuePrefix || ''} />
67
-
68
- <label> <ox-i18n msgid="label.value-suffix">Value suffix</ox-i18n> </label>
69
- <input type="text" value-key="series.valueSuffix" .value=${this.series.valueSuffix || ''} />
70
-
71
- <input type="checkbox" value-key="series.displayValue" .checked=${this.series.displayValue || false} />
72
- <label> <ox-i18n msgid="label.value-display">Value Display</ox-i18n> </label>
73
-
74
- ${this.series.displayValue
75
- ? html `
76
- <label> <ox-i18n msgid="label.font-color">Font Color</ox-i18n> </label>
77
- <ox-input-color
78
- value-key="series.defaultFontColor"
79
- .value=${this.series.defaultFontColor || '#000'}
80
- ></ox-input-color>
81
- <label> <ox-i18n msgid="label.font-size">Font Size</ox-i18n> </label>
82
- <input type="number" value-key="series.defaultFontSize" .value=${this.series.defaultFontSize || 10} />
83
- <label> <ox-i18n msgid="label.position">Position</ox-i18n> </label>
84
- <select value-key="series.dataLabelAnchor" .value=${this.series.dataLabelAnchor || 'center'}>
85
- <option value="start">Start</option>
86
- <option value="center" selected>Center</option>
87
- <option value="end">End</option>
88
- </select>
89
- `
90
- : html ``}
91
- `;
92
- }
93
- editorTemplate(props) {
94
- return html ``;
95
- }
96
- get data() {
97
- return this.value.data;
98
- }
99
- set data(data) {
100
- this.value.data = data;
101
- }
102
- get datasets() {
103
- if (!this.data.datasets)
104
- this.data.datasets = [];
105
- return this.data.datasets;
106
- }
107
- set datasets(datasets) {
108
- this.datasets = datasets;
109
- }
110
- get series() {
111
- if (!this.datasets[this.currentSeriesIndex])
112
- this.datasets[this.currentSeriesIndex] = {};
113
- return this.datasets[this.currentSeriesIndex];
114
- }
115
- set series(series) {
116
- !this.data ? (this.data = { dataset: [series] }) : (this.datasets[this.currentSeriesIndex] = series);
117
- }
118
- set dataKey(key) {
119
- this.series.dataKey = key;
120
- }
121
- get dataKey() {
122
- return this.series.dataKey;
123
- }
124
- get legend() {
125
- !this.value.options && (this.value.options = {});
126
- return this.value.options.legend;
127
- }
128
- set legend(legend) {
129
- this.value.options.legend = legend;
130
- }
131
- get theme() {
132
- return this.value.options && this.value.options.theme;
133
- }
134
- set theme(theme) {
135
- !this.value.options && (this.value.options = {});
136
- this.value.options.theme = theme;
137
- }
138
- get tooltip() {
139
- return !this.value.options || this.value.options.tooltip !== false; /* default true */
140
- }
141
- set tooltip(tooltip) {
142
- this.value.options.tooltip = tooltip;
143
- }
144
- get animation() {
145
- return !this.value.options || this.value.options.animation !== false; /* default true */
146
- }
147
- set animation(animation) {
148
- this.value.options.animation = animation;
149
- }
150
- get scales() {
151
- return this.value.options.scales;
152
- }
153
- set scales(scales) {
154
- !this.value.options && (this.value.options = {});
155
- this.value.options.scales = scales;
156
- }
157
- get display() {
158
- return this.legend && this.legend.display;
159
- }
160
- set display(display) {
161
- this.legend.display = display;
162
- }
163
- get position() {
164
- return this.legend.position;
165
- }
166
- set position(position) {
167
- this.legend.position = position;
168
- }
169
- get stacked() {
170
- return this.value.options.stacked;
171
- }
172
- set stacked(stacked) {
173
- this.value.options.stacked = stacked;
174
- }
175
- get labelDataKey() {
176
- return this.data && this.data.labelDataKey;
177
- }
178
- set labelDataKey(labelDataKey) {
179
- this.data.labelDataKey = labelDataKey;
180
- }
181
- set options(options) {
182
- this.value.options = options;
183
- }
184
- get options() {
185
- return this.value.options;
186
- }
187
- onValuesChanged(e) {
188
- var element = e.target;
189
- var key = element.getAttribute('value-key');
190
- var value = element.value;
191
- if (!key) {
192
- return;
193
- }
194
- value = this._getElementValue(element);
195
- var attrs = key.split('.');
196
- var attr = attrs.shift() || '';
197
- var variable = this;
198
- while (attrs.length > 0) {
199
- //@ts-ignore
200
- variable = variable[attr];
201
- attr = attrs.shift() || '';
202
- }
203
- //@ts-ignore
204
- variable[attr] = value;
205
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
206
- this.requestUpdate();
207
- }
208
- onTapAddTab(e) {
209
- if (!this.value.data.datasets)
210
- return;
211
- var lastSeriesIndex = this.value.data.datasets.length;
212
- var chartType = this.series.type || this.value.type;
213
- var lastSeriesColor = new TinyColor(this.datasets[lastSeriesIndex - 1].backgroundColor);
214
- var seriesModel = this._getSeriesModel({
215
- chartType,
216
- datasetsLength: lastSeriesIndex,
217
- lastSeriesColor
218
- });
219
- this.value.data.datasets.push(seriesModel);
220
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
221
- this.currentSeriesIndex = lastSeriesIndex;
222
- }
223
- onTapRemoveCurrentTab(e) {
224
- if (!this.value.data.datasets)
225
- return;
226
- var currIndex = this.currentSeriesIndex;
227
- this.value.data.datasets.splice(currIndex, 1);
228
- currIndex--;
229
- if (currIndex < 0)
230
- currIndex = 0;
231
- this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
232
- this.currentSeriesIndex = currIndex;
233
- this.requestUpdate();
234
- }
235
- _getSeriesModel({ chartType, datasetsLength, lastSeriesColor }) {
236
- var addSeriesOption = {
237
- label: `series ${datasetsLength + 1}`,
238
- data: [],
239
- borderWidth: 1,
240
- dataKey: '',
241
- yAxisID: 'left',
242
- color: randomColor({
243
- hue: lastSeriesColor
244
- }).toRgbString()
245
- };
246
- addSeriesOption.type = addSeriesOption.chartType = chartType;
247
- return addSeriesOption;
248
- }
249
- _getElementValue(element) {
250
- switch (element.tagName) {
251
- case 'INPUT':
252
- switch (element.type) {
253
- case 'checkbox':
254
- return element.checked;
255
- case 'number':
256
- return Number(element.value) || 0;
257
- case 'text':
258
- return String(element.value);
259
- }
260
- default:
261
- return element.value;
262
- }
263
- }
264
- }
265
- PropertyEditorChartJSAbstract.styles = [PropertyEditorChartJSStyles];
266
- export default PropertyEditorChartJSAbstract;
267
- __decorate([
268
- property({ type: Object })
269
- ], PropertyEditorChartJSAbstract.prototype, "value", void 0);
270
- __decorate([
271
- property({ type: Number })
272
- ], PropertyEditorChartJSAbstract.prototype, "currentSeriesIndex", void 0);
273
- //# sourceMappingURL=property-editor-chartjs-abstract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property-editor-chartjs-abstract.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-abstract.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAE9E,MAAqB,6BAA8B,SAAQ,UAAU;I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AG,eAAe,CAAC,SAAS,GAAG,SAAS,CAAA;QAC5D,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,gBAAgB,CAAC,OAAoB;QACnC,QAAQ,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,KAAK,OAAO;gBACV,QAAS,OAA4B,CAAC,IAAI,EAAE,CAAC;oBAC3C,KAAK,UAAU;wBACb,OAAQ,OAA4B,CAAC,OAAO,CAAA;oBAC9C,KAAK,QAAQ;wBACX,OAAO,MAAM,CAAE,OAA4B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;oBACzD,KAAK,MAAM;wBACT,OAAO,MAAM,CAAE,OAA4B,CAAC,KAAK,CAAC,CAAA;gBACtD,CAAC;YAEH;gBACE,OAAQ,OAAe,CAAC,KAAK,CAAA;QACjC,CAAC;IACH,CAAC;;AAvTM,oCAAM,GAAG,CAAC,2BAA2B,CAAC,AAAhC,CAAgC;eAD1B,6BAA6B;AAGpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yEAA+B","sourcesContent":["import '@operato/i18n/ox-i18n.js'\n\nimport { html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { random as randomColor, TinyColor } from '@ctrl/tinycolor'\nimport { Properties } from '@hatiolab/things-scene'\n\nimport { PropertyEditorChartJSStyles } from './property-editor-chartjs-styles'\n\nexport default class PropertyEditorChartJSAbstract extends LitElement {\n static styles = [PropertyEditorChartJSStyles]\n\n @property({ type: Object }) value: any = {}\n @property({ type: Number }) currentSeriesIndex: number = 0\n\n render() {\n return html`\n <legend><ox-i18n msgid=\"label.chart\">Chart</ox-i18n></legend>\n\n <label> <ox-i18n msgid=\"label.theme\">theme</ox-i18n> </label>\n <select value-key=\"theme\" class=\"select-content\" .value=${this.theme}>\n <option value=\"dark\">dark</option>\n <option value=\"light\">light</option>\n </select>\n\n <input type=\"checkbox\" value-key=\"tooltip\" .checked=${this.tooltip} />\n <label> <ox-i18n msgid=\"label.tooltip\">Tooltip</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"animation\" .checked=${this.animation} />\n <label> <ox-i18n msgid=\"label.animation\">Animation</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"display\" .checked=${this.display} />\n <label> <ox-i18n msgid=\"label.legend\">Legend</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"stacked\" .checked=${this.stacked} />\n <label> <ox-i18n msgid=\"label.stacked\">Stacked</ox-i18n> </label>\n\n ${this.display\n ? html`\n <label> <ox-i18n msgid=\"label.position\">Position</ox-i18n> </label>\n <select value-key=\"position\" class=\"select-content\" .value=${this.position}>\n <option value=\"top\">top</option>\n <option value=\"right\">right</option>\n <option value=\"bottom\">bottom</option>\n <option value=\"left\">left</option>\n </select>\n `\n : html``}\n ${this.editorTemplate(this)}\n `\n }\n\n firstUpdated() {\n this.renderRoot.addEventListener('change', this.onValuesChanged.bind(this))\n }\n\n displayValueTemplate() {\n return html`\n <label for=\"value-format\"> <ox-i18n msgid=\"label.value-format\">Value Format</ox-i18n> </label>\n <input type=\"text\" value-key=\"series.valueFormat\" .value=${this.series.valueFormat || ''} list=\"format-list\" />\n <datalist id=\"format-list\">\n <option value=\"#,###.\"></option>\n <option value=\"#,###.#\"></option>\n <option value=\"#,###.0\"></option>\n <option value=\"#,##0.#\"></option>\n <option value=\"#,##0.0\"></option>\n <option value=\"#,##0.0%\"></option>\n </datalist>\n\n <label> <ox-i18n msgid=\"label.value-prefix\">Value Prefix</ox-i18n> </label>\n <input type=\"text\" value-key=\"series.valuePrefix\" .value=${this.series.valuePrefix || ''} />\n\n <label> <ox-i18n msgid=\"label.value-suffix\">Value suffix</ox-i18n> </label>\n <input type=\"text\" value-key=\"series.valueSuffix\" .value=${this.series.valueSuffix || ''} />\n\n <input type=\"checkbox\" value-key=\"series.displayValue\" .checked=${this.series.displayValue || false} />\n <label> <ox-i18n msgid=\"label.value-display\">Value Display</ox-i18n> </label>\n\n ${this.series.displayValue\n ? html`\n <label> <ox-i18n msgid=\"label.font-color\">Font Color</ox-i18n> </label>\n <ox-input-color\n value-key=\"series.defaultFontColor\"\n .value=${this.series.defaultFontColor || '#000'}\n ></ox-input-color>\n <label> <ox-i18n msgid=\"label.font-size\">Font Size</ox-i18n> </label>\n <input type=\"number\" value-key=\"series.defaultFontSize\" .value=${this.series.defaultFontSize || 10} />\n <label> <ox-i18n msgid=\"label.position\">Position</ox-i18n> </label>\n <select value-key=\"series.dataLabelAnchor\" .value=${this.series.dataLabelAnchor || 'center'}>\n <option value=\"start\">Start</option>\n <option value=\"center\" selected>Center</option>\n <option value=\"end\">End</option>\n </select>\n `\n : html``}\n `\n }\n\n editorTemplate(props: Properties) {\n return html``\n }\n\n get data() {\n return this.value.data\n }\n\n set data(data) {\n this.value.data = data\n }\n\n get datasets() {\n if (!this.data.datasets) this.data.datasets = []\n\n return this.data.datasets\n }\n\n set datasets(datasets) {\n this.datasets = datasets\n }\n\n get series() {\n if (!this.datasets[this.currentSeriesIndex]) this.datasets[this.currentSeriesIndex] = {}\n return this.datasets[this.currentSeriesIndex]\n }\n\n set series(series) {\n !this.data ? (this.data = { dataset: [series] }) : (this.datasets[this.currentSeriesIndex] = series)\n }\n\n set dataKey(key) {\n this.series.dataKey = key\n }\n\n get dataKey() {\n return this.series.dataKey\n }\n\n get legend() {\n !this.value.options && (this.value.options = {})\n return this.value.options.legend\n }\n\n set legend(legend) {\n this.value.options.legend = legend\n }\n\n get theme() {\n return this.value.options && this.value.options.theme\n }\n\n set theme(theme) {\n !this.value.options && (this.value.options = {})\n this.value.options.theme = theme\n }\n\n get tooltip() {\n return !this.value.options || this.value.options.tooltip !== false /* default true */\n }\n\n set tooltip(tooltip) {\n this.value.options.tooltip = tooltip\n }\n\n get animation() {\n return !this.value.options || this.value.options.animation !== false /* default true */\n }\n\n set animation(animation) {\n this.value.options.animation = animation\n }\n\n get scales() {\n return this.value.options.scales\n }\n\n set scales(scales) {\n !this.value.options && (this.value.options = {})\n this.value.options.scales = scales\n }\n\n get display() {\n return this.legend && this.legend.display\n }\n\n set display(display) {\n this.legend.display = display\n }\n\n get position() {\n return this.legend.position\n }\n\n set position(position) {\n this.legend.position = position\n }\n\n get stacked() {\n return this.value.options.stacked\n }\n\n set stacked(stacked) {\n this.value.options.stacked = stacked\n }\n\n get labelDataKey() {\n return this.data && this.data.labelDataKey\n }\n\n set labelDataKey(labelDataKey) {\n this.data.labelDataKey = labelDataKey\n }\n\n set options(options) {\n this.value.options = options\n }\n\n get options() {\n return this.value.options\n }\n\n onValuesChanged(e: Event) {\n var element = e.target as HTMLInputElement\n var key = element.getAttribute('value-key')\n var value = element.value\n\n if (!key) {\n return\n }\n\n value = this._getElementValue(element)\n\n var attrs = key.split('.')\n var attr = attrs.shift() || ''\n var variable = this\n\n while (attrs.length > 0) {\n //@ts-ignore\n variable = variable[attr]\n attr = attrs.shift() || ''\n }\n\n //@ts-ignore\n variable[attr] = value\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n this.requestUpdate()\n }\n\n onTapAddTab(e: Event) {\n if (!this.value.data.datasets) return\n\n var lastSeriesIndex = this.value.data.datasets.length\n var chartType = this.series.type || this.value.type\n var lastSeriesColor = new TinyColor(this.datasets[lastSeriesIndex - 1].backgroundColor)\n\n var seriesModel = this._getSeriesModel({\n chartType,\n datasetsLength: lastSeriesIndex,\n lastSeriesColor\n })\n\n this.value.data.datasets.push(seriesModel)\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n this.currentSeriesIndex = lastSeriesIndex\n }\n\n onTapRemoveCurrentTab(e: Event) {\n if (!this.value.data.datasets) return\n\n var currIndex = this.currentSeriesIndex\n this.value.data.datasets.splice(currIndex, 1)\n\n currIndex--\n\n if (currIndex < 0) currIndex = 0\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n this.currentSeriesIndex = currIndex\n\n this.requestUpdate()\n }\n\n _getSeriesModel({\n chartType,\n datasetsLength,\n lastSeriesColor\n }: {\n chartType: any\n datasetsLength: number\n lastSeriesColor: TinyColor\n }) {\n var addSeriesOption: any = {\n label: `series ${datasetsLength + 1}`,\n data: [],\n borderWidth: 1,\n dataKey: '',\n yAxisID: 'left',\n color: randomColor({\n hue: lastSeriesColor as any\n }).toRgbString()\n }\n\n addSeriesOption.type = addSeriesOption.chartType = chartType\n return addSeriesOption\n }\n\n _getElementValue(element: HTMLElement) {\n switch (element.tagName) {\n case 'INPUT':\n switch ((element as HTMLInputElement).type) {\n case 'checkbox':\n return (element as HTMLInputElement).checked\n case 'number':\n return Number((element as HTMLInputElement).value) || 0\n case 'text':\n return String((element as HTMLInputElement).value)\n }\n\n default:\n return (element as any).value\n }\n }\n}\n"]}
@@ -1,10 +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
- import '@operato/i18n/ox-i18n.js';
5
- import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
6
- export default class PropertyEditorChartJSHBar extends PropertyEditorChartJSMultiSeriesAbstract {
7
- static styles: import("lit").CSSResult[];
8
- editorTemplate(): import("lit-html").TemplateResult<1>;
9
- multiSeriesTabTemplate(): import("lit-html").TemplateResult<1>;
10
- }
@@ -1,154 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import '@material/web/icon/icon.js';
3
- import '@material/web/button/elevated-button.js';
4
- import '@material/web/tabs/tabs.js';
5
- import '@operato/i18n/ox-i18n.js';
6
- import { html } from 'lit';
7
- import { customElement } from 'lit/decorators.js';
8
- import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
9
- let PropertyEditorChartJSHBar = class PropertyEditorChartJSHBar extends PropertyEditorChartJSMultiSeriesAbstract {
10
- editorTemplate() {
11
- return html `
12
- <legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
13
- ${this.multiSeriesTabTemplate()}
14
-
15
- <legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
16
-
17
- <label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
18
- <input type="text" value-key="labelDataKey" .value=${this.labelDataKey} />
19
-
20
- <label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
21
- <input type="text" value-key="yAxes0.axisTitle" .value=${this.yAxes0.axisTitle || ''} />
22
-
23
- <label><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
24
- <input
25
- type="number"
26
- min="0"
27
- max="1"
28
- step="0.1"
29
- value-key="yAxes0.barSpacing"
30
- .value=${this.yAxes0.barSpacing || NaN}
31
- />
32
- <label><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
33
- <input
34
- type="number"
35
- min="0"
36
- max="1"
37
- step="0.1"
38
- value-key="yAxes0.categorySpacing"
39
- .value=${this.yAxes0.categorySpacing || NaN}
40
- />
41
-
42
- <input type="checkbox" value-key="value.options.xGridLine" .checked=${this.value.options.xGridLine} />
43
- <label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
44
-
45
- <input type="checkbox" value-key="xAxes0.ticks.display" .checked=${this.xAxes0.ticks.display} />
46
- <label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
47
-
48
- <legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
49
-
50
- <label> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
51
- <input type="text" value-key="xAxes0.title" .value=${this.xAxes0.axisTitle || ''} />
52
-
53
- <input type="checkbox" value-key="xAxes0.ticks.autoMin" .checked=${this.xAxes0.ticks.autoMin} />
54
- <label> <ox-i18n msgid="label.axis-min-auto">Axis Min Auto</ox-i18n> </label>
55
-
56
- <input type="checkbox" value-key="xAxes0.ticks.autoMax" .checked=${this.xAxes0.ticks.autoMax} />
57
- <label> <ox-i18n msgid="label.axis-max-auto">Axis Max Auto</ox-i18n> </label>
58
-
59
- ${!this.xAxes0.ticks.autoMin
60
- ? html `
61
- <label> <ox-i18n msgid="label.axis-min">Axis Min</ox-i18n> </label>
62
- <input type="number" value-key="xAxes0.ticks.min" .value=${this.xAxes0.ticks.min} />
63
- `
64
- : html ``}
65
- ${!this.xAxes0.ticks.autoMax
66
- ? html `
67
- <label> <ox-i18n msgid="label.axis-max">Axis Max</ox-i18n> </label>
68
- <input type="number" value-key="xAxes0.ticks.max" .value=${this.xAxes0.ticks.max} />
69
- `
70
- : html ``}
71
-
72
- <label> <ox-i18n msgid="label.axis-step-size">Axis Step Size</ox-i18n> </label>
73
- <input type="number" value-key="yAxes0.ticks.stepSize" .value=${this.yAxes0.ticks.stepSize} />
74
-
75
- <input type="checkbox" .checked=${this.value.options.yGridLine} />
76
- <label> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
77
-
78
- <input type="checkbox" value-key="yAxes0.ticks.display" .checked=${this.yAxes0.ticks.display} />
79
- <label> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
80
- `;
81
- }
82
- multiSeriesTabTemplate() {
83
- return html `
84
- <div id="series-properties-container" fullwidth>
85
- <div id="tab-header">
86
- <md-icon
87
- id="tab-nav-left-button"
88
- @tap=${(e) => {
89
- this._onTabScrollNavLeft(e);
90
- }}
91
- disabled
92
- >chevron_left</md-icon
93
- >
94
- <div
95
- id="tabs"
96
- @change=${(e) => {
97
- this.currentSeriesIndex = e.target.activeTabIndex;
98
- }}
99
- active-tab-index=${this.currentSeriesIndex}
100
- fit-container
101
- >
102
- ${this.datasets.map((dataset, index) => html `
103
- <div
104
- data-series=${index + 1}
105
- data-tab-index=${index}
106
- tab
107
- ?selected=${index == this.currentSeriesIndex}
108
- @click=${(e) => {
109
- const target = e.target;
110
- this.currentSeriesIndex = Number(target.getAttribute('data-tab-index'));
111
- }}
112
- >
113
- ${index + 1}
114
- ${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)
115
- ? html ` <md-icon @tap="${(e) => this.onTapRemoveCurrentTab(e)}"> close </md-icon> `
116
- : html ``}
117
- </div>
118
- `)}
119
- </div>
120
- <md-icon
121
- id="tab-nav-right-button"
122
- @click=${(e) => {
123
- this._onTabScrollNavRight(e);
124
- }}
125
- disabled
126
- >chevron_right</md-icon
127
- >
128
- </div>
129
- <div id="add-series-button-container">
130
- <md-icon id="add-series-button" @tap=${(e) => this.onTapAddTab(e)}>add</md-icon>
131
- </div>
132
-
133
- <div class="tab-content">
134
- <label> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
135
- <input type="text" value-key="dataKey" .value=${this.dataKey} />
136
- <label> <ox-i18n msgid="label.label">Label</ox-i18n> </label>
137
- <input type="text" value-key="series.label" .value=${this.series.label} />
138
- <label> <ox-i18n msgid="label.color">Color</ox-i18n> </label>
139
- <ox-input-color value-key="color" .value=${this.color}></ox-input-color>
140
- <label> <ox-i18n msgid="label.stack-group">Stack Group</ox-i18n> </label>
141
- <input type="text" value-key="series.stack" .value=${this.series.stack || ''} />
142
-
143
- ${this.displayValueTemplate()}
144
- </div>
145
- </div>
146
- `;
147
- }
148
- };
149
- PropertyEditorChartJSHBar.styles = [...PropertyEditorChartJSMultiSeriesAbstract.styles];
150
- PropertyEditorChartJSHBar = __decorate([
151
- customElement('property-editor-chartjs-hbar')
152
- ], PropertyEditorChartJSHBar);
153
- export default PropertyEditorChartJSHBar;
154
- //# sourceMappingURL=property-editor-chartjs-hbar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property-editor-chartjs-hbar.js","sourceRoot":"","sources":["../../src/editors/property-editor-chartjs-hbar.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAChD,OAAO,4BAA4B,CAAA;AAEnC,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,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K,IAAI,EAAE;;YAE1E,IAAI,CAAC,oBAAoB,EAAE;;;KAGlC,CAAA;IACH,CAAC;;AA9IM,gCAAM,GAAG,CAAC,GAAG,wCAAwC,CAAC,MAAM,CAAC,AAAvD,CAAuD;AADjD,yBAAyB;IAD7C,aAAa,CAAC,8BAA8B,CAAC;GACzB,yBAAyB,CAgJ7C;eAhJoB,yBAAyB","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/elevated-button.js'\nimport '@material/web/tabs/tabs.js'\n\nimport '@operato/i18n/ox-i18n.js'\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-hbar')\nexport default class PropertyEditorChartJSHBar extends PropertyEditorChartJSMultiSeriesAbstract {\n static styles = [...PropertyEditorChartJSMultiSeriesAbstract.styles]\n\n editorTemplate() {\n return html`\n <legend><ox-i18n msgid=\"label.series\">Series</ox-i18n></legend>\n ${this.multiSeriesTabTemplate()}\n\n <legend><ox-i18n msgid=\"label.y-axes\">Y Axes</ox-i18n></legend>\n\n <label> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input type=\"text\" value-key=\"labelDataKey\" .value=${this.labelDataKey} />\n\n <label> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input type=\"text\" value-key=\"yAxes0.axisTitle\" .value=${this.yAxes0.axisTitle || ''} />\n\n <label><ox-i18n msgid=\"label.bar-spacing\">Bar Spacing</ox-i18n></label>\n <input\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"yAxes0.barSpacing\"\n .value=${this.yAxes0.barSpacing || NaN}\n />\n <label><ox-i18n msgid=\"label.tick-spacing\">Tick Spacing</ox-i18n></label>\n <input\n type=\"number\"\n min=\"0\"\n max=\"1\"\n step=\"0.1\"\n value-key=\"yAxes0.categorySpacing\"\n .value=${this.yAxes0.categorySpacing || NaN}\n />\n\n <input type=\"checkbox\" value-key=\"value.options.xGridLine\" .checked=${this.value.options.xGridLine} />\n <label> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.display\" .checked=${this.xAxes0.ticks.display} />\n <label> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n\n <legend><ox-i18n msgid=\"label.x-axes\">X Axes</ox-i18n></legend>\n\n <label> <ox-i18n msgid=\"label.title\">Title</ox-i18n> </label>\n <input type=\"text\" value-key=\"xAxes0.title\" .value=${this.xAxes0.axisTitle || ''} />\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.autoMin\" .checked=${this.xAxes0.ticks.autoMin} />\n <label> <ox-i18n msgid=\"label.axis-min-auto\">Axis Min Auto</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"xAxes0.ticks.autoMax\" .checked=${this.xAxes0.ticks.autoMax} />\n <label> <ox-i18n msgid=\"label.axis-max-auto\">Axis Max Auto</ox-i18n> </label>\n\n ${!this.xAxes0.ticks.autoMin\n ? html`\n <label> <ox-i18n msgid=\"label.axis-min\">Axis Min</ox-i18n> </label>\n <input type=\"number\" value-key=\"xAxes0.ticks.min\" .value=${this.xAxes0.ticks.min} />\n `\n : html``}\n ${!this.xAxes0.ticks.autoMax\n ? html`\n <label> <ox-i18n msgid=\"label.axis-max\">Axis Max</ox-i18n> </label>\n <input type=\"number\" value-key=\"xAxes0.ticks.max\" .value=${this.xAxes0.ticks.max} />\n `\n : html``}\n\n <label> <ox-i18n msgid=\"label.axis-step-size\">Axis Step Size</ox-i18n> </label>\n <input type=\"number\" value-key=\"yAxes0.ticks.stepSize\" .value=${this.yAxes0.ticks.stepSize} />\n\n <input type=\"checkbox\" .checked=${this.value.options.yGridLine} />\n <label> <ox-i18n msgid=\"label.grid-line\">Grid Line</ox-i18n> </label>\n\n <input type=\"checkbox\" value-key=\"yAxes0.ticks.display\" .checked=${this.yAxes0.ticks.display} />\n <label> <ox-i18n msgid=\"label.display-tick\">Display Tick</ox-i18n> </label>\n `\n }\n\n multiSeriesTabTemplate() {\n return html`\n <div id=\"series-properties-container\" fullwidth>\n <div id=\"tab-header\">\n <md-icon\n id=\"tab-nav-left-button\"\n @tap=${(e: Event) => {\n this._onTabScrollNavLeft(e)\n }}\n disabled\n >chevron_left</md-icon\n >\n <div\n id=\"tabs\"\n @change=${(e: Event) => {\n this.currentSeriesIndex = (e.target as any).activeTabIndex\n }}\n active-tab-index=${this.currentSeriesIndex}\n fit-container\n >\n ${this.datasets.map(\n (dataset: any, index: number) => html`\n <div\n data-series=${index + 1}\n data-tab-index=${index}\n tab\n ?selected=${index == this.currentSeriesIndex}\n @click=${(e: Event) => {\n const target = e.target as HTMLDivElement\n this.currentSeriesIndex = Number(target.getAttribute('data-tab-index'))\n }}\n >\n ${index + 1}\n ${!this.datasets || (this.datasets.length != 1 && this.currentSeriesIndex == index)\n ? html` <md-icon @tap=\"${(e: Event) => this.onTapRemoveCurrentTab(e)}\"> close </md-icon> `\n : html``}\n </div>\n `\n )}\n </div>\n <md-icon\n id=\"tab-nav-right-button\"\n @click=${(e: Event) => {\n this._onTabScrollNavRight(e)\n }}\n disabled\n >chevron_right</md-icon\n >\n </div>\n <div id=\"add-series-button-container\">\n <md-icon id=\"add-series-button\" @tap=${(e: Event) => this.onTapAddTab(e)}>add</md-icon>\n </div>\n\n <div class=\"tab-content\">\n <label> <ox-i18n msgid=\"label.data-key\">Data Key</ox-i18n> </label>\n <input type=\"text\" value-key=\"dataKey\" .value=${this.dataKey} />\n <label> <ox-i18n msgid=\"label.label\">Label</ox-i18n> </label>\n <input type=\"text\" value-key=\"series.label\" .value=${this.series.label} />\n <label> <ox-i18n msgid=\"label.color\">Color</ox-i18n> </label>\n <ox-input-color value-key=\"color\" .value=${this.color}></ox-input-color>\n <label> <ox-i18n msgid=\"label.stack-group\">Stack Group</ox-i18n> </label>\n <input type=\"text\" value-key=\"series.stack\" .value=${this.series.stack || ''} />\n\n ${this.displayValueTemplate()}\n </div>\n </div>\n `\n }\n}\n"]}
@@ -1,17 +0,0 @@
1
- import '@operato/i18n/ox-i18n.js';
2
- import { Properties } from '@hatiolab/things-scene';
3
- import PropertyEditorChartJSMultiSeriesAbstract from './property-editor-chartjs-multi-series-abstract';
4
- export default class PropertyEditorChartJSMixed extends PropertyEditorChartJSMultiSeriesAbstract {
5
- static styles: import("lit").CSSResult[];
6
- constructor();
7
- get xAxes0(): any;
8
- set xAxes0(xAxes0: any);
9
- get yAxes0(): any;
10
- set yAxes0(yAxes0: any);
11
- get yAxes1(): any;
12
- set yAxes1(yAxes1: any);
13
- get multiAxis(): any;
14
- set multiAxis(multiAxis: any);
15
- editorTemplate(props: Properties): import("lit-html").TemplateResult<1>;
16
- _hasBarSeries(chart: any): boolean;
17
- }