@undp/data-viz 2.1.8 → 2.2.0

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 (461) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +19 -19
  3. package/dist/AreaChart.js.map +1 -1
  4. package/dist/{Axis-CRyfcLjc.js → Axis-DoOqnt6g.js} +2 -2
  5. package/dist/{Axis-CRyfcLjc.js.map → Axis-DoOqnt6g.js.map} +1 -1
  6. package/dist/{Axis-DxRV2yMi.cjs → Axis-Dtjn-EgM.cjs} +2 -2
  7. package/dist/{Axis-DxRV2yMi.cjs.map → Axis-Dtjn-EgM.cjs.map} +1 -1
  8. package/dist/{AxisTitle-sS5bLLR7.cjs → AxisTitle-DV4n0RxE.cjs} +2 -2
  9. package/dist/{AxisTitle-sS5bLLR7.cjs.map → AxisTitle-DV4n0RxE.cjs.map} +1 -1
  10. package/dist/{AxisTitle-jeI7am8o.js → AxisTitle-VFq89Olw.js} +2 -2
  11. package/dist/{AxisTitle-jeI7am8o.js.map → AxisTitle-VFq89Olw.js.map} +1 -1
  12. package/dist/BarGraph.cjs +1 -1
  13. package/dist/BarGraph.js +24 -24
  14. package/dist/BarGraph.js.map +1 -1
  15. package/dist/BasicStatCard.cjs +1 -1
  16. package/dist/BasicStatCard.js +2 -2
  17. package/dist/BeeSwarmChart.cjs +1 -1
  18. package/dist/BeeSwarmChart.js +14 -14
  19. package/dist/BeeSwarmChart.js.map +1 -1
  20. package/dist/BiVariateChoroplethMap.cjs +1 -1
  21. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  22. package/dist/BiVariateChoroplethMap.js +48 -48
  23. package/dist/BiVariateChoroplethMap.js.map +1 -1
  24. package/dist/BulletChart.cjs +1 -1
  25. package/dist/BulletChart.js +22 -22
  26. package/dist/BulletChart.js.map +1 -1
  27. package/dist/ButterflyChart.cjs +1 -1
  28. package/dist/ButterflyChart.js +19 -19
  29. package/dist/ButterflyChart.js.map +1 -1
  30. package/dist/ChoroplethMap.cjs +1 -1
  31. package/dist/ChoroplethMap.cjs.map +1 -1
  32. package/dist/ChoroplethMap.js +51 -51
  33. package/dist/ChoroplethMap.js.map +1 -1
  34. package/dist/CirclePackingGraph.cjs +1 -1
  35. package/dist/CirclePackingGraph.js +4 -4
  36. package/dist/ColorLegend.cjs +1 -1
  37. package/dist/ColorLegend.js +2 -2
  38. package/dist/ColorLegendWithMouseOver.cjs +1 -1
  39. package/dist/ColorLegendWithMouseOver.js +2 -2
  40. package/dist/CopyTextButton.cjs +1 -16
  41. package/dist/CopyTextButton.cjs.map +1 -1
  42. package/dist/CopyTextButton.js +13 -31
  43. package/dist/CopyTextButton.js.map +1 -1
  44. package/dist/CsvDownloadButton.cjs +2 -20
  45. package/dist/CsvDownloadButton.cjs.map +1 -1
  46. package/dist/CsvDownloadButton.js +5 -26
  47. package/dist/CsvDownloadButton.js.map +1 -1
  48. package/dist/DataCards.cjs +1 -21
  49. package/dist/DataCards.cjs.map +1 -1
  50. package/dist/DataCards.js +18 -42
  51. package/dist/DataCards.js.map +1 -1
  52. package/dist/DataTable.cjs +1 -1
  53. package/dist/DataTable.js +6 -6
  54. package/dist/DataTable.js.map +1 -1
  55. package/dist/{DetailsModal-0Ry5nXiC.js → DetailsModal-BMCTgVsk.js} +4 -4
  56. package/dist/{DetailsModal-0Ry5nXiC.js.map → DetailsModal-BMCTgVsk.js.map} +1 -1
  57. package/dist/{DetailsModal-BN0HDFlV.cjs → DetailsModal-DHttOA80.cjs} +2 -2
  58. package/dist/{DetailsModal-BN0HDFlV.cjs.map → DetailsModal-DHttOA80.cjs.map} +1 -1
  59. package/dist/DifferenceLineChart.cjs +1 -1
  60. package/dist/DifferenceLineChart.js +22 -22
  61. package/dist/DifferenceLineChart.js.map +1 -1
  62. package/dist/DonutChart.cjs +1 -1
  63. package/dist/DonutChart.js +10 -10
  64. package/dist/DotDensityMap.cjs +1 -1
  65. package/dist/DotDensityMap.cjs.map +1 -1
  66. package/dist/DotDensityMap.d.ts +1 -1
  67. package/dist/DotDensityMap.js +78 -78
  68. package/dist/DotDensityMap.js.map +1 -1
  69. package/dist/{DropdownSelect-BbdPQa2k.js → DropdownSelect-D8rFbygC.js} +5 -33
  70. package/dist/{DropdownSelect-BbdPQa2k.js.map → DropdownSelect-D8rFbygC.js.map} +1 -1
  71. package/dist/{DropdownSelect-Doz3mCrM.cjs → DropdownSelect-NNpOs7DX.cjs} +2 -26
  72. package/dist/{DropdownSelect-Doz3mCrM.cjs.map → DropdownSelect-NNpOs7DX.cjs.map} +1 -1
  73. package/dist/DualAxisLineChart.cjs +1 -1
  74. package/dist/DualAxisLineChart.js +15 -15
  75. package/dist/DualAxisLineChart.js.map +1 -1
  76. package/dist/DumbbellChart.cjs +1 -1
  77. package/dist/DumbbellChart.js +22 -22
  78. package/dist/DumbbellChart.js.map +1 -1
  79. package/dist/{EmptyState-gLDRXBHm.cjs → EmptyState-CGeBqbmR.cjs} +2 -2
  80. package/dist/{EmptyState-gLDRXBHm.cjs.map → EmptyState-CGeBqbmR.cjs.map} +1 -1
  81. package/dist/EmptyState-tZBErBKF.js +15 -0
  82. package/dist/{EmptyState-C7ZXkZWd.js.map → EmptyState-tZBErBKF.js.map} +1 -1
  83. package/dist/ExcelDownloadButton.cjs +1 -1
  84. package/dist/ExcelDownloadButton.js +2 -2
  85. package/dist/FootNote.cjs +1 -1
  86. package/dist/FootNote.js +2 -2
  87. package/dist/GeoHubCompareMaps.cjs +1 -1
  88. package/dist/GeoHubCompareMaps.js +13 -13
  89. package/dist/GeoHubCompareMaps.js.map +1 -1
  90. package/dist/GeoHubMap.cjs +1 -1
  91. package/dist/GeoHubMap.js +8 -8
  92. package/dist/GeoHubMap.js.map +1 -1
  93. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  94. package/dist/GeoHubMapWithLayerSelection.js +12 -12
  95. package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
  96. package/dist/{GraphContainer-d8A46BK2.cjs → GraphContainer-B1EDxJ0S.cjs} +2 -2
  97. package/dist/{GraphContainer-d8A46BK2.cjs.map → GraphContainer-B1EDxJ0S.cjs.map} +1 -1
  98. package/dist/{GraphContainer-CRqzdKu2.js → GraphContainer-CF6ws3pd.js} +2 -2
  99. package/dist/{GraphContainer-CRqzdKu2.js.map → GraphContainer-CF6ws3pd.js.map} +1 -1
  100. package/dist/GraphDescription.cjs +1 -1
  101. package/dist/GraphDescription.js +2 -2
  102. package/dist/GraphEl-CBZdcvb7.cjs +2 -0
  103. package/dist/GraphEl-CBZdcvb7.cjs.map +1 -0
  104. package/dist/{GraphEl-Dyu_EIQb.js → GraphEl-DKrjuQNB.js} +79 -18
  105. package/dist/GraphEl-DKrjuQNB.js.map +1 -0
  106. package/dist/GraphFooter.cjs +1 -1
  107. package/dist/GraphFooter.js +2 -2
  108. package/dist/GraphHeader.cjs +1 -1
  109. package/dist/GraphHeader.js +1 -1
  110. package/dist/GraphTitle.cjs +1 -1
  111. package/dist/GraphTitle.js +2 -2
  112. package/dist/GriddedGraphs.cjs +1 -1
  113. package/dist/GriddedGraphs.d.ts +1 -1
  114. package/dist/GriddedGraphs.js +8 -8
  115. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  116. package/dist/GriddedGraphsFromConfig.d.ts +1 -1
  117. package/dist/GriddedGraphsFromConfig.js +4 -4
  118. package/dist/GriddedGraphsFromConfig.js.map +1 -1
  119. package/dist/HeatMap.cjs +1 -1
  120. package/dist/HeatMap.js +14 -14
  121. package/dist/HeatMap.js.map +1 -1
  122. package/dist/Histogram.cjs +1 -1
  123. package/dist/Histogram.js +5 -5
  124. package/dist/Histogram.js.map +1 -1
  125. package/dist/HybridMap.cjs +1 -1
  126. package/dist/HybridMap.cjs.map +1 -1
  127. package/dist/HybridMap.js +134 -133
  128. package/dist/HybridMap.js.map +1 -1
  129. package/dist/ImageDownloadButton.cjs +1 -1
  130. package/dist/ImageDownloadButton.js +3 -3
  131. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  132. package/dist/LineChartWithConfidenceInterval.js +18 -18
  133. package/dist/LineChartWithConfidenceInterval.js.map +1 -1
  134. package/dist/LinearColorLegend.cjs +1 -1
  135. package/dist/LinearColorLegend.js +2 -2
  136. package/dist/{Modal-JW_IExO3.cjs → Modal-CaYa_TLE.cjs} +2 -2
  137. package/dist/{Modal-JW_IExO3.cjs.map → Modal-CaYa_TLE.cjs.map} +1 -1
  138. package/dist/{Modal-bMQA6bL_.js → Modal-Ch9wvKxF.js} +4 -4
  139. package/dist/{Modal-bMQA6bL_.js.map → Modal-Ch9wvKxF.js.map} +1 -1
  140. package/dist/MultiGraphDashboard.cjs +1 -1
  141. package/dist/MultiGraphDashboard.d.ts +1 -1
  142. package/dist/MultiGraphDashboard.js +5 -5
  143. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  144. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -1
  145. package/dist/MultiGraphDashboardFromConfig.js +4 -4
  146. package/dist/MultiGraphDashboardFromConfig.js.map +1 -1
  147. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  148. package/dist/MultiGraphDashboardWideToLongFormat.js +5 -5
  149. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  150. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +4 -4
  151. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -1
  152. package/dist/MultiLineAltChart.cjs +1 -1
  153. package/dist/MultiLineAltChart.js +17 -17
  154. package/dist/MultiLineAltChart.js.map +1 -1
  155. package/dist/MultiLineChart.cjs +1 -1
  156. package/dist/MultiLineChart.js +19 -19
  157. package/dist/MultiLineChart.js.map +1 -1
  158. package/dist/ParetoChart.cjs +1 -1
  159. package/dist/ParetoChart.js +15 -15
  160. package/dist/ParetoChart.js.map +1 -1
  161. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  162. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -1
  163. package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
  164. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  165. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -1
  166. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +4 -4
  167. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -1
  168. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  169. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -1
  170. package/dist/PerformanceIntensiveScrollStory.js +6 -6
  171. package/dist/PerformanceIntensiveScrollStory.js.map +1 -1
  172. package/dist/RadarChart.cjs +1 -1
  173. package/dist/RadarChart.cjs.map +1 -1
  174. package/dist/RadarChart.js +9 -9
  175. package/dist/{ReferenceLine-2XCwHXQ4.js → ReferenceLine-DgtoRgw0.js} +5 -5
  176. package/dist/ReferenceLine-DgtoRgw0.js.map +1 -0
  177. package/dist/{ReferenceLine-BH0qdf4R.cjs → ReferenceLine-M9aP3dj-.cjs} +2 -2
  178. package/dist/{ReferenceLine-BH0qdf4R.cjs.map → ReferenceLine-M9aP3dj-.cjs.map} +1 -1
  179. package/dist/{RegressionLine-BOTTNSrr.cjs → RegressionLine-Ci-Dh0w0.cjs} +2 -2
  180. package/dist/{RegressionLine-BOTTNSrr.cjs.map → RegressionLine-Ci-Dh0w0.cjs.map} +1 -1
  181. package/dist/{RegressionLine-DAcY2DjT.js → RegressionLine-D2aqeBKp.js} +6 -6
  182. package/dist/RegressionLine-D2aqeBKp.js.map +1 -0
  183. package/dist/SVGDownloadButton.cjs +1 -1
  184. package/dist/SVGDownloadButton.js +2 -2
  185. package/dist/SankeyChart.cjs +1 -1
  186. package/dist/SankeyChart.cjs.map +1 -1
  187. package/dist/SankeyChart.js +61 -67
  188. package/dist/SankeyChart.js.map +1 -1
  189. package/dist/ScatterPlot.cjs +1 -1
  190. package/dist/ScatterPlot.js +23 -23
  191. package/dist/ScatterPlot.js.map +1 -1
  192. package/dist/ScrollStory.cjs +1 -1
  193. package/dist/ScrollStory.d.ts +1 -1
  194. package/dist/ScrollStory.js +4 -4
  195. package/dist/ScrollStory.js.map +1 -1
  196. package/dist/SimpleLineChart.cjs +1 -1
  197. package/dist/SimpleLineChart.js +19 -19
  198. package/dist/SimpleLineChart.js.map +1 -1
  199. package/dist/SingleGraphDashboard.cjs +1 -1
  200. package/dist/SingleGraphDashboard.d.ts +1 -1
  201. package/dist/SingleGraphDashboard.js +9 -9
  202. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  203. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -1
  204. package/dist/SingleGraphDashboardFromConfig.js +4 -4
  205. package/dist/SingleGraphDashboardFromConfig.js.map +1 -1
  206. package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
  207. package/dist/SingleGraphDashboardGeoHubMaps.js +5 -5
  208. package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -1
  209. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  210. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +4 -4
  211. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -1
  212. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  213. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  214. package/dist/SingleGraphDashboardThreeDGraphs.js +63 -70
  215. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  216. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  217. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +4 -4
  218. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -1
  219. package/dist/SlopeChart.cjs +1 -1
  220. package/dist/SlopeChart.js +12 -12
  221. package/dist/SlopeChart.js.map +1 -1
  222. package/dist/{Source-DYMJRrsq.cjs → Source-B5AoSlsi.cjs} +2 -2
  223. package/dist/{Source-DYMJRrsq.cjs.map → Source-B5AoSlsi.cjs.map} +1 -1
  224. package/dist/{Source-DwTHB8fn.js → Source-F8EYCYkV.js} +4 -4
  225. package/dist/{Source-DwTHB8fn.js.map → Source-F8EYCYkV.js.map} +1 -1
  226. package/dist/Source.cjs +1 -1
  227. package/dist/Source.js +3 -3
  228. package/dist/SparkLine.cjs +1 -1
  229. package/dist/SparkLine.js +8 -8
  230. package/dist/SparkLine.js.map +1 -1
  231. package/dist/{Spinner-DVBnY6Vg.js → Spinner--r2RrJV8.js} +2 -2
  232. package/dist/{Spinner-DVBnY6Vg.js.map → Spinner--r2RrJV8.js.map} +1 -1
  233. package/dist/{Spinner-CQZcjzwd.cjs → Spinner-jTMOLuw_.cjs} +2 -2
  234. package/dist/{Spinner-CQZcjzwd.cjs.map → Spinner-jTMOLuw_.cjs.map} +1 -1
  235. package/dist/StatCardFromData.cjs +1 -1
  236. package/dist/StatCardFromData.js +2 -2
  237. package/dist/StripChart.cjs +1 -1
  238. package/dist/StripChart.js +10 -10
  239. package/dist/StripChart.js.map +1 -1
  240. package/dist/ThreeDGlobe.cjs +1 -1
  241. package/dist/ThreeDGlobe.js +13 -13
  242. package/dist/ThreeDGlobe.js.map +1 -1
  243. package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
  244. package/dist/ThresholdColorLegendWithMouseOver.js +3 -3
  245. package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
  246. package/dist/{Tooltip-uUdw6wJL.cjs → Tooltip-BLa2EfMs.cjs} +2 -2
  247. package/dist/{Tooltip-uUdw6wJL.cjs.map → Tooltip-BLa2EfMs.cjs.map} +1 -1
  248. package/dist/{Tooltip-Dj5eVppQ.js → Tooltip-BRnAz2Gv.js} +3 -3
  249. package/dist/{Tooltip-Dj5eVppQ.js.map → Tooltip-BRnAz2Gv.js.map} +1 -1
  250. package/dist/TreeMapGraph.cjs +1 -1
  251. package/dist/TreeMapGraph.js +10 -10
  252. package/dist/TreeMapGraph.js.map +1 -1
  253. package/dist/Types.d.ts +8 -1
  254. package/dist/{Typography-PxtFcnJb.js → Typography-hWfh3H0J.js} +2 -2
  255. package/dist/{Typography-PxtFcnJb.js.map → Typography-hWfh3H0J.js.map} +1 -1
  256. package/dist/{Typography-DX7PlgQU.cjs → Typography-sa1UE0oF.cjs} +2 -2
  257. package/dist/{Typography-DX7PlgQU.cjs.map → Typography-sa1UE0oF.cjs.map} +1 -1
  258. package/dist/UnitChart.cjs +1 -1
  259. package/dist/UnitChart.js +8 -8
  260. package/dist/WaterfallChart.cjs +2 -0
  261. package/dist/WaterfallChart.cjs.map +1 -0
  262. package/dist/WaterfallChart.d.ts +208 -0
  263. package/dist/WaterfallChart.js +427 -0
  264. package/dist/WaterfallChart.js.map +1 -0
  265. package/dist/{XAxesLabels-Bt5NZBmX.cjs → XAxesLabels-C6o9jJal.cjs} +2 -2
  266. package/dist/{XAxesLabels-Bt5NZBmX.cjs.map → XAxesLabels-C6o9jJal.cjs.map} +1 -1
  267. package/dist/{XAxesLabels-Dy8E1SEo.js → XAxesLabels-rhK7lRjO.js} +3 -3
  268. package/dist/{XAxesLabels-Dy8E1SEo.js.map → XAxesLabels-rhK7lRjO.js.map} +1 -1
  269. package/dist/{XTicksAndGridLines-CObVFSm4.js → XTicksAndGridLines-CVZkZkpS.js} +2 -2
  270. package/dist/{XTicksAndGridLines-CObVFSm4.js.map → XTicksAndGridLines-CVZkZkpS.js.map} +1 -1
  271. package/dist/{XTicksAndGridLines-B6CELS7q.cjs → XTicksAndGridLines-CekrPykD.cjs} +2 -2
  272. package/dist/{XTicksAndGridLines-B6CELS7q.cjs.map → XTicksAndGridLines-CekrPykD.cjs.map} +1 -1
  273. package/dist/{YAxesLabels-DesLesUP.cjs → YAxesLabels-BQ2aCazV.cjs} +2 -2
  274. package/dist/{YAxesLabels-DesLesUP.cjs.map → YAxesLabels-BQ2aCazV.cjs.map} +1 -1
  275. package/dist/{YAxesLabels-a57ZRv-0.js → YAxesLabels-QICWVsHf.js} +3 -3
  276. package/dist/{YAxesLabels-a57ZRv-0.js.map → YAxesLabels-QICWVsHf.js.map} +1 -1
  277. package/dist/{YTicksAndGridLines-Blepl7XF.js → YTicksAndGridLines-GnXnSRF2.js} +2 -2
  278. package/dist/{YTicksAndGridLines-Blepl7XF.js.map → YTicksAndGridLines-GnXnSRF2.js.map} +1 -1
  279. package/dist/{YTicksAndGridLines-4pxTRlRK.cjs → YTicksAndGridLines-UzVC5eBM.cjs} +2 -2
  280. package/dist/{YTicksAndGridLines-4pxTRlRK.cjs.map → YTicksAndGridLines-UzVC5eBM.cjs.map} +1 -1
  281. package/dist/{band-DHUZ2X7J.js → band-DYty33LD.js} +2 -2
  282. package/dist/{band-DHUZ2X7J.js.map → band-DYty33LD.js.map} +1 -1
  283. package/dist/{checkIfMultiple-CIRtG0KE.js → checkIfMultiple-D9fVkeOq.js} +7 -19
  284. package/dist/{checkIfMultiple-CIRtG0KE.js.map → checkIfMultiple-D9fVkeOq.js.map} +1 -1
  285. package/dist/checkIfMultiple-DxnGtm3t.cjs +2 -0
  286. package/dist/{checkIfMultiple-wg6hJLXy.cjs.map → checkIfMultiple-DxnGtm3t.cjs.map} +1 -1
  287. package/dist/{customArea-BUhPiPT6.js → customArea-ASDaSE4u.js} +5 -5
  288. package/dist/{customArea-BUhPiPT6.js.map → customArea-ASDaSE4u.js.map} +1 -1
  289. package/dist/{customArea-CMF5g-C3.cjs → customArea-B1LWQBmM.cjs} +2 -2
  290. package/dist/{customArea-CMF5g-C3.cjs.map → customArea-B1LWQBmM.cjs.map} +1 -1
  291. package/dist/defaultLocale-C4wbwF1n.cjs +2 -0
  292. package/dist/defaultLocale-C4wbwF1n.cjs.map +1 -0
  293. package/dist/defaultLocale-CPy_WVtp.js +172 -0
  294. package/dist/defaultLocale-CPy_WVtp.js.map +1 -0
  295. package/dist/{ensureCompleteData-DH5c52Ub.js → ensureCompleteData-CDIukSG6.js} +2 -2
  296. package/dist/{ensureCompleteData-DH5c52Ub.js.map → ensureCompleteData-CDIukSG6.js.map} +1 -1
  297. package/dist/{ensureCompleteData-pZ9QO6kB.cjs → ensureCompleteData-D9bQTiVS.cjs} +2 -2
  298. package/dist/{ensureCompleteData-pZ9QO6kB.cjs.map → ensureCompleteData-D9bQTiVS.cjs.map} +1 -1
  299. package/dist/{fetchAndParseData-BpqkBPQL.js → fetchAndParseData-BAXhgTDM.js} +12 -18
  300. package/dist/{fetchAndParseData-BpqkBPQL.js.map → fetchAndParseData-BAXhgTDM.js.map} +1 -1
  301. package/dist/{fetchAndParseData-l5HGMAEs.cjs → fetchAndParseData-QTF6tjij.cjs} +3 -8
  302. package/dist/{fetchAndParseData-l5HGMAEs.cjs.map → fetchAndParseData-QTF6tjij.cjs.map} +1 -1
  303. package/dist/fetchAndParseData.cjs +1 -1
  304. package/dist/fetchAndParseData.js +1 -1
  305. package/dist/getCentroidCoordinates-CtBGrNC8.cjs +2 -0
  306. package/dist/getCentroidCoordinates-CtBGrNC8.cjs.map +1 -0
  307. package/dist/{getCentroidCoordinates-D7r34N4w.js → getCentroidCoordinates-s0OOUjLF.js} +15 -15
  308. package/dist/getCentroidCoordinates-s0OOUjLF.js.map +1 -0
  309. package/dist/{getGraphList-Dxwo9TDb.js → getGraphList-Bpd3PVmF.js} +7 -1
  310. package/dist/getGraphList-Bpd3PVmF.js.map +1 -0
  311. package/dist/getGraphList-DQ24IzAn.cjs +2 -0
  312. package/dist/getGraphList-DQ24IzAn.cjs.map +1 -0
  313. package/dist/{getJenks-GYmdwBqm.cjs → getJenks-BzJvhy_H.cjs} +2 -2
  314. package/dist/{getJenks-GYmdwBqm.cjs.map → getJenks-BzJvhy_H.cjs.map} +1 -1
  315. package/dist/{getJenks-BbngDoBQ.js → getJenks-DTCcQSDi.js} +2 -2
  316. package/dist/{getJenks-BbngDoBQ.js.map → getJenks-DTCcQSDi.js.map} +1 -1
  317. package/dist/getSchema.cjs +1 -1
  318. package/dist/getSchema.cjs.map +1 -1
  319. package/dist/getSchema.d.ts +3 -3
  320. package/dist/getSchema.js +24 -16
  321. package/dist/getSchema.js.map +1 -1
  322. package/dist/getSliderMarks-CIuSoedo.cjs +2 -0
  323. package/dist/{getSliderMarks-BmADcPQt.cjs.map → getSliderMarks-CIuSoedo.cjs.map} +1 -1
  324. package/dist/{getSliderMarks-HIDJ0_Cd.js → getSliderMarks-Cvg8zHBU.js} +4 -9
  325. package/dist/getSliderMarks-Cvg8zHBU.js.map +1 -0
  326. package/dist/{imageDownload-NYXbvKob.cjs → imageDownload-61q6jyJW.cjs} +3 -3
  327. package/dist/imageDownload-61q6jyJW.cjs.map +1 -0
  328. package/dist/{imageDownload-BU4qnxJP.js → imageDownload-Diofs_vY.js} +14 -15
  329. package/dist/imageDownload-Diofs_vY.js.map +1 -0
  330. package/dist/{index-D491FEn1.js → index-BQYOuXdl.js} +15 -15
  331. package/dist/{index-D491FEn1.js.map → index-BQYOuXdl.js.map} +1 -1
  332. package/dist/{index-DxXnJ8Ti.cjs → index-C5K--w8d.cjs} +2 -2
  333. package/dist/index-C5K--w8d.cjs.map +1 -0
  334. package/dist/{index-DRXx7m-C.cjs → index-C6er0ety.cjs} +2 -2
  335. package/dist/{index-DRXx7m-C.cjs.map → index-C6er0ety.cjs.map} +1 -1
  336. package/dist/{index-CHPV5EwG-CTPQjnHt.cjs → index-CHPV5EwG-6v2a2njQ.cjs} +5 -69
  337. package/dist/{index-CHPV5EwG-CTPQjnHt.cjs.map → index-CHPV5EwG-6v2a2njQ.cjs.map} +1 -1
  338. package/dist/{index-CHPV5EwG-Curnpaqc.js → index-CHPV5EwG-DecW7_qr.js} +5 -77
  339. package/dist/{index-CHPV5EwG-Curnpaqc.js.map → index-CHPV5EwG-DecW7_qr.js.map} +1 -1
  340. package/dist/{index-SKgJALZg.js → index-CSiFiXPj.js} +3 -3
  341. package/dist/{index-SKgJALZg.js.map → index-CSiFiXPj.js.map} +1 -1
  342. package/dist/index-CoobIWNj.cjs +10 -0
  343. package/dist/index-CoobIWNj.cjs.map +1 -0
  344. package/dist/index-CtMBjvtq.js +148 -0
  345. package/dist/index-CtMBjvtq.js.map +1 -0
  346. package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs → index-Cw8sCyo_-CEcCMKUi.cjs} +2 -2
  347. package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs.map → index-Cw8sCyo_-CEcCMKUi.cjs.map} +1 -1
  348. package/dist/{index-Cw8sCyo_-B2hEKjzG.js → index-Cw8sCyo_-n4AacHGk.js} +6 -4
  349. package/dist/{index-Cw8sCyo_-B2hEKjzG.js.map → index-Cw8sCyo_-n4AacHGk.js.map} +1 -1
  350. package/dist/{index-R1gTfap5.js → index-D5ihtaJJ.js} +12 -12
  351. package/dist/{index-R1gTfap5.js.map → index-D5ihtaJJ.js.map} +1 -1
  352. package/dist/{index-B_sAFsEV.cjs → index-D69M6klB.cjs} +2 -2
  353. package/dist/{index-B_sAFsEV.cjs.map → index-D69M6klB.cjs.map} +1 -1
  354. package/dist/{index-GEsywGxz.js → index-DCsFBfJ_.js} +160 -104
  355. package/dist/index-DCsFBfJ_.js.map +1 -0
  356. package/dist/{index-WML2dCZ0.cjs → index-Dgjq6aZ2.cjs} +2 -2
  357. package/dist/{index-WML2dCZ0.cjs.map → index-Dgjq6aZ2.cjs.map} +1 -1
  358. package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs → index-Dzc_aaI9-C3DbPpy3.cjs} +2 -2
  359. package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs.map → index-Dzc_aaI9-C3DbPpy3.cjs.map} +1 -1
  360. package/dist/{index-Dzc_aaI9-Bb7gobH_.js → index-Dzc_aaI9-CG2Ar7l1.js} +4 -4
  361. package/dist/{index-Dzc_aaI9-Bb7gobH_.js.map → index-Dzc_aaI9-CG2Ar7l1.js.map} +1 -1
  362. package/dist/index.cjs +1 -1
  363. package/dist/index.d.ts +209 -94
  364. package/dist/index.js +129 -127
  365. package/dist/index.js.map +1 -1
  366. package/dist/{linear-BqltdMeF.js → linear-CalFSAaO.js} +2 -2
  367. package/dist/{linear-BqltdMeF.js.map → linear-CalFSAaO.js.map} +1 -1
  368. package/dist/{linear-BwPAspcq.cjs → linear-CgUCbw9F.cjs} +2 -2
  369. package/dist/{linear-BwPAspcq.cjs.map → linear-CgUCbw9F.cjs.map} +1 -1
  370. package/dist/{ordinal-BJ6O_LC5.js → ordinal-CHaxGJ_l.js} +2 -2
  371. package/dist/{ordinal-BJ6O_LC5.js.map → ordinal-CHaxGJ_l.js.map} +1 -1
  372. package/dist/{parse-DlCRUFh_.js → parse-Dv4of-PN.js} +2 -67
  373. package/dist/{parse-DlCRUFh_.js.map → parse-Dv4of-PN.js.map} +1 -1
  374. package/dist/parse-xYI9yrvL.cjs +2 -0
  375. package/dist/{parse-hMnG_lRV.cjs.map → parse-xYI9yrvL.cjs.map} +1 -1
  376. package/dist/{pow-DgrUorRi.cjs → pow-BnyPO-NX.cjs} +2 -2
  377. package/dist/{pow-DgrUorRi.cjs.map → pow-BnyPO-NX.cjs.map} +1 -1
  378. package/dist/{pow-CM2aze4M.js → pow-CaIrlM4J.js} +2 -2
  379. package/dist/{pow-CM2aze4M.js.map → pow-CaIrlM4J.js.map} +1 -1
  380. package/dist/proxy-C4-uo6nS.cjs +2 -0
  381. package/dist/proxy-C4-uo6nS.cjs.map +1 -0
  382. package/dist/{proxy-BxkFHwUw.js → proxy-DRuSUlPL.js} +2828 -2717
  383. package/dist/proxy-DRuSUlPL.js.map +1 -0
  384. package/dist/{string2HTML-DhG75NqA.js → string2HTML-DUYZT1L9.js} +17 -17
  385. package/dist/{string2HTML-DhG75NqA.js.map → string2HTML-DUYZT1L9.js.map} +1 -1
  386. package/dist/{string2HTML-CPGr_I5E.cjs → string2HTML-xx9MzTtY.cjs} +3 -3
  387. package/dist/{string2HTML-CPGr_I5E.cjs.map → string2HTML-xx9MzTtY.cjs.map} +1 -1
  388. package/dist/style.css +1 -1
  389. package/dist/{time-BUL-dwnK.js → time-CAtex-RV.js} +2 -2
  390. package/dist/{time-BUL-dwnK.js.map → time-CAtex-RV.js.map} +1 -1
  391. package/dist/{time-CZd5YLSP.cjs → time-CkcKbhwe.cjs} +2 -2
  392. package/dist/{time-CZd5YLSP.cjs.map → time-CkcKbhwe.cjs.map} +1 -1
  393. package/dist/transformData.cjs +1 -1
  394. package/dist/transformData.d.ts +1 -1
  395. package/dist/transformData.js +3 -3
  396. package/dist/transformDataForAggregation-BFdha9Dx.cjs +2 -0
  397. package/dist/transformDataForAggregation-BFdha9Dx.cjs.map +1 -0
  398. package/dist/{transformDataForAggregation-j34UL73s.js → transformDataForAggregation-wdPf8bNt.js} +26 -11
  399. package/dist/transformDataForAggregation-wdPf8bNt.js.map +1 -0
  400. package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs → transformDataForGraphFromFile-DOhp1qrp.cjs} +2 -2
  401. package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs.map → transformDataForGraphFromFile-DOhp1qrp.cjs.map} +1 -1
  402. package/dist/{transformDataForGraphFromFile-DyP-83Nh.js → transformDataForGraphFromFile-dt9sHTVy.js} +3 -3
  403. package/dist/{transformDataForGraphFromFile-DyP-83Nh.js.map → transformDataForGraphFromFile-dt9sHTVy.js.map} +1 -1
  404. package/dist/{use-in-view-QcfiW0w3.cjs → use-in-view-C3o_ntMv.cjs} +2 -2
  405. package/dist/use-in-view-C3o_ntMv.cjs.map +1 -0
  406. package/dist/{use-in-view-Cxa7y1TH.js → use-in-view-Dl5L8LtP.js} +2 -2
  407. package/dist/use-in-view-Dl5L8LtP.js.map +1 -0
  408. package/dist/utils.cjs +1 -1
  409. package/dist/utils.js +4 -4
  410. package/dist/validateSchema.cjs +1 -1
  411. package/dist/validateSchema.d.ts +1 -1
  412. package/dist/validateSchema.js +1 -1
  413. package/dist/{x-BBpi7a_7-WVdj1j6r.js → x-BBpi7a_7-BsvWCzYM.js} +1 -31
  414. package/dist/{x-BBpi7a_7-WVdj1j6r.js.map → x-BBpi7a_7-BsvWCzYM.js.map} +1 -1
  415. package/dist/x-BBpi7a_7-DXYIEFwN.cjs +2 -0
  416. package/dist/{x-BBpi7a_7-mTo40uId.cjs.map → x-BBpi7a_7-DXYIEFwN.cjs.map} +1 -1
  417. package/dist/{zoom-C9MFjAaV.js → zoom-5AkJSuWO.js} +3 -3
  418. package/dist/zoom-5AkJSuWO.js.map +1 -0
  419. package/dist/{zoom-DPw8bba-.cjs → zoom-ChcvXFIz.cjs} +2 -2
  420. package/dist/zoom-ChcvXFIz.cjs.map +1 -0
  421. package/package.json +21 -1
  422. package/readme.md +33 -22
  423. package/dist/EmptyState-C7ZXkZWd.js +0 -15
  424. package/dist/GraphEl-BixTEyKW.cjs +0 -2
  425. package/dist/GraphEl-BixTEyKW.cjs.map +0 -1
  426. package/dist/GraphEl-Dyu_EIQb.js.map +0 -1
  427. package/dist/ReferenceLine-2XCwHXQ4.js.map +0 -1
  428. package/dist/RegressionLine-DAcY2DjT.js.map +0 -1
  429. package/dist/checkIfMultiple-wg6hJLXy.cjs +0 -12
  430. package/dist/defaultLocale-BEa-49Qz.js +0 -172
  431. package/dist/defaultLocale-BEa-49Qz.js.map +0 -1
  432. package/dist/defaultLocale-DIVzfLaQ.cjs +0 -2
  433. package/dist/defaultLocale-DIVzfLaQ.cjs.map +0 -1
  434. package/dist/getCentroidCoordinates-D7r34N4w.js.map +0 -1
  435. package/dist/getCentroidCoordinates-Dng1HVjO.cjs +0 -2
  436. package/dist/getCentroidCoordinates-Dng1HVjO.cjs.map +0 -1
  437. package/dist/getGraphList-CA17dvFB.cjs +0 -2
  438. package/dist/getGraphList-CA17dvFB.cjs.map +0 -1
  439. package/dist/getGraphList-Dxwo9TDb.js.map +0 -1
  440. package/dist/getSliderMarks-BmADcPQt.cjs +0 -6
  441. package/dist/getSliderMarks-HIDJ0_Cd.js.map +0 -1
  442. package/dist/imageDownload-BU4qnxJP.js.map +0 -1
  443. package/dist/imageDownload-NYXbvKob.cjs.map +0 -1
  444. package/dist/index-BqfRwk1n.js +0 -146
  445. package/dist/index-BqfRwk1n.js.map +0 -1
  446. package/dist/index-DG2bgAva.cjs +0 -10
  447. package/dist/index-DG2bgAva.cjs.map +0 -1
  448. package/dist/index-DxXnJ8Ti.cjs.map +0 -1
  449. package/dist/index-GEsywGxz.js.map +0 -1
  450. package/dist/parse-hMnG_lRV.cjs +0 -2
  451. package/dist/proxy-BxkFHwUw.js.map +0 -1
  452. package/dist/proxy-BxvUI_9l.cjs +0 -2
  453. package/dist/proxy-BxvUI_9l.cjs.map +0 -1
  454. package/dist/transformDataForAggregation-CYoB5Xsk.cjs +0 -2
  455. package/dist/transformDataForAggregation-CYoB5Xsk.cjs.map +0 -1
  456. package/dist/transformDataForAggregation-j34UL73s.js.map +0 -1
  457. package/dist/use-in-view-Cxa7y1TH.js.map +0 -1
  458. package/dist/use-in-view-QcfiW0w3.cjs.map +0 -1
  459. package/dist/x-BBpi7a_7-mTo40uId.cjs +0 -27
  460. package/dist/zoom-C9MFjAaV.js.map +0 -1
  461. package/dist/zoom-DPw8bba-.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","t30","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","fetchAndParseJSON","then","d_1","t35","t36","t37","speed","interval","setInterval","clearInterval","t38","t39","getSliderMarks","markObj","console","error","t40","graphContainer","t41","t42","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t43","Pause","Play","SliderUI","nextValue","nextValue_0","t44","GraphArea","d_7","format","_temp8","getJenks","_temp9","_temp0","Spinner","t45","footnote","source","GraphFooter","t46","GraphContainer","d_9","d_8","NAME","d_4","d_3","d_2","d_6","d_5","a","b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6EO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJC,MAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,oBAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,6BAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,QAAAA;AAAAA,IACAC,YAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,6BAAAA;AAAAA,EAAAA,IACEhC,GACE,CAACi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,MAAMpF;AAAS;AA1J1D,SAAAqQ,GAAAiC,GAAA;AAAA,SA0JuBlN,EAACvH;AAAK;AA1J7B,SAAA0P,GAAAgF,GAAAC,GAAA;AAAA,SAgEkBD,IAAIC;AAAC;AAhEvB,SAAAnF,GAAAjI,GAAA;AAAA,SA4DgBA,EAAC6H;AAAK;"}
1
+ {"version":3,"file":"BiVariateChoroplethMap.js","sources":["../src/Components/Graphs/Maps/BiVariateMap/Graph.tsx","../src/Components/Graphs/Maps/BiVariateMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n BivariateMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n data: BivariateMapDataType[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n xDomain: number[];\r\n yDomain: number[];\r\n width: number;\r\n height: number;\r\n colors: string[][];\r\n xColorLegendTitle: string;\r\n yColorLegendTitle: string;\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderColor: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n isWorldMap: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n showColorScale: boolean;\r\n collapseColorScaleByDefault?: boolean;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n xDomain,\r\n mapData,\r\n xColorLegendTitle,\r\n yDomain,\r\n yColorLegendTitle,\r\n width,\r\n height,\r\n colors,\r\n scale,\r\n centerPoint,\r\n mapBorderWidth,\r\n mapNoDataColor,\r\n mapBorderColor,\r\n tooltip,\r\n onSeriesMouseOver,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n showColorScale,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n\r\n const xRange = Array.from({ length: xDomain.length }, (_, i) => i);\r\n\r\n const yRange = Array.from({ length: yDomain.length }, (_, i) => i);\r\n const xScale = scaleThreshold<number, number>().domain(xDomain).range(xRange);\r\n const yScale = scaleThreshold<number, number>().domain(yDomain).range(yRange);\r\n\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n viewBox={`0 0 ${width} ${height}`}\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <motion.g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </motion.g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const xColorCoord = !checkIfNullOrUndefined(d.x)\r\n ? xScale(d.x as number)\r\n : undefined;\r\n const yColorCoord = !checkIfNullOrUndefined(d.y)\r\n ? yScale(d.y as number)\r\n : undefined;\r\n const color =\r\n xColorCoord !== undefined && yColorCoord !== undefined\r\n ? colors[yColorCoord][xColorCoord]\r\n : mapNoDataColor;\r\n\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n d={masterPath}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={`${\r\n color === mapNoDataColor\r\n ? 'stroke-primary-gray-400 dark:stroke-primary-gray-500'\r\n : 'stroke-primary-white dark:stroke-primary-gray-650'\r\n }`}\r\n style={{\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{ width: '175px' }}\r\n >\r\n <div className='flex gap-1 items-center'>\r\n <svg width='136px' viewBox='0 0 136 136' className='shrink-0'>\r\n <g>\r\n {colors.map((d, i) => (\r\n <g key={i} transform={`translate(0,${100 - i * 25})`}>\r\n {d.map((el, j) => (\r\n <rect\r\n key={j}\r\n y={1}\r\n x={j * 25 + 1}\r\n fill={el}\r\n width={23}\r\n height={23}\r\n strokeWidth={selectedColor === el ? 2 : 0.25}\r\n style={{ cursor: 'pointer' }}\r\n onMouseOver={() => {\r\n setSelectedColor(el);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n />\r\n ))}\r\n </g>\r\n ))}\r\n <g transform='translate(0,125)'>\r\n {xDomain.map((el, j) => (\r\n <text key={j} y={10} x={(j + 1) * 25} fontSize={10} textAnchor='middle'>\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n ))}\r\n </g>\r\n {yDomain.map((el, j) => (\r\n <g\r\n key={j}\r\n transform={`translate(${\r\n Math.max(Math.min(xDomain.length + 1, 5), 4) * 25 + 10\r\n },${100 - j * 25})`}\r\n >\r\n <text\r\n x={0}\r\n transform='rotate(-90)'\r\n y={0}\r\n fontSize={10}\r\n textAnchor='middle'\r\n >\r\n {typeof el === 'string' || el < 1\r\n ? el\r\n : numberFormattingFunction(el, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n </g>\r\n </svg>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='leading-normal text-center shrink-0'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n writingMode: 'vertical-rl',\r\n height: '8.5rem',\r\n transform: 'rotate(180deg)',\r\n }}\r\n >\r\n {yColorLegendTitle}\r\n </P>\r\n </div>\r\n <P\r\n marginBottom='none'\r\n size='xs'\r\n className='mt-1 leading-normal text-center'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n width: '8.5rem',\r\n WebkitBoxOrient: 'vertical',\r\n overflow: 'hidden',\r\n }}\r\n >\r\n {xColorLegendTitle}\r\n </P>\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border text-primary-gray-700 border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useEffect, useEffectEvent, useMemo, useRef, useState } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n BivariateMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects. */\r\n data: BivariateMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map. Array must be 5x5 */\r\n colors?: string[][];\r\n /** Title for the first color legend */\r\n xColorLegendTitle?: string;\r\n /** Title for the second color legend */\r\n yColorLegendTitle?: string;\r\n /** Domain of x-colors for the map */\r\n xDomain?: number[];\r\n /** Domain of y-colors for the map */\r\n yDomain?: number[];\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function BiVariateChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n colors = Colors.light.bivariateColors.colors05x05,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n xDomain,\r\n yDomain,\r\n xColorLegendTitle = 'X Color key',\r\n yColorLegendTitle = 'Y Color key',\r\n tooltip,\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n showColorScale = true,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n if (xDomain && yDomain)\r\n if (xDomain.length !== colors[0].length - 1 || yDomain.length !== colors.length - 1) {\r\n console.error(\"the xDomain and yDomain array length don't match to the color array length\");\r\n return null;\r\n }\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n xDomain={\r\n xDomain ||\r\n getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors[0].length,\r\n )\r\n }\r\n yDomain={\r\n yDomain ||\r\n getJenks(\r\n data.map(d => d.y as number | null | undefined),\r\n colors.length,\r\n )\r\n }\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={colors}\r\n xColorLegendTitle={xColorLegendTitle}\r\n yColorLegendTitle={yColorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n showColorScale={showColorScale}\r\n classNames={classNames}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n detailsOnClick={detailsOnClick}\r\n zoomInteraction={zoomInteraction}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","xDomain","mapData","xColorLegendTitle","yDomain","yColorLegendTitle","width","height","colors","scale","centerPoint","mapBorderWidth","mapNoDataColor","mapBorderColor","tooltip","onSeriesMouseOver","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","showColorScale","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","showLegend","setShowLegend","useState","undefined","selectedColor","setSelectedColor","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","useRef","isInView","useInView","once","amount","mapG","zoomRef","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","xRange","Array","from","length","_","i","yRange","xScale","scaleThreshold","domain","range","yScale","handleZoom","direction","svg","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","findIndex","el","id","properties","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","xColorCoord","checkIfNullOrUndefined","x","yColorCoord","y","color","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","cursor","numberFormattingFunction","max","P","display","WebkitLineClamp","WebkitBoxOrient","overflow","writingMode","Tooltip","DetailsModal","modal","BiVariateChoroplethMap","$","_c","graphTitle","t0","t1","sources","graphDescription","footNote","t2","t3","t4","t5","padding","t6","t7","backgroundColor","t8","t9","relativeHeight","isWorldMap","t10","t11","graphID","t12","t13","t14","graphDownload","t15","dataDownload","t16","showAntarctica","t17","language","t18","minHeight","t19","theme","t20","ariaLabel","t21","t22","t23","t24","t25","timeline","t26","Colors","light","bivariateColors","colors05x05","graphNoData","grays","t27","t28","t29","t30","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t31","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t32","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t33","shape","onUpdateShape","useEffectEvent","t34","fetchAndParseJSON","then","d_1","t35","t36","t37","speed","interval","setInterval","clearInterval","t38","t39","getSliderMarks","markObj","console","error","t40","graphContainer","t41","t42","description","title","GraphHeader","_temp3","_temp4","_temp5","_temp6","_temp7","t43","Pause","Play","SliderUI","nextValue","nextValue_0","t44","GraphArea","d_7","format","_temp8","getJenks","_temp9","_temp0","Spinner","t45","footnote","source","GraphFooter","t46","GraphContainer","d_9","d_8","NAME","d_4","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6BDM;AAAAA,IAwFCS;AAAAA,EAAAA,GAYH,GAAiB9I,QAAAsC,GAAAtC,SAAAe,IAAAf,SAAAsB,GAAAtB,SAAAvK,GAAAuK,SAAAgC,GAAAhC,SAAAkC,GAAAlC,SAAAY,IAAAZ,SAAAkB,GAAAlB,SAAAmH,IAAAnH,SAAAqH,IAAArH,SAAAsH,IAAAtH,SAAA+H,IAAA/H,SAAAqI,IAAArI,SAAA8I,IAAA9I,SAAAoC,IAAApC,SAAAxK,GAAAwK,SAAAkJ,MAAAA,KAAAlJ,EAAA,GAAA,GAvKjBkJ;AAuKiB;AAlSd,SAAAN,GAAAQ,GAAA;AAAA,SA2NuB3M,EAAC2B;AAA+B;AA3NvD,SAAAuK,GAAAU,GAAA;AAAA,SAoNuB5M,EAACyB;AAA+B;AApNvD,SAAAuK,GAAA1L,GAAA;AAAA,SA6M4BA,EAAEE,WAAWqM,SAAU;AAAY;AA7M/D,SAAAxB,GAAAyB,GAAA;AAAA,SA4J4B9M,MAAMpF;AAAS;AA5J3C,SAAAwQ,GAAA2B,GAAA;AAAA,SA2J6C/M,MAAMpF;AAAS;AA3J5D,SAAAuQ,GAAA6B,GAAA;AAAA,SA2JyBhN,EAACvH;AAAK;AA3J/B,SAAAyS,GAAA+B,GAAA;AAAA,SA0J2CjN,MAAMpF;AAAS;AA1J1D,SAAAqQ,GAAAiC,GAAA;AAAA,SA0JuBlN,EAACvH;AAAK;AA1J7B,SAAA0P,GAAAgF,GAAAC,GAAA;AAAA,SAgEkBD,IAAIC;AAAC;AAhEvB,SAAAnF,GAAAjI,GAAA;AAAA,SA4DgBA,EAAC6H;AAAK;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-CTPQjnHt.cjs"),F=require("react"),Xe=require("./index-Cno4Q0YE.cjs"),Ve=require("./parse-hMnG_lRV.cjs"),Ce=require("./getSliderMarks-BmADcPQt.cjs"),Se=require("./index-DQA8q5sC.cjs"),Oe=require("./index-CSNtgibC.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),$e=require("./Tooltip-uUdw6wJL.cjs"),b=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),De=require("./Axis-DxRV2yMi.cjs"),Te=require("./AxisTitle-sS5bLLR7.cjs"),Ye=require("./XAxesLabels-Bt5NZBmX.cjs"),Fe=require("./ReferenceLine-BH0qdf4R.cjs"),He=require("./YTicksAndGridLines-4pxTRlRK.cjs"),Je=require("./XTicksAndGridLines-B6CELS7q.cjs"),Ke=require("./YAxesLabels-DesLesUP.cjs"),Ue=require("./DetailsModal-BN0HDFlV.cjs"),Be=require("./linear-BwPAspcq.cjs"),Pe=require("./band-VYfcZeJ2.cjs"),Ge=require("./use-in-view-QcfiW0w3.cjs"),kt=require("./proxy-BxvUI_9l.cjs"),We=require("./index-DG2bgAva.cjs"),Ne=require("./Colors.cjs"),Qe=require("./EmptyState-gLDRXBHm.cjs"),ze=require("./GraphContainer-d8A46BK2.cjs"),Ze=require("./GraphFooter.cjs"),_e=require("./GraphHeader.cjs"),ti=require("./ColorLegend.cjs"),qe=require("./ensureCompleteData-pZ9QO6kB.cjs"),Le=require("./index-DRXx7m-C.cjs");function ei(e){const t=a.compilerRuntimeExports.c(160),{data:i,width:Rt,height:se,barColor:Wt,suffix:Ot,prefix:N,barPadding:Xt,showLabels:Yt,showValues:le,showTicks:fe,truncateBy:re,leftMargin:he,rightMargin:Ht,topMargin:oe,bottomMargin:ve,tooltip:ht,onSeriesMouseOver:pt,refValues:It,maxValue:v,minValue:gt,highlightedDataPoints:tt,onSeriesMouseClick:ut,labelOrder:A,maxBarThickness:Jt,minBarThickness:Nt,resetSelectionOnDoubleClick:Kt,detailsOnClick:ct,barAxisTitle:U,valueColor:et,noOfTicks:Vt,styles:p,classNames:l,targetStyle:d,targetColor:B,qualitativeRangeColors:it,measureBarWidthFactor:y,animate:o,dimmedOpacity:m,precision:xt,customLayers:nt,naLabel:V,targetLineThickness:ue}=e,P=he===void 0?20:he,Qt=Ht===void 0?20:Ht,pe=oe===void 0?20:oe,Zt=ve===void 0?25:ve,we=F.useRef(null);let ge;t[0]!==o.amount||t[1]!==o.once?(ge={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ge):ge=t[2];const E=Ge.useInView(we,ge),G=U?P+30:P;let _t;t[3]!==Zt||t[4]!==Qt||t[5]!==G||t[6]!==pe?(_t={top:pe,bottom:Zt,left:G,right:Qt},t[3]=Zt,t[4]=Qt,t[5]=G,t[6]=pe,t[7]=_t):_t=t[7];const g=_t,[at,ye]=F.useState(void 0),[st,yt]=F.useState(void 0),[Et,ce]=F.useState(void 0),[xe,te]=F.useState(void 0),f=Rt-g.left-g.right,Ct=se-g.top-g.bottom;let lt;t[8]!==i?(lt=Math.max(...i.filter(Oi).map(Ri))<0?0:Math.max(...i.filter(ki).map(Ai)),t[8]=i,t[9]=lt):lt=t[9];const bt=lt;let zt;t[10]!==i?(zt=Math.max(...i.filter(Mi).map(ji))<0?0:Math.max(...i.filter(wi).map(vi)),t[10]=i,t[11]=zt):zt=t[11];const qt=zt;let Lt;t[12]!==i?(Lt=Math.max(...i.map(yi)),t[12]=i,t[13]=Lt):Lt=t[13];const St=Lt;let $t;t[14]!==bt||t[15]!==v||t[16]!==St||t[17]!==qt?($t=b.checkIfNullOrUndefined(v)?Math.max(...[bt,qt,St].filter(Number.isFinite))<0?0:Math.max(...[bt,qt,St].filter(Number.isFinite)):v,t[14]=bt,t[15]=v,t[16]=St,t[17]=qt,t[18]=$t):$t=t[18];const Dt=$t;let ee;t[19]!==i?(ee=Math.min(...i.filter(gi).map(pi))>=0?0:Math.min(...i.filter(hi).map(fi)),t[19]=i,t[20]=ee):ee=t[20];const Tt=ee;let Ft;t[21]!==i?(Ft=Math.min(...i.filter(di).map(mi))>=0?0:Math.min(...i.filter(xi).map(ci)),t[21]=i,t[22]=Ft):Ft=t[22];const Ut=Ft;let vt;t[23]!==Tt||t[24]!==gt||t[25]!==Ut?(vt=b.checkIfNullOrUndefined(gt)?Math.min(...[Tt,Ut].filter(Number.isFinite))>=0?0:Math.min(...[Tt,Ut].filter(Number.isFinite)):gt,t[23]=Tt,t[24]=gt,t[25]=Ut,t[26]=vt):vt=t[26];const O=vt;let C;if(t[27]!==i||t[28]!==A){const c=new Set,s=i.map((R,jt)=>{const D=A?`${R.label}`:`${jt}`;return c.add(D),{...R,id:D}}),k=A?A.filter(R=>!c.has(R)):[];C=[...s,...k.map(ui)],t[27]=i,t[28]=A,t[29]=C}else C=t[29];const mt=C;let rt;t[30]!==mt||t[31]!==A?(rt=A??mt.map(oi),t[30]=mt,t[31]=A,t[32]=rt):rt=t[32];const wt=rt;let ot,z,W,X,q,Y,H,M,I,w,j,J,K,Q;if(t[33]!==o||t[34]!==U||t[35]!==Wt||t[36]!==wt||t[37]!==Xt||t[38]!==l?.graphObjectValues||t[39]!==l?.xAxis?.axis||t[40]!==l?.xAxis?.labels||t[41]!==l?.yAxis?.gridLines||t[42]!==l?.yAxis?.labels||t[43]!==l?.yAxis?.title||t[44]!==nt||t[45]!==mt||t[46]!==ct||t[47]!==m||t[48]!==Ct||t[49]!==f||t[50]!==se||t[51]!==tt||t[52]!==E||t[53]!==P||t[54]!==g.bottom||t[55]!==g.left||t[56]!==g.right||t[57]!==g.top||t[58]!==Jt||t[59]!==y||t[60]!==Nt||t[61]!==st||t[62]!==V||t[63]!==Vt||t[64]!==ut||t[65]!==pt||t[66]!==xt||t[67]!==N||t[68]!==it||t[69]!==It||t[70]!==Kt||t[71]!==Yt||t[72]!==fe||t[73]!==le||t[74]!==p?.graphObjectValues||t[75]!==p?.xAxis?.axis||t[76]!==p?.xAxis?.labels||t[77]!==p?.yAxis?.gridLines||t[78]!==p?.yAxis?.labels||t[79]!==p?.yAxis?.title||t[80]!==Ot||t[81]!==B||t[82]!==ue||t[83]!==d||t[84]!==re||t[85]!==et||t[86]!==Rt||t[87]!==Dt||t[88]!==O){const c=Be.linear().domain([O,Dt]).range([Ct,0]).nice(),s=Pe.band().domain(wt).range([0,Nt?Math.max(f,Nt*wt.length):Jt?Math.min(f,Jt*wt.length):f]).paddingInner(Xt),k=c.ticks(Vt);z=kt.motion.svg,w=`${Rt}px`,j=`${se}px`,J=`0 0 ${Rt} ${se}`,K="ltr",Q=we,q=`translate(${g.left},${g.top})`;const R=c(O<0?0:O),jt=c(O<0?0:O),D=O<0?0:O;let x;t[103]!==V||t[104]!==xt||t[105]!==N||t[106]!==Ot||t[107]!==D?(x=Ee.numberFormattingFunction(D,V,xt,N,Ot),t[103]=V,t[104]=xt,t[105]=N,t[106]=Ot,t[107]=D,t[108]=x):x=t[108];const T=l?.xAxis?.axis,me=l?.yAxis?.labels;let Mt;t[109]!==T||t[110]!==me?(Mt={axis:T,label:me},t[109]=T,t[110]=me,t[111]=Mt):Mt=t[111];const ie=p?.xAxis?.axis,Pt=p?.yAxis?.labels;let n;t[112]!==ie||t[113]!==Pt?(n={axis:ie,label:Pt},t[112]=ie,t[113]=Pt,t[114]=n):n=t[114],Y=a.jsxRuntimeExports.jsx(De.Axis,{y1:R,y2:jt,x1:0-P,x2:f+g.right,label:x,labelPos:{x:0-P,dx:0,dy:Dt<0?"1em":-5,y:c(O<0?0:O)},classNames:Mt,styles:n}),H=fe?a.jsxRuntimeExports.jsx(He.YTicksAndGridLines,{values:k.filter(ri),y:k.filter(li).map(r=>c(r)),x1:0-P,x2:f+g.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:l?.yAxis?.gridLines,labels:l?.yAxis?.labels},suffix:Ot,prefix:N,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:xt}):null;const _=0-P-15,At=Ct/2,be=p?.yAxis?.title,je=l?.yAxis?.title;t[115]!==U||t[116]!==_||t[117]!==At||t[118]!==be||t[119]!==je?(M=a.jsxRuntimeExports.jsx(Te.AxisTitle,{x:_,y:At,style:be,className:je,text:U,rotate90:!0}),t[115]=U,t[116]=_,t[117]=At,t[118]=be,t[119]=je,t[120]=M):M=t[120],t[121]!==nt?(I=nt.filter(si).map(ai),t[121]=nt,t[122]=I):I=t[122],ot=We.AnimatePresence,W=mt.map(r=>b.checkIfNullOrUndefined(s(r.id))?null:a.jsxRuntimeExports.jsxs(kt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:ft=>{ye(r),te(ft.clientY),ce(ft.clientX),pt?.(r)},onClick:()=>{(ut||ct)&&(Se.isEqual(st,r)&&Kt?(yt(void 0),ut?.(void 0)):(yt(r),ut?.(r)))},onMouseMove:ft=>{ye(r),te(ft.clientY),ce(ft.clientX)},onMouseLeave:()=>{ye(void 0),ce(void 0),te(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:s(`${r.id}`),y:0,opacity:tt.length!==0?tt.indexOf(r.label)!==-1?.85:m:.85},whileInView:{x:s(`${r.id}`),y:0,opacity:tt.length!==0?tt.indexOf(r.label)!==-1?.85:m:.85,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:[r.qualitativeRange?r.qualitativeRange.map((ft,Gt)=>a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0),fill:it[Gt]},whileInView:{height:Math.abs(c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<=Gt&&ne)))-c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<Gt&&ne)))),y:c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<=Gt&&ne))),fill:it[Gt],transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",width:s.bandwidth()},Gt)):null,r.target&&d==="background"?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,width:s.bandwidth(),exit:{height:0,y:c(0),fill:B,transition:{duration:o.duration}},variants:{initial:{height:0,fill:B,y:c(0)},whileInView:{height:Math.abs(c(r.target)-c(0)),fill:B,y:r.target>0?c(r.target):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,r.size?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:s.bandwidth()*((1-y)/2),width:s.bandwidth()*y,style:{fill:Wt},exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0)},whileInView:{height:Math.abs(c(r.size)-c(0)),y:r.size>0?c(r.size):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,r.target&&d==="line"?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,width:s.bandwidth(),exit:{y:c(0),opacity:0,fill:B,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:B},whileInView:{y:c(r.target)-ue/2,opacity:1,fill:B,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",height:ue}):null,Yt?a.jsxRuntimeExports.jsx(Ye.XAxesLabels,{value:`${r.label}`.length<re?`${r.label}`:`${`${r.label}`.substring(0,re)}...`,y:(r.size||0)<0?0:c(0)+5,x:0,width:s.bandwidth(),height:(r.size||0)<0?c(0)-5:g.bottom,style:p?.xAxis?.labels,className:l?.xAxis?.labels,alignment:(r.size||0)<0?"bottom":"top",animate:o,isInView:E}):null,le?a.jsxRuntimeExports.jsx(kt.motion.text,{x:s.bandwidth()/2,style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!et&&Wt.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",l?.graphObjectValues),dy:r.size?r.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:et||Wt},whileInView:{y:c(r.size||0),opacity:1,fill:et||Wt,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:Ee.numberFormattingFunction(r.size,V,xt,N,Ot)}):null]},r.label)),X=It?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:It.map((r,ft)=>a.jsxRuntimeExports.jsx(Fe.RefLineY,{text:r.text,color:r.color,y:c(r.value),x1:0-P,x2:f+g.right,classNames:r.classNames,styles:r.styles,animate:o,isInView:E},ft))}):null,t[33]=o,t[34]=U,t[35]=Wt,t[36]=wt,t[37]=Xt,t[38]=l?.graphObjectValues,t[39]=l?.xAxis?.axis,t[40]=l?.xAxis?.labels,t[41]=l?.yAxis?.gridLines,t[42]=l?.yAxis?.labels,t[43]=l?.yAxis?.title,t[44]=nt,t[45]=mt,t[46]=ct,t[47]=m,t[48]=Ct,t[49]=f,t[50]=se,t[51]=tt,t[52]=E,t[53]=P,t[54]=g.bottom,t[55]=g.left,t[56]=g.right,t[57]=g.top,t[58]=Jt,t[59]=y,t[60]=Nt,t[61]=st,t[62]=V,t[63]=Vt,t[64]=ut,t[65]=pt,t[66]=xt,t[67]=N,t[68]=it,t[69]=It,t[70]=Kt,t[71]=Yt,t[72]=fe,t[73]=le,t[74]=p?.graphObjectValues,t[75]=p?.xAxis?.axis,t[76]=p?.xAxis?.labels,t[77]=p?.yAxis?.gridLines,t[78]=p?.yAxis?.labels,t[79]=p?.yAxis?.title,t[80]=Ot,t[81]=B,t[82]=ue,t[83]=d,t[84]=re,t[85]=et,t[86]=Rt,t[87]=Dt,t[88]=O,t[89]=ot,t[90]=z,t[91]=W,t[92]=X,t[93]=q,t[94]=Y,t[95]=H,t[96]=M,t[97]=I,t[98]=w,t[99]=j,t[100]=J,t[101]=K,t[102]=Q}else ot=t[89],z=t[90],W=t[91],X=t[92],q=t[93],Y=t[94],H=t[95],M=t[96],I=t[97],w=t[98],j=t[99],J=t[100],K=t[101],Q=t[102];let Z;t[123]!==ot||t[124]!==W||t[125]!==X?(Z=a.jsxRuntimeExports.jsxs(ot,{children:[W,X]}),t[123]=ot,t[124]=W,t[125]=X,t[126]=Z):Z=t[126];let L;t[127]!==nt?(L=nt.filter(ni).map(ii),t[127]=nt,t[128]=L):L=t[128];let u;t[129]!==q||t[130]!==Y||t[131]!==H||t[132]!==M||t[133]!==I||t[134]!==Z||t[135]!==L?(u=a.jsxRuntimeExports.jsxs("g",{transform:q,children:[Y,H,M,I,Z,L]}),t[129]=q,t[130]=Y,t[131]=H,t[132]=M,t[133]=I,t[134]=Z,t[135]=L,t[136]=u):u=t[136];let S;t[137]!==z||t[138]!==w||t[139]!==j||t[140]!==J||t[141]!==K||t[142]!==Q||t[143]!==u?(S=a.jsxRuntimeExports.jsx(z,{width:w,height:j,viewBox:J,direction:K,ref:Q,children:u}),t[137]=z,t[138]=w,t[139]=j,t[140]=J,t[141]=K,t[142]=Q,t[143]=u,t[144]=S):S=t[144];let dt;t[145]!==l?.tooltip||t[146]!==Et||t[147]!==xe||t[148]!==at||t[149]!==p?.tooltip||t[150]!==ht?(dt=at&&ht&&Et&&xe?a.jsxRuntimeExports.jsx($e.Tooltip,{data:at,body:ht,xPos:Et,yPos:xe,backgroundStyle:p?.tooltip,className:l?.tooltip}):null,t[145]=l?.tooltip,t[146]=Et,t[147]=xe,t[148]=at,t[149]=p?.tooltip,t[150]=ht,t[151]=dt):dt=t[151];let $;t[152]!==l?.modal||t[153]!==ct||t[154]!==st?($=ct&&st!==void 0?a.jsxRuntimeExports.jsx(Ue.DetailsModal,{body:ct,data:st,setData:yt,className:l?.modal}):null,t[152]=l?.modal,t[153]=ct,t[154]=st,t[155]=$):$=t[155];let Bt;return t[156]!==S||t[157]!==dt||t[158]!==$?(Bt=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[S,dt,$]}),t[156]=S,t[157]=dt,t[158]=$,t[159]=Bt):Bt=t[159],Bt}function ii(e){return e.layer}function ni(e){return e.position==="after"}function ai(e){return e.layer}function si(e){return e.position==="before"}function li(e){return e!==0}function ri(e){return e!==0}function oi(e){return`${e.id}`}function ui(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function ci(e){return e.target}function xi(e){return!b.checkIfNullOrUndefined(e.target)}function mi(e){return e.target}function di(e){return!b.checkIfNullOrUndefined(e.target)}function fi(e){return e.size}function hi(e){return!b.checkIfNullOrUndefined(e.size)}function pi(e){return e.size}function gi(e){return!b.checkIfNullOrUndefined(e.size)}function yi(e){return Oe.sum((e.qualitativeRange||[]).filter(bi))||0}function bi(e){return!b.checkIfNullOrUndefined(e)}function vi(e){return e.target}function wi(e){return!b.checkIfNullOrUndefined(e.size)}function ji(e){return e.target}function Mi(e){return!b.checkIfNullOrUndefined(e.target)}function Ai(e){return e.size}function ki(e){return!b.checkIfNullOrUndefined(e.size)}function Ri(e){return e.size}function Oi(e){return!b.checkIfNullOrUndefined(e.size)}function Ii(e){const t=a.compilerRuntimeExports.c(152),{data:i,topMargin:Rt,bottomMargin:se,leftMargin:Wt,rightMargin:Ot,barColor:N,suffix:Xt,prefix:Yt,barPadding:le,showValues:fe,showTicks:re,truncateBy:he,width:Ht,height:oe,showLabels:ve,tooltip:ht,onSeriesMouseOver:pt,refValues:It,highlightedDataPoints:v,maxValue:gt,minValue:tt,onSeriesMouseClick:ut,labelOrder:A,rtl:Jt,maxBarThickness:Nt,minBarThickness:Kt,resetSelectionOnDoubleClick:ct,detailsOnClick:U,barAxisTitle:et,valueColor:Vt,noOfTicks:p,styles:l,classNames:d,targetStyle:B,targetColor:it,qualitativeRangeColors:y,measureBarWidthFactor:o,animate:m,dimmedOpacity:xt,precision:nt,customLayers:V,naLabel:ue,targetLineThickness:P}=e,Qt=Rt===void 0?25:Rt,pe=se===void 0?10:se,Zt=Wt===void 0?100:Wt,we=Ot===void 0?40:Ot,ge=F.useRef(null);let E;t[0]!==m.amount||t[1]!==m.once?(E={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=E):E=t[2];const G=Ge.useInView(ge,E),[_t,g]=F.useState(void 0),[at,ye]=F.useState(void 0),[st,yt]=F.useState(void 0),[Et,ce]=F.useState(void 0),xe=et?Qt+25:Qt;let te;t[3]!==pe||t[4]!==Zt||t[5]!==we||t[6]!==xe?(te={top:xe,bottom:pe,left:Zt,right:we},t[3]=pe,t[4]=Zt,t[5]=we,t[6]=xe,t[7]=te):te=t[7];const f=te,Ct=Ht-f.left-f.right,lt=oe-f.top-f.bottom;let bt;t[8]!==i?(bt=Math.max(...i.filter(tn).map(_i))<0?0:Math.max(...i.filter(Zi).map(Qi)),t[8]=i,t[9]=bt):bt=t[9];const zt=bt;let qt;t[10]!==i?(qt=Math.max(...i.filter(Ki).map(Ji))<0?0:Math.max(...i.filter(Hi).map(Yi)),t[10]=i,t[11]=qt):qt=t[11];const Lt=qt;let St;t[12]!==i?(St=Math.max(...i.map(Wi)),t[12]=i,t[13]=St):St=t[13];const $t=St;let Dt;t[14]!==zt||t[15]!==gt||t[16]!==$t||t[17]!==Lt?(Dt=b.checkIfNullOrUndefined(gt)?Math.max(...[zt,Lt,$t].filter(Number.isFinite))<0?0:Math.max(...[zt,Lt,$t].filter(Number.isFinite)):gt,t[14]=zt,t[15]=gt,t[16]=$t,t[17]=Lt,t[18]=Dt):Dt=t[18];const ee=Dt;let Tt;t[19]!==i?(Tt=Math.min(...i.filter(Gi).map(Pi))>=0?0:Math.min(...i.filter(Bi).map(Ui)),t[19]=i,t[20]=Tt):Tt=t[20];const Ft=Tt;let Ut;t[21]!==i?(Ut=Math.min(...i.filter(Fi).map(Ti))>=0?0:Math.min(...i.filter(Di).map($i)),t[21]=i,t[22]=Ut):Ut=t[22];const vt=Ut;let O;t[23]!==Ft||t[24]!==tt||t[25]!==vt?(O=b.checkIfNullOrUndefined(tt)?Math.min(...[Ft,vt].filter(Number.isFinite))>=0?0:Math.min(...[Ft,vt].filter(Number.isFinite)):tt,t[23]=Ft,t[24]=tt,t[25]=vt,t[26]=O):O=t[26];const C=O;let mt;if(t[27]!==i||t[28]!==A){const s=new Set,k=i.map((jt,D)=>{const x=A?`${jt.label}`:`${D}`;return s.add(x),{...jt,id:x}}),R=A?A.filter(jt=>!s.has(jt)):[];mt=[...k,...R.map(Si)],t[27]=i,t[28]=A,t[29]=mt}else mt=t[29];const rt=mt;let wt;t[30]!==rt||t[31]!==A?(wt=A??rt.map(Li),t[30]=rt,t[31]=A,t[32]=wt):wt=t[32];const ot=wt;let z,W,X,q,Y,H,M,I,w,j,J,K,Q,Z;if(t[33]!==m||t[34]!==et||t[35]!==N||t[36]!==ot||t[37]!==le||t[38]!==d?.graphObjectValues||t[39]!==d?.xAxis?.gridLines||t[40]!==d?.xAxis?.labels||t[41]!==d?.xAxis?.title||t[42]!==d?.yAxis?.axis||t[43]!==d?.yAxis?.labels||t[44]!==V||t[45]!==rt||t[46]!==U||t[47]!==xt||t[48]!==lt||t[49]!==Ct||t[50]!==oe||t[51]!==v||t[52]!==G||t[53]!==f.bottom||t[54]!==f.left||t[55]!==f.top||t[56]!==Nt||t[57]!==o||t[58]!==Kt||t[59]!==at||t[60]!==ue||t[61]!==p||t[62]!==ut||t[63]!==pt||t[64]!==nt||t[65]!==Yt||t[66]!==y||t[67]!==It||t[68]!==ct||t[69]!==Jt||t[70]!==ve||t[71]!==re||t[72]!==fe||t[73]!==l?.graphObjectValues||t[74]!==l?.xAxis?.gridLines||t[75]!==l?.xAxis?.labels||t[76]!==l?.xAxis?.title||t[77]!==l?.yAxis?.axis||t[78]!==l?.yAxis?.labels||t[79]!==Xt||t[80]!==it||t[81]!==P||t[82]!==B||t[83]!==Qt||t[84]!==he||t[85]!==Vt||t[86]!==Ht||t[87]!==ee||t[88]!==C){const s=Be.linear().domain([C,ee]).range([0,Ct]).nice(),k=Pe.band().domain(ot).range([0,Kt?Math.max(lt,Kt*ot.length):Nt?Math.min(lt,Nt*ot.length):lt]).paddingInner(le),R=s.ticks(p);W=kt.motion.svg,j=`${Ht}px`,J=`${oe}px`,K=`0 0 ${Ht} ${oe}`,Q="ltr",Z=ge,Y=`translate(${f.left},${f.top})`,H=re?a.jsxRuntimeExports.jsx(Je.XTicksAndGridLines,{values:R.filter(qi),x:R.filter(zi).map(n=>s(n)),y1:0-Qt,y2:lt+f.bottom,styles:{gridLines:l?.xAxis?.gridLines,labels:l?.xAxis?.labels},classNames:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},suffix:Xt,prefix:Yt,labelType:"secondary",showGridLines:!0,precision:nt}):null;const jt=Ct/2,D=0-f.top+15,x=l?.xAxis?.title,T=d?.xAxis?.title;t[103]!==et||t[104]!==jt||t[105]!==D||t[106]!==x||t[107]!==T?(M=a.jsxRuntimeExports.jsx(Te.AxisTitle,{x:jt,y:D,style:x,className:T,text:et}),t[103]=et,t[104]=jt,t[105]=D,t[106]=x,t[107]=T,t[108]=M):M=t[108];const me=d?.yAxis?.axis;let Mt;t[109]!==me?(Mt={axis:me},t[109]=me,t[110]=Mt):Mt=t[110];const ie=l?.yAxis?.axis;let Pt;t[111]!==ie?(Pt={axis:ie},t[111]=ie,t[112]=Pt):Pt=t[112],I=a.jsxRuntimeExports.jsx(De.Axis,{x1:s(C<0?0:C),x2:s(C<0?0:C),y1:-2.5,y2:lt+f.bottom,classNames:Mt,styles:Pt}),t[113]!==V?(w=V.filter(Ci).map(Ei),t[113]=V,t[114]=w):w=t[114],z=We.AnimatePresence,X=rt.map(n=>b.checkIfNullOrUndefined(k(n.id))?null:a.jsxRuntimeExports.jsxs(kt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:_=>{g(n),ce(_.clientY),yt(_.clientX),pt?.(n)},onClick:()=>{(ut||U)&&(Se.isEqual(at,n)&&ct?(ye(void 0),ut?.(void 0)):(ye(n),ut?.(n)))},onMouseMove:_=>{g(n),ce(_.clientY),yt(_.clientX)},onMouseLeave:()=>{g(void 0),yt(void 0),ce(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:0,y:k(`${n.id}`),opacity:v.length!==0?v.indexOf(n.label)!==-1?.85:xt:.85},whileInView:{x:0,y:k(`${n.id}`),opacity:v.length!==0?v.indexOf(n.label)!==-1?.85:xt:.85,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",children:[n.qualitativeRange?n.qualitativeRange.map((_,At)=>a.jsxRuntimeExports.jsx(kt.motion.rect,{exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0,fill:y[At]},whileInView:{x:s(At===0?0:Oe.sum(n.qualitativeRange.filter((be,je)=>je<At&&be))),width:s(_),fill:y[At],transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",y:0,height:k.bandwidth()},At)):null,n.target&&B==="background"?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:0,x:n.target>=0?s(0):s(n.target),height:k.bandwidth(),exit:{width:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),fill:it,width:0},whileInView:{x:n.target>=0?s(0):s(n.target),fill:it,width:n.target>=0?s(n.target)-s(0):s(0)-s(n.target),transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,n.size?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:k.bandwidth()*((1-o)/2),style:{fill:N},height:k.bandwidth()*o,exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0},whileInView:{x:n.size>=0?s(0):s(n.size),width:n.size>=0?s(n.size)-s(0):s(0)-s(n.size),transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,n.target&&B==="line"?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:0,height:k.bandwidth(),width:P,exit:{opacity:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:it},whileInView:{x:s(n.target)-P/2,opacity:1,fill:it,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,ve?a.jsxRuntimeExports.jsx(Ke.YAxesLabels,{value:`${n.label}`.length<he?`${n.label}`:`${`${n.label}`.substring(0,he)}...`,y:0,x:(n.size||0)<0?s(0):0-f.left,width:(n.size||0)<0?Ht-s(0):s(0)+f.left,height:k.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:l?.yAxis?.labels,className:d?.yAxis?.labels,animate:m,isInView:G}):null,fe?a.jsxRuntimeExports.jsx(kt.motion.text,{y:k.bandwidth()/2,style:{textAnchor:n.size&&n.size<0?"end":"start",...l?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!Vt&&N.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",d?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:Vt||N},whileInView:{x:n.size?s(n.size):s(0),opacity:1,fill:Vt||N,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",children:Ee.numberFormattingFunction(n.size,ue,nt,Yt,Xt)}):null]},n.label)),q=It?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:It.map((n,_)=>a.jsxRuntimeExports.jsx(Fe.RefLineX,{text:n.text,color:n.color,x:s(n.value),y1:0-f.top,y2:lt+f.bottom,textSide:s(n.value)>Ct*.75||Jt?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:G},_))}):null,t[33]=m,t[34]=et,t[35]=N,t[36]=ot,t[37]=le,t[38]=d?.graphObjectValues,t[39]=d?.xAxis?.gridLines,t[40]=d?.xAxis?.labels,t[41]=d?.xAxis?.title,t[42]=d?.yAxis?.axis,t[43]=d?.yAxis?.labels,t[44]=V,t[45]=rt,t[46]=U,t[47]=xt,t[48]=lt,t[49]=Ct,t[50]=oe,t[51]=v,t[52]=G,t[53]=f.bottom,t[54]=f.left,t[55]=f.top,t[56]=Nt,t[57]=o,t[58]=Kt,t[59]=at,t[60]=ue,t[61]=p,t[62]=ut,t[63]=pt,t[64]=nt,t[65]=Yt,t[66]=y,t[67]=It,t[68]=ct,t[69]=Jt,t[70]=ve,t[71]=re,t[72]=fe,t[73]=l?.graphObjectValues,t[74]=l?.xAxis?.gridLines,t[75]=l?.xAxis?.labels,t[76]=l?.xAxis?.title,t[77]=l?.yAxis?.axis,t[78]=l?.yAxis?.labels,t[79]=Xt,t[80]=it,t[81]=P,t[82]=B,t[83]=Qt,t[84]=he,t[85]=Vt,t[86]=Ht,t[87]=ee,t[88]=C,t[89]=z,t[90]=W,t[91]=X,t[92]=q,t[93]=Y,t[94]=H,t[95]=M,t[96]=I,t[97]=w,t[98]=j,t[99]=J,t[100]=K,t[101]=Q,t[102]=Z}else z=t[89],W=t[90],X=t[91],q=t[92],Y=t[93],H=t[94],M=t[95],I=t[96],w=t[97],j=t[98],J=t[99],K=t[100],Q=t[101],Z=t[102];let L;t[115]!==z||t[116]!==X||t[117]!==q?(L=a.jsxRuntimeExports.jsxs(z,{children:[X,q]}),t[115]=z,t[116]=X,t[117]=q,t[118]=L):L=t[118];let u;t[119]!==V?(u=V.filter(Vi).map(Ni),t[119]=V,t[120]=u):u=t[120];let S;t[121]!==Y||t[122]!==H||t[123]!==M||t[124]!==I||t[125]!==w||t[126]!==L||t[127]!==u?(S=a.jsxRuntimeExports.jsxs("g",{transform:Y,children:[H,M,I,w,L,u]}),t[121]=Y,t[122]=H,t[123]=M,t[124]=I,t[125]=w,t[126]=L,t[127]=u,t[128]=S):S=t[128];let dt;t[129]!==W||t[130]!==j||t[131]!==J||t[132]!==K||t[133]!==Q||t[134]!==Z||t[135]!==S?(dt=a.jsxRuntimeExports.jsx(W,{width:j,height:J,viewBox:K,direction:Q,ref:Z,children:S}),t[129]=W,t[130]=j,t[131]=J,t[132]=K,t[133]=Q,t[134]=Z,t[135]=S,t[136]=dt):dt=t[136];let $;t[137]!==d?.tooltip||t[138]!==st||t[139]!==Et||t[140]!==_t||t[141]!==l?.tooltip||t[142]!==ht?($=_t&&ht&&st&&Et?a.jsxRuntimeExports.jsx($e.Tooltip,{data:_t,body:ht,xPos:st,yPos:Et,backgroundStyle:l?.tooltip,className:d?.tooltip}):null,t[137]=d?.tooltip,t[138]=st,t[139]=Et,t[140]=_t,t[141]=l?.tooltip,t[142]=ht,t[143]=$):$=t[143];let Bt;t[144]!==d?.modal||t[145]!==U||t[146]!==at?(Bt=U&&at!==void 0?a.jsxRuntimeExports.jsx(Ue.DetailsModal,{body:U,data:at,setData:ye,className:d?.modal}):null,t[144]=d?.modal,t[145]=U,t[146]=at,t[147]=Bt):Bt=t[147];let c;return t[148]!==dt||t[149]!==$||t[150]!==Bt?(c=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[dt,$,Bt]}),t[148]=dt,t[149]=$,t[150]=Bt,t[151]=c):c=t[151],c}function Ni(e){return e.layer}function Vi(e){return e.position==="after"}function Ei(e){return e.layer}function Ci(e){return e.position==="before"}function zi(e){return e!==0}function qi(e){return e!==0}function Li(e){return`${e.id}`}function Si(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function $i(e){return e.target}function Di(e){return!b.checkIfNullOrUndefined(e.target)}function Ti(e){return e.target}function Fi(e){return!b.checkIfNullOrUndefined(e.target)}function Ui(e){return e.size}function Bi(e){return!b.checkIfNullOrUndefined(e.size)}function Pi(e){return e.size}function Gi(e){return!b.checkIfNullOrUndefined(e.size)}function Wi(e){return Oe.sum((e.qualitativeRange||[]).filter(Xi))||0}function Xi(e){return!b.checkIfNullOrUndefined(e)}function Yi(e){return e.target}function Hi(e){return!b.checkIfNullOrUndefined(e.target)}function Ji(e){return e.target}function Ki(e){return!b.checkIfNullOrUndefined(e.target)}function Qi(e){return e.size}function Zi(e){return!b.checkIfNullOrUndefined(e.size)}function _i(e){return e.size}function tn(e){return!b.checkIfNullOrUndefined(e.size)}function en(e){const t=a.compilerRuntimeExports.c(136),{data:i,graphTitle:Rt,barColor:se,barPadding:Wt,showTicks:Ot,leftMargin:N,rightMargin:Xt,topMargin:Yt,bottomMargin:le,truncateBy:fe,showLabels:re,showValues:he,backgroundColor:Ht,suffix:oe,prefix:ve,sources:ht,graphDescription:pt,height:It,width:v,footNote:gt,colorDomain:tt,colorLegendTitle:ut,padding:A,relativeHeight:Jt,tooltip:Nt,onSeriesMouseOver:Kt,refValues:ct,showColorScale:U,graphID:et,maxValue:Vt,minValue:p,highlightedDataPoints:l,onSeriesMouseClick:d,valueColor:B,orientation:it,styles:y,classNames:o,qualitativeRangeColors:m,targetColor:xt,filterNA:nt,targetStyle:V,measureBarWidthFactor:ue,animate:P,dimmedOpacity:Qt,precision:pe,customLayers:Zt,naLabel:we,graphDownload:ge,dataDownload:E,language:G,theme:_t,sortData:g,labelOrder:at,minHeight:ye,maxBarThickness:st,maxNumberOfBars:yt,minBarThickness:Et,ariaLabel:ce,resetSelectionOnDoubleClick:xe,detailsOnClick:te,barAxisTitle:f,noOfTicks:Ct,targetLineThickness:lt,timeline:bt}=e,zt=se===void 0?Ne.Colors.primaryColors["blue-600"]:se,qt=Wt===void 0?.25:Wt,Lt=Ot===void 0?!0:Ot,St=fe===void 0?999:fe,$t=re===void 0?!0:re,Dt=he===void 0?!0:he,ee=Ht===void 0?!1:Ht,Tt=oe===void 0?"":oe,Ft=ve===void 0?"":ve,Ut=U===void 0?!0:U;let vt;t[0]!==l?(vt=l===void 0?[]:l,t[0]=l,t[1]=vt):vt=t[1];const O=vt,C=it===void 0?"vertical":it,mt=xt===void 0?Ne.Colors.light.grays["gray-700"]:xt,rt=nt===void 0?!0:nt,wt=V===void 0?"line":V,ot=ue===void 0?.4:ue,z=P===void 0?!1:P,W=Qt===void 0?.3:Qt,X=pe===void 0?2:pe;let q;t[2]!==Zt?(q=Zt===void 0?[]:Zt,t[2]=Zt,t[3]=q):q=t[3];const Y=q,H=we===void 0?"NA":we,M=ge===void 0?!1:ge,I=E===void 0?!1:E,w=G===void 0?"en":G,j=_t===void 0?"light":_t,J=ye===void 0?0:ye,K=xe===void 0?!0:xe,Q=Ct===void 0?5:Ct,Z=lt===void 0?2:lt;let L;t[4]!==bt?(L=bt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:bt,t[4]=bt,t[5]=L):L=t[5];const u=L,[S,dt]=F.useState(0),[$,Bt]=F.useState(0),c=F.useRef(null),s=F.useRef(null),k=C==="horizontal"?Ii:ei,[R,jt]=F.useState(u.autoplay);let D;if(t[6]!==i||t[7]!==u.dateFormat){let h;t[9]!==u.dateFormat?(h=de=>Ve.parse(`${de.date}`,u.dateFormat||"yyyy",new Date).getTime(),t[9]=u.dateFormat,t[10]=h):h=t[10],D=[...new Set(i.filter(cn).map(h))],D.sort(un),t[6]=i,t[7]=u.dateFormat,t[8]=D}else D=t[8];const x=D,[T,me]=F.useState(u.autoplay?0:x.length-1);let Mt,ie;t[11]===Symbol.for("react.memo_cache_sentinel")?(Mt=()=>{const h=new ResizeObserver(de=>{dt(de[0].target.clientWidth||620),Bt(de[0].target.clientHeight||480)});return c.current&&h.observe(c.current),()=>h.disconnect()},ie=[],t[11]=Mt,t[12]=ie):(Mt=t[11],ie=t[12]),F.useEffect(Mt,ie);let Pt,n;t[13]!==R||t[14]!==u.speed||t[15]!==x?(Pt=()=>{const h=setInterval(()=>{me(de=>de<x.length-1?de+1:0)},(u.speed||2)*1e3);return R||clearInterval(h),()=>clearInterval(h)},n=[x,R,u.speed],t[13]=R,t[14]=u.speed,t[15]=x,t[16]=Pt,t[17]=n):(Pt=t[16],n=t[17]),F.useEffect(Pt,n);const _=u.dateFormat||"yyyy";let At;t[18]!==T||t[19]!==_||t[20]!==u.showOnlyActiveDate||t[21]!==x?(At=Ce.getSliderMarks(x,T,u.showOnlyActiveDate,_),t[18]=T,t[19]=_,t[20]=u.showOnlyActiveDate,t[21]=x,t[22]=At):At=t[22];const be=At,je=o?.graphContainer,r=y?.graphContainer;let ft;t[23]!==o?.description||t[24]!==o?.title||t[25]!==i||t[26]!==I||t[27]!==pt||t[28]!==M||t[29]!==Rt||t[30]!==y?.description||t[31]!==y?.title||t[32]!==v?(ft=Rt||pt||M||I?a.jsxRuntimeExports.jsx(_e.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Rt,graphDescription:pt,width:v,graphDownload:M?s:void 0,dataDownload:I?i.map(on).filter(rn).length>0?i.map(ln).filter(sn):i.filter(an):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=i,t[26]=I,t[27]=pt,t[28]=M,t[29]=Rt,t[30]=y?.description,t[31]=y?.title,t[32]=v,t[33]=ft):ft=t[33];let Gt;t[34]!==T||t[35]!==be||t[36]!==R||t[37]!==u.enabled||t[38]!==x?(Gt=u.enabled&&x.length>0&&be?a.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[a.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{jt(!R)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":R?"Click to pause animation":"Click to play animation",children:R?a.jsxRuntimeExports.jsx(Le.Pause,{}):a.jsxRuntimeExports.jsx(Le.Play,{})}),a.jsxRuntimeExports.jsx(Ce.Nr,{min:x[0],max:x[x.length-1],marks:be,step:null,defaultValue:x[x.length-1],value:x[T],onChangeComplete:h=>{me(x.indexOf(h))},onChange:h=>{me(x.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=T,t[35]=be,t[36]=R,t[37]=u.enabled,t[38]=x,t[39]=Gt):Gt=t[39];let ne;t[40]!==o?.colorLegend||t[41]!==tt||t[42]!==ut||t[43]!==i||t[44]!==m||t[45]!==Ut||t[46]!==j||t[47]!==v?(ne=Ut&&i.filter(nn).length!==0&&tt&&i.length>0?a.jsxRuntimeExports.jsx(ti.ColorLegend,{width:v,colorLegendTitle:ut,colors:m||Ne.Colors[j].sequentialColors.positiveColorsx10,colorDomain:tt,showNAColor:!1,className:o?.colorLegend}):null,t[40]=o?.colorLegend,t[41]=tt,t[42]=ut,t[43]=i,t[44]=m,t[45]=Ut,t[46]=j,t[47]=v,t[48]=ne):ne=t[48];let ae;t[49]!==i.length?(ae=i.length===0&&a.jsxRuntimeExports.jsx(Qe.EmptyState,{}),t[49]=i.length,t[50]=ae):ae=t[50];let Me;t[51]!==k||t[52]!==z||t[53]!==f||t[54]!==zt||t[55]!==qt||t[56]!==le||t[57]!==o||t[58]!==Y||t[59]!==i||t[60]!==te||t[61]!==W||t[62]!==rt||t[63]!==O||t[64]!==T||t[65]!==at||t[66]!==w||t[67]!==N||t[68]!==st||t[69]!==yt||t[70]!==Vt||t[71]!==ot||t[72]!==Et||t[73]!==p||t[74]!==H||t[75]!==Q||t[76]!==d||t[77]!==Kt||t[78]!==C||t[79]!==X||t[80]!==Ft||t[81]!==m||t[82]!==ct||t[83]!==K||t[84]!==Xt||t[85]!==$t||t[86]!==Lt||t[87]!==Dt||t[88]!==g||t[89]!==y||t[90]!==Tt||t[91]!==$||t[92]!==S||t[93]!==mt||t[94]!==Z||t[95]!==wt||t[96]!==j||t[97]!==u.dateFormat||t[98]!==u.enabled||t[99]!==Nt||t[100]!==Yt||t[101]!==St||t[102]!==x||t[103]!==B?(Me=S&&$&&i.length>0?a.jsxRuntimeExports.jsx(k,{data:g?Xe.orderBy(qe.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?h.date===Ve.format(new Date(x[T]),u.dateFormat||"yyyy"):h).filter(h=>rt?!b.checkIfNullOrUndefined(h.size):h),[h=>h.size===void 0?g==="asc"?(C==="horizontal"?1:-1)*(1/0):(C==="horizontal"?-1:1)*(1/0):h.size],[g]).filter((h,de)=>yt?de<yt:!0):qe.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?h.date===Ve.format(new Date(x[T]),u.dateFormat||"yyyy"):h).filter(h=>rt?!b.checkIfNullOrUndefined(h.size):h).filter((h,de)=>yt?de<yt:!0),barColor:zt,targetColor:mt,width:S,refValues:ct,height:$,suffix:Tt,prefix:Ft,barPadding:qt,showLabels:$t,showValues:Dt,showTicks:Lt,truncateBy:St,leftMargin:N,rightMargin:Xt,qualitativeRangeColors:m||Ne.Colors[j].sequentialColors.positiveColorsx10,topMargin:Yt,bottomMargin:le,tooltip:Nt,onSeriesMouseOver:Kt,maxValue:Vt,minValue:p,highlightedDataPoints:O,onSeriesMouseClick:d,labelOrder:at,maxBarThickness:st,minBarThickness:Et,resetSelectionOnDoubleClick:K,detailsOnClick:te,barAxisTitle:f,noOfTicks:Q,valueColor:B,styles:y,classNames:o,targetStyle:wt,dimmedOpacity:W,measureBarWidthFactor:ot,animate:z===!0?{duration:.5,once:!0,amount:.5}:z||{duration:0,once:!0,amount:0},precision:X,customLayers:Y,naLabel:H,targetLineThickness:Z,rtl:w==="ar"||w==="he"}):null,t[51]=k,t[52]=z,t[53]=f,t[54]=zt,t[55]=qt,t[56]=le,t[57]=o,t[58]=Y,t[59]=i,t[60]=te,t[61]=W,t[62]=rt,t[63]=O,t[64]=T,t[65]=at,t[66]=w,t[67]=N,t[68]=st,t[69]=yt,t[70]=Vt,t[71]=ot,t[72]=Et,t[73]=p,t[74]=H,t[75]=Q,t[76]=d,t[77]=Kt,t[78]=C,t[79]=X,t[80]=Ft,t[81]=m,t[82]=ct,t[83]=K,t[84]=Xt,t[85]=$t,t[86]=Lt,t[87]=Dt,t[88]=g,t[89]=y,t[90]=Tt,t[91]=$,t[92]=S,t[93]=mt,t[94]=Z,t[95]=wt,t[96]=j,t[97]=u.dateFormat,t[98]=u.enabled,t[99]=Nt,t[100]=Yt,t[101]=St,t[102]=x,t[103]=B,t[104]=Me):Me=t[104];let Ae;t[105]!==ae||t[106]!==Me?(Ae=a.jsxRuntimeExports.jsxs(ze.GraphArea,{ref:c,children:[ae,Me]}),t[105]=ae,t[106]=Me,t[107]=Ae):Ae=t[107];let ke;t[108]!==ne||t[109]!==Ae?(ke=a.jsxRuntimeExports.jsxs("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:[ne,Ae]}),t[108]=ne,t[109]=Ae,t[110]=ke):ke=t[110];let Re;t[111]!==o?.footnote||t[112]!==o?.source||t[113]!==gt||t[114]!==ht||t[115]!==y?.footnote||t[116]!==y?.source||t[117]!==v?(Re=ht||gt?a.jsxRuntimeExports.jsx(Ze.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ht,footNote:gt,width:v}):null,t[111]=o?.footnote,t[112]=o?.source,t[113]=gt,t[114]=ht,t[115]=y?.footnote,t[116]=y?.source,t[117]=v,t[118]=Re):Re=t[118];let Ie;return t[119]!==ce||t[120]!==ee||t[121]!==et||t[122]!==It||t[123]!==w||t[124]!==J||t[125]!==A||t[126]!==Jt||t[127]!==je||t[128]!==r||t[129]!==ft||t[130]!==Gt||t[131]!==ke||t[132]!==Re||t[133]!==j||t[134]!==v?(Ie=a.jsxRuntimeExports.jsxs(ze.GraphContainer,{className:je,style:r,id:et,ref:s,"aria-label":ce,backgroundColor:ee,theme:j,language:w,minHeight:J,width:v,height:It,relativeHeight:Jt,padding:A,children:[ft,Gt,ke,Re]}),t[119]=ce,t[120]=ee,t[121]=et,t[122]=It,t[123]=w,t[124]=J,t[125]=A,t[126]=Jt,t[127]=je,t[128]=r,t[129]=ft,t[130]=Gt,t[131]=ke,t[132]=Re,t[133]=j,t[134]=v,t[135]=Ie):Ie=t[135],Ie}function nn(e){return e.qualitativeRange}function an(e){return e!==void 0}function sn(e){return e!==void 0}function ln(e){return e.data}function rn(e){return e!==void 0}function on(e){return e.data}function un(e,t){return e-t}function cn(e){return e.date}exports.BulletChart=en;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-6v2a2njQ.cjs"),F=require("react"),Xe=require("./index-Cno4Q0YE.cjs"),Ve=require("./parse-xYI9yrvL.cjs"),Ce=require("./getSliderMarks-CIuSoedo.cjs"),Se=require("./index-DQA8q5sC.cjs"),Oe=require("./index-CSNtgibC.cjs"),Ee=require("./numberFormattingFunction-02t-wJta.cjs"),$e=require("./Tooltip-BLa2EfMs.cjs"),b=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),De=require("./Axis-Dtjn-EgM.cjs"),Te=require("./AxisTitle-DV4n0RxE.cjs"),Ye=require("./XAxesLabels-C6o9jJal.cjs"),Fe=require("./ReferenceLine-M9aP3dj-.cjs"),He=require("./YTicksAndGridLines-UzVC5eBM.cjs"),Je=require("./XTicksAndGridLines-CekrPykD.cjs"),Ke=require("./YAxesLabels-BQ2aCazV.cjs"),Ue=require("./DetailsModal-DHttOA80.cjs"),Be=require("./linear-CgUCbw9F.cjs"),Pe=require("./band-VYfcZeJ2.cjs"),kt=require("./proxy-C4-uo6nS.cjs"),Ge=require("./use-in-view-C3o_ntMv.cjs"),We=require("./index-CoobIWNj.cjs"),Ne=require("./Colors.cjs"),Qe=require("./EmptyState-CGeBqbmR.cjs"),ze=require("./GraphContainer-B1EDxJ0S.cjs"),Ze=require("./GraphFooter.cjs"),_e=require("./GraphHeader.cjs"),ti=require("./ColorLegend.cjs"),qe=require("./ensureCompleteData-D9bQTiVS.cjs"),Le=require("./index-C6er0ety.cjs");function ei(e){const t=a.compilerRuntimeExports.c(160),{data:i,width:Rt,height:se,barColor:Wt,suffix:Ot,prefix:N,barPadding:Xt,showLabels:Yt,showValues:le,showTicks:fe,truncateBy:re,leftMargin:he,rightMargin:Ht,topMargin:oe,bottomMargin:ve,tooltip:ht,onSeriesMouseOver:pt,refValues:It,maxValue:v,minValue:gt,highlightedDataPoints:tt,onSeriesMouseClick:ut,labelOrder:A,maxBarThickness:Jt,minBarThickness:Nt,resetSelectionOnDoubleClick:Kt,detailsOnClick:ct,barAxisTitle:U,valueColor:et,noOfTicks:Vt,styles:p,classNames:l,targetStyle:d,targetColor:B,qualitativeRangeColors:it,measureBarWidthFactor:y,animate:o,dimmedOpacity:m,precision:xt,customLayers:nt,naLabel:V,targetLineThickness:ue}=e,P=he===void 0?20:he,Qt=Ht===void 0?20:Ht,pe=oe===void 0?20:oe,Zt=ve===void 0?25:ve,we=F.useRef(null);let ge;t[0]!==o.amount||t[1]!==o.once?(ge={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=ge):ge=t[2];const E=Ge.useInView(we,ge),G=U?P+30:P;let _t;t[3]!==Zt||t[4]!==Qt||t[5]!==G||t[6]!==pe?(_t={top:pe,bottom:Zt,left:G,right:Qt},t[3]=Zt,t[4]=Qt,t[5]=G,t[6]=pe,t[7]=_t):_t=t[7];const g=_t,[at,ye]=F.useState(void 0),[st,yt]=F.useState(void 0),[Et,ce]=F.useState(void 0),[xe,te]=F.useState(void 0),f=Rt-g.left-g.right,Ct=se-g.top-g.bottom;let lt;t[8]!==i?(lt=Math.max(...i.filter(Oi).map(Ri))<0?0:Math.max(...i.filter(ki).map(Ai)),t[8]=i,t[9]=lt):lt=t[9];const bt=lt;let zt;t[10]!==i?(zt=Math.max(...i.filter(Mi).map(ji))<0?0:Math.max(...i.filter(wi).map(vi)),t[10]=i,t[11]=zt):zt=t[11];const qt=zt;let Lt;t[12]!==i?(Lt=Math.max(...i.map(yi)),t[12]=i,t[13]=Lt):Lt=t[13];const St=Lt;let $t;t[14]!==bt||t[15]!==v||t[16]!==St||t[17]!==qt?($t=b.checkIfNullOrUndefined(v)?Math.max(...[bt,qt,St].filter(Number.isFinite))<0?0:Math.max(...[bt,qt,St].filter(Number.isFinite)):v,t[14]=bt,t[15]=v,t[16]=St,t[17]=qt,t[18]=$t):$t=t[18];const Dt=$t;let ee;t[19]!==i?(ee=Math.min(...i.filter(gi).map(pi))>=0?0:Math.min(...i.filter(hi).map(fi)),t[19]=i,t[20]=ee):ee=t[20];const Tt=ee;let Ft;t[21]!==i?(Ft=Math.min(...i.filter(di).map(mi))>=0?0:Math.min(...i.filter(xi).map(ci)),t[21]=i,t[22]=Ft):Ft=t[22];const Ut=Ft;let vt;t[23]!==Tt||t[24]!==gt||t[25]!==Ut?(vt=b.checkIfNullOrUndefined(gt)?Math.min(...[Tt,Ut].filter(Number.isFinite))>=0?0:Math.min(...[Tt,Ut].filter(Number.isFinite)):gt,t[23]=Tt,t[24]=gt,t[25]=Ut,t[26]=vt):vt=t[26];const O=vt;let C;if(t[27]!==i||t[28]!==A){const c=new Set,s=i.map((R,jt)=>{const D=A?`${R.label}`:`${jt}`;return c.add(D),{...R,id:D}}),k=A?A.filter(R=>!c.has(R)):[];C=[...s,...k.map(ui)],t[27]=i,t[28]=A,t[29]=C}else C=t[29];const mt=C;let rt;t[30]!==mt||t[31]!==A?(rt=A??mt.map(oi),t[30]=mt,t[31]=A,t[32]=rt):rt=t[32];const wt=rt;let ot,z,W,X,q,Y,H,M,I,w,j,J,K,Q;if(t[33]!==o||t[34]!==U||t[35]!==Wt||t[36]!==wt||t[37]!==Xt||t[38]!==l?.graphObjectValues||t[39]!==l?.xAxis?.axis||t[40]!==l?.xAxis?.labels||t[41]!==l?.yAxis?.gridLines||t[42]!==l?.yAxis?.labels||t[43]!==l?.yAxis?.title||t[44]!==nt||t[45]!==mt||t[46]!==ct||t[47]!==m||t[48]!==Ct||t[49]!==f||t[50]!==se||t[51]!==tt||t[52]!==E||t[53]!==P||t[54]!==g.bottom||t[55]!==g.left||t[56]!==g.right||t[57]!==g.top||t[58]!==Jt||t[59]!==y||t[60]!==Nt||t[61]!==st||t[62]!==V||t[63]!==Vt||t[64]!==ut||t[65]!==pt||t[66]!==xt||t[67]!==N||t[68]!==it||t[69]!==It||t[70]!==Kt||t[71]!==Yt||t[72]!==fe||t[73]!==le||t[74]!==p?.graphObjectValues||t[75]!==p?.xAxis?.axis||t[76]!==p?.xAxis?.labels||t[77]!==p?.yAxis?.gridLines||t[78]!==p?.yAxis?.labels||t[79]!==p?.yAxis?.title||t[80]!==Ot||t[81]!==B||t[82]!==ue||t[83]!==d||t[84]!==re||t[85]!==et||t[86]!==Rt||t[87]!==Dt||t[88]!==O){const c=Be.linear().domain([O,Dt]).range([Ct,0]).nice(),s=Pe.band().domain(wt).range([0,Nt?Math.max(f,Nt*wt.length):Jt?Math.min(f,Jt*wt.length):f]).paddingInner(Xt),k=c.ticks(Vt);z=kt.motion.svg,w=`${Rt}px`,j=`${se}px`,J=`0 0 ${Rt} ${se}`,K="ltr",Q=we,q=`translate(${g.left},${g.top})`;const R=c(O<0?0:O),jt=c(O<0?0:O),D=O<0?0:O;let x;t[103]!==V||t[104]!==xt||t[105]!==N||t[106]!==Ot||t[107]!==D?(x=Ee.numberFormattingFunction(D,V,xt,N,Ot),t[103]=V,t[104]=xt,t[105]=N,t[106]=Ot,t[107]=D,t[108]=x):x=t[108];const T=l?.xAxis?.axis,me=l?.yAxis?.labels;let Mt;t[109]!==T||t[110]!==me?(Mt={axis:T,label:me},t[109]=T,t[110]=me,t[111]=Mt):Mt=t[111];const ie=p?.xAxis?.axis,Pt=p?.yAxis?.labels;let n;t[112]!==ie||t[113]!==Pt?(n={axis:ie,label:Pt},t[112]=ie,t[113]=Pt,t[114]=n):n=t[114],Y=a.jsxRuntimeExports.jsx(De.Axis,{y1:R,y2:jt,x1:0-P,x2:f+g.right,label:x,labelPos:{x:0-P,dx:0,dy:Dt<0?"1em":-5,y:c(O<0?0:O)},classNames:Mt,styles:n}),H=fe?a.jsxRuntimeExports.jsx(He.YTicksAndGridLines,{values:k.filter(ri),y:k.filter(li).map(r=>c(r)),x1:0-P,x2:f+g.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:l?.yAxis?.gridLines,labels:l?.yAxis?.labels},suffix:Ot,prefix:N,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:xt}):null;const _=0-P-15,At=Ct/2,be=p?.yAxis?.title,je=l?.yAxis?.title;t[115]!==U||t[116]!==_||t[117]!==At||t[118]!==be||t[119]!==je?(M=a.jsxRuntimeExports.jsx(Te.AxisTitle,{x:_,y:At,style:be,className:je,text:U,rotate90:!0}),t[115]=U,t[116]=_,t[117]=At,t[118]=be,t[119]=je,t[120]=M):M=t[120],t[121]!==nt?(I=nt.filter(si).map(ai),t[121]=nt,t[122]=I):I=t[122],ot=We.AnimatePresence,W=mt.map(r=>b.checkIfNullOrUndefined(s(r.id))?null:a.jsxRuntimeExports.jsxs(kt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:ft=>{ye(r),te(ft.clientY),ce(ft.clientX),pt?.(r)},onClick:()=>{(ut||ct)&&(Se.isEqual(st,r)&&Kt?(yt(void 0),ut?.(void 0)):(yt(r),ut?.(r)))},onMouseMove:ft=>{ye(r),te(ft.clientY),ce(ft.clientX)},onMouseLeave:()=>{ye(void 0),ce(void 0),te(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{x:s(`${r.id}`),y:0,opacity:tt.length!==0?tt.indexOf(r.label)!==-1?.85:m:.85},whileInView:{x:s(`${r.id}`),y:0,opacity:tt.length!==0?tt.indexOf(r.label)!==-1?.85:m:.85,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:[r.qualitativeRange?r.qualitativeRange.map((ft,Gt)=>a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0),fill:it[Gt]},whileInView:{height:Math.abs(c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<=Gt&&ne)))-c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<Gt&&ne)))),y:c(Oe.sum(r.qualitativeRange.filter((ne,ae)=>ae<=Gt&&ne))),fill:it[Gt],transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",width:s.bandwidth()},Gt)):null,r.target&&d==="background"?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,width:s.bandwidth(),exit:{height:0,y:c(0),fill:B,transition:{duration:o.duration}},variants:{initial:{height:0,fill:B,y:c(0)},whileInView:{height:Math.abs(c(r.target)-c(0)),fill:B,y:r.target>0?c(r.target):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,r.size?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:s.bandwidth()*((1-y)/2),width:s.bandwidth()*y,style:{fill:Wt},exit:{height:0,y:c(0),transition:{duration:o.duration}},variants:{initial:{height:0,y:c(0)},whileInView:{height:Math.abs(c(r.size)-c(0)),y:r.size>0?c(r.size):c(0),transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial"}):null,r.target&&d==="line"?a.jsxRuntimeExports.jsx(kt.motion.rect,{x:0,width:s.bandwidth(),exit:{y:c(0),opacity:0,fill:B,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:B},whileInView:{y:c(r.target)-ue/2,opacity:1,fill:B,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",height:ue}):null,Yt?a.jsxRuntimeExports.jsx(Ye.XAxesLabels,{value:`${r.label}`.length<re?`${r.label}`:`${`${r.label}`.substring(0,re)}...`,y:(r.size||0)<0?0:c(0)+5,x:0,width:s.bandwidth(),height:(r.size||0)<0?c(0)-5:g.bottom,style:p?.xAxis?.labels,className:l?.xAxis?.labels,alignment:(r.size||0)<0?"bottom":"top",animate:o,isInView:E}):null,le?a.jsxRuntimeExports.jsx(kt.motion.text,{x:s.bandwidth()/2,style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!et&&Wt.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",l?.graphObjectValues),dy:r.size?r.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:o.duration}},variants:{initial:{y:c(0),opacity:0,fill:et||Wt},whileInView:{y:c(r.size||0),opacity:1,fill:et||Wt,transition:{duration:o.duration}}},initial:"initial",animate:E?"whileInView":"initial",children:Ee.numberFormattingFunction(r.size,V,xt,N,Ot)}):null]},r.label)),X=It?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:It.map((r,ft)=>a.jsxRuntimeExports.jsx(Fe.RefLineY,{text:r.text,color:r.color,y:c(r.value),x1:0-P,x2:f+g.right,classNames:r.classNames,styles:r.styles,animate:o,isInView:E},ft))}):null,t[33]=o,t[34]=U,t[35]=Wt,t[36]=wt,t[37]=Xt,t[38]=l?.graphObjectValues,t[39]=l?.xAxis?.axis,t[40]=l?.xAxis?.labels,t[41]=l?.yAxis?.gridLines,t[42]=l?.yAxis?.labels,t[43]=l?.yAxis?.title,t[44]=nt,t[45]=mt,t[46]=ct,t[47]=m,t[48]=Ct,t[49]=f,t[50]=se,t[51]=tt,t[52]=E,t[53]=P,t[54]=g.bottom,t[55]=g.left,t[56]=g.right,t[57]=g.top,t[58]=Jt,t[59]=y,t[60]=Nt,t[61]=st,t[62]=V,t[63]=Vt,t[64]=ut,t[65]=pt,t[66]=xt,t[67]=N,t[68]=it,t[69]=It,t[70]=Kt,t[71]=Yt,t[72]=fe,t[73]=le,t[74]=p?.graphObjectValues,t[75]=p?.xAxis?.axis,t[76]=p?.xAxis?.labels,t[77]=p?.yAxis?.gridLines,t[78]=p?.yAxis?.labels,t[79]=p?.yAxis?.title,t[80]=Ot,t[81]=B,t[82]=ue,t[83]=d,t[84]=re,t[85]=et,t[86]=Rt,t[87]=Dt,t[88]=O,t[89]=ot,t[90]=z,t[91]=W,t[92]=X,t[93]=q,t[94]=Y,t[95]=H,t[96]=M,t[97]=I,t[98]=w,t[99]=j,t[100]=J,t[101]=K,t[102]=Q}else ot=t[89],z=t[90],W=t[91],X=t[92],q=t[93],Y=t[94],H=t[95],M=t[96],I=t[97],w=t[98],j=t[99],J=t[100],K=t[101],Q=t[102];let Z;t[123]!==ot||t[124]!==W||t[125]!==X?(Z=a.jsxRuntimeExports.jsxs(ot,{children:[W,X]}),t[123]=ot,t[124]=W,t[125]=X,t[126]=Z):Z=t[126];let L;t[127]!==nt?(L=nt.filter(ni).map(ii),t[127]=nt,t[128]=L):L=t[128];let u;t[129]!==q||t[130]!==Y||t[131]!==H||t[132]!==M||t[133]!==I||t[134]!==Z||t[135]!==L?(u=a.jsxRuntimeExports.jsxs("g",{transform:q,children:[Y,H,M,I,Z,L]}),t[129]=q,t[130]=Y,t[131]=H,t[132]=M,t[133]=I,t[134]=Z,t[135]=L,t[136]=u):u=t[136];let S;t[137]!==z||t[138]!==w||t[139]!==j||t[140]!==J||t[141]!==K||t[142]!==Q||t[143]!==u?(S=a.jsxRuntimeExports.jsx(z,{width:w,height:j,viewBox:J,direction:K,ref:Q,children:u}),t[137]=z,t[138]=w,t[139]=j,t[140]=J,t[141]=K,t[142]=Q,t[143]=u,t[144]=S):S=t[144];let dt;t[145]!==l?.tooltip||t[146]!==Et||t[147]!==xe||t[148]!==at||t[149]!==p?.tooltip||t[150]!==ht?(dt=at&&ht&&Et&&xe?a.jsxRuntimeExports.jsx($e.Tooltip,{data:at,body:ht,xPos:Et,yPos:xe,backgroundStyle:p?.tooltip,className:l?.tooltip}):null,t[145]=l?.tooltip,t[146]=Et,t[147]=xe,t[148]=at,t[149]=p?.tooltip,t[150]=ht,t[151]=dt):dt=t[151];let $;t[152]!==l?.modal||t[153]!==ct||t[154]!==st?($=ct&&st!==void 0?a.jsxRuntimeExports.jsx(Ue.DetailsModal,{body:ct,data:st,setData:yt,className:l?.modal}):null,t[152]=l?.modal,t[153]=ct,t[154]=st,t[155]=$):$=t[155];let Bt;return t[156]!==S||t[157]!==dt||t[158]!==$?(Bt=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[S,dt,$]}),t[156]=S,t[157]=dt,t[158]=$,t[159]=Bt):Bt=t[159],Bt}function ii(e){return e.layer}function ni(e){return e.position==="after"}function ai(e){return e.layer}function si(e){return e.position==="before"}function li(e){return e!==0}function ri(e){return e!==0}function oi(e){return`${e.id}`}function ui(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function ci(e){return e.target}function xi(e){return!b.checkIfNullOrUndefined(e.target)}function mi(e){return e.target}function di(e){return!b.checkIfNullOrUndefined(e.target)}function fi(e){return e.size}function hi(e){return!b.checkIfNullOrUndefined(e.size)}function pi(e){return e.size}function gi(e){return!b.checkIfNullOrUndefined(e.size)}function yi(e){return Oe.sum((e.qualitativeRange||[]).filter(bi))||0}function bi(e){return!b.checkIfNullOrUndefined(e)}function vi(e){return e.target}function wi(e){return!b.checkIfNullOrUndefined(e.size)}function ji(e){return e.target}function Mi(e){return!b.checkIfNullOrUndefined(e.target)}function Ai(e){return e.size}function ki(e){return!b.checkIfNullOrUndefined(e.size)}function Ri(e){return e.size}function Oi(e){return!b.checkIfNullOrUndefined(e.size)}function Ii(e){const t=a.compilerRuntimeExports.c(152),{data:i,topMargin:Rt,bottomMargin:se,leftMargin:Wt,rightMargin:Ot,barColor:N,suffix:Xt,prefix:Yt,barPadding:le,showValues:fe,showTicks:re,truncateBy:he,width:Ht,height:oe,showLabels:ve,tooltip:ht,onSeriesMouseOver:pt,refValues:It,highlightedDataPoints:v,maxValue:gt,minValue:tt,onSeriesMouseClick:ut,labelOrder:A,rtl:Jt,maxBarThickness:Nt,minBarThickness:Kt,resetSelectionOnDoubleClick:ct,detailsOnClick:U,barAxisTitle:et,valueColor:Vt,noOfTicks:p,styles:l,classNames:d,targetStyle:B,targetColor:it,qualitativeRangeColors:y,measureBarWidthFactor:o,animate:m,dimmedOpacity:xt,precision:nt,customLayers:V,naLabel:ue,targetLineThickness:P}=e,Qt=Rt===void 0?25:Rt,pe=se===void 0?10:se,Zt=Wt===void 0?100:Wt,we=Ot===void 0?40:Ot,ge=F.useRef(null);let E;t[0]!==m.amount||t[1]!==m.once?(E={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=E):E=t[2];const G=Ge.useInView(ge,E),[_t,g]=F.useState(void 0),[at,ye]=F.useState(void 0),[st,yt]=F.useState(void 0),[Et,ce]=F.useState(void 0),xe=et?Qt+25:Qt;let te;t[3]!==pe||t[4]!==Zt||t[5]!==we||t[6]!==xe?(te={top:xe,bottom:pe,left:Zt,right:we},t[3]=pe,t[4]=Zt,t[5]=we,t[6]=xe,t[7]=te):te=t[7];const f=te,Ct=Ht-f.left-f.right,lt=oe-f.top-f.bottom;let bt;t[8]!==i?(bt=Math.max(...i.filter(tn).map(_i))<0?0:Math.max(...i.filter(Zi).map(Qi)),t[8]=i,t[9]=bt):bt=t[9];const zt=bt;let qt;t[10]!==i?(qt=Math.max(...i.filter(Ki).map(Ji))<0?0:Math.max(...i.filter(Hi).map(Yi)),t[10]=i,t[11]=qt):qt=t[11];const Lt=qt;let St;t[12]!==i?(St=Math.max(...i.map(Wi)),t[12]=i,t[13]=St):St=t[13];const $t=St;let Dt;t[14]!==zt||t[15]!==gt||t[16]!==$t||t[17]!==Lt?(Dt=b.checkIfNullOrUndefined(gt)?Math.max(...[zt,Lt,$t].filter(Number.isFinite))<0?0:Math.max(...[zt,Lt,$t].filter(Number.isFinite)):gt,t[14]=zt,t[15]=gt,t[16]=$t,t[17]=Lt,t[18]=Dt):Dt=t[18];const ee=Dt;let Tt;t[19]!==i?(Tt=Math.min(...i.filter(Gi).map(Pi))>=0?0:Math.min(...i.filter(Bi).map(Ui)),t[19]=i,t[20]=Tt):Tt=t[20];const Ft=Tt;let Ut;t[21]!==i?(Ut=Math.min(...i.filter(Fi).map(Ti))>=0?0:Math.min(...i.filter(Di).map($i)),t[21]=i,t[22]=Ut):Ut=t[22];const vt=Ut;let O;t[23]!==Ft||t[24]!==tt||t[25]!==vt?(O=b.checkIfNullOrUndefined(tt)?Math.min(...[Ft,vt].filter(Number.isFinite))>=0?0:Math.min(...[Ft,vt].filter(Number.isFinite)):tt,t[23]=Ft,t[24]=tt,t[25]=vt,t[26]=O):O=t[26];const C=O;let mt;if(t[27]!==i||t[28]!==A){const s=new Set,k=i.map((jt,D)=>{const x=A?`${jt.label}`:`${D}`;return s.add(x),{...jt,id:x}}),R=A?A.filter(jt=>!s.has(jt)):[];mt=[...k,...R.map(Si)],t[27]=i,t[28]=A,t[29]=mt}else mt=t[29];const rt=mt;let wt;t[30]!==rt||t[31]!==A?(wt=A??rt.map(Li),t[30]=rt,t[31]=A,t[32]=wt):wt=t[32];const ot=wt;let z,W,X,q,Y,H,M,I,w,j,J,K,Q,Z;if(t[33]!==m||t[34]!==et||t[35]!==N||t[36]!==ot||t[37]!==le||t[38]!==d?.graphObjectValues||t[39]!==d?.xAxis?.gridLines||t[40]!==d?.xAxis?.labels||t[41]!==d?.xAxis?.title||t[42]!==d?.yAxis?.axis||t[43]!==d?.yAxis?.labels||t[44]!==V||t[45]!==rt||t[46]!==U||t[47]!==xt||t[48]!==lt||t[49]!==Ct||t[50]!==oe||t[51]!==v||t[52]!==G||t[53]!==f.bottom||t[54]!==f.left||t[55]!==f.top||t[56]!==Nt||t[57]!==o||t[58]!==Kt||t[59]!==at||t[60]!==ue||t[61]!==p||t[62]!==ut||t[63]!==pt||t[64]!==nt||t[65]!==Yt||t[66]!==y||t[67]!==It||t[68]!==ct||t[69]!==Jt||t[70]!==ve||t[71]!==re||t[72]!==fe||t[73]!==l?.graphObjectValues||t[74]!==l?.xAxis?.gridLines||t[75]!==l?.xAxis?.labels||t[76]!==l?.xAxis?.title||t[77]!==l?.yAxis?.axis||t[78]!==l?.yAxis?.labels||t[79]!==Xt||t[80]!==it||t[81]!==P||t[82]!==B||t[83]!==Qt||t[84]!==he||t[85]!==Vt||t[86]!==Ht||t[87]!==ee||t[88]!==C){const s=Be.linear().domain([C,ee]).range([0,Ct]).nice(),k=Pe.band().domain(ot).range([0,Kt?Math.max(lt,Kt*ot.length):Nt?Math.min(lt,Nt*ot.length):lt]).paddingInner(le),R=s.ticks(p);W=kt.motion.svg,j=`${Ht}px`,J=`${oe}px`,K=`0 0 ${Ht} ${oe}`,Q="ltr",Z=ge,Y=`translate(${f.left},${f.top})`,H=re?a.jsxRuntimeExports.jsx(Je.XTicksAndGridLines,{values:R.filter(qi),x:R.filter(zi).map(n=>s(n)),y1:0-Qt,y2:lt+f.bottom,styles:{gridLines:l?.xAxis?.gridLines,labels:l?.xAxis?.labels},classNames:{gridLines:d?.xAxis?.gridLines,labels:d?.xAxis?.labels},suffix:Xt,prefix:Yt,labelType:"secondary",showGridLines:!0,precision:nt}):null;const jt=Ct/2,D=0-f.top+15,x=l?.xAxis?.title,T=d?.xAxis?.title;t[103]!==et||t[104]!==jt||t[105]!==D||t[106]!==x||t[107]!==T?(M=a.jsxRuntimeExports.jsx(Te.AxisTitle,{x:jt,y:D,style:x,className:T,text:et}),t[103]=et,t[104]=jt,t[105]=D,t[106]=x,t[107]=T,t[108]=M):M=t[108];const me=d?.yAxis?.axis;let Mt;t[109]!==me?(Mt={axis:me},t[109]=me,t[110]=Mt):Mt=t[110];const ie=l?.yAxis?.axis;let Pt;t[111]!==ie?(Pt={axis:ie},t[111]=ie,t[112]=Pt):Pt=t[112],I=a.jsxRuntimeExports.jsx(De.Axis,{x1:s(C<0?0:C),x2:s(C<0?0:C),y1:-2.5,y2:lt+f.bottom,classNames:Mt,styles:Pt}),t[113]!==V?(w=V.filter(Ci).map(Ei),t[113]=V,t[114]=w):w=t[114],z=We.AnimatePresence,X=rt.map(n=>b.checkIfNullOrUndefined(k(n.id))?null:a.jsxRuntimeExports.jsxs(kt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:_=>{g(n),ce(_.clientY),yt(_.clientX),pt?.(n)},onClick:()=>{(ut||U)&&(Se.isEqual(at,n)&&ct?(ye(void 0),ut?.(void 0)):(ye(n),ut?.(n)))},onMouseMove:_=>{g(n),ce(_.clientY),yt(_.clientX)},onMouseLeave:()=>{g(void 0),yt(void 0),ce(void 0),pt?.(void 0)},exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:0,y:k(`${n.id}`),opacity:v.length!==0?v.indexOf(n.label)!==-1?.85:xt:.85},whileInView:{x:0,y:k(`${n.id}`),opacity:v.length!==0?v.indexOf(n.label)!==-1?.85:xt:.85,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",children:[n.qualitativeRange?n.qualitativeRange.map((_,At)=>a.jsxRuntimeExports.jsx(kt.motion.rect,{exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0,fill:y[At]},whileInView:{x:s(At===0?0:Oe.sum(n.qualitativeRange.filter((be,je)=>je<At&&be))),width:s(_),fill:y[At],transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",y:0,height:k.bandwidth()},At)):null,n.target&&B==="background"?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:0,x:n.target>=0?s(0):s(n.target),height:k.bandwidth(),exit:{width:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),fill:it,width:0},whileInView:{x:n.target>=0?s(0):s(n.target),fill:it,width:n.target>=0?s(n.target)-s(0):s(0)-s(n.target),transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,n.size?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:k.bandwidth()*((1-o)/2),style:{fill:N},height:k.bandwidth()*o,exit:{width:0,x:s(0),transition:{duration:m.duration}},variants:{initial:{x:s(0),width:0},whileInView:{x:n.size>=0?s(0):s(n.size),width:n.size>=0?s(n.size)-s(0):s(0)-s(n.size),transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,n.target&&B==="line"?a.jsxRuntimeExports.jsx(kt.motion.rect,{y:0,height:k.bandwidth(),width:P,exit:{opacity:0,x:s(0),fill:it,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:it},whileInView:{x:s(n.target)-P/2,opacity:1,fill:it,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial"}):null,ve?a.jsxRuntimeExports.jsx(Ke.YAxesLabels,{value:`${n.label}`.length<he?`${n.label}`:`${`${n.label}`.substring(0,he)}...`,y:0,x:(n.size||0)<0?s(0):0-f.left,width:(n.size||0)<0?Ht-s(0):s(0)+f.left,height:k.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:l?.yAxis?.labels,className:d?.yAxis?.labels,animate:m,isInView:G}):null,fe?a.jsxRuntimeExports.jsx(kt.motion.text,{y:k.bandwidth()/2,style:{textAnchor:n.size&&n.size<0?"end":"start",...l?.graphObjectValues||{}},className:a.mo("graph-value text-sm",!Vt&&N.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",d?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:s(0),opacity:0,fill:Vt||N},whileInView:{x:n.size?s(n.size):s(0),opacity:1,fill:Vt||N,transition:{duration:m.duration}}},initial:"initial",animate:G?"whileInView":"initial",children:Ee.numberFormattingFunction(n.size,ue,nt,Yt,Xt)}):null]},n.label)),q=It?a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:It.map((n,_)=>a.jsxRuntimeExports.jsx(Fe.RefLineX,{text:n.text,color:n.color,x:s(n.value),y1:0-f.top,y2:lt+f.bottom,textSide:s(n.value)>Ct*.75||Jt?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:G},_))}):null,t[33]=m,t[34]=et,t[35]=N,t[36]=ot,t[37]=le,t[38]=d?.graphObjectValues,t[39]=d?.xAxis?.gridLines,t[40]=d?.xAxis?.labels,t[41]=d?.xAxis?.title,t[42]=d?.yAxis?.axis,t[43]=d?.yAxis?.labels,t[44]=V,t[45]=rt,t[46]=U,t[47]=xt,t[48]=lt,t[49]=Ct,t[50]=oe,t[51]=v,t[52]=G,t[53]=f.bottom,t[54]=f.left,t[55]=f.top,t[56]=Nt,t[57]=o,t[58]=Kt,t[59]=at,t[60]=ue,t[61]=p,t[62]=ut,t[63]=pt,t[64]=nt,t[65]=Yt,t[66]=y,t[67]=It,t[68]=ct,t[69]=Jt,t[70]=ve,t[71]=re,t[72]=fe,t[73]=l?.graphObjectValues,t[74]=l?.xAxis?.gridLines,t[75]=l?.xAxis?.labels,t[76]=l?.xAxis?.title,t[77]=l?.yAxis?.axis,t[78]=l?.yAxis?.labels,t[79]=Xt,t[80]=it,t[81]=P,t[82]=B,t[83]=Qt,t[84]=he,t[85]=Vt,t[86]=Ht,t[87]=ee,t[88]=C,t[89]=z,t[90]=W,t[91]=X,t[92]=q,t[93]=Y,t[94]=H,t[95]=M,t[96]=I,t[97]=w,t[98]=j,t[99]=J,t[100]=K,t[101]=Q,t[102]=Z}else z=t[89],W=t[90],X=t[91],q=t[92],Y=t[93],H=t[94],M=t[95],I=t[96],w=t[97],j=t[98],J=t[99],K=t[100],Q=t[101],Z=t[102];let L;t[115]!==z||t[116]!==X||t[117]!==q?(L=a.jsxRuntimeExports.jsxs(z,{children:[X,q]}),t[115]=z,t[116]=X,t[117]=q,t[118]=L):L=t[118];let u;t[119]!==V?(u=V.filter(Vi).map(Ni),t[119]=V,t[120]=u):u=t[120];let S;t[121]!==Y||t[122]!==H||t[123]!==M||t[124]!==I||t[125]!==w||t[126]!==L||t[127]!==u?(S=a.jsxRuntimeExports.jsxs("g",{transform:Y,children:[H,M,I,w,L,u]}),t[121]=Y,t[122]=H,t[123]=M,t[124]=I,t[125]=w,t[126]=L,t[127]=u,t[128]=S):S=t[128];let dt;t[129]!==W||t[130]!==j||t[131]!==J||t[132]!==K||t[133]!==Q||t[134]!==Z||t[135]!==S?(dt=a.jsxRuntimeExports.jsx(W,{width:j,height:J,viewBox:K,direction:Q,ref:Z,children:S}),t[129]=W,t[130]=j,t[131]=J,t[132]=K,t[133]=Q,t[134]=Z,t[135]=S,t[136]=dt):dt=t[136];let $;t[137]!==d?.tooltip||t[138]!==st||t[139]!==Et||t[140]!==_t||t[141]!==l?.tooltip||t[142]!==ht?($=_t&&ht&&st&&Et?a.jsxRuntimeExports.jsx($e.Tooltip,{data:_t,body:ht,xPos:st,yPos:Et,backgroundStyle:l?.tooltip,className:d?.tooltip}):null,t[137]=d?.tooltip,t[138]=st,t[139]=Et,t[140]=_t,t[141]=l?.tooltip,t[142]=ht,t[143]=$):$=t[143];let Bt;t[144]!==d?.modal||t[145]!==U||t[146]!==at?(Bt=U&&at!==void 0?a.jsxRuntimeExports.jsx(Ue.DetailsModal,{body:U,data:at,setData:ye,className:d?.modal}):null,t[144]=d?.modal,t[145]=U,t[146]=at,t[147]=Bt):Bt=t[147];let c;return t[148]!==dt||t[149]!==$||t[150]!==Bt?(c=a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[dt,$,Bt]}),t[148]=dt,t[149]=$,t[150]=Bt,t[151]=c):c=t[151],c}function Ni(e){return e.layer}function Vi(e){return e.position==="after"}function Ei(e){return e.layer}function Ci(e){return e.position==="before"}function zi(e){return e!==0}function qi(e){return e!==0}function Li(e){return`${e.id}`}function Si(e){return{id:e,label:e,size:null,target:null,qualitativeRange:null}}function $i(e){return e.target}function Di(e){return!b.checkIfNullOrUndefined(e.target)}function Ti(e){return e.target}function Fi(e){return!b.checkIfNullOrUndefined(e.target)}function Ui(e){return e.size}function Bi(e){return!b.checkIfNullOrUndefined(e.size)}function Pi(e){return e.size}function Gi(e){return!b.checkIfNullOrUndefined(e.size)}function Wi(e){return Oe.sum((e.qualitativeRange||[]).filter(Xi))||0}function Xi(e){return!b.checkIfNullOrUndefined(e)}function Yi(e){return e.target}function Hi(e){return!b.checkIfNullOrUndefined(e.target)}function Ji(e){return e.target}function Ki(e){return!b.checkIfNullOrUndefined(e.target)}function Qi(e){return e.size}function Zi(e){return!b.checkIfNullOrUndefined(e.size)}function _i(e){return e.size}function tn(e){return!b.checkIfNullOrUndefined(e.size)}function en(e){const t=a.compilerRuntimeExports.c(136),{data:i,graphTitle:Rt,barColor:se,barPadding:Wt,showTicks:Ot,leftMargin:N,rightMargin:Xt,topMargin:Yt,bottomMargin:le,truncateBy:fe,showLabels:re,showValues:he,backgroundColor:Ht,suffix:oe,prefix:ve,sources:ht,graphDescription:pt,height:It,width:v,footNote:gt,colorDomain:tt,colorLegendTitle:ut,padding:A,relativeHeight:Jt,tooltip:Nt,onSeriesMouseOver:Kt,refValues:ct,showColorScale:U,graphID:et,maxValue:Vt,minValue:p,highlightedDataPoints:l,onSeriesMouseClick:d,valueColor:B,orientation:it,styles:y,classNames:o,qualitativeRangeColors:m,targetColor:xt,filterNA:nt,targetStyle:V,measureBarWidthFactor:ue,animate:P,dimmedOpacity:Qt,precision:pe,customLayers:Zt,naLabel:we,graphDownload:ge,dataDownload:E,language:G,theme:_t,sortData:g,labelOrder:at,minHeight:ye,maxBarThickness:st,maxNumberOfBars:yt,minBarThickness:Et,ariaLabel:ce,resetSelectionOnDoubleClick:xe,detailsOnClick:te,barAxisTitle:f,noOfTicks:Ct,targetLineThickness:lt,timeline:bt}=e,zt=se===void 0?Ne.Colors.primaryColors["blue-600"]:se,qt=Wt===void 0?.25:Wt,Lt=Ot===void 0?!0:Ot,St=fe===void 0?999:fe,$t=re===void 0?!0:re,Dt=he===void 0?!0:he,ee=Ht===void 0?!1:Ht,Tt=oe===void 0?"":oe,Ft=ve===void 0?"":ve,Ut=U===void 0?!0:U;let vt;t[0]!==l?(vt=l===void 0?[]:l,t[0]=l,t[1]=vt):vt=t[1];const O=vt,C=it===void 0?"vertical":it,mt=xt===void 0?Ne.Colors.light.grays["gray-700"]:xt,rt=nt===void 0?!0:nt,wt=V===void 0?"line":V,ot=ue===void 0?.4:ue,z=P===void 0?!1:P,W=Qt===void 0?.3:Qt,X=pe===void 0?2:pe;let q;t[2]!==Zt?(q=Zt===void 0?[]:Zt,t[2]=Zt,t[3]=q):q=t[3];const Y=q,H=we===void 0?"NA":we,M=ge===void 0?!1:ge,I=E===void 0?!1:E,w=G===void 0?"en":G,j=_t===void 0?"light":_t,J=ye===void 0?0:ye,K=xe===void 0?!0:xe,Q=Ct===void 0?5:Ct,Z=lt===void 0?2:lt;let L;t[4]!==bt?(L=bt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:bt,t[4]=bt,t[5]=L):L=t[5];const u=L,[S,dt]=F.useState(0),[$,Bt]=F.useState(0),c=F.useRef(null),s=F.useRef(null),k=C==="horizontal"?Ii:ei,[R,jt]=F.useState(u.autoplay);let D;if(t[6]!==i||t[7]!==u.dateFormat){let h;t[9]!==u.dateFormat?(h=de=>Ve.parse(`${de.date}`,u.dateFormat||"yyyy",new Date).getTime(),t[9]=u.dateFormat,t[10]=h):h=t[10],D=[...new Set(i.filter(cn).map(h))],D.sort(un),t[6]=i,t[7]=u.dateFormat,t[8]=D}else D=t[8];const x=D,[T,me]=F.useState(u.autoplay?0:x.length-1);let Mt,ie;t[11]===Symbol.for("react.memo_cache_sentinel")?(Mt=()=>{const h=new ResizeObserver(de=>{dt(de[0].target.clientWidth||620),Bt(de[0].target.clientHeight||480)});return c.current&&h.observe(c.current),()=>h.disconnect()},ie=[],t[11]=Mt,t[12]=ie):(Mt=t[11],ie=t[12]),F.useEffect(Mt,ie);let Pt,n;t[13]!==R||t[14]!==u.speed||t[15]!==x?(Pt=()=>{const h=setInterval(()=>{me(de=>de<x.length-1?de+1:0)},(u.speed||2)*1e3);return R||clearInterval(h),()=>clearInterval(h)},n=[x,R,u.speed],t[13]=R,t[14]=u.speed,t[15]=x,t[16]=Pt,t[17]=n):(Pt=t[16],n=t[17]),F.useEffect(Pt,n);const _=u.dateFormat||"yyyy";let At;t[18]!==T||t[19]!==_||t[20]!==u.showOnlyActiveDate||t[21]!==x?(At=Ce.getSliderMarks(x,T,u.showOnlyActiveDate,_),t[18]=T,t[19]=_,t[20]=u.showOnlyActiveDate,t[21]=x,t[22]=At):At=t[22];const be=At,je=o?.graphContainer,r=y?.graphContainer;let ft;t[23]!==o?.description||t[24]!==o?.title||t[25]!==i||t[26]!==I||t[27]!==pt||t[28]!==M||t[29]!==Rt||t[30]!==y?.description||t[31]!==y?.title||t[32]!==v?(ft=Rt||pt||M||I?a.jsxRuntimeExports.jsx(_e.GraphHeader,{styles:{title:y?.title,description:y?.description},classNames:{title:o?.title,description:o?.description},graphTitle:Rt,graphDescription:pt,width:v,graphDownload:M?s:void 0,dataDownload:I?i.map(on).filter(rn).length>0?i.map(ln).filter(sn):i.filter(an):null}):null,t[23]=o?.description,t[24]=o?.title,t[25]=i,t[26]=I,t[27]=pt,t[28]=M,t[29]=Rt,t[30]=y?.description,t[31]=y?.title,t[32]=v,t[33]=ft):ft=t[33];let Gt;t[34]!==T||t[35]!==be||t[36]!==R||t[37]!==u.enabled||t[38]!==x?(Gt=u.enabled&&x.length>0&&be?a.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[a.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{jt(!R)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":R?"Click to pause animation":"Click to play animation",children:R?a.jsxRuntimeExports.jsx(Le.Pause,{}):a.jsxRuntimeExports.jsx(Le.Play,{})}),a.jsxRuntimeExports.jsx(Ce.Nr,{min:x[0],max:x[x.length-1],marks:be,step:null,defaultValue:x[x.length-1],value:x[T],onChangeComplete:h=>{me(x.indexOf(h))},onChange:h=>{me(x.indexOf(h))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t[34]=T,t[35]=be,t[36]=R,t[37]=u.enabled,t[38]=x,t[39]=Gt):Gt=t[39];let ne;t[40]!==o?.colorLegend||t[41]!==tt||t[42]!==ut||t[43]!==i||t[44]!==m||t[45]!==Ut||t[46]!==j||t[47]!==v?(ne=Ut&&i.filter(nn).length!==0&&tt&&i.length>0?a.jsxRuntimeExports.jsx(ti.ColorLegend,{width:v,colorLegendTitle:ut,colors:m||Ne.Colors[j].sequentialColors.positiveColorsx10,colorDomain:tt,showNAColor:!1,className:o?.colorLegend}):null,t[40]=o?.colorLegend,t[41]=tt,t[42]=ut,t[43]=i,t[44]=m,t[45]=Ut,t[46]=j,t[47]=v,t[48]=ne):ne=t[48];let ae;t[49]!==i.length?(ae=i.length===0&&a.jsxRuntimeExports.jsx(Qe.EmptyState,{}),t[49]=i.length,t[50]=ae):ae=t[50];let Me;t[51]!==k||t[52]!==z||t[53]!==f||t[54]!==zt||t[55]!==qt||t[56]!==le||t[57]!==o||t[58]!==Y||t[59]!==i||t[60]!==te||t[61]!==W||t[62]!==rt||t[63]!==O||t[64]!==T||t[65]!==at||t[66]!==w||t[67]!==N||t[68]!==st||t[69]!==yt||t[70]!==Vt||t[71]!==ot||t[72]!==Et||t[73]!==p||t[74]!==H||t[75]!==Q||t[76]!==d||t[77]!==Kt||t[78]!==C||t[79]!==X||t[80]!==Ft||t[81]!==m||t[82]!==ct||t[83]!==K||t[84]!==Xt||t[85]!==$t||t[86]!==Lt||t[87]!==Dt||t[88]!==g||t[89]!==y||t[90]!==Tt||t[91]!==$||t[92]!==S||t[93]!==mt||t[94]!==Z||t[95]!==wt||t[96]!==j||t[97]!==u.dateFormat||t[98]!==u.enabled||t[99]!==Nt||t[100]!==Yt||t[101]!==St||t[102]!==x||t[103]!==B?(Me=S&&$&&i.length>0?a.jsxRuntimeExports.jsx(k,{data:g?Xe.orderBy(qe.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?h.date===Ve.format(new Date(x[T]),u.dateFormat||"yyyy"):h).filter(h=>rt?!b.checkIfNullOrUndefined(h.size):h),[h=>h.size===void 0?g==="asc"?(C==="horizontal"?1:-1)*(1/0):(C==="horizontal"?-1:1)*(1/0):h.size],[g]).filter((h,de)=>yt?de<yt:!0):qe.ensureCompleteDataForBulletChart(i,u.dateFormat||"yyyy").filter(h=>u.enabled?h.date===Ve.format(new Date(x[T]),u.dateFormat||"yyyy"):h).filter(h=>rt?!b.checkIfNullOrUndefined(h.size):h).filter((h,de)=>yt?de<yt:!0),barColor:zt,targetColor:mt,width:S,refValues:ct,height:$,suffix:Tt,prefix:Ft,barPadding:qt,showLabels:$t,showValues:Dt,showTicks:Lt,truncateBy:St,leftMargin:N,rightMargin:Xt,qualitativeRangeColors:m||Ne.Colors[j].sequentialColors.positiveColorsx10,topMargin:Yt,bottomMargin:le,tooltip:Nt,onSeriesMouseOver:Kt,maxValue:Vt,minValue:p,highlightedDataPoints:O,onSeriesMouseClick:d,labelOrder:at,maxBarThickness:st,minBarThickness:Et,resetSelectionOnDoubleClick:K,detailsOnClick:te,barAxisTitle:f,noOfTicks:Q,valueColor:B,styles:y,classNames:o,targetStyle:wt,dimmedOpacity:W,measureBarWidthFactor:ot,animate:z===!0?{duration:.5,once:!0,amount:.5}:z||{duration:0,once:!0,amount:0},precision:X,customLayers:Y,naLabel:H,targetLineThickness:Z,rtl:w==="ar"||w==="he"}):null,t[51]=k,t[52]=z,t[53]=f,t[54]=zt,t[55]=qt,t[56]=le,t[57]=o,t[58]=Y,t[59]=i,t[60]=te,t[61]=W,t[62]=rt,t[63]=O,t[64]=T,t[65]=at,t[66]=w,t[67]=N,t[68]=st,t[69]=yt,t[70]=Vt,t[71]=ot,t[72]=Et,t[73]=p,t[74]=H,t[75]=Q,t[76]=d,t[77]=Kt,t[78]=C,t[79]=X,t[80]=Ft,t[81]=m,t[82]=ct,t[83]=K,t[84]=Xt,t[85]=$t,t[86]=Lt,t[87]=Dt,t[88]=g,t[89]=y,t[90]=Tt,t[91]=$,t[92]=S,t[93]=mt,t[94]=Z,t[95]=wt,t[96]=j,t[97]=u.dateFormat,t[98]=u.enabled,t[99]=Nt,t[100]=Yt,t[101]=St,t[102]=x,t[103]=B,t[104]=Me):Me=t[104];let Ae;t[105]!==ae||t[106]!==Me?(Ae=a.jsxRuntimeExports.jsxs(ze.GraphArea,{ref:c,children:[ae,Me]}),t[105]=ae,t[106]=Me,t[107]=Ae):Ae=t[107];let ke;t[108]!==ne||t[109]!==Ae?(ke=a.jsxRuntimeExports.jsxs("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:[ne,Ae]}),t[108]=ne,t[109]=Ae,t[110]=ke):ke=t[110];let Re;t[111]!==o?.footnote||t[112]!==o?.source||t[113]!==gt||t[114]!==ht||t[115]!==y?.footnote||t[116]!==y?.source||t[117]!==v?(Re=ht||gt?a.jsxRuntimeExports.jsx(Ze.GraphFooter,{styles:{footnote:y?.footnote,source:y?.source},classNames:{footnote:o?.footnote,source:o?.source},sources:ht,footNote:gt,width:v}):null,t[111]=o?.footnote,t[112]=o?.source,t[113]=gt,t[114]=ht,t[115]=y?.footnote,t[116]=y?.source,t[117]=v,t[118]=Re):Re=t[118];let Ie;return t[119]!==ce||t[120]!==ee||t[121]!==et||t[122]!==It||t[123]!==w||t[124]!==J||t[125]!==A||t[126]!==Jt||t[127]!==je||t[128]!==r||t[129]!==ft||t[130]!==Gt||t[131]!==ke||t[132]!==Re||t[133]!==j||t[134]!==v?(Ie=a.jsxRuntimeExports.jsxs(ze.GraphContainer,{className:je,style:r,id:et,ref:s,"aria-label":ce,backgroundColor:ee,theme:j,language:w,minHeight:J,width:v,height:It,relativeHeight:Jt,padding:A,children:[ft,Gt,ke,Re]}),t[119]=ce,t[120]=ee,t[121]=et,t[122]=It,t[123]=w,t[124]=J,t[125]=A,t[126]=Jt,t[127]=je,t[128]=r,t[129]=ft,t[130]=Gt,t[131]=ke,t[132]=Re,t[133]=j,t[134]=v,t[135]=Ie):Ie=t[135],Ie}function nn(e){return e.qualitativeRange}function an(e){return e!==void 0}function sn(e){return e!==void 0}function ln(e){return e.data}function rn(e){return e!==void 0}function on(e){return e.data}function un(e,t){return e-t}function cn(e){return e.date}exports.BulletChart=en;
2
2
  //# sourceMappingURL=BulletChart.cjs.map