@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,174 @@
1
+ import { html } from 'lit';
2
+ import '../src/editors/ox-input-chart-hbar.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-hbar',
8
+ component: 'ox-input-chart-hbar',
9
+ argTypes: {
10
+ value: { control: 'object' }
11
+ }
12
+ };
13
+ const Template = ({ value }) => 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
+ #charts {
51
+ flex: 1;
52
+
53
+ display: flex;
54
+ flex-direction: column;
55
+ padding: 10px;
56
+ }
57
+
58
+ #chartjs {
59
+ flex: 1;
60
+ }
61
+
62
+ #scichart {
63
+ flex: 1;
64
+ }
65
+ </style>
66
+
67
+ <div style="background-color: black; color: white;">
68
+ Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
69
+ </div>
70
+ <div class="container light">
71
+ <ox-input-chart-hbar
72
+ chart-type="horizontalBar"
73
+ id="editor"
74
+ .value=${value}
75
+ @change=${async (e) => {
76
+ const target = e.currentTarget;
77
+ const config = target.value;
78
+ const chartjs = document.querySelector('#chartjs');
79
+ if (chartjs) {
80
+ ;
81
+ chartjs.config = { ...config };
82
+ }
83
+ const scichart = document.querySelector('#scichart');
84
+ if (scichart) {
85
+ ;
86
+ scichart.config = config;
87
+ }
88
+ const container = document.querySelector('.container');
89
+ if (container) {
90
+ const theme = config.options.theme;
91
+ if (theme == 'dark') {
92
+ container.classList.remove('light');
93
+ container.classList.add('dark');
94
+ }
95
+ else {
96
+ container.classList.remove('dark');
97
+ container.classList.add('light');
98
+ }
99
+ }
100
+ }}
101
+ ></ox-input-chart-hbar>
102
+ <div id="charts">
103
+ <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
104
+ <ox-scichart id="scichart"></ox-scichart>
105
+ </div>
106
+ </div>
107
+ `;
108
+ export const Default = Template.bind({});
109
+ Default.args = {};
110
+ // 다양한 데이터셋과 함께 사용하는 스토리
111
+ export const WithData = Template.bind({});
112
+ WithData.args = {
113
+ value: {
114
+ ...getDefaultChartConfig('bar'),
115
+ data: {
116
+ datasets: [
117
+ {
118
+ label: 'Series 1',
119
+ data: [10, 20, 30],
120
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
121
+ borderColor: 'rgba(255, 99, 132, 1)',
122
+ borderWidth: 1
123
+ },
124
+ {
125
+ label: '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
+ }
131
+ ],
132
+ labelDataKey: 'labels'
133
+ },
134
+ options: {
135
+ scales: {
136
+ xAxes: [{ ticks: { beginAtZero: true } }],
137
+ yAxes: [{ ticks: { beginAtZero: true } }]
138
+ },
139
+ legend: { display: true }
140
+ }
141
+ }
142
+ };
143
+ export const MultiAxis = Template.bind({});
144
+ MultiAxis.args = {
145
+ value: {
146
+ ...getDefaultChartConfig('bar'),
147
+ options: {
148
+ ...getDefaultChartConfig('bar').options,
149
+ multiAxis: true
150
+ },
151
+ data: {
152
+ datasets: [
153
+ {
154
+ label: 'Series 1',
155
+ data: [10, 20, 30],
156
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
157
+ borderColor: 'rgba(255, 99, 132, 1)',
158
+ borderWidth: 1,
159
+ yAxisID: 'left'
160
+ },
161
+ {
162
+ label: 'Series 2',
163
+ data: [15, 25, 35],
164
+ backgroundColor: 'rgba(54, 162, 235, 0.2)',
165
+ borderColor: 'rgba(54, 162, 235, 1)',
166
+ borderWidth: 1,
167
+ yAxisID: 'right'
168
+ }
169
+ ],
170
+ labelDataKey: 'labels'
171
+ }
172
+ }
173
+ };
174
+ //# sourceMappingURL=ox-input-chart-hbar.stories.js.map
@@ -0,0 +1,26 @@
1
+ import { TemplateResult } from 'lit';
2
+ import '../src/editors/ox-input-chart-mixed.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 MultiAxis: Story<ArgTypes>;
@@ -0,0 +1,184 @@
1
+ import { html } from 'lit';
2
+ import '../src/editors/ox-input-chart-mixed.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-mixed for line',
8
+ component: 'ox-input-chart-mixed',
9
+ argTypes: {
10
+ value: { control: 'object' }
11
+ }
12
+ };
13
+ const Template = ({ value }) => 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
+ #charts {
51
+ flex: 1;
52
+
53
+ display: flex;
54
+ flex-direction: column;
55
+ padding: 10px;
56
+ }
57
+
58
+ #chartjs {
59
+ flex: 1;
60
+ }
61
+
62
+ #scichart {
63
+ flex: 1;
64
+ }
65
+ </style>
66
+
67
+ <div style="background-color: black; color: white;">
68
+ Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
69
+ </div>
70
+
71
+ <div class="container light">
72
+ <ox-input-chart-mixed
73
+ chart-type="line"
74
+ id="editor"
75
+ .value=${value}
76
+ @change=${(e) => {
77
+ const target = e.currentTarget;
78
+ const config = target.value;
79
+ const chartjs = document.querySelector('#chartjs');
80
+ if (chartjs) {
81
+ ;
82
+ chartjs.config = { ...config };
83
+ }
84
+ const scichart = document.querySelector('#scichart');
85
+ if (scichart) {
86
+ ;
87
+ scichart.config = config;
88
+ }
89
+ const container = document.querySelector('.container');
90
+ if (container) {
91
+ const theme = config.options.theme;
92
+ if (theme == 'dark') {
93
+ container.classList.remove('light');
94
+ container.classList.add('dark');
95
+ }
96
+ else {
97
+ container.classList.remove('dark');
98
+ container.classList.add('light');
99
+ }
100
+ }
101
+ }}
102
+ ></ox-input-chart-mixed>
103
+ <div id="charts">
104
+ <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
105
+ <ox-scichart id="scichart"></ox-scichart>
106
+ </div>
107
+ </div>
108
+ `;
109
+ export const Default = Template.bind({});
110
+ Default.args = {};
111
+ export const WithData = Template.bind({});
112
+ WithData.args = {
113
+ value: {
114
+ ...getDefaultChartConfig('line'),
115
+ data: {
116
+ datasets: [
117
+ {
118
+ label: 'Bar Series',
119
+ type: 'bar',
120
+ data: [10, 20, 30],
121
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
122
+ borderColor: 'rgba(255, 99, 132, 1)',
123
+ borderWidth: 1
124
+ },
125
+ {
126
+ label: 'Line Series',
127
+ type: 'line',
128
+ data: [15, 25, 35],
129
+ borderColor: 'rgba(54, 162, 235, 1)',
130
+ borderWidth: 1,
131
+ fill: false,
132
+ lineTension: 0.4,
133
+ pointStyle: 'circle',
134
+ pointRadius: 3
135
+ }
136
+ ],
137
+ labelDataKey: 'labels'
138
+ },
139
+ options: {
140
+ scales: {
141
+ xAxes: [{ ticks: { beginAtZero: true } }],
142
+ yAxes: [{ ticks: { beginAtZero: true } }]
143
+ },
144
+ legend: { display: true }
145
+ }
146
+ }
147
+ };
148
+ export const MultiAxis = Template.bind({});
149
+ MultiAxis.args = {
150
+ value: {
151
+ ...getDefaultChartConfig('line'),
152
+ options: {
153
+ ...getDefaultChartConfig('line').options,
154
+ multiAxis: true
155
+ },
156
+ data: {
157
+ datasets: [
158
+ {
159
+ label: 'Bar Series',
160
+ type: 'bar',
161
+ data: [10, 20, 30],
162
+ backgroundColor: 'rgba(255, 99, 132, 0.2)',
163
+ borderColor: 'rgba(255, 99, 132, 1)',
164
+ borderWidth: 1,
165
+ yAxisID: 'left'
166
+ },
167
+ {
168
+ label: 'Line Series',
169
+ type: 'line',
170
+ data: [15, 25, 35],
171
+ borderColor: 'rgba(54, 162, 235, 1)',
172
+ borderWidth: 1,
173
+ fill: false,
174
+ lineTension: 0.4,
175
+ pointStyle: 'circle',
176
+ pointRadius: 3,
177
+ yAxisID: 'right'
178
+ }
179
+ ],
180
+ labelDataKey: 'labels'
181
+ }
182
+ }
183
+ };
184
+ //# sourceMappingURL=ox-input-chart-line.stories.js.map
@@ -0,0 +1,28 @@
1
+ import { TemplateResult } from 'lit';
2
+ import '../src/editors/ox-input-chart-pie.js';
3
+ import '../src/chartjs/ox-chart-js.js';
4
+ import type { OperatoChart } from '../types/types';
5
+ declare const _default: {
6
+ title: string;
7
+ component: string;
8
+ argTypes: {
9
+ value: {
10
+ control: string;
11
+ };
12
+ currentSeriesIndex: {
13
+ control: string;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ interface Story<T> {
19
+ (args: T): TemplateResult;
20
+ args?: Partial<T>;
21
+ argTypes?: Record<string, unknown>;
22
+ }
23
+ interface ArgTypes {
24
+ value: OperatoChart.ChartConfig;
25
+ currentSeriesIndex: number;
26
+ }
27
+ export declare const Default: Story<ArgTypes>;
28
+ export declare const WithData: Story<ArgTypes>;
@@ -0,0 +1,115 @@
1
+ import { html } from 'lit';
2
+ import '../src/editors/ox-input-chart-pie.js';
3
+ import '../src/chartjs/ox-chart-js.js';
4
+ import { data, getDefaultChartConfig } from './common.js';
5
+ export default {
6
+ title: 'ox-input-chart-pie',
7
+ component: 'ox-input-chart-pie',
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-pie
61
+ chart-type="pie"
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-pie>
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('pie'),
97
+ data: {
98
+ datasets: [
99
+ {
100
+ label: 'Pie Series 1',
101
+ data: [10, 20, 30],
102
+ backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
103
+ borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
104
+ borderWidth: 1
105
+ }
106
+ ],
107
+ labelDataKey: 'labels'
108
+ },
109
+ options: {
110
+ legend: { display: true }
111
+ }
112
+ },
113
+ currentSeriesIndex: 0
114
+ };
115
+ //# sourceMappingURL=ox-input-chart-pie.stories.js.map
@@ -0,0 +1,28 @@
1
+ import { TemplateResult } from 'lit';
2
+ import '../src/editors/ox-input-chart-pie.js';
3
+ import '../src/chartjs/ox-chart-js.js';
4
+ import type { OperatoChart } from '../types/types';
5
+ declare const _default: {
6
+ title: string;
7
+ component: string;
8
+ argTypes: {
9
+ value: {
10
+ control: string;
11
+ };
12
+ currentSeriesIndex: {
13
+ control: string;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ interface Story<T> {
19
+ (args: T): TemplateResult;
20
+ args?: Partial<T>;
21
+ argTypes?: Record<string, unknown>;
22
+ }
23
+ interface ArgTypes {
24
+ value: OperatoChart.ChartConfig;
25
+ currentSeriesIndex: number;
26
+ }
27
+ export declare const Default: Story<ArgTypes>;
28
+ export declare const WithData: Story<ArgTypes>;
@@ -0,0 +1,115 @@
1
+ import { html } from 'lit';
2
+ import '../src/editors/ox-input-chart-pie.js';
3
+ import '../src/chartjs/ox-chart-js.js';
4
+ import { data, getDefaultChartConfig } from './common.js';
5
+ export default {
6
+ title: 'ox-input-chart-pie for polla-area',
7
+ component: 'ox-input-chart-pie',
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-pie
61
+ chart-type="polarArea"
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-pie>
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('polarArea'),
97
+ data: {
98
+ datasets: [
99
+ {
100
+ label: 'PolarArea Series',
101
+ data: [10, 20, 30],
102
+ backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
103
+ borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
104
+ borderWidth: 1
105
+ }
106
+ ],
107
+ labelDataKey: 'labels'
108
+ },
109
+ options: {
110
+ legend: { display: true }
111
+ }
112
+ },
113
+ currentSeriesIndex: 0
114
+ };
115
+ //# sourceMappingURL=ox-input-chart-polar-area.stories.js.map
@@ -0,0 +1,28 @@
1
+ import { TemplateResult } from 'lit';
2
+ import '../src/editors/ox-input-chart-radar.js';
3
+ import '../src/chartjs/ox-chart-js.js';
4
+ import type { OperatoChart } from '../types/types';
5
+ declare const _default: {
6
+ title: string;
7
+ component: string;
8
+ argTypes: {
9
+ value: {
10
+ control: string;
11
+ };
12
+ currentSeriesIndex: {
13
+ control: string;
14
+ };
15
+ };
16
+ };
17
+ export default _default;
18
+ interface Story<T> {
19
+ (args: T): TemplateResult;
20
+ args?: Partial<T>;
21
+ argTypes?: Record<string, unknown>;
22
+ }
23
+ interface ArgTypes {
24
+ value: OperatoChart.ChartConfig;
25
+ currentSeriesIndex: number;
26
+ }
27
+ export declare const Default: Story<ArgTypes>;
28
+ export declare const WithData: Story<ArgTypes>;