@undp/data-viz 1.5.2 → 1.5.3

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 (228) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.cjs.map +1 -1
  3. package/dist/AreaChart.js +3 -2
  4. package/dist/AreaChart.js.map +1 -1
  5. package/dist/BarGraph.cjs +1 -1
  6. package/dist/BarGraph.cjs.map +1 -1
  7. package/dist/BarGraph.js +1196 -1224
  8. package/dist/BarGraph.js.map +1 -1
  9. package/dist/BeeSwarmChart.cjs +1 -1
  10. package/dist/BeeSwarmChart.cjs.map +1 -1
  11. package/dist/BeeSwarmChart.js +130 -142
  12. package/dist/BeeSwarmChart.js.map +1 -1
  13. package/dist/BiVariateChoroplethMap.cjs +1 -1
  14. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  15. package/dist/BiVariateChoroplethMap.js +41 -41
  16. package/dist/BiVariateChoroplethMap.js.map +1 -1
  17. package/dist/BulletChart.cjs +1 -1
  18. package/dist/BulletChart.cjs.map +1 -1
  19. package/dist/BulletChart.js +483 -487
  20. package/dist/BulletChart.js.map +1 -1
  21. package/dist/ButterflyChart.cjs +1 -1
  22. package/dist/ButterflyChart.cjs.map +1 -1
  23. package/dist/ButterflyChart.js +99 -99
  24. package/dist/ButterflyChart.js.map +1 -1
  25. package/dist/ChoroplethMap.cjs +1 -1
  26. package/dist/ChoroplethMap.cjs.map +1 -1
  27. package/dist/ChoroplethMap.js +125 -125
  28. package/dist/ChoroplethMap.js.map +1 -1
  29. package/dist/CirclePackingGraph.cjs +1 -1
  30. package/dist/CirclePackingGraph.js +2 -2
  31. package/dist/DataCards.cjs +2 -2
  32. package/dist/DataCards.cjs.map +1 -1
  33. package/dist/DataCards.js +6 -6
  34. package/dist/DataCards.js.map +1 -1
  35. package/dist/DataTable.cjs +1 -1
  36. package/dist/DataTable.cjs.map +1 -1
  37. package/dist/DataTable.js +66 -68
  38. package/dist/DataTable.js.map +1 -1
  39. package/dist/DifferenceLineChart.cjs +1 -1
  40. package/dist/DifferenceLineChart.cjs.map +1 -1
  41. package/dist/DifferenceLineChart.js +3 -2
  42. package/dist/DifferenceLineChart.js.map +1 -1
  43. package/dist/DonutChart.cjs +1 -1
  44. package/dist/DonutChart.cjs.map +1 -1
  45. package/dist/DonutChart.js +205 -205
  46. package/dist/DonutChart.js.map +1 -1
  47. package/dist/DotDensityMap.cjs +1 -1
  48. package/dist/DotDensityMap.cjs.map +1 -1
  49. package/dist/DotDensityMap.js +78 -81
  50. package/dist/DotDensityMap.js.map +1 -1
  51. package/dist/DualAxisLineChart.cjs +1 -1
  52. package/dist/DualAxisLineChart.cjs.map +1 -1
  53. package/dist/DualAxisLineChart.js +3 -2
  54. package/dist/DualAxisLineChart.js.map +1 -1
  55. package/dist/DumbbellChart.cjs +1 -1
  56. package/dist/DumbbellChart.cjs.map +1 -1
  57. package/dist/DumbbellChart.js +64 -65
  58. package/dist/DumbbellChart.js.map +1 -1
  59. package/dist/GeoHubMap.cjs +1 -1
  60. package/dist/GeoHubMap.js +1 -1
  61. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  62. package/dist/GeoHubMapWithLayerSelection.js +1 -1
  63. package/dist/{GraphEl-4RUlclvW.cjs → GraphEl-BcYgMnN2.cjs} +2 -2
  64. package/dist/{GraphEl-4RUlclvW.cjs.map → GraphEl-BcYgMnN2.cjs.map} +1 -1
  65. package/dist/{GraphEl-ClIxlWa3.js → GraphEl-CMWeARJ3.js} +2 -2
  66. package/dist/{GraphEl-ClIxlWa3.js.map → GraphEl-CMWeARJ3.js.map} +1 -1
  67. package/dist/GriddedGraphs.cjs +1 -1
  68. package/dist/GriddedGraphs.js +4 -4
  69. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  70. package/dist/GriddedGraphsFromConfig.js +1 -1
  71. package/dist/HeatMap.cjs +1 -1
  72. package/dist/HeatMap.cjs.map +1 -1
  73. package/dist/HeatMap.js +83 -83
  74. package/dist/HeatMap.js.map +1 -1
  75. package/dist/Histogram.cjs +1 -1
  76. package/dist/Histogram.js +1 -1
  77. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  78. package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
  79. package/dist/LineChartWithConfidenceInterval.js +7 -6
  80. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  81. package/dist/MultiGraphDashboard.cjs +1 -1
  82. package/dist/MultiGraphDashboard.js +2 -2
  83. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  84. package/dist/MultiGraphDashboardFromConfig.js +1 -1
  85. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  86. package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
  87. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  88. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +1 -1
  89. package/dist/MultiLineAltChart.cjs +1 -1
  90. package/dist/MultiLineAltChart.cjs.map +1 -1
  91. package/dist/MultiLineAltChart.js +82 -91
  92. package/dist/MultiLineAltChart.js.map +1 -1
  93. package/dist/MultiLineChart.cjs +1 -1
  94. package/dist/MultiLineChart.cjs.map +1 -1
  95. package/dist/MultiLineChart.js +3 -2
  96. package/dist/MultiLineChart.js.map +1 -1
  97. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  98. package/dist/PerformanceIntensiveMultiGraphDashboard.js +2 -2
  99. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  100. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +1 -1
  101. package/dist/RadarChart.cjs +1 -1
  102. package/dist/RadarChart.cjs.map +1 -1
  103. package/dist/RadarChart.js +124 -130
  104. package/dist/RadarChart.js.map +1 -1
  105. package/dist/SankeyChart.cjs +1 -1
  106. package/dist/SankeyChart.cjs.map +1 -1
  107. package/dist/SankeyChart.js +200 -200
  108. package/dist/SankeyChart.js.map +1 -1
  109. package/dist/ScatterPlot.cjs +1 -1
  110. package/dist/ScatterPlot.cjs.map +1 -1
  111. package/dist/ScatterPlot.js +149 -155
  112. package/dist/ScatterPlot.js.map +1 -1
  113. package/dist/SimpleLineChart.cjs +1 -1
  114. package/dist/SimpleLineChart.cjs.map +1 -1
  115. package/dist/SimpleLineChart.js +44 -43
  116. package/dist/SimpleLineChart.js.map +1 -1
  117. package/dist/SingleGraphDashboard.cjs +1 -1
  118. package/dist/SingleGraphDashboard.js +4 -4
  119. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  120. package/dist/SingleGraphDashboardFromConfig.js +1 -1
  121. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  122. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +1 -1
  123. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  124. package/dist/SingleGraphDashboardThreeDGraphs.js +3 -3
  125. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  126. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +1 -1
  127. package/dist/SlopeChart.cjs +1 -1
  128. package/dist/SlopeChart.cjs.map +1 -1
  129. package/dist/SlopeChart.js +107 -113
  130. package/dist/SlopeChart.js.map +1 -1
  131. package/dist/SparkLine.cjs +1 -1
  132. package/dist/SparkLine.cjs.map +1 -1
  133. package/dist/SparkLine.js +3 -2
  134. package/dist/SparkLine.js.map +1 -1
  135. package/dist/StripChart.cjs +1 -1
  136. package/dist/StripChart.cjs.map +1 -1
  137. package/dist/StripChart.js +159 -159
  138. package/dist/StripChart.js.map +1 -1
  139. package/dist/ThreeDGlobe.cjs +1 -1
  140. package/dist/ThreeDGlobe.cjs.map +1 -1
  141. package/dist/ThreeDGlobe.js +3 -3
  142. package/dist/ThreeDGlobe.js.map +1 -1
  143. package/dist/TreeMapGraph.cjs +1 -1
  144. package/dist/TreeMapGraph.cjs.map +1 -1
  145. package/dist/TreeMapGraph.js +194 -200
  146. package/dist/TreeMapGraph.js.map +1 -1
  147. package/dist/ensureCompleteData-DkQYPeDa.cjs +2 -0
  148. package/dist/ensureCompleteData-DkQYPeDa.cjs.map +1 -0
  149. package/dist/{ensureCompleteData-BALdOrsS.js → ensureCompleteData-DlmibgaI.js} +28 -8
  150. package/dist/ensureCompleteData-DlmibgaI.js.map +1 -0
  151. package/dist/fetchAndParseData-Ba-_CgxS.cjs +16 -0
  152. package/dist/fetchAndParseData-Ba-_CgxS.cjs.map +1 -0
  153. package/dist/fetchAndParseData-sapWbnYk.js +583 -0
  154. package/dist/fetchAndParseData-sapWbnYk.js.map +1 -0
  155. package/dist/fetchAndParseData.cjs +1 -1
  156. package/dist/fetchAndParseData.js +1 -1
  157. package/dist/getJenks-BbngDoBQ.js +19 -0
  158. package/dist/getJenks-BbngDoBQ.js.map +1 -0
  159. package/dist/getJenks-GYmdwBqm.cjs +2 -0
  160. package/dist/getJenks-GYmdwBqm.cjs.map +1 -0
  161. package/dist/getSliderMarks-9cNoRkDx.js +1023 -0
  162. package/dist/getSliderMarks-9cNoRkDx.js.map +1 -0
  163. package/dist/getSliderMarks-CRIbTGYV.cjs +6 -0
  164. package/dist/getSliderMarks-CRIbTGYV.cjs.map +1 -0
  165. package/dist/getUniqValue-DiCh_MOD.js +13 -0
  166. package/dist/getUniqValue-DiCh_MOD.js.map +1 -0
  167. package/dist/getUniqValue-RViz8tTw.cjs +2 -0
  168. package/dist/getUniqValue-RViz8tTw.cjs.map +1 -0
  169. package/dist/{index-BMgDMxKJ.js → index-37q0ULNQ.js} +44 -50
  170. package/dist/index-37q0ULNQ.js.map +1 -0
  171. package/dist/index-CVlCtJbC.cjs +2 -0
  172. package/dist/index-CVlCtJbC.cjs.map +1 -0
  173. package/dist/index.cjs +1 -1
  174. package/dist/index.d.ts +1 -1
  175. package/dist/index.js +6 -6
  176. package/dist/sort-DfK1b0F5.js +34 -0
  177. package/dist/sort-DfK1b0F5.js.map +1 -0
  178. package/dist/sort-O96oMZLb.cjs +2 -0
  179. package/dist/sort-O96oMZLb.cjs.map +1 -0
  180. package/dist/transformData.cjs +1 -1
  181. package/dist/transformData.js +3 -3
  182. package/dist/transformDataForAggregation-KXGm6flX.cjs +2 -0
  183. package/dist/{transformDataForAggregation-BVxVu4yY.cjs.map → transformDataForAggregation-KXGm6flX.cjs.map} +1 -1
  184. package/dist/{transformDataForAggregation-1BYVFqvF.js → transformDataForAggregation-sBpdlX8n.js} +40 -44
  185. package/dist/{transformDataForAggregation-1BYVFqvF.js.map → transformDataForAggregation-sBpdlX8n.js.map} +1 -1
  186. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js → transformDataForGraphFromFile-ComYvzuz.js} +3 -3
  187. package/dist/{transformDataForGraphFromFile-BC9Ha8hF.js.map → transformDataForGraphFromFile-ComYvzuz.js.map} +1 -1
  188. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs → transformDataForGraphFromFile-DVZodTHd.cjs} +2 -2
  189. package/dist/{transformDataForGraphFromFile-b41aNQYY.cjs.map → transformDataForGraphFromFile-DVZodTHd.cjs.map} +1 -1
  190. package/dist/uniqBy-BHy4I8PK.js +8 -0
  191. package/dist/uniqBy-BHy4I8PK.js.map +1 -0
  192. package/dist/uniqBy-O05lp2S5.cjs +2 -0
  193. package/dist/uniqBy-O05lp2S5.cjs.map +1 -0
  194. package/dist/utils.cjs +1 -1
  195. package/dist/utils.d.ts +1 -1
  196. package/dist/utils.js +2 -2
  197. package/package.json +1 -7
  198. package/dist/ensureCompleteData-BALdOrsS.js.map +0 -1
  199. package/dist/ensureCompleteData-BU5Zlccy.cjs +0 -2
  200. package/dist/ensureCompleteData-BU5Zlccy.cjs.map +0 -1
  201. package/dist/fetchAndParseData-DBOl1Icl.js +0 -1196
  202. package/dist/fetchAndParseData-DBOl1Icl.js.map +0 -1
  203. package/dist/fetchAndParseData-Dcy7AS_0.cjs +0 -16
  204. package/dist/fetchAndParseData-Dcy7AS_0.cjs.map +0 -1
  205. package/dist/getJenks-DW96UYNE.js +0 -23
  206. package/dist/getJenks-DW96UYNE.js.map +0 -1
  207. package/dist/getJenks-vofIZmeb.cjs +0 -2
  208. package/dist/getJenks-vofIZmeb.cjs.map +0 -1
  209. package/dist/getSliderMarks-C0jptXeP.js +0 -1054
  210. package/dist/getSliderMarks-C0jptXeP.js.map +0 -1
  211. package/dist/getSliderMarks-CtsEXiLV.cjs +0 -6
  212. package/dist/getSliderMarks-CtsEXiLV.cjs.map +0 -1
  213. package/dist/getUniqValue-CfuE_l9c.cjs +0 -2
  214. package/dist/getUniqValue-CfuE_l9c.cjs.map +0 -1
  215. package/dist/getUniqValue-CttuU_wn.js +0 -20
  216. package/dist/getUniqValue-CttuU_wn.js.map +0 -1
  217. package/dist/index-AqnpA7_O.js +0 -631
  218. package/dist/index-AqnpA7_O.js.map +0 -1
  219. package/dist/index-BJOeaYTk.cjs +0 -2
  220. package/dist/index-BJOeaYTk.cjs.map +0 -1
  221. package/dist/index-BMgDMxKJ.js.map +0 -1
  222. package/dist/index-DYH8g9WA.cjs +0 -2
  223. package/dist/index-DYH8g9WA.cjs.map +0 -1
  224. package/dist/index-Da2GUKrr.cjs +0 -2
  225. package/dist/index-Da2GUKrr.cjs.map +0 -1
  226. package/dist/index-fwdktvAS.js +0 -707
  227. package/dist/index-fwdktvAS.js.map +0 -1
  228. package/dist/transformDataForAggregation-BVxVu4yY.cjs +0 -2
@@ -1,30 +1,31 @@
1
1
  import { j as e, m as et } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
2
  import { useRef as gt, useState as S, useEffect as yt } from "react";
3
- import { s as Nt, g as At, x as Ct } from "./getSliderMarks-C0jptXeP.js";
4
- import { p as kt, f as Lt } from "./parse-DlCRUFh_.js";
5
- import { u as Vt } from "./index-AqnpA7_O.js";
6
- import { i as vt } from "./index-Bwrro8-q.js";
7
- import { X as Tt } from "./Modal-DVVwpKhP.js";
8
- import { n as bt } from "./numberFormattingFunction-14YCbkN2.js";
9
- import { T as Ot } from "./Tooltip-CVCGWyzw.js";
10
- import { s as Dt } from "./string2HTML-oFCROsus.js";
3
+ import { g as Nt, x as At } from "./getSliderMarks-9cNoRkDx.js";
4
+ import { p as Ct, f as kt } from "./parse-DlCRUFh_.js";
5
+ import { i as bt } from "./index-Bwrro8-q.js";
6
+ import { X as Lt } from "./Modal-DVVwpKhP.js";
7
+ import { n as vt } from "./numberFormattingFunction-14YCbkN2.js";
8
+ import { T as Vt } from "./Tooltip-CVCGWyzw.js";
9
+ import { s as Tt } from "./string2HTML-oFCROsus.js";
11
10
  import { X as wt } from "./XTicksAndGridLines-Bn9u5gOM.js";
12
11
  import { A as jt } from "./Axis-Ddg-seDi.js";
13
- import { Y as It } from "./YAxesLabels-CPGZjmZJ.js";
12
+ import { Y as Ot } from "./YAxesLabels-CPGZjmZJ.js";
14
13
  import { a as Bt } from "./ReferenceLine-CfAW3vKJ.js";
15
- import { b as St } from "./band-BEjh2CHI.js";
14
+ import { b as Dt } from "./band-BEjh2CHI.js";
16
15
  import { a as Mt } from "./linear-DUdu7l2G.js";
17
- import { u as Ft } from "./use-in-view-yS6jzJAp.js";
16
+ import { u as It } from "./use-in-view-yS6jzJAp.js";
18
17
  import { m as I } from "./proxy-CkpFesk1.js";
19
- import { A as xt } from "./index-CNvov0eg.js";
20
- import { GraphFooter as Ht } from "./GraphFooter.js";
21
- import { GraphHeader as Pt } from "./GraphHeader.js";
22
- import { ColorLegend as Rt } from "./ColorLegend.js";
18
+ import { A as dt } from "./index-CNvov0eg.js";
19
+ import { GraphFooter as St } from "./GraphFooter.js";
20
+ import { GraphHeader as Ft } from "./GraphHeader.js";
21
+ import { ColorLegend as Ht } from "./ColorLegend.js";
23
22
  import { Colors as $t } from "./Colors.js";
24
- import { E as Xt } from "./EmptyState-DdTp-Mdn.js";
25
- import { P as Et, f as Gt } from "./index-BmCqpO1B.js";
23
+ import { E as Pt } from "./EmptyState-DdTp-Mdn.js";
24
+ import { P as Rt, f as Xt } from "./index-BmCqpO1B.js";
26
25
  import { c as ut } from "./checkIfNullOrUndefined-DmfiKkNw.js";
27
- import { a as Yt } from "./ensureCompleteData-BALdOrsS.js";
26
+ import { a as Et } from "./ensureCompleteData-DlmibgaI.js";
27
+ import { u as Gt } from "./uniqBy-BHy4I8PK.js";
28
+ import { s as Yt } from "./sort-DfK1b0F5.js";
28
29
  import { c as Wt } from "./init-BhZylTFx.js";
29
30
  function zt(z) {
30
31
  const {
@@ -32,7 +33,7 @@ function zt(z) {
32
33
  width: y,
33
34
  height: j,
34
35
  barColors: m,
35
- centerGap: x,
36
+ centerGap: d,
36
37
  refValues: s,
37
38
  maxValue: B,
38
39
  minValue: q,
@@ -55,21 +56,21 @@ function zt(z) {
55
56
  styles: u,
56
57
  classNames: l,
57
58
  noOfTicks: N,
58
- animate: d,
59
+ animate: x,
59
60
  precision: G,
60
61
  customLayers: rt,
61
62
  minValueLeftBar: L,
62
63
  minValueRightBar: V,
63
64
  naLabel: K
64
- } = z, Q = gt(null), v = Ft(Q, {
65
- once: d.once,
66
- amount: d.amount
67
- }), [st, b] = S(void 0), [T, P] = S(void 0), [lt, O] = S(void 0), [A, f] = S(void 0), h = {
65
+ } = z, Q = gt(null), b = It(Q, {
66
+ once: x.once,
67
+ amount: x.amount
68
+ }), [st, v] = S(void 0), [T, P] = S(void 0), [lt, O] = S(void 0), [A, f] = S(void 0), h = {
68
69
  top: _,
69
70
  bottom: ct,
70
71
  left: ot,
71
72
  right: nt
72
- }, C = y - h.left - h.right, w = j - h.top - h.bottom, Y = c.map((t, r) => ({ ...t, id: `${r}` })), a = St().domain(Y.map((t) => `${t.id}`)).range([w, 0]).paddingInner(mt), o = Mt().domain([q, B]).range([0, (C - x) / 2]).nice(), D = o.ticks(N), n = Mt().domain([q, B]).range([(C - x) / 2, 0]).nice(), Z = n.ticks(N);
73
+ }, C = y - h.left - h.right, w = j - h.top - h.bottom, Y = c.map((t, r) => ({ ...t, id: `${r}` })), a = Dt().domain(Y.map((t) => `${t.id}`)).range([w, 0]).paddingInner(mt), o = Mt().domain([q, B]).range([0, (C - d) / 2]).nice(), D = o.ticks(N), n = Mt().domain([q, B]).range([(C - d) / 2, 0]).nice(), Z = n.ticks(N);
73
74
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
74
75
  /* @__PURE__ */ e.jsx(
75
76
  I.svg,
@@ -105,23 +106,23 @@ function zt(z) {
105
106
  precision: G
106
107
  }
107
108
  ) : null,
108
- /* @__PURE__ */ e.jsxs(xt, { children: [
109
+ /* @__PURE__ */ e.jsxs(dt, { children: [
109
110
  Y.map((t, r) => /* @__PURE__ */ e.jsxs(
110
111
  I.g,
111
112
  {
112
113
  className: "undp-viz-g-with-hover",
113
114
  opacity: 0.85,
114
115
  onMouseEnter: (p) => {
115
- b(t), f(p.clientY), O(p.clientX), F?.(t);
116
+ v(t), f(p.clientY), O(p.clientX), F?.(t);
116
117
  },
117
118
  onClick: () => {
118
- (k || $) && (vt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
119
+ (k || $) && (bt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
119
120
  },
120
121
  onMouseMove: (p) => {
121
- b(t), f(p.clientY), O(p.clientX);
122
+ v(t), f(p.clientY), O(p.clientX);
122
123
  },
123
124
  onMouseLeave: () => {
124
- b(void 0), O(void 0), f(void 0), F?.(void 0);
125
+ v(void 0), O(void 0), f(void 0), F?.(void 0);
125
126
  },
126
127
  children: [
127
128
  t.leftBar ? /* @__PURE__ */ e.jsx(
@@ -138,15 +139,15 @@ function zt(z) {
138
139
  whileInView: {
139
140
  x: t.leftBar < 0 ? n(0) : n(t.leftBar),
140
141
  width: t.leftBar < 0 ? n(t.leftBar) - n(0) : n(0) - n(t.leftBar),
141
- transition: { duration: d.duration }
142
+ transition: { duration: x.duration }
142
143
  }
143
144
  },
144
145
  initial: "initial",
145
- animate: v ? "whileInView" : "initial",
146
+ animate: b ? "whileInView" : "initial",
146
147
  exit: {
147
148
  x: n(0),
148
149
  width: 0,
149
- transition: { duration: d.duration }
150
+ transition: { duration: x.duration }
150
151
  }
151
152
  }
152
153
  ) : null,
@@ -164,7 +165,7 @@ function zt(z) {
164
165
  className: et("graph-value text-sm", l?.graphObjectValues),
165
166
  exit: {
166
167
  opacity: 0,
167
- transition: { duration: d.duration }
168
+ transition: { duration: x.duration }
168
169
  },
169
170
  variants: {
170
171
  initial: {
@@ -174,12 +175,12 @@ function zt(z) {
174
175
  whileInView: {
175
176
  x: t.leftBar ? n(t.leftBar) : n(L < 0 ? 0 : L),
176
177
  opacity: 1,
177
- transition: { duration: d.duration }
178
+ transition: { duration: x.duration }
178
179
  }
179
180
  },
180
181
  initial: "initial",
181
- animate: v ? "whileInView" : "initial",
182
- children: bt(t.rightBar, K, G, E, X)
182
+ animate: b ? "whileInView" : "initial",
183
+ children: vt(t.rightBar, K, G, E, X)
183
184
  }
184
185
  ) : null
185
186
  ]
@@ -208,14 +209,14 @@ function zt(z) {
208
209
  textSide: "left",
209
210
  classNames: t.classNames,
210
211
  styles: t.styles,
211
- animate: d,
212
- isInView: v
212
+ animate: x,
213
+ isInView: b
213
214
  },
214
215
  r
215
216
  )) }) : null
216
217
  ] })
217
218
  ] }),
218
- /* @__PURE__ */ e.jsxs("g", { transform: `translate(${(C + x) / 2},0)`, children: [
219
+ /* @__PURE__ */ e.jsxs("g", { transform: `translate(${(C + d) / 2},0)`, children: [
219
220
  it ? /* @__PURE__ */ e.jsx(
220
221
  wt,
221
222
  {
@@ -238,23 +239,23 @@ function zt(z) {
238
239
  precision: G
239
240
  }
240
241
  ) : null,
241
- /* @__PURE__ */ e.jsxs(xt, { children: [
242
+ /* @__PURE__ */ e.jsxs(dt, { children: [
242
243
  Y.map((t, r) => /* @__PURE__ */ e.jsxs(
243
244
  I.g,
244
245
  {
245
246
  className: "undp-viz-g-with-hover",
246
247
  opacity: 0.85,
247
248
  onMouseEnter: (p) => {
248
- b(t), f(p.clientY), O(p.clientX), F?.(t);
249
+ v(t), f(p.clientY), O(p.clientX), F?.(t);
249
250
  },
250
251
  onClick: () => {
251
- (k || $) && (vt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
252
+ (k || $) && (bt(T, t) && at ? (P(void 0), k?.(void 0)) : (P(t), k?.(t)));
252
253
  },
253
254
  onMouseMove: (p) => {
254
- b(t), f(p.clientY), O(p.clientX);
255
+ v(t), f(p.clientY), O(p.clientX);
255
256
  },
256
257
  onMouseLeave: () => {
257
- b(void 0), O(void 0), f(void 0), F?.(void 0);
258
+ v(void 0), O(void 0), f(void 0), F?.(void 0);
258
259
  },
259
260
  children: [
260
261
  t.rightBar ? /* @__PURE__ */ e.jsx(
@@ -266,7 +267,7 @@ function zt(z) {
266
267
  exit: {
267
268
  x: o(0),
268
269
  width: 0,
269
- transition: { duration: d.duration }
270
+ transition: { duration: x.duration }
270
271
  },
271
272
  variants: {
272
273
  initial: {
@@ -276,11 +277,11 @@ function zt(z) {
276
277
  whileInView: {
277
278
  x: t.rightBar >= 0 ? o(0) : o(t.rightBar),
278
279
  width: t.rightBar >= 0 ? o(t.rightBar) - o(0) : o(0) - o(t.rightBar),
279
- transition: { duration: d.duration }
280
+ transition: { duration: x.duration }
280
281
  }
281
282
  },
282
283
  initial: "initial",
283
- animate: v ? "whileInView" : "initial"
284
+ animate: b ? "whileInView" : "initial"
284
285
  }
285
286
  ) : null,
286
287
  U ? /* @__PURE__ */ e.jsx(
@@ -297,7 +298,7 @@ function zt(z) {
297
298
  dy: "0.33em",
298
299
  exit: {
299
300
  opacity: 0,
300
- transition: { duration: d.duration }
301
+ transition: { duration: x.duration }
301
302
  },
302
303
  variants: {
303
304
  initial: {
@@ -307,12 +308,12 @@ function zt(z) {
307
308
  whileInView: {
308
309
  x: t.rightBar ? o(t.rightBar) : o(V < 0 ? 0 : V),
309
310
  opacity: 1,
310
- transition: { duration: d.duration }
311
+ transition: { duration: x.duration }
311
312
  }
312
313
  },
313
314
  initial: "initial",
314
- animate: v ? "whileInView" : "initial",
315
- children: bt(t.rightBar, K, G, E, X)
315
+ animate: b ? "whileInView" : "initial",
316
+ children: vt(t.rightBar, K, G, E, X)
316
317
  }
317
318
  ) : null
318
319
  ]
@@ -341,26 +342,26 @@ function zt(z) {
341
342
  textSide: "right",
342
343
  classNames: t.classNames,
343
344
  styles: t.styles,
344
- animate: d,
345
- isInView: v
345
+ animate: x,
346
+ isInView: b
346
347
  },
347
348
  r
348
349
  )) }) : null
349
350
  ] })
350
351
  ] }),
351
- /* @__PURE__ */ e.jsx(xt, { children: /* @__PURE__ */ e.jsx(I.g, { transform: `translate(${C / 2},0)`, children: Y.map((t, r) => /* @__PURE__ */ e.jsx(
352
- It,
352
+ /* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(I.g, { transform: `translate(${C / 2},0)`, children: Y.map((t, r) => /* @__PURE__ */ e.jsx(
353
+ Ot,
353
354
  {
354
355
  value: `${t.label}`.length < H ? `${t.label}` : `${`${t.label}`.substring(0, H)}...`,
355
356
  y: a(`${t.id}`),
356
- x: 0 - x / 2,
357
- width: x,
357
+ x: 0 - d / 2,
358
+ width: d,
358
359
  height: a.bandwidth(),
359
360
  alignment: "center",
360
361
  style: u?.yAxis?.labels,
361
362
  className: l?.yAxis?.labels,
362
- animate: d,
363
- isInView: v
363
+ animate: x,
364
+ isInView: b
364
365
  },
365
366
  r
366
367
  )) }) }),
@@ -374,7 +375,7 @@ function zt(z) {
374
375
  ...u?.yAxis?.title
375
376
  },
376
377
  className: et("text-base", l?.yAxis?.title),
377
- x: C / 2 - x / 2,
378
+ x: C / 2 - d / 2,
378
379
  y: 0,
379
380
  dx: -5,
380
381
  dy: 20,
@@ -390,7 +391,7 @@ function zt(z) {
390
391
  ...u?.yAxis?.title
391
392
  },
392
393
  className: et("text-base", l?.yAxis?.title),
393
- x: C / 2 + x / 2,
394
+ x: C / 2 + d / 2,
394
395
  y: 0,
395
396
  dx: 5,
396
397
  dy: 20,
@@ -403,7 +404,7 @@ function zt(z) {
403
404
  }
404
405
  ),
405
406
  st && J && lt && A ? /* @__PURE__ */ e.jsx(
406
- Ot,
407
+ Vt,
407
408
  {
408
409
  data: st,
409
410
  body: J,
@@ -414,7 +415,7 @@ function zt(z) {
414
415
  }
415
416
  ) : null,
416
417
  $ && T !== void 0 ? /* @__PURE__ */ e.jsx(
417
- Tt,
418
+ Lt,
418
419
  {
419
420
  open: T !== void 0,
420
421
  onClose: () => {
@@ -424,7 +425,7 @@ function zt(z) {
424
425
  "div",
425
426
  {
426
427
  className: "graph-modal-content m-0",
427
- dangerouslySetInnerHTML: typeof $ == "string" ? { __html: Dt($, T) } : void 0,
428
+ dangerouslySetInnerHTML: typeof $ == "string" ? { __html: Tt($, T) } : void 0,
428
429
  children: typeof $ == "function" ? $(T) : null
429
430
  }
430
431
  )
@@ -433,16 +434,16 @@ function zt(z) {
433
434
  ] });
434
435
  }
435
436
  function W(z, c, y, j) {
436
- const m = z.map((B) => B[c]).filter((B) => !ut(B)), x = ut(y) ? Math.min(...m) >= 0 ? 0 : Math.min(...m) : y, s = ut(j) ? Math.max(...m) < 0 ? 0 : Math.max(...m) : j;
437
- return { min: x, max: s };
437
+ const m = z.map((B) => B[c]).filter((B) => !ut(B)), d = ut(y) ? Math.min(...m) >= 0 ? 0 : Math.min(...m) : y, s = ut(j) ? Math.max(...m) < 0 ? 0 : Math.max(...m) : j;
438
+ return { min: d, max: s };
438
439
  }
439
- function we(z) {
440
+ function je(z) {
440
441
  const {
441
442
  data: c,
442
443
  graphTitle: y,
443
444
  sources: j,
444
445
  graphDescription: m,
445
- height: x,
446
+ height: d,
446
447
  width: s,
447
448
  footNote: B,
448
449
  padding: q,
@@ -468,16 +469,16 @@ function we(z) {
468
469
  showValues: u = !0,
469
470
  maxValue: l,
470
471
  minValue: N,
471
- refValues: d = [],
472
+ refValues: x = [],
472
473
  suffix: G = "",
473
474
  prefix: rt = "",
474
475
  showTicks: L = !0,
475
476
  showColorScale: V = !1,
476
477
  graphDownload: K = !1,
477
478
  dataDownload: Q = !1,
478
- language: v = "en",
479
+ language: b = "en",
479
480
  colorLegendTitle: st,
480
- minHeight: b = 0,
481
+ minHeight: v = 0,
481
482
  theme: T = "light",
482
483
  ariaLabel: P,
483
484
  resetSelectionOnDoubleClick: lt = !0,
@@ -490,28 +491,27 @@ function we(z) {
490
491
  customLayers: Y = [],
491
492
  timeline: a = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
492
493
  naLabel: o = "NA"
493
- } = z, [D, n] = S(0), [Z, t] = S(0), [r, p] = S(a.autoplay), g = Nt(
494
- Vt(
495
- c.filter((i) => i.date !== void 0 && i.date !== null),
496
- (i) => i.date
497
- ).map((i) => kt(`${i.date}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
494
+ } = z, [D, n] = S(0), [Z, t] = S(0), [r, p] = S(a.autoplay), g = Yt(
495
+ Gt(c, "date", !0).map(
496
+ (i) => Ct(`${i}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()
497
+ ),
498
498
  (i, R) => Wt(i, R)
499
- ), [ht, dt] = S(a.autoplay ? 0 : g.length - 1), tt = gt(null), ft = gt(null);
499
+ ), [ht, xt] = S(a.autoplay ? 0 : g.length - 1), tt = gt(null), ft = gt(null);
500
500
  yt(() => {
501
501
  const i = new ResizeObserver((R) => {
502
- n(s || R[0].target.clientWidth || 620), t(x || R[0].target.clientHeight || 480);
502
+ n(s || R[0].target.clientWidth || 620), t(d || R[0].target.clientHeight || 480);
503
503
  });
504
504
  return tt.current && (t(tt.current.clientHeight || 480), n(tt.current.clientWidth || 620), s || i.observe(tt.current)), () => i.disconnect();
505
- }, [s, x]), yt(() => {
505
+ }, [s, d]), yt(() => {
506
506
  const i = setInterval(
507
507
  () => {
508
- dt((R) => R < g.length - 1 ? R + 1 : 0);
508
+ xt((R) => R < g.length - 1 ? R + 1 : 0);
509
509
  },
510
510
  (a.speed || 2) * 1e3
511
511
  );
512
512
  return r || clearInterval(i), () => clearInterval(i);
513
513
  }, [g, r, a.speed]);
514
- const pt = At(
514
+ const pt = Nt(
515
515
  g,
516
516
  ht,
517
517
  a.showOnlyActiveDate,
@@ -521,12 +521,12 @@ function we(z) {
521
521
  "div",
522
522
  {
523
523
  className: `${T || "light"} flex ${s ? "w-fit grow-0" : "w-full grow"}`,
524
- dir: v === "he" || v === "ar" ? "rtl" : void 0,
524
+ dir: b === "he" || b === "ar" ? "rtl" : void 0,
525
525
  children: /* @__PURE__ */ e.jsx(
526
526
  "div",
527
527
  {
528
528
  className: et(
529
- `${M ? M === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${v || "en"}`,
529
+ `${M ? M === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b || "en"}`,
530
530
  s ? "w-fit" : "w-full",
531
531
  f?.graphContainer
532
532
  ),
@@ -544,7 +544,7 @@ function we(z) {
544
544
  style: { padding: M ? q || "1rem" : q || 0 },
545
545
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
546
546
  y || m || K || Q ? /* @__PURE__ */ e.jsx(
547
- Pt,
547
+ Ft,
548
548
  {
549
549
  styles: {
550
550
  title: A?.title,
@@ -571,11 +571,11 @@ function we(z) {
571
571
  },
572
572
  className: "p-0 border-0 cursor-pointer bg-transparent",
573
573
  "aria-label": r ? "Click to pause animation" : "Click to play animation",
574
- children: r ? /* @__PURE__ */ e.jsx(Et, {}) : /* @__PURE__ */ e.jsx(Gt, {})
574
+ children: r ? /* @__PURE__ */ e.jsx(Rt, {}) : /* @__PURE__ */ e.jsx(Xt, {})
575
575
  }
576
576
  ),
577
577
  /* @__PURE__ */ e.jsx(
578
- Ct,
578
+ At,
579
579
  {
580
580
  min: g[0],
581
581
  max: g[g.length - 1],
@@ -584,18 +584,18 @@ function we(z) {
584
584
  defaultValue: g[g.length - 1],
585
585
  value: g[ht],
586
586
  onChangeComplete: (i) => {
587
- dt(g.indexOf(i));
587
+ xt(g.indexOf(i));
588
588
  },
589
589
  onChange: (i) => {
590
- dt(g.indexOf(i));
590
+ xt(g.indexOf(i));
591
591
  },
592
592
  "aria-label": "Time slider. Use arrow keys to adjust selected time period."
593
593
  }
594
594
  )
595
595
  ] }) : null,
596
- /* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: c.length === 0 ? /* @__PURE__ */ e.jsx(Xt, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
596
+ /* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: c.length === 0 ? /* @__PURE__ */ e.jsx(Pt, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
597
597
  V ? /* @__PURE__ */ e.jsx(
598
- Rt,
598
+ Ht,
599
599
  {
600
600
  colorLegendTitle: st,
601
601
  colorDomain: [F, J],
@@ -609,14 +609,14 @@ function we(z) {
609
609
  className: "flex flex-col grow justify-center leading-0",
610
610
  ref: tt,
611
611
  "aria-label": "Graph area",
612
- children: (s || D) && (x || Z) ? /* @__PURE__ */ e.jsx(
612
+ children: (s || D) && (d || Z) ? /* @__PURE__ */ e.jsx(
613
613
  zt,
614
614
  {
615
- data: Yt(
615
+ data: Et(
616
616
  c,
617
617
  a.dateFormat || "yyyy"
618
618
  ).filter(
619
- (i) => a.enabled ? i.date === Lt(
619
+ (i) => a.enabled ? i.date === kt(
620
620
  new Date(g[ht]),
621
621
  a.dateFormat || "yyyy"
622
622
  ) : i
@@ -625,8 +625,8 @@ function we(z) {
625
625
  width: s || D,
626
626
  centerGap: $,
627
627
  height: Math.max(
628
- b,
629
- x || (H ? b ? (s || D) * H > b ? (s || D) * H : b : (s || D) * H : Z)
628
+ v,
629
+ d || (H ? v ? (s || D) * H > v ? (s || D) * H : v : (s || D) * H : Z)
630
630
  ),
631
631
  truncateBy: E,
632
632
  leftMargin: nt,
@@ -637,7 +637,7 @@ function we(z) {
637
637
  tooltip: mt,
638
638
  onSeriesMouseOver: k,
639
639
  barPadding: X,
640
- refValues: d,
640
+ refValues: x,
641
641
  maxValue: Math.max(
642
642
  W(c, "leftBar", N, l).max,
643
643
  W(c, "rightBar", N, l).max
@@ -668,7 +668,7 @@ function we(z) {
668
668
  )
669
669
  ] }) }),
670
670
  j || B ? /* @__PURE__ */ e.jsx(
671
- Ht,
671
+ St,
672
672
  {
673
673
  styles: { footnote: A?.footnote, source: A?.source },
674
674
  classNames: {
@@ -689,6 +689,6 @@ function we(z) {
689
689
  );
690
690
  }
691
691
  export {
692
- we as ButterflyChart
692
+ je as ButterflyChart
693
693
  };
694
694
  //# sourceMappingURL=ButterflyChart.js.map