@carto/ps-react-ui 6.4.0 → 6.5.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-DyWNwvLu.js → actions-D_PVFZaM.js} +4 -4
- package/dist/{actions-DyWNwvLu.js.map → actions-D_PVFZaM.js.map} +1 -1
- package/dist/{category-BHBd5Pcc.js → category-UIGvFN3D.js} +4 -4
- package/dist/{category-BHBd5Pcc.js.map → category-UIGvFN3D.js.map} +1 -1
- package/dist/chat.js +472 -470
- package/dist/chat.js.map +1 -1
- package/dist/{components-CTUpdQuj.js → components-DDJU4m0t.js} +8 -8
- package/dist/components-DDJU4m0t.js.map +1 -0
- package/dist/components.js +2 -2
- package/dist/{download-B4sykOFm.js → download-DIj1Iz0t.js} +2 -2
- package/dist/{download-B4sykOFm.js.map → download-DIj1Iz0t.js.map} +1 -1
- package/dist/{formula-DJS-JLpk.js → formula-CSHhAoyW.js} +4 -4
- package/dist/{formula-DJS-JLpk.js.map → formula-CSHhAoyW.js.map} +1 -1
- package/dist/{item-color-B7xkIpDZ.js → item-color-7o7pFBR2.js} +26 -18
- package/dist/item-color-7o7pFBR2.js.map +1 -0
- package/dist/markdown-B8lLR-NY.js +106 -0
- package/dist/markdown-B8lLR-NY.js.map +1 -0
- package/dist/{spread-CQwFIwuz.js → spread-BRfPPIep.js} +3 -3
- package/dist/{spread-CQwFIwuz.js.map → spread-BRfPPIep.js.map} +1 -1
- package/dist/style-DTLuIo84.js +87 -0
- package/dist/style-DTLuIo84.js.map +1 -0
- package/dist/{styles-BCEBm7xh.js → styles-yKcpfyNV.js} +5 -5
- package/dist/styles-yKcpfyNV.js.map +1 -0
- package/dist/{table-DEdW_fDj.js → table-Col_FRvb.js} +2 -2
- package/dist/{table-DEdW_fDj.js.map → table-Col_FRvb.js.map} +1 -1
- package/dist/theme/tailwind.css +373 -0
- package/dist/theme.js +123 -0
- package/dist/theme.js.map +1 -0
- package/dist/types/components/lasso-tool/styles.d.ts +4 -4
- package/dist/types/theme/create-carto-theme.d.ts +7 -0
- package/dist/types/theme/deep-merge.d.ts +6 -0
- package/dist/types/theme/generate-tailwind-css.d.ts +8 -0
- package/dist/types/theme/index.d.ts +2 -0
- package/dist/types/widgets/markdown/style.d.ts +74 -0
- package/dist/types/widgets/utils/spacing-px.d.ts +13 -0
- package/dist/{utils-C-eWwOhE.js → utils-Dw4y8tiq.js} +2 -2
- package/dist/{utils-C-eWwOhE.js.map → utils-Dw4y8tiq.js.map} +1 -1
- package/dist/widgets/actions.js +3 -3
- package/dist/widgets/bar.js +54 -54
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/formula.js +1 -1
- package/dist/widgets/histogram.js +70 -70
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/markdown.js +1 -1
- package/dist/widgets/pie.js +78 -78
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +82 -82
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/spread.js +1 -1
- package/dist/widgets/table.js +1 -1
- package/dist/widgets/timeseries.js +62 -62
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets.js +283 -279
- package/dist/widgets.js.map +1 -1
- package/dist/{zoom-toggle-MmLjMTEw.js → zoom-toggle-DqrV_0Ji.js} +2 -2
- package/dist/{zoom-toggle-MmLjMTEw.js.map → zoom-toggle-DqrV_0Ji.js.map} +1 -1
- package/package.json +8 -1
- package/src/chat/bubbles/styles.ts +2 -0
- package/src/components/lasso-tool/lasso-tool-inline.test.tsx +4 -4
- package/src/components/lasso-tool/lasso-tool-inline.tsx +6 -6
- package/src/components/lasso-tool/styles.ts +4 -4
- package/src/theme/create-carto-theme.test.ts +53 -0
- package/src/theme/create-carto-theme.ts +21 -0
- package/src/theme/deep-merge.test.ts +25 -0
- package/src/theme/deep-merge.ts +22 -0
- package/src/theme/generate-tailwind-css.test.ts +87 -0
- package/src/theme/generate-tailwind-css.ts +178 -0
- package/src/theme/index.ts +2 -0
- package/src/theme/tailwind-compile.test.ts +71 -0
- package/src/theme/tailwind.css +373 -0
- package/src/widgets/bar/options.ts +7 -6
- package/src/widgets/histogram/options.ts +7 -6
- package/src/widgets/markdown/style.ts +40 -0
- package/src/widgets/note/widget-note.tsx +4 -1
- package/src/widgets/pie/options.ts +5 -4
- package/src/widgets/scatterplot/options.ts +7 -6
- package/src/widgets/timeseries/options.ts +7 -6
- package/src/widgets/utils/css-variables-theme.test.ts +32 -0
- package/src/widgets/utils/option-builders.ts +4 -6
- package/src/widgets/utils/spacing-px.test.ts +42 -0
- package/src/widgets/utils/spacing-px.ts +24 -0
- package/dist/components-CTUpdQuj.js.map +0 -1
- package/dist/item-color-B7xkIpDZ.js.map +0 -1
- package/dist/markdown-DmvLi3vx.js +0 -159
- package/dist/markdown-DmvLi3vx.js.map +0 -1
- package/dist/styles-BCEBm7xh.js.map +0 -1
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { r as e } from "../zoom-toggle-
|
|
1
|
+
import { r as e } from "../zoom-toggle-DqrV_0Ji.js";
|
|
2
2
|
import { n as t } from "../scale-Bhx8HKEB.js";
|
|
3
|
-
import { n, t as r } from "../download-
|
|
4
|
-
import { r as i, t as a } from "../utils-
|
|
5
|
-
import { c as o, i as s,
|
|
6
|
-
import { c as
|
|
7
|
-
import { Box as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import * as
|
|
3
|
+
import { n, t as r } from "../download-DIj1Iz0t.js";
|
|
4
|
+
import { r as i, t as a } from "../utils-Dw4y8tiq.js";
|
|
5
|
+
import { c as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p } from "../item-color-7o7pFBR2.js";
|
|
6
|
+
import { c as m } from "react/compiler-runtime";
|
|
7
|
+
import { Box as h, Skeleton as g } from "@mui/material";
|
|
8
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
9
|
+
import * as y from "echarts";
|
|
10
10
|
//#region src/widgets/scatterplot/points.ts
|
|
11
|
-
function y(e) {
|
|
12
|
-
return S(e) ? e : [e.x, e.y];
|
|
13
|
-
}
|
|
14
11
|
function b(e) {
|
|
15
|
-
|
|
12
|
+
return C(e) ? e : [e.x, e.y];
|
|
13
|
+
}
|
|
14
|
+
function x(e) {
|
|
15
|
+
if (Array.isArray(e)) return e.length === 2 && w(e[0]) && w(e[1]);
|
|
16
16
|
if (typeof e != "object" || !e) return !1;
|
|
17
17
|
let { x: t, y: n } = e;
|
|
18
|
-
return
|
|
18
|
+
return w(t) && w(n);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function S(e, t, n) {
|
|
21
|
+
return C(e) ? [t, n] : {
|
|
22
22
|
...e,
|
|
23
23
|
x: t,
|
|
24
24
|
y: n
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function C(e) {
|
|
28
28
|
return Array.isArray(e);
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function w(e) {
|
|
31
31
|
return typeof e == "number" && Number.isFinite(e);
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/widgets/scatterplot/options.ts
|
|
35
|
-
function
|
|
35
|
+
function T({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
36
36
|
return {
|
|
37
37
|
grid: {
|
|
38
|
-
left:
|
|
39
|
-
top:
|
|
40
|
-
right:
|
|
41
|
-
...
|
|
38
|
+
left: c(e, 1),
|
|
39
|
+
top: c(e, 3),
|
|
40
|
+
right: c(e, 1),
|
|
41
|
+
...d(!1, e),
|
|
42
42
|
containLabel: !0
|
|
43
43
|
},
|
|
44
44
|
tooltip: {
|
|
45
45
|
trigger: "item",
|
|
46
46
|
backgroundColor: e.palette.grey[900],
|
|
47
47
|
borderWidth: 0,
|
|
48
|
-
padding: [
|
|
48
|
+
padding: [c(e, 1), c(e, 1)],
|
|
49
49
|
textStyle: {
|
|
50
50
|
color: e.palette.common.white,
|
|
51
51
|
fontSize: 11,
|
|
52
52
|
fontFamily: e.typography.caption.fontFamily
|
|
53
53
|
},
|
|
54
|
-
position:
|
|
55
|
-
formatter:
|
|
54
|
+
position: f(e),
|
|
55
|
+
formatter: k(t, n)
|
|
56
56
|
},
|
|
57
57
|
legend: { ...s({
|
|
58
58
|
hasLegend: !1,
|
|
@@ -65,8 +65,8 @@ function w({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
65
65
|
axisLine: { show: !1 },
|
|
66
66
|
axisTick: { show: !1 },
|
|
67
67
|
axisLabel: {
|
|
68
|
-
...
|
|
69
|
-
margin:
|
|
68
|
+
...l(e),
|
|
69
|
+
margin: c(e, 1),
|
|
70
70
|
hideOverlap: !0,
|
|
71
71
|
showMinLabel: !0,
|
|
72
72
|
showMaxLabel: !0,
|
|
@@ -82,8 +82,8 @@ function w({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
82
82
|
axisLine: { show: !1 },
|
|
83
83
|
axisTick: { show: !1 },
|
|
84
84
|
axisLabel: {
|
|
85
|
-
...
|
|
86
|
-
margin:
|
|
85
|
+
...l(e),
|
|
86
|
+
margin: c(e, 1),
|
|
87
87
|
hideOverlap: !0,
|
|
88
88
|
showMinLabel: !0,
|
|
89
89
|
showMaxLabel: !0,
|
|
@@ -96,11 +96,11 @@ function w({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
let { theme: r, xFormatter: o, yFormatter: s, optionsOverride: c } = n, l = n.series, u = n.symbolSize ?? 8, d = n.selection,
|
|
99
|
+
function E(n) {
|
|
100
|
+
let { theme: r, xFormatter: o, yFormatter: s, optionsOverride: c } = n, l = n.series, u = n.symbolSize ?? 8, d = n.selection, f = d && d.length > 0 ? new Set(d) : null;
|
|
101
101
|
return (n, d, m) => {
|
|
102
102
|
if (n == null) {
|
|
103
|
-
let e =
|
|
103
|
+
let e = T({
|
|
104
104
|
theme: r,
|
|
105
105
|
xFormatter: o,
|
|
106
106
|
yFormatter: s
|
|
@@ -113,8 +113,8 @@ function T(n) {
|
|
|
113
113
|
dataset: [],
|
|
114
114
|
series: []
|
|
115
115
|
};
|
|
116
|
-
let g = h.length > 1, _ = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {},
|
|
117
|
-
let n =
|
|
116
|
+
let g = h.length > 1, _ = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, v = typeof n.grid == "object" && !Array.isArray(n.grid) ? n.grid : {}, x = typeof n.tooltip == "object" && !Array.isArray(n.tooltip) ? n.tooltip : {}, S = typeof n.xAxis == "object" && !Array.isArray(n.xAxis) ? n.xAxis : {}, C = typeof n.yAxis == "object" && !Array.isArray(n.yAxis) ? n.yAxis : {}, w = m?.formatter, { niceMinX: E, niceMaxX: k, niceMinY: j, niceMaxY: M } = A(h, t(C)), N = Array.isArray(n.series) ? n.series : [], P = (e, t) => {
|
|
117
|
+
let n = p({
|
|
118
118
|
theme: r,
|
|
119
119
|
datums: t,
|
|
120
120
|
template: N[e] ?? N[0],
|
|
@@ -122,14 +122,14 @@ function T(n) {
|
|
|
122
122
|
});
|
|
123
123
|
return (t) => {
|
|
124
124
|
let r = n(t);
|
|
125
|
-
if (!
|
|
125
|
+
if (!f) return r;
|
|
126
126
|
let i = `${e}:${t.dataIndex}`;
|
|
127
|
-
return
|
|
127
|
+
return f.has(i) ? r : y.color.modifyAlpha(r, .15);
|
|
128
128
|
};
|
|
129
|
-
}, F =
|
|
129
|
+
}, F = D(n.dataZoom, g), I = F?.hasXSlider ?? !1, L = F?.hasYSlider ?? !1, R = typeof v.bottom == "number" ? v.bottom : 24, z = g ? 56 : R, B = I ? z + e.sliderHeight + e.sliderGap : z, V = typeof v.right == "number" ? v.right : 8, H = L ? V + e.sliderHeight + e.sliderGap : V;
|
|
130
130
|
return {
|
|
131
131
|
...n,
|
|
132
|
-
dataset: h.map((e) => ({ source: e.every(Array.isArray) ? e : e.map(
|
|
132
|
+
dataset: h.map((e) => ({ source: e.every(Array.isArray) ? e : e.map(b) })),
|
|
133
133
|
series: h.map((e, t) => {
|
|
134
134
|
let n = a(r, l?.[t]?.color);
|
|
135
135
|
return {
|
|
@@ -151,15 +151,15 @@ function T(n) {
|
|
|
151
151
|
show: g
|
|
152
152
|
},
|
|
153
153
|
grid: {
|
|
154
|
-
...
|
|
154
|
+
...v,
|
|
155
155
|
bottom: B,
|
|
156
156
|
right: H
|
|
157
157
|
},
|
|
158
158
|
...F ? { dataZoom: F.entries } : {},
|
|
159
159
|
xAxis: {
|
|
160
160
|
...S,
|
|
161
|
-
min:
|
|
162
|
-
max:
|
|
161
|
+
min: E,
|
|
162
|
+
max: k
|
|
163
163
|
},
|
|
164
164
|
yAxis: {
|
|
165
165
|
...C,
|
|
@@ -167,17 +167,17 @@ function T(n) {
|
|
|
167
167
|
max: M,
|
|
168
168
|
axisLabel: {
|
|
169
169
|
...C.axisLabel ?? {},
|
|
170
|
-
...
|
|
170
|
+
...w ? { formatter: w } : {}
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
tooltip: {
|
|
174
174
|
...x,
|
|
175
|
-
formatter:
|
|
175
|
+
formatter: O(x.formatter, w, o)
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function D(t, n) {
|
|
181
181
|
if (!Array.isArray(t) || t.length === 0) return null;
|
|
182
182
|
let r = !1, i = !1;
|
|
183
183
|
return {
|
|
@@ -193,8 +193,8 @@ function E(t, n) {
|
|
|
193
193
|
hasYSlider: i
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return t ?
|
|
196
|
+
function O(e, t, n) {
|
|
197
|
+
return t ? u((e) => {
|
|
198
198
|
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}: ` : "";
|
|
199
199
|
return {
|
|
200
200
|
name: `(${o}, ${s})`,
|
|
@@ -204,8 +204,8 @@ function D(e, t, n) {
|
|
|
204
204
|
};
|
|
205
205
|
}) : e;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
207
|
+
function k(e, t) {
|
|
208
|
+
return u((n) => {
|
|
209
209
|
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}: ` : "";
|
|
210
210
|
return {
|
|
211
211
|
name: `(${o}, ${s})`,
|
|
@@ -215,11 +215,11 @@ function O(e, t) {
|
|
|
215
215
|
};
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function A(e, t = {}) {
|
|
219
219
|
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity;
|
|
220
220
|
for (let t of e) for (let e of t) {
|
|
221
221
|
if (e == null) continue;
|
|
222
|
-
let [t, o] =
|
|
222
|
+
let [t, o] = b(e);
|
|
223
223
|
typeof t == "number" && Number.isFinite(t) && (t < n && (n = t), t > r && (r = t)), typeof o == "number" && Number.isFinite(o) && (o < i && (i = o), o > a && (a = o));
|
|
224
224
|
}
|
|
225
225
|
let s = Number.isFinite(r) ? r <= 0 ? 1 : o(r) : 1, c = Number.isFinite(a) ? a <= 0 ? 1 : t.max ?? o(a) : 1;
|
|
@@ -232,7 +232,7 @@ function k(e, t = {}) {
|
|
|
232
232
|
}
|
|
233
233
|
//#endregion
|
|
234
234
|
//#region src/widgets/scatterplot/skeleton.tsx
|
|
235
|
-
var
|
|
235
|
+
var j = {
|
|
236
236
|
container: {
|
|
237
237
|
display: "flex",
|
|
238
238
|
alignItems: "center",
|
|
@@ -257,7 +257,7 @@ var A = {
|
|
|
257
257
|
alignItems: "center",
|
|
258
258
|
gap: ({ spacing: e }) => e(1.5)
|
|
259
259
|
}
|
|
260
|
-
},
|
|
260
|
+
}, M = (e, t, n) => ({
|
|
261
261
|
position: "absolute",
|
|
262
262
|
top: e,
|
|
263
263
|
left: t,
|
|
@@ -265,48 +265,48 @@ var A = {
|
|
|
265
265
|
height: n,
|
|
266
266
|
borderRadius: "50%"
|
|
267
267
|
});
|
|
268
|
-
function
|
|
269
|
-
let t =
|
|
268
|
+
function N(e) {
|
|
269
|
+
let t = m(15), { count: n } = e, r = n === void 0 ? 24 : n, i, a, o, s, c;
|
|
270
270
|
if (t[0] !== r) {
|
|
271
|
-
let e = Array.from({ length: r },
|
|
272
|
-
a =
|
|
271
|
+
let e = Array.from({ length: r }, I);
|
|
272
|
+
a = h, c = j.container, i = h, o = j.grid, s = e.map(F), t[0] = r, t[1] = i, t[2] = a, t[3] = o, t[4] = s, t[5] = c;
|
|
273
273
|
} else i = t[1], a = t[2], o = t[3], s = t[4], c = t[5];
|
|
274
274
|
let l;
|
|
275
|
-
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */
|
|
275
|
+
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */ _(i, {
|
|
276
276
|
sx: o,
|
|
277
277
|
children: s
|
|
278
278
|
}), t[6] = i, t[7] = o, t[8] = s, t[9] = l) : l = t[9];
|
|
279
279
|
let u;
|
|
280
|
-
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
281
|
-
sx:
|
|
282
|
-
children: [0, 1].map(
|
|
280
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ _(h, {
|
|
281
|
+
sx: j.legend,
|
|
282
|
+
children: [0, 1].map(P)
|
|
283
283
|
}), t[10] = u) : u = t[10];
|
|
284
284
|
let d;
|
|
285
|
-
return t[11] !== a || t[12] !== c || t[13] !== l ? (d = /* @__PURE__ */
|
|
285
|
+
return t[11] !== a || t[12] !== c || t[13] !== l ? (d = /* @__PURE__ */ v(a, {
|
|
286
286
|
sx: c,
|
|
287
287
|
children: [l, u]
|
|
288
288
|
}), t[11] = a, t[12] = c, t[13] = l, t[14] = d) : d = t[14], d;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
sx:
|
|
293
|
-
children: [/* @__PURE__ */ g
|
|
290
|
+
function P(e) {
|
|
291
|
+
return /* @__PURE__ */ v(h, {
|
|
292
|
+
sx: j.legendItem,
|
|
293
|
+
children: [/* @__PURE__ */ _(g, {
|
|
294
294
|
variant: "circular",
|
|
295
295
|
width: 8,
|
|
296
296
|
height: 8
|
|
297
|
-
}), /* @__PURE__ */ g
|
|
297
|
+
}), /* @__PURE__ */ _(g, {
|
|
298
298
|
width: 48,
|
|
299
299
|
height: 8
|
|
300
300
|
})]
|
|
301
301
|
}, `legend-${e}`);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */ g
|
|
303
|
+
function F(e, t) {
|
|
304
|
+
return /* @__PURE__ */ _(g, {
|
|
305
305
|
variant: "circular",
|
|
306
|
-
sx:
|
|
306
|
+
sx: M(e.top, e.left, e.size)
|
|
307
307
|
}, `dot-${t}`);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function I(e, t) {
|
|
310
310
|
let n = 10 + t * 37 % 80, r = 5 + t * 53 % 90, i = 8 + t * 7 % 6;
|
|
311
311
|
return {
|
|
312
312
|
top: `${n}%`,
|
|
@@ -316,7 +316,7 @@ function F(e, t) {
|
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
318
|
//#region src/widgets/scatterplot/download.ts
|
|
319
|
-
function
|
|
319
|
+
function L(e) {
|
|
320
320
|
return r(e, n({
|
|
321
321
|
filename: e.filename,
|
|
322
322
|
getRows: (t) => {
|
|
@@ -328,7 +328,7 @@ function I(e) {
|
|
|
328
328
|
for (let [t, i] of n.entries()) {
|
|
329
329
|
let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
|
|
330
330
|
for (let e of i) {
|
|
331
|
-
let [t, i] =
|
|
331
|
+
let [t, i] = b(e);
|
|
332
332
|
r.push([
|
|
333
333
|
n,
|
|
334
334
|
t,
|
|
@@ -342,23 +342,23 @@ function I(e) {
|
|
|
342
342
|
}
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region src/widgets/scatterplot/transforms.ts
|
|
345
|
-
var
|
|
346
|
-
if (!
|
|
347
|
-
let t = e.reduce((e, t) => e + Math.abs(
|
|
345
|
+
var R = (e) => Array.isArray(e) ? e.map((e) => {
|
|
346
|
+
if (!z(e)) return e;
|
|
347
|
+
let t = e.reduce((e, t) => e + Math.abs(b(t)[1]), 0);
|
|
348
348
|
return t <= 0 ? e : e.map((e) => {
|
|
349
|
-
let [n, r] =
|
|
350
|
-
return
|
|
349
|
+
let [n, r] = b(e);
|
|
350
|
+
return S(e, n, r / t * 100);
|
|
351
351
|
});
|
|
352
352
|
}) : e;
|
|
353
|
-
function
|
|
354
|
-
return Array.isArray(e) && e.every(
|
|
353
|
+
function z(e) {
|
|
354
|
+
return Array.isArray(e) && e.every(x);
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function B(e, t) {
|
|
357
357
|
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
358
358
|
let n = new Set(t.map(String));
|
|
359
|
-
return e.map((e, t) =>
|
|
359
|
+
return e.map((e, t) => z(e) ? e.filter((e, r) => n.has(`${t}:${r}`)) : e);
|
|
360
360
|
}
|
|
361
361
|
//#endregion
|
|
362
|
-
export {
|
|
362
|
+
export { N as ScatterplotSkeleton, L as createScatterplotDownloadConfig, E as createScatterplotOptionFactory, B as filterScatterplotByLockedPoints, b as getScatterplotXY, T as scatterplotOptions, R as toRelativeScatterplotData };
|
|
363
363
|
|
|
364
364
|
//# 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","_c","ZOOM_LAYOUT","fixedAxisBounds","withPngItem","mergeOptions","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","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","fixedY","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","buildCsvDownloadItem","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'\nimport { fixedAxisBounds } from '../actions/relative-data/scale'\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 } = computeScatterBounds(\n seriesArr,\n // A config transform (RelativeData's `'total'` scale) may pin the\n // y ends; each applies only on the side the data reaches.\n fixedAxisBounds(baseYAxis),\n )\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 fixedY: { min?: number; max?: number } = {},\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)\n ? maxY <= 0\n ? 1\n : (fixedY.max ?? niceNum(maxY))\n : 1\n const niceMinX = Number.isFinite(minX) ? (minX < 0 ? niceNum(minX) : 0) : 0\n const niceMinY = Number.isFinite(minY)\n ? minY < 0\n ? (fixedY.min ?? niceNum(minY))\n : 0\n : 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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AQ;KAC1B,IAAM,CAACV,GAAGC,KAAKP,EAAiBE,CAAK;KACrC,EAAK,KAAK;MAACiE;MAAY7D;MAAGC;KAAC,CAAC;IAC9B;GACF;GACA,OAAOmG;EACT;CACF,CAAC,CACH;AACF;;;ACdA,IAAaC,KAA6B,MACnC,MAAM,QAAQC,CAAK,IACjBA,EAAM,KAAK,MAA6B;CAC7C,IAAI,CAACC,EAAa7F,CAAM,GAAG,OAAOA;CAClC,IAAM8F,IAAQ9F,EAAO,QAClB,GAAK,MAAM+F,IAAM,KAAK,IAAI/G,EAAiBgH,CAAC,CAAC,CAAC,EAAE,GACjD,CACF;CAEA,OADIF,KAAS,IAAU9F,IAChBA,EAAO,KAAK,MAAM;EACvB,IAAM,CAACV,GAAGC,KAAKP,EAAiBgH,CAAC;EACjC,OAAOxG,EAAkBwG,GAAG1G,GAAIC,IAAIuG,IAAS,GAAG;CAClD,CAAC;AACH,CAAC,IAZiCF;AAepC,SAASC,EAAa,GAAoC;CACxD,OAAO,MAAM,QAAQzG,CAAC,KAAKA,EAAE,MAAMD,CAAkB;AACvD;AAUA,SAAgB8G,EACd,GACA,GACS;CAET,IADIC,EAAY,WAAW,KACvB,CAAC,MAAM,QAAQN,CAAK,GAAG,OAAOA;CAClC,IAAMO,IAAS,IAAI,IAAYD,EAAY,IAAI,MAAM,CAAC;CACtD,OAAON,EAAM,KAAK,GAAiB,MAC5BC,EAAa7F,CAAM,IACjBA,EAAO,QAAQ,GAAG,MACvBmG,EAAO,IAAI,GAAGC,EAAY,GAAGC,GAAW,CAC1C,IAHkCrG,CAInC;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","fixedAxisBounds","withPngItem","mergeOptions","resolveThemeColor","niceNum","buildLegendConfig","spacingPx","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","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","fixedY","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","buildCsvDownloadItem","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 { spacingPx } from '../utils/spacing-px'\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'\nimport { fixedAxisBounds } from '../actions/relative-data/scale'\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: spacingPx(theme, 1),\n top: spacingPx(theme, 3),\n right: spacingPx(theme, 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: [spacingPx(theme, 1), spacingPx(theme, 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: spacingPx(theme, 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: spacingPx(theme, 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 } = computeScatterBounds(\n seriesArr,\n // A config transform (RelativeData's `'total'` scale) may pin the\n // y ends; each applies only on the side the data reaches.\n fixedAxisBounds(baseYAxis),\n )\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 fixedY: { min?: number; max?: number } = {},\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)\n ? maxY <= 0\n ? 1\n : (fixedY.max ?? niceNum(maxY))\n : 1\n const niceMinX = Number.isFinite(minX) ? (minX < 0 ? niceNum(minX) : 0) : 0\n const niceMinY = Number.isFinite(minY)\n ? minY < 0\n ? (fixedY.min ?? niceNum(minY))\n : 0\n : 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,SAAgB4B,EACd,GAC2B;CAC3B,OAAOC,EAAQC,CAAK,IAAIA,IAAQ,CAACA,EAAM,GAAGA,EAAM,CAAC;AACnD;AAGA,SAAgBC,EAAmB,GAAkC;CACnE,IAAI,MAAM,QAAQC,CAAC,GACjB,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EAAa7F,CAAM,GAAG,OAAOA;CAClC,IAAM8F,IAAQ9F,EAAO,QAClB,GAAK,MAAM+F,IAAM,KAAK,IAAI/G,EAAiBgH,CAAC,CAAC,CAAC,EAAE,GACjD,CACF;CAEA,OADIF,KAAS,IAAU9F,IAChBA,EAAO,KAAK,MAAM;EACvB,IAAM,CAACV,GAAGC,KAAKP,EAAiBgH,CAAC;EACjC,OAAOxG,EAAkBwG,GAAG1G,GAAIC,IAAIuG,IAAS,GAAG;CAClD,CAAC;AACH,CAAC,IAZiCF;AAepC,SAASC,EAAa,GAAoC;CACxD,OAAO,MAAM,QAAQzG,CAAC,KAAKA,EAAE,MAAMD,CAAkB;AACvD;AAUA,SAAgB8G,EACd,GACA,GACS;CAET,IADIC,EAAY,WAAW,KACvB,CAAC,MAAM,QAAQN,CAAK,GAAG,OAAOA;CAClC,IAAMO,IAAS,IAAI,IAAYD,EAAY,IAAI,MAAM,CAAC;CACtD,OAAON,EAAM,KAAK,GAAiB,MAC5BC,EAAa7F,CAAM,IACjBA,EAAO,QAAQ,GAAG,MACvBmG,EAAO,IAAI,GAAGC,EAAY,GAAGC,GAAW,CAC1C,IAHkCrG,CAInC;AACH"}
|
package/dist/widgets/spread.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../spread-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../spread-BRfPPIep.js";
|
|
2
2
|
export { r as Separator, t as Spread, i as SpreadSkeleton, e as SpreadUI, n as createSpreadDownloadConfig, a as getSpreadBand };
|
package/dist/widgets/table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../table-
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, m as o, n as s, o as c, p as l, r as u, s as d, t as f, u as p } from "../table-Col_FRvb.js";
|
|
2
2
|
export { o as DEFAULT_TABLE_LABELS, r as DEFAULT_TABLE_PAGE_SIZE, l as DEFAULT_TABLE_PAGE_SIZE_OPTIONS, i as Table, u as TableSkeleton, n as TableUI, e as compareValues, s as createTableDownloadConfig, c as deriveVisibleRows, f as filterTableByLockedRows, d as paginateRows, t as resolveColumns, a as sortRows, p as tableDataToCsv };
|