@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
@@ -5,12 +5,12 @@ import { l as Wt, a as Ft } from "./simple-statistics-flVzqVtt.js";
5
5
  import { o as Ht } from "./index-DvVprvy6.js";
6
6
  import { n as lt } from "./numberFormattingFunction-14YCbkN2.js";
7
7
  import { T as Yt } from "./Tooltip-CVCGWyzw.js";
8
- import { c as v } from "./checkIfNullOrUndefined-DmfiKkNw.js";
8
+ import { c as j } from "./checkIfNullOrUndefined-DmfiKkNw.js";
9
9
  import { C as Pt, g as Et, A as Xt } from "./customArea-B-dWU0zZ.js";
10
10
  import { A as Gt } from "./AxisTitle-BmHLMRJZ.js";
11
11
  import { A as Bt } from "./Axis-Ddg-seDi.js";
12
12
  import { R as zt } from "./ReferenceLine-CfAW3vKJ.js";
13
- import { R as Ut } from "./RegressionLine-mH7UKOPi.js";
13
+ import { R as Ut } from "./RegressionLine-C2--oMQq.js";
14
14
  import { Y as qt } from "./YTicksAndGridLines-B6ah7CRf.js";
15
15
  import { H as Jt } from "./index-DKCxu1Gh.js";
16
16
  import { t as Kt } from "./time-BzJP5SPC.js";
@@ -27,22 +27,22 @@ import { GraphFooter as li } from "./GraphFooter.js";
27
27
  import { GraphHeader as ci } from "./GraphHeader.js";
28
28
  import { Colors as ct } from "./Colors.js";
29
29
  import { ColorLegend as mi } from "./ColorLegend.js";
30
- import { E as yi } from "./EmptyState-DdTp-Mdn.js";
31
- function xi(yt) {
30
+ import { E as xi } from "./EmptyState-DdTp-Mdn.js";
31
+ function hi(xt) {
32
32
  const {
33
33
  data: V,
34
- width: C,
34
+ width: b,
35
35
  height: W,
36
- lineColor: k,
37
- suffix: L,
38
- prefix: f,
36
+ lineColor: L,
37
+ suffix: D,
38
+ prefix: w,
39
39
  dateFormat: s,
40
- highlightAreaSettings: x,
40
+ highlightAreaSettings: h,
41
41
  showValues: z,
42
- noOfXTicks: xt,
43
- rightMargin: ht,
44
- leftMargin: j,
45
- topMargin: b,
42
+ noOfXTicks: ht,
43
+ rightMargin: yt,
44
+ leftMargin: M,
45
+ topMargin: A,
46
46
  bottomMargin: U,
47
47
  tooltip: q,
48
48
  onSeriesMouseOver: F,
@@ -56,27 +56,27 @@ function xi(yt) {
56
56
  annotations: pt,
57
57
  customHighlightAreaSettings: gt,
58
58
  regressionLine: H,
59
- showIntervalDots: dt,
60
- showIntervalValues: ft,
59
+ showIntervalDots: ft,
60
+ showIntervalValues: dt,
61
61
  intervalLineStrokeWidth: Y,
62
- intervalLineColors: A,
62
+ intervalLineColors: p,
63
63
  intervalAreaColor: wt,
64
64
  intervalAreaOpacity: vt,
65
65
  yAxisTitle: _,
66
66
  noOfYTicks: jt,
67
67
  minDate: P,
68
68
  maxDate: E,
69
- curveType: D,
69
+ curveType: N,
70
70
  styles: c,
71
71
  classNames: m,
72
- precision: N,
72
+ precision: I,
73
73
  customLayers: tt
74
- } = yt, it = mt(null), l = si(it, {
74
+ } = xt, it = mt(null), l = si(it, {
75
75
  once: n.once,
76
76
  amount: n.amount
77
- }), [y, Mt] = R(!1);
77
+ }), [x, Mt] = R(!1);
78
78
  Vt(() => {
79
- if (l && !y) {
79
+ if (l && !x) {
80
80
  const t = setTimeout(
81
81
  () => {
82
82
  Mt(!0);
@@ -85,23 +85,23 @@ function xi(yt) {
85
85
  );
86
86
  return () => clearTimeout(t);
87
87
  }
88
- }, [l, y, n.duration]);
89
- const S = D === "linear" ? Zt : D === "step" ? _t : D === "stepAfter" ? ti : D === "stepBefore" ? ii : ei, [I, et] = R(void 0), [at, nt] = R(void 0), [X, G] = R(void 0), p = {
90
- top: b,
88
+ }, [l, x, n.duration]);
89
+ const S = N === "linear" ? Zt : N === "step" ? _t : N === "stepAfter" ? ti : N === "stepBefore" ? ii : ei, [k, et] = R(void 0), [at, nt] = R(void 0), [X, G] = R(void 0), g = {
90
+ top: A,
91
91
  bottom: U,
92
- left: _ ? j + 30 : j,
93
- right: ht
94
- }, M = mt(null), a = Ht(
95
- V.filter((t) => !v(t.y)).map((t) => ({
92
+ left: _ ? M + 30 : M,
93
+ right: yt
94
+ }, C = mt(null), a = Ht(
95
+ V.filter((t) => !j(t.y)).map((t) => ({
96
96
  date: u(`${t.date}`, s, /* @__PURE__ */ new Date()),
97
97
  y: t.y,
98
- yMin: v(t.yMin) ? t.y : t.yMin,
99
- yMax: v(t.yMax) ? t.y : t.yMax,
98
+ yMin: j(t.yMin) ? t.y : t.yMin,
99
+ yMax: j(t.yMax) ? t.y : t.yMax,
100
100
  data: t.data
101
101
  })),
102
102
  ["date"],
103
103
  ["asc"]
104
- ), Ct = x.map((t) => ({
104
+ ), Ct = h.map((t) => ({
105
105
  ...t,
106
106
  coordinates: [
107
107
  t.coordinates[0] === null ? null : u(`${t.coordinates[0]}`, s, /* @__PURE__ */ new Date()),
@@ -110,12 +110,12 @@ function xi(yt) {
110
110
  })), bt = gt.map((t) => ({
111
111
  ...t,
112
112
  coordinates: t.coordinates.map(
113
- (g, O) => O % 2 === 0 ? u(`${g}`, s, /* @__PURE__ */ new Date()) : g
113
+ (f, O) => O % 2 === 0 ? u(`${f}`, s, /* @__PURE__ */ new Date()) : f
114
114
  )
115
- })), r = C - p.left - p.right, w = W - p.top - p.bottom, ot = P ? u(`${P}`, s, /* @__PURE__ */ new Date()) : a[0].date, rt = E ? u(`${E}`, s, /* @__PURE__ */ new Date()) : a[a.length - 1].date, h = v(K) ? Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) ? Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) > 0 ? 0 : Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) : 0 : K, T = Math.max(...a.map((t) => Math.max(t.y, t.yMax, t.yMin))) ? Math.max(...a.map((t) => Math.max(t.y, t.yMax, t.yMin))) : 0, e = Kt().domain([ot, rt]).range([0, r]), o = Qt().domain([
116
- h,
117
- v(Q) ? T > 0 ? T : 0 : Q
118
- ]).range([w, 0]).nice(), Lt = Ot().x((t) => e(t.date)).y((t) => o(t.y)).curve(S), Dt = Ot().x((t) => e(t.date)).y((t) => o(t.yMin)).curve(S), Nt = Ot().x((t) => e(t.date)).y((t) => o(t.yMax)).curve(S), It = ai().x((t) => e(t.date)).y0((t) => o(t.yMin)).y1((t) => o(t.yMax)).curve(S), kt = o.ticks(jt), St = e.ticks(xt);
115
+ })), r = b - g.left - g.right, v = W - g.top - g.bottom, ot = P ? u(`${P}`, s, /* @__PURE__ */ new Date()) : a[0].date, rt = E ? u(`${E}`, s, /* @__PURE__ */ new Date()) : a[a.length - 1].date, y = j(K) ? Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) ? Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) > 0 ? 0 : Math.min(...a.map((t) => Math.min(t.y, t.yMax, t.yMin))) : 0 : K, T = Math.max(...a.map((t) => Math.max(t.y, t.yMax, t.yMin))) ? Math.max(...a.map((t) => Math.max(t.y, t.yMax, t.yMin))) : 0, e = Kt().domain([ot, rt]).range([0, r]), o = Qt().domain([
116
+ y,
117
+ j(Q) ? T > 0 ? T : 0 : Q
118
+ ]).range([v, 0]).nice(), Lt = Ot().x((t) => e(t.date)).y((t) => o(t.y)).curve(S), Dt = Ot().x((t) => e(t.date)).y((t) => o(t.yMin)).curve(S), Nt = Ot().x((t) => e(t.date)).y((t) => o(t.yMax)).curve(S), It = ai().x((t) => e(t.date)).y0((t) => o(t.yMin)).y1((t) => o(t.yMax)).curve(S), kt = o.ticks(jt), St = e.ticks(ht);
119
119
  Vt(() => {
120
120
  const t = (O) => {
121
121
  const st = a[oi(
@@ -124,30 +124,30 @@ function xi(yt) {
124
124
  0
125
125
  )];
126
126
  et(st || a[a.length - 1]), F?.(st || a[a.length - 1]), G(O.clientY), nt(O.clientX);
127
- }, g = () => {
127
+ }, f = () => {
128
128
  et(void 0), nt(void 0), G(void 0), F?.(void 0);
129
129
  };
130
- ni(M.current).on("mousemove", t).on("mouseout", g);
130
+ ni(C.current).on("mousemove", t).on("mouseout", f);
131
131
  }, [e, a, F]);
132
132
  const Tt = Wt(
133
- a.filter((t) => !v(t.date) && !v(t.y)).map((t) => [e(t.date), o(t.y)])
133
+ a.filter((t) => !j(t.date) && !j(t.y)).map((t) => [e(t.date), o(t.y)])
134
134
  ), $t = Ft(Tt);
135
135
  return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
136
136
  /* @__PURE__ */ i.jsx(
137
137
  d.svg,
138
138
  {
139
- width: `${C}px`,
139
+ width: `${b}px`,
140
140
  height: `${W}px`,
141
- viewBox: `0 0 ${C} ${W}`,
141
+ viewBox: `0 0 ${b} ${W}`,
142
142
  direction: "ltr",
143
143
  ref: it,
144
- children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${p.left},${p.top})`, children: [
144
+ children: /* @__PURE__ */ i.jsxs("g", { transform: `translate(${g.left},${g.top})`, children: [
145
145
  /* @__PURE__ */ i.jsx(
146
146
  Jt,
147
147
  {
148
148
  areaSettings: Ct,
149
149
  width: r,
150
- height: w,
150
+ height: v,
151
151
  scale: e,
152
152
  animate: n,
153
153
  isInView: l
@@ -169,8 +169,8 @@ function xi(yt) {
169
169
  {
170
170
  values: kt.filter((t) => t !== 0),
171
171
  y: kt.filter((t) => t !== 0).map((t) => o(t)),
172
- x1: 0 - j,
173
- x2: r + p.right,
172
+ x1: 0 - M,
173
+ x2: r + g.right,
174
174
  styles: {
175
175
  gridLines: c?.yAxis?.gridLines,
176
176
  labels: c?.yAxis?.labels
@@ -179,31 +179,31 @@ function xi(yt) {
179
179
  gridLines: m?.yAxis?.gridLines,
180
180
  labels: m?.yAxis?.labels
181
181
  },
182
- suffix: L,
183
- prefix: f,
182
+ suffix: D,
183
+ prefix: w,
184
184
  labelType: "secondary",
185
185
  showGridLines: !0,
186
186
  labelPos: "vertical",
187
- precision: N
187
+ precision: I
188
188
  }
189
189
  ),
190
190
  /* @__PURE__ */ i.jsx(
191
191
  Bt,
192
192
  {
193
- y1: o(h < 0 ? 0 : h),
194
- y2: o(h < 0 ? 0 : h),
195
- x1: 0 - j,
196
- x2: r + p.right,
193
+ y1: o(y < 0 ? 0 : y),
194
+ y2: o(y < 0 ? 0 : y),
195
+ x1: 0 - M,
196
+ x2: r + g.right,
197
197
  label: lt(
198
- h < 0 ? 0 : h,
198
+ y < 0 ? 0 : y,
199
199
  "NA",
200
- N,
201
- f,
202
- L
200
+ I,
201
+ w,
202
+ D
203
203
  ),
204
204
  labelPos: {
205
- x: 0 - j,
206
- y: o(h < 0 ? 0 : h),
205
+ x: 0 - M,
206
+ y: o(y < 0 ? 0 : y),
207
207
  dx: 0,
208
208
  dy: T < 0 ? "1em" : -5
209
209
  },
@@ -220,8 +220,8 @@ function xi(yt) {
220
220
  /* @__PURE__ */ i.jsx(
221
221
  Gt,
222
222
  {
223
- x: 0 - j + 15,
224
- y: w / 2,
223
+ x: 0 - M + 15,
224
+ y: v / 2,
225
225
  style: c?.yAxis?.title,
226
226
  className: m?.yAxis?.title,
227
227
  text: _,
@@ -229,17 +229,17 @@ function xi(yt) {
229
229
  }
230
230
  )
231
231
  ] }),
232
- /* @__PURE__ */ i.jsx("g", { children: St.map((t, g) => /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx(
232
+ /* @__PURE__ */ i.jsx("g", { children: St.map((t, f) => /* @__PURE__ */ i.jsx("g", { children: /* @__PURE__ */ i.jsx(
233
233
  "text",
234
234
  {
235
- y: w,
235
+ y: v,
236
236
  x: e(t),
237
237
  style: { textAnchor: "middle" },
238
238
  className: "fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",
239
239
  dy: 15,
240
240
  children: Rt(t, s)
241
241
  }
242
- ) }, g)) }),
242
+ ) }, f)) }),
243
243
  tt.filter((t) => t.position === "before").map((t) => t.layer),
244
244
  /* @__PURE__ */ i.jsx(
245
245
  d.path,
@@ -265,7 +265,7 @@ function xi(yt) {
265
265
  d.path,
266
266
  {
267
267
  style: {
268
- stroke: A[0],
268
+ stroke: p[0],
269
269
  fill: "none",
270
270
  strokeWidth: Y
271
271
  },
@@ -291,7 +291,7 @@ function xi(yt) {
291
291
  d.path,
292
292
  {
293
293
  style: {
294
- stroke: A[1],
294
+ stroke: p[1],
295
295
  fill: "none",
296
296
  strokeWidth: Y
297
297
  },
@@ -318,7 +318,7 @@ function xi(yt) {
318
318
  d.path,
319
319
  {
320
320
  style: {
321
- stroke: k,
321
+ stroke: L,
322
322
  fill: "none",
323
323
  strokeWidth: ut
324
324
  },
@@ -340,13 +340,13 @@ function xi(yt) {
340
340
  animate: l ? "whileInView" : "initial"
341
341
  }
342
342
  ),
343
- I ? /* @__PURE__ */ i.jsx(
343
+ k ? /* @__PURE__ */ i.jsx(
344
344
  "line",
345
345
  {
346
346
  y1: 0,
347
- y2: w,
348
- x1: e(I.date),
349
- x2: e(I.date),
347
+ y2: v,
348
+ x1: e(k.date),
349
+ x2: e(k.date),
350
350
  className: B(
351
351
  "undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",
352
352
  m?.mouseOverLine
@@ -354,20 +354,20 @@ function xi(yt) {
354
354
  style: c?.mouseOverLine
355
355
  }
356
356
  ) : null,
357
- /* @__PURE__ */ i.jsx("g", { children: a.map((t, g) => /* @__PURE__ */ i.jsx(d.g, { children: v(t.y) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
357
+ /* @__PURE__ */ i.jsx("g", { children: a.map((t, f) => /* @__PURE__ */ i.jsx(d.g, { children: j(t.y) ? null : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
358
358
  $ ? /* @__PURE__ */ i.jsx(
359
359
  d.circle,
360
360
  {
361
361
  r: r / a.length < 5 ? 0 : r / a.length < 20 ? 2 : 4,
362
- style: { fill: k },
362
+ style: { fill: L },
363
363
  exit: { opacity: 0, transition: { duration: n.duration } },
364
364
  variants: {
365
365
  initial: { opacity: 0, cx: e(t.date), cy: o(t.y) },
366
366
  whileInView: {
367
367
  opacity: 1,
368
368
  transition: {
369
- duration: y ? n.duration : 0.5,
370
- delay: y ? 0 : n.duration
369
+ duration: x ? n.duration : 0.5,
370
+ delay: x ? 0 : n.duration
371
371
  },
372
372
  cx: e(t.date),
373
373
  cy: o(t.y)
@@ -377,23 +377,28 @@ function xi(yt) {
377
377
  animate: l ? "whileInView" : "initial"
378
378
  }
379
379
  ) : null,
380
- dt ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
380
+ ft ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
381
381
  /* @__PURE__ */ i.jsx(
382
382
  d.circle,
383
383
  {
384
384
  r: r / a.length < 5 ? 0 : r / a.length < 20 ? 2 : 4,
385
- style: { fill: A[0] },
386
385
  exit: { opacity: 0, transition: { duration: n.duration } },
387
386
  variants: {
388
- initial: { opacity: 0, cx: e(t.date), cy: o(t.yMin) },
387
+ initial: {
388
+ opacity: 0,
389
+ fill: p[0],
390
+ cx: e(t.date),
391
+ cy: o(t.yMin)
392
+ },
389
393
  whileInView: {
390
394
  opacity: 1,
391
395
  transition: {
392
- duration: y ? n.duration : 0.5,
393
- delay: y ? 0 : n.duration
396
+ duration: x ? n.duration : 0.5,
397
+ delay: x ? 0 : n.duration
394
398
  },
395
399
  cx: e(t.date),
396
- cy: o(t.yMin)
400
+ cy: o(t.yMin),
401
+ fill: p[0]
397
402
  }
398
403
  },
399
404
  initial: "initial",
@@ -404,15 +409,20 @@ function xi(yt) {
404
409
  d.circle,
405
410
  {
406
411
  r: r / a.length < 5 ? 0 : r / a.length < 20 ? 2 : 4,
407
- style: { fill: A[1] },
408
412
  exit: { opacity: 0, transition: { duration: n.duration } },
409
413
  variants: {
410
- initial: { opacity: 0, cx: e(t.date), cy: o(t.yMax) },
414
+ initial: {
415
+ opacity: 0,
416
+ fill: p[1],
417
+ cx: e(t.date),
418
+ cy: o(t.yMax)
419
+ },
411
420
  whileInView: {
412
421
  opacity: 1,
422
+ fill: p[1],
413
423
  transition: {
414
- duration: y ? n.duration : 0.5,
415
- delay: y ? 0 : n.duration
424
+ duration: x ? n.duration : 0.5,
425
+ delay: x ? 0 : n.duration
416
426
  },
417
427
  cx: e(t.date),
418
428
  cy: o(t.yMax)
@@ -428,7 +438,6 @@ function xi(yt) {
428
438
  {
429
439
  dy: -8,
430
440
  style: {
431
- fill: k,
432
441
  textAnchor: "middle",
433
442
  ...c?.graphObjectValues || {}
434
443
  },
@@ -438,49 +447,55 @@ function xi(yt) {
438
447
  ),
439
448
  exit: { opacity: 0, transition: { duration: n.duration } },
440
449
  variants: {
441
- initial: { opacity: 0, x: e(t.date), y: o(t.y) },
450
+ initial: { opacity: 0, fill: L, x: e(t.date), y: o(t.y) },
442
451
  whileInView: {
443
452
  opacity: 1,
444
453
  x: e(t.date),
454
+ fill: L,
445
455
  y: o(t.y),
446
456
  transition: {
447
- duration: y ? n.duration : 0.5,
448
- delay: y ? 0 : n.duration
457
+ duration: x ? n.duration : 0.5,
458
+ delay: x ? 0 : n.duration
449
459
  }
450
460
  }
451
461
  },
452
462
  initial: "initial",
453
463
  animate: l ? "whileInView" : "initial",
454
- children: lt(t.y, "NA", N, f, L)
464
+ children: lt(t.y, "NA", I, w, D)
455
465
  }
456
466
  ) : null,
457
- ft ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
467
+ dt ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
458
468
  /* @__PURE__ */ i.jsx(
459
469
  d.text,
460
470
  {
461
471
  dy: "1em",
462
472
  style: {
463
- fill: A[0],
464
473
  textAnchor: "middle",
465
474
  ...c?.graphObjectValues || {}
466
475
  },
467
476
  className: B("text-xs font-bold", m?.graphObjectValues),
468
477
  exit: { opacity: 0, transition: { duration: n.duration } },
469
478
  variants: {
470
- initial: { opacity: 0, x: e(t.date), y: o(t.yMin) },
479
+ initial: {
480
+ opacity: 0,
481
+ fill: p[0],
482
+ x: e(t.date),
483
+ y: o(t.yMin)
484
+ },
471
485
  whileInView: {
472
486
  opacity: 1,
473
487
  x: e(t.date),
474
488
  y: o(t.yMin),
489
+ fill: p[0],
475
490
  transition: {
476
- duration: y ? n.duration : 0.5,
477
- delay: y ? 0 : n.duration
491
+ duration: x ? n.duration : 0.5,
492
+ delay: x ? 0 : n.duration
478
493
  }
479
494
  }
480
495
  },
481
496
  initial: "initial",
482
497
  animate: l ? "whileInView" : "initial",
483
- children: lt(t.yMin, "NA", N, f, L)
498
+ children: lt(t.yMin, "NA", I, w, D)
484
499
  }
485
500
  ),
486
501
  /* @__PURE__ */ i.jsx(
@@ -488,47 +503,52 @@ function xi(yt) {
488
503
  {
489
504
  dy: -8,
490
505
  style: {
491
- fill: A[1],
492
506
  textAnchor: "middle",
493
507
  ...c?.graphObjectValues || {}
494
508
  },
495
509
  className: B("text-xs font-bold", m?.graphObjectValues),
496
510
  exit: { opacity: 0, transition: { duration: n.duration } },
497
511
  variants: {
498
- initial: { opacity: 0, x: e(t.date), y: o(t.yMax) },
512
+ initial: {
513
+ opacity: 0,
514
+ fill: p[1],
515
+ x: e(t.date),
516
+ y: o(t.yMax)
517
+ },
499
518
  whileInView: {
500
519
  opacity: 1,
520
+ fill: p[1],
501
521
  x: e(t.date),
502
522
  y: o(t.yMax),
503
523
  transition: {
504
- duration: y ? n.duration : 0.5,
505
- delay: y ? 0 : n.duration
524
+ duration: x ? n.duration : 0.5,
525
+ delay: x ? 0 : n.duration
506
526
  }
507
527
  }
508
528
  },
509
529
  initial: "initial",
510
530
  animate: l ? "whileInView" : "initial",
511
- children: lt(t.yMax, "NA", N, f, L)
531
+ children: lt(t.yMax, "NA", I, w, D)
512
532
  }
513
533
  )
514
534
  ] }) : null
515
- ] }) }, g)) }),
516
- J ? /* @__PURE__ */ i.jsx(i.Fragment, { children: J.map((t, g) => /* @__PURE__ */ i.jsx(
535
+ ] }) }, f)) }),
536
+ J ? /* @__PURE__ */ i.jsx(i.Fragment, { children: J.map((t, f) => /* @__PURE__ */ i.jsx(
517
537
  zt,
518
538
  {
519
539
  text: t.text,
520
540
  color: t.color,
521
541
  y: o(t.value),
522
- x1: 0 - j,
523
- x2: r + p.right,
542
+ x1: 0 - M,
543
+ x2: r + g.right,
524
544
  classNames: t.classNames,
525
545
  styles: t.styles,
526
546
  animate: n,
527
547
  isInView: l
528
548
  },
529
- g
549
+ f
530
550
  )) }) : null,
531
- /* @__PURE__ */ i.jsx("g", { children: pt.map((t, g) => {
551
+ /* @__PURE__ */ i.jsx("g", { children: pt.map((t, f) => {
532
552
  const O = Et(
533
553
  {
534
554
  x: t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
@@ -538,7 +558,7 @@ function xi(yt) {
538
558
  x: t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) : 0,
539
559
  y: t.yCoordinate ? o(t.yCoordinate) : 0
540
560
  },
541
- v(t.connectorRadius) ? 3.5 : t.connectorRadius
561
+ j(t.connectorRadius) ? 3.5 : t.connectorRadius
542
562
  ), st = t.showConnector ? {
543
563
  y1: O.y,
544
564
  x1: O.x,
@@ -546,12 +566,12 @@ function xi(yt) {
546
566
  x2: t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
547
567
  cy: t.yCoordinate ? o(t.yCoordinate) : 0,
548
568
  cx: t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) : 0,
549
- circleRadius: v(t.connectorRadius) ? 3.5 : t.connectorRadius,
569
+ circleRadius: j(t.connectorRadius) ? 3.5 : t.connectorRadius,
550
570
  strokeWidth: t.showConnector === !0 ? 2 : Math.min(t.showConnector || 0, 1)
551
571
  } : void 0, At = {
552
572
  y: t.yCoordinate ? o(t.yCoordinate) + (t.yOffset || 0) - 8 : 0 + (t.yOffset || 0) - 8,
553
573
  x: Z ? 0 : t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0),
554
- width: Z ? t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0) : r + p.right - (t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0)),
574
+ width: Z ? t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0) : r + g.right - (t.xCoordinate ? e(u(`${t.xCoordinate}`, s, /* @__PURE__ */ new Date())) + (t.xOffset || 0) : 0 + (t.xOffset || 0)),
555
575
  maxWidth: t.maxWidth,
556
576
  fontWeight: t.fontWeight,
557
577
  align: t.align
@@ -568,7 +588,7 @@ function xi(yt) {
568
588
  animate: n,
569
589
  isInView: l
570
590
  },
571
- g
591
+ f
572
592
  );
573
593
  }) }),
574
594
  /* @__PURE__ */ i.jsx("g", { children: H ? /* @__PURE__ */ i.jsx(
@@ -578,7 +598,7 @@ function xi(yt) {
578
598
  x2: r,
579
599
  y1: $t(0),
580
600
  y2: $t(r),
581
- graphHeight: w,
601
+ graphHeight: v,
582
602
  graphWidth: r,
583
603
  className: m?.regLine,
584
604
  style: c?.regLine,
@@ -591,22 +611,22 @@ function xi(yt) {
591
611
  /* @__PURE__ */ i.jsx(
592
612
  "rect",
593
613
  {
594
- ref: M,
614
+ ref: C,
595
615
  style: {
596
616
  fill: "none",
597
617
  pointerEvents: "all"
598
618
  },
599
619
  width: r,
600
- height: w
620
+ height: v
601
621
  }
602
622
  )
603
623
  ] })
604
624
  }
605
625
  ),
606
- I && q && at && X ? /* @__PURE__ */ i.jsx(
626
+ k && q && at && X ? /* @__PURE__ */ i.jsx(
607
627
  Yt,
608
628
  {
609
- data: I,
629
+ data: k,
610
630
  body: q,
611
631
  xPos: at,
612
632
  yPos: X,
@@ -616,21 +636,21 @@ function xi(yt) {
616
636
  ) : null
617
637
  ] });
618
638
  }
619
- function Xi(yt) {
639
+ function Xi(xt) {
620
640
  const {
621
641
  data: V,
622
- graphTitle: C,
642
+ graphTitle: b,
623
643
  suffix: W = "",
624
- sources: k,
625
- prefix: L = "",
626
- graphDescription: f,
644
+ sources: L,
645
+ prefix: D = "",
646
+ graphDescription: w,
627
647
  height: s,
628
- width: x,
648
+ width: h,
629
649
  footNote: z,
630
- noOfXTicks: xt = 10,
631
- dateFormat: ht = "yyyy",
632
- showValues: j = !1,
633
- backgroundColor: b = !1,
650
+ noOfXTicks: ht = 10,
651
+ dateFormat: yt = "yyyy",
652
+ showValues: M = !1,
653
+ backgroundColor: A = !1,
634
654
  padding: U,
635
655
  lineColor: q,
636
656
  leftMargin: F = 30,
@@ -644,92 +664,92 @@ function Xi(yt) {
644
664
  onSeriesMouseOver: pt,
645
665
  graphID: gt,
646
666
  minValue: H,
647
- maxValue: dt,
648
- regressionLine: ft = !1,
667
+ maxValue: ft,
668
+ regressionLine: dt = !1,
649
669
  showIntervalDots: Y = !1,
650
- showIntervalValues: A = !1,
670
+ showIntervalValues: p = !1,
651
671
  intervalLineStrokeWidth: wt = 0,
652
672
  intervalLineColors: vt = [ct.light.grays["gray-500"], ct.light.grays["gray-500"]],
653
673
  intervalAreaColor: _ = ct.primaryColors["blue-100"],
654
674
  intervalAreaOpacity: jt = 0.4,
655
675
  graphDownload: P = !1,
656
676
  dataDownload: E = !1,
657
- animate: D = !1,
677
+ animate: N = !1,
658
678
  language: c = "en",
659
679
  minHeight: m = 0,
660
- strokeWidth: N = 2,
680
+ strokeWidth: I = 2,
661
681
  showDots: tt = !0,
662
682
  annotations: it = [],
663
683
  customHighlightAreaSettings: l = [],
664
- theme: y = "light",
684
+ theme: x = "light",
665
685
  ariaLabel: Mt,
666
686
  yAxisTitle: S,
667
- noOfYTicks: I = 5,
687
+ noOfYTicks: k = 5,
668
688
  minDate: et,
669
689
  maxDate: at,
670
690
  colorLegendTitle: nt,
671
691
  colorLegendColors: X,
672
692
  colorLegendDomain: G,
673
- curveType: p = "curve",
674
- styles: M,
693
+ curveType: g = "curve",
694
+ styles: C,
675
695
  classNames: a,
676
696
  precision: Ct = 2,
677
697
  customLayers: bt = []
678
- } = yt, [r, w] = R(0), [ot, rt] = R(0), h = mt(null), T = mt(null);
698
+ } = xt, [r, v] = R(0), [ot, rt] = R(0), y = mt(null), T = mt(null);
679
699
  return Vt(() => {
680
700
  const e = new ResizeObserver((o) => {
681
- w(x || o[0].target.clientWidth || 620), rt(s || o[0].target.clientHeight || 480);
701
+ v(h || o[0].target.clientWidth || 620), rt(s || o[0].target.clientHeight || 480);
682
702
  });
683
- return h.current && (rt(h.current.clientHeight || 480), w(h.current.clientWidth || 620), x || e.observe(h.current)), () => e.disconnect();
684
- }, [x, s]), /* @__PURE__ */ i.jsx(
703
+ return y.current && (rt(y.current.clientHeight || 480), v(y.current.clientWidth || 620), h || e.observe(y.current)), () => e.disconnect();
704
+ }, [h, s]), /* @__PURE__ */ i.jsx(
685
705
  "div",
686
706
  {
687
- className: `${y || "light"} flex ${x ? "w-fit grow-0" : "w-full grow"}`,
707
+ className: `${x || "light"} flex ${h ? "w-fit grow-0" : "w-full grow"}`,
688
708
  dir: c === "he" || c === "ar" ? "rtl" : void 0,
689
709
  children: /* @__PURE__ */ i.jsx(
690
710
  "div",
691
711
  {
692
712
  className: B(
693
- `${b ? b === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c || "en"}`,
694
- x ? "w-fit" : "w-full",
713
+ `${A ? A === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c || "en"}`,
714
+ h ? "w-fit" : "w-full",
695
715
  a?.graphContainer
696
716
  ),
697
717
  style: {
698
- ...M?.graphContainer || {},
699
- ...b && b !== !0 ? { backgroundColor: b } : {}
718
+ ...C?.graphContainer || {},
719
+ ...A && A !== !0 ? { backgroundColor: A } : {}
700
720
  },
701
721
  id: gt,
702
722
  ref: T,
703
- "aria-label": Mt || `${C ? `The graph shows ${C}. ` : ""}This is a line chart that highlights the difference between two datasets over time.${f ? ` ${f}` : ""}`,
723
+ "aria-label": Mt || `${b ? `The graph shows ${b}. ` : ""}This is a line chart that highlights the difference between two datasets over time.${w ? ` ${w}` : ""}`,
704
724
  children: /* @__PURE__ */ i.jsx(
705
725
  "div",
706
726
  {
707
727
  className: "flex grow",
708
- style: { padding: b ? U || "1rem" : U || 0 },
728
+ style: { padding: A ? U || "1rem" : U || 0 },
709
729
  children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
710
- C || f || P || E ? /* @__PURE__ */ i.jsx(
730
+ b || w || P || E ? /* @__PURE__ */ i.jsx(
711
731
  ci,
712
732
  {
713
733
  styles: {
714
- title: M?.title,
715
- description: M?.description
734
+ title: C?.title,
735
+ description: C?.description
716
736
  },
717
737
  classNames: {
718
738
  title: a?.title,
719
739
  description: a?.description
720
740
  },
721
- graphTitle: C,
722
- graphDescription: f,
723
- width: x,
741
+ graphTitle: b,
742
+ graphDescription: w,
743
+ width: h,
724
744
  graphDownload: P ? T.current : void 0,
725
745
  dataDownload: E ? V.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? V.map((e) => e.data).filter((e) => e !== void 0) : V.filter((e) => e !== void 0) : null
726
746
  }
727
747
  ) : null,
728
- /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: V.length === 0 ? /* @__PURE__ */ i.jsx(yi, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
748
+ /* @__PURE__ */ i.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: V.length === 0 ? /* @__PURE__ */ i.jsx(xi, {}) : /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
729
749
  X && G ? /* @__PURE__ */ i.jsx(
730
750
  mi,
731
751
  {
732
- width: x,
752
+ width: h,
733
753
  colorLegendTitle: nt,
734
754
  colors: X,
735
755
  colorDomain: G,
@@ -740,23 +760,23 @@ function Xi(yt) {
740
760
  "div",
741
761
  {
742
762
  className: "flex flex-col grow justify-center leading-0",
743
- ref: h,
763
+ ref: y,
744
764
  "aria-label": "Graph area",
745
- children: (x || r) && (s || ot) ? /* @__PURE__ */ i.jsx(
746
- xi,
765
+ children: (h || r) && (s || ot) ? /* @__PURE__ */ i.jsx(
766
+ hi,
747
767
  {
748
768
  data: V,
749
769
  lineColor: q || ct.primaryColors["blue-600"],
750
- width: x || r,
770
+ width: h || r,
751
771
  height: Math.max(
752
772
  m,
753
- s || ($ ? m ? (x || r) * $ > m ? (x || r) * $ : m : (x || r) * $ : ot)
773
+ s || ($ ? m ? (h || r) * $ > m ? (h || r) * $ : m : (h || r) * $ : ot)
754
774
  ),
755
775
  suffix: W,
756
- prefix: L,
757
- dateFormat: ht,
758
- showValues: j,
759
- noOfXTicks: xt,
776
+ prefix: D,
777
+ dateFormat: yt,
778
+ showValues: M,
779
+ noOfXTicks: ht,
760
780
  leftMargin: F,
761
781
  rightMargin: J,
762
782
  topMargin: K,
@@ -766,26 +786,26 @@ function Xi(yt) {
766
786
  onSeriesMouseOver: pt,
767
787
  refValues: Z,
768
788
  minValue: H,
769
- maxValue: dt,
770
- animate: D === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : D || { duration: 0, once: !0, amount: 0 },
789
+ maxValue: ft,
790
+ animate: N === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : N || { duration: 0, once: !0, amount: 0 },
771
791
  rtl: c === "he" || c === "ar",
772
- strokeWidth: N,
792
+ strokeWidth: I,
773
793
  showDots: tt,
774
794
  annotations: it,
775
795
  customHighlightAreaSettings: l,
776
- regressionLine: ft,
796
+ regressionLine: dt,
777
797
  showIntervalDots: Y,
778
- showIntervalValues: A,
798
+ showIntervalValues: p,
779
799
  intervalLineStrokeWidth: wt,
780
800
  intervalLineColors: vt,
781
801
  intervalAreaColor: _,
782
802
  intervalAreaOpacity: jt,
783
803
  yAxisTitle: S,
784
- noOfYTicks: I,
804
+ noOfYTicks: k,
785
805
  minDate: et,
786
806
  maxDate: at,
787
- curveType: p,
788
- styles: M,
807
+ curveType: g,
808
+ styles: C,
789
809
  classNames: a,
790
810
  precision: Ct,
791
811
  customLayers: bt
@@ -794,17 +814,17 @@ function Xi(yt) {
794
814
  }
795
815
  )
796
816
  ] }) }),
797
- k || z ? /* @__PURE__ */ i.jsx(
817
+ L || z ? /* @__PURE__ */ i.jsx(
798
818
  li,
799
819
  {
800
- styles: { footnote: M?.footnote, source: M?.source },
820
+ styles: { footnote: C?.footnote, source: C?.source },
801
821
  classNames: {
802
822
  footnote: a?.footnote,
803
823
  source: a?.source
804
824
  },
805
- sources: k,
825
+ sources: L,
806
826
  footNote: z,
807
- width: x
827
+ width: h
808
828
  }
809
829
  ) : null
810
830
  ] })