@worm-print-platform/echarts 1.6.3 → 1.6.5

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.6.3
2
+ * @worm-print-platform/echarts v1.6.5
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
@@ -143,11 +143,11 @@ const p = ["left", "top", "width", "height", "chartOption"], T = ["dataSource",
143
143
  notes: "仪表盘:取首行数据的首个数值字段作指针值;min/max 由面板写入 series[0].min/max",
144
144
  notesKey: "echarts.notes.gauge"
145
145
  }
146
- ], lt = H.map((e) => e.type);
146
+ ], ct = H.map((e) => e.type);
147
147
  function b(e) {
148
148
  return H.find((t) => t.type === e);
149
149
  }
150
- function ct(e) {
150
+ function ut(e) {
151
151
  return b(e)?.fields ?? [];
152
152
  }
153
153
  function Ae(e) {
@@ -181,7 +181,7 @@ function Se(e, t) {
181
181
  function B(e) {
182
182
  return typeof e == "string" && e.length > 0 ? e : void 0;
183
183
  }
184
- function xe(e) {
184
+ function Ce(e) {
185
185
  return Array.isArray(e) ? e.filter((t) => typeof t == "string" && t.length > 0) : [];
186
186
  }
187
187
  function K(e) {
@@ -197,7 +197,7 @@ function U(e, t) {
197
197
  i && typeof i == "object" && Array.isArray(i.data) && i.data.includes("$data") && (i.data = [...t]);
198
198
  }
199
199
  }
200
- function Ce(e, t, r, a, s) {
200
+ function xe(e, t, r, a, s) {
201
201
  const i = K(e);
202
202
  if (!i.some(S)) return;
203
203
  const o = t.map((c, u) => r ? c[r] : u + 1), l = (c) => a[Math.min(c, a.length - 1)];
@@ -270,7 +270,7 @@ function Oe(e, t, r) {
270
270
  function ke(e, t, r) {
271
271
  const a = t.chartOption;
272
272
  if (!a || typeof a != "object" || Array.isArray(a)) return {};
273
- const s = P(a, r), i = xe(t.chartValueFields);
273
+ const s = P(a, r), i = Ce(t.chartValueFields);
274
274
  if (i.length === 0) return { _chartOption: s };
275
275
  const o = Se(t, r);
276
276
  if (o.length === 0) return { _chartOption: s };
@@ -292,7 +292,7 @@ function ke(e, t, r) {
292
292
  Ke(s, o, l, i, t.chartBubble === !0);
293
293
  break;
294
294
  default:
295
- Ce(s, o, l, i, B(t.chartSeriesField));
295
+ xe(s, o, l, i, B(t.chartSeriesField));
296
296
  break;
297
297
  }
298
298
  return { _chartOption: s };
@@ -369,13 +369,13 @@ function Ne(e) {
369
369
  }
370
370
  }
371
371
  }
372
- function ut(e) {
372
+ function ft(e) {
373
373
  re(_, e);
374
374
  }
375
375
  function N() {
376
376
  return te(_);
377
377
  }
378
- function ft() {
378
+ function dt() {
379
379
  const e = N().palettes ?? {}, t = G.map((a) => {
380
380
  const s = e[a.key];
381
381
  return s ? { key: a.key, label: s.label ?? a.label, labelKey: s.label ? void 0 : a.labelKey, colors: s.colors } : { key: a.key, label: a.label, labelKey: a.labelKey, colors: a.colors };
@@ -394,8 +394,8 @@ function Pe(e, t) {
394
394
  title: a?.label ?? "图表",
395
395
  chartOption: Ne(e),
396
396
  chartDataSource: "",
397
- chartCategoryField: "name",
398
- chartValueFields: ["value"],
397
+ chartCategoryField: "",
398
+ chartValueFields: [],
399
399
  chartSeriesField: "",
400
400
  ...t
401
401
  };
@@ -424,7 +424,7 @@ function De() {
424
424
  }
425
425
  }
426
426
  const Me = 96 / 25.4;
427
- function x(e) {
427
+ function C(e) {
428
428
  const t = Number.isFinite(e) ? e : 0;
429
429
  return Math.max(1, Math.round(t * Me));
430
430
  }
@@ -436,7 +436,7 @@ function v(e) {
436
436
  return e;
437
437
  }
438
438
  }
439
- function dt(e, t) {
439
+ function yt(e, t) {
440
440
  if (!t || typeof t != "object" || Array.isArray(t)) return {};
441
441
  const r = v(t), a = b(e), s = [...Re()], i = [...He], o = Array.isArray(r.series) ? r.series : [], l = (c) => {
442
442
  for (const u of o)
@@ -473,14 +473,14 @@ function dt(e, t) {
473
473
  }
474
474
  return r;
475
475
  }
476
- function yt(e, t) {
476
+ function bt(e, t) {
477
477
  const r = Array.isArray(e?.color) ? (e?.color).map(String) : [];
478
478
  return t.find((s) => s.colors.every((i, o) => i === r[o]) && r.length === s.colors.length)?.key ?? "default";
479
479
  }
480
480
  function Q(e) {
481
481
  return Array.isArray(e) ? e[0] && typeof e[0] == "object" ? { ...e[0] } : {} : e && typeof e == "object" ? { ...e } : {};
482
482
  }
483
- function bt(e, t, r) {
483
+ function ht(e, t, r) {
484
484
  const a = v(e), s = Array.isArray(a.series) ? a.series : [], i = b(r), o = s[0] ?? { type: i?.seriesType === "line" ? "line" : "bar", data: ["$data"] };
485
485
  return a.series = Array.from({ length: Math.max(t, 1) }, (l, n) => ({
486
486
  ...o,
@@ -502,15 +502,15 @@ function k(e, t, r) {
502
502
  function Z(e, t, r) {
503
503
  return Math.min(r, Math.max(t, e));
504
504
  }
505
- function C(e) {
505
+ function x(e) {
506
506
  return `${Z(R(e), 0, 100)}%`;
507
507
  }
508
508
  function $e(e) {
509
509
  const r = (Array.isArray(e.series) ? e.series : [])[0];
510
510
  return r && typeof r == "object" ? r : {};
511
511
  }
512
- function ht(e, t, r) {
513
- const s = $e(e && typeof e == "object" ? e : {}), i = x(t), o = x(r);
512
+ function pt(e, t, r) {
513
+ const s = $e(e && typeof e == "object" ? e : {}), i = C(t), o = C(r);
514
514
  return {
515
515
  top: k(s.top, o, O.top),
516
516
  right: k(s.right, i, O.right),
@@ -518,30 +518,30 @@ function ht(e, t, r) {
518
518
  left: k(s.left, i, O.left)
519
519
  };
520
520
  }
521
- function pt(e, t) {
521
+ function mt(e, t) {
522
522
  const r = v(e), a = Array.isArray(r.series) ? r.series : [];
523
523
  a.length === 0 && a.push({ type: "funnel", data: ["$data"] });
524
524
  const s = a[0];
525
- return s.top = C(t.top), s.right = C(t.right), s.bottom = C(t.bottom), s.left = C(t.left), r.series = a, r;
525
+ return s.top = x(t.top), s.right = x(t.right), s.bottom = x(t.bottom), s.left = x(t.left), r.series = a, r;
526
526
  }
527
- function mt(e, t, r) {
528
- const s = Q((e && typeof e == "object" ? e : {}).radar).radius, i = Array.isArray(s) ? s[s.length - 1] : s, o = x(t), l = x(r), n = Math.min(o, l) / 2;
527
+ function gt(e, t, r) {
528
+ const s = Q((e && typeof e == "object" ? e : {}).radar).radius, i = Array.isArray(s) ? s[s.length - 1] : s, o = C(t), l = C(r), n = Math.min(o, l) / 2;
529
529
  if (typeof i == "string" && i.trim().endsWith("%")) {
530
530
  const c = Number.parseFloat(i);
531
531
  if (Number.isFinite(c)) return R(c);
532
532
  }
533
533
  return typeof i == "number" && Number.isFinite(i) ? D(i, n) : we;
534
534
  }
535
- function gt(e, t) {
535
+ function At(e, t) {
536
536
  const r = v(e);
537
- return r.radar = { ...Q(r.radar), radius: C(Z(t, 20, 100)) }, r;
537
+ return r.radar = { ...Q(r.radar), radius: x(Z(t, 20, 100)) }, r;
538
538
  }
539
- const At = [
539
+ const St = [
540
540
  { key: "value", label: "数值", labelKey: "echarts.label.formatter.value", formatter: "{c}" },
541
541
  { key: "name-value", label: "名称: 数值", labelKey: "echarts.label.formatter.nameValue", formatter: "{b}: {c}" },
542
542
  { key: "name", label: "名称", labelKey: "echarts.label.formatter.name", formatter: "{b}" },
543
543
  { key: "percent", label: "百分比", labelKey: "echarts.label.formatter.percent", formatter: "{d}%" }
544
- ], St = {
544
+ ], Ct = {
545
545
  bar: [
546
546
  { value: "top", label: "顶部", labelKey: "echarts.label.position.bar.top" },
547
547
  { value: "inside", label: "内部", labelKey: "echarts.label.position.bar.inside" },
@@ -721,7 +721,7 @@ function xt(e) {
721
721
  const t = b(e);
722
722
  return t ? je[t.seriesType] : [];
723
723
  }
724
- function Ct(e, t) {
724
+ function Kt(e, t) {
725
725
  const r = b(t), a = Ue(e), s = L(a[0]?.[z(t)]);
726
726
  $(s);
727
727
  const i = {
@@ -743,7 +743,7 @@ function qe(e) {
743
743
  function X(e) {
744
744
  return e == null || e === "";
745
745
  }
746
- function Kt(e, t, r) {
746
+ function vt(e, t, r) {
747
747
  const a = v(e ?? {}), s = Array.isArray(a.series) ? a.series : [];
748
748
  if (!b(t) || s.length === 0) return a;
749
749
  const o = z(t), { enabled: l, labelLine: n, ...c } = r;
@@ -821,7 +821,7 @@ function Qe(e) {
821
821
  const t = Xe(e.type, e.option);
822
822
  if (!t || typeof t != "object" || Array.isArray(t))
823
823
  throw new Error("图表 option 非法:需要对象");
824
- const r = x(e.widthMm), a = x(e.heightMm), s = M.init(null, null, { renderer: "svg", ssr: !0, width: r, height: a });
824
+ const r = C(e.widthMm), a = C(e.heightMm), s = M.init(null, null, { renderer: "svg", ssr: !0, width: r, height: a });
825
825
  try {
826
826
  const i = t.textStyle && typeof t.textStyle == "object" && !Array.isArray(t.textStyle) ? t.textStyle : void 0, o = {
827
827
  ...e.fontFamily ? { fontFamily: e.fontFamily } : {},
@@ -855,16 +855,30 @@ function J(e) {
855
855
  return r;
856
856
  }
857
857
  }
858
- const et = "2", ee = {
859
- chartOption: { kind: "object", label: A("echarts.meta.chartOption") },
860
- chartDataSource: { kind: "text", label: A("echarts.meta.dataSource") },
861
- chartCategoryField: { kind: "text", label: A("echarts.meta.categoryField") },
862
- chartValueFields: { kind: "object", label: A("echarts.meta.valueFields") },
863
- chartSeriesField: { kind: "text", label: A("echarts.meta.seriesField") }
864
- }, tt = {
865
- ...ee,
866
- chartBubble: { kind: "bool", label: A("echarts.meta.bubbleSize") }
867
- }, E = ae({
858
+ const et = "2";
859
+ function ee(e = !1) {
860
+ return {
861
+ chartOption: { kind: "object", get label() {
862
+ return A("echarts.meta.chartOption");
863
+ } },
864
+ chartDataSource: { kind: "text", get label() {
865
+ return A("echarts.meta.dataSource");
866
+ } },
867
+ chartCategoryField: { kind: "text", get label() {
868
+ return A("echarts.meta.categoryField");
869
+ } },
870
+ chartValueFields: { kind: "object", get label() {
871
+ return A("echarts.meta.valueFields");
872
+ } },
873
+ chartSeriesField: { kind: "text", get label() {
874
+ return A("echarts.meta.seriesField");
875
+ } },
876
+ ...e ? { chartBubble: { kind: "bool", get label() {
877
+ return A("echarts.meta.bubbleSize");
878
+ } } } : {}
879
+ };
880
+ }
881
+ const tt = ee(), rt = ee(!0), E = ae({
868
882
  id: _,
869
883
  version: et,
870
884
  kinds: H.map((e) => ({
@@ -880,7 +894,7 @@ const et = "2", ee = {
880
894
  get notes() {
881
895
  return A(e.notesKey);
882
896
  },
883
- optionMeta: e.type === "scatterChart" ? tt : ee,
897
+ optionMeta: e.type === "scatterChart" ? rt : tt,
884
898
  defaultOptions: (t) => Pe(e.type, t),
885
899
  binding: { bind: (t, r) => ke(e.type, t, r) }
886
900
  })),
@@ -903,33 +917,33 @@ function I(e, t) {
903
917
  }, s = j(a);
904
918
  return w = s, s;
905
919
  }
906
- function vt(e) {
920
+ function Tt(e) {
907
921
  return I(e);
908
922
  }
909
- function Tt(e) {
923
+ function Ot(e) {
910
924
  return I(void 0, { executorBundle: e });
911
925
  }
912
- function Ot() {
926
+ function kt() {
913
927
  w?.(), w = void 0;
914
928
  }
915
929
  I();
916
930
  export {
917
- mt as A,
918
- vt as B,
919
- lt as C,
920
- Tt as D,
931
+ gt as A,
932
+ Tt as B,
933
+ ct as C,
934
+ Ot as D,
921
935
  O as E,
922
936
  Fe as F,
923
937
  I as G,
924
938
  J as H,
925
939
  Qe as I,
926
- ct as J,
927
- bt as K,
928
- St as L,
929
- Ot as M,
930
- Kt as N,
931
- pt as O,
932
- gt as P,
940
+ ut as J,
941
+ ht as K,
942
+ Ct as L,
943
+ kt as M,
944
+ vt as N,
945
+ mt as O,
946
+ At as P,
933
947
  Le as R,
934
948
  H as a,
935
949
  G as b,
@@ -937,24 +951,24 @@ export {
937
951
  _ as d,
938
952
  we as e,
939
953
  Ee as f,
940
- At as g,
954
+ St as g,
941
955
  Q as h,
942
956
  ke as i,
943
957
  Pe as j,
944
958
  v as k,
945
- ut as l,
959
+ ft as l,
946
960
  Ne as m,
947
961
  Je as n,
948
962
  b as o,
949
- ft as p,
963
+ dt as p,
950
964
  N as q,
951
965
  Re as r,
952
966
  xt as s,
953
967
  z as t,
954
- x as u,
968
+ C as u,
955
969
  Xe as v,
956
- dt as w,
957
- Ct as x,
958
- ht as y,
959
- yt as z
970
+ yt as w,
971
+ Kt as x,
972
+ pt as y,
973
+ bt as z
960
974
  };
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.6.3
2
+ * @worm-print-platform/echarts v1.6.5
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.6.3
2
+ * @worm-print-platform/echarts v1.6.5
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.6.3
2
+ * @worm-print-platform/echarts v1.6.5
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/echarts v1.6.3
2
+ * @worm-print-platform/echarts v1.6.5
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