@undp/data-viz 1.5.7 → 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 (74) 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/UnitChart.cjs +1 -1
  66. package/dist/UnitChart.cjs.map +1 -1
  67. package/dist/UnitChart.js +20 -21
  68. package/dist/UnitChart.js.map +1 -1
  69. package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
  70. package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
  71. package/package.json +1 -1
  72. package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
  73. package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
  74. package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
@@ -12,7 +12,7 @@ import { X as Xe } from "./XTicksAndGridLines-Bn9u5gOM.js";
12
12
  import { R as Pe } from "./ReferenceLine-CfAW3vKJ.js";
13
13
  import { Y as Ee } from "./YTicksAndGridLines-B6ah7CRf.js";
14
14
  import { H as Ge } from "./index-DKCxu1Gh.js";
15
- import { Colors as T } from "./Colors.js";
15
+ import { Colors as D } from "./Colors.js";
16
16
  import { u as ue } from "./uniqBy-BHy4I8PK.js";
17
17
  import { s as Be } from "./sort-DfK1b0F5.js";
18
18
  import { c as ze, a as qe } from "./init-BhZylTFx.js";
@@ -31,16 +31,16 @@ import { E as lt } from "./EmptyState-DdTp-Mdn.js";
31
31
  import { ColorLegendWithMouseOver as ct } from "./ColorLegendWithMouseOver.js";
32
32
  function mt(pe) {
33
33
  const {
34
- data: n,
34
+ data: r,
35
35
  width: S,
36
36
  height: K,
37
- lineColors: s,
37
+ lineColors: a,
38
38
  dateFormat: f,
39
39
  noOfXTicks: ye,
40
40
  rightMargin: _,
41
41
  topMargin: de,
42
42
  bottomMargin: B,
43
- suffix: D,
43
+ suffix: L,
44
44
  prefix: h,
45
45
  leftMargin: O,
46
46
  tooltip: ee,
@@ -49,10 +49,10 @@ function mt(pe) {
49
49
  highlightAreaSettings: k,
50
50
  minValue: z,
51
51
  maxValue: te,
52
- highlightedLines: L,
53
- animate: a,
52
+ highlightedLines: $,
53
+ animate: n,
54
54
  rtl: ie,
55
- strokeWidth: $,
55
+ strokeWidth: M,
56
56
  showDots: q,
57
57
  annotations: we,
58
58
  customHighlightAreaSettings: ve,
@@ -61,41 +61,41 @@ function mt(pe) {
61
61
  minDate: ae,
62
62
  maxDate: re,
63
63
  curveType: U,
64
- styles: b,
65
- colorDomain: C,
64
+ styles: C,
65
+ colorDomain: p,
66
66
  selectedColor: I,
67
- classNames: p,
67
+ classNames: y,
68
68
  showLabels: R,
69
69
  dimmedOpacity: j,
70
- precision: M,
70
+ precision: N,
71
71
  naLabel: Ce,
72
72
  customLayers: ne
73
- } = pe, se = ge(null), y = rt(se, {
74
- once: a.once,
75
- amount: a.amount
73
+ } = pe, se = ge(null), d = rt(se, {
74
+ once: n.once,
75
+ amount: n.amount
76
76
  }), [A, Oe] = G(!1);
77
77
  $e(() => {
78
- if (y && !A) {
78
+ if (d && !A) {
79
79
  const e = setTimeout(
80
80
  () => {
81
81
  Oe(!0);
82
82
  },
83
- (a.duration + 0.5) * 1e3
83
+ (n.duration + 0.5) * 1e3
84
84
  );
85
85
  return () => clearTimeout(e);
86
86
  }
87
- }, [y, A, a.duration]);
87
+ }, [d, A, n.duration]);
88
88
  const je = U === "linear" ? Ze : U === "step" ? _e : U === "stepAfter" ? et : U === "stepBefore" ? tt : it, l = Te(
89
- n.map((e) => ({
89
+ r.map((e) => ({
90
90
  ...e,
91
91
  date: u(`${e.date}`, f, /* @__PURE__ */ new Date())
92
92
  })),
93
93
  ["date"],
94
94
  ["asc"]
95
95
  ).filter((e) => !x(e.y)), Ae = ue(l, "label", !0), Z = Be(
96
- ue(n, "date", !0).map((e) => u(`${e}`, f, /* @__PURE__ */ new Date())),
96
+ ue(r, "date", !0).map((e) => u(`${e}`, f, /* @__PURE__ */ new Date())),
97
97
  (e, i) => ze(e, i)
98
- ), [g, d] = G(void 0), [N, Y] = G(void 0), [le, F] = G(void 0), w = {
98
+ ), [g, w] = G(void 0), [T, Y] = G(void 0), [le, F] = G(void 0), v = {
99
99
  top: de,
100
100
  bottom: B,
101
101
  left: oe ? O + 30 : O,
@@ -117,7 +117,7 @@ function mt(pe) {
117
117
  coordinates: e.coordinates.map(
118
118
  (i, m) => m % 2 === 0 ? u(`${i}`, f, /* @__PURE__ */ new Date()) : i
119
119
  )
120
- })), v = S - w.left - w.right, V = K - w.top - w.bottom, P = ae ? u(`${ae}`, f, /* @__PURE__ */ new Date()) : Z[0], he = re ? u(`${re}`, f, /* @__PURE__ */ new Date()) : Z[Z.length - 1], o = x(z) ? Math.min(...l.map((e) => e.y).filter((e) => !x(e))) ? Math.min(
120
+ })), b = S - v.left - v.right, V = K - v.top - v.bottom, P = ae ? u(`${ae}`, f, /* @__PURE__ */ new Date()) : Z[0], he = re ? u(`${re}`, f, /* @__PURE__ */ new Date()) : Z[Z.length - 1], o = x(z) ? Math.min(...l.map((e) => e.y).filter((e) => !x(e))) ? Math.min(
121
121
  ...l.map((e) => e.y).filter((e) => !x(e))
122
122
  ) > 0 ? 0 : Math.min(
123
123
  ...l.map((e) => e.y).filter((e) => !x(e))
@@ -125,27 +125,27 @@ function mt(pe) {
125
125
  ...l.map((e) => e.y).filter((e) => !x(e))
126
126
  ) ? Math.max(
127
127
  ...l.map((e) => e.y).filter((e) => !x(e))
128
- ) : 0, r = Ue().domain([P, he]).range([0, v]), c = Je().domain([
128
+ ) : 0, s = Ue().domain([P, he]).range([0, b]), c = Je().domain([
129
129
  x(z) ? o : z,
130
130
  x(te) ? J > 0 ? J : 0 : te
131
131
  ]).range([V, 0]).nice(), ke = Ke.from(
132
132
  l.filter((e) => !x(e.date) && !x(e.y)),
133
- (e) => r(e.date),
133
+ (e) => s(e.date),
134
134
  (e) => c(e.y)
135
- ).voronoi([0, 0, v < 0 ? 0 : v, V < 0 ? 0 : V]), De = Qe().x((e) => r(e.date)).y((e) => c(e.y)).curve(je), Me = c.ticks(be), Ne = r.ticks(ye);
135
+ ).voronoi([0, 0, b < 0 ? 0 : b, V < 0 ? 0 : V]), De = Qe().x((e) => s(e.date)).y((e) => c(e.y)).curve(je), Me = c.ticks(be), Ne = s.ticks(ye);
136
136
  return $e(() => {
137
137
  const e = (m) => {
138
138
  const H = l[qe(
139
139
  l.map((Le) => Le.date),
140
- r.invert(at(m)[0]),
140
+ s.invert(at(m)[0]),
141
141
  0
142
142
  )];
143
- d(H || l[l.length - 1]), F(m.clientY), Y(m.clientX), W?.(H || l[l.length - 1]);
143
+ w(H || l[l.length - 1]), F(m.clientY), Y(m.clientX), W?.(H || l[l.length - 1]);
144
144
  }, i = () => {
145
- d(void 0), Y(void 0), F(void 0);
145
+ w(void 0), Y(void 0), F(void 0);
146
146
  };
147
147
  ot(X.current).on("mousemove", e).on("mouseout", i), W?.(void 0);
148
- }, [r, l, W]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
148
+ }, [s, l, W]), /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
149
149
  /* @__PURE__ */ t.jsx(
150
150
  E.svg,
151
151
  {
@@ -154,26 +154,26 @@ function mt(pe) {
154
154
  viewBox: `0 0 ${S} ${K}`,
155
155
  direction: "ltr",
156
156
  ref: se,
157
- children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${w.left},${w.top})`, children: [
157
+ children: /* @__PURE__ */ t.jsxs("g", { transform: `translate(${v.left},${v.top})`, children: [
158
158
  /* @__PURE__ */ t.jsx(
159
159
  Ge,
160
160
  {
161
161
  areaSettings: me,
162
- width: v,
162
+ width: b,
163
163
  height: V,
164
- scale: r,
165
- animate: a,
166
- isInView: y
164
+ scale: s,
165
+ animate: n,
166
+ isInView: d
167
167
  }
168
168
  ),
169
169
  /* @__PURE__ */ t.jsx(
170
170
  We,
171
171
  {
172
172
  areaSettings: fe,
173
- scaleX: r,
173
+ scaleX: s,
174
174
  scaleY: c,
175
- animate: a,
176
- isInView: y
175
+ animate: n,
176
+ isInView: d
177
177
  }
178
178
  ),
179
179
  /* @__PURE__ */ t.jsxs("g", { children: [
@@ -183,21 +183,21 @@ function mt(pe) {
183
183
  values: Me.filter((e) => e !== 0),
184
184
  y: Me.filter((e) => e !== 0).map((e) => c(e)),
185
185
  x1: 0 - O,
186
- x2: v + w.right,
186
+ x2: b + v.right,
187
187
  styles: {
188
- gridLines: b?.yAxis?.gridLines,
189
- labels: b?.yAxis?.labels
188
+ gridLines: C?.yAxis?.gridLines,
189
+ labels: C?.yAxis?.labels
190
190
  },
191
191
  classNames: {
192
- gridLines: p?.yAxis?.gridLines,
193
- labels: p?.yAxis?.labels
192
+ gridLines: y?.yAxis?.gridLines,
193
+ labels: y?.yAxis?.labels
194
194
  },
195
- suffix: D,
195
+ suffix: L,
196
196
  prefix: h,
197
197
  labelType: "secondary",
198
198
  showGridLines: !0,
199
199
  labelPos: "vertical",
200
- precision: M
200
+ precision: N
201
201
  }
202
202
  ),
203
203
  /* @__PURE__ */ t.jsx(
@@ -206,13 +206,13 @@ function mt(pe) {
206
206
  y1: c(o < 0 ? 0 : o),
207
207
  y2: c(o < 0 ? 0 : o),
208
208
  x1: 0 - O,
209
- x2: v + w.right,
209
+ x2: b + v.right,
210
210
  label: Se(
211
211
  o < 0 ? 0 : o,
212
212
  "NA",
213
- M,
213
+ N,
214
214
  h,
215
- D
215
+ L
216
216
  ),
217
217
  labelPos: {
218
218
  x: 0 - O,
@@ -221,12 +221,12 @@ function mt(pe) {
221
221
  dy: J < 0 ? "1em" : -5
222
222
  },
223
223
  classNames: {
224
- axis: p?.xAxis?.axis,
225
- label: p?.yAxis?.labels
224
+ axis: y?.xAxis?.axis,
225
+ label: y?.yAxis?.labels
226
226
  },
227
227
  styles: {
228
- axis: b?.xAxis?.axis,
229
- label: b?.yAxis?.labels
228
+ axis: C?.xAxis?.axis,
229
+ label: C?.yAxis?.labels
230
230
  }
231
231
  }
232
232
  ),
@@ -235,8 +235,8 @@ function mt(pe) {
235
235
  {
236
236
  x: 0 - O - 15,
237
237
  y: V / 2,
238
- style: b?.yAxis?.title,
239
- className: p?.yAxis?.title,
238
+ style: C?.yAxis?.title,
239
+ className: y?.yAxis?.title,
240
240
  text: oe,
241
241
  rotate90: !0
242
242
  }
@@ -246,25 +246,25 @@ function mt(pe) {
246
246
  Xe,
247
247
  {
248
248
  values: Ne.map((e) => Ve(e, f)),
249
- x: Ne.map((e) => r(e)),
249
+ x: Ne.map((e) => s(e)),
250
250
  y1: 0,
251
251
  y2: V,
252
252
  styles: {
253
- gridLines: b?.xAxis?.gridLines,
254
- labels: b?.xAxis?.labels
253
+ gridLines: C?.xAxis?.gridLines,
254
+ labels: C?.xAxis?.labels
255
255
  },
256
256
  classNames: {
257
- gridLines: xe("opacity-0", p?.xAxis?.gridLines),
257
+ gridLines: xe("opacity-0", y?.xAxis?.gridLines),
258
258
  labels: xe(
259
259
  "fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",
260
- p?.xAxis?.labels
260
+ y?.xAxis?.labels
261
261
  )
262
262
  },
263
- suffix: D,
263
+ suffix: L,
264
264
  prefix: h,
265
265
  labelType: "primary",
266
266
  showGridLines: !0,
267
- precision: M
267
+ precision: N
268
268
  }
269
269
  ) }),
270
270
  ne.filter((e) => e.position === "before").map((e) => e.layer),
@@ -272,18 +272,18 @@ function mt(pe) {
272
272
  ce.map((e) => /* @__PURE__ */ t.jsxs(
273
273
  E.g,
274
274
  {
275
- exit: { opacity: 0, transition: { duration: a.duration } },
275
+ exit: { opacity: 0, transition: { duration: n.duration } },
276
276
  variants: {
277
277
  initial: {
278
- opacity: g ? e[0].label === g.label ? 1 : j : I ? e[0].color && s[C.indexOf(e[0].color)] === I ? 1 : j : L.length !== 0 ? L.indexOf(e[0].label) !== -1 ? 1 : j : 1
278
+ opacity: g ? e[0].label === g.label ? 1 : j : I ? e[0].color && a[p.indexOf(e[0].color)] === I ? 1 : j : $.length !== 0 ? $.indexOf(e[0].label) !== -1 ? 1 : j : 1
279
279
  },
280
280
  whileInView: {
281
- opacity: g ? e[0].label === g.label ? 1 : j : I ? e[0].color && s[C.indexOf(e[0].color)] === I ? 1 : j : L.length !== 0 ? L.indexOf(e[0].label) !== -1 ? 1 : j : 1,
282
- transition: { duration: a.duration }
281
+ opacity: g ? e[0].label === g.label ? 1 : j : I ? e[0].color && a[p.indexOf(e[0].color)] === I ? 1 : j : $.length !== 0 ? $.indexOf(e[0].label) !== -1 ? 1 : j : 1,
282
+ transition: { duration: n.duration }
283
283
  }
284
284
  },
285
285
  initial: "initial",
286
- animate: y ? "whileInView" : "initial",
286
+ animate: d ? "whileInView" : "initial",
287
287
  children: [
288
288
  /* @__PURE__ */ t.jsx(
289
289
  E.path,
@@ -293,9 +293,9 @@ function mt(pe) {
293
293
  ) || "",
294
294
  style: {
295
295
  fill: "none",
296
- strokeWidth: g ? e[0].label === g.label ? $ + Math.max(2, 0.5 * $) : $ : L.length !== 0 && L.indexOf(e[0].label) !== -1 ? $ + Math.max(2, 0.5 * $) : $
296
+ strokeWidth: g ? e[0].label === g.label ? M + Math.max(2, 0.5 * M) : M : $.length !== 0 && $.indexOf(e[0].label) !== -1 ? M + Math.max(2, 0.5 * M) : M
297
297
  },
298
- exit: { opacity: 0, transition: { duration: a.duration } },
298
+ exit: { opacity: 0, transition: { duration: n.duration } },
299
299
  variants: {
300
300
  initial: {
301
301
  pathLength: 0,
@@ -303,7 +303,7 @@ function mt(pe) {
303
303
  e.filter((i) => !x(i.y))
304
304
  ) || "",
305
305
  opacity: 1,
306
- stroke: n.filter((i) => i.color).length === 0 ? s[0] : e[0].color ? s[C.indexOf(e[0].color)] : T.gray
306
+ stroke: r.filter((i) => i.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray
307
307
  },
308
308
  whileInView: {
309
309
  pathLength: 1,
@@ -311,69 +311,68 @@ function mt(pe) {
311
311
  e.filter((i) => !x(i.y))
312
312
  ) || "",
313
313
  opacity: 1,
314
- stroke: n.filter((i) => i.color).length === 0 ? s[0] : e[0].color ? s[C.indexOf(e[0].color)] : T.gray,
315
- transition: { duration: a.duration }
314
+ stroke: r.filter((i) => i.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray,
315
+ transition: { duration: n.duration }
316
316
  }
317
317
  },
318
318
  initial: "initial",
319
- animate: y ? "whileInView" : "initial"
319
+ animate: d ? "whileInView" : "initial"
320
320
  }
321
321
  ),
322
322
  e.map((i, m) => /* @__PURE__ */ t.jsx(E.g, { children: x(i.y) ? null : /* @__PURE__ */ t.jsx(t.Fragment, { children: q ? /* @__PURE__ */ t.jsx(
323
323
  E.circle,
324
324
  {
325
- r: v / e.length < 5 ? 0 : v / e.length < 20 ? 2 : 4,
326
- exit: { opacity: 0, transition: { duration: a.duration } },
325
+ r: b / e.length < 5 ? 0 : b / e.length < 20 ? 2 : 4,
326
+ exit: { opacity: 0, transition: { duration: n.duration } },
327
327
  variants: {
328
328
  initial: {
329
329
  opacity: 0,
330
- fill: n.filter((H) => H.color).length === 0 ? s[0] : e[0].color ? s[C.indexOf(e[0].color)] : T.gray,
331
- cx: r(i.date),
330
+ fill: r.filter((H) => H.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray,
331
+ cx: s(i.date),
332
332
  cy: c(i.y)
333
333
  },
334
334
  whileInView: {
335
335
  opacity: 1,
336
- fill: n.filter((H) => H.color).length === 0 ? s[0] : e[0].color ? s[C.indexOf(e[0].color)] : T.gray,
336
+ fill: r.filter((H) => H.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray,
337
337
  transition: {
338
- duration: A ? a.duration : 0.5,
339
- delay: A ? 0 : a.duration
338
+ duration: A ? n.duration : 0.5,
339
+ delay: A ? 0 : n.duration
340
340
  },
341
- cx: r(i.date),
341
+ cx: s(i.date),
342
342
  cy: c(i.y)
343
343
  }
344
344
  },
345
345
  initial: "initial",
346
- animate: y ? "whileInView" : "initial"
346
+ animate: d ? "whileInView" : "initial"
347
347
  }
348
348
  ) : null }) }, m)),
349
- (L.indexOf(e[0].label) !== -1 || g?.label === e[0].label) && R ? /* @__PURE__ */ t.jsx(
349
+ ($.indexOf(e[0].label) !== -1 || g?.label === e[0].label) && R ? /* @__PURE__ */ t.jsx(
350
350
  E.text,
351
351
  {
352
- style: {
353
- fill: n.filter((i) => i.color).length === 0 ? s[0] : e[0].color ? s[C.indexOf(e[0].color)] : T.gray
354
- },
355
352
  className: "text-sm font-bold",
356
353
  dx: 5,
357
354
  dy: 4,
358
- exit: { opacity: 0, transition: { duration: a.duration } },
355
+ exit: { opacity: 0, transition: { duration: n.duration } },
359
356
  variants: {
360
357
  initial: {
361
358
  opacity: 0,
362
- x: r(e[e.length - 1].date),
359
+ fill: r.filter((i) => i.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray,
360
+ x: s(e[e.length - 1].date),
363
361
  y: c(e[e.length - 1].y)
364
362
  },
365
363
  whileInView: {
366
364
  opacity: 1,
367
- x: r(e[e.length - 1].date),
365
+ fill: r.filter((i) => i.color).length === 0 ? a[0] : e[0].color ? a[p.indexOf(e[0].color)] : D.gray,
366
+ x: s(e[e.length - 1].date),
368
367
  y: c(e[e.length - 1].y),
369
368
  transition: {
370
- duration: A ? a.duration : 0.5,
371
- delay: A ? 0 : a.duration
369
+ duration: A ? n.duration : 0.5,
370
+ delay: A ? 0 : n.duration
372
371
  }
373
372
  }
374
373
  },
375
374
  initial: "initial",
376
- animate: y ? "whileInView" : "initial",
375
+ animate: d ? "whileInView" : "initial",
377
376
  children: e[0].label
378
377
  }
379
378
  ) : null
@@ -385,14 +384,14 @@ function mt(pe) {
385
384
  "text",
386
385
  {
387
386
  y: c(g.y) - 8,
388
- x: r(g.date),
389
- className: xe("graph-value text-sm font-bold", p?.graphObjectValues),
387
+ x: s(g.date),
388
+ className: xe("graph-value text-sm font-bold", y?.graphObjectValues),
390
389
  style: {
391
- fill: n.filter((e) => e.color).length === 0 ? s[0] : g.color ? s[C.indexOf(g.color)] : T.gray,
390
+ fill: r.filter((e) => e.color).length === 0 ? a[0] : g.color ? a[p.indexOf(g.color)] : D.gray,
392
391
  textAnchor: "middle",
393
- ...b?.graphObjectValues || {}
392
+ ...C?.graphObjectValues || {}
394
393
  },
395
- children: Se(g.y, Ce, M, h, D)
394
+ children: Se(g.y, Ce, N, h, L)
396
395
  }
397
396
  ) : null
398
397
  ] }),
@@ -404,13 +403,13 @@ function mt(pe) {
404
403
  ),
405
404
  opacity: 0,
406
405
  onMouseEnter: (m) => {
407
- d(e), F(m.clientY), Y(m.clientX), W?.(e);
406
+ w(e), F(m.clientY), Y(m.clientX), W?.(e);
408
407
  },
409
408
  onMouseMove: (m) => {
410
- d(e), F(m.clientY), Y(m.clientX);
409
+ w(e), F(m.clientY), Y(m.clientX);
411
410
  },
412
411
  onMouseLeave: () => {
413
- d(void 0), Y(void 0), F(void 0), W?.(void 0);
412
+ w(void 0), Y(void 0), F(void 0), W?.(void 0);
414
413
  }
415
414
  }
416
415
  ) }, i)),
@@ -421,22 +420,22 @@ function mt(pe) {
421
420
  color: e.color,
422
421
  y: c(e.value),
423
422
  x1: 0 - O,
424
- x2: v + w.right,
423
+ x2: b + v.right,
425
424
  classNames: e.classNames,
426
425
  styles: e.styles,
427
- animate: a,
428
- isInView: y
426
+ animate: n,
427
+ isInView: d
429
428
  },
430
429
  i
431
430
  )) }) : null,
432
431
  /* @__PURE__ */ t.jsx("g", { children: we.map((e, i) => {
433
432
  const m = Ie(
434
433
  {
435
- x: e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
434
+ x: e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
436
435
  y: e.yCoordinate ? c(e.yCoordinate) + (e.yOffset || 0) - 8 : 0 + (e.yOffset || 0) - 8
437
436
  },
438
437
  {
439
- x: e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) : 0,
438
+ x: e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) : 0,
440
439
  y: e.yCoordinate ? c(e.yCoordinate) : 0
441
440
  },
442
441
  x(e.connectorRadius) ? 3.5 : e.connectorRadius
@@ -444,15 +443,15 @@ function mt(pe) {
444
443
  y1: m.y,
445
444
  x1: m.x,
446
445
  y2: e.yCoordinate ? c(e.yCoordinate) + (e.yOffset || 0) : 0 + (e.yOffset || 0),
447
- x2: e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
446
+ x2: e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
448
447
  cy: e.yCoordinate ? c(e.yCoordinate) : 0,
449
- cx: e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) : 0,
448
+ cx: e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) : 0,
450
449
  circleRadius: x(e.connectorRadius) ? 3.5 : e.connectorRadius,
451
450
  strokeWidth: e.showConnector === !0 ? 2 : Math.min(e.showConnector || 0, 1)
452
451
  } : void 0, Le = {
453
452
  y: e.yCoordinate ? c(e.yCoordinate) + (e.yOffset || 0) - 8 : 0 + (e.yOffset || 0) - 8,
454
- x: ie ? 0 : e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
455
- width: ie ? e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0) : v + w.right - (e.xCoordinate ? r(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0)),
453
+ x: ie ? 0 : e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0),
454
+ width: ie ? e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0) : b + v.right - (e.xCoordinate ? s(u(`${e.xCoordinate}`, f, /* @__PURE__ */ new Date())) + (e.xOffset || 0) : 0 + (e.xOffset || 0)),
456
455
  maxWidth: e.maxWidth,
457
456
  fontWeight: e.fontWeight,
458
457
  align: e.align
@@ -466,8 +465,8 @@ function mt(pe) {
466
465
  text: e.text,
467
466
  classNames: e.classNames,
468
467
  styles: e.styles,
469
- animate: a,
470
- isInView: y
468
+ animate: n,
469
+ isInView: d
471
470
  },
472
471
  i
473
472
  );
@@ -476,31 +475,31 @@ function mt(pe) {
476
475
  ] })
477
476
  }
478
477
  ),
479
- g && ee && N && le ? /* @__PURE__ */ t.jsx(
478
+ g && ee && T && le ? /* @__PURE__ */ t.jsx(
480
479
  He,
481
480
  {
482
481
  data: g,
483
482
  body: ee,
484
- xPos: N,
483
+ xPos: T,
485
484
  yPos: le,
486
- backgroundStyle: b?.tooltip,
487
- className: p?.tooltip
485
+ backgroundStyle: C?.tooltip,
486
+ className: y?.tooltip
488
487
  }
489
488
  ) : null
490
489
  ] });
491
490
  }
492
491
  function Pt(pe) {
493
492
  const {
494
- data: n,
493
+ data: r,
495
494
  graphTitle: S,
496
495
  showNAColor: K = !0,
497
- colors: s,
496
+ colors: a,
498
497
  colorDomain: f,
499
498
  suffix: ye = "",
500
499
  sources: _,
501
500
  prefix: de = "",
502
501
  graphDescription: B,
503
- height: D,
502
+ height: L,
504
503
  width: h,
505
504
  footNote: O,
506
505
  noOfXTicks: ee = 10,
@@ -509,10 +508,10 @@ function Pt(pe) {
509
508
  backgroundColor: k = !1,
510
509
  leftMargin: z = 30,
511
510
  rightMargin: te = 50,
512
- topMargin: L = 20,
513
- bottomMargin: a = 25,
511
+ topMargin: $ = 20,
512
+ bottomMargin: n = 25,
514
513
  showColorScale: ie = !0,
515
- tooltip: $,
514
+ tooltip: M,
516
515
  relativeHeight: q,
517
516
  onSeriesMouseOver: we,
518
517
  showLabels: ve = !0,
@@ -521,17 +520,17 @@ function Pt(pe) {
521
520
  graphID: ae,
522
521
  minValue: re,
523
522
  maxValue: U,
524
- highlightedLines: b = [],
525
- graphDownload: C = !1,
523
+ highlightedLines: C = [],
524
+ graphDownload: p = !1,
526
525
  dataDownload: I = !1,
527
- animate: p = !1,
526
+ animate: y = !1,
528
527
  language: R = "en",
529
528
  colorLegendTitle: j,
530
- minHeight: M = 0,
529
+ minHeight: N = 0,
531
530
  strokeWidth: Ce = 2,
532
531
  showDots: ne = !0,
533
532
  annotations: se = [],
534
- customHighlightAreaSettings: y = [],
533
+ customHighlightAreaSettings: d = [],
535
534
  theme: A = "light",
536
535
  ariaLabel: Oe,
537
536
  yAxisTitle: je,
@@ -539,19 +538,19 @@ function Pt(pe) {
539
538
  minDate: Ae,
540
539
  maxDate: Z,
541
540
  curveType: g = "curve",
542
- styles: d,
543
- classNames: N,
541
+ styles: w,
542
+ classNames: T,
544
543
  dimmedOpacity: Y = 0.3,
545
544
  precision: le = 2,
546
545
  customLayers: F = [],
547
- naLabel: w = "NA"
548
- } = pe, [X, ce] = G(0), [me, fe] = G(0), [v, V] = G(void 0), P = ge(null), he = ge(null);
546
+ naLabel: v = "NA"
547
+ } = pe, [X, ce] = G(0), [me, fe] = G(0), [b, V] = G(void 0), P = ge(null), he = ge(null);
549
548
  return $e(() => {
550
549
  const o = new ResizeObserver((J) => {
551
- ce(h || J[0].target.clientWidth || 620), fe(D || J[0].target.clientHeight || 480);
550
+ ce(h || J[0].target.clientWidth || 620), fe(L || J[0].target.clientHeight || 480);
552
551
  });
553
552
  return P.current && (fe(P.current.clientHeight || 480), ce(P.current.clientWidth || 620), h || o.observe(P.current)), () => o.disconnect();
554
- }, [h, D]), /* @__PURE__ */ t.jsx(
553
+ }, [h, L]), /* @__PURE__ */ t.jsx(
555
554
  "div",
556
555
  {
557
556
  className: `${A || "light"} flex ${h ? "w-fit grow-0" : "w-full grow"}`,
@@ -562,10 +561,10 @@ function Pt(pe) {
562
561
  className: xe(
563
562
  `${k ? k === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${R || "en"}`,
564
563
  h ? "w-fit" : "w-full",
565
- N?.graphContainer
564
+ T?.graphContainer
566
565
  ),
567
566
  style: {
568
- ...d?.graphContainer || {},
567
+ ...w?.graphContainer || {},
569
568
  ...k && k !== !0 ? { backgroundColor: k } : {}
570
569
  },
571
570
  id: ae,
@@ -577,53 +576,53 @@ function Pt(pe) {
577
576
  className: "flex grow",
578
577
  style: { padding: k ? Q || "1rem" : Q || 0 },
579
578
  children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
580
- S || B || C || I ? /* @__PURE__ */ t.jsx(
579
+ S || B || p || I ? /* @__PURE__ */ t.jsx(
581
580
  st,
582
581
  {
583
582
  styles: {
584
- title: d?.title,
585
- description: d?.description
583
+ title: w?.title,
584
+ description: w?.description
586
585
  },
587
586
  classNames: {
588
- title: N?.title,
589
- description: N?.description
587
+ title: T?.title,
588
+ description: T?.description
590
589
  },
591
590
  graphTitle: S,
592
591
  graphDescription: B,
593
592
  width: h,
594
- graphDownload: C ? he.current : void 0,
595
- dataDownload: I ? n.map((o) => o.data).filter((o) => o !== void 0).length > 0 ? n.map((o) => o.data).filter((o) => o !== void 0) : n.filter((o) => o !== void 0) : null
593
+ graphDownload: p ? he.current : void 0,
594
+ dataDownload: I ? r.map((o) => o.data).filter((o) => o !== void 0).length > 0 ? r.map((o) => o.data).filter((o) => o !== void 0) : r.filter((o) => o !== void 0) : null
596
595
  }
597
596
  ) : null,
598
- /* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: n.length === 0 ? /* @__PURE__ */ t.jsx(lt, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
599
- ie && n.filter((o) => o.color).length !== 0 ? /* @__PURE__ */ t.jsx(
597
+ /* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: r.length === 0 ? /* @__PURE__ */ t.jsx(lt, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
598
+ ie && r.filter((o) => o.color).length !== 0 ? /* @__PURE__ */ t.jsx(
600
599
  ct,
601
600
  {
602
601
  width: h,
603
602
  colorLegendTitle: j,
604
- colors: s || T[A].categoricalColors.colors,
605
- colorDomain: f || ue(n, "color", !0),
603
+ colors: a || D[A].categoricalColors.colors,
604
+ colorDomain: f || ue(r, "color", !0),
606
605
  setSelectedColor: V,
607
606
  showNAColor: K
608
607
  }
609
608
  ) : null,
610
- /* @__PURE__ */ t.jsx("div", { className: "w-full grow leading-0", ref: P, "aria-label": "Graph area", children: (h || X) && (D || me) ? /* @__PURE__ */ t.jsx(
609
+ /* @__PURE__ */ t.jsx("div", { className: "w-full grow leading-0", ref: P, "aria-label": "Graph area", children: (h || X) && (L || me) ? /* @__PURE__ */ t.jsx(
611
610
  mt,
612
611
  {
613
- data: n,
614
- lineColors: n.filter((o) => o.color).length === 0 ? s ? [s] : [T.primaryColors["blue-600"]] : s || T[A].categoricalColors.colors,
612
+ data: r,
613
+ lineColors: r.filter((o) => o.color).length === 0 ? a ? [a] : [D.primaryColors["blue-600"]] : a || D[A].categoricalColors.colors,
615
614
  width: h || X,
616
615
  height: Math.max(
617
- M,
618
- D || (q ? M ? (h || X) * q > M ? (h || X) * q : M : (h || X) * q : me)
616
+ N,
617
+ L || (q ? N ? (h || X) * q > N ? (h || X) * q : N : (h || X) * q : me)
619
618
  ),
620
619
  dateFormat: W,
621
620
  noOfXTicks: ee,
622
621
  leftMargin: z,
623
622
  rightMargin: te,
624
- topMargin: L,
625
- bottomMargin: a,
626
- tooltip: $,
623
+ topMargin: $,
624
+ bottomMargin: n,
625
+ tooltip: M,
627
626
  onSeriesMouseOver: we,
628
627
  suffix: ye,
629
628
  prefix: de,
@@ -631,37 +630,37 @@ function Pt(pe) {
631
630
  refValues: oe,
632
631
  minValue: re,
633
632
  maxValue: U,
634
- highlightedLines: b,
635
- animate: p === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : p || { duration: 0, once: !0, amount: 0 },
633
+ highlightedLines: C,
634
+ animate: y === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : y || { duration: 0, once: !0, amount: 0 },
636
635
  rtl: R === "he" || R === "ar",
637
636
  strokeWidth: Ce,
638
637
  showDots: ne,
639
638
  annotations: se,
640
- customHighlightAreaSettings: y,
639
+ customHighlightAreaSettings: d,
641
640
  yAxisTitle: je,
642
641
  noOfYTicks: l,
643
642
  minDate: Ae,
644
643
  maxDate: Z,
645
644
  curveType: g,
646
- styles: d,
647
- classNames: N,
648
- selectedColor: v,
645
+ styles: w,
646
+ classNames: T,
647
+ selectedColor: b,
649
648
  showLabels: ve,
650
- colorDomain: n.filter((o) => o.color).length === 0 ? [] : f || ue(n, "color", !0),
649
+ colorDomain: r.filter((o) => o.color).length === 0 ? [] : f || ue(r, "color", !0),
651
650
  dimmedOpacity: Y,
652
651
  precision: le,
653
652
  customLayers: F,
654
- naLabel: w
653
+ naLabel: v
655
654
  }
656
655
  ) : null })
657
656
  ] }) }),
658
657
  _ || O ? /* @__PURE__ */ t.jsx(
659
658
  nt,
660
659
  {
661
- styles: { footnote: d?.footnote, source: d?.source },
660
+ styles: { footnote: w?.footnote, source: w?.source },
662
661
  classNames: {
663
- footnote: N?.footnote,
664
- source: N?.source
662
+ footnote: T?.footnote,
663
+ source: T?.source
665
664
  },
666
665
  sources: _,
667
666
  footNote: O,