@iyulab/u-widgets 0.6.2 → 0.7.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.
@@ -16,7 +16,7 @@ declare type FieldType = 'text' | 'email' | 'password' | 'tel' | 'url' | 'textar
16
16
  */
17
17
  export declare function toEChartsOption(spec: UWidgetSpec): Record<string, unknown>;
18
18
 
19
- export declare class UChart extends LitElement {
19
+ export declare class UwChart extends LitElement {
20
20
  static styles: CSSResult[];
21
21
  spec: UWidgetSpec | null;
22
22
  private _chart;
@@ -1,12 +1,12 @@
1
- import { css as V, LitElement as I, nothing as P, html as E } from "lit";
2
- import { property as R, customElement as T } from "lit/decorators.js";
3
- import { a as D, t as $ } from "./tokens-x1kDxgG8.js";
4
- import * as N from "echarts/core";
5
- import { BarChart as B, LineChart as q, PieChart as G, ScatterChart as H, RadarChart as K, HeatmapChart as U, BoxplotChart as W, FunnelChart as J, TreemapChart as Q } from "echarts/charts";
6
- import { GridComponent as X, TooltipComponent as Y, LegendComponent as Z, RadarComponent as ee, MarkLineComponent as te, VisualMapComponent as re } from "echarts/components";
1
+ import { css as M, LitElement as V, nothing as P, html as E } from "lit";
2
+ import { property as R, customElement as D } from "lit/decorators.js";
3
+ import { a as T, t as $ } from "./tokens-x1kDxgG8.js";
4
+ import * as z from "echarts/core";
5
+ import { BarChart as B, LineChart as q, PieChart as W, ScatterChart as G, RadarChart as H, HeatmapChart as K, BoxplotChart as U, FunnelChart as Y, TreemapChart as J } from "echarts/charts";
6
+ import { GridComponent as Q, TooltipComponent as X, LegendComponent as Z, RadarComponent as ee, MarkLineComponent as te, VisualMapComponent as re } from "echarts/components";
7
7
  import { CanvasRenderer as se } from "echarts/renderers";
8
8
  function ie(e) {
9
- const t = e.widget, i = e.data, r = e.mapping ? D(e.mapping) : void 0, n = e.options ?? {};
9
+ const t = e.widget, i = e.data, r = e.mapping ? T(e.mapping) : void 0, n = e.options ?? {};
10
10
  if (!i) return {};
11
11
  let s;
12
12
  switch (t) {
@@ -41,143 +41,164 @@ function ie(e) {
41
41
  s = fe(i, r);
42
42
  break;
43
43
  case "chart.treemap":
44
- s = he(i);
44
+ s = ye(i);
45
45
  break;
46
46
  default:
47
47
  return {};
48
48
  }
49
- n.legend === !1 && s.legend && (s.legend = { ...s.legend, show: !1 }), n.grid === !1 && (s.xAxis && typeof s.xAxis == "object" && (s.xAxis = { ...s.xAxis, splitLine: { show: !1 } }), s.yAxis && typeof s.yAxis == "object" && (s.yAxis = { ...s.yAxis, splitLine: { show: !1 } })), n.animate === !1 && (s.animation = !1), Array.isArray(n.colors) && n.colors.length > 0 && (s.color = n.colors);
50
- const c = n.echarts;
51
- return c && typeof c == "object" && (s = L(s, c)), s;
49
+ n.legend === !1 && s.legend && (s.legend = { ...s.legend, show: !1 }), n.grid === !1 && (s.xAxis && typeof s.xAxis == "object" && !Array.isArray(s.xAxis) && (s.xAxis = { ...s.xAxis, splitLine: { show: !1 } }), s.yAxis && typeof s.yAxis == "object" && !Array.isArray(s.yAxis) && (s.yAxis = { ...s.yAxis, splitLine: { show: !1 } })), n.animate === !1 && (s.animation = !1), Array.isArray(n.colors) && n.colors.length > 0 && (s.color = n.colors);
50
+ const y = n.echarts;
51
+ return y && typeof y == "object" && (s = L(s, y)), s;
52
52
  }
53
53
  function F(e, t, i, r) {
54
54
  if (!Array.isArray(e)) return {};
55
55
  const n = t?.x ?? C(e), s = t?.y ?? [k(e)].filter(Boolean);
56
56
  if (!n || s.length === 0) return {};
57
- const c = e.map((l) => String(l[n] ?? "")), u = !!r.horizontal, f = Array.isArray(r.series) ? r.series : [], y = s.map((l, x) => {
58
- const o = {
59
- name: l,
57
+ const y = e.map((a) => String(a[n] ?? "")), f = !!r.horizontal, d = Array.isArray(r.series) ? r.series : [], c = s.map((a, o) => {
58
+ const l = {
59
+ name: a,
60
60
  type: i,
61
- data: e.map((h) => h[l] ?? null)
61
+ data: e.map((p) => p[a] ?? null)
62
62
  };
63
- r._area && (o.areaStyle = {}), r.smooth && (o.smooth = !0), r.step && (o.step = r.step === !0 ? "end" : r.step);
64
- const a = f[x];
65
- return a && (a.color && (o.itemStyle = { color: a.color }, o.lineStyle = { ...o.lineStyle ?? {}, color: a.color }), a.lineStyle && (o.lineStyle = { ...o.lineStyle ?? {}, ...a.lineStyle }), a.symbol !== void 0 && (o.symbol = a.symbol), a.label && (o.name = a.label)), o;
66
- }), b = { type: "category", data: c }, p = { type: "value" };
67
- r.histogram && (b.axisTick = { alignWithLabel: !0 }, y.forEach((l) => {
68
- l.barCategoryGap = "0%";
63
+ r._area && (l.areaStyle = {}), r.smooth && (l.smooth = !0), r.step && (l.step = r.step === !0 ? "end" : r.step);
64
+ const u = d[o];
65
+ return u && (u.color && (l.itemStyle = { color: u.color }, l.lineStyle = { ...l.lineStyle ?? {}, color: u.color }), u.lineStyle && (l.lineStyle = { ...l.lineStyle ?? {}, ...u.lineStyle }), u.symbol !== void 0 && (l.symbol = u.symbol), u.label && (l.name = u.label), u.type && (l.type = u.type), u.yAxisIndex !== void 0 && (l.yAxisIndex = u.yAxisIndex)), l;
66
+ }), h = { type: "category", data: y }, m = { type: "value" };
67
+ r.histogram && (h.axisTick = { alignWithLabel: !0 }, c.forEach((a) => {
68
+ a.barCategoryGap = "0%";
69
69
  }));
70
- const g = {
71
- xAxis: u ? p : b,
72
- yAxis: u ? b : p,
73
- series: y,
70
+ const x = !f && c.some((a) => a.yAxisIndex >= 1);
71
+ let b;
72
+ if (x) {
73
+ const a = Array.isArray(r.yAxis) && r.yAxis.length >= 2 ? r.yAxis[1] : { type: "value" };
74
+ b = [m, a];
75
+ } else
76
+ b = f ? h : m;
77
+ const A = {
78
+ xAxis: f ? m : h,
79
+ yAxis: b,
80
+ series: c,
74
81
  tooltip: { trigger: "axis" }
75
82
  };
76
83
  if (s.length > 1) {
77
- const l = y.map((x) => x.name);
78
- g.legend = { data: l };
84
+ const a = c.map((o) => o.name);
85
+ A.legend = { data: a };
79
86
  }
80
- r.stack && g.series.forEach((l) => {
81
- l.stack = "total";
87
+ r.stack && A.series.forEach((a) => {
88
+ a.stack = "total";
82
89
  });
83
- const m = r.referenceLines;
84
- return Array.isArray(m) && m.length > 0 && y.length > 0 && (y[0].markLine = {
90
+ const v = r.referenceLines;
91
+ return Array.isArray(v) && v.length > 0 && c.length > 0 && (c[0].markLine = {
85
92
  silent: !0,
86
93
  symbol: "none",
87
- data: m.map((l) => {
88
- const x = {};
89
- l.axis === "x" ? x.xAxis = l.value : x.yAxis = l.value, l.label && (x.name = l.label);
94
+ data: v.map((a) => {
90
95
  const o = {};
91
- return l.color && (o.color = l.color), l.style && (o.type = l.style), Object.keys(o).length > 0 && (x.lineStyle = o), l.label && (x.label = { formatter: l.label, position: "end" }), x;
96
+ a.axis === "x" ? o.xAxis = a.value : o.yAxis = a.value, a.label && (o.name = a.label);
97
+ const l = {};
98
+ return a.color && (l.color = a.color), a.style && (l.type = a.style), Object.keys(l).length > 0 && (o.lineStyle = l), a.label && (o.label = { formatter: a.label, position: "end" }), o;
92
99
  })
93
- }), g;
100
+ }), A;
94
101
  }
95
102
  function ne(e, t, i) {
96
103
  if (!Array.isArray(e)) return {};
97
- const r = j(e), n = t?.x ?? r[0], s = (t?.y ?? [r[1]])[0], c = t?.color, u = t?.size, f = t?.opacity;
104
+ const r = j(e), n = t?.x ?? r[0], s = (t?.y ?? [r[1]])[0], y = t?.color, f = t?.size, d = t?.opacity;
98
105
  if (!n || !s) return {};
99
- const y = {
106
+ const c = {
100
107
  xAxis: { type: "value" },
101
108
  yAxis: { type: "value" },
102
109
  tooltip: { trigger: "item" }
103
110
  };
104
- let b = 1 / 0, p = -1 / 0;
105
- if (f)
106
- for (const o of e) {
107
- const a = Number(o[f] ?? 0);
108
- a < b && (b = a), a > p && (p = a);
111
+ let h = 1 / 0, m = -1 / 0;
112
+ if (d)
113
+ for (const a of e) {
114
+ const o = Number(a[d] ?? 0);
115
+ o < h && (h = o), o > m && (m = o);
109
116
  }
110
- const g = p - b || 1, m = (o) => {
111
- const a = [Number(o[n] ?? 0), Number(o[s] ?? 0)];
112
- if (u && a.push(Number(o[u] ?? 0)), f) {
113
- const S = 0.1 + 0.9 * ((Number(o[f] ?? 0) - b) / g);
114
- return { value: a, itemStyle: { opacity: Math.round(S * 100) / 100 } };
117
+ const x = m - h || 1, b = (a) => {
118
+ const o = [Number(a[n] ?? 0), Number(a[s] ?? 0)];
119
+ if (f && o.push(Number(a[f] ?? 0)), d) {
120
+ const u = 0.1 + 0.9 * ((Number(a[d] ?? 0) - h) / x);
121
+ return { value: o, itemStyle: { opacity: Math.round(u * 100) / 100 } };
115
122
  }
116
- return a;
117
- }, l = u ? (o) => {
118
- const h = (Array.isArray(o) ? o : o.value)[2] ?? 0;
119
- return Math.max(4, Math.min(60, Math.sqrt(h) * 4));
123
+ return o;
124
+ }, A = f ? (a) => {
125
+ const l = (Array.isArray(a) ? a : a.value)[2] ?? 0;
126
+ return Math.max(4, Math.min(60, Math.sqrt(l) * 4));
120
127
  } : void 0;
121
- if (c) {
122
- const o = /* @__PURE__ */ new Map();
123
- for (const h of e) {
124
- const S = String(h[c] ?? "unknown");
125
- o.has(S) || o.set(S, []), o.get(S).push(m(h));
128
+ if (y) {
129
+ const a = /* @__PURE__ */ new Map();
130
+ for (const l of e) {
131
+ const u = String(l[y] ?? "unknown");
132
+ a.has(u) || a.set(u, []), a.get(u).push(b(l));
126
133
  }
127
- const a = [];
128
- for (const [h, S] of o) {
129
- const d = { name: h, type: "scatter", data: S };
130
- l && (d.symbolSize = l), a.push(d);
134
+ const o = [];
135
+ for (const [l, u] of a) {
136
+ const p = { name: l, type: "scatter", data: u };
137
+ A && (p.symbolSize = A), o.push(p);
131
138
  }
132
- y.series = a, y.legend = { data: Array.from(o.keys()) };
139
+ c.series = o, c.legend = { data: Array.from(a.keys()) };
133
140
  } else {
134
- const a = { type: "scatter", data: e.map((h) => m(h)) };
135
- l && (a.symbolSize = l), y.series = [a];
141
+ const o = { type: "scatter", data: e.map((l) => b(l)) };
142
+ A && (o.symbolSize = A), c.series = [o];
136
143
  }
137
- const x = i.referenceLines;
138
- if (Array.isArray(x) && x.length > 0) {
139
- const o = y.series[0];
140
- o.markLine = {
144
+ const v = i.referenceLines;
145
+ if (Array.isArray(v) && v.length > 0) {
146
+ const a = c.series[0];
147
+ a.markLine = {
141
148
  silent: !0,
142
149
  symbol: "none",
143
- data: x.map((a) => {
144
- const h = {};
145
- a.axis === "x" ? h.xAxis = a.value : h.yAxis = a.value, a.label && (h.name = a.label);
146
- const S = {};
147
- return a.color && (S.color = a.color), a.style && (S.type = a.style), Object.keys(S).length > 0 && (h.lineStyle = S), a.label && (h.label = { formatter: a.label, position: "end" }), h;
150
+ data: v.map((o) => {
151
+ const l = {};
152
+ o.axis === "x" ? l.xAxis = o.value : l.yAxis = o.value, o.label && (l.name = o.label);
153
+ const u = {};
154
+ return o.color && (u.color = o.color), o.style && (u.type = o.style), Object.keys(u).length > 0 && (l.lineStyle = u), o.label && (l.label = { formatter: o.label, position: "end" }), l;
148
155
  })
149
156
  };
150
157
  }
151
- return y;
158
+ return c;
152
159
  }
153
160
  function ae(e, t, i) {
154
161
  if (!Array.isArray(e)) return {};
155
162
  const r = t?.label ?? C(e), n = t?.value ?? k(e);
156
163
  if (!r || !n) return {};
157
- const s = e.map((f) => ({
158
- name: String(f[r] ?? ""),
159
- value: Number(f[n] ?? 0)
160
- })), u = {
164
+ const s = e.map((h) => ({
165
+ name: String(h[r] ?? ""),
166
+ value: Number(h[n] ?? 0)
167
+ })), f = {
161
168
  type: "pie",
162
169
  radius: i.donut ? ["40%", "70%"] : "50%",
163
170
  data: s,
164
171
  label: { overflow: "truncate", width: 80 }
165
172
  };
166
- return i.showLabel === !1 && (u.label = { show: !1 }), {
173
+ i.showLabel === !1 && (f.label = { show: !1 });
174
+ const d = {
167
175
  tooltip: { trigger: "item" },
168
176
  legend: { orient: "vertical", left: "left" },
169
- series: [u]
170
- };
177
+ series: [f]
178
+ }, c = i.center;
179
+ if (i.donut && c && (c.label || c.value)) {
180
+ const h = [];
181
+ c.label && h.push({
182
+ type: "text",
183
+ top: c.value ? -16 : 0,
184
+ style: { text: c.label, fontSize: 13, fill: "#999", textAlign: "center" }
185
+ }), c.value && h.push({
186
+ type: "text",
187
+ top: c.label ? 8 : 0,
188
+ style: { text: c.value, fontSize: 20, fontWeight: "bold", fill: "#333", textAlign: "center" }
189
+ }), d.graphic = [{ type: "group", left: "center", top: "middle", children: h }];
190
+ }
191
+ return d;
171
192
  }
172
193
  function oe(e, t, i) {
173
194
  if (!Array.isArray(e)) return {};
174
195
  const r = t?.axis ?? C(e), n = t?.y ?? j(e);
175
196
  if (!r || n.length === 0) return {};
176
- const s = e.map((u) => ({
177
- name: String(u[r] ?? "")
178
- })), c = n.map((u) => ({
179
- name: u,
180
- value: e.map((f) => Number(f[u] ?? 0))
197
+ const s = e.map((f) => ({
198
+ name: String(f[r] ?? "")
199
+ })), y = n.map((f) => ({
200
+ name: f,
201
+ value: e.map((d) => Number(d[f] ?? 0))
181
202
  }));
182
203
  return {
183
204
  tooltip: {},
@@ -186,80 +207,80 @@ function oe(e, t, i) {
186
207
  series: [
187
208
  {
188
209
  type: "radar",
189
- data: c
210
+ data: y
190
211
  }
191
212
  ]
192
213
  };
193
214
  }
194
215
  function le(e, t, i) {
195
216
  if (!Array.isArray(e)) return {};
196
- const r = e[0] ?? {}, n = Object.keys(r), s = n.filter((d) => typeof r[d] == "string"), c = n.filter((d) => typeof r[d] == "number"), u = t?.x ?? s[0], f = t?.y?.[0] ?? s.find((d) => d !== u), y = t?.value ?? c[0];
197
- if (!u || !f || !y) return {};
198
- const b = [], p = [], g = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
199
- for (const d of e) {
200
- const A = String(d[u] ?? ""), w = String(d[f] ?? "");
201
- g.has(A) || (g.add(A), b.push(A)), m.has(w) || (m.add(w), p.push(w));
217
+ const r = e[0] ?? {}, n = Object.keys(r), s = n.filter((p) => typeof r[p] == "string"), y = n.filter((p) => typeof r[p] == "number"), f = t?.x ?? s[0], d = t?.y?.[0] ?? s.find((p) => p !== f), c = t?.value ?? y[0];
218
+ if (!f || !d || !c) return {};
219
+ const h = [], m = [], x = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
220
+ for (const p of e) {
221
+ const g = String(p[f] ?? ""), w = String(p[d] ?? "");
222
+ x.has(g) || (x.add(g), h.push(g)), b.has(w) || (b.add(w), m.push(w));
202
223
  }
203
- const l = /* @__PURE__ */ new Map();
204
- b.forEach((d, A) => l.set(d, A));
205
- const x = /* @__PURE__ */ new Map();
206
- p.forEach((d, A) => x.set(d, A));
207
- const o = [];
208
- let a = 1 / 0, h = -1 / 0;
209
- for (const d of e) {
210
- const A = l.get(String(d[u] ?? "")) ?? 0, w = x.get(String(d[f] ?? "")) ?? 0, v = d[y] != null ? Number(d[y]) : null;
211
- o.push([A, w, v]), v != null && (v < a && (a = v), v > h && (h = v));
224
+ const A = /* @__PURE__ */ new Map();
225
+ h.forEach((p, g) => A.set(p, g));
226
+ const v = /* @__PURE__ */ new Map();
227
+ m.forEach((p, g) => v.set(p, g));
228
+ const a = [];
229
+ let o = 1 / 0, l = -1 / 0;
230
+ for (const p of e) {
231
+ const g = A.get(String(p[f] ?? "")) ?? 0, w = v.get(String(p[d] ?? "")) ?? 0, S = p[c] != null ? Number(p[c]) : null;
232
+ a.push([g, w, S]), S != null && (S < o && (o = S), S > l && (l = S));
212
233
  }
213
- isFinite(a) || (a = 0, h = 1);
214
- const S = i.colorRange ?? ["#313695", "#4575b4", "#74add1", "#abd9e9", "#fee090", "#fdae61", "#f46d43", "#d73027"];
234
+ isFinite(o) || (o = 0, l = 1);
235
+ const u = i.colorRange ?? ["#313695", "#4575b4", "#74add1", "#abd9e9", "#fee090", "#fdae61", "#f46d43", "#d73027"];
215
236
  return {
216
- xAxis: { type: "category", data: b, splitArea: { show: !0 } },
217
- yAxis: { type: "category", data: p, splitArea: { show: !0 } },
237
+ xAxis: { type: "category", data: h, splitArea: { show: !0 } },
238
+ yAxis: { type: "category", data: m, splitArea: { show: !0 } },
218
239
  visualMap: {
219
- min: i.min != null ? Number(i.min) : a,
220
- max: i.max != null ? Number(i.max) : h,
240
+ min: i.min != null ? Number(i.min) : o,
241
+ max: i.max != null ? Number(i.max) : l,
221
242
  calculable: !0,
222
243
  orient: "horizontal",
223
244
  left: "center",
224
245
  bottom: 0,
225
- inRange: { color: S }
246
+ inRange: { color: u }
226
247
  },
227
248
  tooltip: {
228
249
  trigger: "item",
229
- formatter: (d) => {
230
- const A = d.data;
231
- return A ? `${b[A[0]]} × ${p[A[1]]}: ${A[2] != null ? A[2] : "-"}` : "";
250
+ formatter: (p) => {
251
+ const g = p.data;
252
+ return g ? `${h[g[0]]} × ${m[g[1]]}: ${g[2] != null ? g[2] : "-"}` : "";
232
253
  }
233
254
  },
234
255
  grid: { bottom: 60 },
235
256
  series: [{
236
257
  type: "heatmap",
237
- data: o,
258
+ data: a,
238
259
  label: { show: i.showLabel !== !1 }
239
260
  }]
240
261
  };
241
262
  }
242
263
  function ce(e, t, i) {
243
264
  if (!Array.isArray(e) || e.length === 0) return {};
244
- const r = e[0] ?? {}, n = Object.keys(r), s = n.filter((g) => typeof r[g] == "string"), c = n.filter((g) => typeof r[g] == "number"), u = t?.x ?? s[0];
245
- let f;
265
+ const r = e[0] ?? {}, n = Object.keys(r), s = n.filter((x) => typeof r[x] == "string"), y = n.filter((x) => typeof r[x] == "number"), f = t?.x ?? s[0];
266
+ let d;
246
267
  if (t?.y && t.y.length >= 5)
247
- f = t.y.slice(0, 5);
268
+ d = t.y.slice(0, 5);
248
269
  else {
249
- const m = ["min", "q1", "median", "q3", "max"].filter((l) => c.includes(l));
250
- f = m.length === 5 ? m : c.slice(0, 5);
270
+ const b = ["min", "q1", "median", "q3", "max"].filter((A) => y.includes(A));
271
+ d = b.length === 5 ? b : y.slice(0, 5);
251
272
  }
252
- if (f.length < 5) return {};
253
- const y = u ? e.map((g) => String(g[u] ?? "")) : void 0, b = e.map(
254
- (g) => f.map((m) => Number(g[m] ?? 0))
255
- ), p = {
273
+ if (d.length < 5) return {};
274
+ const c = f ? e.map((x) => String(x[f] ?? "")) : void 0, h = e.map(
275
+ (x) => d.map((b) => Number(x[b] ?? 0))
276
+ ), m = {
256
277
  tooltip: { trigger: "item" },
257
278
  series: [{
258
279
  type: "boxplot",
259
- data: b
280
+ data: h
260
281
  }]
261
282
  };
262
- return y ? (p.xAxis = { type: "category", data: y }, p.yAxis = { type: "value" }) : (p.xAxis = { type: "category" }, p.yAxis = { type: "value" }), p;
283
+ return c ? (m.xAxis = { type: "category", data: c }, m.yAxis = { type: "value" }) : (m.xAxis = { type: "category" }, m.yAxis = { type: "value" }), m;
263
284
  }
264
285
  function C(e) {
265
286
  if (e.length === 0) return;
@@ -275,9 +296,9 @@ function ue(e, t, i) {
275
296
  if (!Array.isArray(e)) return {};
276
297
  const r = t?.label ?? C(e), n = t?.value ?? k(e);
277
298
  if (!r || !n) return {};
278
- const s = e.map((c) => ({
279
- name: String(c[r] ?? ""),
280
- value: Number(c[n] ?? 0)
299
+ const s = e.map((y) => ({
300
+ name: String(y[r] ?? ""),
301
+ value: Number(y[n] ?? 0)
281
302
  }));
282
303
  return {
283
304
  tooltip: { trigger: "item", formatter: "{b}: {c} ({d}%)" },
@@ -295,15 +316,15 @@ function fe(e, t, i) {
295
316
  if (!Array.isArray(e)) return {};
296
317
  const r = e, n = t?.x ?? C(r), s = (t?.y ?? [k(r)])[0];
297
318
  if (!n || !s) return {};
298
- const c = [], u = [], f = [], y = [];
299
- let b = 0;
300
- for (const p of r) {
301
- const g = String(p[n] ?? ""), m = Number(p[s] ?? 0);
302
- c.push(g), m >= 0 ? (u.push(b), f.push(m), y.push(null)) : (u.push(b + m), f.push(null), y.push(Math.abs(m))), b += m;
319
+ const y = [], f = [], d = [], c = [];
320
+ let h = 0;
321
+ for (const m of r) {
322
+ const x = String(m[n] ?? ""), b = Number(m[s] ?? 0);
323
+ y.push(x), b >= 0 ? (f.push(h), d.push(b), c.push(null)) : (f.push(h + b), d.push(null), c.push(Math.abs(b))), h += b;
303
324
  }
304
325
  return {
305
326
  tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
306
- xAxis: { type: "category", data: c },
327
+ xAxis: { type: "category", data: y },
307
328
  yAxis: { type: "value" },
308
329
  series: [
309
330
  {
@@ -312,26 +333,26 @@ function fe(e, t, i) {
312
333
  stack: "waterfall",
313
334
  itemStyle: { borderColor: "transparent", color: "transparent" },
314
335
  emphasis: { itemStyle: { borderColor: "transparent", color: "transparent" } },
315
- data: u
336
+ data: f
316
337
  },
317
338
  {
318
339
  name: "Positive",
319
340
  type: "bar",
320
341
  stack: "waterfall",
321
- data: f
342
+ data: d
322
343
  },
323
344
  {
324
345
  name: "Negative",
325
346
  type: "bar",
326
347
  stack: "waterfall",
327
- data: y
348
+ data: c
328
349
  }
329
350
  ]
330
351
  };
331
352
  }
332
- function he(e, t) {
353
+ function ye(e, t) {
333
354
  if (!Array.isArray(e)) return {};
334
- const i = e.map((r) => z(r));
355
+ const i = e.map((r) => N(r));
335
356
  return {
336
357
  tooltip: { trigger: "item" },
337
358
  series: [{
@@ -343,12 +364,12 @@ function he(e, t) {
343
364
  }]
344
365
  };
345
366
  }
346
- function z(e) {
367
+ function N(e) {
347
368
  const t = {
348
369
  name: String(e.name ?? ""),
349
370
  value: Number(e.value ?? 0)
350
371
  };
351
- return Array.isArray(e.children) && (t.children = e.children.map((i) => z(i))), t;
372
+ return Array.isArray(e.children) && (t.children = e.children.map((i) => N(i))), t;
352
373
  }
353
374
  function j(e) {
354
375
  if (e.length === 0) return [];
@@ -366,30 +387,30 @@ function L(e, t) {
366
387
  function O(e) {
367
388
  return e != null && typeof e == "object" && !Array.isArray(e);
368
389
  }
369
- var ye = Object.defineProperty, de = Object.getOwnPropertyDescriptor, M = (e, t, i, r) => {
370
- for (var n = r > 1 ? void 0 : r ? de(t, i) : t, s = e.length - 1, c; s >= 0; s--)
371
- (c = e[s]) && (n = (r ? c(t, i, n) : c(n)) || n);
372
- return r && n && ye(t, i, n), n;
390
+ var he = Object.defineProperty, de = Object.getOwnPropertyDescriptor, I = (e, t, i, r) => {
391
+ for (var n = r > 1 ? void 0 : r ? de(t, i) : t, s = e.length - 1, y; s >= 0; s--)
392
+ (y = e[s]) && (n = (r ? y(t, i, n) : y(n)) || n);
393
+ return r && n && he(t, i, n), n;
373
394
  };
374
- N.use([
395
+ z.use([
375
396
  B,
376
397
  q,
398
+ W,
377
399
  G,
378
400
  H,
379
401
  K,
380
402
  U,
381
- W,
403
+ Y,
382
404
  J,
383
405
  Q,
384
406
  X,
385
- Y,
386
407
  Z,
387
408
  ee,
388
409
  te,
389
410
  re,
390
411
  se
391
412
  ]);
392
- let _ = class extends I {
413
+ let _ = class extends V {
393
414
  constructor() {
394
415
  super(...arguments), this.spec = null, this._chart = null, this._container = null, this._resizeObserver = null;
395
416
  }
@@ -407,11 +428,11 @@ let _ = class extends I {
407
428
  _initChart() {
408
429
  if (!(!this._container || !this.spec))
409
430
  try {
410
- this._chart = N.init(this._container), this._chart.on("click", (e) => {
431
+ this._chart = z.init(this._container), this._chart.on("click", (e) => {
411
432
  this._onChartClick(e);
412
433
  }), this._updateChart();
413
434
  } catch (e) {
414
- console.warn("[u-chart] Failed to initialize ECharts:", e.message);
435
+ console.warn("[uw-chart] Failed to initialize ECharts:", e.message);
415
436
  }
416
437
  }
417
438
  _onChartClick(e) {
@@ -477,10 +498,10 @@ let _ = class extends I {
477
498
  };
478
499
  _.styles = [
479
500
  $,
480
- V`
501
+ M`
481
502
  :host {
482
503
  display: block;
483
- container: u-chart / inline-size;
504
+ container: uw-chart / inline-size;
484
505
  }
485
506
 
486
507
  .chart-container {
@@ -488,21 +509,21 @@ _.styles = [
488
509
  height: var(--u-widget-chart-height, 300px);
489
510
  }
490
511
 
491
- @container u-chart (max-width: 20rem) {
512
+ @container uw-chart (max-width: 20rem) {
492
513
  .chart-container {
493
514
  height: var(--u-widget-chart-height-narrow, 200px);
494
515
  }
495
516
  }
496
517
  `
497
518
  ];
498
- M([
519
+ I([
499
520
  R({ type: Object })
500
521
  ], _.prototype, "spec", 2);
501
- _ = M([
502
- T("u-chart")
522
+ _ = I([
523
+ D("uw-chart")
503
524
  ], _);
504
525
  export {
505
- _ as UChart,
526
+ _ as UwChart,
506
527
  ie as toEChartsOption
507
528
  };
508
529
  //# sourceMappingURL=u-widgets-charts.js.map