@undp/data-viz 1.5.7 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +666 -664
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +223 -221
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +84 -82
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +133 -131
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +141 -121
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +307 -307
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +204 -184
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +172 -173
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +89 -78
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +186 -181
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +256 -244
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-CW7iViH2.js} +13 -12
- package/dist/RegressionLine-CW7iViH2.js.map +1 -0
- package/dist/RegressionLine-D-49RaHa.cjs +2 -0
- package/dist/RegressionLine-D-49RaHa.cjs.map +1 -0
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +145 -144
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +53 -48
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +137 -133
- package/dist/SlopeChart.js.map +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +307 -295
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +25 -26
- package/dist/UnitChart.js.map +1 -1
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
package/dist/BasicStatCard.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),b=require("./Typography-BDULiwlF.cjs"),N=require("./GraphFooter.cjs"),w=require("./GraphHeader.cjs"),E=require("./numberFormattingFunction-02t-wJta.cjs");function v(R){const{year:o,value:c,graphTitle:i,suffix:m="",sources:l,prefix:p="",graphDescription:n,footNote:x,padding:u,backgroundColor:a=!1,graphID:k,language:s="en",theme:S="light",ariaLabel:$,textBackground:d=!1,headingFontSize:g="4.375rem",centerAlign:h=!1,verticalAlign:f="center",layout:y="primary",styles:t,classNames:r,precision:j}=R;return e.jsxRuntimeExports.jsx("div",{className:`${S||"light"} flex w-full`,dir:s==="he"||s==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${a?a===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col w-full h-inherit ${s||"en"}`,r?.graphContainer),style:{...t?.graphContainer||{},...a&&a!==!0?{backgroundColor:a}:{}},id:k,"aria-label":$||`${i?`The graph shows ${i}. `:""}This is a statistic card.${n?` ${n}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:a?u||"1rem":u||0},children:y!=="secondary"?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-12 justify-between grow",children:[i||n?e.jsxRuntimeExports.jsx(w.GraphHeader,{styles:{title:t?.title,description:t?.description},classNames:{title:r?.title,description:r?.description},graphTitle:i,graphDescription:n}):null,e.jsxRuntimeExports.jsx("div",{className:`flex flex-col justify-between grow ${f==="top"?"justify-start":f==="bottom"?"justify-end":"justify-center"}`,children:e.jsxRuntimeExports.jsxs(b.h,{marginBottom:"base",className:`leading-none text-outline font-heading ${h?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${d?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:g,letterSpacing:"0.05rem"},children:[E.numberFormattingFunction(c,"NA",j,p,m)," ",o?e.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",o,")"]}):null]})}),l||x?e.jsxRuntimeExports.jsx(N.GraphFooter,{styles:{footnote:t?.footnote,source:t?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:l,footNote:x}):null]}):e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-center",children:[e.jsxRuntimeExports.jsxs(b.h,{marginBottom:y==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${h?"text-center":s==="he"||s==="ar"?"text-right":"text-left"} ${d?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:g,letterSpacing:"0.05rem"},children:[E.numberFormattingFunction(c,"NA",j,p,m)," ",o?e.jsxRuntimeExports.jsxs("span",{className:"text-lg font-normal mt-0 mb-4 text-primary-gray-550 dark:text-primary-gray-400",style:{marginLeft:"-8px",lineHeight:"1.09",textShadow:"none",WebkitTextStrokeWidth:0},children:["(",o,")"]}):null]}),i||n?e.jsxRuntimeExports.jsx(w.GraphHeader,{styles:{title:t?.title,description:t?.description},classNames:{title:r?.title,description:r?.description},graphTitle:i,graphDescription:n}):null,l||x?e.jsxRuntimeExports.jsx(N.GraphFooter,{styles:{footnote:t?.footnote,source:t?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:l,footNote:x}):null]})})})})}exports.BasicStatCard=v;
|
|
2
2
|
//# sourceMappingURL=BasicStatCard.cjs.map
|
package/dist/BasicStatCard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as e, m as A } from "./index-CHPV5EwG-
|
|
2
|
-
import { h as b } from "./Typography-
|
|
1
|
+
import { j as e, m as A } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { h as b } from "./Typography-LmZ9LEpe.js";
|
|
3
3
|
import { GraphFooter as N } from "./GraphFooter.js";
|
|
4
4
|
import { GraphHeader as w } from "./GraphHeader.js";
|
|
5
5
|
import { n as k } from "./numberFormattingFunction-14YCbkN2.js";
|
package/dist/BeeSwarmChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-DDoeWRVt.cjs"),c=require("react"),ue=require("./index-DQA8q5sC.cjs"),xe=require("./index-CQ3e6Ewi.cjs"),de=require("./Modal-tXZlLE5s.cjs"),he=require("./Spinner-DA6Z5E4n.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),fe=require("./Tooltip-De16GWhY.cjs"),O=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ge=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),le=require("./Colors.cjs"),pe=require("./string2HTML-z7CwHXcx.cjs"),je=require("./Axis-DE7dSn1_.cjs"),Me=require("./XTicksAndGridLines-CCzXIV8d.cjs"),ye=require("./ReferenceLine-CFVBBN__.cjs"),ve=require("./pow-B5-jkdHU.cjs"),be=require("./linear-BVckp9RD.cjs"),re=require("./y-QcCbqrzx.cjs"),we=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),Ee=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-d8_8SxeW.cjs"),ce=require("./uniqBy-O05lp2S5.cjs"),Oe=require("./YTicksAndGridLines-DBDuz6vb.cjs");function ke(ne){const{data:i,circleColors:u,showTicks:C,leftMargin:se,width:b,height:w,colorDomain:a,rightMargin:ie,topMargin:I,bottomMargin:F,showLabels:A,tooltip:j,onSeriesMouseOver:L,refValues:x,selectedColor:B,startFromZero:U,radius:p,maxRadiusValue:G,maxValue:n,minValue:Z,highlightedDataPoints:J,onSeriesMouseClick:P,rtl:oe,resetSelectionOnDoubleClick:K,detailsOnClick:$,suffix:N,prefix:S,styles:y,classNames:q,noOfTicks:Q,dimmedOpacity:V,precision:H,customLayers:k}=ne,X=c.useRef(null),[R,v]=c.useState(void 0),[D,W]=c.useState(void 0),[Y,z]=c.useState(null),[ee,f]=c.useState(void 0),[g,d]=c.useState(void 0),h={top:I,bottom:F,left:se,right:ie},_=b-h.left-h.right,te=w-h.top-h.bottom,M=i.filter(e=>!O.checkIfNullOrUndefined(e.radius)).length===0?i:xe.orderBy(i.filter(e=>!O.checkIfNullOrUndefined(e.radius)),"radius","desc"),E=O.checkIfNullOrUndefined(n)?Math.max(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0&&!U?0:Math.max(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position)):n,r=O.checkIfNullOrUndefined(Z)?Math.min(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0&&!U?0:Math.min(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position)):Z,l=i.filter(e=>e.radius===void 0||e.radius===null).length!==i.length?ve.sqrt().domain([0,O.checkIfNullOrUndefined(G)?Math.max(...i.map(e=>e.radius).filter(e=>e!=null)):G]).range([.25,p]).nice():void 0,T=be.linear().domain([r,E]).range([0,_]).nice(),t=T.ticks(Q);return c.useEffect(()=>{z(null);const e=M.filter(m=>m.position);re.forceSimulation(e).force("x",re.forceX(m=>T(m.position)).strength(5)).force("y",re.forceY(m=>te/2).strength(1)).force("collide",re.forceCollide(m=>l?l(m.radius||0)+1:p+1)).force("charge",re.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{z(e)}).on("end",()=>{z(e)})},[i,p,te,_,r,E,M,T,l]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Y?s.jsxRuntimeExports.jsx("svg",{width:`${b}px`,height:`${w}px`,viewBox:`0 0 ${b} ${w}`,direction:"ltr",ref:X,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[C?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(je.Axis,{x1:T(r<0?0:r),x2:T(r<0?0:r),y1:0-h.top,y2:te+h.bottom,label:me.numberFormattingFunction(r<0?0:r,"NA",H,S,N),labelPos:{x:T(r<0?0:r),y:0-I,dy:"0.75em",dx:3},classNames:{axis:q?.xAxis?.axis,label:q?.yAxis?.labels},styles:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels}}),s.jsxRuntimeExports.jsx(Me.XTicksAndGridLines,{values:t.filter(e=>e!==0),x:t.filter(e=>e!==0).map(e=>T(e)),y1:0-I,y2:te+h.bottom,styles:{gridLines:y?.xAxis?.gridLines,labels:y?.xAxis?.labels},classNames:{gridLines:q?.xAxis?.gridLines,labels:q?.xAxis?.labels},suffix:N,prefix:S,labelType:"secondary",showGridLines:!0,precision:H})]}):null,k.filter(e=>e.position==="before").map(e=>e.layer),Y.map(e=>s.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${e.x},${e.y})`,opacity:B?e.color&&u[a.indexOf(e.color)]===B?1:V:J.length!==0?J.indexOf(e.label)!==-1?.85:V:.85,onMouseEnter:m=>{v(e),d(m.clientY),f(m.clientX),L?.(e)},onMouseMove:m=>{v(e),d(m.clientY),f(m.clientX)},onClick:()=>{(P||$)&&(ue.isEqual(D,e)&&K?(W(void 0),P?.(void 0)):(W(e),P?.(e)))},onMouseLeave:()=>{v(void 0),f(void 0),d(void 0),L?.(void 0)},children:[s.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,fill:i.filter(m=>m.color).length===0?u[0]:e.color?u[a.indexOf(e.color)]:le.Colors.gray,radius:l?l(e.radius||0):p}),(l?l(e.radius||0):p)>10&&A?s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("foreignObject",{y:0-(l?l(e.radius||0):p),x:0-(l?l(e.radius||0):p),width:2*(l?l(e.radius||0):p),height:2*(l?l(e.radius||0):p),children:s.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5",children:A?s.jsxRuntimeExports.jsx("p",{className:s.mo("text-center leading-none m-0",q?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((l?l(e.radius||0):p)/4),10),Math.max(Math.round((l?l(e.radius||0):p)*12/`${e.label}`.length),10),20)}px`,color:ge.getTextColorBasedOnBgColor(i.filter(m=>m.color).length===0?u[0]:e.color?u[a.indexOf(e.color)]:le.Colors.gray),hyphens:"auto",...y?.graphObjectValues||{}},children:e.label}):null})})}):null]},e.label)),x?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:x.map((e,m)=>s.jsxRuntimeExports.jsx(ye.RefLineX,{text:e.text,color:e.color,x:T(e.value),y1:0-h.top,y2:te+h.bottom,textSide:T(e.value)>_*.75||oe?"left":"right",classNames:e.classNames,styles:e.styles,isInView:!0},m))}):null,k.filter(e=>e.position==="after").map(e=>e.layer)]})}):s.jsxRuntimeExports.jsx("div",{style:{width:`${b}px`,height:`${w}px`},children:s.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:s.jsxRuntimeExports.jsx(he.y,{})})}),R&&j&&ee&&g?s.jsxRuntimeExports.jsx(fe.Tooltip,{data:R,body:j,xPos:ee,yPos:g,backgroundStyle:y?.tooltip,className:q?.tooltip}):null,$&&D!==void 0?s.jsxRuntimeExports.jsx(de.X,{open:D!==void 0,onClose:()=>{W(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:pe.string2HTML($,D)}:void 0,children:typeof $=="function"?$(D):null})}):null]})}function Ne(ne){const{data:i,graphTitle:u,backgroundColor:C=!1,topMargin:se=25,bottomMargin:b=10,leftMargin:w=10,rightMargin:a=10,showLabels:ie=!0,showTicks:I=!0,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:U,colorLegendTitle:p,padding:G,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$=5,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q=[],onSeriesMouseClick:Q,graphDownload:V=!1,dataDownload:H=!1,language:k="en",showNAColor:X=!0,minHeight:R=0,theme:v="light",ariaLabel:D,resetSelectionOnDoubleClick:W=!0,detailsOnClick:Y,suffix:z="",prefix:ee="",styles:f,classNames:g,noOfTicks:d,dimmedOpacity:h=.3,precision:_=2,customLayers:te=[]}=ne,[M,E]=c.useState(0),[r,l]=c.useState(0),[T,t]=c.useState(void 0),e=c.useRef(null),m=c.useRef(null);return c.useEffect(()=>{const o=new ResizeObserver(ae=>{E(x||ae[0].target.clientWidth||620),l(L||ae[0].target.clientHeight||480)});return e.current&&(l(e.current.clientHeight||480),E(e.current.clientWidth||620),x||o.observe(e.current)),()=>o.disconnect()},[x,L]),s.jsxRuntimeExports.jsx("div",{className:`${v||"light"} flex ${x?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,x?"w-fit":"w-full",g?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:K,ref:m,"aria-label":D||`${u?`The graph shows ${u}. `:""}This is a bee swarm chart showing the distribution along the x-axes. ${j?` ${j}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?G||"1rem":G||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||j||V||H?s.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:u,graphDescription:j,width:x,graphDownload:V?m.current:void 0,dataDownload:H?i.map(o=>o.data).filter(o=>o!==void 0).length>0?i.map(o=>o.data).filter(o=>o!==void 0):i.filter(o=>o!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?s.jsxRuntimeExports.jsx(Ce.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[oe!==!1&&i.filter(o=>o.color).length!==0?s.jsxRuntimeExports.jsx(Ee.ColorLegendWithMouseOver,{width:x,colorLegendTitle:p,colors:F||le.Colors[v].categoricalColors.colors,colorDomain:U||ce.uniqBy(i,"color",!0),setSelectedColor:t,showNAColor:X??!0}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:e,"aria-label":"Graph area",children:(x||M)&&(L||r)?s.jsxRuntimeExports.jsx(ke,{data:i,circleColors:i.filter(o=>o.color).length===0?F?[F]:[le.Colors.primaryColors["blue-600"]]:F||le.Colors[v].categoricalColors.colors,colorDomain:i.filter(o=>o.color).length===0?[]:U||ce.uniqBy(i,"color",!0),width:x||M,selectedColor:T,height:Math.max(R,L||(n?R?(x||M)*n>R?(x||M)*n:R:(x||M)*n:r)),showTicks:I,leftMargin:w,rightMargin:a,topMargin:se,bottomMargin:b,showLabels:ie,tooltip:Z,onSeriesMouseOver:J,refValues:P,startFromZero:!1,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,rtl:k==="he"||k==="ar",resetSelectionOnDoubleClick:W,detailsOnClick:Y,suffix:z,prefix:ee,styles:f,classNames:g,noOfTicks:d||5,dimmedOpacity:h,precision:_,customLayers:te}):null})]})}),A||B?s.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:A,footNote:B,width:x}):null]})})})})}function Se(ne){const{data:i,circleColors:u,showTicks:C,leftMargin:se,width:b,height:w,colorDomain:a,rightMargin:ie,topMargin:I,bottomMargin:F,suffix:A,prefix:j,showLabels:L,tooltip:x,onSeriesMouseOver:B,refValues:U,selectedColor:p,startFromZero:G,radius:n,maxRadiusValue:Z,maxValue:J,minValue:P,highlightedDataPoints:oe,onSeriesMouseClick:K,resetSelectionOnDoubleClick:$,detailsOnClick:N,styles:S,classNames:y,noOfTicks:q,dimmedOpacity:Q,precision:V,customLayers:H}=ne,k=c.useRef(null),[X,R]=c.useState(void 0),[v,D]=c.useState(void 0),[W,Y]=c.useState(null),[z,ee]=c.useState(void 0),[f,g]=c.useState(void 0),d={top:I,bottom:F,left:se,right:ie},h=b-d.left-d.right,_=w-d.top-d.bottom,te=i.filter(t=>!O.checkIfNullOrUndefined(t.radius)).length===0?i:xe.orderBy(i.filter(t=>!O.checkIfNullOrUndefined(t.radius)),"radius","desc"),M=O.checkIfNullOrUndefined(J)?Math.max(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position))<0&&!G?0:Math.max(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position)):J,E=O.checkIfNullOrUndefined(P)?Math.min(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position))>=0&&!G?0:Math.min(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position)):P,r=i.filter(t=>t.radius===void 0||t.radius===null).length!==i.length?ve.sqrt().domain([0,O.checkIfNullOrUndefined(Z)?Math.max(...i.map(t=>t.radius).filter(t=>t!=null)):Z]).range([.25,n]).nice():void 0,l=be.linear().domain([E,M]).range([_,0]).nice(),T=l.ticks(q);return c.useEffect(()=>{Y(null);const t=te.filter(e=>e.position);re.forceSimulation(t).force("y",re.forceY(e=>l(e.position)).strength(5)).force("x",re.forceX(e=>h/2).strength(1)).force("collide",re.forceCollide(e=>r?r(e.radius||0)+1:n+1)).force("charge",re.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{Y(t)}).on("end",()=>{Y(t)})},[i,n,_,h,E,M,te,l,r]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[W?s.jsxRuntimeExports.jsx("svg",{width:`${b}px`,height:`${w}px`,viewBox:`0 0 ${b} ${w}`,direction:"ltr",ref:k,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[C?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(je.Axis,{y1:l(E<0?0:E),y2:l(E<0?0:E),x1:0-d.left,x2:h+d.right,label:me.numberFormattingFunction(E<0?0:E,"NA",V,j,A),labelPos:{x:0-d.left,y:l(E<0?0:E),dx:0,dy:M<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:S?.xAxis?.axis,label:S?.yAxis?.labels}}),s.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{values:T.filter(t=>t!==0),y:T.filter(t=>t!==0).map(t=>l(t)),x1:0-d.left,x2:h+d.right,styles:{gridLines:S?.yAxis?.gridLines,labels:S?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:A,prefix:j,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:V})]}):null,H.filter(t=>t.position==="before").map(t=>t.layer),W.map(t=>s.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${t.x},${t.y})`,opacity:p?t.color&&u[a.indexOf(t.color)]===p?1:Q:oe.length!==0?oe.indexOf(t.label)!==-1?.85:Q:.85,onMouseEnter:e=>{R(t),g(e.clientY),ee(e.clientX),B?.(t)},onMouseMove:e=>{R(t),g(e.clientY),ee(e.clientX)},onClick:()=>{(K||N)&&(ue.isEqual(v,t)&&$?(D(void 0),K?.(void 0)):(D(t),K?.(t)))},onMouseLeave:()=>{R(void 0),ee(void 0),g(void 0),B?.(void 0)},children:[s.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:r?r(t.radius||0):n,fill:i.filter(e=>e.color).length===0?u[0]:t.color?u[a.indexOf(t.color)]:le.Colors.gray}),(r?r(t.radius||0):n)>10&&L?s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("foreignObject",{y:0-(r?r(t.radius||0):n),x:0-(r?r(t.radius||0):n),width:2*(r?r(t.radius||0):n),height:2*(r?r(t.radius||0):n),children:s.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit py-0 px-1.5",children:L?s.jsxRuntimeExports.jsx("p",{className:s.mo("text-center leading-none m-0",y?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((r?r(t.radius||0):n)/4),10),Math.max(Math.round((r?r(t.radius||0):n)*12/`${t.label}`.length),10),20)}px`,hyphens:"auto",color:ge.getTextColorBasedOnBgColor(i.filter(e=>e.color).length===0?u[0]:t.color?u[a.indexOf(t.color)]:le.Colors.gray),...S?.graphObjectValues||{}},children:t.label}):null})})}):null]},t.label)),U?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:U.map((t,e)=>s.jsxRuntimeExports.jsx(ye.RefLineY,{text:t.text,color:t.color,y:l(t.value),x1:0-d.left,x2:h+d.right,classNames:t.classNames,styles:t.styles,isInView:!0},e))}):null,H.filter(t=>t.position==="after").map(t=>t.layer)]})}):s.jsxRuntimeExports.jsx("div",{style:{width:`${b}px`,height:`${w}px`},children:s.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:s.jsxRuntimeExports.jsx(he.y,{})})}),X&&x&&z&&f?s.jsxRuntimeExports.jsx(fe.Tooltip,{data:X,body:x,xPos:z,yPos:f,backgroundStyle:S?.tooltip,className:y?.tooltip}):null,N&&v!==void 0?s.jsxRuntimeExports.jsx(de.X,{open:v!==void 0,onClose:()=>{D(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:pe.string2HTML(N,v)}:void 0,children:typeof N=="function"?N(v):null})}):null]})}function De(ne){const{data:i,graphTitle:u,colors:C,sources:se,graphDescription:b,height:w,width:a,footNote:ie,colorDomain:I,colorLegendTitle:F,padding:A,backgroundColor:j=!1,topMargin:L=25,bottomMargin:x=10,leftMargin:B=100,rightMargin:U=40,showLabels:p=!0,showTicks:G=!0,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$=5,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q=[],onSeriesMouseClick:Q,graphDownload:V=!1,dataDownload:H=!1,language:k="en",showNAColor:X=!0,minHeight:R=0,theme:v="light",ariaLabel:D,resetSelectionOnDoubleClick:W=!0,detailsOnClick:Y,suffix:z="",prefix:ee="",styles:f,classNames:g,noOfTicks:d,dimmedOpacity:h=.3,precision:_=2,customLayers:te=[]}=ne,[M,E]=c.useState(0),[r,l]=c.useState(0),[T,t]=c.useState(void 0),e=c.useRef(null),m=c.useRef(null);return c.useEffect(()=>{const o=new ResizeObserver(ae=>{E(a||ae[0].target.clientWidth||620),l(w||ae[0].target.clientHeight||480)});return e.current&&(l(e.current.clientHeight||480),E(e.current.clientWidth||620),a||o.observe(e.current)),()=>o.disconnect()},[a,w]),s.jsxRuntimeExports.jsx("div",{className:`${v||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,a?"w-fit":"w-full",g?.graphContainer),style:{...f?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:K,ref:m,"aria-label":D||`${u?`The graph shows ${u}. `:""}This is a bee swarm chart showing the distribution along the y-axes. ${b?` ${b}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:j?A||"1rem":A||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||b||V||H?s.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:u,graphDescription:b,width:a,graphDownload:V?m.current:void 0,dataDownload:H?i.map(o=>o.data).filter(o=>o!==void 0).length>0?i.map(o=>o.data).filter(o=>o!==void 0):i.filter(o=>o!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?s.jsxRuntimeExports.jsx(Ce.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[oe!==!1&&i.filter(o=>o.color).length!==0?s.jsxRuntimeExports.jsx(Ee.ColorLegendWithMouseOver,{width:a,colorLegendTitle:F,colors:C||le.Colors[v].categoricalColors.colors,colorDomain:I||ce.uniqBy(i,"color",!0),setSelectedColor:t,showNAColor:X}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:e,"aria-label":"Graph area",children:(a||M)&&(w||r)?s.jsxRuntimeExports.jsx(Se,{data:i,circleColors:i.filter(o=>o.color).length===0?C?[C]:[le.Colors.primaryColors["blue-600"]]:C||le.Colors[v].categoricalColors.colors,colorDomain:i.filter(o=>o.color).length===0?[]:I||ce.uniqBy(i,"color",!0),width:a||M,selectedColor:T,height:Math.max(R,w||(n?R?(a||M)*n>R?(a||M)*n:R:(a||M)*n:r)),showTicks:G,leftMargin:B,rightMargin:U,topMargin:L,bottomMargin:x,showLabels:p,tooltip:Z,onSeriesMouseOver:J,refValues:P,startFromZero:!1,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,resetSelectionOnDoubleClick:W,detailsOnClick:Y,styles:f,classNames:g,suffix:z,prefix:ee,noOfTicks:d||5,dimmedOpacity:h,precision:_,customLayers:te}):null})]})}),se||ie?s.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:se,footNote:ie,width:a}):null]})})})})}function Te(ne){const{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:U,colorLegendTitle:p,padding:G,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:X,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:W,detailsOnClick:Y,noOfTicks:z,orientation:ee="vertical",styles:f,classNames:g,dimmedOpacity:d,precision:h,customLayers:_}=ne;return ee==="vertical"?s.jsxRuntimeExports.jsx(De,{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:U,colorLegendTitle:p,padding:G,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:X,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:W,styles:f,detailsOnClick:Y,classNames:g,noOfTicks:z,dimmedOpacity:d,precision:h,customLayers:_}):s.jsxRuntimeExports.jsx(Ne,{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:U,colorLegendTitle:p,padding:G,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:X,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:W,styles:f,detailsOnClick:Y,classNames:g,noOfTicks:z,dimmedOpacity:d,precision:h,customLayers:_})}exports.BeeSwarmChart=Te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-DjM48pIC.cjs"),c=require("react"),ue=require("./index-DQA8q5sC.cjs"),xe=require("./index-CQ3e6Ewi.cjs"),de=require("./Modal-CuuJdWkD.cjs"),he=require("./Spinner-C6wLp85s.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),fe=require("./Tooltip-Cpv0QohJ.cjs"),O=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ge=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),le=require("./Colors.cjs"),pe=require("./string2HTML-z7CwHXcx.cjs"),je=require("./Axis-CkNn1wit.cjs"),Me=require("./XTicksAndGridLines-RKy7BVCO.cjs"),ye=require("./ReferenceLine-D04j-zeV.cjs"),ve=require("./pow-B5-jkdHU.cjs"),be=require("./linear-BVckp9RD.cjs"),re=require("./y-QcCbqrzx.cjs"),we=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),Ee=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-B8IpKGcL.cjs"),ce=require("./uniqBy-O05lp2S5.cjs"),Oe=require("./YTicksAndGridLines-qGpRo_t1.cjs");function ke(ne){const{data:i,circleColors:u,showTicks:C,leftMargin:se,width:b,height:w,colorDomain:a,rightMargin:ie,topMargin:I,bottomMargin:F,showLabels:A,tooltip:j,onSeriesMouseOver:L,refValues:x,selectedColor:B,startFromZero:G,radius:p,maxRadiusValue:U,maxValue:n,minValue:Z,highlightedDataPoints:J,onSeriesMouseClick:P,rtl:oe,resetSelectionOnDoubleClick:K,detailsOnClick:$,suffix:N,prefix:S,styles:y,classNames:q,noOfTicks:Q,dimmedOpacity:V,precision:H,customLayers:k}=ne,W=c.useRef(null),[R,v]=c.useState(void 0),[D,X]=c.useState(void 0),[Y,z]=c.useState(null),[ee,f]=c.useState(void 0),[g,d]=c.useState(void 0),h={top:I,bottom:F,left:se,right:ie},_=b-h.left-h.right,te=w-h.top-h.bottom,M=i.filter(e=>!O.checkIfNullOrUndefined(e.radius)).length===0?i:xe.orderBy(i.filter(e=>!O.checkIfNullOrUndefined(e.radius)),"radius","desc"),E=O.checkIfNullOrUndefined(n)?Math.max(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0&&!G?0:Math.max(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position)):n,r=O.checkIfNullOrUndefined(Z)?Math.min(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0&&!G?0:Math.min(...i.filter(e=>!O.checkIfNullOrUndefined(e.position)).map(e=>e.position)):Z,l=i.filter(e=>e.radius===void 0||e.radius===null).length!==i.length?ve.sqrt().domain([0,O.checkIfNullOrUndefined(U)?Math.max(...i.map(e=>e.radius).filter(e=>e!=null)):U]).range([.25,p]).nice():void 0,T=be.linear().domain([r,E]).range([0,_]).nice(),t=T.ticks(Q);return c.useEffect(()=>{z(null);const e=M.filter(m=>m.position);re.forceSimulation(e).force("x",re.forceX(m=>T(m.position)).strength(5)).force("y",re.forceY(m=>te/2).strength(1)).force("collide",re.forceCollide(m=>l?l(m.radius||0)+1:p+1)).force("charge",re.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{z(e)}).on("end",()=>{z(e)})},[i,p,te,_,r,E,M,T,l]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Y?s.jsxRuntimeExports.jsx("svg",{width:`${b}px`,height:`${w}px`,viewBox:`0 0 ${b} ${w}`,direction:"ltr",ref:W,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${h.left},${h.top})`,children:[C?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(je.Axis,{x1:T(r<0?0:r),x2:T(r<0?0:r),y1:0-h.top,y2:te+h.bottom,label:me.numberFormattingFunction(r<0?0:r,"NA",H,S,N),labelPos:{x:T(r<0?0:r),y:0-I,dy:"0.75em",dx:3},classNames:{axis:q?.xAxis?.axis,label:q?.yAxis?.labels},styles:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels}}),s.jsxRuntimeExports.jsx(Me.XTicksAndGridLines,{values:t.filter(e=>e!==0),x:t.filter(e=>e!==0).map(e=>T(e)),y1:0-I,y2:te+h.bottom,styles:{gridLines:y?.xAxis?.gridLines,labels:y?.xAxis?.labels},classNames:{gridLines:q?.xAxis?.gridLines,labels:q?.xAxis?.labels},suffix:N,prefix:S,labelType:"secondary",showGridLines:!0,precision:H})]}):null,k.filter(e=>e.position==="before").map(e=>e.layer),Y.map(e=>s.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${e.x},${e.y})`,opacity:B?e.color&&u[a.indexOf(e.color)]===B?1:V:J.length!==0?J.indexOf(e.label)!==-1?.85:V:.85,onMouseEnter:m=>{v(e),d(m.clientY),f(m.clientX),L?.(e)},onMouseMove:m=>{v(e),d(m.clientY),f(m.clientX)},onClick:()=>{(P||$)&&(ue.isEqual(D,e)&&K?(X(void 0),P?.(void 0)):(X(e),P?.(e)))},onMouseLeave:()=>{v(void 0),f(void 0),d(void 0),L?.(void 0)},children:[s.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,fill:i.filter(m=>m.color).length===0?u[0]:e.color?u[a.indexOf(e.color)]:le.Colors.gray,radius:l?l(e.radius||0):p}),(l?l(e.radius||0):p)>10&&A?s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("foreignObject",{y:0-(l?l(e.radius||0):p),x:0-(l?l(e.radius||0):p),width:2*(l?l(e.radius||0):p),height:2*(l?l(e.radius||0):p),children:s.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-1.5",children:A?s.jsxRuntimeExports.jsx("p",{className:s.mo("text-center leading-none m-0",q?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((l?l(e.radius||0):p)/4),10),Math.max(Math.round((l?l(e.radius||0):p)*12/`${e.label}`.length),10),20)}px`,color:ge.getTextColorBasedOnBgColor(i.filter(m=>m.color).length===0?u[0]:e.color?u[a.indexOf(e.color)]:le.Colors.gray),hyphens:"auto",...y?.graphObjectValues||{}},children:e.label}):null})})}):null]},e.label)),x?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:x.map((e,m)=>s.jsxRuntimeExports.jsx(ye.RefLineX,{text:e.text,color:e.color,x:T(e.value),y1:0-h.top,y2:te+h.bottom,textSide:T(e.value)>_*.75||oe?"left":"right",classNames:e.classNames,styles:e.styles,isInView:!0},m))}):null,k.filter(e=>e.position==="after").map(e=>e.layer)]})}):s.jsxRuntimeExports.jsx("div",{style:{width:`${b}px`,height:`${w}px`},children:s.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:s.jsxRuntimeExports.jsx(he.y,{})})}),R&&j&&ee&&g?s.jsxRuntimeExports.jsx(fe.Tooltip,{data:R,body:j,xPos:ee,yPos:g,backgroundStyle:y?.tooltip,className:q?.tooltip}):null,$&&D!==void 0?s.jsxRuntimeExports.jsx(de.G,{open:D!==void 0,onClose:()=>{X(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:pe.string2HTML($,D)}:void 0,children:typeof $=="function"?$(D):null})}):null]})}function Ne(ne){const{data:i,graphTitle:u,backgroundColor:C=!1,topMargin:se=25,bottomMargin:b=10,leftMargin:w=10,rightMargin:a=10,showLabels:ie=!0,showTicks:I=!0,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:G,colorLegendTitle:p,padding:U,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$=5,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q=[],onSeriesMouseClick:Q,graphDownload:V=!1,dataDownload:H=!1,language:k="en",showNAColor:W=!0,minHeight:R=0,theme:v="light",ariaLabel:D,resetSelectionOnDoubleClick:X=!0,detailsOnClick:Y,suffix:z="",prefix:ee="",styles:f,classNames:g,noOfTicks:d,dimmedOpacity:h=.3,precision:_=2,customLayers:te=[]}=ne,[M,E]=c.useState(0),[r,l]=c.useState(0),[T,t]=c.useState(void 0),e=c.useRef(null),m=c.useRef(null);return c.useEffect(()=>{const o=new ResizeObserver(ae=>{E(x||ae[0].target.clientWidth||620),l(L||ae[0].target.clientHeight||480)});return e.current&&(l(e.current.clientHeight||480),E(e.current.clientWidth||620),x||o.observe(e.current)),()=>o.disconnect()},[x,L]),s.jsxRuntimeExports.jsx("div",{className:`${v||"light"} flex ${x?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,x?"w-fit":"w-full",g?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:K,ref:m,"aria-label":D||`${u?`The graph shows ${u}. `:""}This is a bee swarm chart showing the distribution along the x-axes. ${j?` ${j}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?U||"1rem":U||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||j||V||H?s.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:u,graphDescription:j,width:x,graphDownload:V?m.current:void 0,dataDownload:H?i.map(o=>o.data).filter(o=>o!==void 0).length>0?i.map(o=>o.data).filter(o=>o!==void 0):i.filter(o=>o!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?s.jsxRuntimeExports.jsx(Ce.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[oe!==!1&&i.filter(o=>o.color).length!==0?s.jsxRuntimeExports.jsx(Ee.ColorLegendWithMouseOver,{width:x,colorLegendTitle:p,colors:F||le.Colors[v].categoricalColors.colors,colorDomain:G||ce.uniqBy(i,"color",!0),setSelectedColor:t,showNAColor:W??!0}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:e,"aria-label":"Graph area",children:(x||M)&&(L||r)?s.jsxRuntimeExports.jsx(ke,{data:i,circleColors:i.filter(o=>o.color).length===0?F?[F]:[le.Colors.primaryColors["blue-600"]]:F||le.Colors[v].categoricalColors.colors,colorDomain:i.filter(o=>o.color).length===0?[]:G||ce.uniqBy(i,"color",!0),width:x||M,selectedColor:T,height:Math.max(R,L||(n?R?(x||M)*n>R?(x||M)*n:R:(x||M)*n:r)),showTicks:I,leftMargin:w,rightMargin:a,topMargin:se,bottomMargin:b,showLabels:ie,tooltip:Z,onSeriesMouseOver:J,refValues:P,startFromZero:!1,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,rtl:k==="he"||k==="ar",resetSelectionOnDoubleClick:X,detailsOnClick:Y,suffix:z,prefix:ee,styles:f,classNames:g,noOfTicks:d||5,dimmedOpacity:h,precision:_,customLayers:te}):null})]})}),A||B?s.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:A,footNote:B,width:x}):null]})})})})}function Se(ne){const{data:i,circleColors:u,showTicks:C,leftMargin:se,width:b,height:w,colorDomain:a,rightMargin:ie,topMargin:I,bottomMargin:F,suffix:A,prefix:j,showLabels:L,tooltip:x,onSeriesMouseOver:B,refValues:G,selectedColor:p,startFromZero:U,radius:n,maxRadiusValue:Z,maxValue:J,minValue:P,highlightedDataPoints:oe,onSeriesMouseClick:K,resetSelectionOnDoubleClick:$,detailsOnClick:N,styles:S,classNames:y,noOfTicks:q,dimmedOpacity:Q,precision:V,customLayers:H}=ne,k=c.useRef(null),[W,R]=c.useState(void 0),[v,D]=c.useState(void 0),[X,Y]=c.useState(null),[z,ee]=c.useState(void 0),[f,g]=c.useState(void 0),d={top:I,bottom:F,left:se,right:ie},h=b-d.left-d.right,_=w-d.top-d.bottom,te=i.filter(t=>!O.checkIfNullOrUndefined(t.radius)).length===0?i:xe.orderBy(i.filter(t=>!O.checkIfNullOrUndefined(t.radius)),"radius","desc"),M=O.checkIfNullOrUndefined(J)?Math.max(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position))<0&&!U?0:Math.max(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position)):J,E=O.checkIfNullOrUndefined(P)?Math.min(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position))>=0&&!U?0:Math.min(...i.filter(t=>!O.checkIfNullOrUndefined(t.position)).map(t=>t.position)):P,r=i.filter(t=>t.radius===void 0||t.radius===null).length!==i.length?ve.sqrt().domain([0,O.checkIfNullOrUndefined(Z)?Math.max(...i.map(t=>t.radius).filter(t=>t!=null)):Z]).range([.25,n]).nice():void 0,l=be.linear().domain([E,M]).range([_,0]).nice(),T=l.ticks(q);return c.useEffect(()=>{Y(null);const t=te.filter(e=>e.position);re.forceSimulation(t).force("y",re.forceY(e=>l(e.position)).strength(5)).force("x",re.forceX(e=>h/2).strength(1)).force("collide",re.forceCollide(e=>r?r(e.radius||0)+1:n+1)).force("charge",re.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{Y(t)}).on("end",()=>{Y(t)})},[i,n,_,h,E,M,te,l,r]),s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[X?s.jsxRuntimeExports.jsx("svg",{width:`${b}px`,height:`${w}px`,viewBox:`0 0 ${b} ${w}`,direction:"ltr",ref:k,children:s.jsxRuntimeExports.jsxs("g",{transform:`translate(${d.left},${d.top})`,children:[C?s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx(je.Axis,{y1:l(E<0?0:E),y2:l(E<0?0:E),x1:0-d.left,x2:h+d.right,label:me.numberFormattingFunction(E<0?0:E,"NA",V,j,A),labelPos:{x:0-d.left,y:l(E<0?0:E),dx:0,dy:M<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:S?.xAxis?.axis,label:S?.yAxis?.labels}}),s.jsxRuntimeExports.jsx(Oe.YTicksAndGridLines,{values:T.filter(t=>t!==0),y:T.filter(t=>t!==0).map(t=>l(t)),x1:0-d.left,x2:h+d.right,styles:{gridLines:S?.yAxis?.gridLines,labels:S?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:A,prefix:j,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:V})]}):null,H.filter(t=>t.position==="before").map(t=>t.layer),X.map(t=>s.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",transform:`translate(${t.x},${t.y})`,opacity:p?t.color&&u[a.indexOf(t.color)]===p?1:Q:oe.length!==0?oe.indexOf(t.label)!==-1?.85:Q:.85,onMouseEnter:e=>{R(t),g(e.clientY),ee(e.clientX),B?.(t)},onMouseMove:e=>{R(t),g(e.clientY),ee(e.clientX)},onClick:()=>{(K||N)&&(ue.isEqual(v,t)&&$?(D(void 0),K?.(void 0)):(D(t),K?.(t)))},onMouseLeave:()=>{R(void 0),ee(void 0),g(void 0),B?.(void 0)},children:[s.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:r?r(t.radius||0):n,fill:i.filter(e=>e.color).length===0?u[0]:t.color?u[a.indexOf(t.color)]:le.Colors.gray}),(r?r(t.radius||0):n)>10&&L?s.jsxRuntimeExports.jsx("g",{children:s.jsxRuntimeExports.jsx("foreignObject",{y:0-(r?r(t.radius||0):n),x:0-(r?r(t.radius||0):n),width:2*(r?r(t.radius||0):n),height:2*(r?r(t.radius||0):n),children:s.jsxRuntimeExports.jsx("div",{className:"flex flex-col justify-center items-center h-inherit py-0 px-1.5",children:L?s.jsxRuntimeExports.jsx("p",{className:s.mo("text-center leading-none m-0",y?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round((r?r(t.radius||0):n)/4),10),Math.max(Math.round((r?r(t.radius||0):n)*12/`${t.label}`.length),10),20)}px`,hyphens:"auto",color:ge.getTextColorBasedOnBgColor(i.filter(e=>e.color).length===0?u[0]:t.color?u[a.indexOf(t.color)]:le.Colors.gray),...S?.graphObjectValues||{}},children:t.label}):null})})}):null]},t.label)),G?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:G.map((t,e)=>s.jsxRuntimeExports.jsx(ye.RefLineY,{text:t.text,color:t.color,y:l(t.value),x1:0-d.left,x2:h+d.right,classNames:t.classNames,styles:t.styles,isInView:!0},e))}):null,H.filter(t=>t.position==="after").map(t=>t.layer)]})}):s.jsxRuntimeExports.jsx("div",{style:{width:`${b}px`,height:`${w}px`},children:s.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:s.jsxRuntimeExports.jsx(he.y,{})})}),W&&x&&z&&f?s.jsxRuntimeExports.jsx(fe.Tooltip,{data:W,body:x,xPos:z,yPos:f,backgroundStyle:S?.tooltip,className:y?.tooltip}):null,N&&v!==void 0?s.jsxRuntimeExports.jsx(de.G,{open:v!==void 0,onClose:()=>{D(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:pe.string2HTML(N,v)}:void 0,children:typeof N=="function"?N(v):null})}):null]})}function De(ne){const{data:i,graphTitle:u,colors:C,sources:se,graphDescription:b,height:w,width:a,footNote:ie,colorDomain:I,colorLegendTitle:F,padding:A,backgroundColor:j=!1,topMargin:L=25,bottomMargin:x=10,leftMargin:B=100,rightMargin:G=40,showLabels:p=!0,showTicks:U=!0,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$=5,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q=[],onSeriesMouseClick:Q,graphDownload:V=!1,dataDownload:H=!1,language:k="en",showNAColor:W=!0,minHeight:R=0,theme:v="light",ariaLabel:D,resetSelectionOnDoubleClick:X=!0,detailsOnClick:Y,suffix:z="",prefix:ee="",styles:f,classNames:g,noOfTicks:d,dimmedOpacity:h=.3,precision:_=2,customLayers:te=[]}=ne,[M,E]=c.useState(0),[r,l]=c.useState(0),[T,t]=c.useState(void 0),e=c.useRef(null),m=c.useRef(null);return c.useEffect(()=>{const o=new ResizeObserver(ae=>{E(a||ae[0].target.clientWidth||620),l(w||ae[0].target.clientHeight||480)});return e.current&&(l(e.current.clientHeight||480),E(e.current.clientWidth||620),a||o.observe(e.current)),()=>o.disconnect()},[a,w]),s.jsxRuntimeExports.jsx("div",{className:`${v||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:s.jsxRuntimeExports.jsx("div",{className:s.mo(`${j?j===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"}`,a?"w-fit":"w-full",g?.graphContainer),style:{...f?.graphContainer||{},...j&&j!==!0?{backgroundColor:j}:{}},id:K,ref:m,"aria-label":D||`${u?`The graph shows ${u}. `:""}This is a bee swarm chart showing the distribution along the y-axes. ${b?` ${b}`:""}`,children:s.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:j?A||"1rem":A||0},children:s.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[u||b||V||H?s.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:g?.title,description:g?.description},graphTitle:u,graphDescription:b,width:a,graphDownload:V?m.current:void 0,dataDownload:H?i.map(o=>o.data).filter(o=>o!==void 0).length>0?i.map(o=>o.data).filter(o=>o!==void 0):i.filter(o=>o!==void 0):null}):null,s.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?s.jsxRuntimeExports.jsx(Ce.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[oe!==!1&&i.filter(o=>o.color).length!==0?s.jsxRuntimeExports.jsx(Ee.ColorLegendWithMouseOver,{width:a,colorLegendTitle:F,colors:C||le.Colors[v].categoricalColors.colors,colorDomain:I||ce.uniqBy(i,"color",!0),setSelectedColor:t,showNAColor:W}):null,s.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:e,"aria-label":"Graph area",children:(a||M)&&(w||r)?s.jsxRuntimeExports.jsx(Se,{data:i,circleColors:i.filter(o=>o.color).length===0?C?[C]:[le.Colors.primaryColors["blue-600"]]:C||le.Colors[v].categoricalColors.colors,colorDomain:i.filter(o=>o.color).length===0?[]:I||ce.uniqBy(i,"color",!0),width:a||M,selectedColor:T,height:Math.max(R,w||(n?R?(a||M)*n>R?(a||M)*n:R:(a||M)*n:r)),showTicks:U,leftMargin:B,rightMargin:G,topMargin:L,bottomMargin:x,showLabels:p,tooltip:Z,onSeriesMouseOver:J,refValues:P,startFromZero:!1,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,resetSelectionOnDoubleClick:X,detailsOnClick:Y,styles:f,classNames:g,suffix:z,prefix:ee,noOfTicks:d||5,dimmedOpacity:h,precision:_,customLayers:te}):null})]})}),se||ie?s.jsxRuntimeExports.jsx(we.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:g?.footnote,source:g?.source},sources:se,footNote:ie,width:a}):null]})})})})}function Te(ne){const{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:G,colorLegendTitle:p,padding:U,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:W,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:X,detailsOnClick:Y,noOfTicks:z,orientation:ee="vertical",styles:f,classNames:g,dimmedOpacity:d,precision:h,customLayers:_}=ne;return ee==="vertical"?s.jsxRuntimeExports.jsx(De,{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:G,colorLegendTitle:p,padding:U,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:W,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:X,styles:f,detailsOnClick:Y,classNames:g,noOfTicks:z,dimmedOpacity:d,precision:h,customLayers:_}):s.jsxRuntimeExports.jsx(Ne,{data:i,graphTitle:u,backgroundColor:C,topMargin:se,bottomMargin:b,leftMargin:w,rightMargin:a,showLabels:ie,showTicks:I,colors:F,sources:A,graphDescription:j,height:L,width:x,footNote:B,colorDomain:G,colorLegendTitle:p,padding:U,relativeHeight:n,tooltip:Z,onSeriesMouseOver:J,refValues:P,showColorScale:oe,graphID:K,radius:$,maxRadiusValue:N,maxValue:S,minValue:y,highlightedDataPoints:q,onSeriesMouseClick:Q,graphDownload:V,dataDownload:H,language:k,showNAColor:W,minHeight:R,theme:v,ariaLabel:D,resetSelectionOnDoubleClick:X,styles:f,detailsOnClick:Y,classNames:g,noOfTicks:z,dimmedOpacity:d,precision:h,customLayers:_})}exports.BeeSwarmChart=Te;
|
|
2
2
|
//# sourceMappingURL=BeeSwarmChart.cjs.map
|
package/dist/BeeSwarmChart.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { j as i, m as he } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as i, m as he } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as ae, useState as T, useEffect as de } from "react";
|
|
3
3
|
import { i as ue } from "./index-Bwrro8-q.js";
|
|
4
4
|
import { o as ge } from "./index-DvVprvy6.js";
|
|
5
|
-
import {
|
|
6
|
-
import { y as fe } from "./Spinner-
|
|
5
|
+
import { G as me } from "./Modal-Cg8daIlV.js";
|
|
6
|
+
import { y as fe } from "./Spinner-Bpz70q_g.js";
|
|
7
7
|
import { n as xe } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
|
-
import { T as pe } from "./Tooltip-
|
|
8
|
+
import { T as pe } from "./Tooltip-6LIdPQGC.js";
|
|
9
9
|
import { c as D } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
10
10
|
import { g as ye } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
|
|
11
11
|
import { Colors as se } from "./Colors.js";
|
|
12
12
|
import { s as ve } from "./string2HTML-oFCROsus.js";
|
|
13
|
-
import { A as be } from "./Axis-
|
|
14
|
-
import { X as Te } from "./XTicksAndGridLines-
|
|
15
|
-
import { a as Ve, R as Ae } from "./ReferenceLine-
|
|
13
|
+
import { A as be } from "./Axis-4gUOL8B7.js";
|
|
14
|
+
import { X as Te } from "./XTicksAndGridLines-DuydSnZ_.js";
|
|
15
|
+
import { a as Ve, R as Ae } from "./ReferenceLine-CPMaAX0r.js";
|
|
16
16
|
import { s as we } from "./pow-e8zx3AQJ.js";
|
|
17
17
|
import { a as je } from "./linear-DUdu7l2G.js";
|
|
18
18
|
import { f as Me, b as Ce, a as Oe, c as De, d as ke } from "./y-D0sAaVii.js";
|
|
19
19
|
import { GraphFooter as Ne } from "./GraphFooter.js";
|
|
20
20
|
import { GraphHeader as $e } from "./GraphHeader.js";
|
|
21
21
|
import { ColorLegendWithMouseOver as Se } from "./ColorLegendWithMouseOver.js";
|
|
22
|
-
import { E as Le } from "./EmptyState-
|
|
22
|
+
import { E as Le } from "./EmptyState-36lXXyui.js";
|
|
23
23
|
import { u as ce } from "./uniqBy-BHy4I8PK.js";
|
|
24
|
-
import { Y as He } from "./YTicksAndGridLines-
|
|
24
|
+
import { Y as He } from "./YTicksAndGridLines-7t4MKtGw.js";
|
|
25
25
|
function Fe(le) {
|
|
26
26
|
const {
|
|
27
27
|
data: o,
|
|
@@ -39,13 +39,13 @@ function Fe(le) {
|
|
|
39
39
|
onSeriesMouseOver: V,
|
|
40
40
|
refValues: h,
|
|
41
41
|
selectedColor: E,
|
|
42
|
-
startFromZero:
|
|
42
|
+
startFromZero: G,
|
|
43
43
|
radius: x,
|
|
44
|
-
maxRadiusValue:
|
|
44
|
+
maxRadiusValue: W,
|
|
45
45
|
maxValue: a,
|
|
46
46
|
minValue: U,
|
|
47
47
|
highlightedDataPoints: J,
|
|
48
|
-
onSeriesMouseClick:
|
|
48
|
+
onSeriesMouseClick: B,
|
|
49
49
|
rtl: re,
|
|
50
50
|
resetSelectionOnDoubleClick: K,
|
|
51
51
|
detailsOnClick: A,
|
|
@@ -66,9 +66,9 @@ function Fe(le) {
|
|
|
66
66
|
o.filter((e) => !D(e.radius)),
|
|
67
67
|
"radius",
|
|
68
68
|
"desc"
|
|
69
|
-
), M = D(a) ? Math.max(...o.filter((e) => !D(e.position)).map((e) => e.position)) < 0 && !
|
|
69
|
+
), M = D(a) ? Math.max(...o.filter((e) => !D(e.position)).map((e) => e.position)) < 0 && !G ? 0 : Math.max(...o.filter((e) => !D(e.position)).map((e) => e.position)) : a, s = D(U) ? Math.min(...o.filter((e) => !D(e.position)).map((e) => e.position)) >= 0 && !G ? 0 : Math.min(...o.filter((e) => !D(e.position)).map((e) => e.position)) : U, l = o.filter((e) => e.radius === void 0 || e.radius === null).length !== o.length ? we().domain([
|
|
70
70
|
0,
|
|
71
|
-
D(
|
|
71
|
+
D(W) ? Math.max(...o.map((e) => e.radius).filter((e) => e != null)) : W
|
|
72
72
|
]).range([0.25, x]).nice() : void 0, L = je().domain([s, M]).range([0, q]).nice(), t = L.ticks(Q);
|
|
73
73
|
return de(() => {
|
|
74
74
|
Z(null);
|
|
@@ -160,7 +160,7 @@ function Fe(le) {
|
|
|
160
160
|
v(e), d(g.clientY), m(g.clientX);
|
|
161
161
|
},
|
|
162
162
|
onClick: () => {
|
|
163
|
-
(
|
|
163
|
+
(B || A) && (ue(S, e) && K ? (I(void 0), B?.(void 0)) : (I(e), B?.(e)));
|
|
164
164
|
},
|
|
165
165
|
onMouseLeave: () => {
|
|
166
166
|
v(void 0), m(void 0), d(void 0), V?.(void 0);
|
|
@@ -286,13 +286,13 @@ function Pe(le) {
|
|
|
286
286
|
height: V,
|
|
287
287
|
width: h,
|
|
288
288
|
footNote: E,
|
|
289
|
-
colorDomain:
|
|
289
|
+
colorDomain: G,
|
|
290
290
|
colorLegendTitle: x,
|
|
291
|
-
padding:
|
|
291
|
+
padding: W,
|
|
292
292
|
relativeHeight: a,
|
|
293
293
|
tooltip: U,
|
|
294
294
|
onSeriesMouseOver: J,
|
|
295
|
-
refValues:
|
|
295
|
+
refValues: B,
|
|
296
296
|
showColorScale: re,
|
|
297
297
|
graphID: K,
|
|
298
298
|
radius: A = 5,
|
|
@@ -348,7 +348,7 @@ function Pe(le) {
|
|
|
348
348
|
"div",
|
|
349
349
|
{
|
|
350
350
|
className: "flex grow",
|
|
351
|
-
style: { padding: C ?
|
|
351
|
+
style: { padding: C ? W || "1rem" : W || 0 },
|
|
352
352
|
children: /* @__PURE__ */ i.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
353
353
|
c || p || F || R ? /* @__PURE__ */ i.jsx(
|
|
354
354
|
$e,
|
|
@@ -375,7 +375,7 @@ function Pe(le) {
|
|
|
375
375
|
width: h,
|
|
376
376
|
colorLegendTitle: x,
|
|
377
377
|
colors: Y || se[v].categoricalColors.colors,
|
|
378
|
-
colorDomain:
|
|
378
|
+
colorDomain: G || ce(o, "color", !0),
|
|
379
379
|
setSelectedColor: t,
|
|
380
380
|
showNAColor: z ?? !0
|
|
381
381
|
}
|
|
@@ -391,7 +391,7 @@ function Pe(le) {
|
|
|
391
391
|
{
|
|
392
392
|
data: o,
|
|
393
393
|
circleColors: o.filter((r) => r.color).length === 0 ? Y ? [Y] : [se.primaryColors["blue-600"]] : Y || se[v].categoricalColors.colors,
|
|
394
|
-
colorDomain: o.filter((r) => r.color).length === 0 ? [] :
|
|
394
|
+
colorDomain: o.filter((r) => r.color).length === 0 ? [] : G || ce(o, "color", !0),
|
|
395
395
|
width: h || O,
|
|
396
396
|
selectedColor: L,
|
|
397
397
|
height: Math.max(
|
|
@@ -406,7 +406,7 @@ function Pe(le) {
|
|
|
406
406
|
showLabels: oe,
|
|
407
407
|
tooltip: U,
|
|
408
408
|
onSeriesMouseOver: J,
|
|
409
|
-
refValues:
|
|
409
|
+
refValues: B,
|
|
410
410
|
startFromZero: !1,
|
|
411
411
|
radius: A,
|
|
412
412
|
maxRadiusValue: N,
|
|
@@ -468,13 +468,13 @@ function Re(le) {
|
|
|
468
468
|
showLabels: V,
|
|
469
469
|
tooltip: h,
|
|
470
470
|
onSeriesMouseOver: E,
|
|
471
|
-
refValues:
|
|
471
|
+
refValues: G,
|
|
472
472
|
selectedColor: x,
|
|
473
|
-
startFromZero:
|
|
473
|
+
startFromZero: W,
|
|
474
474
|
radius: a,
|
|
475
475
|
maxRadiusValue: U,
|
|
476
476
|
maxValue: J,
|
|
477
|
-
minValue:
|
|
477
|
+
minValue: B,
|
|
478
478
|
highlightedDataPoints: re,
|
|
479
479
|
onSeriesMouseClick: K,
|
|
480
480
|
resetSelectionOnDoubleClick: A,
|
|
@@ -494,7 +494,7 @@ function Re(le) {
|
|
|
494
494
|
o.filter((t) => !D(t.radius)),
|
|
495
495
|
"radius",
|
|
496
496
|
"desc"
|
|
497
|
-
), O = D(J) ? Math.max(...o.filter((t) => !D(t.position)).map((t) => t.position)) < 0 && !
|
|
497
|
+
), O = D(J) ? Math.max(...o.filter((t) => !D(t.position)).map((t) => t.position)) < 0 && !W ? 0 : Math.max(...o.filter((t) => !D(t.position)).map((t) => t.position)) : J, M = D(B) ? Math.min(...o.filter((t) => !D(t.position)).map((t) => t.position)) >= 0 && !W ? 0 : Math.min(...o.filter((t) => !D(t.position)).map((t) => t.position)) : B, s = o.filter((t) => t.radius === void 0 || t.radius === null).length !== o.length ? we().domain([
|
|
498
498
|
0,
|
|
499
499
|
D(U) ? Math.max(...o.map((t) => t.radius).filter((t) => t != null)) : U
|
|
500
500
|
]).range([0.25, a]).nice() : void 0, l = je().domain([M, O]).range([q, 0]).nice(), L = l.ticks(H);
|
|
@@ -649,7 +649,7 @@ function Re(le) {
|
|
|
649
649
|
},
|
|
650
650
|
t.label
|
|
651
651
|
)),
|
|
652
|
-
|
|
652
|
+
G ? /* @__PURE__ */ i.jsx(i.Fragment, { children: G.map((t, e) => /* @__PURE__ */ i.jsx(
|
|
653
653
|
Ae,
|
|
654
654
|
{
|
|
655
655
|
text: t.text,
|
|
@@ -714,13 +714,13 @@ function Xe(le) {
|
|
|
714
714
|
topMargin: V = 25,
|
|
715
715
|
bottomMargin: h = 10,
|
|
716
716
|
leftMargin: E = 100,
|
|
717
|
-
rightMargin:
|
|
717
|
+
rightMargin: G = 40,
|
|
718
718
|
showLabels: x = !0,
|
|
719
|
-
showTicks:
|
|
719
|
+
showTicks: W = !0,
|
|
720
720
|
relativeHeight: a,
|
|
721
721
|
tooltip: U,
|
|
722
722
|
onSeriesMouseOver: J,
|
|
723
|
-
refValues:
|
|
723
|
+
refValues: B,
|
|
724
724
|
showColorScale: re,
|
|
725
725
|
graphID: K,
|
|
726
726
|
radius: A = 5,
|
|
@@ -826,15 +826,15 @@ function Xe(le) {
|
|
|
826
826
|
j,
|
|
827
827
|
w || (a ? j ? (n || O) * a > j ? (n || O) * a : j : (n || O) * a : s)
|
|
828
828
|
),
|
|
829
|
-
showTicks:
|
|
829
|
+
showTicks: W,
|
|
830
830
|
leftMargin: E,
|
|
831
|
-
rightMargin:
|
|
831
|
+
rightMargin: G,
|
|
832
832
|
topMargin: V,
|
|
833
833
|
bottomMargin: h,
|
|
834
834
|
showLabels: x,
|
|
835
835
|
tooltip: U,
|
|
836
836
|
onSeriesMouseOver: J,
|
|
837
|
-
refValues:
|
|
837
|
+
refValues: B,
|
|
838
838
|
startFromZero: !1,
|
|
839
839
|
radius: A,
|
|
840
840
|
maxRadiusValue: N,
|
|
@@ -895,13 +895,13 @@ function ht(le) {
|
|
|
895
895
|
height: V,
|
|
896
896
|
width: h,
|
|
897
897
|
footNote: E,
|
|
898
|
-
colorDomain:
|
|
898
|
+
colorDomain: G,
|
|
899
899
|
colorLegendTitle: x,
|
|
900
|
-
padding:
|
|
900
|
+
padding: W,
|
|
901
901
|
relativeHeight: a,
|
|
902
902
|
tooltip: U,
|
|
903
903
|
onSeriesMouseOver: J,
|
|
904
|
-
refValues:
|
|
904
|
+
refValues: B,
|
|
905
905
|
showColorScale: re,
|
|
906
906
|
graphID: K,
|
|
907
907
|
radius: A,
|
|
@@ -945,13 +945,13 @@ function ht(le) {
|
|
|
945
945
|
height: V,
|
|
946
946
|
width: h,
|
|
947
947
|
footNote: E,
|
|
948
|
-
colorDomain:
|
|
948
|
+
colorDomain: G,
|
|
949
949
|
colorLegendTitle: x,
|
|
950
|
-
padding:
|
|
950
|
+
padding: W,
|
|
951
951
|
relativeHeight: a,
|
|
952
952
|
tooltip: U,
|
|
953
953
|
onSeriesMouseOver: J,
|
|
954
|
-
refValues:
|
|
954
|
+
refValues: B,
|
|
955
955
|
showColorScale: re,
|
|
956
956
|
graphID: K,
|
|
957
957
|
radius: A,
|
|
@@ -994,13 +994,13 @@ function ht(le) {
|
|
|
994
994
|
height: V,
|
|
995
995
|
width: h,
|
|
996
996
|
footNote: E,
|
|
997
|
-
colorDomain:
|
|
997
|
+
colorDomain: G,
|
|
998
998
|
colorLegendTitle: x,
|
|
999
|
-
padding:
|
|
999
|
+
padding: W,
|
|
1000
1000
|
relativeHeight: a,
|
|
1001
1001
|
tooltip: U,
|
|
1002
1002
|
onSeriesMouseOver: J,
|
|
1003
|
-
refValues:
|
|
1003
|
+
refValues: B,
|
|
1004
1004
|
showColorScale: re,
|
|
1005
1005
|
graphID: K,
|
|
1006
1006
|
radius: A,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),u=require("react"),$e=require("./getSliderMarks-CRIbTGYV.cjs"),Ie=require("./Spinner-DA6Z5E4n.cjs"),Ce=require("./parse-hMnG_lRV.cjs"),Pe=require("./index-DQA8q5sC.cjs"),L=require("./zoom-BiMNsz72.cjs"),Le=require("./index-CoZbeNM9.cjs"),Te=require("./Modal-tXZlLE5s.cjs"),Se=require("./Typography-k-kOjICQ.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),ze=require("./Tooltip-De16GWhY.cjs"),We=require("./string2HTML-z7CwHXcx.cjs"),De=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Re=require("./index-BW_-wD2k.cjs"),ke=require("./select-Bnfk0lJx.cjs"),Me=require("./threshold-DNsSUf8Q.cjs"),Be=require("./use-in-view-sQJZ_xDO.cjs"),ae=require("./proxy-BHRoeZgd.cjs"),Ae=require("./index-BW8iNx7E.cjs"),Fe=require("./GraphHeader.cjs"),Ve=require("./GraphFooter.cjs"),we=require("./Colors.cjs"),He=require("./fetchAndParseData-Ba-_CgxS.cjs"),qe=require("./getJenks-GYmdwBqm.cjs"),_e=require("./uniqBy-O05lp2S5.cjs"),Ge=require("./sort-O96oMZLb.cjs"),Ue=require("./init-DU0ybBc_.cjs");function Xe(je){const{data:v,xDomain:R,mapData:f,xColorLegendTitle:D,yDomain:T,yColorLegendTitle:z,width:d,height:s,colors:Y,scale:J,centerPoint:$,mapBorderWidth:W,mapNoDataColor:M,mapBorderColor:ne,tooltip:se,onSeriesMouseOver:le,zoomScaleExtend:ce,zoomTranslateExtend:ve,highlightedIds:B,onSeriesMouseClick:b,mapProperty:A,resetSelectionOnDoubleClick:E,detailsOnClick:S,showColorScale:ue,styles:be,classNames:Ee,mapProjection:F,zoomInteraction:q,animate:k,dimmedOpacity:V,customLayers:me}=je,[de,K]=u.useState(!(d<680)),[H,_]=u.useState(void 0),[h,Z]=u.useState(void 0),[G,Q]=u.useState(void 0),[pe,w]=u.useState(void 0),[C,ee]=u.useState(void 0),O=u.useRef(null),U=Be.useInView(O,{once:k.once,amount:k.amount}),xe=u.useRef(null),te=u.useRef(null);u.useEffect(()=>{const e=ke.select(xe.current),n=ke.select(O.current),r=o=>{if(q==="noZoom")return!1;if(q==="button")return!o.type.includes("wheel");const a=o.type==="wheel",m=o.type.startsWith("touch"),l=o.type==="mousedown"||o.type==="mousemove";return m?!0:a?q==="scroll"?!0:o.ctrlKey:l&&!o.button&&!o.ctrlKey},i=L.zoom().scaleExtent(ce).translateExtent(ve||[[-20,-20],[d+20,s+20]]).filter(r).on("zoom",({transform:o})=>{e.attr("transform",o)});n.call(i),te.current=i},[s,d,q]);const p=L.turf_bbox_default(f),g=Le.turf_center_of_mass_default(f),he=p[2]-p[0],re=p[3]-p[1],ge=d*190/960*360/he,I=s*190/678*180/re,P=J*Math.min(ge,I),c=F==="mercator"?L.geoMercator().rotate([0,0]).center($||g.geometry.coordinates).translate([d/2,s/2]).scale(P):F==="equalEarth"?L.geoEqualEarth().rotate([0,0]).center($||g.geometry.coordinates).translate([d/2,s/2]).scale(P):F==="naturalEarth"?L.geoNaturalEarth1().rotate([0,0]).center($||g.geometry.coordinates).translate([d/2,s/2]).scale(P):F==="orthographic"?L.geoOrthographic().rotate([0,0]).center($||g.geometry.coordinates).translate([d/2,s/2]).scale(P):L.geoAlbersUsa().rotate([0,0]).center($||g.geometry.coordinates).translate([d/2,s/2]).scale(P),oe=Array.from({length:R.length},(e,n)=>n),ie=Array.from({length:T.length},(e,n)=>n),X=Me.threshold().domain(R).range(oe),ye=Me.threshold().domain(T).range(ie),N=e=>{if(!O.current||!te.current)return;ke.select(O.current).call(te.current.scaleBy,e==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(ae.motion.svg,{viewBox:`0 0 ${d} ${s}`,width:`${d}px`,height:`${s}px`,ref:O,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:xe,children:[me.filter(e=>e.position==="before").map(e=>e.layer),f.features.map((e,n)=>v.findIndex(i=>i.id===e.properties[A])!==-1?null:t.jsxRuntimeExports.jsx(ae.motion.g,{opacity:H?V:B.length!==0?B.indexOf(e.properties[A])!==-1?1:V:1,children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((i,o)=>{let a="";return i.forEach(m=>{let l=" M";m.forEach((x,y)=>{const j=c([x[0],x[1]]);y!==m.length-1?l=`${l}${j[0]} ${j[1]}L`:l=`${l}${j[0]} ${j[1]}`}),a+=l}),t.jsxRuntimeExports.jsx("path",{d:a,style:{stroke:ne,strokeWidth:W,fill:M}},o)}):e.geometry.coordinates.map((i,o)=>{let a="M";return i.forEach((m,l)=>{const x=c([m[0],m[1]]);l!==i.length-1?a=`${a}${x[0]} ${x[1]}L`:a=`${a}${x[0]} ${x[1]}`}),t.jsxRuntimeExports.jsx("path",{d:a,style:{stroke:ne,strokeWidth:W,fill:M}},o)})},n)),t.jsxRuntimeExports.jsx(Ae.AnimatePresence,{children:v.map(e=>{const n=f.features.findIndex(a=>e.id===a.properties[A]),r=De.checkIfNullOrUndefined(e.x)?void 0:X(e.x),i=De.checkIfNullOrUndefined(e.y)?void 0:ye(e.y),o=r!==void 0&&i!==void 0?Y[i][r]:M;return t.jsxRuntimeExports.jsx(ae.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:H?H===o?1:V:B.length!==0?B.indexOf(e.id)!==-1?1:V:1,transition:{duration:k.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:a=>{Q(e),ee(a.clientY),w(a.clientX),le?.(e)},onClick:()=>{(b||S)&&(Pe.isEqual(h,e)&&E?(Z(void 0),b?.(void 0)):(Z(e),b?.(e)))},onMouseMove:a=>{Q(e),ee(a.clientY),w(a.clientX)},onMouseLeave:()=>{Q(void 0),w(void 0),ee(void 0),le?.(void 0)},children:n===-1?null:f.features[n].geometry.type==="MultiPolygon"?f.features[n].geometry.coordinates.map((a,m)=>{let l="";return a.forEach(x=>{let y=" M";x.forEach((j,Oe)=>{const fe=c([j[0],j[1]]);Oe!==x.length-1?y=`${y}${fe[0]} ${fe[1]}L`:y=`${y}${fe[0]} ${fe[1]}`}),l+=y}),t.jsxRuntimeExports.jsx(ae.motion.path,{variants:{initial:{fill:o,opacity:0},whileInView:{fill:o,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},d:l,className:`${o===M?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:W}},`${e.id}-${m}`)}):f.features[n].geometry.coordinates.map((a,m)=>{let l="M";return a.forEach((x,y)=>{const j=c([x[0],x[1]]);y!==a.length-1?l=`${l}${j[0]} ${j[1]}L`:l=`${l}${j[0]} ${j[1]}`}),t.jsxRuntimeExports.jsx(ae.motion.path,{d:l,variants:{initial:{fill:o,opacity:0},whileInView:{fill:o,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},className:`${o===M?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:W}},`${e.id}-${m}`)})},e.id)})}),G?f.features.filter(e=>e.properties[A]===G.id).map((e,n)=>t.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((r,i)=>{let o="";return r.forEach(a=>{let m=" M";a.forEach((l,x)=>{const y=c([l[0],l[1]]);x!==a.length-1?m=`${m}${y[0]} ${y[1]}L`:m=`${m}${y[0]} ${y[1]}`}),o+=m}),t.jsxRuntimeExports.jsx("path",{d:o,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},i)}):e.geometry.coordinates.map((r,i)=>{let o="M";return r.forEach((a,m)=>{const l=c([a[0],a[1]]);m!==r.length-1?o=`${o}${l[0]} ${l[1]}L`:o=`${o}${l[0]} ${l[1]}`}),t.jsxRuntimeExports.jsx("path",{d:o,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},i)})},n)):null,me.filter(e=>e.position==="after").map(e=>e.layer)]})}),ue===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:de?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.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:()=>{K(!1)},children:t.jsxRuntimeExports.jsx(Re.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:"175px"},children:[t.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:t.jsxRuntimeExports.jsxs("g",{children:[Y.map((e,n)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-n*25})`,children:e.map((r,i)=>t.jsxRuntimeExports.jsx("rect",{y:1,x:i*25+1,fill:r,width:23,height:23,strokeWidth:H===r?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{_(r)},onMouseLeave:()=>{_(void 0)}},i))},n)),t.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:R.map((e,n)=>t.jsxRuntimeExports.jsx("text",{y:10,x:(n+1)*25,fontSize:10,textAnchor:"middle",children:typeof e=="string"||e<1?e:Ne.numberFormattingFunction(e,"NA")},n))}),T.map((e,n)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(R.length+1,5),4)*25+10},${100-n*25})`,children:t.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof e=="string"||e<1?e:Ne.numberFormattingFunction(e,"NA")})},n))]})}),t.jsxRuntimeExports.jsx(Se.u,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:z})]}),t.jsxRuntimeExports.jsx(Se.u,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:D})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{K(!0)},children:t.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"})})}),q==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>N("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>N("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:"–"})]})]}),G&&se&&pe&&C?t.jsxRuntimeExports.jsx(ze.Tooltip,{data:G,body:se,xPos:pe,yPos:C,backgroundStyle:be?.tooltip,className:Ee?.tooltip}):null,S&&h!==void 0?t.jsxRuntimeExports.jsx(Te.X,{open:h!==void 0,onClose:()=>{Z(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof S=="string"?{__html:We.string2HTML(S,h)}:void 0,children:typeof S=="function"?S(h):null})}):null]})}function Ye(je){const{data:v,graphTitle:R,mapData:f="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",colors:D=we.Colors.light.bivariateColors.colors05x05,sources:T,graphDescription:z,height:d,width:s,footNote:Y="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.",xDomain:J,yDomain:$,xColorLegendTitle:W="X Color key",yColorLegendTitle:M="Y Color key",tooltip:ne,scale:se=.95,centerPoint:le,padding:ce,mapBorderWidth:ve=.5,mapNoDataColor:B=we.Colors.light.graphNoData,backgroundColor:b=!1,mapBorderColor:A=we.Colors.light.grays["gray-500"],relativeHeight:E,onSeriesMouseOver:S,isWorldMap:ue=!0,zoomScaleExtend:be=[.8,6],zoomTranslateExtend:Ee,graphID:F,showColorScale:q=!0,highlightedIds:k=[],onSeriesMouseClick:V,mapProperty:me="ISO3",graphDownload:de=!1,dataDownload:K=!1,showAntarctica:H=!1,language:_="en",minHeight:h=0,theme:Z="light",ariaLabel:G,resetSelectionOnDoubleClick:Q=!0,detailsOnClick:pe,styles:w,classNames:C,mapProjection:ee,zoomInteraction:O="button",animate:U=!1,dimmedOpacity:xe=.3,customLayers:te=[],timeline:p={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=je,[g,he]=u.useState(0),[re,ge]=u.useState(0),[I,P]=u.useState(p.autoplay),c=Ge.sort(_e.uniqBy(v,"date",!0).map(r=>Ce.parse(`${r}`,p.dateFormat||"yyyy",new Date).getTime()),(r,i)=>Ue.ascending(r,i)),[oe,ie]=u.useState(p.autoplay?0:c.length-1),[X,ye]=u.useState(void 0),N=u.useRef(null),e=u.useRef(null);u.useEffect(()=>{const r=new ResizeObserver(i=>{he(s||i[0].contentRect.width||760),ge(d||i[0].target.clientHeight||480)});return N.current&&(ge(N.current.clientHeight||480),he(N.current.clientWidth||760),s||r.observe(N.current)),()=>r.disconnect()},[s,d]),u.useEffect(()=>{typeof f=="string"?He.fetchAndParseJSON(f).then(i=>{ye(i)}):ye(f)},[f]),u.useEffect(()=>{const r=setInterval(()=>{ie(i=>i<c.length-1?i+1:0)},(p.speed||2)*1e3);return I||clearInterval(r),()=>clearInterval(r)},[c,I,p.speed]);const n=$e.getSliderMarks(c,oe,p.showOnlyActiveDate,p.dateFormat||"yyyy");return J&&$&&(J.length!==D[0].length-1||$.length!==D.length-1)?(console.error("the xDomain and yDomain array length don't match to the color array length"),null):t.jsxRuntimeExports.jsx("div",{className:`${Z||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:_==="he"||_==="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 ${_||"en"}`,s?"w-fit":"w-full",C?.graphContainer),style:{...w?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:F,ref:e,"aria-label":G||`${R?`The graph shows ${R}. `:""}This is bi-variate choropleth map where geographic areas are colored in proportion to two variables.${z?` ${z}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?ce||"1rem":ce||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||z||de||K?t.jsxRuntimeExports.jsx(Fe.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:C?.title,description:C?.description},graphTitle:R,graphDescription:z,width:s,graphDownload:de?e.current:void 0,dataDownload:K?v.map(r=>r.data).filter(r=>r!==void 0).length>0?v.map(r=>r.data).filter(r=>r!==void 0):v.filter(r=>r!==void 0):null}):null,p.enabled&&c.length>0&&n?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{P(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?t.jsxRuntimeExports.jsx(Re.Pause,{}):t.jsxRuntimeExports.jsx(Re.Play,{})}),t.jsxRuntimeExports.jsx($e.xr,{min:c[0],max:c[c.length-1],marks:n,step:null,defaultValue:c[c.length-1],value:c[oe],onChangeComplete:r=>{ie(c.indexOf(r))},onChange:r=>{ie(c.indexOf(r))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:N,"aria-label":"Map area",children:(s||g)&&(d||re)&&X?t.jsxRuntimeExports.jsx(Xe,{data:v.filter(r=>p.enabled?r.date===Ce.format(new Date(c[oe]),p.dateFormat||"yyyy"):r),mapData:H?X:{...X,features:X.features.filter(r=>r.properties.NAME!=="Antarctica")},xDomain:J||qe.getJenks(v.map(r=>r.x),D[0].length),yDomain:$||qe.getJenks(v.map(r=>r.y),D.length),width:s||g,height:Math.max(h,d||(E?h?(s||g)*E>h?(s||g)*E:h:(s||g)*E:re)),scale:se,centerPoint:le,colors:D,xColorLegendTitle:W,yColorLegendTitle:M,mapBorderWidth:ve,mapNoDataColor:B,mapBorderColor:A,tooltip:ne,onSeriesMouseOver:S,isWorldMap:ue,zoomScaleExtend:be,zoomTranslateExtend:Ee,onSeriesMouseClick:V,mapProperty:me,highlightedIds:k,resetSelectionOnDoubleClick:Q,styles:w,showColorScale:q,classNames:C,mapProjection:ee||(ue?"naturalEarth":"mercator"),detailsOnClick:pe,zoomInteraction:O,animate:U===!0?{duration:.5,once:!0,amount:.5}:U||{duration:0,once:!0,amount:0},dimmedOpacity:xe,customLayers:te}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(h,d||(E?h?(s||g)*E>h?(s||g)*E:h:(s||g)*E:re))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ie.y,{"aria-label":"Loading graph"})})}),T||Y?t.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:C?.footnote,source:C?.source},sources:T,footNote:Y,width:s}):null]})})})})}exports.BiVariateChoroplethMap=Ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),u=require("react"),Ce=require("./getSliderMarks-CUxPy36E.cjs"),Ie=require("./Spinner-C6wLp85s.cjs"),Se=require("./parse-hMnG_lRV.cjs"),Le=require("./index-DQA8q5sC.cjs"),z=require("./zoom-BiMNsz72.cjs"),Te=require("./index-CoZbeNM9.cjs"),ze=require("./Modal-CuuJdWkD.cjs"),Ne=require("./Typography-BDULiwlF.cjs"),De=require("./numberFormattingFunction-02t-wJta.cjs"),We=require("./Tooltip-Cpv0QohJ.cjs"),Be=require("./string2HTML-z7CwHXcx.cjs"),Me=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),$e=require("./index-C0bpbS4F.cjs"),we=require("./select-Bnfk0lJx.cjs"),qe=require("./threshold-DNsSUf8Q.cjs"),Ae=require("./use-in-view-CEwlc_dd.cjs"),ie=require("./proxy-CKadx4lC.cjs"),Fe=require("./index-Cm8NIdOO.cjs"),Ve=require("./GraphHeader.cjs"),He=require("./GraphFooter.cjs"),Re=require("./Colors.cjs"),_e=require("./fetchAndParseData-Ba-_CgxS.cjs"),Oe=require("./getJenks-GYmdwBqm.cjs"),Ge=require("./uniqBy-O05lp2S5.cjs"),Ue=require("./sort-O96oMZLb.cjs"),Xe=require("./init-DU0ybBc_.cjs");function Ye(ve){const{data:v,xDomain:R,mapData:y,xColorLegendTitle:q,yDomain:W,yColorLegendTitle:B,width:d,height:s,colors:Y,scale:J,centerPoint:$,mapBorderWidth:A,mapNoDataColor:O,mapBorderColor:ne,tooltip:se,onSeriesMouseOver:le,zoomScaleExtend:ce,zoomTranslateExtend:be,highlightedIds:F,onSeriesMouseClick:b,mapProperty:V,resetSelectionOnDoubleClick:E,detailsOnClick:S,showColorScale:ue,styles:Ee,classNames:ke,mapProjection:H,zoomInteraction:P,animate:k,dimmedOpacity:_,customLayers:me,collapseColorScaleByDefault:K}=ve,[de,pe]=u.useState(K===void 0?!(d<680):!K),[N,j]=u.useState(void 0),[I,Z]=u.useState(void 0),[G,Q]=u.useState(void 0),[C,w]=u.useState(void 0),[he,ee]=u.useState(void 0),D=u.useRef(null),te=Ae.useInView(D,{once:k.once,amount:k.amount}),xe=u.useRef(null),h=u.useRef(null);u.useEffect(()=>{const e=we.select(xe.current),n=we.select(D.current),r=o=>{if(P==="noZoom")return!1;if(P==="button")return!o.type.includes("wheel");const i=o.type==="wheel",m=o.type.startsWith("touch"),l=o.type==="mousedown"||o.type==="mousemove";return m?!0:i?P==="scroll"?!0:o.ctrlKey:l&&!o.button&&!o.ctrlKey},a=z.zoom().scaleExtent(ce).translateExtent(be||[[-20,-20],[d+20,s+20]]).filter(r).on("zoom",({transform:o})=>{e.attr("transform",o)});n.call(a),h.current=a},[s,d,P]);const U=z.turf_bbox_default(y),x=Te.turf_center_of_mass_default(y),ge=U[2]-U[0],re=U[3]-U[1],ye=d*190/960*360/ge,L=s*190/678*180/re,T=J*Math.min(ye,L),c=H==="mercator"?z.geoMercator().rotate([0,0]).center($||x.geometry.coordinates).translate([d/2,s/2]).scale(T):H==="equalEarth"?z.geoEqualEarth().rotate([0,0]).center($||x.geometry.coordinates).translate([d/2,s/2]).scale(T):H==="naturalEarth"?z.geoNaturalEarth1().rotate([0,0]).center($||x.geometry.coordinates).translate([d/2,s/2]).scale(T):H==="orthographic"?z.geoOrthographic().rotate([0,0]).center($||x.geometry.coordinates).translate([d/2,s/2]).scale(T):z.geoAlbersUsa().rotate([0,0]).center($||x.geometry.coordinates).translate([d/2,s/2]).scale(T),oe=Array.from({length:R.length},(e,n)=>n),ae=Array.from({length:W.length},(e,n)=>n),X=qe.threshold().domain(R).range(oe),fe=qe.threshold().domain(W).range(ae),M=e=>{if(!D.current||!h.current)return;we.select(D.current).call(h.current.scaleBy,e==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(ie.motion.svg,{viewBox:`0 0 ${d} ${s}`,width:`${d}px`,height:`${s}px`,ref:D,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:xe,children:[me.filter(e=>e.position==="before").map(e=>e.layer),y.features.map((e,n)=>v.findIndex(a=>a.id===e.properties[V])!==-1?null:t.jsxRuntimeExports.jsx(ie.motion.g,{opacity:N?_:F.length!==0?F.indexOf(e.properties[V])!==-1?1:_:1,children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((a,o)=>{let i="";return a.forEach(m=>{let l=" M";m.forEach((p,g)=>{const f=c([p[0],p[1]]);g!==m.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),i+=l}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:ne,strokeWidth:A,fill:O}},o)}):e.geometry.coordinates.map((a,o)=>{let i="M";return a.forEach((m,l)=>{const p=c([m[0],m[1]]);l!==a.length-1?i=`${i}${p[0]} ${p[1]}L`:i=`${i}${p[0]} ${p[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:ne,strokeWidth:A,fill:O}},o)})},n)),t.jsxRuntimeExports.jsx(Fe.AnimatePresence,{children:v.map(e=>{const n=y.features.findIndex(i=>e.id===i.properties[V]),r=Me.checkIfNullOrUndefined(e.x)?void 0:X(e.x),a=Me.checkIfNullOrUndefined(e.y)?void 0:fe(e.y),o=r!==void 0&&a!==void 0?Y[a][r]:O;return t.jsxRuntimeExports.jsx(ie.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:N?N===o?1:_:F.length!==0?F.indexOf(e.id)!==-1?1:_:1,transition:{duration:k.duration}}},initial:"initial",animate:te?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},onMouseEnter:i=>{Q(e),ee(i.clientY),w(i.clientX),le?.(e)},onClick:()=>{(b||S)&&(Le.isEqual(I,e)&&E?(Z(void 0),b?.(void 0)):(Z(e),b?.(e)))},onMouseMove:i=>{Q(e),ee(i.clientY),w(i.clientX)},onMouseLeave:()=>{Q(void 0),w(void 0),ee(void 0),le?.(void 0)},children:n===-1?null:y.features[n].geometry.type==="MultiPolygon"?y.features[n].geometry.coordinates.map((i,m)=>{let l="";return i.forEach(p=>{let g=" M";p.forEach((f,Pe)=>{const je=c([f[0],f[1]]);Pe!==p.length-1?g=`${g}${je[0]} ${je[1]}L`:g=`${g}${je[0]} ${je[1]}`}),l+=g}),t.jsxRuntimeExports.jsx(ie.motion.path,{variants:{initial:{fill:o,opacity:0},whileInView:{fill:o,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:te?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},d:l,className:`${o===O?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:A}},`${e.id}-${m}`)}):y.features[n].geometry.coordinates.map((i,m)=>{let l="M";return i.forEach((p,g)=>{const f=c([p[0],p[1]]);g!==i.length-1?l=`${l}${f[0]} ${f[1]}L`:l=`${l}${f[0]} ${f[1]}`}),t.jsxRuntimeExports.jsx(ie.motion.path,{d:l,variants:{initial:{fill:o,opacity:0},whileInView:{fill:o,opacity:1,transition:{duration:k.duration}}},initial:"initial",animate:te?"whileInView":"initial",exit:{opacity:0,transition:{duration:k.duration}},className:`${o===O?"stroke-primary-gray-400 dark:stroke-primary-gray-500":"stroke-primary-white dark:stroke-primary-gray-650"}`,style:{strokeWidth:A}},`${e.id}-${m}`)})},e.id)})}),G?y.features.filter(e=>e.properties[V]===G.id).map((e,n)=>t.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((r,a)=>{let o="";return r.forEach(i=>{let m=" M";i.forEach((l,p)=>{const g=c([l[0],l[1]]);p!==i.length-1?m=`${m}${g[0]} ${g[1]}L`:m=`${m}${g[0]} ${g[1]}`}),o+=m}),t.jsxRuntimeExports.jsx("path",{d:o,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)}):e.geometry.coordinates.map((r,a)=>{let o="M";return r.forEach((i,m)=>{const l=c([i[0],i[1]]);m!==r.length-1?o=`${o}${l[0]} ${l[1]}L`:o=`${o}${l[0]} ${l[1]}`}),t.jsxRuntimeExports.jsx("path",{d:o,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},a)})},n)):null,me.filter(e=>e.position==="after").map(e=>e.layer)]})}),ue===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:de?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:()=>{pe(!1)},children:t.jsxRuntimeExports.jsx($e.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:"175px"},children:[t.jsxRuntimeExports.jsxs("div",{className:"flex gap-1 items-center",children:[t.jsxRuntimeExports.jsx("svg",{width:"136px",viewBox:"0 0 136 136",className:"shrink-0",children:t.jsxRuntimeExports.jsxs("g",{children:[Y.map((e,n)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(0,${100-n*25})`,children:e.map((r,a)=>t.jsxRuntimeExports.jsx("rect",{y:1,x:a*25+1,fill:r,width:23,height:23,strokeWidth:N===r?2:.25,style:{cursor:"pointer"},onMouseOver:()=>{j(r)},onMouseLeave:()=>{j(void 0)}},a))},n)),t.jsxRuntimeExports.jsx("g",{transform:"translate(0,125)",children:R.map((e,n)=>t.jsxRuntimeExports.jsx("text",{y:10,x:(n+1)*25,fontSize:10,textAnchor:"middle",children:typeof e=="string"||e<1?e:De.numberFormattingFunction(e,"NA")},n))}),W.map((e,n)=>t.jsxRuntimeExports.jsx("g",{transform:`translate(${Math.max(Math.min(R.length+1,5),4)*25+10},${100-n*25})`,children:t.jsxRuntimeExports.jsx("text",{x:0,transform:"rotate(-90)",y:0,fontSize:10,textAnchor:"middle",children:typeof e=="string"||e<1?e:De.numberFormattingFunction(e,"NA")})},n))]})}),t.jsxRuntimeExports.jsx(Ne.u,{marginBottom:"none",size:"xs",className:"leading-normal text-center shrink-0",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",writingMode:"vertical-rl",height:"8.5rem",transform:"rotate(180deg)"},children:B})]}),t.jsxRuntimeExports.jsx(Ne.u,{marginBottom:"none",size:"xs",className:"mt-1 leading-normal text-center",style:{display:"-webkit-box",WebkitLineClamp:"1",width:"8.5rem",WebkitBoxOrient:"vertical",overflow:"hidden"},children:q})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{pe(!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"})})}),P==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>M("in"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:()=>M("out"),className:"leading-0 px-2 py-3.5 border text-primary-gray-700 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:"–"})]})]}),G&&se&&C&&he?t.jsxRuntimeExports.jsx(We.Tooltip,{data:G,body:se,xPos:C,yPos:he,backgroundStyle:Ee?.tooltip,className:ke?.tooltip}):null,S&&I!==void 0?t.jsxRuntimeExports.jsx(ze.G,{open:I!==void 0,onClose:()=>{Z(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof S=="string"?{__html:Be.string2HTML(S,I)}:void 0,children:typeof S=="function"?S(I):null})}):null]})}function Je(ve){const{data:v,graphTitle:R,mapData:y="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",colors:q=Re.Colors.light.bivariateColors.colors05x05,sources:W,graphDescription:B,height:d,width:s,footNote:Y="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.",xDomain:J,yDomain:$,xColorLegendTitle:A="X Color key",yColorLegendTitle:O="Y Color key",tooltip:ne,scale:se=.95,centerPoint:le,padding:ce,mapBorderWidth:be=.5,mapNoDataColor:F=Re.Colors.light.graphNoData,backgroundColor:b=!1,mapBorderColor:V=Re.Colors.light.grays["gray-500"],relativeHeight:E,onSeriesMouseOver:S,isWorldMap:ue=!0,zoomScaleExtend:Ee=[.8,6],zoomTranslateExtend:ke,graphID:H,showColorScale:P=!0,highlightedIds:k=[],onSeriesMouseClick:_,mapProperty:me="ISO3",graphDownload:K=!1,dataDownload:de=!1,showAntarctica:pe=!1,language:N="en",minHeight:j=0,theme:I="light",ariaLabel:Z,resetSelectionOnDoubleClick:G=!0,detailsOnClick:Q,styles:C,classNames:w,mapProjection:he,zoomInteraction:ee="button",animate:D=!1,dimmedOpacity:te=.3,customLayers:xe=[],timeline:h={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},collapseColorScaleByDefault:U}=ve,[x,ge]=u.useState(0),[re,ye]=u.useState(0),[L,T]=u.useState(h.autoplay),c=Ue.sort(Ge.uniqBy(v,"date",!0).map(r=>Se.parse(`${r}`,h.dateFormat||"yyyy",new Date).getTime()),(r,a)=>Xe.ascending(r,a)),[oe,ae]=u.useState(h.autoplay?0:c.length-1),[X,fe]=u.useState(void 0),M=u.useRef(null),e=u.useRef(null);u.useEffect(()=>{const r=new ResizeObserver(a=>{ge(s||a[0].contentRect.width||760),ye(d||a[0].target.clientHeight||480)});return M.current&&(ye(M.current.clientHeight||480),ge(M.current.clientWidth||760),s||r.observe(M.current)),()=>r.disconnect()},[s,d]),u.useEffect(()=>{typeof y=="string"?_e.fetchAndParseJSON(y).then(a=>{fe(a)}):fe(y)},[y]),u.useEffect(()=>{const r=setInterval(()=>{ae(a=>a<c.length-1?a+1:0)},(h.speed||2)*1e3);return L||clearInterval(r),()=>clearInterval(r)},[c,L,h.speed]);const n=Ce.getSliderMarks(c,oe,h.showOnlyActiveDate,h.dateFormat||"yyyy");return J&&$&&(J.length!==q[0].length-1||$.length!==q.length-1)?(console.error("the xDomain and yDomain array length don't match to the color array length"),null):t.jsxRuntimeExports.jsx("div",{className:`${I||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:N==="he"||N==="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 ${N||"en"}`,s?"w-fit":"w-full",w?.graphContainer),style:{...C?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:H,ref:e,"aria-label":Z||`${R?`The graph shows ${R}. `:""}This is bi-variate choropleth map where geographic areas are colored in proportion to two variables.${B?` ${B}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?ce||"1rem":ce||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||B||K||de?t.jsxRuntimeExports.jsx(Ve.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:w?.title,description:w?.description},graphTitle:R,graphDescription:B,width:s,graphDownload:K?e.current:void 0,dataDownload:de?v.map(r=>r.data).filter(r=>r!==void 0).length>0?v.map(r=>r.data).filter(r=>r!==void 0):v.filter(r=>r!==void 0):null}):null,h.enabled&&c.length>0&&n?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{T(!L)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":L?"Click to pause animation":"Click to play animation",children:L?t.jsxRuntimeExports.jsx($e.Pause,{}):t.jsxRuntimeExports.jsx($e.Play,{})}),t.jsxRuntimeExports.jsx(Ce.xr,{min:c[0],max:c[c.length-1],marks:n,step:null,defaultValue:c[c.length-1],value:c[oe],onChangeComplete:r=>{ae(c.indexOf(r))},onChange:r=>{ae(c.indexOf(r))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:M,"aria-label":"Map area",children:(s||x)&&(d||re)&&X?t.jsxRuntimeExports.jsx(Ye,{data:v.filter(r=>h.enabled?r.date===Se.format(new Date(c[oe]),h.dateFormat||"yyyy"):r),mapData:pe?X:{...X,features:X.features.filter(r=>r.properties.NAME!=="Antarctica")},xDomain:J||Oe.getJenks(v.map(r=>r.x),q[0].length),yDomain:$||Oe.getJenks(v.map(r=>r.y),q.length),width:s||x,height:Math.max(j,d||(E?j?(s||x)*E>j?(s||x)*E:j:(s||x)*E:re)),scale:se,centerPoint:le,colors:q,xColorLegendTitle:A,yColorLegendTitle:O,mapBorderWidth:be,mapNoDataColor:F,mapBorderColor:V,tooltip:ne,onSeriesMouseOver:S,isWorldMap:ue,zoomScaleExtend:Ee,zoomTranslateExtend:ke,onSeriesMouseClick:_,mapProperty:me,highlightedIds:k,resetSelectionOnDoubleClick:G,styles:C,showColorScale:P,classNames:w,mapProjection:he||(ue?"naturalEarth":"mercator"),detailsOnClick:Q,zoomInteraction:ee,animate:D===!0?{duration:.5,once:!0,amount:.5}:D||{duration:0,once:!0,amount:0},dimmedOpacity:te,customLayers:xe,collapseColorScaleByDefault:U}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(j,d||(E?j?(s||x)*E>j?(s||x)*E:j:(s||x)*E:re))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Ie.y,{"aria-label":"Loading graph"})})}),W||Y?t.jsxRuntimeExports.jsx(He.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:w?.footnote,source:w?.source},sources:W,footNote:Y,width:s}):null]})})})})}exports.BiVariateChoroplethMap=Je;
|
|
2
2
|
//# sourceMappingURL=BiVariateChoroplethMap.cjs.map
|