@carto/ps-react-ui 6.1.1 → 6.3.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/{actions-BWlS5tpP.js → actions-CkxKe8-J.js} +57 -47
- package/dist/actions-CkxKe8-J.js.map +1 -0
- package/dist/category-DULnoxvk.js +933 -0
- package/dist/category-DULnoxvk.js.map +1 -0
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/components-CTUpdQuj.js.map +1 -1
- package/dist/download-B4sykOFm.js.map +1 -1
- package/dist/{echart-CV8F50gn.js → echart-ysYFLa_T.js} +2 -2
- package/dist/echart-ysYFLa_T.js.map +1 -0
- package/dist/formula-DJS-JLpk.js.map +1 -1
- package/dist/{option-builders-DQivvvbb.js → item-color-B7xkIpDZ.js} +26 -9
- package/dist/item-color-B7xkIpDZ.js.map +1 -0
- package/dist/legend.js.map +1 -1
- package/dist/{markdown-Bn2nKCbn.js → markdown-DmvLi3vx.js} +2 -2
- package/dist/markdown-DmvLi3vx.js.map +1 -0
- package/dist/{markdown-content-kYNLOX0T.js → markdown-content-BpAH_V6S.js} +5 -4
- package/dist/markdown-content-BpAH_V6S.js.map +1 -0
- package/dist/range-BpU2zBmq.js.map +1 -1
- package/dist/smart-tooltip-Dc_rHhyI.js.map +1 -1
- package/dist/spread-CQwFIwuz.js.map +1 -1
- package/dist/stores-DcBOZlU3.js.map +1 -1
- package/dist/stores-mad-9yFn.js.map +1 -1
- package/dist/styles-BCEBm7xh.js.map +1 -1
- package/dist/table-DEdW_fDj.js.map +1 -1
- package/dist/types/widgets/bar/types.d.ts +6 -0
- package/dist/types/widgets/category/category-ui.d.ts +10 -2
- package/dist/types/widgets/category/category.d.ts +7 -1
- package/dist/types/widgets/category/components/category-bar-stacked.d.ts +8 -1
- package/dist/types/widgets/category/components/category-bar.d.ts +24 -2
- package/dist/types/widgets/category/components/category-row-multi.d.ts +3 -1
- package/dist/types/widgets/category/components/category-row-single.d.ts +3 -1
- package/dist/types/widgets/category/components/category-row-stacked.d.ts +10 -1
- package/dist/types/widgets/category/style.d.ts +33 -6
- package/dist/types/widgets/histogram/bins.d.ts +7 -0
- package/dist/types/widgets/histogram/download.d.ts +2 -2
- package/dist/types/widgets/histogram/index.d.ts +2 -1
- package/dist/types/widgets/histogram/options.d.ts +1 -1
- package/dist/types/widgets/histogram/transforms.d.ts +5 -4
- package/dist/types/widgets/histogram/types.d.ts +22 -5
- package/dist/types/widgets/index.d.ts +1 -1
- package/dist/types/widgets/pie/types.d.ts +6 -0
- package/dist/types/widgets/scatterplot/download.d.ts +2 -2
- package/dist/types/widgets/scatterplot/index.d.ts +2 -1
- package/dist/types/widgets/scatterplot/points.d.ts +7 -0
- package/dist/types/widgets/scatterplot/transforms.d.ts +4 -3
- package/dist/types/widgets/scatterplot/types.d.ts +21 -2
- package/dist/types/widgets/timeseries/types.d.ts +6 -0
- package/dist/types/widgets/utils/item-color.d.ts +26 -0
- package/dist/utils-C-eWwOhE.js.map +1 -1
- package/dist/widgets/actions.js +1 -1
- package/dist/widgets/bar.js +78 -70
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/echart.js +1 -1
- package/dist/widgets/histogram.js +116 -85
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +2 -2
- package/dist/widgets/pie.js +109 -90
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +131 -92
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/timeseries.js +82 -74
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets.js +5 -5
- package/dist/widgets.js.map +1 -1
- package/dist/zoom-toggle-MmLjMTEw.js.map +1 -1
- package/package.json +2 -2
- package/src/widgets/actions/fullscreen/fullscreen-store.test.tsx +77 -13
- package/src/widgets/actions/fullscreen/fullscreen.tsx +48 -5
- package/src/widgets/bar/options.test.ts +106 -0
- package/src/widgets/bar/options.ts +25 -14
- package/src/widgets/bar/types.ts +6 -0
- package/src/widgets/category/category-ui.test.tsx +139 -0
- package/src/widgets/category/category-ui.tsx +64 -11
- package/src/widgets/category/category.test.tsx +67 -0
- package/src/widgets/category/category.tsx +32 -15
- package/src/widgets/category/components/category-bar-stacked.test.tsx +18 -0
- package/src/widgets/category/components/category-bar-stacked.tsx +42 -29
- package/src/widgets/category/components/category-bar.test.tsx +66 -0
- package/src/widgets/category/components/category-bar.tsx +65 -9
- package/src/widgets/category/components/category-row-multi.tsx +21 -0
- package/src/widgets/category/components/category-row-single.tsx +4 -0
- package/src/widgets/category/components/category-row-stacked.tsx +24 -1
- package/src/widgets/category/style.ts +58 -14
- package/src/widgets/histogram/bins.ts +22 -0
- package/src/widgets/histogram/download.test.ts +10 -0
- package/src/widgets/histogram/download.ts +7 -3
- package/src/widgets/histogram/index.ts +3 -0
- package/src/widgets/histogram/options.test.ts +62 -0
- package/src/widgets/histogram/options.ts +38 -17
- package/src/widgets/histogram/transforms.test.ts +21 -7
- package/src/widgets/histogram/transforms.ts +26 -12
- package/src/widgets/histogram/types.ts +25 -5
- package/src/widgets/index.ts +6 -1
- package/src/widgets/pie/options.test.ts +91 -0
- package/src/widgets/pie/options.ts +50 -20
- package/src/widgets/pie/types.ts +6 -0
- package/src/widgets/scatterplot/download.test.ts +9 -0
- package/src/widgets/scatterplot/download.ts +5 -3
- package/src/widgets/scatterplot/index.ts +3 -0
- package/src/widgets/scatterplot/options.test.ts +78 -0
- package/src/widgets/scatterplot/options.ts +35 -11
- package/src/widgets/scatterplot/points.ts +35 -0
- package/src/widgets/scatterplot/transforms.test.ts +19 -0
- package/src/widgets/scatterplot/transforms.ts +23 -18
- package/src/widgets/scatterplot/types.ts +25 -2
- package/src/widgets/timeseries/options.test.ts +65 -0
- package/src/widgets/timeseries/options.ts +31 -14
- package/src/widgets/timeseries/types.ts +6 -0
- package/src/widgets/utils/item-color.test.ts +74 -0
- package/src/widgets/utils/item-color.ts +55 -0
- package/dist/actions-BWlS5tpP.js.map +0 -1
- package/dist/category-alzjKzvQ.js +0 -839
- package/dist/category-alzjKzvQ.js.map +0 -1
- package/dist/echart-CV8F50gn.js.map +0 -1
- package/dist/markdown-Bn2nKCbn.js.map +0 -1
- package/dist/markdown-content-kYNLOX0T.js.map +0 -1
- package/dist/option-builders-DQivvvbb.js.map +0 -1
|
@@ -1,19 +1,43 @@
|
|
|
1
1
|
import { r as e } from "../zoom-toggle-MmLjMTEw.js";
|
|
2
2
|
import { n as t, t as n } from "../download-B4sykOFm.js";
|
|
3
3
|
import { r, t as i } from "../utils-C-eWwOhE.js";
|
|
4
|
-
import { a,
|
|
5
|
-
import { c as
|
|
6
|
-
import { Box as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import * as
|
|
4
|
+
import { c as a, i as o, n as s, o as c, r as l, s as u, t as d } from "../item-color-B7xkIpDZ.js";
|
|
5
|
+
import { c as f } from "react/compiler-runtime";
|
|
6
|
+
import { Box as p, Skeleton as m } from "@mui/material";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
import * as _ from "echarts";
|
|
9
|
+
//#region src/widgets/scatterplot/points.ts
|
|
10
|
+
function v(e) {
|
|
11
|
+
return x(e) ? e : [e.x, e.y];
|
|
12
|
+
}
|
|
13
|
+
function y(e) {
|
|
14
|
+
if (Array.isArray(e)) return e.length === 2 && S(e[0]) && S(e[1]);
|
|
15
|
+
if (typeof e != "object" || !e) return !1;
|
|
16
|
+
let { x: t, y: n } = e;
|
|
17
|
+
return S(t) && S(n);
|
|
18
|
+
}
|
|
19
|
+
function b(e, t, n) {
|
|
20
|
+
return x(e) ? [t, n] : {
|
|
21
|
+
...e,
|
|
22
|
+
x: t,
|
|
23
|
+
y: n
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function x(e) {
|
|
27
|
+
return Array.isArray(e);
|
|
28
|
+
}
|
|
29
|
+
function S(e) {
|
|
30
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
9
33
|
//#region src/widgets/scatterplot/options.ts
|
|
10
|
-
function
|
|
34
|
+
function C({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
11
35
|
return {
|
|
12
36
|
grid: {
|
|
13
37
|
left: parseInt(e.spacing(1)),
|
|
14
38
|
top: parseInt(e.spacing(3)),
|
|
15
39
|
right: parseInt(e.spacing(1)),
|
|
16
|
-
...
|
|
40
|
+
...l(!1, e),
|
|
17
41
|
containLabel: !0
|
|
18
42
|
},
|
|
19
43
|
tooltip: {
|
|
@@ -26,10 +50,10 @@ function _({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
26
50
|
fontSize: 11,
|
|
27
51
|
fontFamily: e.typography.caption.fontFamily
|
|
28
52
|
},
|
|
29
|
-
position:
|
|
30
|
-
formatter:
|
|
53
|
+
position: u(e),
|
|
54
|
+
formatter: D(t, n)
|
|
31
55
|
},
|
|
32
|
-
legend: { ...
|
|
56
|
+
legend: { ...o({
|
|
33
57
|
hasLegend: !1,
|
|
34
58
|
labelFormatter: void 0
|
|
35
59
|
}) },
|
|
@@ -40,7 +64,7 @@ function _({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
40
64
|
axisLine: { show: !1 },
|
|
41
65
|
axisTick: { show: !1 },
|
|
42
66
|
axisLabel: {
|
|
43
|
-
...
|
|
67
|
+
...s(e),
|
|
44
68
|
margin: parseInt(e.spacing(1)),
|
|
45
69
|
hideOverlap: !0,
|
|
46
70
|
showMinLabel: !0,
|
|
@@ -57,7 +81,7 @@ function _({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
57
81
|
axisLine: { show: !1 },
|
|
58
82
|
axisTick: { show: !1 },
|
|
59
83
|
axisLabel: {
|
|
60
|
-
...
|
|
84
|
+
...s(e),
|
|
61
85
|
margin: parseInt(e.spacing(1)),
|
|
62
86
|
hideOverlap: !0,
|
|
63
87
|
showMinLabel: !0,
|
|
@@ -71,33 +95,41 @@ function _({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
71
95
|
}
|
|
72
96
|
};
|
|
73
97
|
}
|
|
74
|
-
function
|
|
75
|
-
let { theme: n, xFormatter: a, yFormatter: o, optionsOverride: s } = t, c = t.series, l = t.symbolSize ?? 8, u = t.selection,
|
|
76
|
-
return (t, u,
|
|
98
|
+
function w(t) {
|
|
99
|
+
let { theme: n, xFormatter: a, yFormatter: o, optionsOverride: s } = t, c = t.series, l = t.symbolSize ?? 8, u = t.selection, f = u && u.length > 0 ? new Set(u) : null;
|
|
100
|
+
return (t, u, p) => {
|
|
77
101
|
if (t == null) {
|
|
78
|
-
let e =
|
|
102
|
+
let e = C({
|
|
79
103
|
theme: n,
|
|
80
104
|
xFormatter: a,
|
|
81
105
|
yFormatter: o
|
|
82
106
|
});
|
|
83
107
|
return s ? r(e, s) : e;
|
|
84
108
|
}
|
|
85
|
-
let
|
|
86
|
-
if (
|
|
109
|
+
let m = Array.isArray(u) ? u : [];
|
|
110
|
+
if (m.length === 0) return {
|
|
87
111
|
...t,
|
|
88
112
|
dataset: [],
|
|
89
113
|
series: []
|
|
90
114
|
};
|
|
91
|
-
let
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
115
|
+
let h = m.length > 1, g = typeof t.legend == "object" && !Array.isArray(t.legend) ? t.legend : {}, y = typeof t.grid == "object" && !Array.isArray(t.grid) ? t.grid : {}, b = typeof t.tooltip == "object" && !Array.isArray(t.tooltip) ? t.tooltip : {}, x = typeof t.xAxis == "object" && !Array.isArray(t.xAxis) ? t.xAxis : {}, S = typeof t.yAxis == "object" && !Array.isArray(t.yAxis) ? t.yAxis : {}, w = p?.formatter, { niceMinX: D, niceMaxX: k, niceMinY: A, niceMaxY: j } = O(m), M = Array.isArray(t.series) ? t.series : [], N = (e, t) => {
|
|
116
|
+
let r = d({
|
|
117
|
+
theme: n,
|
|
118
|
+
datums: t,
|
|
119
|
+
template: M[e] ?? M[0],
|
|
120
|
+
fallback: (e) => e.color
|
|
121
|
+
});
|
|
122
|
+
return (t) => {
|
|
123
|
+
let n = r(t);
|
|
124
|
+
if (!f) return n;
|
|
125
|
+
let i = `${e}:${t.dataIndex}`;
|
|
126
|
+
return f.has(i) ? n : _.color.modifyAlpha(n, .15);
|
|
127
|
+
};
|
|
128
|
+
}, P = T(t.dataZoom, h), F = P?.hasXSlider ?? !1, I = P?.hasYSlider ?? !1, L = typeof y.bottom == "number" ? y.bottom : 24, R = h ? 56 : L, z = F ? R + e.sliderHeight + e.sliderGap : R, B = typeof y.right == "number" ? y.right : 8, V = I ? B + e.sliderHeight + e.sliderGap : B;
|
|
97
129
|
return {
|
|
98
130
|
...t,
|
|
99
|
-
dataset:
|
|
100
|
-
series:
|
|
131
|
+
dataset: m.map((e) => ({ source: e.every(Array.isArray) ? e : e.map(v) })),
|
|
132
|
+
series: m.map((e, t) => {
|
|
101
133
|
let r = i(n, c?.[t]?.color);
|
|
102
134
|
return {
|
|
103
135
|
type: "scatter",
|
|
@@ -109,42 +141,42 @@ function v(t) {
|
|
|
109
141
|
},
|
|
110
142
|
symbolSize: l,
|
|
111
143
|
emphasis: { focus: "series" },
|
|
112
|
-
itemStyle: { color:
|
|
144
|
+
itemStyle: { color: N(t, e) },
|
|
113
145
|
...r ? { color: r } : {}
|
|
114
146
|
};
|
|
115
147
|
}),
|
|
116
148
|
legend: {
|
|
117
|
-
...
|
|
118
|
-
show:
|
|
149
|
+
...g,
|
|
150
|
+
show: h
|
|
119
151
|
},
|
|
120
152
|
grid: {
|
|
121
|
-
...
|
|
122
|
-
bottom:
|
|
123
|
-
right:
|
|
153
|
+
...y,
|
|
154
|
+
bottom: z,
|
|
155
|
+
right: V
|
|
124
156
|
},
|
|
125
|
-
...
|
|
157
|
+
...P ? { dataZoom: P.entries } : {},
|
|
126
158
|
xAxis: {
|
|
127
|
-
...
|
|
128
|
-
min:
|
|
129
|
-
max:
|
|
159
|
+
...x,
|
|
160
|
+
min: D,
|
|
161
|
+
max: k
|
|
130
162
|
},
|
|
131
163
|
yAxis: {
|
|
132
|
-
...
|
|
133
|
-
min:
|
|
134
|
-
max:
|
|
164
|
+
...S,
|
|
165
|
+
min: A,
|
|
166
|
+
max: j,
|
|
135
167
|
axisLabel: {
|
|
136
|
-
...
|
|
137
|
-
...
|
|
168
|
+
...S.axisLabel ?? {},
|
|
169
|
+
...w ? { formatter: w } : {}
|
|
138
170
|
}
|
|
139
171
|
},
|
|
140
172
|
tooltip: {
|
|
141
|
-
...
|
|
142
|
-
formatter: b
|
|
173
|
+
...b,
|
|
174
|
+
formatter: E(b.formatter, w, a)
|
|
143
175
|
}
|
|
144
176
|
};
|
|
145
177
|
};
|
|
146
178
|
}
|
|
147
|
-
function
|
|
179
|
+
function T(t, n) {
|
|
148
180
|
if (!Array.isArray(t) || t.length === 0) return null;
|
|
149
181
|
let r = !1, i = !1;
|
|
150
182
|
return {
|
|
@@ -160,8 +192,8 @@ function y(t, n) {
|
|
|
160
192
|
hasYSlider: i
|
|
161
193
|
};
|
|
162
194
|
}
|
|
163
|
-
function
|
|
164
|
-
return t ?
|
|
195
|
+
function E(e, t, n) {
|
|
196
|
+
return t ? c((e) => {
|
|
165
197
|
let r = e.value, i = r?.[0], a = r?.[1], o = typeof i == "number" ? n ? n(i) : String(i) : "", s = typeof a == "number" ? t(a) : String(a ?? ""), c = typeof e.marker == "string" ? e.marker : "", l = e.seriesName ? `${e.seriesName}: ` : "";
|
|
166
198
|
return {
|
|
167
199
|
name: `(${o}, ${s})`,
|
|
@@ -171,8 +203,8 @@ function b(e, t, n) {
|
|
|
171
203
|
};
|
|
172
204
|
}) : e;
|
|
173
205
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
206
|
+
function D(e, t) {
|
|
207
|
+
return c((n) => {
|
|
176
208
|
let r = n.value, i = r?.[0], a = r?.[1], o = typeof i == "number" ? e ? e(i) : String(i) : "", s = typeof a == "number" ? t ? t(a) : String(a) : "", c = typeof n.marker == "string" ? n.marker : "", l = n.seriesName ? `${n.seriesName}: ` : "";
|
|
177
209
|
return {
|
|
178
210
|
name: `(${o}, ${s})`,
|
|
@@ -182,23 +214,24 @@ function x(e, t) {
|
|
|
182
214
|
};
|
|
183
215
|
});
|
|
184
216
|
}
|
|
185
|
-
function
|
|
217
|
+
function O(e) {
|
|
186
218
|
let t = Infinity, n = -Infinity, r = Infinity, i = -Infinity;
|
|
187
219
|
for (let a of e) for (let e of a) {
|
|
188
|
-
|
|
220
|
+
if (e == null) continue;
|
|
221
|
+
let [a, o] = v(e);
|
|
189
222
|
typeof a == "number" && Number.isFinite(a) && (a < t && (t = a), a > n && (n = a)), typeof o == "number" && Number.isFinite(o) && (o < r && (r = o), o > i && (i = o));
|
|
190
223
|
}
|
|
191
|
-
let
|
|
224
|
+
let o = Number.isFinite(n) ? n <= 0 ? 1 : a(n) : 1, s = Number.isFinite(i) ? i <= 0 ? 1 : a(i) : 1;
|
|
192
225
|
return {
|
|
193
|
-
niceMinX: Number.isFinite(t) && t < 0 ?
|
|
194
|
-
niceMaxX:
|
|
195
|
-
niceMinY: Number.isFinite(r) && r < 0 ?
|
|
196
|
-
niceMaxY:
|
|
226
|
+
niceMinX: Number.isFinite(t) && t < 0 ? a(t) : 0,
|
|
227
|
+
niceMaxX: o,
|
|
228
|
+
niceMinY: Number.isFinite(r) && r < 0 ? a(r) : 0,
|
|
229
|
+
niceMaxY: s
|
|
197
230
|
};
|
|
198
231
|
}
|
|
199
232
|
//#endregion
|
|
200
233
|
//#region src/widgets/scatterplot/skeleton.tsx
|
|
201
|
-
var
|
|
234
|
+
var k = {
|
|
202
235
|
container: {
|
|
203
236
|
display: "flex",
|
|
204
237
|
alignItems: "center",
|
|
@@ -223,7 +256,7 @@ var C = {
|
|
|
223
256
|
alignItems: "center",
|
|
224
257
|
gap: ({ spacing: e }) => e(1.5)
|
|
225
258
|
}
|
|
226
|
-
},
|
|
259
|
+
}, A = (e, t, n) => ({
|
|
227
260
|
position: "absolute",
|
|
228
261
|
top: e,
|
|
229
262
|
left: t,
|
|
@@ -231,48 +264,48 @@ var C = {
|
|
|
231
264
|
height: n,
|
|
232
265
|
borderRadius: "50%"
|
|
233
266
|
});
|
|
234
|
-
function
|
|
235
|
-
let t =
|
|
267
|
+
function j(e) {
|
|
268
|
+
let t = f(15), { count: n } = e, r = n === void 0 ? 24 : n, i, a, o, s, c;
|
|
236
269
|
if (t[0] !== r) {
|
|
237
|
-
let e = Array.from({ length: r },
|
|
238
|
-
a =
|
|
270
|
+
let e = Array.from({ length: r }, P);
|
|
271
|
+
a = p, c = k.container, i = p, o = k.grid, s = e.map(N), t[0] = r, t[1] = i, t[2] = a, t[3] = o, t[4] = s, t[5] = c;
|
|
239
272
|
} else i = t[1], a = t[2], o = t[3], s = t[4], c = t[5];
|
|
240
273
|
let l;
|
|
241
|
-
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */
|
|
274
|
+
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */ h(i, {
|
|
242
275
|
sx: o,
|
|
243
276
|
children: s
|
|
244
277
|
}), t[6] = i, t[7] = o, t[8] = s, t[9] = l) : l = t[9];
|
|
245
278
|
let u;
|
|
246
|
-
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
247
|
-
sx:
|
|
248
|
-
children: [0, 1].map(
|
|
279
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ h(p, {
|
|
280
|
+
sx: k.legend,
|
|
281
|
+
children: [0, 1].map(M)
|
|
249
282
|
}), t[10] = u) : u = t[10];
|
|
250
|
-
let
|
|
251
|
-
return t[11] !== a || t[12] !== c || t[13] !== l ? (
|
|
283
|
+
let d;
|
|
284
|
+
return t[11] !== a || t[12] !== c || t[13] !== l ? (d = /* @__PURE__ */ g(a, {
|
|
252
285
|
sx: c,
|
|
253
286
|
children: [l, u]
|
|
254
|
-
}), t[11] = a, t[12] = c, t[13] = l, t[14] =
|
|
287
|
+
}), t[11] = a, t[12] = c, t[13] = l, t[14] = d) : d = t[14], d;
|
|
255
288
|
}
|
|
256
|
-
function
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
sx:
|
|
259
|
-
children: [/* @__PURE__ */ m
|
|
289
|
+
function M(e) {
|
|
290
|
+
return /* @__PURE__ */ g(p, {
|
|
291
|
+
sx: k.legendItem,
|
|
292
|
+
children: [/* @__PURE__ */ h(m, {
|
|
260
293
|
variant: "circular",
|
|
261
294
|
width: 8,
|
|
262
295
|
height: 8
|
|
263
|
-
}), /* @__PURE__ */ m
|
|
296
|
+
}), /* @__PURE__ */ h(m, {
|
|
264
297
|
width: 48,
|
|
265
298
|
height: 8
|
|
266
299
|
})]
|
|
267
300
|
}, `legend-${e}`);
|
|
268
301
|
}
|
|
269
|
-
function
|
|
270
|
-
return /* @__PURE__ */ m
|
|
302
|
+
function N(e, t) {
|
|
303
|
+
return /* @__PURE__ */ h(m, {
|
|
271
304
|
variant: "circular",
|
|
272
|
-
sx:
|
|
305
|
+
sx: A(e.top, e.left, e.size)
|
|
273
306
|
}, `dot-${t}`);
|
|
274
307
|
}
|
|
275
|
-
function
|
|
308
|
+
function P(e, t) {
|
|
276
309
|
let n = 10 + t * 37 % 80, r = 5 + t * 53 % 90, i = 8 + t * 7 % 6;
|
|
277
310
|
return {
|
|
278
311
|
top: `${n}%`,
|
|
@@ -282,7 +315,7 @@ function O(e, t) {
|
|
|
282
315
|
}
|
|
283
316
|
//#endregion
|
|
284
317
|
//#region src/widgets/scatterplot/download.ts
|
|
285
|
-
function
|
|
318
|
+
function F(e) {
|
|
286
319
|
return n(e, t({
|
|
287
320
|
filename: e.filename,
|
|
288
321
|
getRows: (t) => {
|
|
@@ -293,11 +326,14 @@ function k(e) {
|
|
|
293
326
|
]];
|
|
294
327
|
for (let [t, i] of n.entries()) {
|
|
295
328
|
let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
|
|
296
|
-
for (let
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
329
|
+
for (let e of i) {
|
|
330
|
+
let [t, i] = v(e);
|
|
331
|
+
r.push([
|
|
332
|
+
n,
|
|
333
|
+
t,
|
|
334
|
+
i
|
|
335
|
+
]);
|
|
336
|
+
}
|
|
301
337
|
}
|
|
302
338
|
return r;
|
|
303
339
|
}
|
|
@@ -305,20 +341,23 @@ function k(e) {
|
|
|
305
341
|
}
|
|
306
342
|
//#endregion
|
|
307
343
|
//#region src/widgets/scatterplot/transforms.ts
|
|
308
|
-
var
|
|
309
|
-
if (!
|
|
310
|
-
let t = e.reduce((e,
|
|
311
|
-
return t <= 0 ? e : e.map((
|
|
344
|
+
var I = (e) => Array.isArray(e) ? e.map((e) => {
|
|
345
|
+
if (!L(e)) return e;
|
|
346
|
+
let t = e.reduce((e, t) => e + Math.abs(v(t)[1]), 0);
|
|
347
|
+
return t <= 0 ? e : e.map((e) => {
|
|
348
|
+
let [n, r] = v(e);
|
|
349
|
+
return b(e, n, r / t * 100);
|
|
350
|
+
});
|
|
312
351
|
}) : e;
|
|
313
|
-
function
|
|
314
|
-
return Array.isArray(e)
|
|
352
|
+
function L(e) {
|
|
353
|
+
return Array.isArray(e) && e.every(y);
|
|
315
354
|
}
|
|
316
|
-
function
|
|
355
|
+
function R(e, t) {
|
|
317
356
|
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
318
357
|
let n = new Set(t.map(String));
|
|
319
|
-
return e.map((e, t) =>
|
|
358
|
+
return e.map((e, t) => L(e) ? e.filter((e, r) => n.has(`${t}:${r}`)) : e);
|
|
320
359
|
}
|
|
321
360
|
//#endregion
|
|
322
|
-
export {
|
|
361
|
+
export { j as ScatterplotSkeleton, F as createScatterplotDownloadConfig, w as createScatterplotOptionFactory, R as filterScatterplotByLockedPoints, v as getScatterplotXY, C as scatterplotOptions, I as toRelativeScatterplotData };
|
|
323
362
|
|
|
324
363
|
//# sourceMappingURL=scatterplot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scatterplot.js","names":["{ count = 24 }: ScatterplotSkeletonProps","count = 24","Box","styles.grid","dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))","styles.container","(_, i) => {\n const top = 10 + ((i * 37) % 80)\n const left = 5 + ((i * 53) % 90)\n const size = 8 + ((i * 7) % 6)\n return { top: `${top}%`, left: `${left}%`, size }\n }","(d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n )","<Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>","<Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>","(i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n )","<Box sx={styles.container}>\n <Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>","i"],"sources":["../../src/widgets/scatterplot/options.ts","../../src/widgets/scatterplot/skeleton.tsx","../../src/widgets/scatterplot/download.ts","../../src/widgets/scatterplot/transforms.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildAxisLabelStyle,\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../utils/option-builders'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport type {\n ScatterplotEChartsOption,\n ScatterplotOptionFactoryInput,\n ScatterplotOptionsInput,\n ScatterplotWidgetData,\n} from './types'\n\n/**\n * Builds the **structural** ECharts option for a scatterplot widget — both\n * axes `type: 'value'` (not category, unlike Bar/Histogram), grid, tooltip\n * triggered per-item rather than per-axis. Intentionally data-agnostic: no\n * series, no dataset, no `legend.show` (those depend on data and are added\n * by {@link createScatterplotOptionFactory}).\n *\n * Styling parity with v1: dark themed tooltip via `createTooltipFormatter`\n * + `createTooltipPositioner`, `buildGridConfig`-based grid, polished\n * axisLine/Tick/splitLine, `overlineDelicate` axis labels, structural\n * legend wired via `buildLegendConfig` (toggled by the merger), and the\n * CARTO `qualitative.bold + secondary` palette — same pattern bar /\n * histogram / pie already use. {@link createScatterplotOptionFactory}\n * wraps this builder in its structural-phase branch.\n */\nexport function scatterplotOptions({\n theme,\n xFormatter,\n yFormatter,\n}: ScatterplotOptionsInput): ScatterplotEChartsOption {\n return {\n grid: {\n left: parseInt(theme.spacing(1)),\n top: parseInt(theme.spacing(3)),\n right: parseInt(theme.spacing(1)),\n // Default: no legend. Merger bumps `bottom` when there are >1 series.\n ...buildGridConfig(false, theme),\n containLabel: true,\n },\n tooltip: {\n // Per-point trigger — different from Bar's 'axis' trigger because\n // points don't share an x-coordinate.\n trigger: 'item',\n backgroundColor: theme.palette.grey[900],\n borderWidth: 0,\n padding: [parseInt(theme.spacing(1)), parseInt(theme.spacing(1))],\n textStyle: {\n color: theme.palette.common.white,\n fontSize: 11,\n fontFamily: theme.typography.caption.fontFamily,\n },\n position: createTooltipPositioner(theme),\n formatter: buildScatterTooltipFormatter(xFormatter, yFormatter),\n },\n // Legend styling baked here; `show` is toggled by the merger based on\n // series count.\n legend: {\n ...buildLegendConfig({ hasLegend: false, labelFormatter: undefined }),\n },\n axisPointer: { lineStyle: { color: theme.palette.grey[400] } },\n color: [\n theme.palette.secondary.main,\n ...Object.values(\n (theme.palette as { qualitative?: { bold?: Record<string, string> } })\n .qualitative?.bold ?? {},\n ),\n ],\n xAxis: {\n type: 'value',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n hideOverlap: true,\n showMinLabel: true,\n showMaxLabel: true,\n ...(xFormatter && { formatter: xFormatter }),\n },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n },\n yAxis: {\n type: 'value',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n hideOverlap: true,\n showMinLabel: true,\n showMaxLabel: true,\n ...(yFormatter && { formatter: yFormatter }),\n },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n },\n } as ScatterplotEChartsOption\n}\n\n/**\n * Returns the scatterplot widget's {@link OptionFactory} — one closure\n * that owns BOTH phases of option construction:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link scatterplotOptions}, optionally merging\n * the consumer-supplied `optionsOverride`. Called once by Provider to\n * seed `rawOptions` in the store.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`ScatterplotWidgetData`) into the option via the dataset API. Each\n * series's `[x, y]` tuples land in `dataset[i].source` as 2-column\n * rows; the series uses positional encoding (`encode: { x: 0, y: 1 }`)\n * and `type: 'scatter'`. niceMin/niceMax are computed over both axes\n * so the chart frames data on rounded extents and numeric jitters\n * don't shift gridlines per render. Reactive `ctx.formatter` (driven\n * by RelativeData) re-derives the y-axis label and tooltip at fusion\n * time; `xFormatter` stays baked at structural-build time (relative\n * is a values-axis concept; x is coordinate-space).\n *\n * When `ZoomToggle` installs a `dataZoom` slider, grid bottom is\n * extended and the slider is positioned above the legend row (if any) —\n * same layout dance bar / histogram / timeseries do.\n */\nexport function createScatterplotOptionFactory(\n options: ScatterplotOptionFactoryInput,\n): OptionFactory {\n const { theme, xFormatter, yFormatter, optionsOverride } = options\n const series = options.series\n const symbolSize = options.symbolSize ?? 8\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0 ? new Set<string>(selection) : null\n return (option, data, ctx) => {\n if (option == null) {\n const structural = scatterplotOptions({ theme, xFormatter, yFormatter })\n return optionsOverride\n ? (mergeOptions(\n structural as unknown as Record<string, unknown>,\n optionsOverride as Partial<Record<string, unknown>>,\n ) as EChartsOption)\n : structural\n }\n\n const seriesArr = Array.isArray(data) ? (data as ScatterplotWidgetData) : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\n : {}\n const baseGrid =\n typeof option.grid === 'object' && !Array.isArray(option.grid)\n ? option.grid\n : {}\n const baseTooltip =\n typeof option.tooltip === 'object' && !Array.isArray(option.tooltip)\n ? option.tooltip\n : {}\n const baseXAxis =\n typeof option.xAxis === 'object' && !Array.isArray(option.xAxis)\n ? option.xAxis\n : {}\n const baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n\n const reactiveFormatter = ctx?.formatter\n\n const { niceMinX, niceMaxX, niceMinY, niceMaxY } =\n computeScatterBounds(seriesArr)\n\n // Dim non-selected points via `series.itemStyle.color`. The selection\n // key is `${seriesIndex}:${dataIndex}`; we read those off the params\n // ECharts hands to the callback per-data.\n //\n // We *always* emit `itemStyle.color` (a passthrough when nothing is\n // selected), not conditionally — dropping the key between renders\n // would let ECharts' default merge keep the previous callback alive\n // and items would stay dimmed forever after an external clear.\n // Keeping the key always-present means a plain setOption merge swaps\n // the callback in place, no `replaceMerge` and no entry-animation\n // flash on selection on/off.\n const makeDimColor =\n (seriesIdx: number) => (params: CallbackDataParams) => {\n const base = params.color as string\n if (!selectionSet) return base\n const key = `${seriesIdx}:${params.dataIndex}`\n return selectionSet.has(key)\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n }\n\n // Zoom slider layout: when ZoomToggle has installed `dataZoom`,\n // reserve grid space and lift any x-slider above the legend (if\n // present). Scatter supports 2D zoom via `axes: ['x', 'y']` — in\n // that case there's also a vertical y-slider on the right edge, so\n // we reserve `grid.right` separately. Inside-only dataZoom entries\n // (no `type: 'slider'`) take no grid space.\n const dataZoomLayout = layoutDataZoomForScatter(option.dataZoom, hasLegend)\n const hasXSlider = dataZoomLayout?.hasXSlider ?? false\n const hasYSlider = dataZoomLayout?.hasYSlider ?? false\n const fallbackBottom =\n typeof baseGrid.bottom === 'number' ? baseGrid.bottom : 24\n const baseBottom = hasLegend ? 56 : fallbackBottom\n const gridBottom = hasXSlider\n ? baseBottom + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : baseBottom\n const fallbackRight =\n typeof baseGrid.right === 'number' ? baseGrid.right : 8\n const gridRight = hasYSlider\n ? fallbackRight + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : fallbackRight\n\n return {\n ...option,\n // ECharts dataset.source wants a mutable [number, number][] shape; we\n // hold readonly tuples internally, so cast at the boundary.\n dataset: seriesArr.map((s) => ({ source: s as unknown as number[][] })),\n series: seriesArr.map((_, i) => {\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n type: 'scatter' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 0, y: 1 },\n symbolSize,\n emphasis: { focus: 'series' },\n itemStyle: { color: makeDimColor(i) },\n ...(overrideColor ? { color: overrideColor } : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: { ...baseGrid, bottom: gridBottom, right: gridRight },\n ...(dataZoomLayout ? { dataZoom: dataZoomLayout.entries } : {}),\n xAxis: {\n ...baseXAxis,\n min: niceMinX,\n max: niceMaxX,\n } as EChartsOption['xAxis'],\n yAxis: {\n ...baseYAxis,\n min: niceMinY,\n max: niceMaxY,\n axisLabel: {\n ...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),\n // Re-derive the y-axis formatter at fusion time so RelativeData's\n // percent formatter (written to `state.formatter`) flows through\n // without rebuilding the structural option. Falls back to the\n // structural `yFormatter` already baked in `baseYAxis.axisLabel`\n // (which `String(value)` if neither is set).\n ...(reactiveFormatter ? { formatter: reactiveFormatter } : {}),\n },\n } as EChartsOption['yAxis'],\n tooltip: {\n ...baseTooltip,\n // Rebuild the tooltip formatter so the live y-axis formatter is\n // applied to the y-coordinate in the (x, y) label. xFormatter is\n // structural — relative is a values-axis concept, so xFormatter\n // doesn't change under RelativeData.\n formatter: buildReactiveScatterTooltipFormatter(\n (baseTooltip as { formatter?: unknown }).formatter,\n reactiveFormatter,\n xFormatter,\n ),\n },\n } as EChartsOption\n }\n}\n\n/**\n * Lay out the `dataZoom` array for the scatter chart:\n * - Detect whether any horizontal (x-axis) slider is present — if so\n * lift it above the legend row when a legend is shown.\n * - Detect whether any vertical (y-axis) slider is present — the\n * caller reserves `grid.right` so the slider doesn't overlap the\n * plot area.\n *\n * Returns `null` when there's no `dataZoom` so callers can skip the\n * layout adjustment entirely. An entry is considered an \"x-slider\" if\n * it has `xAxisIndex` set (or no axis index — defaults to x in ECharts).\n * A \"y-slider\" has `yAxisIndex` set.\n */\nfunction layoutDataZoomForScatter(\n dataZoom: unknown,\n hasLegend: boolean,\n): { entries: unknown[]; hasXSlider: boolean; hasYSlider: boolean } | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n let hasXSlider = false\n let hasYSlider = false\n const entries = dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as {\n type?: string\n xAxisIndex?: unknown\n yAxisIndex?: unknown\n bottom?: number\n }\n if (dz.type !== 'slider') return dz\n const targetsY = dz.yAxisIndex !== undefined\n if (targetsY) {\n hasYSlider = true\n return dz\n }\n // Either explicit x or defaulted (ECharts defaults sliders to xAxis\n // when no axis index is provided).\n hasXSlider = true\n if (hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n return { entries, hasXSlider, hasYSlider }\n}\n\n/**\n * If a reactive (store-driven) y formatter is provided, re-build the\n * scatter tooltip formatter using it. Otherwise, return the structural\n * formatter unchanged so the original `xFormatter` / `yFormatter`\n * baked into `scatterplotOptions` still applies. The structural\n * formatter has stable identity per `scatterplotOptions` call, so this\n * path doesn't churn ECharts on every render.\n */\nfunction buildReactiveScatterTooltipFormatter(\n structuralFormatter: unknown,\n reactiveYFormatter: ((value: number) => string) | undefined,\n xFormatter: ((value: number) => string) | undefined,\n) {\n if (!reactiveYFormatter) return structuralFormatter\n return createTooltipFormatter((item) => {\n const value = item.value as readonly [number, number] | undefined\n const x = value?.[0]\n const y = value?.[1]\n const formattedX =\n typeof x === 'number' ? (xFormatter ? xFormatter(x) : String(x)) : ''\n const formattedY =\n typeof y === 'number' ? reactiveYFormatter(y) : String(y ?? '')\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n return {\n name: `(${formattedX}, ${formattedY})`,\n seriesName,\n marker,\n value: '',\n }\n })\n}\n\nfunction buildScatterTooltipFormatter(\n xFormatter: ((value: number) => string) | undefined,\n yFormatter: ((value: number) => string) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const value = item.value as readonly [number, number] | undefined\n const x = value?.[0]\n const y = value?.[1]\n const formattedX =\n typeof x === 'number' ? (xFormatter ? xFormatter(x) : String(x)) : ''\n const formattedY =\n typeof y === 'number' ? (yFormatter ? yFormatter(y) : String(y)) : ''\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n return {\n name: `(${formattedX}, ${formattedY})`,\n seriesName,\n marker,\n value: '',\n }\n })\n}\n\nfunction computeScatterBounds(seriesArr: ScatterplotWidgetData): {\n niceMinX: number\n niceMaxX: number\n niceMinY: number\n niceMaxY: number\n} {\n let minX = Infinity\n let maxX = -Infinity\n let minY = Infinity\n let maxY = -Infinity\n for (const series of seriesArr) {\n for (const point of series) {\n const x = point?.[0]\n const y = point?.[1]\n if (typeof x === 'number' && Number.isFinite(x)) {\n if (x < minX) minX = x\n if (x > maxX) maxX = x\n }\n if (typeof y === 'number' && Number.isFinite(y)) {\n if (y < minY) minY = y\n if (y > maxY) maxY = y\n }\n }\n }\n // Mirror bar's `computeNiceBounds`: clamp min to 0 when data is\n // non-negative (gridline reads cleanly from zero), apply `niceNum` to\n // negative mins, and floor max=0 to 1 so the chart always has range.\n // Scatter can have free coordinates so we apply this per-axis.\n const niceMaxX = Number.isFinite(maxX) ? (maxX <= 0 ? 1 : niceNum(maxX)) : 1\n const niceMaxY = Number.isFinite(maxY) ? (maxY <= 0 ? 1 : niceNum(maxY)) : 1\n const niceMinX = Number.isFinite(minX) ? (minX < 0 ? niceNum(minX) : 0) : 0\n const niceMinY = Number.isFinite(minY) ? (minY < 0 ? niceNum(minY) : 0) : 0\n return { niceMinX, niceMaxX, niceMinY, niceMaxY }\n}\n","import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n grid: {\n position: 'relative',\n flex: '1 1 auto',\n width: '100%',\n },\n legend: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(2),\n height: ({ spacing }) => spacing(5),\n },\n legendItem: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(1.5),\n },\n} satisfies Record<string, SxProps<Theme>>\n\n// `sx` callback that needs runtime args — extracted at module scope so the\n// `styles` object can satisfy `Record<string, SxProps<Theme>>` cleanly\n// (function `sx`-with-args isn't assignable to plain `SxProps<Theme>`).\nconst dotSx = (top: string, left: string, size: number): SxProps<Theme> => ({\n position: 'absolute',\n top,\n left,\n width: size,\n height: size,\n borderRadius: '50%',\n})\n\nexport interface ScatterplotSkeletonProps {\n /** Number of dots to render. */\n count?: number\n}\n\n/**\n * Loading state for the Scatterplot widget. Mirrors a scatter chart's\n * silhouette — a deterministic spread of small circular dots in the plot\n * area plus a legend stub — so the skeleton reads as \"a scatter chart\"\n * rather than a generic list. Matches bar/histogram/pie skeleton structure\n * (grid stub + legend stub in a flex column).\n */\nexport function ScatterplotSkeleton({ count = 24 }: ScatterplotSkeletonProps) {\n // Deterministic pseudo-scatter positions so the skeleton doesn't flicker.\n const dots = Array.from({ length: count }, (_, i) => {\n const top = 10 + ((i * 37) % 80)\n const left = 5 + ((i * 53) % 90)\n const size = 8 + ((i * 7) % 6)\n return { top: `${top}%`, left: `${left}%`, size }\n })\n return (\n <Box sx={styles.container}>\n <Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>\n )\n}\n","import {\n buildCsvDownloadItem,\n withPngItem,\n type DownloadItem,\n type WidgetDownloadArgs,\n} from '../actions/download'\nimport type { ScatterplotWidgetData } from './types'\n\n/**\n * Download menu items for the Scatterplot widget. Always includes a CSV item\n * with `series, x, y` columns (one row per point). When `getCaptureEl` is\n * given, prepends a PNG item that rasterises the captured element via\n * `html2canvas`.\n */\nexport function createScatterplotDownloadConfig(\n args: WidgetDownloadArgs<ScatterplotWidgetData> & {\n seriesNames?: readonly string[]\n },\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const rows: unknown[][] = [['series', 'x', 'y']]\n for (const [i, series] of data.entries()) {\n const seriesName = args.seriesNames?.[i] ?? `series_${i + 1}`\n for (const [x, y] of series) {\n rows.push([seriesName, x, y])\n }\n }\n return rows\n },\n }),\n )\n}\n","/**\n * Scatterplot-specific `RelativeData` transform. Scatter data is\n * `[number, number][]` — each series is a list of `[x, y]` tuples.\n * Relative is a values-axis concept, so this rewrites `y` to its\n * share of the series's total `y` (0–100) and leaves `x` raw — x is\n * coordinate space, not part of the cohort total.\n *\n * Pass to `<Widget.RelativeData transform={toRelativeScatterplotData} />`.\n *\n * The denominator is the sum of |y| across the series so mixed-sign\n * y values produce sane signed shares-of-magnitude. A series whose\n * total y-magnitude is zero (all-zero or empty input) is returned\n * unchanged so a stalled or empty data set doesn't show misleading 0%\n * values. Inputs whose shape isn't `[number, number][]` fall through\n * untouched.\n */\nexport const toRelativeScatterplotData = (input: unknown): unknown => {\n if (!Array.isArray(input)) return input\n return input.map((series: unknown): unknown => {\n if (!isXyTupleArray(series)) return series\n const total = series.reduce((acc, [, y]) => acc + Math.abs(y), 0)\n if (total <= 0) return series\n return series.map(([x, y]) => [x, (y / total) * 100] as [number, number])\n })\n}\n\nfunction isXyTupleArray(v: unknown): v is [number, number][] {\n if (!Array.isArray(v)) return false\n return v.every(\n (item) =>\n Array.isArray(item) &&\n item.length === 2 &&\n typeof item[0] === 'number' &&\n Number.isFinite(item[0]) &&\n typeof item[1] === 'number' &&\n Number.isFinite(item[1]),\n )\n}\n\n/**\n * `LockSelection` filter for Scatterplot. Data is `[number, number][][]` —\n * points have no `name`, so selection (and locking) is keyed on a synthetic\n * `${seriesIndex}:${dataIndex}` string (same format `useChartSelection`'s\n * `keyFromClick`/`keysFromBrush` produce for this widget). Unlike Histogram,\n * a point's position carries no external meaning (no `ticks` to desync from),\n * so non-locked points are removed outright rather than zeroed.\n */\nexport function filterScatterplotByLockedPoints(\n input: unknown,\n lockedItems: readonly (string | number)[],\n): unknown {\n if (lockedItems.length === 0) return input\n if (!Array.isArray(input)) return input\n const locked = new Set<string>(lockedItems.map(String))\n return input.map((series: unknown, seriesIndex: number): unknown => {\n if (!isXyTupleArray(series)) return series\n return series.filter((_, dataIndex) =>\n locked.has(`${seriesIndex}:${dataIndex}`),\n )\n })\n}\n"],"mappings":";;;;;;;;;AAoCA,SAAgB,EAAmB,EACjC,UACA,eACA,iBACoD;CACpD,OAAO;EACL,MAAM;GACJ,MAAM,SAAS,EAAM,QAAQ,CAAC,CAAC;GAC/B,KAAK,SAAS,EAAM,QAAQ,CAAC,CAAC;GAC9B,OAAO,SAAS,EAAM,QAAQ,CAAC,CAAC;GAEhC,GAAG,EAAgB,IAAO,CAAK;GAC/B,cAAc;EAChB;EACA,SAAS;GAGP,SAAS;GACT,iBAAiB,EAAM,QAAQ,KAAK;GACpC,aAAa;GACb,SAAS,CAAC,SAAS,EAAM,QAAQ,CAAC,CAAC,GAAG,SAAS,EAAM,QAAQ,CAAC,CAAC,CAAC;GAChE,WAAW;IACT,OAAO,EAAM,QAAQ,OAAO;IAC5B,UAAU;IACV,YAAY,EAAM,WAAW,QAAQ;GACvC;GACA,UAAU,EAAwB,CAAK;GACvC,WAAW,EAA6B,GAAY,CAAU;EAChE;EAGA,QAAQ,EACN,GAAG,EAAkB;GAAE,WAAW;GAAO,gBAAgB,KAAA;EAAU,CAAC,EACtE;EACA,aAAa,EAAE,WAAW,EAAE,OAAO,EAAM,QAAQ,KAAK,KAAK,EAAE;EAC7D,OAAO,CACL,EAAM,QAAQ,UAAU,MACxB,GAAG,OAAO,OACP,EAAM,QACJ,aAAa,QAAQ,CAAC,CAC3B,CACF;EACA,OAAO;GACL,MAAM;GACN,UAAU,EAAE,MAAM,GAAM;GACxB,UAAU,EAAE,MAAM,GAAM;GACxB,WAAW;IACT,GAAG,EAAoB,CAAK;IAC5B,QAAQ,SAAS,EAAM,QAAQ,CAAC,CAAC;IACjC,aAAa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ACF;;;ACpBA,IAAa,KAA6B,MACnC,MAAM,QAAQ,CAAK,IACjB,EAAM,KAAK,MAA6B;CAC7C,IAAI,CAAC,EAAe,CAAM,GAAG,OAAO;CACpC,IAAM,IAAQ,EAAO,QAAQ,GAAK,GAAG,OAAO,IAAM,KAAK,IAAI,CAAC,GAAG,CAAC;CAEhE,OADI,KAAS,IAAU,IAChB,EAAO,KAAK,CAAC,GAAG,OAAO,CAAC,GAAI,IAAI,IAAS,GAAG,CAAqB;AAC1E,CAAC,IANiC;AASpC,SAAS,EAAe,GAAqC;CAE3D,OADK,MAAM,QAAQ,CAAC,IACb,EAAE,OACN,MACC,MAAM,QAAQ,CAAI,KAClB,EAAK,WAAW,KAChB,OAAO,EAAK,MAAO,YACnB,OAAO,SAAS,EAAK,EAAE,KACvB,OAAO,EAAK,MAAO,YACnB,OAAO,SAAS,EAAK,EAAE,CAC3B,IAT8B;AAUhC;AAUA,SAAgB,EACd,GACA,GACS;CAET,IADI,EAAY,WAAW,KACvB,CAAC,MAAM,QAAQ,CAAK,GAAG,OAAO;CAClC,IAAM,IAAS,IAAI,IAAY,EAAY,IAAI,MAAM,CAAC;CACtD,OAAO,EAAM,KAAK,GAAiB,MAC5B,EAAe,CAAM,IACnB,EAAO,QAAQ,GAAG,MACvB,EAAO,IAAI,GAAG,EAAY,GAAG,GAAW,CAC1C,IAHoC,CAIrC;AACH"}
|
|
1
|
+
{"version":3,"file":"scatterplot.js","names":["{ count = 24 }: ScatterplotSkeletonProps","count = 24","Box","styles.grid","dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))","styles.container","(_, i) => {\n const top = 10 + ((i * 37) % 80)\n const left = 5 + ((i * 53) % 90)\n const size = 8 + ((i * 7) % 6)\n return { top: `${top}%`, left: `${left}%`, size }\n }","(d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n )","<Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>","<Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>","(i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n )","<Box sx={styles.container}>\n <Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>","i","_c","ZOOM_LAYOUT","buildCsvDownloadItem","withPngItem","resolveThemeColor","niceNum","buildLegendConfig","buildAxisLabelStyle","createTooltipFormatter","buildGridConfig","createTooltipPositioner","createItemColorResolver","echarts","getScatterplotXY","isTuple","point","isScatterplotDatum","v","isFiniteNumber","x","y","withScatterplotXY","scatterplotOptions","theme","buildScatterTooltipFormatter","xFormatter","yFormatter","createScatterplotOptionFactory","options","series","symbolSize","selection","selectionSet","option","structural","optionsOverride","mergeOptions","seriesArr","data","hasLegend","baseLegend","baseGrid","baseTooltip","baseXAxis","baseYAxis","reactiveFormatter","ctx","computeScatterBounds","seriesTemplates","makeDimColor","baseColor","seriesIdx","params","base","key","dataZoomLayout","layoutDataZoomForScatter","hasXSlider","hasYSlider","fallbackBottom","baseBottom","gridBottom","fallbackRight","gridRight","s","overrideColor","i","niceMinX","niceMaxX","niceMinY","niceMaxY","buildReactiveScatterTooltipFormatter","dataZoom","entry","dz","reactiveYFormatter","value","item","formattedX","formattedY","marker","seriesName","structuralFormatter","minX","maxX","minY","maxY","styles","spacing","dotSx","size","ScatterplotSkeleton","$","c","t1","t0","count","T0","T1","t2","t3","t4","dots","_temp","Box","_temp2","t5","t6","_temp3","t7","Skeleton","i_1","d","i_0","top","left","createScatterplotDownloadConfig","args","rows","toRelativeScatterplotData","input","isPointArray","total","acc","p","filterScatterplotByLockedPoints","lockedItems","locked","seriesIndex","dataIndex"],"sources":["../../src/widgets/scatterplot/points.ts","../../src/widgets/scatterplot/options.ts","../../src/widgets/scatterplot/skeleton.tsx","../../src/widgets/scatterplot/download.ts","../../src/widgets/scatterplot/transforms.ts"],"sourcesContent":["import type { ScatterplotItem } from './types'\n\n/** `[x, y]` of a {@link ScatterplotItem}, whichever form it takes. */\nexport function getScatterplotXY(\n point: ScatterplotItem,\n): readonly [number, number] {\n return isTuple(point) ? point : [point.x, point.y]\n}\n\n/** Whether `v` is a valid {@link ScatterplotItem} with finite coordinates. */\nexport function isScatterplotDatum(v: unknown): v is ScatterplotItem {\n if (Array.isArray(v)) {\n return v.length === 2 && isFiniteNumber(v[0]) && isFiniteNumber(v[1])\n }\n if (v == null || typeof v !== 'object') return false\n const { x, y } = v as { x?: unknown; y?: unknown }\n return isFiniteNumber(x) && isFiniteNumber(y)\n}\n\n/** Same point with new coordinates; keeps the object form (and `color`). */\nexport function withScatterplotXY(\n point: ScatterplotItem,\n x: number,\n y: number,\n): ScatterplotItem {\n return isTuple(point) ? [x, y] : { ...point, x, y }\n}\n\nfunction isTuple(point: ScatterplotItem): point is readonly [number, number] {\n return Array.isArray(point)\n}\n\nfunction isFiniteNumber(v: unknown): v is number {\n return typeof v === 'number' && Number.isFinite(v)\n}\n","import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildAxisLabelStyle,\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../utils/option-builders'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions, resolveThemeColor } from '../utils'\nimport { createItemColorResolver } from '../utils/item-color'\nimport { getScatterplotXY } from './points'\nimport type {\n ScatterplotEChartsOption,\n ScatterplotOptionFactoryInput,\n ScatterplotOptionsInput,\n ScatterplotItem,\n ScatterplotWidgetData,\n} from './types'\n\n/**\n * Builds the **structural** ECharts option for a scatterplot widget — both\n * axes `type: 'value'` (not category, unlike Bar/Histogram), grid, tooltip\n * triggered per-item rather than per-axis. Intentionally data-agnostic: no\n * series, no dataset, no `legend.show` (those depend on data and are added\n * by {@link createScatterplotOptionFactory}).\n *\n * Styling parity with v1: dark themed tooltip via `createTooltipFormatter`\n * + `createTooltipPositioner`, `buildGridConfig`-based grid, polished\n * axisLine/Tick/splitLine, `overlineDelicate` axis labels, structural\n * legend wired via `buildLegendConfig` (toggled by the merger), and the\n * CARTO `qualitative.bold + secondary` palette — same pattern bar /\n * histogram / pie already use. {@link createScatterplotOptionFactory}\n * wraps this builder in its structural-phase branch.\n */\nexport function scatterplotOptions({\n theme,\n xFormatter,\n yFormatter,\n}: ScatterplotOptionsInput): ScatterplotEChartsOption {\n return {\n grid: {\n left: parseInt(theme.spacing(1)),\n top: parseInt(theme.spacing(3)),\n right: parseInt(theme.spacing(1)),\n // Default: no legend. Merger bumps `bottom` when there are >1 series.\n ...buildGridConfig(false, theme),\n containLabel: true,\n },\n tooltip: {\n // Per-point trigger — different from Bar's 'axis' trigger because\n // points don't share an x-coordinate.\n trigger: 'item',\n backgroundColor: theme.palette.grey[900],\n borderWidth: 0,\n padding: [parseInt(theme.spacing(1)), parseInt(theme.spacing(1))],\n textStyle: {\n color: theme.palette.common.white,\n fontSize: 11,\n fontFamily: theme.typography.caption.fontFamily,\n },\n position: createTooltipPositioner(theme),\n formatter: buildScatterTooltipFormatter(xFormatter, yFormatter),\n },\n // Legend styling baked here; `show` is toggled by the merger based on\n // series count.\n legend: {\n ...buildLegendConfig({ hasLegend: false, labelFormatter: undefined }),\n },\n axisPointer: { lineStyle: { color: theme.palette.grey[400] } },\n color: [\n theme.palette.secondary.main,\n ...Object.values(\n (theme.palette as { qualitative?: { bold?: Record<string, string> } })\n .qualitative?.bold ?? {},\n ),\n ],\n xAxis: {\n type: 'value',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n hideOverlap: true,\n showMinLabel: true,\n showMaxLabel: true,\n ...(xFormatter && { formatter: xFormatter }),\n },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n },\n yAxis: {\n type: 'value',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n ...buildAxisLabelStyle(theme),\n margin: parseInt(theme.spacing(1)),\n hideOverlap: true,\n showMinLabel: true,\n showMaxLabel: true,\n ...(yFormatter && { formatter: yFormatter }),\n },\n splitLine: {\n show: true,\n lineStyle: { color: theme.palette.black?.[4] ?? theme.palette.divider },\n },\n },\n } as ScatterplotEChartsOption\n}\n\n/**\n * Returns the scatterplot widget's {@link OptionFactory} — one closure\n * that owns BOTH phases of option construction:\n *\n * - **Structural phase** (`option == null`) — builds the theme-aware\n * structural option via {@link scatterplotOptions}, optionally merging\n * the consumer-supplied `optionsOverride`. Called once by Provider to\n * seed `rawOptions` in the store.\n * - **Merge phase** (`option != null`) — fuses post-pipeline `state.data`\n * (`ScatterplotWidgetData`) into the option via the dataset API. Each\n * series's `[x, y]` tuples land in `dataset[i].source` as 2-column\n * rows; the series uses positional encoding (`encode: { x: 0, y: 1 }`)\n * and `type: 'scatter'`. niceMin/niceMax are computed over both axes\n * so the chart frames data on rounded extents and numeric jitters\n * don't shift gridlines per render. Reactive `ctx.formatter` (driven\n * by RelativeData) re-derives the y-axis label and tooltip at fusion\n * time; `xFormatter` stays baked at structural-build time (relative\n * is a values-axis concept; x is coordinate-space).\n *\n * When `ZoomToggle` installs a `dataZoom` slider, grid bottom is\n * extended and the slider is positioned above the legend row (if any) —\n * same layout dance bar / histogram / timeseries do.\n */\nexport function createScatterplotOptionFactory(\n options: ScatterplotOptionFactoryInput,\n): OptionFactory {\n const { theme, xFormatter, yFormatter, optionsOverride } = options\n const series = options.series\n const symbolSize = options.symbolSize ?? 8\n const selection = options.selection\n const selectionSet =\n selection && selection.length > 0 ? new Set<string>(selection) : null\n return (option, data, ctx) => {\n if (option == null) {\n const structural = scatterplotOptions({ theme, xFormatter, yFormatter })\n return optionsOverride\n ? (mergeOptions(\n structural as unknown as Record<string, unknown>,\n optionsOverride as Partial<Record<string, unknown>>,\n ) as EChartsOption)\n : structural\n }\n\n const seriesArr = Array.isArray(data)\n ? (data as ScatterplotWidgetData<ScatterplotItem>)\n : []\n if (seriesArr.length === 0) {\n return { ...option, dataset: [], series: [] }\n }\n const hasLegend = seriesArr.length > 1\n const baseLegend =\n typeof option.legend === 'object' && !Array.isArray(option.legend)\n ? option.legend\n : {}\n const baseGrid =\n typeof option.grid === 'object' && !Array.isArray(option.grid)\n ? option.grid\n : {}\n const baseTooltip =\n typeof option.tooltip === 'object' && !Array.isArray(option.tooltip)\n ? option.tooltip\n : {}\n const baseXAxis =\n typeof option.xAxis === 'object' && !Array.isArray(option.xAxis)\n ? option.xAxis\n : {}\n const baseYAxis =\n typeof option.yAxis === 'object' && !Array.isArray(option.yAxis)\n ? option.yAxis\n : {}\n\n const reactiveFormatter = ctx?.formatter\n\n const { niceMinX, niceMaxX, niceMinY, niceMaxY } =\n computeScatterBounds(seriesArr)\n\n // Dim non-selected points via `series.itemStyle.color`. The selection\n // key is `${seriesIndex}:${dataIndex}`; we read those off the params\n // ECharts hands to the callback per-data.\n //\n // We *always* emit `itemStyle.color` (a passthrough when nothing is\n // selected), not conditionally — dropping the key between renders\n // would let ECharts' default merge keep the previous callback alive\n // and items would stay dimmed forever after an external clear.\n // Keeping the key always-present means a plain setOption merge swaps\n // the callback in place, no `replaceMerge` and no entry-animation\n // flash on selection on/off.\n //\n // The base colour is the point's own `color` (object points), else the\n // template's `itemStyle.color`, else the series colour / palette.\n const seriesTemplates = Array.isArray(option.series) ? option.series : []\n const makeDimColor = (seriesIdx: number, datums: readonly unknown[]) => {\n const baseColor = createItemColorResolver({\n theme,\n datums,\n template: seriesTemplates[seriesIdx] ?? seriesTemplates[0],\n fallback: (params) => params.color as string,\n })\n return (params: CallbackDataParams) => {\n const base = baseColor(params)\n if (!selectionSet) return base\n const key = `${seriesIdx}:${params.dataIndex}`\n return selectionSet.has(key)\n ? base\n : echarts.color.modifyAlpha(base, 0.15)\n }\n }\n\n // Zoom slider layout: when ZoomToggle has installed `dataZoom`,\n // reserve grid space and lift any x-slider above the legend (if\n // present). Scatter supports 2D zoom via `axes: ['x', 'y']` — in\n // that case there's also a vertical y-slider on the right edge, so\n // we reserve `grid.right` separately. Inside-only dataZoom entries\n // (no `type: 'slider'`) take no grid space.\n const dataZoomLayout = layoutDataZoomForScatter(option.dataZoom, hasLegend)\n const hasXSlider = dataZoomLayout?.hasXSlider ?? false\n const hasYSlider = dataZoomLayout?.hasYSlider ?? false\n const fallbackBottom =\n typeof baseGrid.bottom === 'number' ? baseGrid.bottom : 24\n const baseBottom = hasLegend ? 56 : fallbackBottom\n const gridBottom = hasXSlider\n ? baseBottom + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : baseBottom\n const fallbackRight =\n typeof baseGrid.right === 'number' ? baseGrid.right : 8\n const gridRight = hasYSlider\n ? fallbackRight + ZOOM_LAYOUT.sliderHeight + ZOOM_LAYOUT.sliderGap\n : fallbackRight\n\n return {\n ...option,\n // ECharts dataset.source wants a mutable [number, number][] shape; we\n // hold readonly tuples internally, so cast at the boundary. Object\n // points are flattened to `[x, y]` so the positional encode and the\n // tooltip keep reading tuples.\n dataset: seriesArr.map((s) => ({\n source: (s.every(Array.isArray)\n ? s\n : s.map(getScatterplotXY)) as unknown as number[][],\n })),\n series: seriesArr.map((s, i) => {\n const overrideColor = resolveThemeColor(theme, series?.[i]?.color)\n return {\n type: 'scatter' as const,\n datasetIndex: i,\n name: series?.[i]?.name ?? `Series ${i + 1}`,\n encode: { x: 0, y: 1 },\n symbolSize,\n emphasis: { focus: 'series' },\n itemStyle: { color: makeDimColor(i, s) },\n ...(overrideColor ? { color: overrideColor } : {}),\n }\n }),\n legend: { ...baseLegend, show: hasLegend },\n grid: { ...baseGrid, bottom: gridBottom, right: gridRight },\n ...(dataZoomLayout ? { dataZoom: dataZoomLayout.entries } : {}),\n xAxis: {\n ...baseXAxis,\n min: niceMinX,\n max: niceMaxX,\n } as EChartsOption['xAxis'],\n yAxis: {\n ...baseYAxis,\n min: niceMinY,\n max: niceMaxY,\n axisLabel: {\n ...((baseYAxis as { axisLabel?: object }).axisLabel ?? {}),\n // Re-derive the y-axis formatter at fusion time so RelativeData's\n // percent formatter (written to `state.formatter`) flows through\n // without rebuilding the structural option. Falls back to the\n // structural `yFormatter` already baked in `baseYAxis.axisLabel`\n // (which `String(value)` if neither is set).\n ...(reactiveFormatter ? { formatter: reactiveFormatter } : {}),\n },\n } as EChartsOption['yAxis'],\n tooltip: {\n ...baseTooltip,\n // Rebuild the tooltip formatter so the live y-axis formatter is\n // applied to the y-coordinate in the (x, y) label. xFormatter is\n // structural — relative is a values-axis concept, so xFormatter\n // doesn't change under RelativeData.\n formatter: buildReactiveScatterTooltipFormatter(\n (baseTooltip as { formatter?: unknown }).formatter,\n reactiveFormatter,\n xFormatter,\n ),\n },\n } as EChartsOption\n }\n}\n\n/**\n * Lay out the `dataZoom` array for the scatter chart:\n * - Detect whether any horizontal (x-axis) slider is present — if so\n * lift it above the legend row when a legend is shown.\n * - Detect whether any vertical (y-axis) slider is present — the\n * caller reserves `grid.right` so the slider doesn't overlap the\n * plot area.\n *\n * Returns `null` when there's no `dataZoom` so callers can skip the\n * layout adjustment entirely. An entry is considered an \"x-slider\" if\n * it has `xAxisIndex` set (or no axis index — defaults to x in ECharts).\n * A \"y-slider\" has `yAxisIndex` set.\n */\nfunction layoutDataZoomForScatter(\n dataZoom: unknown,\n hasLegend: boolean,\n): { entries: unknown[]; hasXSlider: boolean; hasYSlider: boolean } | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n let hasXSlider = false\n let hasYSlider = false\n const entries = dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as {\n type?: string\n xAxisIndex?: unknown\n yAxisIndex?: unknown\n bottom?: number\n }\n if (dz.type !== 'slider') return dz\n const targetsY = dz.yAxisIndex !== undefined\n if (targetsY) {\n hasYSlider = true\n return dz\n }\n // Either explicit x or defaulted (ECharts defaults sliders to xAxis\n // when no axis index is provided).\n hasXSlider = true\n if (hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n return { entries, hasXSlider, hasYSlider }\n}\n\n/**\n * If a reactive (store-driven) y formatter is provided, re-build the\n * scatter tooltip formatter using it. Otherwise, return the structural\n * formatter unchanged so the original `xFormatter` / `yFormatter`\n * baked into `scatterplotOptions` still applies. The structural\n * formatter has stable identity per `scatterplotOptions` call, so this\n * path doesn't churn ECharts on every render.\n */\nfunction buildReactiveScatterTooltipFormatter(\n structuralFormatter: unknown,\n reactiveYFormatter: ((value: number) => string) | undefined,\n xFormatter: ((value: number) => string) | undefined,\n) {\n if (!reactiveYFormatter) return structuralFormatter\n return createTooltipFormatter((item) => {\n const value = item.value as readonly [number, number] | undefined\n const x = value?.[0]\n const y = value?.[1]\n const formattedX =\n typeof x === 'number' ? (xFormatter ? xFormatter(x) : String(x)) : ''\n const formattedY =\n typeof y === 'number' ? reactiveYFormatter(y) : String(y ?? '')\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n return {\n name: `(${formattedX}, ${formattedY})`,\n seriesName,\n marker,\n value: '',\n }\n })\n}\n\nfunction buildScatterTooltipFormatter(\n xFormatter: ((value: number) => string) | undefined,\n yFormatter: ((value: number) => string) | undefined,\n) {\n return createTooltipFormatter((item) => {\n const value = item.value as readonly [number, number] | undefined\n const x = value?.[0]\n const y = value?.[1]\n const formattedX =\n typeof x === 'number' ? (xFormatter ? xFormatter(x) : String(x)) : ''\n const formattedY =\n typeof y === 'number' ? (yFormatter ? yFormatter(y) : String(y)) : ''\n const marker = typeof item.marker === 'string' ? item.marker : ''\n const seriesName = item.seriesName ? `${item.seriesName}: ` : ''\n return {\n name: `(${formattedX}, ${formattedY})`,\n seriesName,\n marker,\n value: '',\n }\n })\n}\n\nfunction computeScatterBounds(\n seriesArr: ScatterplotWidgetData<ScatterplotItem>,\n): {\n niceMinX: number\n niceMaxX: number\n niceMinY: number\n niceMaxY: number\n} {\n let minX = Infinity\n let maxX = -Infinity\n let minY = Infinity\n let maxY = -Infinity\n for (const series of seriesArr) {\n for (const point of series) {\n if (point == null) continue\n const [x, y] = getScatterplotXY(point)\n if (typeof x === 'number' && Number.isFinite(x)) {\n if (x < minX) minX = x\n if (x > maxX) maxX = x\n }\n if (typeof y === 'number' && Number.isFinite(y)) {\n if (y < minY) minY = y\n if (y > maxY) maxY = y\n }\n }\n }\n // Mirror bar's `computeNiceBounds`: clamp min to 0 when data is\n // non-negative (gridline reads cleanly from zero), apply `niceNum` to\n // negative mins, and floor max=0 to 1 so the chart always has range.\n // Scatter can have free coordinates so we apply this per-axis.\n const niceMaxX = Number.isFinite(maxX) ? (maxX <= 0 ? 1 : niceNum(maxX)) : 1\n const niceMaxY = Number.isFinite(maxY) ? (maxY <= 0 ? 1 : niceNum(maxY)) : 1\n const niceMinX = Number.isFinite(minX) ? (minX < 0 ? niceNum(minX) : 0) : 0\n const niceMinY = Number.isFinite(minY) ? (minY < 0 ? niceNum(minY) : 0) : 0\n return { niceMinX, niceMaxX, niceMinY, niceMaxY }\n}\n","import { Box, Skeleton } from '@mui/material'\nimport type { SxProps, Theme } from '@mui/material'\n\nconst styles = {\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }) => spacing(1),\n height: ({ spacing }) => spacing(38),\n },\n grid: {\n position: 'relative',\n flex: '1 1 auto',\n width: '100%',\n },\n legend: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(2),\n height: ({ spacing }) => spacing(5),\n },\n legendItem: {\n display: 'flex',\n alignItems: 'center',\n gap: ({ spacing }) => spacing(1.5),\n },\n} satisfies Record<string, SxProps<Theme>>\n\n// `sx` callback that needs runtime args — extracted at module scope so the\n// `styles` object can satisfy `Record<string, SxProps<Theme>>` cleanly\n// (function `sx`-with-args isn't assignable to plain `SxProps<Theme>`).\nconst dotSx = (top: string, left: string, size: number): SxProps<Theme> => ({\n position: 'absolute',\n top,\n left,\n width: size,\n height: size,\n borderRadius: '50%',\n})\n\nexport interface ScatterplotSkeletonProps {\n /** Number of dots to render. */\n count?: number\n}\n\n/**\n * Loading state for the Scatterplot widget. Mirrors a scatter chart's\n * silhouette — a deterministic spread of small circular dots in the plot\n * area plus a legend stub — so the skeleton reads as \"a scatter chart\"\n * rather than a generic list. Matches bar/histogram/pie skeleton structure\n * (grid stub + legend stub in a flex column).\n */\nexport function ScatterplotSkeleton({ count = 24 }: ScatterplotSkeletonProps) {\n // Deterministic pseudo-scatter positions so the skeleton doesn't flicker.\n const dots = Array.from({ length: count }, (_, i) => {\n const top = 10 + ((i * 37) % 80)\n const left = 5 + ((i * 53) % 90)\n const size = 8 + ((i * 7) % 6)\n return { top: `${top}%`, left: `${left}%`, size }\n })\n return (\n <Box sx={styles.container}>\n <Box sx={styles.grid}>\n {dots.map((d, i) => (\n <Skeleton\n key={`dot-${i}`}\n variant='circular'\n sx={dotSx(d.top, d.left, d.size)}\n />\n ))}\n </Box>\n <Box sx={styles.legend}>\n {[0, 1].map((i) => (\n <Box key={`legend-${i}`} sx={styles.legendItem}>\n <Skeleton variant='circular' width={8} height={8} />\n <Skeleton width={48} height={8} />\n </Box>\n ))}\n </Box>\n </Box>\n )\n}\n","import {\n buildCsvDownloadItem,\n withPngItem,\n type DownloadItem,\n type WidgetDownloadArgs,\n} from '../actions/download'\nimport { getScatterplotXY } from './points'\nimport type { ScatterplotItem, ScatterplotWidgetData } from './types'\n\n/**\n * Download menu items for the Scatterplot widget. Always includes a CSV item\n * with `series, x, y` columns (one row per point). When `getCaptureEl` is\n * given, prepends a PNG item that rasterises the captured element via\n * `html2canvas`.\n */\nexport function createScatterplotDownloadConfig(\n args: WidgetDownloadArgs<ScatterplotWidgetData<ScatterplotItem>> & {\n seriesNames?: readonly string[]\n },\n): DownloadItem[] {\n return withPngItem(\n args,\n buildCsvDownloadItem({\n filename: args.filename,\n getRows: (ctx) => {\n const data = args.getData(ctx)\n const rows: unknown[][] = [['series', 'x', 'y']]\n for (const [i, series] of data.entries()) {\n const seriesName = args.seriesNames?.[i] ?? `series_${i + 1}`\n for (const point of series) {\n const [x, y] = getScatterplotXY(point)\n rows.push([seriesName, x, y])\n }\n }\n return rows\n },\n }),\n )\n}\n","import {\n getScatterplotXY,\n isScatterplotDatum,\n withScatterplotXY,\n} from './points'\nimport type { ScatterplotItem } from './types'\n\n/**\n * Scatterplot-specific `RelativeData` transform. Scatter data is\n * `ScatterplotItem[][]` — each series is a list of `[x, y]` tuples or\n * `{ x, y, color? }` points (whose shape is kept).\n * Relative is a values-axis concept, so this rewrites `y` to its\n * share of the series's total `y` (0–100) and leaves `x` raw — x is\n * coordinate space, not part of the cohort total.\n *\n * Pass to `<Widget.RelativeData transform={toRelativeScatterplotData} />`.\n *\n * The denominator is the sum of |y| across the series so mixed-sign\n * y values produce sane signed shares-of-magnitude. A series whose\n * total y-magnitude is zero (all-zero or empty input) is returned\n * unchanged so a stalled or empty data set doesn't show misleading 0%\n * values. Inputs whose shape isn't `ScatterplotItem[]` fall through\n * untouched.\n */\nexport const toRelativeScatterplotData = (input: unknown): unknown => {\n if (!Array.isArray(input)) return input\n return input.map((series: unknown): unknown => {\n if (!isPointArray(series)) return series\n const total = series.reduce(\n (acc, p) => acc + Math.abs(getScatterplotXY(p)[1]),\n 0,\n )\n if (total <= 0) return series\n return series.map((p) => {\n const [x, y] = getScatterplotXY(p)\n return withScatterplotXY(p, x, (y / total) * 100)\n })\n })\n}\n\nfunction isPointArray(v: unknown): v is ScatterplotItem[] {\n return Array.isArray(v) && v.every(isScatterplotDatum)\n}\n\n/**\n * `LockSelection` filter for Scatterplot. Data is `ScatterplotItem[][]` —\n * points have no `name`, so selection (and locking) is keyed on a synthetic\n * `${seriesIndex}:${dataIndex}` string (same format `useChartSelection`'s\n * `keyFromClick`/`keysFromBrush` produce for this widget). Unlike Histogram,\n * a point's position carries no external meaning (no `ticks` to desync from),\n * so non-locked points are removed outright rather than zeroed.\n */\nexport function filterScatterplotByLockedPoints(\n input: unknown,\n lockedItems: readonly (string | number)[],\n): unknown {\n if (lockedItems.length === 0) return input\n if (!Array.isArray(input)) return input\n const locked = new Set<string>(lockedItems.map(String))\n return input.map((series: unknown, seriesIndex: number): unknown => {\n if (!isPointArray(series)) return series\n return series.filter((_, dataIndex) =>\n locked.has(`${seriesIndex}:${dataIndex}`),\n )\n })\n}\n"],"mappings":";;;;;;;;;AAGA,SAAgB0B,EACd,GAC2B;CAC3B,OAAOC,EAAQC,CAAK,IAAIA,IAAQ,CAACA,EAAM,GAAGA,EAAM,CAAC;AACnD;AAGA,SAAgBC,EAAmB,GAAkC;CACnE,IAAI,MAAM,QAAQC,CAAC,GACjB,OAAOA,EAAE,WAAW,KAAKC,EAAeD,EAAE,EAAE,KAAKC,EAAeD,EAAE,EAAE;CAEtE,IAAiB,OAAOA,KAAM,aAA1BA,GAAoC,OAAO;CAC/C,IAAM,EAAE,MAAG,SAAMA;CACjB,OAAOC,EAAeC,CAAC,KAAKD,EAAeE,CAAC;AAC9C;AAGA,SAAgBC,EACd,GACA,GACA,GACiB;CACjB,OAAOP,EAAQC,CAAK,IAAI,CAACI,GAAGC,CAAC,IAAI;EAAE,GAAGL;EAAO;EAAG;CAAE;A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