@carto/ps-react-ui 4.26.0 → 4.27.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-DON6fSCh.js +1289 -0
- package/dist/actions-DON6fSCh.js.map +1 -0
- package/dist/category-BoT5FHHp.js +950 -0
- package/dist/category-BoT5FHHp.js.map +1 -0
- package/dist/scale-0elCv3tk.js +29 -0
- package/dist/scale-0elCv3tk.js.map +1 -0
- package/dist/types/widgets-v2/actions/index.d.ts +1 -1
- package/dist/types/widgets-v2/actions/relative-data/index.d.ts +1 -0
- package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +3 -0
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +16 -2
- package/dist/types/widgets-v2/actions/relative-data/scale.d.ts +26 -0
- package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
- package/dist/types/widgets-v2/category/category.d.ts +2 -1
- package/dist/types/widgets-v2/index.d.ts +1 -1
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2/bar.js +84 -83
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/category.js +1 -1
- package/dist/widgets-v2/histogram.js +108 -107
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +120 -119
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +90 -89
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +2 -2
- package/dist/widgets-v2.js.map +1 -1
- package/package.json +3 -3
- package/src/widgets-v2/actions/index.ts +1 -0
- package/src/widgets-v2/actions/relative-data/index.ts +1 -0
- package/src/widgets-v2/actions/relative-data/labels.ts +6 -0
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +78 -1
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +137 -20
- package/src/widgets-v2/actions/relative-data/scale.ts +48 -0
- package/src/widgets-v2/actions/relative-data/style.ts +10 -0
- package/src/widgets-v2/bar/options.test.ts +16 -0
- package/src/widgets-v2/bar/options.ts +6 -2
- package/src/widgets-v2/category/category.relative-data.test.tsx +51 -63
- package/src/widgets-v2/category/category.tsx +25 -11
- package/src/widgets-v2/histogram/options.ts +6 -2
- package/src/widgets-v2/index.ts +1 -0
- package/src/widgets-v2/scatterplot/options.test.ts +12 -0
- package/src/widgets-v2/scatterplot/options.ts +18 -4
- package/src/widgets-v2/timeseries/options.ts +6 -2
- package/dist/actions-DXfQMrll.js +0 -1177
- package/dist/actions-DXfQMrll.js.map +0 -1
- package/dist/category-DuKx_CJX.js +0 -933
- package/dist/category-DuKx_CJX.js.map +0 -1
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { r as e } from "../zoom-toggle-KA63b6-J.js";
|
|
2
|
-
import { n as t
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
2
|
+
import { n as t } from "../scale-0elCv3tk.js";
|
|
3
|
+
import { n, t as r } from "../download--wRRnf19.js";
|
|
4
|
+
import { r as i, t as a } from "../utils-ClB6nn4w.js";
|
|
5
|
+
import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-BWxjodlt.js";
|
|
6
|
+
import { t as f } from "../item-color-C1cu6EJd.js";
|
|
7
|
+
import { c as p } from "react/compiler-runtime";
|
|
8
|
+
import { Box as m, Skeleton as h } from "@mui/material";
|
|
9
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
|
+
import * as v from "echarts";
|
|
10
11
|
//#region src/widgets-v2/scatterplot/points.ts
|
|
11
|
-
function v(e) {
|
|
12
|
-
return x(e) ? e : [e.x, e.y];
|
|
13
|
-
}
|
|
14
12
|
function y(e) {
|
|
15
|
-
|
|
13
|
+
return S(e) ? e : [e.x, e.y];
|
|
14
|
+
}
|
|
15
|
+
function b(e) {
|
|
16
|
+
if (Array.isArray(e)) return e.length === 2 && C(e[0]) && C(e[1]);
|
|
16
17
|
if (typeof e != "object" || !e) return !1;
|
|
17
18
|
let { x: t, y: n } = e;
|
|
18
|
-
return
|
|
19
|
+
return C(t) && C(n);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
21
|
+
function x(e, t, n) {
|
|
22
|
+
return S(e) ? [t, n] : {
|
|
22
23
|
...e,
|
|
23
24
|
x: t,
|
|
24
25
|
y: n
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function S(e) {
|
|
28
29
|
return Array.isArray(e);
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function C(e) {
|
|
31
32
|
return typeof e == "number" && Number.isFinite(e);
|
|
32
33
|
}
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region src/widgets-v2/scatterplot/options.ts
|
|
35
|
-
function
|
|
36
|
+
function w({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
36
37
|
return {
|
|
37
38
|
grid: {
|
|
38
39
|
left: parseInt(e.spacing(1)),
|
|
39
40
|
top: parseInt(e.spacing(3)),
|
|
40
41
|
right: parseInt(e.spacing(1)),
|
|
41
|
-
...
|
|
42
|
+
...o(!1, e),
|
|
42
43
|
containLabel: !0
|
|
43
44
|
},
|
|
44
45
|
tooltip: {
|
|
@@ -51,10 +52,10 @@ function C({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
51
52
|
fontSize: 11,
|
|
52
53
|
fontFamily: e.typography.caption.fontFamily
|
|
53
54
|
},
|
|
54
|
-
position:
|
|
55
|
-
formatter:
|
|
55
|
+
position: s(e),
|
|
56
|
+
formatter: O(t, n)
|
|
56
57
|
},
|
|
57
|
-
legend: { ...
|
|
58
|
+
legend: { ...u({
|
|
58
59
|
hasLegend: !1,
|
|
59
60
|
labelFormatter: void 0
|
|
60
61
|
}) },
|
|
@@ -65,7 +66,7 @@ function C({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
65
66
|
axisLine: { show: !1 },
|
|
66
67
|
axisTick: { show: !1 },
|
|
67
68
|
axisLabel: {
|
|
68
|
-
...
|
|
69
|
+
...l(e),
|
|
69
70
|
margin: parseInt(e.spacing(1)),
|
|
70
71
|
hideOverlap: !0,
|
|
71
72
|
showMinLabel: !0,
|
|
@@ -82,7 +83,7 @@ function C({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
82
83
|
axisLine: { show: !1 },
|
|
83
84
|
axisTick: { show: !1 },
|
|
84
85
|
axisLabel: {
|
|
85
|
-
...
|
|
86
|
+
...l(e),
|
|
86
87
|
margin: parseInt(e.spacing(1)),
|
|
87
88
|
hideOverlap: !0,
|
|
88
89
|
showMinLabel: !0,
|
|
@@ -96,88 +97,88 @@ function C({ theme: e, xFormatter: t, yFormatter: n }) {
|
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
let { theme:
|
|
101
|
-
return (
|
|
102
|
-
if (
|
|
103
|
-
let e =
|
|
104
|
-
theme:
|
|
105
|
-
xFormatter:
|
|
106
|
-
yFormatter:
|
|
100
|
+
function T(n) {
|
|
101
|
+
let { theme: r, xFormatter: o, yFormatter: s, optionsOverride: c } = n, l = n.series, u = n.symbolSize ?? 8, d = n.selection, p = d && d.length > 0 ? new Set(d) : null;
|
|
102
|
+
return (n, d, m) => {
|
|
103
|
+
if (n == null) {
|
|
104
|
+
let e = w({
|
|
105
|
+
theme: r,
|
|
106
|
+
xFormatter: o,
|
|
107
|
+
yFormatter: s
|
|
107
108
|
});
|
|
108
|
-
return
|
|
109
|
+
return c ? i(e, c) : e;
|
|
109
110
|
}
|
|
110
|
-
let
|
|
111
|
-
if (
|
|
112
|
-
...
|
|
111
|
+
let h = Array.isArray(d) ? d : [];
|
|
112
|
+
if (h.length === 0) return {
|
|
113
|
+
...n,
|
|
113
114
|
dataset: [],
|
|
114
115
|
series: []
|
|
115
116
|
};
|
|
116
|
-
let
|
|
117
|
-
let
|
|
118
|
-
theme:
|
|
117
|
+
let g = h.length > 1, _ = typeof n.legend == "object" && !Array.isArray(n.legend) ? n.legend : {}, b = 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 : {}, T = m?.formatter, { niceMinX: O, niceMaxX: A, niceMinY: j, niceMaxY: M } = k(h, t(C)), N = Array.isArray(n.series) ? n.series : [], P = (e, t) => {
|
|
118
|
+
let n = f({
|
|
119
|
+
theme: r,
|
|
119
120
|
datums: t,
|
|
120
|
-
template:
|
|
121
|
+
template: N[e] ?? N[0],
|
|
121
122
|
fallback: (e) => e.color
|
|
122
123
|
});
|
|
123
124
|
return (t) => {
|
|
124
|
-
let
|
|
125
|
-
if (!
|
|
125
|
+
let r = n(t);
|
|
126
|
+
if (!p) return r;
|
|
126
127
|
let i = `${e}:${t.dataIndex}`;
|
|
127
|
-
return
|
|
128
|
+
return p.has(i) ? r : v.color.modifyAlpha(r, .15);
|
|
128
129
|
};
|
|
129
|
-
},
|
|
130
|
+
}, F = E(n.dataZoom, g), I = F?.hasXSlider ?? !1, L = F?.hasYSlider ?? !1, R = typeof b.bottom == "number" ? b.bottom : 24, z = g ? 56 : R, B = I ? z + e.sliderHeight + e.sliderGap : z, V = typeof b.right == "number" ? b.right : 8, H = L ? V + e.sliderHeight + e.sliderGap : V;
|
|
130
131
|
return {
|
|
131
|
-
...
|
|
132
|
-
dataset:
|
|
133
|
-
series:
|
|
134
|
-
let
|
|
132
|
+
...n,
|
|
133
|
+
dataset: h.map((e) => ({ source: e.every(Array.isArray) ? e : e.map(y) })),
|
|
134
|
+
series: h.map((e, t) => {
|
|
135
|
+
let n = a(r, l?.[t]?.color);
|
|
135
136
|
return {
|
|
136
137
|
type: "scatter",
|
|
137
138
|
datasetIndex: t,
|
|
138
|
-
name:
|
|
139
|
+
name: l?.[t]?.name ?? `Series ${t + 1}`,
|
|
139
140
|
encode: {
|
|
140
141
|
x: 0,
|
|
141
142
|
y: 1
|
|
142
143
|
},
|
|
143
|
-
symbolSize:
|
|
144
|
+
symbolSize: u,
|
|
144
145
|
emphasis: { focus: "series" },
|
|
145
|
-
itemStyle: { color:
|
|
146
|
-
...
|
|
146
|
+
itemStyle: { color: P(t, e) },
|
|
147
|
+
...n ? { color: n } : {}
|
|
147
148
|
};
|
|
148
149
|
}),
|
|
149
150
|
legend: {
|
|
150
|
-
...
|
|
151
|
-
show:
|
|
151
|
+
..._,
|
|
152
|
+
show: g
|
|
152
153
|
},
|
|
153
154
|
grid: {
|
|
154
|
-
...
|
|
155
|
-
bottom:
|
|
156
|
-
right:
|
|
155
|
+
...b,
|
|
156
|
+
bottom: B,
|
|
157
|
+
right: H
|
|
157
158
|
},
|
|
158
|
-
...
|
|
159
|
+
...F ? { dataZoom: F.entries } : {},
|
|
159
160
|
xAxis: {
|
|
160
|
-
...
|
|
161
|
-
min:
|
|
162
|
-
max:
|
|
161
|
+
...S,
|
|
162
|
+
min: O,
|
|
163
|
+
max: A
|
|
163
164
|
},
|
|
164
165
|
yAxis: {
|
|
165
|
-
...
|
|
166
|
-
min:
|
|
167
|
-
max:
|
|
166
|
+
...C,
|
|
167
|
+
min: j,
|
|
168
|
+
max: M,
|
|
168
169
|
axisLabel: {
|
|
169
|
-
...
|
|
170
|
-
...
|
|
170
|
+
...C.axisLabel ?? {},
|
|
171
|
+
...T ? { formatter: T } : {}
|
|
171
172
|
}
|
|
172
173
|
},
|
|
173
174
|
tooltip: {
|
|
174
|
-
...
|
|
175
|
-
formatter:
|
|
175
|
+
...x,
|
|
176
|
+
formatter: D(x.formatter, T, o)
|
|
176
177
|
}
|
|
177
178
|
};
|
|
178
179
|
};
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function E(t, n) {
|
|
181
182
|
if (!Array.isArray(t) || t.length === 0) return null;
|
|
182
183
|
let r = !1, i = !1;
|
|
183
184
|
return {
|
|
@@ -193,8 +194,8 @@ function T(t, n) {
|
|
|
193
194
|
hasYSlider: i
|
|
194
195
|
};
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
-
return t ?
|
|
197
|
+
function D(e, t, n) {
|
|
198
|
+
return t ? d((e) => {
|
|
198
199
|
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
200
|
return {
|
|
200
201
|
name: `(${o}, ${s})`,
|
|
@@ -204,8 +205,8 @@ function E(e, t, n) {
|
|
|
204
205
|
};
|
|
205
206
|
}) : e;
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
-
return
|
|
208
|
+
function O(e, t) {
|
|
209
|
+
return d((n) => {
|
|
209
210
|
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
211
|
return {
|
|
211
212
|
name: `(${o}, ${s})`,
|
|
@@ -215,24 +216,24 @@ function D(e, t) {
|
|
|
215
216
|
};
|
|
216
217
|
});
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
-
let
|
|
220
|
-
for (let
|
|
219
|
+
function k(e, t = {}) {
|
|
220
|
+
let n = Infinity, r = -Infinity, i = Infinity, a = -Infinity;
|
|
221
|
+
for (let t of e) for (let e of t) {
|
|
221
222
|
if (e == null) continue;
|
|
222
|
-
let [
|
|
223
|
-
typeof
|
|
223
|
+
let [t, o] = y(e);
|
|
224
|
+
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
225
|
}
|
|
225
|
-
let
|
|
226
|
+
let o = Number.isFinite(r) ? r <= 0 ? 1 : c(r) : 1, s = Number.isFinite(a) ? a <= 0 ? 1 : t.max ?? c(a) : 1;
|
|
226
227
|
return {
|
|
227
|
-
niceMinX: Number.isFinite(
|
|
228
|
-
niceMaxX:
|
|
229
|
-
niceMinY: Number.isFinite(
|
|
230
|
-
niceMaxY:
|
|
228
|
+
niceMinX: Number.isFinite(n) && n < 0 ? c(n) : 0,
|
|
229
|
+
niceMaxX: o,
|
|
230
|
+
niceMinY: Number.isFinite(i) && i < 0 ? t.min ?? c(i) : 0,
|
|
231
|
+
niceMaxY: s
|
|
231
232
|
};
|
|
232
233
|
}
|
|
233
234
|
//#endregion
|
|
234
235
|
//#region src/widgets-v2/scatterplot/skeleton.tsx
|
|
235
|
-
var
|
|
236
|
+
var A = {
|
|
236
237
|
container: {
|
|
237
238
|
display: "flex",
|
|
238
239
|
alignItems: "center",
|
|
@@ -257,7 +258,7 @@ var k = {
|
|
|
257
258
|
alignItems: "center",
|
|
258
259
|
gap: ({ spacing: e }) => e(1.5)
|
|
259
260
|
}
|
|
260
|
-
},
|
|
261
|
+
}, j = (e, t, n) => ({
|
|
261
262
|
position: "absolute",
|
|
262
263
|
top: e,
|
|
263
264
|
left: t,
|
|
@@ -265,48 +266,48 @@ var k = {
|
|
|
265
266
|
height: n,
|
|
266
267
|
borderRadius: "50%"
|
|
267
268
|
});
|
|
268
|
-
function
|
|
269
|
-
let t =
|
|
269
|
+
function M(e) {
|
|
270
|
+
let t = p(15), { count: n } = e, r = n === void 0 ? 24 : n, i, a, o, s, c;
|
|
270
271
|
if (t[0] !== r) {
|
|
271
|
-
let e = Array.from({ length: r },
|
|
272
|
-
a =
|
|
272
|
+
let e = Array.from({ length: r }, F);
|
|
273
|
+
a = m, c = A.container, i = m, o = A.grid, s = e.map(P), t[0] = r, t[1] = i, t[2] = a, t[3] = o, t[4] = s, t[5] = c;
|
|
273
274
|
} else i = t[1], a = t[2], o = t[3], s = t[4], c = t[5];
|
|
274
275
|
let l;
|
|
275
|
-
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */
|
|
276
|
+
t[6] !== i || t[7] !== o || t[8] !== s ? (l = /* @__PURE__ */ g(i, {
|
|
276
277
|
sx: o,
|
|
277
278
|
children: s
|
|
278
279
|
}), t[6] = i, t[7] = o, t[8] = s, t[9] = l) : l = t[9];
|
|
279
280
|
let u;
|
|
280
|
-
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
281
|
-
sx:
|
|
282
|
-
children: [0, 1].map(
|
|
281
|
+
t[10] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ g(m, {
|
|
282
|
+
sx: A.legend,
|
|
283
|
+
children: [0, 1].map(N)
|
|
283
284
|
}), t[10] = u) : u = t[10];
|
|
284
285
|
let d;
|
|
285
|
-
return t[11] !== a || t[12] !== c || t[13] !== l ? (d = /* @__PURE__ */
|
|
286
|
+
return t[11] !== a || t[12] !== c || t[13] !== l ? (d = /* @__PURE__ */ _(a, {
|
|
286
287
|
sx: c,
|
|
287
288
|
children: [l, u]
|
|
288
289
|
}), t[11] = a, t[12] = c, t[13] = l, t[14] = d) : d = t[14], d;
|
|
289
290
|
}
|
|
290
|
-
function
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
sx:
|
|
293
|
-
children: [/* @__PURE__ */ h
|
|
291
|
+
function N(e) {
|
|
292
|
+
return /* @__PURE__ */ _(m, {
|
|
293
|
+
sx: A.legendItem,
|
|
294
|
+
children: [/* @__PURE__ */ g(h, {
|
|
294
295
|
variant: "circular",
|
|
295
296
|
width: 8,
|
|
296
297
|
height: 8
|
|
297
|
-
}), /* @__PURE__ */ h
|
|
298
|
+
}), /* @__PURE__ */ g(h, {
|
|
298
299
|
width: 48,
|
|
299
300
|
height: 8
|
|
300
301
|
})]
|
|
301
302
|
}, `legend-${e}`);
|
|
302
303
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */ h
|
|
304
|
+
function P(e, t) {
|
|
305
|
+
return /* @__PURE__ */ g(h, {
|
|
305
306
|
variant: "circular",
|
|
306
|
-
sx:
|
|
307
|
+
sx: j(e.top, e.left, e.size)
|
|
307
308
|
}, `dot-${t}`);
|
|
308
309
|
}
|
|
309
|
-
function
|
|
310
|
+
function F(e, t) {
|
|
310
311
|
let n = 10 + t * 37 % 80, r = 5 + t * 53 % 90, i = 8 + t * 7 % 6;
|
|
311
312
|
return {
|
|
312
313
|
top: `${n}%`,
|
|
@@ -316,14 +317,14 @@ function P(e, t) {
|
|
|
316
317
|
}
|
|
317
318
|
//#endregion
|
|
318
319
|
//#region src/widgets-v2/scatterplot/download.ts
|
|
319
|
-
function
|
|
320
|
-
let
|
|
321
|
-
return e.getCaptureEl &&
|
|
320
|
+
function I(e) {
|
|
321
|
+
let t = [];
|
|
322
|
+
return e.getCaptureEl && t.push(n({
|
|
322
323
|
filename: e.filename,
|
|
323
324
|
getCaptureEl: e.getCaptureEl,
|
|
324
325
|
pixelRatio: e.pngPixelRatio,
|
|
325
326
|
backgroundColor: e.pngBackgroundColor
|
|
326
|
-
})),
|
|
327
|
+
})), t.push(r({
|
|
327
328
|
filename: e.filename,
|
|
328
329
|
getRows: (t) => {
|
|
329
330
|
let n = e.getData(t), r = [[
|
|
@@ -334,7 +335,7 @@ function F(e) {
|
|
|
334
335
|
for (let [t, i] of n.entries()) {
|
|
335
336
|
let n = e.seriesNames?.[t] ?? `series_${t + 1}`;
|
|
336
337
|
for (let e of i) {
|
|
337
|
-
let [t, i] =
|
|
338
|
+
let [t, i] = y(e);
|
|
338
339
|
r.push([
|
|
339
340
|
n,
|
|
340
341
|
t,
|
|
@@ -344,27 +345,27 @@ function F(e) {
|
|
|
344
345
|
}
|
|
345
346
|
return r;
|
|
346
347
|
}
|
|
347
|
-
})),
|
|
348
|
+
})), t;
|
|
348
349
|
}
|
|
349
350
|
//#endregion
|
|
350
351
|
//#region src/widgets-v2/scatterplot/transforms.ts
|
|
351
|
-
var
|
|
352
|
-
if (!
|
|
353
|
-
let t = e.reduce((e, t) => e + Math.abs(
|
|
352
|
+
var L = (e) => Array.isArray(e) ? e.map((e) => {
|
|
353
|
+
if (!R(e)) return e;
|
|
354
|
+
let t = e.reduce((e, t) => e + Math.abs(y(t)[1]), 0);
|
|
354
355
|
return t <= 0 ? e : e.map((e) => {
|
|
355
|
-
let [n, r] =
|
|
356
|
-
return
|
|
356
|
+
let [n, r] = y(e);
|
|
357
|
+
return x(e, n, r / t * 100);
|
|
357
358
|
});
|
|
358
359
|
}) : e;
|
|
359
|
-
function
|
|
360
|
-
return Array.isArray(e) && e.every(
|
|
360
|
+
function R(e) {
|
|
361
|
+
return Array.isArray(e) && e.every(b);
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function z(e, t) {
|
|
363
364
|
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
364
365
|
let n = new Set(t.map(String));
|
|
365
|
-
return e.map((e, t) =>
|
|
366
|
+
return e.map((e, t) => R(e) ? e.filter((e, r) => n.has(`${t}:${r}`)) : e);
|
|
366
367
|
}
|
|
367
368
|
//#endregion
|
|
368
|
-
export {
|
|
369
|
+
export { M as ScatterplotSkeleton, I as createScatterplotDownloadConfig, T as createScatterplotOptionFactory, z as filterScatterplotByLockedPoints, y as getScatterplotXY, w as scatterplotOptions, L as toRelativeScatterplotData };
|
|
369
370
|
|
|
370
371
|
//# sourceMappingURL=scatterplot.js.map
|