@undp/data-viz 1.5.7 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +666 -664
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +223 -221
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +84 -82
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +133 -131
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.js +141 -121
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +307 -307
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +204 -184
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +172 -173
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +89 -78
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.js +186 -181
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +256 -244
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-mH7UKOPi.js → RegressionLine-CW7iViH2.js} +13 -12
- package/dist/RegressionLine-CW7iViH2.js.map +1 -0
- package/dist/RegressionLine-D-49RaHa.cjs +2 -0
- package/dist/RegressionLine-D-49RaHa.cjs.map +1 -0
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +145 -144
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +53 -48
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +137 -133
- package/dist/SlopeChart.js.map +1 -1
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +307 -295
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +25 -26
- package/dist/UnitChart.js.map +1 -1
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getCentroidCoordinates-Dfk6IqEG.js.map +1 -1
- package/dist/getCentroidCoordinates-DxTBqzp2.cjs.map +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/RegressionLine-mH7UKOPi.js.map +0 -1
- package/dist/RegressionLine-xKdiJ8sw.cjs +0 -2
- package/dist/RegressionLine-xKdiJ8sw.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-37q0ULNQ.js","sources":["../node_modules/d3-array/src/extent.js","../src/Components/Graphs/CirclePackingGraph/Graph.tsx","../src/Components/Graphs/CirclePackingGraph/index.tsx"],"sourcesContent":["export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","import { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react';\r\nimport { forceCollide, forceManyBody, forceSimulation, forceX, forceY } from 'd3-force';\r\nimport orderBy from 'lodash.orderby';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { extent } from 'd3-array';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { ClassNameObject, StyleObject, TreeMapDataType } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n data: TreeMapDataType[];\r\n colors: string[];\r\n colorDomain: string[];\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n showLabels: boolean;\r\n showValues: boolean;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n theme: 'light' | 'dark';\r\n maxRadiusValue?: number;\r\n radius: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n dimmedOpacity: number;\r\n precision: number;\r\n}\r\n\r\ninterface TreeMapDataTypeForBubbleChart extends TreeMapDataType {\r\n x: number;\r\n y: number;\r\n vx: number;\r\n vy: number;\r\n}\r\n\r\nexport const Graph = memo((props: Props) => {\r\n const {\r\n data,\r\n colors,\r\n leftMargin,\r\n width,\r\n height,\r\n colorDomain,\r\n selectedColor,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showValues,\r\n suffix,\r\n prefix,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n maxRadiusValue,\r\n radius,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [viewPortDimensions, setViewPortDimensions] = useState<\r\n [number, number, number, number] | undefined\r\n >(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const [finalData, setFinalData] = useState<TreeMapDataTypeForBubbleChart[] | null>(null);\r\n\r\n // Memoize expensive calculations\r\n const margin = useMemo(\r\n () => ({\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n }),\r\n [topMargin, bottomMargin, leftMargin, rightMargin],\r\n );\r\n\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n // Memoize data ordering and radius scale\r\n const dataOrdered = useMemo(\r\n () =>\r\n data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data\r\n : orderBy(\r\n data.filter(d => !checkIfNullOrUndefined(d.size)),\r\n 'radius',\r\n 'asc',\r\n ),\r\n [data],\r\n );\r\n\r\n const radiusScale = useMemo(() => {\r\n return data.filter(d => d.size === undefined || d.size === null).length !== data.length\r\n ? scaleSqrt()\r\n .domain([\r\n 0,\r\n checkIfNullOrUndefined(maxRadiusValue)\r\n ? Math.max(...data.map(d => d.size).filter(d => d !== undefined && d !== null))\r\n : (maxRadiusValue as number),\r\n ])\r\n .range([0.25, radius])\r\n .nice()\r\n : undefined;\r\n }, [data, maxRadiusValue, radius]);\r\n\r\n // Memoize simulation setup\r\n useEffect(() => {\r\n const setupSimulation = () => {\r\n const dataTemp = [...dataOrdered];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const simulation = forceSimulation(dataTemp as any)\r\n .force('y', forceY(_d => graphHeight / 2).strength(1))\r\n .force('x', forceX(_d => graphWidth / 2).strength(1))\r\n .force(\r\n 'collide',\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n forceCollide((d: any) => (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1)),\r\n )\r\n .force('charge', forceManyBody().strength(-15))\r\n .alphaDecay(0.05)\r\n .tick(10000);\r\n\r\n simulation\r\n .on('tick', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n })\r\n .on('end', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n const xMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const yMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const xMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n const yMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n setViewPortDimensions([\r\n xMinExtent,\r\n yMinExtent,\r\n xMinExtent < 0 ? xMaxExtent - xMinExtent : xMaxExtent,\r\n yMinExtent < 0 ? yMaxExtent - yMinExtent : yMaxExtent,\r\n ]);\r\n });\r\n };\r\n\r\n setupSimulation();\r\n }, [data, radius, graphHeight, graphWidth, maxRadiusValue, dataOrdered, radiusScale]);\r\n\r\n // Memoize event handlers to prevent unnecessary re-renders\r\n const handleMouseEnter = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n },\r\n [onSeriesMouseOver],\r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const handleMouseMove = useCallback((event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }, []);\r\n\r\n const handleClick = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (mouseClickData === d.label && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.label);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n },\r\n [onSeriesMouseClick, detailsOnClick, mouseClickData, resetSelectionOnDoubleClick],\r\n );\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }, [onSeriesMouseOver]);\r\n\r\n // Memoize color and opacity calculations\r\n const getCircleColor = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n [data, colors, colorDomain],\r\n );\r\n\r\n const getOpacity = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.85\r\n : dimmedOpacity\r\n : 0.85,\r\n [selectedColor, dimmedOpacity, colors, colorDomain, highlightedDataPoints],\r\n );\r\n\r\n // Render loading state\r\n if (!finalData) {\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px` }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n }\r\n if (viewPortDimensions) {\r\n return (\r\n <>\r\n <svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`${viewPortDimensions[0] > 0 ? 0 : viewPortDimensions[0]} ${\r\n viewPortDimensions[1] > 0 ? 0 : viewPortDimensions[1]\r\n } ${width < viewPortDimensions[2] ? viewPortDimensions[2] : width} ${\r\n height < viewPortDimensions[3] ? viewPortDimensions[3] : height\r\n }`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {finalData.map(d => {\r\n const circleColor = getCircleColor(d);\r\n const opacity = getOpacity(d);\r\n const bubbleRadius = radiusScale ? radiusScale(d.size || 0) : radius;\r\n const showLabel = bubbleRadius > 20 && (showLabels || showValues);\r\n return (\r\n <g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={opacity}\r\n transform={`translate(${d.x},${d.y})`}\r\n onMouseEnter={event => handleMouseEnter(event, d)}\r\n onMouseMove={event => handleMouseMove(event, d)}\r\n onClick={() => handleClick(d)}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n <circle cx={0} cy={0} r={bubbleRadius} fill={circleColor} />\r\n {(showLabel || showValues) && d.size !== undefined && d.size !== null && (\r\n <g>\r\n <foreignObject\r\n y={0 - bubbleRadius}\r\n x={0 - bubbleRadius}\r\n width={2 * bubbleRadius}\r\n height={2 * bubbleRadius}\r\n >\r\n <div className='flex flex-col justify-center items-center h-full py-0 px-3'>\r\n {showLabels && (\r\n <p\r\n className={cn(\r\n 'text-center leading-[1.25] overflow-hidden m-0 circle-packing-label',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 12),\r\n Math.max(\r\n Math.round((bubbleRadius * 12) / `${d.label}`.length),\r\n 12,\r\n ),\r\n 14,\r\n )}px`,\r\n WebkitLineClamp:\r\n bubbleRadius * 2 < 60\r\n ? 1\r\n : bubbleRadius * 2 < 75\r\n ? 2\r\n : bubbleRadius * 2 < 100\r\n ? 3\r\n : undefined,\r\n display: '-webkit-box',\r\n WebkitBoxOrient: 'vertical',\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n hyphens: 'auto',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {d.label}\r\n </p>\r\n )}\r\n {showValues && (\r\n <p\r\n className='text-center font-bold leading-[1.25] w-full m-0 circle-packing-value'\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 14),\r\n 14,\r\n )}px`,\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n }}\r\n >\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </p>\r\n )}\r\n </div>\r\n </foreignObject>\r\n </g>\r\n )}\r\n </g>\r\n );\r\n })}\r\n </g>\r\n </svg>\r\n {mouseOverData && tooltip && eventX && eventY && (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n )}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n }\r\n return null;\r\n});\r\n\r\nGraph.displayName = 'BubbleChart';\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { Languages, SourcesDataType, StyleObject, ClassNameObject, TreeMapDataType } from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: TreeMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function CirclePackingGraph(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n leftMargin = 0,\r\n rightMargin = 0,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 0,\r\n bottomMargin = 0,\r\n showLabels = true,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n showValues,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n language = 'en',\r\n showNAColor,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n radius,\r\n maxRadiusValue,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a chart where data points are represented by circles, and their sizes reflect their values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n isCenter\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n showLabels={showLabels}\r\n showValues={\r\n showValues !== false\r\n ? data.filter(el => el.size).length !== 0\r\n : (showValues as boolean)\r\n }\r\n selectedColor={selectedColor}\r\n suffix={suffix}\r\n prefix={prefix}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n theme={theme}\r\n radius={\r\n !radius\r\n ? (Math.min(\r\n width || svgWidth,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ) *\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? 1\r\n : Math.max(\r\n ...data\r\n .map(d => d.size)\r\n .filter(d => d !== undefined && d !== null),\r\n ))) /\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data.length\r\n : sum(data.filter(d => d.size).map(d => d.size)) * 1.25)\r\n : radius\r\n }\r\n maxRadiusValue={maxRadiusValue}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["extent","values","valueof","min","max","value","index","Graph","memo","props","data","colors","leftMargin","width","height","colorDomain","selectedColor","rightMargin","topMargin","bottomMargin","showLabels","tooltip","onSeriesMouseOver","showValues","suffix","prefix","highlightedDataPoints","onSeriesMouseClick","maxRadiusValue","radius","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","dimmedOpacity","precision","svgRef","useRef","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","viewPortDimensions","setViewPortDimensions","eventX","setEventX","eventY","setEventY","finalData","setFinalData","margin","useMemo","graphWidth","graphHeight","dataOrdered","d","checkIfNullOrUndefined","orderBy","radiusScale","scaleSqrt","useEffect","dataTemp","forceSimulation","forceY","_d","forceX","forceCollide","forceManyBody","xMinExtent","yMinExtent","xMaxExtent","yMaxExtent","handleMouseEnter","useCallback","event","handleMouseMove","handleClick","handleMouseLeave","getCircleColor","el","Colors","getOpacity","jsxs","Fragment","jsx","circleColor","opacity","bubbleRadius","showLabel","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","Spinner","CirclePackingGraph","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","sum","GraphFooter"],"mappings":";;;;;;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UAAAE;AAAA,oBACA,OAAAvF;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index-CE9pmfxt.js","sources":["../node_modules/d3-array/src/extent.js","../src/Components/Graphs/CirclePackingGraph/Graph.tsx","../src/Components/Graphs/CirclePackingGraph/index.tsx"],"sourcesContent":["export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","import { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react';\r\nimport { forceCollide, forceManyBody, forceSimulation, forceX, forceY } from 'd3-force';\r\nimport orderBy from 'lodash.orderby';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { extent } from 'd3-array';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { ClassNameObject, StyleObject, TreeMapDataType } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n data: TreeMapDataType[];\r\n colors: string[];\r\n colorDomain: string[];\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n showLabels: boolean;\r\n showValues: boolean;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n theme: 'light' | 'dark';\r\n maxRadiusValue?: number;\r\n radius: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n dimmedOpacity: number;\r\n precision: number;\r\n}\r\n\r\ninterface TreeMapDataTypeForBubbleChart extends TreeMapDataType {\r\n x: number;\r\n y: number;\r\n vx: number;\r\n vy: number;\r\n}\r\n\r\nexport const Graph = memo((props: Props) => {\r\n const {\r\n data,\r\n colors,\r\n leftMargin,\r\n width,\r\n height,\r\n colorDomain,\r\n selectedColor,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showValues,\r\n suffix,\r\n prefix,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n maxRadiusValue,\r\n radius,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [viewPortDimensions, setViewPortDimensions] = useState<\r\n [number, number, number, number] | undefined\r\n >(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const [finalData, setFinalData] = useState<TreeMapDataTypeForBubbleChart[] | null>(null);\r\n\r\n // Memoize expensive calculations\r\n const margin = useMemo(\r\n () => ({\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n }),\r\n [topMargin, bottomMargin, leftMargin, rightMargin],\r\n );\r\n\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n // Memoize data ordering and radius scale\r\n const dataOrdered = useMemo(\r\n () =>\r\n data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data\r\n : orderBy(\r\n data.filter(d => !checkIfNullOrUndefined(d.size)),\r\n 'radius',\r\n 'asc',\r\n ),\r\n [data],\r\n );\r\n\r\n const radiusScale = useMemo(() => {\r\n return data.filter(d => d.size === undefined || d.size === null).length !== data.length\r\n ? scaleSqrt()\r\n .domain([\r\n 0,\r\n checkIfNullOrUndefined(maxRadiusValue)\r\n ? Math.max(...data.map(d => d.size).filter(d => d !== undefined && d !== null))\r\n : (maxRadiusValue as number),\r\n ])\r\n .range([0.25, radius])\r\n .nice()\r\n : undefined;\r\n }, [data, maxRadiusValue, radius]);\r\n\r\n // Memoize simulation setup\r\n useEffect(() => {\r\n const setupSimulation = () => {\r\n const dataTemp = [...dataOrdered];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const simulation = forceSimulation(dataTemp as any)\r\n .force('y', forceY(_d => graphHeight / 2).strength(1))\r\n .force('x', forceX(_d => graphWidth / 2).strength(1))\r\n .force(\r\n 'collide',\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n forceCollide((d: any) => (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1)),\r\n )\r\n .force('charge', forceManyBody().strength(-15))\r\n .alphaDecay(0.05)\r\n .tick(10000);\r\n\r\n simulation\r\n .on('tick', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n })\r\n .on('end', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n const xMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const yMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const xMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n const yMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n setViewPortDimensions([\r\n xMinExtent,\r\n yMinExtent,\r\n xMinExtent < 0 ? xMaxExtent - xMinExtent : xMaxExtent,\r\n yMinExtent < 0 ? yMaxExtent - yMinExtent : yMaxExtent,\r\n ]);\r\n });\r\n };\r\n\r\n setupSimulation();\r\n }, [data, radius, graphHeight, graphWidth, maxRadiusValue, dataOrdered, radiusScale]);\r\n\r\n // Memoize event handlers to prevent unnecessary re-renders\r\n const handleMouseEnter = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n },\r\n [onSeriesMouseOver],\r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const handleMouseMove = useCallback((event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }, []);\r\n\r\n const handleClick = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (mouseClickData === d.label && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.label);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n },\r\n [onSeriesMouseClick, detailsOnClick, mouseClickData, resetSelectionOnDoubleClick],\r\n );\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }, [onSeriesMouseOver]);\r\n\r\n // Memoize color and opacity calculations\r\n const getCircleColor = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n [data, colors, colorDomain],\r\n );\r\n\r\n const getOpacity = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.85\r\n : dimmedOpacity\r\n : 0.85,\r\n [selectedColor, dimmedOpacity, colors, colorDomain, highlightedDataPoints],\r\n );\r\n\r\n // Render loading state\r\n if (!finalData) {\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px` }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n }\r\n if (viewPortDimensions) {\r\n return (\r\n <>\r\n <svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`${viewPortDimensions[0] > 0 ? 0 : viewPortDimensions[0]} ${\r\n viewPortDimensions[1] > 0 ? 0 : viewPortDimensions[1]\r\n } ${width < viewPortDimensions[2] ? viewPortDimensions[2] : width} ${\r\n height < viewPortDimensions[3] ? viewPortDimensions[3] : height\r\n }`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {finalData.map(d => {\r\n const circleColor = getCircleColor(d);\r\n const opacity = getOpacity(d);\r\n const bubbleRadius = radiusScale ? radiusScale(d.size || 0) : radius;\r\n const showLabel = bubbleRadius > 20 && (showLabels || showValues);\r\n return (\r\n <g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={opacity}\r\n transform={`translate(${d.x},${d.y})`}\r\n onMouseEnter={event => handleMouseEnter(event, d)}\r\n onMouseMove={event => handleMouseMove(event, d)}\r\n onClick={() => handleClick(d)}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n <circle cx={0} cy={0} r={bubbleRadius} fill={circleColor} />\r\n {(showLabel || showValues) && d.size !== undefined && d.size !== null && (\r\n <g>\r\n <foreignObject\r\n y={0 - bubbleRadius}\r\n x={0 - bubbleRadius}\r\n width={2 * bubbleRadius}\r\n height={2 * bubbleRadius}\r\n >\r\n <div className='flex flex-col justify-center items-center h-full py-0 px-3'>\r\n {showLabels && (\r\n <p\r\n className={cn(\r\n 'text-center leading-[1.25] overflow-hidden m-0 circle-packing-label',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 12),\r\n Math.max(\r\n Math.round((bubbleRadius * 12) / `${d.label}`.length),\r\n 12,\r\n ),\r\n 14,\r\n )}px`,\r\n WebkitLineClamp:\r\n bubbleRadius * 2 < 60\r\n ? 1\r\n : bubbleRadius * 2 < 75\r\n ? 2\r\n : bubbleRadius * 2 < 100\r\n ? 3\r\n : undefined,\r\n display: '-webkit-box',\r\n WebkitBoxOrient: 'vertical',\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n hyphens: 'auto',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {d.label}\r\n </p>\r\n )}\r\n {showValues && (\r\n <p\r\n className='text-center font-bold leading-[1.25] w-full m-0 circle-packing-value'\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 14),\r\n 14,\r\n )}px`,\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n }}\r\n >\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </p>\r\n )}\r\n </div>\r\n </foreignObject>\r\n </g>\r\n )}\r\n </g>\r\n );\r\n })}\r\n </g>\r\n </svg>\r\n {mouseOverData && tooltip && eventX && eventY && (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n )}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n }\r\n return null;\r\n});\r\n\r\nGraph.displayName = 'BubbleChart';\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { Languages, SourcesDataType, StyleObject, ClassNameObject, TreeMapDataType } from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: TreeMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function CirclePackingGraph(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n leftMargin = 0,\r\n rightMargin = 0,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 0,\r\n bottomMargin = 0,\r\n showLabels = true,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n showValues,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n language = 'en',\r\n showNAColor,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n radius,\r\n maxRadiusValue,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a chart where data points are represented by circles, and their sizes reflect their values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n isCenter\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n showLabels={showLabels}\r\n showValues={\r\n showValues !== false\r\n ? data.filter(el => el.size).length !== 0\r\n : (showValues as boolean)\r\n }\r\n selectedColor={selectedColor}\r\n suffix={suffix}\r\n prefix={prefix}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n theme={theme}\r\n radius={\r\n !radius\r\n ? (Math.min(\r\n width || svgWidth,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ) *\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? 1\r\n : Math.max(\r\n ...data\r\n .map(d => d.size)\r\n .filter(d => d !== undefined && d !== null),\r\n ))) /\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data.length\r\n : sum(data.filter(d => d.size).map(d => d.size)) * 1.25)\r\n : radius\r\n }\r\n maxRadiusValue={maxRadiusValue}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["extent","values","valueof","min","max","value","index","Graph","memo","props","data","colors","leftMargin","width","height","colorDomain","selectedColor","rightMargin","topMargin","bottomMargin","showLabels","tooltip","onSeriesMouseOver","showValues","suffix","prefix","highlightedDataPoints","onSeriesMouseClick","maxRadiusValue","radius","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","dimmedOpacity","precision","svgRef","useRef","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","viewPortDimensions","setViewPortDimensions","eventX","setEventX","eventY","setEventY","finalData","setFinalData","margin","useMemo","graphWidth","graphHeight","dataOrdered","d","checkIfNullOrUndefined","orderBy","radiusScale","scaleSqrt","useEffect","dataTemp","forceSimulation","forceY","_d","forceX","forceCollide","forceManyBody","xMinExtent","yMinExtent","xMaxExtent","yMaxExtent","handleMouseEnter","useCallback","event","handleMouseMove","handleClick","handleMouseLeave","getCircleColor","el","Colors","getOpacity","jsxs","Fragment","jsx","circleColor","opacity","bubbleRadius","showLabel","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","Spinner","CirclePackingGraph","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","sum","GraphFooter"],"mappings":";;;;;;;;;;;;;;;;;;;AAAe,SAASA,GAAOC,GAAQC,GAAS;AAC9C,MAAIC,GACAC;AACJ,MAAIF,MAAY;AACd,eAAWG,KAASJ;AAClB,MAAII,KAAS,SACPF,MAAQ,SACNE,KAASA,MAAOF,IAAMC,IAAMC,MAE5BF,IAAME,MAAOF,IAAME,IACnBD,IAAMC,MAAOD,IAAMC;AAAA,OAIxB;AACL,QAAIC,IAAQ;AACZ,aAASD,KAASJ;AAChB,OAAKI,IAAQH,EAAQG,GAAO,EAAEC,GAAOL,CAAM,MAAM,SAC3CE,MAAQ,SACNE,KAASA,MAAOF,IAAMC,IAAMC,MAE5BF,IAAME,MAAOF,IAAME,IACnBD,IAAMC,MAAOD,IAAMC;AAAA,EAI/B;AACA,SAAO,CAACF,GAAKC,CAAG;AAClB;AC8BO,MAAMG,KAAQC,GAAK,CAACC,MAAiB;AAC1C,QAAM;AAAA,IACJ,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,SAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,QAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAA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A,EAAAA;AAAAA,kBAAC2C;AAAA,kBAAA;AAAA,oBACC,QAAQ,EAAE,UAAUhG,GAAQ,UAAU,QAAQA,GAAQ,OAAA;AAAA,oBACtD,YAAY;AAAA,sBACV,UAAUC,GAAY;AAAA,sBACtB,QAAQA,GAAY;AAAA,oBAAA;AAAA,oBAEtB,SAAAiE;AAAA,oBACA,UAAAE;AAAA,oBACA,OAAAvF;AAAA,kBAAA;AAAA,gBAAA,IAEA;AAAA,cAAA,EAAA,CACN;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("./index-CHPV5EwG-
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
"use strict";const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),i=require("react"),fe=require("./index-CSNtgibC.cjs"),ge=require("./index-CQ3e6Ewi.cjs"),me=require("./Modal-CuuJdWkD.cjs"),pe=require("./Spinner-C6wLp85s.cjs"),ve=require("./Tooltip-Cpv0QohJ.cjs"),je=require("./numberFormattingFunction-02t-wJta.cjs"),he=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),se=require("./Colors.cjs"),U=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),ye=require("./string2HTML-z7CwHXcx.cjs"),be=require("./pow-B5-jkdHU.cjs"),W=require("./y-QcCbqrzx.cjs"),Ce=require("./GraphFooter.cjs"),Me=require("./GraphHeader.cjs"),we=require("./ColorLegendWithMouseOver.cjs"),Ee=require("./EmptyState-B8IpKGcL.cjs"),de=require("./uniqBy-O05lp2S5.cjs");function I(M,o){let r,x;if(o===void 0)for(const a of M)a!=null&&(r===void 0?a>=a&&(r=x=a):(r>a&&(r=a),x<a&&(x=a)));else{let a=-1;for(let c of M)(c=o(c,++a,M))!=null&&(r===void 0?c>=c&&(r=x=c):(r>c&&(r=c),x<c&&(x=c)))}return[r,x]}const xe=i.memo(M=>{const{data:o,colors:r,leftMargin:x,width:a,height:c,colorDomain:k,selectedColor:y,rightMargin:X,topMargin:Y,bottomMargin:b,showLabels:l,tooltip:B,onSeriesMouseOver:w,showValues:H,suffix:_,prefix:C,highlightedDataPoints:L,onSeriesMouseClick:O,maxRadiusValue:S,radius:u,resetSelectionOnDoubleClick:A,detailsOnClick:v,styles:J,classNames:T,dimmedOpacity:N,precision:re}=M,le=i.useRef(null),[G,z]=i.useState(void 0),[p,E]=i.useState(void 0),[h,D]=i.useState(void 0),[K,$]=i.useState(void 0),[Q,P]=i.useState(void 0),[Z,j]=i.useState(null),f=i.useMemo(()=>({top:Y,bottom:b,left:x,right:X}),[Y,b,x,X]),ee=a-f.left-f.right,te=c-f.top-f.bottom,g=i.useMemo(()=>o.filter(e=>!U.checkIfNullOrUndefined(e.size)).length===0?o:ge.orderBy(o.filter(e=>!U.checkIfNullOrUndefined(e.size)),"radius","asc"),[o]),d=i.useMemo(()=>o.filter(e=>e.size===void 0||e.size===null).length!==o.length?be.sqrt().domain([0,U.checkIfNullOrUndefined(S)?Math.max(...o.map(e=>e.size).filter(e=>e!=null)):S]).range([.25,u]).nice():void 0,[o,S,u]);i.useEffect(()=>{(()=>{const s=[...g];W.forceSimulation(s).force("y",W.forceY(n=>te/2).strength(1)).force("x",W.forceX(n=>ee/2).strength(1)).force("collide",W.forceCollide(n=>d?d(n.size||0)+1:u+1)).force("charge",W.forceManyBody().strength(-15)).alphaDecay(.05).tick(1e4).on("tick",()=>{j(s)}).on("end",()=>{j(s);const n=I(s,m=>m.x-(d?d(m.size||0)+1:u+1))[0]||0,V=I(s,m=>m.y-(d?d(m.size||0)+1:u+1))[0]||0,q=I(s,m=>m.x+(d?d(m.size||0)+1:u+1))[1]||0,ue=I(s,m=>m.y+(d?d(m.size||0)+1:u+1))[1]||0;D([n,V,n<0?q-n:q,V<0?ue-V:ue])})})()},[o,u,te,ee,S,g,d]);const F=i.useCallback((e,s)=>{z(s),P(e.clientY),$(e.clientX),w?.(s)},[w]),oe=i.useCallback((e,s)=>{z(s),P(e.clientY),$(e.clientX)},[]),ne=i.useCallback(e=>{(O||v)&&(p===e.label&&A?(E(void 0),O?.(void 0)):(E(e.label),O?.(e)))},[O,v,p,A]),ae=i.useCallback(()=>{z(void 0),$(void 0),P(void 0),w?.(void 0)},[w]),R=i.useCallback(e=>o.filter(s=>s.color).length===0?r[0]:e.color?r[k.indexOf(e.color)]:se.Colors.gray,[o,r,k]),ie=i.useCallback(e=>y?e.color&&r[k.indexOf(e.color)]===y?1:N:L.length!==0?L.indexOf(e.label)!==-1?.85:N:.85,[y,N,r,k,L]);return Z?h?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("svg",{width:`${a}px`,height:`${c}px`,viewBox:`${h[0]>0?0:h[0]} ${h[1]>0?0:h[1]} ${a<h[2]?h[2]:a} ${c<h[3]?h[3]:c}`,direction:"ltr",ref:le,children:t.jsxRuntimeExports.jsx("g",{transform:`translate(${f.left},${f.top})`,children:Z.map(e=>{const s=R(e),ce=ie(e),n=d?d(e.size||0):u,V=n>20&&(l||H);return t.jsxRuntimeExports.jsxs("g",{className:"undp-viz-g-with-hover",opacity:ce,transform:`translate(${e.x},${e.y})`,onMouseEnter:q=>F(q,e),onMouseMove:q=>oe(q,e),onClick:()=>ne(e),onMouseLeave:ae,children:[t.jsxRuntimeExports.jsx("circle",{cx:0,cy:0,r:n,fill:s}),(V||H)&&e.size!==void 0&&e.size!==null&&t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("foreignObject",{y:0-n,x:0-n,width:2*n,height:2*n,children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col justify-center items-center h-full py-0 px-3",children:[l&&t.jsxRuntimeExports.jsx("p",{className:t.mo("text-center leading-[1.25] overflow-hidden m-0 circle-packing-label",T?.graphObjectValues),style:{fontSize:`${Math.min(Math.max(Math.round(n/4),12),Math.max(Math.round(n*12/`${e.label}`.length),12),14)}px`,WebkitLineClamp:n*2<60?1:n*2<75?2:n*2<100?3:void 0,display:"-webkit-box",WebkitBoxOrient:"vertical",color:he.getTextColorBasedOnBgColor(s),hyphens:"auto",...J?.graphObjectValues||{}},children:e.label}),H&&t.jsxRuntimeExports.jsx("p",{className:"text-center font-bold leading-[1.25] w-full m-0 circle-packing-value",style:{fontSize:`${Math.min(Math.max(Math.round(n/4),14),14)}px`,color:he.getTextColorBasedOnBgColor(s)},children:je.numberFormattingFunction(e.size,"NA",re,C,_)})]})})})]},e.label)})})}),G&&B&&K&&Q&&t.jsxRuntimeExports.jsx(ve.Tooltip,{data:G,body:B,xPos:K,yPos:Q,backgroundStyle:J?.tooltip,className:T?.tooltip}),v&&p!==void 0?t.jsxRuntimeExports.jsx(me.G,{open:p!==void 0,onClose:()=>{E(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof v=="string"?{__html:ye.string2HTML(v,p)}:void 0,children:typeof v=="function"?v(p):null})}):null]}):null:t.jsxRuntimeExports.jsx("div",{style:{width:`${a}px`,height:`${c}px`},children:t.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:t.jsxRuntimeExports.jsx(pe.y,{})})})});xe.displayName="BubbleChart";function Re(M){const{data:o,graphTitle:r,colors:x,suffix:a="",sources:c,prefix:k="",graphDescription:y,leftMargin:X=0,rightMargin:Y=0,height:b,width:l,footNote:B,colorDomain:w,colorLegendTitle:H,padding:_,backgroundColor:C=!1,topMargin:L=0,bottomMargin:O=0,showLabels:S=!0,relativeHeight:u,tooltip:A,onSeriesMouseOver:v,showColorScale:J=!0,showValues:T,graphID:N,highlightedDataPoints:re=[],onSeriesMouseClick:le,graphDownload:G=!1,dataDownload:z=!1,language:p="en",showNAColor:E,minHeight:h=0,theme:D="light",ariaLabel:K,radius:$,maxRadiusValue:Q,resetSelectionOnDoubleClick:P=!0,detailsOnClick:Z,styles:j,classNames:f,dimmedOpacity:ee=.3,precision:te=2}=M,[g,d]=i.useState(0),[F,oe]=i.useState(0),[ne,ae]=i.useState(void 0),R=i.useRef(null),ie=i.useRef(null);return i.useEffect(()=>{const e=new ResizeObserver(s=>{d(l||s[0].target.clientWidth||620),oe(b||s[0].target.clientHeight||480)});return R.current&&(oe(R.current.clientHeight||480),d(R.current.clientWidth||620),l||e.observe(R.current)),()=>e.disconnect()},[l,b]),t.jsxRuntimeExports.jsx("div",{className:`${D||"light"} flex ${l?"w-fit grow-0":"w-full grow"}`,dir:p==="he"||p==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${C?C===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${p||"en"}`,l?"w-fit":"w-full",f?.graphContainer),style:{...j?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:N,ref:ie,"aria-label":K||`${r?`The graph shows ${r}. `:""}This is a chart where data points are represented by circles, and their sizes reflect their values.${y?` ${y}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?_||"1rem":_||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[r||y||G||z?t.jsxRuntimeExports.jsx(Me.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:f?.title,description:f?.description},graphTitle:r,graphDescription:y,width:l,graphDownload:G?ie.current:void 0,dataDownload:z?o.map(e=>e.data).filter(e=>e!==void 0).length>0?o.map(e=>e.data).filter(e=>e!==void 0):o.filter(e=>e!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:o.length===0?t.jsxRuntimeExports.jsx(Ee.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[J&&o.filter(e=>e.color).length!==0?t.jsxRuntimeExports.jsx(we.ColorLegendWithMouseOver,{width:l,colorLegendTitle:H,colors:x||se.Colors[D].categoricalColors.colors,colorDomain:w||de.uniqBy(o,"color",!0),setSelectedColor:ae,showNAColor:E??!0,isCenter:!0}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center w-full leading-0",ref:R,"aria-label":"Graph area",children:(l||g)&&(b||F)?t.jsxRuntimeExports.jsx(xe,{data:o,colors:o.filter(e=>e.color).length===0?x?[x]:[se.Colors.primaryColors["blue-600"]]:x||se.Colors[D].categoricalColors.colors,colorDomain:o.filter(e=>e.color).length===0?[]:w||de.uniqBy(o,"color",!0),width:l||g,height:Math.max(h,b||(u?h?(l||g)*u>h?(l||g)*u:h:(l||g)*u:F)),leftMargin:X,rightMargin:Y,topMargin:L,bottomMargin:O,showLabels:S,showValues:T!==!1?o.filter(e=>e.size).length!==0:T,selectedColor:ne,suffix:a,prefix:k,tooltip:A,onSeriesMouseOver:v,highlightedDataPoints:re,onSeriesMouseClick:le,theme:D,radius:$||Math.min(l||g,b||(u?h?(l||g)*u>h?(l||g)*u:h:(l||g)*u:F))*(o.filter(e=>!U.checkIfNullOrUndefined(e.size)).length===0?1:Math.max(...o.map(e=>e.size).filter(e=>e!=null)))/(o.filter(e=>!U.checkIfNullOrUndefined(e.size)).length===0?o.length:fe.sum(o.filter(e=>e.size).map(e=>e.size))*1.25),maxRadiusValue:Q,resetSelectionOnDoubleClick:P,detailsOnClick:Z,styles:j,classNames:f,dimmedOpacity:ee,precision:te}):null})]})}),c||B?t.jsxRuntimeExports.jsx(Ce.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:f?.footnote,source:f?.source},sources:c,footNote:B,width:l}):null]})})})})}exports.CirclePackingGraph=Re;exports.extent=I;
|
|
2
|
+
//# sourceMappingURL=index-CEJwW3lL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-CVlCtJbC.cjs","sources":["../node_modules/d3-array/src/extent.js","../src/Components/Graphs/CirclePackingGraph/Graph.tsx","../src/Components/Graphs/CirclePackingGraph/index.tsx"],"sourcesContent":["export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","import { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react';\r\nimport { forceCollide, forceManyBody, forceSimulation, forceX, forceY } from 'd3-force';\r\nimport orderBy from 'lodash.orderby';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { extent } from 'd3-array';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { ClassNameObject, StyleObject, TreeMapDataType } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n data: TreeMapDataType[];\r\n colors: string[];\r\n colorDomain: string[];\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n showLabels: boolean;\r\n showValues: boolean;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n theme: 'light' | 'dark';\r\n maxRadiusValue?: number;\r\n radius: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n dimmedOpacity: number;\r\n precision: number;\r\n}\r\n\r\ninterface TreeMapDataTypeForBubbleChart extends TreeMapDataType {\r\n x: number;\r\n y: number;\r\n vx: number;\r\n vy: number;\r\n}\r\n\r\nexport const Graph = memo((props: Props) => {\r\n const {\r\n data,\r\n colors,\r\n leftMargin,\r\n width,\r\n height,\r\n colorDomain,\r\n selectedColor,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showValues,\r\n suffix,\r\n prefix,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n maxRadiusValue,\r\n radius,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [viewPortDimensions, setViewPortDimensions] = useState<\r\n [number, number, number, number] | undefined\r\n >(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const [finalData, setFinalData] = useState<TreeMapDataTypeForBubbleChart[] | null>(null);\r\n\r\n // Memoize expensive calculations\r\n const margin = useMemo(\r\n () => ({\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n }),\r\n [topMargin, bottomMargin, leftMargin, rightMargin],\r\n );\r\n\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n // Memoize data ordering and radius scale\r\n const dataOrdered = useMemo(\r\n () =>\r\n data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data\r\n : orderBy(\r\n data.filter(d => !checkIfNullOrUndefined(d.size)),\r\n 'radius',\r\n 'asc',\r\n ),\r\n [data],\r\n );\r\n\r\n const radiusScale = useMemo(() => {\r\n return data.filter(d => d.size === undefined || d.size === null).length !== data.length\r\n ? scaleSqrt()\r\n .domain([\r\n 0,\r\n checkIfNullOrUndefined(maxRadiusValue)\r\n ? Math.max(...data.map(d => d.size).filter(d => d !== undefined && d !== null))\r\n : (maxRadiusValue as number),\r\n ])\r\n .range([0.25, radius])\r\n .nice()\r\n : undefined;\r\n }, [data, maxRadiusValue, radius]);\r\n\r\n // Memoize simulation setup\r\n useEffect(() => {\r\n const setupSimulation = () => {\r\n const dataTemp = [...dataOrdered];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const simulation = forceSimulation(dataTemp as any)\r\n .force('y', forceY(_d => graphHeight / 2).strength(1))\r\n .force('x', forceX(_d => graphWidth / 2).strength(1))\r\n .force(\r\n 'collide',\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n forceCollide((d: any) => (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1)),\r\n )\r\n .force('charge', forceManyBody().strength(-15))\r\n .alphaDecay(0.05)\r\n .tick(10000);\r\n\r\n simulation\r\n .on('tick', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n })\r\n .on('end', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n const xMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const yMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const xMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n const yMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n setViewPortDimensions([\r\n xMinExtent,\r\n yMinExtent,\r\n xMinExtent < 0 ? xMaxExtent - xMinExtent : xMaxExtent,\r\n yMinExtent < 0 ? yMaxExtent - yMinExtent : yMaxExtent,\r\n ]);\r\n });\r\n };\r\n\r\n setupSimulation();\r\n }, [data, radius, graphHeight, graphWidth, maxRadiusValue, dataOrdered, radiusScale]);\r\n\r\n // Memoize event handlers to prevent unnecessary re-renders\r\n const handleMouseEnter = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n },\r\n [onSeriesMouseOver],\r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const handleMouseMove = useCallback((event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }, []);\r\n\r\n const handleClick = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (mouseClickData === d.label && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.label);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n },\r\n [onSeriesMouseClick, detailsOnClick, mouseClickData, resetSelectionOnDoubleClick],\r\n );\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }, [onSeriesMouseOver]);\r\n\r\n // Memoize color and opacity calculations\r\n const getCircleColor = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n [data, colors, colorDomain],\r\n );\r\n\r\n const getOpacity = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.85\r\n : dimmedOpacity\r\n : 0.85,\r\n [selectedColor, dimmedOpacity, colors, colorDomain, highlightedDataPoints],\r\n );\r\n\r\n // Render loading state\r\n if (!finalData) {\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px` }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n }\r\n if (viewPortDimensions) {\r\n return (\r\n <>\r\n <svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`${viewPortDimensions[0] > 0 ? 0 : viewPortDimensions[0]} ${\r\n viewPortDimensions[1] > 0 ? 0 : viewPortDimensions[1]\r\n } ${width < viewPortDimensions[2] ? viewPortDimensions[2] : width} ${\r\n height < viewPortDimensions[3] ? viewPortDimensions[3] : height\r\n }`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {finalData.map(d => {\r\n const circleColor = getCircleColor(d);\r\n const opacity = getOpacity(d);\r\n const bubbleRadius = radiusScale ? radiusScale(d.size || 0) : radius;\r\n const showLabel = bubbleRadius > 20 && (showLabels || showValues);\r\n return (\r\n <g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={opacity}\r\n transform={`translate(${d.x},${d.y})`}\r\n onMouseEnter={event => handleMouseEnter(event, d)}\r\n onMouseMove={event => handleMouseMove(event, d)}\r\n onClick={() => handleClick(d)}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n <circle cx={0} cy={0} r={bubbleRadius} fill={circleColor} />\r\n {(showLabel || showValues) && d.size !== undefined && d.size !== null && (\r\n <g>\r\n <foreignObject\r\n y={0 - bubbleRadius}\r\n x={0 - bubbleRadius}\r\n width={2 * bubbleRadius}\r\n height={2 * bubbleRadius}\r\n >\r\n <div className='flex flex-col justify-center items-center h-full py-0 px-3'>\r\n {showLabels && (\r\n <p\r\n className={cn(\r\n 'text-center leading-[1.25] overflow-hidden m-0 circle-packing-label',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 12),\r\n Math.max(\r\n Math.round((bubbleRadius * 12) / `${d.label}`.length),\r\n 12,\r\n ),\r\n 14,\r\n )}px`,\r\n WebkitLineClamp:\r\n bubbleRadius * 2 < 60\r\n ? 1\r\n : bubbleRadius * 2 < 75\r\n ? 2\r\n : bubbleRadius * 2 < 100\r\n ? 3\r\n : undefined,\r\n display: '-webkit-box',\r\n WebkitBoxOrient: 'vertical',\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n hyphens: 'auto',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {d.label}\r\n </p>\r\n )}\r\n {showValues && (\r\n <p\r\n className='text-center font-bold leading-[1.25] w-full m-0 circle-packing-value'\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 14),\r\n 14,\r\n )}px`,\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n }}\r\n >\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </p>\r\n )}\r\n </div>\r\n </foreignObject>\r\n </g>\r\n )}\r\n </g>\r\n );\r\n })}\r\n </g>\r\n </svg>\r\n {mouseOverData && tooltip && eventX && eventY && (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n )}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n }\r\n return null;\r\n});\r\n\r\nGraph.displayName = 'BubbleChart';\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { Languages, SourcesDataType, StyleObject, ClassNameObject, TreeMapDataType } from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: TreeMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function CirclePackingGraph(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n leftMargin = 0,\r\n rightMargin = 0,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 0,\r\n bottomMargin = 0,\r\n showLabels = true,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n showValues,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n language = 'en',\r\n showNAColor,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n radius,\r\n maxRadiusValue,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a chart where data points are represented by circles, and their sizes reflect their values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n isCenter\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n showLabels={showLabels}\r\n showValues={\r\n showValues !== false\r\n ? data.filter(el => el.size).length !== 0\r\n : (showValues as boolean)\r\n }\r\n selectedColor={selectedColor}\r\n suffix={suffix}\r\n prefix={prefix}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n theme={theme}\r\n radius={\r\n !radius\r\n ? (Math.min(\r\n width || svgWidth,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ) *\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? 1\r\n : Math.max(\r\n ...data\r\n .map(d => d.size)\r\n .filter(d => d !== undefined && d !== null),\r\n ))) /\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data.length\r\n : sum(data.filter(d => d.size).map(d => d.size)) * 1.25)\r\n : radius\r\n }\r\n maxRadiusValue={maxRadiusValue}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["extent","values","valueof","min","max","value","index","Graph","memo","props","data","colors","leftMargin","width","height","colorDomain","selectedColor","rightMargin","topMargin","bottomMargin","showLabels","tooltip","onSeriesMouseOver","showValues","suffix","prefix","highlightedDataPoints","onSeriesMouseClick","maxRadiusValue","radius","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","dimmedOpacity","precision","svgRef","useRef","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","viewPortDimensions","setViewPortDimensions","eventX","setEventX","eventY","setEventY","finalData","setFinalData","margin","useMemo","graphWidth","graphHeight","dataOrdered","d","checkIfNullOrUndefined","orderBy","radiusScale","scaleSqrt","useEffect","dataTemp","forceSimulation","forceY","_d","forceX","forceCollide","forceManyBody","xMinExtent","yMinExtent","xMaxExtent","yMaxExtent","handleMouseEnter","useCallback","event","handleMouseMove","handleClick","handleMouseLeave","getCircleColor","el","Colors","getOpacity","jsxs","Fragment","jsx","circleColor","opacity","bubbleRadius","showLabel","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","Spinner","CirclePackingGraph","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","sum","GraphFooter"],"mappings":"iuBAAe,SAASA,EAAOC,EAAQC,EAAS,CAC9C,IAAIC,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YAAA,CACC,OAAQ,CAAE,SAAUhG,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAAiE,EACA,SAAAE,EACA,MAAAvF,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index-CEJwW3lL.cjs","sources":["../node_modules/d3-array/src/extent.js","../src/Components/Graphs/CirclePackingGraph/Graph.tsx","../src/Components/Graphs/CirclePackingGraph/index.tsx"],"sourcesContent":["export default function extent(values, valueof) {\n let min;\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null) {\n if (min === undefined) {\n if (value >= value) min = max = value;\n } else {\n if (min > value) min = value;\n if (max < value) max = value;\n }\n }\n }\n }\n return [min, max];\n}\n","import { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react';\r\nimport { forceCollide, forceManyBody, forceSimulation, forceX, forceY } from 'd3-force';\r\nimport orderBy from 'lodash.orderby';\r\nimport { scaleSqrt } from 'd3-scale';\r\nimport { extent } from 'd3-array';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\n\r\nimport { ClassNameObject, StyleObject, TreeMapDataType } from '@/Types';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { getTextColorBasedOnBgColor } from '@/Utils/getTextColorBasedOnBgColor';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\n\r\ninterface Props {\r\n data: TreeMapDataType[];\r\n colors: string[];\r\n colorDomain: string[];\r\n leftMargin: number;\r\n rightMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n showLabels: boolean;\r\n showValues: boolean;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n selectedColor?: string;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n highlightedDataPoints: (string | number)[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n theme: 'light' | 'dark';\r\n maxRadiusValue?: number;\r\n radius: number;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n dimmedOpacity: number;\r\n precision: number;\r\n}\r\n\r\ninterface TreeMapDataTypeForBubbleChart extends TreeMapDataType {\r\n x: number;\r\n y: number;\r\n vx: number;\r\n vy: number;\r\n}\r\n\r\nexport const Graph = memo((props: Props) => {\r\n const {\r\n data,\r\n colors,\r\n leftMargin,\r\n width,\r\n height,\r\n colorDomain,\r\n selectedColor,\r\n rightMargin,\r\n topMargin,\r\n bottomMargin,\r\n showLabels,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showValues,\r\n suffix,\r\n prefix,\r\n highlightedDataPoints,\r\n onSeriesMouseClick,\r\n maxRadiusValue,\r\n radius,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity,\r\n precision,\r\n } = props;\r\n const svgRef = useRef(null);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [viewPortDimensions, setViewPortDimensions] = useState<\r\n [number, number, number, number] | undefined\r\n >(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const [finalData, setFinalData] = useState<TreeMapDataTypeForBubbleChart[] | null>(null);\r\n\r\n // Memoize expensive calculations\r\n const margin = useMemo(\r\n () => ({\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n }),\r\n [topMargin, bottomMargin, leftMargin, rightMargin],\r\n );\r\n\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n // Memoize data ordering and radius scale\r\n const dataOrdered = useMemo(\r\n () =>\r\n data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data\r\n : orderBy(\r\n data.filter(d => !checkIfNullOrUndefined(d.size)),\r\n 'radius',\r\n 'asc',\r\n ),\r\n [data],\r\n );\r\n\r\n const radiusScale = useMemo(() => {\r\n return data.filter(d => d.size === undefined || d.size === null).length !== data.length\r\n ? scaleSqrt()\r\n .domain([\r\n 0,\r\n checkIfNullOrUndefined(maxRadiusValue)\r\n ? Math.max(...data.map(d => d.size).filter(d => d !== undefined && d !== null))\r\n : (maxRadiusValue as number),\r\n ])\r\n .range([0.25, radius])\r\n .nice()\r\n : undefined;\r\n }, [data, maxRadiusValue, radius]);\r\n\r\n // Memoize simulation setup\r\n useEffect(() => {\r\n const setupSimulation = () => {\r\n const dataTemp = [...dataOrdered];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const simulation = forceSimulation(dataTemp as any)\r\n .force('y', forceY(_d => graphHeight / 2).strength(1))\r\n .force('x', forceX(_d => graphWidth / 2).strength(1))\r\n .force(\r\n 'collide',\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n forceCollide((d: any) => (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1)),\r\n )\r\n .force('charge', forceManyBody().strength(-15))\r\n .alphaDecay(0.05)\r\n .tick(10000);\r\n\r\n simulation\r\n .on('tick', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n })\r\n .on('end', () => {\r\n setFinalData(dataTemp as TreeMapDataTypeForBubbleChart[]);\r\n const xMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const yMinExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y - (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[0] || 0;\r\n const xMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.x + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n const yMaxExtent =\r\n extent(\r\n dataTemp as TreeMapDataTypeForBubbleChart[],\r\n d => d.y + (radiusScale ? radiusScale(d.size || 0) + 1 : radius + 1),\r\n )[1] || 0;\r\n setViewPortDimensions([\r\n xMinExtent,\r\n yMinExtent,\r\n xMinExtent < 0 ? xMaxExtent - xMinExtent : xMaxExtent,\r\n yMinExtent < 0 ? yMaxExtent - yMinExtent : yMaxExtent,\r\n ]);\r\n });\r\n };\r\n\r\n setupSimulation();\r\n }, [data, radius, graphHeight, graphWidth, maxRadiusValue, dataOrdered, radiusScale]);\r\n\r\n // Memoize event handlers to prevent unnecessary re-renders\r\n const handleMouseEnter = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n },\r\n [onSeriesMouseOver],\r\n );\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const handleMouseMove = useCallback((event: any, d: any) => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }, []);\r\n\r\n const handleClick = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (mouseClickData === d.label && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d.label);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n },\r\n [onSeriesMouseClick, detailsOnClick, mouseClickData, resetSelectionOnDoubleClick],\r\n );\r\n\r\n const handleMouseLeave = useCallback(() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }, [onSeriesMouseOver]);\r\n\r\n // Memoize color and opacity calculations\r\n const getCircleColor = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n data.filter(el => el.color).length === 0\r\n ? colors[0]\r\n : !d.color\r\n ? Colors.gray\r\n : colors[colorDomain.indexOf(d.color)],\r\n [data, colors, colorDomain],\r\n );\r\n\r\n const getOpacity = useCallback(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: any) =>\r\n selectedColor\r\n ? d.color\r\n ? colors[colorDomain.indexOf(d.color)] === selectedColor\r\n ? 1\r\n : dimmedOpacity\r\n : dimmedOpacity\r\n : highlightedDataPoints.length !== 0\r\n ? highlightedDataPoints.indexOf(d.label) !== -1\r\n ? 0.85\r\n : dimmedOpacity\r\n : 0.85,\r\n [selectedColor, dimmedOpacity, colors, colorDomain, highlightedDataPoints],\r\n );\r\n\r\n // Render loading state\r\n if (!finalData) {\r\n return (\r\n <div style={{ width: `${width}px`, height: `${height}px` }}>\r\n <div className='flex m-auto items-center justify-center p-0 leading-none text-base h-40'>\r\n <Spinner />\r\n </div>\r\n </div>\r\n );\r\n }\r\n if (viewPortDimensions) {\r\n return (\r\n <>\r\n <svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`${viewPortDimensions[0] > 0 ? 0 : viewPortDimensions[0]} ${\r\n viewPortDimensions[1] > 0 ? 0 : viewPortDimensions[1]\r\n } ${width < viewPortDimensions[2] ? viewPortDimensions[2] : width} ${\r\n height < viewPortDimensions[3] ? viewPortDimensions[3] : height\r\n }`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {finalData.map(d => {\r\n const circleColor = getCircleColor(d);\r\n const opacity = getOpacity(d);\r\n const bubbleRadius = radiusScale ? radiusScale(d.size || 0) : radius;\r\n const showLabel = bubbleRadius > 20 && (showLabels || showValues);\r\n return (\r\n <g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={opacity}\r\n transform={`translate(${d.x},${d.y})`}\r\n onMouseEnter={event => handleMouseEnter(event, d)}\r\n onMouseMove={event => handleMouseMove(event, d)}\r\n onClick={() => handleClick(d)}\r\n onMouseLeave={handleMouseLeave}\r\n >\r\n <circle cx={0} cy={0} r={bubbleRadius} fill={circleColor} />\r\n {(showLabel || showValues) && d.size !== undefined && d.size !== null && (\r\n <g>\r\n <foreignObject\r\n y={0 - bubbleRadius}\r\n x={0 - bubbleRadius}\r\n width={2 * bubbleRadius}\r\n height={2 * bubbleRadius}\r\n >\r\n <div className='flex flex-col justify-center items-center h-full py-0 px-3'>\r\n {showLabels && (\r\n <p\r\n className={cn(\r\n 'text-center leading-[1.25] overflow-hidden m-0 circle-packing-label',\r\n classNames?.graphObjectValues,\r\n )}\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 12),\r\n Math.max(\r\n Math.round((bubbleRadius * 12) / `${d.label}`.length),\r\n 12,\r\n ),\r\n 14,\r\n )}px`,\r\n WebkitLineClamp:\r\n bubbleRadius * 2 < 60\r\n ? 1\r\n : bubbleRadius * 2 < 75\r\n ? 2\r\n : bubbleRadius * 2 < 100\r\n ? 3\r\n : undefined,\r\n display: '-webkit-box',\r\n WebkitBoxOrient: 'vertical',\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n hyphens: 'auto',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n >\r\n {d.label}\r\n </p>\r\n )}\r\n {showValues && (\r\n <p\r\n className='text-center font-bold leading-[1.25] w-full m-0 circle-packing-value'\r\n style={{\r\n fontSize: `${Math.min(\r\n Math.max(Math.round(bubbleRadius / 4), 14),\r\n 14,\r\n )}px`,\r\n color: getTextColorBasedOnBgColor(circleColor),\r\n }}\r\n >\r\n {numberFormattingFunction(d.size, 'NA', precision, prefix, suffix)}\r\n </p>\r\n )}\r\n </div>\r\n </foreignObject>\r\n </g>\r\n )}\r\n </g>\r\n );\r\n })}\r\n </g>\r\n </svg>\r\n {mouseOverData && tooltip && eventX && eventY && (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n )}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n }\r\n return null;\r\n});\r\n\r\nGraph.displayName = 'BubbleChart';\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport sum from 'lodash.sum';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { Languages, SourcesDataType, StyleObject, ClassNameObject, TreeMapDataType } from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegendWithMouseOver } from '@/Components/Elements/ColorLegendWithMouseOver';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { uniqBy } from '@/Utils/uniqBy';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: TreeMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color or array of colors for circle */\r\n colors?: string | string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value mapped to the radius chart */\r\n maxRadiusValue?: number;\r\n\r\n // Graph Parameters\r\n /** Maximum radius of the circle */\r\n radius?: number;\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */\r\n showNAColor?: boolean;\r\n /** Data points to highlight. Use the label value from data to highlight the data point */\r\n highlightedDataPoints?: (string | number)[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function CirclePackingGraph(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n colors,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n leftMargin = 0,\r\n rightMargin = 0,\r\n height,\r\n width,\r\n footNote,\r\n colorDomain,\r\n colorLegendTitle,\r\n padding,\r\n backgroundColor = false,\r\n topMargin = 0,\r\n bottomMargin = 0,\r\n showLabels = true,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n showColorScale = true,\r\n showValues,\r\n graphID,\r\n highlightedDataPoints = [],\r\n onSeriesMouseClick,\r\n graphDownload = false,\r\n dataDownload = false,\r\n language = 'en',\r\n showNAColor,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n radius,\r\n maxRadiusValue,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n dimmedOpacity = 0.3,\r\n precision = 2,\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a chart where data points are represented by circles, and their sizes reflect their values.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale && data.filter(el => el.color).length !== 0 ? (\r\n <ColorLegendWithMouseOver\r\n width={width}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={\r\n (colors as string[] | undefined) || Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={colorDomain || (uniqBy(data, 'color', true) as string[])}\r\n setSelectedColor={setSelectedColor}\r\n showNAColor={\r\n showNAColor === undefined || showNAColor === null ? true : showNAColor\r\n }\r\n isCenter\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center w-full leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n colors={\r\n data.filter(el => el.color).length === 0\r\n ? colors\r\n ? [colors as string]\r\n : [Colors.primaryColors['blue-600']]\r\n : (colors as string[] | undefined) ||\r\n Colors[theme].categoricalColors.colors\r\n }\r\n colorDomain={\r\n data.filter(el => el.color).length === 0\r\n ? []\r\n : colorDomain || (uniqBy(data, 'color', true) as string[])\r\n }\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n showLabels={showLabels}\r\n showValues={\r\n showValues !== false\r\n ? data.filter(el => el.size).length !== 0\r\n : (showValues as boolean)\r\n }\r\n selectedColor={selectedColor}\r\n suffix={suffix}\r\n prefix={prefix}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n highlightedDataPoints={highlightedDataPoints}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n theme={theme}\r\n radius={\r\n !radius\r\n ? (Math.min(\r\n width || svgWidth,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n ) *\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? 1\r\n : Math.max(\r\n ...data\r\n .map(d => d.size)\r\n .filter(d => d !== undefined && d !== null),\r\n ))) /\r\n (data.filter(d => !checkIfNullOrUndefined(d.size)).length === 0\r\n ? data.length\r\n : sum(data.filter(d => d.size).map(d => d.size)) * 1.25)\r\n : radius\r\n }\r\n maxRadiusValue={maxRadiusValue}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n dimmedOpacity={dimmedOpacity}\r\n precision={precision}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["extent","values","valueof","min","max","value","index","Graph","memo","props","data","colors","leftMargin","width","height","colorDomain","selectedColor","rightMargin","topMargin","bottomMargin","showLabels","tooltip","onSeriesMouseOver","showValues","suffix","prefix","highlightedDataPoints","onSeriesMouseClick","maxRadiusValue","radius","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","dimmedOpacity","precision","svgRef","useRef","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","viewPortDimensions","setViewPortDimensions","eventX","setEventX","eventY","setEventY","finalData","setFinalData","margin","useMemo","graphWidth","graphHeight","dataOrdered","d","checkIfNullOrUndefined","orderBy","radiusScale","scaleSqrt","useEffect","dataTemp","forceSimulation","forceY","_d","forceX","forceCollide","forceManyBody","xMinExtent","yMinExtent","xMaxExtent","yMaxExtent","handleMouseEnter","useCallback","event","handleMouseMove","handleClick","handleMouseLeave","getCircleColor","el","Colors","getOpacity","jsxs","Fragment","jsx","circleColor","opacity","bubbleRadius","showLabel","cn","getTextColorBasedOnBgColor","Tooltip","Modal","string2HTML","Spinner","CirclePackingGraph","graphTitle","sources","graphDescription","footNote","colorLegendTitle","padding","backgroundColor","relativeHeight","showColorScale","graphID","graphDownload","dataDownload","language","showNAColor","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","setSelectedColor","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegendWithMouseOver","uniqBy","sum","GraphFooter"],"mappings":"iuBAAe,SAASA,EAAOC,EAAQC,EAAS,CAC9C,IAAIC,EACAC,EACJ,GAAIF,IAAY,OACd,UAAWG,KAASJ,EACdI,GAAS,OACPF,IAAQ,OACNE,GAASA,IAAOF,EAAMC,EAAMC,IAE5BF,EAAME,IAAOF,EAAME,GACnBD,EAAMC,IAAOD,EAAMC,SAIxB,CACL,IAAIC,EAAQ,GACZ,QAASD,KAASJ,GACXI,EAAQH,EAAQG,EAAO,EAAEC,EAAOL,CAAM,IAAM,OAC3CE,IAAQ,OACNE,GAASA,IAAOF,EAAMC,EAAMC,IAE5BF,EAAME,IAAOF,EAAME,GACnBD,EAAMC,IAAOD,EAAMC,IAI/B,CACA,MAAO,CAACF,EAAKC,CAAG,CAClB,CC8BO,MAAMG,GAAQC,EAAAA,KAAMC,GAAiB,CAC1C,KAAM,CACJ,KAAAC,EACA,OAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,EACA,YAAAC,EACA,cAAAC,EACA,YAAAC,EACA,UAAAC,EACA,aAAAC,EACA,WAAAC,EACA,QAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,OAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,mBAAAC,EACA,eAAAC,EACA,OAAAC,EACA,4BAAAC,EACA,eAAAC,EACA,OAAAC,EACA,WAAAC,EACA,cAAAC,EACA,UAAAC,EAAA,EACE1B,EACE2B,GAASC,EAAAA,OAAO,IAAI,EAGpB,CAACC,EAAeC,CAAgB,EAAIC,EAAAA,SAAc,MAAS,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