@undp/data-viz 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +16 -16
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +45 -45
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +12 -12
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +9 -9
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +50 -50
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +12 -12
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +12 -12
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +12 -12
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +26 -26
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +7 -7
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
- package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
- package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
- package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +17 -17
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +13 -13
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +26 -26
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +29 -29
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +5 -5
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
package/dist/DataTable.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-DjM48pIC.cjs"),H=require("./index-DQA8q5sC.cjs"),l=require("react"),U=require("./index-D72cOtq7.cjs"),y=require("./Typography-BDULiwlF.cjs"),Z=require("./index-CQ3e6Ewi.cjs"),R=require("./numberFormattingFunction-02t-wJta.cjs"),_=require("./GraphFooter.cjs"),tt=require("./GraphHeader.cjs"),j=require("./index-C0bpbS4F.cjs"),S=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs"),M=v=>v.map(c=>c||1).reduce((c,b)=>c+b,0);function rt(v){const{width:p,height:N,graphTitle:c,sources:b,graphDescription:C,footNote:B,graphID:V,data:d,columnData:n,onSeriesMouseClick:I,language:k="en",theme:X="light",ariaLabel:L,backgroundColor:u=!1,padding:F,resetSelectionOnDoubleClick:Y=!0,styles:m,classNames:x,minWidth:D,naLabel:w="NA",precision:E=2}=v,[g,T]=l.useState(void 0),[q,z]=l.useState(void 0),[h,W]=l.useState("asc"),[f,G]=l.useState(void 0),[J,K]=l.useState({}),[a,P]=l.useState(n.filter(r=>r.filterOptions&&r.filterOptions.length>0).map(r=>({id:r.columnId,option:r.filterOptions}))),[Q,A]=l.useState(d);return l.useEffect(()=>{const r=[];d.forEach(s=>{let t=!0;a.forEach(e=>{if(typeof s[e.id]!="object"&&typeof s[e.id]!="function"&&typeof s[e.id]!="symbol")if(n[n.findIndex(i=>i.columnId===e.id)].separator){const i=s[e.id].split(n[n.findIndex($=>$.columnId===e.id)].separator);U.intersection(i,e.option).length===0&&(t=!1)}else e.option.indexOf(s[e.id])===-1&&(t=!1)}),t&&r.push(s)}),A(g&&d?Z.orderBy(r,[g],[h]):r)},[g,h,d,a,n]),o.jsxRuntimeExports.jsx("div",{className:`${X||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:k==="he"||k==="ar"?"rtl":void 0,children:o.jsxRuntimeExports.jsx("div",{className:o.mo(`${u?u===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${k||"en"} w-full`,p?"w-fit":"w-full",x?.graphContainer),style:{...m?.graphContainer||{},...u&&u!==!0?{backgroundColor:u}:{}},id:V,"aria-label":L||`${c?`The graph shows ${c}. `:""}This is an data table. ${C?` ${C}`:""}`,children:o.jsxRuntimeExports.jsxs("div",{className:"flex grow",style:{padding:u?F||"1rem":F||0},children:[o.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3 w-full justify-between grow",children:[c||C?o.jsxRuntimeExports.jsx(tt.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:x?.title,description:x?.description},graphTitle:c,graphDescription:C,width:p}):null,o.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center",children:o.jsxRuntimeExports.jsx("div",{className:"undp-scrollbar",style:{width:p?`${p}px`:"100%",height:N?`${N}px`:"auto"},children:o.jsxRuntimeExports.jsx("div",{style:D?{minWidth:D}:void 0,children:d?o.jsxRuntimeExports.jsxs("table",{className:"w-full",style:{borderCollapse:"collapse"},children:[o.jsxRuntimeExports.jsx("thead",{className:"text-left bg-primary-gray-300 dark:bg-primary-gray-550",children:o.jsxRuntimeExports.jsx("tr",{children:n?.map((r,s)=>o.jsxRuntimeExports.jsx("th",{className:"text-primary-gray-700 dark:text-primary-gray-100 text-sm",style:{width:`calc(${100*(r.columnWidth||1)/M(n.map(t=>t.columnWidth||1))}%`},children:o.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 justify-between items-center p-4",children:[o.jsxRuntimeExports.jsx(y.u,{size:"sm",marginBottom:"none",className:`w-fit grow text-${r.align||"left"} font-bold`,children:r.columnTitle||r.columnId}),r.sortable?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer p-0 m-0 border-0",onClick:()=>{g===r.columnId?(h==="asc"&&W("desc"),h==="desc"&&T(void 0)):(T(r.columnId),W("asc"))},children:g===r.columnId?h==="asc"?o.jsxRuntimeExports.jsx(j.SortingIconAscending,{}):o.jsxRuntimeExports.jsx(j.SortingIconDescending,{}):o.jsxRuntimeExports.jsx(j.SortingIcon,{})}):null,r.filterOptions&&r.filterOptions.length?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent cursor-pointer m-0 p-0 border-0",onClick:t=>{if(f===r.columnId)G(void 0);else if(t.currentTarget){G(r.columnId);const e=t.currentTarget.getBoundingClientRect();K({top:e.bottom+window.scrollY,left:e.left+window.scrollX-160<0?e.left+window.scrollX:e.left+window.scrollX-160,width:"10rem"})}},children:a[a.findIndex(t=>t.id===r.columnId)].option.length===r.filterOptions?.length?o.jsxRuntimeExports.jsx(j.FilterIcon,{}):o.jsxRuntimeExports.jsx(j.FilterIconApplied,{})}):null]})},s))})}),o.jsxRuntimeExports.jsx("tbody",{children:Q?.map((r,s)=>o.jsxRuntimeExports.jsx("tr",{className:`cursor-${I?"pointer":"auto"} border-b border-b-primary-gray-400 dark:border-b-primary-gray-500 ${H.isEqual(q,r)?"bg-primary-gray-200 dark:bg-primary-gray-600":"bg-transparent"}`,style:r.rowStyle,onClick:()=>{I&&(H.isEqual(q,r)&&Y?(z(void 0),I(void 0)):(z(r),I(r)))},children:n.map((t,e)=>o.jsxRuntimeExports.jsx("td",{className:`text-primary-gray-700 dark:text-primary-gray-100 text-sm text-${t.align||"left"}`,style:{width:`calc(${100*(r.columnWidth||1)/M(n.map(i=>i.columnWidth||1))}%`},children:o.jsxRuntimeExports.jsx("div",{className:`text-primary-gray-700 dark:text-primary-gray-100 flex p-4 ${t.align==="right"?"justify-end":t.align==="center"?"justify-center":"justify-start"}`,children:typeof r[t.columnId]=="number"?o.jsxRuntimeExports.jsx(y.u,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${t.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${t.align||"left"} ${t.chip?t.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...t.chip&&t.chipColors?{backgroundColor:t.chipColors[t.chipColors.findIndex(i=>i.value===r[t.chipColumnId||t.columnId])].color,color:S.getTextColorBasedOnBgColor(t.chipColors[t.chipColors.findIndex(i=>i.value===r[t.chipColumnId||t.columnId])].color)}:{}},children:R.numberFormattingFunction(r[t.columnId],w,E,t.prefix,t.suffix)}):typeof r[t.columnId]=="string"?t.separator?o.jsxRuntimeExports.jsx("div",{className:"text-primary-gray-700 dark:text-primary-gray-100 flex flex-wrap gap-2",children:r[t.columnId].split(t.separator).map((i,$)=>o.jsxRuntimeExports.jsx(y.u,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${t.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${t.align||"left"} ${t.chip?t.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...t.chip&&t.chipColors?{backgroundColor:t.chipColors[t.chipColors.findIndex(O=>O.value===(t.chipColumnId?r[t.chipColumnId]:i))].color,color:S.getTextColorBasedOnBgColor(t.chipColors[t.chipColors.findIndex(O=>O.value===(t.chipColumnId?r[t.chipColumnId]:i))].color)}:{}},children:R.numberFormattingFunction(i,w,E,t.prefix,t.suffix)},$))}):o.jsxRuntimeExports.jsx(y.u,{marginBottom:"none",size:"sm",className:`text-primary-gray-700 dark:text-primary-gray-100 w-fit ${t.chip?"grow-0 rounded-sm p-2":"grow rounded-none p-0"} text-${t.align||"left"} ${t.chip?t.chipColors?"":"bg-primary-gray-300 dark:bg-primary-gray-500":"bg-transparent"}`,style:{...t.chip&&t.chipColors?{backgroundColor:t.chipColors[t.chipColors.findIndex(i=>i.value===r[t.chipColumnId||t.columnId])].color,color:S.getTextColorBasedOnBgColor(t.chipColors[t.chipColors.findIndex(i=>i.value===r[t.chipColumnId||t.columnId])].color)}:{}},children:R.numberFormattingFunction(r[t.columnId],w,E,t.prefix,t.suffix)}):o.jsxRuntimeExports.jsx("div",{children:R.numberFormattingFunction(r[t.columnId],w,E,t.prefix,t.suffix)})})},e))},s))})]}):null})})}),b||B?o.jsxRuntimeExports.jsx(_.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:x?.footnote,source:x?.source},sources:b,footNote:B,width:p}):null]}),f&&o.jsxRuntimeExports.jsx("div",{style:J,className:"absolute p-3 border z-[1000] rounded-sm bg-primary-white dark:bg-primary-gray-700 border-primary-gray-300 dark:border-primary-gray-550",children:o.jsxRuntimeExports.jsxs("div",{className:"max-w-60",children:[o.jsxRuntimeExports.jsx(y.u,{size:"sm",marginBottom:"2xs",className:"font-bold",children:"Filter data by"}),o.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-2",children:n[n.findIndex(r=>r.columnId===f)].filterOptions?.map((r,s)=>o.jsxRuntimeExports.jsx("div",{children:o.jsxRuntimeExports.jsxs("label",{className:"undp-viz-label",children:[o.jsxRuntimeExports.jsx("input",{type:"checkbox",className:"undp-viz-checkbox",checked:a[a.findIndex(t=>t.id===f)].option.indexOf(r)!==-1,onChange:()=>{const t=a.findIndex(i=>i.id===f),e=[...a[t].option];if(e.indexOf(r)!==-1){e.splice(e.indexOf(r),1);const i=[...a];i[t].option=e,P(i)}else{e.push(r);const i=[...a];i[t].option=e,P(i)}}}),r]},s)},s))})]})})]})})})}exports.DataTable=rt;
|
|
2
2
|
//# sourceMappingURL=DataTable.cjs.map
|
package/dist/DataTable.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { j as i, m as Q } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as i, m as Q } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { i as M } from "./index-Bwrro8-q.js";
|
|
3
3
|
import { useState as p, useEffect as U } from "react";
|
|
4
4
|
import { i as Z } from "./index-V_JXij1_.js";
|
|
5
|
-
import { u as y } from "./Typography-
|
|
5
|
+
import { u as y } from "./Typography-LmZ9LEpe.js";
|
|
6
6
|
import { o as _ } from "./index-DvVprvy6.js";
|
|
7
7
|
import { n as v } from "./numberFormattingFunction-14YCbkN2.js";
|
|
8
8
|
import { GraphFooter as rr } from "./GraphFooter.js";
|
|
9
9
|
import { GraphHeader as or } from "./GraphHeader.js";
|
|
10
|
-
import { S as ir, a as tr, b as er, F as sr, c as ar } from "./index-
|
|
10
|
+
import { S as ir, a as tr, b as er, F as sr, c as ar } from "./index-zZjQEHlm.js";
|
|
11
11
|
import { g as S } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
|
|
12
12
|
const P = (N) => N.map((c) => c || 1).reduce((c, b) => c + b, 0);
|
|
13
13
|
function yr(N) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),y=require("react"),h=require("./parse-hMnG_lRV.cjs"),qt=require("./index-CQ3e6Ewi.cjs"),Et=require("./numberFormattingFunction-02t-wJta.cjs"),Tt=require("./Tooltip-De16GWhY.cjs"),T=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),bt=require("./customArea-CK768gCn.cjs"),Mt=require("./AxisTitle-CK9YeovX.cjs"),Ft=require("./Axis-DE7dSn1_.cjs"),Pt=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Gt=require("./ReferenceLine-CFVBBN__.cjs"),Ht=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Wt=require("./index-BYzIB5V6.cjs"),Yt=require("./time-Byw_jYQ7.cjs"),Xt=require("./linear-BVckp9RD.cjs"),At=require("./line-DHV4JwCR.cjs"),ht=require("./step-BZ3C8QFW.cjs"),Ct=require("./area-D3Qx7k7K.cjs"),Ut=require("./select-Bnfk0lJx.cjs"),Bt=require("./init-DU0ybBc_.cjs"),zt=require("./pointer-Dkq5NV1q.cjs"),Jt=require("./use-in-view-sQJZ_xDO.cjs"),j=require("./proxy-BHRoeZgd.cjs"),Kt=require("./GraphFooter.cjs"),Qt=require("./GraphHeader.cjs"),Zt=require("./ColorLegend.cjs"),pt=require("./Colors.cjs"),_t=require("./generateRandomString-B5zBiJzS.cjs"),te=require("./EmptyState-d8_8SxeW.cjs");function ee(dt){const{data:V,width:O,height:G,lineColors:l,suffix:D,prefix:w,dateFormat:o,showValues:c,noOfXTicks:z,rightMargin:yt,leftMargin:R,topMargin:gt,bottomMargin:J,tooltip:H,highlightAreaSettings:N,onSeriesMouseOver:W,animate:n,rtl:K,showColorLegendAtTop:ft,colorDomain:M,diffAreaColors:Q,idSuffix:E,strokeWidth:Z,showDots:_,refValues:Y,minValue:k,maxValue:X,annotations:L,customHighlightAreaSettings:F,yAxisTitle:U,noOfYTicks:tt,minDate:et,maxDate:it,curveType:P,styles:p,classNames:d,precision:S,customLayers:nt}=dt,at=y.useRef(null),r=Jt.useInView(at,{once:n.once,amount:n.amount}),[x,jt]=y.useState(!1);y.useEffect(()=>{if(r&&!x){const t=setTimeout(()=>{jt(!0)},(n.duration+.5)*1e3);return()=>clearTimeout(t)}},[r,x,n.duration]);const $=P==="linear"?At.curveLinear:P==="step"?ht.curveStep:P==="stepAfter"?ht.stepAfter:P==="stepBefore"?ht.stepBefore:ht.monotoneX,[q,st]=y.useState(void 0),[ot,rt]=y.useState(void 0),[b,A]=y.useState(void 0),g={top:gt,bottom:J,left:U?R+30:R,right:yt},lt=y.useRef(null),i=qt.orderBy(V.map(t=>({...t,date:h.parse(`${t.date}`,o,new Date)})),["date"],["asc"]),ct=N.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:h.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:h.parse(`${t.coordinates[1]}`,o,new Date)]})),xt=F.map(t=>({...t,coordinates:t.coordinates.map((v,I)=>I%2===0?h.parse(`${v}`,o,new Date):v)})),u=O-g.left-g.right,f=G-g.top-g.bottom,ut=et?h.parse(`${et}`,o,new Date):i[0].date,m=it?h.parse(`${it}`,o,new Date):i[i.length-1].date,B=Math.min(...i.map(t=>t.y1))!==1/0?Math.min(...i.map(t=>t.y1))>0?0:Math.min(...i.map(t=>t.y1)):0,Ot=Math.min(...i.map(t=>t.y2))!==1/0?Math.min(...i.map(t=>t.y2))>0?0:Math.min(...i.map(t=>t.y2)):0,Nt=Math.max(...i.map(t=>t.y1))!==1/0?Math.max(...i.map(t=>t.y1)):0,It=Math.max(...i.map(t=>t.y2))!==1/0?Math.max(...i.map(t=>t.y2)):0,C=T.checkIfNullOrUndefined(k)?B<Ot?B:Ot:k,wt=Nt>It?Nt:It,a=Yt.time().domain([ut,m]).range([0,u]),s=Xt.linear().domain([T.checkIfNullOrUndefined(k)?C:k,T.checkIfNullOrUndefined(X)?wt>0?wt:0:X]).range([f,0]).nice(),vt=At.line().x(t=>a(t.date)).y(t=>s(t.y1)).curve($),Vt=At.line().x(t=>a(t.date)).y(t=>s(t.y2)).curve($),Dt=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y1)).y0(t=>s(t.y2)).curve($),St=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y1)).y0(0).curve($),$t=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y2)).y0(0).curve($),kt=s.ticks(tt),Lt=a.ticks(z);return y.useEffect(()=>{const t=I=>{const mt=i[Bt.bisectCenter(i.map(Rt=>Rt.date),a.invert(zt.pointer(I)[0]),0)];st(mt||i[i.length-1]),W?.(mt||i[i.length-1]),A(I.clientY),rt(I.clientX)},v=()=>{st(void 0),rt(void 0),A(void 0),W?.(void 0)};Ut.select(lt.current).on("mousemove",t).on("mouseout",v)},[a,i,W]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(j.motion.svg,{width:`${O}px`,height:`${G}px`,viewBox:`0 0 ${O} ${G}`,direction:"ltr",ref:at,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${g.left},${g.top})`,children:[e.jsxRuntimeExports.jsx("clipPath",{id:`above${E}`,children:e.jsxRuntimeExports.jsx("path",{d:$t(i),style:{fill:"none"}})}),e.jsxRuntimeExports.jsx("clipPath",{id:`below${E}`,children:e.jsxRuntimeExports.jsx("path",{d:St(i),style:{fill:"none"}})}),e.jsxRuntimeExports.jsx(Wt.HighlightArea,{areaSettings:ct,width:u,height:f,scale:a,animate:n,isInView:r}),e.jsxRuntimeExports.jsx(bt.CustomArea,{areaSettings:xt,scaleX:a,scaleY:s,animate:n,isInView:r}),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Ht.YTicksAndGridLines,{values:kt.filter(t=>t!==0),y:kt.filter(t=>t!==0).map(t=>s(t)),x1:0-R,x2:u+g.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:d?.yAxis?.gridLines,labels:d?.yAxis?.labels},suffix:D,prefix:w,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:S}),e.jsxRuntimeExports.jsx(Ft.Axis,{y1:s(C<0?0:C),y2:s(C<0?0:C),x1:0-R,x2:u+g.right,label:Et.numberFormattingFunction(C<0?0:C,"NA",S,w,D),labelPos:{x:0-R,y:s(C<0?0:C),dx:0,dy:wt<0?"1rem":-5},classNames:{axis:d?.xAxis?.axis,label:d?.yAxis?.labels},styles:{axis:p?.xAxis?.axis,label:p?.yAxis?.labels}}),e.jsxRuntimeExports.jsx(Mt.AxisTitle,{x:0-R-15,y:f/2,style:p?.yAxis?.title,className:d?.yAxis?.title,text:U,rotate90:!0})]})}),e.jsxRuntimeExports.jsx(Pt.XTicksAndGridLines,{values:Lt.map(t=>h.format(t,o)),x:Lt.map(t=>a(t)),y1:0,y2:f,styles:{gridLines:p?.xAxis?.gridLines,labels:p?.xAxis?.labels},classNames:{gridLines:e.mo("opacity-0",d?.xAxis?.gridLines),labels:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",d?.xAxis?.labels)},suffix:D,prefix:w,labelType:"primary",showGridLines:!0,precision:S}),nt.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.path,{clipPath:`url(#below${E})`,d:Dt(i)||"",style:{fill:Q[1]},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:1},whileInView:{opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(j.motion.path,{clipPath:`url(#above${E})`,d:Dt(i)||"",style:{fill:Q[0]},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"})]}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.path,{d:vt(i)||"",style:{fill:"none",stroke:l[0],strokeWidth:Z},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{pathLength:0,d:vt(i)||"",opacity:1},whileInView:{pathLength:1,d:vt(i)||"",opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(j.motion.path,{style:{fill:"none",stroke:l[1],strokeWidth:Z},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{pathLength:0,d:Vt(i)||"",opacity:1},whileInView:{pathLength:1,d:Vt(i)||"",opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),ft?null:e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(i[i.length-1].date),y:s(i[i.length-1].y1),fill:l[0]},whileInView:{opacity:1,x:a(i[i.length-1].date),y:s(i[i.length-1].y1),fill:l[0],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:M[0]},M[0]),e.jsxRuntimeExports.jsx(j.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(i[i.length-1].date),y:s(i[i.length-1].y2),fill:l[1]},whileInView:{opacity:1,x:a(i[i.length-1].date),y:s(i[i.length-1].y2),fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:M[1]},M[1])]}),q?e.jsxRuntimeExports.jsx("line",{y1:0,y2:f,x1:a(q.date),x2:a(q.date),className:e.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:p?.mouseOverLine}):null,i.map((t,v)=>e.jsxRuntimeExports.jsxs(j.motion.g,{children:[T.checkIfNullOrUndefined(t.y1)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_?e.jsxRuntimeExports.jsx(j.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,cx:a(t.date),cy:s(t.y1),fill:l[0]},whileInView:{opacity:1,fill:l[0],transition:{duration:.5,delay:n.duration},cx:a(t.date),cy:s(t.y1)}},initial:"initial",animate:r?"whileInView":"initial"}):null,c?e.jsxRuntimeExports.jsx(j.motion.text,{dy:t.y2<t.y1?-8:"1em",style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:e.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(t.date),y:s(t.y1),fill:l[0]},whileInView:{opacity:1,fill:l[0],x:a(t.date),y:s(t.y1),transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:Et.numberFormattingFunction(t.y1,"NA",S,w,D)}):null]}),T.checkIfNullOrUndefined(t.y2)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_?e.jsxRuntimeExports.jsx(j.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,cx:a(t.date),cy:s(t.y2),fill:l[1]},whileInView:{opacity:1,fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration},cx:a(t.date),cy:s(t.y2)}},initial:"initial",animate:r?"whileInView":"initial"}):null,c?e.jsxRuntimeExports.jsx(j.motion.text,{dy:t.y2>t.y1?-8:"1em",style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:e.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(t.date),y:s(t.y2),fill:l[1]},whileInView:{opacity:1,x:a(t.date),y:s(t.y2),fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:Et.numberFormattingFunction(t.y2,"NA",S,w,D)}):null]})]},v))]}),Y?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Y.map((t,v)=>e.jsxRuntimeExports.jsx(Gt.RefLineY,{text:t.text,color:t.color,y:s(t.value),x1:0-R,x2:u+g.right,classNames:t.classNames,styles:t.styles,animate:n,isInView:r},v))}):null,e.jsxRuntimeExports.jsx("g",{children:L.map((t,v)=>{const I=bt.getLineEndPoint({x:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8},{x:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},T.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),mt=t.showConnector?{y1:I.y,x1:I.x,y2:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0):0+(t.yOffset||0),x2:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date)):0,circleRadius:T.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius,strokeWidth:t.showConnector===!0?2:Math.min(t.showConnector||0,1)}:void 0,Rt={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:K?0:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:K?t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):u+g.right-(t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0)),maxWidth:t.maxWidth,fontWeight:t.fontWeight,align:t.align};return e.jsxRuntimeExports.jsx(bt.Annotation,{color:t.color,connectorsSettings:mt,labelSettings:Rt,text:t.text,classNames:t.classNames,styles:t.styles,animate:n,isInView:r},v)})}),nt.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:lt,style:{fill:"none",pointerEvents:"all"},width:u,height:f})]})}),q&&H&&ot&&b?e.jsxRuntimeExports.jsx(Tt.Tooltip,{data:q,body:H,xPos:ot,yPos:b,backgroundStyle:p?.tooltip,className:d?.tooltip}):null]})}function ie(dt){const{data:V,graphTitle:O,suffix:G="",sources:l,prefix:D="",graphDescription:w,height:o,width:c,footNote:z,noOfXTicks:yt=10,dateFormat:R="yyyy",showValues:gt=!1,padding:J,lineColors:H=[pt.Colors.light.categoricalColors.colors[0],pt.Colors.light.categoricalColors.colors[1]],backgroundColor:N=!1,leftMargin:W=30,rightMargin:n=50,topMargin:K=20,bottomMargin:ft=25,tooltip:M,highlightAreaSettings:Q=[],relativeHeight:E,onSeriesMouseOver:Z,graphID:_,graphDownload:Y=!1,dataDownload:k=!1,animate:X=!1,language:L="en",minHeight:F=0,labels:U,showColorLegendAtTop:tt=!1,colorLegendTitle:et,diffAreaColors:it=[pt.Colors.alerts.red,pt.Colors.alerts.darkGreen],strokeWidth:P=2,showDots:p=!0,refValues:d=[],minValue:S,maxValue:nt,annotations:at=[],customHighlightAreaSettings:r=[],theme:x="light",ariaLabel:jt,yAxisTitle:$,noOfYTicks:q=5,minDate:st,maxDate:ot,curveType:rt="curve",styles:b,classNames:A,precision:g=2,customLayers:lt=[]}=dt,[i,ct]=y.useState(0),[xt,u]=y.useState(0),f=y.useRef(null),ut=y.useRef(null);return y.useEffect(()=>{const m=new ResizeObserver(B=>{ct(c||B[0].target.clientWidth||620),u(o||B[0].target.clientHeight||480)});return f.current&&(u(f.current.clientHeight||480),ct(f.current.clientWidth||620),c||m.observe(f.current)),()=>m.disconnect()},[c,o]),e.jsxRuntimeExports.jsx("div",{className:`${x||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:L==="he"||L==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${N?N===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${L||"en"}`,c?"w-fit":"w-full",A?.graphContainer),style:{...b?.graphContainer||{},...N&&N!==!0?{backgroundColor:N}:{}},id:_,ref:ut,"aria-label":jt||`${O?`The graph shows ${O}. `:""}This is a line chart that highlights the difference between two datasets over time.${w?` ${w}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:N?J||"1rem":J||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[O||w||Y||k?e.jsxRuntimeExports.jsx(Qt.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:A?.title,description:A?.description},graphTitle:O,graphDescription:w,width:c,graphDownload:Y?ut.current:void 0,dataDownload:k?V.map(m=>m.data).filter(m=>m!==void 0).length>0?V.map(m=>m.data).filter(m=>m!==void 0):V.filter(m=>m!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:V.length===0?e.jsxRuntimeExports.jsx(te.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[tt?e.jsxRuntimeExports.jsx(Zt.ColorLegend,{colorDomain:U,colorLegendTitle:et,colors:H,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:f,"aria-label":"Graph area",children:(c||i)&&(o||xt)?e.jsxRuntimeExports.jsx(ee,{data:V,lineColors:H,colorDomain:U,width:c||i,height:Math.max(F,o||(E?F?(c||i)*E>F?(c||i)*E:F:(c||i)*E:xt)),suffix:G,prefix:D,dateFormat:R,showValues:gt,noOfXTicks:yt,leftMargin:W,rightMargin:n,topMargin:K,bottomMargin:ft,highlightAreaSettings:Q,tooltip:M,onSeriesMouseOver:Z,showColorLegendAtTop:tt,animate:X===!0?{duration:.5,once:!0,amount:.5}:X||{duration:0,once:!0,amount:0},rtl:L==="he"||L==="ar",diffAreaColors:it,idSuffix:_t.generateRandomString(8),strokeWidth:P,showDots:p,refValues:d,minValue:S,maxValue:nt,annotations:at,customHighlightAreaSettings:r,yAxisTitle:$,noOfYTicks:q,minDate:st,maxDate:ot,curveType:rt,styles:b,classNames:A,precision:g,customLayers:lt}):null})]})}),l||z?e.jsxRuntimeExports.jsx(Kt.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:A?.footnote,source:A?.source},sources:l,footNote:z,width:c}):null]})})})})}exports.DifferenceLineChart=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),y=require("react"),h=require("./parse-hMnG_lRV.cjs"),qt=require("./index-CQ3e6Ewi.cjs"),Et=require("./numberFormattingFunction-02t-wJta.cjs"),Tt=require("./Tooltip-Cpv0QohJ.cjs"),T=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),bt=require("./customArea-1G1S78s_.cjs"),Mt=require("./AxisTitle-Wkz-xeQL.cjs"),Ft=require("./Axis-CkNn1wit.cjs"),Pt=require("./XTicksAndGridLines-RKy7BVCO.cjs"),Gt=require("./ReferenceLine-D04j-zeV.cjs"),Ht=require("./YTicksAndGridLines-qGpRo_t1.cjs"),Wt=require("./index-BHe3wsWF.cjs"),Yt=require("./time-Byw_jYQ7.cjs"),Xt=require("./linear-BVckp9RD.cjs"),At=require("./line-DHV4JwCR.cjs"),ht=require("./step-BZ3C8QFW.cjs"),Ct=require("./area-D3Qx7k7K.cjs"),Ut=require("./select-Bnfk0lJx.cjs"),Bt=require("./init-DU0ybBc_.cjs"),zt=require("./pointer-Dkq5NV1q.cjs"),Jt=require("./use-in-view-CEwlc_dd.cjs"),j=require("./proxy-CKadx4lC.cjs"),Kt=require("./GraphFooter.cjs"),Qt=require("./GraphHeader.cjs"),Zt=require("./ColorLegend.cjs"),pt=require("./Colors.cjs"),_t=require("./generateRandomString-B5zBiJzS.cjs"),te=require("./EmptyState-B8IpKGcL.cjs");function ee(dt){const{data:V,width:O,height:G,lineColors:l,suffix:D,prefix:w,dateFormat:o,showValues:c,noOfXTicks:z,rightMargin:yt,leftMargin:R,topMargin:gt,bottomMargin:J,tooltip:H,highlightAreaSettings:N,onSeriesMouseOver:W,animate:n,rtl:K,showColorLegendAtTop:ft,colorDomain:M,diffAreaColors:Q,idSuffix:E,strokeWidth:Z,showDots:_,refValues:Y,minValue:k,maxValue:X,annotations:L,customHighlightAreaSettings:F,yAxisTitle:U,noOfYTicks:tt,minDate:et,maxDate:it,curveType:P,styles:p,classNames:d,precision:S,customLayers:nt}=dt,at=y.useRef(null),r=Jt.useInView(at,{once:n.once,amount:n.amount}),[x,jt]=y.useState(!1);y.useEffect(()=>{if(r&&!x){const t=setTimeout(()=>{jt(!0)},(n.duration+.5)*1e3);return()=>clearTimeout(t)}},[r,x,n.duration]);const $=P==="linear"?At.curveLinear:P==="step"?ht.curveStep:P==="stepAfter"?ht.stepAfter:P==="stepBefore"?ht.stepBefore:ht.monotoneX,[q,st]=y.useState(void 0),[ot,rt]=y.useState(void 0),[b,A]=y.useState(void 0),g={top:gt,bottom:J,left:U?R+30:R,right:yt},lt=y.useRef(null),i=qt.orderBy(V.map(t=>({...t,date:h.parse(`${t.date}`,o,new Date)})),["date"],["asc"]),ct=N.map(t=>({...t,coordinates:[t.coordinates[0]===null?null:h.parse(`${t.coordinates[0]}`,o,new Date),t.coordinates[1]===null?null:h.parse(`${t.coordinates[1]}`,o,new Date)]})),xt=F.map(t=>({...t,coordinates:t.coordinates.map((v,I)=>I%2===0?h.parse(`${v}`,o,new Date):v)})),u=O-g.left-g.right,f=G-g.top-g.bottom,ut=et?h.parse(`${et}`,o,new Date):i[0].date,m=it?h.parse(`${it}`,o,new Date):i[i.length-1].date,B=Math.min(...i.map(t=>t.y1))!==1/0?Math.min(...i.map(t=>t.y1))>0?0:Math.min(...i.map(t=>t.y1)):0,Ot=Math.min(...i.map(t=>t.y2))!==1/0?Math.min(...i.map(t=>t.y2))>0?0:Math.min(...i.map(t=>t.y2)):0,Nt=Math.max(...i.map(t=>t.y1))!==1/0?Math.max(...i.map(t=>t.y1)):0,It=Math.max(...i.map(t=>t.y2))!==1/0?Math.max(...i.map(t=>t.y2)):0,C=T.checkIfNullOrUndefined(k)?B<Ot?B:Ot:k,wt=Nt>It?Nt:It,a=Yt.time().domain([ut,m]).range([0,u]),s=Xt.linear().domain([T.checkIfNullOrUndefined(k)?C:k,T.checkIfNullOrUndefined(X)?wt>0?wt:0:X]).range([f,0]).nice(),vt=At.line().x(t=>a(t.date)).y(t=>s(t.y1)).curve($),Vt=At.line().x(t=>a(t.date)).y(t=>s(t.y2)).curve($),Dt=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y1)).y0(t=>s(t.y2)).curve($),St=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y1)).y0(0).curve($),$t=Ct.area().x(t=>a(t.date)).y1(t=>s(t.y2)).y0(0).curve($),kt=s.ticks(tt),Lt=a.ticks(z);return y.useEffect(()=>{const t=I=>{const mt=i[Bt.bisectCenter(i.map(Rt=>Rt.date),a.invert(zt.pointer(I)[0]),0)];st(mt||i[i.length-1]),W?.(mt||i[i.length-1]),A(I.clientY),rt(I.clientX)},v=()=>{st(void 0),rt(void 0),A(void 0),W?.(void 0)};Ut.select(lt.current).on("mousemove",t).on("mouseout",v)},[a,i,W]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(j.motion.svg,{width:`${O}px`,height:`${G}px`,viewBox:`0 0 ${O} ${G}`,direction:"ltr",ref:at,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${g.left},${g.top})`,children:[e.jsxRuntimeExports.jsx("clipPath",{id:`above${E}`,children:e.jsxRuntimeExports.jsx("path",{d:$t(i),style:{fill:"none"}})}),e.jsxRuntimeExports.jsx("clipPath",{id:`below${E}`,children:e.jsxRuntimeExports.jsx("path",{d:St(i),style:{fill:"none"}})}),e.jsxRuntimeExports.jsx(Wt.HighlightArea,{areaSettings:ct,width:u,height:f,scale:a,animate:n,isInView:r}),e.jsxRuntimeExports.jsx(bt.CustomArea,{areaSettings:xt,scaleX:a,scaleY:s,animate:n,isInView:r}),e.jsxRuntimeExports.jsx("g",{children:e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(Ht.YTicksAndGridLines,{values:kt.filter(t=>t!==0),y:kt.filter(t=>t!==0).map(t=>s(t)),x1:0-R,x2:u+g.right,styles:{gridLines:p?.yAxis?.gridLines,labels:p?.yAxis?.labels},classNames:{gridLines:d?.yAxis?.gridLines,labels:d?.yAxis?.labels},suffix:D,prefix:w,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:S}),e.jsxRuntimeExports.jsx(Ft.Axis,{y1:s(C<0?0:C),y2:s(C<0?0:C),x1:0-R,x2:u+g.right,label:Et.numberFormattingFunction(C<0?0:C,"NA",S,w,D),labelPos:{x:0-R,y:s(C<0?0:C),dx:0,dy:wt<0?"1rem":-5},classNames:{axis:d?.xAxis?.axis,label:d?.yAxis?.labels},styles:{axis:p?.xAxis?.axis,label:p?.yAxis?.labels}}),e.jsxRuntimeExports.jsx(Mt.AxisTitle,{x:0-R-15,y:f/2,style:p?.yAxis?.title,className:d?.yAxis?.title,text:U,rotate90:!0})]})}),e.jsxRuntimeExports.jsx(Pt.XTicksAndGridLines,{values:Lt.map(t=>h.format(t,o)),x:Lt.map(t=>a(t)),y1:0,y2:f,styles:{gridLines:p?.xAxis?.gridLines,labels:p?.xAxis?.labels},classNames:{gridLines:e.mo("opacity-0",d?.xAxis?.gridLines),labels:e.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",d?.xAxis?.labels)},suffix:D,prefix:w,labelType:"primary",showGridLines:!0,precision:S}),nt.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.path,{clipPath:`url(#below${E})`,d:Dt(i)||"",style:{fill:Q[1]},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:1},whileInView:{opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(j.motion.path,{clipPath:`url(#above${E})`,d:Dt(i)||"",style:{fill:Q[0]},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"})]}),e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.path,{d:vt(i)||"",style:{fill:"none",stroke:l[0],strokeWidth:Z},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{pathLength:0,d:vt(i)||"",opacity:1},whileInView:{pathLength:1,d:vt(i)||"",opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),e.jsxRuntimeExports.jsx(j.motion.path,{style:{fill:"none",stroke:l[1],strokeWidth:Z},exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{pathLength:0,d:Vt(i)||"",opacity:1},whileInView:{pathLength:1,d:Vt(i)||"",opacity:1,transition:{duration:n.duration}}},initial:"initial",animate:r?"whileInView":"initial"}),ft?null:e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx(j.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(i[i.length-1].date),y:s(i[i.length-1].y1),fill:l[0]},whileInView:{opacity:1,x:a(i[i.length-1].date),y:s(i[i.length-1].y1),fill:l[0],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:M[0]},M[0]),e.jsxRuntimeExports.jsx(j.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(i[i.length-1].date),y:s(i[i.length-1].y2),fill:l[1]},whileInView:{opacity:1,x:a(i[i.length-1].date),y:s(i[i.length-1].y2),fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:M[1]},M[1])]}),q?e.jsxRuntimeExports.jsx("line",{y1:0,y2:f,x1:a(q.date),x2:a(q.date),className:e.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",d?.mouseOverLine),style:p?.mouseOverLine}):null,i.map((t,v)=>e.jsxRuntimeExports.jsxs(j.motion.g,{children:[T.checkIfNullOrUndefined(t.y1)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_?e.jsxRuntimeExports.jsx(j.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,cx:a(t.date),cy:s(t.y1),fill:l[0]},whileInView:{opacity:1,fill:l[0],transition:{duration:.5,delay:n.duration},cx:a(t.date),cy:s(t.y1)}},initial:"initial",animate:r?"whileInView":"initial"}):null,c?e.jsxRuntimeExports.jsx(j.motion.text,{dy:t.y2<t.y1?-8:"1em",style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:e.mo("graph-value graph-value-line-1 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(t.date),y:s(t.y1),fill:l[0]},whileInView:{opacity:1,fill:l[0],x:a(t.date),y:s(t.y1),transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:Et.numberFormattingFunction(t.y1,"NA",S,w,D)}):null]}),T.checkIfNullOrUndefined(t.y2)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_?e.jsxRuntimeExports.jsx(j.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,cx:a(t.date),cy:s(t.y2),fill:l[1]},whileInView:{opacity:1,fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration},cx:a(t.date),cy:s(t.y2)}},initial:"initial",animate:r?"whileInView":"initial"}):null,c?e.jsxRuntimeExports.jsx(j.motion.text,{dy:t.y2>t.y1?-8:"1em",style:{textAnchor:"middle",...p?.graphObjectValues||{}},className:e.mo("graph-value graph-value-line-2 text-xs font-bold",d?.graphObjectValues),exit:{opacity:0,transition:{duration:n.duration}},variants:{initial:{opacity:0,x:a(t.date),y:s(t.y2),fill:l[1]},whileInView:{opacity:1,x:a(t.date),y:s(t.y2),fill:l[1],transition:{duration:x?n.duration:.5,delay:x?0:n.duration}}},initial:"initial",animate:r?"whileInView":"initial",children:Et.numberFormattingFunction(t.y2,"NA",S,w,D)}):null]})]},v))]}),Y?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Y.map((t,v)=>e.jsxRuntimeExports.jsx(Gt.RefLineY,{text:t.text,color:t.color,y:s(t.value),x1:0-R,x2:u+g.right,classNames:t.classNames,styles:t.styles,animate:n,isInView:r},v))}):null,e.jsxRuntimeExports.jsx("g",{children:L.map((t,v)=>{const I=bt.getLineEndPoint({x:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8},{x:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date)):0,y:t.yCoordinate?s(t.yCoordinate):0},T.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius),mt=t.showConnector?{y1:I.y,x1:I.x,y2:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0):0+(t.yOffset||0),x2:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),cy:t.yCoordinate?s(t.yCoordinate):0,cx:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date)):0,circleRadius:T.checkIfNullOrUndefined(t.connectorRadius)?3.5:t.connectorRadius,strokeWidth:t.showConnector===!0?2:Math.min(t.showConnector||0,1)}:void 0,Rt={y:t.yCoordinate?s(t.yCoordinate)+(t.yOffset||0)-8:0+(t.yOffset||0)-8,x:K?0:t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0),width:K?t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0):u+g.right-(t.xCoordinate?a(h.parse(`${t.xCoordinate}`,o,new Date))+(t.xOffset||0):0+(t.xOffset||0)),maxWidth:t.maxWidth,fontWeight:t.fontWeight,align:t.align};return e.jsxRuntimeExports.jsx(bt.Annotation,{color:t.color,connectorsSettings:mt,labelSettings:Rt,text:t.text,classNames:t.classNames,styles:t.styles,animate:n,isInView:r},v)})}),nt.filter(t=>t.position==="after").map(t=>t.layer),e.jsxRuntimeExports.jsx("rect",{ref:lt,style:{fill:"none",pointerEvents:"all"},width:u,height:f})]})}),q&&H&&ot&&b?e.jsxRuntimeExports.jsx(Tt.Tooltip,{data:q,body:H,xPos:ot,yPos:b,backgroundStyle:p?.tooltip,className:d?.tooltip}):null]})}function ie(dt){const{data:V,graphTitle:O,suffix:G="",sources:l,prefix:D="",graphDescription:w,height:o,width:c,footNote:z,noOfXTicks:yt=10,dateFormat:R="yyyy",showValues:gt=!1,padding:J,lineColors:H=[pt.Colors.light.categoricalColors.colors[0],pt.Colors.light.categoricalColors.colors[1]],backgroundColor:N=!1,leftMargin:W=30,rightMargin:n=50,topMargin:K=20,bottomMargin:ft=25,tooltip:M,highlightAreaSettings:Q=[],relativeHeight:E,onSeriesMouseOver:Z,graphID:_,graphDownload:Y=!1,dataDownload:k=!1,animate:X=!1,language:L="en",minHeight:F=0,labels:U,showColorLegendAtTop:tt=!1,colorLegendTitle:et,diffAreaColors:it=[pt.Colors.alerts.red,pt.Colors.alerts.darkGreen],strokeWidth:P=2,showDots:p=!0,refValues:d=[],minValue:S,maxValue:nt,annotations:at=[],customHighlightAreaSettings:r=[],theme:x="light",ariaLabel:jt,yAxisTitle:$,noOfYTicks:q=5,minDate:st,maxDate:ot,curveType:rt="curve",styles:b,classNames:A,precision:g=2,customLayers:lt=[]}=dt,[i,ct]=y.useState(0),[xt,u]=y.useState(0),f=y.useRef(null),ut=y.useRef(null);return y.useEffect(()=>{const m=new ResizeObserver(B=>{ct(c||B[0].target.clientWidth||620),u(o||B[0].target.clientHeight||480)});return f.current&&(u(f.current.clientHeight||480),ct(f.current.clientWidth||620),c||m.observe(f.current)),()=>m.disconnect()},[c,o]),e.jsxRuntimeExports.jsx("div",{className:`${x||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:L==="he"||L==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${N?N===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${L||"en"}`,c?"w-fit":"w-full",A?.graphContainer),style:{...b?.graphContainer||{},...N&&N!==!0?{backgroundColor:N}:{}},id:_,ref:ut,"aria-label":jt||`${O?`The graph shows ${O}. `:""}This is a line chart that highlights the difference between two datasets over time.${w?` ${w}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:N?J||"1rem":J||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[O||w||Y||k?e.jsxRuntimeExports.jsx(Qt.GraphHeader,{styles:{title:b?.title,description:b?.description},classNames:{title:A?.title,description:A?.description},graphTitle:O,graphDescription:w,width:c,graphDownload:Y?ut.current:void 0,dataDownload:k?V.map(m=>m.data).filter(m=>m!==void 0).length>0?V.map(m=>m.data).filter(m=>m!==void 0):V.filter(m=>m!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:V.length===0?e.jsxRuntimeExports.jsx(te.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[tt?e.jsxRuntimeExports.jsx(Zt.ColorLegend,{colorDomain:U,colorLegendTitle:et,colors:H,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:f,"aria-label":"Graph area",children:(c||i)&&(o||xt)?e.jsxRuntimeExports.jsx(ee,{data:V,lineColors:H,colorDomain:U,width:c||i,height:Math.max(F,o||(E?F?(c||i)*E>F?(c||i)*E:F:(c||i)*E:xt)),suffix:G,prefix:D,dateFormat:R,showValues:gt,noOfXTicks:yt,leftMargin:W,rightMargin:n,topMargin:K,bottomMargin:ft,highlightAreaSettings:Q,tooltip:M,onSeriesMouseOver:Z,showColorLegendAtTop:tt,animate:X===!0?{duration:.5,once:!0,amount:.5}:X||{duration:0,once:!0,amount:0},rtl:L==="he"||L==="ar",diffAreaColors:it,idSuffix:_t.generateRandomString(8),strokeWidth:P,showDots:p,refValues:d,minValue:S,maxValue:nt,annotations:at,customHighlightAreaSettings:r,yAxisTitle:$,noOfYTicks:q,minDate:st,maxDate:ot,curveType:rt,styles:b,classNames:A,precision:g,customLayers:lt}):null})]})}),l||z?e.jsxRuntimeExports.jsx(Kt.GraphFooter,{styles:{footnote:b?.footnote,source:b?.source},classNames:{footnote:A?.footnote,source:A?.source},sources:l,footNote:z,width:c}):null]})})})})}exports.DifferenceLineChart=ie;
|
|
2
2
|
//# sourceMappingURL=DifferenceLineChart.cjs.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as e, m as G } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as e, m as G } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as ut, useState as W, useEffect as Dt } from "react";
|
|
3
3
|
import { p as u, f as Ht } from "./parse-DlCRUFh_.js";
|
|
4
4
|
import { o as Rt } from "./index-DvVprvy6.js";
|
|
5
5
|
import { n as Ct } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
-
import { T as Ft } from "./Tooltip-
|
|
6
|
+
import { T as Ft } from "./Tooltip-6LIdPQGC.js";
|
|
7
7
|
import { c as P } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
|
-
import { C as Gt, g as Wt, A as Yt } from "./customArea-
|
|
9
|
-
import { A as Xt } from "./AxisTitle-
|
|
10
|
-
import { A as Et } from "./Axis-
|
|
11
|
-
import { X as Bt } from "./XTicksAndGridLines-
|
|
12
|
-
import { R as zt } from "./ReferenceLine-
|
|
13
|
-
import { Y as Ut } from "./YTicksAndGridLines-
|
|
14
|
-
import { H as qt } from "./index-
|
|
8
|
+
import { C as Gt, g as Wt, A as Yt } from "./customArea-x4L4xwLl.js";
|
|
9
|
+
import { A as Xt } from "./AxisTitle-v6_xcXZ-.js";
|
|
10
|
+
import { A as Et } from "./Axis-4gUOL8B7.js";
|
|
11
|
+
import { X as Bt } from "./XTicksAndGridLines-DuydSnZ_.js";
|
|
12
|
+
import { R as zt } from "./ReferenceLine-CPMaAX0r.js";
|
|
13
|
+
import { Y as Ut } from "./YTicksAndGridLines-7t4MKtGw.js";
|
|
14
|
+
import { H as qt } from "./index-Bw_eHBVN.js";
|
|
15
15
|
import { t as Jt } from "./time-BzJP5SPC.js";
|
|
16
16
|
import { a as Kt } from "./linear-DUdu7l2G.js";
|
|
17
17
|
import { l as Mt, c as Qt } from "./line-CPfhohvF.js";
|
|
@@ -20,14 +20,14 @@ import { a as Ot } from "./area-BE2wo7fv.js";
|
|
|
20
20
|
import { s as ei } from "./select-DKy99ogv.js";
|
|
21
21
|
import { a as ai } from "./init-BhZylTFx.js";
|
|
22
22
|
import { p as ni } from "./pointer-CWRWOsrb.js";
|
|
23
|
-
import { u as oi } from "./use-in-view-
|
|
24
|
-
import { m as g } from "./proxy-
|
|
23
|
+
import { u as oi } from "./use-in-view-DR-UTB96.js";
|
|
24
|
+
import { m as g } from "./proxy-BYIC9BuT.js";
|
|
25
25
|
import { GraphFooter as ri } from "./GraphFooter.js";
|
|
26
26
|
import { GraphHeader as si } from "./GraphHeader.js";
|
|
27
27
|
import { ColorLegend as li } from "./ColorLegend.js";
|
|
28
28
|
import { Colors as dt } from "./Colors.js";
|
|
29
29
|
import { g as ci } from "./generateRandomString-za3IQGfQ.js";
|
|
30
|
-
import { E as mi } from "./EmptyState-
|
|
30
|
+
import { E as mi } from "./EmptyState-36lXXyui.js";
|
|
31
31
|
function hi(pt) {
|
|
32
32
|
const {
|
|
33
33
|
data: N,
|
package/dist/DonutChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DDoeWRVt.cjs"),B=require("react"),oe=require("./Typography-k-kOjICQ.cjs"),pe=require("./index-CQ3e6Ewi.cjs"),fe=require("./index-DQA8q5sC.cjs"),he=require("./Modal-tXZlLE5s.cjs"),ye=require("./Tooltip-De16GWhY.cjs"),se=require("./Colors.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./string2HTML-z7CwHXcx.cjs"),S=require("./array-DKbXV8lR.cjs"),je=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),be=require("./EmptyState-d8_8SxeW.cjs"),xe=Math.abs,$=Math.atan2,V=Math.cos,Ee=Math.max,de=Math.min,G=Math.sin,te=Math.sqrt,O=1e-12,ie=Math.PI,ue=ie/2,le=2*ie;function we(s){return s>1?0:s<-1?ie:Math.acos(s)}function ge(s){return s>=1?ue:s<=-1?-ue:Math.asin(s)}function Me(s){return s.innerRadius}function Ae(s){return s.outerRadius}function Ne(s){return s.startAngle}function Ce(s){return s.endAngle}function Se(s){return s&&s.padAngle}function De(s,a,y,d,A,R,x,e){var g=y-s,i=d-a,t=x-A,b=e-R,n=b*g-t*i;if(!(n*n<O))return n=(t*(a-R)-b*(s-A))/n,[s+n*g,a+n*i]}function ae(s,a,y,d,A,R,x){var e=s-y,g=a-d,i=(x?R:-R)/te(e*e+g*g),t=i*g,b=-i*e,n=s+t,u=a+b,h=y+t,f=d+b,k=(n+h)/2,c=(u+f)/2,w=h-n,v=f-u,j=w*w+v*v,N=A-R,M=n*f-h*u,q=(v<0?-1:1)*te(Ee(0,N*N*j-M*M)),D=(M*v-w*q)/j,m=(-M*w-v*q)/j,T=(M*v+w*q)/j,E=(-M*w+v*q)/j,p=D-k,r=m-c,o=T-k,z=E-c;return p*p+r*r>o*o+z*z&&(D=T,m=E),{cx:D,cy:m,x01:-t,y01:-b,x11:D*(A/N-1),y11:m*(A/N-1)}}function Te(){var s=Me,a=Ae,y=S.constant(0),d=null,A=Ne,R=Ce,x=Se,e=null,g=S.withPath(i);function i(){var t,b,n=+s.apply(this,arguments),u=+a.apply(this,arguments),h=A.apply(this,arguments)-ue,f=R.apply(this,arguments)-ue,k=xe(f-h),c=f>h;if(e||(e=t=g()),u<n&&(b=u,u=n,n=b),!(u>O))e.moveTo(0,0);else if(k>le-O)e.moveTo(u*V(h),u*G(h)),e.arc(0,0,u,h,f,!c),n>O&&(e.moveTo(n*V(f),n*G(f)),e.arc(0,0,n,f,h,c));else{var w=h,v=f,j=h,N=f,M=k,q=k,D=x.apply(this,arguments)/2,m=D>O&&(d?+d.apply(this,arguments):te(n*n+u*u)),T=de(xe(u-n)/2,+y.apply(this,arguments)),E=T,p=T,r,o;if(m>O){var z=ge(m/n*G(D)),J=ge(m/u*G(D));(M-=z*2)>O?(z*=c?1:-1,j+=z,N-=z):(M=0,j=N=(h+f)/2),(q-=J*2)>O?(J*=c?1:-1,w+=J,v-=J):(q=0,w=v=(h+f)/2)}var I=u*V(w),L=u*G(w),K=n*V(N),F=n*G(N);if(T>O){var W=u*V(v),Y=u*G(v),Q=n*V(j),U=n*G(j),H;if(k<ie)if(H=De(I,L,Q,U,W,Y,K,F)){var Z=I-H[0],ne=L-H[1],_=W-H[0],P=Y-H[1],re=1/G(we((Z*_+ne*P)/(te(Z*Z+ne*ne)*te(_*_+P*P)))/2),X=te(H[0]*H[0]+H[1]*H[1]);E=de(T,(n-X)/(re-1)),p=de(T,(u-X)/(re+1))}else E=p=0}q>O?p>O?(r=ae(Q,U,I,L,u,p,c),o=ae(W,Y,K,F,u,p,c),e.moveTo(r.cx+r.x01,r.cy+r.y01),p<T?e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,u,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),!c),e.arc(o.cx,o.cy,p,$(o.y11,o.x11),$(o.y01,o.x01),!c))):(e.moveTo(I,L),e.arc(0,0,u,w,v,!c)):e.moveTo(I,L),!(n>O)||!(M>O)?e.lineTo(K,F):E>O?(r=ae(K,F,W,Y,n,-E,c),o=ae(I,L,Q,U,n,-E,c),e.lineTo(r.cx+r.x01,r.cy+r.y01),E<T?e.arc(r.cx,r.cy,E,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,E,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,n,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),c),e.arc(o.cx,o.cy,E,$(o.y11,o.x11),$(o.y01,o.x01),!c))):e.arc(0,0,n,N,j,c)}if(e.closePath(),t)return e=null,t+""||null}return i.centroid=function(){var t=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2,b=(+A.apply(this,arguments)+ +R.apply(this,arguments))/2-ie/2;return[V(b)*t,G(b)*t]},i.innerRadius=function(t){return arguments.length?(s=typeof t=="function"?t:S.constant(+t),i):s},i.outerRadius=function(t){return arguments.length?(a=typeof t=="function"?t:S.constant(+t),i):a},i.cornerRadius=function(t){return arguments.length?(y=typeof t=="function"?t:S.constant(+t),i):y},i.padRadius=function(t){return arguments.length?(d=t==null?null:typeof t=="function"?t:S.constant(+t),i):d},i.startAngle=function(t){return arguments.length?(A=typeof t=="function"?t:S.constant(+t),i):A},i.endAngle=function(t){return arguments.length?(R=typeof t=="function"?t:S.constant(+t),i):R},i.padAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S.constant(+t),i):x},i.context=function(t){return arguments.length?(e=t??null,i):e},i}function $e(s,a){return a<s?-1:a>s?1:a>=s?0:NaN}function ke(s){return s}function qe(){var s=ke,a=$e,y=null,d=S.constant(0),A=S.constant(le),R=S.constant(0);function x(e){var g,i=(e=S.array(e)).length,t,b,n=0,u=new Array(i),h=new Array(i),f=+d.apply(this,arguments),k=Math.min(le,Math.max(-le,A.apply(this,arguments)-f)),c,w=Math.min(Math.abs(k)/i,R.apply(this,arguments)),v=w*(k<0?-1:1),j;for(g=0;g<i;++g)(j=h[u[g]=g]=+s(e[g],g,e))>0&&(n+=j);for(a!=null?u.sort(function(N,M){return a(h[N],h[M])}):y!=null&&u.sort(function(N,M){return y(e[N],e[M])}),g=0,b=n?(k-i*v)/n:0;g<i;++g,f=c)t=u[g],j=h[t],c=f+(j>0?j*b:0)+v,h[t]={data:e[t],index:g,value:j,startAngle:f,endAngle:c,padAngle:w};return h}return x.value=function(e){return arguments.length?(s=typeof e=="function"?e:S.constant(+e),x):s},x.sortValues=function(e){return arguments.length?(a=e,y=null,x):a},x.sort=function(e){return arguments.length?(y=e,a=null,x):y},x.startAngle=function(e){return arguments.length?(d=typeof e=="function"?e:S.constant(+e),x):d},x.endAngle=function(e){return arguments.length?(A=typeof e=="function"?e:S.constant(+e),x):A},x.padAngle=function(e){return arguments.length?(R=typeof e=="function"?e:S.constant(+e),x):R},x}function Oe(s){const{mainText:a,data:y,radius:d,colors:A,subNote:R,strokeWidth:x,tooltip:e,onSeriesMouseOver:g,onSeriesMouseClick:i,colorDomain:t,resetSelectionOnDoubleClick:b,detailsOnClick:n,styles:u,classNames:h,precision:f}=s,k=qe().sort(null).startAngle(0).value(m=>m.size),[c,w]=B.useState(void 0),[v,j]=B.useState(void 0),[N,M]=B.useState(void 0),[q,D]=B.useState(void 0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("svg",{width:`${d*2}px`,height:`${d*2}px`,viewBox:`0 0 ${d*2} ${d*2}`,direction:"ltr",children:l.jsxRuntimeExports.jsxs("g",{transform:`translate(${d} ${d})`,children:[a||R?l.jsxRuntimeExports.jsx("foreignObject",{y:0-(d-x),x:0-(d-x),width:2*(d-x),height:2*(d-x),children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[a?l.jsxRuntimeExports.jsx(oe.f,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof a=="string"?a:y.findIndex(m=>m.label===a.label)!==-1?me.numberFormattingFunction(y[y.findIndex(m=>m.label===a.label)].size,"NA",f,a.prefix,a.suffix):"NA"}):null,R?l.jsxRuntimeExports.jsx(oe.u,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:R}):typeof a=="string"||!a?null:l.jsxRuntimeExports.jsx(oe.u,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:a.label})]})}):null,k(y).map((m,T)=>l.jsxRuntimeExports.jsx("path",{d:Te()({innerRadius:d-x,outerRadius:d,startAngle:m.startAngle,endAngle:m.endAngle}),style:{fill:t.indexOf(m.data.label)!==-1?A[t.indexOf(m.data.label)%A.length]:se.Colors.gray,opacity:c?c.label===m.data.label?1:.3:1},onMouseEnter:E=>{w(m.data),D(E.clientY),M(E.clientX),g?.(m)},onClick:()=>{(i||n)&&(fe.isEqual(v,m.data)&&b?(j(void 0),i?.(void 0)):(j(m.data),i&&i(m.data)))},onMouseMove:E=>{w(m.data),D(E.clientY),M(E.clientX)},onMouseLeave:()=>{w(void 0),M(void 0),D(void 0),g?.(void 0)}},T))]})}),c&&e&&N&&q?l.jsxRuntimeExports.jsx(ye.Tooltip,{data:c,body:e,xPos:N,yPos:q,backgroundStyle:u?.tooltip,className:h?.tooltip}):null,n&&v!==void 0?l.jsxRuntimeExports.jsx(he.X,{open:v!==void 0,onClose:()=>{j(void 0)},children:l.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof n=="string"?{__html:ve.string2HTML(n,v)}:void 0,children:typeof n=="function"?n(v):null})}):null]})}function He(s){const{mainText:a,graphTitle:y,colors:d=se.Colors.light.categoricalColors.colors,suffix:A="",sources:R,prefix:x="",strokeWidth:e=50,graphDescription:g,subNote:i,footNote:t,radius:b,data:n,showColorScale:u=!0,padding:h,backgroundColor:f=!1,tooltip:k,onSeriesMouseOver:c,graphID:w,onSeriesMouseClick:v,topMargin:j=0,bottomMargin:N=0,graphDownload:M=!1,dataDownload:q=!1,colorDomain:D,sortData:m,language:T="en",theme:E="light",width:p,height:r,minHeight:o=0,relativeHeight:z,ariaLabel:J,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:L,detailsOnClick:K,styles:F,classNames:W,precision:Y=2}=s,[Q,U]=B.useState(0),[H,Z]=B.useState(0),[ne,_]=B.useState(0),P=B.useRef(null),re=B.useRef(null);B.useEffect(()=>{const C=new ResizeObserver(ee=>{Z(p||ee[0].target.clientWidth||420),_(r||ee[0].target.clientHeight||420),U((Math.min(p||ee[0].target.clientWidth||620,r||ee[0].target.clientHeight||480)||420)/2)});return P.current&&(_(P.current.clientHeight||420),Z(P.current.clientWidth||420),U((Math.min(P.current.clientWidth,P.current.clientHeight)||420)/2),(!p||!b)&&C.observe(P.current)),()=>C.disconnect()},[p,r,b]);const X=m?pe.orderBy(n,["size"],[m]):n;return l.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:T==="he"||T==="ar"?"rtl":void 0,children:l.jsxRuntimeExports.jsx("div",{className:l.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,p?"w-fit":"w-full",W?.graphContainer),style:{...F?.graphContainer||{},minHeight:"inherit",...f&&f!==!0?{backgroundColor:f}:{}},id:w,ref:re,"aria-label":J||`${y?`The graph shows ${y}. `:""}This is a donut or pie chart chart. ${g?` ${g}`:""}`,children:l.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?h||"1rem":h||0},children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[y||g||M||q?l.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:F?.title,description:F?.description},classNames:{title:W?.title,description:W?.description},graphTitle:y,graphDescription:g,width:p,graphDownload:M?re.current:void 0,dataDownload:q?n.map(C=>C.data).filter(C=>C!==void 0).length>0?n.map(C=>C.data).filter(C=>C!==void 0):n.filter(C=>C!==void 0):null}):null,l.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:p?`${p}px`:"100%",padding:`${j}px 0 ${N}px 0`},children:n.length===0?l.jsxRuntimeExports.jsx(be.EmptyState,{}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[u?l.jsxRuntimeExports.jsx("div",{className:"leading-0","aria-label":"Color legend",children:l.jsxRuntimeExports.jsx("div",{className:"flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",style:{maxWidth:L},children:X.map((C,ee)=>l.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(D||X.map(ce=>ce.label)).indexOf(C.label)!==-1?(d||se.Colors[E].categoricalColors.colors)[(D||X.map(ce=>ce.label)).indexOf(C.label)%(d||se.Colors[E].categoricalColors.colors).length]:se.Colors.gray}}),l.jsxRuntimeExports.jsxs(oe.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[C.label,":"," ",l.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:me.numberFormattingFunction(C.size,"NA",Y,x,A)})]})]},ee))})}):null,l.jsxRuntimeExports.jsx("div",{className:`flex ${p?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:p?`${p}px`:"100%",height:r?`${Math.max(o,r||(z?o?(p||H)*z>o?(p||H)*z:o:(p||H)*z:ne))}px`:"auto"},ref:P,"aria-label":"Graph area",children:l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:b||Q?l.jsxRuntimeExports.jsx(Oe,{mainText:a,data:X,colors:d,radius:b||Q,subNote:i,strokeWidth:e,tooltip:k,colorDomain:D||X.map(C=>C.label),onSeriesMouseOver:c,onSeriesMouseClick:v,resetSelectionOnDoubleClick:I,styles:F,detailsOnClick:K,precision:Y}):null})})]})}),R||t?l.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:F?.footnote,source:F?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:R,footNote:t,width:p}):l.jsxRuntimeExports.jsx("div",{})]})})})})}exports.DonutChart=He;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index-CHPV5EwG-DjM48pIC.cjs"),B=require("react"),oe=require("./Typography-BDULiwlF.cjs"),pe=require("./index-CQ3e6Ewi.cjs"),fe=require("./index-DQA8q5sC.cjs"),he=require("./Modal-CuuJdWkD.cjs"),ye=require("./Tooltip-Cpv0QohJ.cjs"),se=require("./Colors.cjs"),me=require("./numberFormattingFunction-02t-wJta.cjs"),ve=require("./string2HTML-z7CwHXcx.cjs"),S=require("./array-DKbXV8lR.cjs"),je=require("./GraphFooter.cjs"),Re=require("./GraphHeader.cjs"),be=require("./EmptyState-B8IpKGcL.cjs"),xe=Math.abs,$=Math.atan2,V=Math.cos,Ee=Math.max,de=Math.min,G=Math.sin,te=Math.sqrt,O=1e-12,ie=Math.PI,ue=ie/2,le=2*ie;function we(s){return s>1?0:s<-1?ie:Math.acos(s)}function ge(s){return s>=1?ue:s<=-1?-ue:Math.asin(s)}function Me(s){return s.innerRadius}function Ae(s){return s.outerRadius}function Ne(s){return s.startAngle}function Ce(s){return s.endAngle}function Se(s){return s&&s.padAngle}function De(s,a,y,d,A,R,x,e){var g=y-s,i=d-a,t=x-A,b=e-R,n=b*g-t*i;if(!(n*n<O))return n=(t*(a-R)-b*(s-A))/n,[s+n*g,a+n*i]}function ae(s,a,y,d,A,R,x){var e=s-y,g=a-d,i=(x?R:-R)/te(e*e+g*g),t=i*g,b=-i*e,n=s+t,u=a+b,h=y+t,f=d+b,k=(n+h)/2,c=(u+f)/2,w=h-n,v=f-u,j=w*w+v*v,N=A-R,M=n*f-h*u,q=(v<0?-1:1)*te(Ee(0,N*N*j-M*M)),D=(M*v-w*q)/j,m=(-M*w-v*q)/j,T=(M*v+w*q)/j,E=(-M*w+v*q)/j,p=D-k,r=m-c,o=T-k,z=E-c;return p*p+r*r>o*o+z*z&&(D=T,m=E),{cx:D,cy:m,x01:-t,y01:-b,x11:D*(A/N-1),y11:m*(A/N-1)}}function Te(){var s=Me,a=Ae,y=S.constant(0),d=null,A=Ne,R=Ce,x=Se,e=null,g=S.withPath(i);function i(){var t,b,n=+s.apply(this,arguments),u=+a.apply(this,arguments),h=A.apply(this,arguments)-ue,f=R.apply(this,arguments)-ue,k=xe(f-h),c=f>h;if(e||(e=t=g()),u<n&&(b=u,u=n,n=b),!(u>O))e.moveTo(0,0);else if(k>le-O)e.moveTo(u*V(h),u*G(h)),e.arc(0,0,u,h,f,!c),n>O&&(e.moveTo(n*V(f),n*G(f)),e.arc(0,0,n,f,h,c));else{var w=h,v=f,j=h,N=f,M=k,q=k,D=x.apply(this,arguments)/2,m=D>O&&(d?+d.apply(this,arguments):te(n*n+u*u)),T=de(xe(u-n)/2,+y.apply(this,arguments)),E=T,p=T,r,o;if(m>O){var z=ge(m/n*G(D)),J=ge(m/u*G(D));(M-=z*2)>O?(z*=c?1:-1,j+=z,N-=z):(M=0,j=N=(h+f)/2),(q-=J*2)>O?(J*=c?1:-1,w+=J,v-=J):(q=0,w=v=(h+f)/2)}var I=u*V(w),L=u*G(w),K=n*V(N),F=n*G(N);if(T>O){var W=u*V(v),Y=u*G(v),Q=n*V(j),U=n*G(j),H;if(k<ie)if(H=De(I,L,Q,U,W,Y,K,F)){var Z=I-H[0],ne=L-H[1],_=W-H[0],P=Y-H[1],re=1/G(we((Z*_+ne*P)/(te(Z*Z+ne*ne)*te(_*_+P*P)))/2),X=te(H[0]*H[0]+H[1]*H[1]);E=de(T,(n-X)/(re-1)),p=de(T,(u-X)/(re+1))}else E=p=0}q>O?p>O?(r=ae(Q,U,I,L,u,p,c),o=ae(W,Y,K,F,u,p,c),e.moveTo(r.cx+r.x01,r.cy+r.y01),p<T?e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,p,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,u,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),!c),e.arc(o.cx,o.cy,p,$(o.y11,o.x11),$(o.y01,o.x01),!c))):(e.moveTo(I,L),e.arc(0,0,u,w,v,!c)):e.moveTo(I,L),!(n>O)||!(M>O)?e.lineTo(K,F):E>O?(r=ae(K,F,W,Y,n,-E,c),o=ae(I,L,Q,U,n,-E,c),e.lineTo(r.cx+r.x01,r.cy+r.y01),E<T?e.arc(r.cx,r.cy,E,$(r.y01,r.x01),$(o.y01,o.x01),!c):(e.arc(r.cx,r.cy,E,$(r.y01,r.x01),$(r.y11,r.x11),!c),e.arc(0,0,n,$(r.cy+r.y11,r.cx+r.x11),$(o.cy+o.y11,o.cx+o.x11),c),e.arc(o.cx,o.cy,E,$(o.y11,o.x11),$(o.y01,o.x01),!c))):e.arc(0,0,n,N,j,c)}if(e.closePath(),t)return e=null,t+""||null}return i.centroid=function(){var t=(+s.apply(this,arguments)+ +a.apply(this,arguments))/2,b=(+A.apply(this,arguments)+ +R.apply(this,arguments))/2-ie/2;return[V(b)*t,G(b)*t]},i.innerRadius=function(t){return arguments.length?(s=typeof t=="function"?t:S.constant(+t),i):s},i.outerRadius=function(t){return arguments.length?(a=typeof t=="function"?t:S.constant(+t),i):a},i.cornerRadius=function(t){return arguments.length?(y=typeof t=="function"?t:S.constant(+t),i):y},i.padRadius=function(t){return arguments.length?(d=t==null?null:typeof t=="function"?t:S.constant(+t),i):d},i.startAngle=function(t){return arguments.length?(A=typeof t=="function"?t:S.constant(+t),i):A},i.endAngle=function(t){return arguments.length?(R=typeof t=="function"?t:S.constant(+t),i):R},i.padAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S.constant(+t),i):x},i.context=function(t){return arguments.length?(e=t??null,i):e},i}function $e(s,a){return a<s?-1:a>s?1:a>=s?0:NaN}function ke(s){return s}function qe(){var s=ke,a=$e,y=null,d=S.constant(0),A=S.constant(le),R=S.constant(0);function x(e){var g,i=(e=S.array(e)).length,t,b,n=0,u=new Array(i),h=new Array(i),f=+d.apply(this,arguments),k=Math.min(le,Math.max(-le,A.apply(this,arguments)-f)),c,w=Math.min(Math.abs(k)/i,R.apply(this,arguments)),v=w*(k<0?-1:1),j;for(g=0;g<i;++g)(j=h[u[g]=g]=+s(e[g],g,e))>0&&(n+=j);for(a!=null?u.sort(function(N,M){return a(h[N],h[M])}):y!=null&&u.sort(function(N,M){return y(e[N],e[M])}),g=0,b=n?(k-i*v)/n:0;g<i;++g,f=c)t=u[g],j=h[t],c=f+(j>0?j*b:0)+v,h[t]={data:e[t],index:g,value:j,startAngle:f,endAngle:c,padAngle:w};return h}return x.value=function(e){return arguments.length?(s=typeof e=="function"?e:S.constant(+e),x):s},x.sortValues=function(e){return arguments.length?(a=e,y=null,x):a},x.sort=function(e){return arguments.length?(y=e,a=null,x):y},x.startAngle=function(e){return arguments.length?(d=typeof e=="function"?e:S.constant(+e),x):d},x.endAngle=function(e){return arguments.length?(A=typeof e=="function"?e:S.constant(+e),x):A},x.padAngle=function(e){return arguments.length?(R=typeof e=="function"?e:S.constant(+e),x):R},x}function Oe(s){const{mainText:a,data:y,radius:d,colors:A,subNote:R,strokeWidth:x,tooltip:e,onSeriesMouseOver:g,onSeriesMouseClick:i,colorDomain:t,resetSelectionOnDoubleClick:b,detailsOnClick:n,styles:u,classNames:h,precision:f}=s,k=qe().sort(null).startAngle(0).value(m=>m.size),[c,w]=B.useState(void 0),[v,j]=B.useState(void 0),[N,M]=B.useState(void 0),[q,D]=B.useState(void 0);return l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[l.jsxRuntimeExports.jsx("svg",{width:`${d*2}px`,height:`${d*2}px`,viewBox:`0 0 ${d*2} ${d*2}`,direction:"ltr",children:l.jsxRuntimeExports.jsxs("g",{transform:`translate(${d} ${d})`,children:[a||R?l.jsxRuntimeExports.jsx("foreignObject",{y:0-(d-x),x:0-(d-x),width:2*(d-x),height:2*(d-x),children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-0.5 justify-center items-center h-inherit py-0 px-4",children:[a?l.jsxRuntimeExports.jsx(oe.f,{marginBottom:"none",className:"donut-main-text text-primary-gray-700 dark:text-primary-gray-100 leading-none text-center",children:typeof a=="string"?a:y.findIndex(m=>m.label===a.label)!==-1?me.numberFormattingFunction(y[y.findIndex(m=>m.label===a.label)].size,"NA",f,a.prefix,a.suffix):"NA"}):null,R?l.jsxRuntimeExports.jsx(oe.u,{marginBottom:"none",size:"base",leading:"none",className:"donut-sub-note text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:R}):typeof a=="string"||!a?null:l.jsxRuntimeExports.jsx(oe.u,{size:"base",marginBottom:"none",leading:"none",className:"donut-label text-primary-gray-700 dark:text-primary-gray-100 text-center font-bold",children:a.label})]})}):null,k(y).map((m,T)=>l.jsxRuntimeExports.jsx("path",{d:Te()({innerRadius:d-x,outerRadius:d,startAngle:m.startAngle,endAngle:m.endAngle}),style:{fill:t.indexOf(m.data.label)!==-1?A[t.indexOf(m.data.label)%A.length]:se.Colors.gray,opacity:c?c.label===m.data.label?1:.3:1},onMouseEnter:E=>{w(m.data),D(E.clientY),M(E.clientX),g?.(m)},onClick:()=>{(i||n)&&(fe.isEqual(v,m.data)&&b?(j(void 0),i?.(void 0)):(j(m.data),i&&i(m.data)))},onMouseMove:E=>{w(m.data),D(E.clientY),M(E.clientX)},onMouseLeave:()=>{w(void 0),M(void 0),D(void 0),g?.(void 0)}},T))]})}),c&&e&&N&&q?l.jsxRuntimeExports.jsx(ye.Tooltip,{data:c,body:e,xPos:N,yPos:q,backgroundStyle:u?.tooltip,className:h?.tooltip}):null,n&&v!==void 0?l.jsxRuntimeExports.jsx(he.G,{open:v!==void 0,onClose:()=>{j(void 0)},children:l.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof n=="string"?{__html:ve.string2HTML(n,v)}:void 0,children:typeof n=="function"?n(v):null})}):null]})}function He(s){const{mainText:a,graphTitle:y,colors:d=se.Colors.light.categoricalColors.colors,suffix:A="",sources:R,prefix:x="",strokeWidth:e=50,graphDescription:g,subNote:i,footNote:t,radius:b,data:n,showColorScale:u=!0,padding:h,backgroundColor:f=!1,tooltip:k,onSeriesMouseOver:c,graphID:w,onSeriesMouseClick:v,topMargin:j=0,bottomMargin:N=0,graphDownload:M=!1,dataDownload:q=!1,colorDomain:D,sortData:m,language:T="en",theme:E="light",width:p,height:r,minHeight:o=0,relativeHeight:z,ariaLabel:J,resetSelectionOnDoubleClick:I=!0,colorScaleMaxWidth:L,detailsOnClick:K,styles:F,classNames:W,precision:Y=2}=s,[Q,U]=B.useState(0),[H,Z]=B.useState(0),[ne,_]=B.useState(0),P=B.useRef(null),re=B.useRef(null);B.useEffect(()=>{const C=new ResizeObserver(ee=>{Z(p||ee[0].target.clientWidth||420),_(r||ee[0].target.clientHeight||420),U((Math.min(p||ee[0].target.clientWidth||620,r||ee[0].target.clientHeight||480)||420)/2)});return P.current&&(_(P.current.clientHeight||420),Z(P.current.clientWidth||420),U((Math.min(P.current.clientWidth,P.current.clientHeight)||420)/2),(!p||!b)&&C.observe(P.current)),()=>C.disconnect()},[p,r,b]);const X=m?pe.orderBy(n,["size"],[m]):n;return l.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${p?"w-fit grow-0":"w-full grow"}`,dir:T==="he"||T==="ar"?"rtl":void 0,children:l.jsxRuntimeExports.jsx("div",{className:l.mo(`${f?f===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T||"en"}`,p?"w-fit":"w-full",W?.graphContainer),style:{...F?.graphContainer||{},minHeight:"inherit",...f&&f!==!0?{backgroundColor:f}:{}},id:w,ref:re,"aria-label":J||`${y?`The graph shows ${y}. `:""}This is a donut or pie chart chart. ${g?` ${g}`:""}`,children:l.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:f?h||"1rem":h||0},children:l.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[y||g||M||q?l.jsxRuntimeExports.jsx(Re.GraphHeader,{styles:{title:F?.title,description:F?.description},classNames:{title:W?.title,description:W?.description},graphTitle:y,graphDescription:g,width:p,graphDownload:M?re.current:void 0,dataDownload:q?n.map(C=>C.data).filter(C=>C!==void 0).length>0?n.map(C=>C.data).filter(C=>C!==void 0):n.filter(C=>C!==void 0):null}):null,l.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:p?`${p}px`:"100%",padding:`${j}px 0 ${N}px 0`},children:n.length===0?l.jsxRuntimeExports.jsx(be.EmptyState,{}):l.jsxRuntimeExports.jsxs(l.jsxRuntimeExports.Fragment,{children:[u?l.jsxRuntimeExports.jsx("div",{className:"leading-0","aria-label":"Color legend",children:l.jsxRuntimeExports.jsx("div",{className:"flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",style:{maxWidth:L},children:X.map((C,ee)=>l.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:(D||X.map(ce=>ce.label)).indexOf(C.label)!==-1?(d||se.Colors[E].categoricalColors.colors)[(D||X.map(ce=>ce.label)).indexOf(C.label)%(d||se.Colors[E].categoricalColors.colors).length]:se.Colors.gray}}),l.jsxRuntimeExports.jsxs(oe.u,{marginBottom:"none",size:"sm",className:"text-primary-gray-700 dark:text-primary-gray-100",children:[C.label,":"," ",l.jsxRuntimeExports.jsx("span",{className:"font-bold",style:{fontSize:"inherit"},children:me.numberFormattingFunction(C.size,"NA",Y,x,A)})]})]},ee))})}):null,l.jsxRuntimeExports.jsx("div",{className:`flex ${p?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:p?`${p}px`:"100%",height:r?`${Math.max(o,r||(z?o?(p||H)*z>o?(p||H)*z:o:(p||H)*z:ne))}px`:"auto"},ref:P,"aria-label":"Graph area",children:l.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:b||Q?l.jsxRuntimeExports.jsx(Oe,{mainText:a,data:X,colors:d,radius:b||Q,subNote:i,strokeWidth:e,tooltip:k,colorDomain:D||X.map(C=>C.label),onSeriesMouseOver:c,onSeriesMouseClick:v,resetSelectionOnDoubleClick:I,styles:F,detailsOnClick:K,precision:Y}):null})})]})}),R||t?l.jsxRuntimeExports.jsx(je.GraphFooter,{styles:{footnote:F?.footnote,source:F?.source},classNames:{footnote:W?.footnote,source:W?.source},sources:R,footNote:t,width:p}):l.jsxRuntimeExports.jsx("div",{})]})})})})}exports.DonutChart=He;
|
|
2
2
|
//# sourceMappingURL=DonutChart.cjs.map
|
package/dist/DonutChart.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as u, m as pe } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as u, m as pe } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as V, useRef as fe, useEffect as xe } from "react";
|
|
3
|
-
import { f as ye, u as de } from "./Typography-
|
|
3
|
+
import { f as ye, u as de } from "./Typography-LmZ9LEpe.js";
|
|
4
4
|
import { o as ve } from "./index-DvVprvy6.js";
|
|
5
5
|
import { i as be } from "./index-Bwrro8-q.js";
|
|
6
|
-
import {
|
|
7
|
-
import { T as we } from "./Tooltip-
|
|
6
|
+
import { G as je } from "./Modal-Cg8daIlV.js";
|
|
7
|
+
import { T as we } from "./Tooltip-6LIdPQGC.js";
|
|
8
8
|
import { Colors as ae } from "./Colors.js";
|
|
9
9
|
import { n as he } from "./numberFormattingFunction-14YCbkN2.js";
|
|
10
10
|
import { s as Me } from "./string2HTML-oFCROsus.js";
|
|
11
11
|
import { w as Ae, c as S, a as Ne } from "./array-B7TkkRH0.js";
|
|
12
12
|
import { GraphFooter as De } from "./GraphFooter.js";
|
|
13
13
|
import { GraphHeader as Ce } from "./GraphHeader.js";
|
|
14
|
-
import { E as $e } from "./EmptyState-
|
|
14
|
+
import { E as $e } from "./EmptyState-36lXXyui.js";
|
|
15
15
|
const ge = Math.abs, T = Math.atan2, q = Math.cos, ke = Math.max, ce = Math.min, F = Math.sin, ne = Math.sqrt, z = 1e-12, ie = Math.PI, le = ie / 2, se = 2 * ie;
|
|
16
16
|
function Re(a) {
|
|
17
17
|
return a > 1 ? 0 : a < -1 ? ie : Math.acos(a);
|
|
@@ -63,17 +63,17 @@ function Ee() {
|
|
|
63
63
|
var E = me(m / t * F(k)), J = me(m / l * F(k));
|
|
64
64
|
(N -= E * 2) > z ? (E *= c ? 1 : -1, b += E, C -= E) : (N = 0, b = C = (x + p) / 2), (H -= J * 2) > z ? (J *= c ? 1 : -1, A += J, v -= J) : (H = 0, A = v = (x + p) / 2);
|
|
65
65
|
}
|
|
66
|
-
var
|
|
66
|
+
var G = l * q(A), L = l * F(A), K = t * q(C), P = t * F(C);
|
|
67
67
|
if (R > z) {
|
|
68
68
|
var I = l * q(v), Y = l * F(v), Q = t * q(b), U = t * F(b), W;
|
|
69
69
|
if (O < ie)
|
|
70
|
-
if (W = We(
|
|
71
|
-
var Z =
|
|
72
|
-
M = ce(R, (t -
|
|
70
|
+
if (W = We(G, L, Q, U, I, Y, K, P)) {
|
|
71
|
+
var Z = G - W[0], te = L - W[1], _ = I - W[0], B = Y - W[1], re = 1 / F(Re((Z * _ + te * B) / (ne(Z * Z + te * te) * ne(_ * _ + B * B))) / 2), X = ne(W[0] * W[0] + W[1] * W[1]);
|
|
72
|
+
M = ce(R, (t - X) / (re - 1)), h = ce(R, (l - X) / (re + 1));
|
|
73
73
|
} else
|
|
74
74
|
M = h = 0;
|
|
75
75
|
}
|
|
76
|
-
H > z ? h > z ? (r = oe(Q, U,
|
|
76
|
+
H > z ? h > z ? (r = oe(Q, U, G, L, l, h, c), s = oe(I, Y, K, P, l, h, c), e.moveTo(r.cx + r.x01, r.cy + r.y01), h < R ? e.arc(r.cx, r.cy, h, T(r.y01, r.x01), T(s.y01, s.x01), !c) : (e.arc(r.cx, r.cy, h, T(r.y01, r.x01), T(r.y11, r.x11), !c), e.arc(0, 0, l, T(r.cy + r.y11, r.cx + r.x11), T(s.cy + s.y11, s.cx + s.x11), !c), e.arc(s.cx, s.cy, h, T(s.y11, s.x11), T(s.y01, s.x01), !c))) : (e.moveTo(G, L), e.arc(0, 0, l, A, v, !c)) : e.moveTo(G, L), !(t > z) || !(N > z) ? e.lineTo(K, P) : M > z ? (r = oe(K, P, I, Y, t, -M, c), s = oe(G, L, Q, U, t, -M, c), e.lineTo(r.cx + r.x01, r.cy + r.y01), M < R ? e.arc(r.cx, r.cy, M, T(r.y01, r.x01), T(s.y01, s.x01), !c) : (e.arc(r.cx, r.cy, M, T(r.y01, r.x01), T(r.y11, r.x11), !c), e.arc(0, 0, t, T(r.cy + r.y11, r.cx + r.x11), T(s.cy + s.y11, s.cx + s.x11), c), e.arc(s.cx, s.cy, M, T(s.y11, s.x11), T(s.y01, s.x01), !c))) : e.arc(0, 0, t, C, b, c);
|
|
77
77
|
}
|
|
78
78
|
if (e.closePath(), n) return e = null, n + "" || null;
|
|
79
79
|
}
|
|
@@ -305,8 +305,8 @@ function tn(a) {
|
|
|
305
305
|
minHeight: s = 0,
|
|
306
306
|
relativeHeight: E,
|
|
307
307
|
ariaLabel: J,
|
|
308
|
-
resetSelectionOnDoubleClick:
|
|
309
|
-
colorScaleMaxWidth:
|
|
308
|
+
resetSelectionOnDoubleClick: G = !0,
|
|
309
|
+
colorScaleMaxWidth: L,
|
|
310
310
|
detailsOnClick: K,
|
|
311
311
|
styles: P,
|
|
312
312
|
classNames: I,
|
|
@@ -325,7 +325,7 @@ function tn(a) {
|
|
|
325
325
|
(Math.min(B.current.clientWidth, B.current.clientHeight) || 420) / 2
|
|
326
326
|
), (!h || !w) && $.observe(B.current)), () => $.disconnect();
|
|
327
327
|
}, [h, r, w]);
|
|
328
|
-
const
|
|
328
|
+
const X = m ? ve(t, ["size"], [m]) : t;
|
|
329
329
|
return /* @__PURE__ */ u.jsx(
|
|
330
330
|
"div",
|
|
331
331
|
{
|
|
@@ -384,16 +384,16 @@ function tn(a) {
|
|
|
384
384
|
"div",
|
|
385
385
|
{
|
|
386
386
|
className: "flex mb-0 ml-auto mr-auto justify-center gap-3.5 flex-wrap",
|
|
387
|
-
style: { maxWidth:
|
|
388
|
-
children:
|
|
387
|
+
style: { maxWidth: L },
|
|
388
|
+
children: X.map(($, ee) => /* @__PURE__ */ u.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
389
389
|
/* @__PURE__ */ u.jsx(
|
|
390
390
|
"div",
|
|
391
391
|
{
|
|
392
392
|
className: "w-3 h-3 rounded-full",
|
|
393
393
|
style: {
|
|
394
|
-
backgroundColor: (k ||
|
|
394
|
+
backgroundColor: (k || X.map((ue) => ue.label)).indexOf(
|
|
395
395
|
$.label
|
|
396
|
-
) !== -1 ? (d || ae[M].categoricalColors.colors)[(k ||
|
|
396
|
+
) !== -1 ? (d || ae[M].categoricalColors.colors)[(k || X.map((ue) => ue.label)).indexOf(
|
|
397
397
|
$.label
|
|
398
398
|
) % (d || ae[M].categoricalColors.colors).length] : ae.gray
|
|
399
399
|
}
|
|
@@ -433,16 +433,16 @@ function tn(a) {
|
|
|
433
433
|
Fe,
|
|
434
434
|
{
|
|
435
435
|
mainText: o,
|
|
436
|
-
data:
|
|
436
|
+
data: X,
|
|
437
437
|
colors: d,
|
|
438
438
|
radius: w || Q,
|
|
439
439
|
subNote: i,
|
|
440
440
|
strokeWidth: e,
|
|
441
441
|
tooltip: O,
|
|
442
|
-
colorDomain: k ||
|
|
442
|
+
colorDomain: k || X.map(($) => $.label),
|
|
443
443
|
onSeriesMouseOver: c,
|
|
444
444
|
onSeriesMouseClick: v,
|
|
445
|
-
resetSelectionOnDoubleClick:
|
|
445
|
+
resetSelectionOnDoubleClick: G,
|
|
446
446
|
styles: P,
|
|
447
447
|
detailsOnClick: K,
|
|
448
448
|
precision: Y
|
package/dist/DotDensityMap.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),n=require("react"),ve=require("./parse-hMnG_lRV.cjs"),be=require("./getSliderMarks-CRIbTGYV.cjs"),Re=require("./Spinner-DA6Z5E4n.cjs"),ke=require("./index-DQA8q5sC.cjs"),L=require("./zoom-BiMNsz72.cjs"),Ce=require("./Modal-tXZlLE5s.cjs"),De=require("./Typography-k-kOjICQ.cjs"),Se=require("./index-CoZbeNM9.cjs"),Ne=require("./Tooltip-De16GWhY.cjs"),R=require("./Colors.cjs"),$e=require("./string2HTML-z7CwHXcx.cjs"),je=require("./index-BW_-wD2k.cjs"),qe=require("./pow-B5-jkdHU.cjs"),fe=require("./select-Bnfk0lJx.cjs"),Me=require("./use-in-view-sQJZ_xDO.cjs"),de=require("./proxy-BHRoeZgd.cjs"),Oe=require("./index-BW8iNx7E.cjs"),Pe=require("./GraphFooter.cjs"),Ie=require("./GraphHeader.cjs"),Le=require("./fetchAndParseData-Ba-_CgxS.cjs"),Te=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ee=require("./uniqBy-O05lp2S5.cjs"),ze=require("./sort-O96oMZLb.cjs"),Ve=require("./init-DU0ybBc_.cjs");function We(me){const{data:l,colors:c,mapData:k,colorLegendTitle:$,colorDomain:j,radius:v,height:m,width:a,scale:K,centerPoint:q,tooltip:Z,showLabels:pe,mapBorderWidth:J,mapBorderColor:Q,mapNoDataColor:B,onSeriesMouseOver:ee,showColorScale:xe,zoomScaleExtend:C,zoomTranslateExtend:he,highlightedDataPoints:te,onSeriesMouseClick:H,resetSelectionOnDoubleClick:g,detailsOnClick:D,styles:re,classNames:ge,mapProjection:T,zoomInteraction:M,animate:y,dimmedOpacity:oe,customLayers:ae,maxRadiusValue:ie}=me,[A,se]=n.useState(void 0),[F,h]=n.useState(!(a<680)),z=n.useRef(null),[O,G]=n.useState(void 0),[ne,f]=n.useState(void 0),[b,_]=n.useState(void 0),[le,V]=n.useState(void 0),P=n.useRef(null),U=Me.useInView(P,{once:y.once,amount:y.amount}),X=n.useRef(null),d=l.filter(e=>e.radius===void 0||e.radius===null).length!==l.length?qe.sqrt().domain([0,ie]).range([.25,v]).nice():void 0;n.useEffect(()=>{const e=fe.select(X.current),x=fe.select(P.current),o=i=>{if(M==="noZoom")return!1;if(M==="button")return!i.type.includes("wheel");const r=i.type==="wheel",u=i.type.startsWith("touch"),w=i.type==="mousedown"||i.type==="mousemove";return u?!0:r?M==="scroll"?!0:i.ctrlKey:w&&!i.button&&!i.ctrlKey},E=L.zoom().scaleExtent(C).translateExtent(he||[[-20,-20],[a+20,m+20]]).filter(o).on("zoom",({transform:i})=>{e.attr("transform",i)});x.call(E),z.current=E},[m,a,M]);const p=L.turf_bbox_default(k),S=Se.turf_center_of_mass_default(k),Y=p[2]-p[0],ce=p[3]-p[1],I=a*190/960*360/Y,ye=m*190/678*180/ce,s=K*Math.min(I,ye),N=T==="mercator"?L.geoMercator().rotate([0,0]).center(q||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="equalEarth"?L.geoEqualEarth().rotate([0,0]).center(q||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="naturalEarth"?L.geoNaturalEarth1().rotate([0,0]).center(q||S.geometry.coordinates).translate([a/2,m/2]).scale(s):T==="orthographic"?L.geoOrthographic().rotate([0,0]).center(q||S.geometry.coordinates).translate([a/2,m/2]).scale(s):L.geoAlbersUsa().rotate([0,0]).center(q||S.geometry.coordinates).translate([a/2,m/2]).scale(s),W=e=>{if(!P.current||!z.current)return;fe.select(P.current).call(z.current.scaleBy,e==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(de.motion.svg,{width:`${a}px`,height:`${m}px`,viewBox:`0 0 ${a} ${m}`,ref:P,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:X,children:[ae.filter(e=>e.position==="before").map(e=>e.layer),k.features.map((e,x)=>t.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((o,E)=>{let i="";return o.forEach(r=>{let u=" M";r.forEach((w,we)=>{const ue=N([w[0],w[1]]);we!==r.length-1?u=`${u}${ue[0]} ${ue[1]}L`:u=`${u}${ue[0]} ${ue[1]}`}),i+=u}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:B}},E)}):e.geometry.coordinates.map((o,E)=>{let i="M";return o.forEach((r,u)=>{const w=N([r[0],r[1]]);u!==o.length-1?i=`${i}${w[0]} ${w[1]}L`:i=`${i}${w[0]} ${w[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:Q,strokeWidth:J,fill:B}},E)})},x)),t.jsxRuntimeExports.jsx(Oe.AnimatePresence,{children:l.map(e=>{const x=l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray;return t.jsxRuntimeExports.jsxs(de.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:A?A===x?1:oe:te.length!==0?te.indexOf(e.label||"")!==-1?1:oe:1,transition:{duration:y.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},onMouseEnter:o=>{f(e),V(o.clientY),_(o.clientX),ee?.(e)},onMouseMove:o=>{f(e),V(o.clientY),_(o.clientX)},onMouseLeave:()=>{f(void 0),_(void 0),V(void 0),ee?.(void 0)},onClick:()=>{(H||D)&&(ke.isEqual(O,e)&&g?(G(void 0),H?.(void 0)):(G(e),H?.(e)))},transform:`translate(${N([e.long,e.lat])[0]},${N([e.long,e.lat])[1]})`,children:[t.jsxRuntimeExports.jsx(de.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray},whileInView:{r:d?d(e.radius||0):v,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,transition:{duration:y.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{r:0,transition:{duration:y.duration}},style:{fillOpacity:.8}}),pe&&e.label?t.jsxRuntimeExports.jsx(de.motion.text,{variants:{initial:{opacity:0,x:d?d(e.radius||0):v},whileInView:{opacity:1,x:d?d(e.radius||0):v,transition:{duration:y.duration}}},initial:"initial",animate:U?"whileInView":"initial",exit:{opacity:0,transition:{duration:y.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:e.label}):null]},e.label||`${e.lat}-${e.long}`)})}),ae.filter(e=>e.position==="after").map(e=>e.layer)]})}),l.filter(e=>e.color).length===0||xe===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:F?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{h(!1)},children:t.jsxRuntimeExports.jsx(je.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[$&&$!==""?t.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:$}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((e,x)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{se(c[x%c.length])},onMouseLeave:()=>{se(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[x%c.length]}}),t.jsxRuntimeExports.jsx(De.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},x))})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{h(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),M==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>W("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>W("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),D&&O!==void 0?t.jsxRuntimeExports.jsx(Ce.X,{open:O!==void 0,onClose:()=>{G(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:$e.string2HTML(D,O)}:void 0,children:typeof D=="function"?D(O):null})}):null,ne&&Z&&b&&le?t.jsxRuntimeExports.jsx(Ne.Tooltip,{data:ne,body:Z,xPos:b,yPos:le,backgroundStyle:re?.tooltip,className:ge?.tooltip}):null]})}function Be(me){const{data:l,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:k,colors:$,sources:j,graphDescription:v,height:m,width:a,footNote:K="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorLegendTitle:q,colorDomain:Z,radius:pe=5,scale:J=.95,centerPoint:Q,padding:B,mapBorderWidth:ee=.5,mapNoDataColor:xe=R.Colors.light.graphNoData,backgroundColor:C=!1,showLabels:he=!1,mapBorderColor:te=R.Colors.light.grays["gray-500"],tooltip:H,relativeHeight:g,onSeriesMouseOver:D,isWorldMap:re=!0,showColorScale:ge=!0,zoomScaleExtend:T=[.8,6],zoomTranslateExtend:M,graphID:y,highlightedDataPoints:oe=[],onSeriesMouseClick:ae,graphDownload:ie=!1,dataDownload:A=!1,showAntarctica:se=!1,language:F="en",minHeight:h=0,theme:z="light",ariaLabel:O,resetSelectionOnDoubleClick:G=!0,detailsOnClick:ne,styles:f,classNames:b,mapProjection:_,zoomInteraction:le="button",animate:V=!1,dimmedOpacity:P=.3,customLayers:U=[],maxRadiusValue:X,timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=me,[p,S]=n.useState(0),[Y,ce]=n.useState(0),[I,ye]=n.useState(d.autoplay),s=ze.sort(Ee.uniqBy(l,"date",!0).map(r=>ve.parse(`${r}`,d.dateFormat||"yyyy",new Date).getTime()),(r,u)=>Ve.ascending(r,u)),[N,W]=n.useState(d.autoplay?0:s.length-1),[e,x]=n.useState(void 0),o=n.useRef(null),E=n.useRef(null);n.useEffect(()=>{const r=new ResizeObserver(u=>{S(a||u[0].target.clientWidth||760),ce(m||u[0].target.clientHeight||480)});return o.current&&(ce(o.current.clientHeight||480),S(o.current.clientWidth||760),a||r.observe(o.current)),()=>r.disconnect()},[a,m]),n.useEffect(()=>{typeof c=="string"?Le.fetchAndParseJSON(c).then(u=>{x(u)}):x(c)},[c]),n.useEffect(()=>{const r=setInterval(()=>{W(u=>u<s.length-1?u+1:0)},(d.speed||2)*1e3);return I||clearInterval(r),()=>clearInterval(r)},[s,I,d.speed]);const i=be.getSliderMarks(s,N,d.showOnlyActiveDate,d.dateFormat||"yyyy");return t.jsxRuntimeExports.jsx("div",{className:`${z||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:F==="he"||F==="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 ${F||"en"}`,a?"w-fit":"w-full",b?.graphContainer),style:{...f?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:y,ref:E,"aria-label":O||`${k?`The graph shows ${k}. `:""}This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${v?` ${v}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?B||"1rem":B||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||v||ie||A?t.jsxRuntimeExports.jsx(Ie.GraphHeader,{styles:{title:f?.title,description:f?.description},classNames:{title:b?.title,description:b?.description},graphTitle:k,graphDescription:v,width:a,graphDownload:ie?E.current:void 0,dataDownload:A?l.map(r=>r.data).filter(r=>r!==void 0).length>0?l.map(r=>r.data).filter(r=>r!==void 0):l.filter(r=>r!==void 0):null}):null,d.enabled&&s.length>0&&i?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{ye(!I)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":I?"Click to pause animation":"Click to play animation",children:I?t.jsxRuntimeExports.jsx(je.Pause,{}):t.jsxRuntimeExports.jsx(je.Play,{})}),t.jsxRuntimeExports.jsx(be.xr,{min:s[0],max:s[s.length-1],marks:i,step:null,defaultValue:s[s.length-1],value:s[N],onChangeComplete:r=>{W(s.indexOf(r))},onChange:r=>{W(s.indexOf(r))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:o,"aria-label":"Map area",children:(a||p)&&(m||Y)&&e?t.jsxRuntimeExports.jsx(We,{data:l.filter(r=>d.enabled?r.date===ve.format(new Date(s[N]),d.dateFormat||"yyyy"):r),mapData:se?e:{...e,features:e.features.filter(r=>r.properties.NAME!=="Antarctica")},colorDomain:l.filter(r=>r.color).length===0?[]:Z||Ee.uniqBy(l,"color",!0),width:a||p,height:Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y)),scale:J,centerPoint:Q,colors:l.filter(r=>r.color).length===0?$?[$]:[R.Colors.primaryColors["blue-600"]]:$||R.Colors[z].categoricalColors.colors,colorLegendTitle:q,radius:pe,mapBorderWidth:ee,mapNoDataColor:xe,mapBorderColor:te,tooltip:H,onSeriesMouseOver:D,showLabels:he,isWorldMap:re,showColorScale:ge,zoomScaleExtend:T,zoomTranslateExtend:M,onSeriesMouseClick:ae,highlightedDataPoints:oe,resetSelectionOnDoubleClick:G,styles:f,classNames:b,zoomInteraction:le,detailsOnClick:ne,mapProjection:_||(re?"naturalEarth":"mercator"),animate:V===!0?{duration:.5,once:!0,amount:.5}:V||{duration:0,once:!0,amount:0},dimmedOpacity:P,customLayers:U,maxRadiusValue:Te.checkIfNullOrUndefined(X)?Math.max(...l.map(r=>r.radius).filter(r=>r!=null)):X}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(h,m||(g?h?(a||p)*g>h?(a||p)*g:h:(a||p)*g:Y))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Re.y,{"aria-label":"Loading graph"})})}),j||K?t.jsxRuntimeExports.jsx(Pe.GraphFooter,{styles:{footnote:f?.footnote,source:f?.source},classNames:{footnote:b?.footnote,source:b?.source},sources:j,footNote:K,width:a}):null]})})})})}exports.DotDensityMap=Be;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),n=require("react"),ve=require("./parse-hMnG_lRV.cjs"),Ee=require("./getSliderMarks-CUxPy36E.cjs"),ke=require("./Spinner-C6wLp85s.cjs"),Ce=require("./index-DQA8q5sC.cjs"),T=require("./zoom-BiMNsz72.cjs"),De=require("./Modal-CuuJdWkD.cjs"),Se=require("./Typography-BDULiwlF.cjs"),Ne=require("./index-CoZbeNM9.cjs"),$e=require("./Tooltip-Cpv0QohJ.cjs"),R=require("./Colors.cjs"),qe=require("./string2HTML-z7CwHXcx.cjs"),be=require("./index-C0bpbS4F.cjs"),Me=require("./pow-B5-jkdHU.cjs"),je=require("./select-Bnfk0lJx.cjs"),Oe=require("./use-in-view-CEwlc_dd.cjs"),me=require("./proxy-CKadx4lC.cjs"),Pe=require("./index-Cm8NIdOO.cjs"),Ie=require("./GraphFooter.cjs"),Le=require("./GraphHeader.cjs"),Te=require("./fetchAndParseData-Ba-_CgxS.cjs"),ze=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),we=require("./uniqBy-O05lp2S5.cjs"),Ve=require("./sort-O96oMZLb.cjs"),Be=require("./init-DU0ybBc_.cjs");function We(pe){const{data:l,colors:c,mapData:k,colorLegendTitle:q,colorDomain:j,radius:b,height:d,width:a,scale:J,centerPoint:M,tooltip:Q,showLabels:xe,mapBorderWidth:ee,mapBorderColor:te,mapNoDataColor:H,onSeriesMouseOver:re,showColorScale:he,zoomScaleExtend:C,zoomTranslateExtend:ge,highlightedDataPoints:oe,onSeriesMouseClick:A,resetSelectionOnDoubleClick:h,detailsOnClick:D,styles:ae,classNames:ye,mapProjection:z,zoomInteraction:O,animate:g,dimmedOpacity:ie,customLayers:se,maxRadiusValue:ne,collapseColorScaleByDefault:G}=pe,[le,V]=n.useState(void 0),[y,F]=n.useState(G===void 0?!(a<680):!G),_=n.useRef(null),[P,U]=n.useState(void 0),[v,f]=n.useState(void 0),[ce,X]=n.useState(void 0),[Y,K]=n.useState(void 0),I=n.useRef(null),B=Oe.useInView(I,{once:g.once,amount:g.amount}),m=n.useRef(null),S=l.filter(e=>e.radius===void 0||e.radius===null).length!==l.length?Me.sqrt().domain([0,ne]).range([.25,b]).nice():void 0;n.useEffect(()=>{const e=je.select(m.current),x=je.select(I.current),o=i=>{if(O==="noZoom")return!1;if(O==="button")return!i.type.includes("wheel");const r=i.type==="wheel",u=i.type.startsWith("touch"),w=i.type==="mousedown"||i.type==="mousemove";return u?!0:r?O==="scroll"?!0:i.ctrlKey:w&&!i.button&&!i.ctrlKey},E=T.zoom().scaleExtent(C).translateExtent(ge||[[-20,-20],[a+20,d+20]]).filter(o).on("zoom",({transform:i})=>{e.attr("transform",i)});x.call(E),_.current=E},[d,a,O]);const p=T.turf_bbox_default(k),N=Ne.turf_center_of_mass_default(k),Z=p[2]-p[0],ue=p[3]-p[1],L=a*190/960*360/Z,fe=d*190/678*180/ue,s=J*Math.min(L,fe),$=z==="mercator"?T.geoMercator().rotate([0,0]).center(M||N.geometry.coordinates).translate([a/2,d/2]).scale(s):z==="equalEarth"?T.geoEqualEarth().rotate([0,0]).center(M||N.geometry.coordinates).translate([a/2,d/2]).scale(s):z==="naturalEarth"?T.geoNaturalEarth1().rotate([0,0]).center(M||N.geometry.coordinates).translate([a/2,d/2]).scale(s):z==="orthographic"?T.geoOrthographic().rotate([0,0]).center(M||N.geometry.coordinates).translate([a/2,d/2]).scale(s):T.geoAlbersUsa().rotate([0,0]).center(M||N.geometry.coordinates).translate([a/2,d/2]).scale(s),W=e=>{if(!I.current||!_.current)return;je.select(I.current).call(_.current.scaleBy,e==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(me.motion.svg,{width:`${a}px`,height:`${d}px`,viewBox:`0 0 ${a} ${d}`,ref:I,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:m,children:[se.filter(e=>e.position==="before").map(e=>e.layer),k.features.map((e,x)=>t.jsxRuntimeExports.jsx("g",{children:e.geometry.type==="MultiPolygon"?e.geometry.coordinates.map((o,E)=>{let i="";return o.forEach(r=>{let u=" M";r.forEach((w,Re)=>{const de=$([w[0],w[1]]);Re!==r.length-1?u=`${u}${de[0]} ${de[1]}L`:u=`${u}${de[0]} ${de[1]}`}),i+=u}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:te,strokeWidth:ee,fill:H}},E)}):e.geometry.coordinates.map((o,E)=>{let i="M";return o.forEach((r,u)=>{const w=$([r[0],r[1]]);u!==o.length-1?i=`${i}${w[0]} ${w[1]}L`:i=`${i}${w[0]} ${w[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:te,strokeWidth:ee,fill:H}},E)})},x)),t.jsxRuntimeExports.jsx(Pe.AnimatePresence,{children:l.map(e=>{const x=l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray;return t.jsxRuntimeExports.jsxs(me.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:le?le===x?1:ie:oe.length!==0?oe.indexOf(e.label||"")!==-1?1:ie:1,transition:{duration:g.duration}}},initial:"initial",animate:B?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},onMouseEnter:o=>{f(e),K(o.clientY),X(o.clientX),re?.(e)},onMouseMove:o=>{f(e),K(o.clientY),X(o.clientX)},onMouseLeave:()=>{f(void 0),X(void 0),K(void 0),re?.(void 0)},onClick:()=>{(A||D)&&(Ce.isEqual(P,e)&&h?(U(void 0),A?.(void 0)):(U(e),A?.(e)))},transform:`translate(${$([e.long,e.lat])[0]},${$([e.long,e.lat])[1]})`,children:[t.jsxRuntimeExports.jsx(me.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray},whileInView:{r:S?S(e.radius||0):b,fill:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,stroke:l.filter(o=>o.color).length===0?c[0]:e.color?c[j.indexOf(`${e.color}`)]:R.Colors.gray,transition:{duration:g.duration}}},initial:"initial",animate:B?"whileInView":"initial",exit:{r:0,transition:{duration:g.duration}},style:{fillOpacity:.8}}),xe&&e.label?t.jsxRuntimeExports.jsx(me.motion.text,{variants:{initial:{opacity:0,x:S?S(e.radius||0):b},whileInView:{opacity:1,x:S?S(e.radius||0):b,transition:{duration:g.duration}}},initial:"initial",animate:B?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},y:0,className:"fill-primary-gray-600 dark:fill-primary-gray-300 text-sm",style:{textAnchor:"start"},dx:4,dy:5,children:e.label}):null]},e.label||`${e.lat}-${e.long}`)})}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),l.filter(e=>e.color).length===0||he===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:y?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{F(!1)},children:t.jsxRuntimeExports.jsx(be.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)"},children:[q&&q!==""?t.jsxRuntimeExports.jsx("p",{className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:q}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:j.map((e,x)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{V(c[x%c.length])},onMouseLeave:()=>{V(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:c[x%c.length]}}),t.jsxRuntimeExports.jsx(Se.u,{size:"sm",marginBottom:"none",leading:"none",children:e})]},x))})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{F(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"show-color-legend-button items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-600 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),O==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>W("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>W("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),D&&P!==void 0?t.jsxRuntimeExports.jsx(De.G,{open:P!==void 0,onClose:()=>{U(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof D=="string"?{__html:qe.string2HTML(D,P)}:void 0,children:typeof D=="function"?D(P):null})}):null,v&&Q&&ce&&Y?t.jsxRuntimeExports.jsx($e.Tooltip,{data:v,body:Q,xPos:ce,yPos:Y,backgroundStyle:ae?.tooltip,className:ye?.tooltip}):null]})}function He(pe){const{data:l,mapData:c="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:k,colors:q,sources:j,graphDescription:b,height:d,width:a,footNote:J="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorLegendTitle:M,colorDomain:Q,radius:xe=5,scale:ee=.95,centerPoint:te,padding:H,mapBorderWidth:re=.5,mapNoDataColor:he=R.Colors.light.graphNoData,backgroundColor:C=!1,showLabels:ge=!1,mapBorderColor:oe=R.Colors.light.grays["gray-500"],tooltip:A,relativeHeight:h,onSeriesMouseOver:D,isWorldMap:ae=!0,showColorScale:ye=!0,zoomScaleExtend:z=[.8,6],zoomTranslateExtend:O,graphID:g,highlightedDataPoints:ie=[],onSeriesMouseClick:se,graphDownload:ne=!1,dataDownload:G=!1,showAntarctica:le=!1,language:V="en",minHeight:y=0,theme:F="light",ariaLabel:_,resetSelectionOnDoubleClick:P=!0,detailsOnClick:U,styles:v,classNames:f,mapProjection:ce,zoomInteraction:X="button",animate:Y=!1,dimmedOpacity:K=.3,customLayers:I=[],maxRadiusValue:B,timeline:m={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},collapseColorScaleByDefault:S}=pe,[p,N]=n.useState(0),[Z,ue]=n.useState(0),[L,fe]=n.useState(m.autoplay),s=Ve.sort(we.uniqBy(l,"date",!0).map(r=>ve.parse(`${r}`,m.dateFormat||"yyyy",new Date).getTime()),(r,u)=>Be.ascending(r,u)),[$,W]=n.useState(m.autoplay?0:s.length-1),[e,x]=n.useState(void 0),o=n.useRef(null),E=n.useRef(null);n.useEffect(()=>{const r=new ResizeObserver(u=>{N(a||u[0].target.clientWidth||760),ue(d||u[0].target.clientHeight||480)});return o.current&&(ue(o.current.clientHeight||480),N(o.current.clientWidth||760),a||r.observe(o.current)),()=>r.disconnect()},[a,d]),n.useEffect(()=>{typeof c=="string"?Te.fetchAndParseJSON(c).then(u=>{x(u)}):x(c)},[c]),n.useEffect(()=>{const r=setInterval(()=>{W(u=>u<s.length-1?u+1:0)},(m.speed||2)*1e3);return L||clearInterval(r),()=>clearInterval(r)},[s,L,m.speed]);const i=Ee.getSliderMarks(s,$,m.showOnlyActiveDate,m.dateFormat||"yyyy");return t.jsxRuntimeExports.jsx("div",{className:`${F||"light"} flex ${a?"w-fit grow-0":"w-full grow"}`,dir:V==="he"||V==="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 ${V||"en"}`,a?"w-fit":"w-full",f?.graphContainer),style:{...v?.graphContainer||{},...C&&C!==!0?{backgroundColor:C}:{}},id:g,ref:E,"aria-label":_||`${k?`The graph shows ${k}. `:""}This is a dot density map showing the distribution of a variable across a region or world, with each dot representing a data point.${b?` ${b}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:C?H||"1rem":H||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||b||ne||G?t.jsxRuntimeExports.jsx(Le.GraphHeader,{styles:{title:v?.title,description:v?.description},classNames:{title:f?.title,description:f?.description},graphTitle:k,graphDescription:b,width:a,graphDownload:ne?E.current:void 0,dataDownload:G?l.map(r=>r.data).filter(r=>r!==void 0).length>0?l.map(r=>r.data).filter(r=>r!==void 0):l.filter(r=>r!==void 0):null}):null,m.enabled&&s.length>0&&i?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{fe(!L)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":L?"Click to pause animation":"Click to play animation",children:L?t.jsxRuntimeExports.jsx(be.Pause,{}):t.jsxRuntimeExports.jsx(be.Play,{})}),t.jsxRuntimeExports.jsx(Ee.xr,{min:s[0],max:s[s.length-1],marks:i,step:null,defaultValue:s[s.length-1],value:s[$],onChangeComplete:r=>{W(s.indexOf(r))},onChange:r=>{W(s.indexOf(r))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:o,"aria-label":"Map area",children:(a||p)&&(d||Z)&&e?t.jsxRuntimeExports.jsx(We,{data:l.filter(r=>m.enabled?r.date===ve.format(new Date(s[$]),m.dateFormat||"yyyy"):r),mapData:le?e:{...e,features:e.features.filter(r=>r.properties.NAME!=="Antarctica")},colorDomain:l.filter(r=>r.color).length===0?[]:Q||we.uniqBy(l,"color",!0),width:a||p,height:Math.max(y,d||(h?y?(a||p)*h>y?(a||p)*h:y:(a||p)*h:Z)),scale:ee,centerPoint:te,colors:l.filter(r=>r.color).length===0?q?[q]:[R.Colors.primaryColors["blue-600"]]:q||R.Colors[F].categoricalColors.colors,colorLegendTitle:M,radius:xe,mapBorderWidth:re,mapNoDataColor:he,mapBorderColor:oe,tooltip:A,onSeriesMouseOver:D,showLabels:ge,isWorldMap:ae,showColorScale:ye,zoomScaleExtend:z,zoomTranslateExtend:O,onSeriesMouseClick:se,highlightedDataPoints:ie,resetSelectionOnDoubleClick:P,styles:v,classNames:f,zoomInteraction:X,detailsOnClick:U,mapProjection:ce||(ae?"naturalEarth":"mercator"),animate:Y===!0?{duration:.5,once:!0,amount:.5}:Y||{duration:0,once:!0,amount:0},dimmedOpacity:K,customLayers:I,maxRadiusValue:ze.checkIfNullOrUndefined(B)?Math.max(...l.map(r=>r.radius).filter(r=>r!=null)):B,collapseColorScaleByDefault:S}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(y,d||(h?y?(a||p)*h>y?(a||p)*h:y:(a||p)*h:Z))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(ke.y,{"aria-label":"Loading graph"})})}),j||J?t.jsxRuntimeExports.jsx(Ie.GraphFooter,{styles:{footnote:v?.footnote,source:v?.source},classNames:{footnote:f?.footnote,source:f?.source},sources:j,footNote:J,width:a}):null]})})})})}exports.DotDensityMap=He;
|
|
2
2
|
//# sourceMappingURL=DotDensityMap.cjs.map
|