@undp/data-viz 1.4.11 → 1.4.13

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 (42) hide show
  1. package/dist/DualAxisLineChart.cjs +1 -1
  2. package/dist/DualAxisLineChart.cjs.map +1 -1
  3. package/dist/DualAxisLineChart.d.ts +3 -1
  4. package/dist/DualAxisLineChart.js +232 -229
  5. package/dist/DualAxisLineChart.js.map +1 -1
  6. package/dist/{GraphEl-s3ctz7oA.js → GraphEl-B3xVlimz.js} +5 -1
  7. package/dist/GraphEl-B3xVlimz.js.map +1 -0
  8. package/dist/GraphEl-DO-juRN8.cjs +2 -0
  9. package/dist/GraphEl-DO-juRN8.cjs.map +1 -0
  10. package/dist/GriddedGraphs.cjs +1 -1
  11. package/dist/GriddedGraphs.d.ts +1 -0
  12. package/dist/GriddedGraphs.js +1 -1
  13. package/dist/GriddedGraphsFromConfig.d.ts +1 -0
  14. package/dist/MultiGraphDashboard.d.ts +1 -0
  15. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
  16. package/dist/ParetoChart.cjs +1 -1
  17. package/dist/ParetoChart.cjs.map +1 -1
  18. package/dist/ParetoChart.d.ts +4 -0
  19. package/dist/ParetoChart.js +310 -306
  20. package/dist/ParetoChart.js.map +1 -1
  21. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
  22. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
  23. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
  24. package/dist/ScrollStory.d.ts +1 -0
  25. package/dist/SingleGraphDashboard.cjs +1 -1
  26. package/dist/SingleGraphDashboard.d.ts +1 -0
  27. package/dist/SingleGraphDashboard.js +1 -1
  28. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
  29. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
  30. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
  31. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
  32. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
  33. package/dist/ThreeDGlobe.cjs +1 -1
  34. package/dist/ThreeDGlobe.cjs.map +1 -1
  35. package/dist/ThreeDGlobe.js +73 -71
  36. package/dist/ThreeDGlobe.js.map +1 -1
  37. package/dist/Types.d.ts +1 -0
  38. package/dist/index.d.ts +8 -1
  39. package/package.json +1 -1
  40. package/dist/GraphEl-OzC-icbr.cjs +0 -2
  41. package/dist/GraphEl-OzC-icbr.cjs.map +0 -1
  42. package/dist/GraphEl-s3ctz7oA.js.map +0 -1
@@ -1,138 +1,139 @@
1
1
  import { j as i, m as k } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import { useRef as rt, useState as P, useEffect as gt } from "react";
3
- import { p as G, f as Mt } from "./parse-DlCRUFh_.js";
4
- import { s as $t } from "./index-DxagiOHo.js";
5
- import { n as nt } from "./numberFormattingFunction-14YCbkN2.js";
6
- import { T as It } from "./Tooltip-DyM5snqx.js";
7
- import { c as p } from "./checkIfNullOrUndefined-DmfiKkNw.js";
8
- import { X as Tt } from "./XTicksAndGridLines-Bn9u5gOM.js";
9
- import { A as pt } from "./Axis-Ddg-seDi.js";
10
- import { A as jt } from "./AxisTitle-BmHLMRJZ.js";
11
- import { H as Vt } from "./index-Cdcfp4nk.js";
12
- import { t as Ot } from "./time-BzJP5SPC.js";
13
- import { a as At } from "./linear-DUdu7l2G.js";
14
- import { l as bt, c as St } from "./line-CPfhohvF.js";
15
- import { c as Ct, s as Ft, a as Ht, m as Pt } from "./step-BrDul-H4.js";
16
- import { s as Wt } from "./select-DKy99ogv.js";
17
- import { a as Xt } from "./init-BhZylTFx.js";
18
- import { p as Et } from "./pointer-CWRWOsrb.js";
19
- import { u as Yt } from "./use-in-view-yS6jzJAp.js";
2
+ import { useRef as lt, useState as P, useEffect as ft } from "react";
3
+ import { p as G, f as $t } from "./parse-DlCRUFh_.js";
4
+ import { s as It } from "./index-DxagiOHo.js";
5
+ import { n as ot } from "./numberFormattingFunction-14YCbkN2.js";
6
+ import { T as Tt } from "./Tooltip-DyM5snqx.js";
7
+ import { c as g } from "./checkIfNullOrUndefined-DmfiKkNw.js";
8
+ import { X as Vt } from "./XTicksAndGridLines-Bn9u5gOM.js";
9
+ import { A as gt } from "./Axis-Ddg-seDi.js";
10
+ import { A as At } from "./AxisTitle-BmHLMRJZ.js";
11
+ import { H as Ot } from "./index-Cdcfp4nk.js";
12
+ import { t as St } from "./time-BzJP5SPC.js";
13
+ import { a as bt } from "./linear-DUdu7l2G.js";
14
+ import { l as Nt, c as Ct } from "./line-CPfhohvF.js";
15
+ import { c as Ft, s as Ht, a as Pt, m as Wt } from "./step-BrDul-H4.js";
16
+ import { s as Xt } from "./select-DKy99ogv.js";
17
+ import { a as Et } from "./init-BhZylTFx.js";
18
+ import { p as Yt } from "./pointer-CWRWOsrb.js";
19
+ import { u as Gt } from "./use-in-view-yS6jzJAp.js";
20
20
  import { m as N } from "./proxy-CkpFesk1.js";
21
- import { GraphFooter as Gt } from "./GraphFooter.js";
22
- import { GraphHeader as Rt } from "./GraphHeader.js";
23
- import { ColorLegend as Bt } from "./ColorLegend.js";
24
- import { Colors as Nt } from "./Colors.js";
25
- import { E as zt } from "./EmptyState-DdTp-Mdn.js";
26
- function Ut(ot) {
21
+ import { GraphFooter as Rt } from "./GraphFooter.js";
22
+ import { GraphHeader as Bt } from "./GraphHeader.js";
23
+ import { ColorLegend as zt } from "./ColorLegend.js";
24
+ import { Colors as kt } from "./Colors.js";
25
+ import { E as Ut } from "./EmptyState-DdTp-Mdn.js";
26
+ function qt(ct) {
27
27
  const {
28
- data: D,
28
+ data: L,
29
29
  width: A,
30
- height: O,
30
+ height: V,
31
31
  lineColors: s,
32
- labels: y,
32
+ labels: u,
33
33
  sameAxes: m,
34
34
  dateFormat: f,
35
35
  showValues: R,
36
- noOfXTicks: lt,
37
- rightMargin: ct,
36
+ noOfXTicks: mt,
37
+ rightMargin: xt,
38
38
  leftMargin: B,
39
39
  topMargin: z,
40
- bottomMargin: mt,
40
+ bottomMargin: ht,
41
41
  tooltip: v,
42
- highlightAreaSettings: xt,
42
+ highlightAreaSettings: yt,
43
43
  onSeriesMouseOver: W,
44
44
  animate: a,
45
45
  strokeWidth: U,
46
46
  showDots: X,
47
47
  noOfYTicks: q,
48
- lineSuffixes: S,
49
- linePrefixes: C,
48
+ lineSuffixes: O,
49
+ linePrefixes: S,
50
50
  minDate: J,
51
- maxDate: L,
52
- curveType: F,
51
+ maxDate: D,
52
+ curveType: C,
53
53
  styles: o,
54
54
  classNames: n,
55
55
  precision: b,
56
- customLayers: E
57
- } = ot, K = rt(null), d = Yt(K, {
56
+ customLayers: E,
57
+ showAxisLabels: K
58
+ } = ct, Q = lt(null), y = Gt(Q, {
58
59
  once: a.once,
59
60
  amount: a.amount
60
- }), [h, ht] = P(!1);
61
- gt(() => {
62
- if (d && !h) {
61
+ }), [d, F] = P(!1);
62
+ ft(() => {
63
+ if (y && !d) {
63
64
  const t = setTimeout(
64
65
  () => {
65
- ht(!0);
66
+ F(!0);
66
67
  },
67
68
  (a.duration + 0.5) * 1e3
68
69
  );
69
70
  return () => clearTimeout(t);
70
71
  }
71
- }, [d, h, a.duration]);
72
- const M = F === "linear" ? St : F === "step" ? Ct : F === "stepAfter" ? Ft : F === "stepBefore" ? Ht : Pt, [$, Q] = P(void 0), [Z, _] = P(void 0), [tt, it] = P(void 0), g = {
72
+ }, [y, d, a.duration]);
73
+ const Z = C === "linear" ? Ct : C === "step" ? Ft : C === "stepAfter" ? Ht : C === "stepBefore" ? Pt : Wt, [M, _] = P(void 0), [tt, it] = P(void 0), [et, at] = P(void 0), h = {
73
74
  top: z,
74
- bottom: mt,
75
+ bottom: ht,
75
76
  left: B + 50,
76
- right: ct + 65
77
- }, w = rt(null), e = $t(
78
- D.map((t) => ({
77
+ right: xt + 65
78
+ }, w = lt(null), e = It(
79
+ L.map((t) => ({
79
80
  ...t,
80
81
  date: G(`${t.date}`, f, /* @__PURE__ */ new Date())
81
82
  })),
82
83
  "date"
83
- ), yt = xt.map((t) => ({
84
+ ), dt = yt.map((t) => ({
84
85
  ...t,
85
86
  coordinates: [
86
87
  t.coordinates[0] === null ? null : G(`${t.coordinates[0]}`, f, /* @__PURE__ */ new Date()),
87
88
  t.coordinates[1] === null ? null : G(`${t.coordinates[1]}`, f, /* @__PURE__ */ new Date())
88
89
  ]
89
- })), x = A - g.left - g.right, r = O - g.top - g.bottom, et = J ? G(`${J}`, f, /* @__PURE__ */ new Date()) : e[0].date, at = L ? G(`${L}`, f, /* @__PURE__ */ new Date()) : e[e.length - 1].date, H = Math.min(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y1).filter((t) => t != null)) : 0, j = Math.min(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y2).filter((t) => t != null)) : 0, I = Math.max(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y1).filter((t) => t != null)) : 0, l = Math.max(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y2).filter((t) => t != null)) : 0, Y = H < j ? H : j, st = I > l ? I : l, c = Ot().domain([et, at]).range([0, x]), T = At().domain([
90
+ })), x = A - h.left - h.right, r = V - h.top - h.bottom, st = J ? G(`${J}`, f, /* @__PURE__ */ new Date()) : e[0].date, nt = D ? G(`${D}`, f, /* @__PURE__ */ new Date()) : e[e.length - 1].date, H = Math.min(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y1).filter((t) => t != null)) : 0, j = Math.min(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.min(...e.map((t) => t.y2).filter((t) => t != null)) > 0 ? 0 : Math.min(...e.map((t) => t.y2).filter((t) => t != null)) : 0, $ = Math.max(...e.map((t) => t.y1).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y1).filter((t) => t != null)) : 0, l = Math.max(...e.map((t) => t.y2).filter((t) => t != null)) !== 1 / 0 ? Math.max(...e.map((t) => t.y2).filter((t) => t != null)) : 0, Y = H < j ? H : j, rt = $ > l ? $ : l, c = St().domain([st, nt]).range([0, x]), I = bt().domain([
90
91
  m ? Y : H,
91
- m ? st > 0 ? st : 0 : I > 0 ? I : 0
92
- ]).range([r, 0]).nice(), u = At().domain([
92
+ m ? rt > 0 ? rt : 0 : $ > 0 ? $ : 0
93
+ ]).range([r, 0]).nice(), p = bt().domain([
93
94
  m ? Y : j,
94
- m ? st > 0 ? st : 0 : l > 0 ? l : 0
95
- ]).range([r, 0]).nice(), ft = bt().defined((t) => !p(t.y1)).x((t) => c(t.date)).y((t) => T(t.y1)).curve(M), dt = bt().defined((t) => !p(t.y2)).x((t) => c(t.date)).y((t) => u(t.y2)).curve(M), kt = T.ticks(q), Dt = u.ticks(q), vt = c.ticks(lt);
96
- return gt(() => {
97
- const t = (ut) => {
98
- const wt = e[Xt(
99
- e.map((Lt) => Lt.date),
100
- c.invert(Et(ut)[0]),
95
+ m ? rt > 0 ? rt : 0 : l > 0 ? l : 0
96
+ ]).range([r, 0]).nice(), vt = Nt().defined((t) => !g(t.y1)).x((t) => c(t.date)).y((t) => I(t.y1)).curve(Z), ut = Nt().defined((t) => !g(t.y2)).x((t) => c(t.date)).y((t) => p(t.y2)).curve(Z), Lt = I.ticks(q), Dt = p.ticks(q), wt = c.ticks(mt);
97
+ return ft(() => {
98
+ const t = (pt) => {
99
+ const jt = e[Et(
100
+ e.map((Mt) => Mt.date),
101
+ c.invert(Yt(pt)[0]),
101
102
  0
102
103
  )];
103
- Q(wt || e[e.length - 1]), W?.(wt || e[e.length - 1]), it(ut.clientY), _(ut.clientX);
104
- }, V = () => {
105
- Q(void 0), _(void 0), it(void 0), W?.(void 0);
104
+ _(jt || e[e.length - 1]), W?.(jt || e[e.length - 1]), at(pt.clientY), it(pt.clientX);
105
+ }, T = () => {
106
+ _(void 0), it(void 0), at(void 0), W?.(void 0);
106
107
  };
107
- Wt(w.current).on("mousemove", t).on("mouseout", V);
108
+ Xt(w.current).on("mousemove", t).on("mouseout", T);
108
109
  }, [c, e, W]), /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
109
110
  /* @__PURE__ */ i.jsx(
110
111
  N.svg,
111
112
  {
112
113
  width: `${A}px`,
113
- height: `${O}px`,
114
- viewBox: `0 0 ${A} ${O}`,
114
+ height: `${V}px`,
115
+ viewBox: `0 0 ${A} ${V}`,
115
116
  direction: "ltr",
116
- ref: K,
117
- children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${g.left},${g.top})`, children: [
117
+ ref: Q,
118
+ children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${h.left},${h.top})`, children: [
118
119
  /* @__PURE__ */ i.jsx(
119
- Vt,
120
+ Ot,
120
121
  {
121
- areaSettings: yt,
122
+ areaSettings: dt,
122
123
  width: x,
123
124
  height: r,
124
125
  scale: c,
125
126
  animate: a,
126
- isInView: d
127
+ isInView: y
127
128
  }
128
129
  ),
129
130
  /* @__PURE__ */ i.jsxs("g", { children: [
130
- kt.map((t, V) => /* @__PURE__ */ i.jsxs("g", { children: [
131
+ Lt.map((t, T) => /* @__PURE__ */ i.jsxs("g", { children: [
131
132
  /* @__PURE__ */ i.jsx(
132
133
  "line",
133
134
  {
134
- y1: T(t),
135
- y2: T(t),
135
+ y1: I(t),
136
+ y2: I(t),
136
137
  x1: -15,
137
138
  x2: -20,
138
139
  style: {
@@ -147,7 +148,7 @@ function Ut(ot) {
147
148
  "text",
148
149
  {
149
150
  x: -25,
150
- y: T(t),
151
+ y: I(t),
151
152
  dy: "0.33em",
152
153
  className: k("text-xs", n?.yAxis?.labels),
153
154
  style: {
@@ -155,12 +156,12 @@ function Ut(ot) {
155
156
  fill: s[0],
156
157
  ...o?.yAxis?.labels || {}
157
158
  },
158
- children: nt(t, "NA", b, C[0], S[0])
159
+ children: ot(t, "NA", b, S[0], O[0])
159
160
  }
160
161
  )
161
- ] }, V)),
162
+ ] }, T)),
162
163
  /* @__PURE__ */ i.jsx(
163
- pt,
164
+ gt,
164
165
  {
165
166
  y1: 0,
166
167
  y2: r,
@@ -170,25 +171,25 @@ function Ut(ot) {
170
171
  styles: { axis: { stroke: s[0], ...o?.xAxis?.axis || {} } }
171
172
  }
172
173
  ),
173
- /* @__PURE__ */ i.jsx(
174
- jt,
174
+ K ? /* @__PURE__ */ i.jsx(
175
+ At,
175
176
  {
176
- x: 10 - g.left,
177
+ x: 10 - h.left,
177
178
  y: r / 2,
178
179
  style: { fill: s[0], ...o?.yAxis?.title || {} },
179
180
  className: n?.yAxis?.title,
180
- text: y[0].length > 100 ? `${y[0].substring(0, 100)}...` : y[0],
181
+ text: u[0].length > 100 ? `${u[0].substring(0, 100)}...` : u[0],
181
182
  rotate90: !0
182
183
  }
183
- )
184
+ ) : null
184
185
  ] }),
185
186
  /* @__PURE__ */ i.jsxs("g", { children: [
186
- Dt.map((t, V) => /* @__PURE__ */ i.jsxs("g", { children: [
187
+ Dt.map((t, T) => /* @__PURE__ */ i.jsxs("g", { children: [
187
188
  /* @__PURE__ */ i.jsx(
188
189
  "line",
189
190
  {
190
- y1: u(t),
191
- y2: u(t),
191
+ y1: p(t),
192
+ y2: p(t),
192
193
  x1: x + 15,
193
194
  x2: x + 20,
194
195
  style: {
@@ -203,7 +204,7 @@ function Ut(ot) {
203
204
  "text",
204
205
  {
205
206
  x: x + 25,
206
- y: u(t),
207
+ y: p(t),
207
208
  dy: "0.33em",
208
209
  dx: -2,
209
210
  style: {
@@ -212,12 +213,12 @@ function Ut(ot) {
212
213
  ...o?.yAxis?.labels || {}
213
214
  },
214
215
  className: k("text-xs", n?.yAxis?.labels),
215
- children: nt(t, "NA", b, C[1], S[1])
216
+ children: ot(t, "NA", b, S[1], O[1])
216
217
  }
217
218
  )
218
- ] }, V)),
219
+ ] }, T)),
219
220
  /* @__PURE__ */ i.jsx(
220
- pt,
221
+ gt,
221
222
  {
222
223
  y1: 0,
223
224
  y2: r,
@@ -227,21 +228,21 @@ function Ut(ot) {
227
228
  styles: { axis: { stroke: s[1], ...o?.xAxis?.axis || {} } }
228
229
  }
229
230
  ),
230
- /* @__PURE__ */ i.jsx(
231
- jt,
231
+ K ? /* @__PURE__ */ i.jsx(
232
+ At,
232
233
  {
233
- x: x + g.right - 15,
234
+ x: x + h.right - 15,
234
235
  y: r / 2,
235
236
  style: { fill: s[1], ...o?.yAxis?.title || {} },
236
237
  className: n?.yAxis?.title,
237
- text: y[1].length > 100 ? `${y[1].substring(0, 100)}...` : y[1],
238
+ text: u[1].length > 100 ? `${u[1].substring(0, 100)}...` : u[1],
238
239
  rotate90: !0
239
240
  }
240
- )
241
+ ) : null
241
242
  ] }),
242
243
  /* @__PURE__ */ i.jsxs("g", { children: [
243
244
  /* @__PURE__ */ i.jsx(
244
- pt,
245
+ gt,
245
246
  {
246
247
  y1: r,
247
248
  y2: r,
@@ -252,10 +253,10 @@ function Ut(ot) {
252
253
  }
253
254
  ),
254
255
  /* @__PURE__ */ i.jsx(
255
- Tt,
256
+ Vt,
256
257
  {
257
- values: vt.map((t) => Mt(t, f)),
258
- x: vt.map((t) => c(t)),
258
+ values: wt.map((t) => $t(t, f)),
259
+ x: wt.map((t) => c(t)),
259
260
  y1: 0,
260
261
  y2: r,
261
262
  styles: {
@@ -289,18 +290,18 @@ function Ut(ot) {
289
290
  variants: {
290
291
  initial: {
291
292
  pathLength: 0,
292
- d: ft(
293
+ d: vt(
293
294
  e.filter(
294
- (t) => !p(t.y1)
295
+ (t) => !g(t.y1)
295
296
  )
296
297
  ) || "",
297
298
  opacity: 1
298
299
  },
299
300
  whileInView: {
300
301
  pathLength: 1,
301
- d: ft(
302
+ d: vt(
302
303
  e.filter(
303
- (t) => !p(t.y1)
304
+ (t) => !g(t.y1)
304
305
  )
305
306
  ) || "",
306
307
  opacity: 1,
@@ -308,15 +309,15 @@ function Ut(ot) {
308
309
  }
309
310
  },
310
311
  initial: "initial",
311
- animate: d ? "whileInView" : "initial"
312
+ animate: y ? "whileInView" : "initial"
312
313
  }
313
314
  ),
314
315
  /* @__PURE__ */ i.jsx(
315
316
  N.path,
316
317
  {
317
- d: dt(
318
+ d: ut(
318
319
  e.filter(
319
- (t) => !p(t.y2)
320
+ (t) => !g(t.y2)
320
321
  )
321
322
  ) || "",
322
323
  style: {
@@ -328,18 +329,18 @@ function Ut(ot) {
328
329
  variants: {
329
330
  initial: {
330
331
  pathLength: 0,
331
- d: dt(
332
+ d: ut(
332
333
  e.filter(
333
- (t) => !p(t.y2)
334
+ (t) => !g(t.y2)
334
335
  )
335
336
  ) || "",
336
337
  opacity: 1
337
338
  },
338
339
  whileInView: {
339
340
  pathLength: 1,
340
- d: dt(
341
+ d: ut(
341
342
  e.filter(
342
- (t) => !p(t.y2)
343
+ (t) => !g(t.y2)
343
344
  )
344
345
  ) || "",
345
346
  opacity: 1,
@@ -347,16 +348,16 @@ function Ut(ot) {
347
348
  }
348
349
  },
349
350
  initial: "initial",
350
- animate: d ? "whileInView" : "initial"
351
+ animate: y ? "whileInView" : "initial"
351
352
  }
352
353
  ),
353
- $ ? /* @__PURE__ */ i.jsx(
354
+ M ? /* @__PURE__ */ i.jsx(
354
355
  "line",
355
356
  {
356
357
  y1: 0,
357
358
  y2: r,
358
- x1: c($.date),
359
- x2: c($.date),
359
+ x1: c(M.date),
360
+ x2: c(M.date),
360
361
  className: k(
361
362
  "undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",
362
363
  n?.mouseOverLine
@@ -365,8 +366,8 @@ function Ut(ot) {
365
366
  }
366
367
  ) : null
367
368
  ] }),
368
- /* @__PURE__ */ i.jsx("g", { children: e.map((t, V) => /* @__PURE__ */ i.jsxs(N.g, { children: [
369
- p(t.y1) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
369
+ /* @__PURE__ */ i.jsx("g", { children: e.map((t, T) => /* @__PURE__ */ i.jsxs(N.g, { children: [
370
+ g(t.y1) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
370
371
  X ? /* @__PURE__ */ i.jsx(
371
372
  N.circle,
372
373
  {
@@ -374,25 +375,25 @@ function Ut(ot) {
374
375
  style: { fill: s[0] },
375
376
  exit: { opacity: 0, transition: { duration: a.duration } },
376
377
  variants: {
377
- initial: { opacity: 0, cx: c(t.date), cy: T(t.y1) },
378
+ initial: { opacity: 0, cx: c(t.date), cy: I(t.y1) },
378
379
  whileInView: {
379
380
  opacity: 1,
380
381
  transition: {
381
- duration: h ? a.duration : 0.5,
382
- delay: h ? 0 : a.duration
382
+ duration: d ? a.duration : 0.5,
383
+ delay: d ? 0 : a.duration
383
384
  },
384
385
  cx: c(t.date),
385
- cy: T(t.y1)
386
+ cy: I(t.y1)
386
387
  }
387
388
  },
388
389
  initial: "initial",
389
- animate: d ? "whileInView" : "initial"
390
+ animate: y ? "whileInView" : "initial"
390
391
  }
391
392
  ) : null,
392
393
  R ? /* @__PURE__ */ i.jsx(
393
394
  N.text,
394
395
  {
395
- dy: p(t.y2) || t.y2 < t.y1 ? -8 : "1em",
396
+ dy: g(t.y2) || t.y2 < t.y1 ? -8 : "1em",
396
397
  style: {
397
398
  fill: s[0],
398
399
  textAnchor: "middle",
@@ -404,30 +405,30 @@ function Ut(ot) {
404
405
  ),
405
406
  exit: { opacity: 0, transition: { duration: a.duration } },
406
407
  variants: {
407
- initial: { opacity: 0, x: c(t.date), y: u(t.y1) },
408
+ initial: { opacity: 0, x: c(t.date), y: p(t.y1) },
408
409
  whileInView: {
409
410
  opacity: 1,
410
411
  x: c(t.date),
411
- y: u(t.y1),
412
+ y: p(t.y1),
412
413
  transition: {
413
- duration: h ? a.duration : 0.5,
414
- delay: h ? 0 : a.duration
414
+ duration: d ? a.duration : 0.5,
415
+ delay: d ? 0 : a.duration
415
416
  }
416
417
  }
417
418
  },
418
419
  initial: "initial",
419
- animate: d ? "whileInView" : "initial",
420
- children: nt(
420
+ animate: y ? "whileInView" : "initial",
421
+ children: ot(
421
422
  t.y1,
422
423
  "NA",
423
424
  b,
424
- C[0],
425
- S[0]
425
+ S[0],
426
+ O[0]
426
427
  )
427
428
  }
428
429
  ) : null
429
430
  ] }),
430
- p(t.y2) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
431
+ g(t.y2) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
431
432
  X ? /* @__PURE__ */ i.jsx(
432
433
  N.circle,
433
434
  {
@@ -435,25 +436,25 @@ function Ut(ot) {
435
436
  style: { fill: s[1] },
436
437
  exit: { opacity: 0, transition: { duration: a.duration } },
437
438
  variants: {
438
- initial: { opacity: 0, cx: c(t.date), cy: u(t.y2) },
439
+ initial: { opacity: 0, cx: c(t.date), cy: p(t.y2) },
439
440
  whileInView: {
440
441
  opacity: 1,
441
442
  transition: {
442
- duration: h ? a.duration : 0.5,
443
- delay: h ? 0 : a.duration
443
+ duration: d ? a.duration : 0.5,
444
+ delay: d ? 0 : a.duration
444
445
  },
445
446
  cx: c(t.date),
446
- cy: u(t.y2)
447
+ cy: p(t.y2)
447
448
  }
448
449
  },
449
450
  initial: "initial",
450
- animate: d ? "whileInView" : "initial"
451
+ animate: y ? "whileInView" : "initial"
451
452
  }
452
453
  ) : null,
453
454
  R ? /* @__PURE__ */ i.jsx(
454
455
  N.text,
455
456
  {
456
- dy: p(t.y1) || t.y1 < t.y2 ? -8 : "1em",
457
+ dy: g(t.y1) || t.y1 < t.y2 ? -8 : "1em",
457
458
  style: {
458
459
  fill: s[1],
459
460
  textAnchor: "middle",
@@ -465,30 +466,30 @@ function Ut(ot) {
465
466
  ),
466
467
  exit: { opacity: 0, transition: { duration: a.duration } },
467
468
  variants: {
468
- initial: { opacity: 0, x: c(t.date), y: u(t.y2) },
469
+ initial: { opacity: 0, x: c(t.date), y: p(t.y2) },
469
470
  whileInView: {
470
471
  opacity: 1,
471
472
  x: c(t.date),
472
- y: u(t.y2),
473
+ y: p(t.y2),
473
474
  transition: {
474
- duration: h ? a.duration : 0.5,
475
- delay: h ? 0 : a.duration
475
+ duration: d ? a.duration : 0.5,
476
+ delay: d ? 0 : a.duration
476
477
  }
477
478
  }
478
479
  },
479
480
  initial: "initial",
480
- animate: d ? "whileInView" : "initial",
481
- children: nt(
481
+ animate: y ? "whileInView" : "initial",
482
+ children: ot(
482
483
  t.y2,
483
484
  "NA",
484
485
  b,
485
- C[1],
486
- S[1]
486
+ S[1],
487
+ O[1]
487
488
  )
488
489
  }
489
490
  ) : null
490
491
  ] })
491
- ] }, V)) }),
492
+ ] }, T)) }),
492
493
  E.filter((t) => t.position === "after").map((t) => t.layer),
493
494
  /* @__PURE__ */ i.jsx(
494
495
  "rect",
@@ -505,94 +506,95 @@ function Ut(ot) {
505
506
  ] })
506
507
  }
507
508
  ),
508
- $ && v && Z && tt ? /* @__PURE__ */ i.jsx(
509
- It,
509
+ M && v && tt && et ? /* @__PURE__ */ i.jsx(
510
+ Tt,
510
511
  {
511
- data: $,
512
+ data: M,
512
513
  body: v,
513
- xPos: Z,
514
- yPos: tt,
514
+ xPos: tt,
515
+ yPos: et,
515
516
  backgroundStyle: o?.tooltip,
516
517
  className: n?.tooltip
517
518
  }
518
519
  ) : null
519
520
  ] });
520
521
  }
521
- function vi(ot) {
522
+ function wi(ct) {
522
523
  const {
523
- data: D,
524
+ data: L,
524
525
  graphTitle: A,
525
- sources: O,
526
+ sources: V,
526
527
  graphDescription: s,
527
- height: y,
528
+ height: u,
528
529
  width: m,
529
530
  footNote: f,
530
531
  noOfXTicks: R = 10,
531
- dateFormat: lt = "yyyy",
532
- showValues: ct = !1,
532
+ dateFormat: mt = "yyyy",
533
+ showValues: xt = !1,
533
534
  padding: B,
534
535
  lineColors: z = [
535
- Nt.light.categoricalColors.colors[0],
536
- Nt.light.categoricalColors.colors[1]
536
+ kt.light.categoricalColors.colors[0],
537
+ kt.light.categoricalColors.colors[1]
537
538
  ],
538
- sameAxes: mt = !1,
539
+ sameAxes: ht = !1,
539
540
  backgroundColor: v = !1,
540
- leftMargin: xt = 80,
541
+ leftMargin: yt = 80,
541
542
  rightMargin: W = 80,
542
543
  topMargin: a = 20,
543
544
  bottomMargin: U = 25,
544
545
  labels: X,
545
546
  lineSuffixes: q = ["", ""],
546
- linePrefixes: S = ["", ""],
547
- tooltip: C,
547
+ linePrefixes: O = ["", ""],
548
+ tooltip: S,
548
549
  highlightAreaSettings: J = [],
549
- relativeHeight: L,
550
- onSeriesMouseOver: F,
550
+ relativeHeight: D,
551
+ onSeriesMouseOver: C,
551
552
  graphID: o,
552
553
  graphDownload: n = !1,
553
554
  dataDownload: b = !1,
554
555
  animate: E = !1,
555
556
  strokeWidth: K = 2,
556
- showDots: d = !0,
557
- language: h = "en",
558
- showColorScale: ht = !0,
559
- minHeight: M = 0,
560
- colorLegendTitle: $,
561
- theme: Q = "light",
562
- ariaLabel: Z,
563
- noOfYTicks: _ = 5,
564
- maxDate: tt,
565
- minDate: it,
566
- curveType: g = "curve",
567
- styles: w,
568
- classNames: e,
569
- precision: yt = 2,
570
- customLayers: x = []
571
- } = ot, [r, et] = P(0), [at, H] = P(0), j = rt(null), I = rt(null);
572
- return gt(() => {
557
+ showDots: Q = !0,
558
+ language: y = "en",
559
+ showColorScale: d = !0,
560
+ minHeight: F = 0,
561
+ colorLegendTitle: Z,
562
+ theme: M = "light",
563
+ ariaLabel: _,
564
+ noOfYTicks: tt = 5,
565
+ maxDate: it,
566
+ minDate: et,
567
+ curveType: at = "curve",
568
+ styles: h,
569
+ classNames: w,
570
+ precision: e = 2,
571
+ customLayers: dt = [],
572
+ showAxisLabels: x = !0
573
+ } = ct, [r, st] = P(0), [nt, H] = P(0), j = lt(null), $ = lt(null);
574
+ return ft(() => {
573
575
  const l = new ResizeObserver((Y) => {
574
- et(m || Y[0].target.clientWidth || 620), H(y || Y[0].target.clientHeight || 480);
576
+ st(m || Y[0].target.clientWidth || 620), H(u || Y[0].target.clientHeight || 480);
575
577
  });
576
- return j.current && (H(j.current.clientHeight || 480), et(j.current.clientWidth || 620), m || l.observe(j.current)), () => l.disconnect();
577
- }, [m, y]), /* @__PURE__ */ i.jsx(
578
+ return j.current && (H(j.current.clientHeight || 480), st(j.current.clientWidth || 620), m || l.observe(j.current)), () => l.disconnect();
579
+ }, [m, u]), /* @__PURE__ */ i.jsx(
578
580
  "div",
579
581
  {
580
- className: `${Q || "light"} flex ${m ? "w-fit grow-0" : "w-full grow"}`,
581
- dir: h === "he" || h === "ar" ? "rtl" : void 0,
582
+ className: `${M || "light"} flex ${m ? "w-fit grow-0" : "w-full grow"}`,
583
+ dir: y === "he" || y === "ar" ? "rtl" : void 0,
582
584
  children: /* @__PURE__ */ i.jsx(
583
585
  "div",
584
586
  {
585
587
  className: k(
586
- `${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${h || "en"}`,
587
- e?.graphContainer
588
+ `${v ? v === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${y || "en"}`,
589
+ w?.graphContainer
588
590
  ),
589
591
  style: {
590
- ...w?.graphContainer || {},
592
+ ...h?.graphContainer || {},
591
593
  ...v && v !== !0 ? { backgroundColor: v } : {}
592
594
  },
593
595
  id: o,
594
- ref: I,
595
- "aria-label": Z || `${A ? `The graph shows ${A}. ` : ""}This is a line chart that show trends for two datasets over time.${s ? ` ${s}` : ""}`,
596
+ ref: $,
597
+ "aria-label": _ || `${A ? `The graph shows ${A}. ` : ""}This is a line chart that show trends for two datasets over time.${s ? ` ${s}` : ""}`,
596
598
  children: /* @__PURE__ */ i.jsx(
597
599
  "div",
598
600
  {
@@ -600,29 +602,29 @@ function vi(ot) {
600
602
  style: { padding: v ? B || "1rem" : B || 0 },
601
603
  children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
602
604
  A || s || n || b ? /* @__PURE__ */ i.jsx(
603
- Rt,
605
+ Bt,
604
606
  {
605
607
  styles: {
606
- title: w?.title,
607
- description: w?.description
608
+ title: h?.title,
609
+ description: h?.description
608
610
  },
609
611
  classNames: {
610
- title: e?.title,
611
- description: e?.description
612
+ title: w?.title,
613
+ description: w?.description
612
614
  },
613
615
  graphTitle: A,
614
616
  graphDescription: s,
615
617
  width: m,
616
- graphDownload: n ? I.current : void 0,
617
- dataDownload: b ? D.map((l) => l.data).filter((l) => l !== void 0).length > 0 ? D.map((l) => l.data).filter((l) => l !== void 0) : D.filter((l) => l !== void 0) : null
618
+ graphDownload: n ? $.current : void 0,
619
+ dataDownload: b ? L.map((l) => l.data).filter((l) => l !== void 0).length > 0 ? L.map((l) => l.data).filter((l) => l !== void 0) : L.filter((l) => l !== void 0) : null
618
620
  }
619
621
  ) : null,
620
- /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: D.length === 0 ? /* @__PURE__ */ i.jsx(zt, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
621
- ht ? null : /* @__PURE__ */ i.jsx(
622
- Bt,
622
+ /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: L.length === 0 ? /* @__PURE__ */ i.jsx(Ut, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
623
+ d ? null : /* @__PURE__ */ i.jsx(
624
+ zt,
623
625
  {
624
626
  colorDomain: X,
625
- colorLegendTitle: $,
627
+ colorLegendTitle: Z,
626
628
  colors: z,
627
629
  showNAColor: !1
628
630
  }
@@ -633,55 +635,56 @@ function vi(ot) {
633
635
  className: "flex flex-col grow justify-center leading-0",
634
636
  ref: j,
635
637
  "aria-label": "Graph area",
636
- children: (m || r) && (y || at) ? /* @__PURE__ */ i.jsx(
637
- Ut,
638
+ children: (m || r) && (u || nt) ? /* @__PURE__ */ i.jsx(
639
+ qt,
638
640
  {
639
- data: D,
640
- sameAxes: mt,
641
+ data: L,
642
+ sameAxes: ht,
641
643
  lineColors: z,
642
644
  width: m || r,
643
645
  height: Math.max(
644
- M,
645
- y || (L ? M ? (m || r) * L > M ? (m || r) * L : M : (m || r) * L : at)
646
+ F,
647
+ u || (D ? F ? (m || r) * D > F ? (m || r) * D : F : (m || r) * D : nt)
646
648
  ),
647
- dateFormat: lt,
648
- showValues: ct,
649
+ dateFormat: mt,
650
+ showValues: xt,
649
651
  noOfXTicks: R,
650
- leftMargin: xt,
652
+ leftMargin: yt,
651
653
  rightMargin: W,
652
654
  topMargin: a,
653
655
  bottomMargin: U,
654
656
  labels: X,
655
657
  highlightAreaSettings: J,
656
- tooltip: C,
657
- onSeriesMouseOver: F,
658
+ tooltip: S,
659
+ onSeriesMouseOver: C,
658
660
  animate: E === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : E || { duration: 0, once: !0, amount: 0 },
659
661
  strokeWidth: K,
660
- showDots: d,
661
- noOfYTicks: _,
662
+ showDots: Q,
663
+ noOfYTicks: tt,
662
664
  lineSuffixes: q,
663
- linePrefixes: S,
664
- minDate: it,
665
- maxDate: tt,
666
- curveType: g,
667
- styles: w,
668
- classNames: e,
669
- precision: yt,
670
- customLayers: x
665
+ linePrefixes: O,
666
+ minDate: et,
667
+ maxDate: it,
668
+ curveType: at,
669
+ styles: h,
670
+ classNames: w,
671
+ precision: e,
672
+ customLayers: dt,
673
+ showAxisLabels: x
671
674
  }
672
675
  ) : null
673
676
  }
674
677
  )
675
678
  ] }) }),
676
- O || f ? /* @__PURE__ */ i.jsx(
677
- Gt,
679
+ V || f ? /* @__PURE__ */ i.jsx(
680
+ Rt,
678
681
  {
679
- styles: { footnote: w?.footnote, source: w?.source },
682
+ styles: { footnote: h?.footnote, source: h?.source },
680
683
  classNames: {
681
- footnote: e?.footnote,
682
- source: e?.source
684
+ footnote: w?.footnote,
685
+ source: w?.source
683
686
  },
684
- sources: O,
687
+ sources: V,
685
688
  footNote: f,
686
689
  width: m
687
690
  }
@@ -695,6 +698,6 @@ function vi(ot) {
695
698
  );
696
699
  }
697
700
  export {
698
- vi as DualAxisLineChart
701
+ wi as DualAxisLineChart
699
702
  };
700
703
  //# sourceMappingURL=DualAxisLineChart.js.map