@devgateway/dvz-ui-react 1.8.8 → 1.9.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 (56) hide show
  1. package/dist/cjs/common.css +1 -1
  2. package/dist/cjs/embeddable/big-number-trend/Alternative.js +1 -1
  3. package/dist/cjs/embeddable/big-number-trend/BigNumberTrendContainer.js +1 -0
  4. package/dist/cjs/embeddable/big-number-trend/Classic.js +1 -1
  5. package/dist/cjs/embeddable/big-number-trend/useBigNumberTrendData.js +1 -0
  6. package/dist/cjs/embeddable/chart/Bar.js +1 -1
  7. package/dist/cjs/embeddable/chart/Messages.js +2 -2
  8. package/dist/cjs/embeddable/chart/data/Line.js +1 -1
  9. package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
  10. package/dist/cjs/embeddable/chart/index.js +1 -1
  11. package/dist/cjs/embeddable/d3Map/index.js +1 -1
  12. package/dist/cjs/embeddable/data/CategoriesProvider.js +1 -1
  13. package/dist/cjs/embeddable/data/DataConsumer.js +1 -1
  14. package/dist/cjs/embeddable/data/DataProvider.js +1 -1
  15. package/dist/cjs/embeddable/download/dom-to-image.js +32 -1
  16. package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
  17. package/dist/cjs/embeddable/map/index.js +2 -2
  18. package/dist/cjs/embeddable/pagemodules/FloatingNavigator.js +1 -1
  19. package/dist/cjs/embeddable/pagemodules/index.js +1 -1
  20. package/dist/cjs/embeddable/reducers/data.js +1 -1
  21. package/dist/cjs/index.js +1 -1
  22. package/dist/cjs/layout/FlexWrapDetector.js +1 -1
  23. package/dist/cjs/styles.css +1 -1
  24. package/dist/esm/common.css +1 -1
  25. package/dist/esm/embeddable/big-number-trend/Alternative.js +62 -211
  26. package/dist/esm/embeddable/big-number-trend/BigNumberTrendContainer.js +125 -0
  27. package/dist/esm/embeddable/big-number-trend/Classic.js +51 -181
  28. package/dist/esm/embeddable/big-number-trend/index.js +8 -8
  29. package/dist/esm/embeddable/big-number-trend/useBigNumberTrendData.js +49 -0
  30. package/dist/esm/embeddable/chart/Bar.js +464 -471
  31. package/dist/esm/embeddable/chart/Messages.js +18 -15
  32. package/dist/esm/embeddable/chart/data/Line.js +1 -4
  33. package/dist/esm/embeddable/chart/data/Utils.js +0 -1
  34. package/dist/esm/embeddable/chart/index.js +363 -359
  35. package/dist/esm/embeddable/d3Map/index.js +129 -125
  36. package/dist/esm/embeddable/data/CategoriesProvider.js +31 -38
  37. package/dist/esm/embeddable/data/DataConsumer.js +12 -8
  38. package/dist/esm/embeddable/data/DataProvider.js +62 -124
  39. package/dist/esm/embeddable/download/dom-to-image.js +32 -0
  40. package/dist/esm/embeddable/featuredtabs/index.js +64 -61
  41. package/dist/esm/embeddable/map/index.js +47 -47
  42. package/dist/esm/embeddable/pagemodules/FloatingNavigator.js +14 -15
  43. package/dist/esm/embeddable/pagemodules/index.js +44 -45
  44. package/dist/esm/embeddable/reducers/data.js +46 -44
  45. package/dist/esm/index.js +74 -73
  46. package/dist/esm/layout/FlexWrapDetector.js +10 -10
  47. package/dist/esm/styles.css +1 -1
  48. package/dist/types/embeddable/big-number-trend/Alternative.d.ts +2 -4
  49. package/dist/types/embeddable/big-number-trend/BigNumberTrendContainer.d.ts +5 -0
  50. package/dist/types/embeddable/big-number-trend/Classic.d.ts +2 -4
  51. package/dist/types/embeddable/big-number-trend/useBigNumberTrendData.d.ts +21 -0
  52. package/dist/types/embeddable/chart/Bar.d.ts +1 -2
  53. package/dist/types/embeddable/data/DataConsumer.d.ts +5 -2
  54. package/dist/types/embeddable/data/DataProvider.d.ts +18 -3
  55. package/dist/types/layout/FlexWrapDetector.d.ts +2 -1
  56. package/package.json +2 -2
@@ -1,99 +1,96 @@
1
- import { jsx as c, jsxs as y, Fragment as be } from "react/jsx-runtime";
2
- import { useState as T, useEffect as ve, Fragment as Pe } from "react";
3
- import _t from "./Tooltip.js";
4
- import { ResponsiveBar as St } from "@nivo/bar";
5
- import { injectIntl as jt } from "react-intl";
6
- import { useTheme as Rt } from "@nivo/theming";
7
- import { line as Ye } from "d3-shape";
8
- import Ce from "./LineLayer.js";
9
- import Ne from "papaparse";
10
- import Pt from "../../layout/FlexWrapDetector.js";
11
- import Ie from "../../utils/deviceType.js";
12
- const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee = "_Color", Xt = ({
13
- editing: x,
14
- legends: H,
15
- marginLeft: Xe,
16
- marginTop: R,
17
- marginRight: qe,
18
- marginBottom: P,
19
- options: f,
1
+ import { jsx as c, jsxs as x, Fragment as ve } from "react/jsx-runtime";
2
+ import { useState as B, useEffect as Ne, Fragment as Pe } from "react";
3
+ import Ct from "./Tooltip.js";
4
+ import { ResponsiveBar as Yt } from "@nivo/bar";
5
+ import { injectIntl as Kt } from "react-intl";
6
+ import { useTheme as Pt } from "@nivo/theming";
7
+ import { line as Xe } from "d3-shape";
8
+ import qe from "./LineLayer.js";
9
+ import Ie from "papaparse";
10
+ import Xt from "../../layout/FlexWrapDetector.js";
11
+ import ke from "../../utils/deviceType.js";
12
+ const qt = "middle", Zt = "top", W = "#66676d", Ze = "#dddddd", Jt = "none", ee = "_Color", Ut = ({
13
+ editing: y,
14
+ legends: q,
15
+ marginLeft: Je,
16
+ marginTop: j,
17
+ marginRight: Ue,
18
+ marginBottom: R,
19
+ options: m,
20
20
  intl: b,
21
- format: p,
22
- colors: _,
23
- groupMode: F,
24
- height: Ze,
21
+ format: g,
22
+ colors: T,
23
+ groupMode: E,
24
+ height: Qe,
25
+ chartHeight: Le,
25
26
  showLegends: te,
26
27
  legendPosition: v,
27
28
  tickRotation: z,
28
29
  offsetText: ae,
29
30
  tickColor: ne,
30
31
  layout: u,
31
- reverse: S,
32
- offsetY: Je,
33
- csvLineLayerData: ke,
32
+ reverse: A,
33
+ offsetY: Ge,
34
+ csvLineLayerData: De,
34
35
  tooltip: le,
35
36
  lineLayerEnabled: re,
36
- overlays: j,
37
+ overlays: H,
37
38
  maxValue: ie,
38
- valueScale: Ue,
39
+ valueScale: et,
39
40
  colorGenerator: N,
40
- legendLabel: Le,
41
- overrideTickColor: Qe,
41
+ legendLabel: we,
42
+ overrideTickColor: tt,
42
43
  fixedMinValue: se,
43
44
  fixedMaxValue: ce,
44
- barPadding: Ge,
45
- barLabelPosition: we,
46
- barInnerPadding: et,
47
- tooltipEnabled: tt,
48
- xLabelColor: O,
49
- barLabelColor: q,
50
- legendCheckBack: L,
51
- legendLabelBack: de,
52
- legendLabelColor: he,
53
- highlightXAxisLine: at,
54
- showTickLine: Y,
55
- showRightAxis: nt,
56
- offsetRight: De,
57
- offsetBottom: me,
58
- confidenceIntervals: fe,
59
- showGroupTotal: lt,
60
- groupTotalLabel: Me,
61
- groupTotalFormat: Oe,
62
- groupTotalMeasure: Fe,
63
- groupTotalOffset: E,
64
- groupTotalFixedPosition: Z,
65
- tooltipEnableMarkdown: rt,
66
- xAxisTickValues: it,
67
- yAxisTickValues: st,
68
- mobileCustomization: ct,
69
- minMaxClamp: qt,
70
- reverseLegend: dt,
71
- enableGridY: ht,
72
- enableGridX: mt,
73
- customAxisFormat: I,
74
- previewMode: V,
75
- showLegendsInColumns: Zt = !1,
76
- numberOfLegendColumns: Jt = 4,
77
- lineXAxisTickMode: ze = "none",
78
- lineXAxisTickCount: ft = 10,
79
- lineXAxisTickEvery: ut = 1
45
+ barPadding: at,
46
+ barLabelPosition: Fe,
47
+ barInnerPadding: nt,
48
+ tooltipEnabled: lt,
49
+ xLabelColor: M,
50
+ barLabelColor: Z,
51
+ legendCheckBack: k,
52
+ legendLabelBack: he,
53
+ legendLabelColor: de,
54
+ highlightXAxisLine: rt,
55
+ showTickLine: C,
56
+ showRightAxis: it,
57
+ offsetRight: st,
58
+ offsetBottom: Me,
59
+ confidenceIntervals: me,
60
+ showGroupTotal: ct,
61
+ groupTotalLabel: Oe,
62
+ groupTotalFormat: Ee,
63
+ groupTotalMeasure: ze,
64
+ groupTotalOffset: V,
65
+ groupTotalFixedPosition: J,
66
+ tooltipEnableMarkdown: ht,
67
+ xAxisTickValues: dt,
68
+ yAxisTickValues: mt,
69
+ mobileCustomization: ft,
70
+ minMaxClamp: Qt,
71
+ reverseLegend: ut,
72
+ enableGridY: ot,
73
+ enableGridX: yt,
74
+ customAxisFormat: O,
75
+ previewMode: L,
76
+ lineXAxisTickMode: Ve = "none",
77
+ lineXAxisTickCount: xt = 10,
78
+ lineXAxisTickEvery: pt = 1
80
79
  }) => {
81
- var Re;
82
- const Ee = ["mobile", "tablet", "midTablet"].includes(
83
- Ie()
84
- ), J = ["tablet", "midTablet"].includes(Ie()), U = Ie() === "mobile", ue = 30, oe = 15, h = JSON.parse(
85
- decodeURIComponent(ct)
86
- ), Ve = Ee && ((h == null ? void 0 : h.showCustomization) ?? !1), $ = Ve && V !== "Desktop", B = !x && Ve, xe = () => q === "null" || q === null || !q ? "#000000" : q, [w, ot] = T([]), { colorBy: C } = _, $e = {};
87
- j.forEach((e, t) => {
88
- $e[t] = !0;
80
+ var Ke;
81
+ const fe = y ? L === "Mobile" || L === "Tablet" : ["mobile", "tablet", "midTablet"].includes(ke()), U = ["tablet", "midTablet"].includes(ke()), Q = ke() === "mobile", ue = 30, oe = 15, f = JSON.parse(
82
+ decodeURIComponent(ft)
83
+ ), $e = fe && ((f == null ? void 0 : f.showCustomization) ?? !1), S = $e && L !== "Desktop", _ = !y && $e, ye = () => Z === "null" || Z === null || !Z ? "#000000" : Z, [D, gt] = B([]), { colorBy: Y } = T, Be = {};
84
+ H.forEach((e, t) => {
85
+ Be[t] = !0;
89
86
  });
90
- const [k, xt] = T($e), [Be, yt] = T(50), [Ut, We] = T(R), [Qt, Te] = T(0), [pt, Ae] = T(P), [He, gt] = T(!1);
91
- ve(() => {
87
+ const [I, bt] = B(Be), [We, vt] = B(50), [Gt, Te] = B(j), [ea, Ae] = B(0), [He, Se] = B(R), [_e, Nt] = B(!1);
88
+ Ne(() => {
92
89
  let e, t;
93
90
  return e = requestAnimationFrame(() => {
94
91
  e = requestAnimationFrame(() => {
95
92
  t = setTimeout(() => {
96
- gt(!0);
93
+ Nt(!0);
97
94
  }, 50);
98
95
  });
99
96
  }), () => {
@@ -103,48 +100,48 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
103
100
  const K = ((e, t, r, i, a) => {
104
101
  let s = [];
105
102
  return e.data && (s = t.colorBy === "index" ? e.data.map((l) => {
106
- let n, d = !0;
107
- return r.indexOf(l[e.indexBy]) > -1 ? (d = !1, n = i) : n = l[ee] ? l[ee] : a.getColor(l.id, l), {
108
- enabled: d,
103
+ let n, h = !0;
104
+ return r.indexOf(l[e.indexBy]) > -1 ? (h = !1, n = i) : n = l[ee] ? l[ee] : a.getColor(l.id, l), {
105
+ enabled: h,
109
106
  color: n,
110
107
  id: l[e.indexBy],
111
108
  label: l[e.indexBy]
112
109
  };
113
110
  }) : e.keys.map((l) => {
114
- let n, d = !0;
115
- return r.indexOf(l) > -1 ? (d = !1, n = i) : n = a.getColorByKey(l), {
116
- enabled: d,
111
+ let n, h = !0;
112
+ return r.indexOf(l) > -1 ? (h = !1, n = i) : n = a.getColorByKey(l), {
113
+ enabled: h,
117
114
  color: n,
118
115
  id: l,
119
116
  label: l
120
117
  };
121
118
  })), s;
122
119
  })(
123
- f,
124
- _,
125
- w,
126
- Kt,
120
+ m,
121
+ T,
122
+ D,
123
+ Jt,
127
124
  N
128
- ), _e = () => (dt && K.reverse(), /* @__PURE__ */ y(be, { children: [
129
- te && K.map((e) => /* @__PURE__ */ y(
125
+ ), je = () => (ut && K.reverse(), /* @__PURE__ */ x(ve, { children: [
126
+ te && K.map((e) => /* @__PURE__ */ x(
130
127
  "div",
131
128
  {
132
129
  className: `legend item ${e.enabled ? "" : "ignore"}`,
133
- onClick: () => Ot(e.id),
130
+ onClick: () => zt(e.id),
134
131
  children: [
135
- L && /* @__PURE__ */ c(
132
+ k && /* @__PURE__ */ c(
136
133
  "input",
137
134
  {
138
135
  className: e.enabled ? "" : "ignore",
139
136
  type: "checkbox",
140
137
  checked: e.enabled,
141
138
  style: {
142
- backgroundColor: L ? C === "values" ? ne : e.color : "none",
139
+ backgroundColor: k ? Y === "values" ? ne : e.color : "none",
143
140
  color: "#000"
144
141
  }
145
142
  }
146
143
  ),
147
- !L && /* @__PURE__ */ c(
144
+ !k && /* @__PURE__ */ c(
148
145
  "input",
149
146
  {
150
147
  type: "checkbox",
@@ -154,31 +151,31 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
154
151
  }
155
152
  }
156
153
  ),
157
- L && /* @__PURE__ */ c(
154
+ k && /* @__PURE__ */ c(
158
155
  "span",
159
156
  {
160
157
  className: "checkmark-with-bg",
161
158
  style: { backgroundColor: e.color }
162
159
  }
163
160
  ),
164
- !L && /* @__PURE__ */ c("span", { className: "checkmark" }),
165
- de && /* @__PURE__ */ c(
161
+ !k && /* @__PURE__ */ c("span", { className: "checkmark" }),
162
+ he && /* @__PURE__ */ c(
166
163
  "label",
167
164
  {
168
165
  className: e.enabled ? "" : "ignore",
169
166
  style: {
170
- backgroundColor: C === "values" ? ne : e.color,
171
- color: he
167
+ backgroundColor: Y === "values" ? ne : e.color,
168
+ color: de
172
169
  },
173
170
  children: e.label
174
171
  }
175
172
  ),
176
- !de && /* @__PURE__ */ c(
173
+ !he && /* @__PURE__ */ c(
177
174
  "label",
178
175
  {
179
176
  className: e.enabled ? "" : "ignore",
180
177
  style: {
181
- color: he
178
+ color: de
182
179
  },
183
180
  children: e.label
184
181
  }
@@ -186,7 +183,7 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
186
183
  ]
187
184
  }
188
185
  )),
189
- C === "values" && /* @__PURE__ */ y("div", { className: "legend item", children: [
186
+ Y === "values" && /* @__PURE__ */ x("div", { className: "legend item", children: [
190
187
  /* @__PURE__ */ c(
191
188
  "label",
192
189
  {
@@ -200,14 +197,14 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
200
197
  }
201
198
  ),
202
199
  /* @__PURE__ */ c("label", { children: b.formatNumber(
203
- p.style === "percent" ? N.minValue / 100 : N.minValue,
200
+ g.style === "percent" ? N.minValue / 100 : N.minValue,
204
201
  {
205
- ...p,
202
+ ...g,
206
203
  minimumFractionDigits: 0
207
204
  }
208
205
  ) })
209
206
  ] }),
210
- C === "values" && /* @__PURE__ */ y("div", { className: "legend item", children: [
207
+ Y === "values" && /* @__PURE__ */ x("div", { className: "legend item", children: [
211
208
  /* @__PURE__ */ c(
212
209
  "label",
213
210
  {
@@ -222,22 +219,22 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
222
219
  }
223
220
  ),
224
221
  /* @__PURE__ */ c("label", { children: b.formatNumber(
225
- p.style === "percent" ? N.maxValue / 100 : N.maxValue,
222
+ g.style === "percent" ? N.maxValue / 100 : N.maxValue,
226
223
  {
227
- ...p,
224
+ ...g,
228
225
  minimumFractionDigits: 0
229
226
  }
230
227
  ) })
231
228
  ] }),
232
- te && re && j.map((e, t) => /* @__PURE__ */ y("div", { className: "legend item", onClick: () => Ft(t), children: [
229
+ te && re && H.map((e, t) => /* @__PURE__ */ x("div", { className: "legend item", onClick: () => Vt(t), children: [
233
230
  /* @__PURE__ */ c(
234
231
  "input",
235
232
  {
236
- className: L && k[t] ? "" : "ignore",
233
+ className: k && I[t] ? "" : "ignore",
237
234
  type: "checkbox",
238
- checked: k[t],
235
+ checked: I[t],
239
236
  style: {
240
- backgroundColor: k[t] && L === !0 ? e.lineColor : "none",
237
+ backgroundColor: I[t] && k === !0 ? e.lineColor : "none",
241
238
  color: "#000"
242
239
  }
243
240
  }
@@ -245,65 +242,65 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
245
242
  /* @__PURE__ */ c(
246
243
  "span",
247
244
  {
248
- className: L ? "checkmark-with-bg" : "checkmark",
245
+ className: k ? "checkmark-with-bg" : "checkmark",
249
246
  style: {
250
- backgroundColor: k[t] && L === !0 ? e.lineColor : "none"
247
+ backgroundColor: I[t] && k === !0 ? e.lineColor : "none"
251
248
  }
252
249
  }
253
250
  ),
254
251
  /* @__PURE__ */ c(
255
252
  "label",
256
253
  {
257
- className: k[t] ? "" : "ignore",
254
+ className: I[t] ? "" : "ignore",
258
255
  style: {
259
- backgroundColor: k[t] && de === !0 ? e.lineColor : "none",
260
- color: he
256
+ backgroundColor: I[t] && he === !0 ? e.lineColor : "none",
257
+ color: de
261
258
  },
262
259
  children: e.title
263
260
  }
264
261
  )
265
262
  ] }))
266
263
  ] }));
267
- ve(() => {
264
+ Ne(() => {
268
265
  (() => {
269
266
  const r = 5 * Math.max(K.length - 5, 0);
270
- yt(r);
267
+ vt(r);
271
268
  })();
272
- }, [K]), ve(() => {
273
- We(R), Ae(P);
274
- }, [v, R, P]);
275
- const bt = {
276
- bottom: `-${Be}px`,
269
+ }, [K]), Ne(() => {
270
+ Te(j), Se(R);
271
+ }, [v, j, R]);
272
+ const It = {
273
+ bottom: `-${We}px`,
277
274
  justifyContent: "flex-start"
278
- }, vt = {
279
- bottom: `-${Be}px`,
275
+ }, kt = {
276
+ bottom: `-${We}px`,
280
277
  gap: "0px",
281
278
  justifyContent: "flex-start"
282
279
  // top: "0px",
283
- }, Nt = (e) => ye(e, "1 0", Ke, "Y"), It = (e) => ye(e, "4 4", A, "X"), kt = (e) => ye(e, "1 0", Ke, "X"), Lt = (e) => {
280
+ }, Lt = (e) => xe(e, "1 0", Ze, "Y"), Dt = (e) => xe(e, "4 4", W, "X"), wt = (e) => xe(e, "1 0", Ze, "X"), Ft = (e) => {
284
281
  const t = K.find((r) => r.id === e.value);
285
282
  return t ? t.color : "#FFFFFF";
286
- }, wt = (e) => {
283
+ }, Mt = (e) => {
287
284
  const { yScale: t, xScale: r, bars: i } = e;
288
285
  return /* @__PURE__ */ c(Pe, { children: i.filter((a) => a.data.value != null).map((a) => {
289
286
  let s = a.data.indexValue;
290
- f.dimensionsMetadata && f.dimensionsMetadata.size > 1 && (s = a.data.id);
291
- const l = fe.filter(
287
+ m.dimensionsMetadata && m.dimensionsMetadata.size > 1 && (s = a.data.id);
288
+ const l = me.filter(
292
289
  (n) => n.serieLabel == s
293
290
  )[0];
294
291
  if (l && l.low && l.high)
295
292
  if (u === "horizontal") {
296
- const n = r(parseFloat(l.low)), d = r(parseFloat(l.high));
297
- return /* @__PURE__ */ y("g", { children: [
293
+ const n = r(parseFloat(l.low)), h = r(parseFloat(l.high));
294
+ return /* @__PURE__ */ x("g", { children: [
298
295
  /* @__PURE__ */ c(
299
296
  "line",
300
297
  {
301
298
  x1: n,
302
- x2: d,
299
+ x2: h,
303
300
  y1: a.y + a.height / 2,
304
301
  y2: a.y + a.height / 2,
305
302
  strokeWidth: 1,
306
- stroke: A
303
+ stroke: W
307
304
  }
308
305
  ),
309
306
  /* @__PURE__ */ c(
@@ -314,33 +311,33 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
314
311
  y1: a.y + a.height / 2 - 3,
315
312
  y2: a.y + a.height / 2 + 3,
316
313
  strokeWidth: 1,
317
- stroke: A
314
+ stroke: W
318
315
  }
319
316
  ),
320
317
  /* @__PURE__ */ c(
321
318
  "line",
322
319
  {
323
- x1: d,
324
- x2: d,
320
+ x1: h,
321
+ x2: h,
325
322
  y1: a.y + a.height / 2 - 3,
326
323
  y2: a.y + a.height / 2 + 3,
327
324
  strokeWidth: 1,
328
- stroke: A
325
+ stroke: W
329
326
  }
330
327
  )
331
328
  ] });
332
329
  } else {
333
- const n = t(parseFloat(l.low)), d = t(parseFloat(l.high));
334
- return /* @__PURE__ */ y("g", { children: [
330
+ const n = t(parseFloat(l.low)), h = t(parseFloat(l.high));
331
+ return /* @__PURE__ */ x("g", { children: [
335
332
  /* @__PURE__ */ c(
336
333
  "line",
337
334
  {
338
335
  y1: n,
339
- y2: d,
336
+ y2: h,
340
337
  x1: a.x + a.width / 2,
341
338
  x2: a.x + a.width / 2,
342
339
  strokeWidth: 1,
343
- stroke: A
340
+ stroke: W
344
341
  }
345
342
  ),
346
343
  /* @__PURE__ */ c(
@@ -351,54 +348,54 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
351
348
  x1: a.x + a.width / 2 - 3,
352
349
  x2: a.x + a.width / 2 + 3,
353
350
  strokeWidth: 1,
354
- stroke: A
351
+ stroke: W
355
352
  }
356
353
  ),
357
354
  /* @__PURE__ */ c(
358
355
  "line",
359
356
  {
360
- y1: d,
361
- y2: d,
357
+ y1: h,
358
+ y2: h,
362
359
  x1: a.x + a.width / 2 - 3,
363
360
  x2: a.x + a.width / 2 + 3,
364
361
  strokeWidth: 1,
365
- stroke: A
362
+ stroke: W
366
363
  }
367
364
  )
368
365
  ] });
369
366
  }
370
367
  }) });
371
- }, ye = (e, t, r, i) => {
368
+ }, xe = (e, t, r, i) => {
372
369
  const { yScale: a, innerWidth: s, innerHeight: l } = e;
373
- let n, d;
374
- return i == "X" ? (n = [0, s], d = Ye().x((o, W) => W === 0 ? -10 : o).y(() => a(0))) : (n = [0, l], d = Ye().x(() => 0).y((o) => o)), /* @__PURE__ */ c(Pe, { children: /* @__PURE__ */ c(
370
+ let n, h;
371
+ return i == "X" ? (n = [0, s], h = Xe().x((o, $) => $ === 0 ? -10 : o).y(() => a(0))) : (n = [0, l], h = Xe().x(() => 0).y((o) => o)), /* @__PURE__ */ c(Pe, { children: /* @__PURE__ */ c(
375
372
  "path",
376
373
  {
377
- d: d(n),
374
+ d: h(n),
378
375
  fill: "none",
379
376
  stroke: r,
380
377
  style: { pointerEvents: "none", strokeDasharray: t }
381
378
  }
382
379
  ) });
383
- }, D = (e, t) => w ? (_.colorBy === "index" || _.colorBy === "id" || _.colorBy === "values") && !t ? e.filter((r) => w.indexOf(r[f.indexBy]) === -1) : e ? e.filter((r) => w.indexOf(r) === -1) : [] : e, Dt = (e) => {
384
- const t = Rt();
380
+ }, w = (e, t) => D ? (T.colorBy === "index" || T.colorBy === "id" || T.colorBy === "values") && !t ? e.filter((r) => D.indexOf(r[m.indexBy]) === -1) : e ? e.filter((r) => D.indexOf(r) === -1) : [] : e, Ot = (e) => {
381
+ const t = Pt();
385
382
  if (!e.value) return "";
386
383
  const r = Object.assign({}, e);
387
- (B || $) && ge.includes(String(r.value)) && (r.value = "");
384
+ (_ || S) && be.includes(String(r.value)) && (r.value = "");
388
385
  let i;
389
- Qe ? i = ne : i = Lt(e);
386
+ tt ? i = ne : i = Ft(e);
390
387
  let a = [], s = "";
391
- if ($ || B) {
388
+ if (S || _) {
392
389
  const n = String(r.value).split(" ");
393
- let d = 25;
394
- x && V === "Mobile" || U && !x ? d = (h == null ? void 0 : h.mobileMaxTickLength) ?? 25 : x && V === "Tablet" || J && !x ? d = (h == null ? void 0 : h.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !x && (d = 15), n.forEach((o) => {
395
- s.length + String(o).length <= d ? s += (s ? " " : "") + o : (a.push(s), s = o);
390
+ let h = 25;
391
+ y && L === "Mobile" || Q && !y ? h = (f == null ? void 0 : f.mobileMaxTickLength) ?? 25 : y && L === "Tablet" || U && !y ? h = (f == null ? void 0 : f.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !y && (h = 15), n.forEach((o) => {
392
+ s.length + String(o).length <= h ? s += (s ? " " : "") + o : (a.push(s), s = o);
396
393
  }), s && a.push(s);
397
394
  } else
398
395
  a = [r.value];
399
396
  let l = 12;
400
- return U ? l = (h == null ? void 0 : h.mobileYAxisLineHeight) ?? 12 : J && (l = (h == null ? void 0 : h.tabletYAxisLineHeight) ?? 12), z > 0 && z < 180 ? /* @__PURE__ */ y("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
401
- Y && /* @__PURE__ */ c(
397
+ return Q ? l = (f == null ? void 0 : f.mobileYAxisLineHeight) ?? 12 : U && (l = (f == null ? void 0 : f.tabletYAxisLineHeight) ?? 12), z > 0 && z < 180 ? /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
398
+ C && /* @__PURE__ */ c(
402
399
  "line",
403
400
  {
404
401
  stroke: i,
@@ -407,16 +404,16 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
407
404
  y2: -12
408
405
  }
409
406
  ),
410
- /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, d) => /* @__PURE__ */ c(
407
+ /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
411
408
  "text",
412
409
  {
413
410
  transform: `rotate(${z})`,
414
411
  textAnchor: "start",
415
- y: typeof e.value == "number" ? 0 : d * l,
412
+ y: typeof e.value == "number" ? 0 : h * l,
416
413
  dominantBaseline: "middle",
417
414
  style: {
418
415
  ...t.axis.ticks.text,
419
- fill: O === "null" ? "black" : O,
416
+ fill: M === "null" ? "black" : M,
420
417
  fontSize: "12px",
421
418
  fontFamily: "sans-serif"
422
419
  },
@@ -424,8 +421,8 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
424
421
  },
425
422
  n
426
423
  )) })
427
- ] }) : z > 180 && z < 360 ? /* @__PURE__ */ y("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
428
- Y && /* @__PURE__ */ c(
424
+ ] }) : z > 180 && z < 360 ? /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
425
+ C && /* @__PURE__ */ c(
429
426
  "line",
430
427
  {
431
428
  stroke: i,
@@ -434,25 +431,25 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
434
431
  y2: -12
435
432
  }
436
433
  ),
437
- /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, d) => /* @__PURE__ */ c(
434
+ /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
438
435
  "text",
439
436
  {
440
437
  transform: `rotate(${z})`,
441
438
  textAnchor: "end",
442
- y: typeof e.value == "number" ? 0 : d * l,
439
+ y: typeof e.value == "number" ? 0 : h * l,
443
440
  dominantBaseline: "middle",
444
441
  style: {
445
442
  ...t.axis.ticks.text,
446
- fill: O === "null" ? "black" : O,
443
+ fill: M === "null" ? "black" : M,
447
444
  fontSize: "12px",
448
445
  fontFamily: "sans-serif"
449
446
  },
450
447
  children: n
451
448
  },
452
- d
449
+ h
453
450
  )) })
454
- ] }) : /* @__PURE__ */ y("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
455
- Y && /* @__PURE__ */ c(
451
+ ] }) : /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y + 30})`, children: [
452
+ C && /* @__PURE__ */ c(
456
453
  "line",
457
454
  {
458
455
  stroke: i,
@@ -461,30 +458,30 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
461
458
  y2: -12
462
459
  }
463
460
  ),
464
- /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, d) => /* @__PURE__ */ c(
461
+ /* @__PURE__ */ c("g", { transform: `translate(0, ${e.y + ae})`, children: a.map((n, h) => /* @__PURE__ */ c(
465
462
  "text",
466
463
  {
467
464
  transform: `rotate(${z})`,
468
465
  textAnchor: "middle",
469
- y: typeof e.value == "number" ? 0 : d * l,
466
+ y: typeof e.value == "number" ? 0 : h * l,
470
467
  dominantBaseline: "middle",
471
468
  style: {
472
469
  ...t.axis.ticks.text,
473
- fill: O === "null" ? "black" : O,
470
+ fill: M === "null" ? "black" : M,
474
471
  fontSize: "12px",
475
472
  fontFamily: "sans-serif"
476
473
  },
477
474
  children: n
478
475
  },
479
- d
476
+ h
480
477
  )) })
481
478
  ] });
482
- }, Mt = (e) => {
483
- if (!e.value || ($ || B) && ge.includes(String(e.value)))
479
+ }, Et = (e) => {
480
+ if (!e.value || (S || _) && be.includes(String(e.value)))
484
481
  return "";
485
482
  let t = e.value;
486
483
  if (u === "vertical") {
487
- const n = I || p;
484
+ const n = O || g;
488
485
  t = b.formatNumber(
489
486
  n.style === "percent" ? t / 100 : t,
490
487
  {
@@ -493,24 +490,24 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
493
490
  );
494
491
  }
495
492
  let r = 25;
496
- x && V === "Mobile" || U && !x ? r = (h == null ? void 0 : h.mobileMaxTickLength) ?? 25 : x && V === "Tablet" || J && !x ? r = (h == null ? void 0 : h.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !x && (r = 15);
493
+ y && L === "Mobile" || Q && !y ? r = (f == null ? void 0 : f.mobileMaxTickLength) ?? 25 : y && L === "Tablet" || U && !y ? r = (f == null ? void 0 : f.tabletMaxTickLength) ?? 25 : window.matchMedia("(min-width: 768px) and (max-width: 1250px)").matches && !y && (r = 15);
497
494
  const i = typeof t == "string" ? t.split(" ") : [t], a = [];
498
495
  let s = "";
499
496
  i.forEach((n) => {
500
497
  s.length + String(n).length <= r ? s += (s ? " " : "") + n : (a.push(s), s = n);
501
498
  }), s && a.push(s);
502
499
  let l = 12;
503
- return x && V === "Mobile" || U && !x ? l = (h == null ? void 0 : h.mobileYAxisLineHeight) ?? 12 : (x && V === "Tablet" || J && !x) && (l = (h == null ? void 0 : h.tabletYAxisLineHeight) ?? 12), /* @__PURE__ */ y("g", { transform: `translate(${e.x},${e.y})`, children: [
500
+ return y && L === "Mobile" || Q && !y ? l = (f == null ? void 0 : f.mobileYAxisLineHeight) ?? 12 : (y && L === "Tablet" || U && !y) && (l = (f == null ? void 0 : f.tabletYAxisLineHeight) ?? 12), /* @__PURE__ */ x("g", { transform: `translate(${e.x},${e.y})`, children: [
504
501
  /* @__PURE__ */ c("line", { x1: -5, x2: 0, y1: 0, y2: 0, stroke: "#000", strokeWidth: 1 }),
505
- a.map((n, d) => /* @__PURE__ */ c(
502
+ a.map((n, h) => /* @__PURE__ */ c(
506
503
  "text",
507
504
  {
508
505
  x: -10,
509
- y: typeof t == "number" ? 0 : d * l,
506
+ y: typeof t == "number" ? 0 : h * l,
510
507
  textAnchor: "end",
511
508
  dominantBaseline: "middle",
512
509
  style: {
513
- fill: O === "null" ? "black" : O,
510
+ fill: M === "null" ? "black" : M,
514
511
  fontSize: "12px",
515
512
  fontFamily: "sans-serif"
516
513
  },
@@ -519,135 +516,135 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
519
516
  n
520
517
  ))
521
518
  ] });
522
- }, Ot = (e) => {
523
- const t = w.slice();
519
+ }, zt = (e) => {
520
+ const t = D.slice();
524
521
  if (t.indexOf(e) > -1) {
525
522
  const r = t.indexOf(e);
526
523
  t.splice(r, 1);
527
524
  } else
528
525
  t.push(e);
529
- ot(t);
530
- }, Ft = (e) => {
531
- const t = Object.assign({}, k);
532
- t[e] = !t[e], xt(t);
533
- }, zt = ({ bars: e }) => /* @__PURE__ */ c("g", { children: e.map((t) => {
526
+ gt(t);
527
+ }, Vt = (e) => {
528
+ const t = Object.assign({}, I);
529
+ t[e] = !t[e], bt(t);
530
+ }, $t = ({ bars: e }) => /* @__PURE__ */ c("g", { children: e.map((t) => {
534
531
  const { width: r, height: i, y: a, x: s, data: l } = t;
535
532
  if (u === "horizontal" && i <= oe || u === "vertical" && r <= ue)
536
533
  return;
537
534
  const n = l.value ? b.formatNumber(
538
- p.style === "percent" ? l.value / 100 : l.value,
539
- p
540
- ) : "", d = n.length;
541
- let o, W;
535
+ g.style === "percent" ? l.value / 100 : l.value,
536
+ g
537
+ ) : "", h = n.length;
538
+ let o, $;
542
539
  if (u === "vertical" && r >= ue || u === "horizontal" && i >= oe)
543
- return u === "vertical" ? (o = a - 6, W = s + r / 2 - d * 3.5) : (o = a + i / 2 + 4, W = s + r + 5), /* @__PURE__ */ c(
540
+ return u === "vertical" ? (o = a - 6, $ = s + r / 2 - h * 3.5) : (o = a + i / 2 + 4, $ = s + r + 5), /* @__PURE__ */ c(
544
541
  "text",
545
542
  {
546
543
  y: o,
547
- x: W,
548
- style: { fill: xe() },
544
+ x: $,
545
+ style: { fill: ye() },
549
546
  children: `${n}`
550
547
  }
551
548
  );
552
- }) }), Et = (e) => {
553
- const t = f.data.filter((i) => w.indexOf(i[f.indexBy]) == -1).map((i) => i[f.indexBy]), { bars: r } = e;
549
+ }) }), Bt = (e) => {
550
+ const t = m.data.filter((i) => D.indexOf(i[m.indexBy]) == -1).map((i) => i[m.indexBy]), { bars: r } = e;
554
551
  return /* @__PURE__ */ c("g", { children: t.filter(
555
552
  (i) => r.filter((a) => a.data.indexValue == i).length > 0
556
553
  ).map((i) => {
557
554
  var G;
558
- const a = r.filter((m) => m.data.indexValue == i);
555
+ const a = r.filter((d) => d.data.indexValue == i);
559
556
  let s = "right", l = 0, n = 0;
560
557
  if (u == "horizontal")
561
- F === "stacked" ? (Z ? l = e.innerWidth - 20 : (l = a.map((m) => m.width).reduce((m, g) => m + g), S && (l = e.innerWidth - l)), n = e.yScale(i) + a[0].height / 2) : (Z ? l = e.innerWidth : (l = a.map((m) => m.width).reduce((m, g) => m > g ? m : g), S && (l = e.innerWidth - l)), n = e.yScale(i) + a.map((m) => m.height).reduce((m, g) => m + g) / 2), l = l + parseInt(E) + 5;
562
- else if (s = "middle", F === "stacked")
563
- l = e.xScale(i) + a[0].width / 2, Z ? n = n - parseInt(E) : S ? n = parseInt(E) + a.map((m) => m.height).reduce((m, g) => m + g) + 14 : n = e.innerHeight - parseInt(E) - a.map((m) => m.height).reduce((m, g) => m + g) - 5;
564
- else if (l = e.xScale(i) + a.map((m) => m.width).reduce((m, g) => m + g) / 2, S && (n = e.innerHeight), Z)
565
- n = n - parseInt(E);
558
+ E === "stacked" ? (J ? l = e.innerWidth - 20 : (l = a.map((d) => d.width).reduce((d, p) => d + p), A && (l = e.innerWidth - l)), n = e.yScale(i) + a[0].height / 2) : (J ? l = e.innerWidth : (l = a.map((d) => d.width).reduce((d, p) => d > p ? d : p), A && (l = e.innerWidth - l)), n = e.yScale(i) + a.map((d) => d.height).reduce((d, p) => d + p) / 2), l = l + parseInt(V) + 5;
559
+ else if (s = "middle", E === "stacked")
560
+ l = e.xScale(i) + a[0].width / 2, J ? n = n - parseInt(V) : A ? n = parseInt(V) + a.map((d) => d.height).reduce((d, p) => d + p) + 14 : n = e.innerHeight - parseInt(V) - a.map((d) => d.height).reduce((d, p) => d + p) - 5;
561
+ else if (l = e.xScale(i) + a.map((d) => d.width).reduce((d, p) => d + p) / 2, A && (n = e.innerHeight), J)
562
+ n = n - parseInt(V);
566
563
  else {
567
564
  if (a.length % 2 == 1) {
568
- const m = Math.floor(a.length / 2);
569
- n = a[m].height;
565
+ const d = Math.floor(a.length / 2);
566
+ n = a[d].height;
570
567
  } else {
571
- const m = a.length / 2;
568
+ const d = a.length / 2;
572
569
  n = Math.max(
573
- a[m].height,
574
- a[m - 1].height
570
+ a[d].height,
571
+ a[d - 1].height
575
572
  );
576
573
  }
577
- S ? n = n + 14 + parseInt(E) : n = e.innerHeight - n - parseInt(E) - 5;
574
+ A ? n = n + 14 + parseInt(V) : n = e.innerHeight - n - parseInt(V) - 5;
578
575
  }
579
- const d = f.data.filter(
580
- (m) => m[f.indexBy] === i
576
+ const h = m.data.filter(
577
+ (d) => d[m.indexBy] === i
581
578
  )[0];
582
- let o = d.parent_variables ? d.parent_variables[Fe] : d[Fe];
583
- const W = C !== "index" ? (G = w == null ? void 0 : w.map((m) => d[m])) == null ? void 0 : G.reduce((m, g) => m + g, 0) : 0;
584
- return o -= W, /* @__PURE__ */ c("text", { y: n, x: l, style: { fill: xe() }, children: /* @__PURE__ */ y("tspan", { textAnchor: s, children: [
585
- Me ? Me + " " : "",
579
+ let o = h.parent_variables ? h.parent_variables[ze] : h[ze];
580
+ const $ = Y !== "index" ? (G = D == null ? void 0 : D.map((d) => h[d])) == null ? void 0 : G.reduce((d, p) => d + p, 0) : 0;
581
+ return o -= $, /* @__PURE__ */ c("text", { y: n, x: l, style: { fill: ye() }, children: /* @__PURE__ */ x("tspan", { textAnchor: s, children: [
582
+ Oe ? Oe + " " : "",
586
583
  b.formatNumber(
587
- Oe.style === "percent" ? o / 100 : o,
588
- Oe
584
+ Ee.style === "percent" ? o / 100 : o,
585
+ Ee
589
586
  )
590
587
  ] }) });
591
588
  }) });
592
- }, Vt = {
593
- top: R,
594
- right: qe,
595
- bottom: P,
596
- left: Xe
589
+ }, Wt = {
590
+ top: j,
591
+ right: Ue,
592
+ bottom: R,
593
+ left: Je
597
594
  };
598
595
  let pe;
599
- ke && (pe = Ne.parse(ke, {
596
+ De && (pe = Ie.parse(De, {
600
597
  header: !1,
601
598
  dynamicTyping: !0
602
599
  }), Math.max(...pe.data.map((e) => e[1])), Math.min(...pe.data.map((e) => e[1])));
603
- const Se = () => {
600
+ const Re = () => {
604
601
  const e = [];
605
- if (fe && fe.forEach((t) => {
602
+ if (me && me.forEach((t) => {
606
603
  t.low && e.push(parseFloat(t.low)), t.high && e.push(parseFloat(t.high));
607
- }), f.data) {
608
- const t = D(f.data, !1), r = D(f.keys, !0);
604
+ }), m.data) {
605
+ const t = w(m.data, !1), r = w(m.keys, !0);
609
606
  t.forEach((i) => {
610
607
  r.forEach((a) => {
611
608
  i[a] && e.push(i[a]);
612
609
  });
613
610
  });
614
611
  }
615
- return re && j && j.forEach((t, r) => {
616
- if (k[r] !== !1)
612
+ return re && H && H.forEach((t, r) => {
613
+ if (I[r] !== !1)
617
614
  if (t.app === "csv" && t.csvLineLayerData) {
618
- const i = Ne.parse(t.csvLineLayerData, {
615
+ const i = Ie.parse(t.csvLineLayerData, {
619
616
  header: !1,
620
617
  dynamicTyping: !0
621
618
  });
622
619
  i.data && i.data.filter((a) => a[1] !== null && typeof a[1] == "number").forEach((a) => e.push(a[1]));
623
- } else t.measure[0] && f.data && f.data.forEach((i) => {
620
+ } else t.measure[0] && m.data && m.data.forEach((i) => {
624
621
  var s;
625
622
  const a = (s = i.variables) == null ? void 0 : s[t.measure[0]];
626
623
  a !== null && typeof a == "number" && e.push(a);
627
624
  });
628
625
  }), e;
629
- }, $t = () => {
630
- const e = Se(), t = e.length > 0 ? Math.max(...e) : 0;
626
+ }, Tt = () => {
627
+ const e = Re(), t = e.length > 0 ? Math.max(...e) : 0;
631
628
  if (ie === "fixed" && ce !== null && ce !== "")
632
629
  return Number(ce);
633
- if (F === "stacked" && ie !== "fixed") {
634
- const r = D(f.data, !1), i = D(f.keys, !0);
635
- let a = i.length > 0 ? i : f.keys;
630
+ if (E === "stacked" && ie !== "fixed") {
631
+ const r = w(m.data, !1), i = w(m.keys, !0);
632
+ let a = i.length > 0 ? i : m.keys;
636
633
  const s = Math.max(
637
- ...r.map((l) => a.map((n) => l[n] ? l[n] : 0)).map((l) => l.length > 0 ? l.reduce((n, d) => n + d, 0) : 0)
634
+ ...r.map((l) => a.map((n) => l[n] ? l[n] : 0)).map((l) => l.length > 0 ? l.reduce((n, h) => n + h, 0) : 0)
638
635
  );
639
636
  return Math.max(s, t) * 1.1;
640
637
  }
641
638
  return t * 1.05;
642
- }, Bt = () => {
643
- const e = Se(), t = e.length > 0 ? Math.min(...e) : 0;
639
+ }, At = () => {
640
+ const e = Re(), t = e.length > 0 ? Math.min(...e) : 0;
644
641
  return ie === "fixed" && se !== null && String(se) !== "" ? Number(se) : t > 0 ? t * 0.9 : t * 1.1;
645
- }, Wt = Number($t()), Tt = Number(Bt()), At = Math.min(0, Tt), Ht = Math.max(0, Wt), M = ["grid", "axes", "bars"];
646
- lt && M.push(Et), M.push(Nt), M.push(kt), re && j && j.forEach((e, t) => {
647
- if (k[t] == !0 || k[t] == null) {
642
+ }, Ht = Number(Tt()), St = Number(At()), _t = Math.min(0, St), jt = Math.max(0, Ht), F = ["grid", "axes", "bars"];
643
+ ct && F.push(Bt), F.push(Lt), F.push(wt), re && H && H.forEach((e, t) => {
644
+ if (I[t] == !0 || I[t] == null) {
648
645
  const { csvLineLayerData: r, lineColor: i, tooltip: a } = e;
649
646
  if (e.app == "csv") {
650
- const s = Ne.parse(r, {
647
+ const s = Ie.parse(r, {
651
648
  header: !1,
652
649
  dynamicTyping: !0
653
650
  });
@@ -655,281 +652,277 @@ const Yt = "middle", Ct = "top", A = "#66676d", Ke = "#dddddd", Kt = "none", ee
655
652
  s.data = s.data.filter(
656
653
  (n) => n[1] !== null
657
654
  );
658
- const l = Ce(
655
+ const l = qe(
659
656
  s,
660
657
  i,
661
658
  u,
662
- F,
663
- D(f.keys, !0),
659
+ E,
660
+ w(m.keys, !0),
664
661
  a,
665
662
  e.title,
666
663
  ""
667
664
  );
668
- M.push(l);
665
+ F.push(l);
669
666
  }
670
667
  } else if (e.measure[0]) {
671
- const s = {}, l = f.data.map((o) => [
672
- o[f.indexBy],
668
+ const s = {}, l = m.data.map((o) => [
669
+ o[m.indexBy],
673
670
  o.variables[e.measure[0]]
674
- ]), n = f.metadata.measures ? f.metadata.measures.filter((o) => o.value == e.measure[0]) : [];
671
+ ]), n = m.metadata.measures ? m.metadata.measures.filter((o) => o.value == e.measure[0]) : [];
675
672
  s.data = l;
676
- const d = Ce(
673
+ const h = qe(
677
674
  s,
678
675
  i,
679
676
  u,
680
- F,
681
- D(f.keys, !0),
677
+ E,
678
+ w(m.keys, !0),
682
679
  a,
683
680
  e.title,
684
681
  n.length > 0 ? n[0].label : ""
685
682
  );
686
- M.push(d);
683
+ F.push(h);
687
684
  }
688
685
  }
689
- }), we === Ct && M.push(zt), at && M.push(It), M.push(wt);
690
- let Q = parseInt(st);
691
- const je = () => /* @__PURE__ */ c(be, { children: te && Le && /* @__PURE__ */ c("div", { className: "legend item", children: /* @__PURE__ */ c("label", { className: "legend-title", children: Le }) }) }), ge = [];
692
- if (B || $) {
693
- Q = Number.parseInt(h.yAxisTickValues);
686
+ }), Fe === Zt && F.push($t), rt && F.push(Dt), F.push(Mt);
687
+ let ge = parseInt(mt);
688
+ const Ce = () => /* @__PURE__ */ c(ve, { children: te && we && /* @__PURE__ */ c("div", { className: "legend item", children: /* @__PURE__ */ c("label", { className: "legend-title", children: we }) }) }), be = [];
689
+ if (_ || S) {
690
+ ge = Number.parseInt(f.yAxisTickValues);
694
691
  const e = new Map(
695
- Object.entries(((Re = h == null ? void 0 : h.labels) == null ? void 0 : Re.xAxis) ?? {})
692
+ Object.entries(((Ke = f == null ? void 0 : f.labels) == null ? void 0 : Ke.xAxis) ?? {})
696
693
  );
697
694
  for (const [t, r] of e)
698
- r || ge.push(t);
695
+ r || be.push(t);
699
696
  }
700
- let X;
701
- if (u === "vertical" && (f != null && f.data) && f.data.length > 0) {
702
- const e = D(f.data, !1), t = [];
697
+ let P;
698
+ if (u === "vertical" && (m != null && m.data) && m.data.length > 0) {
699
+ const e = w(m.data, !1), t = [];
703
700
  if (e.forEach((r) => {
704
- const i = r == null ? void 0 : r[f.indexBy];
701
+ const i = r == null ? void 0 : r[m.indexBy];
705
702
  i !== void 0 && t.indexOf(i) === -1 && t.push(i);
706
- }), ze === "count") {
707
- const r = Math.max(1, parseInt(String(ft)));
703
+ }), Ve === "count") {
704
+ const r = Math.max(1, parseInt(String(xt)));
708
705
  if (t.length > 0 && r > 0)
709
706
  if (t.length <= r)
710
- X = t.slice();
707
+ P = t.slice();
711
708
  else {
712
709
  const i = (t.length - 1) / (r - 1), a = new Array(r);
713
710
  for (let s = 0; s < r; s++)
714
711
  a[s] = Math.floor(s * i);
715
- a[r - 1] = t.length - 1, X = a.map((s) => t[s]);
712
+ a[r - 1] = t.length - 1, P = a.map((s) => t[s]);
716
713
  }
717
- } else if (ze === "every") {
718
- const r = Math.max(1, parseInt(String(ut)));
714
+ } else if (Ve === "every") {
715
+ const r = Math.max(1, parseInt(String(pt)));
719
716
  if (t.length > 0) {
720
717
  const i = [];
721
718
  for (let a = 0; a < t.length; a++)
722
719
  a % r === 0 && i.push(t[a]);
723
- i[i.length - 1] !== t[t.length - 1] && i.push(t[t.length - 1]), X = i;
720
+ i[i.length - 1] !== t[t.length - 1] && i.push(t[t.length - 1]), P = i;
724
721
  }
725
722
  }
726
723
  }
727
- return /* @__PURE__ */ c("div", { style: { height: Ze }, children: (f == null ? void 0 : f.data) && f.data.length > 0 && /* @__PURE__ */ y(be, { children: [
728
- /* @__PURE__ */ c(
729
- St,
730
- {
731
- colorBy: _.colorBy,
732
- animate: !0,
733
- enableLabel: we == Yt,
734
- ...f,
735
- maxValue: Ht,
736
- minValue: At,
737
- keys: D(f.keys, !0),
738
- data: D(f.data, !1),
739
- groupMode: F || "grouped",
740
- margin: Vt,
741
- innerPadding: et,
742
- valueScale: { type: Ue, clamp: !0 },
743
- colors: (e) => e && e.data[ee] ? e.data[ee] : N.getColor(e.id, e.data),
744
- borderColor: "#000",
745
- reverse: S,
746
- axisTop: null,
747
- axisRight: nt ? {
748
- tickSize: u == "horizontal" && Y || u === "vertical" ? 5 : 0,
749
- tickPadding: 5,
750
- tickRotation: 0,
751
- tickValues: Q,
752
- legend: H.right,
753
- legendPosition: "middle",
754
- legendOffset: parseInt(De),
755
- format: (e) => {
756
- if (!e) return "";
757
- if (u == "vertical") {
758
- const t = I || p;
759
- return b.formatNumber(
760
- t.style === "percent" ? e / 100 : e,
761
- {
762
- ...t
763
- }
764
- );
765
- }
766
- return e;
767
- }
768
- } : null,
769
- axisBottom: ($ || B) && (h == null ? void 0 : h.xAxisDisabled) === !0 ? null : u === "horizontal" ? {
770
- legend: H.bottom,
771
- legendPosition: "middle",
772
- legendOffset: parseInt(me),
773
- tickPadding: 5,
774
- tickRotation: 0,
775
- tickValues: Q,
776
- legend: H.right,
777
- legendPosition: "middle",
778
- legendOffset: parseInt(De),
779
- format: (e) => {
780
- if (!e) return "";
781
- if (u == "vertical") {
782
- const t = I || p;
783
- return b.formatNumber(
784
- t.style === "percent" ? e / 100 : e,
785
- {
786
- ...t
787
- }
788
- );
789
- }
790
- return e;
791
- }
792
- } : null,
793
- axisBottom: ($ || B) && (h == null ? void 0 : h.xAxisDisabled) === !0 ? null : u === "horizontal" ? {
794
- legend: H.bottom,
795
- legendPosition: "middle",
796
- legendOffset: parseInt(me),
797
- tickPadding: 5,
798
- tickRotation: 0,
799
- tickValues: parseInt(it),
800
- format: (e) => {
801
- if (!e) return "";
802
- if (u == "horizontal") {
803
- const t = I || p;
804
- return b.formatNumber(
805
- t.style === "percent" ? e / 100 : e,
806
- {
807
- ...t
808
- }
809
- );
810
- }
811
- return e;
812
- }
813
- } : {
814
- legend: H.bottom,
815
- legendPosition: "middle",
816
- legendOffset: parseInt(me),
817
- ...X ? { tickValues: X } : {},
818
- renderTick: Dt
819
- },
820
- axisLeft: {
821
- tickSize: u === "horizontal" && Y || u === "vertical" ? 5 : 0,
822
- tickPadding: 5,
823
- tickRotation: 0,
824
- tickValues: Q,
825
- legend: H.left,
826
- legendPosition: "middle",
827
- legendOffset: Number.parseInt(Je),
828
- ...$ || B ? { renderTick: Mt } : {
829
- format: (e) => {
830
- if (!e) return "";
831
- if (u === "vertical") {
832
- const t = I || p;
833
- return b.formatNumber(
834
- t.style === "percent" ? e / 100 : e,
724
+ let Ye = parseInt(Qe + "") - He;
725
+ const X = Number(Le) > 0, Rt = X ? Number(Le) : Ye;
726
+ return /* @__PURE__ */ c(
727
+ "div",
728
+ {
729
+ style: X ? { display: "flex", flexDirection: "column" } : { height: Ye },
730
+ children: (m == null ? void 0 : m.data) && m.data.length > 0 && /* @__PURE__ */ x(ve, { children: [
731
+ /* @__PURE__ */ c(
732
+ "div",
733
+ {
734
+ style: X ? { height: Rt, flexShrink: 0 } : { height: "100%" },
735
+ children: /* @__PURE__ */ c(
736
+ Yt,
737
+ {
738
+ colorBy: T.colorBy,
739
+ animate: !0,
740
+ enableLabel: Fe == qt,
741
+ ...m,
742
+ maxValue: jt,
743
+ minValue: _t,
744
+ keys: w(m.keys, !0),
745
+ data: w(m.data, !1),
746
+ groupMode: E || "grouped",
747
+ margin: Wt,
748
+ innerPadding: nt,
749
+ valueScale: { type: et, clamp: !0 },
750
+ colors: (e) => e && e.data[ee] ? e.data[ee] : N.getColor(e.id, e.data),
751
+ borderColor: "#000",
752
+ reverse: A,
753
+ axisTop: null,
754
+ axisRight: it ? {
755
+ tickSize: u == "horizontal" && C || u === "vertical" ? 5 : 0,
756
+ tickPadding: 5,
757
+ tickRotation: 0,
758
+ tickValues: ge,
759
+ legend: q.right,
760
+ legendPosition: "middle",
761
+ legendOffset: parseInt(st),
762
+ format: (e) => {
763
+ if (!e) return "";
764
+ if (u == "vertical") {
765
+ const t = O || g;
766
+ return b.formatNumber(
767
+ t.style === "percent" ? e / 100 : e,
768
+ {
769
+ ...t
770
+ }
771
+ );
772
+ }
773
+ return e;
774
+ }
775
+ } : null,
776
+ axisBottom: (S || _) && (f == null ? void 0 : f.xAxisDisabled) === !0 ? null : u === "horizontal" ? {
777
+ legend: q.bottom,
778
+ legendPosition: "middle",
779
+ legendOffset: parseInt(Me),
780
+ tickPadding: 5,
781
+ tickRotation: 0,
782
+ tickValues: parseInt(dt),
783
+ format: (e) => {
784
+ if (!e) return "";
785
+ if (u == "horizontal") {
786
+ const t = O || g;
787
+ return b.formatNumber(
788
+ t.style === "percent" ? e / 100 : e,
789
+ {
790
+ ...t
791
+ }
792
+ );
793
+ }
794
+ return e;
795
+ }
796
+ } : {
797
+ legend: q.bottom,
798
+ legendPosition: "middle",
799
+ legendOffset: parseInt(Me),
800
+ ...P ? { tickValues: P } : {},
801
+ renderTick: Ot
802
+ },
803
+ axisLeft: {
804
+ tickSize: u === "horizontal" && C || u === "vertical" ? 5 : 0,
805
+ tickPadding: 5,
806
+ tickRotation: 0,
807
+ tickValues: ge,
808
+ legend: q.left,
809
+ legendPosition: "middle",
810
+ legendOffset: Number.parseInt(Ge),
811
+ ...S || _ ? { renderTick: Et } : {
812
+ format: (e) => {
813
+ if (!e) return "";
814
+ if (u === "vertical") {
815
+ const t = O || g;
816
+ return b.formatNumber(
817
+ t.style === "percent" ? e / 100 : e,
818
+ {
819
+ ...t
820
+ }
821
+ );
822
+ }
823
+ return e;
824
+ }
825
+ }
826
+ },
827
+ enableGridY: ot,
828
+ enableGridX: yt,
829
+ layout: u,
830
+ labelSkipWidth: ue,
831
+ labelSkipHeight: oe,
832
+ padding: at,
833
+ labelTextColor: ye(),
834
+ label: (e) => b.formatNumber(
835
+ g.style === "percent" && e.value ? e.value / 100 : e.value,
836
+ g
837
+ ),
838
+ layers: F,
839
+ onMouseEnter: (e) => {
840
+ },
841
+ onMouseLeave: (e) => {
842
+ },
843
+ motionStiffness: 130,
844
+ motionDamping: 15,
845
+ tooltip: (e) => lt && le && le.trim().length > 0 ? /* @__PURE__ */ c(
846
+ Ct,
835
847
  {
836
- ...t
848
+ intl: b,
849
+ format: g,
850
+ d: e,
851
+ tooltip: le,
852
+ tooltipEnableMarkdown: ht
853
+ }
854
+ ) : null,
855
+ theme: {
856
+ tooltip: {
857
+ basic: {
858
+ whiteSpace: "pre",
859
+ display: "flex",
860
+ alignItems: "center"
861
+ },
862
+ container: {
863
+ background: "transparent",
864
+ boxShadow: ""
865
+ },
866
+ table: {},
867
+ tableCell: { padding: "3px 5px" }
837
868
  }
838
- );
869
+ }
839
870
  }
840
- return e;
841
- }
871
+ )
842
872
  }
843
- },
844
- enableGridY: ht,
845
- enableGridX: mt,
846
- layout: u,
847
- labelSkipWidth: ue,
848
- labelSkipHeight: oe,
849
- padding: Ge,
850
- labelTextColor: xe(),
851
- label: (e) => b.formatNumber(
852
- p.style === "percent" && e.value ? e.value / 100 : e.value,
853
- p
854
873
  ),
855
- layers: M,
856
- onMouseEnter: (e) => {
857
- },
858
- onMouseLeave: (e) => {
859
- },
860
- motionStiffness: 130,
861
- motionDamping: 15,
862
- tooltip: (e) => tt && le && le.trim().length > 0 ? /* @__PURE__ */ c(
863
- _t,
874
+ (v === "top" || v === "bottom") && _e && /* @__PURE__ */ c(
875
+ "div",
864
876
  {
865
- intl: b,
866
- format: p,
867
- d: e,
868
- tooltip: le,
869
- tooltipEnableMarkdown: rt
870
- }
871
- ) : null,
872
- theme: {
873
- tooltip: {
874
- basic: {
875
- whiteSpace: "pre",
876
- display: "flex",
877
- alignItems: "center"
878
- },
879
- container: {
880
- background: "transparent",
881
- boxShadow: ""
877
+ className: `legends container has-standard-12-font-size ${v}`,
878
+ style: v === "bottom" ? {
879
+ // In chart-height mode the legend flows below the chart;
880
+ // the dynamic margin-reservation is only needed in legacy.
881
+ marginBottom: X ? void 0 : `${He}px`,
882
+ marginTop: "25px",
883
+ textAlign: "left",
884
+ justifyContent: "flex-start"
885
+ } : {
886
+ justifyContent: "flex-start",
887
+ // Top legend: in chart-height mode it flows ABOVE the chart
888
+ // (override the legacy `position: absolute`) via flex order.
889
+ ...X ? { position: "static", order: -1 } : {}
882
890
  },
883
- table: {},
884
- tableCell: { padding: "3px 5px" }
891
+ children: /* @__PURE__ */ x("div", { className: "legend-sections", children: [
892
+ /* @__PURE__ */ c("div", { className: "title-section", children: Ce() }),
893
+ /* @__PURE__ */ c(
894
+ Xt,
895
+ {
896
+ isMobileOrTablet: fe,
897
+ onWrapChange: (e) => {
898
+ if (v === "top" && fe) {
899
+ const t = j + e / 2 * 40;
900
+ Te(t), Ae(e);
901
+ } else
902
+ Se(R + e / 2 * 25), Ae(e);
903
+ },
904
+ className: "legends container has-standard-12-font-size items-section",
905
+ children: je()
906
+ }
907
+ )
908
+ ] })
885
909
  }
886
- }
887
- }
888
- ),
889
- (v === "top" || v === "bottom") && He && /* @__PURE__ */ c(
890
- "div",
891
- {
892
- className: `legends container has-standard-12-font-size ${v}`,
893
- style: v === "bottom" ? {
894
- marginBottom: `${pt}px`,
895
- marginTop: "25px",
896
- textAlign: "left",
897
- justifyContent: "flex-start"
898
- } : {
899
- justifyContent: "flex-start"
900
- },
901
- children: /* @__PURE__ */ y("div", { className: "legend-sections", children: [
902
- /* @__PURE__ */ c("div", { className: "title-section", children: je() }),
903
- /* @__PURE__ */ c(
904
- Pt,
905
- {
906
- onWrapChange: (e) => {
907
- if (v === "top" && Ee) {
908
- const t = R + e / 2 * 40;
909
- We(t), Te(e);
910
- } else
911
- Ae(P + e / 2 * 25), Te(e);
912
- },
913
- className: "legends container has-standard-12-font-size items-section",
914
- children: _e()
915
- }
916
- )
917
- ] })
918
- }
919
- ),
920
- (v === "right" || v === "left") && He && /* @__PURE__ */ y(
921
- "div",
922
- {
923
- className: `legends container has-standard-12-font-size ${v}`,
924
- style: v === "right" ? bt : vt,
925
- children: [
926
- je(),
927
- _e()
928
- ]
929
- }
930
- )
931
- ] }) });
932
- }, ma = jt(Xt);
910
+ ),
911
+ (v === "right" || v === "left") && _e && /* @__PURE__ */ x(
912
+ "div",
913
+ {
914
+ className: `legends container has-standard-12-font-size ${v}`,
915
+ style: v === "right" ? It : kt,
916
+ children: [
917
+ Ce(),
918
+ je()
919
+ ]
920
+ }
921
+ )
922
+ ] })
923
+ }
924
+ );
925
+ }, ua = Kt(Ut);
933
926
  export {
934
- ma as default
927
+ ua as default
935
928
  };