@undp/data-viz 1.3.0 → 1.3.1
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 +2 -0
- package/dist/AreaChart.cjs.map +1 -0
- package/dist/AreaChart.js +530 -1
- package/dist/AreaChart.js.map +1 -1
- package/dist/Axis-DE7dSn1_.cjs +2 -0
- package/dist/{Axis-BlyBRMNw.cjs.map → Axis-DE7dSn1_.cjs.map} +1 -1
- package/dist/{Axis-CvK-w3E2.js → Axis-Ddg-seDi.js} +10 -11
- package/dist/{Axis-CvK-w3E2.js.map → Axis-Ddg-seDi.js.map} +1 -1
- package/dist/AxisTitle-BmHLMRJZ.js +20 -0
- package/dist/{AxisTitle-BeMxcw5I.js.map → AxisTitle-BmHLMRJZ.js.map} +1 -1
- package/dist/AxisTitle-CK9YeovX.cjs +2 -0
- package/dist/{AxisTitle-BY8MI9jC.cjs.map → AxisTitle-CK9YeovX.cjs.map} +1 -1
- package/dist/BarGraph.cjs +2 -0
- package/dist/BarGraph.cjs.map +1 -0
- package/dist/BarGraph.js +4043 -1
- package/dist/BarGraph.js.map +1 -1
- package/dist/BasicStatCard.cjs +2 -0
- package/dist/BasicStatCard.cjs.map +1 -0
- package/dist/BasicStatCard.js +190 -1
- package/dist/BasicStatCard.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +2 -0
- package/dist/BeeSwarmChart.cjs.map +1 -0
- package/dist/BeeSwarmChart.d.ts +0 -8
- package/dist/BeeSwarmChart.js +1042 -1
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +2 -0
- package/dist/BiVariateChoroplethMap.cjs.map +1 -0
- package/dist/BiVariateChoroplethMap.js +720 -1
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +2 -0
- package/dist/BulletChart.cjs.map +1 -0
- package/dist/BulletChart.js +1431 -1
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +2 -0
- package/dist/ButterflyChart.cjs.map +1 -0
- package/dist/ButterflyChart.js +692 -1
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +2 -0
- package/dist/ChoroplethMap.cjs.map +1 -0
- package/dist/ChoroplethMap.js +745 -1
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +2 -0
- package/dist/CirclePackingGraph.cjs.map +1 -0
- package/dist/CirclePackingGraph.d.ts +0 -8
- package/dist/CirclePackingGraph.js +14 -1
- package/dist/CirclePackingGraph.js.map +1 -1
- package/dist/ColorLegend.cjs +2 -0
- package/dist/ColorLegend.cjs.map +1 -0
- package/dist/ColorLegend.js +47 -1
- package/dist/ColorLegend.js.map +1 -1
- package/dist/ColorLegendWithMouseOver.cjs +2 -0
- package/dist/ColorLegendWithMouseOver.cjs.map +1 -0
- package/dist/ColorLegendWithMouseOver.js +70 -1
- package/dist/ColorLegendWithMouseOver.js.map +1 -1
- package/dist/Colors.cjs +2 -0
- package/dist/Colors.cjs.map +1 -0
- package/dist/Colors.js +561 -1
- package/dist/Colors.js.map +1 -1
- package/dist/CopyTextButton.cjs +17 -0
- package/dist/CopyTextButton.cjs.map +1 -0
- package/dist/CopyTextButton.js +698 -16
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +23 -0
- package/dist/CsvDownloadButton.cjs.map +1 -0
- package/dist/CsvDownloadButton.js +852 -7
- package/dist/CsvDownloadButton.js.map +1 -1
- package/dist/DataCards.cjs +2 -0
- package/dist/DataCards.cjs.map +1 -0
- package/dist/DataCards.js +14 -1
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +2 -0
- package/dist/DataTable.cjs.map +1 -0
- package/dist/DataTable.js +331 -1
- package/dist/DataTable.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +2 -0
- package/dist/DifferenceLineChart.cjs.map +1 -0
- package/dist/DifferenceLineChart.js +805 -1
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +2 -0
- package/dist/DonutChart.cjs.map +1 -0
- package/dist/DonutChart.js +478 -1
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +2 -0
- package/dist/DotDensityMap.cjs.map +1 -0
- package/dist/DotDensityMap.js +600 -1
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/DropdownSelect-0I2QxaVy.cjs +29 -0
- package/dist/DropdownSelect-0I2QxaVy.cjs.map +1 -0
- package/dist/DropdownSelect-CDC9lEqU.js +4193 -0
- package/dist/DropdownSelect-CDC9lEqU.js.map +1 -0
- package/dist/DualAxisLineChart.cjs +2 -0
- package/dist/DualAxisLineChart.cjs.map +1 -0
- package/dist/DualAxisLineChart.js +699 -1
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +2 -0
- package/dist/DumbbellChart.cjs.map +1 -0
- package/dist/DumbbellChart.js +1510 -1
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/{EmptyState-b2Ln487i.js → EmptyState-DdTp-Mdn.js} +8 -8
- package/dist/{EmptyState-b2Ln487i.js.map → EmptyState-DdTp-Mdn.js.map} +1 -1
- package/dist/EmptyState-d8_8SxeW.cjs +2 -0
- package/dist/{EmptyState-BQguKAp5.cjs.map → EmptyState-d8_8SxeW.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +2 -0
- package/dist/ExcelDownloadButton.cjs.map +1 -0
- package/dist/ExcelDownloadButton.js +29 -1
- package/dist/ExcelDownloadButton.js.map +1 -1
- package/dist/FootNote.cjs +2 -0
- package/dist/FootNote.cjs.map +1 -0
- package/dist/FootNote.js +20 -1
- package/dist/FootNote.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +2 -0
- package/dist/GeoHubCompareMaps.cjs.map +1 -0
- package/dist/GeoHubCompareMaps.js +370 -1
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +2 -0
- package/dist/GeoHubMap.cjs.map +1 -0
- package/dist/GeoHubMap.js +429 -1
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +2 -0
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -0
- package/dist/GeoHubMapWithLayerSelection.js +307 -1
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +2 -0
- package/dist/GraphDescription.cjs.map +1 -0
- package/dist/GraphDescription.js +20 -1
- package/dist/GraphDescription.js.map +1 -1
- package/dist/GraphFooter.cjs +2 -0
- package/dist/GraphFooter.cjs.map +1 -0
- package/dist/GraphFooter.js +21 -1
- package/dist/GraphFooter.js.map +1 -1
- package/dist/GraphHeader.cjs +2 -0
- package/dist/GraphHeader.cjs.map +1 -0
- package/dist/GraphHeader.js +63 -1
- package/dist/GraphHeader.js.map +1 -1
- package/dist/GraphTitle.cjs +2 -0
- package/dist/GraphTitle.cjs.map +1 -0
- package/dist/GraphTitle.js +28 -1
- package/dist/GraphTitle.js.map +1 -1
- package/dist/GriddedGraphs.cjs +2 -0
- package/dist/GriddedGraphs.cjs.map +1 -0
- package/dist/GriddedGraphs.js +482 -1
- package/dist/GriddedGraphs.js.map +1 -1
- package/dist/GriddedGraphsFromConfig.cjs +2 -0
- package/dist/GriddedGraphsFromConfig.cjs.map +1 -0
- package/dist/GriddedGraphsFromConfig.js +42 -1
- package/dist/GriddedGraphsFromConfig.js.map +1 -1
- package/dist/HeatMap.cjs +2 -0
- package/dist/HeatMap.cjs.map +1 -0
- package/dist/HeatMap.js +451 -1
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +2 -0
- package/dist/Histogram.cjs.map +1 -0
- package/dist/Histogram.js +287 -1
- package/dist/Histogram.js.map +1 -1
- package/dist/ImageDownloadButton.cjs +2 -0
- package/dist/ImageDownloadButton.cjs.map +1 -0
- package/dist/ImageDownloadButton.js +28 -1
- package/dist/ImageDownloadButton.js.map +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +2 -0
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -0
- package/dist/LineChartWithConfidenceInterval.js +818 -1
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/LinearColorLegend.cjs +2 -0
- package/dist/LinearColorLegend.cjs.map +1 -0
- package/dist/LinearColorLegend.js +33 -1
- package/dist/LinearColorLegend.js.map +1 -1
- package/dist/Modal-CUU6ZK3U.js +1019 -0
- package/dist/Modal-CUU6ZK3U.js.map +1 -0
- package/dist/Modal-C_dl0EtQ.cjs +46 -0
- package/dist/Modal-C_dl0EtQ.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +2 -0
- package/dist/MultiGraphDashboard.cjs.map +1 -0
- package/dist/MultiGraphDashboard.js +303 -1
- package/dist/MultiGraphDashboard.js.map +1 -1
- package/dist/MultiGraphDashboardFromConfig.cjs +2 -0
- package/dist/MultiGraphDashboardFromConfig.cjs.map +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +37 -1
- package/dist/MultiGraphDashboardFromConfig.js.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +2 -0
- package/dist/MultiGraphDashboardWideToLongFormat.cjs.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormat.js +243 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +2 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +30 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -1
- package/dist/MultiLineAltChart.cjs +2 -0
- package/dist/MultiLineAltChart.cjs.map +1 -0
- package/dist/MultiLineAltChart.js +689 -1
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +2 -0
- package/dist/MultiLineChart.cjs.map +1 -0
- package/dist/MultiLineChart.js +722 -1
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +2 -0
- package/dist/ParetoChart.cjs.map +1 -0
- package/dist/ParetoChart.js +636 -1
- package/dist/ParetoChart.js.map +1 -1
- package/dist/RadarChart.cjs +2 -0
- package/dist/RadarChart.cjs.map +1 -0
- package/dist/RadarChart.js +677 -1
- package/dist/RadarChart.js.map +1 -1
- package/dist/{ReferenceLine-BgDdQbDI.js → ReferenceLine-C1GpoG9d.js} +33 -34
- package/dist/ReferenceLine-C1GpoG9d.js.map +1 -0
- package/dist/ReferenceLine-CuFMk0cI.cjs +2 -0
- package/dist/ReferenceLine-CuFMk0cI.cjs.map +1 -0
- package/dist/RegressionLine-7_rKTHN_.cjs +2 -0
- package/dist/{RegressionLine-BfpCuD7B.cjs.map → RegressionLine-7_rKTHN_.cjs.map} +1 -1
- package/dist/{RegressionLine-cSljpHaE.js → RegressionLine-BFwDCTUU.js} +17 -18
- package/dist/{RegressionLine-cSljpHaE.js.map → RegressionLine-BFwDCTUU.js.map} +1 -1
- package/dist/SVGDownloadButton.cjs +2 -0
- package/dist/SVGDownloadButton.cjs.map +1 -0
- package/dist/SVGDownloadButton.js +28 -1
- package/dist/SVGDownloadButton.js.map +1 -1
- package/dist/SankeyChart.cjs +2 -0
- package/dist/SankeyChart.cjs.map +1 -0
- package/dist/SankeyChart.js +989 -1
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +2 -0
- package/dist/ScatterPlot.cjs.map +1 -0
- package/dist/ScatterPlot.js +828 -1
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.cjs +2 -0
- package/dist/ScrollStory.cjs.map +1 -0
- package/dist/ScrollStory.js +105 -1
- package/dist/ScrollStory.js.map +1 -1
- package/dist/SimpleLineChart.cjs +2 -0
- package/dist/SimpleLineChart.cjs.map +1 -0
- package/dist/SimpleLineChart.js +619 -1
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +2 -0
- package/dist/SingleGraphDashboard.cjs.map +1 -0
- package/dist/SingleGraphDashboard.js +522 -1
- package/dist/SingleGraphDashboard.js.map +1 -1
- package/dist/SingleGraphDashboardFromConfig.cjs +2 -0
- package/dist/SingleGraphDashboardFromConfig.cjs.map +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +34 -1
- package/dist/SingleGraphDashboardFromConfig.js.map +1 -1
- package/dist/SlopeChart.cjs +2 -0
- package/dist/SlopeChart.cjs.map +1 -0
- package/dist/SlopeChart.js +582 -1
- package/dist/SlopeChart.js.map +1 -1
- package/dist/Source.cjs +2 -0
- package/dist/Source.cjs.map +1 -0
- package/dist/Source.js +40 -1
- package/dist/Source.js.map +1 -1
- package/dist/SparkLine.cjs +2 -0
- package/dist/SparkLine.cjs.map +1 -0
- package/dist/SparkLine.js +320 -1
- package/dist/SparkLine.js.map +1 -1
- package/dist/Spinner-C85UF28E.js +30 -0
- package/dist/Spinner-C85UF28E.js.map +1 -0
- package/dist/Spinner-DA6Z5E4n.cjs +2 -0
- package/dist/Spinner-DA6Z5E4n.cjs.map +1 -0
- package/dist/StatCardFromData.cjs +2 -0
- package/dist/StatCardFromData.cjs.map +1 -0
- package/dist/StatCardFromData.js +249 -1
- package/dist/StatCardFromData.js.map +1 -1
- package/dist/StripChart.cjs +2 -0
- package/dist/StripChart.cjs.map +1 -0
- package/dist/StripChart.js +988 -1
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +2 -0
- package/dist/ThreeDGlobe.cjs.map +1 -0
- package/dist/ThreeDGlobe.js +451 -1
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +2 -0
- package/dist/ThresholdColorLegendWithMouseOver.cjs.map +1 -0
- package/dist/ThresholdColorLegendWithMouseOver.js +130 -1
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -1
- package/dist/{Tooltip-CzZ1wFyF.js → Tooltip-DyM5snqx.js} +15 -16
- package/dist/{Tooltip-CzZ1wFyF.js.map → Tooltip-DyM5snqx.js.map} +1 -1
- package/dist/Tooltip-n8z5bfav.cjs +2 -0
- package/dist/{Tooltip-BM18N_3l.cjs.map → Tooltip-n8z5bfav.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +2 -0
- package/dist/TreeMapGraph.cjs.map +1 -0
- package/dist/TreeMapGraph.js +760 -1
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.cjs +2 -0
- package/dist/Types.cjs.map +1 -0
- package/dist/Types.js +1 -1
- package/dist/Typography-Ctgfl1J5.js +140 -0
- package/dist/Typography-Ctgfl1J5.js.map +1 -0
- package/dist/Typography-k-kOjICQ.cjs +2 -0
- package/dist/Typography-k-kOjICQ.cjs.map +1 -0
- package/dist/UnitChart.cjs +2 -0
- package/dist/UnitChart.cjs.map +1 -0
- package/dist/UnitChart.js +216 -1
- package/dist/UnitChart.js.map +1 -1
- package/dist/XAxesLabels-CJMQbfVy.cjs +2 -0
- package/dist/{XAxesLabels-C9REbQQs.cjs.map → XAxesLabels-CJMQbfVy.cjs.map} +1 -1
- package/dist/{XAxesLabels-DVw7Lvuz.js → XAxesLabels-DQFo_z2R.js} +21 -22
- package/dist/{XAxesLabels-DVw7Lvuz.js.map → XAxesLabels-DQFo_z2R.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CUefTINd.js → XTicksAndGridLines-Bn9u5gOM.js} +19 -20
- package/dist/{XTicksAndGridLines-CUefTINd.js.map → XTicksAndGridLines-Bn9u5gOM.js.map} +1 -1
- package/dist/XTicksAndGridLines-CCzXIV8d.cjs +2 -0
- package/dist/{XTicksAndGridLines-DuK35ROS.cjs.map → XTicksAndGridLines-CCzXIV8d.cjs.map} +1 -1
- package/dist/YAxesLabels-BXLTX7AI.cjs +2 -0
- package/dist/{YAxesLabels-DhBdLk3Z.cjs.map → YAxesLabels-BXLTX7AI.cjs.map} +1 -1
- package/dist/{YAxesLabels-CYVY053X.js → YAxesLabels-H5-002X5.js} +11 -12
- package/dist/{YAxesLabels-CYVY053X.js.map → YAxesLabels-H5-002X5.js.map} +1 -1
- package/dist/{YTicksAndGridLines-BJRXuBdC.js → YTicksAndGridLines-B6ah7CRf.js} +14 -15
- package/dist/{YTicksAndGridLines-BJRXuBdC.js.map → YTicksAndGridLines-B6ah7CRf.js.map} +1 -1
- package/dist/YTicksAndGridLines-DBDuz6vb.cjs +2 -0
- package/dist/{YTicksAndGridLines-CtLvzExe.cjs.map → YTicksAndGridLines-DBDuz6vb.cjs.map} +1 -1
- package/dist/{checkIfMultiple-CaefP4X2.js → checkIfMultiple-BB7PlCNh.js} +1013 -518
- package/dist/checkIfMultiple-BB7PlCNh.js.map +1 -0
- package/dist/checkIfMultiple-D5ysrI7G.cjs +12 -0
- package/dist/checkIfMultiple-D5ysrI7G.cjs.map +1 -0
- package/dist/checkIfNullOrUndefined-BCW3Y1ML.cjs +2 -0
- package/dist/checkIfNullOrUndefined-BCW3Y1ML.cjs.map +1 -0
- package/dist/checkIfNullOrUndefined-DmfiKkNw.js +7 -0
- package/dist/checkIfNullOrUndefined-DmfiKkNw.js.map +1 -0
- package/dist/customArea-BYNyxAkm.cjs +2 -0
- package/dist/{customArea-B47Ew5cT.cjs.map → customArea-BYNyxAkm.cjs.map} +1 -1
- package/dist/{customArea-I3MsoqIl.js → customArea-CaxScFmW.js} +29 -30
- package/dist/{customArea-I3MsoqIl.js.map → customArea-CaxScFmW.js.map} +1 -1
- package/dist/excelDownload-BOA-lskf.js +19 -0
- package/dist/excelDownload-BOA-lskf.js.map +1 -0
- package/dist/excelDownload-BQpsCa62.cjs +2 -0
- package/dist/excelDownload-BQpsCa62.cjs.map +1 -0
- package/dist/fetchAndParseData-Bcmr659B.js +1196 -0
- package/dist/fetchAndParseData-Bcmr659B.js.map +1 -0
- package/dist/fetchAndParseData-DmgQtB9n.cjs +16 -0
- package/dist/fetchAndParseData-DmgQtB9n.cjs.map +1 -0
- package/dist/fetchAndParseData.cjs +2 -0
- package/dist/fetchAndParseData.cjs.map +1 -0
- package/dist/fetchAndParseData.js +9 -15
- package/dist/fetchAndParseData.js.map +1 -1
- package/dist/getGraphList-DuColTJM.js +265 -0
- package/dist/getGraphList-DuColTJM.js.map +1 -0
- package/dist/getGraphList-gf02xgT2.cjs +2 -0
- package/dist/getGraphList-gf02xgT2.cjs.map +1 -0
- package/dist/getJenks-TWQvbuOz.cjs +2 -0
- package/dist/getJenks-TWQvbuOz.cjs.map +1 -0
- package/dist/getJenks-VhM3GIoC.js +23 -0
- package/dist/getJenks-VhM3GIoC.js.map +1 -0
- package/dist/getSchema.cjs +2 -0
- package/dist/getSchema.cjs.map +1 -0
- package/dist/getSchema.js +910 -1
- package/dist/getSchema.js.map +1 -1
- package/dist/getSliderMarks-C0jptXeP.js +1054 -0
- package/dist/getSliderMarks-C0jptXeP.js.map +1 -0
- package/dist/getSliderMarks-CtsEXiLV.cjs +6 -0
- package/dist/getSliderMarks-CtsEXiLV.cjs.map +1 -0
- package/dist/getTextColorBasedOnBgColor-B6Nk2WBf.js +28 -0
- package/dist/getTextColorBasedOnBgColor-B6Nk2WBf.js.map +1 -0
- package/dist/getTextColorBasedOnBgColor-nqY-bsM_.cjs +2 -0
- package/dist/getTextColorBasedOnBgColor-nqY-bsM_.cjs.map +1 -0
- package/dist/getUniqValue-BtUENB2H.js +20 -0
- package/dist/getUniqValue-BtUENB2H.js.map +1 -0
- package/dist/getUniqValue-CHqgSss5.cjs +2 -0
- package/dist/getUniqValue-CHqgSss5.cjs.map +1 -0
- package/dist/imageDownload-CgDcm1Sj.cjs +3 -0
- package/dist/imageDownload-CgDcm1Sj.cjs.map +1 -0
- package/dist/imageDownload-Dcci2LEy.js +495 -0
- package/dist/imageDownload-Dcci2LEy.js.map +1 -0
- package/dist/index-BVnYktl4.js +435 -0
- package/dist/index-BVnYktl4.js.map +1 -0
- package/dist/index-BW_-wD2k.cjs +2 -0
- package/dist/index-BW_-wD2k.cjs.map +1 -0
- package/dist/{index-DXmF_0ez.js → index-BmCqpO1B.js} +74 -40
- package/dist/index-BmCqpO1B.js.map +1 -0
- package/dist/{index-Db-Yg_Ud.js → index-BxAUvrua.js} +19 -19
- package/dist/{index-Db-Yg_Ud.js.map → index-BxAUvrua.js.map} +1 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js +3341 -0
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +1 -0
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +44 -0
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +1 -0
- package/dist/index-CylX-pWB.cjs +2 -0
- package/dist/{index-BYroABPm.cjs.map → index-CylX-pWB.cjs.map} +1 -1
- package/dist/index-D9h2WYDS.cjs +22 -0
- package/dist/index-D9h2WYDS.cjs.map +1 -0
- package/dist/index-DG3YrCr5-D3FrrXj8.js +459 -0
- package/dist/index-DG3YrCr5-D3FrrXj8.js.map +1 -0
- package/dist/index-DG3YrCr5-v7rayV3N.cjs +2 -0
- package/dist/index-DG3YrCr5-v7rayV3N.cjs.map +1 -0
- package/dist/index-DVOJ7vxH.cjs +10 -0
- package/dist/{index-a2C2Bqn2.cjs.map → index-DVOJ7vxH.cjs.map} +1 -1
- package/dist/index-D_n8aamX.cjs +2 -0
- package/dist/index-D_n8aamX.cjs.map +1 -0
- package/dist/index-OCoyy1wG.js +635 -0
- package/dist/index-OCoyy1wG.js.map +1 -0
- package/dist/{index-DzdwZ2OA.js → index-n_RI8T0n.js} +3 -3
- package/dist/{index-DzdwZ2OA.js.map → index-n_RI8T0n.js.map} +1 -1
- package/dist/index-tvAyXPPW-DBlMKnNB.js +47 -0
- package/dist/index-tvAyXPPW-DBlMKnNB.js.map +1 -0
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +2 -0
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1 -5
- package/dist/index.js +180 -1
- package/dist/index.js.map +1 -1
- package/dist/numberFormattingFunction-02t-wJta.cjs +2 -0
- package/dist/numberFormattingFunction-02t-wJta.cjs.map +1 -0
- package/dist/numberFormattingFunction-14YCbkN2.js +13 -0
- package/dist/numberFormattingFunction-14YCbkN2.js.map +1 -0
- package/dist/{use-in-view-CZPXmTZM.js → proxy-DJxJg1kD.js} +699 -732
- package/dist/proxy-DJxJg1kD.js.map +1 -0
- package/dist/{use-in-view-Dl1CsAIo.cjs → proxy-PQd2AItT.cjs} +2 -2
- package/dist/proxy-PQd2AItT.cjs.map +1 -0
- package/dist/removeOutliers-DR48e-18.js +57 -0
- package/dist/removeOutliers-DR48e-18.js.map +1 -0
- package/dist/removeOutliers-WELHHqiI.cjs +2 -0
- package/dist/removeOutliers-WELHHqiI.cjs.map +1 -0
- package/dist/{string2HTML-BX0oNw83.js → string2HTML-CWHGfz_d.js} +2 -2
- package/dist/{string2HTML-BX0oNw83.js.map → string2HTML-CWHGfz_d.js.map} +1 -1
- package/dist/{string2HTML-X4ZYX5jI.cjs → string2HTML-D2Avudmb.cjs} +2 -2
- package/dist/{string2HTML-X4ZYX5jI.cjs.map → string2HTML-D2Avudmb.cjs.map} +1 -1
- package/dist/svgDownload-C2-E3yf2.js +9 -0
- package/dist/svgDownload-C2-E3yf2.js.map +1 -0
- package/dist/svgDownload-D9zEGjTF.cjs +2 -0
- package/dist/svgDownload-D9zEGjTF.cjs.map +1 -0
- package/dist/toConsumableArray-DiWOvh_d-DcLaZvDq.cjs +4 -0
- package/dist/toConsumableArray-DiWOvh_d-DcLaZvDq.cjs.map +1 -0
- package/dist/toConsumableArray-DiWOvh_d-DlpOlgap.js +145 -0
- package/dist/toConsumableArray-DiWOvh_d-DlpOlgap.js.map +1 -0
- package/dist/transformData.cjs +2 -0
- package/dist/transformData.cjs.map +1 -0
- package/dist/transformData.d.ts +170 -0
- package/dist/transformData.js +10 -0
- package/dist/transformData.js.map +1 -0
- package/dist/transformDataForAggregation-BUGJnson.cjs +2 -0
- package/dist/transformDataForAggregation-BUGJnson.cjs.map +1 -0
- package/dist/transformDataForAggregation-DAQJWGNL.js +759 -0
- package/dist/transformDataForAggregation-DAQJWGNL.js.map +1 -0
- package/dist/transformDataForGraphFromFile-CrntpaMU.cjs +2 -0
- package/dist/transformDataForGraphFromFile-CrntpaMU.cjs.map +1 -0
- package/dist/transformDataForGraphFromFile-DdNiOWeC.js +24 -0
- package/dist/transformDataForGraphFromFile-DdNiOWeC.js.map +1 -0
- package/dist/use-in-view-BAHrBy6b.js +40 -0
- package/dist/use-in-view-BAHrBy6b.js.map +1 -0
- package/dist/use-in-view-BCmzDU2O.cjs +2 -0
- package/dist/use-in-view-BCmzDU2O.cjs.map +1 -0
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +217 -0
- package/dist/utils.js +27 -0
- package/dist/utils.js.map +1 -0
- package/dist/validateSchema.cjs +2 -0
- package/dist/validateSchema.cjs.map +1 -0
- package/dist/validateSchema.js +104 -1
- package/dist/validateSchema.js.map +1 -1
- package/dist/x-CnsEH4Ox-CGGXQl4M.cjs +27 -0
- package/dist/x-CnsEH4Ox-CGGXQl4M.cjs.map +1 -0
- package/dist/x-CnsEH4Ox-DDvAJndW.js +101 -0
- package/dist/x-CnsEH4Ox-DDvAJndW.js.map +1 -0
- package/package.json +15 -90
- package/dist/Axis-BlyBRMNw.cjs +0 -2
- package/dist/AxisTitle-BY8MI9jC.cjs +0 -2
- package/dist/AxisTitle-BeMxcw5I.js +0 -21
- package/dist/DropdownSelect-CuzV7gdj.cjs +0 -29
- package/dist/DropdownSelect-CuzV7gdj.cjs.map +0 -1
- package/dist/DropdownSelect-DmZsXrhY.js +0 -2698
- package/dist/DropdownSelect-DmZsXrhY.js.map +0 -1
- package/dist/EmptyState-BQguKAp5.cjs +0 -2
- package/dist/Modal-C9txyGOk.js +0 -723
- package/dist/Modal-C9txyGOk.js.map +0 -1
- package/dist/Modal-cQF2UQIa.cjs +0 -46
- package/dist/Modal-cQF2UQIa.cjs.map +0 -1
- package/dist/ReferenceLine-BgDdQbDI.js.map +0 -1
- package/dist/ReferenceLine-Bsb5jeE4.cjs +0 -2
- package/dist/ReferenceLine-Bsb5jeE4.cjs.map +0 -1
- package/dist/RegressionLine-BfpCuD7B.cjs +0 -2
- package/dist/Spinner-DN3s4S0H.js +0 -17
- package/dist/Spinner-DN3s4S0H.js.map +0 -1
- package/dist/Spinner-UmN-KPe9.cjs +0 -2
- package/dist/Spinner-UmN-KPe9.cjs.map +0 -1
- package/dist/Tooltip-BM18N_3l.cjs +0 -2
- package/dist/Typography-CDR-DAHH.cjs +0 -2
- package/dist/Typography-CDR-DAHH.cjs.map +0 -1
- package/dist/Typography-XJoSE-By.js +0 -58
- package/dist/Typography-XJoSE-By.js.map +0 -1
- package/dist/XAxesLabels-C9REbQQs.cjs +0 -2
- package/dist/XTicksAndGridLines-DuK35ROS.cjs +0 -2
- package/dist/YAxesLabels-DhBdLk3Z.cjs +0 -2
- package/dist/YTicksAndGridLines-CtLvzExe.cjs +0 -2
- package/dist/checkIfMultiple-CaefP4X2.js.map +0 -1
- package/dist/checkIfMultiple-D3h8to1T.cjs +0 -12
- package/dist/checkIfMultiple-D3h8to1T.cjs.map +0 -1
- package/dist/checkIfNullOrUndefined.d.ts +0 -15
- package/dist/checkIfNullOrUndefined.js +0 -2
- package/dist/checkIfNullOrUndefined.js.map +0 -1
- package/dist/customArea-B47Ew5cT.cjs +0 -2
- package/dist/excelDownload.d.ts +0 -31
- package/dist/excelDownload.js +0 -2
- package/dist/excelDownload.js.map +0 -1
- package/dist/generateCodes.d.ts +0 -25
- package/dist/generateCodes.js +0 -2
- package/dist/generateCodes.js.map +0 -1
- package/dist/getJenks.d.ts +0 -17
- package/dist/getJenks.js +0 -2
- package/dist/getJenks.js.map +0 -1
- package/dist/getPercentileValue.d.ts +0 -13
- package/dist/getPercentileValue.js +0 -2
- package/dist/getPercentileValue.js.map +0 -1
- package/dist/getQueryParamsFromLink.d.ts +0 -18
- package/dist/getQueryParamsFromLink.js +0 -2
- package/dist/getQueryParamsFromLink.js.map +0 -1
- package/dist/getSliderMarks-CWajGCGq.js +0 -719
- package/dist/getSliderMarks-CWajGCGq.js.map +0 -1
- package/dist/getSliderMarks-DDJ1CdhL.cjs +0 -6
- package/dist/getSliderMarks-DDJ1CdhL.cjs.map +0 -1
- package/dist/getTextColorBasedOnBgColor.d.ts +0 -13
- package/dist/getTextColorBasedOnBgColor.js +0 -2
- package/dist/getTextColorBasedOnBgColor.js.map +0 -1
- package/dist/getUniqValue.d.ts +0 -18
- package/dist/getUniqValue.js +0 -2
- package/dist/getUniqValue.js.map +0 -1
- package/dist/graphList.d.ts +0 -9
- package/dist/graphList.js +0 -2
- package/dist/graphList.js.map +0 -1
- package/dist/imageDownload.d.ts +0 -16
- package/dist/imageDownload.js +0 -3
- package/dist/imageDownload.js.map +0 -1
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs +0 -2
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +0 -1
- package/dist/index-01r5X3Gr-kH7FxQ7P.js +0 -451
- package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +0 -1
- package/dist/index-BGMGC-HN.cjs +0 -22
- package/dist/index-BGMGC-HN.cjs.map +0 -1
- package/dist/index-BHm2KTjD-2e-Fu8L-.js +0 -702
- package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +0 -1
- package/dist/index-BHm2KTjD-D8FylaKc.cjs +0 -44
- package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +0 -1
- package/dist/index-BIPNFFja.js +0 -506
- package/dist/index-BIPNFFja.js.map +0 -1
- package/dist/index-BYroABPm.cjs +0 -2
- package/dist/index-CEc_9zWy.cjs +0 -2
- package/dist/index-CEc_9zWy.cjs.map +0 -1
- package/dist/index-CbVeVrla.cjs +0 -2
- package/dist/index-CbVeVrla.cjs.map +0 -1
- package/dist/index-CqzhBPuO-CfQywbdq.js +0 -41
- package/dist/index-CqzhBPuO-CfQywbdq.js.map +0 -1
- package/dist/index-CqzhBPuO-raKZqS7l.cjs +0 -2
- package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +0 -1
- package/dist/index-DSnvdkHZ.js +0 -495
- package/dist/index-DSnvdkHZ.js.map +0 -1
- package/dist/index-DXmF_0ez.js.map +0 -1
- package/dist/index-a2C2Bqn2.cjs +0 -10
- package/dist/numberFormattingFunction.d.ts +0 -22
- package/dist/numberFormattingFunction.js +0 -2
- package/dist/numberFormattingFunction.js.map +0 -1
- package/dist/removeOutliers.d.ts +0 -16
- package/dist/removeOutliers.js +0 -2
- package/dist/removeOutliers.js.map +0 -1
- package/dist/svgDownload.d.ts +0 -16
- package/dist/svgDownload.js +0 -2
- package/dist/svgDownload.js.map +0 -1
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +0 -139
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +0 -1
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +0 -4
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +0 -1
- package/dist/transformColumnsToArray.d.ts +0 -38
- package/dist/transformColumnsToArray.js +0 -2
- package/dist/transformColumnsToArray.js.map +0 -1
- package/dist/transformDataForAggregation.d.ts +0 -38
- package/dist/transformDataForAggregation.js +0 -2
- package/dist/transformDataForAggregation.js.map +0 -1
- package/dist/transformDataForGraph.d.ts +0 -47
- package/dist/transformDataForGraph.js +0 -2
- package/dist/transformDataForGraph.js.map +0 -1
- package/dist/transformDataForGraphFromFile.d.ts +0 -66
- package/dist/transformDataForGraphFromFile.js +0 -2
- package/dist/transformDataForGraphFromFile.js.map +0 -1
- package/dist/use-in-view-CZPXmTZM.js.map +0 -1
- package/dist/use-in-view-Dl1CsAIo.cjs.map +0 -1
- package/dist/x-Dft9NVe_-DcB7wtv5.js +0 -61
- package/dist/x-Dft9NVe_-DcB7wtv5.js.map +0 -1
- package/dist/x-Dft9NVe_-LeyJu02C.cjs +0 -27
- package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +0 -1
package/dist/BarGraph.js
CHANGED
|
@@ -1,2 +1,4044 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHm2KTjD-D8FylaKc.cjs"),De=require("./index-CZbIGs8q.cjs"),m=require("react"),$e=require("./index-BzeLQvXk.cjs"),Ee=require("./parse-hMnG_lRV.cjs"),Me=require("./Typography-CDR-DAHH.cjs"),Ce=require("./getSliderMarks-DDJ1CdhL.cjs"),Ae=require("./index-BXns0-ng.cjs"),ze=require("./Modal-cQF2UQIa.cjs"),Ie=require("./numberFormattingFunction.js"),Ve=require("./Tooltip-BM18N_3l.cjs"),Y=require("./checkIfNullOrUndefined.js"),Re=require("./Colors.js"),Le=require("./string2HTML-X4ZYX5jI.cjs"),Qe=require("./XTicksAndGridLines-DuK35ROS.cjs"),Ze=require("./YAxesLabels-DhBdLk3Z.cjs"),Be=require("./AxisTitle-BY8MI9jC.cjs"),Fe=require("./Axis-BlyBRMNw.cjs"),He=require("./ReferenceLine-Bsb5jeE4.cjs"),ge=require("./use-in-view-Dl1CsAIo.cjs"),Pe=require("./linear-BVckp9RD.cjs"),Te=require("./band-CAApY4Pd.cjs"),Ue=require("./index-a2C2Bqn2.cjs"),qe=require("./GraphFooter.js"),Ge=require("./GraphHeader.js"),We=require("./ColorLegendWithMouseOver.js"),Xe=require("./EmptyState-BQguKAp5.cjs"),Se=require("./index-CEc_9zWy.cjs"),Ne=require("./ensureCompleteData-DqWQ2Zbi.cjs"),Ye=require("./init-DU0ybBc_.cjs"),ke=require("./index-C21TvELx.cjs"),Je=require("./getTextColorBasedOnBgColor.js"),et=require("./XAxesLabels-C9REbQQs.cjs"),tt=require("./YTicksAndGridLines-CtLvzExe.cjs");function it(fe){const{data:l,barColor:p,suffix:P,prefix:A,barPadding:U,showValues:me,showTicks:de,leftMargin:he,truncateBy:Q,width:q,height:ie,colorDomain:I,rightMargin:oe,topMargin:xe,bottomMargin:R,showLabels:G,tooltip:_,onSeriesMouseOver:Z,refValues:E,selectedColor:f,highlightedDataPoints:L,maxValue:ae,minValue:se,onSeriesMouseClick:K,labelOrder:ee,rtl:ne,maxBarThickness:W,minBarThickness:pe,resetSelectionOnDoubleClick:ue,detailsOnClick:S,barAxisTitle:b,valueColor:g,noOfTicks:w,styles:D,classNames:N,animate:M,dimmedOpacity:z,precision:V,customLayers:v,naLabel:j}=fe,X=m.useRef(null),$=ge.useInView(X,{once:M.once,amount:M.amount}),[T,ce]=m.useState(void 0),[H,B]=m.useState(void 0),[re,C]=m.useState(void 0),[F,h]=m.useState(void 0),k={top:b?xe+25:xe,bottom:R,left:he,right:oe},y=q-k.left-k.right,u=ie-k.top-k.bottom,d=l.map((s,x)=>({...s,id:ee?`${s.label}`:`${x}`})),o=Pe.linear().domain([se,ae]).range([0,y]).nice(),a=ee||d.map(s=>`${s.id}`),r=Te.band().domain(a).range([0,pe?Math.max(u,pe*a.length):W?Math.min(u,W*a.length):u]).paddingInner(U),t=o.ticks(w);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{ref:X,width:`${q}px`,height:`${ie}px`,viewBox:`0 0 ${q} ${ie}`,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${k.left},${k.top})`,children:[de?e.jsxRuntimeExports.jsx(Qe.XTicksAndGridLines,{values:t.filter(s=>s!==0),x:t.filter(s=>s!==0).map(s=>o(s)),y1:0-xe,y2:u+k.bottom,styles:{gridLines:D?.xAxis?.gridLines,labels:D?.xAxis?.labels},classNames:{gridLines:N?.xAxis?.gridLines,labels:N?.xAxis?.labels},suffix:P,prefix:A,labelType:"secondary",showGridLines:!0,precision:V}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:y/2,y:0-k.top+15,style:D?.xAxis?.title,className:N?.xAxis?.title,text:b}),v.filter(s=>s.position==="before").map(s=>s.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[d.map(s=>Y.checkIfNullOrUndefined(r(s.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:f?s.color&&p[I.indexOf(s.color)]===f?1:z:L.length!==0?L.indexOf(s.label)!==-1?.85:z:.85},whileInView:{opacity:f?s.color&&p[I.indexOf(s.color)]===f?1:z:L.length!==0?L.indexOf(s.label)!==-1?.85:z:.85,transition:{duration:M.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:M.duration}},onMouseEnter:x=>{ce(s),h(x.clientY),C(x.clientX),Z?.(s)},onClick:()=>{(K||S)&&(Ae.isEqual(H,s)&&ue?(B(void 0),K?.(void 0)):(B(s),K?.(s)))},onMouseMove:x=>{ce(s),h(x.clientY),C(x.clientX)},onMouseLeave:()=>{ce(void 0),C(void 0),h(void 0),Z?.(void 0)},children:[s.size?e.jsxRuntimeExports.jsx(ge.motion.rect,{variants:{initial:{width:0,x:o(0),y:r(`${s.id}`),fill:l.filter(x=>x.color).length===0?p[0]:s.color?p[I.indexOf(s.color)]:Re.Colors.gray},whileInView:{width:s.size>=0?o(s.size)-o(0):o(0)-o(s.size),x:s.size>=0?o(0):o(s.size),y:r(`${s.id}`),fill:l.filter(x=>x.color).length===0?p[0]:s.color?p[I.indexOf(s.color)]:Re.Colors.gray,transition:{duration:M.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{width:0,x:o(0),transition:{duration:M.duration}},height:r.bandwidth()}):null,G?e.jsxRuntimeExports.jsx(Ze.YAxesLabels,{value:`${s.label}`.length<Q?`${s.label}`:`${`${s.label}`.substring(0,Q)}...`,y:r(s.id)||0,x:(s.size||0)<0?o(0):0-k.left,width:(s.size||0)<0?q-o(0):o(0)+k.left,height:r.bandwidth(),alignment:s.size&&s.size<0?"left":"right",style:D?.yAxis?.labels,className:N?.yAxis?.labels,animate:M,isInView:$}):null,me?e.jsxRuntimeExports.jsx(ge.motion.text,{style:{textAnchor:s.size&&s.size<0?"end":"start",...D?.graphObjectValues||{}},className:Me.cnExports.cn("graph-value text-sm",!g&&p.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",N?.graphObjectValues),dx:s.size&&s.size<0?-5:5,dy:"0.33em",variants:{initial:{x:o(0),y:r(`${s.id}`)+r.bandwidth()/2,opacity:0,fill:g||(l.filter(x=>x.color).length===0?p[0]:s.color?p[I.indexOf(s.color)]:Re.Colors.gray)},whileInView:{x:s.size?o(s.size):o(0),opacity:1,y:r(`${s.id}`)+r.bandwidth()/2,fill:g||(l.filter(x=>x.color).length===0?p[0]:s.color?p[I.indexOf(s.color)]:Re.Colors.gray),transition:{duration:M.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:M.duration}},children:Ie.numberFormattingFunction(s.size,j,V,A,P)}):null]},s.label)),e.jsxRuntimeExports.jsx(Fe.Axis,{x1:o(se<0?0:se),x2:o(se<0?0:se),y1:-2.5,y2:u+k.bottom,classNames:{axis:N?.yAxis?.axis},styles:{axis:D?.yAxis?.axis}}),E?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:E.map((s,x)=>e.jsxRuntimeExports.jsx(He.RefLineX,{text:s.text,color:s.color,x:o(s.value),y1:0-k.top,y2:u+k.bottom,textSide:o(s.value)>y*.75||ne?"left":"right",classNames:s.classNames,styles:s.styles,animate:M,isInView:$},x))}):null]}),v.filter(s=>s.position==="after").map(s=>s.layer)]})}),T&&_&&re&&F?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:T,body:_,xPos:re,yPos:F,backgroundStyle:D?.tooltip,className:N?.tooltip}):null,S&&H!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:H!==void 0,onClose:()=>{B(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof S=="string"?{__html:Le.string2HTML(S,H)}:void 0,children:typeof S=="function"?S(H):null})}):null]})}function at(fe){const{data:l,graphTitle:p,colors:P,suffix:A="",sources:U,prefix:me="",graphDescription:de,barPadding:he=.25,showValues:Q=!0,showTicks:q=!0,leftMargin:ie=100,rightMargin:I=40,truncateBy:oe=999,height:xe,width:R,footNote:G,colorDomain:_,colorLegendTitle:Z,highlightedDataPoints:E=[],padding:f,backgroundColor:L=!1,topMargin:ae=25,bottomMargin:se=10,showLabels:K=!0,relativeHeight:ee,tooltip:ne,onSeriesMouseOver:W,refValues:pe,showColorScale:ue=!0,graphID:S,maxValue:b,minValue:g,onSeriesMouseClick:w,graphDownload:D=!1,dataDownload:N=!1,sortData:M,labelOrder:z,language:V="en",showNAColor:v=!0,minHeight:j=0,theme:X="light",maxBarThickness:$,maxNumberOfBars:T,minBarThickness:ce,ariaLabel:H,resetSelectionOnDoubleClick:B=!0,detailsOnClick:re,barAxisTitle:C,noOfTicks:F=5,valueColor:h,styles:k,classNames:y,filterNA:u=!0,animate:d=!1,dimmedOpacity:o=.3,precision:a=2,customLayers:r=[],timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:s="NA"}=fe,[x,Oe]=m.useState(0),[J,je]=m.useState(0),[ve,we]=m.useState(t.autoplay),le=Ce.sort(De.uniqBy(l.filter(i=>i.date!==void 0&&i.date!==null),i=>i.date).map(i=>Ee.parse(`${i.date}`,t.dateFormat||"yyyy",new Date).getTime()),(i,be)=>Ye.ascending(i,be)),[ye,c]=m.useState(t.autoplay?0:le.length-1),[te,n]=m.useState(void 0),O=m.useRef(null),_e=m.useRef(null);m.useEffect(()=>{const i=new ResizeObserver(be=>{Oe(R||be[0].target.clientWidth||620),je(xe||be[0].target.clientHeight||480)});return O.current&&(je(O.current.clientHeight||480),Oe(O.current.clientWidth||620),R||i.observe(O.current)),()=>i.disconnect()},[R,xe]),m.useEffect(()=>{const i=setInterval(()=>{c(be=>be<le.length-1?be+1:0)},(t.speed||2)*1e3);return ve||clearInterval(i),()=>clearInterval(i)},[le,ve,t.speed]);const Ke=Ce.getSliderMarks(le,ye,t.showOnlyActiveDate,t.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${X||"light"} flex ${R?"w-fit grow-0":"w-full grow"}`,dir:V==="he"||V==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${L?L===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${V||"en"}`,y?.graphContainer),style:{...k?.graphContainer||{},...L&&L!==!0?{backgroundColor:L}:{}},id:S,ref:_e,"aria-label":H||`${p?`The graph shows ${p}. `:""}This is a bar chart. ${de?` ${de}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:L?f||"1rem":f||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||de||D||N?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:k?.title,description:k?.description},classNames:{title:y?.title,description:y?.description},graphTitle:p,graphDescription:de,width:R,graphDownload:D?_e.current:void 0,dataDownload:N?l.map(i=>i.data).filter(i=>i!==void 0).length>0?l.map(i=>i.data).filter(i=>i!==void 0):l.filter(i=>i!==void 0):null}):null,t.enabled&&le.length>0&&Ke?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{we(!ve)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ve?"Click to pause animation":"Click to play animation",children:ve?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:le[0],max:le[le.length-1],marks:Ke,step:null,defaultValue:le[le.length-1],value:le[ye],onChangeComplete:i=>{c(le.indexOf(i))},onChange:i=>{c(le.indexOf(i))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[ue&&l.filter(i=>i.color).length!==0?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:R,colorLegendTitle:Z,colors:P||Re.Colors[X].categoricalColors.colors,colorDomain:_||De.uniqBy(l.filter(i=>i.color),"color").map(i=>i.color),setSelectedColor:n,showNAColor:v}):null,e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:O,"aria-label":"Graph area",children:(R||x)&&(xe||J)?e.jsxRuntimeExports.jsx(it,{data:M==="asc"?$e.sortBy(Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i),i=>i.size).filter((i,be)=>T?be<T:!0):M==="desc"?$e.sortBy(Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i),i=>i.size).reverse().filter((i,be)=>T?be<T:!0):Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i).filter((i,be)=>T?be<T:!0),barColor:l.filter(i=>i.color).length===0?P?[P]:[Re.Colors.primaryColors["blue-600"]]:P||Re.Colors[X].categoricalColors.colors,colorDomain:l.filter(i=>i.color).length===0?[]:_||De.uniqBy(l.filter(i=>i.color),"color").map(i=>i.color),width:R||x,selectedColor:te,height:Math.max(j,xe||(ee?j?(R||x)*ee>j?(R||x)*ee:j:(R||x)*ee:J)),suffix:A,prefix:me,barPadding:he,showValues:Q,showTicks:q,leftMargin:ie,rightMargin:I,topMargin:ae,bottomMargin:se,truncateBy:oe,showLabels:K,tooltip:ne,onSeriesMouseOver:W,refValues:pe,maxValue:Y.checkIfNullOrUndefined(b)?Math.max(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size))<0?0:Math.max(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size)):b,minValue:Y.checkIfNullOrUndefined(g)?Math.min(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size))>=0?0:Math.min(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size)):g,highlightedDataPoints:E,onSeriesMouseClick:w,labelOrder:z,rtl:V==="he"||V==="ar",maxBarThickness:$,minBarThickness:ce,resetSelectionOnDoubleClick:B,detailsOnClick:re,barAxisTitle:C,noOfTicks:F,valueColor:h,classNames:y,styles:k,animate:d===!0?{duration:.5,once:!0,amount:.5}:d||{duration:0,once:!0,amount:0},dimmedOpacity:o,precision:a,customLayers:r,naLabel:s}):null})]})}),U||G?e.jsxRuntimeExports.jsx(qe.GraphFooter,{sources:U,footNote:G,width:R,styles:{footnote:k?.footnote,source:k?.source},classNames:{footnote:y?.footnote,source:y?.source}}):null]})})})})}function st(fe){const{data:l,barColors:p,barPadding:P,showTicks:A,leftMargin:U,truncateBy:me,width:de,height:he,suffix:Q,prefix:q,showValues:ie,rightMargin:I,topMargin:oe,bottomMargin:xe,showLabels:R,tooltip:G,onSeriesMouseOver:_,refValues:Z,maxValue:E,minValue:f,onSeriesMouseClick:L,selectedColor:ae,rtl:se,labelOrder:K,maxBarThickness:ee,resetSelectionOnDoubleClick:ne,detailsOnClick:W,barAxisTitle:pe,valueColor:ue,noOfTicks:S,styles:b,classNames:g,animate:w,colorDomain:D,precision:N,customLayers:M,naLabel:z}=fe,V=m.useRef(null),v=ge.useInView(V,{once:w.once,amount:w.amount}),j={top:pe?oe+25:oe,bottom:xe,left:U,right:I},[X,$]=m.useState(void 0),[T,ce]=m.useState(void 0),[H,B]=m.useState(void 0),[re,C]=m.useState(void 0),F=de-j.left-j.right,h=he-j.top-j.bottom,k=l.map((r,t)=>({...r,id:K?`${r.label}`:`${t}`})),y=K||k.map(r=>`${r.id}`),u=Pe.linear().domain([f,E]).range([0,F]).nice(),d=Te.band().domain(y).range([0,ee?Math.min(h,ee*y.length):h]).paddingInner(P),o=Te.band().domain(l[0].size.map((r,t)=>`${t}`)).range([0,d.bandwidth()]).paddingInner(.1),a=u.ticks(S);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{ref:V,width:`${de}px`,height:`${he}px`,viewBox:`0 0 ${de} ${he}`,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${j.left},${j.top})`,children:[A?e.jsxRuntimeExports.jsx(Qe.XTicksAndGridLines,{values:a.filter(r=>r!==0),x:a.filter(r=>r!==0).map(r=>u(r)),y1:0-oe,y2:h+j.bottom,styles:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},classNames:{gridLines:g?.xAxis?.gridLines,labels:g?.xAxis?.labels},suffix:Q,prefix:q,labelType:"secondary",showGridLines:!0,precision:N}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:F/2,y:0-j.top+15,style:b?.xAxis?.title,className:g?.xAxis?.title,text:pe}),M.filter(r=>r.position==="before").map(r=>r.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[k.map(r=>Y.checkIfNullOrUndefined(d(r.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{variants:{initial:{x:0,y:d(`${r.id}`)},whileInView:{x:0,y:d(`${r.id}`),transition:{duration:w.duration}}},initial:"initial",animate:v?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},children:[r.size.map((t,s)=>e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-g-with-hover",opacity:ae?p[s]===ae?1:.3:.85,onMouseEnter:x=>{$({...r,sizeIndex:s}),C(x.clientY),B(x.clientX),_?.({...r,sizeIndex:s})},onMouseMove:x=>{$({...r,sizeIndex:s}),C(x.clientY),B(x.clientX)},onMouseLeave:()=>{$(void 0),B(void 0),C(void 0),_?.(void 0)},onClick:()=>{(L||W)&&(Ae.isEqual(T,{...r,sizeIndex:s})&&ne?(ce(void 0),L?.(void 0)):(ce({...r,sizeIndex:s}),L&&L({...r,sizeIndex:s})))},children:[Y.checkIfNullOrUndefined(t)?null:e.jsxRuntimeExports.jsx(ge.motion.rect,{y:o(`${s}`),variants:{initial:{width:0,x:u(0),fill:p[s]},whileInView:{width:Y.checkIfNullOrUndefined(t)?0:t>=0?u(t)-u(0):u(0)-u(t),x:t>=0?u(0):u(t),fill:p[s],transition:{duration:w.duration}}},exit:{width:0,x:u(0),transition:{duration:w.duration}},height:o.bandwidth(),initial:"initial",animate:v?"whileInView":"initial"}),ie?e.jsxRuntimeExports.jsx(ge.motion.text,{y:o(`${s}`)+o.bandwidth()/2,style:{fill:ue||p[s],textAnchor:t&&t<0?"end":"start",...b?.graphObjectValues||{}},className:Me.cnExports.cn("graph-value text-sm",g?.graphObjectValues),dx:t&&t<0?-5:5,dy:"0.33em",variants:{initial:{x:u(0),opacity:0},whileInView:{x:u(t||0),opacity:1,transition:{duration:w.duration}}},initial:"initial",animate:v?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},children:Ie.numberFormattingFunction(t,z,N,q,Q)}):null]},`${r.label}-${D[s]||s}`)),R?e.jsxRuntimeExports.jsx(Ze.YAxesLabels,{value:`${r.label}`.length<me?`${r.label}`:`${`${r.label}`.substring(0,me)}...`,y:0,x:0-j.left,width:u(f<0?0:f)+j.left,height:d.bandwidth(),style:b?.yAxis?.labels,className:g?.yAxis?.labels,animate:w,isInView:v}):null]},r.label)),e.jsxRuntimeExports.jsx(Fe.Axis,{x1:u(f<0?0:f),x2:u(f<0?0:f),y1:-2.5,y2:h+j.bottom,classNames:{axis:g?.yAxis?.axis},styles:{axis:b?.yAxis?.axis}}),Z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Z.map((r,t)=>e.jsxRuntimeExports.jsx(He.RefLineX,{text:r.text,color:r.color,x:u(r.value),y1:0-j.top,y2:h+j.bottom,textSide:u(r.value)>F*.75||se?"left":"right",classNames:r.classNames,styles:r.styles,animate:w,isInView:v},t))}):null]}),M.filter(r=>r.position==="after").map(r=>r.layer)]})}),X&&G&&H&&re?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:X,body:G,xPos:H,yPos:re,backgroundStyle:b?.tooltip,className:g?.tooltip}):null,W&&T!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:T!==void 0,onClose:()=>{ce(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:Le.string2HTML(W,T)}:void 0,children:typeof W=="function"?W(T):null})}):null]})}function rt(fe){const{data:l,graphTitle:p,colors:P=Re.Colors.light.categoricalColors.colors,sources:A,graphDescription:U,barPadding:me=.25,showTicks:de=!0,truncateBy:he=999,height:Q,width:q,footNote:ie,colorDomain:I,colorLegendTitle:oe,suffix:xe="",prefix:R="",showValues:G=!0,showColorScale:_=!0,padding:Z,backgroundColor:E=!1,leftMargin:f=100,rightMargin:L=40,topMargin:ae=25,bottomMargin:se=10,showLabels:K=!0,relativeHeight:ee,tooltip:ne,onSeriesMouseOver:W,refValues:pe,graphID:ue,maxValue:S,minValue:b,onSeriesMouseClick:g,graphDownload:w=!1,dataDownload:D=!1,language:N="en",labelOrder:M,minHeight:z=0,theme:V="light",maxBarThickness:v,ariaLabel:j,resetSelectionOnDoubleClick:X=!0,detailsOnClick:$,barAxisTitle:T,noOfTicks:ce=5,valueColor:H,styles:B,classNames:re,filterNA:C=!0,animate:F=!1,precision:h=2,customLayers:k=[],timeline:y={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:u="NA"}=fe,[d,o]=m.useState(0),[a,r]=m.useState(0),[t,s]=m.useState(y.autoplay),x=Ce.sort(De.uniqBy(l.filter(c=>c.date!==void 0&&c.date!==null),c=>c.date).map(c=>Ee.parse(`${c.date}`,y.dateFormat||"yyyy",new Date).getTime()),(c,te)=>Ye.ascending(c,te)),[Oe,J]=m.useState(y.autoplay?0:x.length-1),[je,ve]=m.useState(void 0),we=m.useRef(null),le=m.useRef(null);m.useEffect(()=>{const c=new ResizeObserver(te=>{o(q||te[0].target.clientWidth||620),r(Q||te[0].target.clientHeight||480)});return we.current&&(r(we.current.clientHeight||480),o(we.current.clientWidth||620),q||c.observe(we.current)),()=>c.disconnect()},[q,Q]),m.useEffect(()=>{const c=setInterval(()=>{J(te=>te<x.length-1?te+1:0)},(y.speed||2)*1e3);return t||clearInterval(c),()=>clearInterval(c)},[x,t,y.speed]);const ye=Ce.getSliderMarks(x,Oe,y.showOnlyActiveDate,y.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${V||"light"} flex ${q?"w-fit grow-0":"w-full grow"}`,dir:N==="he"||N==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${E?E===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${N||"en"}`,re?.graphContainer),style:{...B?.graphContainer||{},...E&&E!==!0?{backgroundColor:E}:{}},id:ue,ref:le,"aria-label":j||`${p?`The graph shows ${p}. `:""}This is a grouped bar chart. ${U?` ${U}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:E?Z||"1rem":Z||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[p||U||w||D?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:B?.title,description:B?.description},classNames:{title:re?.title,description:re?.description},graphTitle:p,graphDescription:U,width:q,graphDownload:w?le.current:void 0,dataDownload:D?l.map(c=>c.data).filter(c=>c!==void 0).length>0?l.map(c=>c.data).filter(c=>c!==void 0):l.filter(c=>c!==void 0):null}):null,y.enabled&&x.length>0&&ye?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{s(!t)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":t?"Click to pause animation":"Click to play animation",children:t?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:x[0],max:x[x.length-1],marks:ye,step:null,defaultValue:x[x.length-1],value:x[Oe],onChangeComplete:c=>{J(x.indexOf(c))},onChange:c=>{J(x.indexOf(c))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[_?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:q,colorDomain:I,colors:P,colorLegendTitle:oe,setSelectedColor:ve,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:we,"aria-label":"Graph area",children:(q||d)&&(Q||a)?e.jsxRuntimeExports.jsx(st,{data:Ne.ensureCompleteDataForStackedBarChart(l,y.dateFormat||"yyyy").filter(c=>y.enabled?c.date===Ee.format(new Date(x[Oe]),y.dateFormat||"yyyy"):c).filter(c=>C?!c.size.every(te=>te==null):c),barColors:P,width:q||d,height:Math.max(z,Q||(ee?z?(q||d)*ee>z?(q||d)*ee:z:(q||d)*ee:a)),suffix:xe,prefix:R,showValues:G,barPadding:me,showTicks:de,leftMargin:f,rightMargin:L,topMargin:ae,bottomMargin:se,truncateBy:he,showLabels:K,tooltip:ne,onSeriesMouseOver:W,refValues:pe,maxValue:Y.checkIfNullOrUndefined(S)?Math.max(...l.map(c=>Math.max(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te)))))<0?0:Math.max(...l.map(c=>Math.max(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te))))):S,minValue:Y.checkIfNullOrUndefined(b)?Math.min(...l.map(c=>Math.min(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te)))))>=0?0:Math.min(...l.map(c=>Math.min(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te))))):b,onSeriesMouseClick:g,selectedColor:je,labelOrder:M,rtl:N==="he"||N==="ar",maxBarThickness:v,resetSelectionOnDoubleClick:X,detailsOnClick:$,barAxisTitle:T,noOfTicks:ce,valueColor:H,styles:B,classNames:re,colorDomain:I,animate:F===!0?{duration:.5,once:!0,amount:.5}:F||{duration:0,once:!0,amount:0},precision:h,customLayers:k,naLabel:u}):null})]})}),A||ie?e.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:B?.footnote,source:B?.source},classNames:{footnote:re?.footnote,source:re?.source},sources:A,footNote:ie,width:q}):null]})})})})}function nt(fe){const{data:l,barColors:p,barPadding:P,showTicks:A,leftMargin:U,rightMargin:me,truncateBy:de,width:he,height:Q,topMargin:q,bottomMargin:ie,tooltip:I,onSeriesMouseOver:oe,showLabels:xe,suffix:R,prefix:G,showValues:_,refValues:Z,maxValue:E,onSeriesMouseClick:f,selectedColor:L,rtl:ae,labelOrder:se,maxBarThickness:K,minBarThickness:ee,resetSelectionOnDoubleClick:ne,detailsOnClick:W,barAxisTitle:pe,valueColor:ue,noOfTicks:S,styles:b,classNames:g,animate:w,colorDomain:D,precision:N,customLayers:M,naLabel:z}=fe,V=m.useRef(null),v=ge.useInView(V,{once:w.once,amount:w.amount}),j={top:pe?q+25:q,bottom:ie,left:U,right:me},[X,$]=m.useState(void 0),[T,ce]=m.useState(void 0),[H,B]=m.useState(void 0),[re,C]=m.useState(void 0),F=he-j.left-j.right,h=Q-j.top-j.bottom,k=l.map((a,r)=>({...a,id:se?`${a.label}`:`${r}`})),y=se||k.map(a=>`${a.id}`),u=Pe.linear().domain([0,E]).range([0,F]).nice(),d=Te.band().domain(y).range([0,ee?Math.max(h,ee*y.length):K?Math.min(h,K*y.length):h]).paddingInner(P),o=u.ticks(S);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{ref:V,width:`${he}px`,height:`${Q}px`,viewBox:`0 0 ${he} ${Q}`,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${j.left},${j.top})`,children:[A?e.jsxRuntimeExports.jsx(Qe.XTicksAndGridLines,{values:o.filter(a=>a!==0),x:o.filter(a=>a!==0).map(a=>u(a)),y1:0-q,y2:h+j.bottom,styles:{gridLines:b?.xAxis?.gridLines,labels:b?.xAxis?.labels},classNames:{gridLines:g?.xAxis?.gridLines,labels:g?.xAxis?.labels},suffix:R,prefix:G,labelType:"secondary",showGridLines:!0,precision:N}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:F/2,y:0-j.top+15,style:b?.xAxis?.title,className:g?.xAxis?.title,text:pe}),M.filter(a=>a.position==="before").map(a=>a.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[k.map(a=>Y.checkIfNullOrUndefined(d(a.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:0,y:d(`${a.id}`)},whileInView:{x:0,y:d(`${a.id}`),transition:{duration:w.duration}}},initial:"initial",animate:v?"whileInView":"initial",exit:{opacity:0,transition:{duration:w.duration}},children:[a.size.map((r,t)=>e.jsxRuntimeExports.jsxs(ge.motion.g,{opacity:L?p[t]===L?1:.3:1,onMouseEnter:s=>{$({...a,sizeIndex:t}),C(s.clientY),B(s.clientX),oe?.({...a,sizeIndex:t})},onMouseMove:s=>{$({...a,sizeIndex:t}),C(s.clientY),B(s.clientX)},onMouseLeave:()=>{$(void 0),B(void 0),C(void 0),oe?.(void 0)},onClick:()=>{(f||W)&&(Ae.isEqual(T,{...a,sizeIndex:t})&&ne?(ce(void 0),f?.(void 0)):(ce({...a,sizeIndex:t}),f&&f({...a,sizeIndex:t})))},children:[r?e.jsxRuntimeExports.jsx(ge.motion.rect,{y:0,style:{fill:p[t]},height:d.bandwidth(),exit:{width:0,x:u(0),transition:{duration:w.duration}},variants:{initial:{width:0,x:u(0),fill:p[t]},whileInView:{width:u(r||0),x:u(t===0?0:ke.sum(a.size.filter((s,x)=>x<t&&s))),fill:p[t],transition:{duration:w.duration}}},initial:"initial",animate:v?"whileInView":"initial"},t):null,_?e.jsxRuntimeExports.jsx(ge.motion.text,{y:d.bandwidth()/2,style:{textAnchor:"middle",...b?.graphObjectValues||{}},dy:"0.33em",className:Me.cnExports.cn("graph-value text-sm",g?.graphObjectValues),exit:{opacity:0,transition:{duration:w.duration}},variants:{initial:{x:u(0),opacity:0,fill:Je.getTextColorBasedOnBgColor(p[t])},whileInView:{x:u(t===0?0:ke.sum(a.size.filter((s,x)=>x<t&&s)))+u(r||0)/2,opacity:r&&u(r)/Ie.numberFormattingFunction(r,z,N,G,R).length>12?1:0,fill:Je.getTextColorBasedOnBgColor(p[t]),transition:{duration:w.duration}}},initial:"initial",animate:v?"whileInView":"initial",children:Ie.numberFormattingFunction(r,z,N,G,R)}):null]},`${a.label}-${D[t]||t}`)),xe?e.jsxRuntimeExports.jsx(Ze.YAxesLabels,{value:`${a.label}`.length<de?`${a.label}`:`${`${a.label}`.substring(0,de)}...`,y:0,x:0-j.left,width:0+j.left,height:d.bandwidth(),style:b?.yAxis?.labels,className:g?.yAxis?.labels,animate:w,isInView:v}):null,_?e.jsxRuntimeExports.jsx(ge.motion.text,{className:Me.cnExports.cn("graph-value graph-value-total text-sm",ue?"":" fill-primary-gray-700 dark:fill-primary-gray-300",g?.graphObjectValues),style:{...ue?{fill:ue}:{},textAnchor:"start",...b?.graphObjectValues||{}},y:d.bandwidth()/2,dx:5,dy:"0.33em",variants:{initial:{x:u(0),opacity:0},whileInView:{x:u(ke.sum(a.size.map(r=>r||0))),opacity:1,transition:{duration:w.duration}}},exit:{opacity:0,transition:{duration:w.duration}},initial:"initial",animate:v?"whileInView":"initial",children:Ie.numberFormattingFunction(ke.sum(a.size.filter(r=>r)),z,N,G,R)}):null]},a.label)),e.jsxRuntimeExports.jsx(Fe.Axis,{x1:u(0),x2:u(0),y1:-2.5,y2:h+j.bottom,classNames:{axis:g?.yAxis?.axis},styles:{axis:b?.yAxis?.axis}}),Z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Z.map((a,r)=>e.jsxRuntimeExports.jsx(He.RefLineX,{text:a.text,color:a.color,x:u(a.value),y1:0-j.top,y2:h+j.bottom,textSide:u(a.value)>F*.75||ae?"left":"right",classNames:a.classNames,styles:a.styles,animate:w,isInView:v},r))}):null]}),M.filter(a=>a.position==="after").map(a=>a.layer)]})}),X&&I&&H&&re?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:X,body:I,xPos:H,yPos:re,backgroundStyle:b?.tooltip,className:g?.tooltip}):null,W&&T!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:T!==void 0,onClose:()=>{ce(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof W=="string"?{__html:Le.string2HTML(W,T)}:void 0,children:typeof W=="function"?W(T):null})}):null]})}function lt(fe){const{data:l,graphTitle:p,colors:P=Re.Colors.light.categoricalColors.colors,sources:A,graphDescription:U,barPadding:me=.25,showTicks:de=!0,leftMargin:he=100,rightMargin:Q=40,truncateBy:q=999,height:ie,width:I,footNote:oe,colorDomain:xe,colorLegendTitle:R,padding:G,backgroundColor:_=!1,topMargin:Z=25,bottomMargin:E=10,tooltip:f,onSeriesMouseOver:L,suffix:ae="",prefix:se="",showLabels:K=!0,relativeHeight:ee,showValues:ne=!0,refValues:W,graphID:pe,maxValue:ue,onSeriesMouseClick:S,graphDownload:b=!1,dataDownload:g=!1,language:w="en",labelOrder:D,minHeight:N=0,theme:M="light",maxBarThickness:z,sortParameter:V,maxNumberOfBars:v,minBarThickness:j,showColorScale:X=!0,ariaLabel:$,resetSelectionOnDoubleClick:T=!0,detailsOnClick:ce,barAxisTitle:H,noOfTicks:B=5,valueColor:re,styles:C,classNames:F,filterNA:h=!0,animate:k=!1,precision:y=2,customLayers:u=[],timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:o="NA"}=fe,[a,r]=m.useState(0),[t,s]=m.useState(0),[x,Oe]=m.useState(d.autoplay),J=Ce.sort(De.uniqBy(l.filter(n=>n.date!==void 0&&n.date!==null),n=>n.date).map(n=>Ee.parse(`${n.date}`,d.dateFormat||"yyyy",new Date).getTime()),(n,O)=>Ye.ascending(n,O)),[je,ve]=m.useState(d.autoplay?0:J.length-1),[we,le]=m.useState(void 0),ye=m.useRef(null),c=m.useRef(null);m.useEffect(()=>{const n=new ResizeObserver(O=>{r(I||O[0].target.clientWidth||620),s(ie||O[0].target.clientHeight||480)});return ye.current&&(s(ye.current.clientHeight||480),r(ye.current.clientWidth||620),I||n.observe(ye.current)),()=>n.disconnect()},[I,ie]),m.useEffect(()=>{const n=setInterval(()=>{ve(O=>O<J.length-1?O+1:0)},(d.speed||2)*1e3);return x||clearInterval(n),()=>clearInterval(n)},[J,x,d.speed]);const te=Ce.getSliderMarks(J,je,d.showOnlyActiveDate,d.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${M||"light"} flex ${I?"w-fit grow-0":"w-full grow"}`,dir:w==="he"||w==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${_?_===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${w||"en"}`,F?.graphContainer),style:{...C?.graphContainer||{},..._&&_!==!0?{backgroundColor:_}:{}},id:pe,ref:c,"aria-label":$||`${p?`The graph shows ${p}. `:""}This is a stacked bar chart. ${U?` ${U}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:_?G||"1rem":G||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-4 w-full grow justify-between",children:[p||U||b||g?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:F?.title,description:F?.description},graphTitle:p,graphDescription:U,width:I,graphDownload:b?c.current:void 0,dataDownload:g?l.map(n=>n.data).filter(n=>n!==void 0).length>0?l.map(n=>n.data).filter(n=>n!==void 0):l.filter(n=>n!==void 0):null}):null,d.enabled&&J.length>0&&te?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Oe(!x)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":x?"Click to pause animation":"Click to play animation",children:x?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:J[0],max:J[J.length-1],marks:te,step:null,defaultValue:J[J.length-1],value:J[je],onChangeComplete:n=>{ve(J.indexOf(n))},onChange:n=>{ve(J.indexOf(n))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[X?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:I,colorDomain:xe,colors:P,colorLegendTitle:R,setSelectedColor:le,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:ye,"aria-label":"Graph area",children:(I||a)&&(ie||t)?e.jsxRuntimeExports.jsx(nt,{data:V!==void 0?V==="total"?$e.sortBy(Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>d.enabled?n.date===Ee.format(new Date(J[je]),d.dateFormat||"yyyy"):n).filter(n=>h?!n.size.every(O=>O==null):n),n=>ke.sum(n.size.filter(O=>!Y.checkIfNullOrUndefined(O)))).reverse().filter((n,O)=>v?O<v:!0):$e.sortBy(Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>d.enabled?n.date===Ee.format(new Date(J[je]),d.dateFormat||"yyyy"):n).filter(n=>h?!n.size.every(O=>O==null):n),n=>Y.checkIfNullOrUndefined(n.size[V])?-1/0:n.size[V]).reverse().filter((n,O)=>v?O<v:!0):Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>d.enabled?n.date===Ee.format(new Date(J[je]),d.dateFormat||"yyyy"):n).filter(n=>h?!n.size.every(O=>O==null):n).filter((n,O)=>v?O<v:!0),barColors:P,width:I||a,height:Math.max(N,ie||(ee?N?(I||a)*ee>N?(I||a)*ee:N:(I||a)*ee:t)),barPadding:me,showTicks:de,leftMargin:he,rightMargin:Q,topMargin:Z,bottomMargin:E,truncateBy:q,showLabels:K,tooltip:f,onSeriesMouseOver:L,showValues:ne,suffix:ae,prefix:se,refValues:W,maxValue:Y.checkIfNullOrUndefined(ue)?Math.max(...l.map(n=>ke.sum(n.size.filter(O=>!Y.checkIfNullOrUndefined(O)))||0)):ue,onSeriesMouseClick:S,selectedColor:we,rtl:w==="he"||w==="ar",labelOrder:D,maxBarThickness:z,minBarThickness:j,resetSelectionOnDoubleClick:T,detailsOnClick:ce,barAxisTitle:H,noOfTicks:B,valueColor:re,classNames:F,styles:C,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},colorDomain:xe,precision:y,customLayers:u,naLabel:o}):null})]})}),A||oe?e.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:A,footNote:oe,width:I}):null]})})})})}function ot(fe){const{data:l,width:p,height:P,barColor:A,suffix:U,prefix:me,barPadding:de,showLabels:he,showValues:Q,showTicks:q,colorDomain:ie,truncateBy:I,rightMargin:oe,topMargin:xe,bottomMargin:R,leftMargin:G,tooltip:_,onSeriesMouseOver:Z,refValues:E,selectedColor:f,maxValue:L,minValue:ae,highlightedDataPoints:se,onSeriesMouseClick:K,labelOrder:ee,maxBarThickness:ne,minBarThickness:W,resetSelectionOnDoubleClick:pe,detailsOnClick:ue,barAxisTitle:S,valueColor:b,noOfTicks:g,styles:w,classNames:D,dimmedOpacity:N,animate:M,precision:z,customLayers:V,naLabel:v}=fe,j=m.useRef(null),X=ge.useInView(j,{once:M.once,amount:M.amount}),$={top:xe,bottom:R,left:S?G+30:G,right:oe},[T,ce]=m.useState(void 0),[H,B]=m.useState(void 0),[re,C]=m.useState(void 0),[F,h]=m.useState(void 0),k=p-$.left-$.right,y=P-$.top-$.bottom,u=Pe.linear().domain([ae,L]).range([y,0]).nice(),d=l.map((t,s)=>({...t,id:ee?`${t.label}`:`${s}`})),o=ee||d.map(t=>`${t.id}`),a=Te.band().domain(o).range([0,W?Math.max(k,W*o.length):ne?Math.min(k,ne*o.length):k]).paddingInner(de),r=u.ticks(g);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{ref:j,width:`${p}px`,height:`${P}px`,viewBox:`0 0 ${p} ${P}`,direction:"ltr",children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${$.left},${$.top})`,children:[e.jsxRuntimeExports.jsx(Fe.Axis,{y1:u(ae<0?0:ae),y2:u(ae<0?0:ae),x1:0-G,x2:k+$.right,label:Ie.numberFormattingFunction(ae<0?0:ae,v,z,me,U),labelPos:{x:0-G,dx:0,dy:L<0?"1em":-5,y:u(ae<0?0:ae)},classNames:{axis:D?.xAxis?.axis,label:D?.yAxis?.labels},styles:{axis:w?.xAxis?.axis,label:w?.yAxis?.labels}}),q?e.jsxRuntimeExports.jsx(tt.YTicksAndGridLines,{values:r.filter(t=>t!==0),y:r.filter(t=>t!==0).map(t=>u(t)),x1:0-G,x2:k+$.right,styles:{gridLines:w?.yAxis?.gridLines,labels:w?.yAxis?.labels},classNames:{gridLines:D?.yAxis?.gridLines,labels:D?.yAxis?.labels},suffix:U,prefix:me,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:z}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:0-G-15,y:y/2,style:w?.yAxis?.title,className:D?.yAxis?.title,text:S,rotate90:!0}),V.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[d.map((t,s)=>Y.checkIfNullOrUndefined(a(t.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-g-with-hover",initial:"initial",animate:X?"whileInView":"initial",variants:{initial:{opacity:f?t.color&&A[ie.indexOf(t.color)]===f?1:N:se.length!==0?se.indexOf(t.label)!==-1?.85:N:.85},whileInView:{opacity:f?t.color&&A[ie.indexOf(t.color)]===f?1:N:se.length!==0?se.indexOf(t.label)!==-1?.85:N:.85,transition:{duration:M.duration}}},exit:{opacity:0,transition:{duration:M.duration}},onMouseEnter:x=>{ce(t),h(x.clientY),C(x.clientX),Z?.(t)},onClick:()=>{(K||ue)&&(Ae.isEqual(H,t)&&pe?(B(void 0),K?.(void 0)):(B(t),K?.(t)))},onMouseMove:x=>{ce(t),h(x.clientY),C(x.clientX)},onMouseLeave:()=>{ce(void 0),C(void 0),h(void 0),Z?.(void 0)},children:[t.size?e.jsxRuntimeExports.jsx(ge.motion.rect,{width:a.bandwidth(),initial:"initial",animate:X?"whileInView":"initial",variants:{initial:{height:0,x:a(`${t.id}`),y:u(0),fill:l.filter(x=>x.color).length===0?A[0]:t.color?A[ie.indexOf(t.color)]:Re.Colors.gray},whileInView:{height:t.size?Math.abs(u(t.size)-u(0)):0,y:t.size&&t.size>0?u(t.size):u(0),x:a(`${t.id}`),fill:l.filter(x=>x.color).length===0?A[0]:t.color?A[ie.indexOf(t.color)]:Re.Colors.gray,transition:{duration:M.duration}}},exit:{height:0,y:u(0),transition:{duration:M.duration}}}):null,he?e.jsxRuntimeExports.jsx(et.XAxesLabels,{value:`${t.label}`.length<I?`${t.label}`:`${`${t.label}`.substring(0,I)}...`,y:(t.size||0)<0?0:u(0)+5,x:a(`${t.id}`),width:a.bandwidth(),height:(t.size||0)<0?u(0)-5:$.bottom,style:w?.xAxis?.labels,className:D?.xAxis?.labels,alignment:(t.size||0)<0?"bottom":"top",animate:M,isInView:X}):null,Q?e.jsxRuntimeExports.jsx(ge.motion.text,{style:{textAnchor:"middle",...w?.graphObjectValues||{}},className:Me.cnExports.cn("graph-value text-sm",!b&&A.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",D?.graphObjectValues),dy:t.size?t.size>=0?"-5px":"1em":"-5px",variants:{initial:{x:a(`${t.id}`)+a.bandwidth()/2,y:u(0),opacity:0,fill:b||(l.filter(x=>x.color).length===0?A[0]:t.color?A[ie.indexOf(t.color)]:Re.Colors.gray)},whileInView:{x:a(`${t.id}`)+a.bandwidth()/2,y:u(t.size||0),fill:b||(l.filter(x=>x.color).length===0?A[0]:t.color?A[ie.indexOf(t.color)]:Re.Colors.gray),opacity:1,transition:{duration:M.duration}}},initial:"initial",animate:X?"whileInView":"initial",exit:{opacity:0,transition:{duration:M.duration}},children:Ie.numberFormattingFunction(t.size,v,z,me,U)}):null]},t.label)),E?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:E.map((t,s)=>e.jsxRuntimeExports.jsx(He.RefLineY,{text:t.text,color:t.color,y:u(t.value),x1:0-G,x2:k+$.right,classNames:t.classNames,styles:t.styles,animate:M,isInView:X},s))}):null]}),V.filter(t=>t.position==="after").map(t=>t.layer)]})}),T&&_&&re&&F?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:T,body:_,xPos:re,yPos:F,backgroundStyle:w?.tooltip,className:D?.tooltip}):null,ue&&H!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:H!==void 0,onClose:()=>{B(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof ue=="string"?{__html:Le.string2HTML(ue,H)}:void 0,children:typeof ue=="function"?ue(H):null})}):null]})}function ct(fe){const{data:l,graphTitle:p,colors:P,barPadding:A=.25,showTicks:U=!0,leftMargin:me=20,rightMargin:de=20,topMargin:he=20,bottomMargin:Q=25,truncateBy:q=999,showLabels:ie=!0,showValues:I=!0,backgroundColor:oe=!1,suffix:xe="",prefix:R="",sources:G,graphDescription:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,showColorScale:pe=!0,graphID:ue,maxValue:S,minValue:b,highlightedDataPoints:g=[],onSeriesMouseClick:w,graphDownload:D=!1,dataDownload:N=!1,language:M="en",theme:z="light",sortData:V,labelOrder:v,showNAColor:j=!0,minHeight:X=0,maxBarThickness:$,maxNumberOfBars:T,minBarThickness:ce,ariaLabel:H,resetSelectionOnDoubleClick:B=!0,detailsOnClick:re,barAxisTitle:C,noOfTicks:F=5,valueColor:h,styles:k,classNames:y,filterNA:u=!0,animate:d=!1,dimmedOpacity:o=.3,precision:a=2,customLayers:r=[],timeline:t={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:s="NA"}=fe,[x,Oe]=m.useState(0),[J,je]=m.useState(0),[ve,we]=m.useState(t.autoplay),le=Ce.sort(De.uniqBy(l.filter(i=>i.date!==void 0&&i.date!==null),i=>i.date).map(i=>Ee.parse(`${i.date}`,t.dateFormat||"yyyy",new Date).getTime()),(i,be)=>Ye.ascending(i,be)),[ye,c]=m.useState(t.autoplay?0:le.length-1),[te,n]=m.useState(void 0),O=m.useRef(null),_e=m.useRef(null);m.useEffect(()=>{const i=new ResizeObserver(be=>{Oe(E||be[0].target.clientWidth||620),je(Z||be[0].target.clientHeight||480)});return O.current&&(je(O.current.clientHeight||480),Oe(O.current.clientWidth||620),E||i.observe(O.current)),()=>i.disconnect()},[E,Z]),m.useEffect(()=>{const i=setInterval(()=>{c(be=>be<le.length-1?be+1:0)},(t.speed||2)*1e3);return ve||clearInterval(i),()=>clearInterval(i)},[le,ve,t.speed]);const Ke=Ce.getSliderMarks(le,ye,t.showOnlyActiveDate,t.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${z||"light"} flex ${E?"w-fit grow-0":"w-full grow"}`,dir:M==="he"||M==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${oe?oe===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${M||"en"}`,y?.graphContainer),style:{...k?.graphContainer||{},...oe&&oe!==!0?{backgroundColor:oe}:{}},id:ue,ref:_e,"aria-label":H||`${p?`The graph shows ${p}. `:""}This is a grouped bar chart. ${_?` ${_}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:oe?se||"1rem":se||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||_||D||N?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:k?.title,description:k?.description},classNames:{title:y?.title,description:y?.description},graphTitle:p,graphDescription:_,width:E,graphDownload:D?_e.current:void 0,dataDownload:N?l.map(i=>i.data).filter(i=>i!==void 0).length>0?l.map(i=>i.data).filter(i=>i!==void 0):l.filter(i=>i!==void 0):null}):null,t.enabled&&le.length>0&&Ke?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{we(!ve)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":ve?"Click to pause animation":"Click to play animation",children:ve?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:le[0],max:le[le.length-1],marks:Ke,step:null,defaultValue:le[le.length-1],value:le[ye],onChangeComplete:i=>{c(le.indexOf(i))},onChange:i=>{c(le.indexOf(i))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[pe&&l.filter(i=>i.color).length!==0?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:E,colorLegendTitle:ae,colors:P||Re.Colors[z].categoricalColors.colors,colorDomain:L||De.uniqBy(l.filter(i=>i.color),"color").map(i=>i.color),setSelectedColor:n,showNAColor:j}):null,e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center w-full leading-0",ref:O,"aria-label":"Graph area",children:(E||x)&&(Z||J)?e.jsxRuntimeExports.jsx(ot,{data:V==="asc"?$e.sortBy(Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i),i=>i.size).filter((i,be)=>T?be<T:!0):V==="desc"?$e.sortBy(Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i),i=>i.size).reverse().filter((i,be)=>T?be<T:!0):Ne.ensureCompleteDataForBarChart(l,t.dateFormat||"yyyy").filter(i=>t.enabled?i.date===Ee.format(new Date(le[ye]),t.dateFormat||"yyyy"):i).filter(i=>u?!Y.checkIfNullOrUndefined(i.size):i).filter((i,be)=>T?be<T:!0),barColor:l.filter(i=>i.color).length===0?P?[P]:[Re.Colors.primaryColors["blue-600"]]:P||Re.Colors[z].categoricalColors.colors,colorDomain:l.filter(i=>i.color).length===0?[]:L||De.uniqBy(l.filter(i=>i.color),"color").map(i=>i.color),width:E||x,refValues:W,height:Math.max(X,Z||(K?X?(E||x)*K>X?(E||x)*K:X:(E||x)*K:J)),suffix:xe,prefix:R,barPadding:A,showLabels:ie,showValues:I,showTicks:U,truncateBy:q,leftMargin:me,rightMargin:de,selectedColor:te,topMargin:he,bottomMargin:Q,tooltip:ee,onSeriesMouseOver:ne,maxValue:Y.checkIfNullOrUndefined(S)?Math.max(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size))<0?0:Math.max(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size)):S,minValue:Y.checkIfNullOrUndefined(b)?Math.min(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size))>=0?0:Math.min(...l.filter(i=>!Y.checkIfNullOrUndefined(i.size)).map(i=>i.size)):b,highlightedDataPoints:g,onSeriesMouseClick:w,labelOrder:v,maxBarThickness:$,minBarThickness:ce,resetSelectionOnDoubleClick:B,detailsOnClick:re,barAxisTitle:C,noOfTicks:F,valueColor:h,styles:k,classNames:y,animate:d===!0?{duration:.5,once:!0,amount:.5}:d||{duration:0,once:!0,amount:0},dimmedOpacity:o,precision:a,customLayers:r,naLabel:s}):null})]})}),G||f?e.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:k?.footnote,source:k?.source},classNames:{footnote:y?.footnote,source:y?.source},sources:G,footNote:f,width:E}):null]})})})})}function ut(fe){const{data:l,width:p,height:P,barColors:A,suffix:U,prefix:me,barPadding:de,showLabels:he,showValues:Q,showTicks:q,truncateBy:ie,leftMargin:I,rightMargin:oe,topMargin:xe,bottomMargin:R,tooltip:G,onSeriesMouseOver:_,refValues:Z,maxValue:E,minValue:f,onSeriesMouseClick:L,selectedColor:ae,labelOrder:se,maxBarThickness:K,resetSelectionOnDoubleClick:ee,detailsOnClick:ne,barAxisTitle:W,valueColor:pe,noOfTicks:ue,styles:S,classNames:b,animate:g,colorDomain:w,precision:D,customLayers:N,naLabel:M}=fe,z=m.useRef(null),V=ge.useInView(z,{once:g.once,amount:g.amount}),v={top:xe,bottom:R,left:W?I+30:I,right:oe},[j,X]=m.useState(void 0),[$,T]=m.useState(void 0),[ce,H]=m.useState(void 0),[B,re]=m.useState(void 0),C=p-v.left-v.right,F=P-v.top-v.bottom,h=Pe.linear().domain([f,E]).range([F,0]).nice(),k=l.map((a,r)=>({...a,id:se?`${a.label}`:`${r}`})),y=se||k.map(a=>`${a.id}`),u=Te.band().domain(y).range([0,K?Math.min(C,K*y.length):C]).paddingInner(de),d=Te.band().domain(l[0].size.map((a,r)=>`${r}`)).range([0,u.bandwidth()]).paddingInner(.1),o=h.ticks(ue);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{width:`${p}px`,height:`${P}px`,viewBox:`0 0 ${p} ${P}`,direction:"ltr",ref:z,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${v.left},${v.top})`,children:[e.jsxRuntimeExports.jsx(Fe.Axis,{y1:h(f<0?0:f),y2:h(f<0?0:f),x1:0-I,x2:C+v.right,label:Ie.numberFormattingFunction(f<0?0:f,M,D,me,U),labelPos:{x:0-I,dx:0,dy:E<0?"1em":-5,y:h(f<0?0:f)},classNames:{axis:b?.xAxis?.axis,label:b?.yAxis?.labels},styles:{axis:S?.xAxis?.axis,label:S?.yAxis?.labels}}),q?e.jsxRuntimeExports.jsx(tt.YTicksAndGridLines,{values:o.filter(a=>a!==0),y:o.filter(a=>a!==0).map(a=>h(a)),x1:0-I,x2:C+v.right,styles:{gridLines:S?.yAxis?.gridLines,labels:S?.yAxis?.labels},classNames:{gridLines:b?.yAxis?.gridLines,labels:b?.yAxis?.labels},suffix:U,prefix:me,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:D}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:0-I-15,y:F/2,style:S?.yAxis?.title,className:b?.yAxis?.title,text:W,rotate90:!0}),N.filter(a=>a.position==="before").map(a=>a.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[k.map(a=>Y.checkIfNullOrUndefined(u(a.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{variants:{initial:{x:u(`${a.id}`),y:0},whileInView:{x:u(`${a.id}`),y:0,transition:{duration:g.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},children:[a.size.map((r,t)=>e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-g-with-hover",opacity:ae?A[t]===ae?1:.3:.85,onMouseEnter:s=>{X({...a,sizeIndex:t}),re(s.clientY),H(s.clientX),_?.({...a,sizeIndex:t})},onMouseMove:s=>{X({...a,sizeIndex:t}),re(s.clientY),H(s.clientX)},onMouseLeave:()=>{X(void 0),H(void 0),re(void 0),_?.(void 0)},onClick:()=>{(L||ne)&&(Ae.isEqual($,{...a,sizeIndex:t})&&ee?(T(void 0),L?.(void 0)):(T({...a,sizeIndex:t}),L&&L({...a,sizeIndex:t})))},children:[e.jsxRuntimeExports.jsx(ge.motion.rect,{x:d(`${t}`),width:d.bandwidth(),variants:{initial:{height:0,y:h(0),fill:A[t]},whileInView:{height:Y.checkIfNullOrUndefined(r)?0:Math.abs(h(r)-h(0)),y:Y.checkIfNullOrUndefined(r)?h(0):r>0?h(r):h(0),fill:A[t],transition:{duration:g.duration}}},exit:{height:0,y:h(0),transition:{duration:g.duration}},initial:"initial",animate:V?"whileInView":"initial"}),Q?e.jsxRuntimeExports.jsx(ge.motion.text,{x:d(`${t}`)+d.bandwidth()/2,style:{fill:pe||A[t],textAnchor:"middle",...S?.graphObjectValues||{}},className:Me.cnExports.cn("graph-value text-sm",b?.graphObjectValues),dy:r?r>=0?"-5px":"1em":"-5px",variants:{initial:{y:h(0),opacity:0},whileInView:{y:h(r||0),opacity:1,transition:{duration:g.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},children:Ie.numberFormattingFunction(r,M,D,me,U)}):null]},`${a.label}-${w[t]||t}`)),he?e.jsxRuntimeExports.jsx(et.XAxesLabels,{value:`${a.label}`.length<ie?`${a.label}`:`${`${a.label}`.substring(0,ie)}...`,y:h(0)+5,x:0,width:u.bandwidth(),height:v.bottom,style:S?.xAxis?.labels,className:b?.xAxis?.labels,alignment:"top",animate:g,isInView:V}):null]},a.label)),Z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Z.map((a,r)=>e.jsxRuntimeExports.jsx(He.RefLineY,{text:a.text,color:a.color,y:h(a.value),x1:0-I,x2:C+v.right,classNames:a.classNames,styles:a.styles,animate:g,isInView:V},r))}):null]}),N.filter(a=>a.position==="after").map(a=>a.layer)]})}),j&&G&&ce&&B?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:j,body:G,xPos:ce,yPos:B,backgroundStyle:S?.tooltip,className:b?.tooltip}):null,ne&&$!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:$!==void 0,onClose:()=>{T(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof ne=="string"?{__html:Le.string2HTML(ne,$)}:void 0,children:typeof ne=="function"?ne($):null})}):null]})}function xt(fe){const{data:l,graphTitle:p,colors:P=Re.Colors.light.categoricalColors.colors,sources:A,graphDescription:U,barPadding:me=.25,showTicks:de=!0,leftMargin:he=20,rightMargin:Q=20,topMargin:q=20,bottomMargin:ie=25,truncateBy:I=999,showLabels:oe=!0,showValues:xe=!0,backgroundColor:R=!1,suffix:G="",prefix:_="",height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,graphID:pe,maxValue:ue,minValue:S,onSeriesMouseClick:b,graphDownload:g=!1,dataDownload:w=!1,language:D="en",theme:N="light",labelOrder:M,minHeight:z=0,maxBarThickness:V,ariaLabel:v,resetSelectionOnDoubleClick:j=!0,detailsOnClick:X,barAxisTitle:$,noOfTicks:T=5,valueColor:ce,styles:H,classNames:B,filterNA:re=!0,showColorScale:C=!0,animate:F=!1,precision:h=2,customLayers:k=[],timeline:y={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:u="NA"}=fe,[d,o]=m.useState(0),[a,r]=m.useState(0),[t,s]=m.useState(y.autoplay),x=Ce.sort(De.uniqBy(l.filter(c=>c.date!==void 0&&c.date!==null),c=>c.date).map(c=>Ee.parse(`${c.date}`,y.dateFormat||"yyyy",new Date).getTime()),(c,te)=>Ye.ascending(c,te)),[Oe,J]=m.useState(y.autoplay?0:x.length-1),[je,ve]=m.useState(void 0),we=m.useRef(null),le=m.useRef(null);m.useEffect(()=>{const c=new ResizeObserver(te=>{o(E||te[0].target.clientWidth||620),r(Z||te[0].target.clientHeight||480)});return we.current&&(r(we.current.clientHeight||480),o(we.current.clientWidth||620),E||c.observe(we.current)),()=>c.disconnect()},[E,Z]),m.useEffect(()=>{const c=setInterval(()=>{J(te=>te<x.length-1?te+1:0)},(y.speed||2)*1e3);return t||clearInterval(c),()=>clearInterval(c)},[x,t,y.speed]);const ye=Ce.getSliderMarks(x,Oe,y.showOnlyActiveDate,y.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${N||"light"} flex ${E?"w-fit grow-0":"w-full grow"}`,dir:D==="he"||D==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${R?R===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${D||"en"}`,B?.graphContainer),style:{...H?.graphContainer||{},...R&&R!==!0?{backgroundColor:R}:{}},id:pe,ref:le,"aria-label":v||`${p?`The graph shows ${p}. `:""}This is a grouped bar chart. ${U?` ${U}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:R?se||"1rem":se||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||U||g||w?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:H?.title,description:H?.description},classNames:{title:B?.title,description:B?.description},graphTitle:p,graphDescription:U,width:E,graphDownload:g?le.current:void 0,dataDownload:w?l.map(c=>c.data).filter(c=>c!==void 0).length>0?l.map(c=>c.data).filter(c=>c!==void 0):l.filter(c=>c!==void 0):null}):null,y.enabled&&x.length>0&&ye?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{s(!t)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":t?"Click to pause animation":"Click to play animation",children:t?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:x[0],max:x[x.length-1],marks:ye,step:null,defaultValue:x[x.length-1],value:x[Oe],onChangeComplete:c=>{J(x.indexOf(c))},onChange:c=>{J(x.indexOf(c))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[C?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:E,colorDomain:L,colors:P,colorLegendTitle:ae,setSelectedColor:ve,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:we,"aria-label":"Graph area",children:(E||d)&&(Z||a)?e.jsxRuntimeExports.jsx(ut,{data:Ne.ensureCompleteDataForStackedBarChart(l,y.dateFormat||"yyyy").filter(c=>y.enabled?c.date===Ee.format(new Date(x[Oe]),y.dateFormat||"yyyy"):c).filter(c=>re?!c.size.every(te=>te==null):c),barColors:P,width:E||d,height:Math.max(z,Z||(K?z?(E||d)*K>z?(E||d)*K:z:(E||d)*K:a)),suffix:G,prefix:_,barPadding:me,showLabels:oe,showValues:xe,showTicks:de,truncateBy:I,leftMargin:he,rightMargin:Q,topMargin:q,bottomMargin:ie,tooltip:ee,onSeriesMouseOver:ne,refValues:W,maxValue:Y.checkIfNullOrUndefined(ue)?Math.max(...l.map(c=>Math.max(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te)))))<0?0:Math.max(...l.map(c=>Math.max(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te))))):ue,minValue:Y.checkIfNullOrUndefined(S)?Math.min(...l.map(c=>Math.min(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te)))))>=0?0:Math.min(...l.map(c=>Math.min(...c.size.filter(te=>!Y.checkIfNullOrUndefined(te))))):S,onSeriesMouseClick:b,selectedColor:je,labelOrder:M,maxBarThickness:V,resetSelectionOnDoubleClick:j,detailsOnClick:X,barAxisTitle:$,noOfTicks:T,valueColor:ce,styles:H,classNames:B,animate:F===!0?{duration:.5,once:!0,amount:.5}:F||{duration:0,once:!0,amount:0},colorDomain:L,precision:h,customLayers:k,naLabel:u}):null})]})}),A||f?e.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:H?.footnote,source:H?.source},classNames:{footnote:B?.footnote,source:B?.source},sources:A,footNote:f,width:E}):null]})})})})}function dt(fe){const{data:l,width:p,height:P,barColors:A,barPadding:U,showLabels:me,showTicks:de,truncateBy:he,leftMargin:Q,topMargin:q,bottomMargin:ie,rightMargin:I,tooltip:oe,onSeriesMouseOver:xe,suffix:R,prefix:G,showValues:_,refValues:Z,maxValue:E,onSeriesMouseClick:f,selectedColor:L,labelOrder:ae,maxBarThickness:se,minBarThickness:K,resetSelectionOnDoubleClick:ee,detailsOnClick:ne,barAxisTitle:W,valueColor:pe,noOfTicks:ue,styles:S,classNames:b,animate:g,colorDomain:w,precision:D,customLayers:N,naLabel:M}=fe,z=m.useRef(null),V=ge.useInView(z,{once:g.once,amount:g.amount}),v={top:q,bottom:ie,left:W?Q+30:Q,right:I},[j,X]=m.useState(void 0),[$,T]=m.useState(void 0),[ce,H]=m.useState(void 0),[B,re]=m.useState(void 0),C=p-v.left-v.right,F=P-v.top-v.bottom,h=Pe.linear().domain([0,E]).range([F,0]).nice(),k=l.map((o,a)=>({...o,id:ae?`${o.label}`:`${a}`})),y=ae||k.map(o=>`${o.id}`),u=Te.band().domain(y).range([0,K?Math.max(C,K*y.length):se?Math.min(C,se*y.length):C]).paddingInner(U),d=h.ticks(ue);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(ge.motion.svg,{width:`${p}px`,height:`${P}px`,viewBox:`0 0 ${p} ${P}`,direction:"ltr",ref:z,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${v.left},${v.top})`,children:[e.jsxRuntimeExports.jsx(Fe.Axis,{y1:h(0),y2:h(0),x1:0-Q,x2:C+v.right,label:Ie.numberFormattingFunction(0,M,D,G,R),labelPos:{x:0-Q,y:h(0),dx:0,dy:-5},classNames:{axis:b?.xAxis?.axis,label:b?.yAxis?.labels},styles:{axis:S?.xAxis?.axis,label:S?.yAxis?.labels}}),de?e.jsxRuntimeExports.jsx(tt.YTicksAndGridLines,{values:d.filter(o=>o!==0),y:d.filter(o=>o!==0).map(o=>h(o)),x1:0-Q,x2:C+v.right,styles:{gridLines:S?.yAxis?.gridLines,labels:S?.yAxis?.labels},classNames:{gridLines:b?.yAxis?.gridLines,labels:b?.yAxis?.labels},suffix:R,prefix:G,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:D}):null,e.jsxRuntimeExports.jsx(Be.AxisTitle,{x:0-Q-15,y:F/2,style:S?.yAxis?.title,className:b?.yAxis?.title,text:W,rotate90:!0}),N.filter(o=>o.position==="before").map(o=>o.layer),e.jsxRuntimeExports.jsxs(Ue.AnimatePresence,{children:[k.map(o=>Y.checkIfNullOrUndefined(u(o.id))?null:e.jsxRuntimeExports.jsxs(ge.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:u(`${o.id}`),y:0},whileInView:{x:u(`${o.id}`),y:0,transition:{duration:g.duration}}},transition:{duration:g.duration},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},children:[o.size.map((a,r)=>e.jsxRuntimeExports.jsxs(ge.motion.g,{opacity:L?A[r]===L?1:.3:1,onMouseEnter:t=>{X({...o,sizeIndex:r}),re(t.clientY),H(t.clientX),xe?.({...o,sizeIndex:r})},onMouseMove:t=>{X({...o,sizeIndex:r}),re(t.clientY),H(t.clientX)},onMouseLeave:()=>{X(void 0),H(void 0),re(void 0),xe?.(void 0)},onClick:()=>{(f||ne)&&(Ae.isEqual($,{...o,sizeIndex:r})&&ee?(T(void 0),f?.(void 0)):(T({...o,sizeIndex:r}),f&&f({...o,sizeIndex:r})))},children:[e.jsxRuntimeExports.jsx(ge.motion.rect,{x:0,width:u.bandwidth(),variants:{initial:{height:0,fill:A[r],y:h(0)},whileInView:{height:Math.abs(h(ke.sum(o.size.filter((t,s)=>s<=r&&t)))-h(ke.sum(o.size.filter((t,s)=>s<r&&t)))),y:h(ke.sum(o.size.filter((t,s)=>s<=r&&t))),fill:A[r],transition:{duration:g.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{height:0,y:h(0),transition:{duration:g.duration}}}),_?e.jsxRuntimeExports.jsx(ge.motion.text,{x:u.bandwidth()/2,style:{fill:Je.getTextColorBasedOnBgColor(A[r]),textAnchor:"middle",...S?.graphObjectValues||{}},className:Me.cnExports.cn("graph-value text-sm",b?.graphObjectValues),dy:"0.33em",variants:{initial:{y:h(0),opacity:0,fill:Je.getTextColorBasedOnBgColor(A[r])},whileInView:{y:h(ke.sum(o.size.filter((t,s)=>s<=r&&t)))+Math.abs(h(ke.sum(o.size.filter((t,s)=>s<=r&&t)))-h(ke.sum(o.size.filter((t,s)=>s<r&&t))))/2,opacity:a&&Math.abs(h(ke.sum(o.size.filter((t,s)=>s<=r&&t)))-h(ke.sum(o.size.filter((t,s)=>s<r&&t))))>20?1:0,fill:Je.getTextColorBasedOnBgColor(A[r]),transition:{duration:g.duration}}},initial:"initial",animate:V?"whileInView":"initial",exit:{opacity:0,transition:{duration:g.duration}},children:Ie.numberFormattingFunction(a,M,D,G,R)}):null]},`${o.label}-${w[r]||r}`)),me?e.jsxRuntimeExports.jsx(et.XAxesLabels,{value:`${o.label}`.length<he?`${o.label}`:`${`${o.label}`.substring(0,he)}...`,y:h(0)+5,x:0,width:u.bandwidth(),height:v.bottom,style:S?.xAxis?.labels,className:b?.xAxis?.labels,alignment:"top",animate:g,isInView:V}):null,_?e.jsxRuntimeExports.jsx(ge.motion.text,{style:{...pe&&{fill:pe},textAnchor:"middle",...S?.graphObjectValues||{}},x:u.bandwidth()/2,dy:-10,className:Me.cnExports.cn("graph-value graph-value-total",pe?"text-sm":"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",b?.graphObjectValues),variants:{initial:{y:h(0),opacity:0},whileInView:{y:h(ke.sum(o.size.map(a=>a||0))),opacity:1,transition:{duration:g.duration}}},exit:{opacity:0,transition:{duration:g.duration}},initial:"initial",animate:V?"whileInView":"initial",children:Ie.numberFormattingFunction(ke.sum(o.size.filter(a=>a)),M,D,G,R)}):null]},o.label)),Z?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Z.map((o,a)=>e.jsxRuntimeExports.jsx(He.RefLineY,{text:o.text,color:o.color,y:h(o.value),x1:0-Q,x2:C+v.right,classNames:o.classNames,styles:o.styles,animate:g,isInView:V},a))}):null]}),N.filter(o=>o.position==="after").map(o=>o.layer)]})}),j&&oe&&ce&&B?e.jsxRuntimeExports.jsx(Ve.Tooltip,{data:j,body:oe,xPos:ce,yPos:B,backgroundStyle:S?.tooltip,className:b?.tooltip}):null,ne&&$!==void 0?e.jsxRuntimeExports.jsx(ze.ModalExports.Modal,{open:$!==void 0,onClose:()=>{T(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof ne=="string"?{__html:Le.string2HTML(ne,$)}:void 0,children:typeof ne=="function"?ne($):null})}):null]})}function mt(fe){const{data:l,graphTitle:p,colors:P=Re.Colors.light.categoricalColors.colors,sources:A,graphDescription:U,barPadding:me=.25,showTicks:de=!0,leftMargin:he=20,rightMargin:Q=20,topMargin:q=20,bottomMargin:ie=25,truncateBy:I=999,showLabels:oe=!0,showValues:xe=!0,backgroundColor:R=!1,showColorScale:G=!0,suffix:_="",prefix:Z="",height:E,width:f,footNote:L,colorDomain:ae,colorLegendTitle:se,padding:K,tooltip:ee,onSeriesMouseOver:ne,relativeHeight:W,refValues:pe,graphID:ue,maxValue:S,onSeriesMouseClick:b,graphDownload:g=!1,dataDownload:w=!1,language:D="en",theme:N="light",labelOrder:M,minHeight:z=0,maxBarThickness:V,sortParameter:v,maxNumberOfBars:j,minBarThickness:X,ariaLabel:$,resetSelectionOnDoubleClick:T=!0,detailsOnClick:ce,barAxisTitle:H,noOfTicks:B=5,valueColor:re,styles:C,classNames:F,filterNA:h=!0,animate:k=!1,precision:y=2,customLayers:u=[],timeline:d={enabled:!1,autoplay:!1,showOnlyActiveDate:!0},naLabel:o="NA"}=fe,[a,r]=m.useState(0),[t,s]=m.useState(0),[x,Oe]=m.useState(d.autoplay),J=Ce.sort(De.uniqBy(l.filter(n=>n.date!==void 0&&n.date!==null),n=>n.date).map(n=>Ee.parse(`${n.date}`,d.dateFormat||"yyyy",new Date).getTime()),(n,O)=>Ye.ascending(n,O)),[je,ve]=m.useState(d.autoplay?0:J.length-1),[we,le]=m.useState(void 0),ye=m.useRef(null),c=m.useRef(null);m.useEffect(()=>{const n=new ResizeObserver(O=>{r(f||O[0].target.clientWidth||620),s(E||O[0].target.clientHeight||480)});return ye.current&&(s(ye.current.clientHeight||480),r(ye.current.clientWidth||620),f||n.observe(ye.current)),()=>n.disconnect()},[f,E]),m.useEffect(()=>{const n=setInterval(()=>{ve(O=>O<J.length-1?O+1:0)},(d.speed||2)*1e3);return x||clearInterval(n),()=>clearInterval(n)},[J,x,d.speed]);const te=Ce.getSliderMarks(J,je,d.showOnlyActiveDate,d.dateFormat||"yyyy");return e.jsxRuntimeExports.jsx("div",{className:`${N||"light"} flex ${f?"w-fit grow-0":"w-full grow"}`,dir:D==="he"||D==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:Me.cnExports.cn(`${R?R===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${D||"en"}`,F?.graphContainer),style:{...C?.graphContainer||{},...R&&R!==!0?{backgroundColor:R}:{}},id:ue,ref:c,"aria-label":$||`${p?`The graph shows ${p}. `:""}This is a stacked bar chart. ${U?` ${U}`:""}`,children:e.jsxRuntimeExports.jsx("div",{style:{padding:R?K||"1rem":K||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[p||U||g||w?e.jsxRuntimeExports.jsx(Ge.GraphHeader,{styles:{title:C?.title,description:C?.description},classNames:{title:F?.title,description:F?.description},graphTitle:p,graphDescription:U,width:f,graphDownload:g?c.current:void 0,dataDownload:w?l.map(n=>n.data).filter(n=>n!==void 0).length>0?l.map(n=>n.data).filter(n=>n!==void 0):l.filter(n=>n!==void 0):null}):null,d.enabled&&J.length>0&&te?e.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Oe(!x)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":x?"Click to pause animation":"Click to play animation",children:x?e.jsxRuntimeExports.jsx(Se.Pause,{}):e.jsxRuntimeExports.jsx(Se.Play,{})}),e.jsxRuntimeExports.jsx(Ce.SliderUIExports.SliderUI,{min:J[0],max:J[J.length-1],marks:te,step:null,defaultValue:J[J.length-1],value:J[je],onChangeComplete:n=>{ve(J.indexOf(n))},onChange:n=>{ve(J.indexOf(n))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:l.length===0?e.jsxRuntimeExports.jsx(Xe.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[G?e.jsxRuntimeExports.jsx(We.ColorLegendWithMouseOver,{width:f,colorDomain:ae,colors:P,colorLegendTitle:se,setSelectedColor:le,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:ye,"aria-label":"Graph area",children:(f||a)&&(E||t)?e.jsxRuntimeExports.jsx(dt,{data:v!==void 0?v==="total"?$e.sortBy(Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>d.enabled?n.date===Ee.format(new Date(J[je]),d.dateFormat||"yyyy"):n).filter(n=>h?!n.size.every(O=>O==null):n),n=>ke.sum(n.size.filter(O=>!Y.checkIfNullOrUndefined(O)))).filter((n,O)=>j?O<j:!0):$e.sortBy(Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>d.enabled?n.date===Ee.format(new Date(J[je]),d.dateFormat||"yyyy"):n).filter(n=>h?!n.size.every(O=>O==null):n),n=>Y.checkIfNullOrUndefined(n.size[v])?-1/0:n.size[v]).filter((n,O)=>j?O<j:!0):Ne.ensureCompleteDataForStackedBarChart(l,d.dateFormat||"yyyy").filter(n=>h?!n.size.every(O=>O==null):n).filter((n,O)=>j?O<j:!0),barColors:P,width:f||a,height:Math.max(z,E||(W?z?(f||a)*W>z?(f||a)*W:z:(f||a)*W:t)),barPadding:me,showLabels:oe,showTicks:de,truncateBy:I,leftMargin:he,rightMargin:Q,topMargin:q,bottomMargin:ie,tooltip:ee,onSeriesMouseOver:ne,showValues:xe,suffix:_,prefix:Z,refValues:pe,maxValue:Y.checkIfNullOrUndefined(S)?Math.max(...l.map(n=>ke.sum(n.size.filter(O=>!Y.checkIfNullOrUndefined(O)))||0)):S,onSeriesMouseClick:b,selectedColor:we,labelOrder:M,maxBarThickness:V,minBarThickness:X,resetSelectionOnDoubleClick:T,detailsOnClick:ce,barAxisTitle:H,noOfTicks:B,valueColor:re,styles:C,classNames:F,animate:k===!0?{duration:.5,once:!0,amount:.5}:k||{duration:0,once:!0,amount:0},colorDomain:ae,precision:y,customLayers:u,naLabel:o}):null})]})}),A||L?e.jsxRuntimeExports.jsx(qe.GraphFooter,{styles:{footnote:C?.footnote,source:C?.source},classNames:{footnote:F?.footnote,source:F?.source},sources:A,footNote:L,width:f}):null]})})})})}function ht(fe){const{data:l,graphTitle:p,colors:P,barPadding:A,showTicks:U,leftMargin:me,rightMargin:de,topMargin:he,bottomMargin:Q,truncateBy:q,showLabels:ie,showValues:I,backgroundColor:oe,suffix:xe,prefix:R,sources:G,graphDescription:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,showColorScale:pe,graphID:ue,maxValue:S,minValue:b,highlightedDataPoints:g,onSeriesMouseClick:w,graphDownload:D,dataDownload:N,language:M,theme:z,sortData:V,labelOrder:v,showNAColor:j,minHeight:X,maxBarThickness:$,maxNumberOfBars:T,minBarThickness:ce,ariaLabel:H,resetSelectionOnDoubleClick:B,detailsOnClick:re,barAxisTitle:C,noOfTicks:F,valueColor:h,orientation:k="vertical",styles:y,classNames:u,filterNA:d,animate:o,dimmedOpacity:a,precision:r,customLayers:t,timeline:s,naLabel:x}=fe;return k==="vertical"?e.jsxRuntimeExports.jsx(ct,{data:l,graphTitle:p,colors:P,barPadding:A,showTicks:U,leftMargin:me,rightMargin:de,topMargin:he,bottomMargin:Q,truncateBy:q,showLabels:ie,showValues:I,backgroundColor:oe,suffix:xe,prefix:R,sources:G,graphDescription:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,showColorScale:pe,graphID:ue,maxValue:S,minValue:b,highlightedDataPoints:g,onSeriesMouseClick:w,graphDownload:D,dataDownload:N,language:M,theme:z,sortData:V,labelOrder:v,showNAColor:j,minHeight:X,maxBarThickness:$,maxNumberOfBars:T,minBarThickness:ce,ariaLabel:H,resetSelectionOnDoubleClick:B,styles:y,detailsOnClick:re,barAxisTitle:C,noOfTicks:F,valueColor:h,classNames:u,filterNA:d,animate:o,dimmedOpacity:a,precision:r,customLayers:t,timeline:s}):e.jsxRuntimeExports.jsx(at,{data:l,graphTitle:p,colors:P,barPadding:A,showTicks:U,leftMargin:me,rightMargin:de,topMargin:he,bottomMargin:Q,truncateBy:q,showLabels:ie,showValues:I,backgroundColor:oe,suffix:xe,prefix:R,sources:G,graphDescription:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,showColorScale:pe,graphID:ue,maxValue:S,minValue:b,highlightedDataPoints:g,onSeriesMouseClick:w,graphDownload:D,dataDownload:N,language:M,theme:z,sortData:V,labelOrder:v,showNAColor:j,minHeight:X,maxBarThickness:$,maxNumberOfBars:T,minBarThickness:ce,ariaLabel:H,resetSelectionOnDoubleClick:B,styles:y,detailsOnClick:re,barAxisTitle:C,noOfTicks:F,valueColor:h,classNames:u,filterNA:d,dimmedOpacity:a,precision:r,customLayers:t,timeline:s,naLabel:x})}function pt(fe){const{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,truncateBy:he,height:Q,width:q,footNote:ie,colorDomain:I,colorLegendTitle:oe,suffix:xe,prefix:R,showValues:G,padding:_,backgroundColor:Z,leftMargin:E,rightMargin:f,topMargin:L,bottomMargin:ae,showLabels:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,graphID:pe,maxValue:ue,minValue:S,onSeriesMouseClick:b,graphDownload:g,dataDownload:w,language:D,labelOrder:N,minHeight:M,theme:z,maxBarThickness:V,ariaLabel:v,resetSelectionOnDoubleClick:j,detailsOnClick:X,barAxisTitle:$,noOfTicks:T,valueColor:ce,orientation:H="vertical",styles:B,classNames:re,filterNA:C,animate:F,precision:h,customLayers:k,showColorScale:y,timeline:u,naLabel:d}=fe;return H==="vertical"?e.jsxRuntimeExports.jsx(xt,{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,truncateBy:he,height:Q,width:q,footNote:ie,colorDomain:I,colorLegendTitle:oe,suffix:xe,prefix:R,showValues:G,padding:_,backgroundColor:Z,leftMargin:E,rightMargin:f,topMargin:L,bottomMargin:ae,showLabels:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,graphID:pe,maxValue:ue,minValue:S,onSeriesMouseClick:b,graphDownload:g,dataDownload:w,language:D,labelOrder:N,minHeight:M,theme:z,maxBarThickness:V,ariaLabel:v,resetSelectionOnDoubleClick:j,styles:B,detailsOnClick:X,barAxisTitle:$,noOfTicks:T,valueColor:ce,classNames:re,filterNA:C,animate:F,precision:h,customLayers:k,showColorScale:y,timeline:u,naLabel:d}):e.jsxRuntimeExports.jsx(rt,{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,truncateBy:he,height:Q,width:q,footNote:ie,colorDomain:I,colorLegendTitle:oe,suffix:xe,prefix:R,showValues:G,padding:_,backgroundColor:Z,leftMargin:E,rightMargin:f,topMargin:L,bottomMargin:ae,showLabels:se,relativeHeight:K,tooltip:ee,onSeriesMouseOver:ne,refValues:W,graphID:pe,maxValue:ue,minValue:S,onSeriesMouseClick:b,graphDownload:g,dataDownload:w,language:D,labelOrder:N,minHeight:M,theme:z,maxBarThickness:V,ariaLabel:v,resetSelectionOnDoubleClick:j,styles:B,detailsOnClick:X,barAxisTitle:$,noOfTicks:T,valueColor:ce,classNames:re,filterNA:C,animate:F,precision:h,customLayers:k,showColorScale:y,timeline:u,naLabel:d})}function gt(fe){const{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,leftMargin:he,rightMargin:Q,topMargin:q,bottomMargin:ie,truncateBy:I,showLabels:oe,showValues:xe,backgroundColor:R,suffix:G,prefix:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,tooltip:K,onSeriesMouseOver:ee,relativeHeight:ne,refValues:W,graphID:pe,maxValue:ue,onSeriesMouseClick:S,graphDownload:b,dataDownload:g,language:w,theme:D,labelOrder:N,minHeight:M,maxBarThickness:z,sortParameter:V,maxNumberOfBars:v,minBarThickness:j,ariaLabel:X,resetSelectionOnDoubleClick:$,detailsOnClick:T,barAxisTitle:ce,noOfTicks:H,valueColor:B,orientation:re="vertical",styles:C,classNames:F,filterNA:h,animate:k,precision:y,customLayers:u,showColorScale:d,timeline:o,naLabel:a}=fe;return re==="vertical"?e.jsxRuntimeExports.jsx(mt,{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,leftMargin:he,rightMargin:Q,topMargin:q,bottomMargin:ie,truncateBy:I,showLabels:oe,showValues:xe,backgroundColor:R,suffix:G,prefix:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,tooltip:K,onSeriesMouseOver:ee,relativeHeight:ne,refValues:W,graphID:pe,maxValue:ue,onSeriesMouseClick:S,graphDownload:b,dataDownload:g,language:w,theme:D,labelOrder:N,minHeight:M,maxBarThickness:z,sortParameter:V,maxNumberOfBars:v,minBarThickness:j,ariaLabel:X,resetSelectionOnDoubleClick:$,styles:C,detailsOnClick:T,barAxisTitle:ce,noOfTicks:H,valueColor:B,classNames:F,filterNA:h,animate:k,precision:y,customLayers:u,showColorScale:d,timeline:o,naLabel:a}):e.jsxRuntimeExports.jsx(lt,{data:l,graphTitle:p,colors:P,sources:A,graphDescription:U,barPadding:me,showTicks:de,leftMargin:he,rightMargin:Q,topMargin:q,bottomMargin:ie,truncateBy:I,showLabels:oe,showValues:xe,backgroundColor:R,suffix:G,prefix:_,height:Z,width:E,footNote:f,colorDomain:L,colorLegendTitle:ae,padding:se,tooltip:K,onSeriesMouseOver:ee,relativeHeight:ne,refValues:W,graphID:pe,maxValue:ue,onSeriesMouseClick:S,graphDownload:b,dataDownload:g,language:w,theme:D,labelOrder:N,minHeight:M,maxBarThickness:z,sortParameter:V,maxNumberOfBars:v,minBarThickness:j,ariaLabel:X,resetSelectionOnDoubleClick:$,styles:C,detailsOnClick:T,barAxisTitle:ce,noOfTicks:H,valueColor:B,classNames:F,filterNA:h,animate:k,precision:y,customLayers:u,showColorScale:d,timeline:o,naLabel:a})}exports.GroupedBarGraph=pt;exports.SimpleBarGraph=ht;exports.StackedBarGraph=gt;
|
|
1
|
+
import { j as e, m as Ne } from "./index-CHPV5EwG-BPSP-7Jg.js";
|
|
2
|
+
import { u as Te } from "./index-CaAIPGZo.js";
|
|
3
|
+
import { useRef as Me, useState as S, useEffect as ze } from "react";
|
|
4
|
+
import { s as Ae } from "./index-DxagiOHo.js";
|
|
5
|
+
import { p as Se, f as $e } from "./parse-DlCRUFh_.js";
|
|
6
|
+
import { s as Be, g as Fe, x as He } from "./getSliderMarks-C0jptXeP.js";
|
|
7
|
+
import { i as Pe } from "./index-27yTRcko.js";
|
|
8
|
+
import { X as We } from "./Modal-CUU6ZK3U.js";
|
|
9
|
+
import { n as De } from "./numberFormattingFunction-14YCbkN2.js";
|
|
10
|
+
import { T as Ge } from "./Tooltip-DyM5snqx.js";
|
|
11
|
+
import { c as q } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
12
|
+
import { Colors as je } from "./Colors.js";
|
|
13
|
+
import { s as Xe } from "./string2HTML-CWHGfz_d.js";
|
|
14
|
+
import { X as st } from "./XTicksAndGridLines-Bn9u5gOM.js";
|
|
15
|
+
import { Y as rt } from "./YAxesLabels-H5-002X5.js";
|
|
16
|
+
import { A as Ye } from "./AxisTitle-BmHLMRJZ.js";
|
|
17
|
+
import { A as _e } from "./Axis-Ddg-seDi.js";
|
|
18
|
+
import { a as ot, R as nt } from "./ReferenceLine-C1GpoG9d.js";
|
|
19
|
+
import { u as Ee } from "./use-in-view-BAHrBy6b.js";
|
|
20
|
+
import { a as Re } from "./linear-DUdu7l2G.js";
|
|
21
|
+
import { b as Ie } from "./band-BEjh2CHI.js";
|
|
22
|
+
import { m as pe } from "./proxy-DJxJg1kD.js";
|
|
23
|
+
import { A as qe } from "./index-BxAUvrua.js";
|
|
24
|
+
import { GraphFooter as Ue } from "./GraphFooter.js";
|
|
25
|
+
import { GraphHeader as Je } from "./GraphHeader.js";
|
|
26
|
+
import { ColorLegendWithMouseOver as Ke } from "./ColorLegendWithMouseOver.js";
|
|
27
|
+
import { E as Qe } from "./EmptyState-DdTp-Mdn.js";
|
|
28
|
+
import { P as Ze, f as et } from "./index-BmCqpO1B.js";
|
|
29
|
+
import { c as Le, d as Ve } from "./ensureCompleteData-BBDZbDCE.js";
|
|
30
|
+
import { c as tt } from "./init-BhZylTFx.js";
|
|
31
|
+
import { s as ke } from "./index-D7ltPi18.js";
|
|
32
|
+
import { g as lt } from "./getTextColorBasedOnBgColor-B6Nk2WBf.js";
|
|
33
|
+
import { X as ct } from "./XAxesLabels-DQFo_z2R.js";
|
|
34
|
+
import { Y as dt } from "./YTicksAndGridLines-B6ah7CRf.js";
|
|
35
|
+
function ht(fe) {
|
|
36
|
+
const {
|
|
37
|
+
data: o,
|
|
38
|
+
barColor: g,
|
|
39
|
+
suffix: G,
|
|
40
|
+
prefix: I,
|
|
41
|
+
barPadding: X,
|
|
42
|
+
showValues: me,
|
|
43
|
+
showTicks: ue,
|
|
44
|
+
leftMargin: ge,
|
|
45
|
+
truncateBy: Q,
|
|
46
|
+
width: Y,
|
|
47
|
+
height: ie,
|
|
48
|
+
colorDomain: D,
|
|
49
|
+
rightMargin: ne,
|
|
50
|
+
topMargin: he,
|
|
51
|
+
bottomMargin: j,
|
|
52
|
+
showLabels: _,
|
|
53
|
+
tooltip: U,
|
|
54
|
+
onSeriesMouseOver: Z,
|
|
55
|
+
refValues: C,
|
|
56
|
+
selectedColor: p,
|
|
57
|
+
highlightedDataPoints: F,
|
|
58
|
+
maxValue: ae,
|
|
59
|
+
minValue: le,
|
|
60
|
+
onSeriesMouseClick: J,
|
|
61
|
+
labelOrder: ee,
|
|
62
|
+
rtl: re,
|
|
63
|
+
maxBarThickness: E,
|
|
64
|
+
minBarThickness: xe,
|
|
65
|
+
resetSelectionOnDoubleClick: de,
|
|
66
|
+
detailsOnClick: z,
|
|
67
|
+
barAxisTitle: y,
|
|
68
|
+
valueColor: x,
|
|
69
|
+
noOfTicks: w,
|
|
70
|
+
styles: T,
|
|
71
|
+
classNames: N,
|
|
72
|
+
animate: $,
|
|
73
|
+
dimmedOpacity: L,
|
|
74
|
+
precision: B,
|
|
75
|
+
customLayers: b,
|
|
76
|
+
naLabel: v
|
|
77
|
+
} = fe, R = Me(null), V = Ee(R, {
|
|
78
|
+
once: $.once,
|
|
79
|
+
amount: $.amount
|
|
80
|
+
}), [A, ce] = S(void 0), [W, H] = S(void 0), [se, M] = S(void 0), [P, m] = S(void 0), k = {
|
|
81
|
+
top: y ? he + 25 : he,
|
|
82
|
+
bottom: j,
|
|
83
|
+
left: ge,
|
|
84
|
+
right: ne
|
|
85
|
+
}, f = Y - k.left - k.right, d = ie - k.top - k.bottom, u = o.map((l, h) => ({
|
|
86
|
+
...l,
|
|
87
|
+
id: ee ? `${l.label}` : `${h}`
|
|
88
|
+
})), n = Re().domain([le, ae]).range([0, f]).nice(), a = ee || u.map((l) => `${l.id}`), s = Ie().domain(a).range([
|
|
89
|
+
0,
|
|
90
|
+
xe ? Math.max(d, xe * a.length) : E ? Math.min(d, E * a.length) : d
|
|
91
|
+
]).paddingInner(X), t = n.ticks(w);
|
|
92
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ e.jsx(
|
|
94
|
+
pe.svg,
|
|
95
|
+
{
|
|
96
|
+
ref: R,
|
|
97
|
+
width: `${Y}px`,
|
|
98
|
+
height: `${ie}px`,
|
|
99
|
+
viewBox: `0 0 ${Y} ${ie}`,
|
|
100
|
+
direction: "ltr",
|
|
101
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${k.left},${k.top})`, children: [
|
|
102
|
+
ue ? /* @__PURE__ */ e.jsx(
|
|
103
|
+
st,
|
|
104
|
+
{
|
|
105
|
+
values: t.filter((l) => l !== 0),
|
|
106
|
+
x: t.filter((l) => l !== 0).map((l) => n(l)),
|
|
107
|
+
y1: 0 - he,
|
|
108
|
+
y2: d + k.bottom,
|
|
109
|
+
styles: {
|
|
110
|
+
gridLines: T?.xAxis?.gridLines,
|
|
111
|
+
labels: T?.xAxis?.labels
|
|
112
|
+
},
|
|
113
|
+
classNames: {
|
|
114
|
+
gridLines: N?.xAxis?.gridLines,
|
|
115
|
+
labels: N?.xAxis?.labels
|
|
116
|
+
},
|
|
117
|
+
suffix: G,
|
|
118
|
+
prefix: I,
|
|
119
|
+
labelType: "secondary",
|
|
120
|
+
showGridLines: !0,
|
|
121
|
+
precision: B
|
|
122
|
+
}
|
|
123
|
+
) : null,
|
|
124
|
+
/* @__PURE__ */ e.jsx(
|
|
125
|
+
Ye,
|
|
126
|
+
{
|
|
127
|
+
x: f / 2,
|
|
128
|
+
y: 0 - k.top + 15,
|
|
129
|
+
style: T?.xAxis?.title,
|
|
130
|
+
className: N?.xAxis?.title,
|
|
131
|
+
text: y
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
b.filter((l) => l.position === "before").map((l) => l.layer),
|
|
135
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
136
|
+
u.map(
|
|
137
|
+
(l) => q(s(l.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
138
|
+
pe.g,
|
|
139
|
+
{
|
|
140
|
+
className: "undp-viz-g-with-hover",
|
|
141
|
+
variants: {
|
|
142
|
+
initial: {
|
|
143
|
+
opacity: p ? l.color && g[D.indexOf(l.color)] === p ? 1 : L : F.length !== 0 ? F.indexOf(l.label) !== -1 ? 0.85 : L : 0.85
|
|
144
|
+
},
|
|
145
|
+
whileInView: {
|
|
146
|
+
opacity: p ? l.color && g[D.indexOf(l.color)] === p ? 1 : L : F.length !== 0 ? F.indexOf(l.label) !== -1 ? 0.85 : L : 0.85,
|
|
147
|
+
transition: { duration: $.duration }
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
initial: "initial",
|
|
151
|
+
animate: V ? "whileInView" : "initial",
|
|
152
|
+
exit: { opacity: 0, transition: { duration: $.duration } },
|
|
153
|
+
onMouseEnter: (h) => {
|
|
154
|
+
ce(l), m(h.clientY), M(h.clientX), Z?.(l);
|
|
155
|
+
},
|
|
156
|
+
onClick: () => {
|
|
157
|
+
(J || z) && (Pe(W, l) && de ? (H(void 0), J?.(void 0)) : (H(l), J?.(l)));
|
|
158
|
+
},
|
|
159
|
+
onMouseMove: (h) => {
|
|
160
|
+
ce(l), m(h.clientY), M(h.clientX);
|
|
161
|
+
},
|
|
162
|
+
onMouseLeave: () => {
|
|
163
|
+
ce(void 0), M(void 0), m(void 0), Z?.(void 0);
|
|
164
|
+
},
|
|
165
|
+
children: [
|
|
166
|
+
l.size ? /* @__PURE__ */ e.jsx(
|
|
167
|
+
pe.rect,
|
|
168
|
+
{
|
|
169
|
+
variants: {
|
|
170
|
+
initial: {
|
|
171
|
+
width: 0,
|
|
172
|
+
x: n(0),
|
|
173
|
+
y: s(`${l.id}`),
|
|
174
|
+
fill: o.filter((h) => h.color).length === 0 ? g[0] : l.color ? g[D.indexOf(l.color)] : je.gray
|
|
175
|
+
},
|
|
176
|
+
whileInView: {
|
|
177
|
+
width: l.size >= 0 ? n(l.size) - n(0) : n(0) - n(l.size),
|
|
178
|
+
x: l.size >= 0 ? n(0) : n(l.size),
|
|
179
|
+
y: s(`${l.id}`),
|
|
180
|
+
fill: o.filter((h) => h.color).length === 0 ? g[0] : l.color ? g[D.indexOf(l.color)] : je.gray,
|
|
181
|
+
transition: { duration: $.duration }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
initial: "initial",
|
|
185
|
+
animate: V ? "whileInView" : "initial",
|
|
186
|
+
exit: {
|
|
187
|
+
width: 0,
|
|
188
|
+
x: n(0),
|
|
189
|
+
transition: { duration: $.duration }
|
|
190
|
+
},
|
|
191
|
+
height: s.bandwidth()
|
|
192
|
+
}
|
|
193
|
+
) : null,
|
|
194
|
+
_ ? /* @__PURE__ */ e.jsx(
|
|
195
|
+
rt,
|
|
196
|
+
{
|
|
197
|
+
value: `${l.label}`.length < Q ? `${l.label}` : `${`${l.label}`.substring(0, Q)}...`,
|
|
198
|
+
y: s(l.id) || 0,
|
|
199
|
+
x: (l.size || 0) < 0 ? n(0) : 0 - k.left,
|
|
200
|
+
width: (l.size || 0) < 0 ? Y - n(0) : n(0) + k.left,
|
|
201
|
+
height: s.bandwidth(),
|
|
202
|
+
alignment: l.size && l.size < 0 ? "left" : "right",
|
|
203
|
+
style: T?.yAxis?.labels,
|
|
204
|
+
className: N?.yAxis?.labels,
|
|
205
|
+
animate: $,
|
|
206
|
+
isInView: V
|
|
207
|
+
}
|
|
208
|
+
) : null,
|
|
209
|
+
me ? /* @__PURE__ */ e.jsx(
|
|
210
|
+
pe.text,
|
|
211
|
+
{
|
|
212
|
+
style: {
|
|
213
|
+
textAnchor: l.size && l.size < 0 ? "end" : "start",
|
|
214
|
+
...T?.graphObjectValues || {}
|
|
215
|
+
},
|
|
216
|
+
className: Ne(
|
|
217
|
+
"graph-value text-sm",
|
|
218
|
+
!x && g.length > 1 ? " fill-primary-gray-600 dark:fill-primary-gray-300" : "",
|
|
219
|
+
N?.graphObjectValues
|
|
220
|
+
),
|
|
221
|
+
dx: l.size && l.size < 0 ? -5 : 5,
|
|
222
|
+
dy: "0.33em",
|
|
223
|
+
variants: {
|
|
224
|
+
initial: {
|
|
225
|
+
x: n(0),
|
|
226
|
+
y: s(`${l.id}`) + s.bandwidth() / 2,
|
|
227
|
+
opacity: 0,
|
|
228
|
+
fill: x || (o.filter((h) => h.color).length === 0 ? g[0] : l.color ? g[D.indexOf(l.color)] : je.gray)
|
|
229
|
+
},
|
|
230
|
+
whileInView: {
|
|
231
|
+
x: l.size ? n(l.size) : n(0),
|
|
232
|
+
opacity: 1,
|
|
233
|
+
y: s(`${l.id}`) + s.bandwidth() / 2,
|
|
234
|
+
fill: x || (o.filter((h) => h.color).length === 0 ? g[0] : l.color ? g[D.indexOf(l.color)] : je.gray),
|
|
235
|
+
transition: { duration: $.duration }
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
initial: "initial",
|
|
239
|
+
animate: V ? "whileInView" : "initial",
|
|
240
|
+
exit: {
|
|
241
|
+
opacity: 0,
|
|
242
|
+
transition: { duration: $.duration }
|
|
243
|
+
},
|
|
244
|
+
children: De(l.size, v, B, I, G)
|
|
245
|
+
}
|
|
246
|
+
) : null
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
l.label
|
|
250
|
+
)
|
|
251
|
+
),
|
|
252
|
+
/* @__PURE__ */ e.jsx(
|
|
253
|
+
_e,
|
|
254
|
+
{
|
|
255
|
+
x1: n(le < 0 ? 0 : le),
|
|
256
|
+
x2: n(le < 0 ? 0 : le),
|
|
257
|
+
y1: -2.5,
|
|
258
|
+
y2: d + k.bottom,
|
|
259
|
+
classNames: { axis: N?.yAxis?.axis },
|
|
260
|
+
styles: { axis: T?.yAxis?.axis }
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
C ? /* @__PURE__ */ e.jsx(e.Fragment, { children: C.map((l, h) => /* @__PURE__ */ e.jsx(
|
|
264
|
+
ot,
|
|
265
|
+
{
|
|
266
|
+
text: l.text,
|
|
267
|
+
color: l.color,
|
|
268
|
+
x: n(l.value),
|
|
269
|
+
y1: 0 - k.top,
|
|
270
|
+
y2: d + k.bottom,
|
|
271
|
+
textSide: n(l.value) > f * 0.75 || re ? "left" : "right",
|
|
272
|
+
classNames: l.classNames,
|
|
273
|
+
styles: l.styles,
|
|
274
|
+
animate: $,
|
|
275
|
+
isInView: V
|
|
276
|
+
},
|
|
277
|
+
h
|
|
278
|
+
)) }) : null
|
|
279
|
+
] }),
|
|
280
|
+
b.filter((l) => l.position === "after").map((l) => l.layer)
|
|
281
|
+
] })
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
A && U && se && P ? /* @__PURE__ */ e.jsx(
|
|
285
|
+
Ge,
|
|
286
|
+
{
|
|
287
|
+
data: A,
|
|
288
|
+
body: U,
|
|
289
|
+
xPos: se,
|
|
290
|
+
yPos: P,
|
|
291
|
+
backgroundStyle: T?.tooltip,
|
|
292
|
+
className: N?.tooltip
|
|
293
|
+
}
|
|
294
|
+
) : null,
|
|
295
|
+
z && W !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
296
|
+
We,
|
|
297
|
+
{
|
|
298
|
+
open: W !== void 0,
|
|
299
|
+
onClose: () => {
|
|
300
|
+
H(void 0);
|
|
301
|
+
},
|
|
302
|
+
children: /* @__PURE__ */ e.jsx(
|
|
303
|
+
"div",
|
|
304
|
+
{
|
|
305
|
+
className: "graph-modal-content m-0",
|
|
306
|
+
dangerouslySetInnerHTML: typeof z == "string" ? { __html: Xe(z, W) } : void 0,
|
|
307
|
+
children: typeof z == "function" ? z(W) : null
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
) : null
|
|
312
|
+
] });
|
|
313
|
+
}
|
|
314
|
+
function ut(fe) {
|
|
315
|
+
const {
|
|
316
|
+
data: o,
|
|
317
|
+
graphTitle: g,
|
|
318
|
+
colors: G,
|
|
319
|
+
suffix: I = "",
|
|
320
|
+
sources: X,
|
|
321
|
+
prefix: me = "",
|
|
322
|
+
graphDescription: ue,
|
|
323
|
+
barPadding: ge = 0.25,
|
|
324
|
+
showValues: Q = !0,
|
|
325
|
+
showTicks: Y = !0,
|
|
326
|
+
leftMargin: ie = 100,
|
|
327
|
+
rightMargin: D = 40,
|
|
328
|
+
truncateBy: ne = 999,
|
|
329
|
+
height: he,
|
|
330
|
+
width: j,
|
|
331
|
+
footNote: _,
|
|
332
|
+
colorDomain: U,
|
|
333
|
+
colorLegendTitle: Z,
|
|
334
|
+
highlightedDataPoints: C = [],
|
|
335
|
+
padding: p,
|
|
336
|
+
backgroundColor: F = !1,
|
|
337
|
+
topMargin: ae = 25,
|
|
338
|
+
bottomMargin: le = 10,
|
|
339
|
+
showLabels: J = !0,
|
|
340
|
+
relativeHeight: ee,
|
|
341
|
+
tooltip: re,
|
|
342
|
+
onSeriesMouseOver: E,
|
|
343
|
+
refValues: xe,
|
|
344
|
+
showColorScale: de = !0,
|
|
345
|
+
graphID: z,
|
|
346
|
+
maxValue: y,
|
|
347
|
+
minValue: x,
|
|
348
|
+
onSeriesMouseClick: w,
|
|
349
|
+
graphDownload: T = !1,
|
|
350
|
+
dataDownload: N = !1,
|
|
351
|
+
sortData: $,
|
|
352
|
+
labelOrder: L,
|
|
353
|
+
language: B = "en",
|
|
354
|
+
showNAColor: b = !0,
|
|
355
|
+
minHeight: v = 0,
|
|
356
|
+
theme: R = "light",
|
|
357
|
+
maxBarThickness: V,
|
|
358
|
+
maxNumberOfBars: A,
|
|
359
|
+
minBarThickness: ce,
|
|
360
|
+
ariaLabel: W,
|
|
361
|
+
resetSelectionOnDoubleClick: H = !0,
|
|
362
|
+
detailsOnClick: se,
|
|
363
|
+
barAxisTitle: M,
|
|
364
|
+
noOfTicks: P = 5,
|
|
365
|
+
valueColor: m,
|
|
366
|
+
styles: k,
|
|
367
|
+
classNames: f,
|
|
368
|
+
filterNA: d = !0,
|
|
369
|
+
animate: u = !1,
|
|
370
|
+
dimmedOpacity: n = 0.3,
|
|
371
|
+
precision: a = 2,
|
|
372
|
+
customLayers: s = [],
|
|
373
|
+
timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
374
|
+
naLabel: l = "NA"
|
|
375
|
+
} = fe, [h, Oe] = S(0), [K, we] = S(0), [ve, Ce] = S(t.autoplay), oe = Be(
|
|
376
|
+
Te(
|
|
377
|
+
o.filter((i) => i.date !== void 0 && i.date !== null),
|
|
378
|
+
(i) => i.date
|
|
379
|
+
).map((i) => Se(`${i.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
380
|
+
(i, be) => tt(i, be)
|
|
381
|
+
), [ye, c] = S(t.autoplay ? 0 : oe.length - 1), [te, r] = S(void 0), O = Me(null), it = Me(null);
|
|
382
|
+
ze(() => {
|
|
383
|
+
const i = new ResizeObserver((be) => {
|
|
384
|
+
Oe(j || be[0].target.clientWidth || 620), we(he || be[0].target.clientHeight || 480);
|
|
385
|
+
});
|
|
386
|
+
return O.current && (we(O.current.clientHeight || 480), Oe(O.current.clientWidth || 620), j || i.observe(O.current)), () => i.disconnect();
|
|
387
|
+
}, [j, he]), ze(() => {
|
|
388
|
+
const i = setInterval(
|
|
389
|
+
() => {
|
|
390
|
+
c((be) => be < oe.length - 1 ? be + 1 : 0);
|
|
391
|
+
},
|
|
392
|
+
(t.speed || 2) * 1e3
|
|
393
|
+
);
|
|
394
|
+
return ve || clearInterval(i), () => clearInterval(i);
|
|
395
|
+
}, [oe, ve, t.speed]);
|
|
396
|
+
const at = Fe(
|
|
397
|
+
oe,
|
|
398
|
+
ye,
|
|
399
|
+
t.showOnlyActiveDate,
|
|
400
|
+
t.dateFormat || "yyyy"
|
|
401
|
+
);
|
|
402
|
+
return /* @__PURE__ */ e.jsx(
|
|
403
|
+
"div",
|
|
404
|
+
{
|
|
405
|
+
className: `${R || "light"} flex ${j ? "w-fit grow-0" : "w-full grow"}`,
|
|
406
|
+
dir: B === "he" || B === "ar" ? "rtl" : void 0,
|
|
407
|
+
children: /* @__PURE__ */ e.jsx(
|
|
408
|
+
"div",
|
|
409
|
+
{
|
|
410
|
+
className: Ne(
|
|
411
|
+
`${F ? F === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${B || "en"}`,
|
|
412
|
+
f?.graphContainer
|
|
413
|
+
),
|
|
414
|
+
style: {
|
|
415
|
+
...k?.graphContainer || {},
|
|
416
|
+
...F && F !== !0 ? { backgroundColor: F } : {}
|
|
417
|
+
},
|
|
418
|
+
id: z,
|
|
419
|
+
ref: it,
|
|
420
|
+
"aria-label": W || `${g ? `The graph shows ${g}. ` : ""}This is a bar chart. ${ue ? ` ${ue}` : ""}`,
|
|
421
|
+
children: /* @__PURE__ */ e.jsx(
|
|
422
|
+
"div",
|
|
423
|
+
{
|
|
424
|
+
className: "flex grow",
|
|
425
|
+
style: { padding: F ? p || "1rem" : p || 0 },
|
|
426
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
427
|
+
g || ue || T || N ? /* @__PURE__ */ e.jsx(
|
|
428
|
+
Je,
|
|
429
|
+
{
|
|
430
|
+
styles: {
|
|
431
|
+
title: k?.title,
|
|
432
|
+
description: k?.description
|
|
433
|
+
},
|
|
434
|
+
classNames: {
|
|
435
|
+
title: f?.title,
|
|
436
|
+
description: f?.description
|
|
437
|
+
},
|
|
438
|
+
graphTitle: g,
|
|
439
|
+
graphDescription: ue,
|
|
440
|
+
width: j,
|
|
441
|
+
graphDownload: T ? it.current : void 0,
|
|
442
|
+
dataDownload: N ? o.map((i) => i.data).filter((i) => i !== void 0).length > 0 ? o.map((i) => i.data).filter((i) => i !== void 0) : o.filter((i) => i !== void 0) : null
|
|
443
|
+
}
|
|
444
|
+
) : null,
|
|
445
|
+
t.enabled && oe.length > 0 && at ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
446
|
+
/* @__PURE__ */ e.jsx(
|
|
447
|
+
"button",
|
|
448
|
+
{
|
|
449
|
+
type: "button",
|
|
450
|
+
onClick: () => {
|
|
451
|
+
Ce(!ve);
|
|
452
|
+
},
|
|
453
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
454
|
+
"aria-label": ve ? "Click to pause animation" : "Click to play animation",
|
|
455
|
+
children: ve ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ e.jsx(
|
|
459
|
+
He,
|
|
460
|
+
{
|
|
461
|
+
min: oe[0],
|
|
462
|
+
max: oe[oe.length - 1],
|
|
463
|
+
marks: at,
|
|
464
|
+
step: null,
|
|
465
|
+
defaultValue: oe[oe.length - 1],
|
|
466
|
+
value: oe[ye],
|
|
467
|
+
onChangeComplete: (i) => {
|
|
468
|
+
c(oe.indexOf(i));
|
|
469
|
+
},
|
|
470
|
+
onChange: (i) => {
|
|
471
|
+
c(oe.indexOf(i));
|
|
472
|
+
},
|
|
473
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
474
|
+
}
|
|
475
|
+
)
|
|
476
|
+
] }) : null,
|
|
477
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
478
|
+
de && o.filter((i) => i.color).length !== 0 ? /* @__PURE__ */ e.jsx(
|
|
479
|
+
Ke,
|
|
480
|
+
{
|
|
481
|
+
width: j,
|
|
482
|
+
colorLegendTitle: Z,
|
|
483
|
+
colors: G || je[R].categoricalColors.colors,
|
|
484
|
+
colorDomain: U || Te(
|
|
485
|
+
o.filter((i) => i.color),
|
|
486
|
+
"color"
|
|
487
|
+
).map((i) => i.color),
|
|
488
|
+
setSelectedColor: r,
|
|
489
|
+
showNAColor: b
|
|
490
|
+
}
|
|
491
|
+
) : null,
|
|
492
|
+
/* @__PURE__ */ e.jsx(
|
|
493
|
+
"div",
|
|
494
|
+
{
|
|
495
|
+
className: "flex grow flex-col justify-center w-full leading-0",
|
|
496
|
+
ref: O,
|
|
497
|
+
"aria-label": "Graph area",
|
|
498
|
+
children: (j || h) && (he || K) ? /* @__PURE__ */ e.jsx(
|
|
499
|
+
ht,
|
|
500
|
+
{
|
|
501
|
+
data: $ === "asc" ? Ae(
|
|
502
|
+
Le(o, t.dateFormat || "yyyy").filter(
|
|
503
|
+
(i) => t.enabled ? i.date === $e(
|
|
504
|
+
new Date(oe[ye]),
|
|
505
|
+
t.dateFormat || "yyyy"
|
|
506
|
+
) : i
|
|
507
|
+
).filter((i) => d ? !q(i.size) : i),
|
|
508
|
+
(i) => i.size
|
|
509
|
+
).filter((i, be) => A ? be < A : !0) : $ === "desc" ? Ae(
|
|
510
|
+
Le(o, t.dateFormat || "yyyy").filter(
|
|
511
|
+
(i) => t.enabled ? i.date === $e(
|
|
512
|
+
new Date(oe[ye]),
|
|
513
|
+
t.dateFormat || "yyyy"
|
|
514
|
+
) : i
|
|
515
|
+
).filter((i) => d ? !q(i.size) : i),
|
|
516
|
+
(i) => i.size
|
|
517
|
+
).reverse().filter((i, be) => A ? be < A : !0) : Le(o, t.dateFormat || "yyyy").filter(
|
|
518
|
+
(i) => t.enabled ? i.date === $e(
|
|
519
|
+
new Date(oe[ye]),
|
|
520
|
+
t.dateFormat || "yyyy"
|
|
521
|
+
) : i
|
|
522
|
+
).filter((i) => d ? !q(i.size) : i).filter((i, be) => A ? be < A : !0),
|
|
523
|
+
barColor: o.filter((i) => i.color).length === 0 ? G ? [G] : [je.primaryColors["blue-600"]] : G || je[R].categoricalColors.colors,
|
|
524
|
+
colorDomain: o.filter((i) => i.color).length === 0 ? [] : U || Te(
|
|
525
|
+
o.filter((i) => i.color),
|
|
526
|
+
"color"
|
|
527
|
+
).map((i) => i.color),
|
|
528
|
+
width: j || h,
|
|
529
|
+
selectedColor: te,
|
|
530
|
+
height: Math.max(
|
|
531
|
+
v,
|
|
532
|
+
he || (ee ? v ? (j || h) * ee > v ? (j || h) * ee : v : (j || h) * ee : K)
|
|
533
|
+
),
|
|
534
|
+
suffix: I,
|
|
535
|
+
prefix: me,
|
|
536
|
+
barPadding: ge,
|
|
537
|
+
showValues: Q,
|
|
538
|
+
showTicks: Y,
|
|
539
|
+
leftMargin: ie,
|
|
540
|
+
rightMargin: D,
|
|
541
|
+
topMargin: ae,
|
|
542
|
+
bottomMargin: le,
|
|
543
|
+
truncateBy: ne,
|
|
544
|
+
showLabels: J,
|
|
545
|
+
tooltip: re,
|
|
546
|
+
onSeriesMouseOver: E,
|
|
547
|
+
refValues: xe,
|
|
548
|
+
maxValue: q(y) ? Math.max(
|
|
549
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
550
|
+
) < 0 ? 0 : Math.max(
|
|
551
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
552
|
+
) : y,
|
|
553
|
+
minValue: q(x) ? Math.min(
|
|
554
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
555
|
+
) >= 0 ? 0 : Math.min(
|
|
556
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
557
|
+
) : x,
|
|
558
|
+
highlightedDataPoints: C,
|
|
559
|
+
onSeriesMouseClick: w,
|
|
560
|
+
labelOrder: L,
|
|
561
|
+
rtl: B === "he" || B === "ar",
|
|
562
|
+
maxBarThickness: V,
|
|
563
|
+
minBarThickness: ce,
|
|
564
|
+
resetSelectionOnDoubleClick: H,
|
|
565
|
+
detailsOnClick: se,
|
|
566
|
+
barAxisTitle: M,
|
|
567
|
+
noOfTicks: P,
|
|
568
|
+
valueColor: m,
|
|
569
|
+
classNames: f,
|
|
570
|
+
styles: k,
|
|
571
|
+
animate: u === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : u || { duration: 0, once: !0, amount: 0 },
|
|
572
|
+
dimmedOpacity: n,
|
|
573
|
+
precision: a,
|
|
574
|
+
customLayers: s,
|
|
575
|
+
naLabel: l
|
|
576
|
+
}
|
|
577
|
+
) : null
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
] }) }),
|
|
581
|
+
X || _ ? /* @__PURE__ */ e.jsx(
|
|
582
|
+
Ue,
|
|
583
|
+
{
|
|
584
|
+
sources: X,
|
|
585
|
+
footNote: _,
|
|
586
|
+
width: j,
|
|
587
|
+
styles: { footnote: k?.footnote, source: k?.source },
|
|
588
|
+
classNames: {
|
|
589
|
+
footnote: f?.footnote,
|
|
590
|
+
source: f?.source
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
) : null
|
|
594
|
+
] })
|
|
595
|
+
}
|
|
596
|
+
)
|
|
597
|
+
}
|
|
598
|
+
)
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
function mt(fe) {
|
|
603
|
+
const {
|
|
604
|
+
data: o,
|
|
605
|
+
barColors: g,
|
|
606
|
+
barPadding: G,
|
|
607
|
+
showTicks: I,
|
|
608
|
+
leftMargin: X,
|
|
609
|
+
truncateBy: me,
|
|
610
|
+
width: ue,
|
|
611
|
+
height: ge,
|
|
612
|
+
suffix: Q,
|
|
613
|
+
prefix: Y,
|
|
614
|
+
showValues: ie,
|
|
615
|
+
rightMargin: D,
|
|
616
|
+
topMargin: ne,
|
|
617
|
+
bottomMargin: he,
|
|
618
|
+
showLabels: j,
|
|
619
|
+
tooltip: _,
|
|
620
|
+
onSeriesMouseOver: U,
|
|
621
|
+
refValues: Z,
|
|
622
|
+
maxValue: C,
|
|
623
|
+
minValue: p,
|
|
624
|
+
onSeriesMouseClick: F,
|
|
625
|
+
selectedColor: ae,
|
|
626
|
+
rtl: le,
|
|
627
|
+
labelOrder: J,
|
|
628
|
+
maxBarThickness: ee,
|
|
629
|
+
resetSelectionOnDoubleClick: re,
|
|
630
|
+
detailsOnClick: E,
|
|
631
|
+
barAxisTitle: xe,
|
|
632
|
+
valueColor: de,
|
|
633
|
+
noOfTicks: z,
|
|
634
|
+
styles: y,
|
|
635
|
+
classNames: x,
|
|
636
|
+
animate: w,
|
|
637
|
+
colorDomain: T,
|
|
638
|
+
precision: N,
|
|
639
|
+
customLayers: $,
|
|
640
|
+
naLabel: L
|
|
641
|
+
} = fe, B = Me(null), b = Ee(B, {
|
|
642
|
+
once: w.once,
|
|
643
|
+
amount: w.amount
|
|
644
|
+
}), v = {
|
|
645
|
+
top: xe ? ne + 25 : ne,
|
|
646
|
+
bottom: he,
|
|
647
|
+
left: X,
|
|
648
|
+
right: D
|
|
649
|
+
}, [R, V] = S(void 0), [A, ce] = S(void 0), [W, H] = S(void 0), [se, M] = S(void 0), P = ue - v.left - v.right, m = ge - v.top - v.bottom, k = o.map((s, t) => ({
|
|
650
|
+
...s,
|
|
651
|
+
id: J ? `${s.label}` : `${t}`
|
|
652
|
+
})), f = J || k.map((s) => `${s.id}`), d = Re().domain([p, C]).range([0, P]).nice(), u = Ie().domain(f).range([
|
|
653
|
+
0,
|
|
654
|
+
ee ? Math.min(m, ee * f.length) : m
|
|
655
|
+
]).paddingInner(G), n = Ie().domain(o[0].size.map((s, t) => `${t}`)).range([0, u.bandwidth()]).paddingInner(0.1), a = d.ticks(z);
|
|
656
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
657
|
+
/* @__PURE__ */ e.jsx(
|
|
658
|
+
pe.svg,
|
|
659
|
+
{
|
|
660
|
+
ref: B,
|
|
661
|
+
width: `${ue}px`,
|
|
662
|
+
height: `${ge}px`,
|
|
663
|
+
viewBox: `0 0 ${ue} ${ge}`,
|
|
664
|
+
direction: "ltr",
|
|
665
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${v.left},${v.top})`, children: [
|
|
666
|
+
I ? /* @__PURE__ */ e.jsx(
|
|
667
|
+
st,
|
|
668
|
+
{
|
|
669
|
+
values: a.filter((s) => s !== 0),
|
|
670
|
+
x: a.filter((s) => s !== 0).map((s) => d(s)),
|
|
671
|
+
y1: 0 - ne,
|
|
672
|
+
y2: m + v.bottom,
|
|
673
|
+
styles: {
|
|
674
|
+
gridLines: y?.xAxis?.gridLines,
|
|
675
|
+
labels: y?.xAxis?.labels
|
|
676
|
+
},
|
|
677
|
+
classNames: {
|
|
678
|
+
gridLines: x?.xAxis?.gridLines,
|
|
679
|
+
labels: x?.xAxis?.labels
|
|
680
|
+
},
|
|
681
|
+
suffix: Q,
|
|
682
|
+
prefix: Y,
|
|
683
|
+
labelType: "secondary",
|
|
684
|
+
showGridLines: !0,
|
|
685
|
+
precision: N
|
|
686
|
+
}
|
|
687
|
+
) : null,
|
|
688
|
+
/* @__PURE__ */ e.jsx(
|
|
689
|
+
Ye,
|
|
690
|
+
{
|
|
691
|
+
x: P / 2,
|
|
692
|
+
y: 0 - v.top + 15,
|
|
693
|
+
style: y?.xAxis?.title,
|
|
694
|
+
className: x?.xAxis?.title,
|
|
695
|
+
text: xe
|
|
696
|
+
}
|
|
697
|
+
),
|
|
698
|
+
$.filter((s) => s.position === "before").map((s) => s.layer),
|
|
699
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
700
|
+
k.map(
|
|
701
|
+
(s) => q(u(s.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
702
|
+
pe.g,
|
|
703
|
+
{
|
|
704
|
+
variants: {
|
|
705
|
+
initial: {
|
|
706
|
+
x: 0,
|
|
707
|
+
y: u(`${s.id}`)
|
|
708
|
+
},
|
|
709
|
+
whileInView: {
|
|
710
|
+
x: 0,
|
|
711
|
+
y: u(`${s.id}`),
|
|
712
|
+
transition: { duration: w.duration }
|
|
713
|
+
}
|
|
714
|
+
},
|
|
715
|
+
initial: "initial",
|
|
716
|
+
animate: b ? "whileInView" : "initial",
|
|
717
|
+
exit: { opacity: 0, transition: { duration: w.duration } },
|
|
718
|
+
children: [
|
|
719
|
+
s.size.map((t, l) => /* @__PURE__ */ e.jsxs(
|
|
720
|
+
pe.g,
|
|
721
|
+
{
|
|
722
|
+
className: "undp-viz-g-with-hover",
|
|
723
|
+
opacity: ae ? g[l] === ae ? 1 : 0.3 : 0.85,
|
|
724
|
+
onMouseEnter: (h) => {
|
|
725
|
+
V({ ...s, sizeIndex: l }), M(h.clientY), H(h.clientX), U?.({ ...s, sizeIndex: l });
|
|
726
|
+
},
|
|
727
|
+
onMouseMove: (h) => {
|
|
728
|
+
V({ ...s, sizeIndex: l }), M(h.clientY), H(h.clientX);
|
|
729
|
+
},
|
|
730
|
+
onMouseLeave: () => {
|
|
731
|
+
V(void 0), H(void 0), M(void 0), U?.(void 0);
|
|
732
|
+
},
|
|
733
|
+
onClick: () => {
|
|
734
|
+
(F || E) && (Pe(A, { ...s, sizeIndex: l }) && re ? (ce(void 0), F?.(void 0)) : (ce({ ...s, sizeIndex: l }), F && F({ ...s, sizeIndex: l })));
|
|
735
|
+
},
|
|
736
|
+
children: [
|
|
737
|
+
q(t) ? null : /* @__PURE__ */ e.jsx(
|
|
738
|
+
pe.rect,
|
|
739
|
+
{
|
|
740
|
+
y: n(`${l}`),
|
|
741
|
+
variants: {
|
|
742
|
+
initial: {
|
|
743
|
+
width: 0,
|
|
744
|
+
x: d(0),
|
|
745
|
+
fill: g[l]
|
|
746
|
+
},
|
|
747
|
+
whileInView: {
|
|
748
|
+
width: q(t) ? 0 : t >= 0 ? d(t) - d(0) : d(0) - d(t),
|
|
749
|
+
x: t >= 0 ? d(0) : d(t),
|
|
750
|
+
fill: g[l],
|
|
751
|
+
transition: { duration: w.duration }
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
exit: {
|
|
755
|
+
width: 0,
|
|
756
|
+
x: d(0),
|
|
757
|
+
transition: { duration: w.duration }
|
|
758
|
+
},
|
|
759
|
+
height: n.bandwidth(),
|
|
760
|
+
initial: "initial",
|
|
761
|
+
animate: b ? "whileInView" : "initial"
|
|
762
|
+
}
|
|
763
|
+
),
|
|
764
|
+
ie ? /* @__PURE__ */ e.jsx(
|
|
765
|
+
pe.text,
|
|
766
|
+
{
|
|
767
|
+
y: n(`${l}`) + n.bandwidth() / 2,
|
|
768
|
+
style: {
|
|
769
|
+
fill: de || g[l],
|
|
770
|
+
textAnchor: t && t < 0 ? "end" : "start",
|
|
771
|
+
...y?.graphObjectValues || {}
|
|
772
|
+
},
|
|
773
|
+
className: Ne("graph-value text-sm", x?.graphObjectValues),
|
|
774
|
+
dx: t && t < 0 ? -5 : 5,
|
|
775
|
+
dy: "0.33em",
|
|
776
|
+
variants: {
|
|
777
|
+
initial: { x: d(0), opacity: 0 },
|
|
778
|
+
whileInView: {
|
|
779
|
+
x: d(t || 0),
|
|
780
|
+
opacity: 1,
|
|
781
|
+
transition: { duration: w.duration }
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
initial: "initial",
|
|
785
|
+
animate: b ? "whileInView" : "initial",
|
|
786
|
+
exit: {
|
|
787
|
+
opacity: 0,
|
|
788
|
+
transition: { duration: w.duration }
|
|
789
|
+
},
|
|
790
|
+
children: De(t, L, N, Y, Q)
|
|
791
|
+
}
|
|
792
|
+
) : null
|
|
793
|
+
]
|
|
794
|
+
},
|
|
795
|
+
`${s.label}-${T[l] || l}`
|
|
796
|
+
)),
|
|
797
|
+
j ? /* @__PURE__ */ e.jsx(
|
|
798
|
+
rt,
|
|
799
|
+
{
|
|
800
|
+
value: `${s.label}`.length < me ? `${s.label}` : `${`${s.label}`.substring(0, me)}...`,
|
|
801
|
+
y: 0,
|
|
802
|
+
x: 0 - v.left,
|
|
803
|
+
width: d(p < 0 ? 0 : p) + v.left,
|
|
804
|
+
height: u.bandwidth(),
|
|
805
|
+
style: y?.yAxis?.labels,
|
|
806
|
+
className: x?.yAxis?.labels,
|
|
807
|
+
animate: w,
|
|
808
|
+
isInView: b
|
|
809
|
+
}
|
|
810
|
+
) : null
|
|
811
|
+
]
|
|
812
|
+
},
|
|
813
|
+
s.label
|
|
814
|
+
)
|
|
815
|
+
),
|
|
816
|
+
/* @__PURE__ */ e.jsx(
|
|
817
|
+
_e,
|
|
818
|
+
{
|
|
819
|
+
x1: d(p < 0 ? 0 : p),
|
|
820
|
+
x2: d(p < 0 ? 0 : p),
|
|
821
|
+
y1: -2.5,
|
|
822
|
+
y2: m + v.bottom,
|
|
823
|
+
classNames: { axis: x?.yAxis?.axis },
|
|
824
|
+
styles: { axis: y?.yAxis?.axis }
|
|
825
|
+
}
|
|
826
|
+
),
|
|
827
|
+
Z ? /* @__PURE__ */ e.jsx(e.Fragment, { children: Z.map((s, t) => /* @__PURE__ */ e.jsx(
|
|
828
|
+
ot,
|
|
829
|
+
{
|
|
830
|
+
text: s.text,
|
|
831
|
+
color: s.color,
|
|
832
|
+
x: d(s.value),
|
|
833
|
+
y1: 0 - v.top,
|
|
834
|
+
y2: m + v.bottom,
|
|
835
|
+
textSide: d(s.value) > P * 0.75 || le ? "left" : "right",
|
|
836
|
+
classNames: s.classNames,
|
|
837
|
+
styles: s.styles,
|
|
838
|
+
animate: w,
|
|
839
|
+
isInView: b
|
|
840
|
+
},
|
|
841
|
+
t
|
|
842
|
+
)) }) : null
|
|
843
|
+
] }),
|
|
844
|
+
$.filter((s) => s.position === "after").map((s) => s.layer)
|
|
845
|
+
] })
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
R && _ && W && se ? /* @__PURE__ */ e.jsx(
|
|
849
|
+
Ge,
|
|
850
|
+
{
|
|
851
|
+
data: R,
|
|
852
|
+
body: _,
|
|
853
|
+
xPos: W,
|
|
854
|
+
yPos: se,
|
|
855
|
+
backgroundStyle: y?.tooltip,
|
|
856
|
+
className: x?.tooltip
|
|
857
|
+
}
|
|
858
|
+
) : null,
|
|
859
|
+
E && A !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
860
|
+
We,
|
|
861
|
+
{
|
|
862
|
+
open: A !== void 0,
|
|
863
|
+
onClose: () => {
|
|
864
|
+
ce(void 0);
|
|
865
|
+
},
|
|
866
|
+
children: /* @__PURE__ */ e.jsx(
|
|
867
|
+
"div",
|
|
868
|
+
{
|
|
869
|
+
className: "graph-modal-content m-0",
|
|
870
|
+
dangerouslySetInnerHTML: typeof E == "string" ? { __html: Xe(E, A) } : void 0,
|
|
871
|
+
children: typeof E == "function" ? E(A) : null
|
|
872
|
+
}
|
|
873
|
+
)
|
|
874
|
+
}
|
|
875
|
+
) : null
|
|
876
|
+
] });
|
|
877
|
+
}
|
|
878
|
+
function gt(fe) {
|
|
879
|
+
const {
|
|
880
|
+
data: o,
|
|
881
|
+
graphTitle: g,
|
|
882
|
+
colors: G = je.light.categoricalColors.colors,
|
|
883
|
+
sources: I,
|
|
884
|
+
graphDescription: X,
|
|
885
|
+
barPadding: me = 0.25,
|
|
886
|
+
showTicks: ue = !0,
|
|
887
|
+
truncateBy: ge = 999,
|
|
888
|
+
height: Q,
|
|
889
|
+
width: Y,
|
|
890
|
+
footNote: ie,
|
|
891
|
+
colorDomain: D,
|
|
892
|
+
colorLegendTitle: ne,
|
|
893
|
+
suffix: he = "",
|
|
894
|
+
prefix: j = "",
|
|
895
|
+
showValues: _ = !0,
|
|
896
|
+
showColorScale: U = !0,
|
|
897
|
+
padding: Z,
|
|
898
|
+
backgroundColor: C = !1,
|
|
899
|
+
leftMargin: p = 100,
|
|
900
|
+
rightMargin: F = 40,
|
|
901
|
+
topMargin: ae = 25,
|
|
902
|
+
bottomMargin: le = 10,
|
|
903
|
+
showLabels: J = !0,
|
|
904
|
+
relativeHeight: ee,
|
|
905
|
+
tooltip: re,
|
|
906
|
+
onSeriesMouseOver: E,
|
|
907
|
+
refValues: xe,
|
|
908
|
+
graphID: de,
|
|
909
|
+
maxValue: z,
|
|
910
|
+
minValue: y,
|
|
911
|
+
onSeriesMouseClick: x,
|
|
912
|
+
graphDownload: w = !1,
|
|
913
|
+
dataDownload: T = !1,
|
|
914
|
+
language: N = "en",
|
|
915
|
+
labelOrder: $,
|
|
916
|
+
minHeight: L = 0,
|
|
917
|
+
theme: B = "light",
|
|
918
|
+
maxBarThickness: b,
|
|
919
|
+
ariaLabel: v,
|
|
920
|
+
resetSelectionOnDoubleClick: R = !0,
|
|
921
|
+
detailsOnClick: V,
|
|
922
|
+
barAxisTitle: A,
|
|
923
|
+
noOfTicks: ce = 5,
|
|
924
|
+
valueColor: W,
|
|
925
|
+
styles: H,
|
|
926
|
+
classNames: se,
|
|
927
|
+
filterNA: M = !0,
|
|
928
|
+
animate: P = !1,
|
|
929
|
+
precision: m = 2,
|
|
930
|
+
customLayers: k = [],
|
|
931
|
+
timeline: f = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
932
|
+
naLabel: d = "NA"
|
|
933
|
+
} = fe, [u, n] = S(0), [a, s] = S(0), [t, l] = S(f.autoplay), h = Be(
|
|
934
|
+
Te(
|
|
935
|
+
o.filter((c) => c.date !== void 0 && c.date !== null),
|
|
936
|
+
(c) => c.date
|
|
937
|
+
).map((c) => Se(`${c.date}`, f.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
938
|
+
(c, te) => tt(c, te)
|
|
939
|
+
), [Oe, K] = S(f.autoplay ? 0 : h.length - 1), [we, ve] = S(void 0), Ce = Me(null), oe = Me(null);
|
|
940
|
+
ze(() => {
|
|
941
|
+
const c = new ResizeObserver((te) => {
|
|
942
|
+
n(Y || te[0].target.clientWidth || 620), s(Q || te[0].target.clientHeight || 480);
|
|
943
|
+
});
|
|
944
|
+
return Ce.current && (s(Ce.current.clientHeight || 480), n(Ce.current.clientWidth || 620), Y || c.observe(Ce.current)), () => c.disconnect();
|
|
945
|
+
}, [Y, Q]), ze(() => {
|
|
946
|
+
const c = setInterval(
|
|
947
|
+
() => {
|
|
948
|
+
K((te) => te < h.length - 1 ? te + 1 : 0);
|
|
949
|
+
},
|
|
950
|
+
(f.speed || 2) * 1e3
|
|
951
|
+
);
|
|
952
|
+
return t || clearInterval(c), () => clearInterval(c);
|
|
953
|
+
}, [h, t, f.speed]);
|
|
954
|
+
const ye = Fe(
|
|
955
|
+
h,
|
|
956
|
+
Oe,
|
|
957
|
+
f.showOnlyActiveDate,
|
|
958
|
+
f.dateFormat || "yyyy"
|
|
959
|
+
);
|
|
960
|
+
return /* @__PURE__ */ e.jsx(
|
|
961
|
+
"div",
|
|
962
|
+
{
|
|
963
|
+
className: `${B || "light"} flex ${Y ? "w-fit grow-0" : "w-full grow"}`,
|
|
964
|
+
dir: N === "he" || N === "ar" ? "rtl" : void 0,
|
|
965
|
+
children: /* @__PURE__ */ e.jsx(
|
|
966
|
+
"div",
|
|
967
|
+
{
|
|
968
|
+
className: Ne(
|
|
969
|
+
`${C ? C === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${N || "en"}`,
|
|
970
|
+
se?.graphContainer
|
|
971
|
+
),
|
|
972
|
+
style: {
|
|
973
|
+
...H?.graphContainer || {},
|
|
974
|
+
...C && C !== !0 ? { backgroundColor: C } : {}
|
|
975
|
+
},
|
|
976
|
+
id: de,
|
|
977
|
+
ref: oe,
|
|
978
|
+
"aria-label": v || `${g ? `The graph shows ${g}. ` : ""}This is a grouped bar chart. ${X ? ` ${X}` : ""}`,
|
|
979
|
+
children: /* @__PURE__ */ e.jsx(
|
|
980
|
+
"div",
|
|
981
|
+
{
|
|
982
|
+
className: "flex grow",
|
|
983
|
+
style: { padding: C ? Z || "1rem" : Z || 0 },
|
|
984
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 w-full grow justify-between", children: [
|
|
985
|
+
g || X || w || T ? /* @__PURE__ */ e.jsx(
|
|
986
|
+
Je,
|
|
987
|
+
{
|
|
988
|
+
styles: {
|
|
989
|
+
title: H?.title,
|
|
990
|
+
description: H?.description
|
|
991
|
+
},
|
|
992
|
+
classNames: {
|
|
993
|
+
title: se?.title,
|
|
994
|
+
description: se?.description
|
|
995
|
+
},
|
|
996
|
+
graphTitle: g,
|
|
997
|
+
graphDescription: X,
|
|
998
|
+
width: Y,
|
|
999
|
+
graphDownload: w ? oe.current : void 0,
|
|
1000
|
+
dataDownload: T ? o.map((c) => c.data).filter((c) => c !== void 0).length > 0 ? o.map((c) => c.data).filter((c) => c !== void 0) : o.filter((c) => c !== void 0) : null
|
|
1001
|
+
}
|
|
1002
|
+
) : null,
|
|
1003
|
+
f.enabled && h.length > 0 && ye ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
1004
|
+
/* @__PURE__ */ e.jsx(
|
|
1005
|
+
"button",
|
|
1006
|
+
{
|
|
1007
|
+
type: "button",
|
|
1008
|
+
onClick: () => {
|
|
1009
|
+
l(!t);
|
|
1010
|
+
},
|
|
1011
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
1012
|
+
"aria-label": t ? "Click to pause animation" : "Click to play animation",
|
|
1013
|
+
children: t ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
1014
|
+
}
|
|
1015
|
+
),
|
|
1016
|
+
/* @__PURE__ */ e.jsx(
|
|
1017
|
+
He,
|
|
1018
|
+
{
|
|
1019
|
+
min: h[0],
|
|
1020
|
+
max: h[h.length - 1],
|
|
1021
|
+
marks: ye,
|
|
1022
|
+
step: null,
|
|
1023
|
+
defaultValue: h[h.length - 1],
|
|
1024
|
+
value: h[Oe],
|
|
1025
|
+
onChangeComplete: (c) => {
|
|
1026
|
+
K(h.indexOf(c));
|
|
1027
|
+
},
|
|
1028
|
+
onChange: (c) => {
|
|
1029
|
+
K(h.indexOf(c));
|
|
1030
|
+
},
|
|
1031
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
] }) : null,
|
|
1035
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1036
|
+
U ? /* @__PURE__ */ e.jsx(
|
|
1037
|
+
Ke,
|
|
1038
|
+
{
|
|
1039
|
+
width: Y,
|
|
1040
|
+
colorDomain: D,
|
|
1041
|
+
colors: G,
|
|
1042
|
+
colorLegendTitle: ne,
|
|
1043
|
+
setSelectedColor: ve,
|
|
1044
|
+
showNAColor: !1
|
|
1045
|
+
}
|
|
1046
|
+
) : null,
|
|
1047
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full grow leading-0", ref: Ce, "aria-label": "Graph area", children: (Y || u) && (Q || a) ? /* @__PURE__ */ e.jsx(
|
|
1048
|
+
mt,
|
|
1049
|
+
{
|
|
1050
|
+
data: Ve(
|
|
1051
|
+
o,
|
|
1052
|
+
f.dateFormat || "yyyy"
|
|
1053
|
+
).filter(
|
|
1054
|
+
(c) => f.enabled ? c.date === $e(
|
|
1055
|
+
new Date(h[Oe]),
|
|
1056
|
+
f.dateFormat || "yyyy"
|
|
1057
|
+
) : c
|
|
1058
|
+
).filter((c) => M ? !c.size.every((te) => te == null) : c),
|
|
1059
|
+
barColors: G,
|
|
1060
|
+
width: Y || u,
|
|
1061
|
+
height: Math.max(
|
|
1062
|
+
L,
|
|
1063
|
+
Q || (ee ? L ? (Y || u) * ee > L ? (Y || u) * ee : L : (Y || u) * ee : a)
|
|
1064
|
+
),
|
|
1065
|
+
suffix: he,
|
|
1066
|
+
prefix: j,
|
|
1067
|
+
showValues: _,
|
|
1068
|
+
barPadding: me,
|
|
1069
|
+
showTicks: ue,
|
|
1070
|
+
leftMargin: p,
|
|
1071
|
+
rightMargin: F,
|
|
1072
|
+
topMargin: ae,
|
|
1073
|
+
bottomMargin: le,
|
|
1074
|
+
truncateBy: ge,
|
|
1075
|
+
showLabels: J,
|
|
1076
|
+
tooltip: re,
|
|
1077
|
+
onSeriesMouseOver: E,
|
|
1078
|
+
refValues: xe,
|
|
1079
|
+
maxValue: q(z) ? Math.max(
|
|
1080
|
+
...o.map(
|
|
1081
|
+
(c) => Math.max(
|
|
1082
|
+
...c.size.filter(
|
|
1083
|
+
(te) => !q(te)
|
|
1084
|
+
)
|
|
1085
|
+
)
|
|
1086
|
+
)
|
|
1087
|
+
) < 0 ? 0 : Math.max(
|
|
1088
|
+
...o.map(
|
|
1089
|
+
(c) => Math.max(
|
|
1090
|
+
...c.size.filter(
|
|
1091
|
+
(te) => !q(te)
|
|
1092
|
+
)
|
|
1093
|
+
)
|
|
1094
|
+
)
|
|
1095
|
+
) : z,
|
|
1096
|
+
minValue: q(y) ? Math.min(
|
|
1097
|
+
...o.map(
|
|
1098
|
+
(c) => Math.min(
|
|
1099
|
+
...c.size.filter(
|
|
1100
|
+
(te) => !q(te)
|
|
1101
|
+
)
|
|
1102
|
+
)
|
|
1103
|
+
)
|
|
1104
|
+
) >= 0 ? 0 : Math.min(
|
|
1105
|
+
...o.map(
|
|
1106
|
+
(c) => Math.min(
|
|
1107
|
+
...c.size.filter(
|
|
1108
|
+
(te) => !q(te)
|
|
1109
|
+
)
|
|
1110
|
+
)
|
|
1111
|
+
)
|
|
1112
|
+
) : y,
|
|
1113
|
+
onSeriesMouseClick: x,
|
|
1114
|
+
selectedColor: we,
|
|
1115
|
+
labelOrder: $,
|
|
1116
|
+
rtl: N === "he" || N === "ar",
|
|
1117
|
+
maxBarThickness: b,
|
|
1118
|
+
resetSelectionOnDoubleClick: R,
|
|
1119
|
+
detailsOnClick: V,
|
|
1120
|
+
barAxisTitle: A,
|
|
1121
|
+
noOfTicks: ce,
|
|
1122
|
+
valueColor: W,
|
|
1123
|
+
styles: H,
|
|
1124
|
+
classNames: se,
|
|
1125
|
+
colorDomain: D,
|
|
1126
|
+
animate: P === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : P || { duration: 0, once: !0, amount: 0 },
|
|
1127
|
+
precision: m,
|
|
1128
|
+
customLayers: k,
|
|
1129
|
+
naLabel: d
|
|
1130
|
+
}
|
|
1131
|
+
) : null })
|
|
1132
|
+
] }) }),
|
|
1133
|
+
I || ie ? /* @__PURE__ */ e.jsx(
|
|
1134
|
+
Ue,
|
|
1135
|
+
{
|
|
1136
|
+
styles: { footnote: H?.footnote, source: H?.source },
|
|
1137
|
+
classNames: {
|
|
1138
|
+
footnote: se?.footnote,
|
|
1139
|
+
source: se?.source
|
|
1140
|
+
},
|
|
1141
|
+
sources: I,
|
|
1142
|
+
footNote: ie,
|
|
1143
|
+
width: Y
|
|
1144
|
+
}
|
|
1145
|
+
) : null
|
|
1146
|
+
] })
|
|
1147
|
+
}
|
|
1148
|
+
)
|
|
1149
|
+
}
|
|
1150
|
+
)
|
|
1151
|
+
}
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
function xt(fe) {
|
|
1155
|
+
const {
|
|
1156
|
+
data: o,
|
|
1157
|
+
barColors: g,
|
|
1158
|
+
barPadding: G,
|
|
1159
|
+
showTicks: I,
|
|
1160
|
+
leftMargin: X,
|
|
1161
|
+
rightMargin: me,
|
|
1162
|
+
truncateBy: ue,
|
|
1163
|
+
width: ge,
|
|
1164
|
+
height: Q,
|
|
1165
|
+
topMargin: Y,
|
|
1166
|
+
bottomMargin: ie,
|
|
1167
|
+
tooltip: D,
|
|
1168
|
+
onSeriesMouseOver: ne,
|
|
1169
|
+
showLabels: he,
|
|
1170
|
+
suffix: j,
|
|
1171
|
+
prefix: _,
|
|
1172
|
+
showValues: U,
|
|
1173
|
+
refValues: Z,
|
|
1174
|
+
maxValue: C,
|
|
1175
|
+
onSeriesMouseClick: p,
|
|
1176
|
+
selectedColor: F,
|
|
1177
|
+
rtl: ae,
|
|
1178
|
+
labelOrder: le,
|
|
1179
|
+
maxBarThickness: J,
|
|
1180
|
+
minBarThickness: ee,
|
|
1181
|
+
resetSelectionOnDoubleClick: re,
|
|
1182
|
+
detailsOnClick: E,
|
|
1183
|
+
barAxisTitle: xe,
|
|
1184
|
+
valueColor: de,
|
|
1185
|
+
noOfTicks: z,
|
|
1186
|
+
styles: y,
|
|
1187
|
+
classNames: x,
|
|
1188
|
+
animate: w,
|
|
1189
|
+
colorDomain: T,
|
|
1190
|
+
precision: N,
|
|
1191
|
+
customLayers: $,
|
|
1192
|
+
naLabel: L
|
|
1193
|
+
} = fe, B = Me(null), b = Ee(B, {
|
|
1194
|
+
once: w.once,
|
|
1195
|
+
amount: w.amount
|
|
1196
|
+
}), v = {
|
|
1197
|
+
top: xe ? Y + 25 : Y,
|
|
1198
|
+
bottom: ie,
|
|
1199
|
+
left: X,
|
|
1200
|
+
right: me
|
|
1201
|
+
}, [R, V] = S(void 0), [A, ce] = S(void 0), [W, H] = S(void 0), [se, M] = S(void 0), P = ge - v.left - v.right, m = Q - v.top - v.bottom, k = o.map((a, s) => ({
|
|
1202
|
+
...a,
|
|
1203
|
+
id: le ? `${a.label}` : `${s}`
|
|
1204
|
+
})), f = le || k.map((a) => `${a.id}`), d = Re().domain([0, C]).range([0, P]).nice(), u = Ie().domain(f).range([
|
|
1205
|
+
0,
|
|
1206
|
+
ee ? Math.max(m, ee * f.length) : J ? Math.min(m, J * f.length) : m
|
|
1207
|
+
]).paddingInner(G), n = d.ticks(z);
|
|
1208
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1209
|
+
/* @__PURE__ */ e.jsx(
|
|
1210
|
+
pe.svg,
|
|
1211
|
+
{
|
|
1212
|
+
ref: B,
|
|
1213
|
+
width: `${ge}px`,
|
|
1214
|
+
height: `${Q}px`,
|
|
1215
|
+
viewBox: `0 0 ${ge} ${Q}`,
|
|
1216
|
+
direction: "ltr",
|
|
1217
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${v.left},${v.top})`, children: [
|
|
1218
|
+
I ? /* @__PURE__ */ e.jsx(
|
|
1219
|
+
st,
|
|
1220
|
+
{
|
|
1221
|
+
values: n.filter((a) => a !== 0),
|
|
1222
|
+
x: n.filter((a) => a !== 0).map((a) => d(a)),
|
|
1223
|
+
y1: 0 - Y,
|
|
1224
|
+
y2: m + v.bottom,
|
|
1225
|
+
styles: {
|
|
1226
|
+
gridLines: y?.xAxis?.gridLines,
|
|
1227
|
+
labels: y?.xAxis?.labels
|
|
1228
|
+
},
|
|
1229
|
+
classNames: {
|
|
1230
|
+
gridLines: x?.xAxis?.gridLines,
|
|
1231
|
+
labels: x?.xAxis?.labels
|
|
1232
|
+
},
|
|
1233
|
+
suffix: j,
|
|
1234
|
+
prefix: _,
|
|
1235
|
+
labelType: "secondary",
|
|
1236
|
+
showGridLines: !0,
|
|
1237
|
+
precision: N
|
|
1238
|
+
}
|
|
1239
|
+
) : null,
|
|
1240
|
+
/* @__PURE__ */ e.jsx(
|
|
1241
|
+
Ye,
|
|
1242
|
+
{
|
|
1243
|
+
x: P / 2,
|
|
1244
|
+
y: 0 - v.top + 15,
|
|
1245
|
+
style: y?.xAxis?.title,
|
|
1246
|
+
className: x?.xAxis?.title,
|
|
1247
|
+
text: xe
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
$.filter((a) => a.position === "before").map((a) => a.layer),
|
|
1251
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
1252
|
+
k.map(
|
|
1253
|
+
(a) => q(u(a.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
1254
|
+
pe.g,
|
|
1255
|
+
{
|
|
1256
|
+
className: "undp-viz-low-opacity undp-viz-g-with-hover",
|
|
1257
|
+
variants: {
|
|
1258
|
+
initial: { x: 0, y: u(`${a.id}`) },
|
|
1259
|
+
whileInView: {
|
|
1260
|
+
x: 0,
|
|
1261
|
+
y: u(`${a.id}`),
|
|
1262
|
+
transition: { duration: w.duration }
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
initial: "initial",
|
|
1266
|
+
animate: b ? "whileInView" : "initial",
|
|
1267
|
+
exit: { opacity: 0, transition: { duration: w.duration } },
|
|
1268
|
+
children: [
|
|
1269
|
+
a.size.map((s, t) => /* @__PURE__ */ e.jsxs(
|
|
1270
|
+
pe.g,
|
|
1271
|
+
{
|
|
1272
|
+
opacity: F ? g[t] === F ? 1 : 0.3 : 1,
|
|
1273
|
+
onMouseEnter: (l) => {
|
|
1274
|
+
V({ ...a, sizeIndex: t }), M(l.clientY), H(l.clientX), ne?.({ ...a, sizeIndex: t });
|
|
1275
|
+
},
|
|
1276
|
+
onMouseMove: (l) => {
|
|
1277
|
+
V({ ...a, sizeIndex: t }), M(l.clientY), H(l.clientX);
|
|
1278
|
+
},
|
|
1279
|
+
onMouseLeave: () => {
|
|
1280
|
+
V(void 0), H(void 0), M(void 0), ne?.(void 0);
|
|
1281
|
+
},
|
|
1282
|
+
onClick: () => {
|
|
1283
|
+
(p || E) && (Pe(A, { ...a, sizeIndex: t }) && re ? (ce(void 0), p?.(void 0)) : (ce({ ...a, sizeIndex: t }), p && p({ ...a, sizeIndex: t })));
|
|
1284
|
+
},
|
|
1285
|
+
children: [
|
|
1286
|
+
s ? /* @__PURE__ */ e.jsx(
|
|
1287
|
+
pe.rect,
|
|
1288
|
+
{
|
|
1289
|
+
y: 0,
|
|
1290
|
+
style: { fill: g[t] },
|
|
1291
|
+
height: u.bandwidth(),
|
|
1292
|
+
exit: {
|
|
1293
|
+
width: 0,
|
|
1294
|
+
x: d(0),
|
|
1295
|
+
transition: { duration: w.duration }
|
|
1296
|
+
},
|
|
1297
|
+
variants: {
|
|
1298
|
+
initial: {
|
|
1299
|
+
width: 0,
|
|
1300
|
+
x: d(0),
|
|
1301
|
+
fill: g[t]
|
|
1302
|
+
},
|
|
1303
|
+
whileInView: {
|
|
1304
|
+
width: d(s || 0),
|
|
1305
|
+
x: d(
|
|
1306
|
+
t === 0 ? 0 : ke(a.size.filter((l, h) => h < t && l))
|
|
1307
|
+
),
|
|
1308
|
+
fill: g[t],
|
|
1309
|
+
transition: { duration: w.duration }
|
|
1310
|
+
}
|
|
1311
|
+
},
|
|
1312
|
+
initial: "initial",
|
|
1313
|
+
animate: b ? "whileInView" : "initial"
|
|
1314
|
+
},
|
|
1315
|
+
t
|
|
1316
|
+
) : null,
|
|
1317
|
+
U ? /* @__PURE__ */ e.jsx(
|
|
1318
|
+
pe.text,
|
|
1319
|
+
{
|
|
1320
|
+
y: u.bandwidth() / 2,
|
|
1321
|
+
style: {
|
|
1322
|
+
textAnchor: "middle",
|
|
1323
|
+
...y?.graphObjectValues || {}
|
|
1324
|
+
},
|
|
1325
|
+
dy: "0.33em",
|
|
1326
|
+
className: Ne("graph-value text-sm", x?.graphObjectValues),
|
|
1327
|
+
exit: {
|
|
1328
|
+
opacity: 0,
|
|
1329
|
+
transition: { duration: w.duration }
|
|
1330
|
+
},
|
|
1331
|
+
variants: {
|
|
1332
|
+
initial: {
|
|
1333
|
+
x: d(0),
|
|
1334
|
+
opacity: 0,
|
|
1335
|
+
fill: lt(g[t])
|
|
1336
|
+
},
|
|
1337
|
+
whileInView: {
|
|
1338
|
+
x: d(
|
|
1339
|
+
t === 0 ? 0 : ke(a.size.filter((l, h) => h < t && l))
|
|
1340
|
+
) + d(s || 0) / 2,
|
|
1341
|
+
opacity: s && d(s) / De(s, L, N, _, j).length > 12 ? 1 : 0,
|
|
1342
|
+
fill: lt(g[t]),
|
|
1343
|
+
transition: { duration: w.duration }
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
initial: "initial",
|
|
1347
|
+
animate: b ? "whileInView" : "initial",
|
|
1348
|
+
children: De(s, L, N, _, j)
|
|
1349
|
+
}
|
|
1350
|
+
) : null
|
|
1351
|
+
]
|
|
1352
|
+
},
|
|
1353
|
+
`${a.label}-${T[t] || t}`
|
|
1354
|
+
)),
|
|
1355
|
+
he ? /* @__PURE__ */ e.jsx(
|
|
1356
|
+
rt,
|
|
1357
|
+
{
|
|
1358
|
+
value: `${a.label}`.length < ue ? `${a.label}` : `${`${a.label}`.substring(0, ue)}...`,
|
|
1359
|
+
y: 0,
|
|
1360
|
+
x: 0 - v.left,
|
|
1361
|
+
width: 0 + v.left,
|
|
1362
|
+
height: u.bandwidth(),
|
|
1363
|
+
style: y?.yAxis?.labels,
|
|
1364
|
+
className: x?.yAxis?.labels,
|
|
1365
|
+
animate: w,
|
|
1366
|
+
isInView: b
|
|
1367
|
+
}
|
|
1368
|
+
) : null,
|
|
1369
|
+
U ? /* @__PURE__ */ e.jsx(
|
|
1370
|
+
pe.text,
|
|
1371
|
+
{
|
|
1372
|
+
className: Ne(
|
|
1373
|
+
"graph-value graph-value-total text-sm",
|
|
1374
|
+
de ? "" : " fill-primary-gray-700 dark:fill-primary-gray-300",
|
|
1375
|
+
x?.graphObjectValues
|
|
1376
|
+
),
|
|
1377
|
+
style: {
|
|
1378
|
+
...de ? { fill: de } : {},
|
|
1379
|
+
textAnchor: "start",
|
|
1380
|
+
...y?.graphObjectValues || {}
|
|
1381
|
+
},
|
|
1382
|
+
y: u.bandwidth() / 2,
|
|
1383
|
+
dx: 5,
|
|
1384
|
+
dy: "0.33em",
|
|
1385
|
+
variants: {
|
|
1386
|
+
initial: {
|
|
1387
|
+
x: d(0),
|
|
1388
|
+
opacity: 0
|
|
1389
|
+
},
|
|
1390
|
+
whileInView: {
|
|
1391
|
+
x: d(ke(a.size.map((s) => s || 0))),
|
|
1392
|
+
opacity: 1,
|
|
1393
|
+
transition: { duration: w.duration }
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
exit: {
|
|
1397
|
+
opacity: 0,
|
|
1398
|
+
transition: { duration: w.duration }
|
|
1399
|
+
},
|
|
1400
|
+
initial: "initial",
|
|
1401
|
+
animate: b ? "whileInView" : "initial",
|
|
1402
|
+
children: De(
|
|
1403
|
+
ke(a.size.filter((s) => s)),
|
|
1404
|
+
L,
|
|
1405
|
+
N,
|
|
1406
|
+
_,
|
|
1407
|
+
j
|
|
1408
|
+
)
|
|
1409
|
+
}
|
|
1410
|
+
) : null
|
|
1411
|
+
]
|
|
1412
|
+
},
|
|
1413
|
+
a.label
|
|
1414
|
+
)
|
|
1415
|
+
),
|
|
1416
|
+
/* @__PURE__ */ e.jsx(
|
|
1417
|
+
_e,
|
|
1418
|
+
{
|
|
1419
|
+
x1: d(0),
|
|
1420
|
+
x2: d(0),
|
|
1421
|
+
y1: -2.5,
|
|
1422
|
+
y2: m + v.bottom,
|
|
1423
|
+
classNames: { axis: x?.yAxis?.axis },
|
|
1424
|
+
styles: { axis: y?.yAxis?.axis }
|
|
1425
|
+
}
|
|
1426
|
+
),
|
|
1427
|
+
Z ? /* @__PURE__ */ e.jsx(e.Fragment, { children: Z.map((a, s) => /* @__PURE__ */ e.jsx(
|
|
1428
|
+
ot,
|
|
1429
|
+
{
|
|
1430
|
+
text: a.text,
|
|
1431
|
+
color: a.color,
|
|
1432
|
+
x: d(a.value),
|
|
1433
|
+
y1: 0 - v.top,
|
|
1434
|
+
y2: m + v.bottom,
|
|
1435
|
+
textSide: d(a.value) > P * 0.75 || ae ? "left" : "right",
|
|
1436
|
+
classNames: a.classNames,
|
|
1437
|
+
styles: a.styles,
|
|
1438
|
+
animate: w,
|
|
1439
|
+
isInView: b
|
|
1440
|
+
},
|
|
1441
|
+
s
|
|
1442
|
+
)) }) : null
|
|
1443
|
+
] }),
|
|
1444
|
+
$.filter((a) => a.position === "after").map((a) => a.layer)
|
|
1445
|
+
] })
|
|
1446
|
+
}
|
|
1447
|
+
),
|
|
1448
|
+
R && D && W && se ? /* @__PURE__ */ e.jsx(
|
|
1449
|
+
Ge,
|
|
1450
|
+
{
|
|
1451
|
+
data: R,
|
|
1452
|
+
body: D,
|
|
1453
|
+
xPos: W,
|
|
1454
|
+
yPos: se,
|
|
1455
|
+
backgroundStyle: y?.tooltip,
|
|
1456
|
+
className: x?.tooltip
|
|
1457
|
+
}
|
|
1458
|
+
) : null,
|
|
1459
|
+
E && A !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
1460
|
+
We,
|
|
1461
|
+
{
|
|
1462
|
+
open: A !== void 0,
|
|
1463
|
+
onClose: () => {
|
|
1464
|
+
ce(void 0);
|
|
1465
|
+
},
|
|
1466
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1467
|
+
"div",
|
|
1468
|
+
{
|
|
1469
|
+
className: "graph-modal-content m-0",
|
|
1470
|
+
dangerouslySetInnerHTML: typeof E == "string" ? { __html: Xe(E, A) } : void 0,
|
|
1471
|
+
children: typeof E == "function" ? E(A) : null
|
|
1472
|
+
}
|
|
1473
|
+
)
|
|
1474
|
+
}
|
|
1475
|
+
) : null
|
|
1476
|
+
] });
|
|
1477
|
+
}
|
|
1478
|
+
function pt(fe) {
|
|
1479
|
+
const {
|
|
1480
|
+
data: o,
|
|
1481
|
+
graphTitle: g,
|
|
1482
|
+
colors: G = je.light.categoricalColors.colors,
|
|
1483
|
+
sources: I,
|
|
1484
|
+
graphDescription: X,
|
|
1485
|
+
barPadding: me = 0.25,
|
|
1486
|
+
showTicks: ue = !0,
|
|
1487
|
+
leftMargin: ge = 100,
|
|
1488
|
+
rightMargin: Q = 40,
|
|
1489
|
+
truncateBy: Y = 999,
|
|
1490
|
+
height: ie,
|
|
1491
|
+
width: D,
|
|
1492
|
+
footNote: ne,
|
|
1493
|
+
colorDomain: he,
|
|
1494
|
+
colorLegendTitle: j,
|
|
1495
|
+
padding: _,
|
|
1496
|
+
backgroundColor: U = !1,
|
|
1497
|
+
topMargin: Z = 25,
|
|
1498
|
+
bottomMargin: C = 10,
|
|
1499
|
+
tooltip: p,
|
|
1500
|
+
onSeriesMouseOver: F,
|
|
1501
|
+
suffix: ae = "",
|
|
1502
|
+
prefix: le = "",
|
|
1503
|
+
showLabels: J = !0,
|
|
1504
|
+
relativeHeight: ee,
|
|
1505
|
+
showValues: re = !0,
|
|
1506
|
+
refValues: E,
|
|
1507
|
+
graphID: xe,
|
|
1508
|
+
maxValue: de,
|
|
1509
|
+
onSeriesMouseClick: z,
|
|
1510
|
+
graphDownload: y = !1,
|
|
1511
|
+
dataDownload: x = !1,
|
|
1512
|
+
language: w = "en",
|
|
1513
|
+
labelOrder: T,
|
|
1514
|
+
minHeight: N = 0,
|
|
1515
|
+
theme: $ = "light",
|
|
1516
|
+
maxBarThickness: L,
|
|
1517
|
+
sortParameter: B,
|
|
1518
|
+
maxNumberOfBars: b,
|
|
1519
|
+
minBarThickness: v,
|
|
1520
|
+
showColorScale: R = !0,
|
|
1521
|
+
ariaLabel: V,
|
|
1522
|
+
resetSelectionOnDoubleClick: A = !0,
|
|
1523
|
+
detailsOnClick: ce,
|
|
1524
|
+
barAxisTitle: W,
|
|
1525
|
+
noOfTicks: H = 5,
|
|
1526
|
+
valueColor: se,
|
|
1527
|
+
styles: M,
|
|
1528
|
+
classNames: P,
|
|
1529
|
+
filterNA: m = !0,
|
|
1530
|
+
animate: k = !1,
|
|
1531
|
+
precision: f = 2,
|
|
1532
|
+
customLayers: d = [],
|
|
1533
|
+
timeline: u = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
1534
|
+
naLabel: n = "NA"
|
|
1535
|
+
} = fe, [a, s] = S(0), [t, l] = S(0), [h, Oe] = S(u.autoplay), K = Be(
|
|
1536
|
+
Te(
|
|
1537
|
+
o.filter((r) => r.date !== void 0 && r.date !== null),
|
|
1538
|
+
(r) => r.date
|
|
1539
|
+
).map((r) => Se(`${r.date}`, u.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
1540
|
+
(r, O) => tt(r, O)
|
|
1541
|
+
), [we, ve] = S(u.autoplay ? 0 : K.length - 1), [Ce, oe] = S(void 0), ye = Me(null), c = Me(null);
|
|
1542
|
+
ze(() => {
|
|
1543
|
+
const r = new ResizeObserver((O) => {
|
|
1544
|
+
s(D || O[0].target.clientWidth || 620), l(ie || O[0].target.clientHeight || 480);
|
|
1545
|
+
});
|
|
1546
|
+
return ye.current && (l(ye.current.clientHeight || 480), s(ye.current.clientWidth || 620), D || r.observe(ye.current)), () => r.disconnect();
|
|
1547
|
+
}, [D, ie]), ze(() => {
|
|
1548
|
+
const r = setInterval(
|
|
1549
|
+
() => {
|
|
1550
|
+
ve((O) => O < K.length - 1 ? O + 1 : 0);
|
|
1551
|
+
},
|
|
1552
|
+
(u.speed || 2) * 1e3
|
|
1553
|
+
);
|
|
1554
|
+
return h || clearInterval(r), () => clearInterval(r);
|
|
1555
|
+
}, [K, h, u.speed]);
|
|
1556
|
+
const te = Fe(
|
|
1557
|
+
K,
|
|
1558
|
+
we,
|
|
1559
|
+
u.showOnlyActiveDate,
|
|
1560
|
+
u.dateFormat || "yyyy"
|
|
1561
|
+
);
|
|
1562
|
+
return /* @__PURE__ */ e.jsx(
|
|
1563
|
+
"div",
|
|
1564
|
+
{
|
|
1565
|
+
className: `${$ || "light"} flex ${D ? "w-fit grow-0" : "w-full grow"}`,
|
|
1566
|
+
dir: w === "he" || w === "ar" ? "rtl" : void 0,
|
|
1567
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1568
|
+
"div",
|
|
1569
|
+
{
|
|
1570
|
+
className: Ne(
|
|
1571
|
+
`${U ? U === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${w || "en"}`,
|
|
1572
|
+
P?.graphContainer
|
|
1573
|
+
),
|
|
1574
|
+
style: {
|
|
1575
|
+
...M?.graphContainer || {},
|
|
1576
|
+
...U && U !== !0 ? { backgroundColor: U } : {}
|
|
1577
|
+
},
|
|
1578
|
+
id: xe,
|
|
1579
|
+
ref: c,
|
|
1580
|
+
"aria-label": V || `${g ? `The graph shows ${g}. ` : ""}This is a stacked bar chart. ${X ? ` ${X}` : ""}`,
|
|
1581
|
+
children: /* @__PURE__ */ e.jsx(
|
|
1582
|
+
"div",
|
|
1583
|
+
{
|
|
1584
|
+
className: "flex grow",
|
|
1585
|
+
style: { padding: U ? _ || "1rem" : _ || 0 },
|
|
1586
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-4 w-full grow justify-between", children: [
|
|
1587
|
+
g || X || y || x ? /* @__PURE__ */ e.jsx(
|
|
1588
|
+
Je,
|
|
1589
|
+
{
|
|
1590
|
+
styles: {
|
|
1591
|
+
title: M?.title,
|
|
1592
|
+
description: M?.description
|
|
1593
|
+
},
|
|
1594
|
+
classNames: {
|
|
1595
|
+
title: P?.title,
|
|
1596
|
+
description: P?.description
|
|
1597
|
+
},
|
|
1598
|
+
graphTitle: g,
|
|
1599
|
+
graphDescription: X,
|
|
1600
|
+
width: D,
|
|
1601
|
+
graphDownload: y ? c.current : void 0,
|
|
1602
|
+
dataDownload: x ? o.map((r) => r.data).filter((r) => r !== void 0).length > 0 ? o.map((r) => r.data).filter((r) => r !== void 0) : o.filter((r) => r !== void 0) : null
|
|
1603
|
+
}
|
|
1604
|
+
) : null,
|
|
1605
|
+
u.enabled && K.length > 0 && te ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
1606
|
+
/* @__PURE__ */ e.jsx(
|
|
1607
|
+
"button",
|
|
1608
|
+
{
|
|
1609
|
+
type: "button",
|
|
1610
|
+
onClick: () => {
|
|
1611
|
+
Oe(!h);
|
|
1612
|
+
},
|
|
1613
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
1614
|
+
"aria-label": h ? "Click to pause animation" : "Click to play animation",
|
|
1615
|
+
children: h ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
1616
|
+
}
|
|
1617
|
+
),
|
|
1618
|
+
/* @__PURE__ */ e.jsx(
|
|
1619
|
+
He,
|
|
1620
|
+
{
|
|
1621
|
+
min: K[0],
|
|
1622
|
+
max: K[K.length - 1],
|
|
1623
|
+
marks: te,
|
|
1624
|
+
step: null,
|
|
1625
|
+
defaultValue: K[K.length - 1],
|
|
1626
|
+
value: K[we],
|
|
1627
|
+
onChangeComplete: (r) => {
|
|
1628
|
+
ve(K.indexOf(r));
|
|
1629
|
+
},
|
|
1630
|
+
onChange: (r) => {
|
|
1631
|
+
ve(K.indexOf(r));
|
|
1632
|
+
},
|
|
1633
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
1634
|
+
}
|
|
1635
|
+
)
|
|
1636
|
+
] }) : null,
|
|
1637
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1638
|
+
R ? /* @__PURE__ */ e.jsx(
|
|
1639
|
+
Ke,
|
|
1640
|
+
{
|
|
1641
|
+
width: D,
|
|
1642
|
+
colorDomain: he,
|
|
1643
|
+
colors: G,
|
|
1644
|
+
colorLegendTitle: j,
|
|
1645
|
+
setSelectedColor: oe,
|
|
1646
|
+
showNAColor: !1
|
|
1647
|
+
}
|
|
1648
|
+
) : null,
|
|
1649
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full grow leading-0", ref: ye, "aria-label": "Graph area", children: (D || a) && (ie || t) ? /* @__PURE__ */ e.jsx(
|
|
1650
|
+
xt,
|
|
1651
|
+
{
|
|
1652
|
+
data: B !== void 0 ? B === "total" ? Ae(
|
|
1653
|
+
Ve(
|
|
1654
|
+
o,
|
|
1655
|
+
u.dateFormat || "yyyy"
|
|
1656
|
+
).filter(
|
|
1657
|
+
(r) => u.enabled ? r.date === $e(
|
|
1658
|
+
new Date(K[we]),
|
|
1659
|
+
u.dateFormat || "yyyy"
|
|
1660
|
+
) : r
|
|
1661
|
+
).filter(
|
|
1662
|
+
(r) => m ? !r.size.every((O) => O == null) : r
|
|
1663
|
+
),
|
|
1664
|
+
(r) => ke(r.size.filter((O) => !q(O)))
|
|
1665
|
+
).reverse().filter((r, O) => b ? O < b : !0) : Ae(
|
|
1666
|
+
Ve(
|
|
1667
|
+
o,
|
|
1668
|
+
u.dateFormat || "yyyy"
|
|
1669
|
+
).filter(
|
|
1670
|
+
(r) => u.enabled ? r.date === $e(
|
|
1671
|
+
new Date(K[we]),
|
|
1672
|
+
u.dateFormat || "yyyy"
|
|
1673
|
+
) : r
|
|
1674
|
+
).filter(
|
|
1675
|
+
(r) => m ? !r.size.every((O) => O == null) : r
|
|
1676
|
+
),
|
|
1677
|
+
(r) => q(r.size[B]) ? -1 / 0 : r.size[B]
|
|
1678
|
+
).reverse().filter((r, O) => b ? O < b : !0) : Ve(
|
|
1679
|
+
o,
|
|
1680
|
+
u.dateFormat || "yyyy"
|
|
1681
|
+
).filter(
|
|
1682
|
+
(r) => u.enabled ? r.date === $e(
|
|
1683
|
+
new Date(K[we]),
|
|
1684
|
+
u.dateFormat || "yyyy"
|
|
1685
|
+
) : r
|
|
1686
|
+
).filter((r) => m ? !r.size.every((O) => O == null) : r).filter((r, O) => b ? O < b : !0),
|
|
1687
|
+
barColors: G,
|
|
1688
|
+
width: D || a,
|
|
1689
|
+
height: Math.max(
|
|
1690
|
+
N,
|
|
1691
|
+
ie || (ee ? N ? (D || a) * ee > N ? (D || a) * ee : N : (D || a) * ee : t)
|
|
1692
|
+
),
|
|
1693
|
+
barPadding: me,
|
|
1694
|
+
showTicks: ue,
|
|
1695
|
+
leftMargin: ge,
|
|
1696
|
+
rightMargin: Q,
|
|
1697
|
+
topMargin: Z,
|
|
1698
|
+
bottomMargin: C,
|
|
1699
|
+
truncateBy: Y,
|
|
1700
|
+
showLabels: J,
|
|
1701
|
+
tooltip: p,
|
|
1702
|
+
onSeriesMouseOver: F,
|
|
1703
|
+
showValues: re,
|
|
1704
|
+
suffix: ae,
|
|
1705
|
+
prefix: le,
|
|
1706
|
+
refValues: E,
|
|
1707
|
+
maxValue: q(de) ? Math.max(
|
|
1708
|
+
...o.map(
|
|
1709
|
+
(r) => ke(r.size.filter((O) => !q(O))) || 0
|
|
1710
|
+
)
|
|
1711
|
+
) : de,
|
|
1712
|
+
onSeriesMouseClick: z,
|
|
1713
|
+
selectedColor: Ce,
|
|
1714
|
+
rtl: w === "he" || w === "ar",
|
|
1715
|
+
labelOrder: T,
|
|
1716
|
+
maxBarThickness: L,
|
|
1717
|
+
minBarThickness: v,
|
|
1718
|
+
resetSelectionOnDoubleClick: A,
|
|
1719
|
+
detailsOnClick: ce,
|
|
1720
|
+
barAxisTitle: W,
|
|
1721
|
+
noOfTicks: H,
|
|
1722
|
+
valueColor: se,
|
|
1723
|
+
classNames: P,
|
|
1724
|
+
styles: M,
|
|
1725
|
+
animate: k === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : k || { duration: 0, once: !0, amount: 0 },
|
|
1726
|
+
colorDomain: he,
|
|
1727
|
+
precision: f,
|
|
1728
|
+
customLayers: d,
|
|
1729
|
+
naLabel: n
|
|
1730
|
+
}
|
|
1731
|
+
) : null })
|
|
1732
|
+
] }) }),
|
|
1733
|
+
I || ne ? /* @__PURE__ */ e.jsx(
|
|
1734
|
+
Ue,
|
|
1735
|
+
{
|
|
1736
|
+
styles: { footnote: M?.footnote, source: M?.source },
|
|
1737
|
+
classNames: {
|
|
1738
|
+
footnote: P?.footnote,
|
|
1739
|
+
source: P?.source
|
|
1740
|
+
},
|
|
1741
|
+
sources: I,
|
|
1742
|
+
footNote: ne,
|
|
1743
|
+
width: D
|
|
1744
|
+
}
|
|
1745
|
+
) : null
|
|
1746
|
+
] })
|
|
1747
|
+
}
|
|
1748
|
+
)
|
|
1749
|
+
}
|
|
1750
|
+
)
|
|
1751
|
+
}
|
|
1752
|
+
);
|
|
1753
|
+
}
|
|
1754
|
+
function ft(fe) {
|
|
1755
|
+
const {
|
|
1756
|
+
data: o,
|
|
1757
|
+
width: g,
|
|
1758
|
+
height: G,
|
|
1759
|
+
barColor: I,
|
|
1760
|
+
suffix: X,
|
|
1761
|
+
prefix: me,
|
|
1762
|
+
barPadding: ue,
|
|
1763
|
+
showLabels: ge,
|
|
1764
|
+
showValues: Q,
|
|
1765
|
+
showTicks: Y,
|
|
1766
|
+
colorDomain: ie,
|
|
1767
|
+
truncateBy: D,
|
|
1768
|
+
rightMargin: ne,
|
|
1769
|
+
topMargin: he,
|
|
1770
|
+
bottomMargin: j,
|
|
1771
|
+
leftMargin: _,
|
|
1772
|
+
tooltip: U,
|
|
1773
|
+
onSeriesMouseOver: Z,
|
|
1774
|
+
refValues: C,
|
|
1775
|
+
selectedColor: p,
|
|
1776
|
+
maxValue: F,
|
|
1777
|
+
minValue: ae,
|
|
1778
|
+
highlightedDataPoints: le,
|
|
1779
|
+
onSeriesMouseClick: J,
|
|
1780
|
+
labelOrder: ee,
|
|
1781
|
+
maxBarThickness: re,
|
|
1782
|
+
minBarThickness: E,
|
|
1783
|
+
resetSelectionOnDoubleClick: xe,
|
|
1784
|
+
detailsOnClick: de,
|
|
1785
|
+
barAxisTitle: z,
|
|
1786
|
+
valueColor: y,
|
|
1787
|
+
noOfTicks: x,
|
|
1788
|
+
styles: w,
|
|
1789
|
+
classNames: T,
|
|
1790
|
+
dimmedOpacity: N,
|
|
1791
|
+
animate: $,
|
|
1792
|
+
precision: L,
|
|
1793
|
+
customLayers: B,
|
|
1794
|
+
naLabel: b
|
|
1795
|
+
} = fe, v = Me(null), R = Ee(v, {
|
|
1796
|
+
once: $.once,
|
|
1797
|
+
amount: $.amount
|
|
1798
|
+
}), V = {
|
|
1799
|
+
top: he,
|
|
1800
|
+
bottom: j,
|
|
1801
|
+
left: z ? _ + 30 : _,
|
|
1802
|
+
right: ne
|
|
1803
|
+
}, [A, ce] = S(void 0), [W, H] = S(void 0), [se, M] = S(void 0), [P, m] = S(void 0), k = g - V.left - V.right, f = G - V.top - V.bottom, d = Re().domain([ae, F]).range([f, 0]).nice(), u = o.map((t, l) => ({
|
|
1804
|
+
...t,
|
|
1805
|
+
id: ee ? `${t.label}` : `${l}`
|
|
1806
|
+
})), n = ee || u.map((t) => `${t.id}`), a = Ie().domain(n).range([
|
|
1807
|
+
0,
|
|
1808
|
+
E ? Math.max(k, E * n.length) : re ? Math.min(k, re * n.length) : k
|
|
1809
|
+
]).paddingInner(ue), s = d.ticks(x);
|
|
1810
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1811
|
+
/* @__PURE__ */ e.jsx(
|
|
1812
|
+
pe.svg,
|
|
1813
|
+
{
|
|
1814
|
+
ref: v,
|
|
1815
|
+
width: `${g}px`,
|
|
1816
|
+
height: `${G}px`,
|
|
1817
|
+
viewBox: `0 0 ${g} ${G}`,
|
|
1818
|
+
direction: "ltr",
|
|
1819
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${V.left},${V.top})`, children: [
|
|
1820
|
+
/* @__PURE__ */ e.jsx(
|
|
1821
|
+
_e,
|
|
1822
|
+
{
|
|
1823
|
+
y1: d(ae < 0 ? 0 : ae),
|
|
1824
|
+
y2: d(ae < 0 ? 0 : ae),
|
|
1825
|
+
x1: 0 - _,
|
|
1826
|
+
x2: k + V.right,
|
|
1827
|
+
label: De(
|
|
1828
|
+
ae < 0 ? 0 : ae,
|
|
1829
|
+
b,
|
|
1830
|
+
L,
|
|
1831
|
+
me,
|
|
1832
|
+
X
|
|
1833
|
+
),
|
|
1834
|
+
labelPos: {
|
|
1835
|
+
x: 0 - _,
|
|
1836
|
+
dx: 0,
|
|
1837
|
+
dy: F < 0 ? "1em" : -5,
|
|
1838
|
+
y: d(ae < 0 ? 0 : ae)
|
|
1839
|
+
},
|
|
1840
|
+
classNames: {
|
|
1841
|
+
axis: T?.xAxis?.axis,
|
|
1842
|
+
label: T?.yAxis?.labels
|
|
1843
|
+
},
|
|
1844
|
+
styles: { axis: w?.xAxis?.axis, label: w?.yAxis?.labels }
|
|
1845
|
+
}
|
|
1846
|
+
),
|
|
1847
|
+
Y ? /* @__PURE__ */ e.jsx(
|
|
1848
|
+
dt,
|
|
1849
|
+
{
|
|
1850
|
+
values: s.filter((t) => t !== 0),
|
|
1851
|
+
y: s.filter((t) => t !== 0).map((t) => d(t)),
|
|
1852
|
+
x1: 0 - _,
|
|
1853
|
+
x2: k + V.right,
|
|
1854
|
+
styles: {
|
|
1855
|
+
gridLines: w?.yAxis?.gridLines,
|
|
1856
|
+
labels: w?.yAxis?.labels
|
|
1857
|
+
},
|
|
1858
|
+
classNames: {
|
|
1859
|
+
gridLines: T?.yAxis?.gridLines,
|
|
1860
|
+
labels: T?.yAxis?.labels
|
|
1861
|
+
},
|
|
1862
|
+
suffix: X,
|
|
1863
|
+
prefix: me,
|
|
1864
|
+
labelType: "secondary",
|
|
1865
|
+
showGridLines: !0,
|
|
1866
|
+
labelPos: "vertical",
|
|
1867
|
+
precision: L
|
|
1868
|
+
}
|
|
1869
|
+
) : null,
|
|
1870
|
+
/* @__PURE__ */ e.jsx(
|
|
1871
|
+
Ye,
|
|
1872
|
+
{
|
|
1873
|
+
x: 0 - _ - 15,
|
|
1874
|
+
y: f / 2,
|
|
1875
|
+
style: w?.yAxis?.title,
|
|
1876
|
+
className: T?.yAxis?.title,
|
|
1877
|
+
text: z,
|
|
1878
|
+
rotate90: !0
|
|
1879
|
+
}
|
|
1880
|
+
),
|
|
1881
|
+
B.filter((t) => t.position === "before").map((t) => t.layer),
|
|
1882
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
1883
|
+
u.map(
|
|
1884
|
+
(t, l) => q(a(t.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
1885
|
+
pe.g,
|
|
1886
|
+
{
|
|
1887
|
+
className: "undp-viz-g-with-hover",
|
|
1888
|
+
initial: "initial",
|
|
1889
|
+
animate: R ? "whileInView" : "initial",
|
|
1890
|
+
variants: {
|
|
1891
|
+
initial: {
|
|
1892
|
+
opacity: p ? t.color && I[ie.indexOf(t.color)] === p ? 1 : N : le.length !== 0 ? le.indexOf(t.label) !== -1 ? 0.85 : N : 0.85
|
|
1893
|
+
},
|
|
1894
|
+
whileInView: {
|
|
1895
|
+
opacity: p ? t.color && I[ie.indexOf(t.color)] === p ? 1 : N : le.length !== 0 ? le.indexOf(t.label) !== -1 ? 0.85 : N : 0.85,
|
|
1896
|
+
transition: { duration: $.duration }
|
|
1897
|
+
}
|
|
1898
|
+
},
|
|
1899
|
+
exit: { opacity: 0, transition: { duration: $.duration } },
|
|
1900
|
+
onMouseEnter: (h) => {
|
|
1901
|
+
ce(t), m(h.clientY), M(h.clientX), Z?.(t);
|
|
1902
|
+
},
|
|
1903
|
+
onClick: () => {
|
|
1904
|
+
(J || de) && (Pe(W, t) && xe ? (H(void 0), J?.(void 0)) : (H(t), J?.(t)));
|
|
1905
|
+
},
|
|
1906
|
+
onMouseMove: (h) => {
|
|
1907
|
+
ce(t), m(h.clientY), M(h.clientX);
|
|
1908
|
+
},
|
|
1909
|
+
onMouseLeave: () => {
|
|
1910
|
+
ce(void 0), M(void 0), m(void 0), Z?.(void 0);
|
|
1911
|
+
},
|
|
1912
|
+
children: [
|
|
1913
|
+
t.size ? /* @__PURE__ */ e.jsx(
|
|
1914
|
+
pe.rect,
|
|
1915
|
+
{
|
|
1916
|
+
width: a.bandwidth(),
|
|
1917
|
+
initial: "initial",
|
|
1918
|
+
animate: R ? "whileInView" : "initial",
|
|
1919
|
+
variants: {
|
|
1920
|
+
initial: {
|
|
1921
|
+
height: 0,
|
|
1922
|
+
x: a(`${t.id}`),
|
|
1923
|
+
y: d(0),
|
|
1924
|
+
fill: o.filter((h) => h.color).length === 0 ? I[0] : t.color ? I[ie.indexOf(t.color)] : je.gray
|
|
1925
|
+
},
|
|
1926
|
+
whileInView: {
|
|
1927
|
+
height: t.size ? Math.abs(d(t.size) - d(0)) : 0,
|
|
1928
|
+
y: t.size && t.size > 0 ? d(t.size) : d(0),
|
|
1929
|
+
x: a(`${t.id}`),
|
|
1930
|
+
fill: o.filter((h) => h.color).length === 0 ? I[0] : t.color ? I[ie.indexOf(t.color)] : je.gray,
|
|
1931
|
+
transition: { duration: $.duration }
|
|
1932
|
+
}
|
|
1933
|
+
},
|
|
1934
|
+
exit: {
|
|
1935
|
+
height: 0,
|
|
1936
|
+
y: d(0),
|
|
1937
|
+
transition: { duration: $.duration }
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
) : null,
|
|
1941
|
+
ge ? /* @__PURE__ */ e.jsx(
|
|
1942
|
+
ct,
|
|
1943
|
+
{
|
|
1944
|
+
value: `${t.label}`.length < D ? `${t.label}` : `${`${t.label}`.substring(0, D)}...`,
|
|
1945
|
+
y: (t.size || 0) < 0 ? 0 : d(0) + 5,
|
|
1946
|
+
x: a(`${t.id}`),
|
|
1947
|
+
width: a.bandwidth(),
|
|
1948
|
+
height: (t.size || 0) < 0 ? d(0) - 5 : V.bottom,
|
|
1949
|
+
style: w?.xAxis?.labels,
|
|
1950
|
+
className: T?.xAxis?.labels,
|
|
1951
|
+
alignment: (t.size || 0) < 0 ? "bottom" : "top",
|
|
1952
|
+
animate: $,
|
|
1953
|
+
isInView: R
|
|
1954
|
+
}
|
|
1955
|
+
) : null,
|
|
1956
|
+
Q ? /* @__PURE__ */ e.jsx(
|
|
1957
|
+
pe.text,
|
|
1958
|
+
{
|
|
1959
|
+
style: {
|
|
1960
|
+
textAnchor: "middle",
|
|
1961
|
+
...w?.graphObjectValues || {}
|
|
1962
|
+
},
|
|
1963
|
+
className: Ne(
|
|
1964
|
+
"graph-value text-sm",
|
|
1965
|
+
!y && I.length > 1 ? " fill-primary-gray-600 dark:fill-primary-gray-300" : "",
|
|
1966
|
+
T?.graphObjectValues
|
|
1967
|
+
),
|
|
1968
|
+
dy: t.size ? t.size >= 0 ? "-5px" : "1em" : "-5px",
|
|
1969
|
+
variants: {
|
|
1970
|
+
initial: {
|
|
1971
|
+
x: a(`${t.id}`) + a.bandwidth() / 2,
|
|
1972
|
+
y: d(0),
|
|
1973
|
+
opacity: 0,
|
|
1974
|
+
fill: y || (o.filter((h) => h.color).length === 0 ? I[0] : t.color ? I[ie.indexOf(t.color)] : je.gray)
|
|
1975
|
+
},
|
|
1976
|
+
whileInView: {
|
|
1977
|
+
x: a(`${t.id}`) + a.bandwidth() / 2,
|
|
1978
|
+
y: d(t.size || 0),
|
|
1979
|
+
fill: y || (o.filter((h) => h.color).length === 0 ? I[0] : t.color ? I[ie.indexOf(t.color)] : je.gray),
|
|
1980
|
+
opacity: 1,
|
|
1981
|
+
transition: { duration: $.duration }
|
|
1982
|
+
}
|
|
1983
|
+
},
|
|
1984
|
+
initial: "initial",
|
|
1985
|
+
animate: R ? "whileInView" : "initial",
|
|
1986
|
+
exit: {
|
|
1987
|
+
opacity: 0,
|
|
1988
|
+
transition: { duration: $.duration }
|
|
1989
|
+
},
|
|
1990
|
+
children: De(t.size, b, L, me, X)
|
|
1991
|
+
}
|
|
1992
|
+
) : null
|
|
1993
|
+
]
|
|
1994
|
+
},
|
|
1995
|
+
t.label
|
|
1996
|
+
)
|
|
1997
|
+
),
|
|
1998
|
+
C ? /* @__PURE__ */ e.jsx(e.Fragment, { children: C.map((t, l) => /* @__PURE__ */ e.jsx(
|
|
1999
|
+
nt,
|
|
2000
|
+
{
|
|
2001
|
+
text: t.text,
|
|
2002
|
+
color: t.color,
|
|
2003
|
+
y: d(t.value),
|
|
2004
|
+
x1: 0 - _,
|
|
2005
|
+
x2: k + V.right,
|
|
2006
|
+
classNames: t.classNames,
|
|
2007
|
+
styles: t.styles,
|
|
2008
|
+
animate: $,
|
|
2009
|
+
isInView: R
|
|
2010
|
+
},
|
|
2011
|
+
l
|
|
2012
|
+
)) }) : null
|
|
2013
|
+
] }),
|
|
2014
|
+
B.filter((t) => t.position === "after").map((t) => t.layer)
|
|
2015
|
+
] })
|
|
2016
|
+
}
|
|
2017
|
+
),
|
|
2018
|
+
A && U && se && P ? /* @__PURE__ */ e.jsx(
|
|
2019
|
+
Ge,
|
|
2020
|
+
{
|
|
2021
|
+
data: A,
|
|
2022
|
+
body: U,
|
|
2023
|
+
xPos: se,
|
|
2024
|
+
yPos: P,
|
|
2025
|
+
backgroundStyle: w?.tooltip,
|
|
2026
|
+
className: T?.tooltip
|
|
2027
|
+
}
|
|
2028
|
+
) : null,
|
|
2029
|
+
de && W !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
2030
|
+
We,
|
|
2031
|
+
{
|
|
2032
|
+
open: W !== void 0,
|
|
2033
|
+
onClose: () => {
|
|
2034
|
+
H(void 0);
|
|
2035
|
+
},
|
|
2036
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2037
|
+
"div",
|
|
2038
|
+
{
|
|
2039
|
+
className: "graph-modal-content m-0",
|
|
2040
|
+
dangerouslySetInnerHTML: typeof de == "string" ? { __html: Xe(de, W) } : void 0,
|
|
2041
|
+
children: typeof de == "function" ? de(W) : null
|
|
2042
|
+
}
|
|
2043
|
+
)
|
|
2044
|
+
}
|
|
2045
|
+
) : null
|
|
2046
|
+
] });
|
|
2047
|
+
}
|
|
2048
|
+
function yt(fe) {
|
|
2049
|
+
const {
|
|
2050
|
+
data: o,
|
|
2051
|
+
graphTitle: g,
|
|
2052
|
+
colors: G,
|
|
2053
|
+
barPadding: I = 0.25,
|
|
2054
|
+
showTicks: X = !0,
|
|
2055
|
+
leftMargin: me = 20,
|
|
2056
|
+
rightMargin: ue = 20,
|
|
2057
|
+
topMargin: ge = 20,
|
|
2058
|
+
bottomMargin: Q = 25,
|
|
2059
|
+
truncateBy: Y = 999,
|
|
2060
|
+
showLabels: ie = !0,
|
|
2061
|
+
showValues: D = !0,
|
|
2062
|
+
backgroundColor: ne = !1,
|
|
2063
|
+
suffix: he = "",
|
|
2064
|
+
prefix: j = "",
|
|
2065
|
+
sources: _,
|
|
2066
|
+
graphDescription: U,
|
|
2067
|
+
height: Z,
|
|
2068
|
+
width: C,
|
|
2069
|
+
footNote: p,
|
|
2070
|
+
colorDomain: F,
|
|
2071
|
+
colorLegendTitle: ae,
|
|
2072
|
+
padding: le,
|
|
2073
|
+
relativeHeight: J,
|
|
2074
|
+
tooltip: ee,
|
|
2075
|
+
onSeriesMouseOver: re,
|
|
2076
|
+
refValues: E,
|
|
2077
|
+
showColorScale: xe = !0,
|
|
2078
|
+
graphID: de,
|
|
2079
|
+
maxValue: z,
|
|
2080
|
+
minValue: y,
|
|
2081
|
+
highlightedDataPoints: x = [],
|
|
2082
|
+
onSeriesMouseClick: w,
|
|
2083
|
+
graphDownload: T = !1,
|
|
2084
|
+
dataDownload: N = !1,
|
|
2085
|
+
language: $ = "en",
|
|
2086
|
+
theme: L = "light",
|
|
2087
|
+
sortData: B,
|
|
2088
|
+
labelOrder: b,
|
|
2089
|
+
showNAColor: v = !0,
|
|
2090
|
+
minHeight: R = 0,
|
|
2091
|
+
maxBarThickness: V,
|
|
2092
|
+
maxNumberOfBars: A,
|
|
2093
|
+
minBarThickness: ce,
|
|
2094
|
+
ariaLabel: W,
|
|
2095
|
+
resetSelectionOnDoubleClick: H = !0,
|
|
2096
|
+
detailsOnClick: se,
|
|
2097
|
+
barAxisTitle: M,
|
|
2098
|
+
noOfTicks: P = 5,
|
|
2099
|
+
valueColor: m,
|
|
2100
|
+
styles: k,
|
|
2101
|
+
classNames: f,
|
|
2102
|
+
filterNA: d = !0,
|
|
2103
|
+
animate: u = !1,
|
|
2104
|
+
dimmedOpacity: n = 0.3,
|
|
2105
|
+
precision: a = 2,
|
|
2106
|
+
customLayers: s = [],
|
|
2107
|
+
timeline: t = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
2108
|
+
naLabel: l = "NA"
|
|
2109
|
+
} = fe, [h, Oe] = S(0), [K, we] = S(0), [ve, Ce] = S(t.autoplay), oe = Be(
|
|
2110
|
+
Te(
|
|
2111
|
+
o.filter((i) => i.date !== void 0 && i.date !== null),
|
|
2112
|
+
(i) => i.date
|
|
2113
|
+
).map((i) => Se(`${i.date}`, t.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
2114
|
+
(i, be) => tt(i, be)
|
|
2115
|
+
), [ye, c] = S(t.autoplay ? 0 : oe.length - 1), [te, r] = S(void 0), O = Me(null), it = Me(null);
|
|
2116
|
+
ze(() => {
|
|
2117
|
+
const i = new ResizeObserver((be) => {
|
|
2118
|
+
Oe(C || be[0].target.clientWidth || 620), we(Z || be[0].target.clientHeight || 480);
|
|
2119
|
+
});
|
|
2120
|
+
return O.current && (we(O.current.clientHeight || 480), Oe(O.current.clientWidth || 620), C || i.observe(O.current)), () => i.disconnect();
|
|
2121
|
+
}, [C, Z]), ze(() => {
|
|
2122
|
+
const i = setInterval(
|
|
2123
|
+
() => {
|
|
2124
|
+
c((be) => be < oe.length - 1 ? be + 1 : 0);
|
|
2125
|
+
},
|
|
2126
|
+
(t.speed || 2) * 1e3
|
|
2127
|
+
);
|
|
2128
|
+
return ve || clearInterval(i), () => clearInterval(i);
|
|
2129
|
+
}, [oe, ve, t.speed]);
|
|
2130
|
+
const at = Fe(
|
|
2131
|
+
oe,
|
|
2132
|
+
ye,
|
|
2133
|
+
t.showOnlyActiveDate,
|
|
2134
|
+
t.dateFormat || "yyyy"
|
|
2135
|
+
);
|
|
2136
|
+
return /* @__PURE__ */ e.jsx(
|
|
2137
|
+
"div",
|
|
2138
|
+
{
|
|
2139
|
+
className: `${L || "light"} flex ${C ? "w-fit grow-0" : "w-full grow"}`,
|
|
2140
|
+
dir: $ === "he" || $ === "ar" ? "rtl" : void 0,
|
|
2141
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2142
|
+
"div",
|
|
2143
|
+
{
|
|
2144
|
+
className: Ne(
|
|
2145
|
+
`${ne ? ne === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${$ || "en"}`,
|
|
2146
|
+
f?.graphContainer
|
|
2147
|
+
),
|
|
2148
|
+
style: {
|
|
2149
|
+
...k?.graphContainer || {},
|
|
2150
|
+
...ne && ne !== !0 ? { backgroundColor: ne } : {}
|
|
2151
|
+
},
|
|
2152
|
+
id: de,
|
|
2153
|
+
ref: it,
|
|
2154
|
+
"aria-label": W || `${g ? `The graph shows ${g}. ` : ""}This is a grouped bar chart. ${U ? ` ${U}` : ""}`,
|
|
2155
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2156
|
+
"div",
|
|
2157
|
+
{
|
|
2158
|
+
className: "flex grow",
|
|
2159
|
+
style: { padding: ne ? le || "1rem" : le || 0 },
|
|
2160
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
2161
|
+
g || U || T || N ? /* @__PURE__ */ e.jsx(
|
|
2162
|
+
Je,
|
|
2163
|
+
{
|
|
2164
|
+
styles: {
|
|
2165
|
+
title: k?.title,
|
|
2166
|
+
description: k?.description
|
|
2167
|
+
},
|
|
2168
|
+
classNames: {
|
|
2169
|
+
title: f?.title,
|
|
2170
|
+
description: f?.description
|
|
2171
|
+
},
|
|
2172
|
+
graphTitle: g,
|
|
2173
|
+
graphDescription: U,
|
|
2174
|
+
width: C,
|
|
2175
|
+
graphDownload: T ? it.current : void 0,
|
|
2176
|
+
dataDownload: N ? o.map((i) => i.data).filter((i) => i !== void 0).length > 0 ? o.map((i) => i.data).filter((i) => i !== void 0) : o.filter((i) => i !== void 0) : null
|
|
2177
|
+
}
|
|
2178
|
+
) : null,
|
|
2179
|
+
t.enabled && oe.length > 0 && at ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
2180
|
+
/* @__PURE__ */ e.jsx(
|
|
2181
|
+
"button",
|
|
2182
|
+
{
|
|
2183
|
+
type: "button",
|
|
2184
|
+
onClick: () => {
|
|
2185
|
+
Ce(!ve);
|
|
2186
|
+
},
|
|
2187
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
2188
|
+
"aria-label": ve ? "Click to pause animation" : "Click to play animation",
|
|
2189
|
+
children: ve ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
2190
|
+
}
|
|
2191
|
+
),
|
|
2192
|
+
/* @__PURE__ */ e.jsx(
|
|
2193
|
+
He,
|
|
2194
|
+
{
|
|
2195
|
+
min: oe[0],
|
|
2196
|
+
max: oe[oe.length - 1],
|
|
2197
|
+
marks: at,
|
|
2198
|
+
step: null,
|
|
2199
|
+
defaultValue: oe[oe.length - 1],
|
|
2200
|
+
value: oe[ye],
|
|
2201
|
+
onChangeComplete: (i) => {
|
|
2202
|
+
c(oe.indexOf(i));
|
|
2203
|
+
},
|
|
2204
|
+
onChange: (i) => {
|
|
2205
|
+
c(oe.indexOf(i));
|
|
2206
|
+
},
|
|
2207
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
2208
|
+
}
|
|
2209
|
+
)
|
|
2210
|
+
] }) : null,
|
|
2211
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2212
|
+
xe && o.filter((i) => i.color).length !== 0 ? /* @__PURE__ */ e.jsx(
|
|
2213
|
+
Ke,
|
|
2214
|
+
{
|
|
2215
|
+
width: C,
|
|
2216
|
+
colorLegendTitle: ae,
|
|
2217
|
+
colors: G || je[L].categoricalColors.colors,
|
|
2218
|
+
colorDomain: F || Te(
|
|
2219
|
+
o.filter((i) => i.color),
|
|
2220
|
+
"color"
|
|
2221
|
+
).map((i) => i.color),
|
|
2222
|
+
setSelectedColor: r,
|
|
2223
|
+
showNAColor: v
|
|
2224
|
+
}
|
|
2225
|
+
) : null,
|
|
2226
|
+
/* @__PURE__ */ e.jsx(
|
|
2227
|
+
"div",
|
|
2228
|
+
{
|
|
2229
|
+
className: "flex grow flex-col justify-center w-full leading-0",
|
|
2230
|
+
ref: O,
|
|
2231
|
+
"aria-label": "Graph area",
|
|
2232
|
+
children: (C || h) && (Z || K) ? /* @__PURE__ */ e.jsx(
|
|
2233
|
+
ft,
|
|
2234
|
+
{
|
|
2235
|
+
data: B === "asc" ? Ae(
|
|
2236
|
+
Le(o, t.dateFormat || "yyyy").filter(
|
|
2237
|
+
(i) => t.enabled ? i.date === $e(
|
|
2238
|
+
new Date(oe[ye]),
|
|
2239
|
+
t.dateFormat || "yyyy"
|
|
2240
|
+
) : i
|
|
2241
|
+
).filter((i) => d ? !q(i.size) : i),
|
|
2242
|
+
(i) => i.size
|
|
2243
|
+
).filter((i, be) => A ? be < A : !0) : B === "desc" ? Ae(
|
|
2244
|
+
Le(o, t.dateFormat || "yyyy").filter(
|
|
2245
|
+
(i) => t.enabled ? i.date === $e(
|
|
2246
|
+
new Date(oe[ye]),
|
|
2247
|
+
t.dateFormat || "yyyy"
|
|
2248
|
+
) : i
|
|
2249
|
+
).filter((i) => d ? !q(i.size) : i),
|
|
2250
|
+
(i) => i.size
|
|
2251
|
+
).reverse().filter((i, be) => A ? be < A : !0) : Le(o, t.dateFormat || "yyyy").filter(
|
|
2252
|
+
(i) => t.enabled ? i.date === $e(
|
|
2253
|
+
new Date(oe[ye]),
|
|
2254
|
+
t.dateFormat || "yyyy"
|
|
2255
|
+
) : i
|
|
2256
|
+
).filter((i) => d ? !q(i.size) : i).filter((i, be) => A ? be < A : !0),
|
|
2257
|
+
barColor: o.filter((i) => i.color).length === 0 ? G ? [G] : [je.primaryColors["blue-600"]] : G || je[L].categoricalColors.colors,
|
|
2258
|
+
colorDomain: o.filter((i) => i.color).length === 0 ? [] : F || Te(
|
|
2259
|
+
o.filter((i) => i.color),
|
|
2260
|
+
"color"
|
|
2261
|
+
).map((i) => i.color),
|
|
2262
|
+
width: C || h,
|
|
2263
|
+
refValues: E,
|
|
2264
|
+
height: Math.max(
|
|
2265
|
+
R,
|
|
2266
|
+
Z || (J ? R ? (C || h) * J > R ? (C || h) * J : R : (C || h) * J : K)
|
|
2267
|
+
),
|
|
2268
|
+
suffix: he,
|
|
2269
|
+
prefix: j,
|
|
2270
|
+
barPadding: I,
|
|
2271
|
+
showLabels: ie,
|
|
2272
|
+
showValues: D,
|
|
2273
|
+
showTicks: X,
|
|
2274
|
+
truncateBy: Y,
|
|
2275
|
+
leftMargin: me,
|
|
2276
|
+
rightMargin: ue,
|
|
2277
|
+
selectedColor: te,
|
|
2278
|
+
topMargin: ge,
|
|
2279
|
+
bottomMargin: Q,
|
|
2280
|
+
tooltip: ee,
|
|
2281
|
+
onSeriesMouseOver: re,
|
|
2282
|
+
maxValue: q(z) ? Math.max(
|
|
2283
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
2284
|
+
) < 0 ? 0 : Math.max(
|
|
2285
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
2286
|
+
) : z,
|
|
2287
|
+
minValue: q(y) ? Math.min(
|
|
2288
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
2289
|
+
) >= 0 ? 0 : Math.min(
|
|
2290
|
+
...o.filter((i) => !q(i.size)).map((i) => i.size)
|
|
2291
|
+
) : y,
|
|
2292
|
+
highlightedDataPoints: x,
|
|
2293
|
+
onSeriesMouseClick: w,
|
|
2294
|
+
labelOrder: b,
|
|
2295
|
+
maxBarThickness: V,
|
|
2296
|
+
minBarThickness: ce,
|
|
2297
|
+
resetSelectionOnDoubleClick: H,
|
|
2298
|
+
detailsOnClick: se,
|
|
2299
|
+
barAxisTitle: M,
|
|
2300
|
+
noOfTicks: P,
|
|
2301
|
+
valueColor: m,
|
|
2302
|
+
styles: k,
|
|
2303
|
+
classNames: f,
|
|
2304
|
+
animate: u === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : u || { duration: 0, once: !0, amount: 0 },
|
|
2305
|
+
dimmedOpacity: n,
|
|
2306
|
+
precision: a,
|
|
2307
|
+
customLayers: s,
|
|
2308
|
+
naLabel: l
|
|
2309
|
+
}
|
|
2310
|
+
) : null
|
|
2311
|
+
}
|
|
2312
|
+
)
|
|
2313
|
+
] }) }),
|
|
2314
|
+
_ || p ? /* @__PURE__ */ e.jsx(
|
|
2315
|
+
Ue,
|
|
2316
|
+
{
|
|
2317
|
+
styles: { footnote: k?.footnote, source: k?.source },
|
|
2318
|
+
classNames: {
|
|
2319
|
+
footnote: f?.footnote,
|
|
2320
|
+
source: f?.source
|
|
2321
|
+
},
|
|
2322
|
+
sources: _,
|
|
2323
|
+
footNote: p,
|
|
2324
|
+
width: C
|
|
2325
|
+
}
|
|
2326
|
+
) : null
|
|
2327
|
+
] })
|
|
2328
|
+
}
|
|
2329
|
+
)
|
|
2330
|
+
}
|
|
2331
|
+
)
|
|
2332
|
+
}
|
|
2333
|
+
);
|
|
2334
|
+
}
|
|
2335
|
+
function bt(fe) {
|
|
2336
|
+
const {
|
|
2337
|
+
data: o,
|
|
2338
|
+
width: g,
|
|
2339
|
+
height: G,
|
|
2340
|
+
barColors: I,
|
|
2341
|
+
suffix: X,
|
|
2342
|
+
prefix: me,
|
|
2343
|
+
barPadding: ue,
|
|
2344
|
+
showLabels: ge,
|
|
2345
|
+
showValues: Q,
|
|
2346
|
+
showTicks: Y,
|
|
2347
|
+
truncateBy: ie,
|
|
2348
|
+
leftMargin: D,
|
|
2349
|
+
rightMargin: ne,
|
|
2350
|
+
topMargin: he,
|
|
2351
|
+
bottomMargin: j,
|
|
2352
|
+
tooltip: _,
|
|
2353
|
+
onSeriesMouseOver: U,
|
|
2354
|
+
refValues: Z,
|
|
2355
|
+
maxValue: C,
|
|
2356
|
+
minValue: p,
|
|
2357
|
+
onSeriesMouseClick: F,
|
|
2358
|
+
selectedColor: ae,
|
|
2359
|
+
labelOrder: le,
|
|
2360
|
+
maxBarThickness: J,
|
|
2361
|
+
resetSelectionOnDoubleClick: ee,
|
|
2362
|
+
detailsOnClick: re,
|
|
2363
|
+
barAxisTitle: E,
|
|
2364
|
+
valueColor: xe,
|
|
2365
|
+
noOfTicks: de,
|
|
2366
|
+
styles: z,
|
|
2367
|
+
classNames: y,
|
|
2368
|
+
animate: x,
|
|
2369
|
+
colorDomain: w,
|
|
2370
|
+
precision: T,
|
|
2371
|
+
customLayers: N,
|
|
2372
|
+
naLabel: $
|
|
2373
|
+
} = fe, L = Me(null), B = Ee(L, {
|
|
2374
|
+
once: x.once,
|
|
2375
|
+
amount: x.amount
|
|
2376
|
+
}), b = {
|
|
2377
|
+
top: he,
|
|
2378
|
+
bottom: j,
|
|
2379
|
+
left: E ? D + 30 : D,
|
|
2380
|
+
right: ne
|
|
2381
|
+
}, [v, R] = S(void 0), [V, A] = S(void 0), [ce, W] = S(void 0), [H, se] = S(void 0), M = g - b.left - b.right, P = G - b.top - b.bottom, m = Re().domain([p, C]).range([P, 0]).nice(), k = o.map((a, s) => ({
|
|
2382
|
+
...a,
|
|
2383
|
+
id: le ? `${a.label}` : `${s}`
|
|
2384
|
+
})), f = le || k.map((a) => `${a.id}`), d = Ie().domain(f).range([
|
|
2385
|
+
0,
|
|
2386
|
+
J ? Math.min(M, J * f.length) : M
|
|
2387
|
+
]).paddingInner(ue), u = Ie().domain(o[0].size.map((a, s) => `${s}`)).range([0, d.bandwidth()]).paddingInner(0.1), n = m.ticks(de);
|
|
2388
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2389
|
+
/* @__PURE__ */ e.jsx(
|
|
2390
|
+
pe.svg,
|
|
2391
|
+
{
|
|
2392
|
+
width: `${g}px`,
|
|
2393
|
+
height: `${G}px`,
|
|
2394
|
+
viewBox: `0 0 ${g} ${G}`,
|
|
2395
|
+
direction: "ltr",
|
|
2396
|
+
ref: L,
|
|
2397
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${b.left},${b.top})`, children: [
|
|
2398
|
+
/* @__PURE__ */ e.jsx(
|
|
2399
|
+
_e,
|
|
2400
|
+
{
|
|
2401
|
+
y1: m(p < 0 ? 0 : p),
|
|
2402
|
+
y2: m(p < 0 ? 0 : p),
|
|
2403
|
+
x1: 0 - D,
|
|
2404
|
+
x2: M + b.right,
|
|
2405
|
+
label: De(
|
|
2406
|
+
p < 0 ? 0 : p,
|
|
2407
|
+
$,
|
|
2408
|
+
T,
|
|
2409
|
+
me,
|
|
2410
|
+
X
|
|
2411
|
+
),
|
|
2412
|
+
labelPos: {
|
|
2413
|
+
x: 0 - D,
|
|
2414
|
+
dx: 0,
|
|
2415
|
+
dy: C < 0 ? "1em" : -5,
|
|
2416
|
+
y: m(p < 0 ? 0 : p)
|
|
2417
|
+
},
|
|
2418
|
+
classNames: {
|
|
2419
|
+
axis: y?.xAxis?.axis,
|
|
2420
|
+
label: y?.yAxis?.labels
|
|
2421
|
+
},
|
|
2422
|
+
styles: { axis: z?.xAxis?.axis, label: z?.yAxis?.labels }
|
|
2423
|
+
}
|
|
2424
|
+
),
|
|
2425
|
+
Y ? /* @__PURE__ */ e.jsx(
|
|
2426
|
+
dt,
|
|
2427
|
+
{
|
|
2428
|
+
values: n.filter((a) => a !== 0),
|
|
2429
|
+
y: n.filter((a) => a !== 0).map((a) => m(a)),
|
|
2430
|
+
x1: 0 - D,
|
|
2431
|
+
x2: M + b.right,
|
|
2432
|
+
styles: {
|
|
2433
|
+
gridLines: z?.yAxis?.gridLines,
|
|
2434
|
+
labels: z?.yAxis?.labels
|
|
2435
|
+
},
|
|
2436
|
+
classNames: {
|
|
2437
|
+
gridLines: y?.yAxis?.gridLines,
|
|
2438
|
+
labels: y?.yAxis?.labels
|
|
2439
|
+
},
|
|
2440
|
+
suffix: X,
|
|
2441
|
+
prefix: me,
|
|
2442
|
+
labelType: "secondary",
|
|
2443
|
+
showGridLines: !0,
|
|
2444
|
+
labelPos: "vertical",
|
|
2445
|
+
precision: T
|
|
2446
|
+
}
|
|
2447
|
+
) : null,
|
|
2448
|
+
/* @__PURE__ */ e.jsx(
|
|
2449
|
+
Ye,
|
|
2450
|
+
{
|
|
2451
|
+
x: 0 - D - 15,
|
|
2452
|
+
y: P / 2,
|
|
2453
|
+
style: z?.yAxis?.title,
|
|
2454
|
+
className: y?.yAxis?.title,
|
|
2455
|
+
text: E,
|
|
2456
|
+
rotate90: !0
|
|
2457
|
+
}
|
|
2458
|
+
),
|
|
2459
|
+
N.filter((a) => a.position === "before").map((a) => a.layer),
|
|
2460
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
2461
|
+
k.map(
|
|
2462
|
+
(a) => q(d(a.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
2463
|
+
pe.g,
|
|
2464
|
+
{
|
|
2465
|
+
variants: {
|
|
2466
|
+
initial: {
|
|
2467
|
+
x: d(`${a.id}`),
|
|
2468
|
+
y: 0
|
|
2469
|
+
},
|
|
2470
|
+
whileInView: {
|
|
2471
|
+
x: d(`${a.id}`),
|
|
2472
|
+
y: 0,
|
|
2473
|
+
transition: { duration: x.duration }
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2476
|
+
initial: "initial",
|
|
2477
|
+
animate: B ? "whileInView" : "initial",
|
|
2478
|
+
exit: { opacity: 0, transition: { duration: x.duration } },
|
|
2479
|
+
children: [
|
|
2480
|
+
a.size.map((s, t) => /* @__PURE__ */ e.jsxs(
|
|
2481
|
+
pe.g,
|
|
2482
|
+
{
|
|
2483
|
+
className: "undp-viz-g-with-hover",
|
|
2484
|
+
opacity: ae ? I[t] === ae ? 1 : 0.3 : 0.85,
|
|
2485
|
+
onMouseEnter: (l) => {
|
|
2486
|
+
R({ ...a, sizeIndex: t }), se(l.clientY), W(l.clientX), U?.({ ...a, sizeIndex: t });
|
|
2487
|
+
},
|
|
2488
|
+
onMouseMove: (l) => {
|
|
2489
|
+
R({ ...a, sizeIndex: t }), se(l.clientY), W(l.clientX);
|
|
2490
|
+
},
|
|
2491
|
+
onMouseLeave: () => {
|
|
2492
|
+
R(void 0), W(void 0), se(void 0), U?.(void 0);
|
|
2493
|
+
},
|
|
2494
|
+
onClick: () => {
|
|
2495
|
+
(F || re) && (Pe(V, { ...a, sizeIndex: t }) && ee ? (A(void 0), F?.(void 0)) : (A({ ...a, sizeIndex: t }), F && F({ ...a, sizeIndex: t })));
|
|
2496
|
+
},
|
|
2497
|
+
children: [
|
|
2498
|
+
/* @__PURE__ */ e.jsx(
|
|
2499
|
+
pe.rect,
|
|
2500
|
+
{
|
|
2501
|
+
x: u(`${t}`),
|
|
2502
|
+
width: u.bandwidth(),
|
|
2503
|
+
variants: {
|
|
2504
|
+
initial: {
|
|
2505
|
+
height: 0,
|
|
2506
|
+
y: m(0),
|
|
2507
|
+
fill: I[t]
|
|
2508
|
+
},
|
|
2509
|
+
whileInView: {
|
|
2510
|
+
height: q(s) ? 0 : Math.abs(m(s) - m(0)),
|
|
2511
|
+
y: q(s) ? m(0) : s > 0 ? m(s) : m(0),
|
|
2512
|
+
fill: I[t],
|
|
2513
|
+
transition: { duration: x.duration }
|
|
2514
|
+
}
|
|
2515
|
+
},
|
|
2516
|
+
exit: {
|
|
2517
|
+
height: 0,
|
|
2518
|
+
y: m(0),
|
|
2519
|
+
transition: { duration: x.duration }
|
|
2520
|
+
},
|
|
2521
|
+
initial: "initial",
|
|
2522
|
+
animate: B ? "whileInView" : "initial"
|
|
2523
|
+
}
|
|
2524
|
+
),
|
|
2525
|
+
Q ? /* @__PURE__ */ e.jsx(
|
|
2526
|
+
pe.text,
|
|
2527
|
+
{
|
|
2528
|
+
x: u(`${t}`) + u.bandwidth() / 2,
|
|
2529
|
+
style: {
|
|
2530
|
+
fill: xe || I[t],
|
|
2531
|
+
textAnchor: "middle",
|
|
2532
|
+
...z?.graphObjectValues || {}
|
|
2533
|
+
},
|
|
2534
|
+
className: Ne("graph-value text-sm", y?.graphObjectValues),
|
|
2535
|
+
dy: s ? s >= 0 ? "-5px" : "1em" : "-5px",
|
|
2536
|
+
variants: {
|
|
2537
|
+
initial: { y: m(0), opacity: 0 },
|
|
2538
|
+
whileInView: {
|
|
2539
|
+
y: m(s || 0),
|
|
2540
|
+
opacity: 1,
|
|
2541
|
+
transition: { duration: x.duration }
|
|
2542
|
+
}
|
|
2543
|
+
},
|
|
2544
|
+
initial: "initial",
|
|
2545
|
+
animate: B ? "whileInView" : "initial",
|
|
2546
|
+
exit: {
|
|
2547
|
+
opacity: 0,
|
|
2548
|
+
transition: { duration: x.duration }
|
|
2549
|
+
},
|
|
2550
|
+
children: De(s, $, T, me, X)
|
|
2551
|
+
}
|
|
2552
|
+
) : null
|
|
2553
|
+
]
|
|
2554
|
+
},
|
|
2555
|
+
`${a.label}-${w[t] || t}`
|
|
2556
|
+
)),
|
|
2557
|
+
ge ? /* @__PURE__ */ e.jsx(
|
|
2558
|
+
ct,
|
|
2559
|
+
{
|
|
2560
|
+
value: `${a.label}`.length < ie ? `${a.label}` : `${`${a.label}`.substring(0, ie)}...`,
|
|
2561
|
+
y: m(0) + 5,
|
|
2562
|
+
x: 0,
|
|
2563
|
+
width: d.bandwidth(),
|
|
2564
|
+
height: b.bottom,
|
|
2565
|
+
style: z?.xAxis?.labels,
|
|
2566
|
+
className: y?.xAxis?.labels,
|
|
2567
|
+
alignment: "top",
|
|
2568
|
+
animate: x,
|
|
2569
|
+
isInView: B
|
|
2570
|
+
}
|
|
2571
|
+
) : null
|
|
2572
|
+
]
|
|
2573
|
+
},
|
|
2574
|
+
a.label
|
|
2575
|
+
)
|
|
2576
|
+
),
|
|
2577
|
+
Z ? /* @__PURE__ */ e.jsx(e.Fragment, { children: Z.map((a, s) => /* @__PURE__ */ e.jsx(
|
|
2578
|
+
nt,
|
|
2579
|
+
{
|
|
2580
|
+
text: a.text,
|
|
2581
|
+
color: a.color,
|
|
2582
|
+
y: m(a.value),
|
|
2583
|
+
x1: 0 - D,
|
|
2584
|
+
x2: M + b.right,
|
|
2585
|
+
classNames: a.classNames,
|
|
2586
|
+
styles: a.styles,
|
|
2587
|
+
animate: x,
|
|
2588
|
+
isInView: B
|
|
2589
|
+
},
|
|
2590
|
+
s
|
|
2591
|
+
)) }) : null
|
|
2592
|
+
] }),
|
|
2593
|
+
N.filter((a) => a.position === "after").map((a) => a.layer)
|
|
2594
|
+
] })
|
|
2595
|
+
}
|
|
2596
|
+
),
|
|
2597
|
+
v && _ && ce && H ? /* @__PURE__ */ e.jsx(
|
|
2598
|
+
Ge,
|
|
2599
|
+
{
|
|
2600
|
+
data: v,
|
|
2601
|
+
body: _,
|
|
2602
|
+
xPos: ce,
|
|
2603
|
+
yPos: H,
|
|
2604
|
+
backgroundStyle: z?.tooltip,
|
|
2605
|
+
className: y?.tooltip
|
|
2606
|
+
}
|
|
2607
|
+
) : null,
|
|
2608
|
+
re && V !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
2609
|
+
We,
|
|
2610
|
+
{
|
|
2611
|
+
open: V !== void 0,
|
|
2612
|
+
onClose: () => {
|
|
2613
|
+
A(void 0);
|
|
2614
|
+
},
|
|
2615
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2616
|
+
"div",
|
|
2617
|
+
{
|
|
2618
|
+
className: "graph-modal-content m-0",
|
|
2619
|
+
dangerouslySetInnerHTML: typeof re == "string" ? { __html: Xe(re, V) } : void 0,
|
|
2620
|
+
children: typeof re == "function" ? re(V) : null
|
|
2621
|
+
}
|
|
2622
|
+
)
|
|
2623
|
+
}
|
|
2624
|
+
) : null
|
|
2625
|
+
] });
|
|
2626
|
+
}
|
|
2627
|
+
function vt(fe) {
|
|
2628
|
+
const {
|
|
2629
|
+
data: o,
|
|
2630
|
+
graphTitle: g,
|
|
2631
|
+
colors: G = je.light.categoricalColors.colors,
|
|
2632
|
+
sources: I,
|
|
2633
|
+
graphDescription: X,
|
|
2634
|
+
barPadding: me = 0.25,
|
|
2635
|
+
showTicks: ue = !0,
|
|
2636
|
+
leftMargin: ge = 20,
|
|
2637
|
+
rightMargin: Q = 20,
|
|
2638
|
+
topMargin: Y = 20,
|
|
2639
|
+
bottomMargin: ie = 25,
|
|
2640
|
+
truncateBy: D = 999,
|
|
2641
|
+
showLabels: ne = !0,
|
|
2642
|
+
showValues: he = !0,
|
|
2643
|
+
backgroundColor: j = !1,
|
|
2644
|
+
suffix: _ = "",
|
|
2645
|
+
prefix: U = "",
|
|
2646
|
+
height: Z,
|
|
2647
|
+
width: C,
|
|
2648
|
+
footNote: p,
|
|
2649
|
+
colorDomain: F,
|
|
2650
|
+
colorLegendTitle: ae,
|
|
2651
|
+
padding: le,
|
|
2652
|
+
relativeHeight: J,
|
|
2653
|
+
tooltip: ee,
|
|
2654
|
+
onSeriesMouseOver: re,
|
|
2655
|
+
refValues: E,
|
|
2656
|
+
graphID: xe,
|
|
2657
|
+
maxValue: de,
|
|
2658
|
+
minValue: z,
|
|
2659
|
+
onSeriesMouseClick: y,
|
|
2660
|
+
graphDownload: x = !1,
|
|
2661
|
+
dataDownload: w = !1,
|
|
2662
|
+
language: T = "en",
|
|
2663
|
+
theme: N = "light",
|
|
2664
|
+
labelOrder: $,
|
|
2665
|
+
minHeight: L = 0,
|
|
2666
|
+
maxBarThickness: B,
|
|
2667
|
+
ariaLabel: b,
|
|
2668
|
+
resetSelectionOnDoubleClick: v = !0,
|
|
2669
|
+
detailsOnClick: R,
|
|
2670
|
+
barAxisTitle: V,
|
|
2671
|
+
noOfTicks: A = 5,
|
|
2672
|
+
valueColor: ce,
|
|
2673
|
+
styles: W,
|
|
2674
|
+
classNames: H,
|
|
2675
|
+
filterNA: se = !0,
|
|
2676
|
+
showColorScale: M = !0,
|
|
2677
|
+
animate: P = !1,
|
|
2678
|
+
precision: m = 2,
|
|
2679
|
+
customLayers: k = [],
|
|
2680
|
+
timeline: f = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
2681
|
+
naLabel: d = "NA"
|
|
2682
|
+
} = fe, [u, n] = S(0), [a, s] = S(0), [t, l] = S(f.autoplay), h = Be(
|
|
2683
|
+
Te(
|
|
2684
|
+
o.filter((c) => c.date !== void 0 && c.date !== null),
|
|
2685
|
+
(c) => c.date
|
|
2686
|
+
).map((c) => Se(`${c.date}`, f.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
2687
|
+
(c, te) => tt(c, te)
|
|
2688
|
+
), [Oe, K] = S(f.autoplay ? 0 : h.length - 1), [we, ve] = S(void 0), Ce = Me(null), oe = Me(null);
|
|
2689
|
+
ze(() => {
|
|
2690
|
+
const c = new ResizeObserver((te) => {
|
|
2691
|
+
n(C || te[0].target.clientWidth || 620), s(Z || te[0].target.clientHeight || 480);
|
|
2692
|
+
});
|
|
2693
|
+
return Ce.current && (s(Ce.current.clientHeight || 480), n(Ce.current.clientWidth || 620), C || c.observe(Ce.current)), () => c.disconnect();
|
|
2694
|
+
}, [C, Z]), ze(() => {
|
|
2695
|
+
const c = setInterval(
|
|
2696
|
+
() => {
|
|
2697
|
+
K((te) => te < h.length - 1 ? te + 1 : 0);
|
|
2698
|
+
},
|
|
2699
|
+
(f.speed || 2) * 1e3
|
|
2700
|
+
);
|
|
2701
|
+
return t || clearInterval(c), () => clearInterval(c);
|
|
2702
|
+
}, [h, t, f.speed]);
|
|
2703
|
+
const ye = Fe(
|
|
2704
|
+
h,
|
|
2705
|
+
Oe,
|
|
2706
|
+
f.showOnlyActiveDate,
|
|
2707
|
+
f.dateFormat || "yyyy"
|
|
2708
|
+
);
|
|
2709
|
+
return /* @__PURE__ */ e.jsx(
|
|
2710
|
+
"div",
|
|
2711
|
+
{
|
|
2712
|
+
className: `${N || "light"} flex ${C ? "w-fit grow-0" : "w-full grow"}`,
|
|
2713
|
+
dir: T === "he" || T === "ar" ? "rtl" : void 0,
|
|
2714
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2715
|
+
"div",
|
|
2716
|
+
{
|
|
2717
|
+
className: Ne(
|
|
2718
|
+
`${j ? j === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T || "en"}`,
|
|
2719
|
+
H?.graphContainer
|
|
2720
|
+
),
|
|
2721
|
+
style: {
|
|
2722
|
+
...W?.graphContainer || {},
|
|
2723
|
+
...j && j !== !0 ? { backgroundColor: j } : {}
|
|
2724
|
+
},
|
|
2725
|
+
id: xe,
|
|
2726
|
+
ref: oe,
|
|
2727
|
+
"aria-label": b || `${g ? `The graph shows ${g}. ` : ""}This is a grouped bar chart. ${X ? ` ${X}` : ""}`,
|
|
2728
|
+
children: /* @__PURE__ */ e.jsx(
|
|
2729
|
+
"div",
|
|
2730
|
+
{
|
|
2731
|
+
className: "flex grow",
|
|
2732
|
+
style: { padding: j ? le || "1rem" : le || 0 },
|
|
2733
|
+
children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
2734
|
+
g || X || x || w ? /* @__PURE__ */ e.jsx(
|
|
2735
|
+
Je,
|
|
2736
|
+
{
|
|
2737
|
+
styles: {
|
|
2738
|
+
title: W?.title,
|
|
2739
|
+
description: W?.description
|
|
2740
|
+
},
|
|
2741
|
+
classNames: {
|
|
2742
|
+
title: H?.title,
|
|
2743
|
+
description: H?.description
|
|
2744
|
+
},
|
|
2745
|
+
graphTitle: g,
|
|
2746
|
+
graphDescription: X,
|
|
2747
|
+
width: C,
|
|
2748
|
+
graphDownload: x ? oe.current : void 0,
|
|
2749
|
+
dataDownload: w ? o.map((c) => c.data).filter((c) => c !== void 0).length > 0 ? o.map((c) => c.data).filter((c) => c !== void 0) : o.filter((c) => c !== void 0) : null
|
|
2750
|
+
}
|
|
2751
|
+
) : null,
|
|
2752
|
+
f.enabled && h.length > 0 && ye ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
2753
|
+
/* @__PURE__ */ e.jsx(
|
|
2754
|
+
"button",
|
|
2755
|
+
{
|
|
2756
|
+
type: "button",
|
|
2757
|
+
onClick: () => {
|
|
2758
|
+
l(!t);
|
|
2759
|
+
},
|
|
2760
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
2761
|
+
"aria-label": t ? "Click to pause animation" : "Click to play animation",
|
|
2762
|
+
children: t ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
2763
|
+
}
|
|
2764
|
+
),
|
|
2765
|
+
/* @__PURE__ */ e.jsx(
|
|
2766
|
+
He,
|
|
2767
|
+
{
|
|
2768
|
+
min: h[0],
|
|
2769
|
+
max: h[h.length - 1],
|
|
2770
|
+
marks: ye,
|
|
2771
|
+
step: null,
|
|
2772
|
+
defaultValue: h[h.length - 1],
|
|
2773
|
+
value: h[Oe],
|
|
2774
|
+
onChangeComplete: (c) => {
|
|
2775
|
+
K(h.indexOf(c));
|
|
2776
|
+
},
|
|
2777
|
+
onChange: (c) => {
|
|
2778
|
+
K(h.indexOf(c));
|
|
2779
|
+
},
|
|
2780
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
2781
|
+
}
|
|
2782
|
+
)
|
|
2783
|
+
] }) : null,
|
|
2784
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2785
|
+
M ? /* @__PURE__ */ e.jsx(
|
|
2786
|
+
Ke,
|
|
2787
|
+
{
|
|
2788
|
+
width: C,
|
|
2789
|
+
colorDomain: F,
|
|
2790
|
+
colors: G,
|
|
2791
|
+
colorLegendTitle: ae,
|
|
2792
|
+
setSelectedColor: ve,
|
|
2793
|
+
showNAColor: !1
|
|
2794
|
+
}
|
|
2795
|
+
) : null,
|
|
2796
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full grow leading-0", ref: Ce, "aria-label": "Graph area", children: (C || u) && (Z || a) ? /* @__PURE__ */ e.jsx(
|
|
2797
|
+
bt,
|
|
2798
|
+
{
|
|
2799
|
+
data: Ve(
|
|
2800
|
+
o,
|
|
2801
|
+
f.dateFormat || "yyyy"
|
|
2802
|
+
).filter(
|
|
2803
|
+
(c) => f.enabled ? c.date === $e(
|
|
2804
|
+
new Date(h[Oe]),
|
|
2805
|
+
f.dateFormat || "yyyy"
|
|
2806
|
+
) : c
|
|
2807
|
+
).filter((c) => se ? !c.size.every((te) => te == null) : c),
|
|
2808
|
+
barColors: G,
|
|
2809
|
+
width: C || u,
|
|
2810
|
+
height: Math.max(
|
|
2811
|
+
L,
|
|
2812
|
+
Z || (J ? L ? (C || u) * J > L ? (C || u) * J : L : (C || u) * J : a)
|
|
2813
|
+
),
|
|
2814
|
+
suffix: _,
|
|
2815
|
+
prefix: U,
|
|
2816
|
+
barPadding: me,
|
|
2817
|
+
showLabels: ne,
|
|
2818
|
+
showValues: he,
|
|
2819
|
+
showTicks: ue,
|
|
2820
|
+
truncateBy: D,
|
|
2821
|
+
leftMargin: ge,
|
|
2822
|
+
rightMargin: Q,
|
|
2823
|
+
topMargin: Y,
|
|
2824
|
+
bottomMargin: ie,
|
|
2825
|
+
tooltip: ee,
|
|
2826
|
+
onSeriesMouseOver: re,
|
|
2827
|
+
refValues: E,
|
|
2828
|
+
maxValue: q(de) ? Math.max(
|
|
2829
|
+
...o.map(
|
|
2830
|
+
(c) => Math.max(
|
|
2831
|
+
...c.size.filter(
|
|
2832
|
+
(te) => !q(te)
|
|
2833
|
+
)
|
|
2834
|
+
)
|
|
2835
|
+
)
|
|
2836
|
+
) < 0 ? 0 : Math.max(
|
|
2837
|
+
...o.map(
|
|
2838
|
+
(c) => Math.max(
|
|
2839
|
+
...c.size.filter(
|
|
2840
|
+
(te) => !q(te)
|
|
2841
|
+
)
|
|
2842
|
+
)
|
|
2843
|
+
)
|
|
2844
|
+
) : de,
|
|
2845
|
+
minValue: q(z) ? Math.min(
|
|
2846
|
+
...o.map(
|
|
2847
|
+
(c) => Math.min(
|
|
2848
|
+
...c.size.filter(
|
|
2849
|
+
(te) => !q(te)
|
|
2850
|
+
)
|
|
2851
|
+
)
|
|
2852
|
+
)
|
|
2853
|
+
) >= 0 ? 0 : Math.min(
|
|
2854
|
+
...o.map(
|
|
2855
|
+
(c) => Math.min(
|
|
2856
|
+
...c.size.filter(
|
|
2857
|
+
(te) => !q(te)
|
|
2858
|
+
)
|
|
2859
|
+
)
|
|
2860
|
+
)
|
|
2861
|
+
) : z,
|
|
2862
|
+
onSeriesMouseClick: y,
|
|
2863
|
+
selectedColor: we,
|
|
2864
|
+
labelOrder: $,
|
|
2865
|
+
maxBarThickness: B,
|
|
2866
|
+
resetSelectionOnDoubleClick: v,
|
|
2867
|
+
detailsOnClick: R,
|
|
2868
|
+
barAxisTitle: V,
|
|
2869
|
+
noOfTicks: A,
|
|
2870
|
+
valueColor: ce,
|
|
2871
|
+
styles: W,
|
|
2872
|
+
classNames: H,
|
|
2873
|
+
animate: P === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : P || { duration: 0, once: !0, amount: 0 },
|
|
2874
|
+
colorDomain: F,
|
|
2875
|
+
precision: m,
|
|
2876
|
+
customLayers: k,
|
|
2877
|
+
naLabel: d
|
|
2878
|
+
}
|
|
2879
|
+
) : null })
|
|
2880
|
+
] }) }),
|
|
2881
|
+
I || p ? /* @__PURE__ */ e.jsx(
|
|
2882
|
+
Ue,
|
|
2883
|
+
{
|
|
2884
|
+
styles: { footnote: W?.footnote, source: W?.source },
|
|
2885
|
+
classNames: {
|
|
2886
|
+
footnote: H?.footnote,
|
|
2887
|
+
source: H?.source
|
|
2888
|
+
},
|
|
2889
|
+
sources: I,
|
|
2890
|
+
footNote: p,
|
|
2891
|
+
width: C
|
|
2892
|
+
}
|
|
2893
|
+
) : null
|
|
2894
|
+
] })
|
|
2895
|
+
}
|
|
2896
|
+
)
|
|
2897
|
+
}
|
|
2898
|
+
)
|
|
2899
|
+
}
|
|
2900
|
+
);
|
|
2901
|
+
}
|
|
2902
|
+
function wt(fe) {
|
|
2903
|
+
const {
|
|
2904
|
+
data: o,
|
|
2905
|
+
width: g,
|
|
2906
|
+
height: G,
|
|
2907
|
+
barColors: I,
|
|
2908
|
+
barPadding: X,
|
|
2909
|
+
showLabels: me,
|
|
2910
|
+
showTicks: ue,
|
|
2911
|
+
truncateBy: ge,
|
|
2912
|
+
leftMargin: Q,
|
|
2913
|
+
topMargin: Y,
|
|
2914
|
+
bottomMargin: ie,
|
|
2915
|
+
rightMargin: D,
|
|
2916
|
+
tooltip: ne,
|
|
2917
|
+
onSeriesMouseOver: he,
|
|
2918
|
+
suffix: j,
|
|
2919
|
+
prefix: _,
|
|
2920
|
+
showValues: U,
|
|
2921
|
+
refValues: Z,
|
|
2922
|
+
maxValue: C,
|
|
2923
|
+
onSeriesMouseClick: p,
|
|
2924
|
+
selectedColor: F,
|
|
2925
|
+
labelOrder: ae,
|
|
2926
|
+
maxBarThickness: le,
|
|
2927
|
+
minBarThickness: J,
|
|
2928
|
+
resetSelectionOnDoubleClick: ee,
|
|
2929
|
+
detailsOnClick: re,
|
|
2930
|
+
barAxisTitle: E,
|
|
2931
|
+
valueColor: xe,
|
|
2932
|
+
noOfTicks: de,
|
|
2933
|
+
styles: z,
|
|
2934
|
+
classNames: y,
|
|
2935
|
+
animate: x,
|
|
2936
|
+
colorDomain: w,
|
|
2937
|
+
precision: T,
|
|
2938
|
+
customLayers: N,
|
|
2939
|
+
naLabel: $
|
|
2940
|
+
} = fe, L = Me(null), B = Ee(L, {
|
|
2941
|
+
once: x.once,
|
|
2942
|
+
amount: x.amount
|
|
2943
|
+
}), b = {
|
|
2944
|
+
top: Y,
|
|
2945
|
+
bottom: ie,
|
|
2946
|
+
left: E ? Q + 30 : Q,
|
|
2947
|
+
right: D
|
|
2948
|
+
}, [v, R] = S(void 0), [V, A] = S(void 0), [ce, W] = S(void 0), [H, se] = S(void 0), M = g - b.left - b.right, P = G - b.top - b.bottom, m = Re().domain([0, C]).range([P, 0]).nice(), k = o.map((n, a) => ({
|
|
2949
|
+
...n,
|
|
2950
|
+
id: ae ? `${n.label}` : `${a}`
|
|
2951
|
+
})), f = ae || k.map((n) => `${n.id}`), d = Ie().domain(f).range([
|
|
2952
|
+
0,
|
|
2953
|
+
J ? Math.max(M, J * f.length) : le ? Math.min(M, le * f.length) : M
|
|
2954
|
+
]).paddingInner(X), u = m.ticks(de);
|
|
2955
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2956
|
+
/* @__PURE__ */ e.jsx(
|
|
2957
|
+
pe.svg,
|
|
2958
|
+
{
|
|
2959
|
+
width: `${g}px`,
|
|
2960
|
+
height: `${G}px`,
|
|
2961
|
+
viewBox: `0 0 ${g} ${G}`,
|
|
2962
|
+
direction: "ltr",
|
|
2963
|
+
ref: L,
|
|
2964
|
+
children: /* @__PURE__ */ e.jsxs("g", { transform: `translate(${b.left},${b.top})`, children: [
|
|
2965
|
+
/* @__PURE__ */ e.jsx(
|
|
2966
|
+
_e,
|
|
2967
|
+
{
|
|
2968
|
+
y1: m(0),
|
|
2969
|
+
y2: m(0),
|
|
2970
|
+
x1: 0 - Q,
|
|
2971
|
+
x2: M + b.right,
|
|
2972
|
+
label: De(0, $, T, _, j),
|
|
2973
|
+
labelPos: {
|
|
2974
|
+
x: 0 - Q,
|
|
2975
|
+
y: m(0),
|
|
2976
|
+
dx: 0,
|
|
2977
|
+
dy: -5
|
|
2978
|
+
},
|
|
2979
|
+
classNames: {
|
|
2980
|
+
axis: y?.xAxis?.axis,
|
|
2981
|
+
label: y?.yAxis?.labels
|
|
2982
|
+
},
|
|
2983
|
+
styles: { axis: z?.xAxis?.axis, label: z?.yAxis?.labels }
|
|
2984
|
+
}
|
|
2985
|
+
),
|
|
2986
|
+
ue ? /* @__PURE__ */ e.jsx(
|
|
2987
|
+
dt,
|
|
2988
|
+
{
|
|
2989
|
+
values: u.filter((n) => n !== 0),
|
|
2990
|
+
y: u.filter((n) => n !== 0).map((n) => m(n)),
|
|
2991
|
+
x1: 0 - Q,
|
|
2992
|
+
x2: M + b.right,
|
|
2993
|
+
styles: {
|
|
2994
|
+
gridLines: z?.yAxis?.gridLines,
|
|
2995
|
+
labels: z?.yAxis?.labels
|
|
2996
|
+
},
|
|
2997
|
+
classNames: {
|
|
2998
|
+
gridLines: y?.yAxis?.gridLines,
|
|
2999
|
+
labels: y?.yAxis?.labels
|
|
3000
|
+
},
|
|
3001
|
+
suffix: j,
|
|
3002
|
+
prefix: _,
|
|
3003
|
+
labelType: "secondary",
|
|
3004
|
+
showGridLines: !0,
|
|
3005
|
+
labelPos: "vertical",
|
|
3006
|
+
precision: T
|
|
3007
|
+
}
|
|
3008
|
+
) : null,
|
|
3009
|
+
/* @__PURE__ */ e.jsx(
|
|
3010
|
+
Ye,
|
|
3011
|
+
{
|
|
3012
|
+
x: 0 - Q - 15,
|
|
3013
|
+
y: P / 2,
|
|
3014
|
+
style: z?.yAxis?.title,
|
|
3015
|
+
className: y?.yAxis?.title,
|
|
3016
|
+
text: E,
|
|
3017
|
+
rotate90: !0
|
|
3018
|
+
}
|
|
3019
|
+
),
|
|
3020
|
+
N.filter((n) => n.position === "before").map((n) => n.layer),
|
|
3021
|
+
/* @__PURE__ */ e.jsxs(qe, { children: [
|
|
3022
|
+
k.map(
|
|
3023
|
+
(n) => q(d(n.id)) ? null : /* @__PURE__ */ e.jsxs(
|
|
3024
|
+
pe.g,
|
|
3025
|
+
{
|
|
3026
|
+
className: "undp-viz-low-opacity undp-viz-g-with-hover",
|
|
3027
|
+
variants: {
|
|
3028
|
+
initial: { x: d(`${n.id}`), y: 0 },
|
|
3029
|
+
whileInView: {
|
|
3030
|
+
x: d(`${n.id}`),
|
|
3031
|
+
y: 0,
|
|
3032
|
+
transition: { duration: x.duration }
|
|
3033
|
+
}
|
|
3034
|
+
},
|
|
3035
|
+
transition: { duration: x.duration },
|
|
3036
|
+
initial: "initial",
|
|
3037
|
+
animate: B ? "whileInView" : "initial",
|
|
3038
|
+
exit: { opacity: 0, transition: { duration: x.duration } },
|
|
3039
|
+
children: [
|
|
3040
|
+
n.size.map((a, s) => /* @__PURE__ */ e.jsxs(
|
|
3041
|
+
pe.g,
|
|
3042
|
+
{
|
|
3043
|
+
opacity: F ? I[s] === F ? 1 : 0.3 : 1,
|
|
3044
|
+
onMouseEnter: (t) => {
|
|
3045
|
+
R({ ...n, sizeIndex: s }), se(t.clientY), W(t.clientX), he?.({ ...n, sizeIndex: s });
|
|
3046
|
+
},
|
|
3047
|
+
onMouseMove: (t) => {
|
|
3048
|
+
R({ ...n, sizeIndex: s }), se(t.clientY), W(t.clientX);
|
|
3049
|
+
},
|
|
3050
|
+
onMouseLeave: () => {
|
|
3051
|
+
R(void 0), W(void 0), se(void 0), he?.(void 0);
|
|
3052
|
+
},
|
|
3053
|
+
onClick: () => {
|
|
3054
|
+
(p || re) && (Pe(V, { ...n, sizeIndex: s }) && ee ? (A(void 0), p?.(void 0)) : (A({ ...n, sizeIndex: s }), p && p({ ...n, sizeIndex: s })));
|
|
3055
|
+
},
|
|
3056
|
+
children: [
|
|
3057
|
+
/* @__PURE__ */ e.jsx(
|
|
3058
|
+
pe.rect,
|
|
3059
|
+
{
|
|
3060
|
+
x: 0,
|
|
3061
|
+
width: d.bandwidth(),
|
|
3062
|
+
variants: {
|
|
3063
|
+
initial: {
|
|
3064
|
+
height: 0,
|
|
3065
|
+
fill: I[s],
|
|
3066
|
+
y: m(0)
|
|
3067
|
+
},
|
|
3068
|
+
whileInView: {
|
|
3069
|
+
height: Math.abs(
|
|
3070
|
+
m(ke(n.size.filter((t, l) => l <= s && t))) - m(ke(n.size.filter((t, l) => l < s && t)))
|
|
3071
|
+
),
|
|
3072
|
+
y: m(ke(n.size.filter((t, l) => l <= s && t))),
|
|
3073
|
+
fill: I[s],
|
|
3074
|
+
transition: { duration: x.duration }
|
|
3075
|
+
}
|
|
3076
|
+
},
|
|
3077
|
+
initial: "initial",
|
|
3078
|
+
animate: B ? "whileInView" : "initial",
|
|
3079
|
+
exit: {
|
|
3080
|
+
height: 0,
|
|
3081
|
+
y: m(0),
|
|
3082
|
+
transition: { duration: x.duration }
|
|
3083
|
+
}
|
|
3084
|
+
}
|
|
3085
|
+
),
|
|
3086
|
+
U ? /* @__PURE__ */ e.jsx(
|
|
3087
|
+
pe.text,
|
|
3088
|
+
{
|
|
3089
|
+
x: d.bandwidth() / 2,
|
|
3090
|
+
style: {
|
|
3091
|
+
fill: lt(I[s]),
|
|
3092
|
+
textAnchor: "middle",
|
|
3093
|
+
...z?.graphObjectValues || {}
|
|
3094
|
+
},
|
|
3095
|
+
className: Ne("graph-value text-sm", y?.graphObjectValues),
|
|
3096
|
+
dy: "0.33em",
|
|
3097
|
+
variants: {
|
|
3098
|
+
initial: {
|
|
3099
|
+
y: m(0),
|
|
3100
|
+
opacity: 0,
|
|
3101
|
+
fill: lt(I[s])
|
|
3102
|
+
},
|
|
3103
|
+
whileInView: {
|
|
3104
|
+
y: m(ke(n.size.filter((t, l) => l <= s && t))) + Math.abs(
|
|
3105
|
+
m(ke(n.size.filter((t, l) => l <= s && t))) - m(ke(n.size.filter((t, l) => l < s && t)))
|
|
3106
|
+
) / 2,
|
|
3107
|
+
opacity: a && Math.abs(
|
|
3108
|
+
m(ke(n.size.filter((t, l) => l <= s && t))) - m(ke(n.size.filter((t, l) => l < s && t)))
|
|
3109
|
+
) > 20 ? 1 : 0,
|
|
3110
|
+
fill: lt(I[s]),
|
|
3111
|
+
transition: { duration: x.duration }
|
|
3112
|
+
}
|
|
3113
|
+
},
|
|
3114
|
+
initial: "initial",
|
|
3115
|
+
animate: B ? "whileInView" : "initial",
|
|
3116
|
+
exit: { opacity: 0, transition: { duration: x.duration } },
|
|
3117
|
+
children: De(a, $, T, _, j)
|
|
3118
|
+
}
|
|
3119
|
+
) : null
|
|
3120
|
+
]
|
|
3121
|
+
},
|
|
3122
|
+
`${n.label}-${w[s] || s}`
|
|
3123
|
+
)),
|
|
3124
|
+
me ? /* @__PURE__ */ e.jsx(
|
|
3125
|
+
ct,
|
|
3126
|
+
{
|
|
3127
|
+
value: `${n.label}`.length < ge ? `${n.label}` : `${`${n.label}`.substring(0, ge)}...`,
|
|
3128
|
+
y: m(0) + 5,
|
|
3129
|
+
x: 0,
|
|
3130
|
+
width: d.bandwidth(),
|
|
3131
|
+
height: b.bottom,
|
|
3132
|
+
style: z?.xAxis?.labels,
|
|
3133
|
+
className: y?.xAxis?.labels,
|
|
3134
|
+
alignment: "top",
|
|
3135
|
+
animate: x,
|
|
3136
|
+
isInView: B
|
|
3137
|
+
}
|
|
3138
|
+
) : null,
|
|
3139
|
+
U ? /* @__PURE__ */ e.jsx(
|
|
3140
|
+
pe.text,
|
|
3141
|
+
{
|
|
3142
|
+
style: {
|
|
3143
|
+
...xe && { fill: xe },
|
|
3144
|
+
textAnchor: "middle",
|
|
3145
|
+
...z?.graphObjectValues || {}
|
|
3146
|
+
},
|
|
3147
|
+
x: d.bandwidth() / 2,
|
|
3148
|
+
dy: -10,
|
|
3149
|
+
className: Ne(
|
|
3150
|
+
"graph-value graph-value-total",
|
|
3151
|
+
xe ? "text-sm" : "fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",
|
|
3152
|
+
y?.graphObjectValues
|
|
3153
|
+
),
|
|
3154
|
+
variants: {
|
|
3155
|
+
initial: {
|
|
3156
|
+
y: m(0),
|
|
3157
|
+
opacity: 0
|
|
3158
|
+
},
|
|
3159
|
+
whileInView: {
|
|
3160
|
+
y: m(ke(n.size.map((a) => a || 0))),
|
|
3161
|
+
opacity: 1,
|
|
3162
|
+
transition: { duration: x.duration }
|
|
3163
|
+
}
|
|
3164
|
+
},
|
|
3165
|
+
exit: {
|
|
3166
|
+
opacity: 0,
|
|
3167
|
+
transition: { duration: x.duration }
|
|
3168
|
+
},
|
|
3169
|
+
initial: "initial",
|
|
3170
|
+
animate: B ? "whileInView" : "initial",
|
|
3171
|
+
children: De(
|
|
3172
|
+
ke(n.size.filter((a) => a)),
|
|
3173
|
+
$,
|
|
3174
|
+
T,
|
|
3175
|
+
_,
|
|
3176
|
+
j
|
|
3177
|
+
)
|
|
3178
|
+
}
|
|
3179
|
+
) : null
|
|
3180
|
+
]
|
|
3181
|
+
},
|
|
3182
|
+
n.label
|
|
3183
|
+
)
|
|
3184
|
+
),
|
|
3185
|
+
Z ? /* @__PURE__ */ e.jsx(e.Fragment, { children: Z.map((n, a) => /* @__PURE__ */ e.jsx(
|
|
3186
|
+
nt,
|
|
3187
|
+
{
|
|
3188
|
+
text: n.text,
|
|
3189
|
+
color: n.color,
|
|
3190
|
+
y: m(n.value),
|
|
3191
|
+
x1: 0 - Q,
|
|
3192
|
+
x2: M + b.right,
|
|
3193
|
+
classNames: n.classNames,
|
|
3194
|
+
styles: n.styles,
|
|
3195
|
+
animate: x,
|
|
3196
|
+
isInView: B
|
|
3197
|
+
},
|
|
3198
|
+
a
|
|
3199
|
+
)) }) : null
|
|
3200
|
+
] }),
|
|
3201
|
+
N.filter((n) => n.position === "after").map((n) => n.layer)
|
|
3202
|
+
] })
|
|
3203
|
+
}
|
|
3204
|
+
),
|
|
3205
|
+
v && ne && ce && H ? /* @__PURE__ */ e.jsx(
|
|
3206
|
+
Ge,
|
|
3207
|
+
{
|
|
3208
|
+
data: v,
|
|
3209
|
+
body: ne,
|
|
3210
|
+
xPos: ce,
|
|
3211
|
+
yPos: H,
|
|
3212
|
+
backgroundStyle: z?.tooltip,
|
|
3213
|
+
className: y?.tooltip
|
|
3214
|
+
}
|
|
3215
|
+
) : null,
|
|
3216
|
+
re && V !== void 0 ? /* @__PURE__ */ e.jsx(
|
|
3217
|
+
We,
|
|
3218
|
+
{
|
|
3219
|
+
open: V !== void 0,
|
|
3220
|
+
onClose: () => {
|
|
3221
|
+
A(void 0);
|
|
3222
|
+
},
|
|
3223
|
+
children: /* @__PURE__ */ e.jsx(
|
|
3224
|
+
"div",
|
|
3225
|
+
{
|
|
3226
|
+
className: "graph-modal-content m-0",
|
|
3227
|
+
dangerouslySetInnerHTML: typeof re == "string" ? { __html: Xe(re, V) } : void 0,
|
|
3228
|
+
children: typeof re == "function" ? re(V) : null
|
|
3229
|
+
}
|
|
3230
|
+
)
|
|
3231
|
+
}
|
|
3232
|
+
) : null
|
|
3233
|
+
] });
|
|
3234
|
+
}
|
|
3235
|
+
function Ct(fe) {
|
|
3236
|
+
const {
|
|
3237
|
+
data: o,
|
|
3238
|
+
graphTitle: g,
|
|
3239
|
+
colors: G = je.light.categoricalColors.colors,
|
|
3240
|
+
sources: I,
|
|
3241
|
+
graphDescription: X,
|
|
3242
|
+
barPadding: me = 0.25,
|
|
3243
|
+
showTicks: ue = !0,
|
|
3244
|
+
leftMargin: ge = 20,
|
|
3245
|
+
rightMargin: Q = 20,
|
|
3246
|
+
topMargin: Y = 20,
|
|
3247
|
+
bottomMargin: ie = 25,
|
|
3248
|
+
truncateBy: D = 999,
|
|
3249
|
+
showLabels: ne = !0,
|
|
3250
|
+
showValues: he = !0,
|
|
3251
|
+
backgroundColor: j = !1,
|
|
3252
|
+
showColorScale: _ = !0,
|
|
3253
|
+
suffix: U = "",
|
|
3254
|
+
prefix: Z = "",
|
|
3255
|
+
height: C,
|
|
3256
|
+
width: p,
|
|
3257
|
+
footNote: F,
|
|
3258
|
+
colorDomain: ae,
|
|
3259
|
+
colorLegendTitle: le,
|
|
3260
|
+
padding: J,
|
|
3261
|
+
tooltip: ee,
|
|
3262
|
+
onSeriesMouseOver: re,
|
|
3263
|
+
relativeHeight: E,
|
|
3264
|
+
refValues: xe,
|
|
3265
|
+
graphID: de,
|
|
3266
|
+
maxValue: z,
|
|
3267
|
+
onSeriesMouseClick: y,
|
|
3268
|
+
graphDownload: x = !1,
|
|
3269
|
+
dataDownload: w = !1,
|
|
3270
|
+
language: T = "en",
|
|
3271
|
+
theme: N = "light",
|
|
3272
|
+
labelOrder: $,
|
|
3273
|
+
minHeight: L = 0,
|
|
3274
|
+
maxBarThickness: B,
|
|
3275
|
+
sortParameter: b,
|
|
3276
|
+
maxNumberOfBars: v,
|
|
3277
|
+
minBarThickness: R,
|
|
3278
|
+
ariaLabel: V,
|
|
3279
|
+
resetSelectionOnDoubleClick: A = !0,
|
|
3280
|
+
detailsOnClick: ce,
|
|
3281
|
+
barAxisTitle: W,
|
|
3282
|
+
noOfTicks: H = 5,
|
|
3283
|
+
valueColor: se,
|
|
3284
|
+
styles: M,
|
|
3285
|
+
classNames: P,
|
|
3286
|
+
filterNA: m = !0,
|
|
3287
|
+
animate: k = !1,
|
|
3288
|
+
precision: f = 2,
|
|
3289
|
+
customLayers: d = [],
|
|
3290
|
+
timeline: u = { enabled: !1, autoplay: !1, showOnlyActiveDate: !0 },
|
|
3291
|
+
naLabel: n = "NA"
|
|
3292
|
+
} = fe, [a, s] = S(0), [t, l] = S(0), [h, Oe] = S(u.autoplay), K = Be(
|
|
3293
|
+
Te(
|
|
3294
|
+
o.filter((r) => r.date !== void 0 && r.date !== null),
|
|
3295
|
+
(r) => r.date
|
|
3296
|
+
).map((r) => Se(`${r.date}`, u.dateFormat || "yyyy", /* @__PURE__ */ new Date()).getTime()),
|
|
3297
|
+
(r, O) => tt(r, O)
|
|
3298
|
+
), [we, ve] = S(u.autoplay ? 0 : K.length - 1), [Ce, oe] = S(void 0), ye = Me(null), c = Me(null);
|
|
3299
|
+
ze(() => {
|
|
3300
|
+
const r = new ResizeObserver((O) => {
|
|
3301
|
+
s(p || O[0].target.clientWidth || 620), l(C || O[0].target.clientHeight || 480);
|
|
3302
|
+
});
|
|
3303
|
+
return ye.current && (l(ye.current.clientHeight || 480), s(ye.current.clientWidth || 620), p || r.observe(ye.current)), () => r.disconnect();
|
|
3304
|
+
}, [p, C]), ze(() => {
|
|
3305
|
+
const r = setInterval(
|
|
3306
|
+
() => {
|
|
3307
|
+
ve((O) => O < K.length - 1 ? O + 1 : 0);
|
|
3308
|
+
},
|
|
3309
|
+
(u.speed || 2) * 1e3
|
|
3310
|
+
);
|
|
3311
|
+
return h || clearInterval(r), () => clearInterval(r);
|
|
3312
|
+
}, [K, h, u.speed]);
|
|
3313
|
+
const te = Fe(
|
|
3314
|
+
K,
|
|
3315
|
+
we,
|
|
3316
|
+
u.showOnlyActiveDate,
|
|
3317
|
+
u.dateFormat || "yyyy"
|
|
3318
|
+
);
|
|
3319
|
+
return /* @__PURE__ */ e.jsx(
|
|
3320
|
+
"div",
|
|
3321
|
+
{
|
|
3322
|
+
className: `${N || "light"} flex ${p ? "w-fit grow-0" : "w-full grow"}`,
|
|
3323
|
+
dir: T === "he" || T === "ar" ? "rtl" : void 0,
|
|
3324
|
+
children: /* @__PURE__ */ e.jsx(
|
|
3325
|
+
"div",
|
|
3326
|
+
{
|
|
3327
|
+
className: Ne(
|
|
3328
|
+
`${j ? j === !0 ? "bg-primary-gray-200 dark:bg-primary-gray-650 " : "" : "bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${T || "en"}`,
|
|
3329
|
+
P?.graphContainer
|
|
3330
|
+
),
|
|
3331
|
+
style: {
|
|
3332
|
+
...M?.graphContainer || {},
|
|
3333
|
+
...j && j !== !0 ? { backgroundColor: j } : {}
|
|
3334
|
+
},
|
|
3335
|
+
id: de,
|
|
3336
|
+
ref: c,
|
|
3337
|
+
"aria-label": V || `${g ? `The graph shows ${g}. ` : ""}This is a stacked bar chart. ${X ? ` ${X}` : ""}`,
|
|
3338
|
+
children: /* @__PURE__ */ e.jsx("div", { style: { padding: j ? J || "1rem" : J || 0 }, children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col w-full gap-4 grow justify-between", children: [
|
|
3339
|
+
g || X || x || w ? /* @__PURE__ */ e.jsx(
|
|
3340
|
+
Je,
|
|
3341
|
+
{
|
|
3342
|
+
styles: {
|
|
3343
|
+
title: M?.title,
|
|
3344
|
+
description: M?.description
|
|
3345
|
+
},
|
|
3346
|
+
classNames: {
|
|
3347
|
+
title: P?.title,
|
|
3348
|
+
description: P?.description
|
|
3349
|
+
},
|
|
3350
|
+
graphTitle: g,
|
|
3351
|
+
graphDescription: X,
|
|
3352
|
+
width: p,
|
|
3353
|
+
graphDownload: x ? c.current : void 0,
|
|
3354
|
+
dataDownload: w ? o.map((r) => r.data).filter((r) => r !== void 0).length > 0 ? o.map((r) => r.data).filter((r) => r !== void 0) : o.filter((r) => r !== void 0) : null
|
|
3355
|
+
}
|
|
3356
|
+
) : null,
|
|
3357
|
+
u.enabled && K.length > 0 && te ? /* @__PURE__ */ e.jsxs("div", { className: "flex gap-6 items-center", dir: "ltr", children: [
|
|
3358
|
+
/* @__PURE__ */ e.jsx(
|
|
3359
|
+
"button",
|
|
3360
|
+
{
|
|
3361
|
+
type: "button",
|
|
3362
|
+
onClick: () => {
|
|
3363
|
+
Oe(!h);
|
|
3364
|
+
},
|
|
3365
|
+
className: "p-0 border-0 cursor-pointer bg-transparent",
|
|
3366
|
+
"aria-label": h ? "Click to pause animation" : "Click to play animation",
|
|
3367
|
+
children: h ? /* @__PURE__ */ e.jsx(Ze, {}) : /* @__PURE__ */ e.jsx(et, {})
|
|
3368
|
+
}
|
|
3369
|
+
),
|
|
3370
|
+
/* @__PURE__ */ e.jsx(
|
|
3371
|
+
He,
|
|
3372
|
+
{
|
|
3373
|
+
min: K[0],
|
|
3374
|
+
max: K[K.length - 1],
|
|
3375
|
+
marks: te,
|
|
3376
|
+
step: null,
|
|
3377
|
+
defaultValue: K[K.length - 1],
|
|
3378
|
+
value: K[we],
|
|
3379
|
+
onChangeComplete: (r) => {
|
|
3380
|
+
ve(K.indexOf(r));
|
|
3381
|
+
},
|
|
3382
|
+
onChange: (r) => {
|
|
3383
|
+
ve(K.indexOf(r));
|
|
3384
|
+
},
|
|
3385
|
+
"aria-label": "Time slider. Use arrow keys to adjust selected time period."
|
|
3386
|
+
}
|
|
3387
|
+
)
|
|
3388
|
+
] }) : null,
|
|
3389
|
+
/* @__PURE__ */ e.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: o.length === 0 ? /* @__PURE__ */ e.jsx(Qe, {}) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3390
|
+
_ ? /* @__PURE__ */ e.jsx(
|
|
3391
|
+
Ke,
|
|
3392
|
+
{
|
|
3393
|
+
width: p,
|
|
3394
|
+
colorDomain: ae,
|
|
3395
|
+
colors: G,
|
|
3396
|
+
colorLegendTitle: le,
|
|
3397
|
+
setSelectedColor: oe,
|
|
3398
|
+
showNAColor: !1
|
|
3399
|
+
}
|
|
3400
|
+
) : null,
|
|
3401
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full grow leading-0", ref: ye, "aria-label": "Graph area", children: (p || a) && (C || t) ? /* @__PURE__ */ e.jsx(
|
|
3402
|
+
wt,
|
|
3403
|
+
{
|
|
3404
|
+
data: b !== void 0 ? b === "total" ? Ae(
|
|
3405
|
+
Ve(
|
|
3406
|
+
o,
|
|
3407
|
+
u.dateFormat || "yyyy"
|
|
3408
|
+
).filter(
|
|
3409
|
+
(r) => u.enabled ? r.date === $e(
|
|
3410
|
+
new Date(K[we]),
|
|
3411
|
+
u.dateFormat || "yyyy"
|
|
3412
|
+
) : r
|
|
3413
|
+
).filter(
|
|
3414
|
+
(r) => m ? !r.size.every((O) => O == null) : r
|
|
3415
|
+
),
|
|
3416
|
+
(r) => ke(r.size.filter((O) => !q(O)))
|
|
3417
|
+
).filter((r, O) => v ? O < v : !0) : Ae(
|
|
3418
|
+
Ve(
|
|
3419
|
+
o,
|
|
3420
|
+
u.dateFormat || "yyyy"
|
|
3421
|
+
).filter(
|
|
3422
|
+
(r) => u.enabled ? r.date === $e(
|
|
3423
|
+
new Date(K[we]),
|
|
3424
|
+
u.dateFormat || "yyyy"
|
|
3425
|
+
) : r
|
|
3426
|
+
).filter(
|
|
3427
|
+
(r) => m ? !r.size.every((O) => O == null) : r
|
|
3428
|
+
),
|
|
3429
|
+
(r) => q(r.size[b]) ? -1 / 0 : r.size[b]
|
|
3430
|
+
).filter((r, O) => v ? O < v : !0) : Ve(
|
|
3431
|
+
o,
|
|
3432
|
+
u.dateFormat || "yyyy"
|
|
3433
|
+
).filter((r) => m ? !r.size.every((O) => O == null) : r).filter((r, O) => v ? O < v : !0),
|
|
3434
|
+
barColors: G,
|
|
3435
|
+
width: p || a,
|
|
3436
|
+
height: Math.max(
|
|
3437
|
+
L,
|
|
3438
|
+
C || (E ? L ? (p || a) * E > L ? (p || a) * E : L : (p || a) * E : t)
|
|
3439
|
+
),
|
|
3440
|
+
barPadding: me,
|
|
3441
|
+
showLabels: ne,
|
|
3442
|
+
showTicks: ue,
|
|
3443
|
+
truncateBy: D,
|
|
3444
|
+
leftMargin: ge,
|
|
3445
|
+
rightMargin: Q,
|
|
3446
|
+
topMargin: Y,
|
|
3447
|
+
bottomMargin: ie,
|
|
3448
|
+
tooltip: ee,
|
|
3449
|
+
onSeriesMouseOver: re,
|
|
3450
|
+
showValues: he,
|
|
3451
|
+
suffix: U,
|
|
3452
|
+
prefix: Z,
|
|
3453
|
+
refValues: xe,
|
|
3454
|
+
maxValue: q(z) ? Math.max(
|
|
3455
|
+
...o.map(
|
|
3456
|
+
(r) => ke(r.size.filter((O) => !q(O))) || 0
|
|
3457
|
+
)
|
|
3458
|
+
) : z,
|
|
3459
|
+
onSeriesMouseClick: y,
|
|
3460
|
+
selectedColor: Ce,
|
|
3461
|
+
labelOrder: $,
|
|
3462
|
+
maxBarThickness: B,
|
|
3463
|
+
minBarThickness: R,
|
|
3464
|
+
resetSelectionOnDoubleClick: A,
|
|
3465
|
+
detailsOnClick: ce,
|
|
3466
|
+
barAxisTitle: W,
|
|
3467
|
+
noOfTicks: H,
|
|
3468
|
+
valueColor: se,
|
|
3469
|
+
styles: M,
|
|
3470
|
+
classNames: P,
|
|
3471
|
+
animate: k === !0 ? { duration: 0.5, once: !0, amount: 0.5 } : k || { duration: 0, once: !0, amount: 0 },
|
|
3472
|
+
colorDomain: ae,
|
|
3473
|
+
precision: f,
|
|
3474
|
+
customLayers: d,
|
|
3475
|
+
naLabel: n
|
|
3476
|
+
}
|
|
3477
|
+
) : null })
|
|
3478
|
+
] }) }),
|
|
3479
|
+
I || F ? /* @__PURE__ */ e.jsx(
|
|
3480
|
+
Ue,
|
|
3481
|
+
{
|
|
3482
|
+
styles: { footnote: M?.footnote, source: M?.source },
|
|
3483
|
+
classNames: {
|
|
3484
|
+
footnote: P?.footnote,
|
|
3485
|
+
source: P?.source
|
|
3486
|
+
},
|
|
3487
|
+
sources: I,
|
|
3488
|
+
footNote: F,
|
|
3489
|
+
width: p
|
|
3490
|
+
}
|
|
3491
|
+
) : null
|
|
3492
|
+
] }) })
|
|
3493
|
+
}
|
|
3494
|
+
)
|
|
3495
|
+
}
|
|
3496
|
+
);
|
|
3497
|
+
}
|
|
3498
|
+
function ai(fe) {
|
|
3499
|
+
const {
|
|
3500
|
+
data: o,
|
|
3501
|
+
graphTitle: g,
|
|
3502
|
+
colors: G,
|
|
3503
|
+
barPadding: I,
|
|
3504
|
+
showTicks: X,
|
|
3505
|
+
leftMargin: me,
|
|
3506
|
+
rightMargin: ue,
|
|
3507
|
+
topMargin: ge,
|
|
3508
|
+
bottomMargin: Q,
|
|
3509
|
+
truncateBy: Y,
|
|
3510
|
+
showLabels: ie,
|
|
3511
|
+
showValues: D,
|
|
3512
|
+
backgroundColor: ne,
|
|
3513
|
+
suffix: he,
|
|
3514
|
+
prefix: j,
|
|
3515
|
+
sources: _,
|
|
3516
|
+
graphDescription: U,
|
|
3517
|
+
height: Z,
|
|
3518
|
+
width: C,
|
|
3519
|
+
footNote: p,
|
|
3520
|
+
colorDomain: F,
|
|
3521
|
+
colorLegendTitle: ae,
|
|
3522
|
+
padding: le,
|
|
3523
|
+
relativeHeight: J,
|
|
3524
|
+
tooltip: ee,
|
|
3525
|
+
onSeriesMouseOver: re,
|
|
3526
|
+
refValues: E,
|
|
3527
|
+
showColorScale: xe,
|
|
3528
|
+
graphID: de,
|
|
3529
|
+
maxValue: z,
|
|
3530
|
+
minValue: y,
|
|
3531
|
+
highlightedDataPoints: x,
|
|
3532
|
+
onSeriesMouseClick: w,
|
|
3533
|
+
graphDownload: T,
|
|
3534
|
+
dataDownload: N,
|
|
3535
|
+
language: $,
|
|
3536
|
+
theme: L,
|
|
3537
|
+
sortData: B,
|
|
3538
|
+
labelOrder: b,
|
|
3539
|
+
showNAColor: v,
|
|
3540
|
+
minHeight: R,
|
|
3541
|
+
maxBarThickness: V,
|
|
3542
|
+
maxNumberOfBars: A,
|
|
3543
|
+
minBarThickness: ce,
|
|
3544
|
+
ariaLabel: W,
|
|
3545
|
+
resetSelectionOnDoubleClick: H,
|
|
3546
|
+
detailsOnClick: se,
|
|
3547
|
+
barAxisTitle: M,
|
|
3548
|
+
noOfTicks: P,
|
|
3549
|
+
valueColor: m,
|
|
3550
|
+
orientation: k = "vertical",
|
|
3551
|
+
styles: f,
|
|
3552
|
+
classNames: d,
|
|
3553
|
+
filterNA: u,
|
|
3554
|
+
animate: n,
|
|
3555
|
+
dimmedOpacity: a,
|
|
3556
|
+
precision: s,
|
|
3557
|
+
customLayers: t,
|
|
3558
|
+
timeline: l,
|
|
3559
|
+
naLabel: h
|
|
3560
|
+
} = fe;
|
|
3561
|
+
return k === "vertical" ? /* @__PURE__ */ e.jsx(
|
|
3562
|
+
yt,
|
|
3563
|
+
{
|
|
3564
|
+
data: o,
|
|
3565
|
+
graphTitle: g,
|
|
3566
|
+
colors: G,
|
|
3567
|
+
barPadding: I,
|
|
3568
|
+
showTicks: X,
|
|
3569
|
+
leftMargin: me,
|
|
3570
|
+
rightMargin: ue,
|
|
3571
|
+
topMargin: ge,
|
|
3572
|
+
bottomMargin: Q,
|
|
3573
|
+
truncateBy: Y,
|
|
3574
|
+
showLabels: ie,
|
|
3575
|
+
showValues: D,
|
|
3576
|
+
backgroundColor: ne,
|
|
3577
|
+
suffix: he,
|
|
3578
|
+
prefix: j,
|
|
3579
|
+
sources: _,
|
|
3580
|
+
graphDescription: U,
|
|
3581
|
+
height: Z,
|
|
3582
|
+
width: C,
|
|
3583
|
+
footNote: p,
|
|
3584
|
+
colorDomain: F,
|
|
3585
|
+
colorLegendTitle: ae,
|
|
3586
|
+
padding: le,
|
|
3587
|
+
relativeHeight: J,
|
|
3588
|
+
tooltip: ee,
|
|
3589
|
+
onSeriesMouseOver: re,
|
|
3590
|
+
refValues: E,
|
|
3591
|
+
showColorScale: xe,
|
|
3592
|
+
graphID: de,
|
|
3593
|
+
maxValue: z,
|
|
3594
|
+
minValue: y,
|
|
3595
|
+
highlightedDataPoints: x,
|
|
3596
|
+
onSeriesMouseClick: w,
|
|
3597
|
+
graphDownload: T,
|
|
3598
|
+
dataDownload: N,
|
|
3599
|
+
language: $,
|
|
3600
|
+
theme: L,
|
|
3601
|
+
sortData: B,
|
|
3602
|
+
labelOrder: b,
|
|
3603
|
+
showNAColor: v,
|
|
3604
|
+
minHeight: R,
|
|
3605
|
+
maxBarThickness: V,
|
|
3606
|
+
maxNumberOfBars: A,
|
|
3607
|
+
minBarThickness: ce,
|
|
3608
|
+
ariaLabel: W,
|
|
3609
|
+
resetSelectionOnDoubleClick: H,
|
|
3610
|
+
styles: f,
|
|
3611
|
+
detailsOnClick: se,
|
|
3612
|
+
barAxisTitle: M,
|
|
3613
|
+
noOfTicks: P,
|
|
3614
|
+
valueColor: m,
|
|
3615
|
+
classNames: d,
|
|
3616
|
+
filterNA: u,
|
|
3617
|
+
animate: n,
|
|
3618
|
+
dimmedOpacity: a,
|
|
3619
|
+
precision: s,
|
|
3620
|
+
customLayers: t,
|
|
3621
|
+
timeline: l
|
|
3622
|
+
}
|
|
3623
|
+
) : /* @__PURE__ */ e.jsx(
|
|
3624
|
+
ut,
|
|
3625
|
+
{
|
|
3626
|
+
data: o,
|
|
3627
|
+
graphTitle: g,
|
|
3628
|
+
colors: G,
|
|
3629
|
+
barPadding: I,
|
|
3630
|
+
showTicks: X,
|
|
3631
|
+
leftMargin: me,
|
|
3632
|
+
rightMargin: ue,
|
|
3633
|
+
topMargin: ge,
|
|
3634
|
+
bottomMargin: Q,
|
|
3635
|
+
truncateBy: Y,
|
|
3636
|
+
showLabels: ie,
|
|
3637
|
+
showValues: D,
|
|
3638
|
+
backgroundColor: ne,
|
|
3639
|
+
suffix: he,
|
|
3640
|
+
prefix: j,
|
|
3641
|
+
sources: _,
|
|
3642
|
+
graphDescription: U,
|
|
3643
|
+
height: Z,
|
|
3644
|
+
width: C,
|
|
3645
|
+
footNote: p,
|
|
3646
|
+
colorDomain: F,
|
|
3647
|
+
colorLegendTitle: ae,
|
|
3648
|
+
padding: le,
|
|
3649
|
+
relativeHeight: J,
|
|
3650
|
+
tooltip: ee,
|
|
3651
|
+
onSeriesMouseOver: re,
|
|
3652
|
+
refValues: E,
|
|
3653
|
+
showColorScale: xe,
|
|
3654
|
+
graphID: de,
|
|
3655
|
+
maxValue: z,
|
|
3656
|
+
minValue: y,
|
|
3657
|
+
highlightedDataPoints: x,
|
|
3658
|
+
onSeriesMouseClick: w,
|
|
3659
|
+
graphDownload: T,
|
|
3660
|
+
dataDownload: N,
|
|
3661
|
+
language: $,
|
|
3662
|
+
theme: L,
|
|
3663
|
+
sortData: B,
|
|
3664
|
+
labelOrder: b,
|
|
3665
|
+
showNAColor: v,
|
|
3666
|
+
minHeight: R,
|
|
3667
|
+
maxBarThickness: V,
|
|
3668
|
+
maxNumberOfBars: A,
|
|
3669
|
+
minBarThickness: ce,
|
|
3670
|
+
ariaLabel: W,
|
|
3671
|
+
resetSelectionOnDoubleClick: H,
|
|
3672
|
+
styles: f,
|
|
3673
|
+
detailsOnClick: se,
|
|
3674
|
+
barAxisTitle: M,
|
|
3675
|
+
noOfTicks: P,
|
|
3676
|
+
valueColor: m,
|
|
3677
|
+
classNames: d,
|
|
3678
|
+
filterNA: u,
|
|
3679
|
+
dimmedOpacity: a,
|
|
3680
|
+
precision: s,
|
|
3681
|
+
customLayers: t,
|
|
3682
|
+
timeline: l,
|
|
3683
|
+
naLabel: h
|
|
3684
|
+
}
|
|
3685
|
+
);
|
|
3686
|
+
}
|
|
3687
|
+
function li(fe) {
|
|
3688
|
+
const {
|
|
3689
|
+
data: o,
|
|
3690
|
+
graphTitle: g,
|
|
3691
|
+
colors: G,
|
|
3692
|
+
sources: I,
|
|
3693
|
+
graphDescription: X,
|
|
3694
|
+
barPadding: me,
|
|
3695
|
+
showTicks: ue,
|
|
3696
|
+
truncateBy: ge,
|
|
3697
|
+
height: Q,
|
|
3698
|
+
width: Y,
|
|
3699
|
+
footNote: ie,
|
|
3700
|
+
colorDomain: D,
|
|
3701
|
+
colorLegendTitle: ne,
|
|
3702
|
+
suffix: he,
|
|
3703
|
+
prefix: j,
|
|
3704
|
+
showValues: _,
|
|
3705
|
+
padding: U,
|
|
3706
|
+
backgroundColor: Z,
|
|
3707
|
+
leftMargin: C,
|
|
3708
|
+
rightMargin: p,
|
|
3709
|
+
topMargin: F,
|
|
3710
|
+
bottomMargin: ae,
|
|
3711
|
+
showLabels: le,
|
|
3712
|
+
relativeHeight: J,
|
|
3713
|
+
tooltip: ee,
|
|
3714
|
+
onSeriesMouseOver: re,
|
|
3715
|
+
refValues: E,
|
|
3716
|
+
graphID: xe,
|
|
3717
|
+
maxValue: de,
|
|
3718
|
+
minValue: z,
|
|
3719
|
+
onSeriesMouseClick: y,
|
|
3720
|
+
graphDownload: x,
|
|
3721
|
+
dataDownload: w,
|
|
3722
|
+
language: T,
|
|
3723
|
+
labelOrder: N,
|
|
3724
|
+
minHeight: $,
|
|
3725
|
+
theme: L,
|
|
3726
|
+
maxBarThickness: B,
|
|
3727
|
+
ariaLabel: b,
|
|
3728
|
+
resetSelectionOnDoubleClick: v,
|
|
3729
|
+
detailsOnClick: R,
|
|
3730
|
+
barAxisTitle: V,
|
|
3731
|
+
noOfTicks: A,
|
|
3732
|
+
valueColor: ce,
|
|
3733
|
+
orientation: W = "vertical",
|
|
3734
|
+
styles: H,
|
|
3735
|
+
classNames: se,
|
|
3736
|
+
filterNA: M,
|
|
3737
|
+
animate: P,
|
|
3738
|
+
precision: m,
|
|
3739
|
+
customLayers: k,
|
|
3740
|
+
showColorScale: f,
|
|
3741
|
+
timeline: d,
|
|
3742
|
+
naLabel: u
|
|
3743
|
+
} = fe;
|
|
3744
|
+
return W === "vertical" ? /* @__PURE__ */ e.jsx(
|
|
3745
|
+
vt,
|
|
3746
|
+
{
|
|
3747
|
+
data: o,
|
|
3748
|
+
graphTitle: g,
|
|
3749
|
+
colors: G,
|
|
3750
|
+
sources: I,
|
|
3751
|
+
graphDescription: X,
|
|
3752
|
+
barPadding: me,
|
|
3753
|
+
showTicks: ue,
|
|
3754
|
+
truncateBy: ge,
|
|
3755
|
+
height: Q,
|
|
3756
|
+
width: Y,
|
|
3757
|
+
footNote: ie,
|
|
3758
|
+
colorDomain: D,
|
|
3759
|
+
colorLegendTitle: ne,
|
|
3760
|
+
suffix: he,
|
|
3761
|
+
prefix: j,
|
|
3762
|
+
showValues: _,
|
|
3763
|
+
padding: U,
|
|
3764
|
+
backgroundColor: Z,
|
|
3765
|
+
leftMargin: C,
|
|
3766
|
+
rightMargin: p,
|
|
3767
|
+
topMargin: F,
|
|
3768
|
+
bottomMargin: ae,
|
|
3769
|
+
showLabels: le,
|
|
3770
|
+
relativeHeight: J,
|
|
3771
|
+
tooltip: ee,
|
|
3772
|
+
onSeriesMouseOver: re,
|
|
3773
|
+
refValues: E,
|
|
3774
|
+
graphID: xe,
|
|
3775
|
+
maxValue: de,
|
|
3776
|
+
minValue: z,
|
|
3777
|
+
onSeriesMouseClick: y,
|
|
3778
|
+
graphDownload: x,
|
|
3779
|
+
dataDownload: w,
|
|
3780
|
+
language: T,
|
|
3781
|
+
labelOrder: N,
|
|
3782
|
+
minHeight: $,
|
|
3783
|
+
theme: L,
|
|
3784
|
+
maxBarThickness: B,
|
|
3785
|
+
ariaLabel: b,
|
|
3786
|
+
resetSelectionOnDoubleClick: v,
|
|
3787
|
+
styles: H,
|
|
3788
|
+
detailsOnClick: R,
|
|
3789
|
+
barAxisTitle: V,
|
|
3790
|
+
noOfTicks: A,
|
|
3791
|
+
valueColor: ce,
|
|
3792
|
+
classNames: se,
|
|
3793
|
+
filterNA: M,
|
|
3794
|
+
animate: P,
|
|
3795
|
+
precision: m,
|
|
3796
|
+
customLayers: k,
|
|
3797
|
+
showColorScale: f,
|
|
3798
|
+
timeline: d,
|
|
3799
|
+
naLabel: u
|
|
3800
|
+
}
|
|
3801
|
+
) : /* @__PURE__ */ e.jsx(
|
|
3802
|
+
gt,
|
|
3803
|
+
{
|
|
3804
|
+
data: o,
|
|
3805
|
+
graphTitle: g,
|
|
3806
|
+
colors: G,
|
|
3807
|
+
sources: I,
|
|
3808
|
+
graphDescription: X,
|
|
3809
|
+
barPadding: me,
|
|
3810
|
+
showTicks: ue,
|
|
3811
|
+
truncateBy: ge,
|
|
3812
|
+
height: Q,
|
|
3813
|
+
width: Y,
|
|
3814
|
+
footNote: ie,
|
|
3815
|
+
colorDomain: D,
|
|
3816
|
+
colorLegendTitle: ne,
|
|
3817
|
+
suffix: he,
|
|
3818
|
+
prefix: j,
|
|
3819
|
+
showValues: _,
|
|
3820
|
+
padding: U,
|
|
3821
|
+
backgroundColor: Z,
|
|
3822
|
+
leftMargin: C,
|
|
3823
|
+
rightMargin: p,
|
|
3824
|
+
topMargin: F,
|
|
3825
|
+
bottomMargin: ae,
|
|
3826
|
+
showLabels: le,
|
|
3827
|
+
relativeHeight: J,
|
|
3828
|
+
tooltip: ee,
|
|
3829
|
+
onSeriesMouseOver: re,
|
|
3830
|
+
refValues: E,
|
|
3831
|
+
graphID: xe,
|
|
3832
|
+
maxValue: de,
|
|
3833
|
+
minValue: z,
|
|
3834
|
+
onSeriesMouseClick: y,
|
|
3835
|
+
graphDownload: x,
|
|
3836
|
+
dataDownload: w,
|
|
3837
|
+
language: T,
|
|
3838
|
+
labelOrder: N,
|
|
3839
|
+
minHeight: $,
|
|
3840
|
+
theme: L,
|
|
3841
|
+
maxBarThickness: B,
|
|
3842
|
+
ariaLabel: b,
|
|
3843
|
+
resetSelectionOnDoubleClick: v,
|
|
3844
|
+
styles: H,
|
|
3845
|
+
detailsOnClick: R,
|
|
3846
|
+
barAxisTitle: V,
|
|
3847
|
+
noOfTicks: A,
|
|
3848
|
+
valueColor: ce,
|
|
3849
|
+
classNames: se,
|
|
3850
|
+
filterNA: M,
|
|
3851
|
+
animate: P,
|
|
3852
|
+
precision: m,
|
|
3853
|
+
customLayers: k,
|
|
3854
|
+
showColorScale: f,
|
|
3855
|
+
timeline: d,
|
|
3856
|
+
naLabel: u
|
|
3857
|
+
}
|
|
3858
|
+
);
|
|
3859
|
+
}
|
|
3860
|
+
function si(fe) {
|
|
3861
|
+
const {
|
|
3862
|
+
data: o,
|
|
3863
|
+
graphTitle: g,
|
|
3864
|
+
colors: G,
|
|
3865
|
+
sources: I,
|
|
3866
|
+
graphDescription: X,
|
|
3867
|
+
barPadding: me,
|
|
3868
|
+
showTicks: ue,
|
|
3869
|
+
leftMargin: ge,
|
|
3870
|
+
rightMargin: Q,
|
|
3871
|
+
topMargin: Y,
|
|
3872
|
+
bottomMargin: ie,
|
|
3873
|
+
truncateBy: D,
|
|
3874
|
+
showLabels: ne,
|
|
3875
|
+
showValues: he,
|
|
3876
|
+
backgroundColor: j,
|
|
3877
|
+
suffix: _,
|
|
3878
|
+
prefix: U,
|
|
3879
|
+
height: Z,
|
|
3880
|
+
width: C,
|
|
3881
|
+
footNote: p,
|
|
3882
|
+
colorDomain: F,
|
|
3883
|
+
colorLegendTitle: ae,
|
|
3884
|
+
padding: le,
|
|
3885
|
+
tooltip: J,
|
|
3886
|
+
onSeriesMouseOver: ee,
|
|
3887
|
+
relativeHeight: re,
|
|
3888
|
+
refValues: E,
|
|
3889
|
+
graphID: xe,
|
|
3890
|
+
maxValue: de,
|
|
3891
|
+
onSeriesMouseClick: z,
|
|
3892
|
+
graphDownload: y,
|
|
3893
|
+
dataDownload: x,
|
|
3894
|
+
language: w,
|
|
3895
|
+
theme: T,
|
|
3896
|
+
labelOrder: N,
|
|
3897
|
+
minHeight: $,
|
|
3898
|
+
maxBarThickness: L,
|
|
3899
|
+
sortParameter: B,
|
|
3900
|
+
maxNumberOfBars: b,
|
|
3901
|
+
minBarThickness: v,
|
|
3902
|
+
ariaLabel: R,
|
|
3903
|
+
resetSelectionOnDoubleClick: V,
|
|
3904
|
+
detailsOnClick: A,
|
|
3905
|
+
barAxisTitle: ce,
|
|
3906
|
+
noOfTicks: W,
|
|
3907
|
+
valueColor: H,
|
|
3908
|
+
orientation: se = "vertical",
|
|
3909
|
+
styles: M,
|
|
3910
|
+
classNames: P,
|
|
3911
|
+
filterNA: m,
|
|
3912
|
+
animate: k,
|
|
3913
|
+
precision: f,
|
|
3914
|
+
customLayers: d,
|
|
3915
|
+
showColorScale: u,
|
|
3916
|
+
timeline: n,
|
|
3917
|
+
naLabel: a
|
|
3918
|
+
} = fe;
|
|
3919
|
+
return se === "vertical" ? /* @__PURE__ */ e.jsx(
|
|
3920
|
+
Ct,
|
|
3921
|
+
{
|
|
3922
|
+
data: o,
|
|
3923
|
+
graphTitle: g,
|
|
3924
|
+
colors: G,
|
|
3925
|
+
sources: I,
|
|
3926
|
+
graphDescription: X,
|
|
3927
|
+
barPadding: me,
|
|
3928
|
+
showTicks: ue,
|
|
3929
|
+
leftMargin: ge,
|
|
3930
|
+
rightMargin: Q,
|
|
3931
|
+
topMargin: Y,
|
|
3932
|
+
bottomMargin: ie,
|
|
3933
|
+
truncateBy: D,
|
|
3934
|
+
showLabels: ne,
|
|
3935
|
+
showValues: he,
|
|
3936
|
+
backgroundColor: j,
|
|
3937
|
+
suffix: _,
|
|
3938
|
+
prefix: U,
|
|
3939
|
+
height: Z,
|
|
3940
|
+
width: C,
|
|
3941
|
+
footNote: p,
|
|
3942
|
+
colorDomain: F,
|
|
3943
|
+
colorLegendTitle: ae,
|
|
3944
|
+
padding: le,
|
|
3945
|
+
tooltip: J,
|
|
3946
|
+
onSeriesMouseOver: ee,
|
|
3947
|
+
relativeHeight: re,
|
|
3948
|
+
refValues: E,
|
|
3949
|
+
graphID: xe,
|
|
3950
|
+
maxValue: de,
|
|
3951
|
+
onSeriesMouseClick: z,
|
|
3952
|
+
graphDownload: y,
|
|
3953
|
+
dataDownload: x,
|
|
3954
|
+
language: w,
|
|
3955
|
+
theme: T,
|
|
3956
|
+
labelOrder: N,
|
|
3957
|
+
minHeight: $,
|
|
3958
|
+
maxBarThickness: L,
|
|
3959
|
+
sortParameter: B,
|
|
3960
|
+
maxNumberOfBars: b,
|
|
3961
|
+
minBarThickness: v,
|
|
3962
|
+
ariaLabel: R,
|
|
3963
|
+
resetSelectionOnDoubleClick: V,
|
|
3964
|
+
styles: M,
|
|
3965
|
+
detailsOnClick: A,
|
|
3966
|
+
barAxisTitle: ce,
|
|
3967
|
+
noOfTicks: W,
|
|
3968
|
+
valueColor: H,
|
|
3969
|
+
classNames: P,
|
|
3970
|
+
filterNA: m,
|
|
3971
|
+
animate: k,
|
|
3972
|
+
precision: f,
|
|
3973
|
+
customLayers: d,
|
|
3974
|
+
showColorScale: u,
|
|
3975
|
+
timeline: n,
|
|
3976
|
+
naLabel: a
|
|
3977
|
+
}
|
|
3978
|
+
) : /* @__PURE__ */ e.jsx(
|
|
3979
|
+
pt,
|
|
3980
|
+
{
|
|
3981
|
+
data: o,
|
|
3982
|
+
graphTitle: g,
|
|
3983
|
+
colors: G,
|
|
3984
|
+
sources: I,
|
|
3985
|
+
graphDescription: X,
|
|
3986
|
+
barPadding: me,
|
|
3987
|
+
showTicks: ue,
|
|
3988
|
+
leftMargin: ge,
|
|
3989
|
+
rightMargin: Q,
|
|
3990
|
+
topMargin: Y,
|
|
3991
|
+
bottomMargin: ie,
|
|
3992
|
+
truncateBy: D,
|
|
3993
|
+
showLabels: ne,
|
|
3994
|
+
showValues: he,
|
|
3995
|
+
backgroundColor: j,
|
|
3996
|
+
suffix: _,
|
|
3997
|
+
prefix: U,
|
|
3998
|
+
height: Z,
|
|
3999
|
+
width: C,
|
|
4000
|
+
footNote: p,
|
|
4001
|
+
colorDomain: F,
|
|
4002
|
+
colorLegendTitle: ae,
|
|
4003
|
+
padding: le,
|
|
4004
|
+
tooltip: J,
|
|
4005
|
+
onSeriesMouseOver: ee,
|
|
4006
|
+
relativeHeight: re,
|
|
4007
|
+
refValues: E,
|
|
4008
|
+
graphID: xe,
|
|
4009
|
+
maxValue: de,
|
|
4010
|
+
onSeriesMouseClick: z,
|
|
4011
|
+
graphDownload: y,
|
|
4012
|
+
dataDownload: x,
|
|
4013
|
+
language: w,
|
|
4014
|
+
theme: T,
|
|
4015
|
+
labelOrder: N,
|
|
4016
|
+
minHeight: $,
|
|
4017
|
+
maxBarThickness: L,
|
|
4018
|
+
sortParameter: B,
|
|
4019
|
+
maxNumberOfBars: b,
|
|
4020
|
+
minBarThickness: v,
|
|
4021
|
+
ariaLabel: R,
|
|
4022
|
+
resetSelectionOnDoubleClick: V,
|
|
4023
|
+
styles: M,
|
|
4024
|
+
detailsOnClick: A,
|
|
4025
|
+
barAxisTitle: ce,
|
|
4026
|
+
noOfTicks: W,
|
|
4027
|
+
valueColor: H,
|
|
4028
|
+
classNames: P,
|
|
4029
|
+
filterNA: m,
|
|
4030
|
+
animate: k,
|
|
4031
|
+
precision: f,
|
|
4032
|
+
customLayers: d,
|
|
4033
|
+
showColorScale: u,
|
|
4034
|
+
timeline: n,
|
|
4035
|
+
naLabel: a
|
|
4036
|
+
}
|
|
4037
|
+
);
|
|
4038
|
+
}
|
|
4039
|
+
export {
|
|
4040
|
+
li as GroupedBarGraph,
|
|
4041
|
+
ai as SimpleBarGraph,
|
|
4042
|
+
si as StackedBarGraph
|
|
4043
|
+
};
|
|
2
4044
|
//# sourceMappingURL=BarGraph.js.map
|