@openmaic/renderer 0.0.2 → 0.0.3
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/DESIGN.md +7 -1
- package/README.md +11 -3
- package/dist/SlideCanvas.d.ts +12 -1
- package/dist/SlideCanvas.js +105 -0
- package/dist/SlideCanvas.js.map +1 -0
- package/dist/SlideElement.d.ts +3 -2
- package/dist/SlideElement.js +60 -0
- package/dist/SlideElement.js.map +1 -0
- package/dist/context.d.ts +2 -1
- package/dist/context.js +27 -0
- package/dist/context.js.map +1 -0
- package/dist/editing/EditableSlideCanvas.d.ts +26 -0
- package/dist/editing/EditableSlideCanvas.js +352 -0
- package/dist/editing/EditableSlideCanvas.js.map +1 -0
- package/dist/editing/core/drag.d.ts +108 -0
- package/dist/editing/core/drag.js +119 -0
- package/dist/editing/core/drag.js.map +1 -0
- package/dist/editing/core/geometry.d.ts +48 -0
- package/dist/editing/core/geometry.js +186 -0
- package/dist/editing/core/geometry.js.map +1 -0
- package/dist/editing/core/intent.d.ts +39 -0
- package/dist/editing/core/intent.js +35 -0
- package/dist/editing/core/intent.js.map +1 -0
- package/dist/editing/core/line-drag.d.ts +19 -0
- package/dist/editing/core/line-drag.js +163 -0
- package/dist/editing/core/line-drag.js.map +1 -0
- package/dist/editing/core/marquee.d.ts +56 -0
- package/dist/editing/core/marquee.js +74 -0
- package/dist/editing/core/marquee.js.map +1 -0
- package/dist/editing/core/resize.d.ts +121 -0
- package/dist/editing/core/resize.js +392 -0
- package/dist/editing/core/resize.js.map +1 -0
- package/dist/editing/core/rotate.d.ts +37 -0
- package/dist/editing/core/rotate.js +74 -0
- package/dist/editing/core/rotate.js.map +1 -0
- package/dist/editing/core/selection.d.ts +68 -0
- package/dist/editing/core/selection.js +108 -0
- package/dist/editing/core/selection.js.map +1 -0
- package/dist/editing/core/snapping.d.ts +54 -0
- package/dist/editing/core/snapping.js +96 -0
- package/dist/editing/core/snapping.js.map +1 -0
- package/dist/editing/handles/BorderLine.d.ts +15 -0
- package/dist/editing/handles/BorderLine.js +17 -0
- package/dist/editing/handles/BorderLine.js.map +1 -0
- package/dist/editing/handles/LineHandles.d.ts +28 -0
- package/dist/editing/handles/LineHandles.js +51 -0
- package/dist/editing/handles/LineHandles.js.map +1 -0
- package/dist/editing/handles/MarqueeBox.d.ts +19 -0
- package/dist/editing/handles/MarqueeBox.js +26 -0
- package/dist/editing/handles/MarqueeBox.js.map +1 -0
- package/dist/editing/handles/ResizeHandles.d.ts +31 -0
- package/dist/editing/handles/ResizeHandles.js +44 -0
- package/dist/editing/handles/ResizeHandles.js.map +1 -0
- package/dist/editing/handles/RotateHandle.d.ts +26 -0
- package/dist/editing/handles/RotateHandle.js +52 -0
- package/dist/editing/handles/RotateHandle.js.map +1 -0
- package/dist/editing/handles/SelectionOverlay.d.ts +18 -0
- package/dist/editing/handles/SelectionOverlay.js +35 -0
- package/dist/editing/handles/SelectionOverlay.js.map +1 -0
- package/dist/editing/index.d.ts +3 -0
- package/dist/editing/index.js +4 -0
- package/dist/editing/index.js.map +1 -0
- package/dist/editing/types.d.ts +107 -0
- package/dist/editing/types.js +7 -0
- package/dist/editing/types.js.map +1 -0
- package/dist/editing/useEditGesture.d.ts +46 -0
- package/dist/editing/useEditGesture.js +217 -0
- package/dist/editing/useEditGesture.js.map +1 -0
- package/dist/editing/useLineHandleGesture.d.ts +35 -0
- package/dist/editing/useLineHandleGesture.js +112 -0
- package/dist/editing/useLineHandleGesture.js.map +1 -0
- package/dist/editing/useMarqueeGesture.d.ts +43 -0
- package/dist/editing/useMarqueeGesture.js +157 -0
- package/dist/editing/useMarqueeGesture.js.map +1 -0
- package/dist/editing/useResizeGesture.d.ts +43 -0
- package/dist/editing/useResizeGesture.js +137 -0
- package/dist/editing/useResizeGesture.js.map +1 -0
- package/dist/editing/useRotateGesture.d.ts +47 -0
- package/dist/editing/useRotateGesture.js +128 -0
- package/dist/editing/useRotateGesture.js.map +1 -0
- package/dist/effects/HighlightOverlay.js +44 -0
- package/dist/effects/HighlightOverlay.js.map +1 -0
- package/dist/effects/LaserOverlay.js +40 -0
- package/dist/effects/LaserOverlay.js.map +1 -0
- package/dist/effects/SpotlightOverlay.d.ts +3 -1
- package/dist/effects/SpotlightOverlay.js +99 -0
- package/dist/effects/SpotlightOverlay.js.map +1 -0
- package/dist/effects/ZoomWrapper.js +19 -0
- package/dist/effects/ZoomWrapper.js.map +1 -0
- package/dist/elements/chart/BaseChartElement.js +22 -0
- package/dist/elements/chart/BaseChartElement.js.map +1 -0
- package/dist/elements/chart/Chart.js +83 -0
- package/dist/elements/chart/Chart.js.map +1 -0
- package/dist/elements/chart/chartOption.js +178 -0
- package/dist/elements/chart/chartOption.js.map +1 -0
- package/dist/elements/code/BaseCodeElement.js +525 -0
- package/dist/elements/code/BaseCodeElement.js.map +1 -0
- package/dist/elements/image/BaseImageElement.d.ts +4 -4
- package/dist/elements/image/BaseImageElement.js +76 -0
- package/dist/elements/image/BaseImageElement.js.map +1 -0
- package/dist/elements/image/ImageOutline.js +30 -0
- package/dist/elements/image/ImageOutline.js.map +1 -0
- package/dist/elements/image/clipPaths.js +130 -0
- package/dist/elements/image/clipPaths.js.map +1 -0
- package/dist/elements/image/useClipImage.js +40 -0
- package/dist/elements/image/useClipImage.js.map +1 -0
- package/dist/elements/image/useFilter.d.ts +1 -0
- package/dist/elements/image/useFilter.js +35 -0
- package/dist/elements/image/useFilter.js.map +1 -0
- package/dist/elements/index.js +14 -9
- package/dist/elements/index.js.map +1 -1
- package/dist/elements/latex/BaseLatexElement.js +94 -0
- package/dist/elements/latex/BaseLatexElement.js.map +1 -0
- package/dist/elements/line/BaseLineElement.js +72 -0
- package/dist/elements/line/BaseLineElement.js.map +1 -0
- package/dist/elements/line/LinePointMarker.js +19 -0
- package/dist/elements/line/LinePointMarker.js.map +1 -0
- package/dist/elements/shape/BaseShapeElement.js +174 -0
- package/dist/elements/shape/BaseShapeElement.js.map +1 -0
- package/dist/elements/shape/GradientDefs.js +11 -0
- package/dist/elements/shape/GradientDefs.js.map +1 -0
- package/dist/elements/shape/PatternDefs.js +8 -0
- package/dist/elements/shape/PatternDefs.js.map +1 -0
- package/dist/elements/shared/ElementOutline.js +13 -0
- package/dist/elements/shared/ElementOutline.js.map +1 -0
- package/dist/elements/shared/useElementFill.js +15 -0
- package/dist/elements/shared/useElementFill.js.map +1 -0
- package/dist/elements/shared/useElementFlip.js +18 -0
- package/dist/elements/shared/useElementFlip.js.map +1 -0
- package/dist/elements/shared/useElementOutline.js +19 -0
- package/dist/elements/shared/useElementOutline.js.map +1 -0
- package/dist/elements/shared/useElementShadow.js +15 -0
- package/dist/elements/shared/useElementShadow.js.map +1 -0
- package/dist/elements/table/BaseTableElement.js +21 -0
- package/dist/elements/table/BaseTableElement.js.map +1 -0
- package/dist/elements/table/StaticTable.js +117 -0
- package/dist/elements/table/StaticTable.js.map +1 -0
- package/dist/elements/table/tableUtils.js +28 -0
- package/dist/elements/table/tableUtils.js.map +1 -0
- package/dist/elements/text/BaseTextElement.js +46 -0
- package/dist/elements/text/BaseTextElement.js.map +1 -0
- package/dist/elements/video/BaseVideoElement.d.ts +3 -1
- package/dist/elements/video/BaseVideoElement.js +36 -0
- package/dist/elements/video/BaseVideoElement.js.map +1 -0
- package/dist/hooks/useSlideBackgroundStyle.js +43 -0
- package/dist/hooks/useSlideBackgroundStyle.js.map +1 -0
- package/dist/hooks/useViewportSize.d.ts +2 -0
- package/dist/hooks/useViewportSize.js +71 -0
- package/dist/hooks/useViewportSize.js.map +1 -0
- package/dist/index.js +11 -31
- package/dist/index.js.map +1 -1
- package/dist/snapshot/index.d.ts +1 -0
- package/dist/snapshot/index.js +93 -28
- package/dist/snapshot/index.js.map +1 -1
- package/dist/snapshot/katex-fonts-embed.d.ts +10 -0
- package/dist/snapshot/katex-fonts-embed.js +13 -0
- package/dist/snapshot/katex-fonts-embed.js.map +1 -0
- package/dist/snapshot/measure.d.ts +32 -0
- package/dist/snapshot/measure.js +129 -0
- package/dist/snapshot/measure.js.map +1 -0
- package/dist/styles.js +50 -0
- package/dist/styles.js.map +1 -0
- package/dist/types/effects.d.ts +2 -0
- package/dist/utils/cn.js +9 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/element.js +85 -0
- package/dist/utils/element.js.map +1 -0
- package/dist/utils/geometry.d.ts +2 -2
- package/dist/utils/geometry.js +44 -0
- package/dist/utils/geometry.js.map +1 -0
- package/package.json +14 -4
- package/dist/chunks/BaseCodeElement-Bh-Bfdz6.js +0 -1742
- package/dist/chunks/BaseCodeElement-Bh-Bfdz6.js.map +0 -1
- package/dist/chunks/SlideCanvas-KcCxfrYE.js +0 -477
- package/dist/chunks/SlideCanvas-KcCxfrYE.js.map +0 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const getChartOption = ({ type, data, themeColors, textColor, lineColor, lineSmooth, stack, }) => {
|
|
2
|
+
const textStyle = textColor ? { color: textColor } : {};
|
|
3
|
+
const axisLine = textColor ? { lineStyle: { color: textColor } } : undefined;
|
|
4
|
+
const axisLabel = textColor ? { color: textColor } : undefined;
|
|
5
|
+
const splitLine = lineColor ? { lineStyle: { color: lineColor } } : {};
|
|
6
|
+
if (!Array.isArray(data?.series) || data.series.length === 0) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const legend = data.series.length > 1 ? { top: 'bottom', textStyle } : undefined;
|
|
10
|
+
if (type === 'bar') {
|
|
11
|
+
return {
|
|
12
|
+
color: themeColors,
|
|
13
|
+
textStyle,
|
|
14
|
+
legend,
|
|
15
|
+
xAxis: { type: 'category', data: data.labels, axisLine, axisLabel },
|
|
16
|
+
yAxis: { type: 'value', axisLine, axisLabel, splitLine },
|
|
17
|
+
series: data.series.map((item, index) => {
|
|
18
|
+
const seriesItem = {
|
|
19
|
+
data: item,
|
|
20
|
+
name: data.legends[index],
|
|
21
|
+
type: 'bar',
|
|
22
|
+
label: { show: true },
|
|
23
|
+
itemStyle: { borderRadius: [2, 2, 0, 0] },
|
|
24
|
+
};
|
|
25
|
+
if (stack)
|
|
26
|
+
seriesItem.stack = 'A';
|
|
27
|
+
return seriesItem;
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (type === 'column') {
|
|
32
|
+
return {
|
|
33
|
+
color: themeColors,
|
|
34
|
+
textStyle,
|
|
35
|
+
legend,
|
|
36
|
+
yAxis: { type: 'category', data: data.labels, axisLine, axisLabel },
|
|
37
|
+
xAxis: { type: 'value', axisLine, axisLabel, splitLine },
|
|
38
|
+
series: data.series.map((item, index) => {
|
|
39
|
+
const seriesItem = {
|
|
40
|
+
data: item,
|
|
41
|
+
name: data.legends[index],
|
|
42
|
+
type: 'bar',
|
|
43
|
+
label: { show: true },
|
|
44
|
+
itemStyle: { borderRadius: [0, 2, 2, 0] },
|
|
45
|
+
};
|
|
46
|
+
if (stack)
|
|
47
|
+
seriesItem.stack = 'A';
|
|
48
|
+
return seriesItem;
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (type === 'line') {
|
|
53
|
+
return {
|
|
54
|
+
color: themeColors,
|
|
55
|
+
textStyle,
|
|
56
|
+
legend,
|
|
57
|
+
xAxis: { type: 'category', data: data.labels, axisLine, axisLabel },
|
|
58
|
+
yAxis: { type: 'value', axisLine, axisLabel, splitLine },
|
|
59
|
+
series: data.series.map((item, index) => {
|
|
60
|
+
const seriesItem = {
|
|
61
|
+
data: item,
|
|
62
|
+
name: data.legends[index],
|
|
63
|
+
type: 'line',
|
|
64
|
+
smooth: lineSmooth,
|
|
65
|
+
label: { show: true },
|
|
66
|
+
};
|
|
67
|
+
if (stack)
|
|
68
|
+
seriesItem.stack = 'A';
|
|
69
|
+
return seriesItem;
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (type === 'pie') {
|
|
74
|
+
const series0 = data.series[0];
|
|
75
|
+
if (!Array.isArray(series0))
|
|
76
|
+
return null;
|
|
77
|
+
return {
|
|
78
|
+
color: themeColors,
|
|
79
|
+
textStyle,
|
|
80
|
+
legend: { top: 'bottom', textStyle },
|
|
81
|
+
series: [
|
|
82
|
+
{
|
|
83
|
+
data: series0.map((item, index) => ({ value: item, name: data.labels[index] })),
|
|
84
|
+
label: textColor ? { color: textColor } : {},
|
|
85
|
+
type: 'pie',
|
|
86
|
+
radius: '70%',
|
|
87
|
+
emphasis: {
|
|
88
|
+
itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' },
|
|
89
|
+
label: { show: true, fontSize: 14, fontWeight: 'bold' },
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (type === 'ring') {
|
|
96
|
+
const series0 = data.series[0];
|
|
97
|
+
if (!Array.isArray(series0))
|
|
98
|
+
return null;
|
|
99
|
+
return {
|
|
100
|
+
color: themeColors,
|
|
101
|
+
textStyle,
|
|
102
|
+
legend: { top: 'bottom', textStyle },
|
|
103
|
+
series: [
|
|
104
|
+
{
|
|
105
|
+
data: series0.map((item, index) => ({ value: item, name: data.labels[index] })),
|
|
106
|
+
label: textColor ? { color: textColor } : {},
|
|
107
|
+
type: 'pie',
|
|
108
|
+
radius: ['40%', '70%'],
|
|
109
|
+
padAngle: 1,
|
|
110
|
+
avoidLabelOverlap: false,
|
|
111
|
+
itemStyle: { borderRadius: 4 },
|
|
112
|
+
emphasis: { label: { show: true, fontSize: 14, fontWeight: 'bold' } },
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
if (type === 'area') {
|
|
118
|
+
return {
|
|
119
|
+
color: themeColors,
|
|
120
|
+
textStyle,
|
|
121
|
+
legend,
|
|
122
|
+
xAxis: { type: 'category', boundaryGap: false, data: data.labels, axisLine, axisLabel },
|
|
123
|
+
yAxis: { type: 'value', axisLine, axisLabel, splitLine },
|
|
124
|
+
series: data.series.map((item, index) => {
|
|
125
|
+
const seriesItem = {
|
|
126
|
+
data: item,
|
|
127
|
+
name: data.legends[index],
|
|
128
|
+
type: 'line',
|
|
129
|
+
areaStyle: {},
|
|
130
|
+
label: { show: true },
|
|
131
|
+
};
|
|
132
|
+
if (stack)
|
|
133
|
+
seriesItem.stack = 'A';
|
|
134
|
+
return seriesItem;
|
|
135
|
+
}),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (type === 'radar') {
|
|
139
|
+
return {
|
|
140
|
+
color: themeColors,
|
|
141
|
+
textStyle,
|
|
142
|
+
legend,
|
|
143
|
+
radar: {
|
|
144
|
+
indicator: data.labels.map((item) => ({ name: item })),
|
|
145
|
+
splitLine,
|
|
146
|
+
axisLine: lineColor ? { lineStyle: { color: lineColor } } : undefined,
|
|
147
|
+
},
|
|
148
|
+
series: [
|
|
149
|
+
{
|
|
150
|
+
data: data.series.map((item, index) => ({ value: item, name: data.legends[index] })),
|
|
151
|
+
type: 'radar',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
if (type === 'scatter') {
|
|
157
|
+
const series0 = data.series[0];
|
|
158
|
+
if (!Array.isArray(series0))
|
|
159
|
+
return null;
|
|
160
|
+
const formatedData = [];
|
|
161
|
+
for (let i = 0; i < series0.length; i++) {
|
|
162
|
+
const x = series0[i];
|
|
163
|
+
const y = data.series[1]?.[i] ?? x;
|
|
164
|
+
formatedData.push([x, y]);
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
color: themeColors,
|
|
168
|
+
textStyle,
|
|
169
|
+
xAxis: { axisLine, axisLabel, splitLine },
|
|
170
|
+
yAxis: { axisLine, axisLabel, splitLine },
|
|
171
|
+
series: [{ symbolSize: 12, data: formatedData, type: 'scatter' }],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { getChartOption };
|
|
178
|
+
//# sourceMappingURL=chartOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartOption.js","sources":["../../../src/elements/chart/chartOption.ts"],"sourcesContent":["import type { ComposeOption } from 'echarts/core';\nimport type {\n BarSeriesOption,\n LineSeriesOption,\n PieSeriesOption,\n ScatterSeriesOption,\n RadarSeriesOption,\n} from 'echarts/charts';\nimport type { ChartData, ChartType } from '@openmaic/dsl';\n\ntype EChartOption = ComposeOption<\n BarSeriesOption | LineSeriesOption | PieSeriesOption | ScatterSeriesOption | RadarSeriesOption\n>;\n\nexport interface ChartOptionPayload {\n type: ChartType;\n data: ChartData;\n themeColors: string[];\n textColor?: string;\n lineColor?: string;\n lineSmooth?: boolean;\n stack?: boolean;\n}\n\nexport const getChartOption = ({\n type,\n data,\n themeColors,\n textColor,\n lineColor,\n lineSmooth,\n stack,\n}: ChartOptionPayload): EChartOption | null => {\n const textStyle = textColor ? { color: textColor } : {};\n\n const axisLine = textColor ? { lineStyle: { color: textColor } } : undefined;\n const axisLabel = textColor ? { color: textColor } : undefined;\n const splitLine = lineColor ? { lineStyle: { color: lineColor } } : {};\n\n if (!Array.isArray(data?.series) || data.series.length === 0) {\n return null;\n }\n\n const legend = data.series.length > 1 ? { top: 'bottom' as const, textStyle } : undefined;\n\n if (type === 'bar') {\n return {\n color: themeColors,\n textStyle,\n legend,\n xAxis: { type: 'category', data: data.labels, axisLine, axisLabel },\n yAxis: { type: 'value', axisLine, axisLabel, splitLine },\n series: data.series.map((item, index) => {\n const seriesItem: BarSeriesOption = {\n data: item,\n name: data.legends[index],\n type: 'bar',\n label: { show: true },\n itemStyle: { borderRadius: [2, 2, 0, 0] },\n };\n if (stack) seriesItem.stack = 'A';\n return seriesItem;\n }),\n };\n }\n if (type === 'column') {\n return {\n color: themeColors,\n textStyle,\n legend,\n yAxis: { type: 'category', data: data.labels, axisLine, axisLabel },\n xAxis: { type: 'value', axisLine, axisLabel, splitLine },\n series: data.series.map((item, index) => {\n const seriesItem: BarSeriesOption = {\n data: item,\n name: data.legends[index],\n type: 'bar',\n label: { show: true },\n itemStyle: { borderRadius: [0, 2, 2, 0] },\n };\n if (stack) seriesItem.stack = 'A';\n return seriesItem;\n }),\n };\n }\n if (type === 'line') {\n return {\n color: themeColors,\n textStyle,\n legend,\n xAxis: { type: 'category', data: data.labels, axisLine, axisLabel },\n yAxis: { type: 'value', axisLine, axisLabel, splitLine },\n series: data.series.map((item, index) => {\n const seriesItem: LineSeriesOption = {\n data: item,\n name: data.legends[index],\n type: 'line',\n smooth: lineSmooth,\n label: { show: true },\n };\n if (stack) seriesItem.stack = 'A';\n return seriesItem;\n }),\n };\n }\n if (type === 'pie') {\n const series0 = data.series[0];\n if (!Array.isArray(series0)) return null;\n return {\n color: themeColors,\n textStyle,\n legend: { top: 'bottom' as const, textStyle },\n series: [\n {\n data: series0.map((item, index) => ({ value: item, name: data.labels[index] })),\n label: textColor ? { color: textColor } : {},\n type: 'pie',\n radius: '70%',\n emphasis: {\n itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' },\n label: { show: true, fontSize: 14, fontWeight: 'bold' },\n },\n },\n ],\n };\n }\n if (type === 'ring') {\n const series0 = data.series[0];\n if (!Array.isArray(series0)) return null;\n return {\n color: themeColors,\n textStyle,\n legend: { top: 'bottom' as const, textStyle },\n series: [\n {\n data: series0.map((item, index) => ({ value: item, name: data.labels[index] })),\n label: textColor ? { color: textColor } : {},\n type: 'pie',\n radius: ['40%', '70%'],\n padAngle: 1,\n avoidLabelOverlap: false,\n itemStyle: { borderRadius: 4 },\n emphasis: { label: { show: true, fontSize: 14, fontWeight: 'bold' } },\n },\n ],\n };\n }\n if (type === 'area') {\n return {\n color: themeColors,\n textStyle,\n legend,\n xAxis: { type: 'category', boundaryGap: false, data: data.labels, axisLine, axisLabel },\n yAxis: { type: 'value', axisLine, axisLabel, splitLine },\n series: data.series.map((item, index) => {\n const seriesItem: LineSeriesOption = {\n data: item,\n name: data.legends[index],\n type: 'line',\n areaStyle: {},\n label: { show: true },\n };\n if (stack) seriesItem.stack = 'A';\n return seriesItem;\n }),\n };\n }\n if (type === 'radar') {\n return {\n color: themeColors,\n textStyle,\n legend,\n radar: {\n indicator: data.labels.map((item) => ({ name: item })),\n splitLine,\n axisLine: lineColor ? { lineStyle: { color: lineColor } } : undefined,\n },\n series: [\n {\n data: data.series.map((item, index) => ({ value: item, name: data.legends[index] })),\n type: 'radar',\n },\n ],\n };\n }\n if (type === 'scatter') {\n const series0 = data.series[0];\n if (!Array.isArray(series0)) return null;\n const formatedData: number[][] = [];\n for (let i = 0; i < series0.length; i++) {\n const x = series0[i];\n const y = data.series[1]?.[i] ?? x;\n formatedData.push([x, y]);\n }\n\n return {\n color: themeColors,\n textStyle,\n xAxis: { axisLine, axisLabel, splitLine },\n yAxis: { axisLine, axisLabel, splitLine },\n series: [{ symbolSize: 12, data: formatedData, type: 'scatter' }],\n };\n }\n\n return null;\n};\n"],"names":[],"mappings":"MAwBa,cAAc,GAAG,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,SAAS,EACT,SAAS,EACT,UAAU,EACV,KAAK,GACc,KAAyB;AAC5C,IAAA,MAAM,SAAS,GAAG,SAAS,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE;AAEvD,IAAA,MAAM,QAAQ,GAAG,SAAS,GAAG,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,SAAS;AAC5E,IAAA,MAAM,SAAS,GAAG,SAAS,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS;AAC9D,IAAA,MAAM,SAAS,GAAG,SAAS,GAAG,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE;AAEtE,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,C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