@undp/data-viz 1.4.3 → 1.4.4

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.
@@ -1,39 +1,39 @@
1
1
  import { j as i, m as ke } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useRef as Ce, useState as L, useEffect as Ne } from "react";
3
- import { s as De } from "./index-DxagiOHo.js";
4
- import { p as Ae, f as Ie } from "./parse-DlCRUFh_.js";
5
- import { s as Se, g as Pe, x as Fe } from "./getSliderMarks-C0jptXeP.js";
6
- import { u as Be } from "./index-CaAIPGZo.js";
7
- import { i as We } from "./index-27yTRcko.js";
8
- import { X as He } from "./Modal-DVVwpKhP.js";
9
- import { n as Le } from "./numberFormattingFunction-14YCbkN2.js";
10
- import { T as Xe } from "./Tooltip-DyM5snqx.js";
2
+ import { useRef as Ce, useState as L, useEffect as De } from "react";
3
+ import { p as Se, f as Ie } from "./parse-DlCRUFh_.js";
4
+ import { s as Pe, g as Fe, x as Be } from "./getSliderMarks-C0jptXeP.js";
5
+ import { u as We } from "./index-CaAIPGZo.js";
6
+ import { o as Ve } from "./index-BLizQDlg.js";
7
+ import { i as He } from "./index-27yTRcko.js";
8
+ import { X as Xe } from "./Modal-DVVwpKhP.js";
9
+ import { n as Ae } from "./numberFormattingFunction-14YCbkN2.js";
10
+ import { T as Ye } from "./Tooltip-DyM5snqx.js";
11
11
  import { c as F } from "./checkIfNullOrUndefined-DmfiKkNw.js";
12
- import { s as Ye } from "./string2HTML-CWHGfz_d.js";
13
- import { X as at } from "./XTicksAndGridLines-Bn9u5gOM.js";
14
- import { A as Ee } from "./AxisTitle-BmHLMRJZ.js";
15
- import { Y as rt } from "./YAxesLabels-CPGZjmZJ.js";
16
- import { Y as _e } from "./YTicksAndGridLines-B6ah7CRf.js";
17
- import { a as lt, R as nt } from "./ReferenceLine-CfAW3vKJ.js";
18
- import { a as Ge } from "./linear-DUdu7l2G.js";
19
- import { b as ze } from "./band-BEjh2CHI.js";
20
- import { u as Re } from "./use-in-view-yS6jzJAp.js";
12
+ import { s as Ee } from "./string2HTML-CWHGfz_d.js";
13
+ import { X as rt } from "./XTicksAndGridLines-Bn9u5gOM.js";
14
+ import { A as _e } from "./AxisTitle-BmHLMRJZ.js";
15
+ import { Y as lt } from "./YAxesLabels-CPGZjmZJ.js";
16
+ import { Y as Ge } from "./YTicksAndGridLines-B6ah7CRf.js";
17
+ import { a as nt, R as ot } from "./ReferenceLine-CfAW3vKJ.js";
18
+ import { a as ze } from "./linear-DUdu7l2G.js";
19
+ import { b as Re } from "./band-BEjh2CHI.js";
20
+ import { u as qe } from "./use-in-view-yS6jzJAp.js";
21
21
  import { m as se } from "./proxy-CkpFesk1.js";
22
- import { A as qe } from "./index-CNvov0eg.js";
23
- import { GraphHeader as Ue } from "./GraphHeader.js";
24
- import { GraphFooter as Je } from "./GraphFooter.js";
25
- import { ColorLegendWithMouseOver as Ke } from "./ColorLegendWithMouseOver.js";
26
- import { Colors as Qe } from "./Colors.js";
27
- import { E as Ze } from "./EmptyState-DdTp-Mdn.js";
28
- import { P as et, f as tt } from "./index-BmCqpO1B.js";
22
+ import { A as Ue } from "./index-CNvov0eg.js";
23
+ import { GraphHeader as Je } from "./GraphHeader.js";
24
+ import { GraphFooter as Ke } from "./GraphFooter.js";
25
+ import { ColorLegendWithMouseOver as Qe } from "./ColorLegendWithMouseOver.js";
26
+ import { Colors as Ze } from "./Colors.js";
27
+ import { E as et } from "./EmptyState-DdTp-Mdn.js";
28
+ import { P as tt, f as it } from "./index-BmCqpO1B.js";
29
29
  import { b as we } from "./ensureCompleteData-BBDZbDCE.js";
30
- import { c as it } from "./init-BhZylTFx.js";
31
- import { A as ot } from "./Axis-Ddg-seDi.js";
32
- import { X as st } from "./XAxesLabels-CaV2q-6H.js";
33
- function ct(ye) {
30
+ import { c as at } from "./init-BhZylTFx.js";
31
+ import { A as st } from "./Axis-Ddg-seDi.js";
32
+ import { X as ct } from "./XAxesLabels-CaV2q-6H.js";
33
+ function dt(ye) {
34
34
  const {
35
- data: o,
36
- dotColors: x,
35
+ data: s,
36
+ dotColors: g,
37
37
  suffix: q,
38
38
  prefix: U,
39
39
  barPadding: b,
@@ -63,31 +63,31 @@ function ct(ye) {
63
63
  axisTitle: _,
64
64
  noOfTicks: fe,
65
65
  valueColor: ne,
66
- styles: d,
67
- classNames: h,
66
+ styles: m,
67
+ classNames: u,
68
68
  labelOrder: V,
69
69
  refValues: oe,
70
70
  rtl: f,
71
- animate: s,
71
+ animate: c,
72
72
  precision: N,
73
73
  customLayers: G,
74
74
  highlightedDataPoints: z,
75
75
  dimmedOpacity: A
76
- } = ye, w = Ce(null), u = Re(w, {
77
- once: s.once,
78
- amount: s.amount
79
- }), m = {
76
+ } = ye, w = Ce(null), x = qe(w, {
77
+ once: c.once,
78
+ amount: c.amount
79
+ }), h = {
80
80
  top: _ ? D + 25 : D,
81
81
  bottom: n,
82
82
  left: ee,
83
83
  right: J
84
- }, Y = te - m.left - m.right, E = ie - m.top - m.bottom, [K, H] = L(void 0), [j, y] = L(void 0), [T, Q] = L(void 0), [S, P] = L(void 0), R = o.map((t, l) => ({
84
+ }, Y = te - h.left - h.right, E = ie - h.top - h.bottom, [K, H] = L(void 0), [j, y] = L(void 0), [T, Q] = L(void 0), [S, P] = L(void 0), R = s.map((t, l) => ({
85
85
  ...t,
86
86
  id: V ? `${t.label}` : `${l}`
87
- })), k = V || R.map((t) => `${t.id}`), g = Ge().domain([ae, C]).range([0, Y]).nice(), $ = ze().domain(k).range([
87
+ })), k = V || R.map((t) => `${t.id}`), p = ze().domain([ae, C]).range([0, Y]).nice(), $ = Re().domain(k).range([
88
88
  0,
89
89
  le ? Math.max(E, le * R.length) : re ? Math.min(E, re * R.length) : E
90
- ]).paddingInner(b), a = g.ticks(fe);
90
+ ]).paddingInner(b), a = p.ticks(fe);
91
91
  return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
92
92
  /* @__PURE__ */ i.jsxs(
93
93
  se.svg,
@@ -117,21 +117,21 @@ function ct(ye) {
117
117
  )
118
118
  }
119
119
  ) }) : null,
120
- /* @__PURE__ */ i.jsxs("g", { transform: `translate(${m.left},${m.top})`, children: [
120
+ /* @__PURE__ */ i.jsxs("g", { transform: `translate(${h.left},${h.top})`, children: [
121
121
  Z ? /* @__PURE__ */ i.jsx(
122
- at,
122
+ rt,
123
123
  {
124
124
  values: a.filter((t, l) => l !== 0),
125
- x: a.filter((t, l) => l !== 0).map((t) => g(t)),
125
+ x: a.filter((t, l) => l !== 0).map((t) => p(t)),
126
126
  y1: 0 - D,
127
- y2: E + m.bottom,
127
+ y2: E + h.bottom,
128
128
  styles: {
129
- gridLines: d?.xAxis?.gridLines,
130
- labels: d?.xAxis?.labels
129
+ gridLines: m?.xAxis?.gridLines,
130
+ labels: m?.xAxis?.labels
131
131
  },
132
132
  classNames: {
133
- gridLines: h?.xAxis?.gridLines,
134
- labels: h?.xAxis?.labels
133
+ gridLines: u?.xAxis?.gridLines,
134
+ labels: u?.xAxis?.labels
135
135
  },
136
136
  suffix: q,
137
137
  prefix: U,
@@ -141,23 +141,23 @@ function ct(ye) {
141
141
  }
142
142
  ) : null,
143
143
  /* @__PURE__ */ i.jsx(
144
- Ee,
144
+ _e,
145
145
  {
146
146
  x: Y / 2,
147
- y: 0 - m.top + 15,
148
- style: d?.xAxis?.title,
149
- className: h?.xAxis?.title,
147
+ y: 0 - h.top + 15,
148
+ style: m?.xAxis?.title,
149
+ className: u?.xAxis?.title,
150
150
  text: _
151
151
  }
152
152
  ),
153
153
  /* @__PURE__ */ i.jsx(
154
- _e,
154
+ Ge,
155
155
  {
156
156
  y: R.map((t) => $(`${t.id}`) + $.bandwidth() / 2),
157
157
  x1: 0,
158
158
  x2: Y,
159
- styles: { gridLines: d?.yAxis?.gridLines },
160
- classNames: { gridLines: h?.yAxis?.gridLines },
159
+ styles: { gridLines: m?.yAxis?.gridLines },
160
+ classNames: { gridLines: u?.yAxis?.gridLines },
161
161
  labelType: "secondary",
162
162
  showGridLines: !0,
163
163
  labelPos: "vertical",
@@ -165,7 +165,7 @@ function ct(ye) {
165
165
  }
166
166
  ),
167
167
  G.filter((t) => t.position === "before").map((t) => t.layer),
168
- /* @__PURE__ */ i.jsxs(qe, { children: [
168
+ /* @__PURE__ */ i.jsxs(Ue, { children: [
169
169
  R.map((t) => /* @__PURE__ */ i.jsxs(
170
170
  se.g,
171
171
  {
@@ -180,26 +180,26 @@ function ct(ye) {
180
180
  x: 0,
181
181
  y: $(`${t.id}`) + $.bandwidth() / 2,
182
182
  opacity: z.length !== 0 ? z.indexOf(t.label) !== -1 ? 0.85 : A : 0.85,
183
- transition: { duration: s.duration }
183
+ transition: { duration: c.duration }
184
184
  }
185
185
  },
186
186
  initial: "initial",
187
- animate: u ? "whileInView" : "initial",
188
- exit: { opacity: 0, transition: { duration: s.duration } },
187
+ animate: x ? "whileInView" : "initial",
188
+ exit: { opacity: 0, transition: { duration: c.duration } },
189
189
  children: [
190
190
  me ? /* @__PURE__ */ i.jsx(
191
- rt,
191
+ lt,
192
192
  {
193
193
  value: `${t.label}`.length < de ? `${t.label}` : `${`${t.label}`.substring(0, de)}...`,
194
194
  y: 0 - $.bandwidth() / 2,
195
- x: 0 - m.left,
196
- width: m.left,
195
+ x: 0 - h.left,
196
+ width: h.left,
197
197
  height: $.bandwidth(),
198
198
  alignment: "right",
199
- style: d?.yAxis?.labels,
200
- className: h?.yAxis?.labels,
201
- animate: s,
202
- isInView: u
199
+ style: m?.yAxis?.labels,
200
+ className: u?.yAxis?.labels,
201
+ animate: c,
202
+ isInView: x
203
203
  }
204
204
  ) : null,
205
205
  /* @__PURE__ */ i.jsx(
@@ -209,58 +209,58 @@ function ct(ye) {
209
209
  y2: 0,
210
210
  style: {
211
211
  strokeWidth: ge,
212
- ...d?.dataConnectors || {},
212
+ ...m?.dataConnectors || {},
213
213
  opacity: I ? 0.3 : 1
214
214
  },
215
215
  className: ke(
216
216
  "stroke-primary-gray-600 dark:stroke-primary-gray-300",
217
- h?.dataConnectors
217
+ u?.dataConnectors
218
218
  ),
219
219
  markerEnd: M && t.x.indexOf(Math.min(...t.x.filter((l) => l !== null))) === 0 ? "url(#arrow)" : "",
220
220
  markerStart: M && t.x.indexOf(Math.min(...t.x.filter((l) => l !== null))) === t.x.length - 1 ? "url(#arrow)" : "",
221
- exit: { opacity: 0, transition: { duration: s.duration } },
221
+ exit: { opacity: 0, transition: { duration: c.duration } },
222
222
  variants: {
223
223
  initial: {
224
224
  x1: 0,
225
225
  x2: 0
226
226
  },
227
227
  whileInView: {
228
- x1: g(Math.min(...t.x.filter((l) => l !== null))) + B,
229
- x2: g(Math.max(...t.x.filter((l) => l !== null))) - B,
230
- transition: { duration: s.duration }
228
+ x1: p(Math.min(...t.x.filter((l) => l !== null))) + B,
229
+ x2: p(Math.max(...t.x.filter((l) => l !== null))) - B,
230
+ transition: { duration: c.duration }
231
231
  }
232
232
  },
233
233
  initial: "initial",
234
- animate: u ? "whileInView" : "initial"
234
+ animate: x ? "whileInView" : "initial"
235
235
  }
236
236
  ),
237
- t.x.map((l, p) => /* @__PURE__ */ i.jsx(
237
+ t.x.map((l, o) => /* @__PURE__ */ i.jsx(
238
238
  se.g,
239
239
  {
240
240
  onMouseEnter: (he) => {
241
- H({ ...t, xIndex: p }), P(he.clientY), Q(he.clientX), W?.({ ...t, xIndex: p });
241
+ H({ ...t, xIndex: o }), P(he.clientY), Q(he.clientX), W?.({ ...t, xIndex: o });
242
242
  },
243
243
  onClick: () => {
244
- (X || v) && (We(j, { ...t, xIndex: p }) && pe ? (y(void 0), X?.(void 0)) : (y({ ...t, xIndex: p }), X && X({ ...t, xIndex: p })));
244
+ (X || v) && (He(j, { ...t, xIndex: o }) && pe ? (y(void 0), X?.(void 0)) : (y({ ...t, xIndex: o }), X && X({ ...t, xIndex: o })));
245
245
  },
246
246
  onMouseMove: (he) => {
247
- H({ ...t, xIndex: p }), P(he.clientY), Q(he.clientX);
247
+ H({ ...t, xIndex: o }), P(he.clientY), Q(he.clientX);
248
248
  },
249
249
  onMouseLeave: () => {
250
250
  H(void 0), Q(void 0), P(void 0), W?.(void 0);
251
251
  },
252
- exit: { opacity: 0, transition: { duration: s.duration } },
252
+ exit: { opacity: 0, transition: { duration: c.duration } },
253
253
  variants: {
254
254
  initial: {
255
- opacity: I ? x[p] === I ? 1 : 0.3 : 1
255
+ opacity: I ? g[o] === I ? 1 : 0.3 : 1
256
256
  },
257
257
  whileInView: {
258
- opacity: I ? x[p] === I ? 1 : 0.3 : 1,
259
- transition: { duration: s.duration }
258
+ opacity: I ? g[o] === I ? 1 : 0.3 : 1,
259
+ transition: { duration: c.duration }
260
260
  }
261
261
  },
262
262
  initial: "initial",
263
- animate: u ? "whileInView" : "initial",
263
+ animate: x ? "whileInView" : "initial",
264
264
  children: F(l) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
265
265
  /* @__PURE__ */ i.jsx(
266
266
  se.circle,
@@ -268,23 +268,23 @@ function ct(ye) {
268
268
  cy: 0,
269
269
  r: B,
270
270
  style: {
271
- fill: x[p],
271
+ fill: g[o],
272
272
  fillOpacity: 0.85,
273
- stroke: x[p],
273
+ stroke: g[o],
274
274
  strokeWidth: 1,
275
275
  opacity: F(l) ? 0 : 1
276
276
  },
277
- exit: { opacity: 0, transition: { duration: s.duration } },
277
+ exit: { opacity: 0, transition: { duration: c.duration } },
278
278
  variants: {
279
- initial: { cx: g(0), opacity: 0 },
279
+ initial: { cx: p(0), opacity: 0 },
280
280
  whileInView: {
281
- cx: g(l || 0),
281
+ cx: p(l || 0),
282
282
  opacity: F(l) ? 0 : 1,
283
- transition: { duration: s.duration }
283
+ transition: { duration: c.duration }
284
284
  }
285
285
  },
286
286
  initial: "initial",
287
- animate: u ? "whileInView" : "initial"
287
+ animate: x ? "whileInView" : "initial"
288
288
  }
289
289
  ),
290
290
  ce ? /* @__PURE__ */ i.jsx(
@@ -292,52 +292,52 @@ function ct(ye) {
292
292
  {
293
293
  y: 0,
294
294
  style: {
295
- fill: ne || x[p],
295
+ fill: ne || g[o],
296
296
  textAnchor: "middle",
297
- ...d?.graphObjectValues || {}
297
+ ...m?.graphObjectValues || {}
298
298
  },
299
299
  dx: 0,
300
300
  dy: 0 - B - 3,
301
301
  className: ke(
302
302
  "graph-value text-sm font-bold",
303
303
  F(l) ? "0opacity-0" : "opacity-100",
304
- h?.graphObjectValues
304
+ u?.graphObjectValues
305
305
  ),
306
- exit: { opacity: 0, transition: { duration: s.duration } },
306
+ exit: { opacity: 0, transition: { duration: c.duration } },
307
307
  variants: {
308
- initial: { x: g(0), opacity: 0 },
308
+ initial: { x: p(0), opacity: 0 },
309
309
  whileInView: {
310
- x: g(l || 0),
310
+ x: p(l || 0),
311
311
  opacity: 1,
312
- transition: { duration: s.duration }
312
+ transition: { duration: c.duration }
313
313
  }
314
314
  },
315
315
  initial: "initial",
316
- animate: u ? "whileInView" : "initial",
317
- children: Le(l, "NA", N, U, q)
316
+ animate: x ? "whileInView" : "initial",
317
+ children: Ae(l, "NA", N, U, q)
318
318
  }
319
319
  ) : null
320
320
  ] })
321
321
  },
322
- p
322
+ o
323
323
  ))
324
324
  ]
325
325
  },
326
326
  t.label
327
327
  )),
328
328
  oe ? /* @__PURE__ */ i.jsx(i.Fragment, { children: oe.map((t, l) => /* @__PURE__ */ i.jsx(
329
- lt,
329
+ nt,
330
330
  {
331
331
  text: t.text,
332
332
  color: t.color,
333
- x: g(t.value),
334
- y1: 0 - m.top,
335
- y2: E + m.bottom,
336
- textSide: g(t.value) > Y * 0.75 || f ? "left" : "right",
333
+ x: p(t.value),
334
+ y1: 0 - h.top,
335
+ y2: E + h.bottom,
336
+ textSide: p(t.value) > Y * 0.75 || f ? "left" : "right",
337
337
  classNames: t.classNames,
338
338
  styles: t.styles,
339
- animate: s,
340
- isInView: u
339
+ animate: c,
340
+ isInView: x
341
341
  },
342
342
  l
343
343
  )) }) : null
@@ -348,18 +348,18 @@ function ct(ye) {
348
348
  }
349
349
  ),
350
350
  K && O && T && S ? /* @__PURE__ */ i.jsx(
351
- Xe,
351
+ Ye,
352
352
  {
353
353
  data: K,
354
354
  body: O,
355
355
  xPos: T,
356
356
  yPos: S,
357
- backgroundStyle: d?.tooltip,
358
- className: h?.tooltip
357
+ backgroundStyle: m?.tooltip,
358
+ className: u?.tooltip
359
359
  }
360
360
  ) : null,
361
361
  v && j !== void 0 ? /* @__PURE__ */ i.jsx(
362
- He,
362
+ Xe,
363
363
  {
364
364
  open: j !== void 0,
365
365
  onClose: () => {
@@ -369,7 +369,7 @@ function ct(ye) {
369
369
  "div",
370
370
  {
371
371
  className: "graph-modal-content m-0",
372
- dangerouslySetInnerHTML: typeof v == "string" ? { __html: Ye(v, j) } : void 0,
372
+ dangerouslySetInnerHTML: typeof v == "string" ? { __html: Ee(v, j) } : void 0,
373
373
  children: typeof v == "function" ? v(j) : null
374
374
  }
375
375
  )
@@ -377,11 +377,11 @@ function ct(ye) {
377
377
  ) : null
378
378
  ] });
379
379
  }
380
- function dt(ye) {
380
+ function mt(ye) {
381
381
  const {
382
- data: o,
383
- graphTitle: x,
384
- colors: q = Qe.light.categoricalColors.colors,
382
+ data: s,
383
+ graphTitle: g,
384
+ colors: q = Ze.light.categoricalColors.colors,
385
385
  sources: U,
386
386
  graphDescription: b,
387
387
  barPadding: ce = 0.25,
@@ -410,19 +410,19 @@ function dt(ye) {
410
410
  minValue: _,
411
411
  onSeriesMouseClick: fe,
412
412
  graphDownload: ne = !1,
413
- dataDownload: d = !1,
414
- showValues: h = !0,
413
+ dataDownload: m = !1,
414
+ showValues: u = !0,
415
415
  sortParameter: V,
416
416
  arrowConnector: oe = !1,
417
417
  connectorStrokeWidth: f = 2,
418
- language: s = "en",
418
+ language: c = "en",
419
419
  minHeight: N = 0,
420
420
  theme: G = "light",
421
421
  labelOrder: z,
422
422
  maxBarThickness: A,
423
423
  maxNumberOfBars: w,
424
- minBarThickness: u,
425
- ariaLabel: m,
424
+ minBarThickness: x,
425
+ ariaLabel: h,
426
426
  resetSelectionOnDoubleClick: Y = !0,
427
427
  detailsOnClick: E,
428
428
  axisTitle: K,
@@ -435,33 +435,34 @@ function dt(ye) {
435
435
  animate: P = !1,
436
436
  precision: R = 2,
437
437
  customLayers: k = [],
438
- showColorScale: g = !0,
438
+ showColorScale: p = !0,
439
439
  highlightedDataPoints: $ = [],
440
440
  dimmedOpacity: a = 0.3,
441
- timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 }
442
- } = ye, [l, p] = L(0), [he, Me] = L(0), [ue, Ve] = L(t.autoplay), c = Se(
443
- Be(
444
- o.filter((e) => e.date !== void 0 && e.date !== null),
441
+ timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
442
+ sortData: l
443
+ } = ye, [o, he] = L(0), [Me, je] = L(0), [ue, Te] = L(t.autoplay), d = Pe(
444
+ We(
445
+ s.filter((e) => e.date !== void 0 && e.date !== null),
445
446
  (e) => e.date
446
- ).map((e) => Ae(`${e.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
447
- (e, r) => it(e, r)
448
- ), [be, ve] = L(t.autoplay ? 0 : c.length - 1), [Te, $e] = L(void 0), xe = Ce(null), je = Ce(null);
449
- Ne(() => {
447
+ ).map((e) => Se(`${e.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
448
+ (e, r) => at(e, r)
449
+ ), [be, ve] = L(t.autoplay ? 0 : d.length - 1), [$e, Le] = L(void 0), xe = Ce(null), Oe = Ce(null);
450
+ De(() => {
450
451
  const e = new ResizeObserver((r) => {
451
- p(n || r[0].target.clientWidth || 620), Me(D || r[0].target.clientHeight || 480);
452
+ he(n || r[0].target.clientWidth || 620), je(D || r[0].target.clientHeight || 480);
452
453
  });
453
- return xe.current && (Me(xe.current.clientHeight || 480), p(xe.current.clientWidth || 620), n || e.observe(xe.current)), () => e.disconnect();
454
- }, [n, D]), Ne(() => {
454
+ return xe.current && (je(xe.current.clientHeight || 480), he(xe.current.clientWidth || 620), n || e.observe(xe.current)), () => e.disconnect();
455
+ }, [n, D]), De(() => {
455
456
  const e = setInterval(
456
457
  () => {
457
- ve((r) => r < c.length - 1 ? r + 1 : 0);
458
+ ve((r) => r < d.length - 1 ? r + 1 : 0);
458
459
  },
459
460
  (t.speed || 2) * 1e3
460
461
  );
461
462
  return ue || clearInterval(e), () => clearInterval(e);
462
- }, [c, ue, t.speed]);
463
- const Oe = Pe(
464
- c,
463
+ }, [d, ue, t.speed]);
464
+ const Ne = Fe(
465
+ d,
465
466
  be,
466
467
  t.showOnlyActiveDate,
467
468
  t.dateFormat || "yyyy"
@@ -470,12 +471,12 @@ function dt(ye) {
470
471
  "div",
471
472
  {
472
473
  className: `${G || "light"} flex ${n ? "w-fit grow-0" : "w-full grow"}`,
473
- dir: s === "he" || s === "ar" ? "rtl" : void 0,
474
+ dir: c === "he" || c === "ar" ? "rtl" : void 0,
474
475
  children: /* @__PURE__ */ i.jsx(
475
476
  "div",
476
477
  {
477
478
  className: ke(
478
- `${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${s || "en"}`,
479
+ `${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c || "en"}`,
479
480
  T?.graphContainer
480
481
  ),
481
482
  style: {
@@ -483,16 +484,16 @@ function dt(ye) {
483
484
  ...C && C !== !0 ? { backgroundColor: C } : {}
484
485
  },
485
486
  id: re,
486
- ref: je,
487
- "aria-label": m || `${x ? `The graph shows ${x}. ` : ""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${b ? ` ${b}` : ""}`,
487
+ ref: Oe,
488
+ "aria-label": h || `${g ? `The graph shows ${g}. ` : ""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${b ? ` ${b}` : ""}`,
488
489
  children: /* @__PURE__ */ i.jsx(
489
490
  "div",
490
491
  {
491
492
  className: "flex grow",
492
493
  style: { padding: C ? W || "1rem" : W || 0 },
493
494
  children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
494
- x || b || ne || d ? /* @__PURE__ */ i.jsx(
495
- Ue,
495
+ g || b || ne || m ? /* @__PURE__ */ i.jsx(
496
+ Je,
496
497
  {
497
498
  styles: {
498
499
  title: y?.title,
@@ -502,54 +503,54 @@ function dt(ye) {
502
503
  title: T?.title,
503
504
  description: T?.description
504
505
  },
505
- graphTitle: x,
506
+ graphTitle: g,
506
507
  graphDescription: b,
507
508
  width: n,
508
- graphDownload: ne ? je.current : void 0,
509
- dataDownload: d ? o.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? o.map((e) => e.data).filter((e) => e !== void 0) : o.filter((e) => e !== void 0) : null
509
+ graphDownload: ne ? Oe.current : void 0,
510
+ dataDownload: m ? s.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? s.map((e) => e.data).filter((e) => e !== void 0) : s.filter((e) => e !== void 0) : null
510
511
  }
511
512
  ) : null,
512
- t.enabled && c.length > 0 && Oe ? /* @__PURE__ */ i.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
513
+ t.enabled && d.length > 0 && Ne ? /* @__PURE__ */ i.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
513
514
  /* @__PURE__ */ i.jsx(
514
515
  "button",
515
516
  {
516
517
  type: "button",
517
518
  onClick: () => {
518
- Ve(!ue);
519
+ Te(!ue);
519
520
  },
520
521
  className: "p-0 border-0 cursor-pointer bg-transparent",
521
522
  "aria-label": ue ? "Click to pause animation" : "Click to play animation",
522
- children: ue ? /* @__PURE__ */ i.jsx(et, {}) : /* @__PURE__ */ i.jsx(tt, {})
523
+ children: ue ? /* @__PURE__ */ i.jsx(tt, {}) : /* @__PURE__ */ i.jsx(it, {})
523
524
  }
524
525
  ),
525
526
  /* @__PURE__ */ i.jsx(
526
- Fe,
527
+ Be,
527
528
  {
528
- min: c[0],
529
- max: c[c.length - 1],
530
- marks: Oe,
529
+ min: d[0],
530
+ max: d[d.length - 1],
531
+ marks: Ne,
531
532
  step: null,
532
- defaultValue: c[c.length - 1],
533
- value: c[be],
533
+ defaultValue: d[d.length - 1],
534
+ value: d[be],
534
535
  onChangeComplete: (e) => {
535
- ve(c.indexOf(e));
536
+ ve(d.indexOf(e));
536
537
  },
537
538
  onChange: (e) => {
538
- ve(c.indexOf(e));
539
+ ve(d.indexOf(e));
539
540
  },
540
541
  "aria-label": "Time slider. Use arrow keys to adjust selected time period."
541
542
  }
542
543
  )
543
544
  ] }) : null,
544
- /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ i.jsx(Ze, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
545
- g ? /* @__PURE__ */ i.jsx(
546
- Ke,
545
+ /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: s.length === 0 ? /* @__PURE__ */ i.jsx(et, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
546
+ p ? /* @__PURE__ */ i.jsx(
547
+ Qe,
547
548
  {
548
549
  width: n,
549
550
  colorDomain: me,
550
551
  colors: q,
551
552
  colorLegendTitle: O,
552
- setSelectedColor: $e,
553
+ setSelectedColor: Le,
553
554
  showNAColor: !1
554
555
  }
555
556
  ) : null,
@@ -559,40 +560,42 @@ function dt(ye) {
559
560
  className: "flex grow w-full justify-center leading-0",
560
561
  ref: xe,
561
562
  "aria-label": "Graph area",
562
- children: (n || l) && (D || he) ? /* @__PURE__ */ i.jsx(
563
- ct,
563
+ children: (n || o) && (D || Me) ? /* @__PURE__ */ i.jsx(
564
+ dt,
564
565
  {
565
- data: V !== void 0 ? V === "diff" ? De(
566
+ data: V !== void 0 ? V === "diff" ? Ve(
566
567
  we(
567
- o,
568
+ s,
568
569
  t.dateFormat || "yyyy"
569
570
  ).filter(
570
571
  (e) => t.enabled ? e.date === Ie(
571
- new Date(c[be]),
572
+ new Date(d[be]),
572
573
  t.dateFormat || "yyyy"
573
574
  ) : e
574
575
  ).filter((e) => S ? !e.x.every((r) => r == null) : e),
575
- (e) => F(e.x[e.x.length - 1]) || F(e.x[0]) ? -1 / 0 : e.x[e.x.length - 1] - e.x[0]
576
- ).reverse().filter((e, r) => w ? r < w : !0) : De(
576
+ (e) => F(e.x[e.x.length - 1]) || F(e.x[0]) ? -1 / 0 : e.x[e.x.length - 1] - e.x[0],
577
+ [l || "asc"]
578
+ ).filter((e, r) => w ? r < w : !0) : Ve(
577
579
  we(
578
- o,
580
+ s,
579
581
  t.dateFormat || "yyyy"
580
582
  ).filter(
581
583
  (e) => t.enabled ? e.date === Ie(
582
- new Date(c[be]),
584
+ new Date(d[be]),
583
585
  t.dateFormat || "yyyy"
584
586
  ) : e
585
587
  ).filter((e) => S ? !e.x.every((r) => r == null) : e),
586
- (e) => F(e.x[V]) ? -1 / 0 : e.x[V]
587
- ).reverse().filter((e, r) => w ? r < w : !0) : we(
588
- o,
588
+ (e) => F(e.x[V]) ? -1 / 0 : e.x[V],
589
+ [l || "asc"]
590
+ ).filter((e, r) => w ? r < w : !0) : we(
591
+ s,
589
592
  t.dateFormat || "yyyy"
590
593
  ).filter((e) => S ? !e.x.every((r) => r == null) : e).filter((e, r) => w ? r < w : !0),
591
594
  dotColors: q,
592
- width: n || l,
595
+ width: n || o,
593
596
  height: Math.max(
594
597
  N,
595
- D || (M ? N ? (n || l) * M > N ? (n || l) * M : N : (n || l) * M : he)
598
+ D || (M ? N ? (n || o) * M > N ? (n || o) * M : N : (n || o) * M : Me)
596
599
  ),
597
600
  suffix: le,
598
601
  prefix: pe,
@@ -605,25 +608,25 @@ function dt(ye) {
605
608
  bottomMargin: ie,
606
609
  truncateBy: J,
607
610
  showLabels: X,
608
- showValues: h,
611
+ showValues: u,
609
612
  tooltip: I,
610
613
  onSeriesMouseOver: ge,
611
614
  maxValue: F(v) ? Math.max(
612
- ...o.map((e) => Math.max(...e.x.filter((r) => r !== null)))
615
+ ...s.map((e) => Math.max(...e.x.filter((r) => r !== null)))
613
616
  ) < 0 ? 0 : Math.max(
614
- ...o.map((e) => Math.max(...e.x.filter((r) => r !== null)))
617
+ ...s.map((e) => Math.max(...e.x.filter((r) => r !== null)))
615
618
  ) : v,
616
619
  minValue: F(_) ? Math.min(
617
- ...o.map((e) => Math.min(...e.x.filter((r) => r !== null)))
620
+ ...s.map((e) => Math.min(...e.x.filter((r) => r !== null)))
618
621
  ) > 0 ? 0 : Math.min(
619
- ...o.map((e) => Math.min(...e.x.filter((r) => r !== null)))
622
+ ...s.map((e) => Math.min(...e.x.filter((r) => r !== null)))
620
623
  ) : _,
621
624
  onSeriesMouseClick: fe,
622
- selectedColor: Te,
625
+ selectedColor: $e,
623
626
  arrowConnector: oe,
624
627
  connectorStrokeWidth: f,
625
628
  maxBarThickness: A,
626
- minBarThickness: u,
629
+ minBarThickness: x,
627
630
  resetSelectionOnDoubleClick: Y,
628
631
  detailsOnClick: E,
629
632
  axisTitle: K,
@@ -633,7 +636,7 @@ function dt(ye) {
633
636
  classNames: T,
634
637
  labelOrder: z,
635
638
  refValues: Q,
636
- rtl: s === "he" || s === "ar",
639
+ rtl: c === "he" || c === "ar",
637
640
  animate: P === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : P || { duration: 0, once: !0, amount: 0 },
638
641
  precision: R,
639
642
  customLayers: k,
@@ -645,7 +648,7 @@ function dt(ye) {
645
648
  )
646
649
  ] }) }),
647
650
  U || B ? /* @__PURE__ */ i.jsx(
648
- Je,
651
+ Ke,
649
652
  {
650
653
  styles: { footnote: y?.footnote, source: y?.source },
651
654
  classNames: {
@@ -665,10 +668,10 @@ function dt(ye) {
665
668
  }
666
669
  );
667
670
  }
668
- function mt(ye) {
671
+ function ht(ye) {
669
672
  const {
670
- data: o,
671
- dotColors: x,
673
+ data: s,
674
+ dotColors: g,
672
675
  barPadding: q,
673
676
  showTicks: U,
674
677
  leftMargin: b,
@@ -698,29 +701,29 @@ function mt(ye) {
698
701
  axisTitle: _,
699
702
  noOfTicks: fe,
700
703
  valueColor: ne,
701
- styles: d,
702
- classNames: h,
704
+ styles: m,
705
+ classNames: u,
703
706
  labelOrder: V,
704
707
  refValues: oe,
705
708
  animate: f,
706
- precision: s,
709
+ precision: c,
707
710
  customLayers: N,
708
711
  highlightedDataPoints: G,
709
712
  dimmedOpacity: z
710
- } = ye, A = Ce(null), w = Re(A, {
713
+ } = ye, A = Ce(null), w = qe(A, {
711
714
  once: f.once,
712
715
  amount: f.amount
713
- }), u = {
716
+ }), x = {
714
717
  top: te,
715
718
  bottom: ie,
716
719
  left: _ ? b + 30 : b,
717
720
  right: de
718
- }, m = Z - u.left - u.right, Y = ee - u.top - u.bottom, [E, K] = L(void 0), [H, j] = L(void 0), [y, T] = L(void 0), [Q, S] = L(void 0), P = o.map((a, t) => ({
721
+ }, h = Z - x.left - x.right, Y = ee - x.top - x.bottom, [E, K] = L(void 0), [H, j] = L(void 0), [y, T] = L(void 0), [Q, S] = L(void 0), P = s.map((a, t) => ({
719
722
  ...a,
720
723
  id: V ? `${a.label}` : `${t}`
721
- })), R = V || P.map((a) => `${a.id}`), k = Ge().domain([O, me]).range([Y, 0]).nice(), g = ze().domain(R).range([
724
+ })), R = V || P.map((a) => `${a.id}`), k = ze().domain([O, me]).range([Y, 0]).nice(), p = Re().domain(R).range([
722
725
  0,
723
- le ? Math.max(m, le * P.length) : re ? Math.min(m, re * P.length) : m
726
+ le ? Math.max(h, le * P.length) : re ? Math.min(h, re * P.length) : h
724
727
  ]).paddingInner(q), $ = k.ticks(fe);
725
728
  return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
726
729
  /* @__PURE__ */ i.jsxs(
@@ -751,18 +754,18 @@ function mt(ye) {
751
754
  )
752
755
  }
753
756
  ) }) : null,
754
- /* @__PURE__ */ i.jsxs("g", { transform: `translate(${u.left},${u.top})`, children: [
757
+ /* @__PURE__ */ i.jsxs("g", { transform: `translate(${x.left},${x.top})`, children: [
755
758
  /* @__PURE__ */ i.jsx(
756
- ot,
759
+ st,
757
760
  {
758
761
  y1: k(O < 0 ? 0 : O),
759
762
  y2: k(O < 0 ? 0 : O),
760
763
  x1: 0 - b,
761
- x2: m + u.right,
762
- label: Le(
764
+ x2: h + x.right,
765
+ label: Ae(
763
766
  O < 0 ? 0 : O,
764
767
  "NA",
765
- s,
768
+ c,
766
769
  X,
767
770
  ae
768
771
  ),
@@ -773,60 +776,60 @@ function mt(ye) {
773
776
  y: k(O < 0 ? 0 : O)
774
777
  },
775
778
  classNames: {
776
- axis: h?.xAxis?.axis,
777
- label: h?.yAxis?.labels
779
+ axis: u?.xAxis?.axis,
780
+ label: u?.yAxis?.labels
778
781
  },
779
- styles: { axis: d?.xAxis?.axis, label: d?.yAxis?.labels }
782
+ styles: { axis: m?.xAxis?.axis, label: m?.yAxis?.labels }
780
783
  }
781
784
  ),
782
785
  U ? /* @__PURE__ */ i.jsx(
783
- _e,
786
+ Ge,
784
787
  {
785
788
  values: $.filter((a) => a !== 0),
786
789
  y: $.filter((a) => a !== 0).map((a) => k(a)),
787
790
  x1: 0 - b,
788
- x2: m + u.right,
791
+ x2: h + x.right,
789
792
  styles: {
790
- gridLines: d?.yAxis?.gridLines,
791
- labels: d?.yAxis?.labels
793
+ gridLines: m?.yAxis?.gridLines,
794
+ labels: m?.yAxis?.labels
792
795
  },
793
796
  classNames: {
794
- gridLines: h?.yAxis?.gridLines,
795
- labels: h?.yAxis?.labels
797
+ gridLines: u?.yAxis?.gridLines,
798
+ labels: u?.yAxis?.labels
796
799
  },
797
800
  suffix: ae,
798
801
  prefix: X,
799
802
  labelType: "secondary",
800
803
  showGridLines: !0,
801
804
  labelPos: "vertical",
802
- precision: s
805
+ precision: c
803
806
  }
804
807
  ) : null,
805
808
  /* @__PURE__ */ i.jsx(
806
- Ee,
809
+ _e,
807
810
  {
808
811
  x: 0 - b - 15,
809
812
  y: Y / 2,
810
- style: d?.yAxis?.title,
811
- className: h?.yAxis?.title,
813
+ style: m?.yAxis?.title,
814
+ className: u?.yAxis?.title,
812
815
  text: _,
813
816
  rotate90: !0
814
817
  }
815
818
  ),
816
819
  N.filter((a) => a.position === "before").map((a) => a.layer),
817
- /* @__PURE__ */ i.jsxs(qe, { children: [
820
+ /* @__PURE__ */ i.jsxs(Ue, { children: [
818
821
  P.map((a) => /* @__PURE__ */ i.jsxs(
819
822
  se.g,
820
823
  {
821
824
  className: "undp-viz-g-with-hover",
822
825
  variants: {
823
826
  initial: {
824
- x: g(`${a.id}`) + g.bandwidth() / 2,
827
+ x: p(`${a.id}`) + p.bandwidth() / 2,
825
828
  y: 0,
826
829
  opacity: G.length !== 0 ? G.indexOf(a.label) !== -1 ? 0.85 : z : 0.85
827
830
  },
828
831
  whileInView: {
829
- x: g(`${a.id}`) + g.bandwidth() / 2,
832
+ x: p(`${a.id}`) + p.bandwidth() / 2,
830
833
  y: 0,
831
834
  opacity: G.length !== 0 ? G.indexOf(a.label) !== -1 ? 0.85 : z : 0.85,
832
835
  transition: { duration: f.duration }
@@ -837,15 +840,15 @@ function mt(ye) {
837
840
  exit: { opacity: 0, transition: { duration: f.duration } },
838
841
  children: [
839
842
  D ? /* @__PURE__ */ i.jsx(
840
- st,
843
+ ct,
841
844
  {
842
845
  value: `${a.label}`.length < ce ? `${a.label}` : `${`${a.label}`.substring(0, ce)}...`,
843
846
  y: Y + 5,
844
- x: 0 - g.bandwidth() / 2,
845
- width: g.bandwidth(),
846
- height: u.bottom,
847
- style: d?.xAxis?.labels,
848
- className: h?.xAxis?.labels,
847
+ x: 0 - p.bandwidth() / 2,
848
+ width: p.bandwidth(),
849
+ height: x.bottom,
850
+ style: m?.xAxis?.labels,
851
+ className: u?.xAxis?.labels,
849
852
  alignment: "top",
850
853
  animate: f,
851
854
  isInView: w
@@ -858,12 +861,12 @@ function mt(ye) {
858
861
  x2: 0,
859
862
  style: {
860
863
  strokeWidth: ge,
861
- ...d?.dataConnectors || {},
864
+ ...m?.dataConnectors || {},
862
865
  opacity: I ? 0.3 : 1
863
866
  },
864
867
  className: ke(
865
868
  "stroke-primary-gray-600 dark:stroke-primary-gray-300",
866
- h?.dataConnectors
869
+ u?.dataConnectors
867
870
  ),
868
871
  markerEnd: M && a.x.indexOf(Math.min(...a.x.filter((t) => t !== null))) === 0 ? "url(#arrow)" : "",
869
872
  markerStart: M && a.x.indexOf(Math.min(...a.x.filter((t) => t !== null))) === a.x.length - 1 ? "url(#arrow)" : "",
@@ -886,14 +889,14 @@ function mt(ye) {
886
889
  a.x.map((t, l) => /* @__PURE__ */ i.jsx(
887
890
  se.g,
888
891
  {
889
- onMouseEnter: (p) => {
890
- K({ ...a, xIndex: l }), S(p.clientY), T(p.clientX), B?.({ ...a, xIndex: l });
892
+ onMouseEnter: (o) => {
893
+ K({ ...a, xIndex: l }), S(o.clientY), T(o.clientX), B?.({ ...a, xIndex: l });
891
894
  },
892
895
  onClick: () => {
893
- (W || v) && (We(H, { ...a, xIndex: l }) && pe ? (j(void 0), W?.(void 0)) : (j({ ...a, xIndex: l }), W && W({ ...a, xIndex: l })));
896
+ (W || v) && (He(H, { ...a, xIndex: l }) && pe ? (j(void 0), W?.(void 0)) : (j({ ...a, xIndex: l }), W && W({ ...a, xIndex: l })));
894
897
  },
895
- onMouseMove: (p) => {
896
- K({ ...a, xIndex: l }), S(p.clientY), T(p.clientX);
898
+ onMouseMove: (o) => {
899
+ K({ ...a, xIndex: l }), S(o.clientY), T(o.clientX);
897
900
  },
898
901
  onMouseLeave: () => {
899
902
  K(void 0), T(void 0), S(void 0), B?.(void 0);
@@ -901,10 +904,10 @@ function mt(ye) {
901
904
  exit: { opacity: 0, transition: { duration: f.duration } },
902
905
  variants: {
903
906
  initial: {
904
- opacity: I ? x[l] === I ? 1 : 0.3 : 1
907
+ opacity: I ? g[l] === I ? 1 : 0.3 : 1
905
908
  },
906
909
  whileInView: {
907
- opacity: I ? x[l] === I ? 1 : 0.3 : 1,
910
+ opacity: I ? g[l] === I ? 1 : 0.3 : 1,
908
911
  transition: { duration: f.duration }
909
912
  }
910
913
  },
@@ -917,9 +920,9 @@ function mt(ye) {
917
920
  cx: 0,
918
921
  r: J,
919
922
  style: {
920
- fill: x[l],
923
+ fill: g[l],
921
924
  fillOpacity: 0.85,
922
- stroke: x[l],
925
+ stroke: g[l],
923
926
  strokeWidth: 1
924
927
  },
925
928
  exit: { opacity: 0, transition: { duration: f.duration } },
@@ -940,14 +943,14 @@ function mt(ye) {
940
943
  {
941
944
  x: 0,
942
945
  style: {
943
- fill: ne || x[l],
946
+ fill: ne || g[l],
944
947
  textAnchor: "start",
945
- ...d?.graphObjectValues || {}
948
+ ...m?.graphObjectValues || {}
946
949
  },
947
950
  className: ke(
948
951
  "graph-value text-sm font-bold",
949
952
  F(t) ? "opacity-0" : "opacity-100",
950
- h?.graphObjectValues
953
+ u?.graphObjectValues
951
954
  ),
952
955
  dx: J + 3,
953
956
  dy: "0.33em",
@@ -962,7 +965,7 @@ function mt(ye) {
962
965
  },
963
966
  initial: "initial",
964
967
  animate: w ? "whileInView" : "initial",
965
- children: Le(t, "NA", s, X, ae)
968
+ children: Ae(t, "NA", c, X, ae)
966
969
  }
967
970
  ) : null
968
971
  ] })
@@ -974,13 +977,13 @@ function mt(ye) {
974
977
  a.label
975
978
  )),
976
979
  oe ? /* @__PURE__ */ i.jsx(i.Fragment, { children: oe.map((a, t) => /* @__PURE__ */ i.jsx(
977
- nt,
980
+ ot,
978
981
  {
979
982
  text: a.text,
980
983
  color: a.color,
981
984
  y: k(a.value),
982
985
  x1: 0 - b,
983
- x2: m + u.right,
986
+ x2: h + x.right,
984
987
  classNames: a.classNames,
985
988
  styles: a.styles,
986
989
  animate: f,
@@ -995,18 +998,18 @@ function mt(ye) {
995
998
  }
996
999
  ),
997
1000
  E && n && y && Q ? /* @__PURE__ */ i.jsx(
998
- Xe,
1001
+ Ye,
999
1002
  {
1000
1003
  data: E,
1001
1004
  body: n,
1002
1005
  xPos: y,
1003
1006
  yPos: Q,
1004
- backgroundStyle: d?.tooltip,
1005
- className: h?.tooltip
1007
+ backgroundStyle: m?.tooltip,
1008
+ className: u?.tooltip
1006
1009
  }
1007
1010
  ) : null,
1008
1011
  v && H !== void 0 ? /* @__PURE__ */ i.jsx(
1009
- He,
1012
+ Xe,
1010
1013
  {
1011
1014
  open: H !== void 0,
1012
1015
  onClose: () => {
@@ -1016,7 +1019,7 @@ function mt(ye) {
1016
1019
  "div",
1017
1020
  {
1018
1021
  className: "graph-modal-content m-0",
1019
- dangerouslySetInnerHTML: typeof v == "string" ? { __html: Ye(v, H) } : void 0,
1022
+ dangerouslySetInnerHTML: typeof v == "string" ? { __html: Ee(v, H) } : void 0,
1020
1023
  children: typeof v == "function" ? v(H) : null
1021
1024
  }
1022
1025
  )
@@ -1024,11 +1027,11 @@ function mt(ye) {
1024
1027
  ) : null
1025
1028
  ] });
1026
1029
  }
1027
- function ht(ye) {
1030
+ function ut(ye) {
1028
1031
  const {
1029
- data: o,
1030
- graphTitle: x,
1031
- colors: q = Qe.light.categoricalColors.colors,
1032
+ data: s,
1033
+ graphTitle: g,
1034
+ colors: q = Ze.light.categoricalColors.colors,
1032
1035
  sources: U,
1033
1036
  graphDescription: b,
1034
1037
  barPadding: ce = 0.25,
@@ -1057,19 +1060,19 @@ function ht(ye) {
1057
1060
  minValue: _,
1058
1061
  onSeriesMouseClick: fe,
1059
1062
  graphDownload: ne = !1,
1060
- dataDownload: d = !1,
1061
- showValues: h = !0,
1063
+ dataDownload: m = !1,
1064
+ showValues: u = !0,
1062
1065
  sortParameter: V,
1063
1066
  arrowConnector: oe = !1,
1064
1067
  connectorStrokeWidth: f = 2,
1065
- language: s = "en",
1068
+ language: c = "en",
1066
1069
  minHeight: N = 0,
1067
1070
  theme: G = "light",
1068
1071
  maxBarThickness: z,
1069
1072
  maxNumberOfBars: A,
1070
1073
  minBarThickness: w,
1071
- ariaLabel: u,
1072
- resetSelectionOnDoubleClick: m = !0,
1074
+ ariaLabel: x,
1075
+ resetSelectionOnDoubleClick: h = !0,
1073
1076
  detailsOnClick: Y,
1074
1077
  axisTitle: E,
1075
1078
  noOfTicks: K = 5,
@@ -1082,33 +1085,34 @@ function ht(ye) {
1082
1085
  animate: P = !1,
1083
1086
  precision: R = 2,
1084
1087
  customLayers: k = [],
1085
- showColorScale: g = !0,
1088
+ showColorScale: p = !0,
1086
1089
  highlightedDataPoints: $ = [],
1087
1090
  dimmedOpacity: a = 0.3,
1088
- timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 }
1089
- } = ye, [l, p] = L(0), [he, Me] = L(0), [ue, Ve] = L(t.autoplay), c = Se(
1090
- Be(
1091
- o.filter((e) => e.date !== void 0 && e.date !== null),
1091
+ timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
1092
+ sortData: l
1093
+ } = ye, [o, he] = L(0), [Me, je] = L(0), [ue, Te] = L(t.autoplay), d = Pe(
1094
+ We(
1095
+ s.filter((e) => e.date !== void 0 && e.date !== null),
1092
1096
  (e) => e.date
1093
- ).map((e) => Ae(`${e.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
1094
- (e, r) => it(e, r)
1095
- ), [be, ve] = L(t.autoplay ? 0 : c.length - 1), [Te, $e] = L(void 0), xe = Ce(null), je = Ce(null);
1096
- Ne(() => {
1097
+ ).map((e) => Se(`${e.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
1098
+ (e, r) => at(e, r)
1099
+ ), [be, ve] = L(t.autoplay ? 0 : d.length - 1), [$e, Le] = L(void 0), xe = Ce(null), Oe = Ce(null);
1100
+ De(() => {
1097
1101
  const e = new ResizeObserver((r) => {
1098
- p(n || r[0].target.clientWidth || 620), Me(D || r[0].target.clientHeight || 480);
1102
+ he(n || r[0].target.clientWidth || 620), je(D || r[0].target.clientHeight || 480);
1099
1103
  });
1100
- return xe.current && (Me(xe.current.clientHeight || 480), p(xe.current.clientWidth || 620), n || e.observe(xe.current)), () => e.disconnect();
1101
- }, [n, D]), Ne(() => {
1104
+ return xe.current && (je(xe.current.clientHeight || 480), he(xe.current.clientWidth || 620), n || e.observe(xe.current)), () => e.disconnect();
1105
+ }, [n, D]), De(() => {
1102
1106
  const e = setInterval(
1103
1107
  () => {
1104
- ve((r) => r < c.length - 1 ? r + 1 : 0);
1108
+ ve((r) => r < d.length - 1 ? r + 1 : 0);
1105
1109
  },
1106
1110
  (t.speed || 2) * 1e3
1107
1111
  );
1108
1112
  return ue || clearInterval(e), () => clearInterval(e);
1109
- }, [c, ue, t.speed]);
1110
- const Oe = Pe(
1111
- c,
1113
+ }, [d, ue, t.speed]);
1114
+ const Ne = Fe(
1115
+ d,
1112
1116
  be,
1113
1117
  t.showOnlyActiveDate,
1114
1118
  t.dateFormat || "yyyy"
@@ -1117,12 +1121,12 @@ function ht(ye) {
1117
1121
  "div",
1118
1122
  {
1119
1123
  className: `${G || "light"} flex ${n ? "w-fit grow-0" : "w-full grow"}`,
1120
- dir: s === "he" || s === "ar" ? "rtl" : void 0,
1124
+ dir: c === "he" || c === "ar" ? "rtl" : void 0,
1121
1125
  children: /* @__PURE__ */ i.jsx(
1122
1126
  "div",
1123
1127
  {
1124
1128
  className: ke(
1125
- `${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${s || "en"}`,
1129
+ `${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c || "en"}`,
1126
1130
  y?.graphContainer
1127
1131
  ),
1128
1132
  style: {
@@ -1130,16 +1134,16 @@ function ht(ye) {
1130
1134
  ...C && C !== !0 ? { backgroundColor: C } : {}
1131
1135
  },
1132
1136
  id: re,
1133
- ref: je,
1134
- "aria-label": u || `${x ? `The graph shows ${x}. ` : ""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${b ? ` ${b}` : ""}`,
1137
+ ref: Oe,
1138
+ "aria-label": x || `${g ? `The graph shows ${g}. ` : ""}This is a dumbbell chart that shows comparisons between two or more data points across categories. ${b ? ` ${b}` : ""}`,
1135
1139
  children: /* @__PURE__ */ i.jsx(
1136
1140
  "div",
1137
1141
  {
1138
1142
  className: "flex grow",
1139
1143
  style: { padding: C ? W || "1rem" : W || 0 },
1140
1144
  children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
1141
- x || b || ne || d ? /* @__PURE__ */ i.jsx(
1142
- Ue,
1145
+ g || b || ne || m ? /* @__PURE__ */ i.jsx(
1146
+ Je,
1143
1147
  {
1144
1148
  styles: {
1145
1149
  title: j?.title,
@@ -1149,54 +1153,54 @@ function ht(ye) {
1149
1153
  title: y?.title,
1150
1154
  description: y?.description
1151
1155
  },
1152
- graphTitle: x,
1156
+ graphTitle: g,
1153
1157
  graphDescription: b,
1154
1158
  width: n,
1155
- graphDownload: ne ? je.current : void 0,
1156
- dataDownload: d ? o.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? o.map((e) => e.data).filter((e) => e !== void 0) : o.filter((e) => e !== void 0) : null
1159
+ graphDownload: ne ? Oe.current : void 0,
1160
+ dataDownload: m ? s.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? s.map((e) => e.data).filter((e) => e !== void 0) : s.filter((e) => e !== void 0) : null
1157
1161
  }
1158
1162
  ) : null,
1159
- t.enabled && c.length > 0 && Oe ? /* @__PURE__ */ i.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
1163
+ t.enabled && d.length > 0 && Ne ? /* @__PURE__ */ i.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
1160
1164
  /* @__PURE__ */ i.jsx(
1161
1165
  "button",
1162
1166
  {
1163
1167
  type: "button",
1164
1168
  onClick: () => {
1165
- Ve(!ue);
1169
+ Te(!ue);
1166
1170
  },
1167
1171
  className: "p-0 border-0 cursor-pointer bg-transparent",
1168
1172
  "aria-label": ue ? "Click to pause animation" : "Click to play animation",
1169
- children: ue ? /* @__PURE__ */ i.jsx(et, {}) : /* @__PURE__ */ i.jsx(tt, {})
1173
+ children: ue ? /* @__PURE__ */ i.jsx(tt, {}) : /* @__PURE__ */ i.jsx(it, {})
1170
1174
  }
1171
1175
  ),
1172
1176
  /* @__PURE__ */ i.jsx(
1173
- Fe,
1177
+ Be,
1174
1178
  {
1175
- min: c[0],
1176
- max: c[c.length - 1],
1177
- marks: Oe,
1179
+ min: d[0],
1180
+ max: d[d.length - 1],
1181
+ marks: Ne,
1178
1182
  step: null,
1179
- defaultValue: c[c.length - 1],
1180
- value: c[be],
1183
+ defaultValue: d[d.length - 1],
1184
+ value: d[be],
1181
1185
  onChangeComplete: (e) => {
1182
- ve(c.indexOf(e));
1186
+ ve(d.indexOf(e));
1183
1187
  },
1184
1188
  onChange: (e) => {
1185
- ve(c.indexOf(e));
1189
+ ve(d.indexOf(e));
1186
1190
  },
1187
1191
  "aria-label": "Time slider. Use arrow keys to adjust selected time period."
1188
1192
  }
1189
1193
  )
1190
1194
  ] }) : null,
1191
- /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ i.jsx(Ze, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1192
- g ? /* @__PURE__ */ i.jsx(
1193
- Ke,
1195
+ /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: s.length === 0 ? /* @__PURE__ */ i.jsx(et, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1196
+ p ? /* @__PURE__ */ i.jsx(
1197
+ Qe,
1194
1198
  {
1195
1199
  width: n,
1196
1200
  colorDomain: me,
1197
1201
  colors: q,
1198
1202
  colorLegendTitle: O,
1199
- setSelectedColor: $e,
1203
+ setSelectedColor: Le,
1200
1204
  showNAColor: !1
1201
1205
  }
1202
1206
  ) : null,
@@ -1206,40 +1210,42 @@ function ht(ye) {
1206
1210
  className: "flex grow w-full justify-center leading-0",
1207
1211
  ref: xe,
1208
1212
  "aria-label": "Graph area",
1209
- children: (n || l) && (D || he) ? /* @__PURE__ */ i.jsx(
1210
- mt,
1213
+ children: (n || o) && (D || Me) ? /* @__PURE__ */ i.jsx(
1214
+ ht,
1211
1215
  {
1212
- data: V !== void 0 ? V === "diff" ? De(
1216
+ data: V !== void 0 ? V === "diff" ? Ve(
1213
1217
  we(
1214
- o,
1218
+ s,
1215
1219
  t.dateFormat || "yyyy"
1216
1220
  ).filter(
1217
1221
  (e) => t.enabled ? e.date === Ie(
1218
- new Date(c[be]),
1222
+ new Date(d[be]),
1219
1223
  t.dateFormat || "yyyy"
1220
1224
  ) : e
1221
1225
  ).filter((e) => S ? !e.x.every((r) => r == null) : e),
1222
- (e) => F(e.x[e.x.length - 1]) || F(e.x[0]) ? -1 / 0 : e.x[e.x.length - 1] - e.x[0]
1223
- ).filter((e, r) => A ? r < A : !0) : De(
1226
+ (e) => F(e.x[e.x.length - 1]) || F(e.x[0]) ? -1 / 0 : e.x[e.x.length - 1] - e.x[0],
1227
+ [l || "asc"]
1228
+ ).filter((e, r) => A ? r < A : !0) : Ve(
1224
1229
  we(
1225
- o,
1230
+ s,
1226
1231
  t.dateFormat || "yyyy"
1227
1232
  ).filter(
1228
1233
  (e) => t.enabled ? e.date === Ie(
1229
- new Date(c[be]),
1234
+ new Date(d[be]),
1230
1235
  t.dateFormat || "yyyy"
1231
1236
  ) : e
1232
1237
  ).filter((e) => S ? !e.x.every((r) => r == null) : e),
1233
- (e) => F(e.x[V]) ? -1 / 0 : e.x[V]
1238
+ (e) => F(e.x[V]) ? -1 / 0 : e.x[V],
1239
+ [l || "asc"]
1234
1240
  ).filter((e, r) => A ? r < A : !0) : we(
1235
- o,
1241
+ s,
1236
1242
  t.dateFormat || "yyyy"
1237
1243
  ).filter((e) => S ? !e.x.every((r) => r == null) : e).filter((e, r) => A ? r < A : !0),
1238
1244
  dotColors: q,
1239
- width: n || l,
1245
+ width: n || o,
1240
1246
  height: Math.max(
1241
1247
  N,
1242
- D || (M ? N ? (n || l) * M > N ? (n || l) * M : N : (n || l) * M : he)
1248
+ D || (M ? N ? (n || o) * M > N ? (n || o) * M : N : (n || o) * M : Me)
1243
1249
  ),
1244
1250
  radius: ae,
1245
1251
  barPadding: ce,
@@ -1250,28 +1256,28 @@ function ht(ye) {
1250
1256
  bottomMargin: ie,
1251
1257
  truncateBy: J,
1252
1258
  showLabels: I,
1253
- showValues: h,
1259
+ showValues: u,
1254
1260
  tooltip: X,
1255
1261
  suffix: le,
1256
1262
  prefix: pe,
1257
1263
  onSeriesMouseOver: ge,
1258
1264
  maxValue: F(v) ? Math.max(
1259
- ...o.map((e) => Math.max(...e.x.filter((r) => r !== null)))
1265
+ ...s.map((e) => Math.max(...e.x.filter((r) => r !== null)))
1260
1266
  ) < 0 ? 0 : Math.max(
1261
- ...o.map((e) => Math.max(...e.x.filter((r) => r !== null)))
1267
+ ...s.map((e) => Math.max(...e.x.filter((r) => r !== null)))
1262
1268
  ) : v,
1263
1269
  minValue: F(_) ? Math.min(
1264
- ...o.map((e) => Math.min(...e.x.filter((r) => r !== null)))
1270
+ ...s.map((e) => Math.min(...e.x.filter((r) => r !== null)))
1265
1271
  ) > 0 ? 0 : Math.min(
1266
- ...o.map((e) => Math.min(...e.x.filter((r) => r !== null)))
1272
+ ...s.map((e) => Math.min(...e.x.filter((r) => r !== null)))
1267
1273
  ) : _,
1268
1274
  onSeriesMouseClick: fe,
1269
- selectedColor: Te,
1275
+ selectedColor: $e,
1270
1276
  arrowConnector: oe,
1271
1277
  connectorStrokeWidth: f,
1272
1278
  maxBarThickness: z,
1273
1279
  minBarThickness: w,
1274
- resetSelectionOnDoubleClick: m,
1280
+ resetSelectionOnDoubleClick: h,
1275
1281
  detailsOnClick: Y,
1276
1282
  axisTitle: E,
1277
1283
  noOfTicks: K,
@@ -1291,7 +1297,7 @@ function ht(ye) {
1291
1297
  )
1292
1298
  ] }) }),
1293
1299
  U || B ? /* @__PURE__ */ i.jsx(
1294
- Je,
1300
+ Ke,
1295
1301
  {
1296
1302
  styles: { footnote: j?.footnote, source: j?.source },
1297
1303
  classNames: {
@@ -1311,10 +1317,10 @@ function ht(ye) {
1311
1317
  }
1312
1318
  );
1313
1319
  }
1314
- function Gt(ye) {
1320
+ function zt(ye) {
1315
1321
  const {
1316
- data: o,
1317
- graphTitle: x,
1322
+ data: s,
1323
+ graphTitle: g,
1318
1324
  colors: q,
1319
1325
  sources: U,
1320
1326
  graphDescription: b,
@@ -1344,19 +1350,19 @@ function Gt(ye) {
1344
1350
  minValue: _,
1345
1351
  onSeriesMouseClick: fe,
1346
1352
  graphDownload: ne,
1347
- dataDownload: d,
1348
- showValues: h,
1353
+ dataDownload: m,
1354
+ showValues: u,
1349
1355
  sortParameter: V,
1350
1356
  arrowConnector: oe,
1351
1357
  connectorStrokeWidth: f,
1352
- language: s,
1358
+ language: c,
1353
1359
  minHeight: N,
1354
1360
  theme: G,
1355
1361
  maxBarThickness: z,
1356
1362
  maxNumberOfBars: A,
1357
1363
  minBarThickness: w,
1358
- ariaLabel: u,
1359
- resetSelectionOnDoubleClick: m,
1364
+ ariaLabel: x,
1365
+ resetSelectionOnDoubleClick: h,
1360
1366
  detailsOnClick: Y,
1361
1367
  axisTitle: E,
1362
1368
  noOfTicks: K,
@@ -1369,17 +1375,18 @@ function Gt(ye) {
1369
1375
  filterNA: P,
1370
1376
  animate: R,
1371
1377
  precision: k,
1372
- showColorScale: g,
1378
+ showColorScale: p,
1373
1379
  customLayers: $,
1374
1380
  highlightedDataPoints: a,
1375
1381
  dimmedOpacity: t,
1376
- timeline: l
1382
+ timeline: l,
1383
+ sortData: o
1377
1384
  } = ye;
1378
1385
  return j === "vertical" ? /* @__PURE__ */ i.jsx(
1379
- ht,
1386
+ ut,
1380
1387
  {
1381
- data: o,
1382
- graphTitle: x,
1388
+ data: s,
1389
+ graphTitle: g,
1383
1390
  colors: q,
1384
1391
  sources: U,
1385
1392
  graphDescription: b,
@@ -1409,19 +1416,19 @@ function Gt(ye) {
1409
1416
  minValue: _,
1410
1417
  onSeriesMouseClick: fe,
1411
1418
  graphDownload: ne,
1412
- dataDownload: d,
1413
- showValues: h,
1419
+ dataDownload: m,
1420
+ showValues: u,
1414
1421
  sortParameter: V,
1415
1422
  arrowConnector: oe,
1416
1423
  connectorStrokeWidth: f,
1417
- language: s,
1424
+ language: c,
1418
1425
  minHeight: N,
1419
1426
  theme: G,
1420
1427
  maxBarThickness: z,
1421
1428
  maxNumberOfBars: A,
1422
1429
  minBarThickness: w,
1423
- ariaLabel: u,
1424
- resetSelectionOnDoubleClick: m,
1430
+ ariaLabel: x,
1431
+ resetSelectionOnDoubleClick: h,
1425
1432
  styles: y,
1426
1433
  detailsOnClick: Y,
1427
1434
  axisTitle: E,
@@ -1433,17 +1440,18 @@ function Gt(ye) {
1433
1440
  filterNA: P,
1434
1441
  animate: R,
1435
1442
  precision: k,
1436
- showColorScale: g,
1443
+ showColorScale: p,
1437
1444
  customLayers: $,
1438
1445
  highlightedDataPoints: a,
1439
1446
  dimmedOpacity: t,
1440
- timeline: l
1447
+ timeline: l,
1448
+ sortData: o
1441
1449
  }
1442
1450
  ) : /* @__PURE__ */ i.jsx(
1443
- dt,
1451
+ mt,
1444
1452
  {
1445
- data: o,
1446
- graphTitle: x,
1453
+ data: s,
1454
+ graphTitle: g,
1447
1455
  colors: q,
1448
1456
  sources: U,
1449
1457
  graphDescription: b,
@@ -1473,19 +1481,19 @@ function Gt(ye) {
1473
1481
  minValue: _,
1474
1482
  onSeriesMouseClick: fe,
1475
1483
  graphDownload: ne,
1476
- dataDownload: d,
1477
- showValues: h,
1484
+ dataDownload: m,
1485
+ showValues: u,
1478
1486
  sortParameter: V,
1479
1487
  arrowConnector: oe,
1480
1488
  connectorStrokeWidth: f,
1481
- language: s,
1489
+ language: c,
1482
1490
  minHeight: N,
1483
1491
  theme: G,
1484
1492
  maxBarThickness: z,
1485
1493
  maxNumberOfBars: A,
1486
1494
  minBarThickness: w,
1487
- ariaLabel: u,
1488
- resetSelectionOnDoubleClick: m,
1495
+ ariaLabel: x,
1496
+ resetSelectionOnDoubleClick: h,
1489
1497
  styles: y,
1490
1498
  detailsOnClick: Y,
1491
1499
  axisTitle: E,
@@ -1497,15 +1505,16 @@ function Gt(ye) {
1497
1505
  filterNA: P,
1498
1506
  animate: R,
1499
1507
  precision: k,
1500
- showColorScale: g,
1508
+ showColorScale: p,
1501
1509
  customLayers: $,
1502
1510
  highlightedDataPoints: a,
1503
1511
  dimmedOpacity: t,
1504
- timeline: l
1512
+ timeline: l,
1513
+ sortData: o
1505
1514
  }
1506
1515
  );
1507
1516
  }
1508
1517
  export {
1509
- Gt as DumbbellChart
1518
+ zt as DumbbellChart
1510
1519
  };
1511
1520
  //# sourceMappingURL=DumbbellChart.js.map