@undp/data-viz 1.5.7 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +666 -664
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +223 -221
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +84 -82
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +133 -131
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +141 -121
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +307 -307
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +204 -184
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +172 -173
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +89 -78
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +186 -181
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +256 -244
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-CW7iViH2.js} +13 -12
- package/dist/RegressionLine-CW7iViH2.js.map +1 -0
- package/dist/RegressionLine-D-49RaHa.cjs +2 -0
- package/dist/RegressionLine-D-49RaHa.cjs.map +1 -0
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +145 -144
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +53 -48
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +137 -133
- package/dist/SlopeChart.js.map +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +307 -295
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +25 -26
- package/dist/UnitChart.js.map +1 -1
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
package/dist/SlopeChart.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlopeChart.js","sources":["../src/Components/Graphs/SlopeChart/Graph.tsx","../src/Components/Graphs/SlopeChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n SlopeChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\n\r\ninterface Props {\r\n data: SlopeChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n showLabels: boolean;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n axisTitles: [string, string];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n showLabels,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n axisTitles,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minY = Math.min(Math.min(...data.map(d => d.y1)), Math.min(...data.map(d => d.y2)));\r\n const maxY = Math.max(Math.max(...data.map(d => d.y1)), Math.max(...data.map(d => d.y2)));\r\n const y = scaleLinear()\r\n .domain([\r\n checkIfNullOrUndefined(minValue) ? (minY > 0 ? 0 : minY) : (minValue as number),\r\n checkIfNullOrUndefined(maxValue) ? (maxY > 0 ? maxY : 0) : (maxValue as number),\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n className='mx-auto'\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <g>\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={radius}\r\n x2={radius}\r\n classNames={{\r\n axis: cn(\r\n 'stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550',\r\n classNames?.yAxis?.axis,\r\n ),\r\n }}\r\n />\r\n <AxisTitle\r\n x={radius}\r\n y={graphHeight + 15}\r\n style={styles?.yAxis?.title}\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs',\r\n classNames?.yAxis?.title,\r\n )}\r\n text={axisTitles[0]}\r\n />\r\n </g>\r\n <g>\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth - radius}\r\n x2={graphWidth - radius}\r\n classNames={{\r\n axis: cn(\r\n 'stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550',\r\n classNames?.yAxis?.axis,\r\n ),\r\n }}\r\n />\r\n <AxisTitle\r\n x={graphWidth - radius}\r\n y={graphHeight + 15}\r\n style={styles?.yAxis?.title}\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs',\r\n classNames?.yAxis?.title,\r\n )}\r\n text={axisTitles[1]}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {data.map((d, i) => {\r\n return (\r\n <motion.g\r\n key={i}\r\n variants={{\r\n initial: {\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(`${d.color}`)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : mouseOverData\r\n ? mouseOverData.label === d.label\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(`${d.color}`)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : mouseOverData\r\n ? mouseOverData.label === d.label\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.circle\r\n cx={radius}\r\n variants={{\r\n initial: {\r\n cy: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n style={{\r\n fillOpacity: 0.6,\r\n }}\r\n />\r\n {showLabels ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'end',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={5}\r\n dy='0.33em'\r\n textAnchor='end'\r\n dx={0 - radius - 3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'end',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={5}\r\n dy='0.33em'\r\n dx={-3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n <motion.circle\r\n cx={graphWidth - radius}\r\n variants={{\r\n initial: {\r\n cy: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n style={{\r\n fillOpacity: 0.6,\r\n }}\r\n />\r\n {showLabels ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={graphWidth - 5}\r\n dy='0.33em'\r\n dx={radius + 3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={graphWidth - 5}\r\n dy='0.33em'\r\n dx={3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n <motion.line\r\n x1={radius}\r\n x2={graphWidth - radius}\r\n variants={{\r\n initial: {\r\n y1: y(d.y1),\r\n y2: y(d.y1),\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n y1: y(d.y1),\r\n y2: y(d.y2),\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={classNames?.dataConnectors}\r\n style={{\r\n fill: 'none',\r\n strokeWidth: 1,\r\n ...styles?.dataConnectors,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SlopeChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: SlopeChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circles */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Toggles the background to fill the container. This only works if the width of the graph is defined. */\r\n fillContainer?: boolean;\r\n\r\n // Values and Ticks\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Radius of the circles */\r\n radius?: number;\r\n /** Title for the two axis */\r\n axisTitles?: [string, string];\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function SlopeChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n showLabels = false,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n axisTitles = ['', ''],\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 50,\r\n rightMargin = 50,\r\n topMargin = 20,\r\n bottomMargin = 20,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n fillContainer = true,\r\n language = 'en',\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'grow-0' : 'grow'} ${\r\n !fillContainer ? 'w-fit' : 'w-full'\r\n } `}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n !fillContainer ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a slope chart showing changes in data between two category or starting and ending time. Each line represents a different row in data, with lines sloping up or down to show increase or decrease over two categories or time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data.filter(\r\n d => !checkIfNullOrUndefined(d.y1) && !checkIfNullOrUndefined(d.y2),\r\n )}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n axisTitles={axisTitles}\r\n showLabels={showLabels}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","showLabels","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","axisTitles","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","animate","dimmedOpacity","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","minY","d","maxY","scaleLinear","checkIfNullOrUndefined","jsxs","Fragment","jsx","motion","Axis","cn","AxisTitle","AnimatePresence","i","event","isEqual","el","Colors","Tooltip","Modal","string2HTML","SlopeChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","fillContainer","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAA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AAAA,0BACA,cAAAC;AAAA,0BACA,SAAAC;AAAA,0BACA,mBAAAC;AAAA,0BACA,uBAAAE;AAAA,0BACA,UAAAE;AAAA,0BACA,UAAAC;AAAA,0BACA,oBAAAC;AAAA,0BACA,6BAAAC;AAAA,0BACA,gBAAAC;AAAA,0BACA,QAAAC;AAAA,0BACA,YAAAC;AAAA,0BACA,SACEC,MAAY,KACR,EAAE,UAAU,KAAK,MAAM,IAAM,QAAQ,IAAA,IACrCA,KAAW,EAAE,UAAU,GAAG,MAAM,IAAM,QAAQ,EAAA;AAAA,0BAEpD,eAAAC;AAAA,0BACA,cAAAC;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACCwC,KAAWE,IACVlB,gBAAAA,EAAAA;AAAAA,kBAAC+C;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAU3E,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA2C;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAlE;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"SlopeChart.js","sources":["../src/Components/Graphs/SlopeChart/Graph.tsx","../src/Components/Graphs/SlopeChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n SlopeChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\n\r\ninterface Props {\r\n data: SlopeChartDataType[];\r\n width: number;\r\n height: number;\r\n selectedColor?: string;\r\n showLabels: boolean;\r\n colors: string[];\r\n colorDomain: string[];\r\n radius: number;\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n axisTitles: [string, string];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n maxValue?: number;\r\n minValue?: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n showLabels,\r\n colors,\r\n colorDomain,\r\n radius,\r\n leftMargin,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n axisTitles,\r\n highlightedDataPoints,\r\n selectedColor,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minY = Math.min(Math.min(...data.map(d => d.y1)), Math.min(...data.map(d => d.y2)));\r\n const maxY = Math.max(Math.max(...data.map(d => d.y1)), Math.max(...data.map(d => d.y2)));\r\n const y = scaleLinear()\r\n .domain([\r\n checkIfNullOrUndefined(minValue) ? (minY > 0 ? 0 : minY) : (minValue as number),\r\n checkIfNullOrUndefined(maxValue) ? (maxY > 0 ? maxY : 0) : (maxValue as number),\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n className='mx-auto'\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <g>\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={radius}\r\n x2={radius}\r\n classNames={{\r\n axis: cn(\r\n 'stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550',\r\n classNames?.yAxis?.axis,\r\n ),\r\n }}\r\n />\r\n <AxisTitle\r\n x={radius}\r\n y={graphHeight + 15}\r\n style={styles?.yAxis?.title}\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs',\r\n classNames?.yAxis?.title,\r\n )}\r\n text={axisTitles[0]}\r\n />\r\n </g>\r\n <g>\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth - radius}\r\n x2={graphWidth - radius}\r\n classNames={{\r\n axis: cn(\r\n 'stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550',\r\n classNames?.yAxis?.axis,\r\n ),\r\n }}\r\n />\r\n <AxisTitle\r\n x={graphWidth - radius}\r\n y={graphHeight + 15}\r\n style={styles?.yAxis?.title}\r\n className={cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 text-xs',\r\n classNames?.yAxis?.title,\r\n )}\r\n text={axisTitles[1]}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {data.map((d, i) => {\r\n return (\r\n <motion.g\r\n key={i}\r\n variants={{\r\n initial: {\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(`${d.color}`)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : mouseOverData\r\n ? mouseOverData.label === d.label\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(`${d.color}`)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : mouseOverData\r\n ? mouseOverData.label === d.label\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n <motion.circle\r\n variants={{\r\n initial: {\r\n cx: radius,\r\n cy: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cx: radius,\r\n cy: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n style={{\r\n fillOpacity: 0.6,\r\n }}\r\n />\r\n {showLabels ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'end',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={5}\r\n dy='0.33em'\r\n textAnchor='end'\r\n dx={0 - radius - 3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y1),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'end',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={5}\r\n dy='0.33em'\r\n dx={-3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n <motion.circle\r\n variants={{\r\n initial: {\r\n cx: graphWidth - radius,\r\n cy: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cx: graphWidth - radius,\r\n cy: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n r={radius}\r\n style={{\r\n fillOpacity: 0.6,\r\n }}\r\n />\r\n {showLabels ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={graphWidth - 5}\r\n dy='0.33em'\r\n dx={radius + 3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : highlightedDataPoints.length !== 0 ? (\r\n highlightedDataPoints.indexOf(d.label) !== -1 ? (\r\n <motion.text\r\n variants={{\r\n initial: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y(d.y2),\r\n fill:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n textAnchor: 'start',\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n x={graphWidth - 5}\r\n dy='0.33em'\r\n dx={3}\r\n >\r\n {d.label}\r\n </motion.text>\r\n ) : null\r\n ) : null}\r\n <motion.line\r\n variants={{\r\n initial: {\r\n x1: radius,\r\n x2: graphWidth - radius,\r\n y1: y(d.y1),\r\n y2: y(d.y1),\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n },\r\n whileInView: {\r\n x1: radius,\r\n x2: graphWidth - radius,\r\n y1: y(d.y1),\r\n y2: y(d.y2),\r\n stroke:\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(`${d.color}`)],\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n className={classNames?.dataConnectors}\r\n style={{\r\n fill: 'none',\r\n strokeWidth: 1,\r\n ...styles?.dataConnectors,\r\n }}\r\n />\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n Languages,\r\n SlopeChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: SlopeChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circles */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Toggles the background to fill the container. This only works if the width of the graph is defined. */\r\n fillContainer?: boolean;\r\n\r\n // Values and Ticks\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Radius of the circles */\r\n radius?: number;\r\n /** Title for the two axis */\r\n axisTitles?: [string, string];\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function SlopeChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n showLabels = false,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n radius = 5,\r\n axisTitles = ['', ''],\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 50,\r\n rightMargin = 50,\r\n topMargin = 20,\r\n bottomMargin = 20,\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n highlightedDataPoints = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n fillContainer = true,\r\n language = 'en',\r\n showNAColor = true,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'grow-0' : 'grow'} ${\r\n !fillContainer ? 'w-fit' : 'w-full'\r\n } `}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n !fillContainer ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a slope chart showing changes in data between two category or starting and ending time. Each line represents a different row in data, with lines sloping up or down to show increase or decrease over two categories or time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={showNAColor}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data.filter(\r\n d => !checkIfNullOrUndefined(d.y1) && !checkIfNullOrUndefined(d.y2),\r\n )}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n selectedColor={selectedColor}\r\n axisTitles={axisTitles}\r\n showLabels={showLabels}\r\n radius={radius}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n minValue={minValue}\r\n maxValue={maxValue}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n dimmedOpacity={dimmedOpacity}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","showLabels","colors","colorDomain","radius","leftMargin","rightMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","axisTitles","highlightedDataPoints","selectedColor","minValue","maxValue","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","animate","dimmedOpacity","customLayers","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","minY","d","maxY","scaleLinear","checkIfNullOrUndefined","jsxs","Fragment","jsx","motion","Axis","cn","AxisTitle","AnimatePresence","i","event","isEqual","el","Colors","Tooltip","Modal","string2HTML","SlopeChart","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","fillContainer","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDO,SAASA,GAAMC,GAAc;AAClC,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;A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AAC;AAAA,0BACA,gBAAAC;AAAA,0BACA,QAAAC;AAAA,0BACA,YAAAC;AAAA,0BACA,SACEC,MAAY,KACR,EAAE,UAAU,KAAK,MAAM,IAAM,QAAQ,IAAA,IACrCA,KAAW,EAAE,UAAU,GAAG,MAAM,IAAM,QAAQ,EAAA;AAAA,0BAEpD,eAAAC;AAAA,0BACA,cAAAC;AAAA,wBAAA;AAAA,sBAAA,IAEA;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACN,EAAA,CACF,EAAA,CAEJ;AAAA,gBACCwC,KAAWE,IACVlB,gBAAAA,EAAAA;AAAAA,kBAAC+C;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAU3E,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAA2C;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAlE;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
package/dist/Source.cjs
CHANGED
|
@@ -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"),a=require("./Typography-BDULiwlF.cjs");function m(s){const{sources:i,style:o={},className:t}=s;return r.jsxRuntimeExports.jsxs(a.u,{size:"sm",marginBottom:"none","aria-label":"Data sources",className:r.mo("text-primary-gray-550 dark:text-primary-gray-400",t),style:o,children:["Source:"," ",i.map((e,n)=>r.jsxRuntimeExports.jsx("span",{className:r.mo("text-primary-gray-550 dark:text-primary-gray-400",t),style:{fontFamily:"inherit"},children:e.link?r.jsxRuntimeExports.jsx(a.H,{className:r.mo("text-primary-gray-550 dark:text-primary-gray-400",t),href:e.link,target:"_blank",rel:"noreferrer",children:e.source}):e.source},n))]})}exports.Source=m;
|
|
2
2
|
//# sourceMappingURL=Source.cjs.map
|
package/dist/Source.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as e, m as t } from "./index-CHPV5EwG-
|
|
2
|
-
import { u as n, H as l } from "./Typography-
|
|
1
|
+
import { j as e, m as t } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { u as n, H as l } from "./Typography-LmZ9LEpe.js";
|
|
3
3
|
function p(s) {
|
|
4
4
|
const { sources: m, style: i = {}, className: a } = s;
|
|
5
5
|
return /* @__PURE__ */ e.jsxs(
|
package/dist/SparkLine.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),l=require("react"),B=require("./parse-hMnG_lRV.cjs"),K=require("./index-CQ3e6Ewi.cjs"),Q=require("./Tooltip-Cpv0QohJ.cjs"),U=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Z=require("./time-Byw_jYQ7.cjs"),_=require("./linear-BVckp9RD.cjs"),ee=require("./area-D3Qx7k7K.cjs"),z=require("./line-DHV4JwCR.cjs"),T=require("./step-BZ3C8QFW.cjs"),te=require("./select-Bnfk0lJx.cjs"),re=require("./init-DU0ybBc_.cjs"),se=require("./pointer-Dkq5NV1q.cjs"),ie=require("./GraphFooter.cjs"),oe=require("./GraphHeader.cjs"),ae=require("./Colors.cjs"),ne=require("./generateRandomString-B5zBiJzS.cjs");function le(F){const{data:y,width:c,height:E,lineColor:p,dateFormat:u,areaId:x,leftMargin:s,rightMargin:$,topMargin:L,bottomMargin:W,tooltip:w,onSeriesMouseOver:o,minValue:C,maxValue:k,curveType:v,styles:b,classNames:M,customLayers:m}=F,D=v==="linear"?z.curveLinear:v==="step"?T.curveStep:v==="stepAfter"?T.stepAfter:v==="stepBefore"?T.stepBefore:T.monotoneX,[h,O]=l.useState(void 0),[H,q]=l.useState(void 0),[S,j]=l.useState(void 0),a={top:L,bottom:W,left:s,right:$},A=l.useRef(null),r=K.orderBy(y.map(e=>({...e,date:B.parse(`${e.date}`,u,new Date)})),["date"],["asc"]),G=c-a.left-a.right,i=E-a.top-a.bottom,d=r[0].date,V=r[r.length-1].date,g=Math.min(...r.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.min(...r.map(e=>e.y).filter(e=>e!=null))>0?0:Math.min(...r.map(e=>e.y).filter(e=>e!=null)):0,N=Math.max(...r.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.max(...r.map(e=>e.y).filter(e=>e!=null)):0,n=Z.time().domain([d,V]).range([0,G]),R=_.linear().domain([U.checkIfNullOrUndefined(C)?g:C,U.checkIfNullOrUndefined(k)?N>0?N:0:k]).range([i,0]).nice(),f=ee.area().x(e=>n(e.date)).y1(e=>R(e.y)).y0(i).curve(D),I=z.line().x(e=>n(e.date)).y(e=>R(e.y)).curve(D);return l.useEffect(()=>{const e=Y=>{const X=r[re.bisectCenter(r.map(J=>J.date),n.invert(se.pointer(Y)[0]),0)];O(X||r[r.length-1]),o?.(X||r[r.length-1]),j(Y.clientY),q(Y.clientX)},P=()=>{O(void 0),o?.(void 0),q(void 0),j(void 0)};te.select(A.current).on("mousemove",e).on("mouseout",P),o?.(void 0)},[n,r,o]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("svg",{width:`${c}px`,height:`${E}px`,viewBox:`0 0 ${c} ${E}`,direction:"ltr",children:[x?t.jsxRuntimeExports.jsxs("linearGradient",{id:x,x1:"0",x2:"0",y1:"0",y2:"1",children:[t.jsxRuntimeExports.jsx("stop",{style:{stopColor:p},stopOpacity:"0.1",offset:"0%"}),t.jsxRuntimeExports.jsx("stop",{style:{stopColor:p},stopOpacity:"0",offset:"100%"})]}):null,t.jsxRuntimeExports.jsxs("g",{transform:`translate(${a.left},${a.top})`,children:[m.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("text",{className:t.mo("xs:max-[360px]:hidden fill-primary-gray-700 dark:fill-primary-gray-300 text-[9px] md:text-[10px] lg:text-xs",M?.xAxis?.labels),y:i,x:n(r[r.length-1].date),style:{textAnchor:"end",...b?.xAxis?.labels},dy:"1em",children:B.format(r[r.length-1].date,u)}),t.jsxRuntimeExports.jsx("text",{y:i,x:n(r[0].date),style:{textAnchor:"start",...b?.xAxis?.labels},className:t.mo("xs:max-[360px]:hidden fill-primary-gray-700 dark:fill-primary-gray-300 text-[9px] md:text-[10px] lg:text-xs",M?.xAxis?.labels),dy:"1em",children:B.format(r[0].date,u)})]}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("path",{d:f(r)||"",style:{fill:`url(#${x})`,clipPath:"url(#clip)"}}),t.jsxRuntimeExports.jsx("path",{d:I(r)||"",style:{stroke:p,fill:"none",strokeWidth:2}}),h?t.jsxRuntimeExports.jsx("circle",{y1:0,cy:R(h.y),cx:n(h.date),r:5,style:{fill:p}}):null]}),m.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:A,style:{fill:"none",pointerEvents:"all"},width:G,height:i})]})]}),h&&w&&H&&S?t.jsxRuntimeExports.jsx(Q.Tooltip,{data:h,body:w,xPos:H,yPos:S,backgroundStyle:b?.tooltip,className:M?.tooltip}):null]})}function ce(F){const{data:y,graphTitle:c,lineColor:E,sources:p,graphDescription:u,height:x,width:s,footNote:$,dateFormat:L="yyyy",area:W=!1,padding:w,backgroundColor:o,leftMargin:C=5,rightMargin:k=5,topMargin:v=10,bottomMargin:b=20,tooltip:M,relativeHeight:m,onSeriesMouseOver:D,graphID:h,minValue:O,maxValue:H,graphDownload:q=!1,dataDownload:S=!1,language:j="en",minHeight:a=0,theme:A="light",ariaLabel:r,curveType:G="curve",styles:i,classNames:d,customLayers:V=[]}=F,[g,N]=l.useState(0),[n,R]=l.useState(0),f=l.useRef(null),I=l.useRef(null);return l.useEffect(()=>{const e=new ResizeObserver(P=>{N(s||P[0].target.clientWidth||620),R(x||P[0].target.clientHeight||480)});return f.current&&(R(f.current.clientHeight||480),N(f.current.clientWidth||620),s||e.observe(f.current)),()=>e.disconnect()},[s,x]),t.jsxRuntimeExports.jsx("div",{className:`${A||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:j==="he"||j==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${o?o===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${j||"en"}`,s?"w-fit":"w-full",d?.graphContainer),style:{...i?.graphContainer||{},...o&&o!==!0?{backgroundColor:o}:{}},id:h,ref:I,"aria-label":r||`${c?`The graph shows ${c}. `:""}This is a line chart that show trends over time.${u?` ${u}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:o?w||"1rem":w||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[c||u||q||S?t.jsxRuntimeExports.jsx(oe.GraphHeader,{styles:{title:i?.title,description:i?.description},classNames:{title:d?.title,description:d?.description},graphTitle:c,graphDescription:u,width:s,graphDownload:q?I.current:void 0,dataDownload:S?y.map(e=>e.data).filter(e=>e!==void 0).length>0?y.map(e=>e.data).filter(e=>e!==void 0):y.filter(e=>e!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:f,"aria-label":"Graph area",children:(s||g)&&(x||n)?t.jsxRuntimeExports.jsx(le,{data:y,lineColor:E||ae.Colors.primaryColors["blue-600"],width:s||g,height:Math.max(a,x||(m?a?(s||g)*m>a?(s||g)*m:a:(s||g)*m:n)),dateFormat:L,areaId:W?ne.generateRandomString(8):void 0,leftMargin:C,rightMargin:k,topMargin:v,bottomMargin:b,tooltip:M,onSeriesMouseOver:D,minValue:O,maxValue:H,curveType:G,styles:i,classNames:d,customLayers:V}):null}),p||$?t.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:i?.footnote,source:i?.source},classNames:{footnote:d?.footnote,source:d?.source},sources:p,footNote:$,width:s}):null]})})})})}exports.SparkLine=ce;
|
|
2
2
|
//# sourceMappingURL=SparkLine.cjs.map
|
package/dist/SparkLine.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { j as r, m as V } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as r, m as V } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as S, useRef as X, useEffect as J } from "react";
|
|
3
3
|
import { p as Q, f as U } from "./parse-DlCRUFh_.js";
|
|
4
4
|
import { o as Z } from "./index-DvVprvy6.js";
|
|
5
|
-
import { T as _ } from "./Tooltip-
|
|
5
|
+
import { T as _ } from "./Tooltip-6LIdPQGC.js";
|
|
6
6
|
import { c as q } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
7
7
|
import { t as ee } from "./time-BzJP5SPC.js";
|
|
8
8
|
import { a as te } from "./linear-DUdu7l2G.js";
|
|
@@ -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 i=require("./index-CHPV5EwG-DDoeWRVt.cjs"),p=require("react"),de=require("./index-DQA8q5sC.cjs"),xe=require("./Modal-tXZlLE5s.cjs"),ge=require("./index-CQ3e6Ewi.cjs"),pe=require("./Tooltip-De16GWhY.cjs"),J=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ce=require("./numberFormattingFunction-02t-wJta.cjs"),c=require("./Colors.cjs"),fe=require("./string2HTML-z7CwHXcx.cjs"),me=require("./linear-BVckp9RD.cjs"),ye=require("./use-in-view-sQJZ_xDO.cjs"),le=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,o){if(L<2)return[];const d=o/(L-1);return Array.from({length:L},(f,r)=>r*d)}function Ee(L){const{data:o,width:d,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:n,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,prefix:K,suffix:C,stripType:Q,highlightColor:v,dotOpacity:j,resetSelectionOnDoubleClick:te,detailsOnClick:N,styles:E,classNames:I,valueColor:V,animate:m,noOfTicks:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:m.once,amount:m.amount}),[T,y]=p.useState(void 0),[x,q]=p.useState(void 0),[_,H]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=d-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(n||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([0,S]).nice(),ne=be(w,S);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${d}px`,height:`${f}px`,viewBox:`0 0 ${d} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.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&&r[a.indexOf(e.color)]===z?.95:$:n.length!==0?n.indexOf(e.label)!==-1?.95:$:j,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:t=>{y(e),h(t.clientY),H(t.clientX),k?.(e)},onClick:()=>{(D||N)&&(de.isEqual(x,e)&&te?(q(void 0),D?.(void 0)):(q(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{y(void 0),H(void 0),h(void 0),k?.(void 0)},children:[Q==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:v&&n?n.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&n?n.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{y:0-u,x:-1,height:u*2,width:2,variants:{initial:{fill:v&&n?n.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:v&&n?n.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}}}),n.length!==0&&n.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{x:0,y:0-u-5,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},style:{fill:V||(v&&n?n.indexOf(e.label)!==-1?v:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"middle",...E?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",I?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",B,K,C)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{x:e,y:A/2+u,style:{textAnchor:t===0?"start":t===ne.length-1?"end":"middle",...E?.xAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",I?.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&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:E?.tooltip,className:I?.tooltip}):null,N&&x!==void 0?i.jsxRuntimeExports.jsx(xe.X,{open:x!==void 0,onClose:()=>{q(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:fe.string2HTML(N,x)}:void 0,children:typeof N=="function"?N(x):null})}):null]})}function Me(L){const{data:o,graphTitle:d,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:n=!1,leftMargin:z=5,rightMargin:G=5,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:x="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const l=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||l.observe(Z.current)),()=>l.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${x||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${n?n===!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:{...g?.graphContainer||{},...n&&n!==!0?{backgroundColor:n}:{}},id:te,ref:ae,"aria-label":q||`${d?`The graph shows ${d}. `:""}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.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:n?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[d||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:d,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(l=>l.data).filter(l=>l!==void 0).length>0?o.map(l=>l.data).filter(l=>l!==void 0):o.filter(l=>l!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(l=>l.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[x].categoricalColors.colors,colorDomain:W||ue.uniqBy(o,"color",!0),setSelectedColor:he,showNAColor:T??!0}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,"aria-label":"Graph area",children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Ee,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(l=>l.color).length===0?[]:W||ue.uniqBy(o,"color",!0),colors:o.filter(l=>l.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[x].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Re(L){const{data:o,width:d,height:f,colors:r,colorDomain:a,radius:u,leftMargin:s,rightMargin:P,topMargin:W,bottomMargin:ee,tooltip:U,onSeriesMouseOver:k,highlightedDataPoints:n,selectedColor:z,minValue:G,maxValue:X,onSeriesMouseClick:D,noOfTicks:K,prefix:C,suffix:Q,stripType:v,highlightColor:j,dotOpacity:te,resetSelectionOnDoubleClick:N,detailsOnClick:E,styles:I,classNames:V,valueColor:m,animate:w,dimmedOpacity:$,precision:B,customLayers:M}=L,Y=p.useRef(null),R=ye.useInView(Y,{once:w.once,amount:w.amount}),[T,y]=p.useState(void 0),[x,q]=p.useState(void 0),[_,H]=p.useState(void 0),[g,h]=p.useState(void 0),O={top:W,bottom:ee,left:s,right:P},S=d-O.left-O.right,A=f-O.top-O.bottom,ie=o.map((e,t)=>({...e,id:`${t}`})),oe=ge.orderBy(ie,[e=>{const t=(n||[]).indexOf(e.label);return t===-1?1/0:t}],["desc"]),re=J.checkIfNullOrUndefined(X)?Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))<0?0:Math.max(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):X,b=J.checkIfNullOrUndefined(G)?Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position))>=0?0:Math.min(...o.filter(e=>!J.checkIfNullOrUndefined(e.position)).map(e=>e.position)):G,F=me.linear().domain([b,re]).range([A,0]).nice(),ne=be(K,A);return i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[i.jsxRuntimeExports.jsx(le.motion.svg,{width:`${d}px`,height:`${f}px`,viewBox:`0 0 ${d} ${f}`,direction:"ltr",ref:Y,children:i.jsxRuntimeExports.jsxs("g",{transform:`translate(${O.left},${O.top})`,children:[M.filter(e=>e.position==="before").map(e=>e.layer),i.jsxRuntimeExports.jsxs(ve.AnimatePresence,{children:[oe.map(e=>i.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:0,x:S/2,y:F(0)},whileInView:{x:S/2,y:F(e.position),opacity:z?e.color&&r[a.indexOf(e.color)]===z?.95:$:n.length!==0?n.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=>{y(e),h(t.clientY),H(t.clientX),k?.(e)},onClick:()=>{(D||E)&&(de.isEqual(x,e)&&N?(q(void 0),D?.(void 0)):(q(e),D?.(e)))},onMouseMove:t=>{y(e),h(t.clientY),H(t.clientX)},onMouseLeave:()=>{y(void 0),H(void 0),h(void 0),k?.(void 0)},children:[v==="dot"?i.jsxRuntimeExports.jsx(le.motion.circle,{cy:0,cx:0,variants:{initial:{fill:j&&n?n.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&n?n.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},r:u}):i.jsxRuntimeExports.jsx(le.motion.rect,{x:0-u,y:-1,width:u*2,height:2,variants:{initial:{fill:j&&n?n.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray},whileInView:{fill:j&&n?n.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}}}),n.length!==0&&n.indexOf(e.label)!==-1?i.jsxRuntimeExports.jsx(le.motion.text,{y:0,dy:"0.33em",x:0+u+3,variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:R?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},style:{fill:m||(j&&n?n.indexOf(e.label)!==-1?j:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray:o.filter(t=>t.color).length===0?r[0]:e.color?r[a.indexOf(e.color)]:c.Colors.gray),textAnchor:"start",...I?.graphObjectValues||{}},className:i.mo("graph-value text-sm font-bold",V?.graphObjectValues),children:ce.numberFormattingFunction(e.position,"NA",B,C,Q)}):null]},e.label)),ne.map((e,t)=>i.jsxRuntimeExports.jsx("text",{y:e,x:S/2+u+5,style:{textAnchor:"start",...I?.yAxis?.labels||{}},className:i.mo("fill-primary-gray-550 dark:fill-primary-gray-500 text-xs",V?.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&&_&&g?i.jsxRuntimeExports.jsx(pe.Tooltip,{data:T,body:U,xPos:_,yPos:g,backgroundStyle:I?.tooltip,className:V?.tooltip}):null,E&&x!==void 0?i.jsxRuntimeExports.jsx(xe.X,{open:x!==void 0,onClose:()=>{q(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof E=="string"?{__html:fe.string2HTML(E,x)}:void 0,children:typeof E=="function"?E(x):null})}):null]})}function Ne(L){const{data:o,graphTitle:d,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U=5,padding:k,backgroundColor:n=!1,leftMargin:z=20,rightMargin:G=20,topMargin:X=10,bottomMargin:D=10,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v=!0,highlightedDataPoints:j=[],graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,graphDownload:V=!1,dataDownload:m=!1,prefix:w="",suffix:$="",stripType:B="dot",language:M="en",highlightColor:Y,dotOpacity:R=.3,showNAColor:T=!0,minHeight:y=0,theme:x="light",ariaLabel:q,resetSelectionOnDoubleClick:_=!0,detailsOnClick:H,styles:g,classNames:h,valueColor:O,animate:S=!1,noOfTicks:A=2,dimmedOpacity:ie=.3,precision:oe=2,customLayers:re=[]}=L,[b,F]=p.useState(0),[ne,e]=p.useState(0),[t,he]=p.useState(void 0),Z=p.useRef(null),ae=p.useRef(null);return p.useEffect(()=>{const l=new ResizeObserver(se=>{F(s||se[0].target.clientWidth||620),e(u||se[0].target.clientHeight||480)});return Z.current&&(e(Z.current.clientHeight||480),F(Z.current.clientWidth||620),s||l.observe(Z.current)),()=>l.disconnect()},[s,u]),i.jsxRuntimeExports.jsx("div",{className:`${x||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:i.jsxRuntimeExports.jsx("div",{className:i.mo(`${n?n===!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:{...g?.graphContainer||{},...n&&n!==!0?{backgroundColor:n}:{}},id:te,ref:ae,"aria-label":q||`${d?`The graph shows ${d}. `:""}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.${a?` ${a}`:""}`,children:i.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:n?k||"1rem":k||0},children:i.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[d||a||V||m?i.jsxRuntimeExports.jsx(we.GraphHeader,{styles:{title:g?.title,description:g?.description},classNames:{title:h?.title,description:h?.description},graphTitle:d,graphDescription:a,width:s,graphDownload:V?ae.current:void 0,dataDownload:m?o.map(l=>l.data).filter(l=>l!==void 0).length>0?o.map(l=>l.data).filter(l=>l!==void 0):o.filter(l=>l!==void 0):null}):null,i.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?i.jsxRuntimeExports.jsx(Ce.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[v!==!1&&o.filter(l=>l.color).length!==0?i.jsxRuntimeExports.jsx(Oe.ColorLegendWithMouseOver,{width:s,colorLegendTitle:ee,colors:f||c.Colors[x].categoricalColors.colors,colorDomain:W||ue.uniqBy(o,"color",!0),setSelectedColor:he,showNAColor:T}):null,i.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:Z,children:(s||b)&&(u||ne)?i.jsxRuntimeExports.jsx(Re,{data:o,width:s||b,height:Math.max(y,u||(C?y?(s||b)*C>y?(s||b)*C:y:(s||b)*C:ne)),colorDomain:o.filter(l=>l.color).length===0?[]:W||ue.uniqBy(o,"color",!0),colors:o.filter(l=>l.color).length===0?f?[f]:[c.Colors.primaryColors["blue-600"]]:f||c.Colors[x].categoricalColors.colors,selectedColor:t,radius:U,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,onSeriesMouseOver:Q,highlightedDataPoints:j,minValue:N,maxValue:E,onSeriesMouseClick:I,prefix:w,suffix:$,stripType:B,highlightColor:Y,dotOpacity:R,resetSelectionOnDoubleClick:_,detailsOnClick:H,styles:g,classNames:h,valueColor:O,animate:S===!0?{duration:.5,once:!0,amount:.5}:S||{duration:0,once:!0,amount:0},noOfTicks:A,dimmedOpacity:ie,precision:oe,customLayers:re}):null})]})}),r||P?i.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:g?.footnote,source:g?.source},classNames:{footnote:h?.footnote,source:h?.source},sources:r,footNote:P,width:s}):null]})})})})}function Se(L){const{data:o,graphTitle:d,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:n,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:x,theme:q,ariaLabel:_,valueColor:H,resetSelectionOnDoubleClick:g,detailsOnClick:h,orientation:O="vertical",styles:S,classNames:A,animate:ie,dimmedOpacity:oe=.3,precision:re,customLayers:b}=L;return O==="vertical"?i.jsxRuntimeExports.jsx(Ne,{data:o,graphTitle:d,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:n,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:x,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,valueColor:H,detailsOnClick:h,classNames:A,animate:ie,dimmedOpacity:oe,precision:re,customLayers:b}):i.jsxRuntimeExports.jsx(Me,{data:o,graphTitle:d,colors:f,sources:r,graphDescription:a,height:u,width:s,footNote:P,colorDomain:W,colorLegendTitle:ee,radius:U,padding:k,backgroundColor:n,leftMargin:z,rightMargin:G,topMargin:X,bottomMargin:D,tooltip:K,relativeHeight:C,onSeriesMouseOver:Q,showColorScale:v,highlightedDataPoints:j,graphID:te,minValue:N,maxValue:E,onSeriesMouseClick:I,noOfTicks:V,graphDownload:m,dataDownload:w,prefix:$,suffix:B,stripType:M,language:Y,highlightColor:R,dotOpacity:T,showNAColor:y,minHeight:x,theme:q,ariaLabel:_,resetSelectionOnDoubleClick:g,styles:S,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
|