@worm-print-platform/echarts 1.5.0 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -127
- 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 +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/defaults.d.ts +1 -1
- package/dist/echarts.d.ts +1 -1
- package/dist/echarts.js +8 -8
- package/dist/executor.iife.global.d.ts +1 -1
- package/dist/executor.iife.global.js +16 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kinds.d.ts +1 -1
- package/dist/kit.cjs +1 -1
- package/dist/kit.d.ts +1 -1
- package/dist/kit.js +1 -1
- package/dist/marketplace.d.ts +8 -0
- package/dist/marketplace.js +1064 -0
- package/dist/node.cjs +2 -2
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/normalize.d.ts +1 -1
- package/dist/option-utils.d.ts +1 -1
- package/dist/plugin-Bf6QDbHO.cjs +1 -1
- package/dist/plugin-CUoE2jMs.js +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/renderer.d.ts +1 -1
- package/dist/type-augmentation.d.ts +1 -1
- package/dist/ui.cjs +23 -28
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +23 -28
- package/dist/units.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +8 -8
package/dist/node.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/echarts v1.5.
|
|
2
|
+
* @worm-print-platform/echarts v1.5.3
|
|
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
|
|
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// ../../../node_modules/tsup/assets/cjs_shims.js
|
|
32
32
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
33
33
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
34
34
|
|
package/dist/node.d.ts
CHANGED
package/dist/node.js
CHANGED
package/dist/normalize.d.ts
CHANGED
package/dist/option-utils.d.ts
CHANGED
package/dist/plugin-Bf6QDbHO.cjs
CHANGED
package/dist/plugin-CUoE2jMs.js
CHANGED
package/dist/plugin.d.ts
CHANGED
package/dist/renderer.d.ts
CHANGED
package/dist/ui.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/echarts v1.5.
|
|
2
|
+
* @worm-print-platform/echarts v1.5.3
|
|
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
|
|
@@ -74,8 +74,7 @@ function escapeHtml(value) {
|
|
|
74
74
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
75
75
|
}
|
|
76
76
|
function elementType(element) {
|
|
77
|
-
|
|
78
|
-
return (_b = (_a = element.printElementType) == null ? void 0 : _a.type) != null ? _b : "";
|
|
77
|
+
return element.printElementType?.type ?? "";
|
|
79
78
|
}
|
|
80
79
|
function rawChartOption(element) {
|
|
81
80
|
const raw = element.options.chartOption;
|
|
@@ -83,10 +82,10 @@ function rawChartOption(element) {
|
|
|
83
82
|
}
|
|
84
83
|
function panelOption(element) {
|
|
85
84
|
const raw = rawChartOption(element);
|
|
86
|
-
return (0, import_kit.cloneChartOption)(raw
|
|
85
|
+
return (0, import_kit.cloneChartOption)(raw ?? (0, import_kit.createDefaultChartOption)(elementType(element)));
|
|
87
86
|
}
|
|
88
87
|
function chartHasProperties(element) {
|
|
89
|
-
const options = element
|
|
88
|
+
const options = element?.options;
|
|
90
89
|
if (!options || typeof options !== "object") return false;
|
|
91
90
|
const record = options;
|
|
92
91
|
return CHART_OPTION_KEYS.some((key) => record[key] !== void 0);
|
|
@@ -99,7 +98,7 @@ function readValueFields(element) {
|
|
|
99
98
|
return Array.isArray(raw) ? raw.map(String) : [];
|
|
100
99
|
}
|
|
101
100
|
function maxValueFields(def) {
|
|
102
|
-
switch (def
|
|
101
|
+
switch (def?.seriesType) {
|
|
103
102
|
case "pie":
|
|
104
103
|
case "funnel":
|
|
105
104
|
case "gauge":
|
|
@@ -111,11 +110,11 @@ function maxValueFields(def) {
|
|
|
111
110
|
}
|
|
112
111
|
}
|
|
113
112
|
function valueFieldsLabel(def, limit) {
|
|
114
|
-
if (
|
|
113
|
+
if (def?.seriesType === "radar") return "\u7EF4\u5EA6\u5B57\u6BB5\uFF08\u6BCF\u4E2A\u5B57\u6BB5\u4E00\u4E2A\u7EF4\u5EA6\uFF09";
|
|
115
114
|
return limit === 1 ? "\u6570\u503C\u5B57\u6BB5" : "\u6570\u503C\u5B57\u6BB5\uFF08\u591A\u503C\u591A\u7CFB\u5217\uFF09";
|
|
116
115
|
}
|
|
117
116
|
function dataSourceCandidates(data) {
|
|
118
|
-
const first = data
|
|
117
|
+
const first = data?.[0];
|
|
119
118
|
if (!first) return [];
|
|
120
119
|
return Object.keys(first).filter((key) => Array.isArray(first[key]));
|
|
121
120
|
}
|
|
@@ -129,28 +128,26 @@ function syncValueFields(ctx, type, nextFields) {
|
|
|
129
128
|
const next = (0, import_kit.syncSeriesCount)(panelOption(ctx.element), nextFields.length, type);
|
|
130
129
|
const series = Array.isArray(next.series) ? next.series : [];
|
|
131
130
|
series.forEach((item, index) => {
|
|
132
|
-
|
|
133
|
-
const name = (_a = nextFields[index]) == null ? void 0 : _a.trim();
|
|
131
|
+
const name = nextFields[index]?.trim();
|
|
134
132
|
if (name) item.name = name;
|
|
135
133
|
});
|
|
136
134
|
commitOption(ctx, type, next, { chartValueFields: nextFields });
|
|
137
135
|
}
|
|
138
136
|
function renderCanvas(ctx) {
|
|
139
|
-
var _a, _b, _c;
|
|
140
137
|
const element = ctx.element;
|
|
141
138
|
const type = elementType(element);
|
|
142
139
|
const options = element.options;
|
|
143
140
|
const widthMm = Number(options.width) || 0;
|
|
144
141
|
const heightMm = Number(options.height) || 0;
|
|
145
142
|
try {
|
|
146
|
-
const preview = (0, import_kit.previewChartOption)(type,
|
|
143
|
+
const preview = (0, import_kit.previewChartOption)(type, rawChartOption(element) ?? (0, import_kit.createDefaultChartOption)(type));
|
|
147
144
|
const option = (0, import_kit.normalizeChartOption)(type, preview);
|
|
148
145
|
if (!option || typeof option !== "object" || Array.isArray(option)) throw new Error("\u56FE\u8868 option \u975E\u6CD5\uFF1A\u9700\u8981\u5BF9\u8C61");
|
|
149
146
|
const fontFamily = typeof options.fontFamily === "string" && options.fontFamily ? options.fontFamily : void 0;
|
|
150
147
|
const svg = (0, import_kit.renderChartToSvg)({ key: element.id, type, option, widthMm, heightMm, fontFamily });
|
|
151
148
|
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${svg}</div>`;
|
|
152
|
-
} catch
|
|
153
|
-
const title = typeof options.title === "string" && options.title.trim() ? options.title : (
|
|
149
|
+
} catch {
|
|
150
|
+
const title = typeof options.title === "string" && options.title.trim() ? options.title : (0, import_kit.getChartKindDefinition)(type)?.label ?? "\u56FE\u8868";
|
|
154
151
|
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${escapeHtml(title)}</div>`;
|
|
155
152
|
}
|
|
156
153
|
}
|
|
@@ -188,7 +185,6 @@ function checkboxField(labelText, checked, onCommit) {
|
|
|
188
185
|
return wrap;
|
|
189
186
|
}
|
|
190
187
|
function renderProperty(ctx) {
|
|
191
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
192
188
|
const element = ctx.element;
|
|
193
189
|
const type = elementType(element);
|
|
194
190
|
const def = (0, import_kit.getChartKindDefinition)(type);
|
|
@@ -219,9 +215,9 @@ function renderProperty(ctx) {
|
|
|
219
215
|
wrap.appendChild(
|
|
220
216
|
textInput(
|
|
221
217
|
{
|
|
222
|
-
value: String(
|
|
218
|
+
value: String(options.chartDataSource ?? ""),
|
|
223
219
|
placeholder: "\u6570\u636E\u96C6\u8DEF\u5F84\uFF08\u7559\u7A7A\u53D6\u9876\u5C42\u7B2C\u4E00\u4E2A\u6570\u7EC4\uFF09",
|
|
224
|
-
list: datalist
|
|
220
|
+
list: datalist?.id
|
|
225
221
|
},
|
|
226
222
|
(value) => commitOption(ctx, type, panelOption(element), { chartDataSource: value })
|
|
227
223
|
)
|
|
@@ -233,7 +229,7 @@ function renderProperty(ctx) {
|
|
|
233
229
|
const wrap = field("\u7C7B\u76EE\u5B57\u6BB5");
|
|
234
230
|
wrap.appendChild(
|
|
235
231
|
textInput(
|
|
236
|
-
{ value: String(
|
|
232
|
+
{ value: String(options.chartCategoryField ?? ""), placeholder: "\u5982 name" },
|
|
237
233
|
(value) => commitOption(ctx, type, panelOption(element), { chartCategoryField: value })
|
|
238
234
|
)
|
|
239
235
|
);
|
|
@@ -275,7 +271,7 @@ function renderProperty(ctx) {
|
|
|
275
271
|
const wrap = field("\u7CFB\u5217\u62C6\u5206\u5B57\u6BB5");
|
|
276
272
|
wrap.appendChild(
|
|
277
273
|
textInput(
|
|
278
|
-
{ value: String(
|
|
274
|
+
{ value: String(options.chartSeriesField ?? ""), placeholder: "\u53EF\u9009\uFF0C\u5982 region\uFF08\u6309\u503C\u62C6\u6210\u591A\u7CFB\u5217\uFF09" },
|
|
279
275
|
(value) => commitOption(ctx, type, panelOption(element), { chartSeriesField: value })
|
|
280
276
|
)
|
|
281
277
|
);
|
|
@@ -292,7 +288,7 @@ function renderProperty(ctx) {
|
|
|
292
288
|
const wrap = field("\u56FE\u8868\u6807\u9898");
|
|
293
289
|
wrap.appendChild(
|
|
294
290
|
textInput(
|
|
295
|
-
{ value: String((
|
|
291
|
+
{ value: String((0, import_kit.asObject)(panelOption(element).title).text ?? ""), placeholder: "\u7559\u7A7A\u4E0D\u663E\u793A\u6807\u9898" },
|
|
296
292
|
(value) => {
|
|
297
293
|
const next = panelOption(element);
|
|
298
294
|
next.title = { ...(0, import_kit.asObject)(next.title), text: value };
|
|
@@ -323,8 +319,7 @@ function renderProperty(ctx) {
|
|
|
323
319
|
}
|
|
324
320
|
select.value = (0, import_kit.readPaletteKey)(panelOption(element), palettes);
|
|
325
321
|
select.addEventListener("change", () => {
|
|
326
|
-
|
|
327
|
-
const palette = (_a2 = palettes.find((item) => item.key === select.value)) != null ? _a2 : palettes[0];
|
|
322
|
+
const palette = palettes.find((item) => item.key === select.value) ?? palettes[0];
|
|
328
323
|
const next = panelOption(element);
|
|
329
324
|
next.color = [...palette.colors];
|
|
330
325
|
commitOption(ctx, type, next);
|
|
@@ -348,8 +343,8 @@ function renderProperty(ctx) {
|
|
|
348
343
|
}
|
|
349
344
|
if (has("innerRadius")) {
|
|
350
345
|
const wrap = field("\u5185\u5F84\uFF08%\uFF09");
|
|
351
|
-
const radius =
|
|
352
|
-
const inner = Array.isArray(radius) ? Number(String(
|
|
346
|
+
const radius = seriesList(panelOption(element))[0]?.radius;
|
|
347
|
+
const inner = Array.isArray(radius) ? Number(String(radius[0] ?? "40%").replace("%", "")) || 40 : 40;
|
|
353
348
|
wrap.appendChild(
|
|
354
349
|
textInput({ value: String(inner), type: "number", min: 0, max: 90 }, (value) => {
|
|
355
350
|
const next = panelOption(element);
|
|
@@ -403,7 +398,7 @@ function renderProperty(ctx) {
|
|
|
403
398
|
const series = seriesList(panelOption(element));
|
|
404
399
|
const row = el("div", "echarts-field-row");
|
|
405
400
|
row.appendChild(
|
|
406
|
-
textInput({ value: String(Number(
|
|
401
|
+
textInput({ value: String(Number(series[0]?.min ?? 0)), type: "number" }, (value) => {
|
|
407
402
|
const next = panelOption(element);
|
|
408
403
|
const list = seriesList(next);
|
|
409
404
|
if (list[0]) list[0].min = Number(value) || 0;
|
|
@@ -411,7 +406,7 @@ function renderProperty(ctx) {
|
|
|
411
406
|
})
|
|
412
407
|
);
|
|
413
408
|
row.appendChild(
|
|
414
|
-
textInput({ value: String(Number(
|
|
409
|
+
textInput({ value: String(Number(series[0]?.max ?? 100)), type: "number" }, (value) => {
|
|
415
410
|
const next = panelOption(element);
|
|
416
411
|
const list = seriesList(next);
|
|
417
412
|
if (list[0]) list[0].max = Number(value) || 100;
|
|
@@ -435,12 +430,12 @@ var CHART_ELEMENT_UI = (0, import_plugin_kit.defineElementUI)({
|
|
|
435
430
|
});
|
|
436
431
|
var disposeHandle;
|
|
437
432
|
function installChartCommonUI() {
|
|
438
|
-
disposeHandle
|
|
433
|
+
disposeHandle?.();
|
|
439
434
|
disposeHandle = (0, import_plugin_kit.registerElementUI)(CHART_ELEMENT_UI);
|
|
440
435
|
return disposeHandle;
|
|
441
436
|
}
|
|
442
437
|
function uninstallChartCommonUI() {
|
|
443
|
-
disposeHandle
|
|
438
|
+
disposeHandle?.();
|
|
444
439
|
disposeHandle = void 0;
|
|
445
440
|
}
|
|
446
441
|
installChartCommonUI();
|
package/dist/ui.d.ts
CHANGED
package/dist/ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/echarts v1.5.
|
|
2
|
+
* @worm-print-platform/echarts v1.5.3
|
|
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
|
|
@@ -68,8 +68,7 @@ function escapeHtml(value) {
|
|
|
68
68
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
69
69
|
}
|
|
70
70
|
function elementType(element) {
|
|
71
|
-
|
|
72
|
-
return (_b = (_a = element.printElementType) == null ? void 0 : _a.type) != null ? _b : "";
|
|
71
|
+
return element.printElementType?.type ?? "";
|
|
73
72
|
}
|
|
74
73
|
function rawChartOption(element) {
|
|
75
74
|
const raw = element.options.chartOption;
|
|
@@ -77,10 +76,10 @@ function rawChartOption(element) {
|
|
|
77
76
|
}
|
|
78
77
|
function panelOption(element) {
|
|
79
78
|
const raw = rawChartOption(element);
|
|
80
|
-
return cloneChartOption(raw
|
|
79
|
+
return cloneChartOption(raw ?? createDefaultChartOption(elementType(element)));
|
|
81
80
|
}
|
|
82
81
|
function chartHasProperties(element) {
|
|
83
|
-
const options = element
|
|
82
|
+
const options = element?.options;
|
|
84
83
|
if (!options || typeof options !== "object") return false;
|
|
85
84
|
const record = options;
|
|
86
85
|
return CHART_OPTION_KEYS.some((key) => record[key] !== void 0);
|
|
@@ -93,7 +92,7 @@ function readValueFields(element) {
|
|
|
93
92
|
return Array.isArray(raw) ? raw.map(String) : [];
|
|
94
93
|
}
|
|
95
94
|
function maxValueFields(def) {
|
|
96
|
-
switch (def
|
|
95
|
+
switch (def?.seriesType) {
|
|
97
96
|
case "pie":
|
|
98
97
|
case "funnel":
|
|
99
98
|
case "gauge":
|
|
@@ -105,11 +104,11 @@ function maxValueFields(def) {
|
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
function valueFieldsLabel(def, limit) {
|
|
108
|
-
if (
|
|
107
|
+
if (def?.seriesType === "radar") return "\u7EF4\u5EA6\u5B57\u6BB5\uFF08\u6BCF\u4E2A\u5B57\u6BB5\u4E00\u4E2A\u7EF4\u5EA6\uFF09";
|
|
109
108
|
return limit === 1 ? "\u6570\u503C\u5B57\u6BB5" : "\u6570\u503C\u5B57\u6BB5\uFF08\u591A\u503C\u591A\u7CFB\u5217\uFF09";
|
|
110
109
|
}
|
|
111
110
|
function dataSourceCandidates(data) {
|
|
112
|
-
const first = data
|
|
111
|
+
const first = data?.[0];
|
|
113
112
|
if (!first) return [];
|
|
114
113
|
return Object.keys(first).filter((key) => Array.isArray(first[key]));
|
|
115
114
|
}
|
|
@@ -123,28 +122,26 @@ function syncValueFields(ctx, type, nextFields) {
|
|
|
123
122
|
const next = syncSeriesCount(panelOption(ctx.element), nextFields.length, type);
|
|
124
123
|
const series = Array.isArray(next.series) ? next.series : [];
|
|
125
124
|
series.forEach((item, index) => {
|
|
126
|
-
|
|
127
|
-
const name = (_a = nextFields[index]) == null ? void 0 : _a.trim();
|
|
125
|
+
const name = nextFields[index]?.trim();
|
|
128
126
|
if (name) item.name = name;
|
|
129
127
|
});
|
|
130
128
|
commitOption(ctx, type, next, { chartValueFields: nextFields });
|
|
131
129
|
}
|
|
132
130
|
function renderCanvas(ctx) {
|
|
133
|
-
var _a, _b, _c;
|
|
134
131
|
const element = ctx.element;
|
|
135
132
|
const type = elementType(element);
|
|
136
133
|
const options = element.options;
|
|
137
134
|
const widthMm = Number(options.width) || 0;
|
|
138
135
|
const heightMm = Number(options.height) || 0;
|
|
139
136
|
try {
|
|
140
|
-
const preview = previewChartOption(type,
|
|
137
|
+
const preview = previewChartOption(type, rawChartOption(element) ?? createDefaultChartOption(type));
|
|
141
138
|
const option = normalizeChartOption(type, preview);
|
|
142
139
|
if (!option || typeof option !== "object" || Array.isArray(option)) throw new Error("\u56FE\u8868 option \u975E\u6CD5\uFF1A\u9700\u8981\u5BF9\u8C61");
|
|
143
140
|
const fontFamily = typeof options.fontFamily === "string" && options.fontFamily ? options.fontFamily : void 0;
|
|
144
141
|
const svg = renderChartToSvg({ key: element.id, type, option, widthMm, heightMm, fontFamily });
|
|
145
142
|
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${svg}</div>`;
|
|
146
|
-
} catch
|
|
147
|
-
const title = typeof options.title === "string" && options.title.trim() ? options.title :
|
|
143
|
+
} catch {
|
|
144
|
+
const title = typeof options.title === "string" && options.title.trim() ? options.title : getChartKindDefinition(type)?.label ?? "\u56FE\u8868";
|
|
148
145
|
return `<div class="echarts-canvas-element" style="${CANVAS_STYLE}">${escapeHtml(title)}</div>`;
|
|
149
146
|
}
|
|
150
147
|
}
|
|
@@ -182,7 +179,6 @@ function checkboxField(labelText, checked, onCommit) {
|
|
|
182
179
|
return wrap;
|
|
183
180
|
}
|
|
184
181
|
function renderProperty(ctx) {
|
|
185
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
186
182
|
const element = ctx.element;
|
|
187
183
|
const type = elementType(element);
|
|
188
184
|
const def = getChartKindDefinition(type);
|
|
@@ -213,9 +209,9 @@ function renderProperty(ctx) {
|
|
|
213
209
|
wrap.appendChild(
|
|
214
210
|
textInput(
|
|
215
211
|
{
|
|
216
|
-
value: String(
|
|
212
|
+
value: String(options.chartDataSource ?? ""),
|
|
217
213
|
placeholder: "\u6570\u636E\u96C6\u8DEF\u5F84\uFF08\u7559\u7A7A\u53D6\u9876\u5C42\u7B2C\u4E00\u4E2A\u6570\u7EC4\uFF09",
|
|
218
|
-
list: datalist
|
|
214
|
+
list: datalist?.id
|
|
219
215
|
},
|
|
220
216
|
(value) => commitOption(ctx, type, panelOption(element), { chartDataSource: value })
|
|
221
217
|
)
|
|
@@ -227,7 +223,7 @@ function renderProperty(ctx) {
|
|
|
227
223
|
const wrap = field("\u7C7B\u76EE\u5B57\u6BB5");
|
|
228
224
|
wrap.appendChild(
|
|
229
225
|
textInput(
|
|
230
|
-
{ value: String(
|
|
226
|
+
{ value: String(options.chartCategoryField ?? ""), placeholder: "\u5982 name" },
|
|
231
227
|
(value) => commitOption(ctx, type, panelOption(element), { chartCategoryField: value })
|
|
232
228
|
)
|
|
233
229
|
);
|
|
@@ -269,7 +265,7 @@ function renderProperty(ctx) {
|
|
|
269
265
|
const wrap = field("\u7CFB\u5217\u62C6\u5206\u5B57\u6BB5");
|
|
270
266
|
wrap.appendChild(
|
|
271
267
|
textInput(
|
|
272
|
-
{ value: String(
|
|
268
|
+
{ value: String(options.chartSeriesField ?? ""), placeholder: "\u53EF\u9009\uFF0C\u5982 region\uFF08\u6309\u503C\u62C6\u6210\u591A\u7CFB\u5217\uFF09" },
|
|
273
269
|
(value) => commitOption(ctx, type, panelOption(element), { chartSeriesField: value })
|
|
274
270
|
)
|
|
275
271
|
);
|
|
@@ -286,7 +282,7 @@ function renderProperty(ctx) {
|
|
|
286
282
|
const wrap = field("\u56FE\u8868\u6807\u9898");
|
|
287
283
|
wrap.appendChild(
|
|
288
284
|
textInput(
|
|
289
|
-
{ value: String(
|
|
285
|
+
{ value: String(asObject(panelOption(element).title).text ?? ""), placeholder: "\u7559\u7A7A\u4E0D\u663E\u793A\u6807\u9898" },
|
|
290
286
|
(value) => {
|
|
291
287
|
const next = panelOption(element);
|
|
292
288
|
next.title = { ...asObject(next.title), text: value };
|
|
@@ -317,8 +313,7 @@ function renderProperty(ctx) {
|
|
|
317
313
|
}
|
|
318
314
|
select.value = readPaletteKey(panelOption(element), palettes);
|
|
319
315
|
select.addEventListener("change", () => {
|
|
320
|
-
|
|
321
|
-
const palette = (_a2 = palettes.find((item) => item.key === select.value)) != null ? _a2 : palettes[0];
|
|
316
|
+
const palette = palettes.find((item) => item.key === select.value) ?? palettes[0];
|
|
322
317
|
const next = panelOption(element);
|
|
323
318
|
next.color = [...palette.colors];
|
|
324
319
|
commitOption(ctx, type, next);
|
|
@@ -342,8 +337,8 @@ function renderProperty(ctx) {
|
|
|
342
337
|
}
|
|
343
338
|
if (has("innerRadius")) {
|
|
344
339
|
const wrap = field("\u5185\u5F84\uFF08%\uFF09");
|
|
345
|
-
const radius =
|
|
346
|
-
const inner = Array.isArray(radius) ? Number(String(
|
|
340
|
+
const radius = seriesList(panelOption(element))[0]?.radius;
|
|
341
|
+
const inner = Array.isArray(radius) ? Number(String(radius[0] ?? "40%").replace("%", "")) || 40 : 40;
|
|
347
342
|
wrap.appendChild(
|
|
348
343
|
textInput({ value: String(inner), type: "number", min: 0, max: 90 }, (value) => {
|
|
349
344
|
const next = panelOption(element);
|
|
@@ -397,7 +392,7 @@ function renderProperty(ctx) {
|
|
|
397
392
|
const series = seriesList(panelOption(element));
|
|
398
393
|
const row = el("div", "echarts-field-row");
|
|
399
394
|
row.appendChild(
|
|
400
|
-
textInput({ value: String(Number(
|
|
395
|
+
textInput({ value: String(Number(series[0]?.min ?? 0)), type: "number" }, (value) => {
|
|
401
396
|
const next = panelOption(element);
|
|
402
397
|
const list = seriesList(next);
|
|
403
398
|
if (list[0]) list[0].min = Number(value) || 0;
|
|
@@ -405,7 +400,7 @@ function renderProperty(ctx) {
|
|
|
405
400
|
})
|
|
406
401
|
);
|
|
407
402
|
row.appendChild(
|
|
408
|
-
textInput({ value: String(Number(
|
|
403
|
+
textInput({ value: String(Number(series[0]?.max ?? 100)), type: "number" }, (value) => {
|
|
409
404
|
const next = panelOption(element);
|
|
410
405
|
const list = seriesList(next);
|
|
411
406
|
if (list[0]) list[0].max = Number(value) || 100;
|
|
@@ -429,12 +424,12 @@ var CHART_ELEMENT_UI = defineElementUI({
|
|
|
429
424
|
});
|
|
430
425
|
var disposeHandle;
|
|
431
426
|
function installChartCommonUI() {
|
|
432
|
-
disposeHandle
|
|
427
|
+
disposeHandle?.();
|
|
433
428
|
disposeHandle = registerElementUI(CHART_ELEMENT_UI);
|
|
434
429
|
return disposeHandle;
|
|
435
430
|
}
|
|
436
431
|
function uninstallChartCommonUI() {
|
|
437
|
-
disposeHandle
|
|
432
|
+
disposeHandle?.();
|
|
438
433
|
disposeHandle = void 0;
|
|
439
434
|
}
|
|
440
435
|
installChartCommonUI();
|
package/dist/units.d.ts
CHANGED
package/dist/version.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worm-print-platform/echarts",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "兼容镜像包:源码唯一真源在 marketplace/plugins/echarts(@worm-print-platform/plugin-echarts),本包由同一源码生成,保留原包名与子路径供存量依赖方零改动使用",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"svg"
|
|
56
56
|
],
|
|
57
57
|
"scripts": {
|
|
58
|
-
"dev": "
|
|
59
|
-
"build": "
|
|
60
|
-
"test": "
|
|
61
|
-
"test:watch": "
|
|
58
|
+
"dev": "npm --prefix ../../marketplace/plugins/echarts run dev",
|
|
59
|
+
"build": "npm --prefix ../../marketplace/plugins/echarts run build",
|
|
60
|
+
"test": "npm --prefix ../../marketplace/plugins/echarts test",
|
|
61
|
+
"test:watch": "npm --prefix ../../marketplace/plugins/echarts run test:watch"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@worm-print-platform/core": "^1.5.
|
|
65
|
-
"@worm-print-platform/plugin-kit": "^1.5.
|
|
64
|
+
"@worm-print-platform/core": "^1.5.3",
|
|
65
|
+
"@worm-print-platform/plugin-kit": "^1.5.3",
|
|
66
66
|
"echarts": "^6.1.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|