@carto/ps-react-ui 4.12.0 → 4.12.1

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