@worm-print-platform/echarts 1.5.3 → 1.6.0

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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./plugin-Bf6QDbHO.cjs");t.registerChartPlugin();exports.CHART_KINDS=t.CHART_KINDS;exports.CHART_KIND_DEFINITIONS=t.CHART_KIND_DEFINITIONS;exports.CHART_PALETTES=t.CHART_PALETTES;exports.CHART_PLUGIN=t.CHART_PLUGIN;exports.CHART_PLUGIN_ID=t.CHART_PLUGIN_ID;exports.bindChartData=t.bindChartData;exports.chartFactoryDefaults=t.chartFactoryDefaults;exports.configureChartPlugin=t.configureChartPlugin;exports.createDefaultChartOption=t.createDefaultChartOption;exports.fitSvgRoot=t.fitSvgRoot;exports.getChartKindDefinition=t.getChartKindDefinition;exports.getChartPalettes=t.getChartPalettes;exports.getChartPluginConfig=t.getChartPluginConfig;exports.getSampleCategories=t.getSampleCategories;exports.mmToChartPx=t.mmToChartPx;exports.normalizeChartOption=t.normalizeChartOption;exports.registerChartDesigner=t.registerChartDesigner;exports.registerChartExecutorBundle=t.registerChartExecutorBundle;exports.registerChartPlugin=t.registerChartPlugin;exports.renderChartElement=t.renderChartElement;exports.renderChartToSvg=t.renderChartToSvg;exports.resolveChartPanelFields=t.resolveChartPanelFields;exports.uninstallChartPlugin=t.uninstallChartPlugin;
6
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./plugin-BWmSrZ3m.cjs");t.registerChartPlugin();exports.CHART_KINDS=t.CHART_KINDS;exports.CHART_KIND_DEFINITIONS=t.CHART_KIND_DEFINITIONS;exports.CHART_PALETTES=t.CHART_PALETTES;exports.CHART_PLUGIN=t.CHART_PLUGIN;exports.CHART_PLUGIN_ID=t.CHART_PLUGIN_ID;exports.bindChartData=t.bindChartData;exports.chartFactoryDefaults=t.chartFactoryDefaults;exports.configureChartPlugin=t.configureChartPlugin;exports.createDefaultChartOption=t.createDefaultChartOption;exports.fitSvgRoot=t.fitSvgRoot;exports.getChartKindDefinition=t.getChartKindDefinition;exports.getChartPalettes=t.getChartPalettes;exports.getChartPluginConfig=t.getChartPluginConfig;exports.getSampleCategories=t.getSampleCategories;exports.mmToChartPx=t.mmToChartPx;exports.normalizeChartOption=t.normalizeChartOption;exports.registerChartDesigner=t.registerChartDesigner;exports.registerChartExecutorBundle=t.registerChartExecutorBundle;exports.registerChartPlugin=t.registerChartPlugin;exports.renderChartElement=t.renderChartElement;exports.renderChartToSvg=t.renderChartToSvg;exports.resolveChartPanelFields=t.resolveChartPanelFields;exports.uninstallChartPlugin=t.uninstallChartPlugin;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
- */import { r as a } from "./plugin-CUoE2jMs.js";
7
- import { C as s, a as i, b as C, c as n, d as o, e as g, f as h, g as l, h as u, i as P, j as T, k as f, l as m, m as D, n as I, o as d, p, q as _, s as c, t as A, u as N, v as R } from "./plugin-CUoE2jMs.js";
6
+ */import { G as a } from "./plugin-Dvcrcg_Z.js";
7
+ import { C as s, a as i, b as C, c as n, d as o, i as g, j as l, l as h, m as u, n as D, o as P, p as T, q as m, r as I, u as f, v as d, B as p, D as _, H as c, I as A, J as H, M as N } from "./plugin-Dvcrcg_Z.js";
8
8
  a();
9
9
  export {
10
10
  s as CHART_KINDS,
@@ -13,21 +13,21 @@ export {
13
13
  n as CHART_PLUGIN,
14
14
  o as CHART_PLUGIN_ID,
15
15
  g as bindChartData,
16
- h as chartFactoryDefaults,
17
- l as configureChartPlugin,
16
+ l as chartFactoryDefaults,
17
+ h as configureChartPlugin,
18
18
  u as createDefaultChartOption,
19
- P as fitSvgRoot,
20
- T as getChartKindDefinition,
21
- f as getChartPalettes,
19
+ D as fitSvgRoot,
20
+ P as getChartKindDefinition,
21
+ T as getChartPalettes,
22
22
  m as getChartPluginConfig,
23
- D as getSampleCategories,
24
- I as mmToChartPx,
23
+ I as getSampleCategories,
24
+ f as mmToChartPx,
25
25
  d as normalizeChartOption,
26
26
  p as registerChartDesigner,
27
27
  _ as registerChartExecutorBundle,
28
28
  a as registerChartPlugin,
29
29
  c as renderChartElement,
30
30
  A as renderChartToSvg,
31
- N as resolveChartPanelFields,
32
- R as uninstallChartPlugin
31
+ H as resolveChartPanelFields,
32
+ N as uninstallChartPlugin
33
33
  };
package/dist/kinds.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
- export type ChartFieldKey = 'dataSource' | 'categoryField' | 'valueFields' | 'seriesField' | 'title' | 'legend' | 'palette' | 'stack' | 'bubble' | 'innerRadius' | 'gaugeRange' | 'padding' | 'radius';
7
+ export type ChartFieldKey = 'dataSource' | 'categoryField' | 'valueFields' | 'seriesField' | 'title' | 'legend' | 'palette' | 'stack' | 'bubble' | 'innerRadius' | 'gaugeRange' | 'padding' | 'radius' | 'label';
8
8
  export type ChartSeriesType = 'bar' | 'line' | 'pie' | 'scatter' | 'radar' | 'funnel' | 'gauge';
9
9
  export interface ChartKindDefinition {
10
10
  type: string;
package/dist/kit.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./plugin-Bf6QDbHO.cjs"),m=[12,20,15];function l(r){try{return JSON.parse(JSON.stringify(r))}catch{return r}}function y(r,a){if(!a||typeof a!="object"||Array.isArray(a))return{};const e=l(a),o=t.getChartKindDefinition(r),n=[...t.getSampleCategories()],i=[...m],c=Array.isArray(e.series)?e.series:[],A=s=>{for(const u of c)Array.isArray(u.data)&&u.data.includes("$data")&&(u.data=s(u))},f=()=>{for(const s of["xAxis","yAxis"]){const u=Array.isArray(e[s])?e[s]:e[s]?[e[s]]:[];for(const C of u)C&&Array.isArray(C.data)&&C.data.includes("$data")&&(C.data=[...n])}};switch(o?.seriesType){case"pie":A(()=>n.map((s,u)=>({name:s,value:i[u]??10})));break;case"funnel":A(()=>n.map((s,u)=>({name:s,value:i[u]??10})));break;case"scatter":A(()=>i.map(s=>[s,s+6]));break;case"radar":e.radar={...e.radar??{},indicator:n.map(s=>({name:s,max:30}))},A(()=>[{name:"示例",value:i}]);break;case"gauge":A(()=>[{value:i[0]??40,name:"数量"}]);break;default:A(()=>[...i]),f();break}return e}function S(r,a){const e=Array.isArray(r?.color)?(r?.color).map(String):[];return a.find(n=>n.colors.every((i,c)=>i===e[c])&&e.length===n.colors.length)?.key??"default"}function _(r){return Array.isArray(r)?r[0]&&typeof r[0]=="object"?{...r[0]}:{}:r&&typeof r=="object"?{...r}:{}}function R(r,a,e){const o=l(r),n=Array.isArray(o.series)?o.series:[],i=t.getChartKindDefinition(e),c=n[0]??{type:i?.seriesType==="line"?"line":"bar",data:["$data"]};return o.series=Array.from({length:Math.max(a,1)},(A,f)=>({...c,...n[f]??{},data:["$data"]})),o}const g=r=>Math.round(r*10)/10;function D(r,a){return a>0?g(r/a*100):0}function d(r,a,e){if(typeof r=="string"&&r.trim().endsWith("%")){const o=Number.parseFloat(r);if(Number.isFinite(o))return g(o)}return typeof r=="number"&&Number.isFinite(r)?D(r,a):D(e,a)}function P(r,a,e){return Math.min(e,Math.max(a,r))}function h(r){return`${P(g(r),0,100)}%`}function T(r){const e=(Array.isArray(r.series)?r.series:[])[0];return e&&typeof e=="object"?e:{}}function N(r,a,e){const n=T(r&&typeof r=="object"?r:{}),i=t.mmToChartPx(a),c=t.mmToChartPx(e);return{top:d(n.top,c,t.ECHARTS_FUNNEL_PADDING_PX.top),right:d(n.right,i,t.ECHARTS_FUNNEL_PADDING_PX.right),bottom:d(n.bottom,c,t.ECHARTS_FUNNEL_PADDING_PX.bottom),left:d(n.left,i,t.ECHARTS_FUNNEL_PADDING_PX.left)}}function E(r,a){const e=l(r),o=Array.isArray(e.series)?e.series:[];o.length===0&&o.push({type:"funnel",data:["$data"]});const n=o[0];return n.top=h(a.top),n.right=h(a.right),n.bottom=h(a.bottom),n.left=h(a.left),e.series=o,e}function p(r,a,e){const n=_((r&&typeof r=="object"?r:{}).radar).radius,i=Array.isArray(n)?n[n.length-1]:n,c=t.mmToChartPx(a),A=t.mmToChartPx(e),f=Math.min(c,A)/2;if(typeof i=="string"&&i.trim().endsWith("%")){const s=Number.parseFloat(i);if(Number.isFinite(s))return g(s)}return typeof i=="number"&&Number.isFinite(i)?D(i,f):t.ECHARTS_RADAR_RADIUS_DEFAULT}function F(r,a){const e=l(r);return e.radar={..._(e.radar),radius:h(P(a,20,100))},e}exports.CHART_KINDS=t.CHART_KINDS;exports.CHART_KIND_DEFINITIONS=t.CHART_KIND_DEFINITIONS;exports.CHART_PALETTES=t.CHART_PALETTES;exports.CHART_PLUGIN=t.CHART_PLUGIN;exports.CHART_PLUGIN_ID=t.CHART_PLUGIN_ID;exports.ECHARTS_FUNNEL_PADDING_PX=t.ECHARTS_FUNNEL_PADDING_PX;exports.ECHARTS_RADAR_RADIUS_DEFAULT=t.ECHARTS_RADAR_RADIUS_DEFAULT;exports.FALLBACK_SAMPLE_CATEGORIES=t.FALLBACK_SAMPLE_CATEGORIES;exports.FUNNEL_PADDING_DEFAULTS=t.FUNNEL_PADDING_DEFAULTS;exports.RADAR_RADIUS_DEFAULT=t.RADAR_RADIUS_DEFAULT;exports.bindChartData=t.bindChartData;exports.chartFactoryDefaults=t.chartFactoryDefaults;exports.configureChartPlugin=t.configureChartPlugin;exports.createDefaultChartOption=t.createDefaultChartOption;exports.fitSvgRoot=t.fitSvgRoot;exports.getChartKindDefinition=t.getChartKindDefinition;exports.getChartPalettes=t.getChartPalettes;exports.getChartPluginConfig=t.getChartPluginConfig;exports.getSampleCategories=t.getSampleCategories;exports.mmToChartPx=t.mmToChartPx;exports.normalizeChartOption=t.normalizeChartOption;exports.registerChartDesigner=t.registerChartDesigner;exports.registerChartExecutorBundle=t.registerChartExecutorBundle;exports.registerChartPlugin=t.registerChartPlugin;exports.renderChartElement=t.renderChartElement;exports.renderChartToSvg=t.renderChartToSvg;exports.resolveChartPanelFields=t.resolveChartPanelFields;exports.uninstallChartPlugin=t.uninstallChartPlugin;exports.asObject=_;exports.cloneChartOption=l;exports.previewChartOption=y;exports.readFunnelPadding=N;exports.readPaletteKey=S;exports.readRadarRadius=p;exports.syncSeriesCount=R;exports.writeFunnelPadding=E;exports.writeRadarRadius=F;
6
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./plugin-BWmSrZ3m.cjs");exports.CHART_KINDS=e.CHART_KINDS;exports.CHART_KIND_DEFINITIONS=e.CHART_KIND_DEFINITIONS;exports.CHART_PALETTES=e.CHART_PALETTES;exports.CHART_PLUGIN=e.CHART_PLUGIN;exports.CHART_PLUGIN_ID=e.CHART_PLUGIN_ID;exports.ECHARTS_FUNNEL_PADDING_PX=e.ECHARTS_FUNNEL_PADDING_PX;exports.ECHARTS_RADAR_RADIUS_DEFAULT=e.ECHARTS_RADAR_RADIUS_DEFAULT;exports.FALLBACK_SAMPLE_CATEGORIES=e.FALLBACK_SAMPLE_CATEGORIES;exports.FUNNEL_PADDING_DEFAULTS=e.FUNNEL_PADDING_DEFAULTS;exports.LABEL_POSITIONS=e.LABEL_POSITIONS;exports.LABEL_PRESETS=e.LABEL_PRESETS;exports.RADAR_RADIUS_DEFAULT=e.RADAR_RADIUS_DEFAULT;exports.asObject=e.asObject;exports.bindChartData=e.bindChartData;exports.chartFactoryDefaults=e.chartFactoryDefaults;exports.cloneChartOption=e.cloneChartOption;exports.configureChartPlugin=e.configureChartPlugin;exports.createDefaultChartOption=e.createDefaultChartOption;exports.fitSvgRoot=e.fitSvgRoot;exports.getChartKindDefinition=e.getChartKindDefinition;exports.getChartPalettes=e.getChartPalettes;exports.getChartPluginConfig=e.getChartPluginConfig;exports.getSampleCategories=e.getSampleCategories;exports.labelFieldsOf=e.labelFieldsOf;exports.labelTargetOf=e.labelTargetOf;exports.mmToChartPx=e.mmToChartPx;exports.normalizeChartOption=e.normalizeChartOption;exports.previewChartOption=e.previewChartOption;exports.readChartLabel=e.readChartLabel;exports.readFunnelPadding=e.readFunnelPadding;exports.readPaletteKey=e.readPaletteKey;exports.readRadarRadius=e.readRadarRadius;exports.registerChartDesigner=e.registerChartDesigner;exports.registerChartExecutorBundle=e.registerChartExecutorBundle;exports.registerChartPlugin=e.registerChartPlugin;exports.renderChartElement=e.renderChartElement;exports.renderChartToSvg=e.renderChartToSvg;exports.resolveChartPanelFields=e.resolveChartPanelFields;exports.syncSeriesCount=e.syncSeriesCount;exports.uninstallChartPlugin=e.uninstallChartPlugin;exports.updateChartLabel=e.updateChartLabel;exports.writeFunnelPadding=e.writeFunnelPadding;exports.writeRadarRadius=e.writeRadarRadius;
package/dist/kit.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
@@ -14,6 +14,8 @@ export type { ChartPalette, ChartPaletteDefinition, ChartPluginConfig } from './
14
14
  export { CHART_KINDS, CHART_KIND_DEFINITIONS, getChartKindDefinition, resolveChartPanelFields } from './kinds.js';
15
15
  export type { ChartFieldKey, ChartKindDefinition, ChartSeriesType } from './kinds.js';
16
16
  export { createDefaultChartOption } from './defaults.js';
17
+ export { LABEL_POSITIONS, LABEL_PRESETS, labelFieldsOf, labelTargetOf, readChartLabel, updateChartLabel, } from './label.js';
18
+ export type { ChartLabelPatch, ChartLabelState, LabelFieldKey } from './label.js';
17
19
  export { normalizeChartOption } from './normalize.js';
18
20
  export { bindChartData } from './bind.js';
19
21
  export { fitSvgRoot, mmToChartPx, renderChartElement, renderChartToSvg } from './renderer.js';
package/dist/kit.js CHANGED
@@ -1,154 +1,51 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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
- */import { j as C, m as D, E as l, w as P, n as d } from "./plugin-CUoE2jMs.js";
7
- import { C as O, a as j, b as H, c as M, d as v, F as $, x as G, R as K, e as z, f as B, g as J, h as W, i as q, k as V, l as X, o as Q, p as Y, q as Z, r as rr, s as tr, t as er, u as ar, v as sr } from "./plugin-CUoE2jMs.js";
8
- const x = [12, 20, 15];
9
- function m(r) {
10
- try {
11
- return JSON.parse(JSON.stringify(r));
12
- } catch {
13
- return r;
14
- }
15
- }
16
- function R(r, e) {
17
- if (!e || typeof e != "object" || Array.isArray(e)) return {};
18
- const t = m(e), i = C(r), a = [...D()], s = [...x], o = Array.isArray(t.series) ? t.series : [], u = (n) => {
19
- for (const c of o)
20
- Array.isArray(c.data) && c.data.includes("$data") && (c.data = n(c));
21
- }, f = () => {
22
- for (const n of ["xAxis", "yAxis"]) {
23
- const c = Array.isArray(t[n]) ? t[n] : t[n] ? [t[n]] : [];
24
- for (const h of c)
25
- h && Array.isArray(h.data) && h.data.includes("$data") && (h.data = [...a]);
26
- }
27
- };
28
- switch (i?.seriesType) {
29
- case "pie":
30
- u(() => a.map((n, c) => ({ name: n, value: s[c] ?? 10 })));
31
- break;
32
- case "funnel":
33
- u(() => a.map((n, c) => ({ name: n, value: s[c] ?? 10 })));
34
- break;
35
- case "scatter":
36
- u(() => s.map((n) => [n, n + 6]));
37
- break;
38
- case "radar":
39
- t.radar = {
40
- ...t.radar ?? {},
41
- indicator: a.map((n) => ({ name: n, max: 30 }))
42
- }, u(() => [{ name: "示例", value: s }]);
43
- break;
44
- case "gauge":
45
- u(() => [{ value: s[0] ?? 40, name: "数量" }]);
46
- break;
47
- default:
48
- u(() => [...s]), f();
49
- break;
50
- }
51
- return t;
52
- }
53
- function T(r, e) {
54
- const t = Array.isArray(r?.color) ? (r?.color).map(String) : [];
55
- return e.find((a) => a.colors.every((s, o) => s === t[o]) && t.length === a.colors.length)?.key ?? "default";
56
- }
57
- function b(r) {
58
- return Array.isArray(r) ? r[0] && typeof r[0] == "object" ? { ...r[0] } : {} : r && typeof r == "object" ? { ...r } : {};
59
- }
60
- function E(r, e, t) {
61
- const i = m(r), a = Array.isArray(i.series) ? i.series : [], s = C(t), o = a[0] ?? { type: s?.seriesType === "line" ? "line" : "bar", data: ["$data"] };
62
- return i.series = Array.from({ length: Math.max(e, 1) }, (u, f) => ({
63
- ...o,
64
- ...a[f] ?? {},
65
- data: ["$data"]
66
- })), i;
67
- }
68
- const g = (r) => Math.round(r * 10) / 10;
69
- function p(r, e) {
70
- return e > 0 ? g(r / e * 100) : 0;
71
- }
72
- function y(r, e, t) {
73
- if (typeof r == "string" && r.trim().endsWith("%")) {
74
- const i = Number.parseFloat(r);
75
- if (Number.isFinite(i)) return g(i);
76
- }
77
- return typeof r == "number" && Number.isFinite(r) ? p(r, e) : p(t, e);
78
- }
79
- function S(r, e, t) {
80
- return Math.min(t, Math.max(e, r));
81
- }
82
- function A(r) {
83
- return `${S(g(r), 0, 100)}%`;
84
- }
85
- function _(r) {
86
- const t = (Array.isArray(r.series) ? r.series : [])[0];
87
- return t && typeof t == "object" ? t : {};
88
- }
89
- function F(r, e, t) {
90
- const a = _(r && typeof r == "object" ? r : {}), s = d(e), o = d(t);
91
- return {
92
- top: y(a.top, o, l.top),
93
- right: y(a.right, s, l.right),
94
- bottom: y(a.bottom, o, l.bottom),
95
- left: y(a.left, s, l.left)
96
- };
97
- }
98
- function I(r, e) {
99
- const t = m(r), i = Array.isArray(t.series) ? t.series : [];
100
- i.length === 0 && i.push({ type: "funnel", data: ["$data"] });
101
- const a = i[0];
102
- return a.top = A(e.top), a.right = A(e.right), a.bottom = A(e.bottom), a.left = A(e.left), t.series = i, t;
103
- }
104
- function L(r, e, t) {
105
- const a = b((r && typeof r == "object" ? r : {}).radar).radius, s = Array.isArray(a) ? a[a.length - 1] : a, o = d(e), u = d(t), f = Math.min(o, u) / 2;
106
- if (typeof s == "string" && s.trim().endsWith("%")) {
107
- const n = Number.parseFloat(s);
108
- if (Number.isFinite(n)) return g(n);
109
- }
110
- return typeof s == "number" && Number.isFinite(s) ? p(s, f) : P;
111
- }
112
- function w(r, e) {
113
- const t = m(r);
114
- return t.radar = { ...b(t.radar), radius: A(S(e, 20, 100)) }, t;
115
- }
6
+ */import { C as s, a as t, b as r, c as i, d as n, E as C, e as l, F as A, f as d, L as g, g as h, R as o, h as D, i as R, j as _, k as E, l as P, m as T, n as L, o as S, p as u, q as I, r as N, s as F, t as O, u as f, v as c, w as p, x as U, y as H, z as b, A as m, B as G, D as K, G as v, H as B, I as w, J as x, K as y, M as j, N as z, O as M, P as k } from "./plugin-Dvcrcg_Z.js";
116
7
  export {
117
- O as CHART_KINDS,
118
- j as CHART_KIND_DEFINITIONS,
119
- H as CHART_PALETTES,
120
- M as CHART_PLUGIN,
121
- v as CHART_PLUGIN_ID,
122
- l as ECHARTS_FUNNEL_PADDING_PX,
123
- P as ECHARTS_RADAR_RADIUS_DEFAULT,
124
- $ as FALLBACK_SAMPLE_CATEGORIES,
125
- G as FUNNEL_PADDING_DEFAULTS,
126
- K as RADAR_RADIUS_DEFAULT,
127
- b as asObject,
128
- z as bindChartData,
129
- B as chartFactoryDefaults,
130
- m as cloneChartOption,
131
- J as configureChartPlugin,
132
- W as createDefaultChartOption,
133
- q as fitSvgRoot,
134
- C as getChartKindDefinition,
135
- V as getChartPalettes,
136
- X as getChartPluginConfig,
137
- D as getSampleCategories,
138
- d as mmToChartPx,
139
- Q as normalizeChartOption,
140
- R as previewChartOption,
141
- F as readFunnelPadding,
142
- T as readPaletteKey,
143
- L as readRadarRadius,
144
- Y as registerChartDesigner,
145
- Z as registerChartExecutorBundle,
146
- rr as registerChartPlugin,
147
- tr as renderChartElement,
148
- er as renderChartToSvg,
149
- ar as resolveChartPanelFields,
150
- E as syncSeriesCount,
151
- sr as uninstallChartPlugin,
152
- I as writeFunnelPadding,
153
- w as writeRadarRadius
8
+ s as CHART_KINDS,
9
+ t as CHART_KIND_DEFINITIONS,
10
+ r as CHART_PALETTES,
11
+ i as CHART_PLUGIN,
12
+ n as CHART_PLUGIN_ID,
13
+ C as ECHARTS_FUNNEL_PADDING_PX,
14
+ l as ECHARTS_RADAR_RADIUS_DEFAULT,
15
+ A as FALLBACK_SAMPLE_CATEGORIES,
16
+ d as FUNNEL_PADDING_DEFAULTS,
17
+ g as LABEL_POSITIONS,
18
+ h as LABEL_PRESETS,
19
+ o as RADAR_RADIUS_DEFAULT,
20
+ D as asObject,
21
+ R as bindChartData,
22
+ _ as chartFactoryDefaults,
23
+ E as cloneChartOption,
24
+ P as configureChartPlugin,
25
+ T as createDefaultChartOption,
26
+ L as fitSvgRoot,
27
+ S as getChartKindDefinition,
28
+ u as getChartPalettes,
29
+ I as getChartPluginConfig,
30
+ N as getSampleCategories,
31
+ F as labelFieldsOf,
32
+ O as labelTargetOf,
33
+ f as mmToChartPx,
34
+ c as normalizeChartOption,
35
+ p as previewChartOption,
36
+ U as readChartLabel,
37
+ H as readFunnelPadding,
38
+ b as readPaletteKey,
39
+ m as readRadarRadius,
40
+ G as registerChartDesigner,
41
+ K as registerChartExecutorBundle,
42
+ v as registerChartPlugin,
43
+ B as renderChartElement,
44
+ w as renderChartToSvg,
45
+ x as resolveChartPanelFields,
46
+ y as syncSeriesCount,
47
+ j as uninstallChartPlugin,
48
+ z as updateChartLabel,
49
+ M as writeFunnelPadding,
50
+ k as writeRadarRadius
154
51
  };
@@ -0,0 +1,63 @@
1
+ /*!
2
+ * @worm-print-platform/echarts v1.6.0
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ import type { ChartSeriesType } from './kinds.js';
8
+ export type LabelFieldKey = 'formatter' | 'overflow' | 'position' | 'distance' | 'rotate' | 'offset' | 'fontSize' | 'fontWeight' | 'color' | 'backgroundColor' | 'borderColor' | 'borderWidth' | 'borderRadius' | 'padding' | 'labelLine.show' | 'labelLine.length' | 'labelLine.length2' | 'labelLine.smooth';
9
+ export interface ChartLabelState {
10
+ show: boolean;
11
+ formatter?: string;
12
+ overflow?: string;
13
+ position?: string;
14
+ distance?: number;
15
+ rotate?: number;
16
+ /** ECharts 原生标签偏移 [x, y];旧模板的 offsetX / offsetY 在读取时迁移至此 */
17
+ offset?: [number, number];
18
+ fontSize?: number;
19
+ fontWeight?: string;
20
+ color?: string;
21
+ backgroundColor?: string;
22
+ borderColor?: string;
23
+ borderWidth?: number;
24
+ borderRadius?: number;
25
+ padding?: number;
26
+ labelLine: {
27
+ show?: boolean;
28
+ length?: number;
29
+ length2?: number;
30
+ smooth?: boolean;
31
+ };
32
+ }
33
+ export interface ChartLabelPatch extends Partial<Omit<ChartLabelState, 'labelLine'>> {
34
+ /** 总开关:true 写默认集(只补缺失键),false 只写 show:false */
35
+ enabled?: boolean;
36
+ labelLine?: {
37
+ show?: boolean;
38
+ length?: number | null;
39
+ length2?: number | null;
40
+ smooth?: boolean;
41
+ };
42
+ }
43
+ /** formatter 预设:底层仍是 ECharts 字符串模板,选中即写入 formatter */
44
+ export declare const LABEL_PRESETS: readonly {
45
+ key: string;
46
+ label: string;
47
+ formatter: string;
48
+ }[];
49
+ /** 标签位置候选:按 seriesType 给,ECharts 对不适用项会忽略,面板只做引导 */
50
+ export declare const LABEL_POSITIONS: Readonly<Record<ChartSeriesType, readonly {
51
+ value: string;
52
+ label: string;
53
+ }[]>>;
54
+ /**
55
+ * 把单个 label / detail 上的旧 offsetX / offsetY 迁成 ECharts 原生 offset: [x, y](原地修改)。
56
+ * 旧键来自早期面板误写,ECharts 不识别,必须在读取、写入与出图归一三处统一迁移。
57
+ */
58
+ export declare function normalizeLabelOffsetInPlace(target: Record<string, any>): void;
59
+ /** 仪表盘的数值文本走 series[].detail,其余走 series[].label */
60
+ export declare function labelTargetOf(type: string): 'label' | 'detail';
61
+ export declare function labelFieldsOf(type: string): readonly LabelFieldKey[];
62
+ export declare function readChartLabel(option: Record<string, unknown> | undefined, type: string): ChartLabelState;
63
+ export declare function updateChartLabel(option: Record<string, unknown> | undefined, type: string, patch: ChartLabelPatch): Record<string, unknown>;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.5.3
2
+ * @worm-print-platform/echarts v1.6.0
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