@undp/data-viz 2.1.8 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +19 -19
- package/dist/AreaChart.js.map +1 -1
- package/dist/{Axis-CRyfcLjc.js → Axis-DoOqnt6g.js} +2 -2
- package/dist/{Axis-CRyfcLjc.js.map → Axis-DoOqnt6g.js.map} +1 -1
- package/dist/{Axis-DxRV2yMi.cjs → Axis-Dtjn-EgM.cjs} +2 -2
- package/dist/{Axis-DxRV2yMi.cjs.map → Axis-Dtjn-EgM.cjs.map} +1 -1
- package/dist/{AxisTitle-sS5bLLR7.cjs → AxisTitle-DV4n0RxE.cjs} +2 -2
- package/dist/{AxisTitle-sS5bLLR7.cjs.map → AxisTitle-DV4n0RxE.cjs.map} +1 -1
- package/dist/{AxisTitle-jeI7am8o.js → AxisTitle-VFq89Olw.js} +2 -2
- package/dist/{AxisTitle-jeI7am8o.js.map → AxisTitle-VFq89Olw.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +24 -24
- 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 +14 -14
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +48 -48
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +22 -22
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +19 -19
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +51 -51
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +4 -4
- 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 +1 -16
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +13 -31
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +2 -20
- package/dist/CsvDownloadButton.cjs.map +1 -1
- package/dist/CsvDownloadButton.js +5 -26
- package/dist/CsvDownloadButton.js.map +1 -1
- package/dist/DataCards.cjs +1 -21
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +18 -42
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +6 -6
- package/dist/DataTable.js.map +1 -1
- package/dist/{DetailsModal-0Ry5nXiC.js → DetailsModal-BMCTgVsk.js} +4 -4
- package/dist/{DetailsModal-0Ry5nXiC.js.map → DetailsModal-BMCTgVsk.js.map} +1 -1
- package/dist/{DetailsModal-BN0HDFlV.cjs → DetailsModal-DHttOA80.cjs} +2 -2
- package/dist/{DetailsModal-BN0HDFlV.cjs.map → DetailsModal-DHttOA80.cjs.map} +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +22 -22
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +10 -10
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +1 -1
- package/dist/DotDensityMap.js +78 -78
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-BbdPQa2k.js → DropdownSelect-D8rFbygC.js} +5 -33
- package/dist/{DropdownSelect-BbdPQa2k.js.map → DropdownSelect-D8rFbygC.js.map} +1 -1
- package/dist/{DropdownSelect-Doz3mCrM.cjs → DropdownSelect-NNpOs7DX.cjs} +2 -26
- package/dist/{DropdownSelect-Doz3mCrM.cjs.map → DropdownSelect-NNpOs7DX.cjs.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +15 -15
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +22 -22
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-gLDRXBHm.cjs → EmptyState-CGeBqbmR.cjs} +2 -2
- package/dist/{EmptyState-gLDRXBHm.cjs.map → EmptyState-CGeBqbmR.cjs.map} +1 -1
- package/dist/EmptyState-tZBErBKF.js +15 -0
- package/dist/{EmptyState-C7ZXkZWd.js.map → EmptyState-tZBErBKF.js.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.js +13 -13
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.js +8 -8
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +12 -12
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/{GraphContainer-d8A46BK2.cjs → GraphContainer-B1EDxJ0S.cjs} +2 -2
- package/dist/{GraphContainer-d8A46BK2.cjs.map → GraphContainer-B1EDxJ0S.cjs.map} +1 -1
- package/dist/{GraphContainer-CRqzdKu2.js → GraphContainer-CF6ws3pd.js} +2 -2
- package/dist/{GraphContainer-CRqzdKu2.js.map → GraphContainer-CF6ws3pd.js.map} +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/GraphEl-CBZdcvb7.cjs +2 -0
- package/dist/GraphEl-CBZdcvb7.cjs.map +1 -0
- package/dist/{GraphEl-Dyu_EIQb.js → GraphEl-DKrjuQNB.js} +79 -18
- package/dist/GraphEl-DKrjuQNB.js.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +2 -2
- 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 -1
- package/dist/GriddedGraphs.js +8 -8
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -1
- package/dist/GriddedGraphsFromConfig.js +4 -4
- package/dist/GriddedGraphsFromConfig.js.map +1 -1
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +14 -14
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +5 -5
- package/dist/Histogram.js.map +1 -1
- package/dist/HybridMap.cjs +1 -1
- package/dist/HybridMap.cjs.map +1 -1
- package/dist/HybridMap.js +134 -133
- package/dist/HybridMap.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +3 -3
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +18 -18
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-JW_IExO3.cjs → Modal-CaYa_TLE.cjs} +2 -2
- package/dist/{Modal-JW_IExO3.cjs.map → Modal-CaYa_TLE.cjs.map} +1 -1
- package/dist/{Modal-bMQA6bL_.js → Modal-Ch9wvKxF.js} +4 -4
- package/dist/{Modal-bMQA6bL_.js.map → Modal-Ch9wvKxF.js.map} +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -1
- package/dist/MultiGraphDashboard.js +5 -5
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/MultiGraphDashboardFromConfig.js +4 -4
- package/dist/MultiGraphDashboardFromConfig.js.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +5 -5
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +17 -17
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +19 -19
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +15 -15
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +5 -5
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +4 -4
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js.map +1 -1
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -1
- package/dist/PerformanceIntensiveScrollStory.js +6 -6
- package/dist/PerformanceIntensiveScrollStory.js.map +1 -1
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +9 -9
- package/dist/{ReferenceLine-2XCwHXQ4.js → ReferenceLine-DgtoRgw0.js} +5 -5
- package/dist/ReferenceLine-DgtoRgw0.js.map +1 -0
- package/dist/{ReferenceLine-BH0qdf4R.cjs → ReferenceLine-M9aP3dj-.cjs} +2 -2
- package/dist/{ReferenceLine-BH0qdf4R.cjs.map → ReferenceLine-M9aP3dj-.cjs.map} +1 -1
- package/dist/{RegressionLine-BOTTNSrr.cjs → RegressionLine-Ci-Dh0w0.cjs} +2 -2
- package/dist/{RegressionLine-BOTTNSrr.cjs.map → RegressionLine-Ci-Dh0w0.cjs.map} +1 -1
- package/dist/{RegressionLine-DAcY2DjT.js → RegressionLine-D2aqeBKp.js} +6 -6
- package/dist/RegressionLine-D2aqeBKp.js.map +1 -0
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.js +61 -67
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +23 -23
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -1
- package/dist/ScrollStory.js +4 -4
- package/dist/ScrollStory.js.map +1 -1
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +19 -19
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -1
- package/dist/SingleGraphDashboard.js +9 -9
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -1
- package/dist/SingleGraphDashboardFromConfig.js +4 -4
- package/dist/SingleGraphDashboardFromConfig.js.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.js +5 -5
- package/dist/SingleGraphDashboardGeoHubMaps.js.map +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +4 -4
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.js +63 -70
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +4 -4
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js.map +1 -1
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +12 -12
- package/dist/SlopeChart.js.map +1 -1
- package/dist/{Source-DYMJRrsq.cjs → Source-B5AoSlsi.cjs} +2 -2
- package/dist/{Source-DYMJRrsq.cjs.map → Source-B5AoSlsi.cjs.map} +1 -1
- package/dist/{Source-DwTHB8fn.js → Source-F8EYCYkV.js} +4 -4
- package/dist/{Source-DwTHB8fn.js.map → Source-F8EYCYkV.js.map} +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +3 -3
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +8 -8
- package/dist/SparkLine.js.map +1 -1
- package/dist/{Spinner-DVBnY6Vg.js → Spinner--r2RrJV8.js} +2 -2
- package/dist/{Spinner-DVBnY6Vg.js.map → Spinner--r2RrJV8.js.map} +1 -1
- package/dist/{Spinner-CQZcjzwd.cjs → Spinner-jTMOLuw_.cjs} +2 -2
- package/dist/{Spinner-CQZcjzwd.cjs.map → Spinner-jTMOLuw_.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.js +10 -10
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.js +13 -13
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +3 -3
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
- package/dist/{Tooltip-uUdw6wJL.cjs → Tooltip-BLa2EfMs.cjs} +2 -2
- package/dist/{Tooltip-uUdw6wJL.cjs.map → Tooltip-BLa2EfMs.cjs.map} +1 -1
- package/dist/{Tooltip-Dj5eVppQ.js → Tooltip-BRnAz2Gv.js} +3 -3
- package/dist/{Tooltip-Dj5eVppQ.js.map → Tooltip-BRnAz2Gv.js.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +10 -10
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +8 -1
- package/dist/{Typography-PxtFcnJb.js → Typography-hWfh3H0J.js} +2 -2
- package/dist/{Typography-PxtFcnJb.js.map → Typography-hWfh3H0J.js.map} +1 -1
- package/dist/{Typography-DX7PlgQU.cjs → Typography-sa1UE0oF.cjs} +2 -2
- package/dist/{Typography-DX7PlgQU.cjs.map → Typography-sa1UE0oF.cjs.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +8 -8
- package/dist/WaterfallChart.cjs +2 -0
- package/dist/WaterfallChart.cjs.map +1 -0
- package/dist/WaterfallChart.d.ts +208 -0
- package/dist/WaterfallChart.js +427 -0
- package/dist/WaterfallChart.js.map +1 -0
- package/dist/{XAxesLabels-Bt5NZBmX.cjs → XAxesLabels-C6o9jJal.cjs} +2 -2
- package/dist/{XAxesLabels-Bt5NZBmX.cjs.map → XAxesLabels-C6o9jJal.cjs.map} +1 -1
- package/dist/{XAxesLabels-Dy8E1SEo.js → XAxesLabels-rhK7lRjO.js} +3 -3
- package/dist/{XAxesLabels-Dy8E1SEo.js.map → XAxesLabels-rhK7lRjO.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CObVFSm4.js → XTicksAndGridLines-CVZkZkpS.js} +2 -2
- package/dist/{XTicksAndGridLines-CObVFSm4.js.map → XTicksAndGridLines-CVZkZkpS.js.map} +1 -1
- package/dist/{XTicksAndGridLines-B6CELS7q.cjs → XTicksAndGridLines-CekrPykD.cjs} +2 -2
- package/dist/{XTicksAndGridLines-B6CELS7q.cjs.map → XTicksAndGridLines-CekrPykD.cjs.map} +1 -1
- package/dist/{YAxesLabels-DesLesUP.cjs → YAxesLabels-BQ2aCazV.cjs} +2 -2
- package/dist/{YAxesLabels-DesLesUP.cjs.map → YAxesLabels-BQ2aCazV.cjs.map} +1 -1
- package/dist/{YAxesLabels-a57ZRv-0.js → YAxesLabels-QICWVsHf.js} +3 -3
- package/dist/{YAxesLabels-a57ZRv-0.js.map → YAxesLabels-QICWVsHf.js.map} +1 -1
- package/dist/{YTicksAndGridLines-Blepl7XF.js → YTicksAndGridLines-GnXnSRF2.js} +2 -2
- package/dist/{YTicksAndGridLines-Blepl7XF.js.map → YTicksAndGridLines-GnXnSRF2.js.map} +1 -1
- package/dist/{YTicksAndGridLines-4pxTRlRK.cjs → YTicksAndGridLines-UzVC5eBM.cjs} +2 -2
- package/dist/{YTicksAndGridLines-4pxTRlRK.cjs.map → YTicksAndGridLines-UzVC5eBM.cjs.map} +1 -1
- package/dist/{band-DHUZ2X7J.js → band-DYty33LD.js} +2 -2
- package/dist/{band-DHUZ2X7J.js.map → band-DYty33LD.js.map} +1 -1
- package/dist/{checkIfMultiple-CIRtG0KE.js → checkIfMultiple-D9fVkeOq.js} +7 -19
- package/dist/{checkIfMultiple-CIRtG0KE.js.map → checkIfMultiple-D9fVkeOq.js.map} +1 -1
- package/dist/checkIfMultiple-DxnGtm3t.cjs +2 -0
- package/dist/{checkIfMultiple-wg6hJLXy.cjs.map → checkIfMultiple-DxnGtm3t.cjs.map} +1 -1
- package/dist/{customArea-BUhPiPT6.js → customArea-ASDaSE4u.js} +5 -5
- package/dist/{customArea-BUhPiPT6.js.map → customArea-ASDaSE4u.js.map} +1 -1
- package/dist/{customArea-CMF5g-C3.cjs → customArea-B1LWQBmM.cjs} +2 -2
- package/dist/{customArea-CMF5g-C3.cjs.map → customArea-B1LWQBmM.cjs.map} +1 -1
- package/dist/defaultLocale-C4wbwF1n.cjs +2 -0
- package/dist/defaultLocale-C4wbwF1n.cjs.map +1 -0
- package/dist/defaultLocale-CPy_WVtp.js +172 -0
- package/dist/defaultLocale-CPy_WVtp.js.map +1 -0
- package/dist/{ensureCompleteData-DH5c52Ub.js → ensureCompleteData-CDIukSG6.js} +2 -2
- package/dist/{ensureCompleteData-DH5c52Ub.js.map → ensureCompleteData-CDIukSG6.js.map} +1 -1
- package/dist/{ensureCompleteData-pZ9QO6kB.cjs → ensureCompleteData-D9bQTiVS.cjs} +2 -2
- package/dist/{ensureCompleteData-pZ9QO6kB.cjs.map → ensureCompleteData-D9bQTiVS.cjs.map} +1 -1
- package/dist/{fetchAndParseData-BpqkBPQL.js → fetchAndParseData-BAXhgTDM.js} +12 -18
- package/dist/{fetchAndParseData-BpqkBPQL.js.map → fetchAndParseData-BAXhgTDM.js.map} +1 -1
- package/dist/{fetchAndParseData-l5HGMAEs.cjs → fetchAndParseData-QTF6tjij.cjs} +3 -8
- package/dist/{fetchAndParseData-l5HGMAEs.cjs.map → fetchAndParseData-QTF6tjij.cjs.map} +1 -1
- package/dist/fetchAndParseData.cjs +1 -1
- package/dist/fetchAndParseData.js +1 -1
- package/dist/getCentroidCoordinates-CtBGrNC8.cjs +2 -0
- package/dist/getCentroidCoordinates-CtBGrNC8.cjs.map +1 -0
- package/dist/{getCentroidCoordinates-D7r34N4w.js → getCentroidCoordinates-s0OOUjLF.js} +15 -15
- package/dist/getCentroidCoordinates-s0OOUjLF.js.map +1 -0
- package/dist/{getGraphList-Dxwo9TDb.js → getGraphList-Bpd3PVmF.js} +7 -1
- package/dist/getGraphList-Bpd3PVmF.js.map +1 -0
- package/dist/getGraphList-DQ24IzAn.cjs +2 -0
- package/dist/getGraphList-DQ24IzAn.cjs.map +1 -0
- package/dist/{getJenks-GYmdwBqm.cjs → getJenks-BzJvhy_H.cjs} +2 -2
- package/dist/{getJenks-GYmdwBqm.cjs.map → getJenks-BzJvhy_H.cjs.map} +1 -1
- package/dist/{getJenks-BbngDoBQ.js → getJenks-DTCcQSDi.js} +2 -2
- package/dist/{getJenks-BbngDoBQ.js.map → getJenks-DTCcQSDi.js.map} +1 -1
- package/dist/getSchema.cjs +1 -1
- package/dist/getSchema.cjs.map +1 -1
- package/dist/getSchema.d.ts +3 -3
- package/dist/getSchema.js +24 -16
- package/dist/getSchema.js.map +1 -1
- package/dist/getSliderMarks-CIuSoedo.cjs +2 -0
- package/dist/{getSliderMarks-BmADcPQt.cjs.map → getSliderMarks-CIuSoedo.cjs.map} +1 -1
- package/dist/{getSliderMarks-HIDJ0_Cd.js → getSliderMarks-Cvg8zHBU.js} +4 -9
- package/dist/getSliderMarks-Cvg8zHBU.js.map +1 -0
- package/dist/{imageDownload-NYXbvKob.cjs → imageDownload-61q6jyJW.cjs} +3 -3
- package/dist/imageDownload-61q6jyJW.cjs.map +1 -0
- package/dist/{imageDownload-BU4qnxJP.js → imageDownload-Diofs_vY.js} +14 -15
- package/dist/imageDownload-Diofs_vY.js.map +1 -0
- package/dist/{index-D491FEn1.js → index-BQYOuXdl.js} +15 -15
- package/dist/{index-D491FEn1.js.map → index-BQYOuXdl.js.map} +1 -1
- package/dist/{index-DxXnJ8Ti.cjs → index-C5K--w8d.cjs} +2 -2
- package/dist/index-C5K--w8d.cjs.map +1 -0
- package/dist/{index-DRXx7m-C.cjs → index-C6er0ety.cjs} +2 -2
- package/dist/{index-DRXx7m-C.cjs.map → index-C6er0ety.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-CTPQjnHt.cjs → index-CHPV5EwG-6v2a2njQ.cjs} +5 -69
- package/dist/{index-CHPV5EwG-CTPQjnHt.cjs.map → index-CHPV5EwG-6v2a2njQ.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-Curnpaqc.js → index-CHPV5EwG-DecW7_qr.js} +5 -77
- package/dist/{index-CHPV5EwG-Curnpaqc.js.map → index-CHPV5EwG-DecW7_qr.js.map} +1 -1
- package/dist/{index-SKgJALZg.js → index-CSiFiXPj.js} +3 -3
- package/dist/{index-SKgJALZg.js.map → index-CSiFiXPj.js.map} +1 -1
- package/dist/index-CoobIWNj.cjs +10 -0
- package/dist/index-CoobIWNj.cjs.map +1 -0
- package/dist/index-CtMBjvtq.js +148 -0
- package/dist/index-CtMBjvtq.js.map +1 -0
- package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs → index-Cw8sCyo_-CEcCMKUi.cjs} +2 -2
- package/dist/{index-Cw8sCyo_-BrHiWiRF.cjs.map → index-Cw8sCyo_-CEcCMKUi.cjs.map} +1 -1
- package/dist/{index-Cw8sCyo_-B2hEKjzG.js → index-Cw8sCyo_-n4AacHGk.js} +6 -4
- package/dist/{index-Cw8sCyo_-B2hEKjzG.js.map → index-Cw8sCyo_-n4AacHGk.js.map} +1 -1
- package/dist/{index-R1gTfap5.js → index-D5ihtaJJ.js} +12 -12
- package/dist/{index-R1gTfap5.js.map → index-D5ihtaJJ.js.map} +1 -1
- package/dist/{index-B_sAFsEV.cjs → index-D69M6klB.cjs} +2 -2
- package/dist/{index-B_sAFsEV.cjs.map → index-D69M6klB.cjs.map} +1 -1
- package/dist/{index-GEsywGxz.js → index-DCsFBfJ_.js} +160 -104
- package/dist/index-DCsFBfJ_.js.map +1 -0
- package/dist/{index-WML2dCZ0.cjs → index-Dgjq6aZ2.cjs} +2 -2
- package/dist/{index-WML2dCZ0.cjs.map → index-Dgjq6aZ2.cjs.map} +1 -1
- package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs → index-Dzc_aaI9-C3DbPpy3.cjs} +2 -2
- package/dist/{index-Dzc_aaI9-BmkfPMyc.cjs.map → index-Dzc_aaI9-C3DbPpy3.cjs.map} +1 -1
- package/dist/{index-Dzc_aaI9-Bb7gobH_.js → index-Dzc_aaI9-CG2Ar7l1.js} +4 -4
- package/dist/{index-Dzc_aaI9-Bb7gobH_.js.map → index-Dzc_aaI9-CG2Ar7l1.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +209 -94
- package/dist/index.js +129 -127
- package/dist/index.js.map +1 -1
- package/dist/{linear-BqltdMeF.js → linear-CalFSAaO.js} +2 -2
- package/dist/{linear-BqltdMeF.js.map → linear-CalFSAaO.js.map} +1 -1
- package/dist/{linear-BwPAspcq.cjs → linear-CgUCbw9F.cjs} +2 -2
- package/dist/{linear-BwPAspcq.cjs.map → linear-CgUCbw9F.cjs.map} +1 -1
- package/dist/{ordinal-BJ6O_LC5.js → ordinal-CHaxGJ_l.js} +2 -2
- package/dist/{ordinal-BJ6O_LC5.js.map → ordinal-CHaxGJ_l.js.map} +1 -1
- package/dist/{parse-DlCRUFh_.js → parse-Dv4of-PN.js} +2 -67
- package/dist/{parse-DlCRUFh_.js.map → parse-Dv4of-PN.js.map} +1 -1
- package/dist/parse-xYI9yrvL.cjs +2 -0
- package/dist/{parse-hMnG_lRV.cjs.map → parse-xYI9yrvL.cjs.map} +1 -1
- package/dist/{pow-DgrUorRi.cjs → pow-BnyPO-NX.cjs} +2 -2
- package/dist/{pow-DgrUorRi.cjs.map → pow-BnyPO-NX.cjs.map} +1 -1
- package/dist/{pow-CM2aze4M.js → pow-CaIrlM4J.js} +2 -2
- package/dist/{pow-CM2aze4M.js.map → pow-CaIrlM4J.js.map} +1 -1
- package/dist/proxy-C4-uo6nS.cjs +2 -0
- package/dist/proxy-C4-uo6nS.cjs.map +1 -0
- package/dist/{proxy-BxkFHwUw.js → proxy-DRuSUlPL.js} +2828 -2717
- package/dist/proxy-DRuSUlPL.js.map +1 -0
- package/dist/{string2HTML-DhG75NqA.js → string2HTML-DUYZT1L9.js} +17 -17
- package/dist/{string2HTML-DhG75NqA.js.map → string2HTML-DUYZT1L9.js.map} +1 -1
- package/dist/{string2HTML-CPGr_I5E.cjs → string2HTML-xx9MzTtY.cjs} +3 -3
- package/dist/{string2HTML-CPGr_I5E.cjs.map → string2HTML-xx9MzTtY.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{time-BUL-dwnK.js → time-CAtex-RV.js} +2 -2
- package/dist/{time-BUL-dwnK.js.map → time-CAtex-RV.js.map} +1 -1
- package/dist/{time-CZd5YLSP.cjs → time-CkcKbhwe.cjs} +2 -2
- package/dist/{time-CZd5YLSP.cjs.map → time-CkcKbhwe.cjs.map} +1 -1
- package/dist/transformData.cjs +1 -1
- package/dist/transformData.d.ts +1 -1
- package/dist/transformData.js +3 -3
- package/dist/transformDataForAggregation-BFdha9Dx.cjs +2 -0
- package/dist/transformDataForAggregation-BFdha9Dx.cjs.map +1 -0
- package/dist/{transformDataForAggregation-j34UL73s.js → transformDataForAggregation-wdPf8bNt.js} +26 -11
- package/dist/transformDataForAggregation-wdPf8bNt.js.map +1 -0
- package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs → transformDataForGraphFromFile-DOhp1qrp.cjs} +2 -2
- package/dist/{transformDataForGraphFromFile-CuXxR8uA.cjs.map → transformDataForGraphFromFile-DOhp1qrp.cjs.map} +1 -1
- package/dist/{transformDataForGraphFromFile-DyP-83Nh.js → transformDataForGraphFromFile-dt9sHTVy.js} +3 -3
- package/dist/{transformDataForGraphFromFile-DyP-83Nh.js.map → transformDataForGraphFromFile-dt9sHTVy.js.map} +1 -1
- package/dist/{use-in-view-QcfiW0w3.cjs → use-in-view-C3o_ntMv.cjs} +2 -2
- package/dist/use-in-view-C3o_ntMv.cjs.map +1 -0
- package/dist/{use-in-view-Cxa7y1TH.js → use-in-view-Dl5L8LtP.js} +2 -2
- package/dist/use-in-view-Dl5L8LtP.js.map +1 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +4 -4
- package/dist/validateSchema.cjs +1 -1
- package/dist/validateSchema.d.ts +1 -1
- package/dist/validateSchema.js +1 -1
- package/dist/{x-BBpi7a_7-WVdj1j6r.js → x-BBpi7a_7-BsvWCzYM.js} +1 -31
- package/dist/{x-BBpi7a_7-WVdj1j6r.js.map → x-BBpi7a_7-BsvWCzYM.js.map} +1 -1
- package/dist/x-BBpi7a_7-DXYIEFwN.cjs +2 -0
- package/dist/{x-BBpi7a_7-mTo40uId.cjs.map → x-BBpi7a_7-DXYIEFwN.cjs.map} +1 -1
- package/dist/{zoom-C9MFjAaV.js → zoom-5AkJSuWO.js} +3 -3
- package/dist/zoom-5AkJSuWO.js.map +1 -0
- package/dist/{zoom-DPw8bba-.cjs → zoom-ChcvXFIz.cjs} +2 -2
- package/dist/zoom-ChcvXFIz.cjs.map +1 -0
- package/package.json +21 -1
- package/readme.md +33 -22
- package/dist/EmptyState-C7ZXkZWd.js +0 -15
- package/dist/GraphEl-BixTEyKW.cjs +0 -2
- package/dist/GraphEl-BixTEyKW.cjs.map +0 -1
- package/dist/GraphEl-Dyu_EIQb.js.map +0 -1
- package/dist/ReferenceLine-2XCwHXQ4.js.map +0 -1
- package/dist/RegressionLine-DAcY2DjT.js.map +0 -1
- package/dist/checkIfMultiple-wg6hJLXy.cjs +0 -12
- package/dist/defaultLocale-BEa-49Qz.js +0 -172
- package/dist/defaultLocale-BEa-49Qz.js.map +0 -1
- package/dist/defaultLocale-DIVzfLaQ.cjs +0 -2
- package/dist/defaultLocale-DIVzfLaQ.cjs.map +0 -1
- package/dist/getCentroidCoordinates-D7r34N4w.js.map +0 -1
- package/dist/getCentroidCoordinates-Dng1HVjO.cjs +0 -2
- package/dist/getCentroidCoordinates-Dng1HVjO.cjs.map +0 -1
- package/dist/getGraphList-CA17dvFB.cjs +0 -2
- package/dist/getGraphList-CA17dvFB.cjs.map +0 -1
- package/dist/getGraphList-Dxwo9TDb.js.map +0 -1
- package/dist/getSliderMarks-BmADcPQt.cjs +0 -6
- package/dist/getSliderMarks-HIDJ0_Cd.js.map +0 -1
- package/dist/imageDownload-BU4qnxJP.js.map +0 -1
- package/dist/imageDownload-NYXbvKob.cjs.map +0 -1
- package/dist/index-BqfRwk1n.js +0 -146
- package/dist/index-BqfRwk1n.js.map +0 -1
- package/dist/index-DG2bgAva.cjs +0 -10
- package/dist/index-DG2bgAva.cjs.map +0 -1
- package/dist/index-DxXnJ8Ti.cjs.map +0 -1
- package/dist/index-GEsywGxz.js.map +0 -1
- package/dist/parse-hMnG_lRV.cjs +0 -2
- package/dist/proxy-BxkFHwUw.js.map +0 -1
- package/dist/proxy-BxvUI_9l.cjs +0 -2
- package/dist/proxy-BxvUI_9l.cjs.map +0 -1
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs +0 -2
- package/dist/transformDataForAggregation-CYoB5Xsk.cjs.map +0 -1
- package/dist/transformDataForAggregation-j34UL73s.js.map +0 -1
- package/dist/use-in-view-Cxa7y1TH.js.map +0 -1
- package/dist/use-in-view-QcfiW0w3.cjs.map +0 -1
- package/dist/x-BBpi7a_7-mTo40uId.cjs +0 -27
- package/dist/zoom-C9MFjAaV.js.map +0 -1
- package/dist/zoom-DPw8bba-.cjs.map +0 -1
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-CTPQjnHt.cjs"),x=require("react"),dt=require("./getSliderMarks-BmADcPQt.cjs"),ft=require("./Spinner-CQZcjzwd.cjs"),ut=require("./parse-hMnG_lRV.cjs"),jt=require("./index-DQA8q5sC.cjs"),oe=require("./zoom-DPw8bba-.cjs"),mt=require("./Typography-DX7PlgQU.cjs"),vt=require("./index-DxXnJ8Ti.cjs"),bt=require("./numberFormattingFunction-02t-wJta.cjs"),Et=require("./Tooltip-uUdw6wJL.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),lt=require("./index-DRXx7m-C.cjs"),wt=require("./DetailsModal-BN0HDFlV.cjs"),Rt=require("./ordinal-CrsysVE-.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),it=require("./select-Bnfk0lJx.cjs"),St=require("./use-in-view-QcfiW0w3.cjs"),Je=require("./proxy-BxvUI_9l.cjs"),$t=require("./index-DG2bgAva.cjs"),Dt=require("./GraphFooter.cjs"),Nt=require("./GraphHeader.cjs"),Ke=require("./Colors.cjs"),Mt=require("./fetchAndParseData-l5HGMAEs.cjs"),Ot=require("./getUniqValue-NX8DgwND.cjs"),qt=require("./getJenks-GYmdwBqm.cjs"),pt=require("./GraphContainer-d8A46BK2.cjs");function Pt(h){const{data:e,colorDomain:l,colors:d,mapData:R,colorLegendTitle:D,categorical:B,height:E,width:j,scale:b,centerPoint:T,tooltip:re,mapBorderWidth:V,mapBorderColor:H,mapNoDataColor:ae,onSeriesMouseOver:se,showColorScale:Ee,zoomScaleExtend:Ne,zoomTranslateExtend:Me,highlightedIds:X,onSeriesMouseClick:ne,mapProperty:k,resetSelectionOnDoubleClick:ke,detailsOnClick:Y,styles:Oe,classNames:ie,mapProjection:O,zoomInteraction:q,animate:S,dimmedOpacity:P,customLayers:le,collapseColorScaleByDefault:we}=h,[N,I]=x.useState(void 0),ce=x.useRef(null),[qe,Re]=x.useState(we===void 0?!(j<680):!we),[de,J]=x.useState(void 0),[K,Z]=x.useState(void 0),[f,g]=x.useState(void 0),[ue,me]=x.useState(void 0),G=x.useRef(null),pe=St.useInView(G,{once:S.once,amount:S.amount}),Q=x.useRef(null),he=B?Rt.ordinal().domain(l).range(d):Ct.threshold().domain(l).range(d);x.useEffect(()=>{const o=it.select(Q.current),i=it.select(G.current),v=r=>{if(q==="noZoom")return!1;if(q==="button")return!r.type.includes("wheel");const n=r.type==="wheel",c=r.type.startsWith("touch"),s=r.type==="mousedown"||r.type==="mousemove";return c?!0:n?q==="scroll"?!0:r.ctrlKey:s&&!r.button&&!r.ctrlKey},a=oe.zoom().scaleExtent(Ne).translateExtent(Me||[[-20,-20],[j+20,E+20]]).filter(v).on("zoom",({transform:r})=>{o.attr("transform",r)});i.call(a),ce.current=a},[E,j,q]);const U=oe.turf_bbox_default(R),w=vt.turf_center_of_mass_default(R),xe=U[2]-U[0],L=U[3]-U[1],Ce=j*190/960*360/xe,Se=E*190/678*180/L,z=b*Math.min(Ce,Se),M=O==="mercator"?oe.geoMercator().rotate([0,0]).center(T||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="equalEarth"?oe.geoEqualEarth().rotate([0,0]).center(T||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="naturalEarth"?oe.geoNaturalEarth1().rotate([0,0]).center(T||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="orthographic"?oe.geoOrthographic().rotate([0,0]).center(T||w.geometry.coordinates).translate([j/2,E/2]).scale(z):oe.geoAlbersUsa().rotate([0,0]).center(T||w.geometry.coordinates).translate([j/2,E/2]).scale(z),ge=o=>{if(!G.current||!ce.current)return;it.select(G.current).call(ce.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${j}px`,height:`${E}px`,viewBox:`0 0 ${j} ${E}`,ref:G,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Q,children:[le.filter(o=>o.position==="before").map(o=>o.layer),R.features.map((o,i)=>e.findIndex(a=>a.id===o.properties[k])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:N?P:X.length!==0?X.indexOf(o.properties[k])!==-1?1:P:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((a,r)=>{let n="";return a.forEach(c=>{let s=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),n+=s}),t.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:H,strokeWidth:V,fill:ae}},r)}):o.geometry.coordinates.map((a,r)=>{let n="M";return a.forEach((c,s)=>{const m=M([c[0],c[1]]);s!==a.length-1?n=`${n}${m[0]} ${m[1]}L`:n=`${n}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx("path",{d:n,style:{stroke:H,strokeWidth:V,fill:ae}},r)})},i)),t.jsxRuntimeExports.jsx($t.AnimatePresence,{children:e.map(o=>{const i=R.features.findIndex(a=>o.id===a.properties[k]),v=kt.checkIfNullOrUndefined(o.x)?ae:he(o.x);return t.jsxRuntimeExports.jsx(Je.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:N?N===v?1:P:X.length!==0?X.indexOf(o.id)!==-1?1:P:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:a=>{Z(o),me(a.clientY),g(a.clientX),se?.(o)},onMouseMove:a=>{Z(o),me(a.clientY),g(a.clientX)},onMouseLeave:()=>{Z(void 0),g(void 0),me(void 0),se?.(void 0)},onClick:()=>{(ne||Y)&&(jt.isEqual(de,o)&&ke?(J(void 0),ne?.(void 0)):(J(o),ne?.(o)))},children:i===-1?null:R.features[i].geometry.type==="MultiPolygon"?R.features[i].geometry.coordinates.map((a,r)=>{let n="";return a.forEach(c=>{let s=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?s=`${s}${C[0]} ${C[1]}L`:s=`${s}${C[0]} ${C[1]}`}),n+=s}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:n,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:V}},`${o.id}-${r}`)}):R.features[i].geometry.coordinates.map((a,r)=>{let n="M";return a.forEach((c,s)=>{const m=M([c[0],c[1]]);s!==a.length-1?n=`${n}${m[0]} ${m[1]}L`:n=`${n}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:n,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:V}},`${o.id}-${r}`)})},o.id)})}),K?R.features.filter(o=>o.properties[k]===K.id).map((o,i)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((v,a)=>{let r="";return v.forEach(n=>{let c=" M";n.forEach((s,m)=>{const $=M([s[0],s[1]]);m!==n.length-1?c=`${c}${$[0]} ${$[1]}L`:c=`${c}${$[0]} ${$[1]}`}),r+=c}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)}):o.geometry.coordinates.map((v,a)=>{let r="M";return v.forEach((n,c)=>{const s=M([n[0],n[1]]);c!==v.length-1?r=`${r}${s[0]} ${s[1]}L`:r=`${r}${s[0]} ${s[1]}`}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)})},i)):null,le.filter(o=>o.position==="after").map(o=>o.layer)]})}),Ee===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",ie?.colorLegend),children:qe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.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:()=>{Re(!1)},children:t.jsxRuntimeExports.jsx(lt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:B?void 0:"340px"},children:[D&&D!==""?t.jsxRuntimeExports.jsx(mt.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:D}):null,B?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:l.map((o,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{I(d[i%d.length])},onMouseLeave:()=>{I(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[i%d.length]}}),t.jsxRuntimeExports.jsx(mt.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[l.map((o,i)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{I(d[i])},onMouseLeave:()=>{I(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:i*320/d.length+1,y:1,width:320/d.length-2,height:8,className:N===d[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[i],...N===d[i]?{}:{stroke:d[i]}}}),t.jsxRuntimeExports.jsx("text",{x:(i+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:bt.numberFormattingFunction(o,"NA")})]},i)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{I(d[l.length])},onMouseLeave:()=>{I(void 0)},x:l.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${N===d[l.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[l.length],...N===d[l.length]?{}:{stroke:d[l.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Re(!0)},children:t.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"})})}),q==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),Y&&de!==void 0?t.jsxRuntimeExports.jsx(wt.DetailsModal,{body:Y,data:de,setData:J,className:ie?.modal}):null,K&&re&&f&&ue?t.jsxRuntimeExports.jsx(Et.Tooltip,{data:K,body:re,xPos:f,yPos:ue,backgroundStyle:Oe?.tooltip,className:ie?.tooltip}):null]})}function It(h){const e=t.compilerRuntimeExports.c(121),{data:l,mapData:d,graphTitle:R,colors:D,sources:B,graphDescription:E,height:j,width:b,footNote:T,colorDomain:re,colorLegendTitle:V,scaleType:H,scale:ae,centerPoint:se,padding:Ee,mapBorderWidth:Ne,mapNoDataColor:Me,backgroundColor:X,mapBorderColor:ne,relativeHeight:k,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:Oe,showColorScale:ie,zoomScaleExtend:O,zoomTranslateExtend:q,graphID:S,highlightedIds:P,onSeriesMouseClick:le,mapProperty:we,graphDownload:N,dataDownload:I,showAntarctica:ce,language:qe,minHeight:Re,theme:de,ariaLabel:J,resetSelectionOnDoubleClick:K,detailsOnClick:Z,styles:f,classNames:g,mapProjection:ue,zoomInteraction:me,animate:G,dimmedOpacity:pe,customLayers:Q,timeline:he,collapseColorScaleByDefault:U}=h,w=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,xe=T===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":T,L=H===void 0?"threshold":H,Ce=ae===void 0?.95:ae,Se=Ne===void 0?.5:Ne,z=Me===void 0?Ke.Colors.light.graphNoData:Me,M=X===void 0?!1:X,ge=ne===void 0?Ke.Colors.light.grays["gray-500"]:ne,o=Oe===void 0?!0:Oe,i=ie===void 0?!0:ie;let v;e[0]!==O?(v=O===void 0?[.8,6]:O,e[0]=O,e[1]=v):v=e[1];const a=v;let r;e[2]!==P?(r=P===void 0?[]:P,e[2]=P,e[3]=r):r=e[3];const n=r,c=we===void 0?"ISO3":we,s=N===void 0?!1:N,m=I===void 0?!1:I,$=ce===void 0?!1:ce,C=qe===void 0?"en":qe,F=Re===void 0?0:Re,ee=de===void 0?"light":de,Ze=K===void 0?!0:K,Qe=me===void 0?"button":me,Pe=G===void 0?!1:G,et=pe===void 0?.3:pe;let Ie;e[4]!==Q?(Ie=Q===void 0?[]:Q,e[4]=Q,e[5]=Ie):Ie=e[5];const tt=Ie;let Le;e[6]!==he?(Le=he===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:he,e[6]=he,e[7]=Le):Le=e[7];const u=Le,[te,ht]=x.useState(0),[$e,xt]=x.useState(0),[W,gt]=x.useState(u.autoplay);let De;if(e[8]!==l||e[9]!==u.dateFormat){let y;e[11]!==u.dateFormat?(y=A=>ut.parse(`${A.date}`,u.dateFormat||"yyyy",new Date).getTime(),e[11]=u.dateFormat,e[12]=y):y=e[12],De=[...new Set(l.filter(Vt).map(y))],De.sort(Tt),e[8]=l,e[9]=u.dateFormat,e[10]=De}else De=e[10];const p=De,[_,ot]=x.useState(u.autoplay?0:p.length-1),[ye,yt]=x.useState(void 0),rt=x.useRef(null),ct=x.useRef(null);let ze,Fe;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{const y=new ResizeObserver(A=>{ht(A[0].target.clientWidth||620),xt(A[0].target.clientHeight||480)});return rt.current&&y.observe(rt.current),()=>y.disconnect()},Fe=[],e[13]=ze,e[14]=Fe):(ze=e[13],Fe=e[14]),x.useEffect(ze,Fe);let We;e[15]===Symbol.for("react.memo_cache_sentinel")?(We=y=>{yt(y)},e[15]=We):We=e[15];const _e=x.useEffectEvent(We);let Ae;e[16]!==w||e[17]!==_e?(Ae=()=>{typeof w=="string"?Mt.fetchAndParseJSON(w).then(A=>{_e(A)}):_e(w)},e[16]=w,e[17]=_e,e[18]=Ae):Ae=e[18];let Be;e[19]!==w?(Be=[w],e[19]=w,e[20]=Be):Be=e[20],x.useEffect(Ae,Be);let Te;e[21]!==re||e[22]!==D?.length||e[23]!==l||e[24]!==L?(Te=re||(L==="categorical"?Ot.getUniqValue(l,"x"):qt.getJenks(l.map(Bt),D?.length||4)),e[21]=re,e[22]=D?.length,e[23]=l,e[24]=L,e[25]=Te):Te=e[25];const Ve=Te;let Ge,Ue;e[26]!==W||e[27]!==u.speed||e[28]!==p?(Ge=()=>{const y=setInterval(()=>{ot(A=>A<p.length-1?A+1:0)},(u.speed||2)*1e3);return W||clearInterval(y),()=>clearInterval(y)},Ue=[p,W,u.speed],e[26]=W,e[27]=u.speed,e[28]=p,e[29]=Ge,e[30]=Ue):(Ge=e[29],Ue=e[30]),x.useEffect(Ge,Ue);const at=u.dateFormat||"yyyy";let He;e[31]!==_||e[32]!==at||e[33]!==u.showOnlyActiveDate||e[34]!==p?(He=dt.getSliderMarks(p,_,u.showOnlyActiveDate,at),e[31]=_,e[32]=at,e[33]=u.showOnlyActiveDate,e[34]=p,e[35]=He):He=e[35];const Xe=He,st=g?.graphContainer,nt=f?.graphContainer;let fe;e[36]!==g?.description||e[37]!==g?.title||e[38]!==l||e[39]!==m||e[40]!==E||e[41]!==s||e[42]!==R||e[43]!==f?.description||e[44]!==f?.title||e[45]!==b?(fe=R||E||s||m?t.jsxRuntimeExports.jsx(Nt.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:R,graphDescription:E,width:b,graphDownload:s?ct:void 0,dataDownload:m?l.map(At).filter(_t).length>0?l.map(Wt).filter(Ft):l.filter(zt):null}):null,e[36]=g?.description,e[37]=g?.title,e[38]=l,e[39]=m,e[40]=E,e[41]=s,e[42]=R,e[43]=f?.description,e[44]=f?.title,e[45]=b,e[46]=fe):fe=e[46];let je;e[47]!==_||e[48]!==Xe||e[49]!==W||e[50]!==u.enabled||e[51]!==p?(je=u.enabled&&p.length>0&&Xe?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{gt(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?t.jsxRuntimeExports.jsx(lt.Pause,{}):t.jsxRuntimeExports.jsx(lt.Play,{})}),t.jsxRuntimeExports.jsx(dt.Nr,{min:p[0],max:p[p.length-1],marks:Xe,step:null,defaultValue:p[p.length-1],value:p[_],onChangeComplete:y=>{ot(p.indexOf(y))},onChange:y=>{ot(p.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[47]=_,e[48]=Xe,e[49]=W,e[50]=u.enabled,e[51]=p,e[52]=je):je=e[52];let ve;e[53]!==Pe||e[54]!==se||e[55]!==g||e[56]!==U||e[57]!==V||e[58]!==D||e[59]!==tt||e[60]!==l||e[61]!==Z||e[62]!==et||e[63]!==Ve||e[64]!==j||e[65]!==n||e[66]!==_||e[67]!==o||e[68]!==ge||e[69]!==Se||e[70]!==z||e[71]!==ue||e[72]!==c||e[73]!==ye||e[74]!==F||e[75]!==le||e[76]!==Y||e[77]!==k||e[78]!==Ze||e[79]!==Ce||e[80]!==L||e[81]!==$||e[82]!==i||e[83]!==f||e[84]!==$e||e[85]!==te||e[86]!==ee||e[87]!==u.dateFormat||e[88]!==u.enabled||e[89]!==ke||e[90]!==p||e[91]!==b||e[92]!==Qe||e[93]!==a||e[94]!==q?(ve=t.jsxRuntimeExports.jsx(pt.GraphArea,{ref:rt,children:te&&$e&&ye?t.jsxRuntimeExports.jsx(Pt,{data:l.filter(y=>u.enabled?y.date===ut.format(new Date(p[_]),u.dateFormat||"yyyy"):y),mapData:$?ye:{...ye,features:ye.features.filter(Lt)},colorDomain:Ve,width:te,height:$e,scale:Ce,centerPoint:se,colors:D||(L==="categorical"?Ke.Colors[ee].categoricalColors.colors:Ke.Colors[ee].sequentialColors[`neutralColorsx0${Ve.length+1}`]),colorLegendTitle:V,mapBorderWidth:Se,mapNoDataColor:z,categorical:L==="categorical",mapBorderColor:ge,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:o,showColorScale:i,zoomScaleExtend:a,zoomTranslateExtend:q,onSeriesMouseClick:le,mapProperty:c,highlightedIds:n,resetSelectionOnDoubleClick:Ze,styles:f,classNames:g,detailsOnClick:Z,mapProjection:ue||(o?"naturalEarth":"mercator"),zoomInteraction:Qe,dimmedOpacity:et,animate:Pe===!0?{duration:.5,once:!0,amount:.5}:Pe||{duration:0,once:!0,amount:0},customLayers:tt,collapseColorScaleByDefault:U}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,j||(k?F?(b||te)*k>F?(b||te)*k:F:(b||te)*k:$e))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(ft.w,{"aria-label":"Loading graph"})})}),e[53]=Pe,e[54]=se,e[55]=g,e[56]=U,e[57]=V,e[58]=D,e[59]=tt,e[60]=l,e[61]=Z,e[62]=et,e[63]=Ve,e[64]=j,e[65]=n,e[66]=_,e[67]=o,e[68]=ge,e[69]=Se,e[70]=z,e[71]=ue,e[72]=c,e[73]=ye,e[74]=F,e[75]=le,e[76]=Y,e[77]=k,e[78]=Ze,e[79]=Ce,e[80]=L,e[81]=$,e[82]=i,e[83]=f,e[84]=$e,e[85]=te,e[86]=ee,e[87]=u.dateFormat,e[88]=u.enabled,e[89]=ke,e[90]=p,e[91]=b,e[92]=Qe,e[93]=a,e[94]=q,e[95]=ve):ve=e[95];let be;e[96]!==g?.footnote||e[97]!==g?.source||e[98]!==xe||e[99]!==B||e[100]!==f?.footnote||e[101]!==f?.source||e[102]!==b?(be=B||xe?t.jsxRuntimeExports.jsx(Dt.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:B,footNote:xe,width:b}):null,e[96]=g?.footnote,e[97]=g?.source,e[98]=xe,e[99]=B,e[100]=f?.footnote,e[101]=f?.source,e[102]=b,e[103]=be):be=e[103];let Ye;return e[104]!==J||e[105]!==M||e[106]!==S||e[107]!==j||e[108]!==C||e[109]!==F||e[110]!==Ee||e[111]!==k||e[112]!==st||e[113]!==nt||e[114]!==fe||e[115]!==je||e[116]!==ve||e[117]!==be||e[118]!==ee||e[119]!==b?(Ye=t.jsxRuntimeExports.jsxs(pt.GraphContainer,{className:st,style:nt,id:S,ref:ct,"aria-label":J,backgroundColor:M,theme:ee,language:C,minHeight:F,width:b,height:j,relativeHeight:k,padding:Ee,children:[fe,je,ve,be]}),e[104]=J,e[105]=M,e[106]=S,e[107]=j,e[108]=C,e[109]=F,e[110]=Ee,e[111]=k,e[112]=st,e[113]=nt,e[114]=fe,e[115]=je,e[116]=ve,e[117]=be,e[118]=ee,e[119]=b,e[120]=Ye):Ye=e[120],Ye}function Lt(h){return h.properties.NAME!=="Antarctica"}function zt(h){return h!==void 0}function Ft(h){return h!==void 0}function Wt(h){return h.data}function _t(h){return h!==void 0}function At(h){return h.data}function Bt(h){return h.x}function Tt(h,e){return h-e}function Vt(h){return h.date}exports.ChoroplethMap=It;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-6v2a2njQ.cjs"),x=require("react"),dt=require("./getSliderMarks-CIuSoedo.cjs"),ft=require("./Spinner-jTMOLuw_.cjs"),ut=require("./parse-xYI9yrvL.cjs"),jt=require("./index-DQA8q5sC.cjs"),oe=require("./zoom-ChcvXFIz.cjs"),mt=require("./Typography-sa1UE0oF.cjs"),vt=require("./index-C5K--w8d.cjs"),bt=require("./numberFormattingFunction-02t-wJta.cjs"),Et=require("./Tooltip-BLa2EfMs.cjs"),kt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),lt=require("./index-C6er0ety.cjs"),wt=require("./DetailsModal-DHttOA80.cjs"),Rt=require("./ordinal-CrsysVE-.cjs"),Ct=require("./threshold-DNsSUf8Q.cjs"),it=require("./select-Bnfk0lJx.cjs"),Je=require("./proxy-C4-uo6nS.cjs"),St=require("./use-in-view-C3o_ntMv.cjs"),$t=require("./index-CoobIWNj.cjs"),Dt=require("./GraphFooter.cjs"),Nt=require("./GraphHeader.cjs"),Ke=require("./Colors.cjs"),Mt=require("./fetchAndParseData-QTF6tjij.cjs"),Ot=require("./getUniqValue-NX8DgwND.cjs"),qt=require("./getJenks-BzJvhy_H.cjs"),pt=require("./GraphContainer-B1EDxJ0S.cjs");function Pt(h){const{data:e,colorDomain:l,colors:d,mapData:R,colorLegendTitle:D,categorical:T,height:E,width:j,scale:b,centerPoint:V,tooltip:re,mapBorderWidth:_,mapBorderColor:H,mapNoDataColor:ae,onSeriesMouseOver:ne,showColorScale:Ee,zoomScaleExtend:Ne,zoomTranslateExtend:Me,highlightedIds:X,onSeriesMouseClick:se,mapProperty:k,resetSelectionOnDoubleClick:ke,detailsOnClick:Y,styles:Oe,classNames:ie,mapProjection:O,zoomInteraction:q,animate:S,dimmedOpacity:P,customLayers:le,collapseColorScaleByDefault:we}=h,[N,I]=x.useState(void 0),ce=x.useRef(null),[qe,Re]=x.useState(we===void 0?!(j<680):!we),[de,J]=x.useState(void 0),[K,Z]=x.useState(void 0),[f,g]=x.useState(void 0),[ue,me]=x.useState(void 0),G=x.useRef(null),pe=St.useInView(G,{once:S.once,amount:S.amount}),Q=x.useRef(null),he=T?Rt.ordinal().domain(l).range(d):Ct.threshold().domain(l).range(d);x.useEffect(()=>{const o=it.select(Q.current),i=it.select(G.current),v=r=>{if(q==="noZoom")return!1;if(q==="button")return!r.type.includes("wheel");const s=r.type==="wheel",c=r.type.startsWith("touch"),n=r.type==="mousedown"||r.type==="mousemove";return c?!0:s?q==="scroll"?!0:r.ctrlKey:n&&!r.button&&!r.ctrlKey},a=oe.zoom().scaleExtent(Ne).translateExtent(Me||[[-20,-20],[j+20,E+20]]).filter(v).on("zoom",({transform:r})=>{o.attr("transform",r)});i.call(a),ce.current=a},[E,j,q]);const U=oe.index_default(R),w=vt.index_default(R),xe=U[2]-U[0],L=U[3]-U[1],Ce=j*190/960*360/xe,Se=E*190/678*180/L,z=b*Math.min(Ce,Se),M=O==="mercator"?oe.geoMercator().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="equalEarth"?oe.geoEqualEarth().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="naturalEarth"?oe.geoNaturalEarth1().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):O==="orthographic"?oe.geoOrthographic().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z):oe.geoAlbersUsa().rotate([0,0]).center(V||w.geometry.coordinates).translate([j/2,E/2]).scale(z),ge=o=>{if(!G.current||!ce.current)return;it.select(G.current).call(ce.current.scaleBy,o==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(Je.motion.svg,{width:`${j}px`,height:`${E}px`,viewBox:`0 0 ${j} ${E}`,ref:G,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:Q,children:[le.filter(o=>o.position==="before").map(o=>o.layer),R.features.map((o,i)=>e.findIndex(a=>a.id===o.properties[k])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:N?P:X.length!==0?X.indexOf(o.properties[k])!==-1?1:P:1,children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((a,r)=>{let s="";return a.forEach(c=>{let n=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?n=`${n}${C[0]} ${C[1]}L`:n=`${n}${C[0]} ${C[1]}`}),s+=n}),t.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:H,strokeWidth:_,fill:ae}},r)}):o.geometry.coordinates.map((a,r)=>{let s="M";return a.forEach((c,n)=>{const m=M([c[0],c[1]]);n!==a.length-1?s=`${s}${m[0]} ${m[1]}L`:s=`${s}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx("path",{d:s,style:{stroke:H,strokeWidth:_,fill:ae}},r)})},i)),t.jsxRuntimeExports.jsx($t.AnimatePresence,{children:e.map(o=>{const i=R.features.findIndex(a=>o.id===a.properties[k]),v=kt.checkIfNullOrUndefined(o.x)?ae:he(o.x);return t.jsxRuntimeExports.jsx(Je.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:N?N===v?1:P:X.length!==0?X.indexOf(o.id)!==-1?1:P:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},onMouseEnter:a=>{Z(o),me(a.clientY),g(a.clientX),ne?.(o)},onMouseMove:a=>{Z(o),me(a.clientY),g(a.clientX)},onMouseLeave:()=>{Z(void 0),g(void 0),me(void 0),ne?.(void 0)},onClick:()=>{(se||Y)&&(jt.isEqual(de,o)&&ke?(J(void 0),se?.(void 0)):(J(o),se?.(o)))},children:i===-1?null:R.features[i].geometry.type==="MultiPolygon"?R.features[i].geometry.coordinates.map((a,r)=>{let s="";return a.forEach(c=>{let n=" M";c.forEach((m,$)=>{const C=M([m[0],m[1]]);$!==c.length-1?n=`${n}${C[0]} ${C[1]}L`:n=`${n}${C[0]} ${C[1]}`}),s+=n}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:s,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:_}},`${o.id}-${r}`)}):R.features[i].geometry.coordinates.map((a,r)=>{let s="M";return a.forEach((c,n)=>{const m=M([c[0],c[1]]);n!==a.length-1?s=`${s}${m[0]} ${m[1]}L`:s=`${s}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx(Je.motion.path,{d:s,variants:{initial:{fill:v,opacity:0},whileInView:{fill:v,opacity:1,transition:{duration:S.duration}}},initial:"initial",animate:pe?"whileInView":"initial",exit:{opacity:0,transition:{duration:S.duration}},style:{stroke:H,strokeWidth:_}},`${o.id}-${r}`)})},o.id)})}),K?R.features.filter(o=>o.properties[k]===K.id).map((o,i)=>t.jsxRuntimeExports.jsx("g",{children:o.geometry.type==="MultiPolygon"?o.geometry.coordinates.map((v,a)=>{let r="";return v.forEach(s=>{let c=" M";s.forEach((n,m)=>{const $=M([n[0],n[1]]);m!==s.length-1?c=`${c}${$[0]} ${$[1]}L`:c=`${c}${$[0]} ${$[1]}`}),r+=c}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)}):o.geometry.coordinates.map((v,a)=>{let r="M";return v.forEach((s,c)=>{const n=M([s[0],s[1]]);c!==v.length-1?r=`${r}${n[0]} ${n[1]}L`:r=`${r}${n[0]} ${n[1]}`}),t.jsxRuntimeExports.jsx("path",{d:r,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)})},i)):null,le.filter(o=>o.position==="after").map(o=>o.layer)]})}),Ee===!1?null:t.jsxRuntimeExports.jsx("div",{className:t.mo("absolute left-4 bottom-4 map-color-legend",ie?.colorLegend),children:qe?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.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:()=>{Re(!1)},children:t.jsxRuntimeExports.jsx(lt.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:T?void 0:"340px"},children:[D&&D!==""?t.jsxRuntimeExports.jsx(mt.j,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:D}):null,T?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:l.map((o,i)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{I(d[i%d.length])},onMouseLeave:()=>{I(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:d[i%d.length]}}),t.jsxRuntimeExports.jsx(mt.j,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[l.map((o,i)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{I(d[i])},onMouseLeave:()=>{I(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:i*320/d.length+1,y:1,width:320/d.length-2,height:8,className:N===d[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:d[i],...N===d[i]?{}:{stroke:d[i]}}}),t.jsxRuntimeExports.jsx("text",{x:(i+1)*320/d.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:bt.numberFormattingFunction(o,"NA")})]},i)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{I(d[l.length])},onMouseLeave:()=>{I(void 0)},x:l.length*320/d.length+1,y:1,width:320/d.length-2,height:8,className:`cursor-pointer ${N===d[l.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:d[l.length],...N===d[l.length]?{}:{stroke:d[l.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{Re(!0)},children:t.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"})})}),q==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>ge("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),Y&&de!==void 0?t.jsxRuntimeExports.jsx(wt.DetailsModal,{body:Y,data:de,setData:J,className:ie?.modal}):null,K&&re&&f&&ue?t.jsxRuntimeExports.jsx(Et.Tooltip,{data:K,body:re,xPos:f,yPos:ue,backgroundStyle:Oe?.tooltip,className:ie?.tooltip}):null]})}function It(h){const e=t.compilerRuntimeExports.c(121),{data:l,mapData:d,graphTitle:R,colors:D,sources:T,graphDescription:E,height:j,width:b,footNote:V,colorDomain:re,colorLegendTitle:_,scaleType:H,scale:ae,centerPoint:ne,padding:Ee,mapBorderWidth:Ne,mapNoDataColor:Me,backgroundColor:X,mapBorderColor:se,relativeHeight:k,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:Oe,showColorScale:ie,zoomScaleExtend:O,zoomTranslateExtend:q,graphID:S,highlightedIds:P,onSeriesMouseClick:le,mapProperty:we,graphDownload:N,dataDownload:I,showAntarctica:ce,language:qe,minHeight:Re,theme:de,ariaLabel:J,resetSelectionOnDoubleClick:K,detailsOnClick:Z,styles:f,classNames:g,mapProjection:ue,zoomInteraction:me,animate:G,dimmedOpacity:pe,customLayers:Q,timeline:he,collapseColorScaleByDefault:U}=h,w=d===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json":d,xe=V===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":V,L=H===void 0?"threshold":H,Ce=ae===void 0?.95:ae,Se=Ne===void 0?.5:Ne,z=Me===void 0?Ke.Colors.light.graphNoData:Me,M=X===void 0?!1:X,ge=se===void 0?Ke.Colors.light.grays["gray-500"]:se,o=Oe===void 0?!0:Oe,i=ie===void 0?!0:ie;let v;e[0]!==O?(v=O===void 0?[.8,6]:O,e[0]=O,e[1]=v):v=e[1];const a=v;let r;e[2]!==P?(r=P===void 0?[]:P,e[2]=P,e[3]=r):r=e[3];const s=r,c=we===void 0?"ISO3":we,n=N===void 0?!1:N,m=I===void 0?!1:I,$=ce===void 0?!1:ce,C=qe===void 0?"en":qe,F=Re===void 0?0:Re,ee=de===void 0?"light":de,Ze=K===void 0?!0:K,Qe=me===void 0?"button":me,Pe=G===void 0?!1:G,et=pe===void 0?.3:pe;let Ie;e[4]!==Q?(Ie=Q===void 0?[]:Q,e[4]=Q,e[5]=Ie):Ie=e[5];const tt=Ie;let Le;e[6]!==he?(Le=he===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:he,e[6]=he,e[7]=Le):Le=e[7];const u=Le,[te,ht]=x.useState(0),[$e,xt]=x.useState(0),[W,gt]=x.useState(u.autoplay);let De;if(e[8]!==l||e[9]!==u.dateFormat){let y;e[11]!==u.dateFormat?(y=B=>ut.parse(`${B.date}`,u.dateFormat||"yyyy",new Date).getTime(),e[11]=u.dateFormat,e[12]=y):y=e[12],De=[...new Set(l.filter(_t).map(y))],De.sort(Vt),e[8]=l,e[9]=u.dateFormat,e[10]=De}else De=e[10];const p=De,[A,ot]=x.useState(u.autoplay?0:p.length-1),[ye,yt]=x.useState(void 0),rt=x.useRef(null),ct=x.useRef(null);let ze,Fe;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{const y=new ResizeObserver(B=>{ht(B[0].target.clientWidth||620),xt(B[0].target.clientHeight||480)});return rt.current&&y.observe(rt.current),()=>y.disconnect()},Fe=[],e[13]=ze,e[14]=Fe):(ze=e[13],Fe=e[14]),x.useEffect(ze,Fe);let We;e[15]===Symbol.for("react.memo_cache_sentinel")?(We=y=>{yt(y)},e[15]=We):We=e[15];const Ae=x.useEffectEvent(We);let Be;e[16]!==w||e[17]!==Ae?(Be=()=>{typeof w=="string"?Mt.fetchAndParseJSON(w).then(B=>{Ae(B)}):Ae(w)},e[16]=w,e[17]=Ae,e[18]=Be):Be=e[18];let Te;e[19]!==w?(Te=[w],e[19]=w,e[20]=Te):Te=e[20],x.useEffect(Be,Te);let Ve;e[21]!==re||e[22]!==D?.length||e[23]!==l||e[24]!==L?(Ve=re||(L==="categorical"?Ot.getUniqValue(l,"x"):qt.getJenks(l.map(Tt),D?.length||4)),e[21]=re,e[22]=D?.length,e[23]=l,e[24]=L,e[25]=Ve):Ve=e[25];const _e=Ve;let Ge,Ue;e[26]!==W||e[27]!==u.speed||e[28]!==p?(Ge=()=>{const y=setInterval(()=>{ot(B=>B<p.length-1?B+1:0)},(u.speed||2)*1e3);return W||clearInterval(y),()=>clearInterval(y)},Ue=[p,W,u.speed],e[26]=W,e[27]=u.speed,e[28]=p,e[29]=Ge,e[30]=Ue):(Ge=e[29],Ue=e[30]),x.useEffect(Ge,Ue);const at=u.dateFormat||"yyyy";let He;e[31]!==A||e[32]!==at||e[33]!==u.showOnlyActiveDate||e[34]!==p?(He=dt.getSliderMarks(p,A,u.showOnlyActiveDate,at),e[31]=A,e[32]=at,e[33]=u.showOnlyActiveDate,e[34]=p,e[35]=He):He=e[35];const Xe=He,nt=g?.graphContainer,st=f?.graphContainer;let fe;e[36]!==g?.description||e[37]!==g?.title||e[38]!==l||e[39]!==m||e[40]!==E||e[41]!==n||e[42]!==R||e[43]!==f?.description||e[44]!==f?.title||e[45]!==b?(fe=R||E||n||m?t.jsxRuntimeExports.jsx(Nt.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:R,graphDescription:E,width:b,graphDownload:n?ct:void 0,dataDownload:m?l.map(Bt).filter(At).length>0?l.map(Wt).filter(Ft):l.filter(zt):null}):null,e[36]=g?.description,e[37]=g?.title,e[38]=l,e[39]=m,e[40]=E,e[41]=n,e[42]=R,e[43]=f?.description,e[44]=f?.title,e[45]=b,e[46]=fe):fe=e[46];let je;e[47]!==A||e[48]!==Xe||e[49]!==W||e[50]!==u.enabled||e[51]!==p?(je=u.enabled&&p.length>0&&Xe?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{gt(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?t.jsxRuntimeExports.jsx(lt.Pause,{}):t.jsxRuntimeExports.jsx(lt.Play,{})}),t.jsxRuntimeExports.jsx(dt.Nr,{min:p[0],max:p[p.length-1],marks:Xe,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:y=>{ot(p.indexOf(y))},onChange:y=>{ot(p.indexOf(y))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[47]=A,e[48]=Xe,e[49]=W,e[50]=u.enabled,e[51]=p,e[52]=je):je=e[52];let ve;e[53]!==Pe||e[54]!==ne||e[55]!==g||e[56]!==U||e[57]!==_||e[58]!==D||e[59]!==tt||e[60]!==l||e[61]!==Z||e[62]!==et||e[63]!==_e||e[64]!==j||e[65]!==s||e[66]!==A||e[67]!==o||e[68]!==ge||e[69]!==Se||e[70]!==z||e[71]!==ue||e[72]!==c||e[73]!==ye||e[74]!==F||e[75]!==le||e[76]!==Y||e[77]!==k||e[78]!==Ze||e[79]!==Ce||e[80]!==L||e[81]!==$||e[82]!==i||e[83]!==f||e[84]!==$e||e[85]!==te||e[86]!==ee||e[87]!==u.dateFormat||e[88]!==u.enabled||e[89]!==ke||e[90]!==p||e[91]!==b||e[92]!==Qe||e[93]!==a||e[94]!==q?(ve=t.jsxRuntimeExports.jsx(pt.GraphArea,{ref:rt,children:te&&$e&&ye?t.jsxRuntimeExports.jsx(Pt,{data:l.filter(y=>u.enabled?y.date===ut.format(new Date(p[A]),u.dateFormat||"yyyy"):y),mapData:$?ye:{...ye,features:ye.features.filter(Lt)},colorDomain:_e,width:te,height:$e,scale:Ce,centerPoint:ne,colors:D||(L==="categorical"?Ke.Colors[ee].categoricalColors.colors:Ke.Colors[ee].sequentialColors[`neutralColorsx0${_e.length+1}`]),colorLegendTitle:_,mapBorderWidth:Se,mapNoDataColor:z,categorical:L==="categorical",mapBorderColor:ge,tooltip:ke,onSeriesMouseOver:Y,isWorldMap:o,showColorScale:i,zoomScaleExtend:a,zoomTranslateExtend:q,onSeriesMouseClick:le,mapProperty:c,highlightedIds:s,resetSelectionOnDoubleClick:Ze,styles:f,classNames:g,detailsOnClick:Z,mapProjection:ue||(o?"naturalEarth":"mercator"),zoomInteraction:Qe,dimmedOpacity:et,animate:Pe===!0?{duration:.5,once:!0,amount:.5}:Pe||{duration:0,once:!0,amount:0},customLayers:tt,collapseColorScaleByDefault:U}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(F,j||(k?F?(b||te)*k>F?(b||te)*k:F:(b||te)*k:$e))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(ft.w,{"aria-label":"Loading graph"})})}),e[53]=Pe,e[54]=ne,e[55]=g,e[56]=U,e[57]=_,e[58]=D,e[59]=tt,e[60]=l,e[61]=Z,e[62]=et,e[63]=_e,e[64]=j,e[65]=s,e[66]=A,e[67]=o,e[68]=ge,e[69]=Se,e[70]=z,e[71]=ue,e[72]=c,e[73]=ye,e[74]=F,e[75]=le,e[76]=Y,e[77]=k,e[78]=Ze,e[79]=Ce,e[80]=L,e[81]=$,e[82]=i,e[83]=f,e[84]=$e,e[85]=te,e[86]=ee,e[87]=u.dateFormat,e[88]=u.enabled,e[89]=ke,e[90]=p,e[91]=b,e[92]=Qe,e[93]=a,e[94]=q,e[95]=ve):ve=e[95];let be;e[96]!==g?.footnote||e[97]!==g?.source||e[98]!==xe||e[99]!==T||e[100]!==f?.footnote||e[101]!==f?.source||e[102]!==b?(be=T||xe?t.jsxRuntimeExports.jsx(Dt.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:T,footNote:xe,width:b}):null,e[96]=g?.footnote,e[97]=g?.source,e[98]=xe,e[99]=T,e[100]=f?.footnote,e[101]=f?.source,e[102]=b,e[103]=be):be=e[103];let Ye;return e[104]!==J||e[105]!==M||e[106]!==S||e[107]!==j||e[108]!==C||e[109]!==F||e[110]!==Ee||e[111]!==k||e[112]!==nt||e[113]!==st||e[114]!==fe||e[115]!==je||e[116]!==ve||e[117]!==be||e[118]!==ee||e[119]!==b?(Ye=t.jsxRuntimeExports.jsxs(pt.GraphContainer,{className:nt,style:st,id:S,ref:ct,"aria-label":J,backgroundColor:M,theme:ee,language:C,minHeight:F,width:b,height:j,relativeHeight:k,padding:Ee,children:[fe,je,ve,be]}),e[104]=J,e[105]=M,e[106]=S,e[107]=j,e[108]=C,e[109]=F,e[110]=Ee,e[111]=k,e[112]=nt,e[113]=st,e[114]=fe,e[115]=je,e[116]=ve,e[117]=be,e[118]=ee,e[119]=b,e[120]=Ye):Ye=e[120],Ye}function Lt(h){return h.properties.NAME!=="Antarctica"}function zt(h){return h!==void 0}function Ft(h){return h!==void 0}function Wt(h){return h.data}function At(h){return h!==void 0}function Bt(h){return h.data}function Tt(h){return h.x}function Vt(h,e){return h-e}function _t(h){return h.date}exports.ChoroplethMap=It;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoroplethMap.cjs","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={masterPath}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","getUniqValue","getJenks","_temp3","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":"ylCAyEO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,GACAC,eAAAA,EACAC,eAAAA,EACAC,eAAAA,GACAC,kBAAAA,GACAC,eAAAA,GACAC,gBAAAA,GACAC,oBAAAA,GACAC,eAAAA,EACAC,mBAAAA,GACAC,YAAAA,EACAC,4BAAAA,GACAC,eAAAA,EACAC,OAAAA,GACAC,WAAAA,GACAC,cAAAA,EACAC,gBAAAA,EACAC,QAAAA,EACAC,cAAAA,EACAC,aAAAA,GACAC,4BAAAA,EAAAA,EACE/B,EACE,CAACgC,EAAeC,CAAgB,EAAIC,EAAAA,SAA6BC,MAAS,EAC1EC,GAAUC,EAAAA,OAAoD,IAAI,EAClE,CAACC,GAAYC,EAAa,EAAIL,WAClCH,KAAgCI,OAAY,EAAE3B,EAAQ,KAAO,CAACuB,EAChE,EAEM,CAACS,GAAgBC,CAAiB,EAAIP,EAAAA,SAAcC,MAAS,EAE7D,CAACO,EAAeC,CAAgB,EAAIT,EAAAA,SAAcC,MAAS,EAC3D,CAACS,EAAQC,CAAS,EAAIX,EAAAA,SAA6BC,MAAS,EAC5D,CAACW,GAAQC,EAAS,EAAIb,EAAAA,SAA6BC,MAAS,EAC5Da,EAASX,EAAAA,OAAsB,IAAI,EACnCY,GAAWC,GAAAA,UAAUF,EAAQ,CACjCG,KAAMvB,EAAQuB,KACdC,OAAQxB,EAAQwB,MAAAA,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AAAwQ,GAAAkD,EAAA,CAAA,OAsGiB5M,EAAC2B,CAA+B,CAtGjD,SAAAiG,GAAAiF,EAAAC,EAAA,CAAA,OA8DkBD,EAAIC,CAAC,CA9DvB,SAAApF,GAAA1H,EAAA,CAAA,OA0DgBA,EAACsH,IAAK"}
|
|
1
|
+
{"version":3,"file":"ChoroplethMap.cjs","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centerOfMass from '@turf/center-of-mass';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\nimport { DetailsModal } from '@/Components/Elements/DetailsModal';\r\n\r\ninterface Props {\r\n colorDomain: (number | string)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n collapseColorScaleByDefault?: boolean;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(\r\n collapseColorScaleByDefault === undefined ? !(width < 680) : !collapseColorScaleByDefault,\r\n );\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centerOfMass(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={masterPath}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className={cn('absolute left-4 bottom-4 map-color-legend', classNames?.colorLegend)}>\r\n {showLegend ? (\r\n <>\r\n <div\r\n className='color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]'\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]'\r\n style={{\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start map-legend-button'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col zoom-buttons'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <DetailsModal\r\n body={detailsOnClick}\r\n data={mouseClickData}\r\n setData={setMouseClickData}\r\n className={classNames?.modal}\r\n />\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect, useEffectEvent, useMemo } from 'react';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { GraphArea, GraphContainer } from '@/Components/Elements/GraphContainer';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle if color scale is collapsed by default. */\r\n collapseColorScaleByDefault?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n collapseColorScaleByDefault,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = useMemo(() => {\r\n const dates = [\r\n ...new Set(\r\n data\r\n .filter(d => d.date)\r\n .map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n ),\r\n ];\r\n dates.sort((a, b) => a - b);\r\n return dates;\r\n }, [data, timeline.dateFormat]);\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(entries[0].target.clientWidth || 620);\r\n setSvgHeight(entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, []);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const onUpdateShape = useEffectEvent((shape: any) => {\r\n setMapShape(shape);\r\n });\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n onUpdateShape(d);\r\n });\r\n } else {\r\n onUpdateShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <GraphContainer\r\n className={classNames?.graphContainer}\r\n style={styles?.graphContainer}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={ariaLabel}\r\n backgroundColor={backgroundColor}\r\n theme={theme}\r\n language={language}\r\n minHeight={minHeight}\r\n width={width}\r\n height={height}\r\n relativeHeight={relativeHeight}\r\n padding={padding}\r\n >\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <GraphArea ref={graphDiv}>\r\n {svgWidth && svgHeight && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date === format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={svgWidth}\r\n height={svgHeight}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].categoricalColors.colors\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n collapseColorScaleByDefault={collapseColorScaleByDefault}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </GraphArea>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </GraphContainer>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","collapseColorScaleByDefault","selectedColor","setSelectedColor","useState","undefined","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","once","amount","mapG","colorScale","scaleOrdinal","domain","range","scaleThreshold","useEffect","mapGSelect","select","current","mapSvgSelect","zoomFilter","e","type","includes","isWheel","isTouch","startsWith","isDrag","ctrlKey","button","zoomBehavior","zoom","scaleExtent","translateExtent","filter","on","transform","attr","call","bounds","bbox","center","centerOfMass","lonDiff","latDiff","scaleX","scaleY","scaleVar","Math","min","projection","geoMercator","rotate","geometry","coordinates","translate","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","scaleBy","jsxs","Fragment","jsx","motion","d","position","map","layer","features","i","findIndex","el","id","properties","length","indexOf","j","masterPath","forEach","geo","path","c","k","point","stroke","strokeWidth","fill","AnimatePresence","index","color","checkIfNullOrUndefined","x","initial","opacity","whileInView","transition","duration","event","clientY","clientX","isEqual","fillOpacity","cn","colorLegend","X","P","display","WebkitLineClamp","WebkitBoxOrient","backgroundColor","textAnchor","numberFormattingFunction","DetailsModal","modal","Tooltip","ChoroplethMap","$","_c","t0","graphTitle","sources","graphDescription","footNote","t1","scaleType","t2","t3","padding","t4","t5","t6","t7","relativeHeight","isWorldMap","t8","t9","t10","graphID","t11","t12","graphDownload","t13","dataDownload","t14","showAntarctica","t15","language","t16","minHeight","t17","theme","t18","ariaLabel","t19","t20","t21","t22","t23","timeline","t24","Colors","light","graphNoData","grays","t25","t26","t27","t28","enabled","autoplay","showOnlyActiveDate","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","dates","dateFormat","t29","d_0","parse","date","Date","getTime","Set","_temp","sort","_temp2","uniqDatesSorted","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","t30","Symbol","for","resizeObserver","ResizeObserver","entries","target","clientWidth","clientHeight","observe","disconnect","t31","shape","onUpdateShape","useEffectEvent","t32","fetchAndParseJSON","then","d_1","t33","t34","getUniqValue","getJenks","_temp3","t35","t36","speed","interval","setInterval","clearInterval","t37","t38","getSliderMarks","markObj","t39","graphContainer","t40","t41","description","title","GraphHeader","_temp4","_temp5","_temp6","_temp7","_temp8","t42","Pause","Play","SliderUI","nextValue","nextValue_0","t43","GraphArea","d_8","format","_temp9","categoricalColors","sequentialColors","max","Spinner","t44","footnote","source","GraphFooter","t45","GraphContainer","NAME","d_5","d_4","d_3","d_7","d_6","d_2","a","b"],"mappings":"ylCAyEO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJC,KAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,QAAAA,EACAC,iBAAAA,EACAC,YAAAA,EACAC,OAAAA,EACAC,MAAAA,EACAC,MAAAA,EACAC,YAAAA,EACAC,QAAAA,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