@operato/chart 9.0.0-beta.7 → 9.0.0-beta.70
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.
- package/CHANGELOG.md +331 -0
- package/dist/src/chartjs/config-converter.d.ts +1 -0
- package/dist/src/chartjs/config-converter.js.map +1 -1
- package/dist/src/chartjs/ox-chart-js.d.ts +3 -2
- package/dist/src/chartjs/ox-chart-js.js.map +1 -1
- package/dist/src/editors/configurer.d.ts +3 -2
- package/dist/src/editors/configurer.js.map +1 -1
- package/dist/src/editors/input-chart-abstract.d.ts +2 -1
- package/dist/src/editors/input-chart-abstract.js +1 -1
- package/dist/src/editors/input-chart-abstract.js.map +1 -1
- package/dist/src/editors/input-chart-styles.js +12 -11
- package/dist/src/editors/input-chart-styles.js.map +1 -1
- package/dist/src/editors/ox-input-chart-hbar.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-pie.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-pie.js.map +1 -1
- package/dist/src/editors/ox-input-chart-radar.d.ts +1 -0
- package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
- package/dist/src/editors/ox-input-chart-timeseries.js +1 -1
- package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
- package/dist/src/editors/ox-property-editor-chart.js +3 -3
- package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
- package/dist/src/editors/templates/annotations.d.ts +1 -0
- package/dist/src/editors/templates/annotations.js.map +1 -1
- package/dist/src/editors/templates/series.d.ts +1 -0
- package/dist/src/editors/templates/series.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/scichart/ox-scichart.d.ts +3 -2
- package/dist/src/scichart/ox-scichart.js.map +1 -1
- package/dist/src/scichart/scichart-builder.d.ts +1 -0
- package/dist/src/scichart/scichart-builder.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -7
- package/types/types.d.ts +1 -1
- package/dist/stories/common.d.ts +0 -7
- package/dist/stories/common.js +0 -78
- package/dist/stories/common.js.map +0 -1
- package/dist/stories/ox-input-chart-bar.stories.d.ts +0 -25
- package/dist/stories/ox-input-chart-bar.stories.js +0 -173
- package/dist/stories/ox-input-chart-bar.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-doughnut.stories.d.ts +0 -27
- package/dist/stories/ox-input-chart-doughnut.stories.js +0 -115
- package/dist/stories/ox-input-chart-doughnut.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-hbar.stories.d.ts +0 -25
- package/dist/stories/ox-input-chart-hbar.stories.js +0 -174
- package/dist/stories/ox-input-chart-hbar.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-line.stories.d.ts +0 -25
- package/dist/stories/ox-input-chart-line.stories.js +0 -184
- package/dist/stories/ox-input-chart-line.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-pie.stories.d.ts +0 -27
- package/dist/stories/ox-input-chart-pie.stories.js +0 -115
- package/dist/stories/ox-input-chart-pie.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-polar-area.stories.d.ts +0 -27
- package/dist/stories/ox-input-chart-polar-area.stories.js +0 -115
- package/dist/stories/ox-input-chart-polar-area.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-radar.stories.d.ts +0 -27
- package/dist/stories/ox-input-chart-radar.stories.js +0 -126
- package/dist/stories/ox-input-chart-radar.stories.js.map +0 -1
- package/dist/stories/ox-input-chart-timeseries.stories.d.ts +0 -25
- package/dist/stories/ox-input-chart-timeseries.stories.js +0 -253
- package/dist/stories/ox-input-chart-timeseries.stories.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-input-chart-radar.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-radar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;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,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAClC,CAAC;IACH,CAAC;AACH,CAAC;;sCAE+B,IAAI;;CAEzC,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,kBAAkB,EAAE,CAAC;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACzC,QAAQ,CAAC,IAAI,GAAG;IACd,KAAK,EAAE;QACL,GAAG,qBAAqB,CAAC,OAAO,CAAC;QACjC,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,gBAAgB;oBACvB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oBAClB,eAAe,EAAE,yBAAyB;oBAC1C,WAAW,EAAE,uBAAuB;oBACpC,WAAW,EAAE,CAAC;oBACd,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,CAAC;iBACf;gBACD;oBACE,KAAK,EAAE,gBAAgB;oBACvB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oBAClB,eAAe,EAAE,yBAAyB;oBAC1C,WAAW,EAAE,uBAAuB;oBACpC,WAAW,EAAE,CAAC;oBACd,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,CAAC;iBACf;aACF;YACD,YAAY,EAAE,QAAQ;SACvB;QACD,OAAO,EAAE;YACP,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;SAC1B;KACF;IACD,kBAAkB,EAAE,CAAC;CACtB,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\n\nimport '../src/editors/ox-input-chart-radar.js'\nimport '../src/chartjs/ox-chart-js.js'\n\nimport { data, getDefaultChartConfig } from './common.js'\n\nexport default {\n title: 'ox-input-chart-radar',\n component: 'ox-input-chart-radar',\n argTypes: {\n value: { control: 'object' },\n currentSeriesIndex: { control: 'number' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n value: OperatoChart.ChartConfig\n currentSeriesIndex: number\n}\n\nconst Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <style>\n .container {\n width: 100%;\n height: 100%;\n\n display: flex;\n flex-direction: row;\n overflow-y: auto;\n padding: var(--spacing-medium);\n }\n\n .container.dark {\n background-color: black;\n }\n\n #editor {\n width: 300px;\n }\n\n #chart {\n flex: 1;\n }\n </style>\n\n <div style=\"background-color: black; color: white;\">\n Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey\n </div>\n\n <div class=\"container light\">\n <ox-input-chart-radar\n chart-type=\"radar\"\n id=\"editor\"\n .value=${value}\n @change=${(e: CustomEvent) => {\n const target = e.currentTarget as any\n const config = target.value\n const chartjs = document.querySelector('#chartjs') as HTMLElement\n if (chartjs) {\n ;(chartjs as any).config = { ...config }\n }\n\n const container = document.querySelector('.container') as HTMLElement\n if (container) {\n const theme = config.options.theme\n if (theme == 'dark') {\n container.classList.remove('light')\n container.classList.add('dark')\n } else {\n container.classList.remove('dark')\n container.classList.add('light')\n }\n }\n }}\n ></ox-input-chart-radar>\n <ox-chart-js id=\"chartjs\" .data=${data}></ox-chart-js>\n </div>\n`\n\nexport const Default = Template.bind({})\nDefault.args = {\n currentSeriesIndex: 0\n}\n\nexport const WithData = Template.bind({})\nWithData.args = {\n value: {\n ...getDefaultChartConfig('radar'),\n data: {\n datasets: [\n {\n label: 'Radar Series 1',\n data: [10, 20, 30],\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 1,\n pointStyle: 'circle',\n pointRadius: 3\n },\n {\n label: 'Radar Series 2',\n data: [15, 25, 35],\n backgroundColor: 'rgba(54, 162, 235, 0.2)',\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n pointStyle: 'circle',\n pointRadius: 3\n }\n ],\n labelDataKey: 'labels'\n },\n options: {\n legend: { display: true }\n }\n },\n currentSeriesIndex: 0\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
declare const _default: {
|
|
6
|
-
title: string;
|
|
7
|
-
component: string;
|
|
8
|
-
argTypes: {
|
|
9
|
-
value: {
|
|
10
|
-
control: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
15
|
-
interface Story<T> {
|
|
16
|
-
(args: T): TemplateResult;
|
|
17
|
-
args?: Partial<T>;
|
|
18
|
-
argTypes?: Record<string, unknown>;
|
|
19
|
-
}
|
|
20
|
-
interface ArgTypes {
|
|
21
|
-
value: OperatoChart.ChartConfig;
|
|
22
|
-
}
|
|
23
|
-
export declare const Default: Story<ArgTypes>;
|
|
24
|
-
export declare const WithData: Story<ArgTypes>;
|
|
25
|
-
export declare const MultiAxis: Story<ArgTypes>;
|
|
@@ -1,253 +0,0 @@
|
|
|
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" .data=${data} attr-x="timestamp" attr-y="count"></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
|
-
export const MultiAxis = Template.bind({});
|
|
147
|
-
MultiAxis.args = {
|
|
148
|
-
value: {
|
|
149
|
-
...getDefaultChartConfig('line'),
|
|
150
|
-
data: {
|
|
151
|
-
datasets: [
|
|
152
|
-
{
|
|
153
|
-
label: 'Bar Series',
|
|
154
|
-
type: 'bar',
|
|
155
|
-
dataKey: 'count',
|
|
156
|
-
axisTitle: 'count',
|
|
157
|
-
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
158
|
-
borderColor: 'rgba(255, 99, 132, 1)',
|
|
159
|
-
borderWidth: 1,
|
|
160
|
-
yAxisID: 'left'
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
label: 'Line Series',
|
|
164
|
-
type: 'line',
|
|
165
|
-
dataKey: 'average',
|
|
166
|
-
axisTitle: 'average',
|
|
167
|
-
color: 'rgba(54, 162, 235, 1)',
|
|
168
|
-
borderWidth: 1,
|
|
169
|
-
fill: false,
|
|
170
|
-
lineTension: 0.4,
|
|
171
|
-
pointStyle: 'rect',
|
|
172
|
-
pointRadius: 3,
|
|
173
|
-
yAxisID: 'right'
|
|
174
|
-
}
|
|
175
|
-
],
|
|
176
|
-
labelDataKey: 'timestamp'
|
|
177
|
-
},
|
|
178
|
-
options: {
|
|
179
|
-
scales: {
|
|
180
|
-
xAxes: [
|
|
181
|
-
{
|
|
182
|
-
axisTitle: 'timestamp',
|
|
183
|
-
ticks: { beginAtZero: true }
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
yAxes: [
|
|
187
|
-
{
|
|
188
|
-
axisTitle: 'count',
|
|
189
|
-
ticks: { beginAtZero: true }
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
axisTitle: 'average',
|
|
193
|
-
ticks: { beginAtZero: true }
|
|
194
|
-
}
|
|
195
|
-
]
|
|
196
|
-
},
|
|
197
|
-
multiAxis: true,
|
|
198
|
-
legend: { display: true },
|
|
199
|
-
annotations: [
|
|
200
|
-
{
|
|
201
|
-
type: 'line',
|
|
202
|
-
x1: 0,
|
|
203
|
-
y1: -10,
|
|
204
|
-
x2: 1,
|
|
205
|
-
y2: 10,
|
|
206
|
-
stroke: 'red',
|
|
207
|
-
strokeThickness: 5,
|
|
208
|
-
xCoordinateMode: 'Relative',
|
|
209
|
-
yCoordinateMode: 'DataValue'
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
type: 'text',
|
|
213
|
-
x1: 0.5,
|
|
214
|
-
y1: 0,
|
|
215
|
-
text: 'Hello',
|
|
216
|
-
fontSize: 50,
|
|
217
|
-
stroke: 'blue',
|
|
218
|
-
xCoordinateMode: 'Relative',
|
|
219
|
-
yCoordinateMode: 'DataValue'
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
type: 'box',
|
|
223
|
-
x1: 0.2,
|
|
224
|
-
y1: 10,
|
|
225
|
-
x2: 0.5,
|
|
226
|
-
y2: 20,
|
|
227
|
-
fill: 'green',
|
|
228
|
-
stroke: 'blue',
|
|
229
|
-
strokeThickness: 10,
|
|
230
|
-
xCoordinateMode: 'Relative',
|
|
231
|
-
yCoordinateMode: 'DataValue'
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
type: 'horizontalLine',
|
|
235
|
-
y1: 20,
|
|
236
|
-
stroke: 'purple',
|
|
237
|
-
strokeThickness: 5,
|
|
238
|
-
xCoordinateMode: 'Relative',
|
|
239
|
-
yCoordinateMode: 'DataValue'
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
type: 'verticalLine',
|
|
243
|
-
x1: 0.8,
|
|
244
|
-
stroke: 'orange',
|
|
245
|
-
strokeThickness: 5,
|
|
246
|
-
xCoordinateMode: 'Relative',
|
|
247
|
-
yCoordinateMode: 'DataValue'
|
|
248
|
-
}
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
};
|
|
253
|
-
//# sourceMappingURL=ox-input-chart-timeseries.stories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-input-chart-timeseries.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-timeseries.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,6CAA6C,CAAA;AACpD,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,qBAAq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AE,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,MAAM,EAAE,MAAM;oBACd,eAAe,EAAE,EAAE;oBACnB,eAAe,EAAE,UAAU;oBAC3B,eAAe,EAAE,WAAW;iBAC7B;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,EAAE,EAAE,EAAE;oBACN,MAAM,EAAE,QAAQ;oBAChB,eAAe,EAAE,CAAC;oBAClB,eAAe,EAAE,UAAU;oBAC3B,eAAe,EAAE,WAAW;iBAC7B;gBACD;oBACE,IAAI,EAAE,cAAc;oBACpB,EAAE,EAAE,GAAG;oBACP,MAAM,EAAE,QAAQ;oBAChB,eAAe,EAAE,CAAC;oBAClB,eAAe,EAAE,UAAU;oBAC3B,eAAe,EAAE,WAAW;iBAC7B;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\n\nimport '../src/editors/ox-input-chart-timeseries.js'\nimport '../src/chartjs/ox-chart-js.js'\nimport '../src/scichart/ox-scichart.js'\n\nimport { data, getDefaultChartConfig } from './common.js'\n\nexport default {\n title: 'ox-input-chart-timeseries',\n component: 'ox-input-chart-timeseries',\n argTypes: {\n value: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n value: OperatoChart.ChartConfig\n}\n\nfunction showCharts(e: Event) {\n const target = e.currentTarget as any\n const config = target.value\n const chartjs = document.querySelector('#chartjs') as HTMLElement\n if (chartjs) {\n ;(chartjs as any).config = { ...config }\n }\n const scichart = document.querySelector('#scichart') as HTMLElement\n if (scichart) {\n ;(scichart as any).config = config\n }\n}\n\nconst Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <style>\n .desc {\n color: var(--md-sys-color-background);\n background-color: var(--md-sys-color-on-background);\n padding: var(--spacing-small);\n }\n\n .container {\n display: flex;\n flex-direction: row;\n overflow-y: auto;\n padding: var(--spacing-medium);\n gap: var(--spacing-medium);\n\n color: var(--md-sys-color-on-background);\n background-color: var(--md-sys-color-background);\n }\n\n #editor {\n width: 300px;\n }\n\n #charts {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium);\n }\n\n #chartjs {\n flex: 1;\n }\n\n #scichart {\n flex: 1;\n }\n </style>\n\n <div class=\"desc\">Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey</div>\n\n <div class=\"container\">\n <ox-input-chart-timeseries\n chart-type=\"line\"\n id=\"editor\"\n .value=${value}\n @change=${showCharts}\n ></ox-input-chart-timeseries>\n <div id=\"charts\">\n <ox-scichart id=\"scichart\" .data=${data} attr-x=\"timestamp\" attr-y=\"count\"></ox-scichart>\n <!-- <ox-chart-js id=\"chartjs\" .data=${data}></ox-chart-js> -->\n </div>\n </div>\n`\n\nexport const Default = Template.bind({})\nDefault.args = {}\n\nexport const WithData = Template.bind({})\nWithData.args = {\n value: {\n ...getDefaultChartConfig('line'),\n data: {\n datasets: [\n {\n dataKey: 'count',\n label: '라인 시리즈 카운트',\n type: 'line',\n color: 'rgba(255, 99, 132, 1)',\n borderWidth: 1\n },\n {\n dataKey: 'average',\n label: '라인 시리즈 평균값',\n type: 'line',\n color: 'rgba(54, 162, 235, 1)',\n fill: false,\n lineTension: 0.4,\n pointStyle: 'circle',\n pointRadius: 3\n }\n ],\n labelDataKey: 'timestamp'\n },\n options: {\n scales: {\n xAxes: [\n {\n axisTitle: 'timestamp',\n ticks: { beginAtZero: true }\n }\n ],\n yAxes: [\n {\n axisTitle: 'count',\n ticks: { beginAtZero: true }\n }\n ]\n },\n legend: { display: true }\n }\n }\n}\n\nexport const MultiAxis = Template.bind({})\nMultiAxis.args = {\n value: {\n ...getDefaultChartConfig('line'),\n data: {\n datasets: [\n {\n label: 'Bar Series',\n type: 'bar',\n dataKey: 'count',\n axisTitle: 'count',\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 1,\n yAxisID: 'left'\n },\n {\n label: 'Line Series',\n type: 'line',\n dataKey: 'average',\n axisTitle: 'average',\n color: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n fill: false,\n lineTension: 0.4,\n pointStyle: 'rect',\n pointRadius: 3,\n yAxisID: 'right'\n }\n ],\n labelDataKey: 'timestamp'\n },\n options: {\n scales: {\n xAxes: [\n {\n axisTitle: 'timestamp',\n ticks: { beginAtZero: true }\n }\n ],\n yAxes: [\n {\n axisTitle: 'count',\n ticks: { beginAtZero: true }\n },\n {\n axisTitle: 'average',\n ticks: { beginAtZero: true }\n }\n ]\n },\n multiAxis: true,\n legend: { display: true },\n annotations: [\n {\n type: 'line',\n x1: 0,\n y1: -10,\n x2: 1,\n y2: 10,\n stroke: 'red',\n strokeThickness: 5,\n xCoordinateMode: 'Relative',\n yCoordinateMode: 'DataValue'\n },\n {\n type: 'text',\n x1: 0.5,\n y1: 0,\n text: 'Hello',\n fontSize: 50,\n stroke: 'blue',\n xCoordinateMode: 'Relative',\n yCoordinateMode: 'DataValue'\n },\n {\n type: 'box',\n x1: 0.2,\n y1: 10,\n x2: 0.5,\n y2: 20,\n fill: 'green',\n stroke: 'blue',\n strokeThickness: 10,\n xCoordinateMode: 'Relative',\n yCoordinateMode: 'DataValue'\n },\n {\n type: 'horizontalLine',\n y1: 20,\n stroke: 'purple',\n strokeThickness: 5,\n xCoordinateMode: 'Relative',\n yCoordinateMode: 'DataValue'\n },\n {\n type: 'verticalLine',\n x1: 0.8,\n stroke: 'orange',\n strokeThickness: 5,\n xCoordinateMode: 'Relative',\n yCoordinateMode: 'DataValue'\n }\n ]\n }\n }\n}\n"]}
|