@undp/data-viz 1.5.6 → 1.5.8

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 (88) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +650 -648
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BulletChart.cjs +1 -1
  6. package/dist/BulletChart.cjs.map +1 -1
  7. package/dist/BulletChart.js +210 -208
  8. package/dist/BulletChart.js.map +1 -1
  9. package/dist/ButterflyChart.cjs +1 -1
  10. package/dist/ButterflyChart.cjs.map +1 -1
  11. package/dist/ButterflyChart.js +42 -40
  12. package/dist/ButterflyChart.js.map +1 -1
  13. package/dist/DifferenceLineChart.cjs +1 -1
  14. package/dist/DifferenceLineChart.cjs.map +1 -1
  15. package/dist/DifferenceLineChart.js +122 -120
  16. package/dist/DifferenceLineChart.js.map +1 -1
  17. package/dist/DualAxisLineChart.cjs +1 -1
  18. package/dist/DualAxisLineChart.cjs.map +1 -1
  19. package/dist/DualAxisLineChart.js +133 -113
  20. package/dist/DualAxisLineChart.js.map +1 -1
  21. package/dist/DumbbellChart.cjs +1 -1
  22. package/dist/DumbbellChart.cjs.map +1 -1
  23. package/dist/DumbbellChart.js +274 -274
  24. package/dist/DumbbellChart.js.map +1 -1
  25. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  26. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  27. package/dist/LineChartWithConfidenceInterval.js +194 -174
  28. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  29. package/dist/MultiLineAltChart.cjs +1 -1
  30. package/dist/MultiLineAltChart.cjs.map +1 -1
  31. package/dist/MultiLineAltChart.js +160 -161
  32. package/dist/MultiLineAltChart.js.map +1 -1
  33. package/dist/MultiLineChart.cjs +1 -1
  34. package/dist/MultiLineChart.cjs.map +1 -1
  35. package/dist/MultiLineChart.js +77 -66
  36. package/dist/MultiLineChart.js.map +1 -1
  37. package/dist/ParetoChart.cjs +1 -1
  38. package/dist/ParetoChart.cjs.map +1 -1
  39. package/dist/ParetoChart.js +166 -161
  40. package/dist/ParetoChart.js.map +1 -1
  41. package/dist/RadarChart.cjs +1 -1
  42. package/dist/RadarChart.cjs.map +1 -1
  43. package/dist/RadarChart.js +253 -241
  44. package/dist/RadarChart.js.map +1 -1
  45. package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-C2--oMQq.js} +10 -9
  46. package/dist/RegressionLine-C2--oMQq.js.map +1 -0
  47. package/dist/RegressionLine-Dj0GSiAp.cjs +2 -0
  48. package/dist/RegressionLine-Dj0GSiAp.cjs.map +1 -0
  49. package/dist/ScatterPlot.cjs +1 -1
  50. package/dist/ScatterPlot.cjs.map +1 -1
  51. package/dist/ScatterPlot.js +130 -129
  52. package/dist/ScatterPlot.js.map +1 -1
  53. package/dist/SimpleLineChart.cjs +1 -1
  54. package/dist/SimpleLineChart.cjs.map +1 -1
  55. package/dist/SimpleLineChart.js +43 -38
  56. package/dist/SimpleLineChart.js.map +1 -1
  57. package/dist/SlopeChart.cjs +1 -1
  58. package/dist/SlopeChart.cjs.map +1 -1
  59. package/dist/SlopeChart.js +113 -109
  60. package/dist/SlopeChart.js.map +1 -1
  61. package/dist/StripChart.cjs +1 -1
  62. package/dist/StripChart.cjs.map +1 -1
  63. package/dist/StripChart.js +282 -270
  64. package/dist/StripChart.js.map +1 -1
  65. package/dist/ThreeDGlobe.cjs +1 -1
  66. package/dist/ThreeDGlobe.cjs.map +1 -1
  67. package/dist/ThreeDGlobe.js +284 -349
  68. package/dist/ThreeDGlobe.js.map +1 -1
  69. package/dist/UnitChart.cjs +1 -1
  70. package/dist/UnitChart.cjs.map +1 -1
  71. package/dist/UnitChart.js +20 -21
  72. package/dist/UnitChart.js.map +1 -1
  73. package/dist/getCentroidCoordinates-Dfk6IqEG.js +70 -0
  74. package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -0
  75. package/dist/getCentroidCoordinates-DxTBqzp2.cjs +2 -0
  76. package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -0
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.d.ts +7 -0
  79. package/dist/index.js +34 -32
  80. package/dist/index.js.map +1 -1
  81. package/dist/utils.cjs +1 -1
  82. package/dist/utils.d.ts +8 -0
  83. package/dist/utils.js +16 -14
  84. package/dist/utils.js.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
  87. package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
  88. package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { j as e, m as G } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as ut, useState as W, useEffect as Dt } from "react";
3
- import { p as d, f as Ht } from "./parse-DlCRUFh_.js";
3
+ import { p as u, f as Ht } from "./parse-DlCRUFh_.js";
4
4
  import { o as Rt } from "./index-DvVprvy6.js";
5
5
  import { n as Ct } from "./numberFormattingFunction-14YCbkN2.js";
6
6
  import { T as Ft } from "./Tooltip-CVCGWyzw.js";
@@ -21,7 +21,7 @@ import { s as ei } from "./select-DKy99ogv.js";
21
21
  import { a as ai } from "./init-BhZylTFx.js";
22
22
  import { p as ni } from "./pointer-CWRWOsrb.js";
23
23
  import { u as oi } from "./use-in-view-yS6jzJAp.js";
24
- import { m as f } from "./proxy-CkpFesk1.js";
24
+ import { m as g } from "./proxy-CkpFesk1.js";
25
25
  import { GraphFooter as ri } from "./GraphFooter.js";
26
26
  import { GraphHeader as si } from "./GraphHeader.js";
27
27
  import { ColorLegend as li } from "./ColorLegend.js";
@@ -33,11 +33,11 @@ function hi(pt) {
33
33
  data: N,
34
34
  width: D,
35
35
  height: Y,
36
- lineColors: g,
36
+ lineColors: l,
37
37
  suffix: L,
38
38
  prefix: w,
39
39
  dateFormat: r,
40
- showValues: l,
40
+ showValues: c,
41
41
  noOfXTicks: J,
42
42
  rightMargin: ft,
43
43
  leftMargin: j,
@@ -64,16 +64,16 @@ function hi(pt) {
64
64
  minDate: et,
65
65
  maxDate: at,
66
66
  curveType: F,
67
- styles: x,
68
- classNames: y,
67
+ styles: y,
68
+ classNames: d,
69
69
  precision: T,
70
70
  customLayers: nt
71
71
  } = pt, ot = ut(null), s = oi(ot, {
72
72
  once: a.once,
73
73
  amount: a.amount
74
- }), [c, vt] = W(!1);
74
+ }), [m, vt] = W(!1);
75
75
  Dt(() => {
76
- if (s && !c) {
76
+ if (s && !m) {
77
77
  const t = setTimeout(
78
78
  () => {
79
79
  vt(!0);
@@ -82,8 +82,8 @@ function hi(pt) {
82
82
  );
83
83
  return () => clearTimeout(t);
84
84
  }
85
- }, [s, c, a.duration]);
86
- const M = F === "linear" ? Qt : F === "step" ? Zt : F === "stepAfter" ? _t : F === "stepBefore" ? ti : ii, [S, rt] = W(void 0), [st, lt] = W(void 0), [A, C] = W(void 0), u = {
85
+ }, [s, m, a.duration]);
86
+ const M = F === "linear" ? Qt : F === "step" ? Zt : F === "stepAfter" ? _t : F === "stepBefore" ? ti : ii, [S, rt] = W(void 0), [st, lt] = W(void 0), [A, C] = W(void 0), p = {
87
87
  top: gt,
88
88
  bottom: K,
89
89
  left: U ? j + 30 : j,
@@ -91,25 +91,25 @@ function hi(pt) {
91
91
  }, ct = ut(null), i = Rt(
92
92
  N.map((t) => ({
93
93
  ...t,
94
- date: d(`${t.date}`, r, /* @__PURE__ */ new Date())
94
+ date: u(`${t.date}`, r, /* @__PURE__ */ new Date())
95
95
  })),
96
96
  ["date"],
97
97
  ["asc"]
98
98
  ), mt = V.map((t) => ({
99
99
  ...t,
100
100
  coordinates: [
101
- t.coordinates[0] === null ? null : d(`${t.coordinates[0]}`, r, /* @__PURE__ */ new Date()),
102
- t.coordinates[1] === null ? null : d(`${t.coordinates[1]}`, r, /* @__PURE__ */ new Date())
101
+ t.coordinates[0] === null ? null : u(`${t.coordinates[0]}`, r, /* @__PURE__ */ new Date()),
102
+ t.coordinates[1] === null ? null : u(`${t.coordinates[1]}`, r, /* @__PURE__ */ new Date())
103
103
  ]
104
104
  })), ht = R.map((t) => ({
105
105
  ...t,
106
106
  coordinates: t.coordinates.map(
107
- (v, $) => $ % 2 === 0 ? d(`${v}`, r, /* @__PURE__ */ new Date()) : v
107
+ (v, $) => $ % 2 === 0 ? u(`${v}`, r, /* @__PURE__ */ new Date()) : v
108
108
  )
109
- })), m = D - u.left - u.right, p = Y - u.top - u.bottom, xt = et ? d(`${et}`, r, /* @__PURE__ */ new Date()) : i[0].date, h = at ? d(`${at}`, r, /* @__PURE__ */ new Date()) : i[i.length - 1].date, q = Math.min(...i.map((t) => t.y1)) !== 1 / 0 ? Math.min(...i.map((t) => t.y1)) > 0 ? 0 : Math.min(...i.map((t) => t.y1)) : 0, Vt = Math.min(...i.map((t) => t.y2)) !== 1 / 0 ? Math.min(...i.map((t) => t.y2)) > 0 ? 0 : Math.min(...i.map((t) => t.y2)) : 0, $t = Math.max(...i.map((t) => t.y1)) !== 1 / 0 ? Math.max(...i.map((t) => t.y1)) : 0, Nt = Math.max(...i.map((t) => t.y2)) !== 1 / 0 ? Math.max(...i.map((t) => t.y2)) : 0, O = P(I) ? q < Vt ? q : Vt : I, jt = $t > Nt ? $t : Nt, n = Jt().domain([xt, h]).range([0, m]), o = Kt().domain([
109
+ })), h = D - p.left - p.right, f = Y - p.top - p.bottom, xt = et ? u(`${et}`, r, /* @__PURE__ */ new Date()) : i[0].date, x = at ? u(`${at}`, r, /* @__PURE__ */ new Date()) : i[i.length - 1].date, q = Math.min(...i.map((t) => t.y1)) !== 1 / 0 ? Math.min(...i.map((t) => t.y1)) > 0 ? 0 : Math.min(...i.map((t) => t.y1)) : 0, Vt = Math.min(...i.map((t) => t.y2)) !== 1 / 0 ? Math.min(...i.map((t) => t.y2)) > 0 ? 0 : Math.min(...i.map((t) => t.y2)) : 0, $t = Math.max(...i.map((t) => t.y1)) !== 1 / 0 ? Math.max(...i.map((t) => t.y1)) : 0, Nt = Math.max(...i.map((t) => t.y2)) !== 1 / 0 ? Math.max(...i.map((t) => t.y2)) : 0, O = P(I) ? q < Vt ? q : Vt : I, jt = $t > Nt ? $t : Nt, n = Jt().domain([xt, x]).range([0, h]), o = Kt().domain([
110
110
  P(I) ? O : I,
111
111
  P(z) ? jt > 0 ? jt : 0 : z
112
- ]).range([p, 0]).nice(), bt = Mt().x((t) => n(t.date)).y((t) => o(t.y1)).curve(M), Lt = Mt().x((t) => n(t.date)).y((t) => o(t.y2)).curve(M), It = Ot().x((t) => n(t.date)).y1((t) => o(t.y1)).y0((t) => o(t.y2)).curve(M), St = Ot().x((t) => n(t.date)).y1((t) => o(t.y1)).y0(0).curve(M), Pt = Ot().x((t) => n(t.date)).y1((t) => o(t.y2)).y0(0).curve(M), kt = o.ticks(it), Tt = n.ticks(J);
112
+ ]).range([f, 0]).nice(), bt = Mt().x((t) => n(t.date)).y((t) => o(t.y1)).curve(M), Lt = Mt().x((t) => n(t.date)).y((t) => o(t.y2)).curve(M), It = Ot().x((t) => n(t.date)).y1((t) => o(t.y1)).y0((t) => o(t.y2)).curve(M), St = Ot().x((t) => n(t.date)).y1((t) => o(t.y1)).y0(0).curve(M), Pt = Ot().x((t) => n(t.date)).y1((t) => o(t.y2)).y0(0).curve(M), kt = o.ticks(it), Tt = n.ticks(J);
113
113
  return Dt(() => {
114
114
  const t = ($) => {
115
115
  const yt = i[ai(
@@ -124,14 +124,14 @@ function hi(pt) {
124
124
  ei(ct.current).on("mousemove", t).on("mouseout", v);
125
125
  }, [n, i, E]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
126
126
  /* @__PURE__ */ e.jsx(
127
- f.svg,
127
+ g.svg,
128
128
  {
129
129
  width: `${D}px`,
130
130
  height: `${Y}px`,
131
131
  viewBox: `0 0 ${D} ${Y}`,
132
132
  direction: "ltr",
133
133
  ref: ot,
134
- children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${u.left},${u.top})`, children: [
134
+ children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${p.left},${p.top})`, children: [
135
135
  /* @__PURE__ */ e.jsx("clipPath", { id: `above${b}`, children: /* @__PURE__ */ e.jsx(
136
136
  "path",
137
137
  {
@@ -150,8 +150,8 @@ function hi(pt) {
150
150
  qt,
151
151
  {
152
152
  areaSettings: mt,
153
- width: m,
154
- height: p,
153
+ width: h,
154
+ height: f,
155
155
  scale: n,
156
156
  animate: a,
157
157
  isInView: s
@@ -174,15 +174,15 @@ function hi(pt) {
174
174
  values: kt.filter((t) => t !== 0),
175
175
  y: kt.filter((t) => t !== 0).map((t) => o(t)),
176
176
  x1: 0 - j,
177
- x2: m + u.right,
177
+ x2: h + p.right,
178
178
  styles: {
179
- gridLines: x?.yAxis?.gridLines,
180
- labels: x?.yAxis?.labels
181
- },
182
- classNames: {
183
179
  gridLines: y?.yAxis?.gridLines,
184
180
  labels: y?.yAxis?.labels
185
181
  },
182
+ classNames: {
183
+ gridLines: d?.yAxis?.gridLines,
184
+ labels: d?.yAxis?.labels
185
+ },
186
186
  suffix: L,
187
187
  prefix: w,
188
188
  labelType: "secondary",
@@ -197,7 +197,7 @@ function hi(pt) {
197
197
  y1: o(O < 0 ? 0 : O),
198
198
  y2: o(O < 0 ? 0 : O),
199
199
  x1: 0 - j,
200
- x2: m + u.right,
200
+ x2: h + p.right,
201
201
  label: Ct(
202
202
  O < 0 ? 0 : O,
203
203
  "NA",
@@ -212,12 +212,12 @@ function hi(pt) {
212
212
  dy: jt < 0 ? "1rem" : -5
213
213
  },
214
214
  classNames: {
215
- axis: y?.xAxis?.axis,
216
- label: y?.yAxis?.labels
215
+ axis: d?.xAxis?.axis,
216
+ label: d?.yAxis?.labels
217
217
  },
218
218
  styles: {
219
- axis: x?.xAxis?.axis,
220
- label: x?.yAxis?.labels
219
+ axis: y?.xAxis?.axis,
220
+ label: y?.yAxis?.labels
221
221
  }
222
222
  }
223
223
  ),
@@ -225,9 +225,9 @@ function hi(pt) {
225
225
  Xt,
226
226
  {
227
227
  x: 0 - j - 15,
228
- y: p / 2,
229
- style: x?.yAxis?.title,
230
- className: y?.yAxis?.title,
228
+ y: f / 2,
229
+ style: y?.yAxis?.title,
230
+ className: d?.yAxis?.title,
231
231
  text: U,
232
232
  rotate90: !0
233
233
  }
@@ -239,16 +239,16 @@ function hi(pt) {
239
239
  values: Tt.map((t) => Ht(t, r)),
240
240
  x: Tt.map((t) => n(t)),
241
241
  y1: 0,
242
- y2: p,
242
+ y2: f,
243
243
  styles: {
244
- gridLines: x?.xAxis?.gridLines,
245
- labels: x?.xAxis?.labels
244
+ gridLines: y?.xAxis?.gridLines,
245
+ labels: y?.xAxis?.labels
246
246
  },
247
247
  classNames: {
248
- gridLines: G("opacity-0", y?.xAxis?.gridLines),
248
+ gridLines: G("opacity-0", d?.xAxis?.gridLines),
249
249
  labels: G(
250
250
  "fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",
251
- y?.xAxis?.labels
251
+ d?.xAxis?.labels
252
252
  )
253
253
  },
254
254
  suffix: L,
@@ -261,7 +261,7 @@ function hi(pt) {
261
261
  nt.filter((t) => t.position === "before").map((t) => t.layer),
262
262
  /* @__PURE__ */ e.jsxs("g", { children: [
263
263
  /* @__PURE__ */ e.jsx(
264
- f.path,
264
+ g.path,
265
265
  {
266
266
  clipPath: `url(#below${b})`,
267
267
  d: It(i) || "",
@@ -276,7 +276,7 @@ function hi(pt) {
276
276
  }
277
277
  ),
278
278
  /* @__PURE__ */ e.jsx(
279
- f.path,
279
+ g.path,
280
280
  {
281
281
  clipPath: `url(#above${b})`,
282
282
  d: It(i) || "",
@@ -293,12 +293,12 @@ function hi(pt) {
293
293
  ] }),
294
294
  /* @__PURE__ */ e.jsxs("g", { children: [
295
295
  /* @__PURE__ */ e.jsx(
296
- f.path,
296
+ g.path,
297
297
  {
298
298
  d: bt(i) || "",
299
299
  style: {
300
300
  fill: "none",
301
- stroke: g[0],
301
+ stroke: l[0],
302
302
  strokeWidth: _
303
303
  },
304
304
  exit: { opacity: 0, transition: { duration: a.duration } },
@@ -316,11 +316,11 @@ function hi(pt) {
316
316
  }
317
317
  ),
318
318
  /* @__PURE__ */ e.jsx(
319
- f.path,
319
+ g.path,
320
320
  {
321
321
  style: {
322
322
  fill: "none",
323
- stroke: g[1],
323
+ stroke: l[1],
324
324
  strokeWidth: _
325
325
  },
326
326
  exit: { opacity: 0, transition: { duration: a.duration } },
@@ -339,9 +339,8 @@ function hi(pt) {
339
339
  ),
340
340
  wt ? null : /* @__PURE__ */ e.jsxs("g", { children: [
341
341
  /* @__PURE__ */ e.jsx(
342
- f.text,
342
+ g.text,
343
343
  {
344
- style: { fill: g[0] },
345
344
  className: "text-xs",
346
345
  dx: 5,
347
346
  dy: 4,
@@ -350,15 +349,17 @@ function hi(pt) {
350
349
  initial: {
351
350
  opacity: 0,
352
351
  x: n(i[i.length - 1].date),
353
- y: o(i[i.length - 1].y1)
352
+ y: o(i[i.length - 1].y1),
353
+ fill: l[0]
354
354
  },
355
355
  whileInView: {
356
356
  opacity: 1,
357
357
  x: n(i[i.length - 1].date),
358
358
  y: o(i[i.length - 1].y1),
359
+ fill: l[0],
359
360
  transition: {
360
- duration: c ? a.duration : 0.5,
361
- delay: c ? 0 : a.duration
361
+ duration: m ? a.duration : 0.5,
362
+ delay: m ? 0 : a.duration
362
363
  }
363
364
  }
364
365
  },
@@ -369,9 +370,8 @@ function hi(pt) {
369
370
  H[0]
370
371
  ),
371
372
  /* @__PURE__ */ e.jsx(
372
- f.text,
373
+ g.text,
373
374
  {
374
- style: { fill: g[1] },
375
375
  className: "text-xs",
376
376
  dx: 5,
377
377
  dy: 4,
@@ -380,15 +380,17 @@ function hi(pt) {
380
380
  initial: {
381
381
  opacity: 0,
382
382
  x: n(i[i.length - 1].date),
383
- y: o(i[i.length - 1].y2)
383
+ y: o(i[i.length - 1].y2),
384
+ fill: l[1]
384
385
  },
385
386
  whileInView: {
386
387
  opacity: 1,
387
388
  x: n(i[i.length - 1].date),
388
389
  y: o(i[i.length - 1].y2),
390
+ fill: l[1],
389
391
  transition: {
390
- duration: c ? a.duration : 0.5,
391
- delay: c ? 0 : a.duration
392
+ duration: m ? a.duration : 0.5,
393
+ delay: m ? 0 : a.duration
392
394
  }
393
395
  }
394
396
  },
@@ -403,28 +405,28 @@ function hi(pt) {
403
405
  "line",
404
406
  {
405
407
  y1: 0,
406
- y2: p,
408
+ y2: f,
407
409
  x1: n(S.date),
408
410
  x2: n(S.date),
409
411
  className: G(
410
412
  "undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",
411
- y?.mouseOverLine
413
+ d?.mouseOverLine
412
414
  ),
413
- style: x?.mouseOverLine
415
+ style: y?.mouseOverLine
414
416
  }
415
417
  ) : null,
416
- i.map((t, v) => /* @__PURE__ */ e.jsxs(f.g, { children: [
418
+ i.map((t, v) => /* @__PURE__ */ e.jsxs(g.g, { children: [
417
419
  P(t.y1) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
418
420
  tt ? /* @__PURE__ */ e.jsx(
419
- f.circle,
421
+ g.circle,
420
422
  {
421
- r: m / i.length < 5 ? 0 : m / i.length < 20 ? 2 : 4,
422
- style: { fill: g[0] },
423
+ r: h / i.length < 5 ? 0 : h / i.length < 20 ? 2 : 4,
423
424
  exit: { opacity: 0, transition: { duration: a.duration } },
424
425
  variants: {
425
- initial: { opacity: 0, cx: n(t.date), cy: o(t.y1) },
426
+ initial: { opacity: 0, cx: n(t.date), cy: o(t.y1), fill: l[0] },
426
427
  whileInView: {
427
428
  opacity: 1,
429
+ fill: l[0],
428
430
  transition: { duration: 0.5, delay: a.duration },
429
431
  cx: n(t.date),
430
432
  cy: o(t.y1)
@@ -434,29 +436,29 @@ function hi(pt) {
434
436
  animate: s ? "whileInView" : "initial"
435
437
  }
436
438
  ) : null,
437
- l ? /* @__PURE__ */ e.jsx(
438
- f.text,
439
+ c ? /* @__PURE__ */ e.jsx(
440
+ g.text,
439
441
  {
440
442
  dy: t.y2 < t.y1 ? -8 : "1em",
441
443
  style: {
442
- fill: g[0],
443
444
  textAnchor: "middle",
444
- ...x?.graphObjectValues || {}
445
+ ...y?.graphObjectValues || {}
445
446
  },
446
447
  className: G(
447
448
  "graph-value graph-value-line-1 text-xs font-bold",
448
- y?.graphObjectValues
449
+ d?.graphObjectValues
449
450
  ),
450
451
  exit: { opacity: 0, transition: { duration: a.duration } },
451
452
  variants: {
452
- initial: { opacity: 0, x: n(t.date), y: o(t.y1) },
453
+ initial: { opacity: 0, x: n(t.date), y: o(t.y1), fill: l[0] },
453
454
  whileInView: {
454
455
  opacity: 1,
456
+ fill: l[0],
455
457
  x: n(t.date),
456
458
  y: o(t.y1),
457
459
  transition: {
458
- duration: c ? a.duration : 0.5,
459
- delay: c ? 0 : a.duration
460
+ duration: m ? a.duration : 0.5,
461
+ delay: m ? 0 : a.duration
460
462
  }
461
463
  }
462
464
  },
@@ -468,18 +470,18 @@ function hi(pt) {
468
470
  ] }),
469
471
  P(t.y2) ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
470
472
  tt ? /* @__PURE__ */ e.jsx(
471
- f.circle,
473
+ g.circle,
472
474
  {
473
- r: m / i.length < 5 ? 0 : m / i.length < 20 ? 2 : 4,
474
- style: { fill: g[1] },
475
+ r: h / i.length < 5 ? 0 : h / i.length < 20 ? 2 : 4,
475
476
  exit: { opacity: 0, transition: { duration: a.duration } },
476
477
  variants: {
477
- initial: { opacity: 0, cx: n(t.date), cy: o(t.y2) },
478
+ initial: { opacity: 0, cx: n(t.date), cy: o(t.y2), fill: l[1] },
478
479
  whileInView: {
479
480
  opacity: 1,
481
+ fill: l[1],
480
482
  transition: {
481
- duration: c ? a.duration : 0.5,
482
- delay: c ? 0 : a.duration
483
+ duration: m ? a.duration : 0.5,
484
+ delay: m ? 0 : a.duration
483
485
  },
484
486
  cx: n(t.date),
485
487
  cy: o(t.y2)
@@ -489,29 +491,29 @@ function hi(pt) {
489
491
  animate: s ? "whileInView" : "initial"
490
492
  }
491
493
  ) : null,
492
- l ? /* @__PURE__ */ e.jsx(
493
- f.text,
494
+ c ? /* @__PURE__ */ e.jsx(
495
+ g.text,
494
496
  {
495
497
  dy: t.y2 > t.y1 ? -8 : "1em",
496
498
  style: {
497
- fill: g[1],
498
499
  textAnchor: "middle",
499
- ...x?.graphObjectValues || {}
500
+ ...y?.graphObjectValues || {}
500
501
  },
501
502
  className: G(
502
503
  "graph-value graph-value-line-2 text-xs font-bold",
503
- y?.graphObjectValues
504
+ d?.graphObjectValues
504
505
  ),
505
506
  exit: { opacity: 0, transition: { duration: a.duration } },
506
507
  variants: {
507
- initial: { opacity: 0, x: n(t.date), y: o(t.y2) },
508
+ initial: { opacity: 0, x: n(t.date), y: o(t.y2), fill: l[1] },
508
509
  whileInView: {
509
510
  opacity: 1,
510
511
  x: n(t.date),
511
512
  y: o(t.y2),
513
+ fill: l[1],
512
514
  transition: {
513
- duration: c ? a.duration : 0.5,
514
- delay: c ? 0 : a.duration
515
+ duration: m ? a.duration : 0.5,
516
+ delay: m ? 0 : a.duration
515
517
  }
516
518
  }
517
519
  },
@@ -530,7 +532,7 @@ function hi(pt) {
530
532
  color: t.color,
531
533
  y: o(t.value),
532
534
  x1: 0 - j,
533
- x2: m + u.right,
535
+ x2: h + p.right,
534
536
  classNames: t.classNames,
535
537
  styles: t.styles,
536
538
  animate: a,
@@ -541,11 +543,11 @@ function hi(pt) {
541
543
  /* @__PURE__ */ e.jsx("g", { children: k.map((t, v) => {
542
544
  const $ = Wt(
543
545
  {
544
- x: t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
546
+ x: t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
545
547
  y: t.yCoordinate ? o(t.yCoordinate) + (t.yOffset || 0) - 8 : 0 + (t.yOffset || 0) - 8
546
548
  },
547
549
  {
548
- x: t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) : 0,
550
+ x: t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) : 0,
549
551
  y: t.yCoordinate ? o(t.yCoordinate) : 0
550
552
  },
551
553
  P(t.connectorRadius) ? 3.5 : t.connectorRadius
@@ -553,15 +555,15 @@ function hi(pt) {
553
555
  y1: $.y,
554
556
  x1: $.x,
555
557
  y2: t.yCoordinate ? o(t.yCoordinate) + (t.yOffset || 0) : 0 + (t.yOffset || 0),
556
- x2: t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
558
+ x2: t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
557
559
  cy: t.yCoordinate ? o(t.yCoordinate) : 0,
558
- cx: t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) : 0,
560
+ cx: t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) : 0,
559
561
  circleRadius: P(t.connectorRadius) ? 3.5 : t.connectorRadius,
560
562
  strokeWidth: t.showConnector === !0 ? 2 : Math.min(t.showConnector || 0, 1)
561
563
  } : void 0, At = {
562
564
  y: t.yCoordinate ? o(t.yCoordinate) + (t.yOffset || 0) - 8 : 0 + (t.yOffset || 0) - 8,
563
- x: Q ? 0 : t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
564
- width: Q ? t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0) : m + u.right - (t.xCoordinate ? n(d(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0)),
565
+ x: Q ? 0 : t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
566
+ width: Q ? t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0) : h + p.right - (t.xCoordinate ? n(u(`${t.xCoordinate}`, r, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0)),
565
567
  maxWidth: t.maxWidth,
566
568
  fontWeight: t.fontWeight,
567
569
  align: t.align
@@ -590,8 +592,8 @@ function hi(pt) {
590
592
  fill: "none",
591
593
  pointerEvents: "all"
592
594
  },
593
- width: m,
594
- height: p
595
+ width: h,
596
+ height: f
595
597
  }
596
598
  )
597
599
  ] })
@@ -604,8 +606,8 @@ function hi(pt) {
604
606
  body: X,
605
607
  xPos: st,
606
608
  yPos: A,
607
- backgroundStyle: x?.tooltip,
608
- className: y?.tooltip
609
+ backgroundStyle: y?.tooltip,
610
+ className: d?.tooltip
609
611
  }
610
612
  ) : null
611
613
  ] });
@@ -615,11 +617,11 @@ function Yi(pt) {
615
617
  data: N,
616
618
  graphTitle: D,
617
619
  suffix: Y = "",
618
- sources: g,
620
+ sources: l,
619
621
  prefix: L = "",
620
622
  graphDescription: w,
621
623
  height: r,
622
- width: l,
624
+ width: c,
623
625
  footNote: J,
624
626
  noOfXTicks: ft = 10,
625
627
  dateFormat: j = "yyyy",
@@ -649,13 +651,13 @@ function Yi(pt) {
649
651
  colorLegendTitle: et,
650
652
  diffAreaColors: at = [dt.alerts.red, dt.alerts.darkGreen],
651
653
  strokeWidth: F = 2,
652
- showDots: x = !0,
653
- refValues: y = [],
654
+ showDots: y = !0,
655
+ refValues: d = [],
654
656
  minValue: T,
655
657
  maxValue: nt,
656
658
  annotations: ot = [],
657
659
  customHighlightAreaSettings: s = [],
658
- theme: c = "light",
660
+ theme: m = "light",
659
661
  ariaLabel: vt,
660
662
  yAxisTitle: M,
661
663
  noOfYTicks: S = 5,
@@ -664,25 +666,25 @@ function Yi(pt) {
664
666
  curveType: lt = "curve",
665
667
  styles: A,
666
668
  classNames: C,
667
- precision: u = 2,
669
+ precision: p = 2,
668
670
  customLayers: ct = []
669
- } = pt, [i, mt] = W(0), [ht, m] = W(0), p = ut(null), xt = ut(null);
671
+ } = pt, [i, mt] = W(0), [ht, h] = W(0), f = ut(null), xt = ut(null);
670
672
  return Dt(() => {
671
- const h = new ResizeObserver((q) => {
672
- mt(l || q[0].target.clientWidth || 620), m(r || q[0].target.clientHeight || 480);
673
+ const x = new ResizeObserver((q) => {
674
+ mt(c || q[0].target.clientWidth || 620), h(r || q[0].target.clientHeight || 480);
673
675
  });
674
- return p.current && (m(p.current.clientHeight || 480), mt(p.current.clientWidth || 620), l || h.observe(p.current)), () => h.disconnect();
675
- }, [l, r]), /* @__PURE__ */ e.jsx(
676
+ return f.current && (h(f.current.clientHeight || 480), mt(f.current.clientWidth || 620), c || x.observe(f.current)), () => x.disconnect();
677
+ }, [c, r]), /* @__PURE__ */ e.jsx(
676
678
  "div",
677
679
  {
678
- className: `${c || "light"} flex ${l ? "w-fit grow-0" : "w-full grow"}`,
680
+ className: `${m || "light"} flex ${c ? "w-fit grow-0" : "w-full grow"}`,
679
681
  dir: k === "he" || k === "ar" ? "rtl" : void 0,
680
682
  children: /* @__PURE__ */ e.jsx(
681
683
  "div",
682
684
  {
683
685
  className: G(
684
686
  `${V ? V === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k || "en"}`,
685
- l ? "w-fit" : "w-full",
687
+ c ? "w-fit" : "w-full",
686
688
  C?.graphContainer
687
689
  ),
688
690
  style: {
@@ -711,9 +713,9 @@ function Yi(pt) {
711
713
  },
712
714
  graphTitle: D,
713
715
  graphDescription: w,
714
- width: l,
716
+ width: c,
715
717
  graphDownload: B ? xt.current : void 0,
716
- dataDownload: I ? N.map((h) => h.data).filter((h) => h !== void 0).length > 0 ? N.map((h) => h.data).filter((h) => h !== void 0) : N.filter((h) => h !== void 0) : null
718
+ dataDownload: I ? N.map((x) => x.data).filter((x) => x !== void 0).length > 0 ? N.map((x) => x.data).filter((x) => x !== void 0) : N.filter((x) => x !== void 0) : null
717
719
  }
718
720
  ) : null,
719
721
  /* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: N.length === 0 ? /* @__PURE__ */ e.jsx(mi, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
@@ -730,18 +732,18 @@ function Yi(pt) {
730
732
  "div",
731
733
  {
732
734
  className: "flex flex-col grow justify-center leading-0",
733
- ref: p,
735
+ ref: f,
734
736
  "aria-label": "Graph area",
735
- children: (l || i) && (r || ht) ? /* @__PURE__ */ e.jsx(
737
+ children: (c || i) && (r || ht) ? /* @__PURE__ */ e.jsx(
736
738
  hi,
737
739
  {
738
740
  data: N,
739
741
  lineColors: X,
740
742
  colorDomain: U,
741
- width: l || i,
743
+ width: c || i,
742
744
  height: Math.max(
743
745
  R,
744
- r || (b ? R ? (l || i) * b > R ? (l || i) * b : R : (l || i) * b : ht)
746
+ r || (b ? R ? (c || i) * b > R ? (c || i) * b : R : (c || i) * b : ht)
745
747
  ),
746
748
  suffix: Y,
747
749
  prefix: L,
@@ -761,8 +763,8 @@ function Yi(pt) {
761
763
  diffAreaColors: at,
762
764
  idSuffix: ci(8),
763
765
  strokeWidth: F,
764
- showDots: x,
765
- refValues: y,
766
+ showDots: y,
767
+ refValues: d,
766
768
  minValue: T,
767
769
  maxValue: nt,
768
770
  annotations: ot,
@@ -774,14 +776,14 @@ function Yi(pt) {
774
776
  curveType: lt,
775
777
  styles: A,
776
778
  classNames: C,
777
- precision: u,
779
+ precision: p,
778
780
  customLayers: ct
779
781
  }
780
782
  ) : null
781
783
  }
782
784
  )
783
785
  ] }) }),
784
- g || J ? /* @__PURE__ */ e.jsx(
786
+ l || J ? /* @__PURE__ */ e.jsx(
785
787
  ri,
786
788
  {
787
789
  styles: { footnote: A?.footnote, source: A?.source },
@@ -789,9 +791,9 @@ function Yi(pt) {
789
791
  footnote: C?.footnote,
790
792
  source: C?.source
791
793
  },
792
- sources: g,
794
+ sources: l,
793
795
  footNote: J,
794
- width: l
796
+ width: c
795
797
  }
796
798
  ) : null
797
799
  ] })