@carto/ps-react-ui 4.8.0 → 4.9.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/range-l4fNHLEg.js +213 -0
- package/dist/range-l4fNHLEg.js.map +1 -0
- package/dist/resolve-theme-color-BdojIw0K.js +47 -0
- package/dist/resolve-theme-color-BdojIw0K.js.map +1 -0
- package/dist/table-CQCAnDLb.js +388 -0
- package/dist/table-CQCAnDLb.js.map +1 -0
- package/dist/types/widgets-v2/bar/types.d.ts +8 -3
- package/dist/types/widgets-v2/category/types.d.ts +8 -4
- package/dist/types/widgets-v2/formula/types.d.ts +10 -7
- package/dist/types/widgets-v2/histogram/types.d.ts +7 -3
- package/dist/types/widgets-v2/index.d.ts +1 -0
- package/dist/types/widgets-v2/pie/types.d.ts +10 -3
- package/dist/types/widgets-v2/range/range-ui.d.ts +12 -4
- package/dist/types/widgets-v2/range/range.d.ts +13 -8
- package/dist/types/widgets-v2/scatterplot/types.d.ts +7 -3
- package/dist/types/widgets-v2/table/style.d.ts +0 -4
- package/dist/types/widgets-v2/table/table-ui.d.ts +7 -1
- package/dist/types/widgets-v2/table/table.d.ts +1 -1
- package/dist/types/widgets-v2/table/types.d.ts +13 -2
- package/dist/types/widgets-v2/timeseries/types.d.ts +7 -3
- package/dist/types/widgets-v2/types.d.ts +25 -0
- package/dist/types/widgets-v2/utils/index.d.ts +1 -0
- package/dist/types/widgets-v2/utils/resolve-theme-color.d.ts +18 -0
- package/dist/types/widgets-v2/utils/resolve-theme-color.test.d.ts +1 -0
- package/dist/widgets-v2/bar.js +58 -55
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/histogram.js +65 -62
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/pie.js +100 -94
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/range.js +1 -1
- package/dist/widgets-v2/scatterplot.js +107 -101
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/table.js +2 -2
- package/dist/widgets-v2/timeseries.js +85 -79
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2/utils.js +4 -3
- package/dist/widgets-v2.js +2 -2
- package/dist/widgets-v2.js.map +1 -1
- package/package.json +3 -3
- package/src/widgets-v2/bar/options.test.ts +19 -2
- package/src/widgets-v2/bar/options.ts +9 -3
- package/src/widgets-v2/bar/types.ts +8 -3
- package/src/widgets-v2/category/types.ts +9 -4
- package/src/widgets-v2/formula/types.ts +11 -7
- package/src/widgets-v2/histogram/options.test.ts +16 -2
- package/src/widgets-v2/histogram/options.ts +5 -4
- package/src/widgets-v2/histogram/types.ts +7 -3
- package/src/widgets-v2/index.ts +3 -0
- package/src/widgets-v2/pie/options.test.ts +20 -4
- package/src/widgets-v2/pie/options.ts +21 -17
- package/src/widgets-v2/pie/types.ts +10 -3
- package/src/widgets-v2/range/range-ui.test.tsx +8 -2
- package/src/widgets-v2/range/range-ui.tsx +81 -14
- package/src/widgets-v2/range/range.tsx +14 -8
- package/src/widgets-v2/scatterplot/options.test.ts +15 -3
- package/src/widgets-v2/scatterplot/options.ts +15 -11
- package/src/widgets-v2/scatterplot/types.ts +7 -3
- package/src/widgets-v2/table/style.ts +2 -5
- package/src/widgets-v2/table/table-ui.tsx +40 -7
- package/src/widgets-v2/table/table.tsx +6 -1
- package/src/widgets-v2/table/types.ts +13 -2
- package/src/widgets-v2/timeseries/options.test.ts +17 -2
- package/src/widgets-v2/timeseries/options.ts +10 -3
- package/src/widgets-v2/timeseries/types.ts +7 -3
- package/src/widgets-v2/types.ts +25 -0
- package/src/widgets-v2/utils/index.ts +1 -0
- package/src/widgets-v2/utils/resolve-theme-color.test.ts +43 -0
- package/src/widgets-v2/utils/resolve-theme-color.ts +34 -0
- package/dist/merge-options-DCkkHZIf.js +0 -34
- package/dist/merge-options-DCkkHZIf.js.map +0 -1
- package/dist/range-DsqTjSpg.js +0 -186
- package/dist/range-DsqTjSpg.js.map +0 -1
- package/dist/table-HIpXuq4G.js +0 -390
- package/dist/table-HIpXuq4G.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as E from "echarts";
|
|
2
|
-
import { d as H, g as V, c as W, n as
|
|
3
|
-
import { jsx as
|
|
2
|
+
import { d as H, g as V, c as W, n as S, f as F } from "../option-builders-F-c9ELi1.js";
|
|
3
|
+
import { jsx as x, jsxs as M } from "react/jsx-runtime";
|
|
4
4
|
import { c as q } from "react/compiler-runtime";
|
|
5
|
-
import { Skeleton as I, Box as
|
|
5
|
+
import { Skeleton as I, Box as A } from "@mui/material";
|
|
6
6
|
import "../widget-store-Bw5zRUGg.js";
|
|
7
7
|
import "zustand/shallow";
|
|
8
8
|
import "@mui/icons-material";
|
|
@@ -20,13 +20,13 @@ import "zustand";
|
|
|
20
20
|
import "zustand/vanilla";
|
|
21
21
|
import "zustand/middleware";
|
|
22
22
|
import "zustand/react/shallow";
|
|
23
|
-
import { Z as
|
|
24
|
-
import { m as U } from "../
|
|
23
|
+
import { Z as b } from "../transforms-Cdx4fkU5.js";
|
|
24
|
+
import { m as U, r as J } from "../resolve-theme-color-BdojIw0K.js";
|
|
25
25
|
import "@mui/icons-material/FileDownload";
|
|
26
|
-
import { a as
|
|
26
|
+
import { a as K } from "../exports-Cx-f6m6U.js";
|
|
27
27
|
import "@mui/icons-material/ImageOutlined";
|
|
28
|
-
import { b as
|
|
29
|
-
function
|
|
28
|
+
import { b as Q } from "../png-item-CS4z1iSH.js";
|
|
29
|
+
function ee({
|
|
30
30
|
theme: e,
|
|
31
31
|
xFormatter: t,
|
|
32
32
|
yFormatter: r
|
|
@@ -53,7 +53,7 @@ function Q({
|
|
|
53
53
|
fontFamily: e.typography.caption.fontFamily
|
|
54
54
|
},
|
|
55
55
|
position: V(e),
|
|
56
|
-
formatter:
|
|
56
|
+
formatter: oe(t, r)
|
|
57
57
|
},
|
|
58
58
|
// Legend styling baked here; `show` is toggled by the merger based on
|
|
59
59
|
// series count.
|
|
@@ -125,21 +125,21 @@ function Q({
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Oe(e) {
|
|
129
129
|
const {
|
|
130
130
|
theme: t,
|
|
131
131
|
xFormatter: r,
|
|
132
132
|
yFormatter: i,
|
|
133
133
|
optionsOverride: n
|
|
134
|
-
} = e,
|
|
134
|
+
} = e, s = e.series, a = e.symbolSize ?? 8, l = e.selection, c = l && l.length > 0 ? new Set(l) : null;
|
|
135
135
|
return (o, u, p) => {
|
|
136
136
|
if (o == null) {
|
|
137
|
-
const
|
|
137
|
+
const d = ee({
|
|
138
138
|
theme: t,
|
|
139
139
|
xFormatter: r,
|
|
140
140
|
yFormatter: i
|
|
141
141
|
});
|
|
142
|
-
return n ? U(
|
|
142
|
+
return n ? U(d, n) : d;
|
|
143
143
|
}
|
|
144
144
|
const f = Array.isArray(u) ? u : [];
|
|
145
145
|
if (f.length === 0)
|
|
@@ -148,56 +148,62 @@ function je(e) {
|
|
|
148
148
|
dataset: [],
|
|
149
149
|
series: []
|
|
150
150
|
};
|
|
151
|
-
const
|
|
152
|
-
niceMinX:
|
|
153
|
-
niceMaxX:
|
|
151
|
+
const k = f.length > 1, Y = typeof o.legend == "object" && !Array.isArray(o.legend) ? o.legend : {}, g = typeof o.grid == "object" && !Array.isArray(o.grid) ? o.grid : {}, L = typeof o.tooltip == "object" && !Array.isArray(o.tooltip) ? o.tooltip : {}, T = typeof o.xAxis == "object" && !Array.isArray(o.xAxis) ? o.xAxis : {}, N = typeof o.yAxis == "object" && !Array.isArray(o.yAxis) ? o.yAxis : {}, w = p?.formatter, {
|
|
152
|
+
niceMinX: X,
|
|
153
|
+
niceMaxX: D,
|
|
154
154
|
niceMinY: j,
|
|
155
155
|
niceMaxY: O
|
|
156
|
-
} =
|
|
157
|
-
const
|
|
158
|
-
if (!c) return
|
|
159
|
-
const Z = `${
|
|
160
|
-
return c.has(Z) ?
|
|
161
|
-
},
|
|
156
|
+
} = ie(f), z = (d) => (m) => {
|
|
157
|
+
const y = m.color;
|
|
158
|
+
if (!c) return y;
|
|
159
|
+
const Z = `${d}:${m.dataIndex}`;
|
|
160
|
+
return c.has(Z) ? y : E.color.modifyAlpha(y, 0.15);
|
|
161
|
+
}, h = te(o.dataZoom, k), _ = h?.hasXSlider ?? !1, B = h?.hasYSlider ?? !1, R = typeof g.bottom == "number" ? g.bottom : 24, $ = k ? 56 : R, P = _ ? $ + b.sliderHeight + b.sliderGap : $, C = typeof g.right == "number" ? g.right : 8, G = B ? C + b.sliderHeight + b.sliderGap : C;
|
|
162
162
|
return {
|
|
163
163
|
...o,
|
|
164
164
|
// ECharts dataset.source wants a mutable [number, number][] shape; we
|
|
165
165
|
// hold readonly tuples internally, so cast at the boundary.
|
|
166
|
-
dataset: f.map((
|
|
167
|
-
source:
|
|
168
|
-
})),
|
|
169
|
-
series: f.map((m, d) => ({
|
|
170
|
-
type: "scatter",
|
|
171
|
-
datasetIndex: d,
|
|
172
|
-
name: a?.[d] ?? `Series ${d + 1}`,
|
|
173
|
-
encode: {
|
|
174
|
-
x: 0,
|
|
175
|
-
y: 1
|
|
176
|
-
},
|
|
177
|
-
symbolSize: s,
|
|
178
|
-
emphasis: {
|
|
179
|
-
focus: "series"
|
|
180
|
-
},
|
|
181
|
-
itemStyle: {
|
|
182
|
-
color: z(d)
|
|
183
|
-
}
|
|
166
|
+
dataset: f.map((d) => ({
|
|
167
|
+
source: d
|
|
184
168
|
})),
|
|
169
|
+
series: f.map((d, m) => {
|
|
170
|
+
const y = J(t, s?.[m]?.color);
|
|
171
|
+
return {
|
|
172
|
+
type: "scatter",
|
|
173
|
+
datasetIndex: m,
|
|
174
|
+
name: s?.[m]?.name ?? `Series ${m + 1}`,
|
|
175
|
+
encode: {
|
|
176
|
+
x: 0,
|
|
177
|
+
y: 1
|
|
178
|
+
},
|
|
179
|
+
symbolSize: a,
|
|
180
|
+
emphasis: {
|
|
181
|
+
focus: "series"
|
|
182
|
+
},
|
|
183
|
+
itemStyle: {
|
|
184
|
+
color: z(m)
|
|
185
|
+
},
|
|
186
|
+
...y ? {
|
|
187
|
+
color: y
|
|
188
|
+
} : {}
|
|
189
|
+
};
|
|
190
|
+
}),
|
|
185
191
|
legend: {
|
|
186
|
-
...
|
|
187
|
-
show:
|
|
192
|
+
...Y,
|
|
193
|
+
show: k
|
|
188
194
|
},
|
|
189
195
|
grid: {
|
|
190
|
-
...
|
|
196
|
+
...g,
|
|
191
197
|
bottom: P,
|
|
192
198
|
right: G
|
|
193
199
|
},
|
|
194
|
-
...
|
|
195
|
-
dataZoom:
|
|
200
|
+
...h ? {
|
|
201
|
+
dataZoom: h.entries
|
|
196
202
|
} : {},
|
|
197
203
|
xAxis: {
|
|
198
|
-
...
|
|
199
|
-
min:
|
|
200
|
-
max:
|
|
204
|
+
...T,
|
|
205
|
+
min: X,
|
|
206
|
+
max: D
|
|
201
207
|
},
|
|
202
208
|
yAxis: {
|
|
203
209
|
...N,
|
|
@@ -210,8 +216,8 @@ function je(e) {
|
|
|
210
216
|
// without rebuilding the structural option. Falls back to the
|
|
211
217
|
// structural `yFormatter` already baked in `baseYAxis.axisLabel`
|
|
212
218
|
// (which `String(value)` if neither is set).
|
|
213
|
-
...
|
|
214
|
-
formatter:
|
|
219
|
+
...w ? {
|
|
220
|
+
formatter: w
|
|
215
221
|
} : {}
|
|
216
222
|
}
|
|
217
223
|
},
|
|
@@ -221,30 +227,30 @@ function je(e) {
|
|
|
221
227
|
// applied to the y-coordinate in the (x, y) label. xFormatter is
|
|
222
228
|
// structural — relative is a values-axis concept, so xFormatter
|
|
223
229
|
// doesn't change under RelativeData.
|
|
224
|
-
formatter:
|
|
230
|
+
formatter: re(L.formatter, w, r)
|
|
225
231
|
}
|
|
226
232
|
};
|
|
227
233
|
};
|
|
228
234
|
}
|
|
229
|
-
function
|
|
235
|
+
function te(e, t) {
|
|
230
236
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
231
237
|
let r = !1, i = !1;
|
|
232
238
|
return {
|
|
233
|
-
entries: e.map((
|
|
234
|
-
if (
|
|
235
|
-
const
|
|
236
|
-
return
|
|
237
|
-
...
|
|
238
|
-
bottom:
|
|
239
|
-
} :
|
|
239
|
+
entries: e.map((s) => {
|
|
240
|
+
if (s == null || typeof s != "object") return s;
|
|
241
|
+
const a = s;
|
|
242
|
+
return a.type !== "slider" ? a : a.yAxisIndex !== void 0 ? (i = !0, a) : (r = !0, t ? {
|
|
243
|
+
...a,
|
|
244
|
+
bottom: b.sliderBottomWithLegend
|
|
245
|
+
} : a);
|
|
240
246
|
}),
|
|
241
247
|
hasXSlider: r,
|
|
242
248
|
hasYSlider: i
|
|
243
249
|
};
|
|
244
250
|
}
|
|
245
|
-
function
|
|
246
|
-
return t ?
|
|
247
|
-
const n = i.value,
|
|
251
|
+
function re(e, t, r) {
|
|
252
|
+
return t ? F((i) => {
|
|
253
|
+
const n = i.value, s = n?.[0], a = n?.[1], l = typeof s == "number" ? r ? r(s) : String(s) : "", c = typeof a == "number" ? t(a) : String(a ?? ""), o = typeof i.marker == "string" ? i.marker : "", u = i.seriesName ? `${i.seriesName}: ` : "";
|
|
248
254
|
return {
|
|
249
255
|
name: `(${l}, ${c})`,
|
|
250
256
|
seriesName: u,
|
|
@@ -253,33 +259,33 @@ function te(e, t, r) {
|
|
|
253
259
|
};
|
|
254
260
|
}) : e;
|
|
255
261
|
}
|
|
256
|
-
function
|
|
257
|
-
return
|
|
258
|
-
const i = r.value, n = i?.[0],
|
|
262
|
+
function oe(e, t) {
|
|
263
|
+
return F((r) => {
|
|
264
|
+
const i = r.value, n = i?.[0], s = i?.[1], a = typeof n == "number" ? e ? e(n) : String(n) : "", l = typeof s == "number" ? t ? t(s) : String(s) : "", c = typeof r.marker == "string" ? r.marker : "", o = r.seriesName ? `${r.seriesName}: ` : "";
|
|
259
265
|
return {
|
|
260
|
-
name: `(${
|
|
266
|
+
name: `(${a}, ${l})`,
|
|
261
267
|
seriesName: o,
|
|
262
268
|
marker: c,
|
|
263
269
|
value: ""
|
|
264
270
|
};
|
|
265
271
|
});
|
|
266
272
|
}
|
|
267
|
-
function
|
|
273
|
+
function ie(e) {
|
|
268
274
|
let t = 1 / 0, r = -1 / 0, i = 1 / 0, n = -1 / 0;
|
|
269
275
|
for (const o of e)
|
|
270
276
|
for (const u of o) {
|
|
271
277
|
const p = u?.[0], f = u?.[1];
|
|
272
278
|
typeof p == "number" && Number.isFinite(p) && (p < t && (t = p), p > r && (r = p)), typeof f == "number" && Number.isFinite(f) && (f < i && (i = f), f > n && (n = f));
|
|
273
279
|
}
|
|
274
|
-
const
|
|
280
|
+
const s = Number.isFinite(r) ? r <= 0 ? 1 : S(r) : 1, a = Number.isFinite(n) ? n <= 0 ? 1 : S(n) : 1, l = Number.isFinite(t) && t < 0 ? S(t) : 0, c = Number.isFinite(i) && i < 0 ? S(i) : 0;
|
|
275
281
|
return {
|
|
276
282
|
niceMinX: l,
|
|
277
|
-
niceMaxX:
|
|
283
|
+
niceMaxX: s,
|
|
278
284
|
niceMinY: c,
|
|
279
|
-
niceMaxY:
|
|
285
|
+
niceMaxY: a
|
|
280
286
|
};
|
|
281
287
|
}
|
|
282
|
-
const
|
|
288
|
+
const v = {
|
|
283
289
|
container: {
|
|
284
290
|
display: "flex",
|
|
285
291
|
alignItems: "center",
|
|
@@ -314,7 +320,7 @@ const A = {
|
|
|
314
320
|
spacing: e
|
|
315
321
|
}) => e(1.5)
|
|
316
322
|
}
|
|
317
|
-
},
|
|
323
|
+
}, ne = (e, t, r) => ({
|
|
318
324
|
position: "absolute",
|
|
319
325
|
top: e,
|
|
320
326
|
left: t,
|
|
@@ -322,38 +328,38 @@ const A = {
|
|
|
322
328
|
height: r,
|
|
323
329
|
borderRadius: "50%"
|
|
324
330
|
});
|
|
325
|
-
function
|
|
331
|
+
function ze(e) {
|
|
326
332
|
const t = q(15), {
|
|
327
333
|
count: r
|
|
328
334
|
} = e, i = r === void 0 ? 24 : r;
|
|
329
|
-
let n,
|
|
335
|
+
let n, s, a, l, c;
|
|
330
336
|
if (t[0] !== i) {
|
|
331
337
|
const f = Array.from({
|
|
332
338
|
length: i
|
|
333
|
-
},
|
|
334
|
-
|
|
339
|
+
}, le);
|
|
340
|
+
s = A, c = v.container, n = A, a = v.grid, l = f.map(ae), t[0] = i, t[1] = n, t[2] = s, t[3] = a, t[4] = l, t[5] = c;
|
|
335
341
|
} else
|
|
336
|
-
n = t[1],
|
|
342
|
+
n = t[1], s = t[2], a = t[3], l = t[4], c = t[5];
|
|
337
343
|
let o;
|
|
338
|
-
t[6] !== n || t[7] !==
|
|
344
|
+
t[6] !== n || t[7] !== a || t[8] !== l ? (o = /* @__PURE__ */ x(n, { sx: a, children: l }), t[6] = n, t[7] = a, t[8] = l, t[9] = o) : o = t[9];
|
|
339
345
|
let u;
|
|
340
|
-
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
346
|
+
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ x(A, { sx: v.legend, children: [0, 1].map(se) }), t[10] = u) : u = t[10];
|
|
341
347
|
let p;
|
|
342
|
-
return t[11] !==
|
|
348
|
+
return t[11] !== s || t[12] !== c || t[13] !== o ? (p = /* @__PURE__ */ M(s, { sx: c, children: [
|
|
343
349
|
o,
|
|
344
350
|
u
|
|
345
|
-
] }), t[11] =
|
|
351
|
+
] }), t[11] = s, t[12] = c, t[13] = o, t[14] = p) : p = t[14], p;
|
|
346
352
|
}
|
|
347
|
-
function
|
|
348
|
-
return /* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
353
|
+
function se(e) {
|
|
354
|
+
return /* @__PURE__ */ M(A, { sx: v.legendItem, children: [
|
|
355
|
+
/* @__PURE__ */ x(I, { variant: "circular", width: 8, height: 8 }),
|
|
356
|
+
/* @__PURE__ */ x(I, { width: 48, height: 8 })
|
|
351
357
|
] }, `legend-${e}`);
|
|
352
358
|
}
|
|
353
359
|
function ae(e, t) {
|
|
354
|
-
return /* @__PURE__ */
|
|
360
|
+
return /* @__PURE__ */ x(I, { variant: "circular", sx: ne(e.top, e.left, e.size) }, `dot-${t}`);
|
|
355
361
|
}
|
|
356
|
-
function
|
|
362
|
+
function le(e, t) {
|
|
357
363
|
const r = 10 + t * 37 % 80, i = 5 + t * 53 % 90, n = 8 + t * 7 % 6;
|
|
358
364
|
return {
|
|
359
365
|
top: `${r}%`,
|
|
@@ -361,9 +367,9 @@ function se(e, t) {
|
|
|
361
367
|
size: n
|
|
362
368
|
};
|
|
363
369
|
}
|
|
364
|
-
function
|
|
370
|
+
function _e(e) {
|
|
365
371
|
const t = [];
|
|
366
|
-
return e.getCaptureEl && t.push(
|
|
372
|
+
return e.getCaptureEl && t.push(Q({
|
|
367
373
|
filename: e.filename,
|
|
368
374
|
getCaptureEl: e.getCaptureEl,
|
|
369
375
|
pixelRatio: e.pngPixelRatio,
|
|
@@ -373,12 +379,12 @@ function ze(e) {
|
|
|
373
379
|
label: "Download as CSV",
|
|
374
380
|
resolve: () => {
|
|
375
381
|
const r = e.getData(), i = [["series", "x", "y"]];
|
|
376
|
-
for (const [
|
|
377
|
-
const l = e.seriesNames?.[
|
|
378
|
-
for (const [c, o] of
|
|
382
|
+
for (const [s, a] of r.entries()) {
|
|
383
|
+
const l = e.seriesNames?.[s] ?? `series_${s + 1}`;
|
|
384
|
+
for (const [c, o] of a)
|
|
379
385
|
i.push([l, c, o]);
|
|
380
386
|
}
|
|
381
|
-
const n =
|
|
387
|
+
const n = K(i);
|
|
382
388
|
return Promise.resolve({
|
|
383
389
|
url: n.url,
|
|
384
390
|
filename: `${e.filename}.csv`,
|
|
@@ -387,19 +393,19 @@ function ze(e) {
|
|
|
387
393
|
}
|
|
388
394
|
}), t;
|
|
389
395
|
}
|
|
390
|
-
const
|
|
391
|
-
if (!
|
|
396
|
+
const Be = (e) => Array.isArray(e) ? e.map((t) => {
|
|
397
|
+
if (!ce(t)) return t;
|
|
392
398
|
const r = t.reduce((i, [, n]) => i + Math.abs(n), 0);
|
|
393
399
|
return r <= 0 ? t : t.map(([i, n]) => [i, n / r * 100]);
|
|
394
400
|
}) : e;
|
|
395
|
-
function
|
|
401
|
+
function ce(e) {
|
|
396
402
|
return Array.isArray(e) ? e.every((t) => Array.isArray(t) && t.length === 2 && typeof t[0] == "number" && Number.isFinite(t[0]) && typeof t[1] == "number" && Number.isFinite(t[1])) : !1;
|
|
397
403
|
}
|
|
398
404
|
export {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
405
|
+
ze as ScatterplotSkeleton,
|
|
406
|
+
_e as createScatterplotDownloadConfig,
|
|
407
|
+
Oe as createScatterplotOptionFactory,
|
|
408
|
+
ee as scatterplotOptions,
|
|
409
|
+
Be as toRelativeScatterplotData
|
|
404
410
|
};
|
|
405
411
|
//# sourceMappingURL=scatterplot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scatterplot.js","sources":["../../src/widgets-v2/scatterplot/options.ts","../../src/widgets-v2/scatterplot/skeleton.tsx","../../src/widgets-v2/scatterplot/download.ts","../../src/widgets-v2/scatterplot/transforms.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../../widgets/utils/chart-config'\nimport { ZOOM_LAYOUT } from '../actions/zoom-toggle'\nimport type { OptionFactory } from '../echart'\nimport { mergeOptions } 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 fontSize: theme.typography.overlineDelicate?.fontSize,\n fontFamily: theme.typography.overlineDelicate?.fontFamily,\n color: theme.palette.black?.[60],\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 fontSize: theme.typography.overlineDelicate?.fontSize,\n fontFamily: theme.typography.overlineDelicate?.fontFamily,\n color: theme.palette.black?.[60],\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 seriesNames = options.seriesNames\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 type: 'scatter' as const,\n datasetIndex: i,\n name: seriesNames?.[i] ?? `Series ${i + 1}`,\n encode: { x: 0, y: 1 },\n symbolSize,\n emphasis: { focus: 'series' },\n itemStyle: { color: makeDimColor(i) },\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 buildPngDownloadItem,\n downloadToCSV,\n type DownloadItem,\n} from '../actions/download'\nimport type { ScatterplotWidgetData } from './types'\n\n/**\n * Download menu items for the Scatterplot widget. Always includes a CSV\n * item with `series, x, y` columns (one row per point). When\n * `getCaptureEl` is supplied, prepends a PNG item that rasterises the\n * captured element via `html2canvas`.\n */\nexport function createScatterplotDownloadConfig(args: {\n filename: string\n getData: () => ScatterplotWidgetData\n seriesNames?: readonly string[]\n getCaptureEl?: () => HTMLElement | null\n pngPixelRatio?: number\n pngBackgroundColor?: string | null\n}): DownloadItem[] {\n const items: DownloadItem[] = []\n if (args.getCaptureEl) {\n items.push(\n buildPngDownloadItem({\n filename: args.filename,\n getCaptureEl: args.getCaptureEl,\n pixelRatio: args.pngPixelRatio,\n backgroundColor: args.pngBackgroundColor,\n }),\n )\n }\n items.push({\n id: 'csv',\n label: 'Download as CSV',\n resolve: () => {\n const data = args.getData()\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 const handle = downloadToCSV(rows)\n return Promise.resolve({\n url: handle.url,\n filename: `${args.filename}.csv`,\n revoke: handle.revoke,\n })\n },\n })\n return items\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"],"names":["scatterplotOptions","theme","xFormatter","yFormatter","grid","left","parseInt","spacing","top","right","buildGridConfig","containLabel","tooltip","trigger","backgroundColor","palette","grey","borderWidth","padding","textStyle","color","common","white","fontSize","fontFamily","typography","caption","position","createTooltipPositioner","formatter","buildScatterTooltipFormatter","legend","buildLegendConfig","hasLegend","labelFormatter","undefined","axisPointer","lineStyle","secondary","main","Object","values","qualitative","bold","xAxis","type","axisLine","show","axisTick","axisLabel","overlineDelicate","black","margin","hideOverlap","showMinLabel","showMaxLabel","splitLine","divider","yAxis","createScatterplotOptionFactory","options","optionsOverride","seriesNames","symbolSize","selection","selectionSet","length","Set","option","data","ctx","structural","mergeOptions","seriesArr","Array","isArray","dataset","series","baseLegend","baseGrid","baseTooltip","baseXAxis","baseYAxis","reactiveFormatter","niceMinX","niceMaxX","niceMinY","niceMaxY","computeScatterBounds","makeDimColor","seriesIdx","params","base","key","dataIndex","has","echarts","modifyAlpha","dataZoomLayout","layoutDataZoomForScatter","dataZoom","hasXSlider","hasYSlider","fallbackBottom","bottom","baseBottom","gridBottom","ZOOM_LAYOUT","sliderHeight","sliderGap","fallbackRight","gridRight","map","s","source","_","i","datasetIndex","name","encode","x","y","emphasis","focus","itemStyle","entries","min","max","buildReactiveScatterTooltipFormatter","entry","dz","yAxisIndex","sliderBottomWithLegend","structuralFormatter","reactiveYFormatter","createTooltipFormatter","item","value","formattedX","String","formattedY","marker","seriesName","minX","Infinity","maxX","minY","maxY","point","Number","isFinite","niceNum","styles","container","display","alignItems","justifyContent","flexDirection","gap","height","flex","width","legendItem","dotSx","size","borderRadius","ScatterplotSkeleton","t0","$","_c","count","t1","T0","T1","t2","t3","t4","dots","from","_temp","Box","_temp2","t5","jsx","t6","Symbol","for","_temp3","t7","i_1","jsxs","Skeleton","d","i_0","createScatterplotDownloadConfig","args","items","getCaptureEl","push","buildPngDownloadItem","filename","pixelRatio","pngPixelRatio","pngBackgroundColor","id","label","resolve","getData","rows","handle","downloadToCSV","Promise","url","revoke","toRelativeScatterplotData","input","isXyTupleArray","total","reduce","acc","Math","abs","v","every"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,SAASA,EAAmB;AAAA,EACjCC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA;AACuB,GAA6B;AACpD,SAAO;AAAA,IACLC,MAAM;AAAA,MACJC,MAAMC,SAASL,EAAMM,QAAQ,CAAC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,QACrBM,KAAKH,EAAOG;AAAAA,QACZZ,UAAU,GAAGL,EAAKK,QAAQ;AAAA,QAC1Ba,QAAQJ,EAAOI;AAAAA,MAAAA,CAChB;AAAA,IACH;AAAA,EAAA,CACD,GACMjB;AACT;ACrCO,MAAMkB,KAA4BA,CAACC,MACnC7I,MAAMC,QAAQ4I,CAAK,IACjBA,EAAMvG,IAAI,CAACnC,MAA6B;AAC7C,MAAI,CAAC2I,GAAe3I,CAAM,EAAG,QAAOA;AACpC,QAAM4I,IAAQ5I,EAAO6I,OAAO,CAACC,GAAK,CAAA,EAAGlG,CAAC,MAAMkG,IAAMC,KAAKC,IAAIpG,CAAC,GAAG,CAAC;AAChE,SAAIgG,KAAS,IAAU5I,IAChBA,EAAOmC,IAAI,CAAC,CAACQ,GAAGC,CAAC,MAAM,CAACD,GAAIC,IAAIgG,IAAS,GAAG,CAAqB;AAC1E,CAAC,IANiCF;AASpC,SAASC,GAAeM,GAAqC;AAC3D,SAAKpJ,MAAMC,QAAQmJ,CAAC,IACbA,EAAEC,MACNvF,CAAAA,MACC9D,MAAMC,QAAQ6D,CAAI,KAClBA,EAAKtE,WAAW,KAChB,OAAOsE,EAAK,CAAC,KAAM,YACnBa,OAAOC,SAASd,EAAK,CAAC,CAAC,KACvB,OAAOA,EAAK,CAAC,KAAM,YACnBa,OAAOC,SAASd,EAAK,CAAC,CAAC,CAC3B,IAT8B;AAUhC;"}
|
|
1
|
+
{"version":3,"file":"scatterplot.js","sources":["../../src/widgets-v2/scatterplot/options.ts","../../src/widgets-v2/scatterplot/skeleton.tsx","../../src/widgets-v2/scatterplot/download.ts","../../src/widgets-v2/scatterplot/transforms.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\nimport * as echarts from 'echarts'\nimport type { CallbackDataParams } from 'echarts/types/dist/shared'\nimport {\n buildGridConfig,\n buildLegendConfig,\n createTooltipFormatter,\n createTooltipPositioner,\n niceNum,\n} from '../../widgets/utils/chart-config'\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 fontSize: theme.typography.overlineDelicate?.fontSize,\n fontFamily: theme.typography.overlineDelicate?.fontFamily,\n color: theme.palette.black?.[60],\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 fontSize: theme.typography.overlineDelicate?.fontSize,\n fontFamily: theme.typography.overlineDelicate?.fontFamily,\n color: theme.palette.black?.[60],\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 buildPngDownloadItem,\n downloadToCSV,\n type DownloadItem,\n} from '../actions/download'\nimport type { ScatterplotWidgetData } from './types'\n\n/**\n * Download menu items for the Scatterplot widget. Always includes a CSV\n * item with `series, x, y` columns (one row per point). When\n * `getCaptureEl` is supplied, prepends a PNG item that rasterises the\n * captured element via `html2canvas`.\n */\nexport function createScatterplotDownloadConfig(args: {\n filename: string\n getData: () => ScatterplotWidgetData\n seriesNames?: readonly string[]\n getCaptureEl?: () => HTMLElement | null\n pngPixelRatio?: number\n pngBackgroundColor?: string | null\n}): DownloadItem[] {\n const items: DownloadItem[] = []\n if (args.getCaptureEl) {\n items.push(\n buildPngDownloadItem({\n filename: args.filename,\n getCaptureEl: args.getCaptureEl,\n pixelRatio: args.pngPixelRatio,\n backgroundColor: args.pngBackgroundColor,\n }),\n )\n }\n items.push({\n id: 'csv',\n label: 'Download as CSV',\n resolve: () => {\n const data = args.getData()\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 const handle = downloadToCSV(rows)\n return Promise.resolve({\n url: handle.url,\n filename: `${args.filename}.csv`,\n revoke: handle.revoke,\n })\n },\n })\n return items\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"],"names":["scatterplotOptions","theme","xFormatter","yFormatter","grid","left","parseInt","spacing","top","right","buildGridConfig","containLabel","tooltip","trigger","backgroundColor","palette","grey","borderWidth","padding","textStyle","color","common","white","fontSize","fontFamily","typography","caption","position","createTooltipPositioner","formatter","buildScatterTooltipFormatter","legend","buildLegendConfig","hasLegend","labelFormatter","undefined","axisPointer","lineStyle","secondary","main","Object","values","qualitative","bold","xAxis","type","axisLine","show","axisTick","axisLabel","overlineDelicate","black","margin","hideOverlap","showMinLabel","showMaxLabel","splitLine","divider","yAxis","createScatterplotOptionFactory","options","optionsOverride","series","symbolSize","selection","selectionSet","length","Set","option","data","ctx","structural","mergeOptions","seriesArr","Array","isArray","dataset","baseLegend","baseGrid","baseTooltip","baseXAxis","baseYAxis","reactiveFormatter","niceMinX","niceMaxX","niceMinY","niceMaxY","computeScatterBounds","makeDimColor","seriesIdx","params","base","key","dataIndex","has","echarts","modifyAlpha","dataZoomLayout","layoutDataZoomForScatter","dataZoom","hasXSlider","hasYSlider","fallbackBottom","bottom","baseBottom","gridBottom","ZOOM_LAYOUT","sliderHeight","sliderGap","fallbackRight","gridRight","map","s","source","_","i","overrideColor","resolveThemeColor","datasetIndex","name","encode","x","y","emphasis","focus","itemStyle","entries","min","max","buildReactiveScatterTooltipFormatter","entry","dz","yAxisIndex","sliderBottomWithLegend","structuralFormatter","reactiveYFormatter","createTooltipFormatter","item","value","formattedX","String","formattedY","marker","seriesName","minX","Infinity","maxX","minY","maxY","point","Number","isFinite","niceNum","styles","container","display","alignItems","justifyContent","flexDirection","gap","height","flex","width","legendItem","dotSx","size","borderRadius","ScatterplotSkeleton","t0","$","_c","count","t1","T0","T1","t2","t3","t4","dots","from","_temp","Box","_temp2","t5","jsx","t6","Symbol","for","_temp3","t7","i_1","jsxs","Skeleton","d","i_0","createScatterplotDownloadConfig","args","items","getCaptureEl","push","buildPngDownloadItem","filename","pixelRatio","pngPixelRatio","pngBackgroundColor","id","label","resolve","getData","rows","seriesNames","handle","downloadToCSV","Promise","url","revoke","toRelativeScatterplotData","input","isXyTupleArray","total","reduce","acc","Math","abs","v","every"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCO,SAASA,GAAmB;AAAA,EACjCC,OAAAA;AAAAA,EACAC,YAAAA;AAAAA,EACAC,YAAAA;AACuB,GAA6B;AACpD,SAAO;AAAA,IACLC,MAAM;AAAA,MACJC,MAAMC,SAASL,EAAMM,QAAQ,CAAC,CAAC;AAAA,MAC/BC,KAAKF,SAASL,EAAMM,QAAQ,CAAC,CAAC;AAAA,MAC9BE,OAAOH,SAASL,EAAMM,QAAQ,CAAC,CAAC;AAAA;AAAA,MAEhC,GAAGG,EAAgB,IAAOT,CAAK;AAAA,MAC/BU,cAAc;AAAA,IAAA;AAAA,IAEhBC,SAAS;AAAA;AAAA;AAAA,MAGPC,SAAS;AAAA,MACTC,iBAAiBb,EAAMc,QAAQC,KAAK,GAAG;AAAA,MACvCC,aAAa;AAAA,MACbC,SAAS,CAACZ,SAASL,EAAMM,QAAQ,CAAC,CAAC,GAAGD,SAASL,EAAMM,QAAQ,CAAC,CAAC,CAAC;AAAA,MAChEY,WAAW;AAAA,QACTC,OAAOnB,EAAMc,QAAQM,OAAOC;AAAAA,QAC5BC,UAAU;AAAA,QACVC,YAAYvB,EAAMwB,WAAWC,QAAQF;AAAAA,MAAAA;AAAAA,MAEvCG,UAAUC,EAAwB3B,CAAK;AAAA,MACvC4B,WAAWC,GAA6B5B,GAAYC,CAAU;AAAA,IAAA;AAAA;AAAA;AAAA,IAIhE4B,QAAQ;AAAA,MACN,GAAGC,EAAkB;AAAA,QAAEC,WAAW;AAAA,QAAOC,gBAAgBC;AAAAA,MAAAA,CAAW;AAAA,IAAA;AAAA,IAEtEC,aAAa;AAAA,MAAEC,WAAW;AAAA,QAAEjB,OAAOnB,EAAMc,QAAQC,KAAK,GAAG;AAAA,MAAA;AAA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EAAK,CAAC,KAAM,YACnBa,OAAOC,SAASd,EAAK,CAAC,CAAC,KACvB,OAAOA,EAAK,CAAC,KAAM,YACnBa,OAAOC,SAASd,EAAK,CAAC,CAAC,CAC3B,IAT8B;AAUhC;"}
|
package/dist/widgets-v2/table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as d, t as g } from "../table-
|
|
2
|
-
import { D as N, a as q, b as J, T as K, c as M, d as Q, e as W, p as X, r as Y, f as ee } from "../table-
|
|
1
|
+
import { s as d, t as g } from "../table-CQCAnDLb.js";
|
|
2
|
+
import { D as N, a as q, b as J, T as K, c as M, d as Q, e as W, p as X, r as Y, f as ee } from "../table-CQCAnDLb.js";
|
|
3
3
|
import { jsx as r, jsxs as v } from "react/jsx-runtime";
|
|
4
4
|
import { c as _ } from "react/compiler-runtime";
|
|
5
5
|
import { TableHead as w, TableRow as p, TableBody as x, TableCell as u, Skeleton as h, Box as E, Table as A } from "@mui/material";
|