@undp/data-viz 1.5.8 → 1.5.9

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 (305) hide show
  1. package/dist/AreaChart.cjs +1 -1
  2. package/dist/AreaChart.js +13 -13
  3. package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
  4. package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
  5. package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
  6. package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
  7. package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
  8. package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
  9. package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
  10. package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
  11. package/dist/BarGraph.cjs +1 -1
  12. package/dist/BarGraph.js +16 -16
  13. package/dist/BasicStatCard.cjs +1 -1
  14. package/dist/BasicStatCard.js +2 -2
  15. package/dist/BeeSwarmChart.cjs +1 -1
  16. package/dist/BeeSwarmChart.js +42 -42
  17. package/dist/BiVariateChoroplethMap.cjs +1 -1
  18. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  19. package/dist/BiVariateChoroplethMap.d.ts +2 -0
  20. package/dist/BiVariateChoroplethMap.js +257 -264
  21. package/dist/BiVariateChoroplethMap.js.map +1 -1
  22. package/dist/BulletChart.cjs +1 -1
  23. package/dist/BulletChart.js +14 -14
  24. package/dist/ButterflyChart.cjs +1 -1
  25. package/dist/ButterflyChart.js +45 -45
  26. package/dist/ChoroplethMap.cjs +1 -1
  27. package/dist/ChoroplethMap.cjs.map +1 -1
  28. package/dist/ChoroplethMap.d.ts +2 -0
  29. package/dist/ChoroplethMap.js +296 -304
  30. package/dist/ChoroplethMap.js.map +1 -1
  31. package/dist/CirclePackingGraph.cjs +1 -1
  32. package/dist/CirclePackingGraph.js +3 -3
  33. package/dist/ColorLegend.cjs +1 -1
  34. package/dist/ColorLegend.js +2 -2
  35. package/dist/ColorLegendWithMouseOver.cjs +1 -1
  36. package/dist/ColorLegendWithMouseOver.js +2 -2
  37. package/dist/CopyTextButton.cjs +4 -4
  38. package/dist/CopyTextButton.cjs.map +1 -1
  39. package/dist/CopyTextButton.js +27 -27
  40. package/dist/CopyTextButton.js.map +1 -1
  41. package/dist/CsvDownloadButton.cjs +1 -1
  42. package/dist/CsvDownloadButton.js +2 -2
  43. package/dist/DataCards.cjs +3 -3
  44. package/dist/DataCards.cjs.map +1 -1
  45. package/dist/DataCards.js +16 -16
  46. package/dist/DataCards.js.map +1 -1
  47. package/dist/DataTable.cjs +1 -1
  48. package/dist/DataTable.js +3 -3
  49. package/dist/DifferenceLineChart.cjs +1 -1
  50. package/dist/DifferenceLineChart.js +12 -12
  51. package/dist/DonutChart.cjs +1 -1
  52. package/dist/DonutChart.js +20 -20
  53. package/dist/DotDensityMap.cjs +1 -1
  54. package/dist/DotDensityMap.cjs.map +1 -1
  55. package/dist/DotDensityMap.d.ts +2 -0
  56. package/dist/DotDensityMap.js +282 -289
  57. package/dist/DotDensityMap.js.map +1 -1
  58. package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
  59. package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
  60. package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
  61. package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
  62. package/dist/DualAxisLineChart.cjs +1 -1
  63. package/dist/DualAxisLineChart.js +9 -9
  64. package/dist/DumbbellChart.cjs +1 -1
  65. package/dist/DumbbellChart.js +50 -50
  66. package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
  67. package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
  68. package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
  69. package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
  70. package/dist/ExcelDownloadButton.cjs +1 -1
  71. package/dist/ExcelDownloadButton.js +2 -2
  72. package/dist/FootNote.cjs +1 -1
  73. package/dist/FootNote.js +2 -2
  74. package/dist/GeoHubCompareMaps.cjs +1 -1
  75. package/dist/GeoHubCompareMaps.cjs.map +1 -1
  76. package/dist/GeoHubCompareMaps.js +65 -80
  77. package/dist/GeoHubCompareMaps.js.map +1 -1
  78. package/dist/GeoHubMap.cjs +1 -1
  79. package/dist/GeoHubMap.cjs.map +1 -1
  80. package/dist/GeoHubMap.js +95 -125
  81. package/dist/GeoHubMap.js.map +1 -1
  82. package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
  83. package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
  84. package/dist/GeoHubMapWithLayerSelection.js +73 -88
  85. package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
  86. package/dist/GraphDescription.cjs +1 -1
  87. package/dist/GraphDescription.js +2 -2
  88. package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
  89. package/dist/GraphEl-2IiUDxjR.js.map +1 -0
  90. package/dist/GraphEl-qrlfGPe3.cjs +2 -0
  91. package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
  92. package/dist/GraphFooter.cjs +1 -1
  93. package/dist/GraphFooter.js +1 -1
  94. package/dist/GraphHeader.cjs +1 -1
  95. package/dist/GraphHeader.js +1 -1
  96. package/dist/GraphTitle.cjs +1 -1
  97. package/dist/GraphTitle.js +2 -2
  98. package/dist/GriddedGraphs.cjs +1 -1
  99. package/dist/GriddedGraphs.d.ts +1 -0
  100. package/dist/GriddedGraphs.js +5 -5
  101. package/dist/GriddedGraphsFromConfig.cjs +1 -1
  102. package/dist/GriddedGraphsFromConfig.d.ts +1 -0
  103. package/dist/GriddedGraphsFromConfig.js +2 -2
  104. package/dist/HeatMap.cjs +1 -1
  105. package/dist/HeatMap.js +19 -19
  106. package/dist/Histogram.cjs +1 -1
  107. package/dist/Histogram.js +3 -3
  108. package/dist/ImageDownloadButton.cjs +1 -1
  109. package/dist/ImageDownloadButton.js +2 -2
  110. package/dist/LineChartWithConfidenceInterval.cjs +1 -1
  111. package/dist/LineChartWithConfidenceInterval.js +12 -12
  112. package/dist/LinearColorLegend.cjs +1 -1
  113. package/dist/LinearColorLegend.js +2 -2
  114. package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
  115. package/dist/Modal-Cg8daIlV.js.map +1 -0
  116. package/dist/Modal-CuuJdWkD.cjs +46 -0
  117. package/dist/Modal-CuuJdWkD.cjs.map +1 -0
  118. package/dist/MultiGraphDashboard.cjs +1 -1
  119. package/dist/MultiGraphDashboard.d.ts +1 -0
  120. package/dist/MultiGraphDashboard.js +3 -3
  121. package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
  122. package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
  123. package/dist/MultiGraphDashboardFromConfig.js +2 -2
  124. package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
  125. package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
  126. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
  127. package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
  128. package/dist/MultiLineAltChart.cjs +1 -1
  129. package/dist/MultiLineAltChart.js +12 -12
  130. package/dist/MultiLineChart.cjs +1 -1
  131. package/dist/MultiLineChart.js +12 -12
  132. package/dist/ParetoChart.cjs +1 -1
  133. package/dist/ParetoChart.js +26 -26
  134. package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
  135. package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
  136. package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
  137. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
  138. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
  139. package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
  140. package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
  141. package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
  142. package/dist/PerformanceIntensiveScrollStory.js +3 -3
  143. package/dist/RadarChart.cjs +1 -1
  144. package/dist/RadarChart.js +7 -7
  145. package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
  146. package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
  147. package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
  148. package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
  149. package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
  150. package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
  151. package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
  152. package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
  153. package/dist/SVGDownloadButton.cjs +1 -1
  154. package/dist/SVGDownloadButton.js +2 -2
  155. package/dist/SankeyChart.cjs +1 -1
  156. package/dist/SankeyChart.js +27 -27
  157. package/dist/ScatterPlot.cjs +1 -1
  158. package/dist/ScatterPlot.js +17 -17
  159. package/dist/ScrollStory.cjs +1 -1
  160. package/dist/ScrollStory.d.ts +1 -0
  161. package/dist/ScrollStory.js +3 -3
  162. package/dist/SimpleLineChart.cjs +1 -1
  163. package/dist/SimpleLineChart.js +13 -13
  164. package/dist/SingleGraphDashboard.cjs +1 -1
  165. package/dist/SingleGraphDashboard.d.ts +1 -0
  166. package/dist/SingleGraphDashboard.js +6 -6
  167. package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
  168. package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
  169. package/dist/SingleGraphDashboardFromConfig.js +2 -2
  170. package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
  171. package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
  172. package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
  173. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
  174. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
  175. package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
  176. package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
  177. package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
  178. package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
  179. package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
  180. package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
  181. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
  182. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
  183. package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
  184. package/dist/SlopeChart.cjs +1 -1
  185. package/dist/SlopeChart.js +26 -26
  186. package/dist/Source.cjs +1 -1
  187. package/dist/Source.js +2 -2
  188. package/dist/SparkLine.cjs +1 -1
  189. package/dist/SparkLine.js +2 -2
  190. package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
  191. package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
  192. package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
  193. package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
  194. package/dist/StatCardFromData.cjs +1 -1
  195. package/dist/StatCardFromData.js +2 -2
  196. package/dist/StripChart.cjs +1 -1
  197. package/dist/StripChart.js +29 -29
  198. package/dist/ThreeDGlobe.cjs +1 -1
  199. package/dist/ThreeDGlobe.cjs.map +1 -1
  200. package/dist/ThreeDGlobe.d.ts +2 -0
  201. package/dist/ThreeDGlobe.js +220 -228
  202. package/dist/ThreeDGlobe.js.map +1 -1
  203. package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
  204. package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
  205. package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
  206. package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
  207. package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
  208. package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
  209. package/dist/TreeMapGraph.cjs +1 -1
  210. package/dist/TreeMapGraph.js +24 -24
  211. package/dist/Types.d.ts +1 -0
  212. package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
  213. package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
  214. package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
  215. package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
  216. package/dist/UnitChart.cjs +1 -1
  217. package/dist/UnitChart.js +5 -5
  218. package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
  219. package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
  220. package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
  221. package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
  222. package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
  223. package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
  224. package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
  225. package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
  226. package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
  227. package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
  228. package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
  229. package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
  230. package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
  231. package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
  232. package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
  233. package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
  234. package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
  235. package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
  236. package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
  237. package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
  238. package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
  239. package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
  240. package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
  241. package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
  242. package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
  243. package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
  244. package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
  245. package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
  246. package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
  247. package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
  248. package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
  249. package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
  250. package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
  251. package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
  252. package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
  253. package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
  254. package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
  255. package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
  256. package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
  257. package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
  258. package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
  259. package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
  260. package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
  261. package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
  262. package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
  263. package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
  264. package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
  265. package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
  266. package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
  267. package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
  268. package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
  269. package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
  270. package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
  271. package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
  272. package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
  273. package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
  274. package/dist/index.cjs +1 -1
  275. package/dist/index.d.ts +9 -0
  276. package/dist/index.js +1 -1
  277. package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
  278. package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
  279. package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
  280. package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
  281. package/dist/style.css +1 -1
  282. package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
  283. package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
  284. package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
  285. package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
  286. package/package.json +4 -4
  287. package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
  288. package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
  289. package/dist/GraphEl-C6yjl1VM.cjs +0 -2
  290. package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
  291. package/dist/GraphEl-CqWzvOyr.js.map +0 -1
  292. package/dist/Modal-DVVwpKhP.js.map +0 -1
  293. package/dist/Modal-tXZlLE5s.cjs +0 -46
  294. package/dist/Modal-tXZlLE5s.cjs.map +0 -1
  295. package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
  296. package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
  297. package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
  298. package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
  299. package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
  300. package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
  301. package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
  302. package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
  303. package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
  304. package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
  305. package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ThreeDGlobe.js","sources":["../src/Components/Graphs/Maps/ThreeDGlobe/Graph.tsx","../src/Components/Graphs/Maps/ThreeDGlobe/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport Globe, { GlobeMethods } from 'react-globe.gl';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport * as THREE from 'three';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n LightConfig,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getCentroidCoordinates } from '@/Utils/getCentroidCoordinates';\r\n\r\ninterface Props {\r\n width: number;\r\n data: ChoroplethMapDataType[];\r\n autoRotate: number;\r\n enableZoom: boolean;\r\n categorical: boolean;\r\n colorDomain: (number | string)[];\r\n colors: string[];\r\n height: number;\r\n globeMaterial?: THREE.Material;\r\n lights: LightConfig[];\r\n polygonData: any;\r\n mapProperty: string;\r\n mapBorderColor: string;\r\n atmosphereColor: string;\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapNoDataColor: string;\r\n colorLegendTitle?: string;\r\n showColorScale: boolean;\r\n hoverStrokeColor: string;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n resetSelectionOnDoubleClick: boolean;\r\n highlightedIds: string[];\r\n scale: number;\r\n globeOffset: [number, number];\r\n polygonAltitude: number;\r\n centerLng: number;\r\n centerLat: number;\r\n atmosphereAltitude: number;\r\n globeCurvatureResolution: number;\r\n fogSettings?: FogDataType;\r\n highlightedAltitude: number;\r\n selectedId?: string;\r\n}\r\n\r\nfunction createLightFromConfig(config: LightConfig): THREE.Light {\r\n let light: THREE.Light;\r\n\r\n switch (config.type) {\r\n case 'ambient':\r\n light = new THREE.AmbientLight(config.color, config.intensity);\r\n break;\r\n case 'directional':\r\n light = new THREE.DirectionalLight(config.color, config.intensity);\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z === undefined ? -1 : config.target.z,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.DirectionalLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.DirectionalLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.DirectionalLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.DirectionalLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.DirectionalLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n case 'point':\r\n light = new THREE.PointLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n break;\r\n case 'spot':\r\n light = new THREE.SpotLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.angle || Math.PI / 3,\r\n config.penumbra || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z || 0,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.SpotLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.SpotLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.SpotLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.SpotLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.SpotLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error('Unknown light type');\r\n }\r\n\r\n return light;\r\n}\r\nfunction Graph(props: Props) {\r\n const {\r\n width,\r\n autoRotate,\r\n data,\r\n enableZoom,\r\n categorical,\r\n colorDomain,\r\n colors,\r\n globeMaterial,\r\n height,\r\n polygonData,\r\n mapProperty,\r\n mapBorderColor,\r\n atmosphereColor,\r\n tooltip,\r\n styles,\r\n classNames,\r\n mapNoDataColor,\r\n colorLegendTitle,\r\n showColorScale,\r\n hoverStrokeColor,\r\n detailsOnClick,\r\n onSeriesMouseClick,\r\n onSeriesMouseOver,\r\n resetSelectionOnDoubleClick,\r\n highlightedIds,\r\n scale,\r\n globeOffset,\r\n polygonAltitude,\r\n centerLng,\r\n centerLat,\r\n atmosphereAltitude,\r\n globeCurvatureResolution,\r\n fogSettings,\r\n lights,\r\n highlightedAltitude,\r\n selectedId,\r\n } = props;\r\n const [globeReady, setGlobeReady] = useState(false);\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 });\r\n const [mouseOverData, setMouseOverData] = useState<ChoroplethMapDataType | undefined>(undefined);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.controls().enableZoom = enableZoom;\r\n }\r\n }, [enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData || selectedId) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }\r\n }, [mouseOverData, selectedId, autoRotate]);\r\n useEffect(() => {\r\n if (globeEl.current && selectedId) {\r\n const selectedPolygon = polygonData.find(\r\n (d: any) => d.properties[mapProperty] === selectedId,\r\n );\r\n const [lng, lat] = getCentroidCoordinates(selectedPolygon);\r\n globeEl.current.pointOfView({ lat, lng, altitude: scale }, 1000);\r\n }\r\n }, [selectedId, scale, polygonData, mapProperty]);\r\n\r\n useEffect(() => {\r\n const canvas = globeEl.current?.renderer().domElement;\r\n if (!canvas) return;\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n setMousePos({ x: e.clientX, y: e.clientY });\r\n };\r\n\r\n canvas.addEventListener('mousemove', handleMouseMove);\r\n return () => canvas.removeEventListener('mousemove', handleMouseMove);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({ lat: centerLat, lng: centerLng, altitude: scale }, 1000);\r\n }\r\n }, [scale, centerLng, centerLat]);\r\n const materials =\r\n globeMaterial ||\r\n new THREE.MeshBasicMaterial({\r\n color: '#FFF',\r\n });\r\n const setupCustomLighting = useCallback(() => {\r\n if (!globeEl.current) return;\r\n\r\n const scene = globeEl.current.scene();\r\n const camera = globeEl.current.camera();\r\n\r\n let lightsAndObjToRemove: THREE.Object3D[] = [];\r\n scene.traverse(obj => {\r\n if (obj instanceof THREE.Light) {\r\n lightsAndObjToRemove.push(obj);\r\n }\r\n });\r\n lightsAndObjToRemove = [...lightsAndObjToRemove, ...camera.children];\r\n lightsAndObjToRemove.forEach(light => light.parent?.remove(light));\r\n\r\n const lightConfig = lights.map(config => createLightFromConfig(config));\r\n lightConfig.forEach((light, i) => {\r\n if (lights[i].type !== 'ambient' && lights[i].position === 'camera') {\r\n camera.add(light);\r\n if (lights[i].type !== 'point') {\r\n camera.add((light as THREE.DirectionalLight | THREE.SpotLight).target);\r\n }\r\n } else {\r\n scene.add(light);\r\n }\r\n });\r\n\r\n if (fogSettings) {\r\n scene.fog = new THREE.Fog(fogSettings.color, fogSettings.near, fogSettings.far);\r\n }\r\n }, [lights, fogSettings]);\r\n\r\n const handleGlobeReady = useCallback(() => {\r\n setGlobeReady(true);\r\n setupCustomLighting();\r\n }, [setupCustomLighting]);\r\n useEffect(() => {\r\n if (globeReady) {\r\n setupCustomLighting();\r\n }\r\n }, [globeReady, setupCustomLighting]);\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n height={height}\r\n width={width}\r\n globeOffset={globeOffset}\r\n lineHoverPrecision={0}\r\n polygonsData={polygonData}\r\n polygonAltitude={(polygon: any) =>\r\n highlightedIds.includes(polygon?.properties?.[mapProperty]) ||\r\n polygon?.properties?.[mapProperty] === selectedId\r\n ? highlightedAltitude * (polygon?.properties?.[mapProperty] === selectedId ? 2 : 1)\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id ||\r\n polygon?.properties?.[mapProperty] === mouseClickData?.id\r\n ? highlightedAltitude\r\n : polygonAltitude\r\n }\r\n polygonCapColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n if (val !== undefined && val !== null) {\r\n return colorScale(val as any);\r\n }\r\n return mapNoDataColor;\r\n }}\r\n polygonSideColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n const color = val !== undefined && val !== null ? colorScale(val as any) : mapNoDataColor;\r\n return highlightedIds.includes(polygon?.properties?.[mapProperty]) ||\r\n polygon?.properties?.[mapProperty] === selectedId\r\n ? color\r\n : 'rgba(100,100,100,0)';\r\n }}\r\n polygonStrokeColor={(polygon: any) =>\r\n polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? hoverStrokeColor\r\n : mapBorderColor\r\n }\r\n onGlobeClick={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n onPolygonClick={(polygon: any) => {\r\n const clickedData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (\r\n isEqual(mouseClickData, clickedData) &&\r\n resetSelectionOnDoubleClick &&\r\n clickedData\r\n ) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }\r\n }\r\n }}\r\n onPolygonHover={(polygon: any) => {\r\n const hoverData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n setMouseOverData(hoverData);\r\n onSeriesMouseOver?.(hoverData);\r\n }}\r\n atmosphereColor={atmosphereColor}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n globeMaterial={materials}\r\n backgroundColor='rgba(0, 0, 0, 0)'\r\n polygonsTransitionDuration={100}\r\n onGlobeReady={() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({\r\n lat: centerLat,\r\n lng: centerLng,\r\n });\r\n const scene = globeEl.current.scene();\r\n setTimeout(() => {\r\n const polygons = scene.children[3]?.children[0]?.children[4]?.children || [];\r\n polygons.forEach(d => {\r\n const line = d.children[1];\r\n line.renderOrder = 2;\r\n });\r\n }, 300);\r\n const camera = globeEl.current.camera();\r\n scene.add(camera);\r\n handleGlobeReady();\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g key={i} className='cursor-pointer'>\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[i],\r\n stroke: colors[i],\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n stroke: colors[colorDomain.length],\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div key={i} className='flex gap-2 items-center'>\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\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='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-550 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 {mouseOverData && tooltip ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={mousePos.x}\r\n yPos={mousePos.y}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n\r\nexport default Graph;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport Graph from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n Languages,\r\n LightConfig,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\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 */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\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 /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines if the globe rotates automatically */\r\n autoRotate?: number | boolean;\r\n /** Defines the material property applied to the sphere of the globe */\r\n globeMaterial?: THREE.Material;\r\n /** Defines the lights for the 3D scene */\r\n lights?: LightConfig[];\r\n /** Defines the colo of the glow around the globe */\r\n atmosphereColor?: string;\r\n /** Defines if the globe can be zoomed when scrolled */\r\n enableZoom?: boolean;\r\n /** Position offset of the globe relative to the canvas center */\r\n globeOffset?: [number, number];\r\n /** Defines the camera distance from Earth. This helps in defining the default size of the globe. Smaller = closer camera therefore the globe is bigger) */\r\n scale?: number;\r\n /** Defines the spacing between the country shape polygon with the sphere */\r\n polygonAltitude?: number;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** The max altitude of the atmosphere, in terms of globe radius units. */\r\n atmosphereAltitude?: number;\r\n /** Resolution in angular degrees of the sphere curvature. The finer the resolution, the more the globe is fragmented into smaller faces to approximate the spheric surface, at the cost of performance. */\r\n globeCurvatureResolution?: number;\r\n /** Defines fog settings for the scene. */\r\n fogSettings?: FogDataType;\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 /** Countries or regions to be highlighted */\r\n selectedId?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the altitude of the highlighted countries or the countries on mouseover. */\r\n highlightedAltitude?: number;\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\n/** For using these maps you will have to install [`three`](https://threejs.org/manual/) and [react-globe.gl](https://www.npmjs.com/package/react-globe.gl) package to your project */\r\nexport function ThreeDGlobe(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json',\r\n graphTitle,\r\n colors,\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 colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n padding,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n graphID,\r\n mapProperty = 'ISO3',\r\n dataDownload = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n autoRotate = true,\r\n enableZoom = true,\r\n globeMaterial,\r\n centerPoint = [0, 0],\r\n atmosphereColor = '#999',\r\n showColorScale = true,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n highlightedIds = [],\r\n highlightedAltitude = 0.1,\r\n scale = 1,\r\n globeOffset = [0, 0],\r\n polygonAltitude = 0.01,\r\n globeCurvatureResolution = 4,\r\n atmosphereAltitude = 0.15,\r\n fogSettings,\r\n lights = [\r\n {\r\n type: 'ambient',\r\n color: 0x404040,\r\n intensity: 0.4,\r\n },\r\n {\r\n type: 'directional',\r\n color: 0xffffff,\r\n intensity: 1,\r\n position: { x: 5, y: 10, z: 5 },\r\n },\r\n ],\r\n selectedId,\r\n } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n if (\r\n mapData ===\r\n 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json'\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const features = d.features.map((el: any) => {\r\n if (el.geometry.type === 'Polygon') {\r\n const reversed = [...el.geometry.coordinates[0]].reverse();\r\n const geometry = { ...el.geometry, coordinates: [reversed] };\r\n return { ...el, geometry };\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const coord: any = [];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n el.geometry.coordinates.forEach((c: any) => {\r\n const reversed = [...c[0]].reverse();\r\n coord.push([reversed]);\r\n });\r\n const geometry = { ...el.geometry, coordinates: coord };\r\n return { ...el, geometry };\r\n });\r\n setMapShape(features);\r\n } else setMapShape(d.features);\r\n });\r\n } else {\r\n setMapShape(mapData.features);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || 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={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 <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data}\r\n globeOffset={globeOffset}\r\n polygonData={mapShape}\r\n colorDomain={domain}\r\n width={width || svgWidth}\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 )}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n mapProperty={mapProperty}\r\n styles={styles}\r\n classNames={classNames}\r\n autoRotate={autoRotate === true ? 1.5 : autoRotate === false ? 0 : autoRotate}\r\n enableZoom={enableZoom}\r\n globeMaterial={globeMaterial}\r\n atmosphereColor={atmosphereColor}\r\n colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light'\r\n ? Colors.light.grays['gray-700']\r\n : Colors.light.grays['gray-300']\r\n }\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n scale={scale}\r\n polygonAltitude={polygonAltitude}\r\n centerLat={centerPoint[0]}\r\n centerLng={centerPoint[1]}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n fogSettings={fogSettings}\r\n lights={lights}\r\n highlightedAltitude={highlightedAltitude}\r\n selectedId={selectedId}\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 </div>\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 </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["createLightFromConfig","config","light","THREE","Graph","props","width","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","height","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","atmosphereAltitude","globeCurvatureResolution","fogSettings","lights","highlightedAltitude","selectedId","globeReady","setGlobeReady","useState","globeEl","useRef","mouseClickData","setMouseClickData","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","scaleThreshold","useEffect","selectedPolygon","d","lng","lat","getCentroidCoordinates","canvas","handleMouseMove","e","materials","setupCustomLighting","useCallback","scene","camera","lightsAndObjToRemove","obj","i","handleGlobeReady","jsxs","jsx","Globe","polygon","id","val","el","color","clickedData","isEqual","hoverData","line","Fragment","X","P","numberFormattingFunction","Tooltip","Modal","string2HTML","ThreeDGlobe","mapData","graphTitle","sources","graphDescription","footNote","scaleType","padding","Colors","backgroundColor","relativeHeight","graphID","dataDownload","language","minHeight","theme","ariaLabel","centerPoint","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","resizeObserver","entries","fetchAndParseJSON","features","reversed","geomet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A,oBAAA;AAAA,oBAEtB,SAAA6E;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA9F;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ThreeDGlobe.js","sources":["../src/Components/Graphs/Maps/ThreeDGlobe/Graph.tsx","../src/Components/Graphs/Maps/ThreeDGlobe/index.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\r\nimport Globe, { GlobeMethods } from 'react-globe.gl';\r\nimport isEqual from 'fast-deep-equal';\r\nimport { useCallback, useEffect, useRef, useState } from 'react';\r\nimport { scaleOrdinal, scaleThreshold } from 'd3-scale';\r\nimport * as THREE from 'three';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n LightConfig,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { getCentroidCoordinates } from '@/Utils/getCentroidCoordinates';\r\n\r\ninterface Props {\r\n width: number;\r\n data: ChoroplethMapDataType[];\r\n autoRotate: number;\r\n enableZoom: boolean;\r\n categorical: boolean;\r\n colorDomain: (number | string)[];\r\n colors: string[];\r\n height: number;\r\n globeMaterial?: THREE.Material;\r\n lights: LightConfig[];\r\n polygonData: any;\r\n mapProperty: string;\r\n mapBorderColor: string;\r\n atmosphereColor: string;\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n onSeriesMouseOver?: (_d: any) => void;\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapNoDataColor: string;\r\n colorLegendTitle?: string;\r\n showColorScale: boolean;\r\n hoverStrokeColor: string;\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n resetSelectionOnDoubleClick: boolean;\r\n highlightedIds: string[];\r\n scale: number;\r\n globeOffset: [number, number];\r\n polygonAltitude: number;\r\n centerLng: number;\r\n centerLat: number;\r\n atmosphereAltitude: number;\r\n globeCurvatureResolution: number;\r\n fogSettings?: FogDataType;\r\n highlightedAltitude: number;\r\n selectedId?: string;\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nfunction createLightFromConfig(config: LightConfig): THREE.Light {\r\n let light: THREE.Light;\r\n\r\n switch (config.type) {\r\n case 'ambient':\r\n light = new THREE.AmbientLight(config.color, config.intensity);\r\n break;\r\n case 'directional':\r\n light = new THREE.DirectionalLight(config.color, config.intensity);\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z === undefined ? -1 : config.target.z,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.DirectionalLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.DirectionalLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.DirectionalLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.DirectionalLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.DirectionalLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n case 'point':\r\n light = new THREE.PointLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n break;\r\n case 'spot':\r\n light = new THREE.SpotLight(\r\n config.color,\r\n config.intensity,\r\n config.distance || 0,\r\n config.angle || Math.PI / 3,\r\n config.penumbra || 0,\r\n config.decay || 2,\r\n );\r\n if (config.position) {\r\n if (config.position === 'camera') light.position.set(0, 0, 0);\r\n else light.position.set(config.position.x, config.position.y, config.position.z);\r\n }\r\n if (config.target || config.position === 'camera') {\r\n (light as THREE.SpotLight).target.position.set(\r\n config.target?.x || 0,\r\n config.target?.y || 0,\r\n config.target?.z || 0,\r\n );\r\n }\r\n if (config.castShadow) {\r\n (light as THREE.SpotLight).castShadow = true;\r\n if (config.shadow) {\r\n (light as THREE.SpotLight).shadow.mapSize.width = config.shadow.mapSize.width;\r\n (light as THREE.SpotLight).shadow.mapSize.height = config.shadow.mapSize.height;\r\n (light as THREE.SpotLight).shadow.camera.near = config.shadow.camera.near;\r\n (light as THREE.SpotLight).shadow.camera.far = config.shadow.camera.far;\r\n }\r\n }\r\n break;\r\n default:\r\n throw new Error('Unknown light type');\r\n }\r\n\r\n return light;\r\n}\r\nfunction Graph(props: Props) {\r\n const {\r\n width,\r\n autoRotate,\r\n data,\r\n enableZoom,\r\n categorical,\r\n colorDomain,\r\n colors,\r\n globeMaterial,\r\n height,\r\n polygonData,\r\n mapProperty,\r\n mapBorderColor,\r\n atmosphereColor,\r\n tooltip,\r\n styles,\r\n classNames,\r\n mapNoDataColor,\r\n colorLegendTitle,\r\n showColorScale,\r\n hoverStrokeColor,\r\n detailsOnClick,\r\n onSeriesMouseClick,\r\n onSeriesMouseOver,\r\n resetSelectionOnDoubleClick,\r\n highlightedIds,\r\n scale,\r\n globeOffset,\r\n polygonAltitude,\r\n centerLng,\r\n centerLat,\r\n atmosphereAltitude,\r\n globeCurvatureResolution,\r\n fogSettings,\r\n lights,\r\n highlightedAltitude,\r\n selectedId,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [globeReady, setGlobeReady] = useState(false);\r\n const globeEl = useRef<GlobeMethods | undefined>(undefined);\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n const [mousePos, setMousePos] = useState({ x: 0, y: 0 });\r\n const [mouseOverData, setMouseOverData] = useState<ChoroplethMapDataType | undefined>(undefined);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.controls().enableZoom = enableZoom;\r\n }\r\n }, [enableZoom]);\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n if (mouseOverData || selectedId) {\r\n globeEl.current.controls().autoRotate = false;\r\n } else {\r\n globeEl.current.controls().autoRotate = autoRotate === 0 ? false : true;\r\n globeEl.current.controls().autoRotateSpeed = autoRotate;\r\n }\r\n }\r\n }, [mouseOverData, selectedId, autoRotate]);\r\n useEffect(() => {\r\n if (globeEl.current && selectedId) {\r\n const selectedPolygon = polygonData.find(\r\n (d: any) => d.properties[mapProperty] === selectedId,\r\n );\r\n const [lng, lat] = getCentroidCoordinates(selectedPolygon);\r\n globeEl.current.pointOfView({ lat, lng, altitude: scale }, 1000);\r\n }\r\n }, [selectedId, scale, polygonData, mapProperty]);\r\n\r\n useEffect(() => {\r\n const canvas = globeEl.current?.renderer().domElement;\r\n if (!canvas) return;\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n setMousePos({ x: e.clientX, y: e.clientY });\r\n };\r\n\r\n canvas.addEventListener('mousemove', handleMouseMove);\r\n return () => canvas.removeEventListener('mousemove', handleMouseMove);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({ lat: centerLat, lng: centerLng, altitude: scale }, 1000);\r\n }\r\n }, [scale, centerLng, centerLat]);\r\n const materials =\r\n globeMaterial ||\r\n new THREE.MeshBasicMaterial({\r\n color: '#FFF',\r\n });\r\n const setupCustomLighting = useCallback(() => {\r\n if (!globeEl.current) return;\r\n\r\n const scene = globeEl.current.scene();\r\n const camera = globeEl.current.camera();\r\n\r\n let lightsAndObjToRemove: THREE.Object3D[] = [];\r\n scene.traverse(obj => {\r\n if (obj instanceof THREE.Light) {\r\n lightsAndObjToRemove.push(obj);\r\n }\r\n });\r\n lightsAndObjToRemove = [...lightsAndObjToRemove, ...camera.children];\r\n lightsAndObjToRemove.forEach(light => light.parent?.remove(light));\r\n\r\n const lightConfig = lights.map(config => createLightFromConfig(config));\r\n lightConfig.forEach((light, i) => {\r\n if (lights[i].type !== 'ambient' && lights[i].position === 'camera') {\r\n camera.add(light);\r\n if (lights[i].type !== 'point') {\r\n camera.add((light as THREE.DirectionalLight | THREE.SpotLight).target);\r\n }\r\n } else {\r\n scene.add(light);\r\n }\r\n });\r\n\r\n if (fogSettings) {\r\n scene.fog = new THREE.Fog(fogSettings.color, fogSettings.near, fogSettings.far);\r\n }\r\n }, [lights, fogSettings]);\r\n\r\n const handleGlobeReady = useCallback(() => {\r\n setGlobeReady(true);\r\n setupCustomLighting();\r\n }, [setupCustomLighting]);\r\n useEffect(() => {\r\n if (globeReady) {\r\n setupCustomLighting();\r\n }\r\n }, [globeReady, setupCustomLighting]);\r\n return (\r\n <div className='relative'>\r\n <Globe\r\n ref={globeEl}\r\n height={height}\r\n width={width}\r\n globeOffset={globeOffset}\r\n lineHoverPrecision={0}\r\n polygonsData={polygonData}\r\n polygonAltitude={(polygon: any) =>\r\n highlightedIds.includes(polygon?.properties?.[mapProperty]) ||\r\n polygon?.properties?.[mapProperty] === selectedId\r\n ? highlightedAltitude * (polygon?.properties?.[mapProperty] === selectedId ? 2 : 1)\r\n : polygon?.properties?.[mapProperty] === mouseOverData?.id ||\r\n polygon?.properties?.[mapProperty] === mouseClickData?.id\r\n ? highlightedAltitude\r\n : polygonAltitude\r\n }\r\n polygonCapColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n if (val !== undefined && val !== null) {\r\n return colorScale(val as any);\r\n }\r\n return mapNoDataColor;\r\n }}\r\n polygonSideColor={(polygon: any) => {\r\n const id = polygon?.properties?.[mapProperty];\r\n const val = data.find(el => el.id === id)?.x;\r\n const color = val !== undefined && val !== null ? colorScale(val as any) : mapNoDataColor;\r\n return highlightedIds.includes(polygon?.properties?.[mapProperty]) ||\r\n polygon?.properties?.[mapProperty] === selectedId\r\n ? color\r\n : 'rgba(100,100,100,0)';\r\n }}\r\n polygonStrokeColor={(polygon: any) =>\r\n polygon?.properties?.[mapProperty] === mouseOverData?.id\r\n ? hoverStrokeColor\r\n : mapBorderColor\r\n }\r\n onGlobeClick={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n onPolygonClick={(polygon: any) => {\r\n const clickedData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (\r\n isEqual(mouseClickData, clickedData) &&\r\n resetSelectionOnDoubleClick &&\r\n clickedData\r\n ) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(clickedData);\r\n onSeriesMouseClick?.(clickedData);\r\n }\r\n }\r\n }}\r\n onPolygonHover={(polygon: any) => {\r\n const hoverData = polygon?.properties?.[mapProperty]\r\n ? data.find(el => el.id === polygon?.properties?.[mapProperty])\r\n : undefined;\r\n setMouseOverData(hoverData);\r\n onSeriesMouseOver?.(hoverData);\r\n }}\r\n atmosphereColor={atmosphereColor}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n globeMaterial={materials}\r\n backgroundColor='rgba(0, 0, 0, 0)'\r\n polygonsTransitionDuration={100}\r\n onGlobeReady={() => {\r\n if (globeEl.current) {\r\n globeEl.current.pointOfView({\r\n lat: centerLat,\r\n lng: centerLng,\r\n });\r\n const scene = globeEl.current.scene();\r\n setTimeout(() => {\r\n const polygons = scene.children[3]?.children[0]?.children[4]?.children || [];\r\n polygons.forEach(d => {\r\n const line = d.children[1];\r\n line.renderOrder = 2;\r\n });\r\n }, 300);\r\n const camera = globeEl.current.camera();\r\n scene.add(camera);\r\n handleGlobeReady();\r\n }\r\n }}\r\n />\r\n {showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\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={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g key={i} className='cursor-pointer'>\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[i],\r\n stroke: colors[i],\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n stroke: colors[colorDomain.length],\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div key={i} className='flex gap-2 items-center'>\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\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 {mouseOverData && tooltip ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={mousePos.x}\r\n yPos={mousePos.y}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </div>\r\n );\r\n}\r\n\r\nexport default Graph;\r\n","import React, { useEffect, useRef, useState } from 'react';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport * as THREE from 'three';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport Graph from './Graph';\r\n\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport {\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n FogDataType,\r\n Languages,\r\n LightConfig,\r\n ScaleDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\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 */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\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 /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines if the globe rotates automatically */\r\n autoRotate?: number | boolean;\r\n /** Defines the material property applied to the sphere of the globe */\r\n globeMaterial?: THREE.Material;\r\n /** Defines the lights for the 3D scene */\r\n lights?: LightConfig[];\r\n /** Defines the colo of the glow around the globe */\r\n atmosphereColor?: string;\r\n /** Defines if the globe can be zoomed when scrolled */\r\n enableZoom?: boolean;\r\n /** Position offset of the globe relative to the canvas center */\r\n globeOffset?: [number, number];\r\n /** Defines the camera distance from Earth. This helps in defining the default size of the globe. Smaller = closer camera therefore the globe is bigger) */\r\n scale?: number;\r\n /** Defines the spacing between the country shape polygon with the sphere */\r\n polygonAltitude?: number;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\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 /** The max altitude of the atmosphere, in terms of globe radius units. */\r\n atmosphereAltitude?: number;\r\n /** Resolution in angular degrees of the sphere curvature. The finer the resolution, the more the globe is fragmented into smaller faces to approximate the spheric surface, at the cost of performance. */\r\n globeCurvatureResolution?: number;\r\n /** Defines fog settings for the scene. */\r\n fogSettings?: FogDataType;\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 /** Countries or regions to be highlighted */\r\n selectedId?: string;\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the altitude of the highlighted countries or the countries on mouseover. */\r\n highlightedAltitude?: number;\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\n/** For using these maps you will have to install [`three`](https://threejs.org/manual/) and [react-globe.gl](https://www.npmjs.com/package/react-globe.gl) package to your project */\r\nexport function ThreeDGlobe(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json',\r\n graphTitle,\r\n colors,\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 colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n padding,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n graphID,\r\n mapProperty = 'ISO3',\r\n dataDownload = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n autoRotate = true,\r\n enableZoom = true,\r\n globeMaterial,\r\n centerPoint = [0, 0],\r\n atmosphereColor = '#999',\r\n showColorScale = true,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n onSeriesMouseOver,\r\n onSeriesMouseClick,\r\n highlightedIds = [],\r\n highlightedAltitude = 0.1,\r\n scale = 1,\r\n globeOffset = [0, 0],\r\n polygonAltitude = 0.01,\r\n globeCurvatureResolution = 4,\r\n atmosphereAltitude = 0.15,\r\n fogSettings,\r\n lights = [\r\n {\r\n type: 'ambient',\r\n color: 0x404040,\r\n intensity: 0.4,\r\n },\r\n {\r\n type: 'directional',\r\n color: 0xffffff,\r\n intensity: 1,\r\n position: { x: 5, y: 10, z: 5 },\r\n },\r\n ],\r\n selectedId,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n if (\r\n mapData ===\r\n 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json'\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const features = d.features.map((el: any) => {\r\n if (el.geometry.type === 'Polygon') {\r\n const reversed = [...el.geometry.coordinates[0]].reverse();\r\n const geometry = { ...el.geometry, coordinates: [reversed] };\r\n return { ...el, geometry };\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const coord: any = [];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n el.geometry.coordinates.forEach((c: any) => {\r\n const reversed = [...c[0]].reverse();\r\n coord.push([reversed]);\r\n });\r\n const geometry = { ...el.geometry, coordinates: coord };\r\n return { ...el, geometry };\r\n });\r\n setMapShape(features);\r\n } else setMapShape(d.features);\r\n });\r\n } else {\r\n setMapShape(mapData.features);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a map.${graphDescription ? ` ${graphDescription}` : ''}`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || 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={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 <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data}\r\n globeOffset={globeOffset}\r\n polygonData={mapShape}\r\n colorDomain={domain}\r\n width={width || svgWidth}\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 )}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n mapProperty={mapProperty}\r\n styles={styles}\r\n classNames={classNames}\r\n autoRotate={autoRotate === true ? 1.5 : autoRotate === false ? 0 : autoRotate}\r\n enableZoom={enableZoom}\r\n globeMaterial={globeMaterial}\r\n atmosphereColor={atmosphereColor}\r\n colorLegendTitle={colorLegendTitle}\r\n showColorScale={showColorScale}\r\n hoverStrokeColor={\r\n theme === 'light'\r\n ? Colors.light.grays['gray-700']\r\n : Colors.light.grays['gray-300']\r\n }\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n scale={scale}\r\n polygonAltitude={polygonAltitude}\r\n centerLat={centerPoint[0]}\r\n centerLng={centerPoint[1]}\r\n atmosphereAltitude={atmosphereAltitude}\r\n globeCurvatureResolution={globeCurvatureResolution}\r\n fogSettings={fogSettings}\r\n lights={lights}\r\n highlightedAltitude={highlightedAltitude}\r\n selectedId={selectedId}\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 </div>\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 </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["createLightFromConfig","config","light","THREE","Graph","props","width","autoRotate","data","enableZoom","categorical","colorDomain","colors","globeMaterial","height","polygonData","mapProperty","mapBorderColor","atmosphereColor","tooltip","styles","classNames","mapNoDataColor","colorLegendTitle","showColorScale","hoverStrokeColor","detailsOnClick","onSeriesMouseClick","onSeriesMouseOver","resetSelectionOnDoubleClick","highlightedIds","scale","globeOffset","polygonAltitude","centerLng","centerLat","atmosphereAltitude","globeCurvatureResolution","fogSettings","lights","highlightedAltitude","selectedId","collapseColorScaleByDefault","globeReady","setGlobeReady","useState","globeEl","useRef","mouseClickData","setMouseClickData","showLegend","setShowLegend","mousePos","setMousePos","mouseOverData","setMouseOverData","colorScale","scaleOrdinal","scaleThreshold","useEffect","selectedPolygon","d","lng","lat","getCentroidCoordinates","canvas","handleMouseMove","e","materials","setupCustomLighting","useCallback","scene","camera","lightsAndObjToRemove","obj","i","handleGlobeReady","jsxs","jsx","Globe","polygon","id","val","el","color","clickedData","isEqual","hoverData","line","Fragment","X","P","numberFormattingFunction","Tooltip","Modal","string2HTML","ThreeDGlobe","mapData","graphTitle","sources","graphDescription","footNote","scaleType","padding","Colors","backgroundColor","relativeHeight","graphID","dataDownload","language","minHeight","theme","ariaLabel","centerPoint","mapShape","setMapShape","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","resizeObserver","entries","fetchAndParseJSON","features","reversed","geometry","coord","c","domain","getUniqValue","getJenks","cn","GraphHeader","Spinner","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8DA,SAASA,GAAsBC,GAAkC;AAC/D,MAAIC;AAEJ,UAAQD,EAAO,MAAA;AAAA,IACb,KAAK;AACH,MAAAC,IAAQ,IAAIC,EAAM,aAAaF,EAAO,OAAOA,EAAO,SAAS;AAC7D;AAAA,IACF,KAAK;AACH,MAAAC,IAAQ,IAAIC,EAAM,iBAAiBF,EAAO,OAAOA,EAAO,SAAS,GAC7DA,EAAO,aACLA,EAAO,aAAa,WAAUC,EAAM,SAAS,IAAI,GAAG,GAAG,CAAC,IACvDA,EAAM,SAAS,IAAID,EAAO,SAAS,GAAGA,EAAO,SAAS,GAAGA,E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AAAA,sBAAC;AAAA,sBAAA;AAAA,wBACC,OAAO;AAAA,0BACL,QAAQ,GAAG,KAAK;AAAA,4BACdgC;AAAA,4BACAhG,MACG4F,IACGI,KACGxG,KAAS8G,KAAYV,IAAiBI,KACpCxG,KAAS8G,KAAYV,IACtBI,KACDxG,KAAS8G,KAAYV,IACxBY;AAAA,0BAAA,CACP;AAAA,wBAAA;AAAA,wBAEH,WAAU;AAAA,wBAEV,UAAAxC,gBAAAA,EAAAA,IAACwD,IAAA,EAAQ,cAAW,gBAAA,CAAgB;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACtC;AAAA,gBAAA;AAAA,gBAGHnC,KAAWE,IACVvB,gBAAAA,EAAAA;AAAAA,kBAACyD;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUnH,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA8E;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAA/F;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),g=require("react"),y=require("./Typography-k-kOjICQ.cjs"),p=require("./numberFormattingFunction-02t-wJta.cjs");function j(d){const{colorLegendTitle:x,colorDomain:s,colors:e,setSelectedColor:l,width:m,naColor:o,className:h,showNAColor:c}=d,[n,i]=g.useState(void 0),a=o?320:360;return r.jsxRuntimeExports.jsxs("div",{className:r.mo("flex flex-wrap gap-0 justify-center leading-0",h),style:{maxWidth:m?`${m}px`:"none"},"aria-label":"Color legend",children:[x&&x!==""?r.jsxRuntimeExports.jsx(y.u,{size:"sm",marginBottom:"2xs",className:"w-full text-center",children:x}):null,r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 360 30",style:{maxWidth:"360px"},direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[s.map((u,t)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{i(e[t]),l(e[t])},onMouseLeave:()=>{i(void 0),l(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:t*a/e.length+1,y:1,width:a/e.length-2,height:8,className:`stroke-1 ${n===e[t]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:e[t],...n!==e[t]?{stroke:e[t]}:{}}}),r.jsxRuntimeExports.jsx("text",{x:(t+1)*a/e.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"middle"},children:p.numberFormattingFunction(u,"NA",2,"","")})]},t)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{i(e[s.length]),l(e[s.length])},onMouseLeave:()=>{i(void 0),l(void 0)},x:s.length*a/e.length+1,y:1,width:a/e.length-2,height:8,className:`cursor-pointer stroke-1 ${n===e[s.length]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:e[s.length],...n!==e[s.length]?{stroke:e[s.length]}:{}}})}),c?r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{i(o||"#D4D6D8"),l(o||"#D4D6D8")},onMouseLeave:()=>{i(void 0),l(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:335,y:1,width:24,height:8,className:`stroke-1 ${n===o?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:o||"#D4D6D8",...n!==o?{stroke:o}:{},strokeWidth:1}}),r.jsxRuntimeExports.jsx("text",{x:337.5,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},children:"NA"})]}):null]})})]})}exports.ThresholdColorLegendWithMouseOver=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),g=require("react"),y=require("./Typography-BDULiwlF.cjs"),p=require("./numberFormattingFunction-02t-wJta.cjs");function j(d){const{colorLegendTitle:x,colorDomain:s,colors:e,setSelectedColor:l,width:m,naColor:o,className:h,showNAColor:c}=d,[n,i]=g.useState(void 0),a=o?320:360;return r.jsxRuntimeExports.jsxs("div",{className:r.mo("flex flex-wrap gap-0 justify-center leading-0",h),style:{maxWidth:m?`${m}px`:"none"},"aria-label":"Color legend",children:[x&&x!==""?r.jsxRuntimeExports.jsx(y.u,{size:"sm",marginBottom:"2xs",className:"w-full text-center",children:x}):null,r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 360 30",style:{maxWidth:"360px"},direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[s.map((u,t)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{i(e[t]),l(e[t])},onMouseLeave:()=>{i(void 0),l(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:t*a/e.length+1,y:1,width:a/e.length-2,height:8,className:`stroke-1 ${n===e[t]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:e[t],...n!==e[t]?{stroke:e[t]}:{}}}),r.jsxRuntimeExports.jsx("text",{x:(t+1)*a/e.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"middle"},children:p.numberFormattingFunction(u,"NA",2,"","")})]},t)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{i(e[s.length]),l(e[s.length])},onMouseLeave:()=>{i(void 0),l(void 0)},x:s.length*a/e.length+1,y:1,width:a/e.length-2,height:8,className:`cursor-pointer stroke-1 ${n===e[s.length]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:e[s.length],...n!==e[s.length]?{stroke:e[s.length]}:{}}})}),c?r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{i(o||"#D4D6D8"),l(o||"#D4D6D8")},onMouseLeave:()=>{i(void 0),l(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:335,y:1,width:24,height:8,className:`stroke-1 ${n===o?"stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:o||"#D4D6D8",...n!==o?{stroke:o}:{},strokeWidth:1}}),r.jsxRuntimeExports.jsx("text",{x:337.5,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},children:"NA"})]}):null]})})]})}exports.ThresholdColorLegendWithMouseOver=j;
2
2
  //# sourceMappingURL=ThresholdColorLegendWithMouseOver.cjs.map
@@ -1,6 +1,6 @@
1
- import { j as r, m as y } from "./index-CHPV5EwG-BPSP-7Jg.js";
1
+ import { j as r, m as y } from "./index-CHPV5EwG-DBWUSD9b.js";
2
2
  import { useState as p } from "react";
3
- import { u } from "./Typography-Ctgfl1J5.js";
3
+ import { u } from "./Typography-LmZ9LEpe.js";
4
4
  import { n as v } from "./numberFormattingFunction-14YCbkN2.js";
5
5
  function D(d) {
6
6
  const {
@@ -1,4 +1,4 @@
1
- import { j as o, m as s } from "./index-CHPV5EwG-BPSP-7Jg.js";
1
+ import { j as o, m as s } from "./index-CHPV5EwG-DBWUSD9b.js";
2
2
  import { createPortal as m } from "react-dom";
3
3
  import { s as l } from "./string2HTML-oFCROsus.js";
4
4
  function g(i) {
@@ -43,4 +43,4 @@ function g(i) {
43
43
  export {
44
44
  g as T
45
45
  };
46
- //# sourceMappingURL=Tooltip-CVCGWyzw.js.map
46
+ //# sourceMappingURL=Tooltip-6LIdPQGC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip-CVCGWyzw.js","sources":["../src/Components/Elements/Tooltip.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n body: string | ((_d: any) => React.ReactNode);\r\n xPos: number;\r\n yPos: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n data: any;\r\n backgroundStyle?: React.CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Tooltip(props: Props) {\r\n const {\r\n body,\r\n xPos,\r\n yPos,\r\n data,\r\n backgroundStyle = {\r\n maxWidth: '24rem',\r\n wordWrap: 'break-word',\r\n },\r\n className,\r\n } = props;\r\n return createPortal(\r\n <div className='undp-container'>\r\n <div\r\n className={cn(\r\n 'graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500',\r\n className,\r\n )}\r\n style={{\r\n ...backgroundStyle,\r\n top: `${yPos < window.innerHeight / 2 ? yPos - 10 : yPos + 10}px`,\r\n left: `${xPos > window.innerWidth / 2 ? xPos - 10 : xPos + 10}px`,\r\n transform: `translate(${\r\n xPos > window.innerWidth / 2 ? '-100%' : '0%'\r\n },${yPos > window.innerHeight / 2 ? '-100%' : '0%'})`,\r\n }}\r\n >\r\n <div\r\n className='text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0'\r\n dangerouslySetInnerHTML={\r\n typeof body === 'string' ? { __html: string2HTML(body, data) } : undefined\r\n }\r\n >\r\n {typeof body === 'function' ? body(data) : null}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n"],"names":["Tooltip","props","body","xPos","yPos","data","backgroundStyle","className","createPortal","jsx","cn","string2HTML"],"mappings":";;;AAgBO,SAASA,EAAQC,GAAc;AACpC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,MAChB,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ,WAAAC;AAAA,EAAA,IACEN;AACJ,SAAOO;AAAA,IACLC,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,kBACb,UAAAA,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAAA,UACT;AAAA,UACAH;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,GAAGD;AAAA,UACH,KAAK,GAAGF,IAAO,OAAO,cAAc,IAAIA,IAAO,KAAKA,IAAO,EAAE;AAAA,UAC7D,MAAM,GAAGD,IAAO,OAAO,aAAa,IAAIA,IAAO,KAAKA,IAAO,EAAE;AAAA,UAC7D,WAAW,aACTA,IAAO,OAAO,aAAa,IAAI,UAAU,IAC3C,IAAIC,IAAO,OAAO,cAAc,IAAI,UAAU,IAAI;AAAA,QAAA;AAAA,QAGpD,UAAAK,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,yBACE,OAAOP,KAAS,WAAW,EAAE,QAAQS,EAAYT,GAAMG,CAAI,EAAA,IAAM;AAAA,YAGlE,UAAA,OAAOH,KAAS,aAAaA,EAAKG,CAAI,IAAI;AAAA,UAAA;AAAA,QAAA;AAAA,MAC7C;AAAA,IAAA,GAEJ;AAAA,IACA,SAAS;AAAA,EAAA;AAEb;"}
1
+ {"version":3,"file":"Tooltip-6LIdPQGC.js","sources":["../src/Components/Elements/Tooltip.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n body: string | ((_d: any) => React.ReactNode);\r\n xPos: number;\r\n yPos: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n data: any;\r\n backgroundStyle?: React.CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Tooltip(props: Props) {\r\n const {\r\n body,\r\n xPos,\r\n yPos,\r\n data,\r\n backgroundStyle = {\r\n maxWidth: '24rem',\r\n wordWrap: 'break-word',\r\n },\r\n className,\r\n } = props;\r\n return createPortal(\r\n <div className='undp-container'>\r\n <div\r\n className={cn(\r\n 'graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500',\r\n className,\r\n )}\r\n style={{\r\n ...backgroundStyle,\r\n top: `${yPos < window.innerHeight / 2 ? yPos - 10 : yPos + 10}px`,\r\n left: `${xPos > window.innerWidth / 2 ? xPos - 10 : xPos + 10}px`,\r\n transform: `translate(${\r\n xPos > window.innerWidth / 2 ? '-100%' : '0%'\r\n },${yPos > window.innerHeight / 2 ? '-100%' : '0%'})`,\r\n }}\r\n >\r\n <div\r\n className='text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0'\r\n dangerouslySetInnerHTML={\r\n typeof body === 'string' ? { __html: string2HTML(body, data) } : undefined\r\n }\r\n >\r\n {typeof body === 'function' ? body(data) : null}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n"],"names":["Tooltip","props","body","xPos","yPos","data","backgroundStyle","className","createPortal","jsx","cn","string2HTML"],"mappings":";;;AAgBO,SAASA,EAAQC,GAAc;AACpC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,MAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,MAChB,UAAU;AAAA,MACV,UAAU;AAAA,IAAA;AAAA,IAEZ,WAAAC;AAAA,EAAA,IACEN;AACJ,SAAOO;AAAA,IACLC,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAU,kBACb,UAAAA,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAAA,UACT;AAAA,UACAH;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,GAAGD;AAAA,UACH,KAAK,GAAGF,IAAO,OAAO,cAAc,IAAIA,IAAO,KAAKA,IAAO,EAAE;AAAA,UAC7D,MAAM,GAAGD,IAAO,OAAO,aAAa,IAAIA,IAAO,KAAKA,IAAO,EAAE;AAAA,UAC7D,WAAW,aACTA,IAAO,OAAO,aAAa,IAAI,UAAU,IAC3C,IAAIC,IAAO,OAAO,cAAc,IAAI,UAAU,IAAI;AAAA,QAAA;AAAA,QAGpD,UAAAK,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,yBACE,OAAOP,KAAS,WAAW,EAAE,QAAQS,EAAYT,GAAMG,CAAI,EAAA,IAAM;AAAA,YAGlE,UAAA,OAAOH,KAAS,aAAaA,EAAKG,CAAI,IAAI;AAAA,UAAA;AAAA,QAAA;AAAA,MAC7C;AAAA,IAAA,GAEJ;AAAA,IACA,SAAS;AAAA,EAAA;AAEb;"}
@@ -1,2 +1,2 @@
1
- "use strict";const i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react-dom"),l=require("./string2HTML-z7CwHXcx.cjs");function m(o){const{body:r,xPos:t,yPos:e,data:n,backgroundStyle:a={maxWidth:"24rem",wordWrap:"break-word"},className:s}=o;return d.createPortal(i.jsxRuntimeExports.jsx("div",{className:"undp-container",children:i.jsxRuntimeExports.jsx("div",{className:i.mo("graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500",s),style:{...a,top:`${e<window.innerHeight/2?e-10:e+10}px`,left:`${t>window.innerWidth/2?t-10:t+10}px`,transform:`translate(${t>window.innerWidth/2?"-100%":"0%"},${e>window.innerHeight/2?"-100%":"0%"})`},children:i.jsxRuntimeExports.jsx("div",{className:"text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0",dangerouslySetInnerHTML:typeof r=="string"?{__html:l.string2HTML(r,n)}:void 0,children:typeof r=="function"?r(n):null})})}),document.body)}exports.Tooltip=m;
2
- //# sourceMappingURL=Tooltip-De16GWhY.cjs.map
1
+ "use strict";const i=require("./index-CHPV5EwG-DjM48pIC.cjs"),d=require("react-dom"),l=require("./string2HTML-z7CwHXcx.cjs");function m(o){const{body:r,xPos:t,yPos:e,data:n,backgroundStyle:a={maxWidth:"24rem",wordWrap:"break-word"},className:s}=o;return d.createPortal(i.jsxRuntimeExports.jsx("div",{className:"undp-container",children:i.jsxRuntimeExports.jsx("div",{className:i.mo("graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500",s),style:{...a,top:`${e<window.innerHeight/2?e-10:e+10}px`,left:`${t>window.innerWidth/2?t-10:t+10}px`,transform:`translate(${t>window.innerWidth/2?"-100%":"0%"},${e>window.innerHeight/2?"-100%":"0%"})`},children:i.jsxRuntimeExports.jsx("div",{className:"text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0",dangerouslySetInnerHTML:typeof r=="string"?{__html:l.string2HTML(r,n)}:void 0,children:typeof r=="function"?r(n):null})})}),document.body)}exports.Tooltip=m;
2
+ //# sourceMappingURL=Tooltip-Cpv0QohJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip-De16GWhY.cjs","sources":["../src/Components/Elements/Tooltip.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n body: string | ((_d: any) => React.ReactNode);\r\n xPos: number;\r\n yPos: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n data: any;\r\n backgroundStyle?: React.CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Tooltip(props: Props) {\r\n const {\r\n body,\r\n xPos,\r\n yPos,\r\n data,\r\n backgroundStyle = {\r\n maxWidth: '24rem',\r\n wordWrap: 'break-word',\r\n },\r\n className,\r\n } = props;\r\n return createPortal(\r\n <div className='undp-container'>\r\n <div\r\n className={cn(\r\n 'graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500',\r\n className,\r\n )}\r\n style={{\r\n ...backgroundStyle,\r\n top: `${yPos < window.innerHeight / 2 ? yPos - 10 : yPos + 10}px`,\r\n left: `${xPos > window.innerWidth / 2 ? xPos - 10 : xPos + 10}px`,\r\n transform: `translate(${\r\n xPos > window.innerWidth / 2 ? '-100%' : '0%'\r\n },${yPos > window.innerHeight / 2 ? '-100%' : '0%'})`,\r\n }}\r\n >\r\n <div\r\n className='text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0'\r\n dangerouslySetInnerHTML={\r\n typeof body === 'string' ? { __html: string2HTML(body, data) } : undefined\r\n }\r\n >\r\n {typeof body === 'function' ? body(data) : null}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n"],"names":["Tooltip","props","body","xPos","yPos","data","backgroundStyle","className","createPortal","jsx","cn","string2HTML"],"mappings":"6HAgBO,SAASA,EAAQC,EAAc,CACpC,KAAM,CACJ,KAAAC,EACA,KAAAC,EACA,KAAAC,EACA,KAAAC,EACA,gBAAAC,EAAkB,CAChB,SAAU,QACV,SAAU,YAAA,EAEZ,UAAAC,CAAA,EACEN,EACJ,OAAOO,EAAAA,aACLC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,iBACb,SAAAA,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GACT,kJACAH,CAAA,EAEF,MAAO,CACL,GAAGD,EACH,IAAK,GAAGF,EAAO,OAAO,YAAc,EAAIA,EAAO,GAAKA,EAAO,EAAE,KAC7D,KAAM,GAAGD,EAAO,OAAO,WAAa,EAAIA,EAAO,GAAKA,EAAO,EAAE,KAC7D,UAAW,aACTA,EAAO,OAAO,WAAa,EAAI,QAAU,IAC3C,IAAIC,EAAO,OAAO,YAAc,EAAI,QAAU,IAAI,GAAA,EAGpD,SAAAK,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,2EACV,wBACE,OAAOP,GAAS,SAAW,CAAE,OAAQS,EAAAA,YAAYT,EAAMG,CAAI,CAAA,EAAM,OAGlE,SAAA,OAAOH,GAAS,WAAaA,EAAKG,CAAI,EAAI,IAAA,CAAA,CAC7C,CAAA,EAEJ,EACA,SAAS,IAAA,CAEb"}
1
+ {"version":3,"file":"Tooltip-Cpv0QohJ.cjs","sources":["../src/Components/Elements/Tooltip.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n body: string | ((_d: any) => React.ReactNode);\r\n xPos: number;\r\n yPos: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n data: any;\r\n backgroundStyle?: React.CSSProperties;\r\n className?: string;\r\n}\r\n\r\nexport function Tooltip(props: Props) {\r\n const {\r\n body,\r\n xPos,\r\n yPos,\r\n data,\r\n backgroundStyle = {\r\n maxWidth: '24rem',\r\n wordWrap: 'break-word',\r\n },\r\n className,\r\n } = props;\r\n return createPortal(\r\n <div className='undp-container'>\r\n <div\r\n className={cn(\r\n 'graph-tooltip block p-2 fixed z-[1000] bg-primary-gray-200 dark:bg-primary-gray-600 border border-primary-gray-300 dark:border-primary-gray-500',\r\n className,\r\n )}\r\n style={{\r\n ...backgroundStyle,\r\n top: `${yPos < window.innerHeight / 2 ? yPos - 10 : yPos + 10}px`,\r\n left: `${xPos > window.innerWidth / 2 ? xPos - 10 : xPos + 10}px`,\r\n transform: `translate(${\r\n xPos > window.innerWidth / 2 ? '-100%' : '0%'\r\n },${yPos > window.innerHeight / 2 ? '-100%' : '0%'})`,\r\n }}\r\n >\r\n <div\r\n className='text-sm leading-normal text-primary-black dark:text-primary-gray-100 m-0'\r\n dangerouslySetInnerHTML={\r\n typeof body === 'string' ? { __html: string2HTML(body, data) } : undefined\r\n }\r\n >\r\n {typeof body === 'function' ? body(data) : null}\r\n </div>\r\n </div>\r\n </div>,\r\n document.body,\r\n );\r\n}\r\n"],"names":["Tooltip","props","body","xPos","yPos","data","backgroundStyle","className","createPortal","jsx","cn","string2HTML"],"mappings":"6HAgBO,SAASA,EAAQC,EAAc,CACpC,KAAM,CACJ,KAAAC,EACA,KAAAC,EACA,KAAAC,EACA,KAAAC,EACA,gBAAAC,EAAkB,CAChB,SAAU,QACV,SAAU,YAAA,EAEZ,UAAAC,CAAA,EACEN,EACJ,OAAOO,EAAAA,aACLC,EAAAA,kBAAAA,IAAC,MAAA,CAAI,UAAU,iBACb,SAAAA,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,GACT,kJACAH,CAAA,EAEF,MAAO,CACL,GAAGD,EACH,IAAK,GAAGF,EAAO,OAAO,YAAc,EAAIA,EAAO,GAAKA,EAAO,EAAE,KAC7D,KAAM,GAAGD,EAAO,OAAO,WAAa,EAAIA,EAAO,GAAKA,EAAO,EAAE,KAC7D,UAAW,aACTA,EAAO,OAAO,WAAa,EAAI,QAAU,IAC3C,IAAIC,EAAO,OAAO,YAAc,EAAI,QAAU,IAAI,GAAA,EAGpD,SAAAK,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,2EACV,wBACE,OAAOP,GAAS,SAAW,CAAE,OAAQS,EAAAA,YAAYT,EAAMG,CAAI,CAAA,EAAM,OAGlE,SAAA,OAAOH,GAAS,WAAaA,EAAKG,CAAI,EAAI,IAAA,CAAA,CAC7C,CAAA,EAEJ,EACA,SAAS,IAAA,CAEb"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DDoeWRVt.cjs"),O=require("react"),le=require("./Typography-k-kOjICQ.cjs"),me=require("./Modal-tXZlLE5s.cjs"),xe=require("./Tooltip-De16GWhY.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-z7CwHXcx.cjs"),we=require("./use-in-view-sQJZ_xDO.cjs"),Z=require("./proxy-BHRoeZgd.cjs"),je=require("./index-BW8iNx7E.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-d8_8SxeW.cjs"),se=require("./uniqBy-O05lp2S5.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Be(){return this.eachAfter(Oe)}function ke(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function qe(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function Ie(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:Be,each:ke,eachAfter:qe,eachBefore:Se,find:Ie,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,w=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*w}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,w,c,x,i,u,f,v,p=new Map;if(n!=null){const d=s.map((y,E)=>Je(n(y,E,a))),j=d.map(ce),B=new Set(d).add("");for(const y of j)B.has(y)||(B.add(y),d.push(y),j.push(ce(y)),s.push(ne));l=(y,E)=>d[E],h=(y,E)=>j[E]}for(c=0,m=s.length;c<m;++c)w=s[c],u=s[c]=new F(w),(f=l(w,c,a))!=null&&(f+="")&&(v=u.id=f,p.set(v,p.has(v)?ue:u)),(f=h(w,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(x)throw new Error("multiple roots");x=u}if(!x)throw new Error("no root");if(n!=null){for(;x.data===ne&&x.children.length===1;)x=x.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(x.parent=Ye,x.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),x.parent=null,m>0)throw new Error("cycle");return x}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,w=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*w}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,w,c=0,x=0,i=h.length,u,f,v=t.value,p,d,j,B,y,E,R;c<i;){u=a-n,f=s-r;do p=h[x++].value;while(!p&&x<i);for(d=j=p,E=Math.max(f/u,u/f)/(v*e),R=p*p*E,y=Math.max(j/R,R/d);x<i;++x){if(p+=w=h[x].value,w<d&&(d=w),w>j&&(j=w),R=p*p*E,B=Math.max(j/R,R/d),B>y){p-=w;break}y=B}l.push(m={value:p,dice:u<f,children:h.slice(c,x)}),m.dice?Xe(m,n,r,a,v?r+=f*p/v:s):Qe(m,n,r,v?n+=u*p/v:a,s),v-=p,c=x}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,w=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(x),a=[0],t&&i.eachBefore(Fe),i}function x(i){var u=a[i.depth],f=i.x0+u,v=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<v&&(v=d=(v+d)/2),i.x0=f,i.y0=v,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=w(i)-u,v+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<v&&(v=d=(v+d)/2),e(i,f,v,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(w=typeof i=="function"?i:W(+i),c):w},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:w,showLabels:c,tooltip:x,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:v,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:j,resetSelectionOnDoubleClick:B,detailsOnClick:y,language:E,styles:R,classNames:$,animate:k,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:k.once,amount:k.amount}),[L,S]=O.useState(void 0),[D,q]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:w,left:r,right:h},I=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([I,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(j||y)&&(D===o.data.id&&B?(q(void 0),j?.(void 0)):(q(o.data.id),j?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:k.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,v)}):null]})})}):null]},o.data.id))})})}),L&&x&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:x,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,y&&D!==void 0?g.jsxRuntimeExports.jsx(me.X,{open:D!==void 0,onClose:()=>{q(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof y=="string"?{__html:ye.string2HTML(y,D)}:void 0,children:typeof y=="function"?y(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:w=0,topMargin:c=0,bottomMargin:x=0,height:i,width:u,footNote:f,colorDomain:v,colorLegendTitle:p,padding:d,backgroundColor:j=!1,showLabels:B=!0,relativeHeight:y,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:k=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:q=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:I,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const C=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||C.observe(P.current)),()=>C.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,u?"w-fit":"w-full",I?.graphContainer),style:{...M?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:j?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:I?.title,description:I?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(C=>C.data).filter(C=>C!==void 0).length>0?t.map(C=>C.data).filter(C=>C!==void 0):t.filter(C=>C!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(C=>C.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:v||se.uniqBy(t,"color",!0),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(C=>!Ce.checkIfNullOrUndefined(C.size)),colors:t.filter(C=>C.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(C=>C.color).length===0?[]:v||se.uniqBy(t,"color",!0),width:u||T,height:Math.max(q,i||(y?q?(u||T)*y>q?(u||T)*y:q:(u||T)*y:b)),leftMargin:m,rightMargin:w,topMargin:c,bottomMargin:x,showLabels:B,showValues:k,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:I,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:I?.footnote,source:I?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-CHPV5EwG-DjM48pIC.cjs"),O=require("react"),le=require("./Typography-BDULiwlF.cjs"),me=require("./Modal-CuuJdWkD.cjs"),xe=require("./Tooltip-Cpv0QohJ.cjs"),ve=require("./numberFormattingFunction-02t-wJta.cjs"),ee=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),N=require("./Colors.cjs"),ye=require("./string2HTML-z7CwHXcx.cjs"),we=require("./use-in-view-CEwlc_dd.cjs"),Z=require("./proxy-CKadx4lC.cjs"),je=require("./index-Cm8NIdOO.cjs"),Ce=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./GraphFooter.cjs"),Ee=require("./GraphHeader.cjs"),Me=require("./ColorLegendWithMouseOver.cjs"),Re=require("./EmptyState-B8IpKGcL.cjs"),se=require("./uniqBy-O05lp2S5.cjs");function Oe(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Be(){return this.eachAfter(Oe)}function ke(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function Se(e,t){for(var n=this,r=[n],a,s,l=-1;n=r.pop();)if(e.call(t,n,++l,this),a=n.children)for(s=a.length-1;s>=0;--s)r.push(a[s]);return this}function qe(e,t){for(var n=this,r=[n],a=[],s,l,h,m=-1;n=r.pop();)if(a.push(n),s=n.children)for(l=0,h=s.length;l<h;++l)r.push(s[l]);for(;n=a.pop();)e.call(t,n,++m,this);return this}function Ie(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function Ne(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,a=r&&r.length;--a>=0;)n+=r[a].value;t.value=n})}function De(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Te(e){for(var t=this,n=Ve(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var a=r.length;e!==n;)r.splice(a,0,e),e=e.parent;return r}function Ve(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),a=null;for(e=n.pop(),t=r.pop();e===t;)a=e,e=n.pop(),t=r.pop();return a}function _e(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function $e(){return Array.from(this)}function He(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function Le(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*Ae(){var e=this,t,n=[e],r,a,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(a=0,s=r.length;a<s;++a)n.push(r[a]);while(n.length)}function he(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=Ge)):t===void 0&&(t=Pe);for(var n=new F(e),r,a=[n],s,l,h,m;r=a.pop();)if((l=t(r.data))&&(m=(l=Array.from(l)).length))for(r.children=l,h=m-1;h>=0;--h)a.push(s=l[h]=new F(l[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(de)}function ze(){return he(this).eachBefore(We)}function Pe(e){return e.children}function Ge(e){return Array.isArray(e)?e[1]:null}function We(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function de(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function F(e){this.data=e,this.depth=this.height=0,this.parent=null}F.prototype=he.prototype={constructor:F,count:Be,each:ke,eachAfter:qe,eachBefore:Se,find:Ie,sum:Ne,sort:De,path:Te,ancestors:_e,descendants:$e,leaves:He,links:Le,copy:ze,[Symbol.iterator]:Ae};function te(e){return e==null?null:fe(e)}function fe(e){if(typeof e!="function")throw new Error;return e}function G(){return 0}function W(e){return function(){return e}}function Fe(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function Xe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,w=e.value&&(r-t)/e.value;++h<m;)l=s[h],l.y0=n,l.y1=a,l.x0=t,l.x1=t+=l.value*w}var Ye={depth:-1},ue={},ne={};function Ke(e){return e.id}function Ue(e){return e.parentId}function Ze(){var e=Ke,t=Ue,n;function r(a){var s=Array.from(a),l=e,h=t,m,w,c,x,i,u,f,v,p=new Map;if(n!=null){const d=s.map((y,E)=>Je(n(y,E,a))),j=d.map(ce),B=new Set(d).add("");for(const y of j)B.has(y)||(B.add(y),d.push(y),j.push(ce(y)),s.push(ne));l=(y,E)=>d[E],h=(y,E)=>j[E]}for(c=0,m=s.length;c<m;++c)w=s[c],u=s[c]=new F(w),(f=l(w,c,a))!=null&&(f+="")&&(v=u.id=f,p.set(v,p.has(v)?ue:u)),(f=h(w,c,a))!=null&&(f+="")&&(u.parent=f);for(c=0;c<m;++c)if(u=s[c],f=u.parent){if(i=p.get(f),!i)throw new Error("missing: "+f);if(i===ue)throw new Error("ambiguous: "+f);i.children?i.children.push(u):i.children=[u],u.parent=i}else{if(x)throw new Error("multiple roots");x=u}if(!x)throw new Error("no root");if(n!=null){for(;x.data===ne&&x.children.length===1;)x=x.children[0],--m;for(let d=s.length-1;d>=0&&(u=s[d],u.data===ne);--d)u.data=null}if(x.parent=Ye,x.eachBefore(function(d){d.depth=d.parent.depth+1,--m}).eachBefore(de),x.parent=null,m>0)throw new Error("cycle");return x}return r.id=function(a){return arguments.length?(e=te(a),r):e},r.parentId=function(a){return arguments.length?(t=te(a),r):t},r.path=function(a){return arguments.length?(n=te(a),r):n},r}function Je(e){e=`${e}`;let t=e.length;return ie(e,t-1)&&!ie(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ce(e){let t=e.length;if(t<2)return"";for(;--t>1&&!ie(e,t););return e.slice(0,t)}function ie(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if((n&1)===0)return!0}return!1}function Qe(e,t,n,r,a){for(var s=e.children,l,h=-1,m=s.length,w=e.value&&(a-n)/e.value;++h<m;)l=s[h],l.x0=t,l.x1=r,l.y0=n,l.y1=n+=l.value*w}var et=(1+Math.sqrt(5))/2;function tt(e,t,n,r,a,s){for(var l=[],h=t.children,m,w,c=0,x=0,i=h.length,u,f,v=t.value,p,d,j,B,y,E,R;c<i;){u=a-n,f=s-r;do p=h[x++].value;while(!p&&x<i);for(d=j=p,E=Math.max(f/u,u/f)/(v*e),R=p*p*E,y=Math.max(j/R,R/d);x<i;++x){if(p+=w=h[x].value,w<d&&(d=w),w>j&&(j=w),R=p*p*E,B=Math.max(j/R,R/d),B>y){p-=w;break}y=B}l.push(m={value:p,dice:u<f,children:h.slice(c,x)}),m.dice?Xe(m,n,r,a,v?r+=f*p/v:s):Qe(m,n,r,v?n+=u*p/v:a,s),v-=p,c=x}return l}const nt=function e(t){function n(r,a,s,l,h){tt(t,r,a,s,l,h)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(et);function it(){var e=nt,t=!1,n=1,r=1,a=[0],s=G,l=G,h=G,m=G,w=G;function c(i){return i.x0=i.y0=0,i.x1=n,i.y1=r,i.eachBefore(x),a=[0],t&&i.eachBefore(Fe),i}function x(i){var u=a[i.depth],f=i.x0+u,v=i.y0+u,p=i.x1-u,d=i.y1-u;p<f&&(f=p=(f+p)/2),d<v&&(v=d=(v+d)/2),i.x0=f,i.y0=v,i.x1=p,i.y1=d,i.children&&(u=a[i.depth+1]=s(i)/2,f+=w(i)-u,v+=l(i)-u,p-=h(i)-u,d-=m(i)-u,p<f&&(f=p=(f+p)/2),d<v&&(v=d=(v+d)/2),e(i,f,v,p,d))}return c.round=function(i){return arguments.length?(t=!!i,c):t},c.size=function(i){return arguments.length?(n=+i[0],r=+i[1],c):[n,r]},c.tile=function(i){return arguments.length?(e=fe(i),c):e},c.padding=function(i){return arguments.length?c.paddingInner(i).paddingOuter(i):c.paddingInner()},c.paddingInner=function(i){return arguments.length?(s=typeof i=="function"?i:W(+i),c):s},c.paddingOuter=function(i){return arguments.length?c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):c.paddingTop()},c.paddingTop=function(i){return arguments.length?(l=typeof i=="function"?i:W(+i),c):l},c.paddingRight=function(i){return arguments.length?(h=typeof i=="function"?i:W(+i),c):h},c.paddingBottom=function(i){return arguments.length?(m=typeof i=="function"?i:W(+i),c):m},c.paddingLeft=function(i){return arguments.length?(w=typeof i=="function"?i:W(+i),c):w},c}function rt(e){const{data:t,colors:n,leftMargin:r,width:a,height:s,colorDomain:l,rightMargin:h,topMargin:m,bottomMargin:w,showLabels:c,tooltip:x,onSeriesMouseOver:i,selectedColor:u,showValues:f,suffix:v,prefix:p,highlightedDataPoints:d,onSeriesMouseClick:j,resetSelectionOnDoubleClick:B,detailsOnClick:y,language:E,styles:R,classNames:$,animate:k,dimmedOpacity:H,precision:J}=e,X=O.useRef(null),V=we.useInView(X,{once:k.once,amount:k.amount}),[L,S]=O.useState(void 0),[D,q]=O.useState(void 0),[_,A]=O.useState(void 0),[Y,z]=O.useState(void 0),M={top:m,bottom:w,left:r,right:h},I=a-M.left-M.right,K=s-M.top-M.bottom,Q=[{id:"root",parent:void 0,value:void 0,data:void 0},...t.map(o=>({id:o.label,value:o.size,parent:"root",data:o}))],U=Ze().id(o=>o.id).parentId(o=>o.parent)(Q);U.sum(o=>o.value);const T=it().size([I,K]).padding(2)(U);return g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[g.jsxRuntimeExports.jsx(Z.motion.svg,{width:`${a}px`,height:`${s}px`,viewBox:`0 0 ${a} ${s}`,direction:"ltr",ref:X,children:g.jsxRuntimeExports.jsx("g",{transform:`translate(${M.left},${M.top})`,children:g.jsxRuntimeExports.jsx(je.AnimatePresence,{children:T.children?.map(o=>g.jsxRuntimeExports.jsxs(Z.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:o.x0,y:o.y0},whileInView:{opacity:u?o.data.data.color&&n[l.indexOf(o.data.data.color)]===u?1:H:d.length!==0?d.indexOf(o.data.id)!==-1?.85:H:.85,x:o.x0,y:o.y0,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:b=>{S(o.data.data),z(b.clientY),A(b.clientX),i?.(o.data.data)},onClick:()=>{(j||y)&&(D===o.data.id&&B?(q(void 0),j?.(void 0)):(q(o.data.id),j?.(o.data.data)))},onMouseMove:b=>{S(o.data.data),z(b.clientY),A(b.clientX)},onMouseLeave:()=>{S(void 0),A(void 0),z(void 0),i?.(void 0)},children:[g.jsxRuntimeExports.jsx(Z.motion.rect,{x:0,y:0,exit:{width:0,height:0,opacity:0,transition:{duration:k.duration}},variants:{initial:{width:0,height:0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray},whileInView:{width:o.x1-o.x0,height:o.y1-o.y0,fill:t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial"}),o.x1-o.x0>50&&o.y1-o.y0>25&&(c||f)?g.jsxRuntimeExports.jsx(Z.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},children:g.jsxRuntimeExports.jsx("foreignObject",{y:0,x:0,width:o.x1-o.x0,height:o.y1-o.y0,children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 p-2 w-full",style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray)},children:[c?g.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full treemap-label",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{WebkitLineClamp:o.y1-o.y0>50?o.y1-o.y0>100?o.y1-o.y0>150?void 0:3:2:1,display:"-webkit-box",WebkitBoxOrient:"vertical",overflow:"hidden",color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:o.data.id}):null,f?g.jsxRuntimeExports.jsx(le.u,{marginBottom:"none",size:"sm",leading:"none",className:g.mo("w-full font-bold treemap-value",E==="ar"||E==="he"?"text-right":"text-left",$?.graphObjectValues),style:{color:ee.getTextColorBasedOnBgColor(t.filter(b=>b.color).length===0?n[0]:o.data.data.color?n[l.indexOf(o.data.data.color)]:N.Colors.gray),...R?.graphObjectValues||{}},children:ve.numberFormattingFunction(o.data.value,"NA",J,p,v)}):null]})})}):null]},o.data.id))})})}),L&&x&&_&&Y?g.jsxRuntimeExports.jsx(xe.Tooltip,{data:L,body:x,xPos:_,yPos:Y,backgroundStyle:R?.tooltip,className:$?.tooltip}):null,y&&D!==void 0?g.jsxRuntimeExports.jsx(me.G,{open:D!==void 0,onClose:()=>{q(void 0)},children:g.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof y=="string"?{__html:ye.string2HTML(y,D)}:void 0,children:typeof y=="function"?y(D):null})}):null]})}function ot(e){const{data:t,graphTitle:n,colors:r,suffix:a="",sources:s,prefix:l="",graphDescription:h,leftMargin:m=0,rightMargin:w=0,topMargin:c=0,bottomMargin:x=0,height:i,width:u,footNote:f,colorDomain:v,colorLegendTitle:p,padding:d,backgroundColor:j=!1,showLabels:B=!0,relativeHeight:y,tooltip:E,onSeriesMouseOver:R,showColorScale:$=!0,showValues:k=!0,graphID:H,highlightedDataPoints:J=[],onSeriesMouseClick:X,graphDownload:V=!1,dataDownload:L=!1,language:S="en",showNAColor:D=!0,minHeight:q=0,theme:_="light",ariaLabel:A,resetSelectionOnDoubleClick:Y=!0,detailsOnClick:z,styles:M,classNames:I,animate:K=!1,dimmedOpacity:Q=.3,precision:U=2}=e,[T,o]=O.useState(0),[b,re]=O.useState(0),[pe,ge]=O.useState(void 0),P=O.useRef(null),oe=O.useRef(null);return O.useEffect(()=>{const C=new ResizeObserver(ae=>{o(u||ae[0].target.clientWidth||620),re(i||ae[0].target.clientHeight||480)});return P.current&&(re(P.current.clientHeight||480),o(P.current.clientWidth||620),u||C.observe(P.current)),()=>C.disconnect()},[u,i]),g.jsxRuntimeExports.jsx("div",{className:`${_||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:S==="he"||S==="ar"?"rtl":void 0,children:g.jsxRuntimeExports.jsx("div",{className:g.mo(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${S||"en"}`,u?"w-fit":"w-full",I?.graphContainer),style:{...M?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:H,ref:oe,"aria-label":A||`${n?`The graph shows ${n}. `:""}This is a chart where data points are represented by squares, and their sizes reflect their values. ${h?` ${h}`:""}`,children:g.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:j?d||"1rem":d||0},children:g.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[n||h||V||L?g.jsxRuntimeExports.jsx(Ee.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:I?.title,description:I?.description},graphTitle:n,graphDescription:h,width:u,graphDownload:V?oe.current:void 0,dataDownload:L?t.map(C=>C.data).filter(C=>C!==void 0).length>0?t.map(C=>C.data).filter(C=>C!==void 0):t.filter(C=>C!==void 0):null}):null,g.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.length===0?g.jsxRuntimeExports.jsx(Re.EmptyState,{}):g.jsxRuntimeExports.jsxs(g.jsxRuntimeExports.Fragment,{children:[$&&t.filter(C=>C.color).length!==0?g.jsxRuntimeExports.jsx(Me.ColorLegendWithMouseOver,{width:u,colorLegendTitle:p,colors:r||N.Colors[_].categoricalColors.colors,colorDomain:v||se.uniqBy(t,"color",!0),setSelectedColor:ge,showNAColor:D}):null,g.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:P,"aria-label":"Graph area",children:(u||T)&&(i||b)?g.jsxRuntimeExports.jsx(rt,{data:t.filter(C=>!Ce.checkIfNullOrUndefined(C.size)),colors:t.filter(C=>C.color).length===0?r?[r]:[N.Colors.primaryColors["blue-600"]]:r||N.Colors[_].categoricalColors.colors,colorDomain:t.filter(C=>C.color).length===0?[]:v||se.uniqBy(t,"color",!0),width:u||T,height:Math.max(q,i||(y?q?(u||T)*y>q?(u||T)*y:q:(u||T)*y:b)),leftMargin:m,rightMargin:w,topMargin:c,bottomMargin:x,showLabels:B,showValues:k,suffix:a,prefix:l,selectedColor:pe,tooltip:E,onSeriesMouseOver:R,onSeriesMouseClick:X,highlightedDataPoints:J,resetSelectionOnDoubleClick:Y,detailsOnClick:z,styles:M,classNames:I,language:S,animate:K===!0?{duration:.5,once:!0,amount:.5}:K||{duration:0,once:!0,amount:0},dimmedOpacity:Q,precision:U}):null})]})}),s||f?g.jsxRuntimeExports.jsx(be.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:I?.footnote,source:I?.source},sources:s,footNote:f,width:u}):null]})})})})}exports.TreeMapGraph=ot;
2
2
  //# sourceMappingURL=TreeMapGraph.cjs.map
@@ -1,20 +1,20 @@
1
- import { j as m, m as ie } from "./index-CHPV5EwG-BPSP-7Jg.js";
1
+ import { j as m, m as ie } from "./index-CHPV5EwG-DBWUSD9b.js";
2
2
  import { useRef as re, useState as A, useEffect as ye } from "react";
3
- import { u as ue } from "./Typography-Ctgfl1J5.js";
4
- import { X as we } from "./Modal-DVVwpKhP.js";
5
- import { T as xe } from "./Tooltip-CVCGWyzw.js";
3
+ import { u as ue } from "./Typography-LmZ9LEpe.js";
4
+ import { G as we } from "./Modal-Cg8daIlV.js";
5
+ import { T as xe } from "./Tooltip-6LIdPQGC.js";
6
6
  import { n as be } from "./numberFormattingFunction-14YCbkN2.js";
7
7
  import { g as ee } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
8
8
  import { Colors as V } from "./Colors.js";
9
9
  import { s as je } from "./string2HTML-oFCROsus.js";
10
- import { u as Me } from "./use-in-view-yS6jzJAp.js";
11
- import { m as Z } from "./proxy-CkpFesk1.js";
12
- import { A as Oe } from "./index-CNvov0eg.js";
10
+ import { u as Me } from "./use-in-view-DR-UTB96.js";
11
+ import { m as Z } from "./proxy-BYIC9BuT.js";
12
+ import { A as Oe } from "./index-Cwgh7i7X.js";
13
13
  import { c as Ce } from "./checkIfNullOrUndefined-DmfiKkNw.js";
14
14
  import { GraphFooter as ke } from "./GraphFooter.js";
15
15
  import { GraphHeader as De } from "./GraphHeader.js";
16
16
  import { ColorLegendWithMouseOver as Ie } from "./ColorLegendWithMouseOver.js";
17
- import { E as Ne } from "./EmptyState-DdTp-Mdn.js";
17
+ import { E as Ne } from "./EmptyState-36lXXyui.js";
18
18
  import { u as ce } from "./uniqBy-BHy4I8PK.js";
19
19
  function Be(e) {
20
20
  var t = 0, n = e.children, r = n && n.length;
@@ -108,17 +108,17 @@ function* qe() {
108
108
  while (n.length);
109
109
  }
110
110
  function fe(e, t) {
111
- e instanceof Map ? (e = [void 0, e], t === void 0 && (t = Xe)) : t === void 0 && (t = Ge);
112
- for (var n = new G(e), r, a = [n], s, l, h, g; r = a.pop(); )
111
+ e instanceof Map ? (e = [void 0, e], t === void 0 && (t = Xe)) : t === void 0 && (t = Fe);
112
+ for (var n = new F(e), r, a = [n], s, l, h, g; r = a.pop(); )
113
113
  if ((l = t(r.data)) && (g = (l = Array.from(l)).length))
114
114
  for (r.children = l, h = g - 1; h >= 0; --h)
115
- a.push(s = l[h] = new G(l[h])), s.parent = r, s.depth = r.depth + 1;
115
+ a.push(s = l[h] = new F(l[h])), s.parent = r, s.depth = r.depth + 1;
116
116
  return n.eachBefore(pe);
117
117
  }
118
- function Fe() {
118
+ function Ge() {
119
119
  return fe(this).eachBefore(Ye);
120
120
  }
121
- function Ge(e) {
121
+ function Fe(e) {
122
122
  return e.children;
123
123
  }
124
124
  function Xe(e) {
@@ -133,11 +133,11 @@ function pe(e) {
133
133
  e.height = t;
134
134
  while ((e = e.parent) && e.height < ++t);
135
135
  }
136
- function G(e) {
136
+ function F(e) {
137
137
  this.data = e, this.depth = this.height = 0, this.parent = null;
138
138
  }
139
- G.prototype = fe.prototype = {
140
- constructor: G,
139
+ F.prototype = fe.prototype = {
140
+ constructor: F,
141
141
  count: Se,
142
142
  each: Ve,
143
143
  eachAfter: $e,
@@ -150,7 +150,7 @@ G.prototype = fe.prototype = {
150
150
  descendants: Re,
151
151
  leaves: Pe,
152
152
  links: We,
153
- copy: Fe,
153
+ copy: Ge,
154
154
  [Symbol.iterator]: qe
155
155
  };
156
156
  function te(e) {
@@ -163,7 +163,7 @@ function ge(e) {
163
163
  function q() {
164
164
  return 0;
165
165
  }
166
- function F(e) {
166
+ function G(e) {
167
167
  return function() {
168
168
  return e;
169
169
  };
@@ -193,7 +193,7 @@ function et() {
193
193
  l = (w, O) => d[O], h = (w, O) => b[O];
194
194
  }
195
195
  for (c = 0, g = s.length; c < g; ++c)
196
- x = s[c], u = s[c] = new G(x), (f = l(x, c, a)) != null && (f += "") && (y = u.id = f, p.set(y, p.has(y) ? he : u)), (f = h(x, c, a)) != null && (f += "") && (u.parent = f);
196
+ x = s[c], u = s[c] = new F(x), (f = l(x, c, a)) != null && (f += "") && (y = u.id = f, p.set(y, p.has(y) ? he : u)), (f = h(x, c, a)) != null && (f += "") && (u.parent = f);
197
197
  for (c = 0; c < g; ++c)
198
198
  if (u = s[c], f = u.parent) {
199
199
  if (i = p.get(f), !i) throw new Error("missing: " + f);
@@ -290,17 +290,17 @@ function at() {
290
290
  }, c.padding = function(i) {
291
291
  return arguments.length ? c.paddingInner(i).paddingOuter(i) : c.paddingInner();
292
292
  }, c.paddingInner = function(i) {
293
- return arguments.length ? (s = typeof i == "function" ? i : F(+i), c) : s;
293
+ return arguments.length ? (s = typeof i == "function" ? i : G(+i), c) : s;
294
294
  }, c.paddingOuter = function(i) {
295
295
  return arguments.length ? c.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i) : c.paddingTop();
296
296
  }, c.paddingTop = function(i) {
297
- return arguments.length ? (l = typeof i == "function" ? i : F(+i), c) : l;
297
+ return arguments.length ? (l = typeof i == "function" ? i : G(+i), c) : l;
298
298
  }, c.paddingRight = function(i) {
299
- return arguments.length ? (h = typeof i == "function" ? i : F(+i), c) : h;
299
+ return arguments.length ? (h = typeof i == "function" ? i : G(+i), c) : h;
300
300
  }, c.paddingBottom = function(i) {
301
- return arguments.length ? (g = typeof i == "function" ? i : F(+i), c) : g;
301
+ return arguments.length ? (g = typeof i == "function" ? i : G(+i), c) : g;
302
302
  }, c.paddingLeft = function(i) {
303
- return arguments.length ? (x = typeof i == "function" ? i : F(+i), c) : x;
303
+ return arguments.length ? (x = typeof i == "function" ? i : G(+i), c) : x;
304
304
  }, c;
305
305
  }
306
306
  function lt(e) {
package/dist/Types.d.ts CHANGED
@@ -657,6 +657,7 @@ export declare interface GraphSettingsDataType {
657
657
  showAxisLabels?: boolean;
658
658
  highlightedAltitude?: number;
659
659
  selectedId?: string;
660
+ collapseColorScaleByDefault?: boolean;
660
661
  }
661
662
 
662
663
  export declare type GraphType = GraphTypeForGriddedGraph;
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),l=e.j("mt-0 ml-0 mr-0",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base","base-responsive":"text-base md:text-xl",lg:"text-lg",xl:"text-xl"},leading:{none:"leading-none",xs:"leading-[1.25]",sm:"leading-[1.375]",base:"leading-[1.4]",lg:"leading-[1.625]",xl:"leading-[2]"},marginBottom:{none:"mb-0","3xs":"mb-1","2xs":"mb-2",xs:"mb-3",sm:"mb-4",base:"mb-5",lg:"mb-6",xl:"mb-7"}},defaultVariants:{size:"base-responsive",leading:"base",marginBottom:"base"}});function o({children:t,className:m,size:a,leading:n,marginBottom:i,...r}){return e.ae.jsx("p",{...r,className:e.mo(l({size:a,leading:n,marginBottom:i}),m),children:t})}const s=e.j("mt-0 ml-0 mr-0 p-0",{variants:{marginBottom:{none:"mb-0","2xs":"mb-1",xs:"mb-2",sm:"mb-3","base-responsive":"mb-3 md:mb-4",base:"mb-4",lg:"mb-5",xl:"mb-6"}},defaultVariants:{marginBottom:"base-responsive"}});function d({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h2",{...n,className:e.mo("text-[2.5rem] md:text-[2.813rem] lg:text-[3.438rem] font-bold leading-[1.1]",s({marginBottom:a}),m),children:t})}function b({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h3",{...n,className:e.mo("text-[1.875rem] md:text-[2.188rem] font-semibold leading-[1.15]",s({marginBottom:a}),m),children:t})}function x({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h5",{...n,className:e.mo("text-[1.25rem] md:text-[1.563rem] font-normal leading-[1.15]",s({marginBottom:a}),m),children:t})}function g({children:t,className:m,...a}){return e.ae.jsx("a",{...a,className:e.mo("undp-link light text-primary-black dark:text-primary-white dark:text-primary-white bg-double-red dark:bg-double-white","cursor-pointer no-underline focus-visible:outline-hidden focus-visible:shadow-[0_0_0_#0468b1]",m),children:t})}exports.H=g;exports.f=d;exports.h=b;exports.k=x;exports.u=o;
2
- //# sourceMappingURL=Typography-k-kOjICQ.cjs.map
1
+ "use strict";const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),l=e.j("mt-0 ml-0 mr-0",{variants:{size:{xs:"text-xs",sm:"text-sm",base:"text-base","base-responsive":"text-base md:text-xl",lg:"text-lg",xl:"text-xl"},leading:{none:"leading-none",xs:"leading-[1.25]",sm:"leading-[1.375]",base:"leading-[1.4]",lg:"leading-[1.625]",xl:"leading-[2]"},marginBottom:{none:"mb-0","3xs":"mb-1","2xs":"mb-2",xs:"mb-3",sm:"mb-4",base:"mb-5",lg:"mb-6",xl:"mb-7"}},defaultVariants:{size:"base-responsive",leading:"base",marginBottom:"base"}});function o({children:t,className:m,size:a,leading:n,marginBottom:i,...r}){return e.ae.jsx("p",{...r,className:e.mo(l({size:a,leading:n,marginBottom:i}),m),children:t})}const s=e.j("mt-0 ml-0 mr-0 p-0",{variants:{marginBottom:{none:"mb-0","2xs":"mb-1",xs:"mb-2",sm:"mb-3","base-responsive":"mb-3 md:mb-4",base:"mb-4",lg:"mb-5",xl:"mb-6"}},defaultVariants:{marginBottom:"base-responsive"}});function d({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h2",{...n,className:e.mo("text-[2.5rem] md:text-[2.813rem] lg:text-[3.438rem] font-bold leading-[1.1]",s({marginBottom:a}),m),children:t})}function b({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h3",{...n,className:e.mo("text-[1.875rem] md:text-[2.188rem] font-semibold leading-[1.15]",s({marginBottom:a}),m),children:t})}function x({children:t,className:m,marginBottom:a,...n}){return e.ae.jsx("h5",{...n,className:e.mo("text-[1.25rem] md:text-[1.563rem] font-normal leading-[1.15]",s({marginBottom:a}),m),children:t})}function g({children:t,className:m,...a}){return e.ae.jsx("a",{...a,className:e.mo("undp-link light text-primary-black dark:text-primary-white dark:text-primary-white bg-double-red dark:bg-double-white","cursor-pointer no-underline focus-visible:outline-hidden focus-visible:shadow-[0_0_0_#0468b1]",m),children:t})}exports.H=g;exports.f=d;exports.h=b;exports.k=x;exports.u=o;
2
+ //# sourceMappingURL=Typography-BDULiwlF.cjs.map