@operato/chart 2.0.0-beta.25
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/.editorconfig +29 -0
- package/.storybook/main.js +3 -0
- package/.storybook/preview.js +29 -0
- package/.storybook/server.mjs +8 -0
- package/CHANGELOG.md +17 -0
- package/README.md +0 -0
- package/assets/images/icon-editor-gradient-direction.png +0 -0
- package/assets/images/icon-properties-label.png +0 -0
- package/assets/images/icon-properties-line-type.png +0 -0
- package/assets/images/icon-properties-table.png +0 -0
- package/assets/images/no-image.png +0 -0
- package/demo/index.html +33 -0
- package/dist/src/chartjs/config-converter.d.ts +29 -0
- package/dist/src/chartjs/config-converter.js +218 -0
- package/dist/src/chartjs/config-converter.js.map +1 -0
- package/dist/src/chartjs/ox-chart-js.d.ts +17 -0
- package/dist/src/chartjs/ox-chart-js.js +46 -0
- package/dist/src/chartjs/ox-chart-js.js.map +1 -0
- package/dist/src/editors/configurer.d.ts +52 -0
- package/dist/src/editors/configurer.js +198 -0
- package/dist/src/editors/configurer.js.map +1 -0
- package/dist/src/editors/index.d.ts +6 -0
- package/dist/src/editors/index.js +8 -0
- package/dist/src/editors/index.js.map +1 -0
- package/dist/src/editors/input-chart-abstract.d.ts +27 -0
- package/dist/src/editors/input-chart-abstract.js +273 -0
- package/dist/src/editors/input-chart-abstract.js.map +1 -0
- package/dist/src/editors/input-chart-multi-series-abstract.d.ts +17 -0
- package/dist/src/editors/input-chart-multi-series-abstract.js +418 -0
- package/dist/src/editors/input-chart-multi-series-abstract.js.map +1 -0
- package/dist/src/editors/input-chart-styles.d.ts +1 -0
- package/dist/src/editors/input-chart-styles.js +167 -0
- package/dist/src/editors/input-chart-styles.js.map +1 -0
- package/dist/src/editors/ox-input-chart-hbar.d.ts +11 -0
- package/dist/src/editors/ox-input-chart-hbar.js +220 -0
- package/dist/src/editors/ox-input-chart-hbar.js.map +1 -0
- package/dist/src/editors/ox-input-chart-mixed.d.ts +8 -0
- package/dist/src/editors/ox-input-chart-mixed.js +237 -0
- package/dist/src/editors/ox-input-chart-mixed.js.map +1 -0
- package/dist/src/editors/ox-input-chart-pie.d.ts +11 -0
- package/dist/src/editors/ox-input-chart-pie.js +67 -0
- package/dist/src/editors/ox-input-chart-pie.js.map +1 -0
- package/dist/src/editors/ox-input-chart-radar.d.ts +8 -0
- package/dist/src/editors/ox-input-chart-radar.js +52 -0
- package/dist/src/editors/ox-input-chart-radar.js.map +1 -0
- package/dist/src/editors/ox-property-editor-chart.d.ts +10 -0
- package/dist/src/editors/ox-property-editor-chart.js +79 -0
- package/dist/src/editors/ox-property-editor-chart.js.map +1 -0
- package/dist/src/index.d.ts +0 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/scichart/ox-scichart.d.ts +35 -0
- package/dist/src/scichart/ox-scichart.js +122 -0
- package/dist/src/scichart/ox-scichart.js.map +1 -0
- package/dist/src/scichart/scichart-builder.d.ts +8 -0
- package/dist/src/scichart/scichart-builder.js +46 -0
- package/dist/src/scichart/scichart-builder.js.map +1 -0
- package/dist/stories/common.d.ts +2 -0
- package/dist/stories/common.js +44 -0
- package/dist/stories/common.js.map +1 -0
- package/dist/stories/ox-input-chart-hbar.stories.d.ts +25 -0
- package/dist/stories/ox-input-chart-hbar.stories.js +171 -0
- package/dist/stories/ox-input-chart-hbar.stories.js.map +1 -0
- package/dist/stories/ox-input-chart-mixed.stories.d.ts +25 -0
- package/dist/stories/ox-input-chart-mixed.stories.js +180 -0
- package/dist/stories/ox-input-chart-mixed.stories.js.map +1 -0
- package/dist/stories/ox-input-chart-pie.stories.d.ts +27 -0
- package/dist/stories/ox-input-chart-pie.stories.js +111 -0
- package/dist/stories/ox-input-chart-pie.stories.js.map +1 -0
- package/dist/stories/ox-input-chart-radar.stories.d.ts +27 -0
- package/dist/stories/ox-input-chart-radar.stories.js +122 -0
- package/dist/stories/ox-input-chart-radar.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +104 -0
- package/src/chartjs/config-converter.ts +307 -0
- package/src/chartjs/ox-chart-js.ts +46 -0
- package/src/editors/configurer.ts +243 -0
- package/src/editors/index.ts +8 -0
- package/src/editors/input-chart-abstract.ts +315 -0
- package/src/editors/input-chart-multi-series-abstract.ts +429 -0
- package/src/editors/input-chart-styles.ts +167 -0
- package/src/editors/ox-input-chart-hbar.ts +226 -0
- package/src/editors/ox-input-chart-mixed.ts +240 -0
- package/src/editors/ox-input-chart-pie.ts +75 -0
- package/src/editors/ox-input-chart-radar.ts +54 -0
- package/src/editors/ox-property-editor-chart.ts +79 -0
- package/src/globat.d.ts +1 -0
- package/src/index.ts +0 -0
- package/src/scichart/ox-scichart.ts +143 -0
- package/src/scichart/scichart-builder.ts +87 -0
- package/src/types.d.ts +74 -0
- package/stories/common.ts +47 -0
- package/stories/ox-input-chart-hbar.stories.ts +185 -0
- package/stories/ox-input-chart-mixed.stories.ts +194 -0
- package/stories/ox-input-chart-pie.stories.ts +126 -0
- package/stories/ox-input-chart-radar.stories.ts +137 -0
- package/themes/dark-hc.css +151 -0
- package/themes/dark-mc.css +151 -0
- package/themes/dark.css +151 -0
- package/themes/grist-theme.css +177 -0
- package/themes/light-hc.css +151 -0
- package/themes/light-mc.css +151 -0
- package/themes/light.css +151 -0
- package/themes/md-typescale-styles.css +100 -0
- package/themes/spacing.css +43 -0
- package/themes/state-color.css +6 -0
- package/translations/en.json +44 -0
- package/translations/ja.json +44 -0
- package/translations/ko.json +44 -0
- package/translations/ms.json +8 -0
- package/translations/zh.json +44 -0
- package/tsconfig.json +24 -0
- package/web-dev-server.config.mjs +27 -0
- package/web-test-runner.config.mjs +41 -0
|
@@ -0,0 +1,194 @@
|
|
|
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
|
+
import { convertConfigure } from '../src/chartjs/config-converter.js'
|
|
7
|
+
|
|
8
|
+
import { getDefaultChartConfig } from './common.js'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'ox-input-chart-mixed',
|
|
12
|
+
component: 'ox-input-chart-mixed',
|
|
13
|
+
argTypes: {
|
|
14
|
+
value: { control: 'object' }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Story<T> {
|
|
19
|
+
(args: T): TemplateResult
|
|
20
|
+
args?: Partial<T>
|
|
21
|
+
argTypes?: Record<string, unknown>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ArgTypes {
|
|
25
|
+
value: OperatoChart.ChartConfig
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const Template: Story<ArgTypes> = ({ value }: 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
|
+
#charts {
|
|
66
|
+
flex: 1;
|
|
67
|
+
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
padding: 10px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#chartjs {
|
|
74
|
+
flex: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#scichart {
|
|
78
|
+
flex: 1;
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
81
|
+
|
|
82
|
+
<div class="container light">
|
|
83
|
+
<ox-input-chart-mixed
|
|
84
|
+
id="editor"
|
|
85
|
+
.value=${value}
|
|
86
|
+
@change=${(e: CustomEvent) => {
|
|
87
|
+
const target = e.currentTarget as any
|
|
88
|
+
const config = target.value
|
|
89
|
+
const chartjs = document.querySelector('#chartjs') as HTMLElement
|
|
90
|
+
if (chartjs) {
|
|
91
|
+
;(chartjs as any).config = convertConfigure(config, {})
|
|
92
|
+
}
|
|
93
|
+
const scichart = document.querySelector('#scichart') as HTMLElement
|
|
94
|
+
if (scichart) {
|
|
95
|
+
;(scichart as any).config = config
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const container = document.querySelector('.container') as HTMLElement
|
|
99
|
+
if (container) {
|
|
100
|
+
const theme = config.options.theme
|
|
101
|
+
if (theme == 'dark') {
|
|
102
|
+
container.classList.remove('light')
|
|
103
|
+
container.classList.add('dark')
|
|
104
|
+
} else {
|
|
105
|
+
container.classList.remove('dark')
|
|
106
|
+
container.classList.add('light')
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}}
|
|
110
|
+
></ox-input-chart-mixed>
|
|
111
|
+
<div id="charts">
|
|
112
|
+
<ox-chart-js id="chartjs"></ox-chart-js>
|
|
113
|
+
<ox-scichart id="scichart"></ox-scichart>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
`
|
|
117
|
+
|
|
118
|
+
export const Default = Template.bind({})
|
|
119
|
+
Default.args = {}
|
|
120
|
+
|
|
121
|
+
export const WithData = Template.bind({})
|
|
122
|
+
WithData.args = {
|
|
123
|
+
value: {
|
|
124
|
+
...getDefaultChartConfig('mixed'),
|
|
125
|
+
data: {
|
|
126
|
+
datasets: [
|
|
127
|
+
{
|
|
128
|
+
label: 'Bar Series',
|
|
129
|
+
type: 'bar',
|
|
130
|
+
data: [10, 20, 30],
|
|
131
|
+
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
132
|
+
borderColor: 'rgba(255, 99, 132, 1)',
|
|
133
|
+
borderWidth: 1
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: 'Line Series',
|
|
137
|
+
type: 'line',
|
|
138
|
+
data: [15, 25, 35],
|
|
139
|
+
borderColor: 'rgba(54, 162, 235, 1)',
|
|
140
|
+
borderWidth: 1,
|
|
141
|
+
fill: false,
|
|
142
|
+
lineTension: 0.4,
|
|
143
|
+
pointStyle: 'circle',
|
|
144
|
+
pointRadius: 3
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
labelDataKey: 'labels'
|
|
148
|
+
},
|
|
149
|
+
options: {
|
|
150
|
+
scales: {
|
|
151
|
+
xAxes: [{ ticks: { beginAtZero: true } }],
|
|
152
|
+
yAxes: [{ ticks: { beginAtZero: true } }]
|
|
153
|
+
},
|
|
154
|
+
legend: { display: true }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export const MultiAxis = Template.bind({})
|
|
160
|
+
MultiAxis.args = {
|
|
161
|
+
value: {
|
|
162
|
+
...getDefaultChartConfig('mixed'),
|
|
163
|
+
options: {
|
|
164
|
+
...getDefaultChartConfig('mixed').options,
|
|
165
|
+
multiAxis: true
|
|
166
|
+
},
|
|
167
|
+
data: {
|
|
168
|
+
datasets: [
|
|
169
|
+
{
|
|
170
|
+
label: 'Bar Series',
|
|
171
|
+
type: 'bar',
|
|
172
|
+
data: [10, 20, 30],
|
|
173
|
+
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
174
|
+
borderColor: 'rgba(255, 99, 132, 1)',
|
|
175
|
+
borderWidth: 1,
|
|
176
|
+
yAxisID: 'left'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: 'Line Series',
|
|
180
|
+
type: 'line',
|
|
181
|
+
data: [15, 25, 35],
|
|
182
|
+
borderColor: 'rgba(54, 162, 235, 1)',
|
|
183
|
+
borderWidth: 1,
|
|
184
|
+
fill: false,
|
|
185
|
+
lineTension: 0.4,
|
|
186
|
+
pointStyle: 'circle',
|
|
187
|
+
pointRadius: 3,
|
|
188
|
+
yAxisID: 'right'
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
labelDataKey: 'labels'
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
import { convertConfigure } from '../src/chartjs/config-converter.js'
|
|
6
|
+
|
|
7
|
+
import { getDefaultChartConfig } from './common.js'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'ox-input-chart-pie',
|
|
11
|
+
component: 'ox-input-chart-pie',
|
|
12
|
+
argTypes: {
|
|
13
|
+
value: { control: 'object' },
|
|
14
|
+
currentSeriesIndex: { control: 'number' }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Story<T> {
|
|
19
|
+
(args: T): TemplateResult
|
|
20
|
+
args?: Partial<T>
|
|
21
|
+
argTypes?: Record<string, unknown>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ArgTypes {
|
|
25
|
+
value: OperatoChart.ChartConfig
|
|
26
|
+
currentSeriesIndex: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
|
|
30
|
+
<link
|
|
31
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
32
|
+
rel="stylesheet"
|
|
33
|
+
/>
|
|
34
|
+
<link
|
|
35
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
36
|
+
rel="stylesheet"
|
|
37
|
+
/>
|
|
38
|
+
<link
|
|
39
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
40
|
+
rel="stylesheet"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
44
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
45
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.container {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
padding: var(--spacing-medium);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.container.dark {
|
|
59
|
+
background-color: black;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#editor {
|
|
63
|
+
width: 300px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#chart {
|
|
67
|
+
flex: 1;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
70
|
+
|
|
71
|
+
<div class="container light">
|
|
72
|
+
<ox-input-chart-pie
|
|
73
|
+
id="editor"
|
|
74
|
+
.value=${value}
|
|
75
|
+
@change=${(e: CustomEvent) => {
|
|
76
|
+
const target = e.currentTarget as any
|
|
77
|
+
const config = target.value
|
|
78
|
+
const chart = document.querySelector('#chart') as HTMLElement
|
|
79
|
+
if (chart) {
|
|
80
|
+
;(chart as any).config = convertConfigure(config, {})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const container = document.querySelector('.container') as HTMLElement
|
|
84
|
+
if (container) {
|
|
85
|
+
const theme = config.options.theme
|
|
86
|
+
if (theme == 'dark') {
|
|
87
|
+
container.classList.remove('light')
|
|
88
|
+
container.classList.add('dark')
|
|
89
|
+
} else {
|
|
90
|
+
container.classList.remove('dark')
|
|
91
|
+
container.classList.add('light')
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}}
|
|
95
|
+
></ox-input-chart-pie>
|
|
96
|
+
<ox-chart-js id="chart"></ox-chart-js>
|
|
97
|
+
</div>
|
|
98
|
+
`
|
|
99
|
+
|
|
100
|
+
export const Default = Template.bind({})
|
|
101
|
+
Default.args = {
|
|
102
|
+
currentSeriesIndex: 0
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const WithData = Template.bind({})
|
|
106
|
+
WithData.args = {
|
|
107
|
+
value: {
|
|
108
|
+
...getDefaultChartConfig('pie'),
|
|
109
|
+
data: {
|
|
110
|
+
datasets: [
|
|
111
|
+
{
|
|
112
|
+
label: 'Pie Series 1',
|
|
113
|
+
data: [10, 20, 30],
|
|
114
|
+
backgroundColor: ['rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)'],
|
|
115
|
+
borderColor: ['rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(75, 192, 192, 1)'],
|
|
116
|
+
borderWidth: 1
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
labelDataKey: 'labels'
|
|
120
|
+
},
|
|
121
|
+
options: {
|
|
122
|
+
legend: { display: true }
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
currentSeriesIndex: 0
|
|
126
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
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
|
+
import { convertConfigure } from '../src/chartjs/config-converter.js'
|
|
6
|
+
|
|
7
|
+
import { getDefaultChartConfig } from './common.js'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'ox-input-chart-radar',
|
|
11
|
+
component: 'ox-input-chart-radar',
|
|
12
|
+
argTypes: {
|
|
13
|
+
value: { control: 'object' },
|
|
14
|
+
currentSeriesIndex: { control: 'number' }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Story<T> {
|
|
19
|
+
(args: T): TemplateResult
|
|
20
|
+
args?: Partial<T>
|
|
21
|
+
argTypes?: Record<string, unknown>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ArgTypes {
|
|
25
|
+
value: OperatoChart.ChartConfig
|
|
26
|
+
currentSeriesIndex: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => html`
|
|
30
|
+
<link
|
|
31
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
32
|
+
rel="stylesheet"
|
|
33
|
+
/>
|
|
34
|
+
<link
|
|
35
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
36
|
+
rel="stylesheet"
|
|
37
|
+
/>
|
|
38
|
+
<link
|
|
39
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
40
|
+
rel="stylesheet"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
44
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
45
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.container {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row;
|
|
54
|
+
overflow-y: auto;
|
|
55
|
+
padding: var(--spacing-medium);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.container.dark {
|
|
59
|
+
background-color: black;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
#editor {
|
|
63
|
+
width: 300px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#chart {
|
|
67
|
+
flex: 1;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
70
|
+
|
|
71
|
+
<div class="container light">
|
|
72
|
+
<ox-input-chart-radar
|
|
73
|
+
id="editor"
|
|
74
|
+
.value=${value}
|
|
75
|
+
@change=${(e: CustomEvent) => {
|
|
76
|
+
const target = e.currentTarget as any
|
|
77
|
+
const config = target.value
|
|
78
|
+
const chart = document.querySelector('#chart') as HTMLElement
|
|
79
|
+
if (chart) {
|
|
80
|
+
;(chart as any).config = convertConfigure(config, {})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const container = document.querySelector('.container') as HTMLElement
|
|
84
|
+
if (container) {
|
|
85
|
+
const theme = config.options.theme
|
|
86
|
+
if (theme == 'dark') {
|
|
87
|
+
container.classList.remove('light')
|
|
88
|
+
container.classList.add('dark')
|
|
89
|
+
} else {
|
|
90
|
+
container.classList.remove('dark')
|
|
91
|
+
container.classList.add('light')
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}}
|
|
95
|
+
></ox-input-chart-radar>
|
|
96
|
+
<ox-chart-js id="chart"></ox-chart-js>
|
|
97
|
+
</div>
|
|
98
|
+
`
|
|
99
|
+
|
|
100
|
+
export const Default = Template.bind({})
|
|
101
|
+
Default.args = {
|
|
102
|
+
currentSeriesIndex: 0
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const WithData = Template.bind({})
|
|
106
|
+
WithData.args = {
|
|
107
|
+
value: {
|
|
108
|
+
...getDefaultChartConfig('radar'),
|
|
109
|
+
data: {
|
|
110
|
+
datasets: [
|
|
111
|
+
{
|
|
112
|
+
label: 'Radar Series 1',
|
|
113
|
+
data: [10, 20, 30],
|
|
114
|
+
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
115
|
+
borderColor: 'rgba(255, 99, 132, 1)',
|
|
116
|
+
borderWidth: 1,
|
|
117
|
+
pointStyle: 'circle',
|
|
118
|
+
pointRadius: 3
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: 'Radar Series 2',
|
|
122
|
+
data: [15, 25, 35],
|
|
123
|
+
backgroundColor: 'rgba(54, 162, 235, 0.2)',
|
|
124
|
+
borderColor: 'rgba(54, 162, 235, 1)',
|
|
125
|
+
borderWidth: 1,
|
|
126
|
+
pointStyle: 'circle',
|
|
127
|
+
pointRadius: 3
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
labelDataKey: 'labels'
|
|
131
|
+
},
|
|
132
|
+
options: {
|
|
133
|
+
legend: { display: true }
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
currentSeriesIndex: 0
|
|
137
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
.dark-high-contrast {
|
|
2
|
+
--md-sys-color-primary: rgb(252 250 255);
|
|
3
|
+
--md-sys-color-surface-tint: rgb(178 197 255);
|
|
4
|
+
--md-sys-color-on-primary: rgb(0 0 0);
|
|
5
|
+
--md-sys-color-primary-container: rgb(184 201 255);
|
|
6
|
+
--md-sys-color-on-primary-container: rgb(0 0 0);
|
|
7
|
+
--md-sys-color-secondary: rgb(248 251 255);
|
|
8
|
+
--md-sys-color-on-secondary: rgb(0 0 0);
|
|
9
|
+
--md-sys-color-secondary-container: rgb(147 211 247);
|
|
10
|
+
--md-sys-color-on-secondary-container: rgb(0 0 0);
|
|
11
|
+
--md-sys-color-tertiary: rgb(238 255 242);
|
|
12
|
+
--md-sys-color-on-tertiary: rgb(0 0 0);
|
|
13
|
+
--md-sys-color-tertiary-container: rgb(148 218 179);
|
|
14
|
+
--md-sys-color-on-tertiary-container: rgb(0 0 0);
|
|
15
|
+
--md-sys-color-error: rgb(255 249 249);
|
|
16
|
+
--md-sys-color-on-error: rgb(0 0 0);
|
|
17
|
+
--md-sys-color-error-container: rgb(255 185 180);
|
|
18
|
+
--md-sys-color-on-error-container: rgb(0 0 0);
|
|
19
|
+
--md-sys-color-background: rgb(18 19 24);
|
|
20
|
+
--md-sys-color-on-background: rgb(227 226 233);
|
|
21
|
+
--md-sys-color-surface: rgb(18 19 24);
|
|
22
|
+
--md-sys-color-on-surface: rgb(255 255 255);
|
|
23
|
+
--md-sys-color-surface-variant: rgb(69 70 79);
|
|
24
|
+
--md-sys-color-on-surface-variant: rgb(252 250 255);
|
|
25
|
+
--md-sys-color-outline: rgb(201 202 212);
|
|
26
|
+
--md-sys-color-outline-variant: rgb(201 202 212);
|
|
27
|
+
--md-sys-color-shadow: rgb(0 0 0);
|
|
28
|
+
--md-sys-color-scrim: rgb(0 0 0);
|
|
29
|
+
--md-sys-color-inverse-surface: rgb(227 226 233);
|
|
30
|
+
--md-sys-color-inverse-on-surface: rgb(0 0 0);
|
|
31
|
+
--md-sys-color-inverse-primary: rgb(16 39 90);
|
|
32
|
+
--md-sys-color-primary-fixed: rgb(224 230 255);
|
|
33
|
+
--md-sys-color-on-primary-fixed: rgb(0 0 0);
|
|
34
|
+
--md-sys-color-primary-fixed-dim: rgb(184 201 255);
|
|
35
|
+
--md-sys-color-on-primary-fixed-variant: rgb(0 19 61);
|
|
36
|
+
--md-sys-color-secondary-fixed: rgb(205 235 255);
|
|
37
|
+
--md-sys-color-on-secondary-fixed: rgb(0 0 0);
|
|
38
|
+
--md-sys-color-secondary-fixed-dim: rgb(147 211 247);
|
|
39
|
+
--md-sys-color-on-secondary-fixed-variant: rgb(0 25 36);
|
|
40
|
+
--md-sys-color-tertiary-fixed: rgb(175 246 206);
|
|
41
|
+
--md-sys-color-on-tertiary-fixed: rgb(0 0 0);
|
|
42
|
+
--md-sys-color-tertiary-fixed-dim: rgb(148 218 179);
|
|
43
|
+
--md-sys-color-on-tertiary-fixed-variant: rgb(0 27 14);
|
|
44
|
+
--md-sys-color-surface-dim: rgb(18 19 24);
|
|
45
|
+
--md-sys-color-surface-bright: rgb(56 57 63);
|
|
46
|
+
--md-sys-color-surface-container-lowest: rgb(13 14 19);
|
|
47
|
+
--md-sys-color-surface-container-low: rgb(26 27 33);
|
|
48
|
+
--md-sys-color-surface-container: rgb(30 31 37);
|
|
49
|
+
--md-sys-color-surface-container-high: rgb(41 42 47);
|
|
50
|
+
--md-sys-color-surface-container-highest: rgb(51 52 58);
|
|
51
|
+
|
|
52
|
+
/* primary palette */
|
|
53
|
+
--md-ref-palette-primary0:#000000;
|
|
54
|
+
--md-ref-palette-primary5:#000E32;
|
|
55
|
+
--md-ref-palette-primary10:#001848;
|
|
56
|
+
--md-ref-palette-primary15:#00215E;
|
|
57
|
+
--md-ref-palette-primary20:#002B74;
|
|
58
|
+
--md-ref-palette-primary25:#002B74;
|
|
59
|
+
--md-ref-palette-primary30:#0040A2;
|
|
60
|
+
--md-ref-palette-primary35:#002B74;
|
|
61
|
+
--md-ref-palette-primary40:#1957CA;
|
|
62
|
+
--md-ref-palette-primary50:#3E71E5;
|
|
63
|
+
--md-ref-palette-primary60:#5C8BFF;
|
|
64
|
+
--md-ref-palette-primary70:#89A9FF;
|
|
65
|
+
--md-ref-palette-primary80:#B2C5FF;
|
|
66
|
+
--md-ref-palette-primary90:#DAE2FF;
|
|
67
|
+
--md-ref-palette-primary95:#EEF0FF;
|
|
68
|
+
--md-ref-palette-primary98:#FAF8FF;
|
|
69
|
+
--md-ref-palette-primary99:#FEFBFF;
|
|
70
|
+
--md-ref-palette-primary100:#FFFFFF;
|
|
71
|
+
|
|
72
|
+
/* secondary palette */
|
|
73
|
+
--md-ref-palette-secondary0:#000000;
|
|
74
|
+
--md-ref-palette-secondary5:#00131D;
|
|
75
|
+
--md-ref-palette-secondary10:#001E2C;
|
|
76
|
+
--md-ref-palette-secondary15:#00293A;
|
|
77
|
+
--md-ref-palette-secondary20:#003549;
|
|
78
|
+
--md-ref-palette-secondary25:#004058;
|
|
79
|
+
--md-ref-palette-secondary30:#004C68;
|
|
80
|
+
--md-ref-palette-secondary35:#005978;
|
|
81
|
+
--md-ref-palette-secondary40:#006689;
|
|
82
|
+
--md-ref-palette-secondary50:#0080AC;
|
|
83
|
+
--md-ref-palette-secondary60:#009BCF;
|
|
84
|
+
--md-ref-palette-secondary70:#00B8F4;
|
|
85
|
+
--md-ref-palette-secondary80:#79D1FF;
|
|
86
|
+
--md-ref-palette-secondary90:#C3E8FF;
|
|
87
|
+
--md-ref-palette-secondary95:#E3F3FF;
|
|
88
|
+
--md-ref-palette-secondary98:#F5FAFF;
|
|
89
|
+
--md-ref-palette-secondary99:#FBFCFF;
|
|
90
|
+
--md-ref-palette-secondary100:#FFFFFF;
|
|
91
|
+
|
|
92
|
+
/* tertiary palette */
|
|
93
|
+
--md-ref-palette-tertiary0:#000000;
|
|
94
|
+
--md-ref-palette-tertiary5:#00150A;
|
|
95
|
+
--md-ref-palette-tertiary10:#002113;
|
|
96
|
+
--md-ref-palette-tertiary15:#002C1B;
|
|
97
|
+
--md-ref-palette-tertiary20:#003823;
|
|
98
|
+
--md-ref-palette-tertiary25:#00452B;
|
|
99
|
+
--md-ref-palette-tertiary30:#005234;
|
|
100
|
+
--md-ref-palette-tertiary35:#005F3E;
|
|
101
|
+
--md-ref-palette-tertiary40:#006C47;
|
|
102
|
+
--md-ref-palette-tertiary50:#00885A;
|
|
103
|
+
--md-ref-palette-tertiary60:#31A372;
|
|
104
|
+
--md-ref-palette-tertiary70:#51BF8B;
|
|
105
|
+
--md-ref-palette-tertiary80:#6EDBA5;
|
|
106
|
+
--md-ref-palette-tertiary90:#A2F4C7;
|
|
107
|
+
--md-ref-palette-tertiary95:#BFFFD9;
|
|
108
|
+
--md-ref-palette-tertiary98:#E8FFEF;
|
|
109
|
+
--md-ref-palette-tertiary99:#F4FFF5;
|
|
110
|
+
--md-ref-palette-tertiary100:#FFFFFF;
|
|
111
|
+
|
|
112
|
+
/* error palette */
|
|
113
|
+
--md-ref-palette-error0:#000000;
|
|
114
|
+
--md-ref-palette-error5:#2d0102;
|
|
115
|
+
--md-ref-palette-error10:#410304;
|
|
116
|
+
--md-ref-palette-error15:#540507;
|
|
117
|
+
--md-ref-palette-error20:#68070a;
|
|
118
|
+
--md-ref-palette-error25:#7d0b0e;
|
|
119
|
+
--md-ref-palette-error30:#930f14;
|
|
120
|
+
--md-ref-palette-error35:#a91319;
|
|
121
|
+
--md-ref-palette-error40:#bc1620;
|
|
122
|
+
--md-ref-palette-error50:#e03236;
|
|
123
|
+
--md-ref-palette-error60:#ff5450;
|
|
124
|
+
--md-ref-palette-error70:#ff8982;
|
|
125
|
+
--md-ref-palette-error80:#ffb3ad;
|
|
126
|
+
--md-ref-palette-error90:#ffdad7;
|
|
127
|
+
--md-ref-palette-error95:#ffedeb;
|
|
128
|
+
--md-ref-palette-error98:#fff8f7;
|
|
129
|
+
--md-ref-palette-error99:#fffbff;
|
|
130
|
+
--md-ref-palette-error100:#FFFFFF;
|
|
131
|
+
|
|
132
|
+
/* neutral palette */
|
|
133
|
+
--md-ref-palette-neutral0:#000000;
|
|
134
|
+
--md-ref-palette-neutral5:#111111;
|
|
135
|
+
--md-ref-palette-neutral10:#1C1C1C;
|
|
136
|
+
--md-ref-palette-neutral15:#262626;
|
|
137
|
+
--md-ref-palette-neutral20:#313131;
|
|
138
|
+
--md-ref-palette-neutral25:#3C3C3C;
|
|
139
|
+
--md-ref-palette-neutral30:#474747;
|
|
140
|
+
--md-ref-palette-neutral35:#535353;
|
|
141
|
+
--md-ref-palette-neutral40:#5F5F5F;
|
|
142
|
+
--md-ref-palette-neutral50:#787878;
|
|
143
|
+
--md-ref-palette-neutral60:#929292;
|
|
144
|
+
--md-ref-palette-neutral70:#ACACAC;
|
|
145
|
+
--md-ref-palette-neutral80:#C8C8C8;
|
|
146
|
+
--md-ref-palette-neutral90:#E4E4E4;
|
|
147
|
+
--md-ref-palette-neutral95:#F0F0F0;
|
|
148
|
+
--md-ref-palette-neutral98:#F9F9F9;
|
|
149
|
+
--md-ref-palette-neutral99:#FEFEFE;
|
|
150
|
+
--md-ref-palette-neutral100:#FFFFFF;
|
|
151
|
+
}
|