@operato/chart 8.0.0-beta.0 → 8.0.0-beta.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +6 -6
  3. package/.editorconfig +0 -29
  4. package/.storybook/main.js +0 -3
  5. package/.storybook/preview.js +0 -52
  6. package/.storybook/server.mjs +0 -8
  7. package/demo/index.html +0 -33
  8. package/src/chartjs/config-converter.ts +0 -341
  9. package/src/chartjs/ox-chart-js.ts +0 -207
  10. package/src/editors/configurer.ts +0 -336
  11. package/src/editors/index.ts +0 -8
  12. package/src/editors/input-chart-abstract.ts +0 -202
  13. package/src/editors/input-chart-styles.ts +0 -206
  14. package/src/editors/ox-input-chart-hbar.ts +0 -157
  15. package/src/editors/ox-input-chart-mixed.ts +0 -241
  16. package/src/editors/ox-input-chart-pie.ts +0 -69
  17. package/src/editors/ox-input-chart-radar.ts +0 -56
  18. package/src/editors/ox-input-chart-timeseries.ts +0 -279
  19. package/src/editors/ox-property-editor-chart.ts +0 -72
  20. package/src/editors/templates/annotations.ts +0 -295
  21. package/src/editors/templates/display-value.ts +0 -111
  22. package/src/editors/templates/series.ts +0 -316
  23. package/src/global.d.ts +0 -1
  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 -508
  28. package/src/types.d.ts +0 -124
  29. package/stories/common.ts +0 -87
  30. package/stories/ox-input-chart-bar.stories.ts +0 -188
  31. package/stories/ox-input-chart-doughnut.stories.ts +0 -130
  32. package/stories/ox-input-chart-hbar.stories.ts +0 -188
  33. package/stories/ox-input-chart-line.stories.ts +0 -198
  34. package/stories/ox-input-chart-pie.stories.ts +0 -130
  35. package/stories/ox-input-chart-polar-area.stories.ts +0 -130
  36. package/stories/ox-input-chart-radar.stories.ts +0 -141
  37. package/stories/ox-input-chart-timeseries.stories.ts +0 -268
  38. package/tsconfig.json +0 -25
  39. package/web-dev-server.config.mjs +0 -27
  40. package/web-test-runner.config.mjs +0 -41
@@ -1,130 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-pie.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-pie',
10
- component: 'ox-input-chart-pie',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-pie
76
- chart-type="pie"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-pie>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('pie'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'Pie Series 1',
117
- data: [10, 20, 30],
118
- backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
119
- borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
120
- borderWidth: 1
121
- }
122
- ],
123
- labelDataKey: 'labels'
124
- },
125
- options: {
126
- legend: { display: true }
127
- }
128
- },
129
- currentSeriesIndex: 0
130
- }
@@ -1,130 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-pie.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-pie for polla-area',
10
- component: 'ox-input-chart-pie',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-pie
76
- chart-type="polarArea"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-pie>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('polarArea'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'PolarArea Series',
117
- data: [10, 20, 30],
118
- backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
119
- borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
120
- borderWidth: 1
121
- }
122
- ],
123
- labelDataKey: 'labels'
124
- },
125
- options: {
126
- legend: { display: true }
127
- }
128
- },
129
- currentSeriesIndex: 0
130
- }
@@ -1,141 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-radar.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-radar',
10
- component: 'ox-input-chart-radar',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-radar
76
- chart-type="radar"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-radar>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('radar'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'Radar Series 1',
117
- data: [10, 20, 30],
118
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
119
- borderColor: 'rgba(255, 99, 132, 1)',
120
- borderWidth: 1,
121
- pointStyle: 'circle',
122
- pointRadius: 3
123
- },
124
- {
125
- label: 'Radar Series 2',
126
- data: [15, 25, 35],
127
- backgroundColor: 'rgba(54, 162, 235, 0.2)',
128
- borderColor: 'rgba(54, 162, 235, 1)',
129
- borderWidth: 1,
130
- pointStyle: 'circle',
131
- pointRadius: 3
132
- }
133
- ],
134
- labelDataKey: 'labels'
135
- },
136
- options: {
137
- legend: { display: true }
138
- }
139
- },
140
- currentSeriesIndex: 0
141
- }
@@ -1,268 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-timeseries.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
- import '../src/scichart/ox-scichart.js'
6
-
7
- import { data, getDefaultChartConfig } from './common.js'
8
-
9
- export default {
10
- title: 'ox-input-chart-timeseries',
11
- component: 'ox-input-chart-timeseries',
12
- argTypes: {
13
- value: { control: 'object' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- }
26
-
27
- function showCharts(e: Event) {
28
- const target = e.currentTarget as any
29
- const config = target.value
30
- const chartjs = document.querySelector('#chartjs') as HTMLElement
31
- if (chartjs) {
32
- ;(chartjs as any).config = { ...config }
33
- }
34
- const scichart = document.querySelector('#scichart') as HTMLElement
35
- if (scichart) {
36
- ;(scichart as any).config = config
37
- }
38
- }
39
-
40
- const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
41
- <link
42
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
43
- rel="stylesheet"
44
- />
45
- <link
46
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
47
- rel="stylesheet"
48
- />
49
- <link
50
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
51
- rel="stylesheet"
52
- />
53
-
54
- <link href="/themes/light.css" rel="stylesheet" />
55
- <link href="/themes/dark.css" rel="stylesheet" />
56
- <link href="/themes/spacing.css" rel="stylesheet" />
57
-
58
- <style>
59
- .desc {
60
- color: var(--md-sys-color-background);
61
- background-color: var(--md-sys-color-on-background);
62
- padding: var(--spacing-small);
63
- }
64
-
65
- .container {
66
- display: flex;
67
- flex-direction: row;
68
- overflow-y: auto;
69
- padding: var(--spacing-medium);
70
- gap: var(--spacing-medium);
71
-
72
- color: var(--md-sys-color-on-background);
73
- background-color: var(--md-sys-color-background);
74
- }
75
-
76
- #editor {
77
- width: 300px;
78
- }
79
-
80
- #charts {
81
- flex: 1;
82
-
83
- display: flex;
84
- flex-direction: column;
85
- gap: var(--spacing-medium);
86
- }
87
-
88
- #chartjs {
89
- flex: 1;
90
- }
91
-
92
- #scichart {
93
- flex: 1;
94
- }
95
- </style>
96
-
97
- <div class="desc">Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey</div>
98
-
99
- <div class="container">
100
- <ox-input-chart-timeseries
101
- chart-type="line"
102
- id="editor"
103
- .value=${value}
104
- @change=${showCharts}
105
- ></ox-input-chart-timeseries>
106
- <div id="charts">
107
- <ox-scichart id="scichart" .data=${data} attr-x="timestamp" attr-y="count"></ox-scichart>
108
- <!-- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js> -->
109
- </div>
110
- </div>
111
- `
112
-
113
- export const Default = Template.bind({})
114
- Default.args = {}
115
-
116
- export const WithData = Template.bind({})
117
- WithData.args = {
118
- value: {
119
- ...getDefaultChartConfig('line'),
120
- data: {
121
- datasets: [
122
- {
123
- dataKey: 'count',
124
- label: '라인 시리즈 카운트',
125
- type: 'line',
126
- color: 'rgba(255, 99, 132, 1)',
127
- borderWidth: 1
128
- },
129
- {
130
- dataKey: 'average',
131
- label: '라인 시리즈 평균값',
132
- type: 'line',
133
- color: 'rgba(54, 162, 235, 1)',
134
- fill: false,
135
- lineTension: 0.4,
136
- pointStyle: 'circle',
137
- pointRadius: 3
138
- }
139
- ],
140
- labelDataKey: 'timestamp'
141
- },
142
- options: {
143
- scales: {
144
- xAxes: [
145
- {
146
- axisTitle: 'timestamp',
147
- ticks: { beginAtZero: true }
148
- }
149
- ],
150
- yAxes: [
151
- {
152
- axisTitle: 'count',
153
- ticks: { beginAtZero: true }
154
- }
155
- ]
156
- },
157
- legend: { display: true }
158
- }
159
- }
160
- }
161
-
162
- export const MultiAxis = Template.bind({})
163
- MultiAxis.args = {
164
- value: {
165
- ...getDefaultChartConfig('line'),
166
- data: {
167
- datasets: [
168
- {
169
- label: 'Bar Series',
170
- type: 'bar',
171
- dataKey: 'count',
172
- axisTitle: 'count',
173
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
174
- borderColor: 'rgba(255, 99, 132, 1)',
175
- borderWidth: 1,
176
- yAxisID: 'left'
177
- },
178
- {
179
- label: 'Line Series',
180
- type: 'line',
181
- dataKey: 'average',
182
- axisTitle: 'average',
183
- color: 'rgba(54, 162, 235, 1)',
184
- borderWidth: 1,
185
- fill: false,
186
- lineTension: 0.4,
187
- pointStyle: 'rect',
188
- pointRadius: 3,
189
- yAxisID: 'right'
190
- }
191
- ],
192
- labelDataKey: 'timestamp'
193
- },
194
- options: {
195
- scales: {
196
- xAxes: [
197
- {
198
- axisTitle: 'timestamp',
199
- ticks: { beginAtZero: true }
200
- }
201
- ],
202
- yAxes: [
203
- {
204
- axisTitle: 'count',
205
- ticks: { beginAtZero: true }
206
- },
207
- {
208
- axisTitle: 'average',
209
- ticks: { beginAtZero: true }
210
- }
211
- ]
212
- },
213
- multiAxis: true,
214
- legend: { display: true },
215
- annotations: [
216
- {
217
- type: 'line',
218
- x1: 0,
219
- y1: -10,
220
- x2: 1,
221
- y2: 10,
222
- stroke: 'red',
223
- strokeThickness: 5,
224
- xCoordinateMode: 'Relative',
225
- yCoordinateMode: 'DataValue'
226
- },
227
- {
228
- type: 'text',
229
- x1: 0.5,
230
- y1: 0,
231
- text: 'Hello',
232
- fontSize: 50,
233
- stroke: 'blue',
234
- xCoordinateMode: 'Relative',
235
- yCoordinateMode: 'DataValue'
236
- },
237
- {
238
- type: 'box',
239
- x1: 0.2,
240
- y1: 10,
241
- x2: 0.5,
242
- y2: 20,
243
- fill: 'green',
244
- stroke: 'blue',
245
- strokeThickness: 10,
246
- xCoordinateMode: 'Relative',
247
- yCoordinateMode: 'DataValue'
248
- },
249
- {
250
- type: 'horizontalLine',
251
- y1: 20,
252
- stroke: 'purple',
253
- strokeThickness: 5,
254
- xCoordinateMode: 'Relative',
255
- yCoordinateMode: 'DataValue'
256
- },
257
- {
258
- type: 'verticalLine',
259
- x1: 0.8,
260
- stroke: 'orange',
261
- strokeThickness: 5,
262
- xCoordinateMode: 'Relative',
263
- yCoordinateMode: 'DataValue'
264
- }
265
- ]
266
- }
267
- }
268
- }
package/tsconfig.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "resolveJsonModule": true,
7
- "noEmitOnError": true,
8
- "lib": ["es2017", "dom"],
9
- "strict": true,
10
- "esModuleInterop": false,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "useDefineForClassFields": false,
14
- "importHelpers": true,
15
- "outDir": "dist",
16
- "sourceMap": true,
17
- "inlineSources": true,
18
- "rootDir": "./",
19
- "declaration": true,
20
- "incremental": true,
21
- "skipLibCheck": true,
22
- "types": ["node", "mocha"]
23
- },
24
- "include": ["**/*.ts", "*.d.ts"]
25
- }