@worm-print-platform/echarts 1.5.3 → 1.6.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.
- package/README.md +41 -1
- package/dist/bind.d.ts +1 -1
- package/dist/browser/executor.iife.d.ts +1 -1
- package/dist/browser-bundle.d.ts +1 -1
- package/dist/config.d.ts +3 -1
- package/dist/constants.d.ts +5 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/echarts.d.ts +1 -1
- package/dist/echarts.js +38 -14
- package/dist/executor.iife.global.d.ts +1 -1
- package/dist/executor.iife.global.js +29 -17
- package/dist/i18n/en-US.json +153 -0
- package/dist/i18n/th-TH.json +153 -0
- package/dist/i18n/zh-CN.json +153 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/kinds.d.ts +6 -2
- package/dist/kit.cjs +2 -2
- package/dist/kit.d.ts +3 -1
- package/dist/kit.js +45 -148
- package/dist/label.d.ts +65 -0
- package/dist/marketplace.d.ts +1 -1
- package/dist/marketplace.js +1361 -126
- package/dist/node.cjs +93 -39
- package/dist/node.d.ts +1 -1
- package/dist/node.js +93 -39
- package/dist/normalize.d.ts +1 -1
- package/dist/option-utils.d.ts +1 -1
- package/dist/plugin-8R67OtBD.cjs +6 -0
- package/dist/plugin-CKyaiHYF.js +960 -0
- package/dist/plugin.d.ts +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/test-setup.d.ts +7 -0
- package/dist/type-augmentation.d.ts +1 -1
- package/dist/ui.cjs +1973 -87
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1953 -86
- package/dist/units.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +29 -3
- package/dist/plugin-Bf6QDbHO.cjs +0 -6
- package/dist/plugin-CUoE2jMs.js +0 -573
package/dist/ui.cjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/echarts v1.
|
|
2
|
+
* @worm-print-platform/echarts v1.6.1
|
|
3
3
|
* Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
|
|
4
4
|
* SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
*/
|
|
7
7
|
"use strict";
|
|
8
|
+
var __create = Object.create;
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
9
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
11
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
13
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
14
|
var __export = (target, all) => {
|
|
13
15
|
for (var name in all)
|
|
@@ -21,6 +23,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
21
23
|
}
|
|
22
24
|
return to;
|
|
23
25
|
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
24
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
35
|
|
|
26
36
|
// src/ui.ts
|
|
@@ -31,14 +41,1596 @@ __export(ui_exports, {
|
|
|
31
41
|
uninstallChartCommonUI: () => uninstallChartCommonUI
|
|
32
42
|
});
|
|
33
43
|
module.exports = __toCommonJS(ui_exports);
|
|
44
|
+
var import_i18n2 = require("@worm-print-platform/core/i18n");
|
|
45
|
+
|
|
46
|
+
// src/i18n/zh-CN.json
|
|
47
|
+
var zh_CN_default = {
|
|
48
|
+
echarts: {
|
|
49
|
+
"echarts.panel.chart": "\u56FE\u8868",
|
|
50
|
+
"echarts.panel.config": "\u914D\u7F6E",
|
|
51
|
+
"echarts.panel.dataSource": "\u6570\u636E\u6E90",
|
|
52
|
+
"echarts.panel.category": "\u7C7B\u76EE",
|
|
53
|
+
"echarts.panel.value": "\u6570\u503C",
|
|
54
|
+
"echarts.panel.series": "\u7CFB\u5217",
|
|
55
|
+
"echarts.panel.chartType.bar": "\u67F1\u72B6",
|
|
56
|
+
"echarts.panel.chartType.barH": "\u6761\u5F62",
|
|
57
|
+
"echarts.panel.chartType.line": "\u6298\u7EBF",
|
|
58
|
+
"echarts.panel.chartType.area": "\u9762\u79EF",
|
|
59
|
+
"echarts.panel.chartType.pie": "\u997C",
|
|
60
|
+
"echarts.panel.chartType.doughnut": "\u73AF\u5F62",
|
|
61
|
+
"echarts.panel.chartType.scatter": "\u6563\u70B9",
|
|
62
|
+
"echarts.panel.chartType.radar": "\u96F7\u8FBE",
|
|
63
|
+
"echarts.panel.chartType.funnel": "\u6F0F\u6597",
|
|
64
|
+
"echarts.panel.chartType.gauge": "\u4EEA\u8868",
|
|
65
|
+
"echarts.panel.dataLabel": "\u6570\u636E\u6807\u7B7E",
|
|
66
|
+
"echarts.panel.valueLabel": "\u6570\u503C\u6807\u7B7E",
|
|
67
|
+
"echarts.panel.hint.dataBinding": "\u6570\u636E\u7531\u6A21\u677F\u7ED1\u5B9A\u9636\u6BB5\u6CE8\u5165\uFF1Aseries/xAxis \u7684 data \u4FDD\u7559 `$data` \u5360\u4F4D\u5373\u53EF\uFF1B\u590D\u6742\u6837\u5F0F\u53EF\u5728\u6A21\u677F JSON \u4E2D\u624B\u5199 chartOption\u3002",
|
|
68
|
+
"echarts.panel.field.dimension": "\u7EF4\u5EA6\u5B57\u6BB5\uFF08\u6BCF\u4E2A\u5B57\u6BB5\u4E00\u4E2A\u7EF4\u5EA6\uFF09",
|
|
69
|
+
"echarts.panel.field.value": "\u6570\u503C\u5B57\u6BB5",
|
|
70
|
+
"echarts.panel.field.valueMulti": "\u6570\u503C\u5B57\u6BB5\uFF08\u591A\u503C\u591A\u7CFB\u5217\uFF09",
|
|
71
|
+
"echarts.panel.default": "\uFF08\u9ED8\u8BA4\uFF09",
|
|
72
|
+
"echarts.panel.current": "\uFF08\u5F53\u524D\uFF09",
|
|
73
|
+
"echarts.panel.defaultFirstArray": "\uFF08\u9ED8\u8BA4\uFF1A\u9876\u5C42\u7B2C\u4E00\u4E2A\u6570\u7EC4\uFF09",
|
|
74
|
+
"echarts.panel.error.invalidOption": "\u56FE\u8868 option \u975E\u6CD5\uFF1A\u9700\u8981\u5BF9\u8C61",
|
|
75
|
+
"echarts.panel.chartFallback": "\u56FE\u8868",
|
|
76
|
+
"echarts.panel.optionDefault": "\uFF08\u9ED8\u8BA4\uFF09",
|
|
77
|
+
"echarts.panel.overflow.default": "\u9ED8\u8BA4",
|
|
78
|
+
"echarts.panel.overflow.none": "\u4E0D\u5904\u7406\uFF08\u663E\u793A\u5B8C\u6574\uFF09",
|
|
79
|
+
"echarts.panel.overflow.truncate": "\u622A\u65AD",
|
|
80
|
+
"echarts.panel.overflow.break": "\u6362\u884C",
|
|
81
|
+
"echarts.panel.fontWeight.default": "\u9ED8\u8BA4",
|
|
82
|
+
"echarts.panel.fontWeight.normal": "\u5E38\u89C4",
|
|
83
|
+
"echarts.panel.fontWeight.bold": "\u52A0\u7C97",
|
|
84
|
+
"echarts.panel.label.distance": "\u8DDD\u79BB",
|
|
85
|
+
"echarts.panel.label.rotate": "\u65CB\u8F6C\uFF08\u5EA6\uFF09",
|
|
86
|
+
"echarts.panel.label.fontSize": "\u5B57\u53F7",
|
|
87
|
+
"echarts.panel.label.fontWeight": "\u5B57\u91CD",
|
|
88
|
+
"echarts.panel.label.color": "\u6587\u5B57\u989C\u8272",
|
|
89
|
+
"echarts.panel.label.backgroundColor": "\u80CC\u666F\u8272",
|
|
90
|
+
"echarts.panel.label.borderColor": "\u8FB9\u6846\u8272",
|
|
91
|
+
"echarts.panel.label.borderWidth": "\u8FB9\u6846\u5BBD\u5EA6",
|
|
92
|
+
"echarts.panel.label.borderRadius": "\u5706\u89D2",
|
|
93
|
+
"echarts.panel.label.padding": "\u5185\u8FB9\u8DDD",
|
|
94
|
+
"echarts.panel.label.show": "\u663E\u793A\u6570\u636E\u6807\u7B7E",
|
|
95
|
+
"echarts.panel.label.content": "\u5185\u5BB9",
|
|
96
|
+
"echarts.panel.label.formatterTitle": "\u6570\u636E\u6807\u7B7E\u5185\u5BB9",
|
|
97
|
+
"echarts.panel.label.formatterCustom": "\u81EA\u5B9A\u4E49 / \u9ED8\u8BA4",
|
|
98
|
+
"echarts.panel.label.formatterPlaceholder": "\u5982 {b}: {c}",
|
|
99
|
+
"echarts.panel.label.overflow": "\u6EA2\u51FA\u5904\u7406",
|
|
100
|
+
"echarts.panel.label.position": "\u4F4D\u7F6E",
|
|
101
|
+
"echarts.panel.label.positionTitle": "\u6807\u7B7E\u4F4D\u7F6E",
|
|
102
|
+
"echarts.panel.label.positionDefault": "\u9ED8\u8BA4",
|
|
103
|
+
"echarts.panel.label.offset": "\u504F\u79FB X / Y",
|
|
104
|
+
"echarts.panel.label.style": "\u6837\u5F0F",
|
|
105
|
+
"echarts.panel.labelLine.fontWeight": "\u5B57\u91CD",
|
|
106
|
+
"echarts.panel.labelLine": "\u5F15\u5BFC\u7EBF",
|
|
107
|
+
"echarts.panel.labelLine.show": "\u663E\u793A\u5F15\u5BFC\u7EBF",
|
|
108
|
+
"echarts.panel.labelLine.length": "\u5F15\u5BFC\u7EBF\u957F\u5EA6",
|
|
109
|
+
"echarts.panel.labelLine.length2": "\u7B2C\u4E8C\u6BB5\u957F\u5EA6",
|
|
110
|
+
"echarts.panel.labelLine.smooth": "\u5E73\u6ED1\u5F15\u5BFC\u7EBF",
|
|
111
|
+
"echarts.panel.dataSourceTitle": "\u6570\u636E\u6E90",
|
|
112
|
+
"echarts.panel.categoryField": "\u7C7B\u76EE\u5B57\u6BB5",
|
|
113
|
+
"echarts.panel.removeField": "\u5220\u9664\u8BE5\u5B57\u6BB5",
|
|
114
|
+
"echarts.panel.addField": "+ \u6DFB\u52A0\u5B57\u6BB5",
|
|
115
|
+
"echarts.panel.seriesField": "\u7CFB\u5217\u62C6\u5206\u5B57\u6BB5",
|
|
116
|
+
"echarts.panel.seriesFieldHint": "\u53EF\u9009\uFF0C\u5982 region\uFF08\u6309\u503C\u62C6\u6210\u591A\u7CFB\u5217\uFF09",
|
|
117
|
+
"echarts.panel.bubbleSize": "\u6C14\u6CE1\u5927\u5C0F",
|
|
118
|
+
"echarts.panel.title": "\u56FE\u8868\u6807\u9898",
|
|
119
|
+
"echarts.panel.titleHint": "\u7559\u7A7A\u4E0D\u663E\u793A\u6807\u9898",
|
|
120
|
+
"echarts.panel.legend": "\u663E\u793A\u56FE\u4F8B",
|
|
121
|
+
"echarts.panel.palette": "\u914D\u8272",
|
|
122
|
+
"echarts.palette.default": "\u9ED8\u8BA4\u84DD",
|
|
123
|
+
"echarts.palette.fresh": "\u6E05\u65B0\u7EFF",
|
|
124
|
+
"echarts.palette.warm": "\u6696\u6A59\u7EA2",
|
|
125
|
+
"echarts.palette.purple": "\u7D2B\u7070",
|
|
126
|
+
"echarts.panel.stack": "\u5806\u53E0\u663E\u793A",
|
|
127
|
+
"echarts.panel.innerRadius": "\u5185\u5F84\uFF08%\uFF09",
|
|
128
|
+
"echarts.panel.paddingTRBL": "\u5185\u8FB9\u8DDD \u4E0A/\u53F3/\u4E0B/\u5DE6 (%)",
|
|
129
|
+
"echarts.panel.paddingTop": "\u4E0A\u8FB9\u8DDD",
|
|
130
|
+
"echarts.panel.paddingRight": "\u53F3\u8FB9\u8DDD\uFF08\u7559\u5916\u7F6E\u6807\u7B7E\uFF09",
|
|
131
|
+
"echarts.panel.paddingBottom": "\u4E0B\u8FB9\u8DDD",
|
|
132
|
+
"echarts.panel.paddingLeft": "\u5DE6\u8FB9\u8DDD",
|
|
133
|
+
"echarts.panel.radius": "\u534A\u5F84\uFF08%\uFF09",
|
|
134
|
+
"echarts.panel.minMax": "\u6700\u5C0F / \u6700\u5927\u503C",
|
|
135
|
+
"echarts.panel.group": "\u56FE\u8868",
|
|
136
|
+
"echarts.series.typeNames.bar": "\u67F1\u72B6\u56FE",
|
|
137
|
+
"echarts.series.typeNames.barH": "\u6761\u5F62\u56FE",
|
|
138
|
+
"echarts.series.typeNames.line": "\u6298\u7EBF\u56FE",
|
|
139
|
+
"echarts.series.typeNames.area": "\u9762\u79EF\u56FE",
|
|
140
|
+
"echarts.series.typeNames.pie": "\u997C\u56FE",
|
|
141
|
+
"echarts.series.typeNames.doughnut": "\u73AF\u5F62\u56FE",
|
|
142
|
+
"echarts.series.typeNames.scatter": "\u6563\u70B9\u56FE",
|
|
143
|
+
"echarts.series.typeNames.radar": "\u96F7\u8FBE\u56FE",
|
|
144
|
+
"echarts.series.typeNames.funnel": "\u6F0F\u6597\u56FE",
|
|
145
|
+
"echarts.series.typeNames.gauge": "\u4EEA\u8868\u76D8",
|
|
146
|
+
"echarts.label.formatter.value": "\u6570\u503C",
|
|
147
|
+
"echarts.label.formatter.nameValue": "\u540D\u79F0: \u6570\u503C",
|
|
148
|
+
"echarts.label.formatter.name": "\u540D\u79F0",
|
|
149
|
+
"echarts.label.formatter.percent": "\u767E\u5206\u6BD4",
|
|
150
|
+
"echarts.label.position.bar.top": "\u9876\u90E8",
|
|
151
|
+
"echarts.label.position.bar.inside": "\u5185\u90E8",
|
|
152
|
+
"echarts.label.position.bar.insideTop": "\u5185\u90E8\u9876\u7AEF",
|
|
153
|
+
"echarts.label.position.bar.bottom": "\u5E95\u90E8",
|
|
154
|
+
"echarts.label.position.bar.insideBottom": "\u5185\u90E8\u5E95\u7AEF",
|
|
155
|
+
"echarts.label.position.bar.right": "\u53F3\u4FA7",
|
|
156
|
+
"echarts.label.position.bar.left": "\u5DE6\u4FA7",
|
|
157
|
+
"echarts.label.position.bar.middle": "\u5C45\u4E2D",
|
|
158
|
+
"echarts.label.position.line.top": "\u9876\u90E8",
|
|
159
|
+
"echarts.label.position.line.bottom": "\u5E95\u90E8",
|
|
160
|
+
"echarts.label.position.line.inside": "\u5185\u90E8",
|
|
161
|
+
"echarts.label.position.line.left": "\u5DE6\u4FA7",
|
|
162
|
+
"echarts.label.position.line.right": "\u53F3\u4FA7",
|
|
163
|
+
"echarts.label.position.pie.outside": "\u5916\u4FA7",
|
|
164
|
+
"echarts.label.position.pie.inside": "\u5185\u90E8",
|
|
165
|
+
"echarts.label.position.pie.center": "\u4E2D\u5FC3",
|
|
166
|
+
"echarts.label.position.scatter.top": "\u9876\u90E8",
|
|
167
|
+
"echarts.label.position.scatter.bottom": "\u5E95\u90E8",
|
|
168
|
+
"echarts.label.position.scatter.left": "\u5DE6\u4FA7",
|
|
169
|
+
"echarts.label.position.scatter.right": "\u53F3\u4FA7",
|
|
170
|
+
"echarts.label.position.scatter.inside": "\u5185\u90E8",
|
|
171
|
+
"echarts.label.position.radar.top": "\u9876\u90E8",
|
|
172
|
+
"echarts.label.position.radar.bottom": "\u5E95\u90E8",
|
|
173
|
+
"echarts.label.position.radar.left": "\u5DE6\u4FA7",
|
|
174
|
+
"echarts.label.position.radar.right": "\u53F3\u4FA7",
|
|
175
|
+
"echarts.label.position.radar.inside": "\u5185\u90E8",
|
|
176
|
+
"echarts.label.position.funnel.outer": "\u5916\u4FA7",
|
|
177
|
+
"echarts.label.position.funnel.inner": "\u5185\u90E8",
|
|
178
|
+
"echarts.label.position.funnel.left": "\u5DE6\u4FA7",
|
|
179
|
+
"echarts.label.position.funnel.right": "\u53F3\u4FA7",
|
|
180
|
+
"echarts.label.position.funnel.top": "\u9876\u90E8",
|
|
181
|
+
"echarts.label.position.funnel.bottom": "\u5E95\u90E8",
|
|
182
|
+
"echarts.meta.chartOption": "\u56FE\u8868 option",
|
|
183
|
+
"echarts.meta.dataSource": "\u6570\u636E\u6E90",
|
|
184
|
+
"echarts.meta.categoryField": "\u7C7B\u76EE\u5B57\u6BB5",
|
|
185
|
+
"echarts.meta.valueFields": "\u6570\u503C\u5B57\u6BB5",
|
|
186
|
+
"echarts.meta.seriesField": "\u7CFB\u5217\u62C6\u5206\u5B57\u6BB5",
|
|
187
|
+
"echarts.meta.bubbleSize": "\u6C14\u6CE1\u5927\u5C0F",
|
|
188
|
+
"echarts.notes.bar": "\u67F1\u72B6\u56FE\uFF1A\u7C7B\u76EE + \u591A\u4E2A\u6570\u503C\u5B57\u6BB5\uFF0C\u6BCF\u5B57\u6BB5\u4E00\u4E2A series\uFF1Bseries[].data \u5199 $data \u5360\u4F4D\uFF1B\u56FA\u5B9A\u9AD8\uFF0C\u7981\u6B62 autoHeight",
|
|
189
|
+
"echarts.notes.barH": "\u6A2A\u5411\u6761\u5F62\u56FE\uFF1AxAxis \u4E3A\u6570\u503C\u3001yAxis \u4E3A\u7C7B\u76EE\uFF1B\u7C7B\u76EE\u5199 yAxis.data \u7684 $data \u5360\u4F4D",
|
|
190
|
+
"echarts.notes.line": "\u6298\u7EBF\u56FE\uFF1A\u7C7B\u76EE + \u591A\u4E2A\u6570\u503C\u5B57\u6BB5\uFF1B\u4E0D\u5199 areaStyle",
|
|
191
|
+
"echarts.notes.area": "\u9762\u79EF\u56FE\uFF1A\u6298\u7EBF + series[].areaStyle\uFF1B\u5176\u4F59\u540C\u6298\u7EBF\u56FE",
|
|
192
|
+
"echarts.notes.pie": "\u997C\u56FE\uFF1A\u7C7B\u76EE + \u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u751F\u6210 { name, value }\uFF1B\u53EA\u9700\u4E00\u4E2A\u6570\u503C\u5B57\u6BB5",
|
|
193
|
+
"echarts.notes.doughnut": "\u73AF\u5F62\u56FE\uFF1A\u997C\u56FE + radius:[\u5185\u5F84,\u5916\u5F84]\uFF1B\u5185\u5F84\u7531\u9762\u677F\u914D\u7F6E",
|
|
194
|
+
"echarts.notes.scatter": "\u6563\u70B9\u56FE\uFF1A\u7C7B\u76EE\u5B57\u6BB5\u4F5C x\u3001\u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C y\uFF1BchartBubble \u5F00\u542F\u65F6\u7528\u7B2C\u4E8C\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C\u70B9\u5927\u5C0F",
|
|
195
|
+
"echarts.notes.radar": "\u96F7\u8FBE\u56FE\uFF1A\u6BCF\u4E2A\u6570\u503C\u5B57\u6BB5\u662F\u4E00\u4E2A\u7EF4\u5EA6\uFF08radar.indicator\uFF09\uFF0C\u6BCF\u884C\u6570\u636E\u662F\u4E00\u4E2A\u7CFB\u5217\uFF08\u7C7B\u76EE\u5B57\u6BB5\u4F5C\u7CFB\u5217\u540D\uFF09\uFF1B\u534A\u5F84\u7531\u9762\u677F\u5199 radar.radius\uFF08%\uFF0C\u9ED8\u8BA4 75\uFF09",
|
|
196
|
+
"echarts.notes.funnel": "\u6F0F\u6597\u56FE\uFF1A\u7C7B\u76EE + \u9996\u4E2A\u6570\u503C\u5B57\u6BB5\uFF0C\u6309\u6570\u503C\u964D\u5E8F\uFF1B\u56DB\u8FB9\u5185\u8FB9\u8DDD\u7531\u9762\u677F\u5199 series.left/right/top/bottom\uFF08%\uFF0C\u53F3\u4FA7\u9700\u7559\u5916\u7F6E\u6807\u7B7E\u7A7A\u95F4\uFF09",
|
|
197
|
+
"echarts.notes.gauge": "\u4EEA\u8868\u76D8\uFF1A\u53D6\u9996\u884C\u6570\u636E\u7684\u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C\u6307\u9488\u503C\uFF1Bmin/max \u7531\u9762\u677F\u5199\u5165 series[0].min/max"
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// src/i18n/en-US.json
|
|
202
|
+
var en_US_default = {
|
|
203
|
+
echarts: {
|
|
204
|
+
"echarts.panel.chart": "Chart",
|
|
205
|
+
"echarts.panel.config": "Config",
|
|
206
|
+
"echarts.panel.dataSource": "Data source",
|
|
207
|
+
"echarts.panel.category": "Category",
|
|
208
|
+
"echarts.panel.value": "Value",
|
|
209
|
+
"echarts.panel.series": "Series",
|
|
210
|
+
"echarts.panel.chartType.bar": "Bar",
|
|
211
|
+
"echarts.panel.chartType.barH": "Horizontal bar",
|
|
212
|
+
"echarts.panel.chartType.line": "Line",
|
|
213
|
+
"echarts.panel.chartType.area": "Area",
|
|
214
|
+
"echarts.panel.chartType.pie": "Pie",
|
|
215
|
+
"echarts.panel.chartType.doughnut": "Doughnut",
|
|
216
|
+
"echarts.panel.chartType.scatter": "Scatter",
|
|
217
|
+
"echarts.panel.chartType.radar": "Radar",
|
|
218
|
+
"echarts.panel.chartType.funnel": "Funnel",
|
|
219
|
+
"echarts.panel.chartType.gauge": "Gauge",
|
|
220
|
+
"echarts.panel.dataLabel": "Data label",
|
|
221
|
+
"echarts.panel.valueLabel": "Value label",
|
|
222
|
+
"echarts.panel.hint.dataBinding": "Data is injected at template binding; keep the `$data` placeholder in series/xAxis data; advanced styles can be written in chartOption in the template JSON.",
|
|
223
|
+
"echarts.panel.field.dimension": "Dimension fields (one per dimension)",
|
|
224
|
+
"echarts.panel.field.value": "Value fields",
|
|
225
|
+
"echarts.panel.field.valueMulti": "Value fields (multiple values, multiple series)",
|
|
226
|
+
"echarts.panel.default": "(default)",
|
|
227
|
+
"echarts.panel.current": "(current)",
|
|
228
|
+
"echarts.panel.defaultFirstArray": "(default: first top-level array)",
|
|
229
|
+
"echarts.panel.error.invalidOption": "Invalid chart option: expected an object",
|
|
230
|
+
"echarts.panel.chartFallback": "Chart",
|
|
231
|
+
"echarts.panel.optionDefault": "(default)",
|
|
232
|
+
"echarts.panel.overflow.default": "Default",
|
|
233
|
+
"echarts.panel.overflow.none": "None (show full)",
|
|
234
|
+
"echarts.panel.overflow.truncate": "Truncate",
|
|
235
|
+
"echarts.panel.overflow.break": "Wrap",
|
|
236
|
+
"echarts.panel.fontWeight.default": "Default",
|
|
237
|
+
"echarts.panel.fontWeight.normal": "Regular",
|
|
238
|
+
"echarts.panel.fontWeight.bold": "Bold",
|
|
239
|
+
"echarts.panel.label.distance": "Distance",
|
|
240
|
+
"echarts.panel.label.rotate": "Rotation (deg)",
|
|
241
|
+
"echarts.panel.label.fontSize": "Font size",
|
|
242
|
+
"echarts.panel.label.fontWeight": "Font weight",
|
|
243
|
+
"echarts.panel.label.color": "Text color",
|
|
244
|
+
"echarts.panel.label.backgroundColor": "Background color",
|
|
245
|
+
"echarts.panel.label.borderColor": "Border color",
|
|
246
|
+
"echarts.panel.label.borderWidth": "Border width",
|
|
247
|
+
"echarts.panel.label.borderRadius": "Radius",
|
|
248
|
+
"echarts.panel.label.padding": "Padding",
|
|
249
|
+
"echarts.panel.label.show": "Show data labels",
|
|
250
|
+
"echarts.panel.label.content": "Content",
|
|
251
|
+
"echarts.panel.label.formatterTitle": "Data label content",
|
|
252
|
+
"echarts.panel.label.formatterCustom": "Custom / Default",
|
|
253
|
+
"echarts.panel.label.formatterPlaceholder": "e.g. {b}: {c}",
|
|
254
|
+
"echarts.panel.label.overflow": "Overflow",
|
|
255
|
+
"echarts.panel.label.position": "Position",
|
|
256
|
+
"echarts.panel.label.positionTitle": "Label position",
|
|
257
|
+
"echarts.panel.label.positionDefault": "Default",
|
|
258
|
+
"echarts.panel.label.offset": "Offset X / Y",
|
|
259
|
+
"echarts.panel.label.style": "Style",
|
|
260
|
+
"echarts.panel.labelLine.fontWeight": "Font weight",
|
|
261
|
+
"echarts.panel.labelLine": "Label line",
|
|
262
|
+
"echarts.panel.labelLine.show": "Show label line",
|
|
263
|
+
"echarts.panel.labelLine.length": "Label line length",
|
|
264
|
+
"echarts.panel.labelLine.length2": "Second segment length",
|
|
265
|
+
"echarts.panel.labelLine.smooth": "Smooth label line",
|
|
266
|
+
"echarts.panel.dataSourceTitle": "Data source",
|
|
267
|
+
"echarts.panel.categoryField": "Category field",
|
|
268
|
+
"echarts.panel.removeField": "Remove this field",
|
|
269
|
+
"echarts.panel.addField": "+ Add field",
|
|
270
|
+
"echarts.panel.seriesField": "Series split field",
|
|
271
|
+
"echarts.panel.seriesFieldHint": "Optional, e.g. region (splits into series by value)",
|
|
272
|
+
"echarts.panel.bubbleSize": "Bubble size",
|
|
273
|
+
"echarts.panel.title": "Chart title",
|
|
274
|
+
"echarts.panel.titleHint": "Leave empty to hide the title",
|
|
275
|
+
"echarts.panel.legend": "Show legend",
|
|
276
|
+
"echarts.panel.palette": "Color palette",
|
|
277
|
+
"echarts.palette.default": "Default blue",
|
|
278
|
+
"echarts.palette.fresh": "Fresh green",
|
|
279
|
+
"echarts.palette.warm": "Warm orange-red",
|
|
280
|
+
"echarts.palette.purple": "Purple grey",
|
|
281
|
+
"echarts.panel.stack": "Stacked",
|
|
282
|
+
"echarts.panel.innerRadius": "Inner radius (%)",
|
|
283
|
+
"echarts.panel.paddingTRBL": "Padding top/right/bottom/left (%)",
|
|
284
|
+
"echarts.panel.paddingTop": "Top padding",
|
|
285
|
+
"echarts.panel.paddingRight": "Right padding (for outer labels)",
|
|
286
|
+
"echarts.panel.paddingBottom": "Bottom padding",
|
|
287
|
+
"echarts.panel.paddingLeft": "Left padding",
|
|
288
|
+
"echarts.panel.radius": "Radius (%)",
|
|
289
|
+
"echarts.panel.minMax": "Min / max",
|
|
290
|
+
"echarts.panel.group": "Chart",
|
|
291
|
+
"echarts.series.typeNames.bar": "Bar chart",
|
|
292
|
+
"echarts.series.typeNames.barH": "Horizontal bar chart",
|
|
293
|
+
"echarts.series.typeNames.line": "Line chart",
|
|
294
|
+
"echarts.series.typeNames.area": "Area chart",
|
|
295
|
+
"echarts.series.typeNames.pie": "Pie chart",
|
|
296
|
+
"echarts.series.typeNames.doughnut": "Doughnut chart",
|
|
297
|
+
"echarts.series.typeNames.scatter": "Scatter chart",
|
|
298
|
+
"echarts.series.typeNames.radar": "Radar chart",
|
|
299
|
+
"echarts.series.typeNames.funnel": "Funnel chart",
|
|
300
|
+
"echarts.series.typeNames.gauge": "Gauge chart",
|
|
301
|
+
"echarts.label.formatter.value": "Value",
|
|
302
|
+
"echarts.label.formatter.nameValue": "Name: Value",
|
|
303
|
+
"echarts.label.formatter.name": "Name",
|
|
304
|
+
"echarts.label.formatter.percent": "Percentage",
|
|
305
|
+
"echarts.label.position.bar.top": "Top",
|
|
306
|
+
"echarts.label.position.bar.inside": "Inside",
|
|
307
|
+
"echarts.label.position.bar.insideTop": "Inside top",
|
|
308
|
+
"echarts.label.position.bar.bottom": "Bottom",
|
|
309
|
+
"echarts.label.position.bar.insideBottom": "Inside bottom",
|
|
310
|
+
"echarts.label.position.bar.right": "Right",
|
|
311
|
+
"echarts.label.position.bar.left": "Left",
|
|
312
|
+
"echarts.label.position.bar.middle": "Center",
|
|
313
|
+
"echarts.label.position.line.top": "Top",
|
|
314
|
+
"echarts.label.position.line.bottom": "Bottom",
|
|
315
|
+
"echarts.label.position.line.inside": "Inside",
|
|
316
|
+
"echarts.label.position.line.left": "Left",
|
|
317
|
+
"echarts.label.position.line.right": "Right",
|
|
318
|
+
"echarts.label.position.pie.outside": "Outside",
|
|
319
|
+
"echarts.label.position.pie.inside": "Inside",
|
|
320
|
+
"echarts.label.position.pie.center": "Center",
|
|
321
|
+
"echarts.label.position.scatter.top": "Top",
|
|
322
|
+
"echarts.label.position.scatter.bottom": "Bottom",
|
|
323
|
+
"echarts.label.position.scatter.left": "Left",
|
|
324
|
+
"echarts.label.position.scatter.right": "Right",
|
|
325
|
+
"echarts.label.position.scatter.inside": "Inside",
|
|
326
|
+
"echarts.label.position.radar.top": "Top",
|
|
327
|
+
"echarts.label.position.radar.bottom": "Bottom",
|
|
328
|
+
"echarts.label.position.radar.left": "Left",
|
|
329
|
+
"echarts.label.position.radar.right": "Right",
|
|
330
|
+
"echarts.label.position.radar.inside": "Inside",
|
|
331
|
+
"echarts.label.position.funnel.outer": "Outside",
|
|
332
|
+
"echarts.label.position.funnel.inner": "Inside",
|
|
333
|
+
"echarts.label.position.funnel.left": "Left",
|
|
334
|
+
"echarts.label.position.funnel.right": "Right",
|
|
335
|
+
"echarts.label.position.funnel.top": "Top",
|
|
336
|
+
"echarts.label.position.funnel.bottom": "Bottom",
|
|
337
|
+
"echarts.meta.chartOption": "Chart option",
|
|
338
|
+
"echarts.meta.dataSource": "Data source",
|
|
339
|
+
"echarts.meta.categoryField": "Category field",
|
|
340
|
+
"echarts.meta.valueFields": "Value fields",
|
|
341
|
+
"echarts.meta.seriesField": "Series split field",
|
|
342
|
+
"echarts.meta.bubbleSize": "Bubble size",
|
|
343
|
+
"echarts.notes.bar": "Bar chart: category + multiple value fields, one series per field; write the $data placeholder in series[].data; fixed height, autoHeight is forbidden",
|
|
344
|
+
"echarts.notes.barH": "Horizontal bar: xAxis is the value axis, yAxis is the category axis; write the $data placeholder in yAxis.data for categories",
|
|
345
|
+
"echarts.notes.line": "Line chart: category + multiple value fields; do not write areaStyle",
|
|
346
|
+
"echarts.notes.area": "Area chart: line + series[].areaStyle; otherwise same as the line chart",
|
|
347
|
+
"echarts.notes.pie": "Pie chart: category + the first value field produce { name, value }; only one value field is needed",
|
|
348
|
+
"echarts.notes.doughnut": "Doughnut: pie + radius:[inner, outer]; the inner radius is configured in the panel",
|
|
349
|
+
"echarts.notes.scatter": "Scatter: the category field is x, the first value field is y; when chartBubble is on, the second value field is the point size",
|
|
350
|
+
"echarts.notes.radar": "Radar: each value field is a dimension (radar.indicator), each data row is a series (the category field is the series name); the radius is written by the panel to radar.radius (%, default 75)",
|
|
351
|
+
"echarts.notes.funnel": "Funnel: category + the first value field, sorted descending; the four insets are written by the panel to series.left/right/top/bottom (%, reserve room on the right for outer labels)",
|
|
352
|
+
"echarts.notes.gauge": "Gauge: the first value field of the first data row is the pointer value; min/max are written by the panel to series[0].min/max"
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// src/i18n/th-TH.json
|
|
357
|
+
var th_TH_default = {
|
|
358
|
+
echarts: {
|
|
359
|
+
"echarts.panel.chart": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34",
|
|
360
|
+
"echarts.panel.config": "\u0E01\u0E32\u0E23\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E04\u0E48\u0E32",
|
|
361
|
+
"echarts.panel.dataSource": "\u0E41\u0E2B\u0E25\u0E48\u0E07\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
362
|
+
"echarts.panel.category": "\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48",
|
|
363
|
+
"echarts.panel.value": "\u0E04\u0E48\u0E32",
|
|
364
|
+
"echarts.panel.series": "\u0E0A\u0E38\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
365
|
+
"echarts.panel.chartType.bar": "\u0E41\u0E17\u0E48\u0E07",
|
|
366
|
+
"echarts.panel.chartType.barH": "\u0E41\u0E17\u0E48\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19",
|
|
367
|
+
"echarts.panel.chartType.line": "\u0E40\u0E2A\u0E49\u0E19",
|
|
368
|
+
"echarts.panel.chartType.area": "\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",
|
|
369
|
+
"echarts.panel.chartType.pie": "\u0E27\u0E07\u0E01\u0E25\u0E21",
|
|
370
|
+
"echarts.panel.chartType.doughnut": "\u0E27\u0E07\u0E01\u0E25\u0E21\u0E27\u0E07\u0E41\u0E2B\u0E27\u0E19",
|
|
371
|
+
"echarts.panel.chartType.scatter": "\u0E08\u0E38\u0E14\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",
|
|
372
|
+
"echarts.panel.chartType.radar": "\u0E40\u0E23\u0E14\u0E32\u0E23\u0E4C",
|
|
373
|
+
"echarts.panel.chartType.funnel": "\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07",
|
|
374
|
+
"echarts.panel.chartType.gauge": "\u0E40\u0E01\u0E08\u0E27\u0E31\u0E14",
|
|
375
|
+
"echarts.panel.dataLabel": "\u0E1B\u0E49\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
376
|
+
"echarts.panel.valueLabel": "\u0E1B\u0E49\u0E32\u0E22\u0E04\u0E48\u0E32",
|
|
377
|
+
"echarts.panel.hint.dataBinding": "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E16\u0E39\u0E01\u0E41\u0E17\u0E23\u0E01\u0E15\u0E2D\u0E19\u0E1C\u0E39\u0E01\u0E40\u0E17\u0E21\u0E40\u0E1E\u0E25\u0E15; \u0E04\u0E07\u0E15\u0E31\u0E27\u0E41\u0E17\u0E19 `$data` \u0E44\u0E27\u0E49\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25 series/xAxis; \u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E40\u0E02\u0E35\u0E22\u0E19\u0E2A\u0E44\u0E15\u0E25\u0E4C\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07\u0E43\u0E19 chartOption \u0E02\u0E2D\u0E07 JSON \u0E40\u0E17\u0E21\u0E40\u0E1E\u0E25\u0E15\u0E44\u0E14\u0E49",
|
|
378
|
+
"echarts.panel.field.dimension": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E21\u0E34\u0E15\u0E34 (\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E21\u0E34\u0E15\u0E34)",
|
|
379
|
+
"echarts.panel.field.value": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32",
|
|
380
|
+
"echarts.panel.field.valueMulti": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32 (\u0E2B\u0E25\u0E32\u0E22\u0E04\u0E48\u0E32 \u0E2B\u0E25\u0E32\u0E22\u0E0A\u0E38\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25)",
|
|
381
|
+
"echarts.panel.default": "(\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19)",
|
|
382
|
+
"echarts.panel.current": "(\u0E1B\u0E31\u0E08\u0E08\u0E38\u0E1A\u0E31\u0E19)",
|
|
383
|
+
"echarts.panel.defaultFirstArray": "(\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19: \u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C\u0E23\u0E30\u0E14\u0E31\u0E1A\u0E1A\u0E19\u0E15\u0E31\u0E27\u0E41\u0E23\u0E01)",
|
|
384
|
+
"echarts.panel.error.invalidOption": "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E32\u0E14\u0E27\u0E48\u0E32\u0E40\u0E1B\u0E47\u0E19\u0E2D\u0E47\u0E2D\u0E1A\u0E40\u0E08\u0E01\u0E15\u0E4C",
|
|
385
|
+
"echarts.panel.chartFallback": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34",
|
|
386
|
+
"echarts.panel.optionDefault": "(\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19)",
|
|
387
|
+
"echarts.panel.overflow.default": "\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
388
|
+
"echarts.panel.overflow.none": "\u0E44\u0E21\u0E48\u0E21\u0E35 (\u0E41\u0E2A\u0E14\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14)",
|
|
389
|
+
"echarts.panel.overflow.truncate": "\u0E15\u0E31\u0E14\u0E17\u0E34\u0E49\u0E07",
|
|
390
|
+
"echarts.panel.overflow.break": "\u0E15\u0E31\u0E14\u0E04\u0E33",
|
|
391
|
+
"echarts.panel.fontWeight.default": "\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
392
|
+
"echarts.panel.fontWeight.normal": "\u0E1B\u0E01\u0E15\u0E34",
|
|
393
|
+
"echarts.panel.fontWeight.bold": "\u0E2B\u0E19\u0E32",
|
|
394
|
+
"echarts.panel.label.distance": "\u0E23\u0E30\u0E22\u0E30\u0E2B\u0E48\u0E32\u0E07",
|
|
395
|
+
"echarts.panel.label.rotate": "\u0E01\u0E32\u0E23\u0E2B\u0E21\u0E38\u0E19 (\u0E2D\u0E07\u0E28\u0E32)",
|
|
396
|
+
"echarts.panel.label.fontSize": "\u0E02\u0E19\u0E32\u0E14\u0E1F\u0E2D\u0E19\u0E15\u0E4C",
|
|
397
|
+
"echarts.panel.label.fontWeight": "\u0E19\u0E49\u0E33\u0E2B\u0E19\u0E31\u0E01\u0E1F\u0E2D\u0E19\u0E15\u0E4C",
|
|
398
|
+
"echarts.panel.label.color": "\u0E2A\u0E35\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
399
|
+
"echarts.panel.label.backgroundColor": "\u0E2A\u0E35\u0E1E\u0E37\u0E49\u0E19\u0E2B\u0E25\u0E31\u0E07",
|
|
400
|
+
"echarts.panel.label.borderColor": "\u0E2A\u0E35\u0E40\u0E2A\u0E49\u0E19\u0E02\u0E2D\u0E1A",
|
|
401
|
+
"echarts.panel.label.borderWidth": "\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E02\u0E2D\u0E1A",
|
|
402
|
+
"echarts.panel.label.borderRadius": "\u0E23\u0E31\u0E28\u0E21\u0E35",
|
|
403
|
+
"echarts.panel.label.padding": "\u0E23\u0E30\u0E22\u0E30\u0E20\u0E32\u0E22\u0E43\u0E19",
|
|
404
|
+
"echarts.panel.label.show": "\u0E41\u0E2A\u0E14\u0E07\u0E1B\u0E49\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
405
|
+
"echarts.panel.label.content": "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32",
|
|
406
|
+
"echarts.panel.label.formatterTitle": "\u0E40\u0E19\u0E37\u0E49\u0E2D\u0E2B\u0E32\u0E1B\u0E49\u0E32\u0E22\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
407
|
+
"echarts.panel.label.formatterCustom": "\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E40\u0E2D\u0E07 / \u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
408
|
+
"echarts.panel.label.formatterPlaceholder": "\u0E40\u0E0A\u0E48\u0E19 {b}: {c}",
|
|
409
|
+
"echarts.panel.label.overflow": "\u0E25\u0E49\u0E19",
|
|
410
|
+
"echarts.panel.label.position": "\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07",
|
|
411
|
+
"echarts.panel.label.positionTitle": "\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E1B\u0E49\u0E32\u0E22",
|
|
412
|
+
"echarts.panel.label.positionDefault": "\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
413
|
+
"echarts.panel.label.offset": "\u0E2D\u0E2D\u0E1F\u0E40\u0E0B\u0E47\u0E15 X / Y",
|
|
414
|
+
"echarts.panel.label.style": "\u0E2A\u0E44\u0E15\u0E25\u0E4C",
|
|
415
|
+
"echarts.panel.labelLine.fontWeight": "\u0E19\u0E49\u0E33\u0E2B\u0E19\u0E31\u0E01\u0E1F\u0E2D\u0E19\u0E15\u0E4C",
|
|
416
|
+
"echarts.panel.labelLine": "\u0E40\u0E2A\u0E49\u0E19\u0E1B\u0E49\u0E32\u0E22",
|
|
417
|
+
"echarts.panel.labelLine.show": "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E1B\u0E49\u0E32\u0E22",
|
|
418
|
+
"echarts.panel.labelLine.length": "\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E40\u0E2A\u0E49\u0E19\u0E1B\u0E49\u0E32\u0E22",
|
|
419
|
+
"echarts.panel.labelLine.length2": "\u0E04\u0E27\u0E32\u0E21\u0E22\u0E32\u0E27\u0E17\u0E48\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E07",
|
|
420
|
+
"echarts.panel.labelLine.smooth": "\u0E40\u0E2A\u0E49\u0E19\u0E1B\u0E49\u0E32\u0E22\u0E42\u0E04\u0E49\u0E07",
|
|
421
|
+
"echarts.panel.dataSourceTitle": "\u0E41\u0E2B\u0E25\u0E48\u0E07\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
422
|
+
"echarts.panel.categoryField": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48",
|
|
423
|
+
"echarts.panel.removeField": "\u0E25\u0E1A\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E19\u0E35\u0E49",
|
|
424
|
+
"echarts.panel.addField": "+ \u0E40\u0E1E\u0E34\u0E48\u0E21\u0E1F\u0E34\u0E25\u0E14\u0E4C",
|
|
425
|
+
"echarts.panel.seriesField": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E41\u0E22\u0E01\u0E0A\u0E38\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
426
|
+
"echarts.panel.seriesFieldHint": "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A \u0E40\u0E0A\u0E48\u0E19 region (\u0E41\u0E22\u0E01\u0E40\u0E1B\u0E47\u0E19\u0E0A\u0E38\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E15\u0E32\u0E21\u0E04\u0E48\u0E32)",
|
|
427
|
+
"echarts.panel.bubbleSize": "\u0E02\u0E19\u0E32\u0E14\u0E1F\u0E2D\u0E07",
|
|
428
|
+
"echarts.panel.title": "\u0E0A\u0E37\u0E48\u0E2D\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34",
|
|
429
|
+
"echarts.panel.titleHint": "\u0E40\u0E27\u0E49\u0E19\u0E27\u0E48\u0E32\u0E07\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E0A\u0E37\u0E48\u0E2D",
|
|
430
|
+
"echarts.panel.legend": "\u0E41\u0E2A\u0E14\u0E07\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
|
|
431
|
+
"echarts.panel.palette": "\u0E0A\u0E38\u0E14\u0E2A\u0E35",
|
|
432
|
+
"echarts.palette.default": "\u0E2A\u0E35\u0E19\u0E49\u0E33\u0E40\u0E07\u0E34\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
433
|
+
"echarts.palette.fresh": "\u0E2A\u0E35\u0E40\u0E02\u0E35\u0E22\u0E27\u0E2A\u0E14\u0E0A\u0E37\u0E48\u0E19",
|
|
434
|
+
"echarts.palette.warm": "\u0E2A\u0E35\u0E2A\u0E49\u0E21\u0E41\u0E14\u0E07\u0E2D\u0E1A\u0E2D\u0E38\u0E48\u0E19",
|
|
435
|
+
"echarts.palette.purple": "\u0E2A\u0E35\u0E21\u0E39\u0E1F\u0E40\u0E17\u0E32",
|
|
436
|
+
"echarts.panel.stack": "\u0E0B\u0E49\u0E2D\u0E19\u0E01\u0E31\u0E19",
|
|
437
|
+
"echarts.panel.innerRadius": "\u0E23\u0E31\u0E28\u0E21\u0E35\u0E43\u0E19 (%)",
|
|
438
|
+
"echarts.panel.paddingTRBL": "\u0E23\u0E30\u0E22\u0E30\u0E1A\u0E19/\u0E02\u0E27\u0E32/\u0E25\u0E48\u0E32\u0E07/\u0E0B\u0E49\u0E32\u0E22 (%)",
|
|
439
|
+
"echarts.panel.paddingTop": "\u0E23\u0E30\u0E22\u0E30\u0E1A\u0E19",
|
|
440
|
+
"echarts.panel.paddingRight": "\u0E23\u0E30\u0E22\u0E30\u0E02\u0E27\u0E32 (\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E1B\u0E49\u0E32\u0E22\u0E14\u0E49\u0E32\u0E19\u0E19\u0E2D\u0E01)",
|
|
441
|
+
"echarts.panel.paddingBottom": "\u0E23\u0E30\u0E22\u0E30\u0E25\u0E48\u0E32\u0E07",
|
|
442
|
+
"echarts.panel.paddingLeft": "\u0E23\u0E30\u0E22\u0E30\u0E0B\u0E49\u0E32\u0E22",
|
|
443
|
+
"echarts.panel.radius": "\u0E23\u0E31\u0E28\u0E21\u0E35 (%)",
|
|
444
|
+
"echarts.panel.minMax": "\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14 / \u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",
|
|
445
|
+
"echarts.panel.group": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34",
|
|
446
|
+
"echarts.series.typeNames.bar": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07",
|
|
447
|
+
"echarts.series.typeNames.barH": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19",
|
|
448
|
+
"echarts.series.typeNames.line": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",
|
|
449
|
+
"echarts.series.typeNames.area": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",
|
|
450
|
+
"echarts.series.typeNames.pie": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21",
|
|
451
|
+
"echarts.series.typeNames.doughnut": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21\u0E27\u0E07\u0E41\u0E2B\u0E27\u0E19",
|
|
452
|
+
"echarts.series.typeNames.scatter": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",
|
|
453
|
+
"echarts.series.typeNames.radar": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E23\u0E14\u0E32\u0E23\u0E4C",
|
|
454
|
+
"echarts.series.typeNames.funnel": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07",
|
|
455
|
+
"echarts.series.typeNames.gauge": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E01\u0E08\u0E27\u0E31\u0E14",
|
|
456
|
+
"echarts.label.formatter.value": "\u0E04\u0E48\u0E32",
|
|
457
|
+
"echarts.label.formatter.nameValue": "\u0E0A\u0E37\u0E48\u0E2D: \u0E04\u0E48\u0E32",
|
|
458
|
+
"echarts.label.formatter.name": "\u0E0A\u0E37\u0E48\u0E2D",
|
|
459
|
+
"echarts.label.formatter.percent": "\u0E40\u0E1B\u0E2D\u0E23\u0E4C\u0E40\u0E0B\u0E47\u0E19\u0E15\u0E4C",
|
|
460
|
+
"echarts.label.position.bar.top": "\u0E1A\u0E19",
|
|
461
|
+
"echarts.label.position.bar.inside": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
462
|
+
"echarts.label.position.bar.insideTop": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19\u0E1A\u0E19",
|
|
463
|
+
"echarts.label.position.bar.bottom": "\u0E25\u0E48\u0E32\u0E07",
|
|
464
|
+
"echarts.label.position.bar.insideBottom": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19\u0E25\u0E48\u0E32\u0E07",
|
|
465
|
+
"echarts.label.position.bar.right": "\u0E02\u0E27\u0E32",
|
|
466
|
+
"echarts.label.position.bar.left": "\u0E0B\u0E49\u0E32\u0E22",
|
|
467
|
+
"echarts.label.position.bar.middle": "\u0E01\u0E25\u0E32\u0E07",
|
|
468
|
+
"echarts.label.position.line.top": "\u0E1A\u0E19",
|
|
469
|
+
"echarts.label.position.line.bottom": "\u0E25\u0E48\u0E32\u0E07",
|
|
470
|
+
"echarts.label.position.line.inside": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
471
|
+
"echarts.label.position.line.left": "\u0E0B\u0E49\u0E32\u0E22",
|
|
472
|
+
"echarts.label.position.line.right": "\u0E02\u0E27\u0E32",
|
|
473
|
+
"echarts.label.position.pie.outside": "\u0E14\u0E49\u0E32\u0E19\u0E19\u0E2D\u0E01",
|
|
474
|
+
"echarts.label.position.pie.inside": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
475
|
+
"echarts.label.position.pie.center": "\u0E01\u0E25\u0E32\u0E07",
|
|
476
|
+
"echarts.label.position.scatter.top": "\u0E1A\u0E19",
|
|
477
|
+
"echarts.label.position.scatter.bottom": "\u0E25\u0E48\u0E32\u0E07",
|
|
478
|
+
"echarts.label.position.scatter.left": "\u0E0B\u0E49\u0E32\u0E22",
|
|
479
|
+
"echarts.label.position.scatter.right": "\u0E02\u0E27\u0E32",
|
|
480
|
+
"echarts.label.position.scatter.inside": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
481
|
+
"echarts.label.position.radar.top": "\u0E1A\u0E19",
|
|
482
|
+
"echarts.label.position.radar.bottom": "\u0E25\u0E48\u0E32\u0E07",
|
|
483
|
+
"echarts.label.position.radar.left": "\u0E0B\u0E49\u0E32\u0E22",
|
|
484
|
+
"echarts.label.position.radar.right": "\u0E02\u0E27\u0E32",
|
|
485
|
+
"echarts.label.position.radar.inside": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
486
|
+
"echarts.label.position.funnel.outer": "\u0E14\u0E49\u0E32\u0E19\u0E19\u0E2D\u0E01",
|
|
487
|
+
"echarts.label.position.funnel.inner": "\u0E14\u0E49\u0E32\u0E19\u0E43\u0E19",
|
|
488
|
+
"echarts.label.position.funnel.left": "\u0E0B\u0E49\u0E32\u0E22",
|
|
489
|
+
"echarts.label.position.funnel.right": "\u0E02\u0E27\u0E32",
|
|
490
|
+
"echarts.label.position.funnel.top": "\u0E1A\u0E19",
|
|
491
|
+
"echarts.label.position.funnel.bottom": "\u0E25\u0E48\u0E32\u0E07",
|
|
492
|
+
"echarts.meta.chartOption": "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34",
|
|
493
|
+
"echarts.meta.dataSource": "\u0E41\u0E2B\u0E25\u0E48\u0E07\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
494
|
+
"echarts.meta.categoryField": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48",
|
|
495
|
+
"echarts.meta.valueFields": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32",
|
|
496
|
+
"echarts.meta.seriesField": "\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E41\u0E22\u0E01\u0E0A\u0E38\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
497
|
+
"echarts.meta.bubbleSize": "\u0E02\u0E19\u0E32\u0E14\u0E1F\u0E2D\u0E07",
|
|
498
|
+
"echarts.notes.bar": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07: \u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48 + \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E2B\u0E25\u0E32\u0E22\u0E15\u0E31\u0E27 \u0E2B\u0E19\u0E36\u0E48\u0E07\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E36\u0E48\u0E07 series; \u0E40\u0E02\u0E35\u0E22\u0E19\u0E15\u0E31\u0E27\u0E41\u0E17\u0E19 $data \u0E43\u0E19 series[].data; \u0E04\u0E27\u0E32\u0E21\u0E2A\u0E39\u0E07\u0E04\u0E07\u0E17\u0E35\u0E48 \u0E2B\u0E49\u0E32\u0E21\u0E43\u0E0A\u0E49 autoHeight",
|
|
499
|
+
"echarts.notes.barH": "\u0E41\u0E17\u0E48\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19: xAxis \u0E40\u0E1B\u0E47\u0E19\u0E41\u0E01\u0E19\u0E04\u0E48\u0E32 yAxis \u0E40\u0E1B\u0E47\u0E19\u0E41\u0E01\u0E19\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48; \u0E40\u0E02\u0E35\u0E22\u0E19\u0E15\u0E31\u0E27\u0E41\u0E17\u0E19 $data \u0E43\u0E19 yAxis.data \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48",
|
|
500
|
+
"echarts.notes.line": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19: \u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48 + \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E2B\u0E25\u0E32\u0E22\u0E15\u0E31\u0E27; \u0E44\u0E21\u0E48\u0E40\u0E02\u0E35\u0E22\u0E19 areaStyle",
|
|
501
|
+
"echarts.notes.area": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48: \u0E40\u0E2A\u0E49\u0E19 + series[].areaStyle; \u0E19\u0E2D\u0E01\u0E19\u0E31\u0E49\u0E19\u0E40\u0E2B\u0E21\u0E37\u0E2D\u0E19\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",
|
|
502
|
+
"echarts.notes.pie": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21: \u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48 + \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E41\u0E23\u0E01\u0E2A\u0E23\u0E49\u0E32\u0E07 { name, value }; \u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E40\u0E1E\u0E35\u0E22\u0E07\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32",
|
|
503
|
+
"echarts.notes.doughnut": "\u0E27\u0E07\u0E01\u0E25\u0E21\u0E27\u0E07\u0E41\u0E2B\u0E27\u0E19: \u0E27\u0E07\u0E01\u0E25\u0E21 + radius:[\u0E23\u0E31\u0E28\u0E21\u0E35\u0E43\u0E19, \u0E23\u0E31\u0E28\u0E21\u0E35\u0E19\u0E2D\u0E01]; \u0E23\u0E31\u0E28\u0E21\u0E35\u0E43\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E43\u0E19\u0E41\u0E1C\u0E07",
|
|
504
|
+
"echarts.notes.scatter": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22: \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48\u0E40\u0E1B\u0E47\u0E19 x \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E41\u0E23\u0E01\u0E40\u0E1B\u0E47\u0E19 y; \u0E40\u0E21\u0E37\u0E48\u0E2D\u0E40\u0E1B\u0E34\u0E14 chartBubble \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E02\u0E19\u0E32\u0E14\u0E08\u0E38\u0E14",
|
|
505
|
+
"echarts.notes.radar": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E23\u0E14\u0E32\u0E23\u0E4C: \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E17\u0E38\u0E01\u0E15\u0E31\u0E27\u0E04\u0E37\u0E2D\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E21\u0E34\u0E15\u0E34 (radar.indicator) \u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E41\u0E15\u0E48\u0E25\u0E30\u0E41\u0E16\u0E27\u0E04\u0E37\u0E2D\u0E2B\u0E19\u0E36\u0E48\u0E07 series (\u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48\u0E40\u0E1B\u0E47\u0E19\u0E0A\u0E37\u0E48\u0E2D series); \u0E23\u0E31\u0E28\u0E21\u0E35\u0E40\u0E02\u0E35\u0E22\u0E19\u0E42\u0E14\u0E22\u0E41\u0E1C\u0E07\u0E44\u0E1B\u0E17\u0E35\u0E48 radar.radius (%, \u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19 75)",
|
|
506
|
+
"echarts.notes.funnel": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E0A\u0E48\u0E2D\u0E07\u0E17\u0E32\u0E07: \u0E2B\u0E21\u0E27\u0E14\u0E2B\u0E21\u0E39\u0E48 + \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E41\u0E23\u0E01 \u0E40\u0E23\u0E35\u0E22\u0E07\u0E15\u0E32\u0E21\u0E04\u0E48\u0E32\u0E25\u0E07\u0E21\u0E32; \u0E23\u0E30\u0E22\u0E30\u0E20\u0E32\u0E22\u0E43\u0E19\u0E2A\u0E35\u0E48\u0E14\u0E49\u0E32\u0E19\u0E40\u0E02\u0E35\u0E22\u0E19\u0E42\u0E14\u0E22\u0E41\u0E1C\u0E07\u0E44\u0E1B\u0E17\u0E35\u0E48 series.left/right/top/bottom (%, \u0E40\u0E1C\u0E37\u0E48\u0E2D\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48\u0E14\u0E49\u0E32\u0E19\u0E02\u0E27\u0E32\u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A\u0E1B\u0E49\u0E32\u0E22\u0E14\u0E49\u0E32\u0E19\u0E19\u0E2D\u0E01)",
|
|
507
|
+
"echarts.notes.gauge": "\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E01\u0E08\u0E27\u0E31\u0E14: \u0E1F\u0E34\u0E25\u0E14\u0E4C\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E41\u0E23\u0E01\u0E02\u0E2D\u0E07\u0E41\u0E16\u0E27\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E41\u0E23\u0E01\u0E40\u0E1B\u0E47\u0E19\u0E04\u0E48\u0E32\u0E1C\u0E25\u0E31\u0E01\u0E14\u0E31\u0E19; min/max \u0E40\u0E02\u0E35\u0E22\u0E19\u0E42\u0E14\u0E22\u0E41\u0E1C\u0E07\u0E44\u0E1B\u0E17\u0E35\u0E48 series[0].min/max"
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
// src/ui.ts
|
|
34
512
|
var import_plugin_kit = require("@worm-print-platform/plugin-kit");
|
|
35
|
-
var
|
|
513
|
+
var import_dom = require("@worm-print-platform/plugin-kit/dom");
|
|
514
|
+
var import_controls = require("@worm-print-platform/plugin-kit/controls");
|
|
515
|
+
|
|
516
|
+
// src/plugin.ts
|
|
517
|
+
var import_i18n = require("@worm-print-platform/core/i18n");
|
|
518
|
+
var import_designer2 = require("@worm-print-platform/core/designer");
|
|
519
|
+
|
|
520
|
+
// src/kinds.ts
|
|
521
|
+
var BASE_REQUIRED = ["left", "top", "width", "height", "chartOption"];
|
|
522
|
+
var DATA_FIELDS = ["dataSource", "categoryField", "valueFields", "seriesField"];
|
|
523
|
+
var STYLE_FIELDS = ["title", "legend", "palette"];
|
|
524
|
+
var CHART_KIND_DEFINITIONS = [
|
|
525
|
+
{
|
|
526
|
+
type: "barChart",
|
|
527
|
+
label: "\u67F1\u72B6\u56FE",
|
|
528
|
+
labelKey: "echarts.series.typeNames.bar",
|
|
529
|
+
icon: "ChartColumn",
|
|
530
|
+
seriesType: "bar",
|
|
531
|
+
orientation: "vertical",
|
|
532
|
+
fields: [...DATA_FIELDS, ...STYLE_FIELDS, "stack", "label"],
|
|
533
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
534
|
+
defaultWidth: 100,
|
|
535
|
+
defaultHeight: 60,
|
|
536
|
+
notes: "\u67F1\u72B6\u56FE\uFF1A\u7C7B\u76EE + \u591A\u4E2A\u6570\u503C\u5B57\u6BB5\uFF0C\u6BCF\u5B57\u6BB5\u4E00\u4E2A series\uFF1Bseries[].data \u5199 $data \u5360\u4F4D\uFF1B\u56FA\u5B9A\u9AD8\uFF0C\u7981\u6B62 autoHeight",
|
|
537
|
+
notesKey: "echarts.notes.bar"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
type: "barHChart",
|
|
541
|
+
label: "\u6761\u5F62\u56FE",
|
|
542
|
+
labelKey: "echarts.series.typeNames.barH",
|
|
543
|
+
icon: "ChartBar",
|
|
544
|
+
seriesType: "bar",
|
|
545
|
+
orientation: "horizontal",
|
|
546
|
+
fields: [...DATA_FIELDS, ...STYLE_FIELDS, "stack", "label"],
|
|
547
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
548
|
+
defaultWidth: 100,
|
|
549
|
+
defaultHeight: 60,
|
|
550
|
+
notes: "\u6A2A\u5411\u6761\u5F62\u56FE\uFF1AxAxis \u4E3A\u6570\u503C\u3001yAxis \u4E3A\u7C7B\u76EE\uFF1B\u7C7B\u76EE\u5199 yAxis.data \u7684 $data \u5360\u4F4D",
|
|
551
|
+
notesKey: "echarts.notes.barH"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
type: "lineChart",
|
|
555
|
+
label: "\u6298\u7EBF\u56FE",
|
|
556
|
+
labelKey: "echarts.series.typeNames.line",
|
|
557
|
+
icon: "ChartLine",
|
|
558
|
+
seriesType: "line",
|
|
559
|
+
fields: [...DATA_FIELDS, ...STYLE_FIELDS, "stack", "label"],
|
|
560
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
561
|
+
defaultWidth: 100,
|
|
562
|
+
defaultHeight: 60,
|
|
563
|
+
notes: "\u6298\u7EBF\u56FE\uFF1A\u7C7B\u76EE + \u591A\u4E2A\u6570\u503C\u5B57\u6BB5\uFF1B\u4E0D\u5199 areaStyle",
|
|
564
|
+
notesKey: "echarts.notes.line"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
type: "areaChart",
|
|
568
|
+
label: "\u9762\u79EF\u56FE",
|
|
569
|
+
labelKey: "echarts.series.typeNames.area",
|
|
570
|
+
icon: "ChartArea",
|
|
571
|
+
seriesType: "line",
|
|
572
|
+
fields: [...DATA_FIELDS, ...STYLE_FIELDS, "stack", "label"],
|
|
573
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
574
|
+
defaultWidth: 100,
|
|
575
|
+
defaultHeight: 60,
|
|
576
|
+
notes: "\u9762\u79EF\u56FE\uFF1A\u6298\u7EBF + series[].areaStyle\uFF1B\u5176\u4F59\u540C\u6298\u7EBF\u56FE",
|
|
577
|
+
notesKey: "echarts.notes.area"
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
type: "pieChart",
|
|
581
|
+
label: "\u997C\u56FE",
|
|
582
|
+
labelKey: "echarts.series.typeNames.pie",
|
|
583
|
+
icon: "ChartPie",
|
|
584
|
+
seriesType: "pie",
|
|
585
|
+
fields: ["dataSource", "categoryField", "valueFields", ...STYLE_FIELDS, "label"],
|
|
586
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
587
|
+
defaultWidth: 60,
|
|
588
|
+
defaultHeight: 60,
|
|
589
|
+
notes: "\u997C\u56FE\uFF1A\u7C7B\u76EE + \u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u751F\u6210 { name, value }\uFF1B\u53EA\u9700\u4E00\u4E2A\u6570\u503C\u5B57\u6BB5",
|
|
590
|
+
notesKey: "echarts.notes.pie"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
type: "doughnutChart",
|
|
594
|
+
label: "\u73AF\u5F62\u56FE",
|
|
595
|
+
labelKey: "echarts.series.typeNames.doughnut",
|
|
596
|
+
icon: "Donut",
|
|
597
|
+
seriesType: "pie",
|
|
598
|
+
fields: ["dataSource", "categoryField", "valueFields", ...STYLE_FIELDS, "innerRadius", "label"],
|
|
599
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
600
|
+
defaultWidth: 60,
|
|
601
|
+
defaultHeight: 60,
|
|
602
|
+
notes: "\u73AF\u5F62\u56FE\uFF1A\u997C\u56FE + radius:[\u5185\u5F84,\u5916\u5F84]\uFF1B\u5185\u5F84\u7531\u9762\u677F\u914D\u7F6E",
|
|
603
|
+
notesKey: "echarts.notes.doughnut"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
type: "scatterChart",
|
|
607
|
+
label: "\u6563\u70B9\u56FE",
|
|
608
|
+
labelKey: "echarts.series.typeNames.scatter",
|
|
609
|
+
icon: "ChartScatter",
|
|
610
|
+
seriesType: "scatter",
|
|
611
|
+
fields: ["dataSource", "categoryField", "valueFields", ...STYLE_FIELDS, "bubble", "label"],
|
|
612
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
613
|
+
defaultWidth: 80,
|
|
614
|
+
defaultHeight: 60,
|
|
615
|
+
notes: "\u6563\u70B9\u56FE\uFF1A\u7C7B\u76EE\u5B57\u6BB5\u4F5C x\u3001\u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C y\uFF1BchartBubble \u5F00\u542F\u65F6\u7528\u7B2C\u4E8C\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C\u70B9\u5927\u5C0F",
|
|
616
|
+
notesKey: "echarts.notes.scatter"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
type: "radarChart",
|
|
620
|
+
label: "\u96F7\u8FBE\u56FE",
|
|
621
|
+
labelKey: "echarts.series.typeNames.radar",
|
|
622
|
+
icon: "Radar",
|
|
623
|
+
seriesType: "radar",
|
|
624
|
+
fields: ["dataSource", "categoryField", "valueFields", ...STYLE_FIELDS, "radius", "label"],
|
|
625
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
626
|
+
defaultWidth: 70,
|
|
627
|
+
defaultHeight: 60,
|
|
628
|
+
notes: "\u96F7\u8FBE\u56FE\uFF1A\u6BCF\u4E2A\u6570\u503C\u5B57\u6BB5\u662F\u4E00\u4E2A\u7EF4\u5EA6\uFF08radar.indicator\uFF09\uFF0C\u6BCF\u884C\u6570\u636E\u662F\u4E00\u4E2A\u7CFB\u5217\uFF08\u7C7B\u76EE\u5B57\u6BB5\u4F5C\u7CFB\u5217\u540D\uFF09\uFF1B\u534A\u5F84\u7531\u9762\u677F\u5199 radar.radius\uFF08%\uFF0C\u9ED8\u8BA4 75\uFF09",
|
|
629
|
+
notesKey: "echarts.notes.radar"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
type: "funnelChart",
|
|
633
|
+
label: "\u6F0F\u6597\u56FE",
|
|
634
|
+
labelKey: "echarts.series.typeNames.funnel",
|
|
635
|
+
icon: "Funnel",
|
|
636
|
+
seriesType: "funnel",
|
|
637
|
+
fields: ["dataSource", "categoryField", "valueFields", ...STYLE_FIELDS, "padding", "label"],
|
|
638
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
639
|
+
defaultWidth: 60,
|
|
640
|
+
defaultHeight: 60,
|
|
641
|
+
notes: "\u6F0F\u6597\u56FE\uFF1A\u7C7B\u76EE + \u9996\u4E2A\u6570\u503C\u5B57\u6BB5\uFF0C\u6309\u6570\u503C\u964D\u5E8F\uFF1B\u56DB\u8FB9\u5185\u8FB9\u8DDD\u7531\u9762\u677F\u5199 series.left/right/top/bottom\uFF08%\uFF0C\u53F3\u4FA7\u9700\u7559\u5916\u7F6E\u6807\u7B7E\u7A7A\u95F4\uFF09",
|
|
642
|
+
notesKey: "echarts.notes.funnel"
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
type: "gaugeChart",
|
|
646
|
+
label: "\u4EEA\u8868\u76D8",
|
|
647
|
+
labelKey: "echarts.series.typeNames.gauge",
|
|
648
|
+
icon: "Gauge",
|
|
649
|
+
seriesType: "gauge",
|
|
650
|
+
fields: ["dataSource", "valueFields", ...STYLE_FIELDS, "gaugeRange", "label"],
|
|
651
|
+
requiredOptionKeys: BASE_REQUIRED,
|
|
652
|
+
defaultWidth: 60,
|
|
653
|
+
defaultHeight: 60,
|
|
654
|
+
notes: "\u4EEA\u8868\u76D8\uFF1A\u53D6\u9996\u884C\u6570\u636E\u7684\u9996\u4E2A\u6570\u503C\u5B57\u6BB5\u4F5C\u6307\u9488\u503C\uFF1Bmin/max \u7531\u9762\u677F\u5199\u5165 series[0].min/max",
|
|
655
|
+
notesKey: "echarts.notes.gauge"
|
|
656
|
+
}
|
|
657
|
+
];
|
|
658
|
+
var CHART_KINDS = CHART_KIND_DEFINITIONS.map((def) => def.type);
|
|
659
|
+
function getChartKindDefinition(type) {
|
|
660
|
+
return CHART_KIND_DEFINITIONS.find((def) => def.type === type);
|
|
661
|
+
}
|
|
662
|
+
function resolveChartPanelFields(type) {
|
|
663
|
+
return getChartKindDefinition(type)?.fields ?? [];
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// src/bind.ts
|
|
667
|
+
var import_core = require("@worm-print-platform/core");
|
|
668
|
+
function chartNumber(value) {
|
|
669
|
+
const n = typeof value === "number" ? value : Number(value);
|
|
670
|
+
return Number.isFinite(n) ? n : 0;
|
|
671
|
+
}
|
|
672
|
+
function evaluateChartOption(node, data, keepStrings = false) {
|
|
673
|
+
if (typeof node === "string") {
|
|
674
|
+
if (node.startsWith("$data")) return node;
|
|
675
|
+
if (keepStrings) return node;
|
|
676
|
+
return node.includes("{") ? (0, import_core.evaluateTemplate)(node, data) : node;
|
|
677
|
+
}
|
|
678
|
+
if (Array.isArray(node)) return node.map((item) => evaluateChartOption(item, data, keepStrings));
|
|
679
|
+
if (node && typeof node === "object") {
|
|
680
|
+
const out = {};
|
|
681
|
+
for (const [key, value] of Object.entries(node)) {
|
|
682
|
+
const childKeep = keepStrings || key === "label" || key === "detail";
|
|
683
|
+
out[key] = evaluateChartOption(value, data, childKeep);
|
|
684
|
+
}
|
|
685
|
+
return out;
|
|
686
|
+
}
|
|
687
|
+
return node;
|
|
688
|
+
}
|
|
689
|
+
function hasDataPlaceholder(series) {
|
|
690
|
+
return Array.isArray(series.data) && series.data.includes("$data");
|
|
691
|
+
}
|
|
692
|
+
function resolveListSource(options, data) {
|
|
693
|
+
const explicit = options.dataSource;
|
|
694
|
+
if (typeof explicit === "string" && Array.isArray(data[explicit])) return data[explicit];
|
|
695
|
+
for (const value of Object.values(data)) {
|
|
696
|
+
if (Array.isArray(value)) return value;
|
|
697
|
+
}
|
|
698
|
+
return [];
|
|
699
|
+
}
|
|
700
|
+
function asString(value) {
|
|
701
|
+
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
702
|
+
}
|
|
703
|
+
function asFieldList(value) {
|
|
704
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
|
|
705
|
+
}
|
|
706
|
+
function seriesOf(option) {
|
|
707
|
+
return Array.isArray(option.series) ? option.series : [];
|
|
708
|
+
}
|
|
709
|
+
function rowValue(row, field2) {
|
|
710
|
+
return field2 ? chartNumber(row[field2]) : 0;
|
|
711
|
+
}
|
|
712
|
+
function writeCategories(option, categories) {
|
|
713
|
+
for (const key of ["xAxis", "yAxis"]) {
|
|
714
|
+
const raw = option[key];
|
|
715
|
+
const axes = Array.isArray(raw) ? raw : raw ? [raw] : [];
|
|
716
|
+
for (const axis of axes) {
|
|
717
|
+
if (axis && typeof axis === "object" && Array.isArray(axis.data) && axis.data.includes("$data")) {
|
|
718
|
+
axis.data = [...categories];
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
function applyCartesian(option, rows, categoryField, valueFields, seriesField) {
|
|
724
|
+
const rawSeries = seriesOf(option);
|
|
725
|
+
if (!rawSeries.some(hasDataPlaceholder)) return;
|
|
726
|
+
const categories = rows.map((row, index) => categoryField ? row[categoryField] : index + 1);
|
|
727
|
+
const fieldAt = (index) => valueFields[Math.min(index, valueFields.length - 1)];
|
|
728
|
+
if (seriesField) {
|
|
729
|
+
const template2 = rawSeries[0];
|
|
730
|
+
const groups = /* @__PURE__ */ new Map();
|
|
731
|
+
for (const row of rows) {
|
|
732
|
+
const name = String(row[seriesField] ?? "");
|
|
733
|
+
const bucket = groups.get(name) ?? /* @__PURE__ */ new Map();
|
|
734
|
+
const category = String(row[categoryField ?? ""]);
|
|
735
|
+
bucket.set(category, (bucket.get(category) ?? 0) + rowValue(row, fieldAt(0)));
|
|
736
|
+
groups.set(name, bucket);
|
|
737
|
+
}
|
|
738
|
+
const distinctCategories = [...new Set(categories)];
|
|
739
|
+
option.series = [...groups.entries()].map(([name, bucket]) => ({
|
|
740
|
+
...template2,
|
|
741
|
+
name,
|
|
742
|
+
data: distinctCategories.map((category) => bucket.get(String(category)) ?? null)
|
|
743
|
+
}));
|
|
744
|
+
writeCategories(option, distinctCategories);
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
const template = rawSeries[rawSeries.length - 1];
|
|
748
|
+
while (rawSeries.length < valueFields.length) rawSeries.push({ ...template, data: ["$data"] });
|
|
749
|
+
option.series = rawSeries.map((series, index) => {
|
|
750
|
+
if (!hasDataPlaceholder(series)) return series;
|
|
751
|
+
return { ...series, data: rows.map((row) => rowValue(row, fieldAt(index))) };
|
|
752
|
+
});
|
|
753
|
+
writeCategories(option, categories);
|
|
754
|
+
}
|
|
755
|
+
function applyPieLike(option, rows, categoryField, valueField, sortDescending) {
|
|
756
|
+
const series = seriesOf(option);
|
|
757
|
+
if (!series.some(hasDataPlaceholder)) return;
|
|
758
|
+
const data = rows.map((row) => ({
|
|
759
|
+
name: categoryField ? String(row[categoryField] ?? "") : "",
|
|
760
|
+
value: rowValue(row, valueField)
|
|
761
|
+
}));
|
|
762
|
+
if (sortDescending) data.sort((a, b) => b.value - a.value);
|
|
763
|
+
option.series = series.map((item) => ({ ...item, data }));
|
|
764
|
+
}
|
|
765
|
+
function applyScatter(option, rows, xField, valueFields, bubble) {
|
|
766
|
+
const series = seriesOf(option);
|
|
767
|
+
if (!series.some(hasDataPlaceholder)) return;
|
|
768
|
+
const yField = valueFields[0];
|
|
769
|
+
const sizeField = bubble ? valueFields[1] : void 0;
|
|
770
|
+
const sizes = sizeField ? rows.map((row) => rowValue(row, sizeField)) : [];
|
|
771
|
+
const min = sizes.length > 0 ? Math.min(...sizes) : 0;
|
|
772
|
+
const max = sizes.length > 0 ? Math.max(...sizes) : 0;
|
|
773
|
+
const sizeOf = (value) => max === min ? 12 : Math.round(6 + (value - min) / (max - min) * 18);
|
|
774
|
+
option.series = series.map((item) => ({
|
|
775
|
+
...item,
|
|
776
|
+
data: rows.map((row) => {
|
|
777
|
+
const value = [rowValue(row, xField), rowValue(row, yField)];
|
|
778
|
+
if (!sizeField) return value;
|
|
779
|
+
return { value, symbolSize: sizeOf(rowValue(row, sizeField)) };
|
|
780
|
+
})
|
|
781
|
+
}));
|
|
782
|
+
}
|
|
783
|
+
function niceMax(value) {
|
|
784
|
+
if (value <= 0) return 10;
|
|
785
|
+
const magnitude = 10 ** Math.floor(Math.log10(value));
|
|
786
|
+
const step = magnitude >= 10 ? magnitude : 10;
|
|
787
|
+
return Math.ceil(value / step) * step;
|
|
788
|
+
}
|
|
789
|
+
function applyRadar(option, rows, categoryField, valueFields) {
|
|
790
|
+
const series = seriesOf(option);
|
|
791
|
+
if (!series.some(hasDataPlaceholder)) return;
|
|
792
|
+
const columnMax = valueFields.map((field2) => Math.max(0, ...rows.map((row) => rowValue(row, field2))));
|
|
793
|
+
option.radar = {
|
|
794
|
+
...option.radar ?? {},
|
|
795
|
+
// 维度 = 数值字段;max 取该列最大值上浮取整
|
|
796
|
+
indicator: valueFields.map((field2, index) => ({ name: field2, max: niceMax(columnMax[index]) }))
|
|
797
|
+
};
|
|
798
|
+
option.series = series.map((item) => ({
|
|
799
|
+
...item,
|
|
800
|
+
data: rows.map((row) => ({
|
|
801
|
+
name: categoryField ? String(row[categoryField] ?? "") : "",
|
|
802
|
+
value: valueFields.map((field2) => rowValue(row, field2))
|
|
803
|
+
}))
|
|
804
|
+
}));
|
|
805
|
+
}
|
|
806
|
+
function applyGauge(option, rows, valueField) {
|
|
807
|
+
const series = seriesOf(option);
|
|
808
|
+
if (!series.some(hasDataPlaceholder)) return;
|
|
809
|
+
const first = rows[0] ?? {};
|
|
810
|
+
option.series = series.map((item) => ({ ...item, data: [{ value: rowValue(first, valueField), name: valueField }] }));
|
|
811
|
+
}
|
|
812
|
+
function bindChartData(type, options, data) {
|
|
813
|
+
const raw = options.chartOption;
|
|
814
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
|
|
815
|
+
const option = evaluateChartOption(raw, data);
|
|
816
|
+
const valueFields = asFieldList(options.chartValueFields);
|
|
817
|
+
if (valueFields.length === 0) return { _chartOption: option };
|
|
818
|
+
const list = resolveListSource({ ...options, dataSource: options.chartDataSource ?? options.dataSource }, data);
|
|
819
|
+
if (list.length === 0) return { _chartOption: option };
|
|
820
|
+
const categoryField = asString(options.chartCategoryField);
|
|
821
|
+
const def = getChartKindDefinition(type);
|
|
822
|
+
switch (def?.seriesType) {
|
|
823
|
+
case "radar":
|
|
824
|
+
applyRadar(option, list, categoryField, valueFields);
|
|
825
|
+
break;
|
|
826
|
+
case "gauge":
|
|
827
|
+
applyGauge(option, list, valueFields[0]);
|
|
828
|
+
break;
|
|
829
|
+
case "funnel":
|
|
830
|
+
applyPieLike(option, list, categoryField, valueFields[0], true);
|
|
831
|
+
break;
|
|
832
|
+
case "pie":
|
|
833
|
+
applyPieLike(option, list, categoryField, valueFields[0], false);
|
|
834
|
+
break;
|
|
835
|
+
case "scatter":
|
|
836
|
+
applyScatter(option, list, categoryField, valueFields, options.chartBubble === true);
|
|
837
|
+
break;
|
|
838
|
+
default:
|
|
839
|
+
applyCartesian(option, list, categoryField, valueFields, asString(options.chartSeriesField));
|
|
840
|
+
break;
|
|
841
|
+
}
|
|
842
|
+
return { _chartOption: option };
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// src/config.ts
|
|
846
|
+
var import_designer = require("@worm-print-platform/core/designer");
|
|
847
|
+
|
|
848
|
+
// src/constants.ts
|
|
849
|
+
var CHART_PLUGIN_ID = "@worm-print-platform/echarts";
|
|
850
|
+
var CHART_PALETTES = [
|
|
851
|
+
{ key: "default", label: "\u9ED8\u8BA4\u84DD", labelKey: "echarts.palette.default", colors: ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de"] },
|
|
852
|
+
{ key: "fresh", label: "\u6E05\u65B0\u7EFF", labelKey: "echarts.palette.fresh", colors: ["#2f9e6e", "#5cc9a7", "#9ad6c1", "#f2c94c", "#4a90e2"] },
|
|
853
|
+
{ key: "warm", label: "\u6696\u6A59\u7EA2", labelKey: "echarts.palette.warm", colors: ["#f2704e", "#f7a35c", "#f7d56d", "#c54e3f", "#8f5a4a"] },
|
|
854
|
+
{ key: "purple", label: "\u7D2B\u7070", labelKey: "echarts.palette.purple", colors: ["#7b61ff", "#9b8cff", "#c3baff", "#596275", "#8d99ae"] }
|
|
855
|
+
];
|
|
856
|
+
var FALLBACK_SAMPLE_CATEGORIES = ["\u793A\u4F8B\u4E00", "\u793A\u4F8B\u4E8C", "\u793A\u4F8B\u4E09"];
|
|
857
|
+
var FUNNEL_PADDING_DEFAULTS = { top: 6, right: 25, bottom: 6, left: 5 };
|
|
858
|
+
var RADAR_RADIUS_DEFAULT = 75;
|
|
859
|
+
var ECHARTS_RADAR_RADIUS_DEFAULT = 50;
|
|
860
|
+
var ECHARTS_FUNNEL_PADDING_PX = { top: 60, right: 80, bottom: 65, left: 80 };
|
|
861
|
+
|
|
862
|
+
// src/defaults.ts
|
|
863
|
+
var GRID = { left: "8%", right: "8%", bottom: "12%", top: "18%", containLabel: true };
|
|
864
|
+
function percentInsets(padding) {
|
|
865
|
+
return {
|
|
866
|
+
top: `${padding.top}%`,
|
|
867
|
+
right: `${padding.right}%`,
|
|
868
|
+
bottom: `${padding.bottom}%`,
|
|
869
|
+
left: `${padding.left}%`
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
function createDefaultChartOption(type) {
|
|
873
|
+
const def = getChartKindDefinition(type);
|
|
874
|
+
const title = { text: "" };
|
|
875
|
+
switch (def?.seriesType) {
|
|
876
|
+
case "pie":
|
|
877
|
+
return {
|
|
878
|
+
title,
|
|
879
|
+
tooltip: { trigger: "item" },
|
|
880
|
+
series: [{
|
|
881
|
+
type: "pie",
|
|
882
|
+
name: "\u6570\u91CF",
|
|
883
|
+
data: ["$data"],
|
|
884
|
+
radius: type === "doughnutChart" ? ["40%", "70%"] : "62%"
|
|
885
|
+
}]
|
|
886
|
+
};
|
|
887
|
+
case "scatter":
|
|
888
|
+
return {
|
|
889
|
+
title,
|
|
890
|
+
grid: GRID,
|
|
891
|
+
tooltip: { trigger: "axis" },
|
|
892
|
+
xAxis: { type: "value" },
|
|
893
|
+
yAxis: { type: "value" },
|
|
894
|
+
series: [{ type: "scatter", name: "\u6570\u91CF", data: ["$data"], symbolSize: 8 }]
|
|
895
|
+
};
|
|
896
|
+
case "radar":
|
|
897
|
+
return {
|
|
898
|
+
title,
|
|
899
|
+
tooltip: { trigger: "item" },
|
|
900
|
+
// indicator 由绑定阶段按 chartValueFields 生成;设计态预览见 previewChartOption
|
|
901
|
+
radar: { indicator: [], radius: `${RADAR_RADIUS_DEFAULT}%` },
|
|
902
|
+
series: [{ type: "radar", name: "\u6570\u91CF", data: ["$data"] }]
|
|
903
|
+
};
|
|
904
|
+
case "funnel":
|
|
905
|
+
return {
|
|
906
|
+
title,
|
|
907
|
+
tooltip: { trigger: "item" },
|
|
908
|
+
legend: { show: false },
|
|
909
|
+
// 不写内边距会吃 ECharts 的 px 默认(左右 80/上下 60~65),小框里图形只占一半不到
|
|
910
|
+
series: [{ type: "funnel", name: "\u6570\u91CF", data: ["$data"], sort: "descending", ...percentInsets(FUNNEL_PADDING_DEFAULTS) }]
|
|
911
|
+
};
|
|
912
|
+
case "gauge":
|
|
913
|
+
return {
|
|
914
|
+
title,
|
|
915
|
+
tooltip: { trigger: "item" },
|
|
916
|
+
series: [{ type: "gauge", name: "\u6570\u91CF", min: 0, max: 100, data: [{ value: 0, name: "\u6570\u91CF" }] }]
|
|
917
|
+
};
|
|
918
|
+
default: {
|
|
919
|
+
const horizontal = def?.orientation === "horizontal";
|
|
920
|
+
const isArea = def?.seriesType === "line" && type === "areaChart";
|
|
921
|
+
const seriesType = def?.seriesType === "line" ? "line" : "bar";
|
|
922
|
+
return {
|
|
923
|
+
title,
|
|
924
|
+
grid: GRID,
|
|
925
|
+
tooltip: { trigger: "axis" },
|
|
926
|
+
xAxis: horizontal ? { type: "value" } : { type: "category", data: ["$data"] },
|
|
927
|
+
yAxis: horizontal ? { type: "category", data: ["$data"] } : { type: "value" },
|
|
928
|
+
series: [{ type: seriesType, name: "\u6570\u91CF", data: ["$data"], ...isArea ? { areaStyle: {} } : {} }]
|
|
929
|
+
};
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/config.ts
|
|
935
|
+
function getChartPluginConfig() {
|
|
936
|
+
return (0, import_designer.getPluginConfig)(CHART_PLUGIN_ID);
|
|
937
|
+
}
|
|
938
|
+
function getChartPalettes() {
|
|
939
|
+
const overrides = getChartPluginConfig().palettes ?? {};
|
|
940
|
+
const builtin = CHART_PALETTES.map((palette) => {
|
|
941
|
+
const custom = overrides[palette.key];
|
|
942
|
+
return custom ? { key: palette.key, label: custom.label ?? palette.label, labelKey: custom.label ? void 0 : palette.labelKey, colors: custom.colors } : { key: palette.key, label: palette.label, labelKey: palette.labelKey, colors: palette.colors };
|
|
943
|
+
});
|
|
944
|
+
const extra = Object.entries(overrides).filter(([key]) => !CHART_PALETTES.some((palette) => palette.key === key)).map(([key, value]) => ({ key, label: value.label ?? key, colors: value.colors }));
|
|
945
|
+
return [...builtin, ...extra];
|
|
946
|
+
}
|
|
947
|
+
function getSampleCategories() {
|
|
948
|
+
const custom = getChartPluginConfig().sampleCategories;
|
|
949
|
+
return Array.isArray(custom) && custom.length > 0 ? custom : FALLBACK_SAMPLE_CATEGORIES;
|
|
950
|
+
}
|
|
951
|
+
function chartFactoryDefaults(type, partial) {
|
|
952
|
+
const config = getChartPluginConfig();
|
|
953
|
+
const def = getChartKindDefinition(type);
|
|
954
|
+
return {
|
|
955
|
+
width: typeof config.defaultWidth === "number" ? config.defaultWidth : def?.defaultWidth ?? 100,
|
|
956
|
+
height: typeof config.defaultHeight === "number" ? config.defaultHeight : def?.defaultHeight ?? 60,
|
|
957
|
+
title: def?.label ?? "\u56FE\u8868",
|
|
958
|
+
chartOption: createDefaultChartOption(type),
|
|
959
|
+
chartDataSource: "",
|
|
960
|
+
chartCategoryField: "name",
|
|
961
|
+
chartValueFields: ["value"],
|
|
962
|
+
chartSeriesField: "",
|
|
963
|
+
...partial
|
|
964
|
+
};
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
// src/echarts.ts
|
|
968
|
+
var import_charts = require("echarts/charts");
|
|
969
|
+
var import_components = require("echarts/components");
|
|
970
|
+
var echarts = __toESM(require("echarts/core"), 1);
|
|
971
|
+
var import_renderers = require("echarts/renderers");
|
|
972
|
+
echarts.use([
|
|
973
|
+
import_charts.BarChart,
|
|
974
|
+
import_charts.LineChart,
|
|
975
|
+
import_charts.PieChart,
|
|
976
|
+
import_charts.ScatterChart,
|
|
977
|
+
import_charts.RadarChart,
|
|
978
|
+
import_charts.FunnelChart,
|
|
979
|
+
import_charts.GaugeChart,
|
|
980
|
+
import_components.GridComponent,
|
|
981
|
+
import_components.TooltipComponent,
|
|
982
|
+
import_components.LegendComponent,
|
|
983
|
+
import_components.TitleComponent,
|
|
984
|
+
import_components.DatasetComponent,
|
|
985
|
+
import_renderers.SVGRenderer
|
|
986
|
+
]);
|
|
987
|
+
var appliedComponents = /* @__PURE__ */ new Set();
|
|
988
|
+
function applyExtraComponents() {
|
|
989
|
+
const extra = getChartPluginConfig().components ?? [];
|
|
990
|
+
const fresh = extra.filter((item) => item != null && !appliedComponents.has(item));
|
|
991
|
+
if (fresh.length === 0) return;
|
|
992
|
+
echarts.use(fresh);
|
|
993
|
+
for (const item of fresh) appliedComponents.add(item);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
// src/units.ts
|
|
997
|
+
var PX_PER_MM = 96 / 25.4;
|
|
998
|
+
function mmToChartPx(mm) {
|
|
999
|
+
const value = Number.isFinite(mm) ? mm : 0;
|
|
1000
|
+
return Math.max(1, Math.round(value * PX_PER_MM));
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
// src/option-utils.ts
|
|
1004
|
+
var SAMPLE_VALUES = [12, 20, 15];
|
|
1005
|
+
function cloneChartOption(value) {
|
|
1006
|
+
try {
|
|
1007
|
+
return JSON.parse(JSON.stringify(value));
|
|
1008
|
+
} catch {
|
|
1009
|
+
return value;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
function previewChartOption(type, option) {
|
|
1013
|
+
if (!option || typeof option !== "object" || Array.isArray(option)) return {};
|
|
1014
|
+
const next = cloneChartOption(option);
|
|
1015
|
+
const def = getChartKindDefinition(type);
|
|
1016
|
+
const categories = [...getSampleCategories()];
|
|
1017
|
+
const values = [...SAMPLE_VALUES];
|
|
1018
|
+
const series = Array.isArray(next.series) ? next.series : [];
|
|
1019
|
+
const replaceSeriesData = (mapper) => {
|
|
1020
|
+
for (const item of series) {
|
|
1021
|
+
if (Array.isArray(item.data) && item.data.includes("$data")) item.data = mapper(item);
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
const replaceAxisData = () => {
|
|
1025
|
+
for (const key of ["xAxis", "yAxis"]) {
|
|
1026
|
+
const axes = Array.isArray(next[key]) ? next[key] : next[key] ? [next[key]] : [];
|
|
1027
|
+
for (const axis of axes) {
|
|
1028
|
+
if (axis && Array.isArray(axis.data) && axis.data.includes("$data")) axis.data = [...categories];
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
switch (def?.seriesType) {
|
|
1033
|
+
case "pie":
|
|
1034
|
+
replaceSeriesData(() => categories.map((name, index) => ({ name, value: values[index] ?? 10 })));
|
|
1035
|
+
break;
|
|
1036
|
+
case "funnel":
|
|
1037
|
+
replaceSeriesData(() => categories.map((name, index) => ({ name, value: values[index] ?? 10 })));
|
|
1038
|
+
break;
|
|
1039
|
+
case "scatter":
|
|
1040
|
+
replaceSeriesData(() => values.map((value) => [value, value + 6]));
|
|
1041
|
+
break;
|
|
1042
|
+
case "radar":
|
|
1043
|
+
next.radar = {
|
|
1044
|
+
...next.radar ?? {},
|
|
1045
|
+
indicator: categories.map((name) => ({ name, max: 30 }))
|
|
1046
|
+
};
|
|
1047
|
+
replaceSeriesData(() => [{ name: "\u793A\u4F8B", value: values }]);
|
|
1048
|
+
break;
|
|
1049
|
+
case "gauge":
|
|
1050
|
+
replaceSeriesData(() => [{ value: values[0] ?? 40, name: "\u6570\u91CF" }]);
|
|
1051
|
+
break;
|
|
1052
|
+
default:
|
|
1053
|
+
replaceSeriesData(() => [...values]);
|
|
1054
|
+
replaceAxisData();
|
|
1055
|
+
break;
|
|
1056
|
+
}
|
|
1057
|
+
return next;
|
|
1058
|
+
}
|
|
1059
|
+
function readPaletteKey(option, palettes) {
|
|
1060
|
+
const color = Array.isArray(option?.color) ? (option?.color).map(String) : [];
|
|
1061
|
+
const hit = palettes.find((palette) => palette.colors.every((c, i) => c === color[i]) && color.length === palette.colors.length);
|
|
1062
|
+
return hit?.key ?? "default";
|
|
1063
|
+
}
|
|
1064
|
+
function asObject(node) {
|
|
1065
|
+
if (Array.isArray(node)) return node[0] && typeof node[0] === "object" ? { ...node[0] } : {};
|
|
1066
|
+
return node && typeof node === "object" ? { ...node } : {};
|
|
1067
|
+
}
|
|
1068
|
+
function syncSeriesCount(option, count, type) {
|
|
1069
|
+
const next = cloneChartOption(option);
|
|
1070
|
+
const rawSeries = Array.isArray(next.series) ? next.series : [];
|
|
1071
|
+
const def = getChartKindDefinition(type);
|
|
1072
|
+
const template = rawSeries[0] ?? { type: def?.seriesType === "line" ? "line" : "bar", data: ["$data"] };
|
|
1073
|
+
next.series = Array.from({ length: Math.max(count, 1) }, (_, index) => ({
|
|
1074
|
+
...template,
|
|
1075
|
+
...rawSeries[index] ?? {},
|
|
1076
|
+
data: ["$data"]
|
|
1077
|
+
}));
|
|
1078
|
+
return next;
|
|
1079
|
+
}
|
|
1080
|
+
var round1 = (value) => Math.round(value * 10) / 10;
|
|
1081
|
+
function pxToPercent(px, totalPx) {
|
|
1082
|
+
return totalPx > 0 ? round1(px / totalPx * 100) : 0;
|
|
1083
|
+
}
|
|
1084
|
+
function readInsetPercent(value, totalPx, echartsPx) {
|
|
1085
|
+
if (typeof value === "string" && value.trim().endsWith("%")) {
|
|
1086
|
+
const parsed = Number.parseFloat(value);
|
|
1087
|
+
if (Number.isFinite(parsed)) return round1(parsed);
|
|
1088
|
+
}
|
|
1089
|
+
if (typeof value === "number" && Number.isFinite(value)) return pxToPercent(value, totalPx);
|
|
1090
|
+
return pxToPercent(echartsPx, totalPx);
|
|
1091
|
+
}
|
|
1092
|
+
function clamp(value, min, max) {
|
|
1093
|
+
return Math.min(max, Math.max(min, value));
|
|
1094
|
+
}
|
|
1095
|
+
function percentString(value) {
|
|
1096
|
+
return `${clamp(round1(value), 0, 100)}%`;
|
|
1097
|
+
}
|
|
1098
|
+
function firstSeries(option) {
|
|
1099
|
+
const series = Array.isArray(option.series) ? option.series : [];
|
|
1100
|
+
const first = series[0];
|
|
1101
|
+
return first && typeof first === "object" ? first : {};
|
|
1102
|
+
}
|
|
1103
|
+
function readFunnelPadding(option, widthMm, heightMm) {
|
|
1104
|
+
const source = option && typeof option === "object" ? option : {};
|
|
1105
|
+
const series = firstSeries(source);
|
|
1106
|
+
const widthPx = mmToChartPx(widthMm);
|
|
1107
|
+
const heightPx = mmToChartPx(heightMm);
|
|
1108
|
+
return {
|
|
1109
|
+
top: readInsetPercent(series.top, heightPx, ECHARTS_FUNNEL_PADDING_PX.top),
|
|
1110
|
+
right: readInsetPercent(series.right, widthPx, ECHARTS_FUNNEL_PADDING_PX.right),
|
|
1111
|
+
bottom: readInsetPercent(series.bottom, heightPx, ECHARTS_FUNNEL_PADDING_PX.bottom),
|
|
1112
|
+
left: readInsetPercent(series.left, widthPx, ECHARTS_FUNNEL_PADDING_PX.left)
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
function writeFunnelPadding(option, padding) {
|
|
1116
|
+
const next = cloneChartOption(option);
|
|
1117
|
+
const series = Array.isArray(next.series) ? next.series : [];
|
|
1118
|
+
if (series.length === 0) series.push({ type: "funnel", data: ["$data"] });
|
|
1119
|
+
const first = series[0];
|
|
1120
|
+
first.top = percentString(padding.top);
|
|
1121
|
+
first.right = percentString(padding.right);
|
|
1122
|
+
first.bottom = percentString(padding.bottom);
|
|
1123
|
+
first.left = percentString(padding.left);
|
|
1124
|
+
next.series = series;
|
|
1125
|
+
return next;
|
|
1126
|
+
}
|
|
1127
|
+
function readRadarRadius(option, widthMm, heightMm) {
|
|
1128
|
+
const source = option && typeof option === "object" ? option : {};
|
|
1129
|
+
const raw = asObject(source.radar).radius;
|
|
1130
|
+
const value = Array.isArray(raw) ? raw[raw.length - 1] : raw;
|
|
1131
|
+
const widthPx = mmToChartPx(widthMm);
|
|
1132
|
+
const heightPx = mmToChartPx(heightMm);
|
|
1133
|
+
const viewSize = Math.min(widthPx, heightPx) / 2;
|
|
1134
|
+
if (typeof value === "string" && value.trim().endsWith("%")) {
|
|
1135
|
+
const parsed = Number.parseFloat(value);
|
|
1136
|
+
if (Number.isFinite(parsed)) return round1(parsed);
|
|
1137
|
+
}
|
|
1138
|
+
if (typeof value === "number" && Number.isFinite(value)) return pxToPercent(value, viewSize);
|
|
1139
|
+
return ECHARTS_RADAR_RADIUS_DEFAULT;
|
|
1140
|
+
}
|
|
1141
|
+
function writeRadarRadius(option, percent) {
|
|
1142
|
+
const next = cloneChartOption(option);
|
|
1143
|
+
next.radar = { ...asObject(next.radar), radius: percentString(clamp(percent, 20, 100)) };
|
|
1144
|
+
return next;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// src/label.ts
|
|
1148
|
+
var LABEL_PRESETS = [
|
|
1149
|
+
{ key: "value", label: "\u6570\u503C", labelKey: "echarts.label.formatter.value", formatter: "{c}" },
|
|
1150
|
+
{ key: "name-value", label: "\u540D\u79F0: \u6570\u503C", labelKey: "echarts.label.formatter.nameValue", formatter: "{b}: {c}" },
|
|
1151
|
+
{ key: "name", label: "\u540D\u79F0", labelKey: "echarts.label.formatter.name", formatter: "{b}" },
|
|
1152
|
+
{ key: "percent", label: "\u767E\u5206\u6BD4", labelKey: "echarts.label.formatter.percent", formatter: "{d}%" }
|
|
1153
|
+
];
|
|
1154
|
+
var LABEL_POSITIONS = {
|
|
1155
|
+
bar: [
|
|
1156
|
+
{ value: "top", label: "\u9876\u90E8", labelKey: "echarts.label.position.bar.top" },
|
|
1157
|
+
{ value: "inside", label: "\u5185\u90E8", labelKey: "echarts.label.position.bar.inside" },
|
|
1158
|
+
{ value: "insideTop", label: "\u5185\u90E8\u9876\u7AEF", labelKey: "echarts.label.position.bar.insideTop" },
|
|
1159
|
+
{ value: "bottom", label: "\u5E95\u90E8", labelKey: "echarts.label.position.bar.bottom" },
|
|
1160
|
+
{ value: "insideBottom", label: "\u5185\u90E8\u5E95\u7AEF", labelKey: "echarts.label.position.bar.insideBottom" },
|
|
1161
|
+
{ value: "right", label: "\u53F3\u4FA7", labelKey: "echarts.label.position.bar.right" },
|
|
1162
|
+
{ value: "left", label: "\u5DE6\u4FA7", labelKey: "echarts.label.position.bar.left" },
|
|
1163
|
+
{ value: "middle", label: "\u5C45\u4E2D", labelKey: "echarts.label.position.bar.middle" }
|
|
1164
|
+
],
|
|
1165
|
+
line: [
|
|
1166
|
+
{ value: "top", label: "\u9876\u90E8", labelKey: "echarts.label.position.line.top" },
|
|
1167
|
+
{ value: "bottom", label: "\u5E95\u90E8", labelKey: "echarts.label.position.line.bottom" },
|
|
1168
|
+
{ value: "inside", label: "\u5185\u90E8", labelKey: "echarts.label.position.line.inside" },
|
|
1169
|
+
{ value: "left", label: "\u5DE6\u4FA7", labelKey: "echarts.label.position.line.left" },
|
|
1170
|
+
{ value: "right", label: "\u53F3\u4FA7", labelKey: "echarts.label.position.line.right" }
|
|
1171
|
+
],
|
|
1172
|
+
pie: [
|
|
1173
|
+
{ value: "outside", label: "\u5916\u4FA7", labelKey: "echarts.label.position.pie.outside" },
|
|
1174
|
+
{ value: "inside", label: "\u5185\u90E8", labelKey: "echarts.label.position.pie.inside" },
|
|
1175
|
+
{ value: "center", label: "\u4E2D\u5FC3", labelKey: "echarts.label.position.pie.center" }
|
|
1176
|
+
],
|
|
1177
|
+
scatter: [
|
|
1178
|
+
{ value: "top", label: "\u9876\u90E8", labelKey: "echarts.label.position.scatter.top" },
|
|
1179
|
+
{ value: "bottom", label: "\u5E95\u90E8", labelKey: "echarts.label.position.scatter.bottom" },
|
|
1180
|
+
{ value: "left", label: "\u5DE6\u4FA7", labelKey: "echarts.label.position.scatter.left" },
|
|
1181
|
+
{ value: "right", label: "\u53F3\u4FA7", labelKey: "echarts.label.position.scatter.right" },
|
|
1182
|
+
{ value: "inside", label: "\u5185\u90E8", labelKey: "echarts.label.position.scatter.inside" }
|
|
1183
|
+
],
|
|
1184
|
+
radar: [
|
|
1185
|
+
{ value: "top", label: "\u9876\u90E8", labelKey: "echarts.label.position.radar.top" },
|
|
1186
|
+
{ value: "bottom", label: "\u5E95\u90E8", labelKey: "echarts.label.position.radar.bottom" },
|
|
1187
|
+
{ value: "left", label: "\u5DE6\u4FA7", labelKey: "echarts.label.position.radar.left" },
|
|
1188
|
+
{ value: "right", label: "\u53F3\u4FA7", labelKey: "echarts.label.position.radar.right" },
|
|
1189
|
+
{ value: "inside", label: "\u5185\u90E8", labelKey: "echarts.label.position.radar.inside" }
|
|
1190
|
+
],
|
|
1191
|
+
funnel: [
|
|
1192
|
+
{ value: "outer", label: "\u5916\u4FA7", labelKey: "echarts.label.position.funnel.outer" },
|
|
1193
|
+
{ value: "inner", label: "\u5185\u90E8", labelKey: "echarts.label.position.funnel.inner" },
|
|
1194
|
+
{ value: "left", label: "\u5DE6\u4FA7", labelKey: "echarts.label.position.funnel.left" },
|
|
1195
|
+
{ value: "right", label: "\u53F3\u4FA7", labelKey: "echarts.label.position.funnel.right" },
|
|
1196
|
+
{ value: "top", label: "\u9876\u90E8", labelKey: "echarts.label.position.funnel.top" },
|
|
1197
|
+
{ value: "bottom", label: "\u5E95\u90E8", labelKey: "echarts.label.position.funnel.bottom" }
|
|
1198
|
+
],
|
|
1199
|
+
gauge: []
|
|
1200
|
+
};
|
|
1201
|
+
var NATIVE_SHOW = {
|
|
1202
|
+
bar: false,
|
|
1203
|
+
line: false,
|
|
1204
|
+
pie: true,
|
|
1205
|
+
scatter: false,
|
|
1206
|
+
radar: false,
|
|
1207
|
+
funnel: true,
|
|
1208
|
+
gauge: true
|
|
1209
|
+
};
|
|
1210
|
+
var ENABLE_DEFAULTS = {
|
|
1211
|
+
bar: { position: "top", fontSize: 12 },
|
|
1212
|
+
line: { position: "top", fontSize: 12 },
|
|
1213
|
+
pie: { position: "outside", overflow: "none", fontSize: 11 },
|
|
1214
|
+
scatter: { position: "top", fontSize: 11 },
|
|
1215
|
+
radar: { position: "top", fontSize: 10 },
|
|
1216
|
+
funnel: { position: "outer", fontSize: 11 },
|
|
1217
|
+
gauge: { fontSize: 14 }
|
|
1218
|
+
};
|
|
1219
|
+
var TYPE_DEFAULTS = {
|
|
1220
|
+
barHChart: { position: "right", fontSize: 12 }
|
|
1221
|
+
};
|
|
1222
|
+
var FIELDS_BY_SERIES = {
|
|
1223
|
+
bar: [
|
|
1224
|
+
"formatter",
|
|
1225
|
+
"overflow",
|
|
1226
|
+
"position",
|
|
1227
|
+
"rotate",
|
|
1228
|
+
"offset",
|
|
1229
|
+
"fontSize",
|
|
1230
|
+
"fontWeight",
|
|
1231
|
+
"color",
|
|
1232
|
+
"backgroundColor",
|
|
1233
|
+
"borderColor",
|
|
1234
|
+
"borderWidth",
|
|
1235
|
+
"borderRadius",
|
|
1236
|
+
"padding"
|
|
1237
|
+
],
|
|
1238
|
+
line: [
|
|
1239
|
+
"formatter",
|
|
1240
|
+
"overflow",
|
|
1241
|
+
"position",
|
|
1242
|
+
"rotate",
|
|
1243
|
+
"offset",
|
|
1244
|
+
"fontSize",
|
|
1245
|
+
"fontWeight",
|
|
1246
|
+
"color",
|
|
1247
|
+
"backgroundColor",
|
|
1248
|
+
"borderColor",
|
|
1249
|
+
"borderWidth",
|
|
1250
|
+
"borderRadius",
|
|
1251
|
+
"padding"
|
|
1252
|
+
],
|
|
1253
|
+
pie: [
|
|
1254
|
+
"formatter",
|
|
1255
|
+
"overflow",
|
|
1256
|
+
"position",
|
|
1257
|
+
"distance",
|
|
1258
|
+
"offset",
|
|
1259
|
+
"fontSize",
|
|
1260
|
+
"fontWeight",
|
|
1261
|
+
"color",
|
|
1262
|
+
"backgroundColor",
|
|
1263
|
+
"borderColor",
|
|
1264
|
+
"borderWidth",
|
|
1265
|
+
"borderRadius",
|
|
1266
|
+
"padding",
|
|
1267
|
+
"labelLine.show",
|
|
1268
|
+
"labelLine.length",
|
|
1269
|
+
"labelLine.length2",
|
|
1270
|
+
"labelLine.smooth"
|
|
1271
|
+
],
|
|
1272
|
+
scatter: [
|
|
1273
|
+
"formatter",
|
|
1274
|
+
"overflow",
|
|
1275
|
+
"position",
|
|
1276
|
+
"distance",
|
|
1277
|
+
"rotate",
|
|
1278
|
+
"offset",
|
|
1279
|
+
"fontSize",
|
|
1280
|
+
"fontWeight",
|
|
1281
|
+
"color",
|
|
1282
|
+
"backgroundColor",
|
|
1283
|
+
"borderColor",
|
|
1284
|
+
"borderWidth",
|
|
1285
|
+
"borderRadius",
|
|
1286
|
+
"padding"
|
|
1287
|
+
],
|
|
1288
|
+
radar: ["formatter", "fontSize", "fontWeight", "color"],
|
|
1289
|
+
funnel: [
|
|
1290
|
+
"formatter",
|
|
1291
|
+
"overflow",
|
|
1292
|
+
"position",
|
|
1293
|
+
"distance",
|
|
1294
|
+
"fontSize",
|
|
1295
|
+
"fontWeight",
|
|
1296
|
+
"color",
|
|
1297
|
+
"labelLine.show",
|
|
1298
|
+
"labelLine.length",
|
|
1299
|
+
"labelLine.smooth"
|
|
1300
|
+
],
|
|
1301
|
+
gauge: ["formatter", "fontSize", "fontWeight", "color", "offset"]
|
|
1302
|
+
};
|
|
1303
|
+
var VALUE_KEYS = [
|
|
1304
|
+
"formatter",
|
|
1305
|
+
"overflow",
|
|
1306
|
+
"position",
|
|
1307
|
+
"distance",
|
|
1308
|
+
"rotate",
|
|
1309
|
+
"offset",
|
|
1310
|
+
"fontSize",
|
|
1311
|
+
"fontWeight",
|
|
1312
|
+
"color",
|
|
1313
|
+
"backgroundColor",
|
|
1314
|
+
"borderColor",
|
|
1315
|
+
"borderWidth",
|
|
1316
|
+
"borderRadius",
|
|
1317
|
+
"padding"
|
|
1318
|
+
];
|
|
1319
|
+
function seriesOf2(option) {
|
|
1320
|
+
const series = option?.series;
|
|
1321
|
+
return Array.isArray(series) ? series : [];
|
|
1322
|
+
}
|
|
1323
|
+
function asRecord(node) {
|
|
1324
|
+
return node && typeof node === "object" && !Array.isArray(node) ? { ...node } : {};
|
|
1325
|
+
}
|
|
1326
|
+
function normalizeLabelOffsetInPlace(target) {
|
|
1327
|
+
if (typeof target.offsetX !== "number" && typeof target.offsetY !== "number") return;
|
|
1328
|
+
if (!Array.isArray(target.offset)) {
|
|
1329
|
+
target.offset = [
|
|
1330
|
+
typeof target.offsetX === "number" ? target.offsetX : 0,
|
|
1331
|
+
typeof target.offsetY === "number" ? target.offsetY : 0
|
|
1332
|
+
];
|
|
1333
|
+
}
|
|
1334
|
+
delete target.offsetX;
|
|
1335
|
+
delete target.offsetY;
|
|
1336
|
+
}
|
|
1337
|
+
function labelTargetOf(type) {
|
|
1338
|
+
return getChartKindDefinition(type)?.seriesType === "gauge" ? "detail" : "label";
|
|
1339
|
+
}
|
|
1340
|
+
function labelFieldsOf(type) {
|
|
1341
|
+
const def = getChartKindDefinition(type);
|
|
1342
|
+
return def ? FIELDS_BY_SERIES[def.seriesType] : [];
|
|
1343
|
+
}
|
|
1344
|
+
function readChartLabel(option, type) {
|
|
1345
|
+
const def = getChartKindDefinition(type);
|
|
1346
|
+
const series = seriesOf2(option);
|
|
1347
|
+
const target = asRecord(series[0]?.[labelTargetOf(type)]);
|
|
1348
|
+
normalizeLabelOffsetInPlace(target);
|
|
1349
|
+
const state = {
|
|
1350
|
+
show: typeof target.show === "boolean" ? target.show : def ? NATIVE_SHOW[def.seriesType] : false,
|
|
1351
|
+
// labelLine 在 ECharts 里是 series 顶层键(与 label 平级),不是 label 的子键
|
|
1352
|
+
labelLine: asRecord(series[0]?.labelLine)
|
|
1353
|
+
};
|
|
1354
|
+
for (const key of VALUE_KEYS) {
|
|
1355
|
+
const value = target[key];
|
|
1356
|
+
if (key === "offset") continue;
|
|
1357
|
+
if (typeof value === "string" || typeof value === "number") state[key] = value;
|
|
1358
|
+
}
|
|
1359
|
+
const offset = target.offset;
|
|
1360
|
+
if (Array.isArray(offset) && typeof offset[0] === "number" && typeof offset[1] === "number") {
|
|
1361
|
+
state.offset = [offset[0], offset[1]];
|
|
1362
|
+
}
|
|
1363
|
+
return state;
|
|
1364
|
+
}
|
|
1365
|
+
function defaultSetOf(type) {
|
|
1366
|
+
const def = getChartKindDefinition(type);
|
|
1367
|
+
if (!def) return {};
|
|
1368
|
+
return { ...ENABLE_DEFAULTS[def.seriesType], ...TYPE_DEFAULTS[type] };
|
|
1369
|
+
}
|
|
1370
|
+
function isEmpty(value) {
|
|
1371
|
+
return value === null || value === void 0 || value === "";
|
|
1372
|
+
}
|
|
1373
|
+
function updateChartLabel(option, type, patch) {
|
|
1374
|
+
const next = cloneChartOption(option ?? {});
|
|
1375
|
+
const series = Array.isArray(next.series) ? next.series : [];
|
|
1376
|
+
const def = getChartKindDefinition(type);
|
|
1377
|
+
if (!def || series.length === 0) return next;
|
|
1378
|
+
const targetKey = labelTargetOf(type);
|
|
1379
|
+
const { enabled, labelLine, ...values } = patch;
|
|
1380
|
+
for (const item of series) {
|
|
1381
|
+
if (!item || typeof item !== "object") continue;
|
|
1382
|
+
const current = asRecord(item[targetKey]);
|
|
1383
|
+
normalizeLabelOffsetInPlace(current);
|
|
1384
|
+
if (enabled === true) {
|
|
1385
|
+
Object.assign(current, { ...defaultSetOf(type), ...current, show: true });
|
|
1386
|
+
} else if (enabled === false) {
|
|
1387
|
+
current.show = false;
|
|
1388
|
+
}
|
|
1389
|
+
for (const [key, value] of Object.entries(values)) {
|
|
1390
|
+
if (isEmpty(value)) delete current[key];
|
|
1391
|
+
else current[key] = value;
|
|
1392
|
+
}
|
|
1393
|
+
if (labelLine) {
|
|
1394
|
+
const line = asRecord(item.labelLine);
|
|
1395
|
+
for (const [key, value] of Object.entries(labelLine)) {
|
|
1396
|
+
if (isEmpty(value)) delete line[key];
|
|
1397
|
+
else line[key] = value;
|
|
1398
|
+
}
|
|
1399
|
+
item.labelLine = line;
|
|
1400
|
+
}
|
|
1401
|
+
item[targetKey] = current;
|
|
1402
|
+
}
|
|
1403
|
+
return next;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
// src/normalize.ts
|
|
1407
|
+
function asArray(value) {
|
|
1408
|
+
if (Array.isArray(value)) return value.map((item) => ({ ...item }));
|
|
1409
|
+
return [];
|
|
1410
|
+
}
|
|
1411
|
+
function normalizeCategoryAxis(axis, horizontal) {
|
|
1412
|
+
const next = { ...axis, type: horizontal ? "value" : "category" };
|
|
1413
|
+
if (horizontal) delete next.data;
|
|
1414
|
+
else if (!Array.isArray(next.data)) next.data = ["$data"];
|
|
1415
|
+
return next;
|
|
1416
|
+
}
|
|
1417
|
+
function normalizeValueAxis(axis, horizontal) {
|
|
1418
|
+
const next = { ...axis, type: horizontal ? "category" : "value" };
|
|
1419
|
+
if (horizontal && !Array.isArray(next.data)) next.data = ["$data"];
|
|
1420
|
+
if (!horizontal) delete next.data;
|
|
1421
|
+
return next;
|
|
1422
|
+
}
|
|
1423
|
+
function mapAxes(value, fn) {
|
|
1424
|
+
if (Array.isArray(value)) return value.map((item) => fn({ ...item }));
|
|
1425
|
+
if (value && typeof value === "object") return fn({ ...value });
|
|
1426
|
+
return fn({});
|
|
1427
|
+
}
|
|
1428
|
+
function normalizeChartOption(type, option) {
|
|
1429
|
+
const def = getChartKindDefinition(type);
|
|
1430
|
+
if (!def) return option;
|
|
1431
|
+
const next = structuredClone(option);
|
|
1432
|
+
const series = asArray(next.series);
|
|
1433
|
+
if (series.length === 0) return next;
|
|
1434
|
+
const labelKey = labelTargetOf(type);
|
|
1435
|
+
for (const item of series) {
|
|
1436
|
+
const label = item[labelKey];
|
|
1437
|
+
if (label && typeof label === "object" && !Array.isArray(label)) {
|
|
1438
|
+
const nextLabel = { ...label };
|
|
1439
|
+
normalizeLabelOffsetInPlace(nextLabel);
|
|
1440
|
+
item[labelKey] = nextLabel;
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
if (def.seriesType === "pie") {
|
|
1444
|
+
next.series = series.map((item) => ({
|
|
1445
|
+
...item,
|
|
1446
|
+
type: "pie",
|
|
1447
|
+
...type === "doughnutChart" ? { radius: item.radius ?? ["40%", "70%"] } : {}
|
|
1448
|
+
}));
|
|
1449
|
+
delete next.xAxis;
|
|
1450
|
+
delete next.yAxis;
|
|
1451
|
+
return next;
|
|
1452
|
+
}
|
|
1453
|
+
if (def.seriesType === "scatter") {
|
|
1454
|
+
next.series = series.map((item) => ({ ...item, type: "scatter" }));
|
|
1455
|
+
next.xAxis = mapAxes(next.xAxis, (axis) => ({ ...axis, type: "value", data: void 0 }));
|
|
1456
|
+
next.yAxis = mapAxes(next.yAxis, (axis) => ({ ...axis, type: "value", data: void 0 }));
|
|
1457
|
+
return next;
|
|
1458
|
+
}
|
|
1459
|
+
if (def.seriesType === "radar") {
|
|
1460
|
+
next.series = series.map((item) => ({ ...item, type: "radar" }));
|
|
1461
|
+
return next;
|
|
1462
|
+
}
|
|
1463
|
+
if (def.seriesType === "funnel") {
|
|
1464
|
+
next.series = series.map((item) => ({ ...item, type: "funnel", sort: "descending" }));
|
|
1465
|
+
return next;
|
|
1466
|
+
}
|
|
1467
|
+
if (def.seriesType === "gauge") {
|
|
1468
|
+
next.series = series.map((item) => ({ ...item, type: "gauge" }));
|
|
1469
|
+
return next;
|
|
1470
|
+
}
|
|
1471
|
+
const horizontal = def.orientation === "horizontal";
|
|
1472
|
+
const seriesType = def.seriesType === "line" ? "line" : "bar";
|
|
1473
|
+
next.xAxis = mapAxes(next.xAxis, (axis) => normalizeCategoryAxis(axis, horizontal));
|
|
1474
|
+
next.yAxis = mapAxes(next.yAxis, (axis) => normalizeValueAxis(axis, horizontal));
|
|
1475
|
+
next.series = series.map((item) => {
|
|
1476
|
+
const shape = { ...item, type: seriesType };
|
|
1477
|
+
if (type === "areaChart") shape.areaStyle = item.areaStyle ?? {};
|
|
1478
|
+
else delete shape.areaStyle;
|
|
1479
|
+
return shape;
|
|
1480
|
+
});
|
|
1481
|
+
return next;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
// src/renderer.ts
|
|
1485
|
+
function fitSvgRoot(svg, widthPx, heightPx) {
|
|
1486
|
+
const match = /<svg\b[^>]*>/i.exec(svg);
|
|
1487
|
+
if (!match) return svg;
|
|
1488
|
+
const rootTag = match[0];
|
|
1489
|
+
const rawAttrs = rootTag.slice("<svg".length, -1);
|
|
1490
|
+
const styleMatch = /\sstyle\s*=\s*"([^"]*)"/i.exec(rawAttrs);
|
|
1491
|
+
const keptStyle = (styleMatch?.[1] ?? "").split(";").map((decl) => decl.trim()).filter((decl) => decl && !/^(width|height|display)\s*:/i.test(decl)).join(";");
|
|
1492
|
+
const attrs = rawAttrs.replace(/\s(width|height|style|viewBox)\s*=\s*"[^"]*"/gi, "").trimEnd();
|
|
1493
|
+
const style = ["display:block", "width:100%", "height:100%", keptStyle].filter(Boolean).join(";");
|
|
1494
|
+
const nextTag = `<svg${attrs} width="100%" height="100%" viewBox="0 0 ${widthPx} ${heightPx}" style="${style}">`;
|
|
1495
|
+
return svg.slice(0, match.index) + nextTag + svg.slice(match.index + rootTag.length);
|
|
1496
|
+
}
|
|
1497
|
+
function renderChartToSvg(spec) {
|
|
1498
|
+
applyExtraComponents();
|
|
1499
|
+
const option = normalizeChartOption(spec.type, spec.option);
|
|
1500
|
+
if (!option || typeof option !== "object" || Array.isArray(option)) {
|
|
1501
|
+
throw new Error("\u56FE\u8868 option \u975E\u6CD5\uFF1A\u9700\u8981\u5BF9\u8C61");
|
|
1502
|
+
}
|
|
1503
|
+
const width = mmToChartPx(spec.widthMm);
|
|
1504
|
+
const height = mmToChartPx(spec.heightMm);
|
|
1505
|
+
const chart = echarts.init(null, null, { renderer: "svg", ssr: true, width, height });
|
|
1506
|
+
try {
|
|
1507
|
+
const userTextStyle = option.textStyle && typeof option.textStyle === "object" && !Array.isArray(option.textStyle) ? option.textStyle : void 0;
|
|
1508
|
+
const textStyle = {
|
|
1509
|
+
...spec.fontFamily ? { fontFamily: spec.fontFamily } : {},
|
|
1510
|
+
...userTextStyle ?? {}
|
|
1511
|
+
};
|
|
1512
|
+
chart.setOption({
|
|
1513
|
+
animation: false,
|
|
1514
|
+
...option,
|
|
1515
|
+
...Object.keys(textStyle).length > 0 ? { textStyle } : {}
|
|
1516
|
+
});
|
|
1517
|
+
return fitSvgRoot(chart.renderToSVGString(), width, height);
|
|
1518
|
+
} finally {
|
|
1519
|
+
chart.dispose();
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
function escapeHtml(value) {
|
|
1523
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1524
|
+
}
|
|
1525
|
+
function renderChartElement(spec) {
|
|
1526
|
+
const option = spec._chartOption ?? spec.chartOption;
|
|
1527
|
+
const placeholder = `<span>${escapeHtml(String(spec.title ?? "\u56FE\u8868"))}</span>`;
|
|
1528
|
+
if (!option || typeof option !== "object" || Array.isArray(option)) return placeholder;
|
|
1529
|
+
try {
|
|
1530
|
+
return renderChartToSvg({
|
|
1531
|
+
key: String(spec.key ?? ""),
|
|
1532
|
+
type: String(spec.type ?? ""),
|
|
1533
|
+
option,
|
|
1534
|
+
widthMm: Number(spec.widthMm ?? 0),
|
|
1535
|
+
heightMm: Number(spec.heightMm ?? 0),
|
|
1536
|
+
fontFamily: typeof spec.fontFamily === "string" ? spec.fontFamily : void 0
|
|
1537
|
+
});
|
|
1538
|
+
} catch {
|
|
1539
|
+
return placeholder;
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
// src/version.ts
|
|
1544
|
+
var CHART_EXECUTOR_VERSION = "2";
|
|
1545
|
+
|
|
1546
|
+
// src/plugin.ts
|
|
1547
|
+
var CHART_OPTION_META = {
|
|
1548
|
+
chartOption: { kind: "object", label: (0, import_i18n.t)("echarts.meta.chartOption") },
|
|
1549
|
+
chartDataSource: { kind: "text", label: (0, import_i18n.t)("echarts.meta.dataSource") },
|
|
1550
|
+
chartCategoryField: { kind: "text", label: (0, import_i18n.t)("echarts.meta.categoryField") },
|
|
1551
|
+
chartValueFields: { kind: "object", label: (0, import_i18n.t)("echarts.meta.valueFields") },
|
|
1552
|
+
chartSeriesField: { kind: "text", label: (0, import_i18n.t)("echarts.meta.seriesField") }
|
|
1553
|
+
};
|
|
1554
|
+
var SCATTER_OPTION_META = {
|
|
1555
|
+
...CHART_OPTION_META,
|
|
1556
|
+
chartBubble: { kind: "bool", label: (0, import_i18n.t)("echarts.meta.bubbleSize") }
|
|
1557
|
+
};
|
|
1558
|
+
var CHART_PLUGIN = (0, import_designer2.defineElementPlugin)({
|
|
1559
|
+
id: CHART_PLUGIN_ID,
|
|
1560
|
+
version: CHART_EXECUTOR_VERSION,
|
|
1561
|
+
kinds: CHART_KIND_DEFINITIONS.map((def) => ({
|
|
1562
|
+
type: def.type,
|
|
1563
|
+
// getter:每次读取按当前实例语言取词,避免模块加载期冻结为单一语言
|
|
1564
|
+
get label() {
|
|
1565
|
+
return (0, import_i18n.t)(def.labelKey);
|
|
1566
|
+
},
|
|
1567
|
+
icon: def.icon,
|
|
1568
|
+
fixedHeight: true,
|
|
1569
|
+
requiredOptionKeys: def.requiredOptionKeys,
|
|
1570
|
+
// getter:每次读取按当前实例语言取词,避免模块加载期冻结为单一语言
|
|
1571
|
+
get notes() {
|
|
1572
|
+
return (0, import_i18n.t)(def.notesKey);
|
|
1573
|
+
},
|
|
1574
|
+
optionMeta: def.type === "scatterChart" ? SCATTER_OPTION_META : CHART_OPTION_META,
|
|
1575
|
+
defaultOptions: (partial) => chartFactoryDefaults(def.type, partial),
|
|
1576
|
+
binding: { bind: (options, data) => bindChartData(def.type, options, data) }
|
|
1577
|
+
})),
|
|
1578
|
+
render: {
|
|
1579
|
+
html: renderChartElement,
|
|
1580
|
+
createRenderer: () => ({ render: renderChartElement })
|
|
1581
|
+
}
|
|
1582
|
+
});
|
|
1583
|
+
var disposeHandle;
|
|
1584
|
+
function registerChartPlugin(designer, extraRender) {
|
|
1585
|
+
const current = (0, import_designer2.getElementPluginById)(CHART_PLUGIN_ID);
|
|
1586
|
+
if (!designer && !extraRender) {
|
|
1587
|
+
const dispose2 = (0, import_designer2.registerElementPlugin)(CHART_PLUGIN);
|
|
1588
|
+
disposeHandle = dispose2;
|
|
1589
|
+
return dispose2;
|
|
1590
|
+
}
|
|
1591
|
+
const merged = {
|
|
1592
|
+
...CHART_PLUGIN,
|
|
1593
|
+
designer: designer ?? current?.designer ?? CHART_PLUGIN.designer,
|
|
1594
|
+
render: { ...CHART_PLUGIN.render, ...current?.render, ...extraRender }
|
|
1595
|
+
};
|
|
1596
|
+
const dispose = (0, import_designer2.registerElementPlugin)(merged);
|
|
1597
|
+
disposeHandle = dispose;
|
|
1598
|
+
return dispose;
|
|
1599
|
+
}
|
|
1600
|
+
registerChartPlugin();
|
|
1601
|
+
|
|
1602
|
+
// src/ui.ts
|
|
1603
|
+
var activeT = import_i18n2.t;
|
|
1604
|
+
var t2 = (key, params) => activeT(key, params);
|
|
1605
|
+
function withTranslator(translator, render2) {
|
|
1606
|
+
const prev = activeT;
|
|
1607
|
+
activeT = translator ?? import_i18n2.t;
|
|
1608
|
+
try {
|
|
1609
|
+
return render2();
|
|
1610
|
+
} finally {
|
|
1611
|
+
activeT = prev;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
36
1614
|
var CANVAS_STYLE = "width:100%;height:100%;min-width:0;min-height:0;pointer-events:none";
|
|
37
1615
|
var STYLES = [
|
|
38
1616
|
".echarts-canvas-element{overflow:hidden}",
|
|
39
1617
|
".echarts-field-row{display:flex;gap:6px;align-items:center}",
|
|
40
1618
|
".echarts-field-row>.pd-input{flex:1;min-width:0}",
|
|
41
|
-
".echarts-field-row>.pd-button{flex:none}"
|
|
1619
|
+
".echarts-field-row>.pd-button{flex:none}",
|
|
1620
|
+
".echarts-dropdown-trigger{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%;height:26px;min-height:26px;padding:3px 6px;border:1px solid var(--pd-border,#d9dde6);border-radius:6px;background:var(--pd-input-bg,#fff);color:inherit;font:inherit;box-sizing:border-box;cursor:pointer;text-align:left}",
|
|
1621
|
+
".echarts-dropdown-trigger:hover{border-color:var(--pd-text-faint,#b4b9c4)}",
|
|
1622
|
+
'.echarts-dropdown-trigger[aria-expanded="true"]{border-color:var(--pd-accent,#165dff);box-shadow:0 0 0 2px rgb(22 93 255 / 12%)}',
|
|
1623
|
+
".echarts-dropdown-value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
1624
|
+
".echarts-dropdown-arrow{flex:none;color:var(--pd-text-muted,#909399);font-size:10px;transition:transform .14s}",
|
|
1625
|
+
'.echarts-dropdown-trigger[aria-expanded="true"] .echarts-dropdown-arrow{transform:rotate(180deg)}',
|
|
1626
|
+
".echarts-dropdown-panel{position:fixed;z-index:1200;max-height:240px;overflow:auto;padding:3px;border:1px solid var(--pd-border,#d9dde6);border-radius:6px;background:var(--pd-input-bg,#fff);box-shadow:0 6px 18px rgb(0 0 0 / 14%);box-sizing:border-box}",
|
|
1627
|
+
".echarts-dropdown-option{padding:5px 8px;border-radius:4px;cursor:pointer;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",
|
|
1628
|
+
".echarts-dropdown-option:hover{background:var(--pd-accent-soft,rgb(22 93 255 / 9%))}",
|
|
1629
|
+
".echarts-dropdown-option.is-active{background:var(--pd-accent-soft,rgb(22 93 255 / 9%));color:var(--pd-accent,#165dff)}",
|
|
1630
|
+
".echarts-label-group{margin-top:8px;border-top:1px solid var(--pd-border,#e5e7eb);padding-top:8px}",
|
|
1631
|
+
".echarts-label-group>summary{display:flex;align-items:center;cursor:pointer;list-style:none;font-size:12px;font-weight:600}",
|
|
1632
|
+
".echarts-label-summary>.pd-field{flex:1;margin:0;font-weight:400}",
|
|
1633
|
+
".echarts-label-sub{font-size:11px;color:var(--pd-text-secondary,#6b7280);margin:8px 0 4px}"
|
|
42
1634
|
].join("");
|
|
43
1635
|
var CHART_OPTION_KEYS = [
|
|
44
1636
|
"chartOption",
|
|
@@ -66,11 +1658,13 @@ var SEARCH_KEYWORDS = [
|
|
|
66
1658
|
"\u6563\u70B9",
|
|
67
1659
|
"\u96F7\u8FBE",
|
|
68
1660
|
"\u6F0F\u6597",
|
|
69
|
-
"\u4EEA\u8868"
|
|
1661
|
+
"\u4EEA\u8868",
|
|
1662
|
+
"\u6570\u636E\u6807\u7B7E",
|
|
1663
|
+
"\u6570\u503C\u6807\u7B7E",
|
|
1664
|
+
"label"
|
|
70
1665
|
];
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
function escapeHtml(value) {
|
|
1666
|
+
var panelHint = () => t2("echarts.panel.hint.dataBinding");
|
|
1667
|
+
function escapeHtml2(value) {
|
|
74
1668
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
75
1669
|
}
|
|
76
1670
|
function elementType(element) {
|
|
@@ -82,7 +1676,7 @@ function rawChartOption(element) {
|
|
|
82
1676
|
}
|
|
83
1677
|
function panelOption(element) {
|
|
84
1678
|
const raw = rawChartOption(element);
|
|
85
|
-
return
|
|
1679
|
+
return cloneChartOption(raw ?? createDefaultChartOption(elementType(element)));
|
|
86
1680
|
}
|
|
87
1681
|
function chartHasProperties(element) {
|
|
88
1682
|
const options = element?.options;
|
|
@@ -91,7 +1685,7 @@ function chartHasProperties(element) {
|
|
|
91
1685
|
return CHART_OPTION_KEYS.some((key) => record[key] !== void 0);
|
|
92
1686
|
}
|
|
93
1687
|
function commitOption(ctx, type, next, patch = {}) {
|
|
94
|
-
ctx.update({ chartOption:
|
|
1688
|
+
ctx.update({ chartOption: normalizeChartOption(type, next), ...patch });
|
|
95
1689
|
}
|
|
96
1690
|
function readValueFields(element) {
|
|
97
1691
|
const raw = element.options.chartValueFields;
|
|
@@ -110,22 +1704,49 @@ function maxValueFields(def) {
|
|
|
110
1704
|
}
|
|
111
1705
|
}
|
|
112
1706
|
function valueFieldsLabel(def, limit) {
|
|
113
|
-
if (def?.seriesType === "radar") return "
|
|
114
|
-
return limit === 1 ? "
|
|
1707
|
+
if (def?.seriesType === "radar") return t2("echarts.panel.field.dimension");
|
|
1708
|
+
return limit === 1 ? t2("echarts.panel.field.value") : t2("echarts.panel.field.valueMulti");
|
|
115
1709
|
}
|
|
116
1710
|
function dataSourceCandidates(data) {
|
|
117
1711
|
const first = data?.[0];
|
|
118
1712
|
if (!first) return [];
|
|
119
1713
|
return Object.keys(first).filter((key) => Array.isArray(first[key]));
|
|
120
1714
|
}
|
|
1715
|
+
function dataRowFields(data, dataSource) {
|
|
1716
|
+
const first = data?.[0];
|
|
1717
|
+
if (!first) return [];
|
|
1718
|
+
const key = dataSource && Array.isArray(first[dataSource]) ? dataSource : Object.keys(first).find((k) => Array.isArray(first[k]));
|
|
1719
|
+
if (!key) return [];
|
|
1720
|
+
const rows = first[key];
|
|
1721
|
+
return rows.length > 0 && typeof rows[0] === "object" && rows[0] !== null ? Object.keys(rows[0]) : [];
|
|
1722
|
+
}
|
|
1723
|
+
function fieldLabelMap(fields) {
|
|
1724
|
+
const map = /* @__PURE__ */ new Map();
|
|
1725
|
+
for (const field2 of fields ?? []) {
|
|
1726
|
+
if (field2.fieldKey && field2.fieldLabel) map.set(field2.fieldKey, field2.fieldLabel);
|
|
1727
|
+
}
|
|
1728
|
+
return map;
|
|
1729
|
+
}
|
|
1730
|
+
function optionLabel(value, labels, fallbackSuffix) {
|
|
1731
|
+
if (!value) return fallbackSuffix ?? t2("echarts.panel.default");
|
|
1732
|
+
const name = labels.get(value);
|
|
1733
|
+
const base = name ? `${name}\uFF08${value}\uFF09` : value;
|
|
1734
|
+
return fallbackSuffix ? `${base}${fallbackSuffix}` : base;
|
|
1735
|
+
}
|
|
1736
|
+
function dropdownOptions(candidates, current, labels = /* @__PURE__ */ new Map()) {
|
|
1737
|
+
const opts = candidates.map((value) => ({ value, label: optionLabel(value, labels) }));
|
|
1738
|
+
if (current && !candidates.includes(current)) opts.unshift({ value: current, label: optionLabel(current, labels, t2("echarts.panel.current")) });
|
|
1739
|
+
if (!current) opts.unshift({ value: "", label: t2("echarts.panel.defaultFirstArray") });
|
|
1740
|
+
return opts;
|
|
1741
|
+
}
|
|
121
1742
|
function seriesList(option) {
|
|
122
1743
|
return Array.isArray(option.series) ? option.series : [];
|
|
123
1744
|
}
|
|
124
|
-
function
|
|
1745
|
+
function clamp2(value, min, max) {
|
|
125
1746
|
return Math.min(max, Math.max(min, value));
|
|
126
1747
|
}
|
|
127
1748
|
function syncValueFields(ctx, type, nextFields) {
|
|
128
|
-
const next =
|
|
1749
|
+
const next = syncSeriesCount(panelOption(ctx.element), nextFields.length, type);
|
|
129
1750
|
const series = Array.isArray(next.series) ? next.series : [];
|
|
130
1751
|
series.forEach((item, index) => {
|
|
131
1752
|
const name = nextFields[index]?.trim();
|
|
@@ -140,15 +1761,15 @@ function renderCanvas(ctx) {
|
|
|
140
1761
|
const widthMm = Number(options.width) || 0;
|
|
141
1762
|
const heightMm = Number(options.height) || 0;
|
|
142
1763
|
try {
|
|
143
|
-
const preview =
|
|
144
|
-
const option =
|
|
145
|
-
if (!option || typeof option !== "object" || Array.isArray(option)) throw new Error("
|
|
1764
|
+
const preview = previewChartOption(type, rawChartOption(element) ?? createDefaultChartOption(type));
|
|
1765
|
+
const option = normalizeChartOption(type, preview);
|
|
1766
|
+
if (!option || typeof option !== "object" || Array.isArray(option)) throw new Error(t2("echarts.panel.error.invalidOption"));
|
|
146
1767
|
const fontFamily = typeof options.fontFamily === "string" && options.fontFamily ? options.fontFamily : void 0;
|
|
147
|
-
const svg =
|
|
1768
|
+
const svg = renderChartToSvg({ key: element.id, type, option, widthMm, heightMm, fontFamily });
|
|
148
1769
|
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${svg}</div>`;
|
|
149
1770
|
} catch {
|
|
150
|
-
const title = typeof options.title === "string" && options.title.trim() ? options.title :
|
|
151
|
-
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${
|
|
1771
|
+
const title = typeof options.title === "string" && options.title.trim() ? options.title : getChartKindDefinition(type)?.label ?? t2("echarts.panel.chartFallback");
|
|
1772
|
+
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${escapeHtml2(title)}</div>`;
|
|
152
1773
|
}
|
|
153
1774
|
}
|
|
154
1775
|
function el(tag, className, text) {
|
|
@@ -184,52 +1805,311 @@ function checkboxField(labelText, checked, onCommit) {
|
|
|
184
1805
|
wrap.appendChild(input);
|
|
185
1806
|
return wrap;
|
|
186
1807
|
}
|
|
1808
|
+
function selectInput(options, value, onCommit) {
|
|
1809
|
+
const select = el("select", "pd-select");
|
|
1810
|
+
for (const item of options) {
|
|
1811
|
+
const optionEl = el("option");
|
|
1812
|
+
optionEl.value = item.value;
|
|
1813
|
+
optionEl.textContent = item.label;
|
|
1814
|
+
select.appendChild(optionEl);
|
|
1815
|
+
}
|
|
1816
|
+
select.value = value;
|
|
1817
|
+
select.addEventListener("change", () => onCommit(select.value));
|
|
1818
|
+
return select;
|
|
1819
|
+
}
|
|
1820
|
+
var activeDropdown = null;
|
|
1821
|
+
function composedPathOf(ev) {
|
|
1822
|
+
const composed = typeof ev.composedPath === "function" ? ev.composedPath() : [];
|
|
1823
|
+
return composed.length ? composed : [ev.target];
|
|
1824
|
+
}
|
|
1825
|
+
function dropdownSelect(options, value, onCommit) {
|
|
1826
|
+
const current = options.find((item) => item.value === value) ?? { value, label: value || t2("echarts.panel.optionDefault") };
|
|
1827
|
+
const trigger = el("button", "echarts-dropdown-trigger");
|
|
1828
|
+
trigger.type = "button";
|
|
1829
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
1830
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
1831
|
+
const valueEl = el("span", "echarts-dropdown-value", current.label);
|
|
1832
|
+
const arrow = el("span", "echarts-dropdown-arrow", "\u25BE");
|
|
1833
|
+
trigger.appendChild(valueEl);
|
|
1834
|
+
trigger.appendChild(arrow);
|
|
1835
|
+
let panel = null;
|
|
1836
|
+
let off = [];
|
|
1837
|
+
const close = () => {
|
|
1838
|
+
off.forEach((fn) => fn());
|
|
1839
|
+
off = [];
|
|
1840
|
+
panel?.remove();
|
|
1841
|
+
panel = null;
|
|
1842
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
1843
|
+
if (activeDropdown?.close === close) activeDropdown = null;
|
|
1844
|
+
};
|
|
1845
|
+
const open = () => {
|
|
1846
|
+
activeDropdown?.close();
|
|
1847
|
+
const root = trigger.getRootNode();
|
|
1848
|
+
const mount = root instanceof ShadowRoot ? root : document.body;
|
|
1849
|
+
panel = el("div", "echarts-dropdown-panel");
|
|
1850
|
+
panel.setAttribute("role", "listbox");
|
|
1851
|
+
for (const item of options) {
|
|
1852
|
+
const optionEl = el("div", `echarts-dropdown-option${item.value === value ? " is-active" : ""}`, item.label);
|
|
1853
|
+
optionEl.setAttribute("role", "option");
|
|
1854
|
+
optionEl.setAttribute("aria-selected", item.value === value ? "true" : "false");
|
|
1855
|
+
optionEl.addEventListener("click", (ev) => {
|
|
1856
|
+
ev.stopPropagation();
|
|
1857
|
+
close();
|
|
1858
|
+
onCommit(item.value);
|
|
1859
|
+
});
|
|
1860
|
+
panel.appendChild(optionEl);
|
|
1861
|
+
}
|
|
1862
|
+
mount.appendChild(panel);
|
|
1863
|
+
const rect = trigger.getBoundingClientRect();
|
|
1864
|
+
panel.style.left = `${rect.left}px`;
|
|
1865
|
+
panel.style.top = `${rect.bottom + 4}px`;
|
|
1866
|
+
panel.style.minWidth = `${rect.width}px`;
|
|
1867
|
+
trigger.setAttribute("aria-expanded", "true");
|
|
1868
|
+
activeDropdown = { close };
|
|
1869
|
+
const onPointerDown = (ev) => {
|
|
1870
|
+
const path = composedPathOf(ev);
|
|
1871
|
+
if (path.includes(trigger) || path.includes(panel)) return;
|
|
1872
|
+
close();
|
|
1873
|
+
};
|
|
1874
|
+
const onKeydown = (ev) => {
|
|
1875
|
+
if (ev.key === "Escape") close();
|
|
1876
|
+
};
|
|
1877
|
+
const onScroll = () => close();
|
|
1878
|
+
document.addEventListener("pointerdown", onPointerDown, true);
|
|
1879
|
+
document.addEventListener("keydown", onKeydown);
|
|
1880
|
+
window.addEventListener("scroll", onScroll, true);
|
|
1881
|
+
window.addEventListener("resize", onScroll);
|
|
1882
|
+
root.addEventListener("scroll", onScroll, true);
|
|
1883
|
+
off.push(
|
|
1884
|
+
() => document.removeEventListener("pointerdown", onPointerDown, true),
|
|
1885
|
+
() => document.removeEventListener("keydown", onKeydown),
|
|
1886
|
+
() => window.removeEventListener("scroll", onScroll, true),
|
|
1887
|
+
() => window.removeEventListener("resize", onScroll),
|
|
1888
|
+
() => root.removeEventListener("scroll", onScroll, true)
|
|
1889
|
+
);
|
|
1890
|
+
};
|
|
1891
|
+
trigger.addEventListener("click", (ev) => {
|
|
1892
|
+
ev.stopPropagation();
|
|
1893
|
+
if (panel) close();
|
|
1894
|
+
else open();
|
|
1895
|
+
});
|
|
1896
|
+
return trigger;
|
|
1897
|
+
}
|
|
1898
|
+
var overflowOptions = () => [
|
|
1899
|
+
{ value: "", label: t2("echarts.panel.overflow.default") },
|
|
1900
|
+
{ value: "none", label: t2("echarts.panel.overflow.none") },
|
|
1901
|
+
{ value: "truncate", label: t2("echarts.panel.overflow.truncate") },
|
|
1902
|
+
{ value: "break", label: t2("echarts.panel.overflow.break") }
|
|
1903
|
+
];
|
|
1904
|
+
var fontWeightOptions = () => [
|
|
1905
|
+
{ value: "", label: t2("echarts.panel.fontWeight.default") },
|
|
1906
|
+
{ value: "normal", label: t2("echarts.panel.fontWeight.normal") },
|
|
1907
|
+
{ value: "bold", label: t2("echarts.panel.fontWeight.bold") }
|
|
1908
|
+
];
|
|
1909
|
+
var styleFieldLabels = () => ({
|
|
1910
|
+
distance: t2("echarts.panel.label.distance"),
|
|
1911
|
+
rotate: t2("echarts.panel.label.rotate"),
|
|
1912
|
+
fontSize: t2("echarts.panel.label.fontSize"),
|
|
1913
|
+
fontWeight: t2("echarts.panel.label.fontWeight"),
|
|
1914
|
+
color: t2("echarts.panel.label.color"),
|
|
1915
|
+
backgroundColor: t2("echarts.panel.label.backgroundColor"),
|
|
1916
|
+
borderColor: t2("echarts.panel.label.borderColor"),
|
|
1917
|
+
borderWidth: t2("echarts.panel.label.borderWidth"),
|
|
1918
|
+
borderRadius: t2("echarts.panel.label.borderRadius"),
|
|
1919
|
+
padding: t2("echarts.panel.label.padding")
|
|
1920
|
+
});
|
|
1921
|
+
function renderLabelGroup(ctx, type) {
|
|
1922
|
+
const element = ctx.element;
|
|
1923
|
+
const def = getChartKindDefinition(type);
|
|
1924
|
+
const fields = labelFieldsOf(type);
|
|
1925
|
+
const has = (key) => fields.includes(key);
|
|
1926
|
+
const state = readChartLabel(panelOption(element), type);
|
|
1927
|
+
const styleLabels = styleFieldLabels();
|
|
1928
|
+
const commit = (patch) => {
|
|
1929
|
+
commitOption(ctx, type, updateChartLabel(panelOption(element), type, patch));
|
|
1930
|
+
};
|
|
1931
|
+
const commitNumber = (key, raw) => {
|
|
1932
|
+
if (raw.trim() === "") return commit({ [key]: null });
|
|
1933
|
+
const value = Number(raw);
|
|
1934
|
+
if (!Number.isFinite(value)) return;
|
|
1935
|
+
commit({ [key]: value });
|
|
1936
|
+
};
|
|
1937
|
+
const commitLineNumber = (key, raw) => {
|
|
1938
|
+
if (raw.trim() === "") return commit({ labelLine: { [key]: null } });
|
|
1939
|
+
const value = Number(raw);
|
|
1940
|
+
if (!Number.isFinite(value)) return;
|
|
1941
|
+
commit({ labelLine: { [key]: value } });
|
|
1942
|
+
};
|
|
1943
|
+
const numberField = (key, value) => {
|
|
1944
|
+
const wrap = field(styleLabels[key] ?? key);
|
|
1945
|
+
wrap.appendChild(
|
|
1946
|
+
textInput({ value: value === void 0 ? "" : String(value), type: "number" }, (raw) => commitNumber(key, raw))
|
|
1947
|
+
);
|
|
1948
|
+
return wrap;
|
|
1949
|
+
};
|
|
1950
|
+
const colorField = (key, value) => {
|
|
1951
|
+
const wrap = field(styleLabels[key] ?? key);
|
|
1952
|
+
const holder = el("span");
|
|
1953
|
+
(0, import_dom.render)((0, import_controls.colorPicker)({
|
|
1954
|
+
value: value ?? "",
|
|
1955
|
+
title: styleLabels[key] ?? key,
|
|
1956
|
+
// 面板点击时才构建,届时候选渲染期 translator 已还原,必须固化 ctx.t
|
|
1957
|
+
translator: ctx.t,
|
|
1958
|
+
onChange: (next) => commit({ [key]: next ?? "" })
|
|
1959
|
+
}), holder);
|
|
1960
|
+
wrap.appendChild(holder);
|
|
1961
|
+
return wrap;
|
|
1962
|
+
};
|
|
1963
|
+
const group = el("details", "echarts-label-group");
|
|
1964
|
+
group.open = state.show;
|
|
1965
|
+
const summary = el("summary", "echarts-label-summary");
|
|
1966
|
+
const toggle = checkboxField(t2("echarts.panel.label.show"), state.show, (checked) => commit({ enabled: checked }));
|
|
1967
|
+
toggle.querySelector("input")?.addEventListener("click", (event) => event.stopPropagation());
|
|
1968
|
+
summary.appendChild(toggle);
|
|
1969
|
+
group.appendChild(summary);
|
|
1970
|
+
if (has("formatter") || has("overflow")) {
|
|
1971
|
+
group.appendChild(el("div", "echarts-label-sub", t2("echarts.panel.label.content")));
|
|
1972
|
+
if (has("formatter")) {
|
|
1973
|
+
const wrap = field(t2("echarts.panel.label.formatterTitle"));
|
|
1974
|
+
wrap.appendChild(
|
|
1975
|
+
selectInput(
|
|
1976
|
+
[{ value: "", label: t2("echarts.panel.label.formatterCustom") }, ...LABEL_PRESETS.map((preset) => ({ value: preset.formatter, label: t2(preset.labelKey) }))],
|
|
1977
|
+
state.formatter ?? "",
|
|
1978
|
+
(value) => commit({ formatter: value })
|
|
1979
|
+
)
|
|
1980
|
+
);
|
|
1981
|
+
wrap.appendChild(
|
|
1982
|
+
textInput({ value: state.formatter ?? "", placeholder: t2("echarts.panel.label.formatterPlaceholder") }, (value) => commit({ formatter: value }))
|
|
1983
|
+
);
|
|
1984
|
+
group.appendChild(wrap);
|
|
1985
|
+
}
|
|
1986
|
+
if (has("overflow")) {
|
|
1987
|
+
const wrap = field(t2("echarts.panel.label.overflow"));
|
|
1988
|
+
wrap.appendChild(selectInput(overflowOptions(), state.overflow ?? "", (value) => commit({ overflow: value })));
|
|
1989
|
+
group.appendChild(wrap);
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
if (has("position") || has("distance") || has("rotate") || has("offset")) {
|
|
1993
|
+
group.appendChild(el("div", "echarts-label-sub", t2("echarts.panel.label.position")));
|
|
1994
|
+
if (has("position")) {
|
|
1995
|
+
const wrap = field(t2("echarts.panel.label.positionTitle"));
|
|
1996
|
+
const positions = def ? LABEL_POSITIONS[def.seriesType] ?? [] : [];
|
|
1997
|
+
wrap.appendChild(
|
|
1998
|
+
selectInput([{ value: "", label: t2("echarts.panel.label.positionDefault") }, ...positions.map((p) => ({ value: p.value, label: t2(p.labelKey) }))], state.position ?? "", (value) => commit({ position: value }))
|
|
1999
|
+
);
|
|
2000
|
+
group.appendChild(wrap);
|
|
2001
|
+
}
|
|
2002
|
+
if (has("distance")) group.appendChild(numberField("distance", state.distance));
|
|
2003
|
+
if (has("rotate")) group.appendChild(numberField("rotate", state.rotate));
|
|
2004
|
+
if (has("offset")) {
|
|
2005
|
+
let commitOffset2 = function() {
|
|
2006
|
+
const parse = (input, fallback) => {
|
|
2007
|
+
const text = input.value.trim();
|
|
2008
|
+
if (text === "") return 0;
|
|
2009
|
+
const value = Number(text);
|
|
2010
|
+
return Number.isFinite(value) ? value : fallback;
|
|
2011
|
+
};
|
|
2012
|
+
commit({ offset: [parse(inputX, current[0] ?? 0), parse(inputY, current[1] ?? 0)] });
|
|
2013
|
+
};
|
|
2014
|
+
var commitOffset = commitOffset2;
|
|
2015
|
+
const wrap = field(t2("echarts.panel.label.offset"));
|
|
2016
|
+
const row = el("div", "echarts-field-row");
|
|
2017
|
+
const current = state.offset ?? [0, 0];
|
|
2018
|
+
const inputX = textInput({ value: String(current[0] ?? 0), type: "number" }, () => commitOffset2());
|
|
2019
|
+
const inputY = textInput({ value: String(current[1] ?? 0), type: "number" }, () => commitOffset2());
|
|
2020
|
+
row.appendChild(inputX);
|
|
2021
|
+
row.appendChild(inputY);
|
|
2022
|
+
wrap.appendChild(row);
|
|
2023
|
+
group.appendChild(wrap);
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
const styleKeys = ["fontSize", "fontWeight", "color", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];
|
|
2027
|
+
if (styleKeys.some(has)) {
|
|
2028
|
+
group.appendChild(el("div", "echarts-label-sub", t2("echarts.panel.label.style")));
|
|
2029
|
+
if (has("fontSize")) group.appendChild(numberField("fontSize", state.fontSize));
|
|
2030
|
+
if (has("fontWeight")) {
|
|
2031
|
+
const wrap = field(t2("echarts.panel.labelLine.fontWeight"));
|
|
2032
|
+
wrap.appendChild(selectInput(fontWeightOptions(), state.fontWeight ?? "", (value) => commit({ fontWeight: value })));
|
|
2033
|
+
group.appendChild(wrap);
|
|
2034
|
+
}
|
|
2035
|
+
for (const key of ["color", "backgroundColor", "borderColor"]) {
|
|
2036
|
+
if (has(key)) group.appendChild(colorField(key, state[key]));
|
|
2037
|
+
}
|
|
2038
|
+
for (const key of ["borderWidth", "borderRadius", "padding"]) {
|
|
2039
|
+
if (has(key)) group.appendChild(numberField(key, state[key]));
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
if (has("labelLine.show")) {
|
|
2043
|
+
group.appendChild(el("div", "echarts-label-sub", t2("echarts.panel.labelLine")));
|
|
2044
|
+
group.appendChild(
|
|
2045
|
+
checkboxField(t2("echarts.panel.labelLine.show"), state.labelLine.show === true, (checked) => commit({ labelLine: { show: checked } }))
|
|
2046
|
+
);
|
|
2047
|
+
if (has("labelLine.length")) {
|
|
2048
|
+
const wrap = field(t2("echarts.panel.labelLine.length"));
|
|
2049
|
+
wrap.appendChild(
|
|
2050
|
+
textInput(
|
|
2051
|
+
{ value: state.labelLine.length === void 0 ? "" : String(state.labelLine.length), type: "number" },
|
|
2052
|
+
(raw) => commitLineNumber("length", raw)
|
|
2053
|
+
)
|
|
2054
|
+
);
|
|
2055
|
+
group.appendChild(wrap);
|
|
2056
|
+
}
|
|
2057
|
+
if (has("labelLine.length2")) {
|
|
2058
|
+
const wrap = field(t2("echarts.panel.labelLine.length2"));
|
|
2059
|
+
wrap.appendChild(
|
|
2060
|
+
textInput(
|
|
2061
|
+
{ value: state.labelLine.length2 === void 0 ? "" : String(state.labelLine.length2), type: "number" },
|
|
2062
|
+
(raw) => commitLineNumber("length2", raw)
|
|
2063
|
+
)
|
|
2064
|
+
);
|
|
2065
|
+
group.appendChild(wrap);
|
|
2066
|
+
}
|
|
2067
|
+
if (has("labelLine.smooth")) {
|
|
2068
|
+
group.appendChild(
|
|
2069
|
+
checkboxField(t2("echarts.panel.labelLine.smooth"), state.labelLine.smooth === true, (checked) => commit({ labelLine: { smooth: checked } }))
|
|
2070
|
+
);
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
return group;
|
|
2074
|
+
}
|
|
187
2075
|
function renderProperty(ctx) {
|
|
2076
|
+
return withTranslator(ctx.t, () => renderPropertyInner(ctx));
|
|
2077
|
+
}
|
|
2078
|
+
function renderPropertyInner(ctx) {
|
|
188
2079
|
const element = ctx.element;
|
|
189
2080
|
const type = elementType(element);
|
|
190
|
-
const def =
|
|
191
|
-
const fields =
|
|
2081
|
+
const def = getChartKindDefinition(type);
|
|
2082
|
+
const fields = resolveChartPanelFields(type);
|
|
192
2083
|
const has = (key) => fields.includes(key);
|
|
193
2084
|
const options = element.options;
|
|
194
2085
|
const widthMm = Number(options.width) || 0;
|
|
195
2086
|
const heightMm = Number(options.height) || 0;
|
|
196
2087
|
const limit = maxValueFields(def);
|
|
197
|
-
const palettes =
|
|
2088
|
+
const palettes = getChartPalettes();
|
|
2089
|
+
const fieldLabels = fieldLabelMap(ctx.fields);
|
|
198
2090
|
const root = el("div", "echarts-property");
|
|
199
2091
|
const form = el("form", "pd-form");
|
|
200
2092
|
form.addEventListener("submit", (event) => event.preventDefault());
|
|
201
2093
|
root.appendChild(form);
|
|
202
2094
|
if (has("dataSource")) {
|
|
203
|
-
const wrap = field("
|
|
204
|
-
const
|
|
205
|
-
let datalist;
|
|
206
|
-
if (candidates.length > 0) {
|
|
207
|
-
datalist = el("datalist");
|
|
208
|
-
datalist.id = `echarts-ds-${++datalistSeq}`;
|
|
209
|
-
for (const key of candidates) {
|
|
210
|
-
const optionEl = el("option");
|
|
211
|
-
optionEl.value = key;
|
|
212
|
-
datalist.appendChild(optionEl);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
2095
|
+
const wrap = field(t2("echarts.panel.dataSourceTitle"));
|
|
2096
|
+
const current = String(options.chartDataSource ?? "");
|
|
215
2097
|
wrap.appendChild(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
placeholder: "\u6570\u636E\u96C6\u8DEF\u5F84\uFF08\u7559\u7A7A\u53D6\u9876\u5C42\u7B2C\u4E00\u4E2A\u6570\u7EC4\uFF09",
|
|
220
|
-
list: datalist?.id
|
|
221
|
-
},
|
|
2098
|
+
dropdownSelect(
|
|
2099
|
+
dropdownOptions(dataSourceCandidates(ctx.data), current, fieldLabels),
|
|
2100
|
+
current,
|
|
222
2101
|
(value) => commitOption(ctx, type, panelOption(element), { chartDataSource: value })
|
|
223
2102
|
)
|
|
224
2103
|
);
|
|
225
|
-
if (datalist) wrap.appendChild(datalist);
|
|
226
2104
|
form.appendChild(wrap);
|
|
227
2105
|
}
|
|
228
2106
|
if (has("categoryField")) {
|
|
229
|
-
const wrap = field("
|
|
2107
|
+
const wrap = field(t2("echarts.panel.categoryField"));
|
|
2108
|
+
const current = String(options.chartCategoryField ?? "");
|
|
230
2109
|
wrap.appendChild(
|
|
231
|
-
|
|
232
|
-
|
|
2110
|
+
dropdownSelect(
|
|
2111
|
+
dropdownOptions(dataRowFields(ctx.data, String(options.chartDataSource ?? "")), current, fieldLabels),
|
|
2112
|
+
current,
|
|
233
2113
|
(value) => commitOption(ctx, type, panelOption(element), { chartCategoryField: value })
|
|
234
2114
|
)
|
|
235
2115
|
);
|
|
@@ -241,8 +2121,9 @@ function renderProperty(ctx) {
|
|
|
241
2121
|
fieldsNow.forEach((value, index) => {
|
|
242
2122
|
const row = el("div", "echarts-field-row");
|
|
243
2123
|
row.appendChild(
|
|
244
|
-
|
|
245
|
-
|
|
2124
|
+
dropdownSelect(
|
|
2125
|
+
dropdownOptions(dataRowFields(ctx.data, String(options.chartDataSource ?? "")), value, fieldLabels),
|
|
2126
|
+
value,
|
|
246
2127
|
(next) => {
|
|
247
2128
|
const list = readValueFields(element);
|
|
248
2129
|
list[index] = next;
|
|
@@ -253,14 +2134,14 @@ function renderProperty(ctx) {
|
|
|
253
2134
|
if (fieldsNow.length > 1) {
|
|
254
2135
|
const remove = el("button", "pd-button small", "\u2212");
|
|
255
2136
|
remove.type = "button";
|
|
256
|
-
remove.title = "
|
|
2137
|
+
remove.title = t2("echarts.panel.removeField");
|
|
257
2138
|
remove.addEventListener("click", () => syncValueFields(ctx, type, readValueFields(element).filter((_, i) => i !== index)));
|
|
258
2139
|
row.appendChild(remove);
|
|
259
2140
|
}
|
|
260
2141
|
wrap.appendChild(row);
|
|
261
2142
|
});
|
|
262
2143
|
if (fieldsNow.length < limit) {
|
|
263
|
-
const add = el("button", "pd-button small", "
|
|
2144
|
+
const add = el("button", "pd-button small", t2("echarts.panel.addField"));
|
|
264
2145
|
add.type = "button";
|
|
265
2146
|
add.addEventListener("click", () => syncValueFields(ctx, type, [...readValueFields(element), ""]));
|
|
266
2147
|
wrap.appendChild(add);
|
|
@@ -268,10 +2149,10 @@ function renderProperty(ctx) {
|
|
|
268
2149
|
form.appendChild(wrap);
|
|
269
2150
|
}
|
|
270
2151
|
if (has("seriesField")) {
|
|
271
|
-
const wrap = field("
|
|
2152
|
+
const wrap = field(t2("echarts.panel.seriesField"));
|
|
272
2153
|
wrap.appendChild(
|
|
273
2154
|
textInput(
|
|
274
|
-
{ value: String(options.chartSeriesField ?? ""), placeholder: "
|
|
2155
|
+
{ value: String(options.chartSeriesField ?? ""), placeholder: t2("echarts.panel.seriesFieldHint") },
|
|
275
2156
|
(value) => commitOption(ctx, type, panelOption(element), { chartSeriesField: value })
|
|
276
2157
|
)
|
|
277
2158
|
);
|
|
@@ -279,19 +2160,19 @@ function renderProperty(ctx) {
|
|
|
279
2160
|
}
|
|
280
2161
|
if (has("bubble")) {
|
|
281
2162
|
form.appendChild(
|
|
282
|
-
checkboxField("
|
|
2163
|
+
checkboxField(t2("echarts.panel.bubbleSize"), options.chartBubble === true, (checked) => {
|
|
283
2164
|
commitOption(ctx, type, panelOption(element), { chartBubble: checked });
|
|
284
2165
|
})
|
|
285
2166
|
);
|
|
286
2167
|
}
|
|
287
2168
|
if (has("title")) {
|
|
288
|
-
const wrap = field("
|
|
2169
|
+
const wrap = field(t2("echarts.panel.title"));
|
|
289
2170
|
wrap.appendChild(
|
|
290
2171
|
textInput(
|
|
291
|
-
{ value: String(
|
|
2172
|
+
{ value: String(asObject(panelOption(element).title).text ?? ""), placeholder: t2("echarts.panel.titleHint") },
|
|
292
2173
|
(value) => {
|
|
293
2174
|
const next = panelOption(element);
|
|
294
|
-
next.title = { ...
|
|
2175
|
+
next.title = { ...asObject(next.title), text: value };
|
|
295
2176
|
commitOption(ctx, type, next);
|
|
296
2177
|
}
|
|
297
2178
|
)
|
|
@@ -299,25 +2180,25 @@ function renderProperty(ctx) {
|
|
|
299
2180
|
form.appendChild(wrap);
|
|
300
2181
|
}
|
|
301
2182
|
if (has("legend")) {
|
|
302
|
-
const show =
|
|
2183
|
+
const show = asObject(panelOption(element).legend).show !== false;
|
|
303
2184
|
form.appendChild(
|
|
304
|
-
checkboxField("
|
|
2185
|
+
checkboxField(t2("echarts.panel.legend"), show, (checked) => {
|
|
305
2186
|
const next = panelOption(element);
|
|
306
|
-
next.legend = { ...
|
|
2187
|
+
next.legend = { ...asObject(next.legend), show: checked };
|
|
307
2188
|
commitOption(ctx, type, next);
|
|
308
2189
|
})
|
|
309
2190
|
);
|
|
310
2191
|
}
|
|
311
2192
|
if (has("palette")) {
|
|
312
|
-
const wrap = field("
|
|
2193
|
+
const wrap = field(t2("echarts.panel.palette"));
|
|
313
2194
|
const select = el("select", "pd-select");
|
|
314
2195
|
for (const palette of palettes) {
|
|
315
2196
|
const optionEl = el("option");
|
|
316
2197
|
optionEl.value = palette.key;
|
|
317
|
-
optionEl.textContent = palette.label;
|
|
2198
|
+
optionEl.textContent = palette.labelKey ? t2(palette.labelKey) : palette.label;
|
|
318
2199
|
select.appendChild(optionEl);
|
|
319
2200
|
}
|
|
320
|
-
select.value =
|
|
2201
|
+
select.value = readPaletteKey(panelOption(element), palettes);
|
|
321
2202
|
select.addEventListener("change", () => {
|
|
322
2203
|
const palette = palettes.find((item) => item.key === select.value) ?? palettes[0];
|
|
323
2204
|
const next = panelOption(element);
|
|
@@ -327,11 +2208,14 @@ function renderProperty(ctx) {
|
|
|
327
2208
|
wrap.appendChild(select);
|
|
328
2209
|
form.appendChild(wrap);
|
|
329
2210
|
}
|
|
2211
|
+
if (has("label")) {
|
|
2212
|
+
form.appendChild(renderLabelGroup(ctx, type));
|
|
2213
|
+
}
|
|
330
2214
|
if (has("stack")) {
|
|
331
2215
|
const series = seriesList(panelOption(element));
|
|
332
2216
|
const stacked = series.some((item) => item.stack !== void 0 && item.stack !== null && item.stack !== "");
|
|
333
2217
|
form.appendChild(
|
|
334
|
-
checkboxField("
|
|
2218
|
+
checkboxField(t2("echarts.panel.stack"), stacked, (checked) => {
|
|
335
2219
|
const next = panelOption(element);
|
|
336
2220
|
for (const item of seriesList(next)) {
|
|
337
2221
|
if (checked) item.stack = "total";
|
|
@@ -342,37 +2226,37 @@ function renderProperty(ctx) {
|
|
|
342
2226
|
);
|
|
343
2227
|
}
|
|
344
2228
|
if (has("innerRadius")) {
|
|
345
|
-
const wrap = field("
|
|
2229
|
+
const wrap = field(t2("echarts.panel.innerRadius"));
|
|
346
2230
|
const radius = seriesList(panelOption(element))[0]?.radius;
|
|
347
2231
|
const inner = Array.isArray(radius) ? Number(String(radius[0] ?? "40%").replace("%", "")) || 40 : 40;
|
|
348
2232
|
wrap.appendChild(
|
|
349
2233
|
textInput({ value: String(inner), type: "number", min: 0, max: 90 }, (value) => {
|
|
350
2234
|
const next = panelOption(element);
|
|
351
2235
|
const series = seriesList(next);
|
|
352
|
-
if (series[0]) series[0].radius = [`${
|
|
2236
|
+
if (series[0]) series[0].radius = [`${clamp2(Number(value) || 0, 0, 90)}%`, "70%"];
|
|
353
2237
|
commitOption(ctx, type, next);
|
|
354
2238
|
})
|
|
355
2239
|
);
|
|
356
2240
|
form.appendChild(wrap);
|
|
357
2241
|
}
|
|
358
2242
|
if (has("padding")) {
|
|
359
|
-
const wrap = field(
|
|
360
|
-
const padding =
|
|
2243
|
+
const wrap = field(t2("echarts.panel.paddingTRBL"));
|
|
2244
|
+
const padding = readFunnelPadding(panelOption(element), widthMm, heightMm);
|
|
361
2245
|
const row = el("div", "echarts-field-row");
|
|
362
2246
|
const sides = [
|
|
363
|
-
{ side: "top", title: "
|
|
364
|
-
{ side: "right", title: "
|
|
365
|
-
{ side: "bottom", title: "
|
|
366
|
-
{ side: "left", title: "
|
|
2247
|
+
{ side: "top", title: t2("echarts.panel.paddingTop") },
|
|
2248
|
+
{ side: "right", title: t2("echarts.panel.paddingRight") },
|
|
2249
|
+
{ side: "bottom", title: t2("echarts.panel.paddingBottom") },
|
|
2250
|
+
{ side: "left", title: t2("echarts.panel.paddingLeft") }
|
|
367
2251
|
];
|
|
368
2252
|
for (const { side, title } of sides) {
|
|
369
2253
|
row.appendChild(
|
|
370
2254
|
textInput({ value: String(padding[side]), type: "number", min: 0, max: 60, title }, (value) => {
|
|
371
2255
|
const raw = Number(value);
|
|
372
|
-
const next = Number.isFinite(raw) ?
|
|
2256
|
+
const next = Number.isFinite(raw) ? clamp2(raw, 0, 60) : FUNNEL_PADDING_DEFAULTS[side];
|
|
373
2257
|
const option = panelOption(element);
|
|
374
|
-
const current =
|
|
375
|
-
commitOption(ctx, type,
|
|
2258
|
+
const current = readFunnelPadding(option, widthMm, heightMm);
|
|
2259
|
+
commitOption(ctx, type, writeFunnelPadding(option, { ...current, [side]: next }));
|
|
376
2260
|
})
|
|
377
2261
|
);
|
|
378
2262
|
}
|
|
@@ -380,21 +2264,21 @@ function renderProperty(ctx) {
|
|
|
380
2264
|
form.appendChild(wrap);
|
|
381
2265
|
}
|
|
382
2266
|
if (has("radius")) {
|
|
383
|
-
const wrap = field("
|
|
2267
|
+
const wrap = field(t2("echarts.panel.radius"));
|
|
384
2268
|
wrap.appendChild(
|
|
385
2269
|
textInput(
|
|
386
|
-
{ value: String(
|
|
2270
|
+
{ value: String(readRadarRadius(panelOption(element), widthMm, heightMm)), type: "number", min: 20, max: 100 },
|
|
387
2271
|
(value) => {
|
|
388
2272
|
const raw = Number(value);
|
|
389
|
-
const next = Number.isFinite(raw) ?
|
|
390
|
-
commitOption(ctx, type,
|
|
2273
|
+
const next = Number.isFinite(raw) ? clamp2(raw, 20, 100) : RADAR_RADIUS_DEFAULT;
|
|
2274
|
+
commitOption(ctx, type, writeRadarRadius(panelOption(element), next));
|
|
391
2275
|
}
|
|
392
2276
|
)
|
|
393
2277
|
);
|
|
394
2278
|
form.appendChild(wrap);
|
|
395
2279
|
}
|
|
396
2280
|
if (has("gaugeRange")) {
|
|
397
|
-
const wrap = field("
|
|
2281
|
+
const wrap = field(t2("echarts.panel.minMax"));
|
|
398
2282
|
const series = seriesList(panelOption(element));
|
|
399
2283
|
const row = el("div", "echarts-field-row");
|
|
400
2284
|
row.appendChild(
|
|
@@ -416,26 +2300,28 @@ function renderProperty(ctx) {
|
|
|
416
2300
|
wrap.appendChild(row);
|
|
417
2301
|
form.appendChild(wrap);
|
|
418
2302
|
}
|
|
419
|
-
form.appendChild(el("p", "pd-hint",
|
|
2303
|
+
form.appendChild(el("p", "pd-hint", panelHint()));
|
|
420
2304
|
return root;
|
|
421
2305
|
}
|
|
422
2306
|
var CHART_ELEMENT_UI = (0, import_plugin_kit.defineElementUI)({
|
|
423
|
-
types:
|
|
2307
|
+
types: CHART_KINDS,
|
|
424
2308
|
renderCanvas,
|
|
425
2309
|
renderProperty,
|
|
426
2310
|
hasProperties: chartHasProperties,
|
|
427
|
-
group: "
|
|
2311
|
+
group: t2("echarts.panel.group"),
|
|
428
2312
|
searchKeywords: SEARCH_KEYWORDS,
|
|
429
|
-
styles: STYLES
|
|
2313
|
+
styles: STYLES,
|
|
2314
|
+
i18nId: "echarts",
|
|
2315
|
+
locales: { "zh-CN": zh_CN_default.echarts, "en-US": en_US_default.echarts, "th-TH": th_TH_default.echarts }
|
|
430
2316
|
});
|
|
431
|
-
var
|
|
2317
|
+
var disposeHandle2;
|
|
432
2318
|
function installChartCommonUI() {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
return
|
|
2319
|
+
disposeHandle2?.();
|
|
2320
|
+
disposeHandle2 = (0, import_plugin_kit.registerElementUI)(CHART_ELEMENT_UI);
|
|
2321
|
+
return disposeHandle2;
|
|
436
2322
|
}
|
|
437
2323
|
function uninstallChartCommonUI() {
|
|
438
|
-
|
|
439
|
-
|
|
2324
|
+
disposeHandle2?.();
|
|
2325
|
+
disposeHandle2 = void 0;
|
|
440
2326
|
}
|
|
441
2327
|
installChartCommonUI();
|