@carto/ps-react-ui 4.17.2 → 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.
Files changed (91) hide show
  1. package/dist/category-Ct2BzADB.js +753 -0
  2. package/dist/category-Ct2BzADB.js.map +1 -0
  3. package/dist/change-column-Bhcxmp-r.js +1148 -0
  4. package/dist/change-column-Bhcxmp-r.js.map +1 -0
  5. package/dist/echart-B10dhEaM.js +262 -0
  6. package/dist/echart-B10dhEaM.js.map +1 -0
  7. package/dist/legend/stores.js +1 -1
  8. package/dist/{legend-store-registry-Bo8U_qWM.js → legend-store-registry-p1tSwJXH.js} +151 -147
  9. package/dist/legend-store-registry-p1tSwJXH.js.map +1 -0
  10. package/dist/legend.js +473 -415
  11. package/dist/legend.js.map +1 -1
  12. package/dist/types/legend/components/legend-actions/legend-actions.d.ts +2 -2
  13. package/dist/types/legend/components/legend-group/styles.d.ts +31 -20
  14. package/dist/types/legend/components/legend-row/styles.d.ts +24 -4
  15. package/dist/types/legend/components/legend-sortable/styles.d.ts +4 -3
  16. package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +15 -5
  17. package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -2
  18. package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +6 -1
  19. package/dist/types/widgets-v2/category/style.d.ts +8 -0
  20. package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +10 -4
  21. package/dist/types/widgets-v2/histogram/index.d.ts +1 -1
  22. package/dist/types/widgets-v2/histogram/transforms.d.ts +11 -0
  23. package/dist/types/widgets-v2/histogram/types.d.ts +9 -0
  24. package/dist/types/widgets-v2/scatterplot/index.d.ts +1 -1
  25. package/dist/types/widgets-v2/scatterplot/transforms.d.ts +9 -0
  26. package/dist/types/widgets-v2/table/index.d.ts +1 -0
  27. package/dist/types/widgets-v2/table/transforms.d.ts +13 -0
  28. package/dist/types/widgets-v2/table/transforms.test.d.ts +1 -0
  29. package/dist/types/widgets-v2/timeseries/index.d.ts +1 -0
  30. package/dist/types/widgets-v2/timeseries/transforms.d.ts +10 -0
  31. package/dist/types/widgets-v2/timeseries/transforms.test.d.ts +1 -0
  32. package/dist/widgets-v2/actions.js +1 -1
  33. package/dist/widgets-v2/category.js +1 -1
  34. package/dist/widgets-v2/echart.js +1 -1
  35. package/dist/widgets-v2/echart.js.map +1 -1
  36. package/dist/widgets-v2/histogram.js +181 -158
  37. package/dist/widgets-v2/histogram.js.map +1 -1
  38. package/dist/widgets-v2/pie.js +155 -116
  39. package/dist/widgets-v2/pie.js.map +1 -1
  40. package/dist/widgets-v2/scatterplot.js +91 -85
  41. package/dist/widgets-v2/scatterplot.js.map +1 -1
  42. package/dist/widgets-v2/table.js +55 -45
  43. package/dist/widgets-v2/table.js.map +1 -1
  44. package/dist/widgets-v2/timeseries.js +96 -85
  45. package/dist/widgets-v2/timeseries.js.map +1 -1
  46. package/dist/widgets-v2.js +4 -4
  47. package/package.json +3 -3
  48. package/src/legend/components/legend-actions/legend-actions.tsx +2 -2
  49. package/src/legend/components/legend-group/styles.ts +59 -36
  50. package/src/legend/components/legend-row/legend-row.tsx +10 -7
  51. package/src/legend/components/legend-row/styles.ts +41 -10
  52. package/src/legend/components/legend-sortable/styles.ts +13 -4
  53. package/src/legend/stores/legend-store-registry.ts +28 -4
  54. package/src/legend/stores/legend-store.test.ts +23 -0
  55. package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +62 -0
  56. package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +45 -13
  57. package/src/widgets-v2/category/category-ui.test.tsx +55 -0
  58. package/src/widgets-v2/category/category-ui.tsx +65 -6
  59. package/src/widgets-v2/category/components/category-legend.test.tsx +53 -2
  60. package/src/widgets-v2/category/components/category-legend.tsx +55 -12
  61. package/src/widgets-v2/category/components/category-row-stacked.test.tsx +7 -3
  62. package/src/widgets-v2/category/components/category-row-stacked.tsx +8 -3
  63. package/src/widgets-v2/category/style.ts +10 -2
  64. package/src/widgets-v2/echart/echart-ui.test.tsx +25 -0
  65. package/src/widgets-v2/echart/echart-ui.tsx +20 -0
  66. package/src/widgets-v2/echart/use-chart-selection.test.tsx +3 -1
  67. package/src/widgets-v2/echart/use-chart-selection.ts +10 -4
  68. package/src/widgets-v2/histogram/index.ts +4 -1
  69. package/src/widgets-v2/histogram/options.test.ts +86 -0
  70. package/src/widgets-v2/histogram/options.ts +50 -0
  71. package/src/widgets-v2/histogram/transforms.test.ts +36 -1
  72. package/src/widgets-v2/histogram/transforms.ts +23 -0
  73. package/src/widgets-v2/histogram/types.ts +9 -0
  74. package/src/widgets-v2/pie/options.test.ts +262 -0
  75. package/src/widgets-v2/pie/options.ts +80 -5
  76. package/src/widgets-v2/scatterplot/index.ts +4 -1
  77. package/src/widgets-v2/scatterplot/transforms.test.ts +38 -1
  78. package/src/widgets-v2/scatterplot/transforms.ts +23 -0
  79. package/src/widgets-v2/table/index.ts +1 -0
  80. package/src/widgets-v2/table/transforms.test.ts +40 -0
  81. package/src/widgets-v2/table/transforms.ts +26 -0
  82. package/src/widgets-v2/timeseries/index.ts +1 -0
  83. package/src/widgets-v2/timeseries/transforms.test.ts +49 -0
  84. package/src/widgets-v2/timeseries/transforms.ts +31 -0
  85. package/dist/category-CGS_eHr4.js +0 -719
  86. package/dist/category-CGS_eHr4.js.map +0 -1
  87. package/dist/change-column-CiVAjOUB.js +0 -1143
  88. package/dist/change-column-CiVAjOUB.js.map +0 -1
  89. package/dist/echart-Bdvbfx9s.js +0 -250
  90. package/dist/echart-Bdvbfx9s.js.map +0 -1
  91. package/dist/legend-store-registry-Bo8U_qWM.js.map +0 -1
@@ -1,8 +1,8 @@
1
- import * as E from "echarts";
2
- import { n as I, h as O, d as W, g as Y, c as q, f as z } from "../option-builders-DPeoyQaM.js";
3
- import { jsx as b, jsxs as $ } from "react/jsx-runtime";
4
- import { c as U } from "react/compiler-runtime";
5
- import { Skeleton as M, Box as A } from "@mui/material";
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 _ } from "../transforms-Cdx4fkU5.js";
24
- import { m as V, r as J } from "../resolve-theme-color-BdojIw0K.js";
25
- import { p as K } from "../data-zoom-layout-D_FYdnap.js";
26
- import { b as Q } from "../png-item-9dNbB37T.js";
27
- import { b as X } from "../csv-item-hH_Gt7ur.js";
28
- function tt({
29
- theme: t,
30
- formatter: e
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, i = 1;
32
+ let s = 0, n = 1;
33
33
  return {
34
34
  grid: {
35
- left: parseInt(t.spacing(1)),
36
- top: parseInt(t.spacing(3)),
37
- right: parseInt(t.spacing(1)),
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
- ...q(!1, t),
39
+ ...K(!1, e),
40
40
  containLabel: !0
41
41
  },
42
42
  tooltip: {
43
43
  trigger: "axis",
44
- backgroundColor: t.palette.grey[900],
44
+ backgroundColor: e.palette.grey[900],
45
45
  borderWidth: 0,
46
- padding: [parseInt(t.spacing(1)), parseInt(t.spacing(1))],
46
+ padding: [parseInt(e.spacing(1)), parseInt(e.spacing(1))],
47
47
  textStyle: {
48
- color: t.palette.common.white,
48
+ color: e.palette.common.white,
49
49
  fontSize: 11,
50
- fontFamily: t.typography.caption.fontFamily
50
+ fontFamily: e.typography.caption.fontFamily
51
51
  },
52
52
  axisPointer: {
53
53
  type: "line"
54
54
  },
55
- position: Y(t),
56
- formatter: D(e)
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
- ...W({
63
+ ...X({
64
64
  hasLegend: !1
65
65
  })
66
66
  },
67
67
  axisPointer: {
68
68
  lineStyle: {
69
- color: t.palette.grey[400]
69
+ color: e.palette.grey[400]
70
70
  }
71
71
  },
72
- color: [t.palette.secondary.main, ...Object.values(t.palette.qualitative?.bold ?? {})],
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
- ...O(t),
83
- padding: [parseInt(t.spacing(0.5)), 0, 0, 0],
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: (r) => (s = r.min < 0 ? I(r.min) : 0, s),
96
- max: (r) => (i = r.max <= 0 ? 1 : I(r.max), i),
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: t.palette.black?.[4] ?? t.palette.divider
106
+ color: e.palette.black?.[4] ?? e.palette.divider
107
107
  }
108
108
  },
109
109
  axisLabel: {
110
- ...O(t),
111
- margin: parseInt(t.spacing(1)),
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: (r) => r !== i && r !== s || r === 0 ? "" : e ? e(r) : String(r)
117
+ formatter: (i) => i !== n && i !== s || i === 0 ? "" : t ? t(i) : String(i)
118
118
  }
119
119
  }
120
120
  };
121
121
  }
122
- function Nt(t) {
122
+ function Be(e) {
123
123
  const {
124
- theme: e,
124
+ theme: t,
125
125
  formatter: s,
126
- ticks: i,
127
- series: r,
128
- labelFormatter: c,
129
- selection: l
130
- } = t, a = t.optionsOverride, p = l && l.length > 0 ? new Set(l) : null, m = [];
131
- for (let o = 0; o < i.length - 1; o++) {
132
- const u = i[o], f = i[o + 1], d = `${j(u)}–${j(f)}`;
133
- m.push(c ? c(d) : d);
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
- return (o, u, f) => {
136
- if (o == null) {
137
- const n = tt({
138
- theme: e,
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 ? V(n, a) : n;
148
+ return a ? te(o, a) : o;
142
149
  }
143
- const d = Array.isArray(u) ? u : [];
144
- if (d.length === 0 || m.length === 0)
150
+ const d = Array.isArray(f) ? f : [];
151
+ if (d.length === 0 || g.length === 0)
145
152
  return {
146
- ...o,
153
+ ...r,
147
154
  dataset: [],
148
155
  series: []
149
156
  };
150
- const y = d.length > 1, x = Array.isArray(o.series) ? o.series : [], H = x[0] ?? {}, v = typeof o.yAxis == "object" && !Array.isArray(o.yAxis) ? o.yAxis : {}, L = typeof o.grid == "object" && !Array.isArray(o.grid) ? o.grid : {}, Z = typeof o.tooltip == "object" && !Array.isArray(o.tooltip) ? o.tooltip : {}, B = typeof o.legend == "object" && !Array.isArray(o.legend) ? o.legend : {}, S = f?.formatter;
151
- let k = 0, C = 1;
152
- const T = K(o.dataZoom, y), P = typeof L.bottom == "number" ? L.bottom : 24, F = y ? 56 : P, G = T ? F + _.sliderHeight + _.sliderGap : F, R = {
153
- color: (n) => {
154
- const g = n.color;
155
- return p ? p.has(n.dataIndex) ? g : E.color.modifyAlpha(g, 0.15) : g;
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
- ...o,
160
- dataset: d.map((n) => ({
161
- source: m.map((g, h) => [g, n[h] ?? 0])
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((n, g) => {
164
- const h = x[g] ?? H, N = J(e, r?.[g]?.color);
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: g,
169
- name: r?.[g]?.name ?? `Series ${g + 1}`,
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: R,
179
- ...N ? {
180
- color: N
195
+ itemStyle: z,
196
+ ...$ ? {
197
+ color: $
181
198
  } : {}
182
199
  };
183
200
  }),
184
201
  legend: {
185
- ...B,
186
- show: y
202
+ ...W,
203
+ show: I
187
204
  },
188
205
  grid: {
189
206
  ...L,
190
- bottom: G
207
+ bottom: q
191
208
  },
192
209
  ...T ? {
193
210
  dataZoom: T
194
211
  } : {},
195
212
  yAxis: {
196
- ...v,
197
- min: (n) => (k = n.min < 0 ? I(n.min) : 0, k),
198
- max: (n) => (C = n.max <= 0 ? 1 : I(n.max), C),
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
- ...v.axisLabel ?? {},
201
- formatter: (n) => n !== C && n !== k || n === 0 ? "" : S ? S(n) : String(n)
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
- ...Z,
206
- formatter: D(S)
222
+ ...E,
223
+ formatter: Z(S)
207
224
  }
208
225
  };
209
226
  };
210
227
  }
211
- function D(t) {
212
- return z((e) => {
213
- const i = e.value?.[1], r = typeof i == "number" && t ? t(i) : i ?? "", c = typeof e.marker == "string" ? e.marker : "", l = e.seriesName ? `${e.seriesName}: ` : "";
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(e.name ?? ""),
216
- seriesName: l,
217
- marker: c,
218
- value: r
232
+ name: String(t.name ?? ""),
233
+ seriesName: c,
234
+ marker: l,
235
+ value: i
219
236
  };
220
237
  });
221
238
  }
222
- function j(t) {
223
- return Number.isInteger(t) ? String(t) : Number(t.toFixed(2)).toString();
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: t
233
- }) => t(1),
249
+ spacing: e
250
+ }) => e(1),
234
251
  height: ({
235
- spacing: t
236
- }) => t(38)
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: t
250
- }) => t(2),
266
+ spacing: e
267
+ }) => e(2),
251
268
  height: ({
252
- spacing: t
253
- }) => t(5)
269
+ spacing: e
270
+ }) => e(5)
254
271
  },
255
272
  legendItem: {
256
273
  display: "flex",
257
274
  alignItems: "center",
258
275
  gap: ({
259
- spacing: t
260
- }) => t(1.5)
276
+ spacing: e
277
+ }) => e(1.5)
261
278
  }
262
- }, et = (t) => ({
279
+ }, se = (e) => ({
263
280
  flex: 1,
264
- height: `${t}%`,
281
+ height: `${e}%`,
265
282
  minWidth: 8
266
283
  });
267
- function Ot(t) {
268
- const e = U(15), {
284
+ function De(e) {
285
+ const t = ee(15), {
269
286
  bins: s
270
- } = t, i = s === void 0 ? 12 : s;
271
- let r, c, l, a, p;
272
- if (e[0] !== i) {
273
- const f = Array.from({
274
- length: i
275
- }, (d, y) => {
276
- const x = y / Math.max(1, i - 1);
277
- return Math.round(20 + 80 * Math.exp(-((x - 0.5) ** 2) * 8));
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
- c = A, p = w.container, r = A, l = w.grid, a = f.map(ot), e[0] = i, e[1] = r, e[2] = c, e[3] = l, e[4] = a, e[5] = p;
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
- r = e[1], c = e[2], l = e[3], a = e[4], p = e[5];
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
- return e[11] !== c || e[12] !== p || e[13] !== m ? (u = /* @__PURE__ */ $(c, { sx: p, children: [
288
- m,
289
- o
290
- ] }), e[11] = c, e[12] = p, e[13] = m, e[14] = u) : u = e[14], u;
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 rt(t) {
293
- return /* @__PURE__ */ $(A, { sx: w.legendItem, children: [
294
- /* @__PURE__ */ b(M, { variant: "circular", width: 8, height: 8 }),
295
- /* @__PURE__ */ b(M, { width: 48, height: 8 })
296
- ] }, `legend-${t}`);
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 ot(t, e) {
299
- return /* @__PURE__ */ b(M, { variant: "rectangular", sx: et(t) }, `bar-${e}`);
315
+ function ce(e, t) {
316
+ return /* @__PURE__ */ b(N, { variant: "rectangular", sx: se(e) }, `bar-${t}`);
300
317
  }
301
- function _t(t) {
302
- const e = [];
303
- return t.getCaptureEl && e.push(Q({
304
- filename: t.filename,
305
- getCaptureEl: t.getCaptureEl,
306
- pixelRatio: t.pngPixelRatio,
307
- backgroundColor: t.pngBackgroundColor
308
- })), e.push(X({
309
- filename: t.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 = t.getData(), i = t.getTicks(), r = s.length, c = ["bin_low", "bin_high"];
312
- for (let a = 0; a < r; a++)
313
- c.push(t.seriesNames?.[a] ?? `series_${a + 1}`);
314
- const l = [c];
315
- for (let a = 0; a < Math.max(0, i.length - 1); a++) {
316
- const p = [i[a], i[a + 1]];
317
- for (let m = 0; m < r; m++) p.push(s[m]?.[a] ?? 0);
318
- l.push(p);
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 l;
337
+ return c;
321
338
  }
322
- })), e;
339
+ })), t;
323
340
  }
324
- const jt = (t) => Array.isArray(t) ? t.map((e) => {
325
- if (!it(e)) return e;
326
- const s = e.reduce((i, r) => i + Math.abs(r), 0);
327
- return s <= 0 ? e : e.map((i) => i / s * 100);
328
- }) : t;
329
- function it(t) {
330
- return Array.isArray(t) ? t.every((e) => typeof e == "number" && Number.isFinite(e)) : !1;
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
- Ot as HistogramSkeleton,
334
- _t as createHistogramDownloadConfig,
335
- Nt as createHistogramOptionFactory,
336
- tt as histogramOptions,
337
- jt as toRelativeHistogramData
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