@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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),T=require("maplibre-gl"),O=require("pmtiles");;/* empty css */const C=require("@dnd-kit/core"),_=require("@dnd-kit/modifiers"),L=require("./index-BW_-wD2k.cjs"),I=require("./string2HTML-z7CwHXcx.cjs"),q=require("./select-Bnfk0lJx.cjs"),A=require("./GraphHeader.cjs"),W=require("./GraphFooter.cjs");function G(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(s,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return s.default=o,Object.freeze(s)}const v=G(T),X=G(O);function B(o,s){let r=!1;function t(i,p){if(!r){r=!0;const l=i.getCenter(),a=i.getZoom(),x=i.getBearing(),c=i.getPitch();p.jumpTo({center:l,zoom:a,bearing:x,pitch:c}),r=!1}}o.on("move",()=>{t(o,s)}),s.on("move",()=>{t(s,o)})}function F(o){const{height:s,width:r,mapStyles:t,center:i,zoomLevel:p,mapLegend:l}=o,[a,x]=n.useState(50),[c,S]=n.useState(!1),d=n.useRef(null),[N,M]=n.useState(!0),w=n.useRef(50),m=n.useRef(0),D=C.useSensors(C.useSensor(C.PointerSensor,{activationConstraint:{distance:0}})),k=()=>{S(!0),w.current=a,d.current&&(m.current=d.current.getBoundingClientRect().width)},h=u=>{if(!d.current||m.current===0)return;const g=u.delta.x/m.current*100,E=Math.max(0,Math.min(100,w.current+g));x(E)},f=()=>{S(!1)},z=u=>{if(c||!d.current)return;const g=d.current.getBoundingClientRect(),P=(u.clientX-g.left)/g.width*100;x(Math.max(0,Math.min(100,P)))},b=n.useRef(null),j=n.useRef(null),y=n.useRef(null),R=n.useRef(null);return n.useEffect(()=>{if(R.current&&j.current&&y.current&&r){q.select(R.current).selectAll(".maplibregl-compare").remove(),q.select(j.current).selectAll("div").remove(),q.select(y.current).selectAll("div").remove();const P=new X.Protocol;v.addProtocol("pmtiles",P.tile);const H=new v.Map({container:j.current,style:t[0],center:i||[0,0],zoom:p||4}),$=new v.Map({container:y.current,style:t[1],center:i||[0,0],zoom:p||4});$.addControl(new v.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),H.addControl(new v.ScaleControl,"bottom-left"),H.addControl(new v.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),$.addControl(new v.ScaleControl,"bottom-left"),B(H,$)}},[r,t,i,p]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col grow justify-center leading-0",ref:b,"aria-label":"Map area",children:[e.jsxRuntimeExports.jsx("div",{style:{width:r,height:s},children:e.jsxRuntimeExports.jsx("div",{ref:R,className:"map maplibre-show-control relative w-full h-full",style:{inset:0},children:e.jsxRuntimeExports.jsx(C.DndContext,{sensors:D,modifiers:[_.restrictToHorizontalAxis],onDragStart:k,onDragMove:h,onDragEnd:f,children:e.jsxRuntimeExports.jsxs("div",{ref:d,style:{position:"relative",width:r,height:s,overflow:"hidden",cursor:c?"grabbing":"col-resize",userSelect:"none"},onClick:z,children:[e.jsxRuntimeExports.jsx("div",{ref:y,className:"absolute h-full rightMap w-full",style:{position:"absolute",top:0,left:0,clipPath:`polygon(${a}% 0%, ${a}% 100%, 100% 100%, 100% 0%)`}}),e.jsxRuntimeExports.jsx("div",{ref:j,className:"absolute h-full leftMap w-full",style:{position:"absolute",top:0,left:0,inset:0,clipPath:`polygon(0% 0%, ${a}% 0%, ${a}% 100%, 0% 100%)`}}),e.jsxRuntimeExports.jsx(Z,{position:a})]})})})}),l?e.jsxRuntimeExports.jsx("div",{className:"absolute left-[22px] bottom-13",children:N?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{M(!1)},children:e.jsxRuntimeExports.jsx(L.X,{})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},dangerouslySetInnerHTML:typeof l=="string"?{__html:I.string2HTML(l)}:void 0,children:n.isValidElement(l)?l:null})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{M(!0)},children:e.jsxRuntimeExports.jsx("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",children:"Show Legend"})})}):null]})}function Z(o){const{position:s}=o,{attributes:r,listeners:t,setNodeRef:i}=C.useDraggable({id:"slider-handle"});return e.jsxRuntimeExports.jsxs("div",{ref:i,style:{position:"absolute",left:`${s}%`,top:0,bottom:0,width:"40px",transform:"translateX(-50%)",cursor:"col-resize",display:"flex",justifyContent:"center",alignItems:"center",zIndex:10,touchAction:"none"},...t,...r,children:[e.jsxRuntimeExports.jsx("div",{className:"h-full bg-primary-blue-600 dark:bg-primary-blue-400",style:{width:"2px"}}),e.jsxRuntimeExports.jsx("div",{className:"flex bg-primary-blue-600 dark:bg-primary-blue-400 rounded-full absolute items-center justify-center text-primary-white font-primary-white",style:{boxShadow:"inset 0 0 0 1px #fff",width:"42px",height:"42px",top:"calc(50% - 21px)",left:"0",cursor:"col-resize"},children:e.jsxRuntimeExports.jsx(L.ChevronLeftRight,{})})]})}function V(o){const{graphTitle:s,height:r,width:t,relativeHeight:i,sources:p,graphDescription:l,footNote:a,padding:x,backgroundColor:c=!1,graphID:S,mapStyles:d,center:N=[0,0],zoomLevel:M=3,language:w="en",minHeight:m=0,theme:D="light",ariaLabel:k,styles:h,classNames:f,mapLegend:z}=o,[b,j]=n.useState(0),[y,R]=n.useState(0),u=n.useRef(null);return n.useEffect(()=>{const g=new ResizeObserver(E=>{j(t||E[0].target.clientWidth||620),R(r||E[0].target.clientHeight||480)});return u.current&&(R(u.current.clientHeight||480),j(u.current.clientWidth||620),t||g.observe(u.current)),()=>g.disconnect()},[t,r]),e.jsxRuntimeExports.jsx("div",{className:`${D||"light"} flex ${t?"w-fit grow-0":"w-full grow"}`,dir:w==="he"||w==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${c?c===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${w||"en"}`,t?"w-fit":"w-full",f?.graphContainer),style:{...h?.graphContainer||{},...c&&c!==!0?{backgroundColor:c}:{}},id:S,"aria-label":k||`${s?`The graph shows ${s}. `:""}This is a comparison between two maps.${l?` ${l}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:c?x||"1rem":x||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[s||l?e.jsxRuntimeExports.jsx(A.GraphHeader,{styles:{title:h?.title,description:h?.description},classNames:{title:f?.title,description:f?.description},graphTitle:s,graphDescription:l,width:t}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:u,"aria-label":"map area",children:(t||b)&&(r||y)?e.jsxRuntimeExports.jsx(F,{width:t||b,height:Math.max(m,r||(i?m?(t||b)*i>m?(t||b)*i:m:(t||b)*i:y)),mapStyles:d,center:N,zoomLevel:M,mapLegend:z}):null}),p||a?e.jsxRuntimeExports.jsx(W.GraphFooter,{styles:{footnote:h?.footnote,source:h?.source},classNames:{footnote:f?.footnote,source:f?.source},sources:p,footNote:a,width:t}):null]})})})})}exports.GeoHubCompareMaps=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),n=require("react"),T=require("maplibre-gl"),O=require("pmtiles");;/* empty css */const C=require("@dnd-kit/core"),_=require("@dnd-kit/modifiers"),L=require("./index-C0bpbS4F.cjs"),A=require("./string2HTML-z7CwHXcx.cjs"),q=require("./select-Bnfk0lJx.cjs"),I=require("./GraphHeader.cjs"),W=require("./GraphFooter.cjs");function G(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const t=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(s,r,t.get?t:{enumerable:!0,get:()=>o[r]})}}return s.default=o,Object.freeze(s)}const y=G(T),X=G(O);function B(o,s){let r=!1;function t(i,d){if(!r){r=!0;const l=i.getCenter(),a=i.getZoom(),x=i.getBearing(),c=i.getPitch();d.jumpTo({center:l,zoom:a,bearing:x,pitch:c}),r=!1}}o.on("move",()=>{t(o,s)}),s.on("move",()=>{t(s,o)})}function F(o){const{height:s,width:r,mapStyles:t,center:i,zoomLevel:d,mapLegend:l}=o,[a,x]=n.useState(50),[c,S]=n.useState(!1),p=n.useRef(null),[N,M]=n.useState(!0),w=n.useRef(50),m=n.useRef(0),D=C.useSensors(C.useSensor(C.PointerSensor,{activationConstraint:{distance:0}})),k=()=>{S(!0),w.current=a,p.current&&(m.current=p.current.getBoundingClientRect().width)},f=u=>{if(!p.current||m.current===0)return;const g=u.delta.x/m.current*100,E=Math.max(0,Math.min(100,w.current+g));x(E)},h=()=>{S(!1)},z=u=>{if(c||!p.current)return;const g=p.current.getBoundingClientRect(),P=(u.clientX-g.left)/g.width*100;x(Math.max(0,Math.min(100,P)))},b=n.useRef(null),j=n.useRef(null),v=n.useRef(null),R=n.useRef(null);return n.useEffect(()=>{if(R.current&&j.current&&v.current&&r){q.select(R.current).selectAll(".maplibregl-compare").remove(),q.select(j.current).selectAll("div").remove(),q.select(v.current).selectAll("div").remove();const P=new X.Protocol;y.addProtocol("pmtiles",P.tile);const H=new y.Map({container:j.current,style:t[0],center:i||[0,0],zoom:d||4}),$=new y.Map({container:v.current,style:t[1],center:i||[0,0],zoom:d||4});$.addControl(new y.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),H.addControl(new y.ScaleControl,"bottom-left"),H.addControl(new y.NavigationControl({visualizePitch:!0,showZoom:!0,showCompass:!0}),"bottom-right"),$.addControl(new y.ScaleControl,"bottom-left"),B(H,$)}},[r,t,i,d]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col grow justify-center leading-0",ref:b,"aria-label":"Map area",children:[e.jsxRuntimeExports.jsx("div",{style:{width:r,height:s},children:e.jsxRuntimeExports.jsx("div",{ref:R,className:"map maplibre-show-control relative w-full h-full",style:{inset:0},children:e.jsxRuntimeExports.jsx(C.DndContext,{sensors:D,modifiers:[_.restrictToHorizontalAxis],onDragStart:k,onDragMove:f,onDragEnd:h,children:e.jsxRuntimeExports.jsxs("div",{ref:p,style:{position:"relative",width:r,height:s,overflow:"hidden",cursor:c?"grabbing":"col-resize",userSelect:"none"},onClick:z,children:[e.jsxRuntimeExports.jsx("div",{ref:v,className:"absolute h-full rightMap w-full",style:{position:"absolute",top:0,left:0,clipPath:`polygon(${a}% 0%, ${a}% 100%, 100% 100%, 100% 0%)`}}),e.jsxRuntimeExports.jsx("div",{ref:j,className:"absolute h-full leftMap w-full",style:{position:"absolute",top:0,left:0,inset:0,clipPath:`polygon(0% 0%, ${a}% 0%, ${a}% 100%, 0% 100%)`}}),e.jsxRuntimeExports.jsx(Z,{position:a})]})})})}),l?e.jsxRuntimeExports.jsx("div",{className:"absolute left-[22px] bottom-13",children:N?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{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]",onClick:()=>{M(!1)},children:e.jsxRuntimeExports.jsx(L.X,{})}),e.jsxRuntimeExports.jsx("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",dangerouslySetInnerHTML:typeof l=="string"?{__html:A.string2HTML(l)}:void 0,children:n.isValidElement(l)?l:null})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{M(!0)},children:e.jsxRuntimeExports.jsx("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",children:"Show Legend"})})}):null]})}function Z(o){const{position:s}=o,{attributes:r,listeners:t,setNodeRef:i}=C.useDraggable({id:"slider-handle"});return e.jsxRuntimeExports.jsxs("div",{ref:i,style:{position:"absolute",left:`${s}%`,top:0,bottom:0,width:"40px",transform:"translateX(-50%)",cursor:"col-resize",display:"flex",justifyContent:"center",alignItems:"center",zIndex:10,touchAction:"none"},...t,...r,children:[e.jsxRuntimeExports.jsx("div",{className:"h-full bg-primary-blue-600 dark:bg-primary-blue-400",style:{width:"2px"}}),e.jsxRuntimeExports.jsx("div",{className:"flex bg-primary-blue-600 dark:bg-primary-blue-400 rounded-full absolute items-center justify-center text-primary-white font-primary-white",style:{boxShadow:"inset 0 0 0 1px #fff",width:"42px",height:"42px",top:"calc(50% - 21px)",left:"0",cursor:"col-resize"},children:e.jsxRuntimeExports.jsx(L.ChevronLeftRight,{})})]})}function V(o){const{graphTitle:s,height:r,width:t,relativeHeight:i,sources:d,graphDescription:l,footNote:a,padding:x,backgroundColor:c=!1,graphID:S,mapStyles:p,center:N=[0,0],zoomLevel:M=3,language:w="en",minHeight:m=0,theme:D="light",ariaLabel:k,styles:f,classNames:h,mapLegend:z}=o,[b,j]=n.useState(0),[v,R]=n.useState(0),u=n.useRef(null);return n.useEffect(()=>{const g=new ResizeObserver(E=>{j(t||E[0].target.clientWidth||620),R(r||E[0].target.clientHeight||480)});return u.current&&(R(u.current.clientHeight||480),j(u.current.clientWidth||620),t||g.observe(u.current)),()=>g.disconnect()},[t,r]),e.jsxRuntimeExports.jsx("div",{className:`${D||"light"} flex ${t?"w-fit grow-0":"w-full grow"}`,dir:w==="he"||w==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${c?c===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${w||"en"}`,t?"w-fit":"w-full",h?.graphContainer),style:{...f?.graphContainer||{},...c&&c!==!0?{backgroundColor:c}:{}},id:S,"aria-label":k||`${s?`The graph shows ${s}. `:""}This is a comparison between two maps.${l?` ${l}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:c?x||"1rem":x||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[s||l?e.jsxRuntimeExports.jsx(I.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:h?.title,description:h?.description},graphTitle:s,graphDescription:l,width:t}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:u,"aria-label":"map area",children:(t||b)&&(r||v)?e.jsxRuntimeExports.jsx(F,{width:t||b,height:Math.max(m,r||(i?m?(t||b)*i>m?(t||b)*i:m:(t||b)*i:v)),mapStyles:p,center:N,zoomLevel:M,mapLegend:z}):null}),d||a?e.jsxRuntimeExports.jsx(W.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:d,footNote:a,width:t}):null]})})})})}exports.GeoHubCompareMaps=V;
2
2
  //# sourceMappingURL=GeoHubCompareMaps.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeoHubCompareMaps.cjs","sources":["../src/Components/Graphs/Maps/GeoHubMaps/CompareMaps/Graph.tsx","../src/Components/Graphs/Maps/GeoHubMaps/CompareMaps/index.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\r\nimport * as maplibreGl from 'maplibre-gl';\r\nimport * as pmtiles from 'pmtiles';\r\nimport 'maplibre-gl/dist/maplibre-gl.css';\r\nimport { select } from 'd3-selection';\r\nimport {\r\n DndContext,\r\n useDraggable,\r\n useSensor,\r\n useSensors,\r\n PointerSensor,\r\n DragMoveEvent,\r\n} from '@dnd-kit/core';\r\nimport { restrictToHorizontalAxis } from '@dnd-kit/modifiers';\r\nimport React from 'react';\r\n\r\nimport { ChevronLeftRight, X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n width: number;\r\n height: number;\r\n mapStyles: [string, string];\r\n center: [number, number];\r\n mapLegend?: string | React.ReactNode;\r\n zoomLevel: number;\r\n}\r\n\r\nfunction synchronizeMap(map1: maplibreGl.Map, map2: maplibreGl.Map) {\r\n let isSyncing = false;\r\n function syncMap(sourceMap: maplibreGl.Map, targetMap: maplibreGl.Map) {\r\n if (!isSyncing) {\r\n isSyncing = true;\r\n const center = sourceMap.getCenter();\r\n const zoom = sourceMap.getZoom();\r\n const bearing = sourceMap.getBearing();\r\n const pitch = sourceMap.getPitch();\r\n targetMap.jumpTo({\r\n center,\r\n zoom,\r\n bearing,\r\n pitch,\r\n });\r\n isSyncing = false;\r\n }\r\n }\r\n\r\n // Event listeners for map1\r\n map1.on('move', () => {\r\n syncMap(map1, map2);\r\n });\r\n\r\n // Event listeners for map2\r\n map2.on('move', () => {\r\n syncMap(map2, map1);\r\n });\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const { height, width, mapStyles, center, zoomLevel, mapLegend } = props;\r\n const [position, setPosition] = useState(50);\r\n const [isDragging, setIsDragging] = useState(false);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [showLegend, setShowLegend] = useState(true);\r\n const dragStartPositionRef = useRef(50);\r\n const sliderWidthRef = useRef(0);\r\n\r\n const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 0 } }));\r\n\r\n const handleDragStart = () => {\r\n setIsDragging(true);\r\n dragStartPositionRef.current = position;\r\n\r\n if (containerRef.current) {\r\n sliderWidthRef.current = containerRef.current.getBoundingClientRect().width;\r\n }\r\n };\r\n\r\n const handleDragMove = (event: DragMoveEvent) => {\r\n if (!containerRef.current || sliderWidthRef.current === 0) return;\r\n\r\n // Calculate position change as percentage of width\r\n const deltaPercentage = (event.delta.x / sliderWidthRef.current) * 100;\r\n const newPosition = Math.max(0, Math.min(100, dragStartPositionRef.current + deltaPercentage));\r\n\r\n setPosition(newPosition);\r\n };\r\n\r\n const handleDragEnd = () => {\r\n setIsDragging(false);\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent) => {\r\n if (isDragging || !containerRef.current) return;\r\n\r\n const rect = containerRef.current.getBoundingClientRect();\r\n const clickX = e.clientX - rect.left;\r\n const newPosition = (clickX / rect.width) * 100;\r\n\r\n setPosition(Math.max(0, Math.min(100, newPosition)));\r\n };\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const leftMapRef = useRef<HTMLDivElement>(null);\r\n const rightMapRef = useRef<HTMLDivElement>(null);\r\n const mapContainer = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n if (mapContainer.current && leftMapRef.current && rightMapRef.current && width) {\r\n const mapDiv = select(mapContainer.current);\r\n mapDiv.selectAll('.maplibregl-compare').remove();\r\n const leftMapDiv = select(leftMapRef.current);\r\n leftMapDiv.selectAll('div').remove();\r\n const rightMapDiv = select(rightMapRef.current);\r\n rightMapDiv.selectAll('div').remove();\r\n const protocol = new pmtiles.Protocol();\r\n maplibreGl.addProtocol('pmtiles', protocol.tile);\r\n const leftMap = new maplibreGl.Map({\r\n container: leftMapRef.current,\r\n style: mapStyles[0],\r\n center: center || [0, 0],\r\n zoom: zoomLevel || 4,\r\n });\r\n\r\n const rightMap = new maplibreGl.Map({\r\n container: rightMapRef.current,\r\n style: mapStyles[1],\r\n center: center || [0, 0],\r\n zoom: zoomLevel || 4,\r\n });\r\n rightMap.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n leftMap.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n leftMap.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n rightMap.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n synchronizeMap(leftMap, rightMap);\r\n }\r\n }, [width, mapStyles, center, zoomLevel]);\r\n return (\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 <div\r\n style={{\r\n width,\r\n height,\r\n }}\r\n >\r\n <div\r\n ref={mapContainer}\r\n className='map maplibre-show-control relative w-full h-full'\r\n style={{ inset: 0 }}\r\n >\r\n <DndContext\r\n sensors={sensors}\r\n modifiers={[restrictToHorizontalAxis]}\r\n onDragStart={handleDragStart}\r\n onDragMove={handleDragMove}\r\n onDragEnd={handleDragEnd}\r\n >\r\n <div\r\n ref={containerRef}\r\n style={{\r\n position: 'relative',\r\n width,\r\n height,\r\n overflow: 'hidden',\r\n cursor: isDragging ? 'grabbing' : 'col-resize',\r\n userSelect: 'none', // Prevent text selection during drag\r\n }}\r\n onClick={handleClick}\r\n >\r\n <div\r\n ref={rightMapRef}\r\n className='absolute h-full rightMap w-full'\r\n style={{\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n clipPath: `polygon(${position}% 0%, ${position}% 100%, 100% 100%, 100% 0%)`,\r\n }}\r\n />\r\n <div\r\n ref={leftMapRef}\r\n className='absolute h-full leftMap w-full'\r\n style={{\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n inset: 0,\r\n clipPath: `polygon(0% 0%, ${position}% 0%, ${position}% 100%, 0% 100%)`,\r\n }}\r\n />\r\n\r\n <SliderHandle position={position} />\r\n </div>\r\n </DndContext>\r\n </div>\r\n </div>\r\n {mapLegend ? (\r\n <div className='absolute left-[22px] bottom-13'>\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 }}\r\n dangerouslySetInnerHTML={\r\n typeof mapLegend === 'string' ? { __html: string2HTML(mapLegend) } : undefined\r\n }\r\n >\r\n {React.isValidElement(mapLegend) ? mapLegend : null}\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 ) : null}\r\n </div>\r\n );\r\n}\r\n\r\ninterface HandleProps {\r\n position: number;\r\n}\r\n\r\nfunction SliderHandle(props: HandleProps) {\r\n const { position } = props;\r\n const { attributes, listeners, setNodeRef } = useDraggable({ id: 'slider-handle' });\r\n\r\n return (\r\n <div\r\n ref={setNodeRef}\r\n style={{\r\n position: 'absolute',\r\n left: `${position}%`,\r\n top: 0,\r\n bottom: 0,\r\n width: '40px',\r\n transform: 'translateX(-50%)',\r\n cursor: 'col-resize',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n zIndex: 10,\r\n touchAction: 'none',\r\n }}\r\n {...listeners}\r\n {...attributes}\r\n >\r\n <div\r\n className='h-full bg-primary-blue-600 dark:bg-primary-blue-400'\r\n style={{ width: '2px' }}\r\n />\r\n <div\r\n className='flex bg-primary-blue-600 dark:bg-primary-blue-400 rounded-full absolute items-center justify-center text-primary-white font-primary-white'\r\n style={{\r\n boxShadow: 'inset 0 0 0 1px #fff',\r\n width: '42px',\r\n height: '42px',\r\n top: 'calc(50% - 21px)',\r\n left: '0',\r\n cursor: 'col-resize',\r\n }}\r\n >\r\n <ChevronLeftRight />\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { useRef, useEffect, useState } from 'react';\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 { ClassNameObject, Languages, SourcesDataType, StyleObject } from '@/Types';\r\n\r\ninterface Props {\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 /** 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 /** URLs for mapStyles JSON user wants to compare */\r\n mapStyles: [string, string];\r\n /** Defines the legend for the map. mapLegend with type string is show as innerHTML. */\r\n mapLegend?: string | React.ReactNode;\r\n /** Starting center point of the map */\r\n center?: [number, number];\r\n /** Starting zoom level of the map */\r\n zoomLevel?: number;\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 [`maplibre`](https://maplibre.org/maplibre-gl-js/docs/#npm), [pmtiles](https://www.npmjs.com/package/pmtiles), [dnd-kit/core](https://www.npmjs.com/package/@dnd-kit/core), and [dnd-kit/modifier](https://www.npmjs.com/package/@dnd-kit/modifiers) package to your project */\r\nexport function GeoHubCompareMaps(props: Props) {\r\n const {\r\n graphTitle,\r\n height,\r\n width,\r\n relativeHeight,\r\n sources,\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n graphID,\r\n mapStyles,\r\n center = [0, 0],\r\n zoomLevel = 3,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n mapLegend,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\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 || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\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 comparison between two maps.${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 ? (\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 />\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) ? (\r\n <Graph\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 mapStyles={mapStyles}\r\n center={center}\r\n zoomLevel={zoomLevel}\r\n mapLegend={mapLegend}\r\n />\r\n ) : null}\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":["synchronizeMap","map1","map2","isSyncing","syncMap","sourceMap","targetMap","center","zoom","bearing","pitch","Graph","props","height","width","mapStyles","zoomLevel","mapLegend","position","setPosition","useState","isDragging","setIsDragging","containerRef","useRef","showLegend","setShowLegend","dragStartPositionRef","sliderWidthRef","sensors","useSensors","useSensor","PointerSensor","handleDragStart","handleDragMove","event","deltaPercentage","newPosition","handleDragEnd","handleClick","e","rect","graphDiv","leftMapRef","rightMapRef","mapContainer","useEffect","select","protocol","pmtiles","maplibreGl","leftMap","rightMap","jsxs","jsx","DndContext","restrictToHorizontalAxis","SliderHandle","Fragment","X","string2HTML","React","attributes","listeners","setNodeRef","useDraggable","ChevronLeftRight","GeoHubCompareMaps","graphTitle","relativeHeight","sources","graphDescription","footNote","padding","backgroundColor","graphID","language","minHeight","theme","ariaLabel","styles","classNames","svgWidth","setSvgWidth","svgHeight","setSvgHeight","resizeObserver","entries","cn","GraphHeader","GraphFooter"],"mappings":"qvBA4BA,SAASA,EAAeC,EAAsBC,EAAsB,CAClE,IAAIC,EAAY,GAChB,SAASC,EAAQC,EAA2BC,EAA2B,CACrE,GAAI,CAACH,EAAW,CACdA,EAAY,GACZ,MAAMI,EAASF,EAAU,UAAA,EACnBG,EAAOH,EAAU,QAAA,EACjBI,EAAUJ,EAAU,WAAA,EACpBK,EAAQL,EAAU,SAAA,EACxBC,EAAU,OAAO,CACf,OAAAC,EACA,KAAAC,EACA,QAAAC,EACA,MAAAC,CAAA,CACD,EACDP,EAAY,EACd,CACF,CAGAF,EAAK,GAAG,OAAQ,IAAM,CACpBG,EAAQH,EAAMC,CAAI,CACpB,CAAC,EAGDA,EAAK,GAAG,OAAQ,IAAM,CACpBE,EAAQF,EAAMD,CAAI,CACpB,CAAC,CACH,CAEO,SAASU,EAAMC,EAAc,CAClC,KAAM,CAAE,OAAAC,EAAQ,MAAAC,EAAO,UAAAC,EAAW,OAAAR,EAAQ,UAAAS,EAAW,UAAAC,GAAcL,EAC7D,CAACM,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAE,EACrC,CAACC,EAAYC,CAAa,EAAIF,EAAAA,SAAS,EAAK,EAC5CG,EAAeC,EAAAA,OAAuB,IAAI,EAC1C,CAACC,EAAYC,CAAa,EAAIN,EAAAA,SAAS,EAAI,EAC3CO,EAAuBH,EAAAA,OAAO,EAAE,EAChCI,EAAiBJ,EAAAA,OAAO,CAAC,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,MAAA,CAAI,UAAU,kDACZ,SAAA,CAAAe,GAAcG,EACbjB,EAAAA,kBAAAA,IAACmC,EAAAA,YAAA,CACC,OAAQ,CACN,MAAOT,GAAQ,MACf,YAAaA,GAAQ,WAAA,EAEvB,WAAY,CACV,MAAOC,GAAY,MACnB,YAAaA,GAAY,WAAA,EAE3B,WAAAb,EACA,iBAAAG,EACA,MAAAzD,CAAA,CAAA,EAEA,KACJwC,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,8CACV,IAAKZ,EACL,aAAW,WAET,UAAA5B,GAASoE,KAAcrE,GAAUuE,GACjC9B,EAAAA,kBAAAA,IAAC3C,EAAA,CACC,MAAOG,GAASoE,EAChB,OAAQ,KAAK,IACXL,EACAhE,IACGwD,EACGQ,GACG/D,GAASoE,GAAYb,EAAiBQ,GACpC/D,GAASoE,GAAYb,EACtBQ,GACD/D,GAASoE,GAAYb,EACxBe,EAAA,EAER,UAAArE,EACA,OAAAR,EACA,UAAAS,EACA,UAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,EAELqD,GAAWE,EACVlB,EAAAA,kBAAAA,IAACoC,EAAAA,YAAA,CACC,OAAQ,CAAE,SAAUV,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAAX,EACA,SAAAE,EACA,MAAA1D,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
1
+ {"version":3,"file":"GeoHubCompareMaps.cjs","sources":["../src/Components/Graphs/Maps/GeoHubMaps/CompareMaps/Graph.tsx","../src/Components/Graphs/Maps/GeoHubMaps/CompareMaps/index.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\r\nimport * as maplibreGl from 'maplibre-gl';\r\nimport * as pmtiles from 'pmtiles';\r\nimport 'maplibre-gl/dist/maplibre-gl.css';\r\nimport { select } from 'd3-selection';\r\nimport {\r\n DndContext,\r\n useDraggable,\r\n useSensor,\r\n useSensors,\r\n PointerSensor,\r\n DragMoveEvent,\r\n} from '@dnd-kit/core';\r\nimport { restrictToHorizontalAxis } from '@dnd-kit/modifiers';\r\nimport React from 'react';\r\n\r\nimport { ChevronLeftRight, X } from '@/Components/Icons';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n width: number;\r\n height: number;\r\n mapStyles: [string, string];\r\n center: [number, number];\r\n mapLegend?: string | React.ReactNode;\r\n zoomLevel: number;\r\n}\r\n\r\nfunction synchronizeMap(map1: maplibreGl.Map, map2: maplibreGl.Map) {\r\n let isSyncing = false;\r\n function syncMap(sourceMap: maplibreGl.Map, targetMap: maplibreGl.Map) {\r\n if (!isSyncing) {\r\n isSyncing = true;\r\n const center = sourceMap.getCenter();\r\n const zoom = sourceMap.getZoom();\r\n const bearing = sourceMap.getBearing();\r\n const pitch = sourceMap.getPitch();\r\n targetMap.jumpTo({\r\n center,\r\n zoom,\r\n bearing,\r\n pitch,\r\n });\r\n isSyncing = false;\r\n }\r\n }\r\n\r\n // Event listeners for map1\r\n map1.on('move', () => {\r\n syncMap(map1, map2);\r\n });\r\n\r\n // Event listeners for map2\r\n map2.on('move', () => {\r\n syncMap(map2, map1);\r\n });\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const { height, width, mapStyles, center, zoomLevel, mapLegend } = props;\r\n const [position, setPosition] = useState(50);\r\n const [isDragging, setIsDragging] = useState(false);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const [showLegend, setShowLegend] = useState(true);\r\n const dragStartPositionRef = useRef(50);\r\n const sliderWidthRef = useRef(0);\r\n\r\n const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 0 } }));\r\n\r\n const handleDragStart = () => {\r\n setIsDragging(true);\r\n dragStartPositionRef.current = position;\r\n\r\n if (containerRef.current) {\r\n sliderWidthRef.current = containerRef.current.getBoundingClientRect().width;\r\n }\r\n };\r\n\r\n const handleDragMove = (event: DragMoveEvent) => {\r\n if (!containerRef.current || sliderWidthRef.current === 0) return;\r\n\r\n // Calculate position change as percentage of width\r\n const deltaPercentage = (event.delta.x / sliderWidthRef.current) * 100;\r\n const newPosition = Math.max(0, Math.min(100, dragStartPositionRef.current + deltaPercentage));\r\n\r\n setPosition(newPosition);\r\n };\r\n\r\n const handleDragEnd = () => {\r\n setIsDragging(false);\r\n };\r\n\r\n const handleClick = (e: React.MouseEvent) => {\r\n if (isDragging || !containerRef.current) return;\r\n\r\n const rect = containerRef.current.getBoundingClientRect();\r\n const clickX = e.clientX - rect.left;\r\n const newPosition = (clickX / rect.width) * 100;\r\n\r\n setPosition(Math.max(0, Math.min(100, newPosition)));\r\n };\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const leftMapRef = useRef<HTMLDivElement>(null);\r\n const rightMapRef = useRef<HTMLDivElement>(null);\r\n const mapContainer = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n if (mapContainer.current && leftMapRef.current && rightMapRef.current && width) {\r\n const mapDiv = select(mapContainer.current);\r\n mapDiv.selectAll('.maplibregl-compare').remove();\r\n const leftMapDiv = select(leftMapRef.current);\r\n leftMapDiv.selectAll('div').remove();\r\n const rightMapDiv = select(rightMapRef.current);\r\n rightMapDiv.selectAll('div').remove();\r\n const protocol = new pmtiles.Protocol();\r\n maplibreGl.addProtocol('pmtiles', protocol.tile);\r\n const leftMap = new maplibreGl.Map({\r\n container: leftMapRef.current,\r\n style: mapStyles[0],\r\n center: center || [0, 0],\r\n zoom: zoomLevel || 4,\r\n });\r\n\r\n const rightMap = new maplibreGl.Map({\r\n container: rightMapRef.current,\r\n style: mapStyles[1],\r\n center: center || [0, 0],\r\n zoom: zoomLevel || 4,\r\n });\r\n rightMap.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n leftMap.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n leftMap.addControl(\r\n new maplibreGl.NavigationControl({\r\n visualizePitch: true,\r\n showZoom: true,\r\n showCompass: true,\r\n }),\r\n 'bottom-right',\r\n );\r\n rightMap.addControl(new maplibreGl.ScaleControl(), 'bottom-left');\r\n synchronizeMap(leftMap, rightMap);\r\n }\r\n }, [width, mapStyles, center, zoomLevel]);\r\n return (\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 <div\r\n style={{\r\n width,\r\n height,\r\n }}\r\n >\r\n <div\r\n ref={mapContainer}\r\n className='map maplibre-show-control relative w-full h-full'\r\n style={{ inset: 0 }}\r\n >\r\n <DndContext\r\n sensors={sensors}\r\n modifiers={[restrictToHorizontalAxis]}\r\n onDragStart={handleDragStart}\r\n onDragMove={handleDragMove}\r\n onDragEnd={handleDragEnd}\r\n >\r\n <div\r\n ref={containerRef}\r\n style={{\r\n position: 'relative',\r\n width,\r\n height,\r\n overflow: 'hidden',\r\n cursor: isDragging ? 'grabbing' : 'col-resize',\r\n userSelect: 'none', // Prevent text selection during drag\r\n }}\r\n onClick={handleClick}\r\n >\r\n <div\r\n ref={rightMapRef}\r\n className='absolute h-full rightMap w-full'\r\n style={{\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n clipPath: `polygon(${position}% 0%, ${position}% 100%, 100% 100%, 100% 0%)`,\r\n }}\r\n />\r\n <div\r\n ref={leftMapRef}\r\n className='absolute h-full leftMap w-full'\r\n style={{\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n inset: 0,\r\n clipPath: `polygon(0% 0%, ${position}% 0%, ${position}% 100%, 0% 100%)`,\r\n }}\r\n />\r\n\r\n <SliderHandle position={position} />\r\n </div>\r\n </DndContext>\r\n </div>\r\n </div>\r\n {mapLegend ? (\r\n <div className='absolute left-[22px] bottom-13'>\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 dangerouslySetInnerHTML={\r\n typeof mapLegend === 'string' ? { __html: string2HTML(mapLegend) } : undefined\r\n }\r\n >\r\n {React.isValidElement(mapLegend) ? mapLegend : null}\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 ) : null}\r\n </div>\r\n );\r\n}\r\n\r\ninterface HandleProps {\r\n position: number;\r\n}\r\n\r\nfunction SliderHandle(props: HandleProps) {\r\n const { position } = props;\r\n const { attributes, listeners, setNodeRef } = useDraggable({ id: 'slider-handle' });\r\n\r\n return (\r\n <div\r\n ref={setNodeRef}\r\n style={{\r\n position: 'absolute',\r\n left: `${position}%`,\r\n top: 0,\r\n bottom: 0,\r\n width: '40px',\r\n transform: 'translateX(-50%)',\r\n cursor: 'col-resize',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n zIndex: 10,\r\n touchAction: 'none',\r\n }}\r\n {...listeners}\r\n {...attributes}\r\n >\r\n <div\r\n className='h-full bg-primary-blue-600 dark:bg-primary-blue-400'\r\n style={{ width: '2px' }}\r\n />\r\n <div\r\n className='flex bg-primary-blue-600 dark:bg-primary-blue-400 rounded-full absolute items-center justify-center text-primary-white font-primary-white'\r\n style={{\r\n boxShadow: 'inset 0 0 0 1px #fff',\r\n width: '42px',\r\n height: '42px',\r\n top: 'calc(50% - 21px)',\r\n left: '0',\r\n cursor: 'col-resize',\r\n }}\r\n >\r\n <ChevronLeftRight />\r\n </div>\r\n </div>\r\n );\r\n}\r\n","import { useRef, useEffect, useState } from 'react';\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 { ClassNameObject, Languages, SourcesDataType, StyleObject } from '@/Types';\r\n\r\ninterface Props {\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 /** 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 /** URLs for mapStyles JSON user wants to compare */\r\n mapStyles: [string, string];\r\n /** Defines the legend for the map. mapLegend with type string is show as innerHTML. */\r\n mapLegend?: string | React.ReactNode;\r\n /** Starting center point of the map */\r\n center?: [number, number];\r\n /** Starting zoom level of the map */\r\n zoomLevel?: number;\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 [`maplibre`](https://maplibre.org/maplibre-gl-js/docs/#npm), [pmtiles](https://www.npmjs.com/package/pmtiles), [dnd-kit/core](https://www.npmjs.com/package/@dnd-kit/core), and [dnd-kit/modifier](https://www.npmjs.com/package/@dnd-kit/modifiers) package to your project */\r\nexport function GeoHubCompareMaps(props: Props) {\r\n const {\r\n graphTitle,\r\n height,\r\n width,\r\n relativeHeight,\r\n sources,\r\n graphDescription,\r\n footNote,\r\n padding,\r\n backgroundColor = false,\r\n graphID,\r\n mapStyles,\r\n center = [0, 0],\r\n zoomLevel = 3,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n styles,\r\n classNames,\r\n mapLegend,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\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 || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\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 comparison between two maps.${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 ? (\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 />\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) ? (\r\n <Graph\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 mapStyles={mapStyles}\r\n center={center}\r\n zoomLevel={zoomLevel}\r\n mapLegend={mapLegend}\r\n />\r\n ) : null}\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":["synchronizeMap","map1","map2","isSyncing","syncMap","sourceMap","targetMap","center","zoom","bearing","pitch","Graph","props","height","width","mapStyles","zoomLevel","mapLegend","position","setPosition","useState","isDragging","setIsDragging","containerRef","useRef","showLegend","setShowLegend","dragStartPositionRef","sliderWidthRef","sensors","useSensors","useSensor","PointerSensor","handleDragStart","handleDragMove","event","deltaPercentage","newPosition","handleDragEnd","handleClick","e","rect","graphDiv","leftMapRef","rightMapRef","mapContainer","useEffect","select","protocol","pmtiles","maplibreGl","leftMap","rightMap","jsxs","jsx","DndContext","restrictToHorizontalAxis","SliderHandle","Fragment","X","string2HTML","React","attributes","listeners","setNodeRef","useDraggable","ChevronLeftRight","GeoHubCompareMaps","graphTitle","relativeHeight","sources","graphDescription","footNote","padding","backgroundColor","graphID","language","minHeight","theme","ariaLabel","styles","classNames","svgWidth","setSvgWidth","svgHeight","setSvgHeight","resizeObserver","entries","cn","GraphHeader","GraphFooter"],"mappings":"qvBA4BA,SAASA,EAAeC,EAAsBC,EAAsB,CAClE,IAAIC,EAAY,GAChB,SAASC,EAAQC,EAA2BC,EAA2B,CACrE,GAAI,CAACH,EAAW,CACdA,EAAY,GACZ,MAAMI,EAASF,EAAU,UAAA,EACnBG,EAAOH,EAAU,QAAA,EACjBI,EAAUJ,EAAU,WAAA,EACpBK,EAAQL,EAAU,SAAA,EACxBC,EAAU,OAAO,CACf,OAAAC,EACA,KAAAC,EACA,QAAAC,EACA,MAAAC,CAAA,CACD,EACDP,EAAY,EACd,CACF,CAGAF,EAAK,GAAG,OAAQ,IAAM,CACpBG,EAAQH,EAAMC,CAAI,CACpB,CAAC,EAGDA,EAAK,GAAG,OAAQ,IAAM,CACpBE,EAAQF,EAAMD,CAAI,CACpB,CAAC,CACH,CAEO,SAASU,EAAMC,EAAc,CAClC,KAAM,CAAE,OAAAC,EAAQ,MAAAC,EAAO,UAAAC,EAAW,OAAAR,EAAQ,UAAAS,EAAW,UAAAC,GAAcL,EAC7D,CAACM,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAE,EACrC,CAACC,EAAYC,CAAa,EAAIF,E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AAAA,KAAC,MAAA,CAAI,UAAU,kDACZ,SAAA,CAAAe,GAAcG,EACbjB,EAAAA,kBAAAA,IAACmC,EAAAA,YAAA,CACC,OAAQ,CACN,MAAOT,GAAQ,MACf,YAAaA,GAAQ,WAAA,EAEvB,WAAY,CACV,MAAOC,GAAY,MACnB,YAAaA,GAAY,WAAA,EAE3B,WAAAb,EACA,iBAAAG,EACA,MAAAzD,CAAA,CAAA,EAEA,KACJwC,EAAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,8CACV,IAAKZ,EACL,aAAW,WAET,UAAA5B,GAASoE,KAAcrE,GAAUuE,GACjC9B,EAAAA,kBAAAA,IAAC3C,EAAA,CACC,MAAOG,GAASoE,EAChB,OAAQ,KAAK,IACXL,EACAhE,IACGwD,EACGQ,GACG/D,GAASoE,GAAYb,EAAiBQ,GACpC/D,GAASoE,GAAYb,EACtBQ,GACD/D,GAASoE,GAAYb,EACxBe,EAAA,EAER,UAAArE,EACA,OAAAR,EACA,UAAAS,EACA,UAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,EAELqD,GAAWE,EACVlB,EAAAA,kBAAAA,IAACoC,EAAAA,YAAA,CACC,OAAQ,CAAE,SAAUV,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAAX,EACA,SAAAE,EACA,MAAA1D,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
@@ -1,11 +1,11 @@
1
- import { j as e, m as A } from "./index-CHPV5EwG-BPSP-7Jg.js";
2
- import E, { useState as N, useRef as p, useEffect as I } from "react";
1
+ import { j as e, m as E } from "./index-CHPV5EwG-DBWUSD9b.js";
2
+ import G, { useState as M, useRef as p, useEffect as A } from "react";
3
3
  import * as w from "maplibre-gl";
4
- import * as G from "pmtiles";
4
+ import * as I from "pmtiles";
5
5
  /* empty css */
6
6
  import { useSensors as W, useSensor as X, PointerSensor as _, DndContext as B, useDraggable as Z } from "@dnd-kit/core";
7
7
  import { restrictToHorizontalAxis as F } from "@dnd-kit/modifiers";
8
- import { X as O, C as V } from "./index-BmCqpO1B.js";
8
+ import { X as O, C as V } from "./index-zZjQEHlm.js";
9
9
  import { s as q } from "./string2HTML-oFCROsus.js";
10
10
  import { s as T } from "./select-DKy99ogv.js";
11
11
  import { GraphHeader as J } from "./GraphHeader.js";
@@ -15,10 +15,10 @@ function Q(c, n) {
15
15
  function t(o, d) {
16
16
  if (!r) {
17
17
  r = !0;
18
- const i = o.getCenter(), s = o.getZoom(), h = o.getBearing(), l = o.getPitch();
18
+ const s = o.getCenter(), i = o.getZoom(), h = o.getBearing(), l = o.getPitch();
19
19
  d.jumpTo({
20
- center: i,
21
- zoom: s,
20
+ center: s,
21
+ zoom: i,
22
22
  bearing: h,
23
23
  pitch: l
24
24
  }), r = !1;
@@ -31,25 +31,25 @@ function Q(c, n) {
31
31
  });
32
32
  }
33
33
  function U(c) {
34
- const { height: n, width: r, mapStyles: t, center: o, zoomLevel: d, mapLegend: i } = c, [s, h] = N(50), [l, D] = N(!1), u = p(null), [k, S] = N(!0), j = p(50), m = p(0), z = W(X(_, { activationConstraint: { distance: 0 } })), P = () => {
35
- D(!0), j.current = s, u.current && (m.current = u.current.getBoundingClientRect().width);
34
+ const { height: n, width: r, mapStyles: t, center: o, zoomLevel: d, mapLegend: s } = c, [i, h] = M(50), [l, D] = M(!1), g = p(null), [k, S] = M(!0), j = p(50), u = p(0), z = W(X(_, { activationConstraint: { distance: 0 } })), P = () => {
35
+ D(!0), j.current = i, g.current && (u.current = g.current.getBoundingClientRect().width);
36
36
  }, f = (a) => {
37
- if (!u.current || m.current === 0) return;
38
- const g = a.delta.x / m.current * 100, M = Math.max(0, Math.min(100, j.current + g));
39
- h(M);
40
- }, x = () => {
37
+ if (!g.current || u.current === 0) return;
38
+ const m = a.delta.x / u.current * 100, N = Math.max(0, Math.min(100, j.current + m));
39
+ h(N);
40
+ }, b = () => {
41
41
  D(!1);
42
- }, R = (a) => {
43
- if (l || !u.current) return;
44
- const g = u.current.getBoundingClientRect(), $ = (a.clientX - g.left) / g.width * 100;
45
- h(Math.max(0, Math.min(100, $)));
46
- }, b = p(null), v = p(null), y = p(null), C = p(null);
47
- return I(() => {
42
+ }, $ = (a) => {
43
+ if (l || !g.current) return;
44
+ const m = g.current.getBoundingClientRect(), H = (a.clientX - m.left) / m.width * 100;
45
+ h(Math.max(0, Math.min(100, H)));
46
+ }, x = p(null), v = p(null), y = p(null), C = p(null);
47
+ return A(() => {
48
48
  if (C.current && v.current && y.current && r) {
49
49
  T(C.current).selectAll(".maplibregl-compare").remove(), T(v.current).selectAll("div").remove(), T(y.current).selectAll("div").remove();
50
- const $ = new G.Protocol();
51
- w.addProtocol("pmtiles", $.tile);
52
- const H = new w.Map({
50
+ const H = new I.Protocol();
51
+ w.addProtocol("pmtiles", H.tile);
52
+ const R = new w.Map({
53
53
  container: v.current,
54
54
  style: t[0],
55
55
  center: o || [0, 0],
@@ -67,20 +67,20 @@ function U(c) {
67
67
  showCompass: !0
68
68
  }),
69
69
  "bottom-right"
70
- ), H.addControl(new w.ScaleControl(), "bottom-left"), H.addControl(
70
+ ), R.addControl(new w.ScaleControl(), "bottom-left"), R.addControl(
71
71
  new w.NavigationControl({
72
72
  visualizePitch: !0,
73
73
  showZoom: !0,
74
74
  showCompass: !0
75
75
  }),
76
76
  "bottom-right"
77
- ), L.addControl(new w.ScaleControl(), "bottom-left"), Q(H, L);
77
+ ), L.addControl(new w.ScaleControl(), "bottom-left"), Q(R, L);
78
78
  }
79
79
  }, [r, t, o, d]), /* @__PURE__ */ e.jsxs(
80
80
  "div",
81
81
  {
82
82
  className: "flex flex-col grow justify-center leading-0",
83
- ref: b,
83
+ ref: x,
84
84
  "aria-label": "Map area",
85
85
  children: [
86
86
  /* @__PURE__ */ e.jsx(
@@ -103,11 +103,11 @@ function U(c) {
103
103
  modifiers: [F],
104
104
  onDragStart: P,
105
105
  onDragMove: f,
106
- onDragEnd: x,
106
+ onDragEnd: b,
107
107
  children: /* @__PURE__ */ e.jsxs(
108
108
  "div",
109
109
  {
110
- ref: u,
110
+ ref: g,
111
111
  style: {
112
112
  position: "relative",
113
113
  width: r,
@@ -117,7 +117,7 @@ function U(c) {
117
117
  userSelect: "none"
118
118
  // Prevent text selection during drag
119
119
  },
120
- onClick: R,
120
+ onClick: $,
121
121
  children: [
122
122
  /* @__PURE__ */ e.jsx(
123
123
  "div",
@@ -128,7 +128,7 @@ function U(c) {
128
128
  position: "absolute",
129
129
  top: 0,
130
130
  left: 0,
131
- clipPath: `polygon(${s}% 0%, ${s}% 100%, 100% 100%, 100% 0%)`
131
+ clipPath: `polygon(${i}% 0%, ${i}% 100%, 100% 100%, 100% 0%)`
132
132
  }
133
133
  }
134
134
  ),
@@ -142,11 +142,11 @@ function U(c) {
142
142
  top: 0,
143
143
  left: 0,
144
144
  inset: 0,
145
- clipPath: `polygon(0% 0%, ${s}% 0%, ${s}% 100%, 0% 100%)`
145
+ clipPath: `polygon(0% 0%, ${i}% 0%, ${i}% 100%, 0% 100%)`
146
146
  }
147
147
  }
148
148
  ),
149
- /* @__PURE__ */ e.jsx(Y, { position: s })
149
+ /* @__PURE__ */ e.jsx(Y, { position: i })
150
150
  ]
151
151
  }
152
152
  )
@@ -156,23 +156,11 @@ function U(c) {
156
156
  )
157
157
  }
158
158
  ),
159
- i ? /* @__PURE__ */ e.jsx("div", { className: "absolute left-[22px] bottom-13", children: k ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
159
+ s ? /* @__PURE__ */ e.jsx("div", { className: "absolute left-[22px] bottom-13", children: k ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
160
160
  /* @__PURE__ */ e.jsx(
161
161
  "div",
162
162
  {
163
- style: {
164
- backgroundColor: "rgba(240,240,240, 0.7)",
165
- border: "1px solid var(--gray-400)",
166
- borderRadius: "999px",
167
- width: "24px",
168
- height: "24px",
169
- padding: "3px",
170
- cursor: "pointer",
171
- zIndex: 10,
172
- position: "absolute",
173
- right: "-0.75rem",
174
- top: "-0.75rem"
175
- },
163
+ 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]",
176
164
  onClick: () => {
177
165
  S(!1);
178
166
  },
@@ -182,12 +170,9 @@ function U(c) {
182
170
  /* @__PURE__ */ e.jsx(
183
171
  "div",
184
172
  {
185
- className: "p-2",
186
- style: {
187
- backgroundColor: "rgba(240,240,240, 0.7)"
188
- },
189
- dangerouslySetInnerHTML: typeof i == "string" ? { __html: q(i) } : void 0,
190
- children: E.isValidElement(i) ? i : null
173
+ className: "color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",
174
+ dangerouslySetInnerHTML: typeof s == "string" ? { __html: q(s) } : void 0,
175
+ children: G.isValidElement(s) ? s : null
191
176
  }
192
177
  )
193
178
  ] }) : /* @__PURE__ */ e.jsx(
@@ -198,7 +183,7 @@ function U(c) {
198
183
  onClick: () => {
199
184
  S(!0);
200
185
  },
201
- children: /* @__PURE__ */ e.jsx("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", children: "Show Legend" })
186
+ children: /* @__PURE__ */ e.jsx("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", children: "Show Legend" })
202
187
  }
203
188
  ) }) : null
204
189
  ]
@@ -261,27 +246,27 @@ function de(c) {
261
246
  width: t,
262
247
  relativeHeight: o,
263
248
  sources: d,
264
- graphDescription: i,
265
- footNote: s,
249
+ graphDescription: s,
250
+ footNote: i,
266
251
  padding: h,
267
252
  backgroundColor: l = !1,
268
253
  graphID: D,
269
- mapStyles: u,
254
+ mapStyles: g,
270
255
  center: k = [0, 0],
271
256
  zoomLevel: S = 3,
272
257
  language: j = "en",
273
- minHeight: m = 0,
258
+ minHeight: u = 0,
274
259
  theme: z = "light",
275
260
  ariaLabel: P,
276
261
  styles: f,
277
- classNames: x,
278
- mapLegend: R
279
- } = c, [b, v] = N(0), [y, C] = N(0), a = p(null);
280
- return I(() => {
281
- const g = new ResizeObserver((M) => {
282
- v(t || M[0].target.clientWidth || 620), C(r || M[0].target.clientHeight || 480);
262
+ classNames: b,
263
+ mapLegend: $
264
+ } = c, [x, v] = M(0), [y, C] = M(0), a = p(null);
265
+ return A(() => {
266
+ const m = new ResizeObserver((N) => {
267
+ v(t || N[0].target.clientWidth || 620), C(r || N[0].target.clientHeight || 480);
283
268
  });
284
- return a.current && (C(a.current.clientHeight || 480), v(a.current.clientWidth || 620), t || g.observe(a.current)), () => g.disconnect();
269
+ return a.current && (C(a.current.clientHeight || 480), v(a.current.clientWidth || 620), t || m.observe(a.current)), () => m.disconnect();
285
270
  }, [t, r]), /* @__PURE__ */ e.jsx(
286
271
  "div",
287
272
  {
@@ -290,24 +275,24 @@ function de(c) {
290
275
  children: /* @__PURE__ */ e.jsx(
291
276
  "div",
292
277
  {
293
- className: A(
278
+ className: E(
294
279
  `${l ? l === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j || "en"}`,
295
280
  t ? "w-fit" : "w-full",
296
- x?.graphContainer
281
+ b?.graphContainer
297
282
  ),
298
283
  style: {
299
284
  ...f?.graphContainer || {},
300
285
  ...l && l !== !0 ? { backgroundColor: l } : {}
301
286
  },
302
287
  id: D,
303
- "aria-label": P || `${n ? `The graph shows ${n}. ` : ""}This is a comparison between two maps.${i ? ` ${i}` : ""}`,
288
+ "aria-label": P || `${n ? `The graph shows ${n}. ` : ""}This is a comparison between two maps.${s ? ` ${s}` : ""}`,
304
289
  children: /* @__PURE__ */ e.jsx(
305
290
  "div",
306
291
  {
307
292
  className: "flex grow",
308
293
  style: { padding: l ? h || "1rem" : h || 0 },
309
294
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
310
- n || i ? /* @__PURE__ */ e.jsx(
295
+ n || s ? /* @__PURE__ */ e.jsx(
311
296
  J,
312
297
  {
313
298
  styles: {
@@ -315,11 +300,11 @@ function de(c) {
315
300
  description: f?.description
316
301
  },
317
302
  classNames: {
318
- title: x?.title,
319
- description: x?.description
303
+ title: b?.title,
304
+ description: b?.description
320
305
  },
321
306
  graphTitle: n,
322
- graphDescription: i,
307
+ graphDescription: s,
323
308
  width: t
324
309
  }
325
310
  ) : null,
@@ -329,32 +314,32 @@ function de(c) {
329
314
  className: "flex flex-col grow justify-center leading-0",
330
315
  ref: a,
331
316
  "aria-label": "map area",
332
- children: (t || b) && (r || y) ? /* @__PURE__ */ e.jsx(
317
+ children: (t || x) && (r || y) ? /* @__PURE__ */ e.jsx(
333
318
  U,
334
319
  {
335
- width: t || b,
320
+ width: t || x,
336
321
  height: Math.max(
337
- m,
338
- r || (o ? m ? (t || b) * o > m ? (t || b) * o : m : (t || b) * o : y)
322
+ u,
323
+ r || (o ? u ? (t || x) * o > u ? (t || x) * o : u : (t || x) * o : y)
339
324
  ),
340
- mapStyles: u,
325
+ mapStyles: g,
341
326
  center: k,
342
327
  zoomLevel: S,
343
- mapLegend: R
328
+ mapLegend: $
344
329
  }
345
330
  ) : null
346
331
  }
347
332
  ),
348
- d || s ? /* @__PURE__ */ e.jsx(
333
+ d || i ? /* @__PURE__ */ e.jsx(
349
334
  K,
350
335
  {
351
336
  styles: { footnote: f?.footnote, source: f?.source },
352
337
  classNames: {
353
- footnote: x?.footnote,
354
- source: x?.source
338
+ footnote: b?.footnote,
339
+ source: b?.source
355
340
  },
356
341
  sources: d,
357
- footNote: s,
342
+ footNote: i,
358
343
  width: t
359
344
  }
360
345
  ) : null