@carto/ps-react-ui 4.17.3 → 4.18.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/category-Ct2BzADB.js +753 -0
- package/dist/category-Ct2BzADB.js.map +1 -0
- package/dist/change-column-Bhcxmp-r.js +1148 -0
- package/dist/change-column-Bhcxmp-r.js.map +1 -0
- package/dist/echart-B10dhEaM.js +262 -0
- package/dist/echart-B10dhEaM.js.map +1 -0
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +15 -5
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -2
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +6 -1
- package/dist/types/widgets-v2/category/style.d.ts +8 -0
- package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +10 -4
- package/dist/types/widgets-v2/histogram/index.d.ts +1 -1
- package/dist/types/widgets-v2/histogram/transforms.d.ts +11 -0
- package/dist/types/widgets-v2/histogram/types.d.ts +9 -0
- package/dist/types/widgets-v2/scatterplot/index.d.ts +1 -1
- package/dist/types/widgets-v2/scatterplot/transforms.d.ts +9 -0
- package/dist/types/widgets-v2/table/index.d.ts +1 -0
- package/dist/types/widgets-v2/table/transforms.d.ts +13 -0
- package/dist/types/widgets-v2/table/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/index.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/transforms.d.ts +10 -0
- package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +1 -0
- package/dist/widgets-v2/actions.js +1 -1
- package/dist/widgets-v2/category.js +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/echart.js.map +1 -1
- package/dist/widgets-v2/histogram.js +181 -158
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/pie.js +155 -116
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +91 -85
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/table.js +55 -45
- package/dist/widgets-v2/table.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +96 -85
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +4 -4
- package/package.json +1 -1
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +62 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +45 -13
- package/src/widgets-v2/category/category-ui.test.tsx +55 -0
- package/src/widgets-v2/category/category-ui.tsx +65 -6
- package/src/widgets-v2/category/components/category-legend.test.tsx +53 -2
- package/src/widgets-v2/category/components/category-legend.tsx +55 -12
- package/src/widgets-v2/category/components/category-row-stacked.test.tsx +7 -3
- package/src/widgets-v2/category/components/category-row-stacked.tsx +8 -3
- package/src/widgets-v2/category/style.ts +10 -2
- package/src/widgets-v2/echart/echart-ui.test.tsx +25 -0
- package/src/widgets-v2/echart/echart-ui.tsx +20 -0
- package/src/widgets-v2/echart/use-chart-selection.test.tsx +3 -1
- package/src/widgets-v2/echart/use-chart-selection.ts +10 -4
- package/src/widgets-v2/histogram/index.ts +4 -1
- package/src/widgets-v2/histogram/options.test.ts +86 -0
- package/src/widgets-v2/histogram/options.ts +50 -0
- package/src/widgets-v2/histogram/transforms.test.ts +36 -1
- package/src/widgets-v2/histogram/transforms.ts +23 -0
- package/src/widgets-v2/histogram/types.ts +9 -0
- package/src/widgets-v2/pie/options.test.ts +262 -0
- package/src/widgets-v2/pie/options.ts +80 -5
- package/src/widgets-v2/scatterplot/index.ts +4 -1
- package/src/widgets-v2/scatterplot/transforms.test.ts +38 -1
- package/src/widgets-v2/scatterplot/transforms.ts +23 -0
- package/src/widgets-v2/table/index.ts +1 -0
- package/src/widgets-v2/table/transforms.test.ts +40 -0
- package/src/widgets-v2/table/transforms.ts +26 -0
- package/src/widgets-v2/timeseries/index.ts +1 -0
- package/src/widgets-v2/timeseries/transforms.test.ts +49 -0
- package/src/widgets-v2/timeseries/transforms.ts +31 -0
- package/dist/category-CGS_eHr4.js +0 -719
- package/dist/category-CGS_eHr4.js.map +0 -1
- package/dist/change-column-CiVAjOUB.js +0 -1143
- package/dist/change-column-CiVAjOUB.js.map +0 -1
- package/dist/echart-Bdvbfx9s.js +0 -250
- package/dist/echart-Bdvbfx9s.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { n as
|
|
3
|
-
import { jsx as b, jsxs as
|
|
4
|
-
import { c as
|
|
5
|
-
import { Skeleton as
|
|
1
|
+
import * as V from "echarts";
|
|
2
|
+
import { n as k, h as B, d as X, g as J, c as K, f as Q } from "../option-builders-DPeoyQaM.js";
|
|
3
|
+
import { jsx as b, jsxs as R } from "react/jsx-runtime";
|
|
4
|
+
import { c as ee } from "react/compiler-runtime";
|
|
5
|
+
import { Skeleton as N, 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,56 +20,56 @@ 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
|
|
25
|
-
import { p as
|
|
26
|
-
import { b as
|
|
27
|
-
import { b as
|
|
28
|
-
function
|
|
29
|
-
theme:
|
|
30
|
-
formatter:
|
|
23
|
+
import { Z as D } from "../transforms-Cdx4fkU5.js";
|
|
24
|
+
import { m as te, r as re } from "../resolve-theme-color-BdojIw0K.js";
|
|
25
|
+
import { p as ie } from "../data-zoom-layout-D_FYdnap.js";
|
|
26
|
+
import { b as ne } from "../png-item-9dNbB37T.js";
|
|
27
|
+
import { b as ae } from "../csv-item-hH_Gt7ur.js";
|
|
28
|
+
function oe({
|
|
29
|
+
theme: e,
|
|
30
|
+
formatter: t
|
|
31
31
|
}) {
|
|
32
|
-
let s = 0,
|
|
32
|
+
let s = 0, n = 1;
|
|
33
33
|
return {
|
|
34
34
|
grid: {
|
|
35
|
-
left: parseInt(
|
|
36
|
-
top: parseInt(
|
|
37
|
-
right: parseInt(
|
|
35
|
+
left: parseInt(e.spacing(1)),
|
|
36
|
+
top: parseInt(e.spacing(3)),
|
|
37
|
+
right: parseInt(e.spacing(1)),
|
|
38
38
|
// Default: no legend. Merger bumps this when there are >1 series.
|
|
39
|
-
...
|
|
39
|
+
...K(!1, e),
|
|
40
40
|
containLabel: !0
|
|
41
41
|
},
|
|
42
42
|
tooltip: {
|
|
43
43
|
trigger: "axis",
|
|
44
|
-
backgroundColor:
|
|
44
|
+
backgroundColor: e.palette.grey[900],
|
|
45
45
|
borderWidth: 0,
|
|
46
|
-
padding: [parseInt(
|
|
46
|
+
padding: [parseInt(e.spacing(1)), parseInt(e.spacing(1))],
|
|
47
47
|
textStyle: {
|
|
48
|
-
color:
|
|
48
|
+
color: e.palette.common.white,
|
|
49
49
|
fontSize: 11,
|
|
50
|
-
fontFamily:
|
|
50
|
+
fontFamily: e.typography.caption.fontFamily
|
|
51
51
|
},
|
|
52
52
|
axisPointer: {
|
|
53
53
|
type: "line"
|
|
54
54
|
},
|
|
55
|
-
position:
|
|
56
|
-
formatter:
|
|
55
|
+
position: J(e),
|
|
56
|
+
formatter: Z(t)
|
|
57
57
|
},
|
|
58
58
|
// Legend styling baked here; `show` is toggled by the merger based on
|
|
59
59
|
// series count. Histogram doesn't accept `labelFormatter` at the
|
|
60
60
|
// options layer (bin labels are pre-formatted in the merger), so we
|
|
61
61
|
// skip the legend `labelFormatter` argument too.
|
|
62
62
|
legend: {
|
|
63
|
-
...
|
|
63
|
+
...X({
|
|
64
64
|
hasLegend: !1
|
|
65
65
|
})
|
|
66
66
|
},
|
|
67
67
|
axisPointer: {
|
|
68
68
|
lineStyle: {
|
|
69
|
-
color:
|
|
69
|
+
color: e.palette.grey[400]
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
color: [
|
|
72
|
+
color: [e.palette.secondary.main, ...Object.values(e.palette.qualitative?.bold ?? {})],
|
|
73
73
|
xAxis: {
|
|
74
74
|
type: "category",
|
|
75
75
|
axisLine: {
|
|
@@ -79,8 +79,8 @@ function tt({
|
|
|
79
79
|
show: !1
|
|
80
80
|
},
|
|
81
81
|
axisLabel: {
|
|
82
|
-
...
|
|
83
|
-
padding: [parseInt(
|
|
82
|
+
...B(e),
|
|
83
|
+
padding: [parseInt(e.spacing(0.5)), 0, 0, 0],
|
|
84
84
|
margin: 0,
|
|
85
85
|
// `interval: 0` makes every bin label a candidate so `hideOverlap`
|
|
86
86
|
// can pack the maximum number that physically fit. The category-axis
|
|
@@ -92,8 +92,8 @@ function tt({
|
|
|
92
92
|
},
|
|
93
93
|
yAxis: {
|
|
94
94
|
type: "value",
|
|
95
|
-
min: (
|
|
96
|
-
max: (
|
|
95
|
+
min: (i) => (s = i.min < 0 ? k(i.min) : 0, s),
|
|
96
|
+
max: (i) => (n = i.max <= 0 ? 1 : k(i.max), n),
|
|
97
97
|
axisLine: {
|
|
98
98
|
show: !1
|
|
99
99
|
},
|
|
@@ -103,70 +103,87 @@ function tt({
|
|
|
103
103
|
splitLine: {
|
|
104
104
|
show: !0,
|
|
105
105
|
lineStyle: {
|
|
106
|
-
color:
|
|
106
|
+
color: e.palette.black?.[4] ?? e.palette.divider
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
axisLabel: {
|
|
110
|
-
...
|
|
111
|
-
margin: parseInt(
|
|
110
|
+
...B(e),
|
|
111
|
+
margin: parseInt(e.spacing(1)),
|
|
112
112
|
show: !0,
|
|
113
113
|
showMaxLabel: !0,
|
|
114
114
|
showMinLabel: !0,
|
|
115
115
|
verticalAlign: "bottom",
|
|
116
116
|
inside: !0,
|
|
117
|
-
formatter: (
|
|
117
|
+
formatter: (i) => i !== n && i !== s || i === 0 ? "" : t ? t(i) : String(i)
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Be(e) {
|
|
123
123
|
const {
|
|
124
|
-
theme:
|
|
124
|
+
theme: t,
|
|
125
125
|
formatter: s,
|
|
126
|
-
ticks:
|
|
127
|
-
series:
|
|
128
|
-
labelFormatter:
|
|
129
|
-
selection:
|
|
130
|
-
} =
|
|
131
|
-
for (let
|
|
132
|
-
const
|
|
133
|
-
|
|
126
|
+
ticks: n,
|
|
127
|
+
series: i,
|
|
128
|
+
labelFormatter: l,
|
|
129
|
+
selection: c
|
|
130
|
+
} = e, a = e.optionsOverride, m = e.lockedItems, u = c && c.length > 0 ? new Set(c) : null, g = [];
|
|
131
|
+
for (let r = 0; r < n.length - 1; r++) {
|
|
132
|
+
const f = n[r], x = n[r + 1], d = `${H(f)}–${H(x)}`;
|
|
133
|
+
g.push(l ? l(d) : d);
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
const y = m && m.length > 0 ? (() => {
|
|
136
|
+
const r = m.map(Number), f = g[Math.min(...r)], x = g[Math.max(...r)];
|
|
137
|
+
return f != null && x != null ? {
|
|
138
|
+
min: f,
|
|
139
|
+
max: x
|
|
140
|
+
} : null;
|
|
141
|
+
})() : null;
|
|
142
|
+
return (r, f, x) => {
|
|
143
|
+
if (r == null) {
|
|
144
|
+
const o = oe({
|
|
145
|
+
theme: t,
|
|
139
146
|
formatter: s
|
|
140
147
|
});
|
|
141
|
-
return a ?
|
|
148
|
+
return a ? te(o, a) : o;
|
|
142
149
|
}
|
|
143
|
-
const d = Array.isArray(
|
|
144
|
-
if (d.length === 0 ||
|
|
150
|
+
const d = Array.isArray(f) ? f : [];
|
|
151
|
+
if (d.length === 0 || g.length === 0)
|
|
145
152
|
return {
|
|
146
|
-
...
|
|
153
|
+
...r,
|
|
147
154
|
dataset: [],
|
|
148
155
|
series: []
|
|
149
156
|
};
|
|
150
|
-
const
|
|
151
|
-
let
|
|
152
|
-
const T =
|
|
153
|
-
color: (
|
|
154
|
-
const
|
|
155
|
-
return
|
|
157
|
+
const I = d.length > 1, v = Array.isArray(r.series) ? r.series : [], G = v[0] ?? {}, F = typeof r.yAxis == "object" && !Array.isArray(r.yAxis) ? r.yAxis : {}, L = typeof r.grid == "object" && !Array.isArray(r.grid) ? r.grid : {}, E = typeof r.tooltip == "object" && !Array.isArray(r.tooltip) ? r.tooltip : {}, W = typeof r.legend == "object" && !Array.isArray(r.legend) ? r.legend : {}, S = x?.formatter;
|
|
158
|
+
let C = 0, M = 1;
|
|
159
|
+
const T = ie(r.dataZoom, I), Y = typeof L.bottom == "number" ? L.bottom : 24, j = I ? 56 : Y, q = T ? j + D.sliderHeight + D.sliderGap : j, z = {
|
|
160
|
+
color: (o) => {
|
|
161
|
+
const p = o.color;
|
|
162
|
+
return u ? u.has(o.dataIndex) ? p : V.color.modifyAlpha(p, 0.15) : p;
|
|
156
163
|
}
|
|
164
|
+
}, O = Array.isArray(r.xAxis) ? r.xAxis[0] : r.xAxis, _ = {
|
|
165
|
+
min: y?.min ?? O?.min ?? null,
|
|
166
|
+
max: y?.max ?? O?.max ?? null
|
|
167
|
+
}, U = Array.isArray(r.xAxis) ? [{
|
|
168
|
+
...r.xAxis[0],
|
|
169
|
+
..._
|
|
170
|
+
}, ...r.xAxis.slice(1)] : {
|
|
171
|
+
...typeof r.xAxis == "object" ? r.xAxis : {},
|
|
172
|
+
..._
|
|
157
173
|
};
|
|
158
174
|
return {
|
|
159
|
-
...
|
|
160
|
-
|
|
161
|
-
|
|
175
|
+
...r,
|
|
176
|
+
xAxis: U,
|
|
177
|
+
dataset: d.map((o) => ({
|
|
178
|
+
source: g.map((p, h) => [p, o[h] ?? 0])
|
|
162
179
|
})),
|
|
163
|
-
series: d.map((
|
|
164
|
-
const h =
|
|
180
|
+
series: d.map((o, p) => {
|
|
181
|
+
const h = v[p] ?? G, $ = re(t, i?.[p]?.color);
|
|
165
182
|
return {
|
|
166
183
|
...typeof h == "object" ? h : {},
|
|
167
184
|
type: "bar",
|
|
168
|
-
datasetIndex:
|
|
169
|
-
name:
|
|
185
|
+
datasetIndex: p,
|
|
186
|
+
name: i?.[p]?.name ?? `Series ${p + 1}`,
|
|
170
187
|
encode: {
|
|
171
188
|
x: 0,
|
|
172
189
|
y: 1
|
|
@@ -175,52 +192,52 @@ function Nt(t) {
|
|
|
175
192
|
emphasis: {
|
|
176
193
|
focus: "series"
|
|
177
194
|
},
|
|
178
|
-
itemStyle:
|
|
179
|
-
|
|
180
|
-
color:
|
|
195
|
+
itemStyle: z,
|
|
196
|
+
...$ ? {
|
|
197
|
+
color: $
|
|
181
198
|
} : {}
|
|
182
199
|
};
|
|
183
200
|
}),
|
|
184
201
|
legend: {
|
|
185
|
-
...
|
|
186
|
-
show:
|
|
202
|
+
...W,
|
|
203
|
+
show: I
|
|
187
204
|
},
|
|
188
205
|
grid: {
|
|
189
206
|
...L,
|
|
190
|
-
bottom:
|
|
207
|
+
bottom: q
|
|
191
208
|
},
|
|
192
209
|
...T ? {
|
|
193
210
|
dataZoom: T
|
|
194
211
|
} : {},
|
|
195
212
|
yAxis: {
|
|
196
|
-
...
|
|
197
|
-
min: (
|
|
198
|
-
max: (
|
|
213
|
+
...F,
|
|
214
|
+
min: (o) => (C = o.min < 0 ? k(o.min) : 0, C),
|
|
215
|
+
max: (o) => (M = o.max <= 0 ? 1 : k(o.max), M),
|
|
199
216
|
axisLabel: {
|
|
200
|
-
...
|
|
201
|
-
formatter: (
|
|
217
|
+
...F.axisLabel ?? {},
|
|
218
|
+
formatter: (o) => o !== M && o !== C || o === 0 ? "" : S ? S(o) : String(o)
|
|
202
219
|
}
|
|
203
220
|
},
|
|
204
221
|
tooltip: {
|
|
205
|
-
...
|
|
206
|
-
formatter:
|
|
222
|
+
...E,
|
|
223
|
+
formatter: Z(S)
|
|
207
224
|
}
|
|
208
225
|
};
|
|
209
226
|
};
|
|
210
227
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
213
|
-
const
|
|
228
|
+
function Z(e) {
|
|
229
|
+
return Q((t) => {
|
|
230
|
+
const n = t.value?.[1], i = typeof n == "number" && e ? e(n) : n ?? "", l = typeof t.marker == "string" ? t.marker : "", c = t.seriesName ? `${t.seriesName}: ` : "";
|
|
214
231
|
return {
|
|
215
|
-
name: String(
|
|
216
|
-
seriesName:
|
|
217
|
-
marker:
|
|
218
|
-
value:
|
|
232
|
+
name: String(t.name ?? ""),
|
|
233
|
+
seriesName: c,
|
|
234
|
+
marker: l,
|
|
235
|
+
value: i
|
|
219
236
|
};
|
|
220
237
|
});
|
|
221
238
|
}
|
|
222
|
-
function
|
|
223
|
-
return Number.isInteger(
|
|
239
|
+
function H(e) {
|
|
240
|
+
return Number.isInteger(e) ? String(e) : Number(e.toFixed(2)).toString();
|
|
224
241
|
}
|
|
225
242
|
const w = {
|
|
226
243
|
container: {
|
|
@@ -229,11 +246,11 @@ const w = {
|
|
|
229
246
|
justifyContent: "space-between",
|
|
230
247
|
flexDirection: "column",
|
|
231
248
|
gap: ({
|
|
232
|
-
spacing:
|
|
233
|
-
}) =>
|
|
249
|
+
spacing: e
|
|
250
|
+
}) => e(1),
|
|
234
251
|
height: ({
|
|
235
|
-
spacing:
|
|
236
|
-
}) =>
|
|
252
|
+
spacing: e
|
|
253
|
+
}) => e(38)
|
|
237
254
|
},
|
|
238
255
|
grid: {
|
|
239
256
|
display: "flex",
|
|
@@ -246,94 +263,100 @@ const w = {
|
|
|
246
263
|
display: "flex",
|
|
247
264
|
alignItems: "center",
|
|
248
265
|
gap: ({
|
|
249
|
-
spacing:
|
|
250
|
-
}) =>
|
|
266
|
+
spacing: e
|
|
267
|
+
}) => e(2),
|
|
251
268
|
height: ({
|
|
252
|
-
spacing:
|
|
253
|
-
}) =>
|
|
269
|
+
spacing: e
|
|
270
|
+
}) => e(5)
|
|
254
271
|
},
|
|
255
272
|
legendItem: {
|
|
256
273
|
display: "flex",
|
|
257
274
|
alignItems: "center",
|
|
258
275
|
gap: ({
|
|
259
|
-
spacing:
|
|
260
|
-
}) =>
|
|
276
|
+
spacing: e
|
|
277
|
+
}) => e(1.5)
|
|
261
278
|
}
|
|
262
|
-
},
|
|
279
|
+
}, se = (e) => ({
|
|
263
280
|
flex: 1,
|
|
264
|
-
height: `${
|
|
281
|
+
height: `${e}%`,
|
|
265
282
|
minWidth: 8
|
|
266
283
|
});
|
|
267
|
-
function
|
|
268
|
-
const
|
|
284
|
+
function De(e) {
|
|
285
|
+
const t = ee(15), {
|
|
269
286
|
bins: s
|
|
270
|
-
} =
|
|
271
|
-
let
|
|
272
|
-
if (
|
|
273
|
-
const
|
|
274
|
-
length:
|
|
275
|
-
}, (
|
|
276
|
-
const
|
|
277
|
-
return Math.round(20 + 80 * Math.exp(-((
|
|
287
|
+
} = e, n = s === void 0 ? 12 : s;
|
|
288
|
+
let i, l, c, a, m;
|
|
289
|
+
if (t[0] !== n) {
|
|
290
|
+
const r = Array.from({
|
|
291
|
+
length: n
|
|
292
|
+
}, (f, x) => {
|
|
293
|
+
const d = x / Math.max(1, n - 1);
|
|
294
|
+
return Math.round(20 + 80 * Math.exp(-((d - 0.5) ** 2) * 8));
|
|
278
295
|
});
|
|
279
|
-
|
|
296
|
+
l = A, m = w.container, i = A, c = w.grid, a = r.map(ce), t[0] = n, t[1] = i, t[2] = l, t[3] = c, t[4] = a, t[5] = m;
|
|
280
297
|
} else
|
|
281
|
-
|
|
282
|
-
let m;
|
|
283
|
-
e[6] !== r || e[7] !== l || e[8] !== a ? (m = /* @__PURE__ */ b(r, { sx: l, children: a }), e[6] = r, e[7] = l, e[8] = a, e[9] = m) : m = e[9];
|
|
284
|
-
let o;
|
|
285
|
-
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ b(A, { sx: w.legend, children: [0, 1].map(rt) }), e[10] = o) : o = e[10];
|
|
298
|
+
i = t[1], l = t[2], c = t[3], a = t[4], m = t[5];
|
|
286
299
|
let u;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
300
|
+
t[6] !== i || t[7] !== c || t[8] !== a ? (u = /* @__PURE__ */ b(i, { sx: c, children: a }), t[6] = i, t[7] = c, t[8] = a, t[9] = u) : u = t[9];
|
|
301
|
+
let g;
|
|
302
|
+
t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ b(A, { sx: w.legend, children: [0, 1].map(le) }), t[10] = g) : g = t[10];
|
|
303
|
+
let y;
|
|
304
|
+
return t[11] !== l || t[12] !== m || t[13] !== u ? (y = /* @__PURE__ */ R(l, { sx: m, children: [
|
|
305
|
+
u,
|
|
306
|
+
g
|
|
307
|
+
] }), t[11] = l, t[12] = m, t[13] = u, t[14] = y) : y = t[14], y;
|
|
291
308
|
}
|
|
292
|
-
function
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */ b(
|
|
295
|
-
/* @__PURE__ */ b(
|
|
296
|
-
] }, `legend-${
|
|
309
|
+
function le(e) {
|
|
310
|
+
return /* @__PURE__ */ R(A, { sx: w.legendItem, children: [
|
|
311
|
+
/* @__PURE__ */ b(N, { variant: "circular", width: 8, height: 8 }),
|
|
312
|
+
/* @__PURE__ */ b(N, { width: 48, height: 8 })
|
|
313
|
+
] }, `legend-${e}`);
|
|
297
314
|
}
|
|
298
|
-
function
|
|
299
|
-
return /* @__PURE__ */ b(
|
|
315
|
+
function ce(e, t) {
|
|
316
|
+
return /* @__PURE__ */ b(N, { variant: "rectangular", sx: se(e) }, `bar-${t}`);
|
|
300
317
|
}
|
|
301
|
-
function
|
|
302
|
-
const
|
|
303
|
-
return
|
|
304
|
-
filename:
|
|
305
|
-
getCaptureEl:
|
|
306
|
-
pixelRatio:
|
|
307
|
-
backgroundColor:
|
|
308
|
-
})),
|
|
309
|
-
filename:
|
|
318
|
+
function He(e) {
|
|
319
|
+
const t = [];
|
|
320
|
+
return e.getCaptureEl && t.push(ne({
|
|
321
|
+
filename: e.filename,
|
|
322
|
+
getCaptureEl: e.getCaptureEl,
|
|
323
|
+
pixelRatio: e.pngPixelRatio,
|
|
324
|
+
backgroundColor: e.pngBackgroundColor
|
|
325
|
+
})), t.push(ae({
|
|
326
|
+
filename: e.filename,
|
|
310
327
|
getRows: () => {
|
|
311
|
-
const s =
|
|
312
|
-
for (let a = 0; a <
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
for (let a = 0; a < Math.max(0,
|
|
316
|
-
const
|
|
317
|
-
for (let
|
|
318
|
-
|
|
328
|
+
const s = e.getData(), n = e.getTicks(), i = s.length, l = ["bin_low", "bin_high"];
|
|
329
|
+
for (let a = 0; a < i; a++)
|
|
330
|
+
l.push(e.seriesNames?.[a] ?? `series_${a + 1}`);
|
|
331
|
+
const c = [l];
|
|
332
|
+
for (let a = 0; a < Math.max(0, n.length - 1); a++) {
|
|
333
|
+
const m = [n[a], n[a + 1]];
|
|
334
|
+
for (let u = 0; u < i; u++) m.push(s[u]?.[a] ?? 0);
|
|
335
|
+
c.push(m);
|
|
319
336
|
}
|
|
320
|
-
return
|
|
337
|
+
return c;
|
|
321
338
|
}
|
|
322
|
-
})),
|
|
339
|
+
})), t;
|
|
323
340
|
}
|
|
324
|
-
const
|
|
325
|
-
if (!
|
|
326
|
-
const s =
|
|
327
|
-
return s <= 0 ?
|
|
328
|
-
}) :
|
|
329
|
-
function
|
|
330
|
-
return Array.isArray(
|
|
341
|
+
const Re = (e) => Array.isArray(e) ? e.map((t) => {
|
|
342
|
+
if (!P(t)) return t;
|
|
343
|
+
const s = t.reduce((n, i) => n + Math.abs(i), 0);
|
|
344
|
+
return s <= 0 ? t : t.map((n) => n / s * 100);
|
|
345
|
+
}) : e;
|
|
346
|
+
function P(e) {
|
|
347
|
+
return Array.isArray(e) ? e.every((t) => typeof t == "number" && Number.isFinite(t)) : !1;
|
|
348
|
+
}
|
|
349
|
+
function Ze(e, t) {
|
|
350
|
+
if (t.length === 0 || !Array.isArray(e)) return e;
|
|
351
|
+
const s = new Set(t.map(Number));
|
|
352
|
+
return e.map((n) => P(n) ? n.map((i, l) => s.has(l) ? i : 0) : n);
|
|
331
353
|
}
|
|
332
354
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
355
|
+
De as HistogramSkeleton,
|
|
356
|
+
He as createHistogramDownloadConfig,
|
|
357
|
+
Be as createHistogramOptionFactory,
|
|
358
|
+
Ze as filterHistogramByLockedBins,
|
|
359
|
+
oe as histogramOptions,
|
|
360
|
+
Re as toRelativeHistogramData
|
|
338
361
|
};
|
|
339
362
|
//# sourceMappingURL=histogram.js.map
|