@undp/data-viz 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +16 -16
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +45 -45
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +12 -12
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +9 -9
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +50 -50
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +12 -12
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +12 -12
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +12 -12
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +26 -26
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +7 -7
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
- package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
- package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
- package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +17 -17
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +13 -13
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +26 -26
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +29 -29
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +5 -5
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as r, m as a, b as s } from "./index-CHPV5EwG-
|
|
1
|
+
import { a as r, m as a, b as s } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
const m = s("animate-spin border-[5px] rounded-full inline-block box-border", {
|
|
3
3
|
variants: {
|
|
4
4
|
variant: {
|
|
@@ -27,4 +27,4 @@ function n({ size: e, variant: d, show: b = !0, children: o, className: i }) {
|
|
|
27
27
|
export {
|
|
28
28
|
n as y
|
|
29
29
|
};
|
|
30
|
-
//# sourceMappingURL=Spinner-
|
|
30
|
+
//# sourceMappingURL=Spinner-Bpz70q_g.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner-
|
|
1
|
+
{"version":3,"file":"Spinner-Bpz70q_g.js","sources":["../node_modules/@undp/design-system-react/dist/Spinner.js"],"sourcesContent":["import { j as r } from \"./jsx-runtime-BzflLqGi.js\";\nimport { c as s } from \"./index-CHPV5EwG.js\";\nimport { c as a } from \"./utils-D_Pof5Gy.js\";\nconst m = s(\"animate-spin border-[5px] rounded-full inline-block box-border\", {\n variants: {\n variant: {\n red: \"border-accent-dark-red dark:border-accent-red border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n blue: \"border-primary-blue-600 dark:border-primary-blue-500 border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n black: \"border-primary-gray-600 dark:border-primary-gray-200 border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n custom: \"border-custom-color-600 border-b-primary-gray-300 dark:border-b-primary-gray-550\"\n },\n size: {\n sm: \"border-[2px] h-6 w-6\",\n base: \"border-[4px] h-8 w-8\",\n lg: \"border-[6px] h-12 w-12\"\n }\n },\n defaultVariants: {\n size: \"base\",\n variant: \"blue\"\n }\n});\nfunction y({ size: e, variant: d, show: o = !0, children: b, className: i }) {\n return /* @__PURE__ */ r.jsxs(\"span\", { className: a(\"flex-col items-center justify-center\", o ? \"flex\" : \"hidden\"), children: [\n /* @__PURE__ */ r.jsx(\"div\", { className: a(m({ variant: d, size: e }), i) }),\n b\n ] });\n}\nexport {\n y as Spinner\n};\n//# sourceMappingURL=Spinner.js.map\n"],"names":["s","y","o","b","r","a"],"mappings":";AAGA,MAAM,IAAIA,EAAE,kEAAkE;AAAA,EAC5E,UAAU;AAAA,IACR,SAAS;AAAA,MACP,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,QAAQ;AAAA,IACd;AAAA,IACI,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,IACV;AAAA,EACA;AAAA,EACE,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EACb;AACA,CAAC;AACD,SAASC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,MAAMC,IAAI,IAAI,UAAUC,GAAG,WAAW,EAAC,GAAI;AAC3E,SAAuBC,gBAAAA,EAAE,KAAK,QAAQ,EAAE,WAAWC,EAAE,wCAAwCH,IAAI,SAAS,QAAQ,GAAG,UAAU;AAAA,IAC7GE,gBAAAA,EAAE,IAAI,OAAO,EAAE,WAAWC,EAAE,EAAE,EAAE,SAAS,GAAG,MAAM,EAAC,CAAE,GAAG,CAAC,EAAC,CAAE;AAAA,IAC5EF;AAAA,EACJ,GAAK;AACL;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const r=require("./index-CHPV5EwG-
|
|
2
|
-
//# sourceMappingURL=Spinner-
|
|
1
|
+
"use strict";const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),o=r.j("animate-spin border-[5px] rounded-full inline-block box-border",{variants:{variant:{red:"border-accent-dark-red dark:border-accent-red border-b-primary-gray-300 dark:border-b-primary-gray-550",blue:"border-primary-blue-600 dark:border-primary-blue-500 border-b-primary-gray-300 dark:border-b-primary-gray-550",black:"border-primary-gray-600 dark:border-primary-gray-200 border-b-primary-gray-300 dark:border-b-primary-gray-550",custom:"border-custom-color-600 border-b-primary-gray-300 dark:border-b-primary-gray-550"},size:{sm:"border-[2px] h-6 w-6",base:"border-[4px] h-8 w-8",lg:"border-[6px] h-12 w-12"}},defaultVariants:{size:"base",variant:"blue"}});function s({size:e,variant:a,show:d=!0,children:b,className:i}){return r.ae.jsxs("span",{className:r.mo("flex-col items-center justify-center",d?"flex":"hidden"),children:[r.ae.jsx("div",{className:r.mo(o({variant:a,size:e}),i)}),b]})}exports.y=s;
|
|
2
|
+
//# sourceMappingURL=Spinner-C6wLp85s.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner-
|
|
1
|
+
{"version":3,"file":"Spinner-C6wLp85s.cjs","sources":["../node_modules/@undp/design-system-react/dist/Spinner.js"],"sourcesContent":["import { j as r } from \"./jsx-runtime-BzflLqGi.js\";\nimport { c as s } from \"./index-CHPV5EwG.js\";\nimport { c as a } from \"./utils-D_Pof5Gy.js\";\nconst m = s(\"animate-spin border-[5px] rounded-full inline-block box-border\", {\n variants: {\n variant: {\n red: \"border-accent-dark-red dark:border-accent-red border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n blue: \"border-primary-blue-600 dark:border-primary-blue-500 border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n black: \"border-primary-gray-600 dark:border-primary-gray-200 border-b-primary-gray-300 dark:border-b-primary-gray-550\",\n custom: \"border-custom-color-600 border-b-primary-gray-300 dark:border-b-primary-gray-550\"\n },\n size: {\n sm: \"border-[2px] h-6 w-6\",\n base: \"border-[4px] h-8 w-8\",\n lg: \"border-[6px] h-12 w-12\"\n }\n },\n defaultVariants: {\n size: \"base\",\n variant: \"blue\"\n }\n});\nfunction y({ size: e, variant: d, show: o = !0, children: b, className: i }) {\n return /* @__PURE__ */ r.jsxs(\"span\", { className: a(\"flex-col items-center justify-center\", o ? \"flex\" : \"hidden\"), children: [\n /* @__PURE__ */ r.jsx(\"div\", { className: a(m({ variant: d, size: e }), i) }),\n b\n ] });\n}\nexport {\n y as Spinner\n};\n//# sourceMappingURL=Spinner.js.map\n"],"names":["m","s","y","d","o","r","a"],"mappings":"8DAGMA,EAAIC,EAAAA,EAAE,iEAAkE,CAC5E,SAAU,CACR,QAAS,CACP,IAAK,yGACL,KAAM,gHACN,MAAO,gHACP,OAAQ,kFACd,EACI,KAAM,CACJ,GAAI,uBACJ,KAAM,uBACN,GAAI,wBACV,CACA,EACE,gBAAiB,CACf,KAAM,OACN,QAAS,MACb,CACA,CAAC,EACD,SAASC,EAAE,CAAE,KAAM,EAAG,QAASC,EAAG,KAAMC,EAAI,GAAI,SAAU,EAAG,UAAW,CAAC,EAAI,CAC3E,OAAuBC,KAAE,KAAK,OAAQ,CAAE,UAAWC,EAAAA,GAAE,uCAAwCF,EAAI,OAAS,QAAQ,EAAG,SAAU,CAC7GC,EAAAA,GAAE,IAAI,MAAO,CAAE,UAAWC,EAAAA,GAAEN,EAAE,CAAE,QAASG,EAAG,KAAM,CAAC,CAAE,EAAG,CAAC,CAAC,CAAE,EAC5E,CACJ,EAAK,CACL","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),y=require("./index-CSNtgibC.cjs"),E=require("./Typography-BDULiwlF.cjs"),R=require("./GraphFooter.cjs"),k=require("./GraphHeader.cjs"),m=require("./numberFormattingFunction-02t-wJta.cjs");function T(S){const{year:d,data:t,graphTitle:x,suffix:i="",sources:h,prefix:s="",graphDescription:c,footNote:f,padding:j,backgroundColor:g=!1,graphID:$,aggregationMethod:o="count",language:u="en",countOnly:p,theme:A="light",ariaLabel:G,textBackground:b=!1,headingFontSize:F="4.375rem",centerAlign:v=!1,verticalAlign:N="center",layout:w="primary",styles:n,classNames:a,precision:l=2}=S;return r.jsxRuntimeExports.jsx("div",{className:`${A||"light"} flex w-full`,dir:u==="he"||u==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${g?g===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}flex flex-col w-full h-inherit ${u||"en"}`,a?.graphContainer),style:{...n?.graphContainer||{},...g&&g!==!0?{backgroundColor:g}:{}},id:$,"aria-label":G||`${x?`The graph shows ${x}. `:""}This is a statistic card.${c?` ${c}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:g?j||"1rem":j||0},children:w!=="secondary"?r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-12 justify-between grow",children:[x||c?r.jsxRuntimeExports.jsx(k.GraphHeader,{styles:{title:n?.title,description:n?.description},classNames:{title:a?.title,description:a?.description},graphTitle:x,graphDescription:c}):null,r.jsxRuntimeExports.jsx("div",{className:`flex flex-col justify-between grow ${N==="top"?"justify-start":N==="bottom"?"justify-end":"justify-center"}`,children:r.jsxRuntimeExports.jsxs(E.h,{marginBottom:"base",className:`leading-none text-outline font-heading ${v?"text-center":u==="he"||u==="ar"?"text-right":"text-left"} ${b?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:F,letterSpacing:"0.05rem"},children:[t.filter(e=>typeof e.value=="string").length>0||o==="count"?p&&p?.length!==0?t.filter(e=>p.indexOf(e.value)!==-1).length:t.length:o==="sum"?m.numberFormattingFunction(y.sum(t.map(e=>e.value)),"NA",l,s,i):o==="average"?m.numberFormattingFunction(parseFloat((y.sum(t.map(e=>e.value))/t.length).toFixed(2)),"NA",l,s,i):o==="max"?m.numberFormattingFunction(Math.max(...t.map(e=>e.value).filter(e=>e!==void 0)),"NA",l,s,i):m.numberFormattingFunction(Math.min(...t.map(e=>e.value).filter(e=>e!==void 0)),"NA",l,s,i)," ",d?r.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:["(",d,")"]}):null]})}),h||f?r.jsxRuntimeExports.jsx(R.GraphFooter,{styles:{footnote:n?.footnote,source:n?.source},classNames:{footnote:a?.footnote,source:a?.source},sources:h,footNote:f}):null]}):r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-center",children:[r.jsxRuntimeExports.jsxs(E.h,{marginBottom:w==="secondary"?"none":"base",className:`leading-none text-outline font-heading ${v?"text-center":u==="he"||u==="ar"?"text-right":"text-left"} ${b?"text-primary-black dark:text-primary-white":"transparent"}`,style:{fontSize:F,letterSpacing:"0.05rem"},children:[t.filter(e=>typeof e.value=="string").length>0||o==="count"?p&&p?.length!==0?t.filter(e=>p.indexOf(e.value)!==-1).length:t.length:o==="sum"?m.numberFormattingFunction(y.sum(t.map(e=>e.value)),"NA",l,s,i):o==="average"?m.numberFormattingFunction(parseFloat((y.sum(t.map(e=>e.value))/t.length).toFixed(2)),"NA",l,s,i):o==="max"?m.numberFormattingFunction(Math.max(...t.map(e=>e.value).filter(e=>e!==void 0)),"NA",l,s,i):m.numberFormattingFunction(Math.min(...t.map(e=>e.value).filter(e=>e!==void 0)),"NA",l,s,i)," ",d?r.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:["(",d,")"]}):null]}),x||c?r.jsxRuntimeExports.jsx(k.GraphHeader,{styles:{title:n?.title,description:n?.description},classNames:{title:a?.title,description:a?.description},graphTitle:x,graphDescription:c}):null,h||f?r.jsxRuntimeExports.jsx(R.GraphFooter,{styles:{footnote:n?.footnote,source:n?.source},classNames:{footnote:a?.footnote,source:a?.source},sources:h,footNote:f}):null]})})})})}exports.StatCardFromData=T;
|
|
2
2
|
//# sourceMappingURL=StatCardFromData.cjs.map
|
package/dist/StatCardFromData.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as a, m as W } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as a, m as W } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { s as y } from "./index-CeVNqhMO.js";
|
|
3
|
-
import { h as $ } from "./Typography-
|
|
3
|
+
import { h as $ } from "./Typography-LmZ9LEpe.js";
|
|
4
4
|
import { GraphFooter as A } from "./GraphFooter.js";
|
|
5
5
|
import { GraphHeader as S } from "./GraphHeader.js";
|
|
6
6
|
import { n as m } from "./numberFormattingFunction-14YCbkN2.js";
|
package/dist/StripChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),xe=require("./index-DQA8q5sC.cjs"),de=require("./Modal-tXZlLE5s.cjs"),ge=require("./index-CQ3e6Ewi.cjs"),fe=require("./Tooltip-De16GWhY.cjs"),J=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ce=require("./numberFormattingFunction-02t-wJta.cjs"),u=require("./Colors.cjs"),pe=require("./string2HTML-z7CwHXcx.cjs"),me=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-sQJZ_xDO.cjs"),ne=require("./proxy-BHRoeZgd.cjs"),ve=require("./index-BW8iNx7E.cjs"),je=require("./GraphFooter.cjs"),we=require("./GraphHeader.cjs"),Oe=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-d8_8SxeW.cjs"),ue=require("./uniqBy-O05lp2S5.cjs");function be(L,i){if(L<2)return[];const x=i/(L-1);return Array.from({length:L},(m,o)=>o*x)}function Ee(L){const{data:i,width:x,height:m,colors:o,colorDomain:n,radius:c,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:D,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:I,prefix:K,suffix:C,stripType:Q,highlightColor:y,dotOpacity:v,resetSelectionOnDoubleClick:te,detailsOnClick:N,styles:E,classNames:V,valueColor:S,animate:d,noOfTicks:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:d.once,amount:d.amount}),[T,j]=p.useState(void 0),[g,q]=p.useState(void 0),[_,H]=p.useState(void 0),[f,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},k=x-O.left-O.right,A=m-O.top-O.bottom,ie=i.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(X)?Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([0,k]).nice(),le=be(w,k);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ne.motion.svg,{width:`${x}px`,height:`${m}px`,viewBox:`0 0 ${x} ${m}`,direction:"ltr",ref:Y,children:r.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),r.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>r.jsxRuntimeExports.jsxs(ne.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:F(0),y:A/2},whileInView:{x:F(e.position),y:A/2,opacity:z?e.color&&o[n.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:v,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},onMouseEnter:t=>{j(e),h(t.clientY),H(t.clientX),D?.(e)},onClick:()=>{(I||N)&&(xe.isEqual(g,e)&&te?(q(void 0),I?.(void 0)):(q(e),I?.(e)))},onMouseMove:t=>{j(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{j(void 0),H(void 0),h(void 0),D?.(void 0)},children:[Q==="dot"?r.jsxRuntimeExports.jsx(ne.motion.circle,{cy:0,cx:0,variants:{initial:{fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},r:c}):r.jsxRuntimeExports.jsx(ne.motion.rect,{x:-1,width:2,variants:{initial:{y:0-c,height:c*2,fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{y:0-c,height:c*2,fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?r.jsxRuntimeExports.jsx(ne.motion.text,{x:0,variants:{initial:{opacity:0,y:0-c-5,fill:S||(y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray)},whileInView:{opacity:1,y:0-c-5,fill:S||(y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray),transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},style:{textAnchor:"middle",...E?.graphObjectValues||{}},className:r.mo("graph-value text-sm font-bold",V?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",B,K,C)}):null]},e.label)),le.map((e,t)=>r.jsxRuntimeExports.jsx("text",{x:e,y:A/2+c,style:{textAnchor:t===0?"start":t===le.length-1?"end":"middle",...E?.xAxis?.labels||{}},className:r.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.xAxis?.labels),dy:"1em",children:ce.numberFormattingFunction(F.invert(e),"NA",B,K,C)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&f?r.jsxRuntimeExports.jsx(fe.Tooltip,{data:T,body:U,xPos:_,yPos:f,backgroundStyle:E?.tooltip,className:V?.tooltip}):null,N&&g!==void 0?r.jsxRuntimeExports.jsx(de.X,{open:g!==void 0,onClose:()=>{q(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:pe.string2HTML(N,g)}:void 0,children:typeof N=="function"?N(g):null})}):null]})}function Me(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:D,backgroundColor:l=!1,leftMargin:z=5,rightMargin:G=5,topMargin:X=10,bottomMargin:I=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y=!0,highlightedDataPoints:v=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,graphDownload:S=!1,dataDownload:d=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:j=0,theme:g="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[le,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(c||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||a.observe(Z.current)),()=>a.disconnect()},[s,c]),r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,s?"w-fit":"w-full",h?.graphContainer),style:{...f?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":q||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${n?` ${n}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?D||"1rem":D||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||n||S||d?r.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:n,width:s,graphDownload:S?ae.current:void 0,dataDownload:d?i.map(a=>a.data).filter(a=>a!==void 0).length>0?i.map(a=>a.data).filter(a=>a!==void 0):i.filter(a=>a!==void 0):null}):null,r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?r.jsxRuntimeExports.jsx(Ce.EmptyState,{}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y!==!1&&i.filter(a=>a.color).length!==0?r.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:m||u.Colors[g].categoricalColors.colors,colorDomain:W||ue.uniqBy(i,"color",!0),setSelectedColor:he,showNAColor:T??!0}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,"aria-label":"Graph area",children:(s||b)&&(c||le)?r.jsxRuntimeExports.jsx(Ee,{data:i,width:s||b,height:Math.max(j,c||(C?j?(s||b)*C>j?(s||b)*C:j:(s||b)*C:le)),colorDomain:i.filter(a=>a.color).length===0?[]:W||ue.uniqBy(i,"color",!0),colors:i.filter(a=>a.color).length===0?m?[m]:[u.Colors.primaryColors["blue-600"]]:m||u.Colors[g].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:I,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:v,minValue:N,maxValue:E,onSeriesMouseClick:V,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),o||P?r.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:o,footNote:P,width:s}):null]})})})})}function Re(L){const{data:i,width:x,height:m,colors:o,colorDomain:n,radius:c,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:D,highlightedDataPoints:l,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:I,noOfTicks:K,prefix:C,suffix:Q,stripType:y,highlightColor:v,dotOpacity:te,resetSelectionOnDoubleClick:N,detailsOnClick:E,styles:V,classNames:S,valueColor:d,animate:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:w.once,amount:w.amount}),[T,j]=p.useState(void 0),[g,q]=p.useState(void 0),[_,H]=p.useState(void 0),[f,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},k=x-O.left-O.right,A=m-O.top-O.bottom,ie=i.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(X)?Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([A,0]).nice(),le=be(K,A);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ne.motion.svg,{width:`${x}px`,height:`${m}px`,viewBox:`0 0 ${x} ${m}`,direction:"ltr",ref:Y,children:r.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),r.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>r.jsxRuntimeExports.jsxs(ne.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:k/2,y:F(0)},whileInView:{x:k/2,y:F(e.position),opacity:z?e.color&&o[n.indexOf(e.color)]===z?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:te,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},onMouseEnter:t=>{j(e),h(t.clientY),H(t.clientX),D?.(e)},onClick:()=>{(I||E)&&(xe.isEqual(g,e)&&N?(q(void 0),I?.(void 0)):(q(e),I?.(e)))},onMouseMove:t=>{j(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{j(void 0),H(void 0),h(void 0),D?.(void 0)},children:[y==="dot"?r.jsxRuntimeExports.jsx(ne.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},r:c}):r.jsxRuntimeExports.jsx(ne.motion.rect,{y:-1,height:2,variants:{initial:{x:0-c,width:c*2,fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{x:0-c,width:c*2,fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?r.jsxRuntimeExports.jsx(ne.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+c+3,fill:d||(v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray)},whileInView:{opacity:1,x:0+c+3,fill:d||(v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray),transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{textAnchor:"start",...V?.graphObjectValues||{}},className:r.mo("graph-value text-sm font-bold",S?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",B,C,Q)}):null]},e.label)),le.map((e,t)=>r.jsxRuntimeExports.jsx("text",{y:e,x:k/2+c+5,style:{textAnchor:"start",...V?.yAxis?.labels||{}},className:r.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",S?.yAxis?.labels),children:ce.numberFormattingFunction(F.invert(e),"NA",B,C,Q)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&f?r.jsxRuntimeExports.jsx(fe.Tooltip,{data:T,body:U,xPos:_,yPos:f,backgroundStyle:V?.tooltip,className:S?.tooltip}):null,E&&g!==void 0?r.jsxRuntimeExports.jsx(de.X,{open:g!==void 0,onClose:()=>{q(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof E=="string"?{__html:pe.string2HTML(E,g)}:void 0,children:typeof E=="function"?E(g):null})}):null]})}function Ne(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:D,backgroundColor:l=!1,leftMargin:z=20,rightMargin:G=20,topMargin:X=10,bottomMargin:I=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y=!0,highlightedDataPoints:v=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,graphDownload:S=!1,dataDownload:d=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:j=0,theme:g="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[le,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(c||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||a.observe(Z.current)),()=>a.disconnect()},[s,c]),r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,s?"w-fit":"w-full",h?.graphContainer),style:{...f?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":q||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${n?` ${n}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?D||"1rem":D||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||n||S||d?r.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:n,width:s,graphDownload:S?ae.current:void 0,dataDownload:d?i.map(a=>a.data).filter(a=>a!==void 0).length>0?i.map(a=>a.data).filter(a=>a!==void 0):i.filter(a=>a!==void 0):null}):null,r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?r.jsxRuntimeExports.jsx(Ce.EmptyState,{}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y!==!1&&i.filter(a=>a.color).length!==0?r.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:m||u.Colors[g].categoricalColors.colors,colorDomain:W||ue.uniqBy(i,"color",!0),setSelectedColor:he,showNAColor:T}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,children:(s||b)&&(c||le)?r.jsxRuntimeExports.jsx(Re,{data:i,width:s||b,height:Math.max(j,c||(C?j?(s||b)*C>j?(s||b)*C:j:(s||b)*C:le)),colorDomain:i.filter(a=>a.color).length===0?[]:W||ue.uniqBy(i,"color",!0),colors:i.filter(a=>a.color).length===0?m?[m]:[u.Colors.primaryColors["blue-600"]]:m||u.Colors[g].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:I,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:v,minValue:N,maxValue:E,onSeriesMouseClick:V,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),o||P?r.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:o,footNote:P,width:s}):null]})})})})}function Se(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,valueColor:H,resetSelectionOnDoubleClick:f,detailsOnClick:h,orientation:O="vertical",styles:k,classNames:A,animate:ie,dimmedOpacity:oe=.3,precision:re,customLayers:b}=L;return O==="vertical"?r.jsxRuntimeExports.jsx(Ne,{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:f,styles:k,valueColor:H,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b}):r.jsxRuntimeExports.jsx(Me,{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:f,styles:k,valueColor:H,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b})}exports.StripChart=Se;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),p=require("react"),xe=require("./index-DQA8q5sC.cjs"),de=require("./Modal-CuuJdWkD.cjs"),ge=require("./index-CQ3e6Ewi.cjs"),fe=require("./Tooltip-Cpv0QohJ.cjs"),J=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ce=require("./numberFormattingFunction-02t-wJta.cjs"),u=require("./Colors.cjs"),pe=require("./string2HTML-z7CwHXcx.cjs"),me=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-CEwlc_dd.cjs"),ne=require("./proxy-CKadx4lC.cjs"),ve=require("./index-Cm8NIdOO.cjs"),je=require("./GraphFooter.cjs"),we=require("./GraphHeader.cjs"),Oe=require("./ColorLegendWithMouseOver.cjs"),Ce=require("./EmptyState-B8IpKGcL.cjs"),ue=require("./uniqBy-O05lp2S5.cjs");function be(L,i){if(L<2)return[];const x=i/(L-1);return Array.from({length:L},(m,o)=>o*x)}function Ee(L){const{data:i,width:x,height:m,colors:o,colorDomain:n,radius:c,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:D,highlightedDataPoints:l,selectedColor:G,minValue:z,maxValue:B,onSeriesMouseClick:I,prefix:K,suffix:C,stripType:Q,highlightColor:y,dotOpacity:v,resetSelectionOnDoubleClick:te,detailsOnClick:N,styles:E,classNames:V,valueColor:S,animate:d,noOfTicks:w,dimmedOpacity:$,precision:X,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:d.once,amount:d.amount}),[T,j]=p.useState(void 0),[g,q]=p.useState(void 0),[_,H]=p.useState(void 0),[f,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},k=x-O.left-O.right,A=m-O.top-O.bottom,ie=i.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(B)?Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):B,b=J.checkIfNullOrUndefined(z)?Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):z,F=me.linear().domain([b,re]).range([0,k]).nice(),le=be(w,k);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ne.motion.svg,{width:`${x}px`,height:`${m}px`,viewBox:`0 0 ${x} ${m}`,direction:"ltr",ref:Y,children:r.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),r.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>r.jsxRuntimeExports.jsxs(ne.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:F(0),y:A/2},whileInView:{x:F(e.position),y:A/2,opacity:G?e.color&&o[n.indexOf(e.color)]===G?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:v,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},onMouseEnter:t=>{j(e),h(t.clientY),H(t.clientX),D?.(e)},onClick:()=>{(I||N)&&(xe.isEqual(g,e)&&te?(q(void 0),I?.(void 0)):(q(e),I?.(e)))},onMouseMove:t=>{j(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{j(void 0),H(void 0),h(void 0),D?.(void 0)},children:[Q==="dot"?r.jsxRuntimeExports.jsx(ne.motion.circle,{cy:0,cx:0,variants:{initial:{fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},r:c}):r.jsxRuntimeExports.jsx(ne.motion.rect,{x:-1,width:2,variants:{initial:{y:0-c,height:c*2,fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{y:0-c,height:c*2,fill:y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?r.jsxRuntimeExports.jsx(ne.motion.text,{x:0,variants:{initial:{opacity:0,y:0-c-5,fill:S||(y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray)},whileInView:{opacity:1,y:0-c-5,fill:S||(y&&l?l.indexOf(e.label)!==-1?y:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray),transition:{duration:d.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:d.duration}},style:{textAnchor:"middle",...E?.graphObjectValues||{}},className:r.mo("graph-value text-sm font-bold",V?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",X,K,C)}):null]},e.label)),le.map((e,t)=>r.jsxRuntimeExports.jsx("text",{x:e,y:A/2+c,style:{textAnchor:t===0?"start":t===le.length-1?"end":"middle",...E?.xAxis?.labels||{}},className:r.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.xAxis?.labels),dy:"1em",children:ce.numberFormattingFunction(F.invert(e),"NA",X,K,C)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&f?r.jsxRuntimeExports.jsx(fe.Tooltip,{data:T,body:U,xPos:_,yPos:f,backgroundStyle:E?.tooltip,className:V?.tooltip}):null,N&&g!==void 0?r.jsxRuntimeExports.jsx(de.G,{open:g!==void 0,onClose:()=>{q(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:pe.string2HTML(N,g)}:void 0,children:typeof N=="function"?N(g):null})}):null]})}function Me(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:D,backgroundColor:l=!1,leftMargin:G=5,rightMargin:z=5,topMargin:B=10,bottomMargin:I=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y=!0,highlightedDataPoints:v=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,graphDownload:S=!1,dataDownload:d=!1,prefix:w="",suffix:$="",stripType:X="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:j=0,theme:g="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[le,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(c||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||a.observe(Z.current)),()=>a.disconnect()},[s,c]),r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,s?"w-fit":"w-full",h?.graphContainer),style:{...f?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":q||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the horizontal axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${n?` ${n}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?D||"1rem":D||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||n||S||d?r.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:n,width:s,graphDownload:S?ae.current:void 0,dataDownload:d?i.map(a=>a.data).filter(a=>a!==void 0).length>0?i.map(a=>a.data).filter(a=>a!==void 0):i.filter(a=>a!==void 0):null}):null,r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?r.jsxRuntimeExports.jsx(Ce.EmptyState,{}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y!==!1&&i.filter(a=>a.color).length!==0?r.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:m||u.Colors[g].categoricalColors.colors,colorDomain:W||ue.uniqBy(i,"color",!0),setSelectedColor:he,showNAColor:T??!0}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,"aria-label":"Graph area",children:(s||b)&&(c||le)?r.jsxRuntimeExports.jsx(Ee,{data:i,width:s||b,height:Math.max(j,c||(C?j?(s||b)*C>j?(s||b)*C:j:(s||b)*C:le)),colorDomain:i.filter(a=>a.color).length===0?[]:W||ue.uniqBy(i,"color",!0),colors:i.filter(a=>a.color).length===0?m?[m]:[u.Colors.primaryColors["blue-600"]]:m||u.Colors[g].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:G,rightMargin:z,topMargin:B,bottomMargin:I,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:v,minValue:N,maxValue:E,onSeriesMouseClick:V,prefix:w,suffix:$,stripType:X,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),o||P?r.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:o,footNote:P,width:s}):null]})})})})}function Re(L){const{data:i,width:x,height:m,colors:o,colorDomain:n,radius:c,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:D,highlightedDataPoints:l,selectedColor:G,minValue:z,maxValue:B,onSeriesMouseClick:I,noOfTicks:K,prefix:C,suffix:Q,stripType:y,highlightColor:v,dotOpacity:te,resetSelectionOnDoubleClick:N,detailsOnClick:E,styles:V,classNames:S,valueColor:d,animate:w,dimmedOpacity:$,precision:X,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:w.once,amount:w.amount}),[T,j]=p.useState(void 0),[g,q]=p.useState(void 0),[_,H]=p.useState(void 0),[f,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},k=x-O.left-O.right,A=m-O.top-O.bottom,ie=i.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(l||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(B)?Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):B,b=J.checkIfNullOrUndefined(z)?Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...i.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):z,F=me.linear().domain([b,re]).range([A,0]).nice(),le=be(K,A);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(ne.motion.svg,{width:`${x}px`,height:`${m}px`,viewBox:`0 0 ${x} ${m}`,direction:"ltr",ref:Y,children:r.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),r.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>r.jsxRuntimeExports.jsxs(ne.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:k/2,y:F(0)},whileInView:{x:k/2,y:F(e.position),opacity:G?e.color&&o[n.indexOf(e.color)]===G?.95:$:l.length!==0?l.indexOf(e.label)!==-1?.95:$:te,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},onMouseEnter:t=>{j(e),h(t.clientY),H(t.clientX),D?.(e)},onClick:()=>{(I||E)&&(xe.isEqual(g,e)&&N?(q(void 0),I?.(void 0)):(q(e),I?.(e)))},onMouseMove:t=>{j(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{j(void 0),H(void 0),h(void 0),D?.(void 0)},children:[y==="dot"?r.jsxRuntimeExports.jsx(ne.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},r:c}):r.jsxRuntimeExports.jsx(ne.motion.rect,{y:-1,height:2,variants:{initial:{x:0-c,width:c*2,fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray},whileInView:{x:0-c,width:c*2,fill:v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}}}),l.length!==0&&l.indexOf(e.label)!==-1?r.jsxRuntimeExports.jsx(ne.motion.text,{y:0,dy:"0.33em",variants:{initial:{opacity:0,x:0+c+3,fill:d||(v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray)},whileInView:{opacity:1,x:0+c+3,fill:d||(v&&l?l.indexOf(e.label)!==-1?v:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray:i.filter(t=>t.color).length===0?o[0]:e.color?o[n.indexOf(e.color)]:u.Colors.gray),transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{textAnchor:"start",...V?.graphObjectValues||{}},className:r.mo("graph-value text-sm font-bold",S?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",X,C,Q)}):null]},e.label)),le.map((e,t)=>r.jsxRuntimeExports.jsx("text",{y:e,x:k/2+c+5,style:{textAnchor:"start",...V?.yAxis?.labels||{}},className:r.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",S?.yAxis?.labels),children:ce.numberFormattingFunction(F.invert(e),"NA",X,C,Q)},t))]}),M.filter(e=>e.position==="after").map(e=>e.layer)]})}),T&&U&&_&&f?r.jsxRuntimeExports.jsx(fe.Tooltip,{data:T,body:U,xPos:_,yPos:f,backgroundStyle:V?.tooltip,className:S?.tooltip}):null,E&&g!==void 0?r.jsxRuntimeExports.jsx(de.G,{open:g!==void 0,onClose:()=>{q(void 0)},children:r.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof E=="string"?{__html:pe.string2HTML(E,g)}:void 0,children:typeof E=="function"?E(g):null})}):null]})}function Ne(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:D,backgroundColor:l=!1,leftMargin:G=20,rightMargin:z=20,topMargin:B=10,bottomMargin:I=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y=!0,highlightedDataPoints:v=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,graphDownload:S=!1,dataDownload:d=!1,prefix:w="",suffix:$="",stripType:X="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:j=0,theme:g="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[le,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const a=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(c||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||a.observe(Z.current)),()=>a.disconnect()},[s,c]),r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:r.mo(`${l?l===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,s?"w-fit":"w-full",h?.graphContainer),style:{...f?.graphContainer||{},...l&&l!==!0?{backgroundColor:l}:{}},id:te,ref:ae,"aria-label":q||`${x?`The graph shows ${x}. `:""}This is a strip chart showing distribution of data along the vertical axis. Each dot represents an individual data point, helping to visualize the spread and clustering of values.${n?` ${n}`:""}`,children:r.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:l?D||"1rem":D||0},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[x||n||S||d?r.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:h?.title,description:h?.description},graphTitle:x,graphDescription:n,width:s,graphDownload:S?ae.current:void 0,dataDownload:d?i.map(a=>a.data).filter(a=>a!==void 0).length>0?i.map(a=>a.data).filter(a=>a!==void 0):i.filter(a=>a!==void 0):null}):null,r.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:i.length===0?r.jsxRuntimeExports.jsx(Ce.EmptyState,{}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[y!==!1&&i.filter(a=>a.color).length!==0?r.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:m||u.Colors[g].categoricalColors.colors,colorDomain:W||ue.uniqBy(i,"color",!0),setSelectedColor:he,showNAColor:T}):null,r.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,children:(s||b)&&(c||le)?r.jsxRuntimeExports.jsx(Re,{data:i,width:s||b,height:Math.max(j,c||(C?j?(s||b)*C>j?(s||b)*C:j:(s||b)*C:le)),colorDomain:i.filter(a=>a.color).length===0?[]:W||ue.uniqBy(i,"color",!0),colors:i.filter(a=>a.color).length===0?m?[m]:[u.Colors.primaryColors["blue-600"]]:m||u.Colors[g].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:G,rightMargin:z,topMargin:B,bottomMargin:I,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:v,minValue:N,maxValue:E,onSeriesMouseClick:V,prefix:w,suffix:$,stripType:X,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:f,classNames:h,valueColor:O,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),o||P?r.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:o,footNote:P,width:s}):null]})})})})}function Se(L){const{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:G,rightMargin:z,topMargin:B,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:X,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,valueColor:H,resetSelectionOnDoubleClick:f,detailsOnClick:h,orientation:O="vertical",styles:k,classNames:A,animate:ie,dimmedOpacity:oe=.3,precision:re,customLayers:b}=L;return O==="vertical"?r.jsxRuntimeExports.jsx(Ne,{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:G,rightMargin:z,topMargin:B,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:X,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:f,styles:k,valueColor:H,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b}):r.jsxRuntimeExports.jsx(Me,{data:i,graphTitle:x,colors:m,sources:o,graphDescription:n,height:c,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:D,backgroundColor:l,leftMargin:G,rightMargin:z,topMargin:B,bottomMargin:I,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:y,highlightedDataPoints:v,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:V,noOfTicks:S,graphDownload:d,dataDownload:w,prefix:$,suffix:X,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:j,minHeight:g,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:f,styles:k,valueColor:H,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b})}exports.StripChart=Se;
|
|
2
2
|
//# sourceMappingURL=StripChart.cjs.map
|
package/dist/StripChart.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as l, m as ni } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as l, m as ni } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as si, useState as E, useEffect as ui } from "react";
|
|
3
3
|
import { i as pi } from "./index-Bwrro8-q.js";
|
|
4
|
-
import {
|
|
4
|
+
import { G as mi } from "./Modal-Cg8daIlV.js";
|
|
5
5
|
import { o as xi } from "./index-DvVprvy6.js";
|
|
6
|
-
import { T as yi } from "./Tooltip-
|
|
6
|
+
import { T as yi } from "./Tooltip-6LIdPQGC.js";
|
|
7
7
|
import { c as J } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
8
|
import { n as gi } from "./numberFormattingFunction-14YCbkN2.js";
|
|
9
9
|
import { Colors as h } from "./Colors.js";
|
|
10
10
|
import { s as vi } from "./string2HTML-oFCROsus.js";
|
|
11
11
|
import { a as wi } from "./linear-DUdu7l2G.js";
|
|
12
|
-
import { u as Oi } from "./use-in-view-
|
|
13
|
-
import { m as ai } from "./proxy-
|
|
14
|
-
import { A as bi } from "./index-
|
|
12
|
+
import { u as Oi } from "./use-in-view-DR-UTB96.js";
|
|
13
|
+
import { m as ai } from "./proxy-BYIC9BuT.js";
|
|
14
|
+
import { A as bi } from "./index-Cwgh7i7X.js";
|
|
15
15
|
import { GraphFooter as Ci } from "./GraphFooter.js";
|
|
16
16
|
import { GraphHeader as ji } from "./GraphHeader.js";
|
|
17
17
|
import { ColorLegendWithMouseOver as Mi } from "./ColorLegendWithMouseOver.js";
|
|
18
|
-
import { E as Di } from "./EmptyState-
|
|
18
|
+
import { E as Di } from "./EmptyState-36lXXyui.js";
|
|
19
19
|
import { u as fi } from "./uniqBy-BHy4I8PK.js";
|
|
20
20
|
function Ni(P, o) {
|
|
21
21
|
if (P < 2) return [];
|
|
@@ -37,8 +37,8 @@ function Vi(P) {
|
|
|
37
37
|
tooltip: F,
|
|
38
38
|
onSeriesMouseOver: S,
|
|
39
39
|
highlightedDataPoints: r,
|
|
40
|
-
selectedColor:
|
|
41
|
-
minValue:
|
|
40
|
+
selectedColor: G,
|
|
41
|
+
minValue: R,
|
|
42
42
|
maxValue: _,
|
|
43
43
|
onSeriesMouseClick: $,
|
|
44
44
|
prefix: K,
|
|
@@ -73,7 +73,7 @@ function Vi(P) {
|
|
|
73
73
|
}
|
|
74
74
|
],
|
|
75
75
|
["desc"]
|
|
76
|
-
), li = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(
|
|
76
|
+
), li = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(R) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : R, z = wi().domain([C, li]).range([0, k]).nice(), ri = Ni(w, k);
|
|
77
77
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
78
78
|
/* @__PURE__ */ l.jsx(
|
|
79
79
|
ai.svg,
|
|
@@ -99,7 +99,7 @@ function Vi(P) {
|
|
|
99
99
|
whileInView: {
|
|
100
100
|
x: z(i.position),
|
|
101
101
|
y: W / 2,
|
|
102
|
-
opacity:
|
|
102
|
+
opacity: G ? i.color && e[a.indexOf(i.color)] === G ? 0.95 : T : r.length !== 0 ? r.indexOf(i.label) !== -1 ? 0.95 : T : y,
|
|
103
103
|
transition: { duration: d.duration }
|
|
104
104
|
}
|
|
105
105
|
},
|
|
@@ -264,8 +264,8 @@ function ki(P) {
|
|
|
264
264
|
radius: F = 5,
|
|
265
265
|
padding: S,
|
|
266
266
|
backgroundColor: r = !1,
|
|
267
|
-
leftMargin:
|
|
268
|
-
rightMargin:
|
|
267
|
+
leftMargin: G = 5,
|
|
268
|
+
rightMargin: R = 5,
|
|
269
269
|
topMargin: _ = 10,
|
|
270
270
|
bottomMargin: $ = 10,
|
|
271
271
|
tooltip: K,
|
|
@@ -380,8 +380,8 @@ function ki(P) {
|
|
|
380
380
|
colors: o.filter((n) => n.color).length === 0 ? m ? [m] : [h.primaryColors["blue-600"]] : m || h[u].categoricalColors.colors,
|
|
381
381
|
selectedColor: t,
|
|
382
382
|
radius: F,
|
|
383
|
-
leftMargin:
|
|
384
|
-
rightMargin:
|
|
383
|
+
leftMargin: G,
|
|
384
|
+
rightMargin: R,
|
|
385
385
|
topMargin: _,
|
|
386
386
|
bottomMargin: $,
|
|
387
387
|
tooltip: K,
|
|
@@ -446,8 +446,8 @@ function Si(P) {
|
|
|
446
446
|
tooltip: F,
|
|
447
447
|
onSeriesMouseOver: S,
|
|
448
448
|
highlightedDataPoints: r,
|
|
449
|
-
selectedColor:
|
|
450
|
-
minValue:
|
|
449
|
+
selectedColor: G,
|
|
450
|
+
minValue: R,
|
|
451
451
|
maxValue: _,
|
|
452
452
|
onSeriesMouseClick: $,
|
|
453
453
|
noOfTicks: K,
|
|
@@ -482,7 +482,7 @@ function Si(P) {
|
|
|
482
482
|
}
|
|
483
483
|
],
|
|
484
484
|
["desc"]
|
|
485
|
-
), li = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(
|
|
485
|
+
), li = J(_) ? Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) < 0 ? 0 : Math.max(...o.filter((i) => !J(i.position)).map((i) => i.position)) : _, C = J(R) ? Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) >= 0 ? 0 : Math.min(...o.filter((i) => !J(i.position)).map((i) => i.position)) : R, z = wi().domain([C, li]).range([W, 0]).nice(), ri = Ni(K, W);
|
|
486
486
|
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
487
487
|
/* @__PURE__ */ l.jsx(
|
|
488
488
|
ai.svg,
|
|
@@ -508,7 +508,7 @@ function Si(P) {
|
|
|
508
508
|
whileInView: {
|
|
509
509
|
x: k / 2,
|
|
510
510
|
y: z(i.position),
|
|
511
|
-
opacity:
|
|
511
|
+
opacity: G ? i.color && e[a.indexOf(i.color)] === G ? 0.95 : T : r.length !== 0 ? r.indexOf(i.label) !== -1 ? 0.95 : T : ti,
|
|
512
512
|
transition: { duration: w.duration }
|
|
513
513
|
}
|
|
514
514
|
},
|
|
@@ -673,8 +673,8 @@ function $i(P) {
|
|
|
673
673
|
radius: F = 5,
|
|
674
674
|
padding: S,
|
|
675
675
|
backgroundColor: r = !1,
|
|
676
|
-
leftMargin:
|
|
677
|
-
rightMargin:
|
|
676
|
+
leftMargin: G = 20,
|
|
677
|
+
rightMargin: R = 20,
|
|
678
678
|
topMargin: _ = 10,
|
|
679
679
|
bottomMargin: $ = 10,
|
|
680
680
|
tooltip: K,
|
|
@@ -788,8 +788,8 @@ function $i(P) {
|
|
|
788
788
|
colors: o.filter((n) => n.color).length === 0 ? m ? [m] : [h.primaryColors["blue-600"]] : m || h[u].categoricalColors.colors,
|
|
789
789
|
selectedColor: t,
|
|
790
790
|
radius: F,
|
|
791
|
-
leftMargin:
|
|
792
|
-
rightMargin:
|
|
791
|
+
leftMargin: G,
|
|
792
|
+
rightMargin: R,
|
|
793
793
|
topMargin: _,
|
|
794
794
|
bottomMargin: $,
|
|
795
795
|
tooltip: K,
|
|
@@ -854,8 +854,8 @@ function Ki(P) {
|
|
|
854
854
|
radius: F,
|
|
855
855
|
padding: S,
|
|
856
856
|
backgroundColor: r,
|
|
857
|
-
leftMargin:
|
|
858
|
-
rightMargin:
|
|
857
|
+
leftMargin: G,
|
|
858
|
+
rightMargin: R,
|
|
859
859
|
topMargin: _,
|
|
860
860
|
bottomMargin: $,
|
|
861
861
|
tooltip: K,
|
|
@@ -907,8 +907,8 @@ function Ki(P) {
|
|
|
907
907
|
radius: F,
|
|
908
908
|
padding: S,
|
|
909
909
|
backgroundColor: r,
|
|
910
|
-
leftMargin:
|
|
911
|
-
rightMargin:
|
|
910
|
+
leftMargin: G,
|
|
911
|
+
rightMargin: R,
|
|
912
912
|
topMargin: _,
|
|
913
913
|
bottomMargin: $,
|
|
914
914
|
tooltip: K,
|
|
@@ -959,8 +959,8 @@ function Ki(P) {
|
|
|
959
959
|
radius: F,
|
|
960
960
|
padding: S,
|
|
961
961
|
backgroundColor: r,
|
|
962
|
-
leftMargin:
|
|
963
|
-
rightMargin:
|
|
962
|
+
leftMargin: G,
|
|
963
|
+
rightMargin: R,
|
|
964
964
|
topMargin: _,
|
|
965
965
|
bottomMargin: $,
|
|
966
966
|
tooltip: K,
|
package/dist/ThreeDGlobe.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-DDoeWRVt.cjs"),l=require("react"),ge=require("./Spinner-DA6Z5E4n.cjs"),xe=require("react-globe.gl"),ye=require("./index-DQA8q5sC.cjs"),fe=require("three"),be=require("./Modal-tXZlLE5s.cjs"),pe=require("./Typography-k-kOjICQ.cjs"),ve=require("./Tooltip-De16GWhY.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),we=require("./index-BW_-wD2k.cjs"),Ce=require("./string2HTML-z7CwHXcx.cjs"),Ee=require("./getCentroidCoordinates-DxTBqzp2.cjs"),Re=require("./ordinal-BOeNbyae.cjs"),Se=require("./threshold-DNsSUf8Q.cjs"),ke=require("./GraphHeader.cjs"),De=require("./GraphFooter.cjs"),Ne=require("./fetchAndParseData-Ba-_CgxS.cjs"),T=require("./Colors.cjs"),Me=require("./getUniqValue-RViz8tTw.cjs"),qe=require("./getJenks-GYmdwBqm.cjs");function Oe(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const p in e)if(p!=="default"){const m=Object.getOwnPropertyDescriptor(e,p);Object.defineProperty(r,p,m.get?m:{enumerable:!0,get:()=>e[p]})}}return r.default=e,Object.freeze(r)}const q=Oe(fe);function Le(e){let r;switch(e.type){case"ambient":r=new q.AmbientLight(e.color,e.intensity);break;case"directional":r=new q.DirectionalLight(e.color,e.intensity),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&r.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z===void 0?-1:e.target.z),e.castShadow&&(r.castShadow=!0,e.shadow&&(r.shadow.mapSize.width=e.shadow.mapSize.width,r.shadow.mapSize.height=e.shadow.mapSize.height,r.shadow.camera.near=e.shadow.camera.near,r.shadow.camera.far=e.shadow.camera.far));break;case"point":r=new q.PointLight(e.color,e.intensity,e.distance||0,e.decay||2),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z));break;case"spot":r=new q.SpotLight(e.color,e.intensity,e.distance||0,e.angle||Math.PI/3,e.penumbra||0,e.decay||2),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&r.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z||0),e.castShadow&&(r.castShadow=!0,e.shadow&&(r.shadow.mapSize.width=e.shadow.mapSize.width,r.shadow.mapSize.height=e.shadow.mapSize.height,r.shadow.camera.near=e.shadow.camera.near,r.shadow.camera.far=e.shadow.camera.far));break;default:throw new Error("Unknown light type")}return r}function Pe(e){const{width:r,autoRotate:p,data:m,enableZoom:z,categorical:O,colorDomain:g,colors:c,globeMaterial:u,height:V,polygonData:H,mapProperty:d,mapBorderColor:A,atmosphereColor:W,tooltip:_,styles:C,classNames:te,mapNoDataColor:y,colorLegendTitle:G,showColorScale:re,hoverStrokeColor:oe,detailsOnClick:j,onSeriesMouseClick:k,onSeriesMouseOver:b,resetSelectionOnDoubleClick:L,highlightedIds:J,scale:f,globeOffset:E,polygonAltitude:F,centerLng:$,centerLat:I,atmosphereAltitude:X,globeCurvatureResolution:se,fogSettings:D,lights:N,highlightedAltitude:Z,selectedId:v}=e,[Y,ae]=l.useState(!1),n=l.useRef(void 0),[R,P]=l.useState(void 0),[ie,K]=l.useState(!(r<680)),[Q,ne]=l.useState({x:0,y:0}),[S,le]=l.useState(void 0),B=O?Re.ordinal().domain(g).range(c):Se.threshold().domain(g).range(c);l.useEffect(()=>{n.current&&(n.current.controls().enableZoom=z)},[z]),l.useEffect(()=>{n.current&&(S||v?n.current.controls().autoRotate=!1:(n.current.controls().autoRotate=p!==0,n.current.controls().autoRotateSpeed=p))},[S,v,p]),l.useEffect(()=>{if(n.current&&v){const t=H.find(x=>x.properties[d]===v),[s,i]=Ee.getCentroidCoordinates(t);n.current.pointOfView({lat:i,lng:s,altitude:f},1e3)}},[v,f,H,d]),l.useEffect(()=>{const t=n.current?.renderer().domElement;if(!t)return;const s=i=>{ne({x:i.clientX,y:i.clientY})};return t.addEventListener("mousemove",s),()=>t.removeEventListener("mousemove",s)},[]),l.useEffect(()=>{n.current&&n.current.pointOfView({lat:I,lng:$,altitude:f},1e3)},[f,$,I]);const U=u||new q.MeshBasicMaterial({color:"#FFF"}),h=l.useCallback(()=>{if(!n.current)return;const t=n.current.scene(),s=n.current.camera();let i=[];t.traverse(a=>{a instanceof q.Light&&i.push(a)}),i=[...i,...s.children],i.forEach(a=>a.parent?.remove(a)),N.map(a=>Le(a)).forEach((a,w)=>{N[w].type!=="ambient"&&N[w].position==="camera"?(s.add(a),N[w].type!=="point"&&s.add(a.target)):t.add(a)}),D&&(t.fog=new q.Fog(D.color,D.near,D.far))},[N,D]),ee=l.useCallback(()=>{ae(!0),h()},[h]);return l.useEffect(()=>{Y&&h()},[Y,h]),o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(xe,{ref:n,height:V,width:r,globeOffset:E,lineHoverPrecision:0,polygonsData:H,polygonAltitude:t=>J.includes(t?.properties?.[d])||t?.properties?.[d]===v?Z*(t?.properties?.[d]===v?2:1):t?.properties?.[d]===S?.id||t?.properties?.[d]===R?.id?Z:F,polygonCapColor:t=>{const s=t?.properties?.[d],i=m.find(x=>x.id===s)?.x;return i!=null?B(i):y},polygonSideColor:t=>{const s=t?.properties?.[d],i=m.find(a=>a.id===s)?.x,x=i!=null?B(i):y;return J.includes(t?.properties?.[d])||t?.properties?.[d]===v?x:"rgba(100,100,100,0)"},polygonStrokeColor:t=>t?.properties?.[d]===S?.id?oe:A,onGlobeClick:()=>{P(void 0)},onPolygonClick:t=>{const s=t?.properties?.[d]?m.find(i=>i.id===t?.properties?.[d]):void 0;(k||j)&&(ye.isEqual(R,s)&&L&&s?(P(void 0),k?.(void 0)):(P(s),k?.(s)))},onPolygonHover:t=>{const s=t?.properties?.[d]?m.find(i=>i.id===t?.properties?.[d]):void 0;le(s),b?.(s)},atmosphereColor:W,atmosphereAltitude:X,globeCurvatureResolution:se,globeMaterial:U,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(n.current){n.current.pointOfView({lat:I,lng:$});const t=n.current.scene();setTimeout(()=>{(t.children[3]?.children[0]?.children[4]?.children||[]).forEach(x=>{const a=x.children[1];a.renderOrder=2})},300);const s=n.current.camera();t.add(s),ee()}}}),re===!1?null:o.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:ie?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.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:o.jsxRuntimeExports.jsx(we.X,{})}),o.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:O?void 0:"340px"},children:[G&&G!==""?o.jsxRuntimeExports.jsx(pe.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:G}):null,O?o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((t,s)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[s%c.length]}}),o.jsxRuntimeExports.jsx(pe.u,{size:"sm",marginBottom:"none",leading:"none",children:t})]},s))}):o.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{children:[g.map((t,s)=>o.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[o.jsxRuntimeExports.jsx("rect",{x:s*320/c.length+1,y:1,width:320/c.length-2,height:8,style:{fill:c[s],stroke:c[s]}}),o.jsxRuntimeExports.jsx("text",{x:(s+1)*320/c.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:je.numberFormattingFunction(t,"NA")})]},s)),o.jsxRuntimeExports.jsx("g",{children:o.jsxRuntimeExports.jsx("rect",{x:g.length*320/c.length+1,y:1,width:320/c.length-2,height:8,style:{fill:c[g.length],stroke:c[g.length]}})})]})})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{K(!0)},children:o.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"})})}),S&&_?o.jsxRuntimeExports.jsx(ve.Tooltip,{data:S,body:_,xPos:Q.x,yPos:Q.y,backgroundStyle:C?.tooltip,className:te?.tooltip}):null,j&&R!==void 0?o.jsxRuntimeExports.jsx(be.X,{open:R!==void 0,onClose:()=>{P(void 0)},children:o.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:Ce.string2HTML(j,R)}:void 0,children:typeof j=="function"?j(R):null})}):null]})}function Te(e){const{data:r,mapData:p="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:m,colors:z,sources:O,graphDescription:g,height:c,width:u,footNote:V="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:H,colorLegendTitle:d,scaleType:A="threshold",padding:W,mapNoDataColor:_=T.Colors.light.graphNoData,backgroundColor:C=!1,mapBorderColor:te=T.Colors.light.grays["gray-500"],relativeHeight:y,tooltip:G,graphID:re,mapProperty:oe="ISO3",dataDownload:j=!1,language:k="en",minHeight:b=0,theme:L="light",ariaLabel:J,styles:f,classNames:E,autoRotate:F=!0,enableZoom:$=!0,globeMaterial:I,centerPoint:X=[0,0],atmosphereColor:se="#999",showColorScale:D=!0,resetSelectionOnDoubleClick:N=!0,detailsOnClick:Z,onSeriesMouseOver:v,onSeriesMouseClick:Y,highlightedIds:ae=[],highlightedAltitude:n=.1,scale:R=1,globeOffset:P=[0,0],polygonAltitude:ie=.01,globeCurvatureResolution:K=4,atmosphereAltitude:Q=.15,fogSettings:ne,lights:S=[{type:"ambient",color:4210752,intensity:.4},{type:"directional",color:16777215,intensity:1,position:{x:5,y:10,z:5}}],selectedId:le}=e,[B,U]=l.useState(void 0),[h,ee]=l.useState(0),[t,s]=l.useState(0),i=l.useRef(null);l.useEffect(()=>{const a=new ResizeObserver(w=>{ee(u||w[0].target.clientWidth||760),s(c||w[0].target.clientHeight||480)});return i.current&&(s(i.current.clientHeight||480),ee(i.current.clientWidth||760),u||a.observe(i.current)),()=>a.disconnect()},[u,c]),l.useEffect(()=>{typeof p=="string"?Ne.fetchAndParseJSON(p).then(w=>{if(p==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const he=w.features.map(M=>{if(M.geometry.type==="Polygon"){const ce=[...M.geometry.coordinates[0]].reverse(),de={...M.geometry,coordinates:[ce]};return{...M,geometry:de}}const ue=[];M.geometry.coordinates.forEach(ce=>{const de=[...ce[0]].reverse();ue.push([de])});const me={...M.geometry,coordinates:ue};return{...M,geometry:me}});U(he)}else U(w.features)}):U(p.features)},[p]);const x=H||(A==="categorical"?Me.getUniqValue(r,"x"):qe.getJenks(r.map(a=>a.x),z?.length||4));return o.jsxRuntimeExports.jsx("div",{className:`${L||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:o.jsxRuntimeExports.jsx("div",{className:o.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"}`,u?"w-fit":"w-full",E?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:re,"aria-label":J||`${m?`The graph shows ${m}. `:""}This is a map.${g?` ${g}`:""}`,children:o.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?W||"1rem":W||0},children:o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||g||j?o.jsxRuntimeExports.jsx(ke.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:E?.title,description:E?.description},graphTitle:m,graphDescription:g,width:u,graphDownload:void 0,dataDownload:j?r.map(a=>a.data).filter(a=>a!==void 0).length>0?r.map(a=>a.data).filter(a=>a!==void 0):r.filter(a=>a!==void 0):null}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:i,"aria-label":"Map area",children:(u||h)&&(c||t)&&B?o.jsxRuntimeExports.jsx(Pe,{data:r,globeOffset:P,polygonData:B,colorDomain:x,width:u||h,height:Math.max(b,c||(y?b?(u||h)*y>b?(u||h)*y:b:(u||h)*y:t)),colors:z||(A==="categorical"?T.Colors[L].sequentialColors[`neutralColorsx0${x.length}`]:T.Colors[L].sequentialColors[`neutralColorsx0${x.length+1}`]),mapNoDataColor:_,categorical:A==="categorical",mapBorderColor:te,tooltip:G,mapProperty:oe,styles:f,classNames:E,autoRotate:F===!0?1.5:F===!1?0:F,enableZoom:$,globeMaterial:I,atmosphereColor:se,colorLegendTitle:d,showColorScale:D,hoverStrokeColor:L==="light"?T.Colors.light.grays["gray-700"]:T.Colors.light.grays["gray-300"],highlightedIds:ae,resetSelectionOnDoubleClick:N,detailsOnClick:Z,onSeriesMouseOver:v,onSeriesMouseClick:Y,scale:R,polygonAltitude:ie,centerLat:X[0],centerLng:X[1],atmosphereAltitude:Q,globeCurvatureResolution:K,fogSettings:ne,lights:S,highlightedAltitude:n,selectedId:le}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(b,c||(y?b?(u||h)*y>b?(u||h)*y:b:(u||h)*y:t))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(ge.y,{"aria-label":"Loading graph"})})}),O||V?o.jsxRuntimeExports.jsx(De.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:O,footNote:V,width:u}):null]})})})})}exports.ThreeDGlobe=Te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-DjM48pIC.cjs"),l=require("react"),xe=require("./Spinner-C6wLp85s.cjs"),ye=require("react-globe.gl"),fe=require("./index-DQA8q5sC.cjs"),be=require("three"),ve=require("./Modal-CuuJdWkD.cjs"),he=require("./Typography-BDULiwlF.cjs"),je=require("./Tooltip-Cpv0QohJ.cjs"),we=require("./numberFormattingFunction-02t-wJta.cjs"),Ce=require("./index-C0bpbS4F.cjs"),Ee=require("./string2HTML-z7CwHXcx.cjs"),Se=require("./getCentroidCoordinates-DxTBqzp2.cjs"),Re=require("./ordinal-BOeNbyae.cjs"),ke=require("./threshold-DNsSUf8Q.cjs"),De=require("./GraphHeader.cjs"),Ne=require("./GraphFooter.cjs"),Me=require("./fetchAndParseData-Ba-_CgxS.cjs"),T=require("./Colors.cjs"),qe=require("./getUniqValue-RViz8tTw.cjs"),Oe=require("./getJenks-GYmdwBqm.cjs");function Le(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const p in e)if(p!=="default"){const m=Object.getOwnPropertyDescriptor(e,p);Object.defineProperty(r,p,m.get?m:{enumerable:!0,get:()=>e[p]})}}return r.default=e,Object.freeze(r)}const q=Le(be);function Pe(e){let r;switch(e.type){case"ambient":r=new q.AmbientLight(e.color,e.intensity);break;case"directional":r=new q.DirectionalLight(e.color,e.intensity),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&r.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z===void 0?-1:e.target.z),e.castShadow&&(r.castShadow=!0,e.shadow&&(r.shadow.mapSize.width=e.shadow.mapSize.width,r.shadow.mapSize.height=e.shadow.mapSize.height,r.shadow.camera.near=e.shadow.camera.near,r.shadow.camera.far=e.shadow.camera.far));break;case"point":r=new q.PointLight(e.color,e.intensity,e.distance||0,e.decay||2),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z));break;case"spot":r=new q.SpotLight(e.color,e.intensity,e.distance||0,e.angle||Math.PI/3,e.penumbra||0,e.decay||2),e.position&&(e.position==="camera"?r.position.set(0,0,0):r.position.set(e.position.x,e.position.y,e.position.z)),(e.target||e.position==="camera")&&r.target.position.set(e.target?.x||0,e.target?.y||0,e.target?.z||0),e.castShadow&&(r.castShadow=!0,e.shadow&&(r.shadow.mapSize.width=e.shadow.mapSize.width,r.shadow.mapSize.height=e.shadow.mapSize.height,r.shadow.camera.near=e.shadow.camera.near,r.shadow.camera.far=e.shadow.camera.far));break;default:throw new Error("Unknown light type")}return r}function Te(e){const{width:r,autoRotate:p,data:m,enableZoom:z,categorical:O,colorDomain:g,colors:c,globeMaterial:u,height:V,polygonData:H,mapProperty:d,mapBorderColor:G,atmosphereColor:W,tooltip:_,styles:C,classNames:re,mapNoDataColor:y,colorLegendTitle:A,showColorScale:oe,hoverStrokeColor:se,detailsOnClick:j,onSeriesMouseClick:k,onSeriesMouseOver:b,resetSelectionOnDoubleClick:L,highlightedIds:J,scale:f,globeOffset:E,polygonAltitude:F,centerLng:$,centerLat:B,atmosphereAltitude:Z,globeCurvatureResolution:ae,fogSettings:D,lights:N,highlightedAltitude:X,selectedId:v,collapseColorScaleByDefault:Y}=e,[K,ie]=l.useState(!1),n=l.useRef(void 0),[S,P]=l.useState(void 0),[ne,Q]=l.useState(Y===void 0?!(r<680):!Y),[ee,le]=l.useState({x:0,y:0}),[R,ce]=l.useState(void 0),I=O?Re.ordinal().domain(g).range(c):ke.threshold().domain(g).range(c);l.useEffect(()=>{n.current&&(n.current.controls().enableZoom=z)},[z]),l.useEffect(()=>{n.current&&(R||v?n.current.controls().autoRotate=!1:(n.current.controls().autoRotate=p!==0,n.current.controls().autoRotateSpeed=p))},[R,v,p]),l.useEffect(()=>{if(n.current&&v){const t=H.find(x=>x.properties[d]===v),[s,i]=Se.getCentroidCoordinates(t);n.current.pointOfView({lat:i,lng:s,altitude:f},1e3)}},[v,f,H,d]),l.useEffect(()=>{const t=n.current?.renderer().domElement;if(!t)return;const s=i=>{le({x:i.clientX,y:i.clientY})};return t.addEventListener("mousemove",s),()=>t.removeEventListener("mousemove",s)},[]),l.useEffect(()=>{n.current&&n.current.pointOfView({lat:B,lng:$,altitude:f},1e3)},[f,$,B]);const U=u||new q.MeshBasicMaterial({color:"#FFF"}),h=l.useCallback(()=>{if(!n.current)return;const t=n.current.scene(),s=n.current.camera();let i=[];t.traverse(a=>{a instanceof q.Light&&i.push(a)}),i=[...i,...s.children],i.forEach(a=>a.parent?.remove(a)),N.map(a=>Pe(a)).forEach((a,w)=>{N[w].type!=="ambient"&&N[w].position==="camera"?(s.add(a),N[w].type!=="point"&&s.add(a.target)):t.add(a)}),D&&(t.fog=new q.Fog(D.color,D.near,D.far))},[N,D]),te=l.useCallback(()=>{ie(!0),h()},[h]);return l.useEffect(()=>{K&&h()},[K,h]),o.jsxRuntimeExports.jsxs("div",{className:"relative",children:[o.jsxRuntimeExports.jsx(ye,{ref:n,height:V,width:r,globeOffset:E,lineHoverPrecision:0,polygonsData:H,polygonAltitude:t=>J.includes(t?.properties?.[d])||t?.properties?.[d]===v?X*(t?.properties?.[d]===v?2:1):t?.properties?.[d]===R?.id||t?.properties?.[d]===S?.id?X:F,polygonCapColor:t=>{const s=t?.properties?.[d],i=m.find(x=>x.id===s)?.x;return i!=null?I(i):y},polygonSideColor:t=>{const s=t?.properties?.[d],i=m.find(a=>a.id===s)?.x,x=i!=null?I(i):y;return J.includes(t?.properties?.[d])||t?.properties?.[d]===v?x:"rgba(100,100,100,0)"},polygonStrokeColor:t=>t?.properties?.[d]===R?.id?se:G,onGlobeClick:()=>{P(void 0)},onPolygonClick:t=>{const s=t?.properties?.[d]?m.find(i=>i.id===t?.properties?.[d]):void 0;(k||j)&&(fe.isEqual(S,s)&&L&&s?(P(void 0),k?.(void 0)):(P(s),k?.(s)))},onPolygonHover:t=>{const s=t?.properties?.[d]?m.find(i=>i.id===t?.properties?.[d]):void 0;ce(s),b?.(s)},atmosphereColor:W,atmosphereAltitude:Z,globeCurvatureResolution:ae,globeMaterial:U,backgroundColor:"rgba(0, 0, 0, 0)",polygonsTransitionDuration:100,onGlobeReady:()=>{if(n.current){n.current.pointOfView({lat:B,lng:$});const t=n.current.scene();setTimeout(()=>{(t.children[3]?.children[0]?.children[4]?.children||[]).forEach(x=>{const a=x.children[1];a.renderOrder=2})},300);const s=n.current.camera();t.add(s),te()}}}),oe===!1?null:o.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:ne?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.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:()=>{Q(!1)},children:o.jsxRuntimeExports.jsx(Ce.X,{})}),o.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:O?void 0:"340px"},children:[A&&A!==""?o.jsxRuntimeExports.jsx(he.u,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:A}):null,O?o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:g.map((t,s)=>o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[s%c.length]}}),o.jsxRuntimeExports.jsx(he.u,{size:"sm",marginBottom:"none",leading:"none",children:t})]},s))}):o.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:o.jsxRuntimeExports.jsxs("g",{children:[g.map((t,s)=>o.jsxRuntimeExports.jsxs("g",{className:"cursor-pointer",children:[o.jsxRuntimeExports.jsx("rect",{x:s*320/c.length+1,y:1,width:320/c.length-2,height:8,style:{fill:c[s],stroke:c[s]}}),o.jsxRuntimeExports.jsx("text",{x:(s+1)*320/c.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:we.numberFormattingFunction(t,"NA")})]},s)),o.jsxRuntimeExports.jsx("g",{children:o.jsxRuntimeExports.jsx("rect",{x:g.length*320/c.length+1,y:1,width:320/c.length-2,height:8,style:{fill:c[g.length],stroke:c[g.length]}})})]})})]})]}):o.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{Q(!0)},children:o.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"})})}),R&&_?o.jsxRuntimeExports.jsx(je.Tooltip,{data:R,body:_,xPos:ee.x,yPos:ee.y,backgroundStyle:C?.tooltip,className:re?.tooltip}):null,j&&S!==void 0?o.jsxRuntimeExports.jsx(ve.G,{open:S!==void 0,onClose:()=>{P(void 0)},children:o.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:Ee.string2HTML(j,S)}:void 0,children:typeof j=="function"?j(S):null})}):null]})}function ze(e){const{data:r,mapData:p="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json",graphTitle:m,colors:z,sources:O,graphDescription:g,height:c,width:u,footNote:V="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:H,colorLegendTitle:d,scaleType:G="threshold",padding:W,mapNoDataColor:_=T.Colors.light.graphNoData,backgroundColor:C=!1,mapBorderColor:re=T.Colors.light.grays["gray-500"],relativeHeight:y,tooltip:A,graphID:oe,mapProperty:se="ISO3",dataDownload:j=!1,language:k="en",minHeight:b=0,theme:L="light",ariaLabel:J,styles:f,classNames:E,autoRotate:F=!0,enableZoom:$=!0,globeMaterial:B,centerPoint:Z=[0,0],atmosphereColor:ae="#999",showColorScale:D=!0,resetSelectionOnDoubleClick:N=!0,detailsOnClick:X,onSeriesMouseOver:v,onSeriesMouseClick:Y,highlightedIds:K=[],highlightedAltitude:ie=.1,scale:n=1,globeOffset:S=[0,0],polygonAltitude:P=.01,globeCurvatureResolution:ne=4,atmosphereAltitude:Q=.15,fogSettings:ee,lights:le=[{type:"ambient",color:4210752,intensity:.4},{type:"directional",color:16777215,intensity:1,position:{x:5,y:10,z:5}}],selectedId:R,collapseColorScaleByDefault:ce}=e,[I,U]=l.useState(void 0),[h,te]=l.useState(0),[t,s]=l.useState(0),i=l.useRef(null);l.useEffect(()=>{const a=new ResizeObserver(w=>{te(u||w[0].target.clientWidth||760),s(c||w[0].target.clientHeight||480)});return i.current&&(s(i.current.clientHeight||480),te(i.current.clientWidth||760),u||a.observe(i.current)),()=>a.disconnect()},[u,c]),l.useEffect(()=>{typeof p=="string"?Me.fetchAndParseJSON(p).then(w=>{if(p==="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-simplified.json"){const me=w.features.map(M=>{if(M.geometry.type==="Polygon"){const de=[...M.geometry.coordinates[0]].reverse(),ue={...M.geometry,coordinates:[de]};return{...M,geometry:ue}}const pe=[];M.geometry.coordinates.forEach(de=>{const ue=[...de[0]].reverse();pe.push([ue])});const ge={...M.geometry,coordinates:pe};return{...M,geometry:ge}});U(me)}else U(w.features)}):U(p.features)},[p]);const x=H||(G==="categorical"?qe.getUniqValue(r,"x"):Oe.getJenks(r.map(a=>a.x),z?.length||4));return o.jsxRuntimeExports.jsx("div",{className:`${L||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:o.jsxRuntimeExports.jsx("div",{className:o.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"}`,u?"w-fit":"w-full",E?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:oe,"aria-label":J||`${m?`The graph shows ${m}. `:""}This is a map.${g?` ${g}`:""}`,children:o.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?W||"1rem":W||0},children:o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[m||g||j?o.jsxRuntimeExports.jsx(De.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:E?.title,description:E?.description},graphTitle:m,graphDescription:g,width:u,graphDownload:void 0,dataDownload:j?r.map(a=>a.data).filter(a=>a!==void 0).length>0?r.map(a=>a.data).filter(a=>a!==void 0):r.filter(a=>a!==void 0):null}):null,o.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:i,"aria-label":"Map area",children:(u||h)&&(c||t)&&I?o.jsxRuntimeExports.jsx(Te,{data:r,globeOffset:S,polygonData:I,colorDomain:x,width:u||h,height:Math.max(b,c||(y?b?(u||h)*y>b?(u||h)*y:b:(u||h)*y:t)),colors:z||(G==="categorical"?T.Colors[L].sequentialColors[`neutralColorsx0${x.length}`]:T.Colors[L].sequentialColors[`neutralColorsx0${x.length+1}`]),mapNoDataColor:_,categorical:G==="categorical",mapBorderColor:re,tooltip:A,mapProperty:se,styles:f,classNames:E,autoRotate:F===!0?1.5:F===!1?0:F,enableZoom:$,globeMaterial:B,atmosphereColor:ae,colorLegendTitle:d,showColorScale:D,hoverStrokeColor:L==="light"?T.Colors.light.grays["gray-700"]:T.Colors.light.grays["gray-300"],highlightedIds:K,resetSelectionOnDoubleClick:N,detailsOnClick:X,onSeriesMouseOver:v,onSeriesMouseClick:Y,scale:n,polygonAltitude:P,centerLat:Z[0],centerLng:Z[1],atmosphereAltitude:Q,globeCurvatureResolution:ne,fogSettings:ee,lights:le,highlightedAltitude:ie,selectedId:R,collapseColorScaleByDefault:ce}):o.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(b,c||(y?b?(u||h)*y>b?(u||h)*y:b:(u||h)*y:t))}px`},className:"flex items-center justify-center",children:o.jsxRuntimeExports.jsx(xe.y,{"aria-label":"Loading graph"})})}),O||V?o.jsxRuntimeExports.jsx(Ne.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:O,footNote:V,width:u}):null]})})})})}exports.ThreeDGlobe=ze;
|
|
2
2
|
//# sourceMappingURL=ThreeDGlobe.cjs.map
|