@undp/data-viz 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +16 -16
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +45 -45
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +12 -12
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +9 -9
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +50 -50
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +12 -12
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +12 -12
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +12 -12
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +26 -26
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +7 -7
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
- package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
- package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
- package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +17 -17
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +13 -13
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +26 -26
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +29 -29
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +5 -5
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
package/dist/ButterflyChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),y=require("react"),pe=require("./getSliderMarks-CRIbTGYV.cjs"),fe=require("./parse-hMnG_lRV.cjs"),ye=require("./index-DQA8q5sC.cjs"),Me=require("./Modal-tXZlLE5s.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),Ae=require("./Tooltip-De16GWhY.cjs"),Ce=require("./string2HTML-z7CwHXcx.cjs"),be=require("./XTicksAndGridLines-CCzXIV8d.cjs"),ve=require("./Axis-DE7dSn1_.cjs"),Le=require("./YAxesLabels-yRFFdx1s.cjs"),we=require("./ReferenceLine-CFVBBN__.cjs"),ke=require("./band-CAApY4Pd.cjs"),Re=require("./linear-BVckp9RD.cjs"),Ne=require("./use-in-view-sQJZ_xDO.cjs"),T=require("./proxy-BHRoeZgd.cjs"),me=require("./index-BW8iNx7E.cjs"),$e=require("./GraphFooter.cjs"),qe=require("./GraphHeader.cjs"),Ve=require("./ColorLegend.cjs"),Ee=require("./Colors.cjs"),Se=require("./EmptyState-d8_8SxeW.cjs"),Be=require("./index-BW_-wD2k.cjs"),de=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Te=require("./ensureCompleteData-DkQYPeDa.cjs"),Oe=require("./uniqBy-O05lp2S5.cjs"),Ie=require("./sort-O96oMZLb.cjs"),De=require("./init-DU0ybBc_.cjs");function Fe(W){const{data:u,width:j,height:R,barColors:l,centerGap:d,refValues:a,maxValue:E,minValue:U,showValues:z,axisTitles:B,rightMargin:ne,leftMargin:oe,topMargin:_,bottomMargin:le,tooltip:J,onSeriesMouseOver:O,barPadding:xe,truncateBy:I,onSeriesMouseClick:k,showTicks:te,suffix:G,prefix:H,resetSelectionOnDoubleClick:ie,detailsOnClick:M,styles:h,classNames:n,noOfTicks:A,animate:m,precision:P,customLayers:se,minValueLeftBar:N,minValueRightBar:$,naLabel:K}=W,Q=y.useRef(null),b=Ne.useInView(Q,{once:m.once,amount:m.amount}),[re,v]=y.useState(void 0),[q,D]=y.useState(void 0),[ae,V]=y.useState(void 0),[C,p]=y.useState(void 0),c={top:_,bottom:le,left:oe,right:ne},L=j-c.left-c.right,w=R-c.top-c.bottom,X=u.map((e,r)=>({...e,id:`${r}`})),s=ke.band().domain(X.map(e=>`${e.id}`)).range([w,0]).paddingInner(xe),x=Re.linear().domain([U,E]).range([0,(L-d)/2]).nice(),S=x.ticks(A),o=Re.linear().domain([U,E]).range([(L-d)/2,0]).nice(),Z=o.ticks(A);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${j}px`,height:`${R}px`,viewBox:`0 0 ${j} ${R}`,direction:"ltr",ref:Q,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.left},${c.top})`,children:[se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[te?t.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Z.filter(e=>e!==0),x:Z.filter(e=>e!==0).map(e=>o(e)),y1:0-_,y2:w+c.bottom,styles:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:G,prefix:H,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:P}):null,t.jsxRuntimeExports.jsxs(me.AnimatePresence,{children:[X.map((e,r)=>t.jsxRuntimeExports.jsxs(T.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{v(e),p(f.clientY),V(f.clientX),O?.(e)},onClick:()=>{(k||M)&&(ye.isEqual(q,e)&&ie?(D(void 0),k?.(void 0)):(D(e),k?.(e)))},onMouseMove:f=>{v(e),p(f.clientY),V(f.clientX)},onMouseLeave:()=>{v(void 0),V(void 0),p(void 0),O?.(void 0)},children:[e.leftBar?t.jsxRuntimeExports.jsx(T.motion.rect,{y:s(`${r}`),style:{fill:l[0]},height:s.bandwidth(),variants:{initial:{x:o(0),width:0},whileInView:{x:e.leftBar<0?o(0):o(e.leftBar),width:e.leftBar<0?o(e.leftBar)-o(0):o(0)-o(e.leftBar),transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{x:o(0),width:0,transition:{duration:m.duration}}}):null,z?t.jsxRuntimeExports.jsx(T.motion.text,{y:s(`${r}`)+s.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...h?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:t.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:o(0),opacity:0,fill:l[0]},whileInView:{x:e.leftBar?o(e.leftBar):o(N<0?0:N),opacity:1,fill:l[0],transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",children:je.numberFormattingFunction(e.rightBar,K,P,H,G)}):null]},e.label)),t.jsxRuntimeExports.jsx(ve.Axis,{y1:-2.5,y2:w+c.bottom,x1:o(N<0?0:N),x2:o(N<0?0:N),classNames:{axis:n?.yAxis?.axis},styles:{axis:h?.yAxis?.axis}}),a?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a.map((e,r)=>t.jsxRuntimeExports.jsx(we.RefLineX,{text:e.text,color:e.color,x:o(e.value),y1:0-c.top,y2:w+c.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:m,isInView:b},r))}):null]})]}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+d)/2},0)`,children:[te?t.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:S.filter(e=>e!==0),x:S.filter(e=>e!==0).map(e=>x(e)),y1:0-_,y2:w+c.bottom,styles:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:G,prefix:H,labelType:"secondary",showGridLines:!0,precision:P}):null,t.jsxRuntimeExports.jsxs(me.AnimatePresence,{children:[X.map((e,r)=>t.jsxRuntimeExports.jsxs(T.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{v(e),p(f.clientY),V(f.clientX),O?.(e)},onClick:()=>{(k||M)&&(ye.isEqual(q,e)&&ie?(D(void 0),k?.(void 0)):(D(e),k?.(e)))},onMouseMove:f=>{v(e),p(f.clientY),V(f.clientX)},onMouseLeave:()=>{v(void 0),V(void 0),p(void 0),O?.(void 0)},children:[e.rightBar?t.jsxRuntimeExports.jsx(T.motion.rect,{y:s(`${r}`),style:{fill:l[1]},height:s.bandwidth(),exit:{x:x(0),width:0,transition:{duration:m.duration}},variants:{initial:{x:x(0),width:0},whileInView:{x:e.rightBar>=0?x(0):x(e.rightBar),width:e.rightBar>=0?x(e.rightBar)-x(0):x(0)-x(e.rightBar),transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial"}):null,z?t.jsxRuntimeExports.jsx(T.motion.text,{y:s(`${r}`)+s.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...h?.graphObjectValues||{}},className:t.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:x(0),opacity:0,fill:l[1]},whileInView:{x:e.rightBar?x(e.rightBar):x($<0?0:$),opacity:1,fill:l[1],transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",children:je.numberFormattingFunction(e.rightBar,K,P,H,G)}):null]},r)),t.jsxRuntimeExports.jsx(ve.Axis,{y1:-2.5,y2:w+c.bottom,x1:x($<0?0:$),x2:x($<0?0:$),classNames:{axis:n?.yAxis?.axis},styles:{axis:h?.yAxis?.axis}}),a?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a.map((e,r)=>t.jsxRuntimeExports.jsx(we.RefLineX,{text:e.text,color:e.color,x:x(e.value),y1:0-c.top,y2:w+c.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:m,isInView:b},r))}):null]})]}),t.jsxRuntimeExports.jsx(me.AnimatePresence,{children:t.jsxRuntimeExports.jsx(T.motion.g,{transform:`translate(${L/2},0)`,children:X.map((e,r)=>t.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<I?`${e.label}`:`${`${e.label}`.substring(0,I)}...`,y:s(`${e.id}`),x:0-d/2,width:d,height:s.bandwidth(),alignment:"center",style:h?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:b},r))})}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(0,${w})`,children:[t.jsxRuntimeExports.jsx("text",{style:{fill:l[0],textAnchor:"end",...h?.yAxis?.title},className:t.mo("text-base",n?.yAxis?.title),x:L/2-d/2,y:0,dx:-5,dy:20,children:B[0]}),t.jsxRuntimeExports.jsx("text",{style:{fill:l[1],textAnchor:"start",...h?.yAxis?.title},className:t.mo("text-base",n?.yAxis?.title),x:L/2+d/2,y:0,dx:5,dy:20,children:B[1]})]}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),re&&J&&ae&&C?t.jsxRuntimeExports.jsx(Ae.Tooltip,{data:re,body:J,xPos:ae,yPos:C,backgroundStyle:h?.tooltip,className:n?.tooltip}):null,M&&q!==void 0?t.jsxRuntimeExports.jsx(Me.X,{open:q!==void 0,onClose:()=>{D(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:Ce.string2HTML(M,q)}:void 0,children:typeof M=="function"?M(q):null})}):null]})}function Y(W,u,j,R){const l=W.map(E=>E[u]).filter(E=>!de.checkIfNullOrUndefined(E)),d=de.checkIfNullOrUndefined(j)?Math.min(...l)>=0?0:Math.min(...l):j,a=de.checkIfNullOrUndefined(R)?Math.max(...l)<0?0:Math.max(...l):R;return{min:d,max:a}}function Ge(W){const{data:u,graphTitle:j,sources:R,graphDescription:l,height:d,width:a,footNote:E,padding:U,barColors:z=[Ee.Colors.light.categoricalColors.colors[0],Ee.Colors.light.categoricalColors.colors[1]],backgroundColor:B=!1,leftMargin:ne=20,rightMargin:oe=20,topMargin:_=25,bottomMargin:le=30,rightBarTitle:J="Right bar graph",leftBarTitle:O="Left bar graph",tooltip:xe,relativeHeight:I,onSeriesMouseOver:k,graphID:te,barPadding:G=.25,truncateBy:H=999,onSeriesMouseClick:ie,centerGap:M=100,showValues:h=!0,maxValue:n,minValue:A,refValues:m=[],suffix:P="",prefix:se="",showTicks:N=!0,showColorScale:$=!1,graphDownload:K=!1,dataDownload:Q=!1,language:b="en",colorLegendTitle:re,minHeight:v=0,theme:q="light",ariaLabel:D,resetSelectionOnDoubleClick:ae=!0,detailsOnClick:V,styles:C,classNames:p,noOfTicks:c=5,animate:L=!1,precision:w=2,customLayers:X=[],timeline:s={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:x="NA"}=W,[S,o]=y.useState(0),[Z,e]=y.useState(0),[r,f]=y.useState(s.autoplay),g=Ie.sort(Oe.uniqBy(u,"date",!0).map(i=>fe.parse(`${i}`,s.dateFormat||"yyyy",new Date).getTime()),(i,F)=>De.ascending(i,F)),[ue,ce]=y.useState(s.autoplay?0:g.length-1),ee=y.useRef(null),he=y.useRef(null);y.useEffect(()=>{const i=new ResizeObserver(F=>{o(a||F[0].target.clientWidth||620),e(d||F[0].target.clientHeight||480)});return ee.current&&(e(ee.current.clientHeight||480),o(ee.current.clientWidth||620),a||i.observe(ee.current)),()=>i.disconnect()},[a,d]),y.useEffect(()=>{const i=setInterval(()=>{ce(F=>F<g.length-1?F+1:0)},(s.speed||2)*1e3);return r||clearInterval(i),()=>clearInterval(i)},[g,r,s.speed]);const ge=pe.getSliderMarks(g,ue,s.showOnlyActiveDate,s.dateFormat||"yyyy");return t.jsxRuntimeExports.jsx("div",{className:`${q||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${B?B===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,a?"w-fit":"w-full",p?.graphContainer),style:{...C?.graphContainer||{},...B&&B!==!0?{backgroundColor:B}:{}},id:te,ref:he,"aria-label":D||`${j?`The graph shows ${j}. `:""}This is a diverging bar chart. ${l?` ${l}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:B?U||"1rem":U||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[j||l||K||Q?t.jsxRuntimeExports.jsx(qe.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:p?.title,description:p?.description},graphTitle:j,graphDescription:l,width:a,graphDownload:K?he.current:void 0,dataDownload:Q?u.map(i=>i.data).filter(i=>i!==void 0).length>0?u.map(i=>i.data).filter(i=>i!==void 0):u.filter(i=>i!==void 0):null}):null,s.enabled&&g.length>0&&ge?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!r)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":r?"Click to pause animation":"Click to play animation",children:r?t.jsxRuntimeExports.jsx(Be.Pause,{}):t.jsxRuntimeExports.jsx(Be.Play,{})}),t.jsxRuntimeExports.jsx(pe.xr,{min:g[0],max:g[g.length-1],marks:ge,step:null,defaultValue:g[g.length-1],value:g[ue],onChangeComplete:i=>{ce(g.indexOf(i))},onChange:i=>{ce(g.indexOf(i))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:u.length===0?t.jsxRuntimeExports.jsx(Se.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[$?t.jsxRuntimeExports.jsx(Ve.ColorLegend,{colorLegendTitle:re,colorDomain:[O,J],colors:z,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:ee,"aria-label":"Graph area",children:(a||S)&&(d||Z)?t.jsxRuntimeExports.jsx(Fe,{data:Te.ensureCompleteDataForButterFlyChart(u,s.dateFormat||"yyyy").filter(i=>s.enabled?i.date===fe.format(new Date(g[ue]),s.dateFormat||"yyyy"):i),barColors:z,width:a||S,centerGap:M,height:Math.max(v,d||(I?v?(a||S)*I>v?(a||S)*I:v:(a||S)*I:Z)),truncateBy:H,leftMargin:ne,rightMargin:oe,topMargin:_,bottomMargin:le,axisTitles:[O,J],tooltip:xe,onSeriesMouseOver:k,barPadding:G,refValues:m,maxValue:Math.max(Y(u,"leftBar",A,n).max,Y(u,"rightBar",A,n).max),minValue:Math.min(Y(u,"leftBar",A,n).min,Y(u,"rightBar",A,n).min),minValueLeftBar:Y(u,"leftBar",A,n).min,minValueRightBar:Y(u,"rightBar",A,n).min,showValues:h,onSeriesMouseClick:ie,showTicks:N,suffix:P,prefix:se,resetSelectionOnDoubleClick:ae,detailsOnClick:V,styles:C,classNames:p,noOfTicks:c,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},precision:w,customLayers:X,naLabel:x}):null})]})}),R||E?t.jsxRuntimeExports.jsx($e.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:R,footNote:E,width:a}):null]})})})})}exports.ButterflyChart=Ge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),y=require("react"),pe=require("./getSliderMarks-CUxPy36E.cjs"),fe=require("./parse-hMnG_lRV.cjs"),ye=require("./index-DQA8q5sC.cjs"),Me=require("./Modal-CuuJdWkD.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),Ae=require("./Tooltip-Cpv0QohJ.cjs"),Ce=require("./string2HTML-z7CwHXcx.cjs"),be=require("./XTicksAndGridLines-RKy7BVCO.cjs"),ve=require("./Axis-CkNn1wit.cjs"),Le=require("./YAxesLabels-Dqd259-t.cjs"),we=require("./ReferenceLine-D04j-zeV.cjs"),ke=require("./band-CAApY4Pd.cjs"),Re=require("./linear-BVckp9RD.cjs"),Ne=require("./use-in-view-CEwlc_dd.cjs"),T=require("./proxy-CKadx4lC.cjs"),me=require("./index-Cm8NIdOO.cjs"),$e=require("./GraphFooter.cjs"),qe=require("./GraphHeader.cjs"),Ve=require("./ColorLegend.cjs"),Ee=require("./Colors.cjs"),Se=require("./EmptyState-B8IpKGcL.cjs"),Be=require("./index-C0bpbS4F.cjs"),de=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Te=require("./ensureCompleteData-DkQYPeDa.cjs"),Oe=require("./uniqBy-O05lp2S5.cjs"),Ie=require("./sort-O96oMZLb.cjs"),De=require("./init-DU0ybBc_.cjs");function Fe(W){const{data:u,width:j,height:R,barColors:l,centerGap:d,refValues:a,maxValue:E,minValue:U,showValues:z,axisTitles:B,rightMargin:ne,leftMargin:oe,topMargin:_,bottomMargin:le,tooltip:J,onSeriesMouseOver:O,barPadding:xe,truncateBy:I,onSeriesMouseClick:k,showTicks:te,suffix:G,prefix:H,resetSelectionOnDoubleClick:ie,detailsOnClick:M,styles:h,classNames:n,noOfTicks:A,animate:m,precision:P,customLayers:se,minValueLeftBar:N,minValueRightBar:$,naLabel:K}=W,Q=y.useRef(null),b=Ne.useInView(Q,{once:m.once,amount:m.amount}),[re,v]=y.useState(void 0),[q,D]=y.useState(void 0),[ae,V]=y.useState(void 0),[C,p]=y.useState(void 0),c={top:_,bottom:le,left:oe,right:ne},L=j-c.left-c.right,w=R-c.top-c.bottom,X=u.map((e,r)=>({...e,id:`${r}`})),s=ke.band().domain(X.map(e=>`${e.id}`)).range([w,0]).paddingInner(xe),x=Re.linear().domain([U,E]).range([0,(L-d)/2]).nice(),S=x.ticks(A),o=Re.linear().domain([U,E]).range([(L-d)/2,0]).nice(),Z=o.ticks(A);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${j}px`,height:`${R}px`,viewBox:`0 0 ${j} ${R}`,direction:"ltr",ref:Q,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${c.left},${c.top})`,children:[se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{transform:"translate(0,0)",children:[te?t.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:Z.filter(e=>e!==0),x:Z.filter(e=>e!==0).map(e=>o(e)),y1:0-_,y2:w+c.bottom,styles:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:G,prefix:H,labelType:"secondary",showGridLines:!0,leftLabel:!0,precision:P}):null,t.jsxRuntimeExports.jsxs(me.AnimatePresence,{children:[X.map((e,r)=>t.jsxRuntimeExports.jsxs(T.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{v(e),p(f.clientY),V(f.clientX),O?.(e)},onClick:()=>{(k||M)&&(ye.isEqual(q,e)&&ie?(D(void 0),k?.(void 0)):(D(e),k?.(e)))},onMouseMove:f=>{v(e),p(f.clientY),V(f.clientX)},onMouseLeave:()=>{v(void 0),V(void 0),p(void 0),O?.(void 0)},children:[e.leftBar?t.jsxRuntimeExports.jsx(T.motion.rect,{y:s(`${r}`),style:{fill:l[0]},height:s.bandwidth(),variants:{initial:{x:o(0),width:0},whileInView:{x:e.leftBar<0?o(0):o(e.leftBar),width:e.leftBar<0?o(e.leftBar)-o(0):o(0)-o(e.leftBar),transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",exit:{x:o(0),width:0,transition:{duration:m.duration}}}):null,z?t.jsxRuntimeExports.jsx(T.motion.text,{y:s(`${r}`)+s.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar>0?"end":"start",...h?.graphObjectValues||{}},dx:e.rightBar&&e.rightBar>0?-5:5,dy:"0.33em",className:t.mo("graph-value text-sm",n?.graphObjectValues),exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:o(0),opacity:0,fill:l[0]},whileInView:{x:e.leftBar?o(e.leftBar):o(N<0?0:N),opacity:1,fill:l[0],transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",children:je.numberFormattingFunction(e.rightBar,K,P,H,G)}):null]},e.label)),t.jsxRuntimeExports.jsx(ve.Axis,{y1:-2.5,y2:w+c.bottom,x1:o(N<0?0:N),x2:o(N<0?0:N),classNames:{axis:n?.yAxis?.axis},styles:{axis:h?.yAxis?.axis}}),a?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a.map((e,r)=>t.jsxRuntimeExports.jsx(we.RefLineX,{text:e.text,color:e.color,x:o(e.value),y1:0-c.top,y2:w+c.bottom,textSide:"left",classNames:e.classNames,styles:e.styles,animate:m,isInView:b},r))}):null]})]}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(${(L+d)/2},0)`,children:[te?t.jsxRuntimeExports.jsx(be.XTicksAndGridLines,{values:S.filter(e=>e!==0),x:S.filter(e=>e!==0).map(e=>x(e)),y1:0-_,y2:w+c.bottom,styles:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},classNames:{gridLines:n?.xAxis?.gridLines,labels:n?.xAxis?.labels},suffix:G,prefix:H,labelType:"secondary",showGridLines:!0,precision:P}):null,t.jsxRuntimeExports.jsxs(me.AnimatePresence,{children:[X.map((e,r)=>t.jsxRuntimeExports.jsxs(T.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{v(e),p(f.clientY),V(f.clientX),O?.(e)},onClick:()=>{(k||M)&&(ye.isEqual(q,e)&&ie?(D(void 0),k?.(void 0)):(D(e),k?.(e)))},onMouseMove:f=>{v(e),p(f.clientY),V(f.clientX)},onMouseLeave:()=>{v(void 0),V(void 0),p(void 0),O?.(void 0)},children:[e.rightBar?t.jsxRuntimeExports.jsx(T.motion.rect,{y:s(`${r}`),style:{fill:l[1]},height:s.bandwidth(),exit:{x:x(0),width:0,transition:{duration:m.duration}},variants:{initial:{x:x(0),width:0},whileInView:{x:e.rightBar>=0?x(0):x(e.rightBar),width:e.rightBar>=0?x(e.rightBar)-x(0):x(0)-x(e.rightBar),transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial"}):null,z?t.jsxRuntimeExports.jsx(T.motion.text,{y:s(`${r}`)+s.bandwidth()/2,style:{textAnchor:e.rightBar&&e.rightBar<0?"end":"start",...h?.graphObjectValues||{}},className:t.mo("graph-value text-sm",n?.graphObjectValues),dx:e.rightBar&&e.rightBar<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:m.duration}},variants:{initial:{x:x(0),opacity:0,fill:l[1]},whileInView:{x:e.rightBar?x(e.rightBar):x($<0?0:$),opacity:1,fill:l[1],transition:{duration:m.duration}}},initial:"initial",animate:b?"whileInView":"initial",children:je.numberFormattingFunction(e.rightBar,K,P,H,G)}):null]},r)),t.jsxRuntimeExports.jsx(ve.Axis,{y1:-2.5,y2:w+c.bottom,x1:x($<0?0:$),x2:x($<0?0:$),classNames:{axis:n?.yAxis?.axis},styles:{axis:h?.yAxis?.axis}}),a?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:a.map((e,r)=>t.jsxRuntimeExports.jsx(we.RefLineX,{text:e.text,color:e.color,x:x(e.value),y1:0-c.top,y2:w+c.bottom,textSide:"right",classNames:e.classNames,styles:e.styles,animate:m,isInView:b},r))}):null]})]}),t.jsxRuntimeExports.jsx(me.AnimatePresence,{children:t.jsxRuntimeExports.jsx(T.motion.g,{transform:`translate(${L/2},0)`,children:X.map((e,r)=>t.jsxRuntimeExports.jsx(Le.YAxesLabels,{value:`${e.label}`.length<I?`${e.label}`:`${`${e.label}`.substring(0,I)}...`,y:s(`${e.id}`),x:0-d/2,width:d,height:s.bandwidth(),alignment:"center",style:h?.yAxis?.labels,className:n?.yAxis?.labels,animate:m,isInView:b},r))})}),t.jsxRuntimeExports.jsxs("g",{transform:`translate(0,${w})`,children:[t.jsxRuntimeExports.jsx("text",{style:{fill:l[0],textAnchor:"end",...h?.yAxis?.title},className:t.mo("text-base",n?.yAxis?.title),x:L/2-d/2,y:0,dx:-5,dy:20,children:B[0]}),t.jsxRuntimeExports.jsx("text",{style:{fill:l[1],textAnchor:"start",...h?.yAxis?.title},className:t.mo("text-base",n?.yAxis?.title),x:L/2+d/2,y:0,dx:5,dy:20,children:B[1]})]}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),re&&J&&ae&&C?t.jsxRuntimeExports.jsx(Ae.Tooltip,{data:re,body:J,xPos:ae,yPos:C,backgroundStyle:h?.tooltip,className:n?.tooltip}):null,M&&q!==void 0?t.jsxRuntimeExports.jsx(Me.G,{open:q!==void 0,onClose:()=>{D(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:Ce.string2HTML(M,q)}:void 0,children:typeof M=="function"?M(q):null})}):null]})}function Y(W,u,j,R){const l=W.map(E=>E[u]).filter(E=>!de.checkIfNullOrUndefined(E)),d=de.checkIfNullOrUndefined(j)?Math.min(...l)>=0?0:Math.min(...l):j,a=de.checkIfNullOrUndefined(R)?Math.max(...l)<0?0:Math.max(...l):R;return{min:d,max:a}}function Ge(W){const{data:u,graphTitle:j,sources:R,graphDescription:l,height:d,width:a,footNote:E,padding:U,barColors:z=[Ee.Colors.light.categoricalColors.colors[0],Ee.Colors.light.categoricalColors.colors[1]],backgroundColor:B=!1,leftMargin:ne=20,rightMargin:oe=20,topMargin:_=25,bottomMargin:le=30,rightBarTitle:J="Right bar graph",leftBarTitle:O="Left bar graph",tooltip:xe,relativeHeight:I,onSeriesMouseOver:k,graphID:te,barPadding:G=.25,truncateBy:H=999,onSeriesMouseClick:ie,centerGap:M=100,showValues:h=!0,maxValue:n,minValue:A,refValues:m=[],suffix:P="",prefix:se="",showTicks:N=!0,showColorScale:$=!1,graphDownload:K=!1,dataDownload:Q=!1,language:b="en",colorLegendTitle:re,minHeight:v=0,theme:q="light",ariaLabel:D,resetSelectionOnDoubleClick:ae=!0,detailsOnClick:V,styles:C,classNames:p,noOfTicks:c=5,animate:L=!1,precision:w=2,customLayers:X=[],timeline:s={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:x="NA"}=W,[S,o]=y.useState(0),[Z,e]=y.useState(0),[r,f]=y.useState(s.autoplay),g=Ie.sort(Oe.uniqBy(u,"date",!0).map(i=>fe.parse(`${i}`,s.dateFormat||"yyyy",new Date).getTime()),(i,F)=>De.ascending(i,F)),[ue,ce]=y.useState(s.autoplay?0:g.length-1),ee=y.useRef(null),he=y.useRef(null);y.useEffect(()=>{const i=new ResizeObserver(F=>{o(a||F[0].target.clientWidth||620),e(d||F[0].target.clientHeight||480)});return ee.current&&(e(ee.current.clientHeight||480),o(ee.current.clientWidth||620),a||i.observe(ee.current)),()=>i.disconnect()},[a,d]),y.useEffect(()=>{const i=setInterval(()=>{ce(F=>F<g.length-1?F+1:0)},(s.speed||2)*1e3);return r||clearInterval(i),()=>clearInterval(i)},[g,r,s.speed]);const ge=pe.getSliderMarks(g,ue,s.showOnlyActiveDate,s.dateFormat||"yyyy");return t.jsxRuntimeExports.jsx("div",{className:`${q||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:b==="he"||b==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${B?B===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${b||"en"}`,a?"w-fit":"w-full",p?.graphContainer),style:{...C?.graphContainer||{},...B&&B!==!0?{backgroundColor:B}:{}},id:te,ref:he,"aria-label":D||`${j?`The graph shows ${j}. `:""}This is a diverging bar chart. ${l?` ${l}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:B?U||"1rem":U||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[j||l||K||Q?t.jsxRuntimeExports.jsx(qe.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:p?.title,description:p?.description},graphTitle:j,graphDescription:l,width:a,graphDownload:K?he.current:void 0,dataDownload:Q?u.map(i=>i.data).filter(i=>i!==void 0).length>0?u.map(i=>i.data).filter(i=>i!==void 0):u.filter(i=>i!==void 0):null}):null,s.enabled&&g.length>0&&ge?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{f(!r)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":r?"Click to pause animation":"Click to play animation",children:r?t.jsxRuntimeExports.jsx(Be.Pause,{}):t.jsxRuntimeExports.jsx(Be.Play,{})}),t.jsxRuntimeExports.jsx(pe.xr,{min:g[0],max:g[g.length-1],marks:ge,step:null,defaultValue:g[g.length-1],value:g[ue],onChangeComplete:i=>{ce(g.indexOf(i))},onChange:i=>{ce(g.indexOf(i))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:u.length===0?t.jsxRuntimeExports.jsx(Se.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[$?t.jsxRuntimeExports.jsx(Ve.ColorLegend,{colorLegendTitle:re,colorDomain:[O,J],colors:z,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:ee,"aria-label":"Graph area",children:(a||S)&&(d||Z)?t.jsxRuntimeExports.jsx(Fe,{data:Te.ensureCompleteDataForButterFlyChart(u,s.dateFormat||"yyyy").filter(i=>s.enabled?i.date===fe.format(new Date(g[ue]),s.dateFormat||"yyyy"):i),barColors:z,width:a||S,centerGap:M,height:Math.max(v,d||(I?v?(a||S)*I>v?(a||S)*I:v:(a||S)*I:Z)),truncateBy:H,leftMargin:ne,rightMargin:oe,topMargin:_,bottomMargin:le,axisTitles:[O,J],tooltip:xe,onSeriesMouseOver:k,barPadding:G,refValues:m,maxValue:Math.max(Y(u,"leftBar",A,n).max,Y(u,"rightBar",A,n).max),minValue:Math.min(Y(u,"leftBar",A,n).min,Y(u,"rightBar",A,n).min),minValueLeftBar:Y(u,"leftBar",A,n).min,minValueRightBar:Y(u,"rightBar",A,n).min,showValues:h,onSeriesMouseClick:ie,showTicks:N,suffix:P,prefix:se,resetSelectionOnDoubleClick:ae,detailsOnClick:V,styles:C,classNames:p,noOfTicks:c,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},precision:w,customLayers:X,naLabel:x}):null})]})}),R||E?t.jsxRuntimeExports.jsx($e.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:R,footNote:E,width:a}):null]})})})})}exports.ButterflyChart=Ge;
|
|
2
2
|
//# sourceMappingURL=ButterflyChart.cjs.map
|
package/dist/ButterflyChart.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { j as e, m as et } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as e, m as et } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as gt, useState as S, useEffect as yt } from "react";
|
|
3
|
-
import { g as Nt, x as At } from "./getSliderMarks-
|
|
3
|
+
import { g as Nt, x as At } from "./getSliderMarks-_pYOWEtO.js";
|
|
4
4
|
import { p as Ct, f as kt } from "./parse-DlCRUFh_.js";
|
|
5
5
|
import { i as bt } from "./index-Bwrro8-q.js";
|
|
6
|
-
import {
|
|
6
|
+
import { G as Lt } from "./Modal-Cg8daIlV.js";
|
|
7
7
|
import { n as vt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
|
-
import { T as Vt } from "./Tooltip-
|
|
8
|
+
import { T as Vt } from "./Tooltip-6LIdPQGC.js";
|
|
9
9
|
import { s as Tt } from "./string2HTML-oFCROsus.js";
|
|
10
|
-
import { X as wt } from "./XTicksAndGridLines-
|
|
11
|
-
import { A as jt } from "./Axis-
|
|
12
|
-
import { Y as Ot } from "./YAxesLabels-
|
|
13
|
-
import { a as Bt } from "./ReferenceLine-
|
|
10
|
+
import { X as wt } from "./XTicksAndGridLines-DuydSnZ_.js";
|
|
11
|
+
import { A as jt } from "./Axis-4gUOL8B7.js";
|
|
12
|
+
import { Y as Ot } from "./YAxesLabels-DlDyLvhi.js";
|
|
13
|
+
import { a as Bt } from "./ReferenceLine-CPMaAX0r.js";
|
|
14
14
|
import { b as Dt } from "./band-BEjh2CHI.js";
|
|
15
15
|
import { a as Mt } from "./linear-DUdu7l2G.js";
|
|
16
|
-
import { u as It } from "./use-in-view-
|
|
17
|
-
import { m as I } from "./proxy-
|
|
18
|
-
import { A as dt } from "./index-
|
|
16
|
+
import { u as It } from "./use-in-view-DR-UTB96.js";
|
|
17
|
+
import { m as I } from "./proxy-BYIC9BuT.js";
|
|
18
|
+
import { A as dt } from "./index-Cwgh7i7X.js";
|
|
19
19
|
import { GraphFooter as St } from "./GraphFooter.js";
|
|
20
20
|
import { GraphHeader as Ft } from "./GraphHeader.js";
|
|
21
|
-
import { ColorLegend as
|
|
21
|
+
import { ColorLegend as Gt } from "./ColorLegend.js";
|
|
22
22
|
import { Colors as $t } from "./Colors.js";
|
|
23
|
-
import { E as
|
|
24
|
-
import { P as
|
|
23
|
+
import { E as Ht } from "./EmptyState-36lXXyui.js";
|
|
24
|
+
import { P as Pt, f as Rt } from "./index-zZjQEHlm.js";
|
|
25
25
|
import { c as ut } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
26
26
|
import { a as Et } from "./ensureCompleteData-DlmibgaI.js";
|
|
27
|
-
import { u as
|
|
27
|
+
import { u as Xt } from "./uniqBy-BHy4I8PK.js";
|
|
28
28
|
import { s as Yt } from "./sort-DfK1b0F5.js";
|
|
29
29
|
import { c as Wt } from "./init-BhZylTFx.js";
|
|
30
30
|
function zt(z) {
|
|
@@ -46,10 +46,10 @@ function zt(z) {
|
|
|
46
46
|
tooltip: J,
|
|
47
47
|
onSeriesMouseOver: F,
|
|
48
48
|
barPadding: mt,
|
|
49
|
-
truncateBy:
|
|
49
|
+
truncateBy: G,
|
|
50
50
|
onSeriesMouseClick: k,
|
|
51
51
|
showTicks: it,
|
|
52
|
-
suffix:
|
|
52
|
+
suffix: R,
|
|
53
53
|
prefix: E,
|
|
54
54
|
resetSelectionOnDoubleClick: at,
|
|
55
55
|
detailsOnClick: $,
|
|
@@ -57,7 +57,7 @@ function zt(z) {
|
|
|
57
57
|
classNames: l,
|
|
58
58
|
noOfTicks: N,
|
|
59
59
|
animate: x,
|
|
60
|
-
precision:
|
|
60
|
+
precision: X,
|
|
61
61
|
customLayers: rt,
|
|
62
62
|
minValueLeftBar: L,
|
|
63
63
|
minValueRightBar: V,
|
|
@@ -65,7 +65,7 @@ function zt(z) {
|
|
|
65
65
|
} = z, Q = gt(null), b = It(Q, {
|
|
66
66
|
once: x.once,
|
|
67
67
|
amount: x.amount
|
|
68
|
-
}), [st, v] = S(void 0), [T,
|
|
68
|
+
}), [st, v] = S(void 0), [T, H] = S(void 0), [lt, O] = S(void 0), [A, f] = S(void 0), h = {
|
|
69
69
|
top: _,
|
|
70
70
|
bottom: ct,
|
|
71
71
|
left: ot,
|
|
@@ -98,12 +98,12 @@ function zt(z) {
|
|
|
98
98
|
gridLines: l?.xAxis?.gridLines,
|
|
99
99
|
labels: l?.xAxis?.labels
|
|
100
100
|
},
|
|
101
|
-
suffix:
|
|
101
|
+
suffix: R,
|
|
102
102
|
prefix: E,
|
|
103
103
|
labelType: "secondary",
|
|
104
104
|
showGridLines: !0,
|
|
105
105
|
leftLabel: !0,
|
|
106
|
-
precision:
|
|
106
|
+
precision: X
|
|
107
107
|
}
|
|
108
108
|
) : null,
|
|
109
109
|
/* @__PURE__ */ e.jsxs(dt, { children: [
|
|
@@ -116,7 +116,7 @@ function zt(z) {
|
|
|
116
116
|
v(t), f(p.clientY), O(p.clientX), F?.(t);
|
|
117
117
|
},
|
|
118
118
|
onClick: () => {
|
|
119
|
-
(k || $) && (bt(T, t) && at ? (
|
|
119
|
+
(k || $) && (bt(T, t) && at ? (H(void 0), k?.(void 0)) : (H(t), k?.(t)));
|
|
120
120
|
},
|
|
121
121
|
onMouseMove: (p) => {
|
|
122
122
|
v(t), f(p.clientY), O(p.clientX);
|
|
@@ -181,7 +181,7 @@ function zt(z) {
|
|
|
181
181
|
},
|
|
182
182
|
initial: "initial",
|
|
183
183
|
animate: b ? "whileInView" : "initial",
|
|
184
|
-
children: vt(t.rightBar, K,
|
|
184
|
+
children: vt(t.rightBar, K, X, E, R)
|
|
185
185
|
}
|
|
186
186
|
) : null
|
|
187
187
|
]
|
|
@@ -233,11 +233,11 @@ function zt(z) {
|
|
|
233
233
|
gridLines: l?.xAxis?.gridLines,
|
|
234
234
|
labels: l?.xAxis?.labels
|
|
235
235
|
},
|
|
236
|
-
suffix:
|
|
236
|
+
suffix: R,
|
|
237
237
|
prefix: E,
|
|
238
238
|
labelType: "secondary",
|
|
239
239
|
showGridLines: !0,
|
|
240
|
-
precision:
|
|
240
|
+
precision: X
|
|
241
241
|
}
|
|
242
242
|
) : null,
|
|
243
243
|
/* @__PURE__ */ e.jsxs(dt, { children: [
|
|
@@ -250,7 +250,7 @@ function zt(z) {
|
|
|
250
250
|
v(t), f(p.clientY), O(p.clientX), F?.(t);
|
|
251
251
|
},
|
|
252
252
|
onClick: () => {
|
|
253
|
-
(k || $) && (bt(T, t) && at ? (
|
|
253
|
+
(k || $) && (bt(T, t) && at ? (H(void 0), k?.(void 0)) : (H(t), k?.(t)));
|
|
254
254
|
},
|
|
255
255
|
onMouseMove: (p) => {
|
|
256
256
|
v(t), f(p.clientY), O(p.clientX);
|
|
@@ -315,7 +315,7 @@ function zt(z) {
|
|
|
315
315
|
},
|
|
316
316
|
initial: "initial",
|
|
317
317
|
animate: b ? "whileInView" : "initial",
|
|
318
|
-
children: vt(t.rightBar, K,
|
|
318
|
+
children: vt(t.rightBar, K, X, E, R)
|
|
319
319
|
}
|
|
320
320
|
) : null
|
|
321
321
|
]
|
|
@@ -354,7 +354,7 @@ function zt(z) {
|
|
|
354
354
|
/* @__PURE__ */ e.jsx(dt, { children: /* @__PURE__ */ e.jsx(I.g, { transform: `translate(${C / 2},0)`, children: Y.map((t, r) => /* @__PURE__ */ e.jsx(
|
|
355
355
|
Ot,
|
|
356
356
|
{
|
|
357
|
-
value: `${t.label}`.length <
|
|
357
|
+
value: `${t.label}`.length < G ? `${t.label}` : `${`${t.label}`.substring(0, G)}...`,
|
|
358
358
|
y: a(`${t.id}`),
|
|
359
359
|
x: 0 - d / 2,
|
|
360
360
|
width: d,
|
|
@@ -421,7 +421,7 @@ function zt(z) {
|
|
|
421
421
|
{
|
|
422
422
|
open: T !== void 0,
|
|
423
423
|
onClose: () => {
|
|
424
|
-
|
|
424
|
+
H(void 0);
|
|
425
425
|
},
|
|
426
426
|
children: /* @__PURE__ */ e.jsx(
|
|
427
427
|
"div",
|
|
@@ -461,10 +461,10 @@ function je(z) {
|
|
|
461
461
|
rightBarTitle: J = "Right bar graph",
|
|
462
462
|
leftBarTitle: F = "Left bar graph",
|
|
463
463
|
tooltip: mt,
|
|
464
|
-
relativeHeight:
|
|
464
|
+
relativeHeight: G,
|
|
465
465
|
onSeriesMouseOver: k,
|
|
466
466
|
graphID: it,
|
|
467
|
-
barPadding:
|
|
467
|
+
barPadding: R = 0.25,
|
|
468
468
|
truncateBy: E = 999,
|
|
469
469
|
onSeriesMouseClick: at,
|
|
470
470
|
centerGap: $ = 100,
|
|
@@ -472,7 +472,7 @@ function je(z) {
|
|
|
472
472
|
maxValue: l,
|
|
473
473
|
minValue: N,
|
|
474
474
|
refValues: x = [],
|
|
475
|
-
suffix:
|
|
475
|
+
suffix: X = "",
|
|
476
476
|
prefix: rt = "",
|
|
477
477
|
showTicks: L = !0,
|
|
478
478
|
showColorScale: V = !1,
|
|
@@ -482,7 +482,7 @@ function je(z) {
|
|
|
482
482
|
colorLegendTitle: st,
|
|
483
483
|
minHeight: v = 0,
|
|
484
484
|
theme: T = "light",
|
|
485
|
-
ariaLabel:
|
|
485
|
+
ariaLabel: H,
|
|
486
486
|
resetSelectionOnDoubleClick: lt = !0,
|
|
487
487
|
detailsOnClick: O,
|
|
488
488
|
styles: A,
|
|
@@ -494,20 +494,20 @@ function je(z) {
|
|
|
494
494
|
timeline: a = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
495
495
|
naLabel: c = "NA"
|
|
496
496
|
} = z, [D, n] = S(0), [Z, t] = S(0), [r, p] = S(a.autoplay), g = Yt(
|
|
497
|
-
|
|
497
|
+
Xt(m, "date", !0).map(
|
|
498
498
|
(i) => Ct(`${i}`, a.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()
|
|
499
499
|
),
|
|
500
|
-
(i,
|
|
500
|
+
(i, P) => Wt(i, P)
|
|
501
501
|
), [ht, xt] = S(a.autoplay ? 0 : g.length - 1), tt = gt(null), ft = gt(null);
|
|
502
502
|
yt(() => {
|
|
503
|
-
const i = new ResizeObserver((
|
|
504
|
-
n(s ||
|
|
503
|
+
const i = new ResizeObserver((P) => {
|
|
504
|
+
n(s || P[0].target.clientWidth || 620), t(d || P[0].target.clientHeight || 480);
|
|
505
505
|
});
|
|
506
506
|
return tt.current && (t(tt.current.clientHeight || 480), n(tt.current.clientWidth || 620), s || i.observe(tt.current)), () => i.disconnect();
|
|
507
507
|
}, [s, d]), yt(() => {
|
|
508
508
|
const i = setInterval(
|
|
509
509
|
() => {
|
|
510
|
-
xt((
|
|
510
|
+
xt((P) => P < g.length - 1 ? P + 1 : 0);
|
|
511
511
|
},
|
|
512
512
|
(a.speed || 2) * 1e3
|
|
513
513
|
);
|
|
@@ -538,7 +538,7 @@ function je(z) {
|
|
|
538
538
|
},
|
|
539
539
|
id: it,
|
|
540
540
|
ref: ft,
|
|
541
|
-
"aria-label":
|
|
541
|
+
"aria-label": H || `${y ? `The graph shows ${y}. ` : ""}This is a diverging bar chart. ${o ? ` ${o}` : ""}`,
|
|
542
542
|
children: /* @__PURE__ */ e.jsx(
|
|
543
543
|
"div",
|
|
544
544
|
{
|
|
@@ -573,7 +573,7 @@ function je(z) {
|
|
|
573
573
|
},
|
|
574
574
|
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
575
575
|
"aria-label": r ? "Click to pause animation" : "Click to play animation",
|
|
576
|
-
children: r ? /* @__PURE__ */ e.jsx(
|
|
576
|
+
children: r ? /* @__PURE__ */ e.jsx(Pt, {}) : /* @__PURE__ */ e.jsx(Rt, {})
|
|
577
577
|
}
|
|
578
578
|
),
|
|
579
579
|
/* @__PURE__ */ e.jsx(
|
|
@@ -595,9 +595,9 @@ function je(z) {
|
|
|
595
595
|
}
|
|
596
596
|
)
|
|
597
597
|
] }) : null,
|
|
598
|
-
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: m.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
598
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: m.length === 0 ? /* @__PURE__ */ e.jsx(Ht, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
599
599
|
V ? /* @__PURE__ */ e.jsx(
|
|
600
|
-
|
|
600
|
+
Gt,
|
|
601
601
|
{
|
|
602
602
|
colorLegendTitle: st,
|
|
603
603
|
colorDomain: [F, J],
|
|
@@ -628,7 +628,7 @@ function je(z) {
|
|
|
628
628
|
centerGap: $,
|
|
629
629
|
height: Math.max(
|
|
630
630
|
v,
|
|
631
|
-
d || (
|
|
631
|
+
d || (G ? v ? (s || D) * G > v ? (s || D) * G : v : (s || D) * G : Z)
|
|
632
632
|
),
|
|
633
633
|
truncateBy: E,
|
|
634
634
|
leftMargin: nt,
|
|
@@ -638,7 +638,7 @@ function je(z) {
|
|
|
638
638
|
axisTitles: [F, J],
|
|
639
639
|
tooltip: mt,
|
|
640
640
|
onSeriesMouseOver: k,
|
|
641
|
-
barPadding:
|
|
641
|
+
barPadding: R,
|
|
642
642
|
refValues: x,
|
|
643
643
|
maxValue: Math.max(
|
|
644
644
|
W(m, "leftBar", N, l).max,
|
|
@@ -653,7 +653,7 @@ function je(z) {
|
|
|
653
653
|
showValues: u,
|
|
654
654
|
onSeriesMouseClick: at,
|
|
655
655
|
showTicks: L,
|
|
656
|
-
suffix:
|
|
656
|
+
suffix: X,
|
|
657
657
|
prefix: rt,
|
|
658
658
|
resetSelectionOnDoubleClick: lt,
|
|
659
659
|
detailsOnClick: O,
|
package/dist/ChoroplethMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),Ee=require("./getSliderMarks-CRIbTGYV.cjs"),we=require("./Spinner-DA6Z5E4n.cjs"),be=require("./parse-hMnG_lRV.cjs"),Re=require("./index-DQA8q5sC.cjs"),V=require("./zoom-BiMNsz72.cjs"),$e=require("./Modal-tXZlLE5s.cjs"),ke=require("./Typography-k-kOjICQ.cjs"),Ce=require("./index-CoZbeNM9.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),Se=require("./Tooltip-De16GWhY.cjs"),Me=require("./string2HTML-z7CwHXcx.cjs"),qe=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ve=require("./index-BW_-wD2k.cjs"),De=require("./ordinal-BOeNbyae.cjs"),Oe=require("./threshold-DNsSUf8Q.cjs"),je=require("./select-Bnfk0lJx.cjs"),Pe=require("./use-in-view-sQJZ_xDO.cjs"),ue=require("./proxy-BHRoeZgd.cjs"),Ie=require("./index-BW8iNx7E.cjs"),Le=require("./GraphFooter.cjs"),Te=require("./GraphHeader.cjs"),de=require("./Colors.cjs"),ze=require("./fetchAndParseData-Ba-_CgxS.cjs"),We=require("./getUniqValue-RViz8tTw.cjs"),Ve=require("./getJenks-GYmdwBqm.cjs"),Be=require("./uniqBy-O05lp2S5.cjs"),Fe=require("./sort-O96oMZLb.cjs"),He=require("./init-DU0ybBc_.cjs");function Ae(pe){const{data:E,colorDomain:h,colors:c,mapData:j,colorLegendTitle:B,categorical:q,height:x,width:n,scale:ae,centerPoint:T,tooltip:se,mapBorderWidth:D,mapBorderColor:F,mapNoDataColor:Y,onSeriesMouseOver:J,showColorScale:me,zoomScaleExtend:xe,zoomTranslateExtend:O,highlightedIds:H,onSeriesMouseClick:y,mapProperty:A,resetSelectionOnDoubleClick:he,detailsOnClick:$,styles:ge,classNames:ye,mapProjection:U,zoomInteraction:z,animate:b,dimmedOpacity:G,customLayers:ie}=pe,[k,C]=d.useState(void 0),K=d.useRef(null),[Z,v]=d.useState(!(n<680)),[N,Q]=d.useState(void 0),[_,ee]=d.useState(void 0),[S,w]=d.useState(void 0),[ne,te]=d.useState(void 0),P=d.useRef(null),re=Pe.useInView(P,{once:b.once,amount:b.amount}),le=d.useRef(null),f=q?De.ordinal().domain(h).range(c):Oe.threshold().domain(h).range(c);d.useEffect(()=>{const r=je.select(le.current),l=je.select(P.current),p=a=>{if(z==="noZoom")return!1;if(z==="button")return!a.type.includes("wheel");const i=a.type==="wheel",t=a.type.startsWith("touch"),o=a.type==="mousedown"||a.type==="mousemove";return t?!0:i?z==="scroll"?!0:a.ctrlKey:o&&!a.button&&!a.ctrlKey},s=V.zoom().scaleExtent(xe).translateExtent(O||[[-20,-20],[n+20,x+20]]).filter(p).on("zoom",({transform:a})=>{r.attr("transform",a)});l.call(s),K.current=s},[x,n,z]);const g=V.turf_bbox_default(j),I=Ce.turf_center_of_mass_default(j),oe=g[2]-g[0],ce=g[3]-g[1],W=n*190/960*360/oe,fe=x*190/678*180/ce,u=ae*Math.min(W,fe),R=U==="mercator"?V.geoMercator().rotate([0,0]).center(T||I.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="equalEarth"?V.geoEqualEarth().rotate([0,0]).center(T||I.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="naturalEarth"?V.geoNaturalEarth1().rotate([0,0]).center(T||I.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="orthographic"?V.geoOrthographic().rotate([0,0]).center(T||I.geometry.coordinates).translate([n/2,x/2]).scale(u):V.geoAlbersUsa().rotate([0,0]).center(T||I.geometry.coordinates).translate([n/2,x/2]).scale(u),X=r=>{if(!P.current||!K.current)return;je.select(P.current).call(K.current.scaleBy,r==="in"?1.2:1/1.2)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx(ue.motion.svg,{width:`${n}px`,height:`${x}px`,viewBox:`0 0 ${n} ${x}`,ref:P,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{ref:le,children:[ie.filter(r=>r.position==="before").map(r=>r.layer),j.features.map((r,l)=>E.findIndex(s=>s.id===r.properties[A])!==-1?null:e.jsxRuntimeExports.jsx("g",{opacity:k?G:H.length!==0?H.indexOf(r.properties[A])!==-1?1:G:1,children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((s,a)=>{let i="";return s.forEach(t=>{let o=" M";t.forEach((m,L)=>{const M=R([m[0],m[1]]);L!==t.length-1?o=`${o}${M[0]} ${M[1]}L`:o=`${o}${M[0]} ${M[1]}`}),i+=o}),e.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:F,strokeWidth:D,fill:Y}},a)}):r.geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((t,o)=>{const m=R([t[0],t[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),e.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:F,strokeWidth:D,fill:Y}},a)})},l)),e.jsxRuntimeExports.jsx(Ie.AnimatePresence,{children:E.map(r=>{const l=j.features.findIndex(s=>r.id===s.properties[A]),p=qe.checkIfNullOrUndefined(r.x)?Y:f(r.x);return e.jsxRuntimeExports.jsx(ue.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:k?k===p?1:G:H.length!==0?H.indexOf(r.id)!==-1?1:G:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:s=>{ee(r),te(s.clientY),w(s.clientX),J?.(r)},onMouseMove:s=>{ee(r),te(s.clientY),w(s.clientX)},onMouseLeave:()=>{ee(void 0),w(void 0),te(void 0),J?.(void 0)},onClick:()=>{(y||$)&&(Re.isEqual(N,r)&&he?(Q(void 0),y?.(void 0)):(Q(r),y?.(r)))},children:l===-1?null:j.features[l].geometry.type==="MultiPolygon"?j.features[l].geometry.coordinates.map((s,a)=>{let i="";return s.forEach(t=>{let o=" M";t.forEach((m,L)=>{const M=R([m[0],m[1]]);L!==t.length-1?o=`${o}${M[0]} ${M[1]}L`:o=`${o}${M[0]} ${M[1]}`}),i+=o}),e.jsxRuntimeExports.jsx(ue.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:F,strokeWidth:D}},`${r.id}-${a}`)}):j.features[l].geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((t,o)=>{const m=R([t[0],t[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),e.jsxRuntimeExports.jsx(ue.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:F,strokeWidth:D}},`${r.id}-${a}`)})},r.id)})}),_?j.features.filter(r=>r.properties[A]===_.id).map((r,l)=>e.jsxRuntimeExports.jsx("g",{children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((p,s)=>{let a="";return p.forEach(i=>{let t=" M";i.forEach((o,m)=>{const L=R([o[0],o[1]]);m!==i.length-1?t=`${t}${L[0]} ${L[1]}L`:t=`${t}${L[0]} ${L[1]}`}),a+=t}),e.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)}):r.geometry.coordinates.map((p,s)=>{let a="M";return p.forEach((i,t)=>{const o=R([i[0],i[1]]);t!==p.length-1?a=`${a}${o[0]} ${o[1]}L`:a=`${a}${o[0]} ${o[1]}`}),e.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)})},l)):null,ie.filter(r=>r.position==="after").map(r=>r.layer)]})}),me===!1?null:e.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:Z?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{v(!1)},children:e.jsxRuntimeExports.jsx(ve.X,{})}),e.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:q?void 0:"340px"},children:[B&&B!==""?e.jsxRuntimeExports.jsx(ke.u,{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:B}):null,q?e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:h.map((r,l)=>e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{C(c[l%c.length])},onMouseLeave:()=>{C(void 0)},children:[e.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[l%c.length]}}),e.jsxRuntimeExports.jsx(ke.u,{size:"sm",marginBottom:"none",leading:"none",children:r})]},l))}):e.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{children:[h.map((r,l)=>e.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{C(c[l])},onMouseLeave:()=>{C(void 0)},className:"cursor-pointer",children:[e.jsxRuntimeExports.jsx("rect",{x:l*320/c.length+1,y:1,width:320/c.length-2,height:8,className:k===c[l]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:c[l],...k===c[l]?{}:{stroke:c[l]}}}),e.jsxRuntimeExports.jsx("text",{x:(l+1)*320/c.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Ne.numberFormattingFunction(r,"NA")})]},l)),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{C(c[h.length])},onMouseLeave:()=>{C(void 0)},x:h.length*320/c.length+1,y:1,width:320/c.length-2,height:8,className:`cursor-pointer ${k===c[h.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:c[h.length],...k===c[h.length]?{}:{stroke:c[h.length]}}})})]})})]})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{v(!0)},children:e.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),z==="button"&&e.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[e.jsxRuntimeExports.jsx("button",{onClick:()=>X("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),e.jsxRuntimeExports.jsx("button",{onClick:()=>X("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-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),$&&N!==void 0?e.jsxRuntimeExports.jsx($e.X,{open:N!==void 0,onClose:()=>{Q(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:Me.string2HTML($,N)}:void 0,children:typeof $=="function"?$(N):null})}):null,_&&se&&S&&ne?e.jsxRuntimeExports.jsx(Se.Tooltip,{data:_,body:se,xPos:S,yPos:ne,backgroundStyle:ge?.tooltip,className:ye?.tooltip}):null]})}function Ue(pe){const{data:E,mapData:h="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:c,colors:j,sources:B,graphDescription:q,height:x,width:n,footNote:ae="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.",colorDomain:T,colorLegendTitle:se,scaleType:D="threshold",scale:F=.95,centerPoint:Y,padding:J,mapBorderWidth:me=.5,mapNoDataColor:xe=de.Colors.light.graphNoData,backgroundColor:O=!1,mapBorderColor:H=de.Colors.light.grays["gray-500"],relativeHeight:y,tooltip:A,onSeriesMouseOver:he,isWorldMap:$=!0,showColorScale:ge=!0,zoomScaleExtend:ye=[.8,6],zoomTranslateExtend:U,graphID:z,highlightedIds:b=[],onSeriesMouseClick:G,mapProperty:ie="ISO3",graphDownload:k=!1,dataDownload:C=!1,showAntarctica:K=!1,language:Z="en",minHeight:v=0,theme:N="light",ariaLabel:Q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:ee,styles:S,classNames:w,mapProjection:ne,zoomInteraction:te="button",animate:P=!1,dimmedOpacity:re=.3,customLayers:le=[],timeline:f={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=pe,[g,I]=d.useState(0),[oe,ce]=d.useState(0),[W,fe]=d.useState(f.autoplay),u=Fe.sort(Be.uniqBy(E,"date",!0).map(t=>be.parse(`${t}`,f.dateFormat||"yyyy",new Date).getTime()),(t,o)=>He.ascending(t,o)),[R,X]=d.useState(f.autoplay?0:u.length-1),[r,l]=d.useState(void 0),p=d.useRef(null),s=d.useRef(null);d.useEffect(()=>{const t=new ResizeObserver(o=>{I(n||o[0].target.clientWidth||760),ce(x||o[0].target.clientHeight||480)});return p.current&&(ce(p.current.clientHeight||480),I(p.current.clientWidth||760),n||t.observe(p.current)),()=>t.disconnect()},[n,x]),d.useEffect(()=>{typeof h=="string"?ze.fetchAndParseJSON(h).then(o=>{l(o)}):l(h)},[h]);const a=T||(D==="categorical"?We.getUniqValue(E,"x"):Ve.getJenks(E.map(t=>t.x),j?.length||4));d.useEffect(()=>{const t=setInterval(()=>{X(o=>o<u.length-1?o+1:0)},(f.speed||2)*1e3);return W||clearInterval(t),()=>clearInterval(t)},[u,W,f.speed]);const i=Ee.getSliderMarks(u,R,f.showOnlyActiveDate,f.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${N||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:Z==="he"||Z==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${O?O===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${Z||"en"}`,n?"w-fit":"w-full",w?.graphContainer),style:{...S?.graphContainer||{},...O&&O!==!0?{backgroundColor:O}:{}},id:z,ref:s,"aria-label":Q||`${c?`The graph shows ${c}. `:""}This is a choropleth map where geographic areas are colored in proportion to a specific variable.${q?` ${q}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:O?J||"1rem":J||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[c||q||k||C?e.jsxRuntimeExports.jsx(Te.GraphHeader,{styles:{title:S?.title,description:S?.description},classNames:{title:w?.title,description:w?.description},graphTitle:c,graphDescription:q,width:n,graphDownload:k?s.current:void 0,dataDownload:C?E.map(t=>t.data).filter(t=>t!==void 0).length>0?E.map(t=>t.data).filter(t=>t!==void 0):E.filter(t=>t!==void 0):null}):null,f.enabled&&u.length>0&&i?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{fe(!W)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":W?"Click to pause animation":"Click to play animation",children:W?e.jsxRuntimeExports.jsx(ve.Pause,{}):e.jsxRuntimeExports.jsx(ve.Play,{})}),e.jsxRuntimeExports.jsx(Ee.xr,{min:u[0],max:u[u.length-1],marks:i,step:null,defaultValue:u[u.length-1],value:u[R],onChangeComplete:t=>{X(u.indexOf(t))},onChange:t=>{X(u.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Map area",children:(n||g)&&(x||oe)&&r?e.jsxRuntimeExports.jsx(Ae,{data:E.filter(t=>f.enabled?t.date===be.format(new Date(u[R]),f.dateFormat||"yyyy"):t),mapData:K?r:{...r,features:r.features.filter(t=>t.properties.NAME!=="Antarctica")},colorDomain:a,width:n||g,height:Math.max(v,x||(y?v?(n||g)*y>v?(n||g)*y:v:(n||g)*y:oe)),scale:F,centerPoint:Y,colors:j||(D==="categorical"?de.Colors[N].sequentialColors[`neutralColorsx0${a.length}`]:de.Colors[N].sequentialColors[`neutralColorsx0${a.length+1}`]),colorLegendTitle:se,mapBorderWidth:me,mapNoDataColor:xe,categorical:D==="categorical",mapBorderColor:H,tooltip:A,onSeriesMouseOver:he,isWorldMap:$,showColorScale:ge,zoomScaleExtend:ye,zoomTranslateExtend:U,onSeriesMouseClick:G,mapProperty:ie,highlightedIds:b,resetSelectionOnDoubleClick:_,styles:S,classNames:w,detailsOnClick:ee,mapProjection:ne||($?"naturalEarth":"mercator"),zoomInteraction:te,dimmedOpacity:re,animate:P===!0?{duration:.5,once:!0,amount:.5}:P||{duration:0,once:!0,amount:0},customLayers:le}):e.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(v,x||(y?v?(n||g)*y>v?(n||g)*y:v:(n||g)*y:oe))}px`},className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(we.y,{"aria-label":"Loading graph"})})}),B||ae?e.jsxRuntimeExports.jsx(Le.GraphFooter,{styles:{footnote:S?.footnote,source:S?.source},classNames:{footnote:w?.footnote,source:w?.source},sources:B,footNote:ae,width:n}):null]})})})})}exports.ChoroplethMap=Ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),d=require("react"),Ee=require("./getSliderMarks-CUxPy36E.cjs"),Re=require("./Spinner-C6wLp85s.cjs"),ke=require("./parse-hMnG_lRV.cjs"),$e=require("./index-DQA8q5sC.cjs"),V=require("./zoom-BiMNsz72.cjs"),Ce=require("./Modal-CuuJdWkD.cjs"),we=require("./Typography-BDULiwlF.cjs"),Ne=require("./index-CoZbeNM9.cjs"),Se=require("./numberFormattingFunction-02t-wJta.cjs"),Me=require("./Tooltip-Cpv0QohJ.cjs"),qe=require("./string2HTML-z7CwHXcx.cjs"),De=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./index-C0bpbS4F.cjs"),Oe=require("./ordinal-BOeNbyae.cjs"),Pe=require("./threshold-DNsSUf8Q.cjs"),ve=require("./select-Bnfk0lJx.cjs"),Ie=require("./use-in-view-CEwlc_dd.cjs"),ue=require("./proxy-CKadx4lC.cjs"),Le=require("./index-Cm8NIdOO.cjs"),Te=require("./GraphFooter.cjs"),ze=require("./GraphHeader.cjs"),de=require("./Colors.cjs"),We=require("./fetchAndParseData-Ba-_CgxS.cjs"),Be=require("./getUniqValue-RViz8tTw.cjs"),Ve=require("./getJenks-GYmdwBqm.cjs"),Fe=require("./uniqBy-O05lp2S5.cjs"),He=require("./sort-O96oMZLb.cjs"),Ae=require("./init-DU0ybBc_.cjs");function Ge(pe){const{data:v,colorDomain:h,colors:c,mapData:j,colorLegendTitle:F,categorical:S,height:x,width:n,scale:se,centerPoint:I,tooltip:ie,mapBorderWidth:M,mapBorderColor:H,mapNoDataColor:Z,onSeriesMouseOver:Q,showColorScale:me,zoomScaleExtend:xe,zoomTranslateExtend:q,highlightedIds:A,onSeriesMouseClick:f,mapProperty:G,resetSelectionOnDoubleClick:he,detailsOnClick:$,styles:ge,classNames:ye,mapProjection:U,zoomInteraction:L,animate:b,dimmedOpacity:_,customLayers:ne,collapseColorScaleByDefault:ee}=pe,[E,D]=d.useState(void 0),T=d.useRef(null),[k,X]=d.useState(ee===void 0?!(n<680):!ee),[z,te]=d.useState(void 0),[Y,w]=d.useState(void 0),[C,re]=d.useState(void 0),[le,J]=d.useState(void 0),W=d.useRef(null),oe=Ie.useInView(W,{once:b.once,amount:b.amount}),g=d.useRef(null),fe=S?Oe.ordinal().domain(h).range(c):Pe.threshold().domain(h).range(c);d.useEffect(()=>{const r=ve.select(g.current),l=ve.select(W.current),p=a=>{if(L==="noZoom")return!1;if(L==="button")return!a.type.includes("wheel");const i=a.type==="wheel",t=a.type.startsWith("touch"),o=a.type==="mousedown"||a.type==="mousemove";return t?!0:i?L==="scroll"?!0:a.ctrlKey:o&&!a.button&&!a.ctrlKey},s=V.zoom().scaleExtent(xe).translateExtent(q||[[-20,-20],[n+20,x+20]]).filter(p).on("zoom",({transform:a})=>{r.attr("transform",a)});l.call(s),T.current=s},[x,n,L]);const y=V.turf_bbox_default(j),O=Ne.turf_center_of_mass_default(j),ae=y[2]-y[0],ce=y[3]-y[1],B=n*190/960*360/ae,je=x*190/678*180/ce,u=se*Math.min(B,je),R=U==="mercator"?V.geoMercator().rotate([0,0]).center(I||O.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="equalEarth"?V.geoEqualEarth().rotate([0,0]).center(I||O.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="naturalEarth"?V.geoNaturalEarth1().rotate([0,0]).center(I||O.geometry.coordinates).translate([n/2,x/2]).scale(u):U==="orthographic"?V.geoOrthographic().rotate([0,0]).center(I||O.geometry.coordinates).translate([n/2,x/2]).scale(u):V.geoAlbersUsa().rotate([0,0]).center(I||O.geometry.coordinates).translate([n/2,x/2]).scale(u),K=r=>{if(!W.current||!T.current)return;ve.select(W.current).call(T.current.scaleBy,r==="in"?1.2:1/1.2)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"relative",children:[e.jsxRuntimeExports.jsx(ue.motion.svg,{width:`${n}px`,height:`${x}px`,viewBox:`0 0 ${n} ${x}`,ref:W,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{ref:g,children:[ne.filter(r=>r.position==="before").map(r=>r.layer),j.features.map((r,l)=>v.findIndex(s=>s.id===r.properties[G])!==-1?null:e.jsxRuntimeExports.jsx("g",{opacity:E?_:A.length!==0?A.indexOf(r.properties[G])!==-1?1:_:1,children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((s,a)=>{let i="";return s.forEach(t=>{let o=" M";t.forEach((m,P)=>{const N=R([m[0],m[1]]);P!==t.length-1?o=`${o}${N[0]} ${N[1]}L`:o=`${o}${N[0]} ${N[1]}`}),i+=o}),e.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:H,strokeWidth:M,fill:Z}},a)}):r.geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((t,o)=>{const m=R([t[0],t[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),e.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:H,strokeWidth:M,fill:Z}},a)})},l)),e.jsxRuntimeExports.jsx(Le.AnimatePresence,{children:v.map(r=>{const l=j.features.findIndex(s=>r.id===s.properties[G]),p=De.checkIfNullOrUndefined(r.x)?Z:fe(r.x);return e.jsxRuntimeExports.jsx(ue.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:E?E===p?1:_:A.length!==0?A.indexOf(r.id)!==-1?1:_:1,transition:{duration:b.duration}}},initial:"initial",animate:oe?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:s=>{w(r),J(s.clientY),re(s.clientX),Q?.(r)},onMouseMove:s=>{w(r),J(s.clientY),re(s.clientX)},onMouseLeave:()=>{w(void 0),re(void 0),J(void 0),Q?.(void 0)},onClick:()=>{(f||$)&&($e.isEqual(z,r)&&he?(te(void 0),f?.(void 0)):(te(r),f?.(r)))},children:l===-1?null:j.features[l].geometry.type==="MultiPolygon"?j.features[l].geometry.coordinates.map((s,a)=>{let i="";return s.forEach(t=>{let o=" M";t.forEach((m,P)=>{const N=R([m[0],m[1]]);P!==t.length-1?o=`${o}${N[0]} ${N[1]}L`:o=`${o}${N[0]} ${N[1]}`}),i+=o}),e.jsxRuntimeExports.jsx(ue.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:oe?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:H,strokeWidth:M}},`${r.id}-${a}`)}):j.features[l].geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((t,o)=>{const m=R([t[0],t[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),e.jsxRuntimeExports.jsx(ue.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:oe?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:H,strokeWidth:M}},`${r.id}-${a}`)})},r.id)})}),Y?j.features.filter(r=>r.properties[G]===Y.id).map((r,l)=>e.jsxRuntimeExports.jsx("g",{children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((p,s)=>{let a="";return p.forEach(i=>{let t=" M";i.forEach((o,m)=>{const P=R([o[0],o[1]]);m!==i.length-1?t=`${t}${P[0]} ${P[1]}L`:t=`${t}${P[0]} ${P[1]}`}),a+=t}),e.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)}):r.geometry.coordinates.map((p,s)=>{let a="M";return p.forEach((i,t)=>{const o=R([i[0],i[1]]);t!==p.length-1?a=`${a}${o[0]} ${o[1]}L`:a=`${a}${o[0]} ${o[1]}`}),e.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)})},l)):null,ne.filter(r=>r.position==="after").map(r=>r.layer)]})}),me===!1?null:e.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4 map-color-legend",children:k?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{X(!1)},children:e.jsxRuntimeExports.jsx(be.X,{})}),e.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:S?void 0:"340px"},children:[F&&F!==""?e.jsxRuntimeExports.jsx(we.u,{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:F}):null,S?e.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:h.map((r,l)=>e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{D(c[l%c.length])},onMouseLeave:()=>{D(void 0)},children:[e.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[l%c.length]}}),e.jsxRuntimeExports.jsx(we.u,{size:"sm",marginBottom:"none",leading:"none",children:r})]},l))}):e.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{children:[h.map((r,l)=>e.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{D(c[l])},onMouseLeave:()=>{D(void 0)},className:"cursor-pointer",children:[e.jsxRuntimeExports.jsx("rect",{x:l*320/c.length+1,y:1,width:320/c.length-2,height:8,className:E===c[l]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:c[l],...E===c[l]?{}:{stroke:c[l]}}}),e.jsxRuntimeExports.jsx("text",{x:(l+1)*320/c.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Se.numberFormattingFunction(r,"NA")})]},l)),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{D(c[h.length])},onMouseLeave:()=>{D(void 0)},x:h.length*320/c.length+1,y:1,width:320/c.length-2,height:8,className:`cursor-pointer ${E===c[h.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:c[h.length],...E===c[h.length]?{}:{stroke:c[h.length]}}})})]})})]})]}):e.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start map-legend-button",onClick:()=>{X(!0)},children:e.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),L==="button"&&e.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[e.jsxRuntimeExports.jsx("button",{onClick:()=>K("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:"+"}),e.jsxRuntimeExports.jsx("button",{onClick:()=>K("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:"–"})]})]}),$&&z!==void 0?e.jsxRuntimeExports.jsx(Ce.G,{open:z!==void 0,onClose:()=>{te(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:qe.string2HTML($,z)}:void 0,children:typeof $=="function"?$(z):null})}):null,Y&&ie&&C&&le?e.jsxRuntimeExports.jsx(Me.Tooltip,{data:Y,body:ie,xPos:C,yPos:le,backgroundStyle:ge?.tooltip,className:ye?.tooltip}):null]})}function Ue(pe){const{data:v,mapData:h="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:c,colors:j,sources:F,graphDescription:S,height:x,width:n,footNote:se="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.",colorDomain:I,colorLegendTitle:ie,scaleType:M="threshold",scale:H=.95,centerPoint:Z,padding:Q,mapBorderWidth:me=.5,mapNoDataColor:xe=de.Colors.light.graphNoData,backgroundColor:q=!1,mapBorderColor:A=de.Colors.light.grays["gray-500"],relativeHeight:f,tooltip:G,onSeriesMouseOver:he,isWorldMap:$=!0,showColorScale:ge=!0,zoomScaleExtend:ye=[.8,6],zoomTranslateExtend:U,graphID:L,highlightedIds:b=[],onSeriesMouseClick:_,mapProperty:ne="ISO3",graphDownload:ee=!1,dataDownload:E=!1,showAntarctica:D=!1,language:T="en",minHeight:k=0,theme:X="light",ariaLabel:z,resetSelectionOnDoubleClick:te=!0,detailsOnClick:Y,styles:w,classNames:C,mapProjection:re,zoomInteraction:le="button",animate:J=!1,dimmedOpacity:W=.3,customLayers:oe=[],timeline:g={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},collapseColorScaleByDefault:fe}=pe,[y,O]=d.useState(0),[ae,ce]=d.useState(0),[B,je]=d.useState(g.autoplay),u=He.sort(Fe.uniqBy(v,"date",!0).map(t=>ke.parse(`${t}`,g.dateFormat||"yyyy",new Date).getTime()),(t,o)=>Ae.ascending(t,o)),[R,K]=d.useState(g.autoplay?0:u.length-1),[r,l]=d.useState(void 0),p=d.useRef(null),s=d.useRef(null);d.useEffect(()=>{const t=new ResizeObserver(o=>{O(n||o[0].target.clientWidth||760),ce(x||o[0].target.clientHeight||480)});return p.current&&(ce(p.current.clientHeight||480),O(p.current.clientWidth||760),n||t.observe(p.current)),()=>t.disconnect()},[n,x]),d.useEffect(()=>{typeof h=="string"?We.fetchAndParseJSON(h).then(o=>{l(o)}):l(h)},[h]);const a=I||(M==="categorical"?Be.getUniqValue(v,"x"):Ve.getJenks(v.map(t=>t.x),j?.length||4));d.useEffect(()=>{const t=setInterval(()=>{K(o=>o<u.length-1?o+1:0)},(g.speed||2)*1e3);return B||clearInterval(t),()=>clearInterval(t)},[u,B,g.speed]);const i=Ee.getSliderMarks(u,R,g.showOnlyActiveDate,g.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${X||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:T==="he"||T==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${q?q===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,n?"w-fit":"w-full",C?.graphContainer),style:{...w?.graphContainer||{},...q&&q!==!0?{backgroundColor:q}:{}},id:L,ref:s,"aria-label":z||`${c?`The graph shows ${c}. `:""}This is a choropleth map where geographic areas are colored in proportion to a specific variable.${S?` ${S}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:q?Q||"1rem":Q||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[c||S||ee||E?e.jsxRuntimeExports.jsx(ze.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:C?.title,description:C?.description},graphTitle:c,graphDescription:S,width:n,graphDownload:ee?s.current:void 0,dataDownload:E?v.map(t=>t.data).filter(t=>t!==void 0).length>0?v.map(t=>t.data).filter(t=>t!==void 0):v.filter(t=>t!==void 0):null}):null,g.enabled&&u.length>0&&i?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{je(!B)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":B?"Click to pause animation":"Click to play animation",children:B?e.jsxRuntimeExports.jsx(be.Pause,{}):e.jsxRuntimeExports.jsx(be.Play,{})}),e.jsxRuntimeExports.jsx(Ee.xr,{min:u[0],max:u[u.length-1],marks:i,step:null,defaultValue:u[u.length-1],value:u[R],onChangeComplete:t=>{K(u.indexOf(t))},onChange:t=>{K(u.indexOf(t))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Map area",children:(n||y)&&(x||ae)&&r?e.jsxRuntimeExports.jsx(Ge,{data:v.filter(t=>g.enabled?t.date===ke.format(new Date(u[R]),g.dateFormat||"yyyy"):t),mapData:D?r:{...r,features:r.features.filter(t=>t.properties.NAME!=="Antarctica")},colorDomain:a,width:n||y,height:Math.max(k,x||(f?k?(n||y)*f>k?(n||y)*f:k:(n||y)*f:ae)),scale:H,centerPoint:Z,colors:j||(M==="categorical"?de.Colors[X].sequentialColors[`neutralColorsx0${a.length}`]:de.Colors[X].sequentialColors[`neutralColorsx0${a.length+1}`]),colorLegendTitle:ie,mapBorderWidth:me,mapNoDataColor:xe,categorical:M==="categorical",mapBorderColor:A,tooltip:G,onSeriesMouseOver:he,isWorldMap:$,showColorScale:ge,zoomScaleExtend:ye,zoomTranslateExtend:U,onSeriesMouseClick:_,mapProperty:ne,highlightedIds:b,resetSelectionOnDoubleClick:te,styles:w,classNames:C,detailsOnClick:Y,mapProjection:re||($?"naturalEarth":"mercator"),zoomInteraction:le,dimmedOpacity:W,animate:J===!0?{duration:.5,once:!0,amount:.5}:J||{duration:0,once:!0,amount:0},customLayers:oe,collapseColorScaleByDefault:fe}):e.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(k,x||(f?k?(n||y)*f>k?(n||y)*f:k:(n||y)*f:ae))}px`},className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(Re.y,{"aria-label":"Loading graph"})})}),F||se?e.jsxRuntimeExports.jsx(Te.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:F,footNote:se,width:n}):null]})})})})}exports.ChoroplethMap=Ue;
|
|
2
2
|
//# sourceMappingURL=ChoroplethMap.cjs.map
|