@operato/chart 8.0.0-alpha.9 → 8.0.0-beta.1

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 (61) hide show
  1. package/CHANGELOG.md +197 -0
  2. package/dist/src/editors/configurer.d.ts +2 -2
  3. package/dist/src/editors/ox-input-chart-hbar.js +6 -1
  4. package/dist/src/editors/ox-input-chart-hbar.js.map +1 -1
  5. package/dist/src/editors/ox-input-chart-mixed.js +6 -1
  6. package/dist/src/editors/ox-input-chart-mixed.js.map +1 -1
  7. package/dist/src/editors/ox-input-chart-radar.js +6 -1
  8. package/dist/src/editors/ox-input-chart-radar.js.map +1 -1
  9. package/dist/src/editors/ox-input-chart-timeseries.js +7 -1
  10. package/dist/src/editors/ox-input-chart-timeseries.js.map +1 -1
  11. package/dist/src/editors/templates/annotations.d.ts +1 -0
  12. package/dist/src/editors/templates/annotations.js +5 -0
  13. package/dist/src/editors/templates/annotations.js.map +1 -1
  14. package/dist/src/editors/templates/display-value.js +7 -6
  15. package/dist/src/editors/templates/display-value.js.map +1 -1
  16. package/dist/src/editors/templates/series.d.ts +1 -0
  17. package/dist/src/editors/templates/series.js +5 -0
  18. package/dist/src/editors/templates/series.js.map +1 -1
  19. package/dist/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +14 -14
  21. package/.editorconfig +0 -29
  22. package/.storybook/main.js +0 -3
  23. package/.storybook/preview.js +0 -52
  24. package/.storybook/server.mjs +0 -8
  25. package/assets/images/icon-editor-gradient-direction.png +0 -0
  26. package/assets/images/icon-properties-label.png +0 -0
  27. package/assets/images/icon-properties-line-type.png +0 -0
  28. package/assets/images/icon-properties-table.png +0 -0
  29. package/src/chartjs/config-converter.ts +0 -341
  30. package/src/chartjs/ox-chart-js.ts +0 -207
  31. package/src/editors/configurer.ts +0 -336
  32. package/src/editors/index.ts +0 -8
  33. package/src/editors/input-chart-abstract.ts +0 -202
  34. package/src/editors/input-chart-styles.ts +0 -206
  35. package/src/editors/ox-input-chart-hbar.ts +0 -152
  36. package/src/editors/ox-input-chart-mixed.ts +0 -236
  37. package/src/editors/ox-input-chart-pie.ts +0 -69
  38. package/src/editors/ox-input-chart-radar.ts +0 -51
  39. package/src/editors/ox-input-chart-timeseries.ts +0 -273
  40. package/src/editors/ox-property-editor-chart.ts +0 -72
  41. package/src/editors/templates/annotations.ts +0 -287
  42. package/src/editors/templates/display-value.ts +0 -110
  43. package/src/editors/templates/series.ts +0 -308
  44. package/src/global.d.ts +0 -1
  45. package/src/index.ts +0 -0
  46. package/src/progress/ox-progress-circle.ts +0 -133
  47. package/src/scichart/ox-scichart.ts +0 -151
  48. package/src/scichart/scichart-builder.ts +0 -508
  49. package/src/types.d.ts +0 -124
  50. package/stories/common.ts +0 -87
  51. package/stories/ox-input-chart-bar.stories.ts +0 -188
  52. package/stories/ox-input-chart-doughnut.stories.ts +0 -130
  53. package/stories/ox-input-chart-hbar.stories.ts +0 -188
  54. package/stories/ox-input-chart-line.stories.ts +0 -198
  55. package/stories/ox-input-chart-pie.stories.ts +0 -130
  56. package/stories/ox-input-chart-polar-area.stories.ts +0 -130
  57. package/stories/ox-input-chart-radar.stories.ts +0 -141
  58. package/stories/ox-input-chart-timeseries.stories.ts +0 -268
  59. package/tsconfig.json +0 -25
  60. package/web-dev-server.config.mjs +0 -27
  61. package/web-test-runner.config.mjs +0 -41
@@ -1,198 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-mixed.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
- import '../src/scichart/ox-scichart.js'
6
-
7
- import { data, getDefaultChartConfig } from './common.js'
8
-
9
- export default {
10
- title: 'ox-input-chart-mixed for line',
11
- component: 'ox-input-chart-mixed',
12
- argTypes: {
13
- value: { control: 'object' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- }
26
-
27
- const Template: Story<ArgTypes> = ({ value }: ArgTypes) => 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
- .container {
47
- width: 100%;
48
- height: 100%;
49
-
50
- display: flex;
51
- flex-direction: row;
52
- overflow-y: auto;
53
- padding: var(--spacing-medium);
54
- }
55
-
56
- .container.dark {
57
- background-color: black;
58
- }
59
-
60
- #editor {
61
- width: 300px;
62
- }
63
-
64
- #charts {
65
- flex: 1;
66
-
67
- display: flex;
68
- flex-direction: column;
69
- padding: 10px;
70
- }
71
-
72
- #chartjs {
73
- flex: 1;
74
- }
75
-
76
- #scichart {
77
- flex: 1;
78
- }
79
- </style>
80
-
81
- <div style="background-color: black; color: white;">
82
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
83
- </div>
84
-
85
- <div class="container light">
86
- <ox-input-chart-mixed
87
- chart-type="line"
88
- id="editor"
89
- .value=${value}
90
- @change=${(e: CustomEvent) => {
91
- const target = e.currentTarget as any
92
- const config = target.value
93
- const chartjs = document.querySelector('#chartjs') as HTMLElement
94
- if (chartjs) {
95
- ;(chartjs as any).config = { ...config }
96
- }
97
- const scichart = document.querySelector('#scichart') as HTMLElement
98
- if (scichart) {
99
- ;(scichart as any).config = config
100
- }
101
-
102
- const container = document.querySelector('.container') as HTMLElement
103
- if (container) {
104
- const theme = config.options.theme
105
- if (theme == 'dark') {
106
- container.classList.remove('light')
107
- container.classList.add('dark')
108
- } else {
109
- container.classList.remove('dark')
110
- container.classList.add('light')
111
- }
112
- }
113
- }}
114
- ></ox-input-chart-mixed>
115
- <div id="charts">
116
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
117
- <ox-scichart id="scichart"></ox-scichart>
118
- </div>
119
- </div>
120
- `
121
-
122
- export const Default = Template.bind({})
123
- Default.args = {}
124
-
125
- export const WithData = Template.bind({})
126
- WithData.args = {
127
- value: {
128
- ...getDefaultChartConfig('line'),
129
- data: {
130
- datasets: [
131
- {
132
- label: 'Bar Series',
133
- type: 'bar',
134
- data: [10, 20, 30],
135
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
136
- borderColor: 'rgba(255, 99, 132, 1)',
137
- borderWidth: 1
138
- },
139
- {
140
- label: 'Line Series',
141
- type: 'line',
142
- data: [15, 25, 35],
143
- borderColor: 'rgba(54, 162, 235, 1)',
144
- borderWidth: 1,
145
- fill: false,
146
- lineTension: 0.4,
147
- pointStyle: 'circle',
148
- pointRadius: 3
149
- }
150
- ],
151
- labelDataKey: 'labels'
152
- },
153
- options: {
154
- scales: {
155
- xAxes: [{ ticks: { beginAtZero: true } }],
156
- yAxes: [{ ticks: { beginAtZero: true } }]
157
- },
158
- legend: { display: true }
159
- }
160
- }
161
- }
162
-
163
- export const MultiAxis = Template.bind({})
164
- MultiAxis.args = {
165
- value: {
166
- ...getDefaultChartConfig('line'),
167
- options: {
168
- ...getDefaultChartConfig('line').options,
169
- multiAxis: true
170
- },
171
- data: {
172
- datasets: [
173
- {
174
- label: 'Bar Series',
175
- type: 'bar',
176
- data: [10, 20, 30],
177
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
178
- borderColor: 'rgba(255, 99, 132, 1)',
179
- borderWidth: 1,
180
- yAxisID: 'left'
181
- },
182
- {
183
- label: 'Line Series',
184
- type: 'line',
185
- data: [15, 25, 35],
186
- borderColor: 'rgba(54, 162, 235, 1)',
187
- borderWidth: 1,
188
- fill: false,
189
- lineTension: 0.4,
190
- pointStyle: 'circle',
191
- pointRadius: 3,
192
- yAxisID: 'right'
193
- }
194
- ],
195
- labelDataKey: 'labels'
196
- }
197
- }
198
- }
@@ -1,130 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-pie.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-pie',
10
- component: 'ox-input-chart-pie',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-pie
76
- chart-type="pie"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-pie>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('pie'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'Pie Series 1',
117
- data: [10, 20, 30],
118
- backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
119
- borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
120
- borderWidth: 1
121
- }
122
- ],
123
- labelDataKey: 'labels'
124
- },
125
- options: {
126
- legend: { display: true }
127
- }
128
- },
129
- currentSeriesIndex: 0
130
- }
@@ -1,130 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-pie.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-pie for polla-area',
10
- component: 'ox-input-chart-pie',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-pie
76
- chart-type="polarArea"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-pie>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('polarArea'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'PolarArea Series',
117
- data: [10, 20, 30],
118
- backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
119
- borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
120
- borderWidth: 1
121
- }
122
- ],
123
- labelDataKey: 'labels'
124
- },
125
- options: {
126
- legend: { display: true }
127
- }
128
- },
129
- currentSeriesIndex: 0
130
- }
@@ -1,141 +0,0 @@
1
- import { html, TemplateResult } from 'lit'
2
-
3
- import '../src/editors/ox-input-chart-radar.js'
4
- import '../src/chartjs/ox-chart-js.js'
5
-
6
- import { data, getDefaultChartConfig } from './common.js'
7
-
8
- export default {
9
- title: 'ox-input-chart-radar',
10
- component: 'ox-input-chart-radar',
11
- argTypes: {
12
- value: { control: 'object' },
13
- currentSeriesIndex: { control: 'number' }
14
- }
15
- }
16
-
17
- interface Story<T> {
18
- (args: T): TemplateResult
19
- args?: Partial<T>
20
- argTypes?: Record<string, unknown>
21
- }
22
-
23
- interface ArgTypes {
24
- value: OperatoChart.ChartConfig
25
- currentSeriesIndex: number
26
- }
27
-
28
- const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
29
- <link
30
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
31
- rel="stylesheet"
32
- />
33
- <link
34
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
35
- rel="stylesheet"
36
- />
37
- <link
38
- href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
39
- rel="stylesheet"
40
- />
41
-
42
- <link href="/themes/light.css" rel="stylesheet" />
43
- <link href="/themes/dark.css" rel="stylesheet" />
44
- <link href="/themes/spacing.css" rel="stylesheet" />
45
-
46
- <style>
47
- .container {
48
- width: 100%;
49
- height: 100%;
50
-
51
- display: flex;
52
- flex-direction: row;
53
- overflow-y: auto;
54
- padding: var(--spacing-medium);
55
- }
56
-
57
- .container.dark {
58
- background-color: black;
59
- }
60
-
61
- #editor {
62
- width: 300px;
63
- }
64
-
65
- #chart {
66
- flex: 1;
67
- }
68
- </style>
69
-
70
- <div style="background-color: black; color: white;">
71
- Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
72
- </div>
73
-
74
- <div class="container light">
75
- <ox-input-chart-radar
76
- chart-type="radar"
77
- id="editor"
78
- .value=${value}
79
- @change=${(e: CustomEvent) => {
80
- const target = e.currentTarget as any
81
- const config = target.value
82
- const chartjs = document.querySelector('#chartjs') as HTMLElement
83
- if (chartjs) {
84
- ;(chartjs as any).config = { ...config }
85
- }
86
-
87
- const container = document.querySelector('.container') as HTMLElement
88
- if (container) {
89
- const theme = config.options.theme
90
- if (theme == 'dark') {
91
- container.classList.remove('light')
92
- container.classList.add('dark')
93
- } else {
94
- container.classList.remove('dark')
95
- container.classList.add('light')
96
- }
97
- }
98
- }}
99
- ></ox-input-chart-radar>
100
- <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
101
- </div>
102
- `
103
-
104
- export const Default = Template.bind({})
105
- Default.args = {
106
- currentSeriesIndex: 0
107
- }
108
-
109
- export const WithData = Template.bind({})
110
- WithData.args = {
111
- value: {
112
- ...getDefaultChartConfig('radar'),
113
- data: {
114
- datasets: [
115
- {
116
- label: 'Radar Series 1',
117
- data: [10, 20, 30],
118
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
119
- borderColor: 'rgba(255, 99, 132, 1)',
120
- borderWidth: 1,
121
- pointStyle: 'circle',
122
- pointRadius: 3
123
- },
124
- {
125
- label: 'Radar Series 2',
126
- data: [15, 25, 35],
127
- backgroundColor: 'rgba(54, 162, 235, 0.2)',
128
- borderColor: 'rgba(54, 162, 235, 1)',
129
- borderWidth: 1,
130
- pointStyle: 'circle',
131
- pointRadius: 3
132
- }
133
- ],
134
- labelDataKey: 'labels'
135
- },
136
- options: {
137
- legend: { display: true }
138
- }
139
- },
140
- currentSeriesIndex: 0
141
- }