@carto/ps-react-ui 4.12.0 → 4.12.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.
- package/dist/{echart-BMPpj7n_.js → echart-Bdvbfx9s.js} +2 -2
- package/dist/echart-Bdvbfx9s.js.map +1 -0
- package/dist/{option-builders-F-c9ELi1.js → option-builders-DPeoyQaM.js} +41 -33
- package/dist/option-builders-DPeoyQaM.js.map +1 -0
- package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
- package/dist/types/widgets-v2/pie/skeleton.d.ts +9 -0
- package/dist/widgets/bar.js +1 -1
- package/dist/widgets/histogram.js +1 -1
- package/dist/widgets/pie.js +1 -1
- package/dist/widgets/scatterplot.js +5 -5
- package/dist/widgets/timeseries.js +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets-v2/bar.js +64 -64
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/histogram.js +89 -89
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/pie.js +149 -95
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +153 -157
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +74 -74
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +2 -2
- package/package.json +1 -1
- package/src/widgets/utils/chart-config/index.ts +1 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +34 -0
- package/src/widgets/utils/chart-config/option-builders.ts +21 -0
- package/src/widgets-v2/bar/options.ts +3 -2
- package/src/widgets-v2/echart/edge-label-clamp.ts +7 -4
- package/src/widgets-v2/histogram/options.ts +3 -2
- package/src/widgets-v2/pie/skeleton.test.tsx +6 -3
- package/src/widgets-v2/pie/skeleton.tsx +69 -7
- package/src/widgets-v2/scatterplot/options.ts +3 -6
- package/src/widgets-v2/timeseries/options.ts +3 -2
- package/dist/echart-BMPpj7n_.js.map +0 -1
- package/dist/option-builders-F-c9ELi1.js.map +0 -1
- package/dist/types/widgets/utils/chart-config/option-builders.d.ts +0 -124
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { d as
|
|
3
|
-
import { jsx as x, jsxs as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Skeleton as
|
|
1
|
+
import * as H from "echarts";
|
|
2
|
+
import { h as M, d as W, g as q, c as U, n as A, f as Y } from "../option-builders-DPeoyQaM.js";
|
|
3
|
+
import { jsx as x, jsxs as X } from "react/jsx-runtime";
|
|
4
|
+
import { c as J } from "react/compiler-runtime";
|
|
5
|
+
import { Skeleton as L, Box as S } from "@mui/material";
|
|
6
6
|
import "../widget-store-Bw5zRUGg.js";
|
|
7
7
|
import "zustand/shallow";
|
|
8
8
|
import "@mui/icons-material";
|
|
@@ -21,52 +21,52 @@ import "zustand/vanilla";
|
|
|
21
21
|
import "zustand/middleware";
|
|
22
22
|
import "zustand/react/shallow";
|
|
23
23
|
import { Z as b } from "../transforms-Cdx4fkU5.js";
|
|
24
|
-
import { m as
|
|
25
|
-
import { b as
|
|
26
|
-
import { b as
|
|
27
|
-
function
|
|
28
|
-
theme:
|
|
29
|
-
xFormatter:
|
|
24
|
+
import { m as K, r as Q } from "../resolve-theme-color-BdojIw0K.js";
|
|
25
|
+
import { b as V } from "../png-item-9dNbB37T.js";
|
|
26
|
+
import { b as ee } from "../csv-item-hH_Gt7ur.js";
|
|
27
|
+
function te({
|
|
28
|
+
theme: t,
|
|
29
|
+
xFormatter: e,
|
|
30
30
|
yFormatter: r
|
|
31
31
|
}) {
|
|
32
32
|
return {
|
|
33
33
|
grid: {
|
|
34
|
-
left: parseInt(
|
|
35
|
-
top: parseInt(
|
|
36
|
-
right: parseInt(
|
|
34
|
+
left: parseInt(t.spacing(1)),
|
|
35
|
+
top: parseInt(t.spacing(3)),
|
|
36
|
+
right: parseInt(t.spacing(1)),
|
|
37
37
|
// Default: no legend. Merger bumps `bottom` when there are >1 series.
|
|
38
|
-
...
|
|
38
|
+
...U(!1, t),
|
|
39
39
|
containLabel: !0
|
|
40
40
|
},
|
|
41
41
|
tooltip: {
|
|
42
42
|
// Per-point trigger — different from Bar's 'axis' trigger because
|
|
43
43
|
// points don't share an x-coordinate.
|
|
44
44
|
trigger: "item",
|
|
45
|
-
backgroundColor:
|
|
45
|
+
backgroundColor: t.palette.grey[900],
|
|
46
46
|
borderWidth: 0,
|
|
47
|
-
padding: [parseInt(
|
|
47
|
+
padding: [parseInt(t.spacing(1)), parseInt(t.spacing(1))],
|
|
48
48
|
textStyle: {
|
|
49
|
-
color:
|
|
49
|
+
color: t.palette.common.white,
|
|
50
50
|
fontSize: 11,
|
|
51
|
-
fontFamily:
|
|
51
|
+
fontFamily: t.typography.caption.fontFamily
|
|
52
52
|
},
|
|
53
|
-
position:
|
|
54
|
-
formatter: oe(
|
|
53
|
+
position: q(t),
|
|
54
|
+
formatter: oe(e, r)
|
|
55
55
|
},
|
|
56
56
|
// Legend styling baked here; `show` is toggled by the merger based on
|
|
57
57
|
// series count.
|
|
58
58
|
legend: {
|
|
59
|
-
...
|
|
59
|
+
...W({
|
|
60
60
|
hasLegend: !1,
|
|
61
61
|
labelFormatter: void 0
|
|
62
62
|
})
|
|
63
63
|
},
|
|
64
64
|
axisPointer: {
|
|
65
65
|
lineStyle: {
|
|
66
|
-
color:
|
|
66
|
+
color: t.palette.grey[400]
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
color: [
|
|
69
|
+
color: [t.palette.secondary.main, ...Object.values(t.palette.qualitative?.bold ?? {})],
|
|
70
70
|
xAxis: {
|
|
71
71
|
type: "value",
|
|
72
72
|
axisLine: {
|
|
@@ -76,21 +76,19 @@ function ee({
|
|
|
76
76
|
show: !1
|
|
77
77
|
},
|
|
78
78
|
axisLabel: {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
color: e.palette.black?.[60],
|
|
82
|
-
margin: parseInt(e.spacing(1)),
|
|
79
|
+
...M(t),
|
|
80
|
+
margin: parseInt(t.spacing(1)),
|
|
83
81
|
hideOverlap: !0,
|
|
84
82
|
showMinLabel: !0,
|
|
85
83
|
showMaxLabel: !0,
|
|
86
|
-
...
|
|
87
|
-
formatter:
|
|
84
|
+
...e && {
|
|
85
|
+
formatter: e
|
|
88
86
|
}
|
|
89
87
|
},
|
|
90
88
|
splitLine: {
|
|
91
89
|
show: !0,
|
|
92
90
|
lineStyle: {
|
|
93
|
-
color:
|
|
91
|
+
color: t.palette.black?.[4] ?? t.palette.divider
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
94
|
},
|
|
@@ -103,10 +101,8 @@ function ee({
|
|
|
103
101
|
show: !1
|
|
104
102
|
},
|
|
105
103
|
axisLabel: {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
color: e.palette.black?.[60],
|
|
109
|
-
margin: parseInt(e.spacing(1)),
|
|
104
|
+
...M(t),
|
|
105
|
+
margin: parseInt(t.spacing(1)),
|
|
110
106
|
hideOverlap: !0,
|
|
111
107
|
showMinLabel: !0,
|
|
112
108
|
showMaxLabel: !0,
|
|
@@ -117,46 +113,46 @@ function ee({
|
|
|
117
113
|
splitLine: {
|
|
118
114
|
show: !0,
|
|
119
115
|
lineStyle: {
|
|
120
|
-
color:
|
|
116
|
+
color: t.palette.black?.[4] ?? t.palette.divider
|
|
121
117
|
}
|
|
122
118
|
}
|
|
123
119
|
}
|
|
124
120
|
};
|
|
125
121
|
}
|
|
126
|
-
function
|
|
122
|
+
function Oe(t) {
|
|
127
123
|
const {
|
|
128
|
-
theme:
|
|
124
|
+
theme: e,
|
|
129
125
|
xFormatter: r,
|
|
130
|
-
yFormatter:
|
|
131
|
-
optionsOverride:
|
|
132
|
-
} =
|
|
133
|
-
return (n,
|
|
126
|
+
yFormatter: i,
|
|
127
|
+
optionsOverride: o
|
|
128
|
+
} = t, s = t.series, a = t.symbolSize ?? 8, l = t.selection, c = l && l.length > 0 ? new Set(l) : null;
|
|
129
|
+
return (n, p, u) => {
|
|
134
130
|
if (n == null) {
|
|
135
|
-
const d =
|
|
136
|
-
theme:
|
|
131
|
+
const d = te({
|
|
132
|
+
theme: e,
|
|
137
133
|
xFormatter: r,
|
|
138
|
-
yFormatter:
|
|
134
|
+
yFormatter: i
|
|
139
135
|
});
|
|
140
|
-
return
|
|
136
|
+
return o ? K(d, o) : d;
|
|
141
137
|
}
|
|
142
|
-
const f = Array.isArray(
|
|
138
|
+
const f = Array.isArray(p) ? p : [];
|
|
143
139
|
if (f.length === 0)
|
|
144
140
|
return {
|
|
145
141
|
...n,
|
|
146
142
|
dataset: [],
|
|
147
143
|
series: []
|
|
148
144
|
};
|
|
149
|
-
const w = f.length > 1,
|
|
150
|
-
niceMinX:
|
|
151
|
-
niceMaxX:
|
|
152
|
-
niceMinY:
|
|
153
|
-
niceMaxY:
|
|
154
|
-
} =
|
|
145
|
+
const w = f.length > 1, T = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, g = typeof n.grid == "object" && !Array.isArray(n.grid) ? n.grid : {}, k = typeof n.tooltip == "object" && !Array.isArray(n.tooltip) ? n.tooltip : {}, F = typeof n.xAxis == "object" && !Array.isArray(n.xAxis) ? n.xAxis : {}, N = typeof n.yAxis == "object" && !Array.isArray(n.yAxis) ? n.yAxis : {}, I = u?.formatter, {
|
|
146
|
+
niceMinX: j,
|
|
147
|
+
niceMaxX: O,
|
|
148
|
+
niceMinY: _,
|
|
149
|
+
niceMaxY: D
|
|
150
|
+
} = ne(f), R = (d) => (m) => {
|
|
155
151
|
const y = m.color;
|
|
156
152
|
if (!c) return y;
|
|
157
|
-
const
|
|
158
|
-
return c.has(
|
|
159
|
-
}, h =
|
|
153
|
+
const E = `${d}:${m.dataIndex}`;
|
|
154
|
+
return c.has(E) ? y : H.color.modifyAlpha(y, 0.15);
|
|
155
|
+
}, h = re(n.dataZoom, w), B = h?.hasXSlider ?? !1, z = h?.hasYSlider ?? !1, G = typeof g.bottom == "number" ? g.bottom : 24, $ = w ? 56 : G, P = B ? $ + b.sliderHeight + b.sliderGap : $, C = typeof g.right == "number" ? g.right : 8, Z = z ? C + b.sliderHeight + b.sliderGap : C;
|
|
160
156
|
return {
|
|
161
157
|
...n,
|
|
162
158
|
// ECharts dataset.source wants a mutable [number, number][] shape; we
|
|
@@ -165,7 +161,7 @@ function Te(e) {
|
|
|
165
161
|
source: d
|
|
166
162
|
})),
|
|
167
163
|
series: f.map((d, m) => {
|
|
168
|
-
const y =
|
|
164
|
+
const y = Q(e, s?.[m]?.color);
|
|
169
165
|
return {
|
|
170
166
|
type: "scatter",
|
|
171
167
|
datasetIndex: m,
|
|
@@ -179,7 +175,7 @@ function Te(e) {
|
|
|
179
175
|
focus: "series"
|
|
180
176
|
},
|
|
181
177
|
itemStyle: {
|
|
182
|
-
color:
|
|
178
|
+
color: R(m)
|
|
183
179
|
},
|
|
184
180
|
...y ? {
|
|
185
181
|
color: y
|
|
@@ -187,26 +183,26 @@ function Te(e) {
|
|
|
187
183
|
};
|
|
188
184
|
}),
|
|
189
185
|
legend: {
|
|
190
|
-
...
|
|
186
|
+
...T,
|
|
191
187
|
show: w
|
|
192
188
|
},
|
|
193
189
|
grid: {
|
|
194
190
|
...g,
|
|
195
|
-
bottom:
|
|
196
|
-
right:
|
|
191
|
+
bottom: P,
|
|
192
|
+
right: Z
|
|
197
193
|
},
|
|
198
194
|
...h ? {
|
|
199
195
|
dataZoom: h.entries
|
|
200
196
|
} : {},
|
|
201
197
|
xAxis: {
|
|
202
|
-
...
|
|
203
|
-
min:
|
|
204
|
-
max:
|
|
198
|
+
...F,
|
|
199
|
+
min: j,
|
|
200
|
+
max: O
|
|
205
201
|
},
|
|
206
202
|
yAxis: {
|
|
207
203
|
...N,
|
|
208
|
-
min:
|
|
209
|
-
max:
|
|
204
|
+
min: _,
|
|
205
|
+
max: D,
|
|
210
206
|
axisLabel: {
|
|
211
207
|
...N.axisLabel ?? {},
|
|
212
208
|
// Re-derive the y-axis formatter at fusion time so RelativeData's
|
|
@@ -214,52 +210,52 @@ function Te(e) {
|
|
|
214
210
|
// without rebuilding the structural option. Falls back to the
|
|
215
211
|
// structural `yFormatter` already baked in `baseYAxis.axisLabel`
|
|
216
212
|
// (which `String(value)` if neither is set).
|
|
217
|
-
...
|
|
218
|
-
formatter:
|
|
213
|
+
...I ? {
|
|
214
|
+
formatter: I
|
|
219
215
|
} : {}
|
|
220
216
|
}
|
|
221
217
|
},
|
|
222
218
|
tooltip: {
|
|
223
|
-
...
|
|
219
|
+
...k,
|
|
224
220
|
// Rebuild the tooltip formatter so the live y-axis formatter is
|
|
225
221
|
// applied to the y-coordinate in the (x, y) label. xFormatter is
|
|
226
222
|
// structural — relative is a values-axis concept, so xFormatter
|
|
227
223
|
// doesn't change under RelativeData.
|
|
228
|
-
formatter:
|
|
224
|
+
formatter: ie(k.formatter, I, r)
|
|
229
225
|
}
|
|
230
226
|
};
|
|
231
227
|
};
|
|
232
228
|
}
|
|
233
|
-
function
|
|
234
|
-
if (!Array.isArray(
|
|
235
|
-
let r = !1,
|
|
229
|
+
function re(t, e) {
|
|
230
|
+
if (!Array.isArray(t) || t.length === 0) return null;
|
|
231
|
+
let r = !1, i = !1;
|
|
236
232
|
return {
|
|
237
|
-
entries:
|
|
233
|
+
entries: t.map((s) => {
|
|
238
234
|
if (s == null || typeof s != "object") return s;
|
|
239
235
|
const a = s;
|
|
240
|
-
return a.type !== "slider" ? a : a.yAxisIndex !== void 0 ? (
|
|
236
|
+
return a.type !== "slider" ? a : a.yAxisIndex !== void 0 ? (i = !0, a) : (r = !0, e ? {
|
|
241
237
|
...a,
|
|
242
238
|
bottom: b.sliderBottomWithLegend
|
|
243
239
|
} : a);
|
|
244
240
|
}),
|
|
245
241
|
hasXSlider: r,
|
|
246
|
-
hasYSlider:
|
|
242
|
+
hasYSlider: i
|
|
247
243
|
};
|
|
248
244
|
}
|
|
249
|
-
function
|
|
250
|
-
return
|
|
251
|
-
const
|
|
245
|
+
function ie(t, e, r) {
|
|
246
|
+
return e ? Y((i) => {
|
|
247
|
+
const o = i.value, s = o?.[0], a = o?.[1], l = typeof s == "number" ? r ? r(s) : String(s) : "", c = typeof a == "number" ? e(a) : String(a ?? ""), n = typeof i.marker == "string" ? i.marker : "", p = i.seriesName ? `${i.seriesName}: ` : "";
|
|
252
248
|
return {
|
|
253
249
|
name: `(${l}, ${c})`,
|
|
254
|
-
seriesName:
|
|
250
|
+
seriesName: p,
|
|
255
251
|
marker: n,
|
|
256
252
|
value: ""
|
|
257
253
|
};
|
|
258
|
-
}) :
|
|
254
|
+
}) : t;
|
|
259
255
|
}
|
|
260
|
-
function oe(
|
|
261
|
-
return
|
|
262
|
-
const
|
|
256
|
+
function oe(t, e) {
|
|
257
|
+
return Y((r) => {
|
|
258
|
+
const i = r.value, o = i?.[0], s = i?.[1], a = typeof o == "number" ? t ? t(o) : String(o) : "", l = typeof s == "number" ? e ? e(s) : String(s) : "", c = typeof r.marker == "string" ? r.marker : "", n = r.seriesName ? `${r.seriesName}: ` : "";
|
|
263
259
|
return {
|
|
264
260
|
name: `(${a}, ${l})`,
|
|
265
261
|
seriesName: n,
|
|
@@ -268,14 +264,14 @@ function oe(e, t) {
|
|
|
268
264
|
};
|
|
269
265
|
});
|
|
270
266
|
}
|
|
271
|
-
function
|
|
272
|
-
let
|
|
273
|
-
for (const n of
|
|
274
|
-
for (const
|
|
275
|
-
const
|
|
276
|
-
typeof
|
|
267
|
+
function ne(t) {
|
|
268
|
+
let e = 1 / 0, r = -1 / 0, i = 1 / 0, o = -1 / 0;
|
|
269
|
+
for (const n of t)
|
|
270
|
+
for (const p of n) {
|
|
271
|
+
const u = p?.[0], f = p?.[1];
|
|
272
|
+
typeof u == "number" && Number.isFinite(u) && (u < e && (e = u), u > r && (r = u)), typeof f == "number" && Number.isFinite(f) && (f < i && (i = f), f > o && (o = f));
|
|
277
273
|
}
|
|
278
|
-
const s = Number.isFinite(r) ? r <= 0 ? 1 : A(r) : 1, a = Number.isFinite(
|
|
274
|
+
const s = Number.isFinite(r) ? r <= 0 ? 1 : A(r) : 1, a = Number.isFinite(o) ? o <= 0 ? 1 : A(o) : 1, l = Number.isFinite(e) && e < 0 ? A(e) : 0, c = Number.isFinite(i) && i < 0 ? A(i) : 0;
|
|
279
275
|
return {
|
|
280
276
|
niceMinX: l,
|
|
281
277
|
niceMaxX: s,
|
|
@@ -290,11 +286,11 @@ const v = {
|
|
|
290
286
|
justifyContent: "space-between",
|
|
291
287
|
flexDirection: "column",
|
|
292
288
|
gap: ({
|
|
293
|
-
spacing:
|
|
294
|
-
}) =>
|
|
289
|
+
spacing: t
|
|
290
|
+
}) => t(1),
|
|
295
291
|
height: ({
|
|
296
|
-
spacing:
|
|
297
|
-
}) =>
|
|
292
|
+
spacing: t
|
|
293
|
+
}) => t(38)
|
|
298
294
|
},
|
|
299
295
|
grid: {
|
|
300
296
|
position: "relative",
|
|
@@ -305,99 +301,99 @@ const v = {
|
|
|
305
301
|
display: "flex",
|
|
306
302
|
alignItems: "center",
|
|
307
303
|
gap: ({
|
|
308
|
-
spacing:
|
|
309
|
-
}) =>
|
|
304
|
+
spacing: t
|
|
305
|
+
}) => t(2),
|
|
310
306
|
height: ({
|
|
311
|
-
spacing:
|
|
312
|
-
}) =>
|
|
307
|
+
spacing: t
|
|
308
|
+
}) => t(5)
|
|
313
309
|
},
|
|
314
310
|
legendItem: {
|
|
315
311
|
display: "flex",
|
|
316
312
|
alignItems: "center",
|
|
317
313
|
gap: ({
|
|
318
|
-
spacing:
|
|
319
|
-
}) =>
|
|
314
|
+
spacing: t
|
|
315
|
+
}) => t(1.5)
|
|
320
316
|
}
|
|
321
|
-
},
|
|
317
|
+
}, se = (t, e, r) => ({
|
|
322
318
|
position: "absolute",
|
|
323
|
-
top:
|
|
324
|
-
left:
|
|
319
|
+
top: t,
|
|
320
|
+
left: e,
|
|
325
321
|
width: r,
|
|
326
322
|
height: r,
|
|
327
323
|
borderRadius: "50%"
|
|
328
324
|
});
|
|
329
|
-
function
|
|
330
|
-
const
|
|
325
|
+
function _e(t) {
|
|
326
|
+
const e = J(15), {
|
|
331
327
|
count: r
|
|
332
|
-
} =
|
|
333
|
-
let
|
|
334
|
-
if (
|
|
328
|
+
} = t, i = r === void 0 ? 24 : r;
|
|
329
|
+
let o, s, a, l, c;
|
|
330
|
+
if (e[0] !== i) {
|
|
335
331
|
const f = Array.from({
|
|
336
|
-
length:
|
|
337
|
-
},
|
|
338
|
-
s = S, c = v.container,
|
|
332
|
+
length: i
|
|
333
|
+
}, ce);
|
|
334
|
+
s = S, c = v.container, o = S, a = v.grid, l = f.map(le), e[0] = i, e[1] = o, e[2] = s, e[3] = a, e[4] = l, e[5] = c;
|
|
339
335
|
} else
|
|
340
|
-
|
|
336
|
+
o = e[1], s = e[2], a = e[3], l = e[4], c = e[5];
|
|
341
337
|
let n;
|
|
342
|
-
|
|
343
|
-
let u;
|
|
344
|
-
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ x(S, { sx: v.legend, children: [0, 1].map(se) }), t[10] = u) : u = t[10];
|
|
338
|
+
e[6] !== o || e[7] !== a || e[8] !== l ? (n = /* @__PURE__ */ x(o, { sx: a, children: l }), e[6] = o, e[7] = a, e[8] = l, e[9] = n) : n = e[9];
|
|
345
339
|
let p;
|
|
346
|
-
|
|
340
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ x(S, { sx: v.legend, children: [0, 1].map(ae) }), e[10] = p) : p = e[10];
|
|
341
|
+
let u;
|
|
342
|
+
return e[11] !== s || e[12] !== c || e[13] !== n ? (u = /* @__PURE__ */ X(s, { sx: c, children: [
|
|
347
343
|
n,
|
|
348
|
-
|
|
349
|
-
] }),
|
|
344
|
+
p
|
|
345
|
+
] }), e[11] = s, e[12] = c, e[13] = n, e[14] = u) : u = e[14], u;
|
|
350
346
|
}
|
|
351
|
-
function
|
|
352
|
-
return /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */ x(
|
|
354
|
-
/* @__PURE__ */ x(
|
|
355
|
-
] }, `legend-${
|
|
347
|
+
function ae(t) {
|
|
348
|
+
return /* @__PURE__ */ X(S, { sx: v.legendItem, children: [
|
|
349
|
+
/* @__PURE__ */ x(L, { variant: "circular", width: 8, height: 8 }),
|
|
350
|
+
/* @__PURE__ */ x(L, { width: 48, height: 8 })
|
|
351
|
+
] }, `legend-${t}`);
|
|
356
352
|
}
|
|
357
|
-
function
|
|
358
|
-
return /* @__PURE__ */ x(
|
|
353
|
+
function le(t, e) {
|
|
354
|
+
return /* @__PURE__ */ x(L, { variant: "circular", sx: se(t.top, t.left, t.size) }, `dot-${e}`);
|
|
359
355
|
}
|
|
360
|
-
function
|
|
361
|
-
const r = 10 +
|
|
356
|
+
function ce(t, e) {
|
|
357
|
+
const r = 10 + e * 37 % 80, i = 5 + e * 53 % 90, o = 8 + e * 7 % 6;
|
|
362
358
|
return {
|
|
363
359
|
top: `${r}%`,
|
|
364
|
-
left: `${
|
|
365
|
-
size:
|
|
360
|
+
left: `${i}%`,
|
|
361
|
+
size: o
|
|
366
362
|
};
|
|
367
363
|
}
|
|
368
|
-
function
|
|
369
|
-
const
|
|
370
|
-
return
|
|
371
|
-
filename:
|
|
372
|
-
getCaptureEl:
|
|
373
|
-
pixelRatio:
|
|
374
|
-
backgroundColor:
|
|
375
|
-
})),
|
|
376
|
-
filename:
|
|
364
|
+
function De(t) {
|
|
365
|
+
const e = [];
|
|
366
|
+
return t.getCaptureEl && e.push(V({
|
|
367
|
+
filename: t.filename,
|
|
368
|
+
getCaptureEl: t.getCaptureEl,
|
|
369
|
+
pixelRatio: t.pngPixelRatio,
|
|
370
|
+
backgroundColor: t.pngBackgroundColor
|
|
371
|
+
})), e.push(ee({
|
|
372
|
+
filename: t.filename,
|
|
377
373
|
getRows: () => {
|
|
378
|
-
const r =
|
|
379
|
-
for (const [
|
|
380
|
-
const a =
|
|
374
|
+
const r = t.getData(), i = [["series", "x", "y"]];
|
|
375
|
+
for (const [o, s] of r.entries()) {
|
|
376
|
+
const a = t.seriesNames?.[o] ?? `series_${o + 1}`;
|
|
381
377
|
for (const [l, c] of s)
|
|
382
|
-
|
|
378
|
+
i.push([a, l, c]);
|
|
383
379
|
}
|
|
384
|
-
return
|
|
380
|
+
return i;
|
|
385
381
|
}
|
|
386
|
-
})),
|
|
382
|
+
})), e;
|
|
387
383
|
}
|
|
388
|
-
const
|
|
389
|
-
if (!
|
|
390
|
-
const r =
|
|
391
|
-
return r <= 0 ?
|
|
392
|
-
}) :
|
|
393
|
-
function
|
|
394
|
-
return Array.isArray(
|
|
384
|
+
const Re = (t) => Array.isArray(t) ? t.map((e) => {
|
|
385
|
+
if (!fe(e)) return e;
|
|
386
|
+
const r = e.reduce((i, [, o]) => i + Math.abs(o), 0);
|
|
387
|
+
return r <= 0 ? e : e.map(([i, o]) => [i, o / r * 100]);
|
|
388
|
+
}) : t;
|
|
389
|
+
function fe(t) {
|
|
390
|
+
return Array.isArray(t) ? t.every((e) => Array.isArray(e) && e.length === 2 && typeof e[0] == "number" && Number.isFinite(e[0]) && typeof e[1] == "number" && Number.isFinite(e[1])) : !1;
|
|
395
391
|
}
|
|
396
392
|
export {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
393
|
+
_e as ScatterplotSkeleton,
|
|
394
|
+
De as createScatterplotDownloadConfig,
|
|
395
|
+
Oe as createScatterplotOptionFactory,
|
|
396
|
+
te as scatterplotOptions,
|
|
397
|
+
Re as toRelativeScatterplotData
|
|
402
398
|
};
|
|
403
399
|
//# sourceMappingURL=scatterplot.js.map
|