@operato/chart 10.29.81 → 10.29.84

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