@undp/data-viz 1.5.7 → 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.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +666 -664
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +223 -221
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +84 -82
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +133 -131
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +141 -121
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +307 -307
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +204 -184
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +172 -173
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +89 -78
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +186 -181
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +256 -244
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-CW7iViH2.js} +13 -12
- package/dist/RegressionLine-CW7iViH2.js.map +1 -0
- package/dist/RegressionLine-D-49RaHa.cjs +2 -0
- package/dist/RegressionLine-D-49RaHa.cjs.map +1 -0
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +145 -144
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +53 -48
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +137 -133
- package/dist/SlopeChart.js.map +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +307 -295
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +25 -26
- package/dist/UnitChart.js.map +1 -1
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as r } from "./index-CHPV5EwG-
|
|
2
|
-
import { u as e } from "./Typography-
|
|
3
|
-
import { A as t } from "./index-
|
|
1
|
+
import { j as r } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { u as e } from "./Typography-LmZ9LEpe.js";
|
|
3
|
+
import { A as t } from "./index-zZjQEHlm.js";
|
|
4
4
|
function s() {
|
|
5
5
|
return /* @__PURE__ */ r.jsxs("div", { className: "flex w-full flex-col justify-center grow items-center gap-2 p-6", children: [
|
|
6
6
|
/* @__PURE__ */ r.jsx(t, {}),
|
|
@@ -19,4 +19,4 @@ function s() {
|
|
|
19
19
|
export {
|
|
20
20
|
s as E
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=EmptyState-
|
|
22
|
+
//# sourceMappingURL=EmptyState-36lXXyui.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState-
|
|
1
|
+
{"version":3,"file":"EmptyState-36lXXyui.js","sources":["../src/Components/Elements/EmptyState.tsx"],"sourcesContent":["import { P } from '@undp/design-system-react/Typography';\r\n\r\nimport { Alert } from '@/Components/Icons';\r\n\r\nexport function EmptyState() {\r\n return (\r\n <div className='flex w-full flex-col justify-center grow items-center gap-2 p-6'>\r\n <Alert />\r\n <P\r\n marginBottom='none'\r\n leading='none'\r\n size='lg'\r\n className='text-primary-gray-550 dark:text-primary-gray-550'\r\n >\r\n No data available\r\n </P>\r\n </div>\r\n );\r\n}\r\n"],"names":["EmptyState","jsxs","jsx","Alert","P"],"mappings":";;;AAIO,SAASA,IAAa;AAC3B,SACEC,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAU,mEACb,UAAA;AAAA,IAAAC,gBAAAA,EAAAA,IAACC,GAAA,EAAM;AAAA,IACPD,gBAAAA,EAAAA;AAAAA,MAACE;AAAAA,MAAA;AAAA,QACC,cAAa;AAAA,QACb,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,WAAU;AAAA,QACX,UAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAED,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./index-CHPV5EwG-
|
|
2
|
-
//# sourceMappingURL=EmptyState-
|
|
1
|
+
"use strict";const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),t=require("./Typography-BDULiwlF.cjs"),r=require("./index-C0bpbS4F.cjs");function s(){return e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-col justify-center grow items-center gap-2 p-6",children:[e.jsxRuntimeExports.jsx(r.Alert,{}),e.jsxRuntimeExports.jsx(t.u,{marginBottom:"none",leading:"none",size:"lg",className:"text-primary-gray-550 dark:text-primary-gray-550",children:"No data available"})]})}exports.EmptyState=s;
|
|
2
|
+
//# sourceMappingURL=EmptyState-B8IpKGcL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState-
|
|
1
|
+
{"version":3,"file":"EmptyState-B8IpKGcL.cjs","sources":["../src/Components/Elements/EmptyState.tsx"],"sourcesContent":["import { P } from '@undp/design-system-react/Typography';\r\n\r\nimport { Alert } from '@/Components/Icons';\r\n\r\nexport function EmptyState() {\r\n return (\r\n <div className='flex w-full flex-col justify-center grow items-center gap-2 p-6'>\r\n <Alert />\r\n <P\r\n marginBottom='none'\r\n leading='none'\r\n size='lg'\r\n className='text-primary-gray-550 dark:text-primary-gray-550'\r\n >\r\n No data available\r\n </P>\r\n </div>\r\n );\r\n}\r\n"],"names":["EmptyState","jsxs","jsx","Alert","P"],"mappings":"uIAIO,SAASA,GAAa,CAC3B,OACEC,EAAAA,kBAAAA,KAAC,MAAA,CAAI,UAAU,kEACb,SAAA,CAAAC,EAAAA,kBAAAA,IAACC,EAAAA,MAAA,EAAM,EACPD,EAAAA,kBAAAA,IAACE,EAAAA,EAAA,CACC,aAAa,OACb,QAAQ,OACR,KAAK,KACL,UAAU,mDACX,SAAA,mBAAA,CAAA,CAED,EACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),t=require("./index-C0bpbS4F.cjs"),u=require("./excelDownload-BQpsCa62.cjs");function w(o){const{buttonContent:n,buttonType:a="tertiary",csvData:l,fileName:s="data",headers:r,xlsxHeader:i,wscols:c,buttonSmall:x,className:d=""}=o;return e.jsxRuntimeExports.jsx(t.d,{variant:a,className:`${x?"p-2":"py-4 px-6"} ${d}`,onClick:()=>u.excelDownload(l,s,r,i,c),"aria-label":"Click to download the data as xlsx",children:n||e.jsxRuntimeExports.jsx(t.FileDown,{})})}exports.ExcelDownloadButton=w;
|
|
2
2
|
//# sourceMappingURL=ExcelDownloadButton.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as a } from "./index-CHPV5EwG-
|
|
2
|
-
import { d as m, e as d } from "./index-
|
|
1
|
+
import { j as a } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { d as m, e as d } from "./index-zZjQEHlm.js";
|
|
3
3
|
import { e as p } from "./excelDownload-BOA-lskf.js";
|
|
4
4
|
function b(t) {
|
|
5
5
|
const {
|
package/dist/FootNote.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),i=require("./Typography-BDULiwlF.cjs"),s=require("react");function a(n){const{text:e,style:r={},className:o}=n;return typeof e=="string"?e.trim()===""?null:t.jsxRuntimeExports.jsx(i.u,{size:"sm",marginBottom:"none",className:t.mo("text-primary-gray-550 dark:text-primary-gray-40",o),"aria-label":"Graph footnote",style:r,children:e}):s.isValidElement(e)?t.jsxRuntimeExports.jsx("div",{className:o,style:r,children:e}):(console.error("FootNote: Invalid text type. Expected string or React element."),null)}exports.FootNote=a;
|
|
2
2
|
//# sourceMappingURL=FootNote.cjs.map
|
package/dist/FootNote.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as o, m as n } from "./index-CHPV5EwG-
|
|
2
|
-
import { u as a } from "./Typography-
|
|
1
|
+
import { j as o, m as n } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { u as a } from "./Typography-LmZ9LEpe.js";
|
|
3
3
|
import m from "react";
|
|
4
4
|
function u(i) {
|
|
5
5
|
const { text: t, style: r = {}, className: e } = i;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-
|
|
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,EAEzBK,EAAUC,aAAWC,EAAAA,UAAUC,EAAAA,cAAe,CAAE,qBAAsB,CAAE,SAAU,CAAA,CAAE,CAAG,CAAC,EAExFC,EAAkB,IAAM,CAC5BX,EAAc,EAAI,EAClBK,EAAqB,QAAUT,EAE3BK,EAAa,UACfK,EAAe,QAAUL,EAAa,QAA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3B,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,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,EAEzBK,EAAUC,aAAW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A,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
|
|
2
|
-
import
|
|
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
|
|
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-
|
|
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
|
|
18
|
+
const s = o.getCenter(), i = o.getZoom(), h = o.getBearing(), l = o.getPitch();
|
|
19
19
|
d.jumpTo({
|
|
20
|
-
center:
|
|
21
|
-
zoom:
|
|
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:
|
|
35
|
-
D(!0), j.current =
|
|
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 (!
|
|
38
|
-
const
|
|
39
|
-
h(
|
|
40
|
-
},
|
|
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
|
-
},
|
|
43
|
-
if (l || !
|
|
44
|
-
const
|
|
45
|
-
h(Math.max(0, Math.min(100,
|
|
46
|
-
},
|
|
47
|
-
return
|
|
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
|
|
51
|
-
w.addProtocol("pmtiles",
|
|
52
|
-
const
|
|
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
|
-
),
|
|
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(
|
|
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:
|
|
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:
|
|
106
|
+
onDragEnd: b,
|
|
107
107
|
children: /* @__PURE__ */ e.jsxs(
|
|
108
108
|
"div",
|
|
109
109
|
{
|
|
110
|
-
ref:
|
|
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:
|
|
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(${
|
|
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%, ${
|
|
145
|
+
clipPath: `polygon(0% 0%, ${i}% 0%, ${i}% 100%, 0% 100%)`
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
/* @__PURE__ */ e.jsx(Y, { position:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
187
|
-
|
|
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-
|
|
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:
|
|
265
|
-
footNote:
|
|
249
|
+
graphDescription: s,
|
|
250
|
+
footNote: i,
|
|
266
251
|
padding: h,
|
|
267
252
|
backgroundColor: l = !1,
|
|
268
253
|
graphID: D,
|
|
269
|
-
mapStyles:
|
|
254
|
+
mapStyles: g,
|
|
270
255
|
center: k = [0, 0],
|
|
271
256
|
zoomLevel: S = 3,
|
|
272
257
|
language: j = "en",
|
|
273
|
-
minHeight:
|
|
258
|
+
minHeight: u = 0,
|
|
274
259
|
theme: z = "light",
|
|
275
260
|
ariaLabel: P,
|
|
276
261
|
styles: f,
|
|
277
|
-
classNames:
|
|
278
|
-
mapLegend:
|
|
279
|
-
} = c, [
|
|
280
|
-
return
|
|
281
|
-
const
|
|
282
|
-
v(t ||
|
|
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 ||
|
|
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:
|
|
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
|
-
|
|
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.${
|
|
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 ||
|
|
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:
|
|
319
|
-
description:
|
|
303
|
+
title: b?.title,
|
|
304
|
+
description: b?.description
|
|
320
305
|
},
|
|
321
306
|
graphTitle: n,
|
|
322
|
-
graphDescription:
|
|
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 ||
|
|
317
|
+
children: (t || x) && (r || y) ? /* @__PURE__ */ e.jsx(
|
|
333
318
|
U,
|
|
334
319
|
{
|
|
335
|
-
width: t ||
|
|
320
|
+
width: t || x,
|
|
336
321
|
height: Math.max(
|
|
337
|
-
|
|
338
|
-
r || (o ?
|
|
322
|
+
u,
|
|
323
|
+
r || (o ? u ? (t || x) * o > u ? (t || x) * o : u : (t || x) * o : y)
|
|
339
324
|
),
|
|
340
|
-
mapStyles:
|
|
325
|
+
mapStyles: g,
|
|
341
326
|
center: k,
|
|
342
327
|
zoomLevel: S,
|
|
343
|
-
mapLegend:
|
|
328
|
+
mapLegend: $
|
|
344
329
|
}
|
|
345
330
|
) : null
|
|
346
331
|
}
|
|
347
332
|
),
|
|
348
|
-
d ||
|
|
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:
|
|
354
|
-
source:
|
|
338
|
+
footnote: b?.footnote,
|
|
339
|
+
source: b?.source
|
|
355
340
|
},
|
|
356
341
|
sources: d,
|
|
357
|
-
footNote:
|
|
342
|
+
footNote: i,
|
|
358
343
|
width: t
|
|
359
344
|
}
|
|
360
345
|
) : null
|