@undp/data-viz 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +16 -16
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +45 -45
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +12 -12
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +9 -9
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +50 -50
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +12 -12
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +12 -12
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +12 -12
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +26 -26
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +7 -7
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
- package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
- package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
- package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +17 -17
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +13 -13
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +26 -26
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +29 -29
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +5 -5
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { j as i } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as i } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as y, useRef as S } from "react";
|
|
3
3
|
import { SingleGraphDashboard as x } from "./SingleGraphDashboard.js";
|
|
4
4
|
import { SingleGraphDashboardThreeDGraphs as j } from "./SingleGraphDashboardThreeDGraphs.js";
|
|
5
5
|
import { SingleGraphDashboardGeoHubMaps as v } from "./SingleGraphDashboardGeoHubMaps.js";
|
|
6
|
-
import { m as D } from "./proxy-
|
|
7
|
-
import { u as b } from "./use-in-view-
|
|
6
|
+
import { m as D } from "./proxy-BYIC9BuT.js";
|
|
7
|
+
import { u as b } from "./use-in-view-DR-UTB96.js";
|
|
8
8
|
function B(n) {
|
|
9
9
|
const {
|
|
10
10
|
chapters: h,
|
package/dist/RadarChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),wt=require("./index-DQA8q5sC.cjs"),bt=require("./Modal-tXZlLE5s.cjs"),Et=require("./Tooltip-De16GWhY.cjs"),M=require("./Colors.cjs"),xt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-z7CwHXcx.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),Rt=require("./use-in-view-sQJZ_xDO.cjs"),G=require("./proxy-BHRoeZgd.cjs"),Ct=require("./index-BW8iNx7E.cjs"),It=require("./GraphFooter.cjs"),Ot=require("./GraphHeader.cjs"),St=require("./EmptyState-d8_8SxeW.cjs"),Nt=require("./ColorLegendWithMouseOver.cjs"),pt=require("./uniqBy-O05lp2S5.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};function gt(t){function i(a){return new ft(t(a))}return i._curve=t,i}function qt(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(a){return arguments.length?i(gt(a)):i()._curve},t}function Tt(){return qt(mt.line().curve(Pt))}function it(){}function ht(t,i,a){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-a),t._x2,t._y2)}function _t(t,i){this._context=t,this._k=(1-i)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};(function t(i){function a(o){return new _t(o,i)}return a.tension=function(o){return t(+o)},a})(0);function yt(t,i){this._context=t,this._k=(1-i)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const Vt=function t(i){function a(o){return new yt(o,i)}return a.tension=function(o){return t(+o)},a}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}};function $t(t){return new vt(t)}function Dt(t){const{data:i,radius:a,lineColors:o,tooltip:R,onSeriesMouseOver:D,onSeriesMouseClick:j,colorDomain:h,detailsOnClick:w,styles:y,classNames:p,selectedColor:P,axisLabels:U,strokeWidth:X,showValues:nt,showDots:st,rightMargin:ot,topMargin:B,bottomMargin:rt,leftMargin:L,curveType:Y,noOfTicks:z,minValue:q,maxValue:T,resetSelectionOnDoubleClick:at,fillShape:c,highlightedLines:g,animate:x,dimmedOpacity:_,precision:C,customLayers:J}=t,K=f.useRef(null),V=Rt.useInView(K,{once:x.once,amount:x.amount}),b=Y==="linear"?$t:Vt,E={top:B,left:L},v=Math.min((2*a-L-ot)/2,(2*a-B-rt)/2),[k,A]=f.useState(void 0),[I,H]=f.useState(void 0),[Q,F]=f.useState(void 0),[Z,W]=f.useState(void 0),l=dt.linear().domain([0,i[0].values.length]).range([0,2*Math.PI]),tt=N.checkIfNullOrUndefined(T)?Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,lt=N.checkIfNullOrUndefined(q)?Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):q,m=dt.linear().domain([lt,tt]).range([0,v]).nice(),ct=m.ticks(z),O=Tt().radius(e=>m(e)).angle((e,s)=>l(s)).curve(b);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(G.motion.svg,{width:`${a*2}px`,height:`${a*2}px`,viewBox:`0 0 ${a*2} ${a*2}`,direction:"ltr",ref:K,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${E.left},${E.top})`,children:[J.filter(e=>e.position==="before").map(e=>e.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[U.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",p?.xAxis?.labels),children:e})]},s)),ct.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:O(Array(U.length).fill(e))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*m(e)>-1e-4?Math.sin(-Math.PI/2)*m(e)-7:Math.sin(-Math.PI/2)*m(e)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",p?.xAxis?.labels),style:y?.xAxis?.labels,children:xt.numberFormattingFunction(e,"NA",C)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:i.map((e,s)=>n.jsxRuntimeExports.jsxs(G.motion.g,{variants:{initial:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:.3:1},whileInView:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:r=>{A(e),W(r.clientY),F(r.clientX),D?.(e)},onMouseMove:r=>{A(e),W(r.clientY),F(r.clientX)},onMouseLeave:()=>{A(void 0),F(void 0),W(void 0),D?.(void 0)},onClick:()=>{(j||w)&&(wt.isEqual(I,e)&&at?(H(void 0),j?.(void 0)):(H(e),j?.(e)))},children:[n.jsxRuntimeExports.jsx(G.motion.path,{d:O(e.values)||"",variants:{initial:{d:O(e.values.map(r=>0))||"",stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:X},whileInView:{d:O(e.values)||"",transition:{duration:x.duration},stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:X}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{fillOpacity:.1}}),n.jsxRuntimeExports.jsx("g",{children:e.values.map((r,d)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(r)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(G.motion.circle,{r:4,variants:{initial:{cx:0,cy:0,opacity:0,fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray},whileInView:{cx:Math.cos(l(d)-Math.PI/2)*m(r),cy:Math.sin(l(d)-Math.PI/2)*m(r),opacity:1,transition:{duration:x.duration},fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(G.motion.text,{style:{...y?.graphObjectValues||{}},dy:Math.sin(l(d)-Math.PI/2)<0?10:(Math.sin(l(d)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",p?.graphObjectValues),variants:{initial:{opacity:0,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start"},whileInView:{opacity:1,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start",transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:xt.numberFormattingFunction(r,"NA",C)}):null]})},d))})]},e.label||s))})]}),J.filter(e=>e.position==="after").map(e=>e.layer)]})}),k&&R&&Q&&Z?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:k,body:R,xPos:Q,yPos:Z,backgroundStyle:y?.tooltip,className:p?.tooltip}):null,w&&I!==void 0?n.jsxRuntimeExports.jsx(bt.X,{open:I!==void 0,onClose:()=>{H(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:kt.string2HTML(w,I)}:void 0,children:typeof w=="function"?w(I):null})}):null]})}function Lt(t){const{graphTitle:i,colors:a,sources:o,graphDescription:R,footNote:D,radius:j,data:h,showColorScale:w=!0,padding:y,backgroundColor:p=!1,tooltip:P,onSeriesMouseOver:U,graphID:X,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:B=75,rightMargin:rt=75,graphDownload:L=!1,dataDownload:Y=!1,colorDomain:z,language:q="en",theme:T="light",highlightedLines:at=[],width:c,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:C,ariaLabel:J,colorLegendTitle:K,detailsOnClick:V,styles:b,classNames:E,showNAColor:v=!0,axisLabels:k,showDots:A=!0,showValues:I=!1,curveType:H="curve",noOfTicks:Q=5,minValue:F,maxValue:Z,fillShape:W=!1,resetSelectionOnDoubleClick:l=!0,animate:tt=!1,dimmedOpacity:lt=.3,precision:m=2,customLayers:ct=[]}=t,[O,e]=f.useState(0),[s,r]=f.useState(0),[d,$]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const u=new ResizeObserver(et=>{r(c||et[0].target.clientWidth||420),$(g||et[0].target.clientHeight||420),e((Math.min(c||et[0].target.clientWidth||620,g||et[0].target.clientHeight||480)||420)/2)});return S.current&&($(S.current.clientHeight||420),r(S.current.clientWidth||420),e((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!c||!j)&&u.observe(S.current)),()=>u.disconnect()},[c,g,j]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:q==="he"||q==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${p?p===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,c?"w-fit":"w-full",E?.graphContainer),style:{...b?.graphContainer||{},minHeight:"inherit",...p&&p!==!0?{backgroundColor:p}:{}},id:X,ref:ut,"aria-label":J||`${i?`The graph shows ${i}. `:""}This is a donut or pie chart chart. ${R?` ${R}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:p?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[i||R||L||Y?n.jsxRuntimeExports.jsx(Ot.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:E?.title,description:E?.description},graphTitle:i,graphDescription:R,width:c,graphDownload:L?ut.current:void 0,dataDownload:Y?h.map(u=>u.data).filter(u=>u!==void 0).length>0?h.map(u=>u.data).filter(u=>u!==void 0):h.filter(u=>u!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:c?`${c}px`:"100%"},children:h.length===0?n.jsxRuntimeExports.jsx(St.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[w&&h.filter(u=>u.color).length!==0?n.jsxRuntimeExports.jsx(Nt.ColorLegendWithMouseOver,{width:c,colorLegendTitle:K,colors:a||M.Colors[T].categoricalColors.colors,colorDomain:z||pt.uniqBy(h,"color",!0),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${c?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:c?`${c}px`:"100%",height:g?`${Math.max(x,g||(C?x?(c||s)*C>x?(c||s)*C:x:(c||s)*C:d))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:j||O?n.jsxRuntimeExports.jsx(Dt,{data:h,lineColors:h.filter(u=>u.color).length===0?a?[a]:[M.Colors.primaryColors["blue-600"]]:a||M.Colors[T].categoricalColors.colors,radius:j||O,tooltip:P,colorDomain:z||pt.uniqBy(h,"color",!0),onSeriesMouseOver:U,onSeriesMouseClick:nt,styles:b,detailsOnClick:V,selectedColor:Mt,axisLabels:k,strokeWidth:_,showValues:I,showDots:A,topMargin:st,bottomMargin:ot,leftMargin:B,rightMargin:rt,curveType:H,noOfTicks:Q,minValue:F,maxValue:Z,fillShape:W,highlightedLines:at,resetSelectionOnDoubleClick:l,animate:tt===!0?{duration:.5,once:!0,amount:.5}:tt||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:m,customLayers:ct}):null})})]})}),o||D?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:o,footNote:D,width:c}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DjM48pIC.cjs"),f=require("react"),wt=require("./index-DQA8q5sC.cjs"),bt=require("./Modal-CuuJdWkD.cjs"),Et=require("./Tooltip-Cpv0QohJ.cjs"),M=require("./Colors.cjs"),xt=require("./numberFormattingFunction-02t-wJta.cjs"),kt=require("./string2HTML-z7CwHXcx.cjs"),N=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./linear-BVckp9RD.cjs"),mt=require("./line-DHV4JwCR.cjs"),Rt=require("./use-in-view-CEwlc_dd.cjs"),G=require("./proxy-CKadx4lC.cjs"),Ct=require("./index-Cm8NIdOO.cjs"),It=require("./GraphFooter.cjs"),Ot=require("./GraphHeader.cjs"),St=require("./EmptyState-B8IpKGcL.cjs"),Nt=require("./ColorLegendWithMouseOver.cjs"),pt=require("./uniqBy-O05lp2S5.cjs");var Pt=gt(mt.curveLinear);function ft(t){this._curve=t}ft.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};function gt(t){function i(a){return new ft(t(a))}return i._curve=t,i}function qt(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(a){return arguments.length?i(gt(a)):i()._curve},t}function Tt(){return qt(mt.line().curve(Pt))}function it(){}function ht(t,i,a){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-a),t._x2,t._y2)}function _t(t,i){this._context=t,this._k=(1-i)/6}_t.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ht(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};(function t(i){function a(o){return new _t(o,i)}return a.tension=function(o){return t(+o)},a})(0);function yt(t,i){this._context=t,this._k=(1-i)/6}yt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:ht(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const Vt=function t(i){function a(o){return new yt(o,i)}return a.tension=function(o){return t(+o)},a}(0);function vt(t){this._context=t}vt.prototype={areaStart:it,areaEnd:it,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}};function $t(t){return new vt(t)}function Dt(t){const{data:i,radius:a,lineColors:o,tooltip:R,onSeriesMouseOver:D,onSeriesMouseClick:j,colorDomain:h,detailsOnClick:w,styles:y,classNames:p,selectedColor:P,axisLabels:U,strokeWidth:B,showValues:nt,showDots:st,rightMargin:ot,topMargin:X,bottomMargin:rt,leftMargin:L,curveType:Y,noOfTicks:z,minValue:q,maxValue:T,resetSelectionOnDoubleClick:at,fillShape:c,highlightedLines:g,animate:x,dimmedOpacity:_,precision:C,customLayers:J}=t,K=f.useRef(null),V=Rt.useInView(K,{once:x.once,amount:x.amount}),b=Y==="linear"?$t:Vt,E={top:X,left:L},v=Math.min((2*a-L-ot)/2,(2*a-X-rt)/2),[k,A]=f.useState(void 0),[I,H]=f.useState(void 0),[Q,F]=f.useState(void 0),[Z,W]=f.useState(void 0),l=dt.linear().domain([0,i[0].values.length]).range([0,2*Math.PI]),tt=N.checkIfNullOrUndefined(T)?Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...i.map(e=>Math.max(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,lt=N.checkIfNullOrUndefined(q)?Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...i.map(e=>Math.min(...e.values.filter(s=>!N.checkIfNullOrUndefined(s))))):q,m=dt.linear().domain([lt,tt]).range([0,v]).nice(),ct=m.ticks(z),O=Tt().radius(e=>m(e)).angle((e,s)=>l(s)).curve(b);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(G.motion.svg,{width:`${a*2}px`,height:`${a*2}px`,viewBox:`0 0 ${a*2} ${a*2}`,direction:"ltr",ref:K,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${E.left},${E.top})`,children:[J.filter(e=>e.position==="before").map(e=>e.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[U.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:n.mo("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:n.mo("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",p?.xAxis?.labels),children:e})]},s)),ct.map((e,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:O(Array(U.length).fill(e))||"",className:n.mo("stroke-primary-gray-500 dark:stroke-primary-gray-550",p?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*m(e)>-1e-4?Math.sin(-Math.PI/2)*m(e)-7:Math.sin(-Math.PI/2)*m(e)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:n.mo("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",p?.xAxis?.labels),style:y?.xAxis?.labels,children:xt.numberFormattingFunction(e,"NA",C)})})})]},s)),n.jsxRuntimeExports.jsx(Ct.AnimatePresence,{children:i.map((e,s)=>n.jsxRuntimeExports.jsxs(G.motion.g,{variants:{initial:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:.3:1},whileInView:{opacity:k?e.label===k.label?1:_:P?e.color&&o[h.indexOf(e.color)]===P?1:_:g.length!==0?e.label&&g.indexOf(e.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:r=>{A(e),W(r.clientY),F(r.clientX),D?.(e)},onMouseMove:r=>{A(e),W(r.clientY),F(r.clientX)},onMouseLeave:()=>{A(void 0),F(void 0),W(void 0),D?.(void 0)},onClick:()=>{(j||w)&&(wt.isEqual(I,e)&&at?(H(void 0),j?.(void 0)):(H(e),j?.(e)))},children:[n.jsxRuntimeExports.jsx(G.motion.path,{d:O(e.values)||"",variants:{initial:{d:O(e.values.map(r=>0))||"",stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:B},whileInView:{d:O(e.values)||"",transition:{duration:x.duration},stroke:i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray,fill:c?i.filter(r=>r.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray:"none",strokeWidth:B}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{fillOpacity:.1}}),n.jsxRuntimeExports.jsx("g",{children:e.values.map((r,d)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(r)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[st?n.jsxRuntimeExports.jsx(G.motion.circle,{r:4,variants:{initial:{cx:0,cy:0,opacity:0,fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray},whileInView:{cx:Math.cos(l(d)-Math.PI/2)*m(r),cy:Math.sin(l(d)-Math.PI/2)*m(r),opacity:1,transition:{duration:x.duration},fill:i.filter($=>$.color).length===0?o[0]:e.color?o[h.indexOf(e.color)]:M.Colors.gray}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,nt?n.jsxRuntimeExports.jsx(G.motion.text,{style:{...y?.graphObjectValues||{}},dy:Math.sin(l(d)-Math.PI/2)<0?10:(Math.sin(l(d)-Math.PI/2)<1e-5,0),className:n.mo("graph-value text-xs font-bold",p?.graphObjectValues),variants:{initial:{opacity:0,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start"},whileInView:{opacity:1,x:Math.cos(l(d)-Math.PI/2)*(m(r)+6),y:Math.sin(l(d)-Math.PI/2)*(m(r)+6),fill:o[s],textAnchor:Math.cos(l(d)-Math.PI/2)<0?"end":Math.cos(l(d)-Math.PI/2)<1e-5?"middle":"start",transition:{duration:x.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:xt.numberFormattingFunction(r,"NA",C)}):null]})},d))})]},e.label||s))})]}),J.filter(e=>e.position==="after").map(e=>e.layer)]})}),k&&R&&Q&&Z?n.jsxRuntimeExports.jsx(Et.Tooltip,{data:k,body:R,xPos:Q,yPos:Z,backgroundStyle:y?.tooltip,className:p?.tooltip}):null,w&&I!==void 0?n.jsxRuntimeExports.jsx(bt.G,{open:I!==void 0,onClose:()=>{H(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof w=="string"?{__html:kt.string2HTML(w,I)}:void 0,children:typeof w=="function"?w(I):null})}):null]})}function Lt(t){const{graphTitle:i,colors:a,sources:o,graphDescription:R,footNote:D,radius:j,data:h,showColorScale:w=!0,padding:y,backgroundColor:p=!1,tooltip:P,onSeriesMouseOver:U,graphID:B,onSeriesMouseClick:nt,topMargin:st=75,bottomMargin:ot=75,leftMargin:X=75,rightMargin:rt=75,graphDownload:L=!1,dataDownload:Y=!1,colorDomain:z,language:q="en",theme:T="light",highlightedLines:at=[],width:c,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:C,ariaLabel:J,colorLegendTitle:K,detailsOnClick:V,styles:b,classNames:E,showNAColor:v=!0,axisLabels:k,showDots:A=!0,showValues:I=!1,curveType:H="curve",noOfTicks:Q=5,minValue:F,maxValue:Z,fillShape:W=!1,resetSelectionOnDoubleClick:l=!0,animate:tt=!1,dimmedOpacity:lt=.3,precision:m=2,customLayers:ct=[]}=t,[O,e]=f.useState(0),[s,r]=f.useState(0),[d,$]=f.useState(0),[Mt,jt]=f.useState(void 0),S=f.useRef(null),ut=f.useRef(null);return f.useEffect(()=>{const u=new ResizeObserver(et=>{r(c||et[0].target.clientWidth||420),$(g||et[0].target.clientHeight||420),e((Math.min(c||et[0].target.clientWidth||620,g||et[0].target.clientHeight||480)||420)/2)});return S.current&&($(S.current.clientHeight||420),r(S.current.clientWidth||420),e((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!c||!j)&&u.observe(S.current)),()=>u.disconnect()},[c,g,j]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:q==="he"||q==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:n.mo(`${p?p===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,c?"w-fit":"w-full",E?.graphContainer),style:{...b?.graphContainer||{},minHeight:"inherit",...p&&p!==!0?{backgroundColor:p}:{}},id:B,ref:ut,"aria-label":J||`${i?`The graph shows ${i}. `:""}This is a donut or pie chart chart. ${R?` ${R}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:p?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[i||R||L||Y?n.jsxRuntimeExports.jsx(Ot.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:E?.title,description:E?.description},graphTitle:i,graphDescription:R,width:c,graphDownload:L?ut.current:void 0,dataDownload:Y?h.map(u=>u.data).filter(u=>u!==void 0).length>0?h.map(u=>u.data).filter(u=>u!==void 0):h.filter(u=>u!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:c?`${c}px`:"100%"},children:h.length===0?n.jsxRuntimeExports.jsx(St.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[w&&h.filter(u=>u.color).length!==0?n.jsxRuntimeExports.jsx(Nt.ColorLegendWithMouseOver,{width:c,colorLegendTitle:K,colors:a||M.Colors[T].categoricalColors.colors,colorDomain:z||pt.uniqBy(h,"color",!0),setSelectedColor:jt,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${c?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:c?`${c}px`:"100%",height:g?`${Math.max(x,g||(C?x?(c||s)*C>x?(c||s)*C:x:(c||s)*C:d))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:j||O?n.jsxRuntimeExports.jsx(Dt,{data:h,lineColors:h.filter(u=>u.color).length===0?a?[a]:[M.Colors.primaryColors["blue-600"]]:a||M.Colors[T].categoricalColors.colors,radius:j||O,tooltip:P,colorDomain:z||pt.uniqBy(h,"color",!0),onSeriesMouseOver:U,onSeriesMouseClick:nt,styles:b,detailsOnClick:V,selectedColor:Mt,axisLabels:k,strokeWidth:_,showValues:I,showDots:A,topMargin:st,bottomMargin:ot,leftMargin:X,rightMargin:rt,curveType:H,noOfTicks:Q,minValue:F,maxValue:Z,fillShape:W,highlightedLines:at,resetSelectionOnDoubleClick:l,animate:tt===!0?{duration:.5,once:!0,amount:.5}:tt||{duration:0,once:!0,amount:0},dimmedOpacity:lt,precision:m,customLayers:ct}):null})})]})}),o||D?n.jsxRuntimeExports.jsx(It.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:o,footNote:D,width:c}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
|
|
2
2
|
//# sourceMappingURL=RadarChart.cjs.map
|
package/dist/RadarChart.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { j as n, m as L } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as n, m as L } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as ut, useState as j, useEffect as kt } from "react";
|
|
3
3
|
import { i as It } from "./index-Bwrro8-q.js";
|
|
4
|
-
import {
|
|
5
|
-
import { T as Ct } from "./Tooltip-
|
|
4
|
+
import { G as jt } from "./Modal-Cg8daIlV.js";
|
|
5
|
+
import { T as Ct } from "./Tooltip-6LIdPQGC.js";
|
|
6
6
|
import { Colors as v } from "./Colors.js";
|
|
7
7
|
import { n as ft } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
8
|
import { s as Pt } from "./string2HTML-oFCROsus.js";
|
|
9
9
|
import { c as T } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
10
10
|
import { a as xt } from "./linear-DUdu7l2G.js";
|
|
11
11
|
import { c as Nt, l as Ot } from "./line-CPfhohvF.js";
|
|
12
|
-
import { u as St } from "./use-in-view-
|
|
13
|
-
import { m as Y } from "./proxy-
|
|
14
|
-
import { A as Tt } from "./index-
|
|
12
|
+
import { u as St } from "./use-in-view-DR-UTB96.js";
|
|
13
|
+
import { m as Y } from "./proxy-BYIC9BuT.js";
|
|
14
|
+
import { A as Tt } from "./index-Cwgh7i7X.js";
|
|
15
15
|
import { GraphFooter as $t } from "./GraphFooter.js";
|
|
16
16
|
import { GraphHeader as Dt } from "./GraphHeader.js";
|
|
17
|
-
import { E as Vt } from "./EmptyState-
|
|
17
|
+
import { E as Vt } from "./EmptyState-36lXXyui.js";
|
|
18
18
|
import { ColorLegendWithMouseOver as At } from "./ColorLegendWithMouseOver.js";
|
|
19
19
|
import { u as pt } from "./uniqBy-BHy4I8PK.js";
|
|
20
20
|
var Et = _t(Nt);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as r, m as x } from "./index-CHPV5EwG-
|
|
2
|
-
import { m } from "./proxy-
|
|
1
|
+
import { j as r, m as x } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { m } from "./proxy-BYIC9BuT.js";
|
|
3
3
|
function u(d) {
|
|
4
4
|
const { text: n, x1: a, x2: e, y: t, classNames: l, styles: s, color: i, animate: o, isInView: y } = d;
|
|
5
5
|
return n ? /* @__PURE__ */ r.jsxs(
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
u as R,
|
|
126
126
|
g as a
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=ReferenceLine-
|
|
128
|
+
//# sourceMappingURL=ReferenceLine-CPMaAX0r.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine-
|
|
1
|
+
{"version":3,"file":"ReferenceLine-CPMaAX0r.js","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":";;AAuBO,SAASA,EAASC,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAC,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAC,GAAY,QAAAC,GAAQ,OAAAC,GAAO,SAAAC,GAAS,UAAAC,EAAA,IAAaT;AAC1E,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAIF;AAAA,YACJ,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAEFS,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAGT;AAAA,YACH,GAAAC;AAAA,YACA,OAAO;AAAA,cACL,GAAIG,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAY;AAAA,cACZ,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA8D,SAAtD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YAEH,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAmDpB;AAqBO,SAASU,EAASd,GAAsB;AAC7C,QAAM,EAAE,MAAAC,GAAM,IAAAc,GAAI,IAAAC,GAAI,GAAAC,GAAG,YAAAZ,GAAY,QAAAC,GAAQ,OAAAC,GAAO,UAAAW,GAAU,SAAAV,GAAS,UAAAC,EAAA,IAAaT;AACpF,SAAKC,IAEHS,gBAAAA,EAAAA;AAAAA,IAACC,EAAO;AAAA,IAAP;AAAA,MAEC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUH,GAAS,YAAY,IAAE;AAAA,MACnE,UAAU;AAAA,QACR,SAAS;AAAA,UACP,SAAS;AAAA,QAAA;AAAA,QAEX,aAAa;AAAA,UACX,SAAS;AAAA,UACT,YAAY,EAAE,UAAUA,GAAS,YAAY,EAAA;AAAA,QAAE;AAAA,MACjD;AAAA,MAEF,SAAQ;AAAA,MACR,SAASC,IAAW,gBAAgB;AAAA,MAEpC,UAAA;AAAA,QAAAG,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWC;AAAAA,cACT;AAAA,cACCN,IAAiE,SAAzD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,OAAO;AAAA,cACL,GAAIE,KAAS,EAAE,QAAQA,EAAA;AAAA,cACvB,GAAID,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,IAAAS;AAAA,YACA,IAAAC;AAAA,YACA,IAAIC;AAAA,YACJ,IAAIA;AAAA,UAAA;AAAA,QAAA;AAAA,QAENL,gBAAAA,EAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,GAAAK;AAAA,YACA,GAAGF;AAAA,YACH,OAAO;AAAA,cACL,GAAIR,KAAS,EAAE,MAAMA,EAAA;AAAA,cACrB,YAAYW,MAAa,SAAS,QAAQ;AAAA,cAC1C,GAAIZ,GAAQ,QAAQ,CAAA;AAAA,YAAC;AAAA,YAEvB,WAAWO;AAAAA,cACT;AAAA,cACCN,IAA6D,SAArD;AAAA,cACTF,GAAY;AAAA,YAAA;AAAA,YAEd,IAAI;AAAA,YACJ,IAAIa,MAAa,SAAS,KAAK;AAAA,YAE9B,UAAAjB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,IA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC;AAAA,EAAA,IAHP;AAoDpB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("./index-CHPV5EwG-
|
|
2
|
-
//# sourceMappingURL=ReferenceLine-
|
|
1
|
+
"use strict";const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),d=require("./proxy-CKadx4lC.cjs");function c(y){const{text:a,x1:n,x2:r,y:e,classNames:s,styles:o,color:i,animate:l,isInView:x}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:l?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:l?.duration||0}}},initial:"initial",animate:x?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:e,y2:e,x1:n,x2:r}),t.jsxRuntimeExports.jsx("text",{x:r,y:e,style:{...i&&{fill:i},textAnchor:"end",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:" fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:-5,children:a})]},`${n}-${r}-${e}`):null}function u(y){const{text:a,y1:n,y2:r,x:e,classNames:s,styles:o,color:i,textSide:l,animate:x,isInView:m}=y;return a?t.jsxRuntimeExports.jsxs(d.motion.g,{exit:{opacity:0,transition:{duration:x?.duration||0}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x?.duration||0}}},initial:"initial",animate:m?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx("line",{className:t.mo("undp-ref-line",i?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",s?.line),style:{...i&&{stroke:i},...o?.line||{}},y1:n,y2:r,x1:e,x2:e}),t.jsxRuntimeExports.jsx("text",{x:e,y:n,style:{...i&&{fill:i},textAnchor:l==="left"?"end":"start",...o?.text||{}},className:t.mo("text-xs font-bold",i?void 0:"fill-primary-gray-700 dark:fill-primary-gray-300",s?.text),dy:12.5,dx:l==="left"?-5:5,children:a})]},`${n}-${r}-${e}`):null}exports.RefLineX=u;exports.RefLineY=c;
|
|
2
|
+
//# sourceMappingURL=ReferenceLine-D04j-zeV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReferenceLine-
|
|
1
|
+
{"version":3,"file":"ReferenceLine-D04j-zeV.cjs","sources":["../src/Components/Elements/ReferenceLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\n\r\ninterface RefLineYProps {\r\n text?: string;\r\n color?: string;\r\n y: number;\r\n x1: number;\r\n x2: number;\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineY(props: RefLineYProps) {\r\n const { text, x1, x2, y, classNames, styles, color, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${x1}-${x2}-${y}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y}\r\n y2={y}\r\n x1={x1}\r\n x2={x2}\r\n />\r\n <text\r\n x={x2}\r\n y={y}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: 'end',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? ' fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={-5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n\r\ninterface RefLineXProps {\r\n text?: string;\r\n color?: string;\r\n x: number;\r\n y1: number;\r\n y2: number;\r\n textSide: 'left' | 'right';\r\n classNames?: {\r\n line?: string;\r\n text?: string;\r\n };\r\n styles?: {\r\n line?: React.CSSProperties;\r\n text?: React.CSSProperties;\r\n };\r\n animate?: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RefLineX(props: RefLineXProps) {\r\n const { text, y1, y2, x, classNames, styles, color, textSide, animate, isInView } = props;\r\n if (!text) return null;\r\n return (\r\n <motion.g\r\n key={`${y1}-${y2}-${x}`}\r\n exit={{ opacity: 0, transition: { duration: animate?.duration || 0 } }}\r\n variants={{\r\n initial: {\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n opacity: 1,\r\n transition: { duration: animate?.duration || 0 },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n <line\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n classNames?.line,\r\n )}\r\n style={{\r\n ...(color && { stroke: color }),\r\n ...(styles?.line || {}),\r\n }}\r\n y1={y1}\r\n y2={y2}\r\n x1={x}\r\n x2={x}\r\n />\r\n <text\r\n x={x}\r\n y={y1}\r\n style={{\r\n ...(color && { fill: color }),\r\n textAnchor: textSide === 'left' ? 'end' : 'start',\r\n ...(styles?.text || {}),\r\n }}\r\n className={cn(\r\n 'text-xs font-bold',\r\n !color ? 'fill-primary-gray-700 dark:fill-primary-gray-300' : undefined,\r\n classNames?.text,\r\n )}\r\n dy={12.5}\r\n dx={textSide === 'left' ? -5 : 5}\r\n >\r\n {text}\r\n </text>\r\n </motion.g>\r\n );\r\n}\r\n"],"names":["RefLineY","props","text","x1","x2","y","classNames","styles","color","animate","isInView","jsxs","motion","jsx","cn","RefLineX","y1","y2","x","textSide"],"mappings":"gGAuBO,SAASA,EAASC,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAC,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,EAAO,QAAAC,EAAS,SAAAC,CAAA,EAAaT,EAC1E,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAIF,EACJ,GAAIA,EACJ,GAAAF,EACA,GAAAC,CAAA,CAAA,EAEFS,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAGT,EACH,EAAAC,EACA,MAAO,CACL,GAAIG,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAY,MACZ,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA8D,OAAtD,oDACTF,GAAY,IAAA,EAEd,GAAI,GAEH,SAAAJ,CAAA,CAAA,CACH,CAAA,EA7CK,GAAGC,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAmDpB,CAqBO,SAASU,EAASd,EAAsB,CAC7C,KAAM,CAAE,KAAAC,EAAM,GAAAc,EAAI,GAAAC,EAAI,EAAAC,EAAG,WAAAZ,EAAY,OAAAC,EAAQ,MAAAC,EAAO,SAAAW,EAAU,QAAAV,EAAS,SAAAC,CAAA,EAAaT,EACpF,OAAKC,EAEHS,EAAAA,kBAAAA,KAACC,EAAAA,OAAO,EAAP,CAEC,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUH,GAAS,UAAY,EAAE,EACnE,SAAU,CACR,QAAS,CACP,QAAS,CAAA,EAEX,YAAa,CACX,QAAS,EACT,WAAY,CAAE,SAAUA,GAAS,UAAY,CAAA,CAAE,CACjD,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,UAEpC,SAAA,CAAAG,EAAAA,kBAAAA,IAAC,OAAA,CACC,UAAWC,EAAAA,GACT,gBACCN,EAAiE,OAAzD,uDACTF,GAAY,IAAA,EAEd,MAAO,CACL,GAAIE,GAAS,CAAE,OAAQA,CAAA,EACvB,GAAID,GAAQ,MAAQ,CAAA,CAAC,EAEvB,GAAAS,EACA,GAAAC,EACA,GAAIC,EACJ,GAAIA,CAAA,CAAA,EAENL,EAAAA,kBAAAA,IAAC,OAAA,CACC,EAAAK,EACA,EAAGF,EACH,MAAO,CACL,GAAIR,GAAS,CAAE,KAAMA,CAAA,EACrB,WAAYW,IAAa,OAAS,MAAQ,QAC1C,GAAIZ,GAAQ,MAAQ,CAAA,CAAC,EAEvB,UAAWO,EAAAA,GACT,oBACCN,EAA6D,OAArD,mDACTF,GAAY,IAAA,EAEd,GAAI,KACJ,GAAIa,IAAa,OAAS,GAAK,EAE9B,SAAAjB,CAAA,CAAA,CACH,CAAA,EA9CK,GAAGc,CAAE,IAAIC,CAAE,IAAIC,CAAC,EAAA,EAHP,IAoDpB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { j as i, m as x } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as i, m as x } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { g } from "./generateRandomString-za3IQGfQ.js";
|
|
3
|
-
import { A as y } from "./index-
|
|
4
|
-
import { m as u } from "./proxy-
|
|
3
|
+
import { A as y } from "./index-Cwgh7i7X.js";
|
|
4
|
+
import { m as u } from "./proxy-BYIC9BuT.js";
|
|
5
5
|
function R(s) {
|
|
6
6
|
const { color: t, x1: r, x2: o, y1: e, y2: l, className: m, style: d, animate: n, isInView: c, graphWidth: h, graphHeight: p } = s, a = g(8);
|
|
7
7
|
return /* @__PURE__ */ i.jsxs("g", { children: [
|
|
@@ -46,4 +46,4 @@ function R(s) {
|
|
|
46
46
|
export {
|
|
47
47
|
R
|
|
48
48
|
};
|
|
49
|
-
//# sourceMappingURL=RegressionLine-
|
|
49
|
+
//# sourceMappingURL=RegressionLine-CW7iViH2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegressionLine-
|
|
1
|
+
{"version":3,"file":"RegressionLine-CW7iViH2.js","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n ...(color && { stroke: color }),\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n ...(color && { stroke: color }),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":";;;;AAoBO,SAASA,EAAeC,GAAc;AAC3C,QAAM,EAAE,OAAAC,GAAO,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,IAAAC,GAAI,WAAAC,GAAW,OAAAC,GAAO,SAAAC,GAAS,UAAAC,GAAU,YAAAC,GAAY,aAAAC,EAAA,IAC9EX,GACIY,IAAKC,EAAqB,CAAC;AACjC,gCACG,KAAA,EACC,UAAA;AAAA,IAAAC,gBAAAA,MAAC,QAAA,EACC,UAAAA,gBAAAA,EAAAA,IAAC,YAAA,EAAS,IAAAF,GACR,gCAAC,QAAA,EAAK,GAAE,KAAI,GAAE,KAAI,OAAOF,GAAY,QAAQC,EAAA,CAAa,GAC5D,GACF;AAAA,0BACCI,GAAA,EACC,UAAAD,gBAAAA,EAAAA;AAAAA,MAACE,EAAO;AAAA,MAAP;AAAA,QACC,UAAU,QAAQJ,CAAE;AAAA,QACpB,WAAWK;AAAAA,UACT;AAAA,UACChB,IAAiE,SAAzD;AAAA,UACTK;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,MAAM;AAAA,UACN,GAAIC,KAAS,CAAA;AAAA,QAAC;AAAA,QAEhB,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,UAAUC,EAAQ,WAAS;AAAA,QAC7D,UAAU;AAAA,UACR,SAAS;AAAA,YACP,IAAAJ;AAAA,YACA,IAAIA;AAAA,YACJ,IAAAF;AAAA,YACA,IAAIA;AAAA,YACJ,GAAID,KAAS,EAAE,QAAQA,EAAA;AAAA,UAAM;AAAA,UAE/B,aAAa;AAAA,YACX,IAAAG;AAAA,YACA,IAAAC;AAAA,YACA,IAAAH;AAAA,YACA,IAAAC;AAAA,YACA,GAAIF,KAAS,EAAE,QAAQA,EAAA;AAAA,YACvB,YAAY,EAAE,UAAUO,EAAQ,SAAA;AAAA,UAAS;AAAA,QAC3C;AAAA,QAEF,SAAQ;AAAA,QACR,SAASC,IAAW,gBAAgB;AAAA,MAAA;AAAA,IAAA,EACtC,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const i=require("./index-CHPV5EwG-
|
|
2
|
-
//# sourceMappingURL=RegressionLine-
|
|
1
|
+
"use strict";const i=require("./index-CHPV5EwG-DjM48pIC.cjs"),h=require("./generateRandomString-B5zBiJzS.cjs"),p=require("./index-Cm8NIdOO.cjs"),g=require("./proxy-CKadx4lC.cjs");function j(o){const{color:e,x1:t,x2:a,y1:n,y2:x,className:l,style:c,animate:r,isInView:d,graphWidth:u,graphHeight:m}=o,s=h.generateRandomString(8);return i.jsxRuntimeExports.jsxs("g",{children:[i.jsxRuntimeExports.jsx("defs",{children:i.jsxRuntimeExports.jsx("clipPath",{id:s,children:i.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:u,height:m})})}),i.jsxRuntimeExports.jsx(p.AnimatePresence,{children:i.jsxRuntimeExports.jsx(g.motion.line,{clipPath:`url(#${s})`,className:i.mo("undp-ref-line",e?void 0:"stroke-primary-gray-700 dark:stroke-primary-gray-300",l),style:{fill:"none",...c||{}},exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{y1:n,y2:n,x1:t,x2:t,...e&&{stroke:e}},whileInView:{y1:n,y2:x,x1:t,x2:a,...e&&{stroke:e},transition:{duration:r.duration}}},initial:"initial",animate:d?"whileInView":"initial"})})]})}exports.RegressionLine=j;
|
|
2
|
+
//# sourceMappingURL=RegressionLine-D-49RaHa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegressionLine-
|
|
1
|
+
{"version":3,"file":"RegressionLine-D-49RaHa.cjs","sources":["../src/Components/Elements/RegressionLine.tsx"],"sourcesContent":["import { cn } from '@undp/design-system-react/cn';\r\nimport { AnimatePresence, motion } from 'motion/react';\r\n\r\nimport { AnimateDataType } from '@/Types';\r\nimport { generateRandomString } from '@/Utils/generateRandomString';\r\n\r\ninterface Props {\r\n color?: string;\r\n y1: number;\r\n y2: number;\r\n x1: number;\r\n x2: number;\r\n graphWidth: number;\r\n graphHeight: number;\r\n className?: string;\r\n style?: React.CSSProperties;\r\n animate: AnimateDataType;\r\n isInView: boolean;\r\n}\r\n\r\nexport function RegressionLine(props: Props) {\r\n const { color, x1, x2, y1, y2, className, style, animate, isInView, graphWidth, graphHeight } =\r\n props;\r\n const id = generateRandomString(8);\r\n return (\r\n <g>\r\n <defs>\r\n <clipPath id={id}>\r\n <rect x='0' y='0' width={graphWidth} height={graphHeight} />\r\n </clipPath>\r\n </defs>\r\n <AnimatePresence>\r\n <motion.line\r\n clipPath={`url(#${id})`}\r\n className={cn(\r\n 'undp-ref-line',\r\n !color ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300' : undefined,\r\n className,\r\n )}\r\n style={{\r\n fill: 'none',\r\n ...(style || {}),\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n y1,\r\n y2: y1,\r\n x1,\r\n x2: x1,\r\n ...(color && { stroke: color }),\r\n },\r\n whileInView: {\r\n y1,\r\n y2,\r\n x1,\r\n x2,\r\n ...(color && { stroke: color }),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n </AnimatePresence>\r\n </g>\r\n );\r\n}\r\n"],"names":["RegressionLine","props","color","x1","x2","y1","y2","className","style","animate","isInView","graphWidth","graphHeight","id","generateRandomString","jsx","AnimatePresence","motion","cn"],"mappings":"mLAoBO,SAASA,EAAeC,EAAc,CAC3C,KAAM,CAAE,MAAAC,EAAO,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,GAAAC,EAAI,UAAAC,EAAW,MAAAC,EAAO,QAAAC,EAAS,SAAAC,EAAU,WAAAC,EAAY,YAAAC,CAAA,EAC9EX,EACIY,EAAKC,EAAAA,qBAAqB,CAAC,EACjC,gCACG,IAAA,CACC,SAAA,CAAAC,wBAAC,OAAA,CACC,SAAAA,EAAAA,kBAAAA,IAAC,WAAA,CAAS,GAAAF,EACR,iCAAC,OAAA,CAAK,EAAE,IAAI,EAAE,IAAI,MAAOF,EAAY,OAAQC,CAAA,CAAa,EAC5D,EACF,0BACCI,EAAAA,gBAAA,CACC,SAAAD,EAAAA,kBAAAA,IAACE,EAAAA,OAAO,KAAP,CACC,SAAU,QAAQJ,CAAE,IACpB,UAAWK,EAAAA,GACT,gBACChB,EAAiE,OAAzD,uDACTK,CAAA,EAEF,MAAO,CACL,KAAM,OACN,GAAIC,GAAS,CAAA,CAAC,EAEhB,KAAM,CAAE,QAAS,EAAG,WAAY,CAAE,SAAUC,EAAQ,SAAS,EAC7D,SAAU,CACR,QAAS,CACP,GAAAJ,EACA,GAAIA,EACJ,GAAAF,EACA,GAAIA,EACJ,GAAID,GAAS,CAAE,OAAQA,CAAA,CAAM,EAE/B,YAAa,CACX,GAAAG,EACA,GAAAC,EACA,GAAAH,EACA,GAAAC,EACA,GAAIF,GAAS,CAAE,OAAQA,CAAA,EACvB,WAAY,CAAE,SAAUO,EAAQ,QAAA,CAAS,CAC3C,EAEF,QAAQ,UACR,QAASC,EAAW,cAAgB,SAAA,CAAA,CACtC,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CHPV5EwG-DjM48pIC.cjs"),o=require("./index-C0bpbS4F.cjs"),l=require("./svgDownload-D9zEGjTF.cjs");function u(a){const{nodeID:e,filename:t="image",buttonContent:s,buttonType:i="tertiary",buttonSmall:r,className:d=""}=a;return n.jsxRuntimeExports.jsx(o.d,{variant:i,className:`undp-viz-download-button ${r?"p-2":"py-4 px-6"} ${d}`,onClick:()=>{typeof e=="string"?document.getElementById(e)?l.svgDownload(document.getElementById(e),t):console.error("Cannot find the html element"):l.svgDownload(e,t)},"aria-label":"Click to download the graph as svg",children:s||n.jsxRuntimeExports.jsx(o.ImageDown,{})})}exports.SVGDownloadButton=u;
|
|
2
2
|
//# sourceMappingURL=SVGDownloadButton.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as o } from "./index-CHPV5EwG-
|
|
2
|
-
import { d as i, I as d } from "./index-
|
|
1
|
+
import { j as o } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { d as i, I as d } from "./index-zZjQEHlm.js";
|
|
3
3
|
import { s as n } from "./svgDownload-C2-E3yf2.js";
|
|
4
4
|
function f(a) {
|
|
5
5
|
const {
|
package/dist/SankeyChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-DDoeWRVt.cjs"),O=require("react"),$t=require("./index-CSNtgibC.cjs"),Et=require("./index-CQ3e6Ewi.cjs"),Vt=require("./index-DQA8q5sC.cjs"),Pt=require("./Modal-tXZlLE5s.cjs"),ut=require("./Typography-k-kOjICQ.cjs"),Lt=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-De16GWhY.cjs"),It=require("./string2HTML-z7CwHXcx.cjs"),Ht=require("./use-in-view-sQJZ_xDO.cjs"),gt=require("./proxy-BHRoeZgd.cjs"),At=require("./index-BW8iNx7E.cjs"),Wt=require("./GraphHeader.cjs"),Gt=require("./GraphFooter.cjs"),Mt=require("./Colors.cjs"),Ft=require("./generateRandomString-B5zBiJzS.cjs"),Xt=require("./EmptyState-d8_8SxeW.cjs"),ot=require("./uniqBy-O05lp2S5.cjs");function Rt(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i<l||i===void 0&&l>=l)&&(i=l)}return i}function qt(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}return i}function dt(e,n){let i=0;if(n===void 0)for(let a of e)(a=+a)&&(i+=a);else{let a=-1;for(let l of e)(l=+n(l,++a,e))&&(i+=l)}return i}function Yt(e){return e.target.depth}function Ut(e,n){return e.sourceLinks.length?e.depth:n-1}function xt(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?qt(e.sourceLinks,Yt)-1:0}function ct(e){return function(){return e}}function St(e,n){return ft(e.source,n.source)||e.index-n.index}function _t(e,n){return ft(e.target,n.target)||e.index-n.index}function ft(e,n){return e.y0-n.y0}function pt(e){return e.value}function Zt(e){return e.index}function Qt(e){return e.nodes}function Jt(e){return e.links}function Nt(e,n){const i=e.get(n);if(!i)throw new Error("missing: "+n);return i}function Ct({nodes:e}){for(const n of e){let i=n.y0,a=i;for(const l of n.sourceLinks)l.y0=i+l.width/2,i+=l.width;for(const l of n.targetLinks)l.y1=a+l.width/2,a+=l.width}}function mt(){let e=0,n=0,i=1,a=1,l=24,m=8,g,x=Zt,y=Ut,v,j,k=Qt,w=Jt,S=6;function d(){const t={nodes:k.apply(null,arguments),links:w.apply(null,arguments)};return _(t),E(t),D(t),X(t),A(t),Ct(t),t}d.update=function(t){return Ct(t),t},d.nodeId=function(t){return arguments.length?(x=typeof t=="function"?t:ct(t),d):x},d.nodeAlign=function(t){return arguments.length?(y=typeof t=="function"?t:ct(t),d):y},d.nodeSort=function(t){return arguments.length?(v=t,d):v},d.nodeWidth=function(t){return arguments.length?(l=+t,d):l},d.nodePadding=function(t){return arguments.length?(m=g=+t,d):m},d.nodes=function(t){return arguments.length?(k=typeof t=="function"?t:ct(t),d):k},d.links=function(t){return arguments.length?(w=typeof t=="function"?t:ct(t),d):w},d.linkSort=function(t){return arguments.length?(j=t,d):j},d.size=function(t){return arguments.length?(e=n=0,i=+t[0],a=+t[1],d):[i-e,a-n]},d.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],a=+t[1][1],d):[[e,n],[i,a]]},d.iterations=function(t){return arguments.length?(S=+t,d):S};function _({nodes:t,links:u}){for(const[c,r]of t.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const s=new Map(t.map((c,r)=>[x(c,r,t),c]));for(const[c,r]of u.entries()){r.index=c;let{source:f,target:p}=r;typeof f!="object"&&(f=r.source=Nt(s,f)),typeof p!="object"&&(p=r.target=Nt(s,p)),f.sourceLinks.push(r),p.targetLinks.push(r)}if(j!=null)for(const{sourceLinks:c,targetLinks:r}of t)c.sort(j),r.sort(j)}function E({nodes:t}){for(const u of t)u.value=u.fixedValue===void 0?Math.max(dt(u.sourceLinks,pt),dt(u.targetLinks,pt)):u.fixedValue}function D({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.depth=r;for(const{target:p}of f.sourceLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function X({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.height=r;for(const{source:p}of f.targetLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function B({nodes:t}){const u=Rt(t,r=>r.depth)+1,s=(i-e-l)/(u-1),c=new Array(u);for(const r of t){const f=Math.max(0,Math.min(u-1,Math.floor(y.call(null,r,u))));r.layer=f,r.x0=e+f*s,r.x1=r.x0+l,c[f]?c[f].push(r):c[f]=[r]}if(v)for(const r of c)r.sort(v);return c}function N(t){const u=qt(t,s=>(a-n-(s.length-1)*g)/dt(s,pt));for(const s of t){let c=n;for(const r of s){r.y0=c,r.y1=c+r.value*u,c=r.y1+g;for(const f of r.sourceLinks)f.width=f.value*u}c=(a-c+g)/(s.length+1);for(let r=0;r<s.length;++r){const f=s[r];f.y0+=c*(r+1),f.y1+=c*(r+1)}P(s)}}function A(t){const u=B(t);g=Math.min(m,(a-n)/(Rt(u,s=>s.length)-1)),N(u);for(let s=0;s<S;++s){const c=Math.pow(.99,s),r=Math.max(1-c,(s+1)/S);et(u,c,r),tt(u,c,r)}}function tt(t,u,s){for(let c=1,r=t.length;c<r;++c){const f=t[c];for(const p of f){let C=0,T=0;for(const{source:I,value:M}of p.targetLinks){let H=M*(p.layer-I.layer);C+=U(I,p)*H,T+=H}if(!(T>0))continue;let W=(C/T-p.y0)*u;p.y0+=W,p.y1+=W,q(p)}v===void 0&&f.sort(ft),V(f,s)}}function et(t,u,s){for(let c=t.length,r=c-2;r>=0;--r){const f=t[r];for(const p of f){let C=0,T=0;for(const{target:I,value:M}of p.sourceLinks){let H=M*(I.layer-p.layer);C+=nt(p,I)*H,T+=H}if(!(T>0))continue;let W=(C/T-p.y0)*u;p.y0+=W,p.y1+=W,q(p)}v===void 0&&f.sort(ft),V(f,s)}}function V(t,u){const s=t.length>>1,c=t[s];Q(t,c.y0-g,s-1,u),Y(t,c.y1+g,s+1,u),Q(t,a,t.length-1,u),Y(t,n,0,u)}function Y(t,u,s,c){for(;s<t.length;++s){const r=t[s],f=(u-r.y0)*c;f>1e-6&&(r.y0+=f,r.y1+=f),u=r.y1+g}}function Q(t,u,s,c){for(;s>=0;--s){const r=t[s],f=(r.y1-u)*c;f>1e-6&&(r.y0-=f,r.y1-=f),u=r.y0-g}}function q({sourceLinks:t,targetLinks:u}){if(j===void 0){for(const{source:{sourceLinks:s}}of u)s.sort(_t);for(const{target:{targetLinks:s}}of t)s.sort(St)}}function P(t){if(j===void 0)for(const{sourceLinks:u,targetLinks:s}of t)u.sort(_t),s.sort(St)}function U(t,u){let s=t.y0-(t.sourceLinks.length-1)*g/2;for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s+=r+g}for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s-=r}return s}function nt(t,u){let s=u.y0-(u.targetLinks.length-1)*g/2;for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s+=r+g}for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s-=r}return s}return d}var yt=Math.PI,jt=2*yt,K=1e-6,Kt=jt-K;function vt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ot(){return new vt}vt.prototype=Ot.prototype={constructor:vt,moveTo:function(e,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,n){this._+="L"+(this._x1=+e)+","+(this._y1=+n)},quadraticCurveTo:function(e,n,i,a){this._+="Q"+ +e+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(e,n,i,a,l,m){this._+="C"+ +e+","+ +n+","+ +i+","+ +a+","+(this._x1=+l)+","+(this._y1=+m)},arcTo:function(e,n,i,a,l){e=+e,n=+n,i=+i,a=+a,l=+l;var m=this._x1,g=this._y1,x=i-e,y=a-n,v=m-e,j=g-n,k=v*v+j*j;if(l<0)throw new Error("negative radius: "+l);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=n);else if(k>K)if(!(Math.abs(j*x-y*v)>K)||!l)this._+="L"+(this._x1=e)+","+(this._y1=n);else{var w=i-m,S=a-g,d=x*x+y*y,_=w*w+S*S,E=Math.sqrt(d),D=Math.sqrt(k),X=l*Math.tan((yt-Math.acos((d+k-_)/(2*E*D)))/2),B=X/D,N=X/E;Math.abs(B-1)>K&&(this._+="L"+(e+B*v)+","+(n+B*j)),this._+="A"+l+","+l+",0,0,"+ +(j*w>v*S)+","+(this._x1=e+N*x)+","+(this._y1=n+N*y)}},arc:function(e,n,i,a,l,m){e=+e,n=+n,i=+i,m=!!m;var g=i*Math.cos(a),x=i*Math.sin(a),y=e+g,v=n+x,j=1^m,k=m?a-l:l-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+y+","+v:(Math.abs(this._x1-y)>K||Math.abs(this._y1-v)>K)&&(this._+="L"+y+","+v),i&&(k<0&&(k=k%jt+jt),k>Kt?this._+="A"+i+","+i+",0,1,"+j+","+(e-g)+","+(n-x)+"A"+i+","+i+",0,1,"+j+","+(this._x1=y)+","+(this._y1=v):k>K&&(this._+="A"+i+","+i+",0,"+ +(k>=yt)+","+j+","+(this._x1=e+i*Math.cos(l))+","+(this._y1=n+i*Math.sin(l))))},rect:function(e,n,i,a){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function Tt(e){return function(){return e}}function te(e){return e[0]}function ee(e){return e[1]}var ne=Array.prototype.slice;function oe(e){return e.source}function ie(e){return e.target}function re(e){var n=oe,i=ie,a=te,l=ee,m=null;function g(){var x,y=ne.call(arguments),v=n.apply(this,y),j=i.apply(this,y);if(m||(m=x=Ot()),e(m,+a.apply(this,(y[0]=v,y)),+l.apply(this,y),+a.apply(this,(y[0]=j,y)),+l.apply(this,y)),x)return m=null,x+""||null}return g.source=function(x){return arguments.length?(n=x,g):n},g.target=function(x){return arguments.length?(i=x,g):i},g.x=function(x){return arguments.length?(a=typeof x=="function"?x:Tt(+x),g):a},g.y=function(x){return arguments.length?(l=typeof x=="function"?x:Tt(+x),g):l},g.context=function(x){return arguments.length?(m=x??null,g):m},g}function se(e,n,i,a,l){e.moveTo(n,i),e.bezierCurveTo(n=(n+a)/2,i,n,l,a,l)}function ae(){return re(se)}function le(e){return[e.source.x1,e.y0]}function ue(e){return[e.target.x0,e.y1]}function ce(){return ae().source(le).target(ue)}function fe(e){const{data:n,showLabels:i,leftMargin:a,rightMargin:l,truncateBy:m,width:g,height:x,topMargin:y,bottomMargin:v,tooltip:j,onSeriesMouseOver:k,suffix:w,prefix:S,showValues:d,onSeriesMouseClick:_,nodePadding:E,nodeWidth:D,id:X,highlightedSourceDataPoints:B,highlightedTargetDataPoints:N,defaultLinkOpacity:A,sourceTitle:tt,targetTitle:et,animate:V,sortNodes:Y,resetSelectionOnDoubleClick:Q,detailsOnClick:q,styles:P,classNames:U,precision:nt,customLayers:t}=e,u=O.useRef(null),s=Ht.useInView(u,{once:V.once,amount:V.amount}),[c,r]=O.useState(void 0),[f,p]=O.useState(void 0),[C,T]=O.useState(void 0),[W,I]=O.useState(void 0),[M,H]=O.useState(void 0),z={top:y,bottom:v,left:a,right:l},G=g-z.left-z.right,F=x-z.top-z.bottom,rt=Y==="mostReadable"?mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt):Y==="none"?mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt).nodeSort(()=>null).linkSort(()=>null):mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt).nodeSort(Y==="desc"?(o,R)=>(R.value||0)-(o.value||0):(o,R)=>(o.value||0)-(R.value||0)),{nodes:st,links:at}=rt(n),J=ce();return h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[h.jsxRuntimeExports.jsxs(gt.motion.svg,{width:`${g}px`,height:`${x}px`,viewBox:`0 0 ${g} ${x}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:u,children:[tt?h.jsxRuntimeExports.jsx("text",{x:z.left,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:tt}):null,et?h.jsxRuntimeExports.jsx("text",{x:g-z.right,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:et}):null,h.jsxRuntimeExports.jsxs("g",{transform:`translate(${z.left},${z.top})`,children:[t.filter(o=>o.position==="before").map(o=>o.layer),st.filter(o=>o.type==="source").map((o,R)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-E/2,x:0-a,width:a,height:(o.y1||0)-(o.y0||0)+E,children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+E}px`,overflow:"visible"},children:[i?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("sankey-right-label text-right",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:"none",size:"sm",leading:"none",className:h.mo("sankey-right-value text-right font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,S,w)}):null]})}):null]})},R)),st.filter(o=>o.type==="target").map((o,R)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-E/2,x:D,width:l-D,height:(o.y1||0)-(o.y0||0)+E,children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+E}px`},children:[i?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("sankey-left-label text-left",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?h.jsxRuntimeExports.jsx(ut.u,{size:"sm",leading:"none",marginBottom:"none",className:h.mo("sankey-left-value text-left font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,S,w)}):null]})}):null]})},R)),h.jsxRuntimeExports.jsx("defs",{children:at.map((o,R)=>h.jsxRuntimeExports.jsxs("linearGradient",{id:`${X}-gradient-${R}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[h.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:o.source.color,stopOpacity:1}}),h.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:o.target.color,stopOpacity:1}})]},R))}),h.jsxRuntimeExports.jsx("g",{children:h.jsxRuntimeExports.jsx(At.AnimatePresence,{children:at.map((o,R)=>h.jsxRuntimeExports.jsx(gt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:Z=>{r(o.data),H(Z.clientY),I(Z.clientX),k?.(o)},onMouseMove:Z=>{r(o.data),H(Z.clientY),I(Z.clientX)},onClick:()=>{(_||q)&&(Vt.isEqual(f,o.data)&&Q?(p(void 0),_?.(void 0)):(p(o.data),_?.(o.data)))},onMouseLeave:()=>{r(void 0),I(void 0),H(void 0),k?.(void 0)},variants:{initial:{opacity:C?o.source.name===C.name||o.target.name===C.name?.85:A:(B.length!==0||N.length!==0)&&(B.indexOf(o.source.label)!==-1||N.indexOf(o.target.label)!==-1)?.85:A},whileInView:{opacity:C?o.source.name===C.name||o.target.name===C.name?.85:A:(B.length!==0||N.length!==0)&&(B.indexOf(o.source.label)!==-1||N.indexOf(o.target.label)!==-1)?.85:A,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},children:h.jsxRuntimeExports.jsx(gt.motion.path,{d:J(o)||"",style:{stroke:`url(#${X}-gradient-${R})`,strokeWidth:o.width,fill:"none"},exit:{opacity:0,transition:{duration:V.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial"},`${o.source}-${o.target}`)},`${o.source}-${o.target}`))})}),t.filter(o=>o.position==="after").map(o=>o.layer)]})]}),c&&j&&W&&M?h.jsxRuntimeExports.jsx(zt.Tooltip,{data:c,body:j,xPos:W,yPos:M,backgroundStyle:P?.tooltip,className:U?.tooltip}):null,q&&f!==void 0?h.jsxRuntimeExports.jsx(Pt.X,{open:f!==void 0,onClose:()=>{p(void 0)},children:h.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof q=="string"?{__html:It.string2HTML(q,f)}:void 0,children:typeof q=="function"?q(f):null})}):null]})}function he(e){const{data:n,graphTitle:i,sources:a,graphDescription:l,showLabels:m=!0,leftMargin:g=75,rightMargin:x=75,topMargin:y=30,bottomMargin:v=10,truncateBy:j=999,height:k,width:w,footNote:S,padding:d,backgroundColor:_,tooltip:E,onSeriesMouseOver:D,suffix:X="",prefix:B="",relativeHeight:N,showValues:A=!0,graphID:tt,onSeriesMouseClick:et,graphDownload:V=!1,dataDownload:Y=!1,fillContainer:Q=!0,language:q="en",minHeight:P=0,theme:U="light",ariaLabel:nt,sourceColors:t,targetColors:u,sourceColorDomain:s,targetColorDomain:c,nodePadding:r=5,nodeWidth:f=5,highlightedSourceDataPoints:p=[],highlightedTargetDataPoints:C=[],defaultLinkOpacity:T=.3,sourceTitle:W,targetTitle:I,sortNodes:M="mostReadable",resetSelectionOnDoubleClick:H=!0,detailsOnClick:z,styles:G,classNames:F,animate:rt=!1,precision:st=2,customLayers:at=[]}=e,[J,o]=O.useState(0),[R,Z]=O.useState(0),[kt,Dt]=O.useState(void 0),it=O.useRef(null),wt=O.useRef(null);return O.useEffect(()=>{const b=ot.uniqBy(n,"source",!0).map(L=>({name:`source_${L}`,type:"source",label:`${L}`,color:typeof t=="string"||!t?t||Mt.Colors.graphMainColor:t[(s||ot.uniqBy(n,"source",!0)).findIndex($=>`${$}`==`${L}`)>t.length?t.length-1:(s||ot.uniqBy(n,"source",!0)).findIndex($=>`${$}`==`${L}`)],totalValue:$t.sum(n.filter($=>`${$.source}`==`${L}`).map($=>$.value))})),lt=M==="asc"||M==="desc"?Et.orderBy(b,["totalValue"],[M]):b,bt=ot.uniqBy(n,"target",!0).map(L=>({name:`target_${L}`,type:"target",label:`${L}`,color:typeof u=="string"||!u?u||Mt.Colors.graphMainColor:u[(c||ot.uniqBy(n,"target",!0)).findIndex($=>`${$}`==`${L}`)>u.length?u.length-1:(c||ot.uniqBy(n,"target",!0)).findIndex($=>`${$}`==`${L}`)],totalValue:$t.sum(n.filter($=>`${$.target}`==`${L}`).map($=>$.value))})),Bt=M==="asc"||M==="desc"?Et.orderBy(bt,["totalValue"],[M]):bt,ht=[...lt,...Bt];Dt({nodes:ht,links:n.map(L=>({source:ht.findIndex($=>$.name===`source_${L.source}`),target:ht.findIndex($=>$.name===`target_${L.target}`),value:L.value,data:{...L}}))})},[n,M,s,t,c,u]),O.useEffect(()=>{const b=new ResizeObserver(lt=>{o(w||lt[0].target.clientWidth||620),Z(k||lt[0].target.clientHeight||480)});return it.current&&(Z(it.current.clientHeight||480),o(it.current.clientWidth||620),w||b.observe(it.current)),()=>b.disconnect()},[w,k]),h.jsxRuntimeExports.jsx("div",{className:`${U||"light"} flex ${w?"grow-0":"grow"} ${Q?"w-full":"w-fit"} `,dir:q==="he"||q==="ar"?"rtl":void 0,children:h.jsxRuntimeExports.jsx("div",{className:h.mo(`${_?_===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,Q?"w-full":"w-fit",F?.graphContainer),style:{...G?.graphContainer||{},..._&&_!==!0?{backgroundColor:_}:{}},id:tt,ref:wt,"aria-label":nt||`${i?`The graph shows ${i}. `:""}This is a sankey chart showing flow. ${l?` ${l}`:""}`,children:h.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:_?d||"1rem":d||0},children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[i||l||V||Y?h.jsxRuntimeExports.jsx(Wt.GraphHeader,{styles:{title:G?.title,description:G?.description},classNames:{title:F?.title,description:F?.description},graphTitle:i,graphDescription:l,width:w,graphDownload:V?wt.current:void 0,dataDownload:Y?n.map(b=>b.data).filter(b=>b!==void 0).length>0?n.map(b=>b.data).filter(b=>b!==void 0):n.filter(b=>b!==void 0):null}):null,h.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?h.jsxRuntimeExports.jsx(Xt.EmptyState,{}):h.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:it,"aria-label":"Graph area",children:(w||J)&&(k||R)&&kt?h.jsxRuntimeExports.jsx(fe,{data:kt,width:w||J,nodePadding:r,nodeWidth:f,height:Math.max(P,k||(N?P?(w||J)*N>P?(w||J)*N:P:(w||J)*N:R)),showLabels:m,leftMargin:g,rightMargin:x,topMargin:y,bottomMargin:v,truncateBy:j,tooltip:E,onSeriesMouseOver:D,showValues:A,suffix:X,prefix:B,onSeriesMouseClick:et,id:Ft.generateRandomString(8),highlightedSourceDataPoints:p.map(b=>`${b}`),highlightedTargetDataPoints:C.map(b=>`${b}`),defaultLinkOpacity:T,sourceTitle:W,targetTitle:I,sortNodes:M,resetSelectionOnDoubleClick:H,styles:G,classNames:F,detailsOnClick:z,animate:rt===!0?{duration:.5,once:!0,amount:.5}:rt||{duration:0,once:!0,amount:0},precision:st,customLayers:at}):null})}),a||S?h.jsxRuntimeExports.jsx(Gt.GraphFooter,{styles:{footnote:G?.footnote,source:G?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:a,footNote:S,width:w}):null]})})})})}exports.SankeyChart=he;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index-CHPV5EwG-DjM48pIC.cjs"),O=require("react"),$t=require("./index-CSNtgibC.cjs"),Et=require("./index-CQ3e6Ewi.cjs"),Vt=require("./index-DQA8q5sC.cjs"),Pt=require("./Modal-CuuJdWkD.cjs"),ut=require("./Typography-BDULiwlF.cjs"),Lt=require("./numberFormattingFunction-02t-wJta.cjs"),zt=require("./Tooltip-Cpv0QohJ.cjs"),It=require("./string2HTML-z7CwHXcx.cjs"),Ht=require("./use-in-view-CEwlc_dd.cjs"),gt=require("./proxy-CKadx4lC.cjs"),At=require("./index-Cm8NIdOO.cjs"),Wt=require("./GraphHeader.cjs"),Gt=require("./GraphFooter.cjs"),Mt=require("./Colors.cjs"),Ft=require("./generateRandomString-B5zBiJzS.cjs"),Xt=require("./EmptyState-B8IpKGcL.cjs"),ot=require("./uniqBy-O05lp2S5.cjs");function Rt(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i<l||i===void 0&&l>=l)&&(i=l)}return i}function qt(e,n){let i;if(n===void 0)for(const a of e)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let l of e)(l=n(l,++a,e))!=null&&(i>l||i===void 0&&l>=l)&&(i=l)}return i}function dt(e,n){let i=0;if(n===void 0)for(let a of e)(a=+a)&&(i+=a);else{let a=-1;for(let l of e)(l=+n(l,++a,e))&&(i+=l)}return i}function Yt(e){return e.target.depth}function Ut(e,n){return e.sourceLinks.length?e.depth:n-1}function xt(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?qt(e.sourceLinks,Yt)-1:0}function ct(e){return function(){return e}}function St(e,n){return ft(e.source,n.source)||e.index-n.index}function _t(e,n){return ft(e.target,n.target)||e.index-n.index}function ft(e,n){return e.y0-n.y0}function pt(e){return e.value}function Zt(e){return e.index}function Qt(e){return e.nodes}function Jt(e){return e.links}function Nt(e,n){const i=e.get(n);if(!i)throw new Error("missing: "+n);return i}function Ct({nodes:e}){for(const n of e){let i=n.y0,a=i;for(const l of n.sourceLinks)l.y0=i+l.width/2,i+=l.width;for(const l of n.targetLinks)l.y1=a+l.width/2,a+=l.width}}function mt(){let e=0,n=0,i=1,a=1,l=24,m=8,g,x=Zt,y=Ut,v,j,k=Qt,w=Jt,S=6;function d(){const t={nodes:k.apply(null,arguments),links:w.apply(null,arguments)};return _(t),E(t),D(t),X(t),A(t),Ct(t),t}d.update=function(t){return Ct(t),t},d.nodeId=function(t){return arguments.length?(x=typeof t=="function"?t:ct(t),d):x},d.nodeAlign=function(t){return arguments.length?(y=typeof t=="function"?t:ct(t),d):y},d.nodeSort=function(t){return arguments.length?(v=t,d):v},d.nodeWidth=function(t){return arguments.length?(l=+t,d):l},d.nodePadding=function(t){return arguments.length?(m=g=+t,d):m},d.nodes=function(t){return arguments.length?(k=typeof t=="function"?t:ct(t),d):k},d.links=function(t){return arguments.length?(w=typeof t=="function"?t:ct(t),d):w},d.linkSort=function(t){return arguments.length?(j=t,d):j},d.size=function(t){return arguments.length?(e=n=0,i=+t[0],a=+t[1],d):[i-e,a-n]},d.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],a=+t[1][1],d):[[e,n],[i,a]]},d.iterations=function(t){return arguments.length?(S=+t,d):S};function _({nodes:t,links:u}){for(const[c,r]of t.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const s=new Map(t.map((c,r)=>[x(c,r,t),c]));for(const[c,r]of u.entries()){r.index=c;let{source:f,target:p}=r;typeof f!="object"&&(f=r.source=Nt(s,f)),typeof p!="object"&&(p=r.target=Nt(s,p)),f.sourceLinks.push(r),p.targetLinks.push(r)}if(j!=null)for(const{sourceLinks:c,targetLinks:r}of t)c.sort(j),r.sort(j)}function E({nodes:t}){for(const u of t)u.value=u.fixedValue===void 0?Math.max(dt(u.sourceLinks,pt),dt(u.targetLinks,pt)):u.fixedValue}function D({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.depth=r;for(const{target:p}of f.sourceLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function X({nodes:t}){const u=t.length;let s=new Set(t),c=new Set,r=0;for(;s.size;){for(const f of s){f.height=r;for(const{source:p}of f.targetLinks)c.add(p)}if(++r>u)throw new Error("circular link");s=c,c=new Set}}function B({nodes:t}){const u=Rt(t,r=>r.depth)+1,s=(i-e-l)/(u-1),c=new Array(u);for(const r of t){const f=Math.max(0,Math.min(u-1,Math.floor(y.call(null,r,u))));r.layer=f,r.x0=e+f*s,r.x1=r.x0+l,c[f]?c[f].push(r):c[f]=[r]}if(v)for(const r of c)r.sort(v);return c}function N(t){const u=qt(t,s=>(a-n-(s.length-1)*g)/dt(s,pt));for(const s of t){let c=n;for(const r of s){r.y0=c,r.y1=c+r.value*u,c=r.y1+g;for(const f of r.sourceLinks)f.width=f.value*u}c=(a-c+g)/(s.length+1);for(let r=0;r<s.length;++r){const f=s[r];f.y0+=c*(r+1),f.y1+=c*(r+1)}P(s)}}function A(t){const u=B(t);g=Math.min(m,(a-n)/(Rt(u,s=>s.length)-1)),N(u);for(let s=0;s<S;++s){const c=Math.pow(.99,s),r=Math.max(1-c,(s+1)/S);et(u,c,r),tt(u,c,r)}}function tt(t,u,s){for(let c=1,r=t.length;c<r;++c){const f=t[c];for(const p of f){let C=0,T=0;for(const{source:I,value:M}of p.targetLinks){let H=M*(p.layer-I.layer);C+=U(I,p)*H,T+=H}if(!(T>0))continue;let W=(C/T-p.y0)*u;p.y0+=W,p.y1+=W,q(p)}v===void 0&&f.sort(ft),V(f,s)}}function et(t,u,s){for(let c=t.length,r=c-2;r>=0;--r){const f=t[r];for(const p of f){let C=0,T=0;for(const{target:I,value:M}of p.sourceLinks){let H=M*(I.layer-p.layer);C+=nt(p,I)*H,T+=H}if(!(T>0))continue;let W=(C/T-p.y0)*u;p.y0+=W,p.y1+=W,q(p)}v===void 0&&f.sort(ft),V(f,s)}}function V(t,u){const s=t.length>>1,c=t[s];Q(t,c.y0-g,s-1,u),Y(t,c.y1+g,s+1,u),Q(t,a,t.length-1,u),Y(t,n,0,u)}function Y(t,u,s,c){for(;s<t.length;++s){const r=t[s],f=(u-r.y0)*c;f>1e-6&&(r.y0+=f,r.y1+=f),u=r.y1+g}}function Q(t,u,s,c){for(;s>=0;--s){const r=t[s],f=(r.y1-u)*c;f>1e-6&&(r.y0-=f,r.y1-=f),u=r.y0-g}}function q({sourceLinks:t,targetLinks:u}){if(j===void 0){for(const{source:{sourceLinks:s}}of u)s.sort(_t);for(const{target:{targetLinks:s}}of t)s.sort(St)}}function P(t){if(j===void 0)for(const{sourceLinks:u,targetLinks:s}of t)u.sort(_t),s.sort(St)}function U(t,u){let s=t.y0-(t.sourceLinks.length-1)*g/2;for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s+=r+g}for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s-=r}return s}function nt(t,u){let s=u.y0-(u.targetLinks.length-1)*g/2;for(const{source:c,width:r}of u.targetLinks){if(c===t)break;s+=r+g}for(const{target:c,width:r}of t.sourceLinks){if(c===u)break;s-=r}return s}return d}var yt=Math.PI,jt=2*yt,K=1e-6,Kt=jt-K;function vt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ot(){return new vt}vt.prototype=Ot.prototype={constructor:vt,moveTo:function(e,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,n){this._+="L"+(this._x1=+e)+","+(this._y1=+n)},quadraticCurveTo:function(e,n,i,a){this._+="Q"+ +e+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(e,n,i,a,l,m){this._+="C"+ +e+","+ +n+","+ +i+","+ +a+","+(this._x1=+l)+","+(this._y1=+m)},arcTo:function(e,n,i,a,l){e=+e,n=+n,i=+i,a=+a,l=+l;var m=this._x1,g=this._y1,x=i-e,y=a-n,v=m-e,j=g-n,k=v*v+j*j;if(l<0)throw new Error("negative radius: "+l);if(this._x1===null)this._+="M"+(this._x1=e)+","+(this._y1=n);else if(k>K)if(!(Math.abs(j*x-y*v)>K)||!l)this._+="L"+(this._x1=e)+","+(this._y1=n);else{var w=i-m,S=a-g,d=x*x+y*y,_=w*w+S*S,E=Math.sqrt(d),D=Math.sqrt(k),X=l*Math.tan((yt-Math.acos((d+k-_)/(2*E*D)))/2),B=X/D,N=X/E;Math.abs(B-1)>K&&(this._+="L"+(e+B*v)+","+(n+B*j)),this._+="A"+l+","+l+",0,0,"+ +(j*w>v*S)+","+(this._x1=e+N*x)+","+(this._y1=n+N*y)}},arc:function(e,n,i,a,l,m){e=+e,n=+n,i=+i,m=!!m;var g=i*Math.cos(a),x=i*Math.sin(a),y=e+g,v=n+x,j=1^m,k=m?a-l:l-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+y+","+v:(Math.abs(this._x1-y)>K||Math.abs(this._y1-v)>K)&&(this._+="L"+y+","+v),i&&(k<0&&(k=k%jt+jt),k>Kt?this._+="A"+i+","+i+",0,1,"+j+","+(e-g)+","+(n-x)+"A"+i+","+i+",0,1,"+j+","+(this._x1=y)+","+(this._y1=v):k>K&&(this._+="A"+i+","+i+",0,"+ +(k>=yt)+","+j+","+(this._x1=e+i*Math.cos(l))+","+(this._y1=n+i*Math.sin(l))))},rect:function(e,n,i,a){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function Tt(e){return function(){return e}}function te(e){return e[0]}function ee(e){return e[1]}var ne=Array.prototype.slice;function oe(e){return e.source}function ie(e){return e.target}function re(e){var n=oe,i=ie,a=te,l=ee,m=null;function g(){var x,y=ne.call(arguments),v=n.apply(this,y),j=i.apply(this,y);if(m||(m=x=Ot()),e(m,+a.apply(this,(y[0]=v,y)),+l.apply(this,y),+a.apply(this,(y[0]=j,y)),+l.apply(this,y)),x)return m=null,x+""||null}return g.source=function(x){return arguments.length?(n=x,g):n},g.target=function(x){return arguments.length?(i=x,g):i},g.x=function(x){return arguments.length?(a=typeof x=="function"?x:Tt(+x),g):a},g.y=function(x){return arguments.length?(l=typeof x=="function"?x:Tt(+x),g):l},g.context=function(x){return arguments.length?(m=x??null,g):m},g}function se(e,n,i,a,l){e.moveTo(n,i),e.bezierCurveTo(n=(n+a)/2,i,n,l,a,l)}function ae(){return re(se)}function le(e){return[e.source.x1,e.y0]}function ue(e){return[e.target.x0,e.y1]}function ce(){return ae().source(le).target(ue)}function fe(e){const{data:n,showLabels:i,leftMargin:a,rightMargin:l,truncateBy:m,width:g,height:x,topMargin:y,bottomMargin:v,tooltip:j,onSeriesMouseOver:k,suffix:w,prefix:S,showValues:d,onSeriesMouseClick:_,nodePadding:E,nodeWidth:D,id:X,highlightedSourceDataPoints:B,highlightedTargetDataPoints:N,defaultLinkOpacity:A,sourceTitle:tt,targetTitle:et,animate:V,sortNodes:Y,resetSelectionOnDoubleClick:Q,detailsOnClick:q,styles:P,classNames:U,precision:nt,customLayers:t}=e,u=O.useRef(null),s=Ht.useInView(u,{once:V.once,amount:V.amount}),[c,r]=O.useState(void 0),[f,p]=O.useState(void 0),[C,T]=O.useState(void 0),[W,I]=O.useState(void 0),[M,H]=O.useState(void 0),z={top:y,bottom:v,left:a,right:l},G=g-z.left-z.right,F=x-z.top-z.bottom,rt=Y==="mostReadable"?mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt):Y==="none"?mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt).nodeSort(()=>null).linkSort(()=>null):mt().nodeWidth(D).nodePadding(E).size([G,F]).nodeAlign(xt).nodeSort(Y==="desc"?(o,R)=>(R.value||0)-(o.value||0):(o,R)=>(o.value||0)-(R.value||0)),{nodes:st,links:at}=rt(n),J=ce();return h.jsxRuntimeExports.jsxs(h.jsxRuntimeExports.Fragment,{children:[h.jsxRuntimeExports.jsxs(gt.motion.svg,{width:`${g}px`,height:`${x}px`,viewBox:`0 0 ${g} ${x}`,style:{marginLeft:"auto",marginRight:"auto"},direction:"ltr",ref:u,children:[tt?h.jsxRuntimeExports.jsx("text",{x:z.left,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"start"},children:tt}):null,et?h.jsxRuntimeExports.jsx("text",{x:g-z.right,y:z.top-10,className:"text-base font-bold fill-primary-gray-700 dark:fill-primary-gray-100",style:{textAnchor:"end"},children:et}):null,h.jsxRuntimeExports.jsxs("g",{transform:`translate(${z.left},${z.top})`,children:[t.filter(o=>o.position==="before").map(o=>o.layer),st.filter(o=>o.type==="source").map((o,R)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-E/2,x:0-a,width:a,height:(o.y1||0)-(o.y0||0)+E,children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+E}px`,overflow:"visible"},children:[i?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("sankey-right-label text-right",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:"none",size:"sm",leading:"none",className:h.mo("sankey-right-value text-right font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,S,w)}):null]})}):null]})},R)),st.filter(o=>o.type==="target").map((o,R)=>h.jsxRuntimeExports.jsx("g",{onMouseEnter:()=>{T(o)},onMouseLeave:()=>{T(void 0)},children:h.jsxRuntimeExports.jsxs("g",{transform:`translate(${o.x0},${o.y0})`,children:[h.jsxRuntimeExports.jsx("rect",{x:0,y:0,width:(o.x1||0)-(o.x0||0),height:(o.y1||0)-(o.y0||0),style:{fill:o.color}}),i||d?h.jsxRuntimeExports.jsx("foreignObject",{y:0-E/2,x:D,width:l-D,height:(o.y1||0)-(o.y0||0)+E,children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center py-0 px-1.5",style:{height:`${(o.y1||0)-(o.y0||0)+E}px`},children:[i?h.jsxRuntimeExports.jsx(ut.u,{marginBottom:d?"3xs":"none",size:"sm",leading:"none",className:h.mo("sankey-left-label text-left",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:`${o.label}`.length<m?`${o.label}`:`${`${o.label}`.substring(0,m)}...`}):null,d?h.jsxRuntimeExports.jsx(ut.u,{size:"sm",leading:"none",marginBottom:"none",className:h.mo("sankey-left-value text-left font-bold",U?.graphObjectValues),style:{hyphens:"auto",color:o.color,...P?.graphObjectValues},children:Lt.numberFormattingFunction(o.value,"NA",nt,S,w)}):null]})}):null]})},R)),h.jsxRuntimeExports.jsx("defs",{children:at.map((o,R)=>h.jsxRuntimeExports.jsxs("linearGradient",{id:`${X}-gradient-${R}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientUnits:"userSpaceOnUse",children:[h.jsxRuntimeExports.jsx("stop",{offset:"0%",style:{stopColor:o.source.color,stopOpacity:1}}),h.jsxRuntimeExports.jsx("stop",{offset:"100%",style:{stopColor:o.target.color,stopOpacity:1}})]},R))}),h.jsxRuntimeExports.jsx("g",{children:h.jsxRuntimeExports.jsx(At.AnimatePresence,{children:at.map((o,R)=>h.jsxRuntimeExports.jsx(gt.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:Z=>{r(o.data),H(Z.clientY),I(Z.clientX),k?.(o)},onMouseMove:Z=>{r(o.data),H(Z.clientY),I(Z.clientX)},onClick:()=>{(_||q)&&(Vt.isEqual(f,o.data)&&Q?(p(void 0),_?.(void 0)):(p(o.data),_?.(o.data)))},onMouseLeave:()=>{r(void 0),I(void 0),H(void 0),k?.(void 0)},variants:{initial:{opacity:C?o.source.name===C.name||o.target.name===C.name?.85:A:(B.length!==0||N.length!==0)&&(B.indexOf(o.source.label)!==-1||N.indexOf(o.target.label)!==-1)?.85:A},whileInView:{opacity:C?o.source.name===C.name||o.target.name===C.name?.85:A:(B.length!==0||N.length!==0)&&(B.indexOf(o.source.label)!==-1||N.indexOf(o.target.label)!==-1)?.85:A,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial",exit:{opacity:0,transition:{duration:V.duration}},children:h.jsxRuntimeExports.jsx(gt.motion.path,{d:J(o)||"",style:{stroke:`url(#${X}-gradient-${R})`,strokeWidth:o.width,fill:"none"},exit:{opacity:0,transition:{duration:V.duration}},variants:{initial:{pathLength:0,opacity:1},whileInView:{pathLength:1,opacity:1,transition:{duration:V.duration}}},initial:"initial",animate:s?"whileInView":"initial"},`${o.source}-${o.target}`)},`${o.source}-${o.target}`))})}),t.filter(o=>o.position==="after").map(o=>o.layer)]})]}),c&&j&&W&&M?h.jsxRuntimeExports.jsx(zt.Tooltip,{data:c,body:j,xPos:W,yPos:M,backgroundStyle:P?.tooltip,className:U?.tooltip}):null,q&&f!==void 0?h.jsxRuntimeExports.jsx(Pt.G,{open:f!==void 0,onClose:()=>{p(void 0)},children:h.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof q=="string"?{__html:It.string2HTML(q,f)}:void 0,children:typeof q=="function"?q(f):null})}):null]})}function he(e){const{data:n,graphTitle:i,sources:a,graphDescription:l,showLabels:m=!0,leftMargin:g=75,rightMargin:x=75,topMargin:y=30,bottomMargin:v=10,truncateBy:j=999,height:k,width:w,footNote:S,padding:d,backgroundColor:_,tooltip:E,onSeriesMouseOver:D,suffix:X="",prefix:B="",relativeHeight:N,showValues:A=!0,graphID:tt,onSeriesMouseClick:et,graphDownload:V=!1,dataDownload:Y=!1,fillContainer:Q=!0,language:q="en",minHeight:P=0,theme:U="light",ariaLabel:nt,sourceColors:t,targetColors:u,sourceColorDomain:s,targetColorDomain:c,nodePadding:r=5,nodeWidth:f=5,highlightedSourceDataPoints:p=[],highlightedTargetDataPoints:C=[],defaultLinkOpacity:T=.3,sourceTitle:W,targetTitle:I,sortNodes:M="mostReadable",resetSelectionOnDoubleClick:H=!0,detailsOnClick:z,styles:G,classNames:F,animate:rt=!1,precision:st=2,customLayers:at=[]}=e,[J,o]=O.useState(0),[R,Z]=O.useState(0),[kt,Dt]=O.useState(void 0),it=O.useRef(null),wt=O.useRef(null);return O.useEffect(()=>{const b=ot.uniqBy(n,"source",!0).map(L=>({name:`source_${L}`,type:"source",label:`${L}`,color:typeof t=="string"||!t?t||Mt.Colors.graphMainColor:t[(s||ot.uniqBy(n,"source",!0)).findIndex($=>`${$}`==`${L}`)>t.length?t.length-1:(s||ot.uniqBy(n,"source",!0)).findIndex($=>`${$}`==`${L}`)],totalValue:$t.sum(n.filter($=>`${$.source}`==`${L}`).map($=>$.value))})),lt=M==="asc"||M==="desc"?Et.orderBy(b,["totalValue"],[M]):b,bt=ot.uniqBy(n,"target",!0).map(L=>({name:`target_${L}`,type:"target",label:`${L}`,color:typeof u=="string"||!u?u||Mt.Colors.graphMainColor:u[(c||ot.uniqBy(n,"target",!0)).findIndex($=>`${$}`==`${L}`)>u.length?u.length-1:(c||ot.uniqBy(n,"target",!0)).findIndex($=>`${$}`==`${L}`)],totalValue:$t.sum(n.filter($=>`${$.target}`==`${L}`).map($=>$.value))})),Bt=M==="asc"||M==="desc"?Et.orderBy(bt,["totalValue"],[M]):bt,ht=[...lt,...Bt];Dt({nodes:ht,links:n.map(L=>({source:ht.findIndex($=>$.name===`source_${L.source}`),target:ht.findIndex($=>$.name===`target_${L.target}`),value:L.value,data:{...L}}))})},[n,M,s,t,c,u]),O.useEffect(()=>{const b=new ResizeObserver(lt=>{o(w||lt[0].target.clientWidth||620),Z(k||lt[0].target.clientHeight||480)});return it.current&&(Z(it.current.clientHeight||480),o(it.current.clientWidth||620),w||b.observe(it.current)),()=>b.disconnect()},[w,k]),h.jsxRuntimeExports.jsx("div",{className:`${U||"light"} flex ${w?"grow-0":"grow"} ${Q?"w-full":"w-fit"} `,dir:q==="he"||q==="ar"?"rtl":void 0,children:h.jsxRuntimeExports.jsx("div",{className:h.mo(`${_?_===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${q||"en"}`,Q?"w-full":"w-fit",F?.graphContainer),style:{...G?.graphContainer||{},..._&&_!==!0?{backgroundColor:_}:{}},id:tt,ref:wt,"aria-label":nt||`${i?`The graph shows ${i}. `:""}This is a sankey chart showing flow. ${l?` ${l}`:""}`,children:h.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:_?d||"1rem":d||0},children:h.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[i||l||V||Y?h.jsxRuntimeExports.jsx(Wt.GraphHeader,{styles:{title:G?.title,description:G?.description},classNames:{title:F?.title,description:F?.description},graphTitle:i,graphDescription:l,width:w,graphDownload:V?wt.current:void 0,dataDownload:Y?n.map(b=>b.data).filter(b=>b!==void 0).length>0?n.map(b=>b.data).filter(b=>b!==void 0):n.filter(b=>b!==void 0):null}):null,h.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?h.jsxRuntimeExports.jsx(Xt.EmptyState,{}):h.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center gap-3 w-full leading-0",ref:it,"aria-label":"Graph area",children:(w||J)&&(k||R)&&kt?h.jsxRuntimeExports.jsx(fe,{data:kt,width:w||J,nodePadding:r,nodeWidth:f,height:Math.max(P,k||(N?P?(w||J)*N>P?(w||J)*N:P:(w||J)*N:R)),showLabels:m,leftMargin:g,rightMargin:x,topMargin:y,bottomMargin:v,truncateBy:j,tooltip:E,onSeriesMouseOver:D,showValues:A,suffix:X,prefix:B,onSeriesMouseClick:et,id:Ft.generateRandomString(8),highlightedSourceDataPoints:p.map(b=>`${b}`),highlightedTargetDataPoints:C.map(b=>`${b}`),defaultLinkOpacity:T,sourceTitle:W,targetTitle:I,sortNodes:M,resetSelectionOnDoubleClick:H,styles:G,classNames:F,detailsOnClick:z,animate:rt===!0?{duration:.5,once:!0,amount:.5}:rt||{duration:0,once:!0,amount:0},precision:st,customLayers:at}):null})}),a||S?h.jsxRuntimeExports.jsx(Gt.GraphFooter,{styles:{footnote:G?.footnote,source:G?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:a,footNote:S,width:w}):null]})})})})}exports.SankeyChart=he;
|
|
2
2
|
//# sourceMappingURL=SankeyChart.cjs.map
|
package/dist/SankeyChart.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { j as h, m as rt } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as h, m as rt } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as vt, useState as Z, useEffect as Mt } from "react";
|
|
3
3
|
import { s as _t } from "./index-CeVNqhMO.js";
|
|
4
4
|
import { o as Nt } from "./index-DvVprvy6.js";
|
|
5
5
|
import { i as Ht } from "./index-Bwrro8-q.js";
|
|
6
|
-
import {
|
|
7
|
-
import { u as ct } from "./Typography-
|
|
6
|
+
import { G as Wt } from "./Modal-Cg8daIlV.js";
|
|
7
|
+
import { u as ct } from "./Typography-LmZ9LEpe.js";
|
|
8
8
|
import { n as St } from "./numberFormattingFunction-14YCbkN2.js";
|
|
9
|
-
import { T as Rt } from "./Tooltip-
|
|
9
|
+
import { T as Rt } from "./Tooltip-6LIdPQGC.js";
|
|
10
10
|
import { s as Gt } from "./string2HTML-oFCROsus.js";
|
|
11
|
-
import { u as qt } from "./use-in-view-
|
|
12
|
-
import { m as dt } from "./proxy-
|
|
13
|
-
import { A as
|
|
14
|
-
import { GraphHeader as
|
|
11
|
+
import { u as qt } from "./use-in-view-DR-UTB96.js";
|
|
12
|
+
import { m as dt } from "./proxy-BYIC9BuT.js";
|
|
13
|
+
import { A as Ft } from "./index-Cwgh7i7X.js";
|
|
14
|
+
import { GraphHeader as Xt } from "./GraphHeader.js";
|
|
15
15
|
import { GraphFooter as Yt } from "./GraphFooter.js";
|
|
16
16
|
import { Colors as Tt } from "./Colors.js";
|
|
17
17
|
import { g as Ut } from "./generateRandomString-za3IQGfQ.js";
|
|
18
|
-
import { E as Zt } from "./EmptyState-
|
|
18
|
+
import { E as Zt } from "./EmptyState-36lXXyui.js";
|
|
19
19
|
import { u as ot } from "./uniqBy-BHy4I8PK.js";
|
|
20
20
|
function Ct(e, n) {
|
|
21
21
|
let i;
|
|
@@ -106,7 +106,7 @@ function xt() {
|
|
|
106
106
|
let e = 0, n = 0, i = 1, a = 1, l = 24, y = 8, g, p = Kt, x = Jt, k, v, w = te, b = ee, S = 6;
|
|
107
107
|
function d() {
|
|
108
108
|
const t = { nodes: w.apply(null, arguments), links: b.apply(null, arguments) };
|
|
109
|
-
return T(t), L(t), z(t),
|
|
109
|
+
return T(t), L(t), z(t), F(t), W(t), zt(t), t;
|
|
110
110
|
}
|
|
111
111
|
d.update = function(t) {
|
|
112
112
|
return zt(t), t;
|
|
@@ -163,7 +163,7 @@ function xt() {
|
|
|
163
163
|
s = c, c = /* @__PURE__ */ new Set();
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function F({ nodes: t }) {
|
|
167
167
|
const u = t.length;
|
|
168
168
|
let s = new Set(t), c = /* @__PURE__ */ new Set(), r = 0;
|
|
169
169
|
for (; s.size; ) {
|
|
@@ -245,9 +245,9 @@ function xt() {
|
|
|
245
245
|
}
|
|
246
246
|
function B(t, u) {
|
|
247
247
|
const s = t.length >> 1, c = t[s];
|
|
248
|
-
Q(t, c.y0 - g, s - 1, u),
|
|
248
|
+
Q(t, c.y0 - g, s - 1, u), X(t, c.y1 + g, s + 1, u), Q(t, a, t.length - 1, u), X(t, n, 0, u);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function X(t, u, s, c) {
|
|
251
251
|
for (; s < t.length; ++s) {
|
|
252
252
|
const r = t[s], f = (u - r.y0) * c;
|
|
253
253
|
f > 1e-6 && (r.y0 += f, r.y1 += f), u = r.y1 + g;
|
|
@@ -332,7 +332,7 @@ bt.prototype = It.prototype = {
|
|
|
332
332
|
else if (w > K) if (!(Math.abs(v * p - x * k) > K) || !l)
|
|
333
333
|
this._ += "L" + (this._x1 = e) + "," + (this._y1 = n);
|
|
334
334
|
else {
|
|
335
|
-
var b = i - y, S = a - g, d = p * p + x * x, T = b * b + S * S, L = Math.sqrt(d), z = Math.sqrt(w),
|
|
335
|
+
var b = i - y, S = a - g, d = p * p + x * x, T = b * b + S * S, L = Math.sqrt(d), z = Math.sqrt(w), F = l * Math.tan((kt - Math.acos((d + w - T) / (2 * L * z))) / 2), P = F / z, C = F / L;
|
|
336
336
|
Math.abs(P - 1) > K && (this._ += "L" + (e + P * k) + "," + (n + P * v)), this._ += "A" + l + "," + l + ",0,0," + +(v * b > k * S) + "," + (this._x1 = e + C * p) + "," + (this._y1 = n + C * x);
|
|
337
337
|
}
|
|
338
338
|
},
|
|
@@ -419,14 +419,14 @@ function de(e) {
|
|
|
419
419
|
onSeriesMouseClick: T,
|
|
420
420
|
nodePadding: L,
|
|
421
421
|
nodeWidth: z,
|
|
422
|
-
id:
|
|
422
|
+
id: F,
|
|
423
423
|
highlightedSourceDataPoints: P,
|
|
424
424
|
highlightedTargetDataPoints: C,
|
|
425
425
|
defaultLinkOpacity: W,
|
|
426
426
|
sourceTitle: tt,
|
|
427
427
|
targetTitle: et,
|
|
428
428
|
animate: B,
|
|
429
|
-
sortNodes:
|
|
429
|
+
sortNodes: X,
|
|
430
430
|
resetSelectionOnDoubleClick: Q,
|
|
431
431
|
detailsOnClick: V,
|
|
432
432
|
styles: I,
|
|
@@ -441,8 +441,8 @@ function de(e) {
|
|
|
441
441
|
bottom: k,
|
|
442
442
|
left: a,
|
|
443
443
|
right: l
|
|
444
|
-
}, G = g - A.left - A.right, q = p - A.top - A.bottom, st =
|
|
445
|
-
|
|
444
|
+
}, G = g - A.left - A.right, q = p - A.top - A.bottom, st = X === "mostReadable" ? xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt) : X === "none" ? xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt).nodeSort(() => null).linkSort(() => null) : xt().nodeWidth(z).nodePadding(L).size([G, q]).nodeAlign(mt).nodeSort(
|
|
445
|
+
X === "desc" ? (o, N) => (N.value || 0) - (o.value || 0) : (o, N) => (o.value || 0) - (N.value || 0)
|
|
446
446
|
), { nodes: at, links: lt } = st(n), J = ge();
|
|
447
447
|
return /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
448
448
|
/* @__PURE__ */ h.jsxs(
|
|
@@ -641,7 +641,7 @@ function de(e) {
|
|
|
641
641
|
/* @__PURE__ */ h.jsx("defs", { children: lt.map((o, N) => /* @__PURE__ */ h.jsxs(
|
|
642
642
|
"linearGradient",
|
|
643
643
|
{
|
|
644
|
-
id: `${
|
|
644
|
+
id: `${F}-gradient-${N}`,
|
|
645
645
|
x1: "0%",
|
|
646
646
|
y1: "0%",
|
|
647
647
|
x2: "100%",
|
|
@@ -672,7 +672,7 @@ function de(e) {
|
|
|
672
672
|
},
|
|
673
673
|
N
|
|
674
674
|
)) }),
|
|
675
|
-
/* @__PURE__ */ h.jsx("g", { children: /* @__PURE__ */ h.jsx(
|
|
675
|
+
/* @__PURE__ */ h.jsx("g", { children: /* @__PURE__ */ h.jsx(Ft, { children: lt.map((o, N) => /* @__PURE__ */ h.jsx(
|
|
676
676
|
dt.g,
|
|
677
677
|
{
|
|
678
678
|
className: "undp-viz-g-with-hover",
|
|
@@ -726,7 +726,7 @@ function de(e) {
|
|
|
726
726
|
{
|
|
727
727
|
d: J(o) || "",
|
|
728
728
|
style: {
|
|
729
|
-
stroke: `url(#${
|
|
729
|
+
stroke: `url(#${F}-gradient-${N})`,
|
|
730
730
|
strokeWidth: o.width,
|
|
731
731
|
fill: "none"
|
|
732
732
|
},
|
|
@@ -804,14 +804,14 @@ function Ve(e) {
|
|
|
804
804
|
backgroundColor: T,
|
|
805
805
|
tooltip: L,
|
|
806
806
|
onSeriesMouseOver: z,
|
|
807
|
-
suffix:
|
|
807
|
+
suffix: F = "",
|
|
808
808
|
prefix: P = "",
|
|
809
809
|
relativeHeight: C,
|
|
810
810
|
showValues: W = !0,
|
|
811
811
|
graphID: tt,
|
|
812
812
|
onSeriesMouseClick: et,
|
|
813
813
|
graphDownload: B = !1,
|
|
814
|
-
dataDownload:
|
|
814
|
+
dataDownload: X = !1,
|
|
815
815
|
fillContainer: Q = !0,
|
|
816
816
|
language: V = "en",
|
|
817
817
|
minHeight: I = 0,
|
|
@@ -899,8 +899,8 @@ function Ve(e) {
|
|
|
899
899
|
className: "flex grow",
|
|
900
900
|
style: { padding: T ? d || "1rem" : d || 0 },
|
|
901
901
|
children: /* @__PURE__ */ h.jsxs("div", { className: "flex flex-col gap-4 w-full grow justify-between", children: [
|
|
902
|
-
i || l || B ||
|
|
903
|
-
|
|
902
|
+
i || l || B || X ? /* @__PURE__ */ h.jsx(
|
|
903
|
+
Xt,
|
|
904
904
|
{
|
|
905
905
|
styles: {
|
|
906
906
|
title: G?.title,
|
|
@@ -914,7 +914,7 @@ function Ve(e) {
|
|
|
914
914
|
graphDescription: l,
|
|
915
915
|
width: b,
|
|
916
916
|
graphDownload: B ? $t.current : void 0,
|
|
917
|
-
dataDownload:
|
|
917
|
+
dataDownload: X ? n.map((j) => j.data).filter((j) => j !== void 0).length > 0 ? n.map((j) => j.data).filter((j) => j !== void 0) : n.filter((j) => j !== void 0) : null
|
|
918
918
|
}
|
|
919
919
|
) : null,
|
|
920
920
|
/* @__PURE__ */ h.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: n.length === 0 ? /* @__PURE__ */ h.jsx(Zt, {}) : /* @__PURE__ */ h.jsx(
|
|
@@ -943,7 +943,7 @@ function Ve(e) {
|
|
|
943
943
|
tooltip: L,
|
|
944
944
|
onSeriesMouseOver: z,
|
|
945
945
|
showValues: W,
|
|
946
|
-
suffix:
|
|
946
|
+
suffix: F,
|
|
947
947
|
prefix: P,
|
|
948
948
|
onSeriesMouseClick: et,
|
|
949
949
|
id: Ut(8),
|