@carto/ps-react-ui 4.17.3 → 4.18.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/category-Ct2BzADB.js +753 -0
- package/dist/category-Ct2BzADB.js.map +1 -0
- package/dist/change-column-Bhcxmp-r.js +1148 -0
- package/dist/change-column-Bhcxmp-r.js.map +1 -0
- package/dist/echart-B10dhEaM.js +262 -0
- package/dist/echart-B10dhEaM.js.map +1 -0
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +15 -5
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -2
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +6 -1
- package/dist/types/widgets-v2/category/style.d.ts +8 -0
- package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +10 -4
- package/dist/types/widgets-v2/histogram/index.d.ts +1 -1
- package/dist/types/widgets-v2/histogram/transforms.d.ts +11 -0
- package/dist/types/widgets-v2/histogram/types.d.ts +9 -0
- package/dist/types/widgets-v2/scatterplot/index.d.ts +1 -1
- package/dist/types/widgets-v2/scatterplot/transforms.d.ts +9 -0
- package/dist/types/widgets-v2/table/index.d.ts +1 -0
- package/dist/types/widgets-v2/table/transforms.d.ts +13 -0
- package/dist/types/widgets-v2/table/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/index.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/transforms.d.ts +10 -0
- package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +1 -0
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2/category.js +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/echart.js.map +1 -1
- package/dist/widgets-v2/histogram.js +181 -158
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/pie.js +155 -116
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +91 -85
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/table.js +55 -45
- package/dist/widgets-v2/table.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +96 -85
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +4 -4
- package/package.json +1 -1
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +62 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +45 -13
- package/src/widgets-v2/category/category-ui.test.tsx +55 -0
- package/src/widgets-v2/category/category-ui.tsx +65 -6
- package/src/widgets-v2/category/components/category-legend.test.tsx +53 -2
- package/src/widgets-v2/category/components/category-legend.tsx +55 -12
- package/src/widgets-v2/category/components/category-row-stacked.test.tsx +7 -3
- package/src/widgets-v2/category/components/category-row-stacked.tsx +8 -3
- package/src/widgets-v2/category/style.ts +10 -2
- package/src/widgets-v2/echart/echart-ui.test.tsx +25 -0
- package/src/widgets-v2/echart/echart-ui.tsx +20 -0
- package/src/widgets-v2/echart/use-chart-selection.test.tsx +3 -1
- package/src/widgets-v2/echart/use-chart-selection.ts +10 -4
- package/src/widgets-v2/histogram/index.ts +4 -1
- package/src/widgets-v2/histogram/options.test.ts +86 -0
- package/src/widgets-v2/histogram/options.ts +50 -0
- package/src/widgets-v2/histogram/transforms.test.ts +36 -1
- package/src/widgets-v2/histogram/transforms.ts +23 -0
- package/src/widgets-v2/histogram/types.ts +9 -0
- package/src/widgets-v2/pie/options.test.ts +262 -0
- package/src/widgets-v2/pie/options.ts +80 -5
- package/src/widgets-v2/scatterplot/index.ts +4 -1
- package/src/widgets-v2/scatterplot/transforms.test.ts +38 -1
- package/src/widgets-v2/scatterplot/transforms.ts +23 -0
- package/src/widgets-v2/table/index.ts +1 -0
- package/src/widgets-v2/table/transforms.test.ts +40 -0
- package/src/widgets-v2/table/transforms.ts +26 -0
- package/src/widgets-v2/timeseries/index.ts +1 -0
- package/src/widgets-v2/timeseries/transforms.test.ts +49 -0
- package/src/widgets-v2/timeseries/transforms.ts +31 -0
- package/dist/category-CGS_eHr4.js +0 -719
- package/dist/category-CGS_eHr4.js.map +0 -1
- package/dist/change-column-CiVAjOUB.js +0 -1143
- package/dist/change-column-CiVAjOUB.js.map +0 -1
- package/dist/echart-Bdvbfx9s.js +0 -250
- package/dist/echart-Bdvbfx9s.js.map +0 -1
package/dist/widgets-v2/pie.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { g as
|
|
3
|
-
import { jsx as x, jsxs as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Skeleton as
|
|
1
|
+
import * as _ from "echarts";
|
|
2
|
+
import { g as E, d as $, i as P, c as z, f as M, n as N } from "../option-builders-DPeoyQaM.js";
|
|
3
|
+
import { jsx as x, jsxs as j } from "react/jsx-runtime";
|
|
4
|
+
import { c as H } from "react/compiler-runtime";
|
|
5
|
+
import { Skeleton as L, Box as I } from "@mui/material";
|
|
6
6
|
import "../widget-store-Bw5zRUGg.js";
|
|
7
7
|
import "zustand/shallow";
|
|
8
8
|
import "@mui/icons-material";
|
|
@@ -15,23 +15,23 @@ import "@dnd-kit/core";
|
|
|
15
15
|
import "@dnd-kit/sortable";
|
|
16
16
|
import "@dnd-kit/utilities";
|
|
17
17
|
import "react-dom";
|
|
18
|
-
import { m as
|
|
18
|
+
import { m as V, r as B } from "../resolve-theme-color-BdojIw0K.js";
|
|
19
19
|
import "../widget-context-DTGO0Yta.js";
|
|
20
20
|
import "zustand";
|
|
21
21
|
import "zustand/vanilla";
|
|
22
22
|
import "zustand/middleware";
|
|
23
23
|
import "zustand/react/shallow";
|
|
24
|
-
import { b as
|
|
25
|
-
import { b as
|
|
26
|
-
const
|
|
27
|
-
function
|
|
24
|
+
import { b as R } from "../png-item-9dNbB37T.js";
|
|
25
|
+
import { b as W } from "../csv-item-hH_Gt7ur.js";
|
|
26
|
+
const G = ["58%", "74%"];
|
|
27
|
+
function U({
|
|
28
28
|
theme: e,
|
|
29
29
|
formatter: r,
|
|
30
30
|
labelFormatter: t
|
|
31
31
|
}) {
|
|
32
32
|
return {
|
|
33
33
|
legend: {
|
|
34
|
-
|
|
34
|
+
...$({
|
|
35
35
|
hasLegend: !0,
|
|
36
36
|
labelFormatter: t
|
|
37
37
|
}),
|
|
@@ -44,7 +44,14 @@ function H({
|
|
|
44
44
|
// 3–6 category case.
|
|
45
45
|
left: "center",
|
|
46
46
|
type: "scroll",
|
|
47
|
-
itemGap: 16
|
|
47
|
+
itemGap: 16,
|
|
48
|
+
// The legend is presentational only here — the pie has its own
|
|
49
|
+
// click-to-select affordance on the slices themselves, so legend
|
|
50
|
+
// clicks toggling series visibility would be a second, redundant/
|
|
51
|
+
// conflicting interaction model. Hover-highlight is disabled per
|
|
52
|
+
// series via `legendHoverLink` (ECharts has no legend-level knob
|
|
53
|
+
// for it).
|
|
54
|
+
selectedMode: !1
|
|
48
55
|
},
|
|
49
56
|
tooltip: {
|
|
50
57
|
// Pie uses item-trigger (no axis); the rest of the styling mirrors
|
|
@@ -60,8 +67,8 @@ function H({
|
|
|
60
67
|
fontSize: 11,
|
|
61
68
|
fontFamily: e.typography.caption.fontFamily
|
|
62
69
|
},
|
|
63
|
-
position:
|
|
64
|
-
formatter:
|
|
70
|
+
position: E(e),
|
|
71
|
+
formatter: D(r, t)
|
|
65
72
|
},
|
|
66
73
|
// V1 used `qualitative.bold` only (no `secondary.main` prefix) because
|
|
67
74
|
// pie slices are categorical — each slice deserves a distinct palette
|
|
@@ -75,6 +82,7 @@ function H({
|
|
|
75
82
|
colorBy: "data",
|
|
76
83
|
avoidLabelOverlap: !0,
|
|
77
84
|
selectedOffset: 0,
|
|
85
|
+
legendHoverLink: !1,
|
|
78
86
|
emphasis: {
|
|
79
87
|
disabled: !0
|
|
80
88
|
},
|
|
@@ -101,59 +109,66 @@ function H({
|
|
|
101
109
|
}]
|
|
102
110
|
};
|
|
103
111
|
}
|
|
104
|
-
function
|
|
112
|
+
function we(e) {
|
|
105
113
|
const {
|
|
106
114
|
theme: r,
|
|
107
115
|
formatter: t,
|
|
108
116
|
labelFormatter: a,
|
|
109
117
|
optionsOverride: o,
|
|
110
118
|
series: n
|
|
111
|
-
} = e,
|
|
112
|
-
return (d,
|
|
119
|
+
} = e, u = e.radius ?? G, c = e.selection, y = c == null || c.length === 0 ? null : new Set(c);
|
|
120
|
+
return (d, p, b) => {
|
|
113
121
|
if (d == null) {
|
|
114
|
-
const h =
|
|
122
|
+
const h = U({
|
|
115
123
|
theme: r,
|
|
116
124
|
formatter: t,
|
|
117
125
|
labelFormatter: a
|
|
118
126
|
});
|
|
119
|
-
return o ?
|
|
127
|
+
return o ? V(h, o) : h;
|
|
120
128
|
}
|
|
121
|
-
const
|
|
122
|
-
return
|
|
129
|
+
const g = Array.isArray(p) ? p : [];
|
|
130
|
+
return g.length === 0 ? {
|
|
123
131
|
...d,
|
|
124
132
|
dataset: [],
|
|
125
133
|
series: []
|
|
126
|
-
} :
|
|
134
|
+
} : g.length > 1 ? q(d, g, r, n, b, y) : Z(d, g, u, n, b, y);
|
|
127
135
|
};
|
|
128
136
|
}
|
|
129
|
-
function
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
if (!n) return
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
},
|
|
137
|
+
function Z(e, r, t, a, o, n) {
|
|
138
|
+
const u = Array.isArray(e.series) ? e.series : [], c = u[0] ?? {}, y = typeof e.tooltip == "object" && !Array.isArray(e.tooltip) ? e.tooltip : {}, d = typeof e.legend == "object" && !Array.isArray(e.legend) ? e.legend : {}, p = o?.formatter, b = o?.labelFormatter, g = Array.isArray(e.color) ? e.color : [], h = (i) => (g.length > 0 ? g[i.dataIndex % g.length] : void 0) ?? i.color, k = (i) => {
|
|
139
|
+
const s = h(i);
|
|
140
|
+
if (!n) return s;
|
|
141
|
+
const f = i.value?.name ?? i.name;
|
|
142
|
+
return f != null && n.has(f) ? s : _.color.modifyAlpha(s, 0.15);
|
|
143
|
+
}, l = r[0] ?? [];
|
|
144
|
+
let m, S = -1 / 0;
|
|
145
|
+
for (const i of l)
|
|
146
|
+
n && !n.has(i.name) || typeof i.value == "number" && i.value > S && (S = i.value, m = i.name);
|
|
147
|
+
const A = (i) => {
|
|
136
148
|
const {
|
|
137
|
-
name:
|
|
138
|
-
} = i
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
return
|
|
149
|
+
name: s
|
|
150
|
+
} = i;
|
|
151
|
+
if (s == null || s !== m) return "";
|
|
152
|
+
const w = i.encode?.value?.[0];
|
|
153
|
+
if (w === void 0) return "";
|
|
154
|
+
const f = Object.values(i.data ?? {}).at(w), C = typeof f == "number" ? p ? p(f) : String(f) : typeof f == "string" ? f : "", F = String(b ? b(s ?? "") : s ?? "");
|
|
155
|
+
return `{c|${C}}
|
|
142
156
|
|
|
143
|
-
{b|${
|
|
157
|
+
{b|${F}}`;
|
|
144
158
|
};
|
|
145
159
|
return {
|
|
146
160
|
...e,
|
|
147
161
|
dataset: r.map((i) => ({
|
|
148
162
|
source: i
|
|
149
163
|
})),
|
|
150
|
-
series: r.map((i,
|
|
151
|
-
const
|
|
164
|
+
series: r.map((i, s) => {
|
|
165
|
+
const w = u[s] ?? c, f = typeof w == "object" ? w : {}, C = f.label ?? {}, F = f.itemStyle ?? {};
|
|
152
166
|
return {
|
|
153
|
-
...
|
|
167
|
+
...f,
|
|
154
168
|
type: "pie",
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
legendHoverLink: !1,
|
|
170
|
+
datasetIndex: s,
|
|
171
|
+
name: a?.[s]?.name ?? `Series ${s + 1}`,
|
|
157
172
|
radius: [...t],
|
|
158
173
|
// Lift the donut up so the bottom-anchored legend has the
|
|
159
174
|
// vertical real estate to wrap to multiple rows for long
|
|
@@ -166,67 +181,83 @@ function W(e, r, t, a, o, n) {
|
|
|
166
181
|
value: "value"
|
|
167
182
|
},
|
|
168
183
|
label: {
|
|
169
|
-
...
|
|
170
|
-
formatter:
|
|
184
|
+
...C,
|
|
185
|
+
formatter: A
|
|
171
186
|
},
|
|
172
187
|
itemStyle: {
|
|
173
|
-
...
|
|
174
|
-
color:
|
|
188
|
+
...F,
|
|
189
|
+
color: k
|
|
175
190
|
}
|
|
176
191
|
};
|
|
177
192
|
}),
|
|
178
193
|
// Legend always shows for pie (mirrors v1) — slice names drive the
|
|
179
194
|
// entries, so even a single donut benefits from a category list.
|
|
195
|
+
//
|
|
196
|
+
// Exclusion is conveyed purely via `colorFn`/`labelTextFormatter`
|
|
197
|
+
// dimming above, never via the legend's `selected` map: for a pie
|
|
198
|
+
// series, ECharts treats `legend.selected[name] = false` as "remove
|
|
199
|
+
// this data point," which recomputes every remaining slice's angle —
|
|
200
|
+
// the excluded slice disappears instead of rendering dimmed. Forcing
|
|
201
|
+
// every name to `true` on every render also overrides ECharts' own
|
|
202
|
+
// internal toggle state from a native legend click (which flips a
|
|
203
|
+
// name to `false` and hides it before our `legendselectchanged`
|
|
204
|
+
// handler gets a chance to react), so a legend click never leaves a
|
|
205
|
+
// slice structurally removed — only the color/label dimming reflects
|
|
206
|
+
// exclusion, and it stays in sync with the slice itself since both
|
|
207
|
+
// read `selectionSet` on the same render.
|
|
180
208
|
legend: {
|
|
181
209
|
...d,
|
|
182
|
-
show: !0
|
|
210
|
+
show: !0,
|
|
211
|
+
selectedMode: !1,
|
|
212
|
+
selected: Object.fromEntries((r[0] ?? []).map((i) => [String(i.name), !0]))
|
|
183
213
|
},
|
|
184
214
|
tooltip: {
|
|
185
|
-
...
|
|
186
|
-
formatter:
|
|
215
|
+
...y,
|
|
216
|
+
formatter: D(p, b)
|
|
187
217
|
}
|
|
188
218
|
};
|
|
189
219
|
}
|
|
190
|
-
function
|
|
191
|
-
const
|
|
220
|
+
function q(e, r, t, a, o, n) {
|
|
221
|
+
const u = typeof e.tooltip == "object" && !Array.isArray(e.tooltip) ? e.tooltip : {}, c = typeof e.legend == "object" && !Array.isArray(e.legend) ? e.legend : {}, y = typeof e.grid == "object" && !Array.isArray(e.grid) ? e.grid : {}, d = o?.formatter, p = o?.labelFormatter, {
|
|
192
222
|
niceMinVal: b,
|
|
193
|
-
niceMaxVal:
|
|
194
|
-
} =
|
|
195
|
-
const
|
|
196
|
-
if (!n) return
|
|
197
|
-
const
|
|
198
|
-
return
|
|
223
|
+
niceMaxVal: g
|
|
224
|
+
} = K(r), h = Array.isArray(e.color) ? e.color : [], k = (l) => {
|
|
225
|
+
const m = l.seriesIndex ?? 0, A = (h.length > 0 ? h[m % h.length] : void 0) ?? l.color;
|
|
226
|
+
if (!n) return A;
|
|
227
|
+
const s = l.value?.name ?? l.name;
|
|
228
|
+
return s != null && n.has(s) ? A : _.color.modifyAlpha(A, 0.15);
|
|
199
229
|
};
|
|
200
230
|
return {
|
|
201
231
|
...e,
|
|
202
|
-
dataset: r.map((
|
|
203
|
-
source:
|
|
232
|
+
dataset: r.map((l) => ({
|
|
233
|
+
source: l
|
|
204
234
|
})),
|
|
205
235
|
grid: {
|
|
206
|
-
...
|
|
207
|
-
|
|
236
|
+
...y,
|
|
237
|
+
...z(!0, t),
|
|
208
238
|
right: parseInt(t.spacing(4)),
|
|
209
239
|
containLabel: !0
|
|
210
240
|
},
|
|
211
241
|
// Drop pie-specific structural keys that shouldn't render in the
|
|
212
242
|
// bar fallback. ECharts ignores undefined keys, so this is a clean
|
|
213
243
|
// override.
|
|
214
|
-
series: r.map((
|
|
215
|
-
const
|
|
244
|
+
series: r.map((l, m) => {
|
|
245
|
+
const S = B(t, a?.[m]?.color);
|
|
216
246
|
return {
|
|
217
|
-
datasetIndex:
|
|
247
|
+
datasetIndex: m,
|
|
218
248
|
type: "bar",
|
|
219
|
-
name: a?.[
|
|
249
|
+
name: a?.[m]?.name ?? `Series ${m + 1}`,
|
|
220
250
|
barMaxWidth: 100,
|
|
251
|
+
legendHoverLink: !1,
|
|
221
252
|
emphasis: {
|
|
222
253
|
focus: "series"
|
|
223
254
|
},
|
|
224
255
|
...P(d, "x"),
|
|
225
256
|
itemStyle: {
|
|
226
|
-
color:
|
|
257
|
+
color: k
|
|
227
258
|
},
|
|
228
|
-
...
|
|
229
|
-
color:
|
|
259
|
+
...S ? {
|
|
260
|
+
color: S
|
|
230
261
|
} : {}
|
|
231
262
|
};
|
|
232
263
|
}),
|
|
@@ -235,7 +266,7 @@ function G(e, r, t, a, o, n) {
|
|
|
235
266
|
// Closures over the pre-computed nice bounds — ECharts calls them
|
|
236
267
|
// once per render to resolve the axis extents.
|
|
237
268
|
min: () => b,
|
|
238
|
-
max: () =>
|
|
269
|
+
max: () => g,
|
|
239
270
|
axisLine: {
|
|
240
271
|
show: !1
|
|
241
272
|
},
|
|
@@ -262,7 +293,7 @@ function G(e, r, t, a, o, n) {
|
|
|
262
293
|
margin: parseInt(t.spacing(1)),
|
|
263
294
|
showMaxLabel: !0,
|
|
264
295
|
showMinLabel: !0,
|
|
265
|
-
formatter: (
|
|
296
|
+
formatter: (l) => l !== g && l !== b || l === 0 ? "" : d ? d(l) : String(l)
|
|
266
297
|
}
|
|
267
298
|
},
|
|
268
299
|
yAxis: {
|
|
@@ -275,55 +306,63 @@ function G(e, r, t, a, o, n) {
|
|
|
275
306
|
},
|
|
276
307
|
axisLabel: {
|
|
277
308
|
padding: [parseInt(t.spacing(0.5)), 0, 0, 0],
|
|
278
|
-
...
|
|
279
|
-
formatter: (
|
|
309
|
+
...p && {
|
|
310
|
+
formatter: (l) => String(p(l))
|
|
280
311
|
}
|
|
281
312
|
}
|
|
282
313
|
},
|
|
314
|
+
// Mirrors the donut branch's `selected` reset above — `selectedMode:
|
|
315
|
+
// false` blocks the native legend click that would otherwise undo an
|
|
316
|
+
// ECharts-internal toggle, so without forcing every entry back to
|
|
317
|
+
// `true` here a prior native toggle (from before `selectedMode` took
|
|
318
|
+
// effect, or a stale `keepAlive` instance) would stay hidden forever
|
|
319
|
+
// with no way to restore it.
|
|
283
320
|
legend: {
|
|
284
|
-
...
|
|
285
|
-
show: !0
|
|
321
|
+
...c,
|
|
322
|
+
show: !0,
|
|
323
|
+
selectedMode: !1,
|
|
324
|
+
selected: Object.fromEntries(r.map((l, m) => [a?.[m]?.name ?? `Series ${m + 1}`, !0]))
|
|
286
325
|
},
|
|
287
326
|
tooltip: {
|
|
288
|
-
...
|
|
327
|
+
...u,
|
|
289
328
|
trigger: "axis",
|
|
290
|
-
formatter:
|
|
329
|
+
formatter: J(d, p)
|
|
291
330
|
}
|
|
292
331
|
};
|
|
293
332
|
}
|
|
294
|
-
function
|
|
295
|
-
return
|
|
296
|
-
const a = t.encode?.x?.at(0), o = a !== void 0 ? t.dimensionNames?.[a] : void 0, n = t.value && typeof t.value == "object" && !Array.isArray(t.value) ? t.value : void 0,
|
|
333
|
+
function J(e, r) {
|
|
334
|
+
return M((t) => {
|
|
335
|
+
const a = t.encode?.x?.at(0), o = a !== void 0 ? t.dimensionNames?.[a] : void 0, n = t.value && typeof t.value == "object" && !Array.isArray(t.value) ? t.value : void 0, u = o && n ? n[o] : void 0, c = typeof u == "number" && e ? e(u) : u ?? "", y = typeof t.marker == "string" ? t.marker : "", d = t.seriesName ? `${t.seriesName}: ` : "";
|
|
297
336
|
return {
|
|
298
337
|
name: String(r ? r(t.name ?? "") : t.name ?? ""),
|
|
299
338
|
seriesName: d,
|
|
300
|
-
marker:
|
|
301
|
-
value:
|
|
339
|
+
marker: y,
|
|
340
|
+
value: c
|
|
302
341
|
};
|
|
303
342
|
});
|
|
304
343
|
}
|
|
305
|
-
function
|
|
344
|
+
function K(e) {
|
|
306
345
|
let r = 0, t = -1 / 0;
|
|
307
346
|
for (const a of e)
|
|
308
347
|
for (const o of a)
|
|
309
348
|
typeof o?.value != "number" || !Number.isFinite(o.value) || (o.value < r && (r = o.value), o.value > t && (t = o.value));
|
|
310
349
|
return {
|
|
311
|
-
niceMinVal: r < 0 ?
|
|
312
|
-
niceMaxVal: t <= 0 ? 1 :
|
|
350
|
+
niceMinVal: r < 0 ? N(r) : 0,
|
|
351
|
+
niceMaxVal: t <= 0 ? 1 : N(t)
|
|
313
352
|
};
|
|
314
353
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
317
|
-
const a = t.encode?.value?.at(0) ?? 1, n = (t.value && typeof t.value == "object" && !Array.isArray(t.value) ? Object.values(t.value) : [])[a],
|
|
354
|
+
function D(e, r) {
|
|
355
|
+
return M((t) => {
|
|
356
|
+
const a = t.encode?.value?.at(0) ?? 1, n = (t.value && typeof t.value == "object" && !Array.isArray(t.value) ? Object.values(t.value) : [])[a], u = typeof n == "number" && e ? e(n) : n ?? "", c = typeof t.marker == "string" ? t.marker : "", y = t.seriesName ? `${t.seriesName}: ` : "";
|
|
318
357
|
return {
|
|
319
358
|
name: String(r ? r(t.name ?? "") : t.name ?? ""),
|
|
320
|
-
seriesName:
|
|
321
|
-
marker:
|
|
322
|
-
value:
|
|
359
|
+
seriesName: y,
|
|
360
|
+
marker: c,
|
|
361
|
+
value: u
|
|
323
362
|
};
|
|
324
363
|
});
|
|
325
364
|
}
|
|
326
|
-
const
|
|
365
|
+
const O = 160, T = 96, v = {
|
|
327
366
|
root: {
|
|
328
367
|
display: "flex",
|
|
329
368
|
flexDirection: "column",
|
|
@@ -342,14 +381,14 @@ const L = 160, k = 96, v = {
|
|
|
342
381
|
justifyContent: "center"
|
|
343
382
|
},
|
|
344
383
|
ring: {
|
|
345
|
-
width:
|
|
346
|
-
height:
|
|
384
|
+
width: O,
|
|
385
|
+
height: O
|
|
347
386
|
},
|
|
348
387
|
hole: {
|
|
349
388
|
position: "absolute",
|
|
350
389
|
zIndex: 1,
|
|
351
|
-
width:
|
|
352
|
-
height:
|
|
390
|
+
width: T,
|
|
391
|
+
height: T,
|
|
353
392
|
borderRadius: "50%",
|
|
354
393
|
bgcolor: "background.paper"
|
|
355
394
|
},
|
|
@@ -379,55 +418,55 @@ const L = 160, k = 96, v = {
|
|
|
379
418
|
}) => e(1.5)
|
|
380
419
|
}
|
|
381
420
|
};
|
|
382
|
-
function
|
|
383
|
-
const r =
|
|
421
|
+
function Ie(e) {
|
|
422
|
+
const r = H(4);
|
|
384
423
|
let t, a;
|
|
385
|
-
r[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ x(
|
|
424
|
+
r[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ x(L, { variant: "circular", sx: v.ring }), a = /* @__PURE__ */ x(I, { sx: v.hole }), r[0] = t, r[1] = a) : (t = r[0], a = r[1]);
|
|
386
425
|
let o;
|
|
387
|
-
r[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */
|
|
426
|
+
r[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ j(I, { sx: v.donut, children: [
|
|
388
427
|
t,
|
|
389
428
|
a,
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */ x(
|
|
392
|
-
/* @__PURE__ */ x(
|
|
429
|
+
/* @__PURE__ */ j(I, { sx: v.label, children: [
|
|
430
|
+
/* @__PURE__ */ x(L, { width: 56, height: 18 }),
|
|
431
|
+
/* @__PURE__ */ x(L, { width: 36, height: 8 })
|
|
393
432
|
] })
|
|
394
433
|
] }), r[2] = o) : o = r[2];
|
|
395
434
|
let n;
|
|
396
|
-
return r[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
435
|
+
return r[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ j(I, { sx: v.root, children: [
|
|
397
436
|
o,
|
|
398
|
-
/* @__PURE__ */ x(
|
|
437
|
+
/* @__PURE__ */ x(I, { sx: v.legend, children: [0, 1].map(Q) })
|
|
399
438
|
] }), r[3] = n) : n = r[3], n;
|
|
400
439
|
}
|
|
401
|
-
function
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */ x(
|
|
404
|
-
/* @__PURE__ */ x(
|
|
440
|
+
function Q(e) {
|
|
441
|
+
return /* @__PURE__ */ j(I, { sx: v.legendItem, children: [
|
|
442
|
+
/* @__PURE__ */ x(L, { variant: "circular", width: 8, height: 8 }),
|
|
443
|
+
/* @__PURE__ */ x(L, { width: 48, height: 8 })
|
|
405
444
|
] }, `legend-${e}`);
|
|
406
445
|
}
|
|
407
|
-
function
|
|
446
|
+
function Ae(e) {
|
|
408
447
|
const r = [];
|
|
409
|
-
return e.getCaptureEl && r.push(
|
|
448
|
+
return e.getCaptureEl && r.push(R({
|
|
410
449
|
filename: e.filename,
|
|
411
450
|
getCaptureEl: e.getCaptureEl,
|
|
412
451
|
pixelRatio: e.pngPixelRatio,
|
|
413
452
|
backgroundColor: e.pngBackgroundColor
|
|
414
|
-
})), r.push(
|
|
453
|
+
})), r.push(W({
|
|
415
454
|
filename: e.filename,
|
|
416
455
|
getRows: () => {
|
|
417
456
|
const t = e.getData(), a = [["series", "name", "value"]];
|
|
418
457
|
for (const [o, n] of t.entries()) {
|
|
419
|
-
const
|
|
420
|
-
for (const
|
|
421
|
-
a.push([
|
|
458
|
+
const u = e.seriesNames?.[o] ?? `series_${o + 1}`;
|
|
459
|
+
for (const c of n)
|
|
460
|
+
a.push([u, c.name, c.value]);
|
|
422
461
|
}
|
|
423
462
|
return a;
|
|
424
463
|
}
|
|
425
464
|
})), r;
|
|
426
465
|
}
|
|
427
466
|
export {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
467
|
+
Ie as PieSkeleton,
|
|
468
|
+
Ae as createPieDownloadConfig,
|
|
469
|
+
we as createPieOptionFactory,
|
|
470
|
+
U as pieOptions
|
|
432
471
|
};
|
|
433
472
|
//# sourceMappingURL=pie.js.map
|