@operato/chart 7.1.31 → 7.1.33

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 (41) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +9 -9
  4. package/.editorconfig +0 -29
  5. package/.storybook/main.js +0 -3
  6. package/.storybook/preview.js +0 -52
  7. package/.storybook/server.mjs +0 -8
  8. package/demo/index.html +0 -33
  9. package/src/chartjs/config-converter.ts +0 -341
  10. package/src/chartjs/ox-chart-js.ts +0 -207
  11. package/src/editors/configurer.ts +0 -336
  12. package/src/editors/index.ts +0 -8
  13. package/src/editors/input-chart-abstract.ts +0 -202
  14. package/src/editors/input-chart-styles.ts +0 -206
  15. package/src/editors/ox-input-chart-hbar.ts +0 -157
  16. package/src/editors/ox-input-chart-mixed.ts +0 -241
  17. package/src/editors/ox-input-chart-pie.ts +0 -69
  18. package/src/editors/ox-input-chart-radar.ts +0 -56
  19. package/src/editors/ox-input-chart-timeseries.ts +0 -279
  20. package/src/editors/ox-property-editor-chart.ts +0 -72
  21. package/src/editors/templates/annotations.ts +0 -295
  22. package/src/editors/templates/display-value.ts +0 -111
  23. package/src/editors/templates/series.ts +0 -316
  24. package/src/index.ts +0 -0
  25. package/src/progress/ox-progress-circle.ts +0 -133
  26. package/src/scichart/ox-scichart.ts +0 -151
  27. package/src/scichart/scichart-builder.ts +0 -490
  28. package/stories/common.ts +0 -87
  29. package/stories/ox-input-chart-bar.stories.ts +0 -188
  30. package/stories/ox-input-chart-doughnut.stories.ts +0 -130
  31. package/stories/ox-input-chart-hbar.stories.ts +0 -188
  32. package/stories/ox-input-chart-line.stories.ts +0 -198
  33. package/stories/ox-input-chart-pie.stories.ts +0 -130
  34. package/stories/ox-input-chart-polar-area.stories.ts +0 -130
  35. package/stories/ox-input-chart-radar.stories.ts +0 -141
  36. package/stories/ox-input-chart-timeseries.stories.ts +0 -268
  37. package/tsconfig.json +0 -25
  38. package/web-dev-server.config.mjs +0 -27
  39. package/web-test-runner.config.mjs +0 -41
  40. /package/{src → types}/global.d.ts +0 -0
  41. /package/{src → types}/types.d.ts +0 -0
@@ -1,56 +0,0 @@
1
- import '@operato/i18n/ox-i18n.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
- import { ifDefined } from 'lit/directives/if-defined.js'
6
-
7
- import { InputChartAbstract } from './input-chart-abstract'
8
-
9
- import './templates/series'
10
-
11
- @customElement('ox-input-chart-radar')
12
- export default class OxInputChartRadar extends InputChartAbstract {
13
- static styles = InputChartAbstract.styles
14
-
15
- subTemplate() {
16
- const configurer = this.configurer
17
-
18
- return html`
19
- <legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
20
- <ox-chart-series
21
- .configurer=${configurer}
22
- .chartType=${this.chartType}
23
- value-key="datasets"
24
- fullwidth
25
- ></ox-chart-series>
26
-
27
- <legend><ox-i18n msgid="label.axes">Axes</ox-i18n></legend>
28
-
29
- <label for="series-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
30
- <input id="series-data-key" type="text" value-key="labelDataKey" value=${ifDefined(configurer.labelDataKey)} />
31
- `
32
- }
33
-
34
- getDefaultDatasets(): OperatoChart.Dataset[] {
35
- return [
36
- {
37
- label: 'Radar Series 1',
38
- data: [10, 20, 30],
39
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
40
- borderColor: 'rgba(255, 99, 132, 1)',
41
- borderWidth: 1,
42
- pointStyle: 'circle',
43
- pointRadius: 3
44
- },
45
- {
46
- label: 'Radar Series 2',
47
- data: [15, 25, 35],
48
- backgroundColor: 'rgba(54, 162, 235, 0.2)',
49
- borderColor: 'rgba(54, 162, 235, 1)',
50
- borderWidth: 1,
51
- pointStyle: 'circle',
52
- pointRadius: 3
53
- }
54
- ]
55
- }
56
- }
@@ -1,279 +0,0 @@
1
- import '@operato/i18n/ox-i18n.js'
2
-
3
- import { html, css } from 'lit'
4
- import { customElement, state } from 'lit/decorators.js'
5
- import { ifDefined } from 'lit/directives/if-defined.js'
6
-
7
- import { InputChartAbstract } from './input-chart-abstract'
8
-
9
- import './templates/annotations'
10
- import './templates/series'
11
-
12
- @customElement('ox-input-chart-timeseries')
13
- export class OxInputChartTimeseries extends InputChartAbstract {
14
- static styles = [
15
- ...InputChartAbstract.styles,
16
- css`
17
- legend[collapsable] {
18
- box-sizing: border-box;
19
- width: 100%;
20
- }
21
-
22
- legend[collapsable] md-icon {
23
- float: right;
24
- font-size: medium;
25
- margin: 0;
26
- }
27
-
28
- [collapsed] {
29
- display: none;
30
- }
31
- `
32
- ]
33
-
34
- @state() annotationExpanded = false
35
-
36
- subTemplate() {
37
- const configurer = this.configurer
38
-
39
- return html`
40
- <input id="multi-axis" type="checkbox" value-key="multiAxis" ?checked=${configurer.multiAxis} />
41
- <label for="multi-axis"> <ox-i18n msgid="label.multi-axis">Multi Axis</ox-i18n> </label>
42
-
43
- <legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
44
- <ox-chart-series
45
- .configurer=${configurer}
46
- .chartType=${this.chartType}
47
- value-key="datasets"
48
- fullwidth
49
- ></ox-chart-series>
50
-
51
- <legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
52
-
53
- <label for="series-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
54
- <input id="series-data-key" type="text" value-key="labelDataKey" value=${ifDefined(configurer.labelDataKey)} />
55
-
56
- <label for="x-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
57
- <input
58
- id="x-axes0-axis-title"
59
- type="text"
60
- value-key="xAxes0.axisTitle"
61
- value=${ifDefined(configurer.xAxes0.axisTitle)}
62
- />
63
-
64
- ${this._hasBarSeries(configurer.value)
65
- ? html`
66
- <label for="bar-spacing"><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
67
- <input
68
- id="bar-spacing"
69
- type="number"
70
- min="0"
71
- max="1"
72
- step="0.1"
73
- value-key="xAxes0.barSpacing"
74
- value=${ifDefined(configurer.xAxes0.barSpacing)}
75
- />
76
- <label for="tick-spacing"><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
77
- <input
78
- id="tick-spacing"
79
- type="number"
80
- min="0"
81
- max="1"
82
- step="0.1"
83
- value-key="xAxes0.categorySpacing"
84
- value=${ifDefined(configurer.xAxes0.categorySpacing)}
85
- />
86
- `
87
- : html``}
88
-
89
- <input
90
- id="x-grid-line"
91
- type="checkbox"
92
- value-key="value.options.xGridLine"
93
- ?checked=${configurer.config.options?.xGridLine}
94
- />
95
- <label for="x-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
96
-
97
- <input
98
- id="x-axes0-ticks-display"
99
- type="checkbox"
100
- value-key="xAxes0.ticks.display"
101
- ?checked=${configurer.xAxes0.ticks?.display}
102
- />
103
- <label for="x-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
104
-
105
- <legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
106
-
107
- <label for="y-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
108
- <input
109
- id="y-axes0-axis-title"
110
- type="text"
111
- value-key="yAxes0.axisTitle"
112
- value=${configurer.yAxes0.axisTitle || ''}
113
- />
114
-
115
- <input
116
- id="axis-min-auto"
117
- type="checkbox"
118
- value-key="yAxes0.ticks.autoMin"
119
- ?checked=${configurer.yAxes0.ticks?.autoMin}
120
- />
121
- <label for="axis-min-auto"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
122
-
123
- <input
124
- id="axis-max-auto"
125
- type="checkbox"
126
- value-key="yAxes0.ticks.autoMax"
127
- ?checked=${configurer.yAxes0.ticks?.autoMax}
128
- />
129
- <label for="axis-max-auto"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
130
-
131
- ${!configurer.yAxes0.ticks?.autoMin
132
- ? html`
133
- <label for="y-axes0-ticks-min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
134
- <input
135
- id="y-axes0-ticks-min"
136
- type="number"
137
- value-key="yAxes0.ticks.min"
138
- value=${ifDefined(configurer.yAxes0.ticks?.min)}
139
- />
140
- `
141
- : html``}
142
- ${!configurer.yAxes0.ticks?.autoMax
143
- ? html`
144
- <label for="y-axes0-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
145
- <input
146
- id="y-axes0-ticks-max"
147
- type="number"
148
- value-key="yAxes0.ticks.max"
149
- value=${ifDefined(configurer.yAxes0.ticks?.max)}
150
- />
151
- `
152
- : html``}
153
-
154
- <label for="y-axes0-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
155
- <input
156
- id="y-axes0-ticks-step-size"
157
- type="number"
158
- value-key="yAxes0.ticks.stepSize"
159
- value=${ifDefined(configurer.yAxes0.ticks?.stepSize)}
160
- />
161
-
162
- <input
163
- id="y-grid-line"
164
- type="checkbox"
165
- value-key="value.options.yGridLine"
166
- ?checked=${configurer.config.options?.yGridLine}
167
- />
168
- <label for="y-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
169
-
170
- <input
171
- id="y-axes0-ticks-display"
172
- type="checkbox"
173
- value-key="yAxes0.ticks.display"
174
- ?checked=${configurer.yAxes0.ticks?.display}
175
- />
176
- <label for="y-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
177
-
178
- ${configurer.config.options?.multiAxis
179
- ? html`
180
- <legend><ox-i18n msgid="label.y-2nd-axes">Y 2nd Axes</ox-i18n></legend>
181
-
182
- <label for="y-axes1.axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
183
- <input
184
- id="y-axes1.axis-title"
185
- type="text"
186
- value-key="yAxes1.axisTitle"
187
- value=${ifDefined(configurer.yAxes1?.axisTitle)}
188
- />
189
-
190
- <input
191
- id="y-axes1-ticks-auto-min"
192
- type="checkbox"
193
- value-key="yAxes1.ticks.autoMin"
194
- ?checked=${configurer.yAxes1?.ticks?.autoMin}
195
- />
196
- <label for="y-axes1-ticks-auto-min"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
197
-
198
- <input
199
- id="y-axes1-ticks-auto-max"
200
- type="checkbox"
201
- value-key="yAxes1.ticks.autoMax"
202
- ?checked=${configurer.yAxes1?.ticks?.autoMax}
203
- />
204
- <label for="y-axes1-ticks-auto-max"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
205
-
206
- ${!configurer.yAxes1?.ticks?.autoMin
207
- ? html`
208
- <label for="y-axes1-ticks-min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
209
- <input
210
- id="y-axes1-ticks-min"
211
- type="number"
212
- value-key="yAxes1.ticks.min"
213
- value=${ifDefined(configurer.yAxes1?.ticks?.min)}
214
- />
215
- `
216
- : html``}
217
- ${!configurer.yAxes1?.ticks?.autoMax
218
- ? html`
219
- <label for="y-axes1-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
220
- <input
221
- id="y-axes1-ticks-max"
222
- type="number"
223
- value-key="yAxes1.ticks.max"
224
- value=${ifDefined(configurer.yAxes1?.ticks?.max)}
225
- />
226
- `
227
- : html``}
228
-
229
- <label for="y-axes1-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
230
- <input
231
- id="y-axes1-ticks-step-size"
232
- type="number"
233
- value-key="yAxes1.ticks.stepSize"
234
- value=${ifDefined(configurer.yAxes1?.ticks?.stepSize)}
235
- />
236
-
237
- <input
238
- id="y-2nd-grid-line"
239
- type="checkbox"
240
- value-key="value.options.y2ndGridLine"
241
- ?checked=${configurer.config.options?.y2ndGridLine}
242
- />
243
- <label for="y-2nd-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
244
-
245
- <input
246
- id="y-axes1-ticks-display"
247
- type="checkbox"
248
- value-key="yAxes1.ticks.display"
249
- ?checked=${configurer.yAxes1?.ticks?.display}
250
- />
251
- <label for="y-axes1-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
252
- `
253
- : html``}
254
-
255
- <legend collapsable>
256
- <ox-i18n msgid="label.chart-annotation">Annotations</ox-i18n>
257
- <md-icon
258
- @tap=${() => {
259
- this.annotationExpanded = !this.annotationExpanded
260
- }}
261
- >${this.annotationExpanded ? 'expand_less' : 'expand_more'}</md-icon
262
- >
263
- </legend>
264
- <ox-chart-annotations
265
- .configurer=${configurer}
266
- ?collapsed=${!this.annotationExpanded}
267
- value-key="annotations"
268
- fullwidth
269
- ></ox-chart-annotations>
270
- `
271
- }
272
-
273
- _hasBarSeries(config: any) {
274
- var hasBarSeries = false
275
- hasBarSeries = config.data.datasets?.some((s: any) => s.type == 'bar')
276
-
277
- return hasBarSeries
278
- }
279
- }
@@ -1,72 +0,0 @@
1
- import '@operato/i18n/ox-i18n.js'
2
-
3
- import './ox-input-chart-hbar'
4
- import './ox-input-chart-mixed'
5
- import './ox-input-chart-pie'
6
- import './ox-input-chart-radar'
7
- import './ox-input-chart-timeseries'
8
-
9
- import { css, html } from 'lit'
10
- import { customElement } from 'lit/decorators.js'
11
-
12
- import { OxPropertyEditor, PropertySpec } from '@operato/property-editor'
13
-
14
- @customElement('ox-property-editor-chart')
15
- export class ChartEditor extends OxPropertyEditor {
16
- static styles = [
17
- css`
18
- :host {
19
- display: block;
20
- padding: 5px;
21
-
22
- --md-elevated-button-container-height: 20px;
23
- }
24
-
25
- #chart-type {
26
- display: grid;
27
- grid-template-columns: repeat(10, 1fr);
28
- grid-gap: 5px;
29
- }
30
-
31
- #chart-type > label {
32
- box-sizing: border-box;
33
- grid-column: span 3;
34
-
35
- text-align: right;
36
-
37
- color: var(--md-sys-color-on-secondary-container);
38
- font-size: 0.8em;
39
- line-height: 2;
40
- text-transform: capitalize;
41
- }
42
-
43
- #chart-type > input {
44
- box-sizing: border-box;
45
- grid-column: span 7;
46
- border: 1px solid rgba(0, 0, 0, 0.2);
47
- }
48
- `
49
- ]
50
-
51
- editorTemplate(value: any, spec: PropertySpec) {
52
- switch (value.type) {
53
- case 'line':
54
- case 'bar':
55
- return html` <ox-input-chart-mixed .value=${value} chart-type=${value.type} fullwidth></ox-input-chart-mixed> `
56
- case 'horizontalBar':
57
- return html` <ox-input-chart-hbar .value=${value} chart-type=${value.type} fullwidth></ox-input-chart-hbar> `
58
- case 'pie':
59
- case 'doughnut':
60
- case 'polarArea':
61
- return html` <ox-input-chart-pie .value=${value} chart-type=${value.type} fullwidth></ox-input-chart-pie> `
62
- case 'radar':
63
- return html` <ox-input-chart-radar .value=${value} chart-type=${value.type} fullwidth></ox-input-chart-radar> `
64
- case 'timeseries':
65
- return html`
66
- <ox-input-chart-timeseries .value=${value} chart-type=${value.type} fullwidth></ox-input-chart-timeseries>
67
- `
68
- }
69
-
70
- return html``
71
- }
72
- }