@operato/chart 9.0.0-beta.7 → 9.0.0-beta.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 (66) hide show
  1. package/CHANGELOG.md +341 -0
  2. package/dist/src/chartjs/config-converter.d.ts +1 -0
  3. package/dist/src/chartjs/config-converter.js.map +1 -1
  4. package/dist/src/chartjs/ox-chart-js.d.ts +3 -2
  5. package/dist/src/chartjs/ox-chart-js.js.map +1 -1
  6. package/dist/src/editors/configurer.d.ts +3 -2
  7. package/dist/src/editors/configurer.js.map +1 -1
  8. package/dist/src/editors/input-chart-abstract.d.ts +2 -1
  9. package/dist/src/editors/input-chart-abstract.js +1 -1
  10. package/dist/src/editors/input-chart-abstract.js.map +1 -1
  11. package/dist/src/editors/input-chart-styles.js +12 -11
  12. package/dist/src/editors/input-chart-styles.js.map +1 -1
  13. package/dist/src/editors/ox-input-chart-hbar.d.ts +1 -0
  14. package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
  15. package/dist/src/editors/ox-input-chart-pie.d.ts +1 -0
  16. package/dist/src/editors/ox-input-chart-pie.js.map +1 -1
  17. package/dist/src/editors/ox-input-chart-radar.d.ts +1 -0
  18. package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
  19. package/dist/src/editors/ox-input-chart-timeseries.js +1 -1
  20. package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
  21. package/dist/src/editors/ox-property-editor-chart.js +3 -3
  22. package/dist/src/editors/ox-property-editor-chart.js.map +1 -1
  23. package/dist/src/editors/templates/annotations.d.ts +1 -0
  24. package/dist/src/editors/templates/annotations.js +10 -0
  25. package/dist/src/editors/templates/annotations.js.map +1 -1
  26. package/dist/src/editors/templates/series.d.ts +1 -0
  27. package/dist/src/editors/templates/series.js.map +1 -1
  28. package/dist/src/index.d.ts +1 -0
  29. package/dist/src/index.js +2 -1
  30. package/dist/src/index.js.map +1 -1
  31. package/dist/src/scichart/ox-scichart.d.ts +3 -2
  32. package/dist/src/scichart/ox-scichart.js +7 -3
  33. package/dist/src/scichart/ox-scichart.js.map +1 -1
  34. package/dist/src/scichart/scichart-builder.d.ts +2 -1
  35. package/dist/src/scichart/scichart-builder.js +225 -63
  36. package/dist/src/scichart/scichart-builder.js.map +1 -1
  37. package/dist/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +13 -7
  39. package/types/types.d.ts +2 -1
  40. package/dist/stories/common.d.ts +0 -7
  41. package/dist/stories/common.js +0 -78
  42. package/dist/stories/common.js.map +0 -1
  43. package/dist/stories/ox-input-chart-bar.stories.d.ts +0 -25
  44. package/dist/stories/ox-input-chart-bar.stories.js +0 -173
  45. package/dist/stories/ox-input-chart-bar.stories.js.map +0 -1
  46. package/dist/stories/ox-input-chart-doughnut.stories.d.ts +0 -27
  47. package/dist/stories/ox-input-chart-doughnut.stories.js +0 -115
  48. package/dist/stories/ox-input-chart-doughnut.stories.js.map +0 -1
  49. package/dist/stories/ox-input-chart-hbar.stories.d.ts +0 -25
  50. package/dist/stories/ox-input-chart-hbar.stories.js +0 -174
  51. package/dist/stories/ox-input-chart-hbar.stories.js.map +0 -1
  52. package/dist/stories/ox-input-chart-line.stories.d.ts +0 -25
  53. package/dist/stories/ox-input-chart-line.stories.js +0 -184
  54. package/dist/stories/ox-input-chart-line.stories.js.map +0 -1
  55. package/dist/stories/ox-input-chart-pie.stories.d.ts +0 -27
  56. package/dist/stories/ox-input-chart-pie.stories.js +0 -115
  57. package/dist/stories/ox-input-chart-pie.stories.js.map +0 -1
  58. package/dist/stories/ox-input-chart-polar-area.stories.d.ts +0 -27
  59. package/dist/stories/ox-input-chart-polar-area.stories.js +0 -115
  60. package/dist/stories/ox-input-chart-polar-area.stories.js.map +0 -1
  61. package/dist/stories/ox-input-chart-radar.stories.d.ts +0 -27
  62. package/dist/stories/ox-input-chart-radar.stories.js +0 -126
  63. package/dist/stories/ox-input-chart-radar.stories.js.map +0 -1
  64. package/dist/stories/ox-input-chart-timeseries.stories.d.ts +0 -25
  65. package/dist/stories/ox-input-chart-timeseries.stories.js +0 -253
  66. package/dist/stories/ox-input-chart-timeseries.stories.js.map +0 -1
@@ -1,184 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-input-chart-line.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-line.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,+BAA+B,CAAA;AACtC,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,sBAAsB;IACjC,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC7B;CACF,CAAA;AAYD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA8DhD,KAAK;gBACJ,CAAC,CAAc,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,CAAC,CAAC,aAAoB,CAAA;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAA;IAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC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AAO,EAAE,MAAM;iBAChB;gBACD;oBACE,KAAK,EAAE,aAAa;oBACpB,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oBAClB,WAAW,EAAE,uBAAuB;oBACpC,WAAW,EAAE,CAAC;oBACd,IAAI,EAAE,KAAK;oBACX,WAAW,EAAE,GAAG;oBAChB,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,CAAC;oBACd,OAAO,EAAE,OAAO;iBACjB;aACF;YACD,YAAY,EAAE,QAAQ;SACvB;KACF;CACF,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\n\nimport '../src/editors/ox-input-chart-mixed.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-mixed for line',\n component: 'ox-input-chart-mixed',\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\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 .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 #charts {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n padding: 10px;\n }\n\n #chartjs {\n flex: 1;\n }\n\n #scichart {\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-mixed\n chart-type=\"line\"\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 const scichart = document.querySelector('#scichart') as HTMLElement\n if (scichart) {\n ;(scichart 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-mixed>\n <div id=\"charts\">\n <ox-chart-js id=\"chartjs\" .data=${data}></ox-chart-js>\n <ox-scichart id=\"scichart\"></ox-scichart>\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 label: 'Bar Series',\n type: 'bar',\n data: [10, 20, 30],\n backgroundColor: 'rgba(255, 99, 132, 0.2)',\n borderColor: 'rgba(255, 99, 132, 1)',\n borderWidth: 1\n },\n {\n label: 'Line Series',\n type: 'line',\n data: [15, 25, 35],\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n fill: false,\n lineTension: 0.4,\n pointStyle: 'circle',\n pointRadius: 3\n }\n ],\n labelDataKey: 'labels'\n },\n options: {\n scales: {\n xAxes: [{ ticks: { beginAtZero: true } }],\n yAxes: [{ ticks: { beginAtZero: true } }]\n },\n legend: { display: true }\n }\n }\n}\n\nexport const MultiAxis = Template.bind({})\nMultiAxis.args = {\n value: {\n ...getDefaultChartConfig('line'),\n options: {\n ...getDefaultChartConfig('line').options,\n multiAxis: true\n },\n data: {\n datasets: [\n {\n label: 'Bar Series',\n type: 'bar',\n data: [10, 20, 30],\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 data: [15, 25, 35],\n borderColor: 'rgba(54, 162, 235, 1)',\n borderWidth: 1,\n fill: false,\n lineTension: 0.4,\n pointStyle: 'circle',\n pointRadius: 3,\n yAxisID: 'right'\n }\n ],\n labelDataKey: 'labels'\n }\n }\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { TemplateResult } from 'lit';
2
- import '../src/editors/ox-input-chart-pie.js';
3
- import '../src/chartjs/ox-chart-js.js';
4
- declare const _default: {
5
- title: string;
6
- component: string;
7
- argTypes: {
8
- value: {
9
- control: string;
10
- };
11
- currentSeriesIndex: {
12
- control: string;
13
- };
14
- };
15
- };
16
- export default _default;
17
- interface Story<T> {
18
- (args: T): TemplateResult;
19
- args?: Partial<T>;
20
- argTypes?: Record<string, unknown>;
21
- }
22
- interface ArgTypes {
23
- value: OperatoChart.ChartConfig;
24
- currentSeriesIndex: number;
25
- }
26
- export declare const Default: Story<ArgTypes>;
27
- export declare const WithData: Story<ArgTypes>;
@@ -1,115 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-input-chart-pie.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-pie.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,kBAAkB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC1C;CACF,CAAA;AAaD,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAkDpE,KAAK;gBACJ,CAAC,CAAc,EAAE,EAAE;IAC3B,MAAM,MAAM,GAAG,CAAC,CAAC,aAAoB,CAAA;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAA;IAC3B,MAAM,OAAO,GAAG,QAAQ,CAAC,aAA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uBAAuB,CAAC;oBACxF,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-pie.js'\nimport '../src/chartjs/ox-chart-js.js'\n\nimport { data, getDefaultChartConfig } from './common.js'\n\nexport default {\n title: 'ox-input-chart-pie',\n component: 'ox-input-chart-pie',\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-pie\n chart-type=\"pie\"\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-pie>\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('pie'),\n data: {\n datasets: [\n {\n label: 'Pie Series 1',\n data: [10, 20, 30],\n backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],\n borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],\n borderWidth: 1\n }\n ],\n labelDataKey: 'labels'\n },\n options: {\n legend: { display: true }\n }\n },\n currentSeriesIndex: 0\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { TemplateResult } from 'lit';
2
- import '../src/editors/ox-input-chart-pie.js';
3
- import '../src/chartjs/ox-chart-js.js';
4
- declare const _default: {
5
- title: string;
6
- component: string;
7
- argTypes: {
8
- value: {
9
- control: string;
10
- };
11
- currentSeriesIndex: {
12
- control: string;
13
- };
14
- };
15
- };
16
- export default _default;
17
- interface Story<T> {
18
- (args: T): TemplateResult;
19
- args?: Partial<T>;
20
- argTypes?: Record<string, unknown>;
21
- }
22
- interface ArgTypes {
23
- value: OperatoChart.ChartConfig;
24
- currentSeriesIndex: number;
25
- }
26
- export declare const Default: Story<ArgTypes>;
27
- export declare const WithData: Story<ArgTypes>;
@@ -1,115 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-input-chart-polar-area.stories.js","sourceRoot":"","sources":["../../stories/ox-input-chart-polar-area.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,sCAAsC,CAAA;AAC7C,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAe;IACb,KAAK,EAAE,mCAAmC;IAC1C,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;QAC5B,kBAAkB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC1C;CACF,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C,CAAA;AACzC,QAAQ,CAAC,IAAI,GAAG;IACd,KAAK,EAAE;QACL,GAAG,qBAAqB,CAAC,WAAW,CAAC;QACrC,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR;oBACE,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oBAClB,eAAe,EAAE,CAAC,yBAAyB,EAAE,yBAAyB,EAAE,yBAAyB,CAAC;oBAClG,WAAW,EAAE,CAAC,uBAAuB,EAAE,uBAAuB,EAAE,uBAAuB,CAAC;oBACxF,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-pie.js'\nimport '../src/chartjs/ox-chart-js.js'\n\nimport { data, getDefaultChartConfig } from './common.js'\n\nexport default {\n title: 'ox-input-chart-pie for polla-area',\n component: 'ox-input-chart-pie',\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-pie\n chart-type=\"polarArea\"\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-pie>\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('polarArea'),\n data: {\n datasets: [\n {\n label: 'PolarArea Series',\n data: [10, 20, 30],\n backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],\n borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],\n borderWidth: 1\n }\n ],\n labelDataKey: 'labels'\n },\n options: {\n legend: { display: true }\n }\n },\n currentSeriesIndex: 0\n}\n"]}
@@ -1,27 +0,0 @@
1
- import { TemplateResult } from 'lit';
2
- import '../src/editors/ox-input-chart-radar.js';
3
- import '../src/chartjs/ox-chart-js.js';
4
- declare const _default: {
5
- title: string;
6
- component: string;
7
- argTypes: {
8
- value: {
9
- control: string;
10
- };
11
- currentSeriesIndex: {
12
- control: string;
13
- };
14
- };
15
- };
16
- export default _default;
17
- interface Story<T> {
18
- (args: T): TemplateResult;
19
- args?: Partial<T>;
20
- argTypes?: Record<string, unknown>;
21
- }
22
- interface ArgTypes {
23
- value: OperatoChart.ChartConfig;
24
- currentSeriesIndex: number;
25
- }
26
- export declare const Default: Story<ArgTypes>;
27
- export declare const WithData: Story<ArgTypes>;
@@ -1,126 +0,0 @@
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