@undp/data-viz 1.2.8 → 1.3.0
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.d.ts +224 -0
- package/dist/AreaChart.js +2 -0
- package/dist/AreaChart.js.map +1 -0
- package/dist/Axis-BlyBRMNw.cjs +2 -0
- package/dist/Axis-BlyBRMNw.cjs.map +1 -0
- package/dist/Axis-CvK-w3E2.js +44 -0
- package/dist/Axis-CvK-w3E2.js.map +1 -0
- package/dist/AxisTitle-BY8MI9jC.cjs +2 -0
- package/dist/AxisTitle-BY8MI9jC.cjs.map +1 -0
- package/dist/AxisTitle-BeMxcw5I.js +21 -0
- package/dist/AxisTitle-BeMxcw5I.js.map +1 -0
- package/dist/BarGraph.d.ts +460 -0
- package/dist/BarGraph.js +2 -0
- package/dist/BarGraph.js.map +1 -0
- package/dist/BasicStatCard.d.ts +106 -0
- package/dist/BasicStatCard.js +2 -0
- package/dist/BasicStatCard.js.map +1 -0
- package/dist/BeeSwarmChart.d.ts +189 -0
- package/dist/BeeSwarmChart.js +2 -0
- package/dist/BeeSwarmChart.js.map +1 -0
- package/dist/BiVariateChoroplethMap.d.ts +189 -0
- package/dist/BiVariateChoroplethMap.js +2 -0
- package/dist/BiVariateChoroplethMap.js.map +1 -0
- package/dist/BulletChart.d.ts +219 -0
- package/dist/BulletChart.js +2 -0
- package/dist/BulletChart.js.map +1 -0
- package/dist/ButterflyChart.d.ts +201 -0
- package/dist/ButterflyChart.js +2 -0
- package/dist/ButterflyChart.js.map +1 -0
- package/dist/ChoroplethMap.d.ts +190 -0
- package/dist/ChoroplethMap.js +2 -0
- package/dist/ChoroplethMap.js.map +1 -0
- package/dist/CirclePackingGraph.d.ts +161 -0
- package/dist/CirclePackingGraph.js +2 -0
- package/dist/CirclePackingGraph.js.map +1 -0
- package/dist/ColorLegend.d.ts +17 -0
- package/dist/ColorLegend.js +2 -0
- package/dist/ColorLegend.js.map +1 -0
- package/dist/ColorLegendWithMouseOver.d.ts +16 -0
- package/dist/ColorLegendWithMouseOver.js +2 -0
- package/dist/ColorLegendWithMouseOver.js.map +1 -0
- package/dist/Colors.d.ts +174 -0
- package/dist/Colors.js +2 -0
- package/dist/Colors.js.map +1 -0
- package/dist/CopyTextButton.d.ts +13 -0
- package/dist/CopyTextButton.js +17 -0
- package/dist/CopyTextButton.js.map +1 -0
- package/dist/CsvDownloadButton.d.ts +22 -0
- package/dist/CsvDownloadButton.js +23 -0
- package/dist/CsvDownloadButton.js.map +1 -0
- package/dist/DataCards.d.ts +131 -0
- package/dist/DataCards.js +2 -0
- package/dist/DataCards.js.map +1 -0
- package/dist/DataTable.d.ts +122 -0
- package/dist/DataTable.js +2 -0
- package/dist/DataTable.js.map +1 -0
- package/dist/DifferenceLineChart.d.ts +237 -0
- package/dist/DifferenceLineChart.js +2 -0
- package/dist/DifferenceLineChart.js.map +1 -0
- package/dist/DonutChart.d.ts +148 -0
- package/dist/DonutChart.js +2 -0
- package/dist/DonutChart.js.map +1 -0
- package/dist/DotDensityMap.d.ts +191 -0
- package/dist/DotDensityMap.js +2 -0
- package/dist/DotDensityMap.js.map +1 -0
- package/dist/DropdownSelect-CuzV7gdj.cjs +29 -0
- package/dist/DropdownSelect-CuzV7gdj.cjs.map +1 -0
- package/dist/DropdownSelect-DmZsXrhY.js +2698 -0
- package/dist/DropdownSelect-DmZsXrhY.js.map +1 -0
- package/dist/DualAxisLineChart.d.ts +180 -0
- package/dist/DualAxisLineChart.js +2 -0
- package/dist/DualAxisLineChart.js.map +1 -0
- package/dist/DumbbellChart.d.ts +224 -0
- package/dist/DumbbellChart.js +2 -0
- package/dist/DumbbellChart.js.map +1 -0
- package/dist/EmptyState-BQguKAp5.cjs +2 -0
- package/dist/EmptyState-BQguKAp5.cjs.map +1 -0
- package/dist/EmptyState-b2Ln487i.js +22 -0
- package/dist/EmptyState-b2Ln487i.js.map +1 -0
- package/dist/ExcelDownloadButton.d.ts +22 -0
- package/dist/ExcelDownloadButton.js +2 -0
- package/dist/ExcelDownloadButton.js.map +1 -0
- package/dist/FootNote.d.ts +12 -0
- package/dist/FootNote.js +2 -0
- package/dist/FootNote.js.map +1 -0
- package/dist/GeoHubCompareMaps.d.ts +103 -0
- package/dist/GeoHubCompareMaps.js +2 -0
- package/dist/GeoHubCompareMaps.js.map +1 -0
- package/dist/GeoHubMap.d.ts +118 -0
- package/dist/GeoHubMap.js +2 -0
- package/dist/GeoHubMap.js.map +1 -0
- package/dist/GeoHubMapWithLayerSelection.d.ts +117 -0
- package/dist/GeoHubMapWithLayerSelection.js +2 -0
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -0
- package/dist/GraphDescription.d.ts +12 -0
- package/dist/GraphDescription.js +2 -0
- package/dist/GraphDescription.js.map +1 -0
- package/dist/GraphFooter.d.ts +24 -0
- package/dist/GraphFooter.js +2 -0
- package/dist/GraphFooter.js.map +1 -0
- package/dist/GraphHeader.d.ts +22 -0
- package/dist/GraphHeader.js +2 -0
- package/dist/GraphHeader.js.map +1 -0
- package/dist/GraphTitle.d.ts +13 -0
- package/dist/GraphTitle.js +2 -0
- package/dist/GraphTitle.js.map +1 -0
- package/dist/GriddedGraphs.d.ts +540 -0
- package/dist/GriddedGraphs.js +2 -0
- package/dist/GriddedGraphs.js.map +1 -0
- package/dist/GriddedGraphsFromConfig.d.ts +543 -0
- package/dist/GriddedGraphsFromConfig.js +2 -0
- package/dist/GriddedGraphsFromConfig.js.map +1 -0
- package/dist/HeatMap.d.ts +166 -0
- package/dist/HeatMap.js +2 -0
- package/dist/HeatMap.js.map +1 -0
- package/dist/Histogram.d.ts +165 -0
- package/dist/Histogram.js +2 -0
- package/dist/Histogram.js.map +1 -0
- package/dist/ImageDownloadButton.d.ts +15 -0
- package/dist/ImageDownloadButton.js +2 -0
- package/dist/ImageDownloadButton.js.map +1 -0
- package/dist/LineChartWithConfidenceInterval.d.ts +250 -0
- package/dist/LineChartWithConfidenceInterval.js +2 -0
- package/dist/LineChartWithConfidenceInterval.js.map +1 -0
- package/dist/LinearColorLegend.d.ts +13 -0
- package/dist/LinearColorLegend.js +2 -0
- package/dist/LinearColorLegend.js.map +1 -0
- package/dist/Modal-C9txyGOk.js +723 -0
- package/dist/Modal-C9txyGOk.js.map +1 -0
- package/dist/Modal-cQF2UQIa.cjs +46 -0
- package/dist/Modal-cQF2UQIa.cjs.map +1 -0
- package/dist/MultiGraphDashboard.d.ts +558 -0
- package/dist/MultiGraphDashboard.js +2 -0
- package/dist/MultiGraphDashboard.js.map +1 -0
- package/dist/MultiGraphDashboardFromConfig.d.ts +562 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -0
- package/dist/MultiGraphDashboardFromConfig.js.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormat.d.ts +128 -0
- package/dist/MultiGraphDashboardWideToLongFormat.js +2 -0
- package/dist/MultiGraphDashboardWideToLongFormat.js.map +1 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.d.ts +133 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -0
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js.map +1 -0
- package/dist/MultiLineAltChart.d.ts +244 -0
- package/dist/MultiLineAltChart.js +2 -0
- package/dist/MultiLineAltChart.js.map +1 -0
- package/dist/MultiLineChart.d.ts +246 -0
- package/dist/MultiLineChart.js +2 -0
- package/dist/MultiLineChart.js.map +1 -0
- package/dist/ParetoChart.d.ts +178 -0
- package/dist/ParetoChart.js +2 -0
- package/dist/ParetoChart.js.map +1 -0
- package/dist/RadarChart.d.ts +176 -0
- package/dist/RadarChart.js +2 -0
- package/dist/RadarChart.js.map +1 -0
- package/dist/ReferenceLine-BgDdQbDI.js +129 -0
- package/dist/ReferenceLine-BgDdQbDI.js.map +1 -0
- package/dist/ReferenceLine-Bsb5jeE4.cjs +2 -0
- package/dist/ReferenceLine-Bsb5jeE4.cjs.map +1 -0
- package/dist/RegressionLine-BfpCuD7B.cjs +2 -0
- package/dist/RegressionLine-BfpCuD7B.cjs.map +1 -0
- package/dist/RegressionLine-cSljpHaE.js +49 -0
- package/dist/RegressionLine-cSljpHaE.js.map +1 -0
- package/dist/SVGDownloadButton.d.ts +15 -0
- package/dist/SVGDownloadButton.js +2 -0
- package/dist/SVGDownloadButton.js.map +1 -0
- package/dist/SankeyChart.d.ts +178 -0
- package/dist/SankeyChart.js +2 -0
- package/dist/SankeyChart.js.map +1 -0
- package/dist/ScatterPlot.d.ts +266 -0
- package/dist/ScatterPlot.js +2 -0
- package/dist/ScatterPlot.js.map +1 -0
- package/dist/ScrollStory.d.ts +491 -0
- package/dist/ScrollStory.js +2 -0
- package/dist/ScrollStory.js.map +1 -0
- package/dist/SimpleLineChart.d.ts +230 -0
- package/dist/SimpleLineChart.js +2 -0
- package/dist/SimpleLineChart.js.map +1 -0
- package/dist/SingleGraphDashboard.d.ts +545 -0
- package/dist/SingleGraphDashboard.js +2 -0
- package/dist/SingleGraphDashboard.js.map +1 -0
- package/dist/SingleGraphDashboardFromConfig.d.ts +547 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -0
- package/dist/SingleGraphDashboardFromConfig.js.map +1 -0
- package/dist/SlopeChart.d.ts +167 -0
- package/dist/SlopeChart.js +2 -0
- package/dist/SlopeChart.js.map +1 -0
- package/dist/Source.d.ts +16 -0
- package/dist/Source.js +2 -0
- package/dist/Source.js.map +1 -0
- package/dist/SparkLine.d.ts +139 -0
- package/dist/SparkLine.js +2 -0
- package/dist/SparkLine.js.map +1 -0
- package/dist/Spinner-DN3s4S0H.js +17 -0
- package/dist/Spinner-DN3s4S0H.js.map +1 -0
- package/dist/Spinner-UmN-KPe9.cjs +2 -0
- package/dist/Spinner-UmN-KPe9.cjs.map +1 -0
- package/dist/StatCardFromData.d.ts +115 -0
- package/dist/StatCardFromData.js +2 -0
- package/dist/StatCardFromData.js.map +1 -0
- package/dist/StripChart.d.ts +178 -0
- package/dist/StripChart.js +2 -0
- package/dist/StripChart.js.map +1 -0
- package/dist/ThreeDGlobe.d.ts +158 -0
- package/dist/ThreeDGlobe.js +2 -0
- package/dist/ThreeDGlobe.js.map +1 -0
- package/dist/ThresholdColorLegendWithMouseOver.d.ts +16 -0
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -0
- package/dist/ThresholdColorLegendWithMouseOver.js.map +1 -0
- package/dist/Tooltip-BM18N_3l.cjs +2 -0
- package/dist/Tooltip-BM18N_3l.cjs.map +1 -0
- package/dist/Tooltip-CzZ1wFyF.js +47 -0
- package/dist/Tooltip-CzZ1wFyF.js.map +1 -0
- package/dist/TreeMapGraph.d.ts +158 -0
- package/dist/TreeMapGraph.js +2 -0
- package/dist/TreeMapGraph.js.map +1 -0
- package/dist/Types.d.ts +883 -0
- package/dist/Types.js +2 -0
- package/dist/Types.js.map +1 -0
- package/dist/Typography-CDR-DAHH.cjs +2 -0
- package/dist/Typography-CDR-DAHH.cjs.map +1 -0
- package/dist/Typography-XJoSE-By.js +58 -0
- package/dist/Typography-XJoSE-By.js.map +1 -0
- package/dist/UnitChart.d.ts +132 -0
- package/dist/UnitChart.js +2 -0
- package/dist/UnitChart.js.map +1 -0
- package/dist/XAxesLabels-C9REbQQs.cjs +2 -0
- package/dist/XAxesLabels-C9REbQQs.cjs.map +1 -0
- package/dist/XAxesLabels-DVw7Lvuz.js +58 -0
- package/dist/XAxesLabels-DVw7Lvuz.js.map +1 -0
- package/dist/XTicksAndGridLines-CUefTINd.js +57 -0
- package/dist/XTicksAndGridLines-CUefTINd.js.map +1 -0
- package/dist/XTicksAndGridLines-DuK35ROS.cjs +2 -0
- package/dist/XTicksAndGridLines-DuK35ROS.cjs.map +1 -0
- package/dist/YAxesLabels-CYVY053X.js +53 -0
- package/dist/YAxesLabels-CYVY053X.js.map +1 -0
- package/dist/YAxesLabels-DhBdLk3Z.cjs +2 -0
- package/dist/YAxesLabels-DhBdLk3Z.cjs.map +1 -0
- package/dist/YTicksAndGridLines-BJRXuBdC.js +57 -0
- package/dist/YTicksAndGridLines-BJRXuBdC.js.map +1 -0
- package/dist/YTicksAndGridLines-CtLvzExe.cjs +2 -0
- package/dist/YTicksAndGridLines-CtLvzExe.cjs.map +1 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs +2 -0
- package/dist/_commonjsHelpers-DKOUU3wS.cjs.map +1 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
- package/dist/area-BE2wo7fv.js +53 -0
- package/dist/area-BE2wo7fv.js.map +1 -0
- package/dist/area-D3Qx7k7K.cjs +2 -0
- package/dist/area-D3Qx7k7K.cjs.map +1 -0
- package/dist/array-B7TkkRH0.js +89 -0
- package/dist/array-B7TkkRH0.js.map +1 -0
- package/dist/array-DKbXV8lR.cjs +2 -0
- package/dist/array-DKbXV8lR.cjs.map +1 -0
- package/dist/band-BEjh2CHI.js +47 -0
- package/dist/band-BEjh2CHI.js.map +1 -0
- package/dist/band-CAApY4Pd.cjs +2 -0
- package/dist/band-CAApY4Pd.cjs.map +1 -0
- package/dist/checkIfMultiple-CaefP4X2.js +2264 -0
- package/dist/checkIfMultiple-CaefP4X2.js.map +1 -0
- package/dist/checkIfMultiple-D3h8to1T.cjs +12 -0
- package/dist/checkIfMultiple-D3h8to1T.cjs.map +1 -0
- package/dist/checkIfNullOrUndefined.d.ts +15 -0
- package/dist/checkIfNullOrUndefined.js +2 -0
- package/dist/checkIfNullOrUndefined.js.map +1 -0
- package/dist/customArea-B47Ew5cT.cjs +2 -0
- package/dist/customArea-B47Ew5cT.cjs.map +1 -0
- package/dist/customArea-I3MsoqIl.js +176 -0
- package/dist/customArea-I3MsoqIl.js.map +1 -0
- package/dist/defaultLocale-BEa-49Qz.js +172 -0
- package/dist/defaultLocale-BEa-49Qz.js.map +1 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs +2 -0
- package/dist/defaultLocale-DIVzfLaQ.cjs.map +1 -0
- package/dist/delaunay-C1uAf38t.js +684 -0
- package/dist/delaunay-C1uAf38t.js.map +1 -0
- package/dist/delaunay-rcy0HhZi.cjs +2 -0
- package/dist/delaunay-rcy0HhZi.cjs.map +1 -0
- package/dist/ensureCompleteData-BBDZbDCE.js +102 -0
- package/dist/ensureCompleteData-BBDZbDCE.js.map +1 -0
- package/dist/ensureCompleteData-DqWQ2Zbi.cjs +2 -0
- package/dist/ensureCompleteData-DqWQ2Zbi.cjs.map +1 -0
- package/dist/excelDownload.d.ts +31 -0
- package/dist/excelDownload.js +2 -0
- package/dist/excelDownload.js.map +1 -0
- package/dist/fetchAndParseData.d.ts +84 -0
- package/dist/fetchAndParseData.js +16 -0
- package/dist/fetchAndParseData.js.map +1 -0
- package/dist/filterData-B8ocT57s.js +14 -0
- package/dist/filterData-B8ocT57s.js.map +1 -0
- package/dist/filterData-DN6py7y_.cjs +2 -0
- package/dist/filterData-DN6py7y_.cjs.map +1 -0
- package/dist/generateCodes.d.ts +25 -0
- package/dist/generateCodes.js +2 -0
- package/dist/generateCodes.js.map +1 -0
- package/dist/generateRandomString-B5zBiJzS.cjs +2 -0
- package/dist/generateRandomString-B5zBiJzS.cjs.map +1 -0
- package/dist/generateRandomString-za3IQGfQ.js +11 -0
- package/dist/generateRandomString-za3IQGfQ.js.map +1 -0
- package/dist/getJenks.d.ts +17 -0
- package/dist/getJenks.js +2 -0
- package/dist/getJenks.js.map +1 -0
- package/dist/getPercentileValue.d.ts +13 -0
- package/dist/getPercentileValue.js +2 -0
- package/dist/getPercentileValue.js.map +1 -0
- package/dist/getQueryParamsFromLink.d.ts +18 -0
- package/dist/getQueryParamsFromLink.js +2 -0
- package/dist/getQueryParamsFromLink.js.map +1 -0
- package/dist/getSchema.d.ts +3256 -0
- package/dist/getSchema.js +2 -0
- package/dist/getSchema.js.map +1 -0
- package/dist/getSliderMarks-CWajGCGq.js +719 -0
- package/dist/getSliderMarks-CWajGCGq.js.map +1 -0
- package/dist/getSliderMarks-DDJ1CdhL.cjs +6 -0
- package/dist/getSliderMarks-DDJ1CdhL.cjs.map +1 -0
- package/dist/getTextColorBasedOnBgColor.d.ts +13 -0
- package/dist/getTextColorBasedOnBgColor.js +2 -0
- package/dist/getTextColorBasedOnBgColor.js.map +1 -0
- package/dist/getUniqValue.d.ts +18 -0
- package/dist/getUniqValue.js +2 -0
- package/dist/getUniqValue.js.map +1 -0
- package/dist/graphList.d.ts +9 -0
- package/dist/graphList.js +2 -0
- package/dist/graphList.js.map +1 -0
- package/dist/imageDownload.d.ts +16 -0
- package/dist/imageDownload.js +3 -0
- package/dist/imageDownload.js.map +1 -0
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs +2 -0
- package/dist/index-01r5X3Gr-9jE0ObrK.cjs.map +1 -0
- package/dist/index-01r5X3Gr-kH7FxQ7P.js +451 -0
- package/dist/index-01r5X3Gr-kH7FxQ7P.js.map +1 -0
- package/dist/index-27yTRcko.js +35 -0
- package/dist/index-27yTRcko.js.map +1 -0
- package/dist/index-B0rbzOoC.cjs +2 -0
- package/dist/index-B0rbzOoC.cjs.map +1 -0
- package/dist/index-BGMGC-HN.cjs +22 -0
- package/dist/index-BGMGC-HN.cjs.map +1 -0
- package/dist/index-BHm2KTjD-2e-Fu8L-.js +702 -0
- package/dist/index-BHm2KTjD-2e-Fu8L-.js.map +1 -0
- package/dist/index-BHm2KTjD-D8FylaKc.cjs +44 -0
- package/dist/index-BHm2KTjD-D8FylaKc.cjs.map +1 -0
- package/dist/index-BIPNFFja.js +506 -0
- package/dist/index-BIPNFFja.js.map +1 -0
- package/dist/index-BLizQDlg.js +658 -0
- package/dist/index-BLizQDlg.js.map +1 -0
- package/dist/index-BXns0-ng.cjs +2 -0
- package/dist/index-BXns0-ng.cjs.map +1 -0
- package/dist/index-BYroABPm.cjs +2 -0
- package/dist/index-BYroABPm.cjs.map +1 -0
- package/dist/index-BczVvEBZ.cjs +2 -0
- package/dist/index-BczVvEBZ.cjs.map +1 -0
- package/dist/index-BzeLQvXk.cjs +2 -0
- package/dist/index-BzeLQvXk.cjs.map +1 -0
- package/dist/index-C1rRk_50.js +273 -0
- package/dist/index-C1rRk_50.js.map +1 -0
- package/dist/index-C21TvELx.cjs +2 -0
- package/dist/index-C21TvELx.cjs.map +1 -0
- package/dist/index-CEc_9zWy.cjs +2 -0
- package/dist/index-CEc_9zWy.cjs.map +1 -0
- package/dist/index-CZbIGs8q.cjs +2 -0
- package/dist/index-CZbIGs8q.cjs.map +1 -0
- package/dist/index-CaAIPGZo.js +631 -0
- package/dist/index-CaAIPGZo.js.map +1 -0
- package/dist/index-CbVeVrla.cjs +2 -0
- package/dist/index-CbVeVrla.cjs.map +1 -0
- package/dist/index-CqzhBPuO-CfQywbdq.js +41 -0
- package/dist/index-CqzhBPuO-CfQywbdq.js.map +1 -0
- package/dist/index-CqzhBPuO-raKZqS7l.cjs +2 -0
- package/dist/index-CqzhBPuO-raKZqS7l.cjs.map +1 -0
- package/dist/index-D7ltPi18.js +26 -0
- package/dist/index-D7ltPi18.js.map +1 -0
- package/dist/index-DSnvdkHZ.js +495 -0
- package/dist/index-DSnvdkHZ.js.map +1 -0
- package/dist/index-DXmF_0ez.js +308 -0
- package/dist/index-DXmF_0ez.js.map +1 -0
- package/dist/index-Db-Yg_Ud.js +120 -0
- package/dist/index-Db-Yg_Ud.js.map +1 -0
- package/dist/index-Ds0uHjK9.cjs +2 -0
- package/dist/index-Ds0uHjK9.cjs.map +1 -0
- package/dist/index-DxagiOHo.js +707 -0
- package/dist/index-DxagiOHo.js.map +1 -0
- package/dist/index-DzdwZ2OA.js +77 -0
- package/dist/index-DzdwZ2OA.js.map +1 -0
- package/dist/index-UV9hjG_S.js +53 -0
- package/dist/index-UV9hjG_S.js.map +1 -0
- package/dist/index-a2C2Bqn2.cjs +10 -0
- package/dist/index-a2C2Bqn2.cjs.map +1 -0
- package/dist/index.js +1 -52488
- package/dist/index.js.map +1 -1
- package/dist/init-BhZylTFx.js +63 -0
- package/dist/init-BhZylTFx.js.map +1 -0
- package/dist/init-DU0ybBc_.cjs +2 -0
- package/dist/init-DU0ybBc_.cjs.map +1 -0
- package/dist/line-CPfhohvF.js +68 -0
- package/dist/line-CPfhohvF.js.map +1 -0
- package/dist/line-DHV4JwCR.cjs +2 -0
- package/dist/line-DHV4JwCR.cjs.map +1 -0
- package/dist/linear-BVckp9RD.cjs +2 -0
- package/dist/linear-BVckp9RD.cjs.map +1 -0
- package/dist/linear-DUdu7l2G.js +221 -0
- package/dist/linear-DUdu7l2G.js.map +1 -0
- package/dist/numberFormattingFunction.d.ts +22 -0
- package/dist/numberFormattingFunction.js +2 -0
- package/dist/numberFormattingFunction.js.map +1 -0
- package/dist/ordinal-BOeNbyae.cjs +2 -0
- package/dist/ordinal-BOeNbyae.cjs.map +1 -0
- package/dist/ordinal-w9Lu4Stb.js +62 -0
- package/dist/ordinal-w9Lu4Stb.js.map +1 -0
- package/dist/parse-DlCRUFh_.js +2768 -0
- package/dist/parse-DlCRUFh_.js.map +1 -0
- package/dist/parse-hMnG_lRV.cjs +2 -0
- package/dist/parse-hMnG_lRV.cjs.map +1 -0
- package/dist/pointer-CWRWOsrb.js +23 -0
- package/dist/pointer-CWRWOsrb.js.map +1 -0
- package/dist/pointer-Dkq5NV1q.cjs +2 -0
- package/dist/pointer-Dkq5NV1q.cjs.map +1 -0
- package/dist/pow-B5-jkdHU.cjs +2 -0
- package/dist/pow-B5-jkdHU.cjs.map +1 -0
- package/dist/pow-e8zx3AQJ.js +35 -0
- package/dist/pow-e8zx3AQJ.js.map +1 -0
- package/dist/removeOutliers.d.ts +16 -0
- package/dist/removeOutliers.js +2 -0
- package/dist/removeOutliers.js.map +1 -0
- package/dist/select-Bnfk0lJx.cjs +2 -0
- package/dist/select-Bnfk0lJx.cjs.map +1 -0
- package/dist/select-DKy99ogv.js +584 -0
- package/dist/select-DKy99ogv.js.map +1 -0
- package/dist/simple-statistics-flVzqVtt.js +65 -0
- package/dist/simple-statistics-flVzqVtt.js.map +1 -0
- package/dist/simple-statistics-xm8c0LQQ.cjs +2 -0
- package/dist/simple-statistics-xm8c0LQQ.cjs.map +1 -0
- package/dist/step-BZ3C8QFW.cjs +2 -0
- package/dist/step-BZ3C8QFW.cjs.map +1 -0
- package/dist/step-BrDul-H4.js +119 -0
- package/dist/step-BrDul-H4.js.map +1 -0
- package/dist/string-B8KlVSPX.js +364 -0
- package/dist/string-B8KlVSPX.js.map +1 -0
- package/dist/string-CRoCZCYa.cjs +2 -0
- package/dist/string-CRoCZCYa.cjs.map +1 -0
- package/dist/string2HTML-BX0oNw83.js +758 -0
- package/dist/string2HTML-BX0oNw83.js.map +1 -0
- package/dist/string2HTML-X4ZYX5jI.cjs +3 -0
- package/dist/string2HTML-X4ZYX5jI.cjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/svgDownload.d.ts +16 -0
- package/dist/svgDownload.js +2 -0
- package/dist/svgDownload.js.map +1 -0
- package/dist/threshold-DFfqcDMa.js +23 -0
- package/dist/threshold-DFfqcDMa.js.map +1 -0
- package/dist/threshold-DNsSUf8Q.cjs +2 -0
- package/dist/threshold-DNsSUf8Q.cjs.map +1 -0
- package/dist/time-Byw_jYQ7.cjs +2 -0
- package/dist/time-Byw_jYQ7.cjs.map +1 -0
- package/dist/time-BzJP5SPC.js +715 -0
- package/dist/time-BzJP5SPC.js.map +1 -0
- package/dist/timer-B39XOBYL.js +124 -0
- package/dist/timer-B39XOBYL.js.map +1 -0
- package/dist/timer-CKyBCVzT.cjs +2 -0
- package/dist/timer-CKyBCVzT.cjs.map +1 -0
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js +139 -0
- package/dist/toConsumableArray-BSMMWi3w-Cu4vcE-m.js.map +1 -0
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs +4 -0
- package/dist/toConsumableArray-BSMMWi3w-DJL7-zAp.cjs.map +1 -0
- package/dist/transformColumnsToArray.d.ts +38 -0
- package/dist/transformColumnsToArray.js +2 -0
- package/dist/transformColumnsToArray.js.map +1 -0
- package/dist/transformDataForAggregation.d.ts +38 -0
- package/dist/transformDataForAggregation.js +2 -0
- package/dist/transformDataForAggregation.js.map +1 -0
- package/dist/transformDataForGraph.d.ts +47 -0
- package/dist/transformDataForGraph.js +2 -0
- package/dist/transformDataForGraph.js.map +1 -0
- package/dist/transformDataForGraphFromFile.d.ts +66 -0
- package/dist/transformDataForGraphFromFile.js +2 -0
- package/dist/transformDataForGraphFromFile.js.map +1 -0
- package/dist/use-in-view-CZPXmTZM.js +4645 -0
- package/dist/use-in-view-CZPXmTZM.js.map +1 -0
- package/dist/use-in-view-Dl1CsAIo.cjs +2 -0
- package/dist/use-in-view-Dl1CsAIo.cjs.map +1 -0
- package/dist/validateSchema.d.ts +68 -0
- package/dist/validateSchema.js +2 -0
- package/dist/validateSchema.js.map +1 -0
- package/dist/x-Dft9NVe_-DcB7wtv5.js +61 -0
- package/dist/x-Dft9NVe_-DcB7wtv5.js.map +1 -0
- package/dist/x-Dft9NVe_-LeyJu02C.cjs +27 -0
- package/dist/x-Dft9NVe_-LeyJu02C.cjs.map +1 -0
- package/dist/y-D0sAaVii.js +421 -0
- package/dist/y-D0sAaVii.js.map +1 -0
- package/dist/y-QcCbqrzx.cjs +2 -0
- package/dist/y-QcCbqrzx.cjs.map +1 -0
- package/dist/zoom-Lo7IAUfC.cjs +2 -0
- package/dist/zoom-Lo7IAUfC.cjs.map +1 -0
- package/dist/zoom-_lqdiGoI.js +1983 -0
- package/dist/zoom-_lqdiGoI.js.map +1 -0
- package/package.json +415 -4
- package/dist/index.cjs +0 -68
- package/dist/index.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButterflyChart.js","sources":["../src/Components/Graphs/ButterflyChart/Graph.tsx","../src/Components/Graphs/ButterflyChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useRef, useState } from 'react';\r\nimport { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ButterflyChartDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n ReferenceDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { YAxesLabels } from '@/Components/Elements/Axes/YAxesLabels';\r\nimport { RefLineX } from '@/Components/Elements/ReferenceLine';\r\n\r\ninterface Props {\r\n data: ButterflyChartDataType[];\r\n barColors: [string, string];\r\n centerGap: number;\r\n refValues: ReferenceDataType[];\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n maxValue: number;\r\n minValue: number;\r\n barPadding: number;\r\n truncateBy: number;\r\n showValues: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n showTicks: boolean;\r\n suffix: string;\r\n prefix: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n noOfTicks: number;\r\n animate: AnimateDataType;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n minValueLeftBar: number;\r\n minValueRightBar: number;\r\n naLabel: string;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColors,\r\n centerGap,\r\n refValues,\r\n maxValue,\r\n minValue,\r\n showValues,\r\n axisTitles,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n onSeriesMouseClick,\r\n showTicks,\r\n suffix,\r\n prefix,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n noOfTicks,\r\n animate,\r\n precision,\r\n customLayers,\r\n minValueLeftBar,\r\n minValueRightBar,\r\n naLabel,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin,\r\n right: rightMargin,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const y = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([graphHeight, 0])\r\n .paddingInner(barPadding);\r\n const xRightBar = scaleLinear()\r\n .domain([minValue, maxValue])\r\n .range([0, (graphWidth - centerGap) / 2])\r\n .nice();\r\n const xRightTicks = xRightBar.ticks(noOfTicks);\r\n const xLeftBar = scaleLinear()\r\n .domain([minValue, maxValue])\r\n .range([(graphWidth - centerGap) / 2, 0])\r\n .nice();\r\n const xLeftTicks = xLeftBar.ticks(noOfTicks);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g transform={`translate(${0},${0})`}>\r\n {showTicks ? (\r\n <XTicksAndGridLines\r\n values={xLeftTicks.filter(d => d !== 0)}\r\n x={xLeftTicks.filter(d => d !== 0).map(d => xLeftBar(d))}\r\n y1={0 - topMargin}\r\n y2={graphHeight + margin.bottom}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: classNames?.xAxis?.gridLines,\r\n labels: classNames?.xAxis?.labels,\r\n }}\r\n suffix={suffix}\r\n prefix={prefix}\r\n labelType='secondary'\r\n showGridLines\r\n leftLabel\r\n precision={precision}\r\n />\r\n ) : null}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {d.leftBar ? (\r\n <motion.rect\r\n y={y(`${i}`)}\r\n style={{ fill: barColors[0] }}\r\n height={y.bandwidth()}\r\n variants={{\r\n initial: {\r\n x: xLeftBar(0),\r\n width: 0,\r\n },\r\n whileInView: {\r\n x: d.leftBar < 0 ? xLeftBar(0) : xLeftBar(d.leftBar),\r\n width:\r\n d.leftBar < 0\r\n ? xLeftBar(d.leftBar) - xLeftBar(0)\r\n : xLeftBar(0) - xLeftBar(d.leftBar),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n x: xLeftBar(0),\r\n width: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n y={(y(`${i}`) as number) + y.bandwidth() / 2}\r\n style={{\r\n fill: barColors[0],\r\n textAnchor: d.rightBar ? (d.rightBar > 0 ? 'end' : 'start') : 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n dx={d.rightBar ? (d.rightBar > 0 ? -5 : 5) : 5}\r\n dy='0.33em'\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n x: xLeftBar(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n x: d.leftBar\r\n ? xLeftBar(d.leftBar)\r\n : xLeftBar(minValueLeftBar < 0 ? 0 : minValueLeftBar),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.rightBar, naLabel, precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <Axis\r\n y1={-2.5}\r\n y2={graphHeight + margin.bottom}\r\n x1={xLeftBar(minValueLeftBar < 0 ? 0 : minValueLeftBar)}\r\n x2={xLeftBar(minValueLeftBar < 0 ? 0 : minValueLeftBar)}\r\n classNames={{ axis: classNames?.yAxis?.axis }}\r\n styles={{ axis: styles?.yAxis?.axis }}\r\n />\r\n {refValues ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineX\r\n key={i}\r\n text={el.text}\r\n color={el.color}\r\n x={xLeftBar(el.value as number)}\r\n y1={0 - margin.top}\r\n y2={graphHeight + margin.bottom}\r\n textSide='left'\r\n classNames={el.classNames}\r\n styles={el.styles}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ))}\r\n </>\r\n ) : null}\r\n </AnimatePresence>\r\n </g>\r\n <g transform={`translate(${(graphWidth + centerGap) / 2},${0})`}>\r\n {showTicks ? (\r\n <XTicksAndGridLines\r\n values={xRightTicks.filter(d => d !== 0)}\r\n x={xRightTicks.filter(d => d !== 0).map(d => xRightBar(d))}\r\n y1={0 - topMargin}\r\n y2={graphHeight + margin.bottom}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: classNames?.xAxis?.gridLines,\r\n labels: classNames?.xAxis?.labels,\r\n }}\r\n suffix={suffix}\r\n prefix={prefix}\r\n labelType='secondary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n ) : null}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={i}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n {d.rightBar ? (\r\n <motion.rect\r\n y={y(`${i}`)}\r\n style={{ fill: barColors[1] }}\r\n height={y.bandwidth()}\r\n exit={{\r\n x: xRightBar(0),\r\n width: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n x: xRightBar(0),\r\n width: 0,\r\n },\r\n whileInView: {\r\n x: d.rightBar >= 0 ? xRightBar(0) : xRightBar(d.rightBar),\r\n width:\r\n d.rightBar >= 0\r\n ? xRightBar(d.rightBar) - xRightBar(0)\r\n : xRightBar(0) - xRightBar(d.rightBar),\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n y={(y(`${i}`) as number) + y.bandwidth() / 2}\r\n style={{\r\n fill: barColors[1],\r\n textAnchor: d.rightBar ? (d.rightBar < 0 ? 'end' : 'start') : 'start',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dx={d.rightBar ? (d.rightBar < 0 ? -5 : 5) : 5}\r\n dy='0.33em'\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n x: xRightBar(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n x: d.rightBar\r\n ? xRightBar(d.rightBar)\r\n : xRightBar(minValueRightBar < 0 ? 0 : minValueRightBar),\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.rightBar, naLabel, precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <Axis\r\n y1={-2.5}\r\n y2={graphHeight + margin.bottom}\r\n x1={xRightBar(minValueRightBar < 0 ? 0 : minValueRightBar)}\r\n x2={xRightBar(minValueRightBar < 0 ? 0 : minValueRightBar)}\r\n classNames={{ axis: classNames?.yAxis?.axis }}\r\n styles={{ axis: styles?.yAxis?.axis }}\r\n />\r\n {refValues ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineX\r\n key={i}\r\n text={el.text}\r\n color={el.color}\r\n x={xRightBar(el.value as number)}\r\n y1={0 - margin.top}\r\n y2={graphHeight + margin.bottom}\r\n textSide='right'\r\n classNames={el.classNames}\r\n styles={el.styles}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ))}\r\n </>\r\n ) : null}\r\n </AnimatePresence>\r\n </g>\r\n <AnimatePresence>\r\n <motion.g transform={`translate(${graphWidth / 2},${0})`}>\r\n {dataWithId.map((d, i) => (\r\n <YAxesLabels\r\n key={i}\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={y(`${d.id}`) as number}\r\n x={0 - centerGap / 2}\r\n width={centerGap}\r\n height={y.bandwidth()}\r\n alignment='center'\r\n style={styles?.yAxis?.labels}\r\n className={classNames?.yAxis?.labels}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ))}\r\n </motion.g>\r\n </AnimatePresence>\r\n <g transform={`translate(${0},${graphHeight})`}>\r\n <text\r\n style={{\r\n fill: barColors[0],\r\n textAnchor: 'end',\r\n ...styles?.yAxis?.title,\r\n }}\r\n className={cn('text-base', classNames?.yAxis?.title)}\r\n x={graphWidth / 2 - centerGap / 2}\r\n y={0}\r\n dx={-5}\r\n dy={20}\r\n >\r\n {axisTitles[0]}\r\n </text>\r\n <text\r\n style={{\r\n fill: barColors[1],\r\n textAnchor: 'start',\r\n ...styles?.yAxis?.title,\r\n }}\r\n className={cn('text-base', classNames?.yAxis?.title)}\r\n x={graphWidth / 2 + centerGap / 2}\r\n y={0}\r\n dx={5}\r\n dy={20}\r\n >\r\n {axisTitles[1]}\r\n </text>\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\r\nimport uniqBy from 'lodash.uniqby';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n ButterflyChartDataType,\r\n Languages,\r\n ReferenceDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { ensureCompleteDataForButterFlyChart } from '@/Utils/ensureCompleteData';\r\n\r\nfunction getMinMax(\r\n data: ButterflyChartDataType[],\r\n key: 'leftBar' | 'rightBar',\r\n minValue?: number | null,\r\n maxValue?: number | null,\r\n) {\r\n const values = data.map(d => d[key]).filter(v => !checkIfNullOrUndefined(v)) as number[];\r\n\r\n const min = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...values) >= 0\r\n ? 0\r\n : Math.min(...values);\r\n\r\n const max = !checkIfNullOrUndefined(maxValue)\r\n ? (maxValue as number)\r\n : Math.max(...values) < 0\r\n ? 0\r\n : Math.max(...values);\r\n\r\n return { min, max };\r\n}\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ButterflyChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color for the left and right bars */\r\n barColors?: [string, string];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n /** Spacing between the left and right bars */\r\n centerGap?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Reference values for comparison */\r\n refValues?: ReferenceDataType[];\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of axis ticks */\r\n showTicks?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Title for the left bars */\r\n leftBarTitle?: string;\r\n /** Title for the right bars */\r\n rightBarTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ButterflyChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n padding,\r\n barColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n backgroundColor = false,\r\n leftMargin = 20,\r\n rightMargin = 20,\r\n topMargin = 25,\r\n bottomMargin = 30,\r\n rightBarTitle = 'Right bar graph',\r\n leftBarTitle = 'Left bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n onSeriesMouseClick,\r\n centerGap = 100,\r\n showValues = true,\r\n maxValue,\r\n minValue,\r\n refValues = [],\r\n suffix = '',\r\n prefix = '',\r\n showTicks = true,\r\n showColorScale = false,\r\n graphDownload = false,\r\n dataDownload = false,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n noOfTicks = 5,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n naLabel = 'NA',\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(\r\n data.filter(d => d.date !== undefined && d.date !== null),\r\n d => d.date,\r\n ).map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${graphTitle ? `The graph shows ${graphTitle}. ` : ''}This is a diverging bar chart. ${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? (\r\n <ColorLegend\r\n colorLegendTitle={colorLegendTitle}\r\n colorDomain={[leftBarTitle, rightBarTitle]}\r\n colors={barColors}\r\n showNAColor={false}\r\n />\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={ensureCompleteDataForButterFlyChart(\r\n data,\r\n timeline.dateFormat || 'yyyy',\r\n ).filter(d =>\r\n timeline.enabled\r\n ? d.date ===\r\n format(\r\n new Date(uniqDatesSorted[index]),\r\n timeline.dateFormat || 'yyyy',\r\n )\r\n : d,\r\n )}\r\n barColors={barColors}\r\n width={width || svgWidth}\r\n centerGap={centerGap}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[leftBarTitle, rightBarTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n refValues={refValues}\r\n maxValue={Math.max(\r\n getMinMax(data, 'leftBar', minValue, maxValue).max,\r\n getMinMax(data, 'rightBar', minValue, maxValue).max,\r\n )}\r\n minValue={Math.min(\r\n getMinMax(data, 'leftBar', minValue, maxValue).min,\r\n getMinMax(data, 'rightBar', minValue, maxValue).min,\r\n )}\r\n minValueLeftBar={getMinMax(data, 'leftBar', minValue, maxValue).min}\r\n minValueRightBar={getMinMax(data, 'rightBar', minValue, maxValue).min}\r\n showValues={showValues}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n showTicks={showTicks}\r\n suffix={suffix}\r\n prefix={prefix}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n styles={styles}\r\n classNames={classNames}\r\n noOfTicks={noOfTicks}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","barColors","centerGap","refValues","maxValue","minValue","showValues","axisTitles","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","barPadding","truncateBy","onSeriesMouseClick","showTicks","suffix","prefix","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","noOfTicks","animate","precision","customLayers","minValueLeftBar","minValueRightBar","naLabel","svgRef","useRef","isInView","useInView","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","y","scaleBand","xRightBar","scaleLinear","xRightTicks","xLeftBar","xLeftTicks","jsxs","Fragment","jsx","motion","XTicksAndGridLines","AnimatePresence","event","isEqual","cn","Axis","el","RefLineX","YAxesLabels","Tooltip","Modal","string2HTML","getMinMax","key","values","v","checkIfNullOrUndefined","min","max","ButterflyChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","rightBarTitle","leftBarTitle","relativeHeight","graphID","showColorScale","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","timeline","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","a","b","ascending","index","setIndex","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","interval","markObj","getSliderMarks","GraphHeader","Pause","Play","SliderUI","nextValue","EmptyState","ColorLegend","ensureCompleteDataForButterFlyChart","format","GraphFooter"],"mappings":"mmCA+DO,SAASA,GAAMC,EAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EACA,UAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,EACA,YAAAC,GACA,WAAAC,GACA,UAAAC,EACA,aAAAC,GACA,QAAAC,EACA,kBAAAC,EACA,WAAAC,GACA,WAAAC,EACA,mBAAAC,EACA,UAAAC,GACA,OAAAC,EACA,OAAAC,EACA,4BAAAC,GACA,eAAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,GACA,gBAAAC,EACA,iBAAAC,EACA,QAAAC,CAAA,EACEjC,EACEkC,EAASC,EAAAA,OAAO,IAAI,EACpBC,EAAWC,EAAAA,UAAUH,EAAQ,CACjC,KAAMN,EAAQ,KACd,OAAQA,EAAQ,MAAA,CACjB,EAEK,CAACU,GAAeC,CAAgB,EAAIC,EAAAA,SAAc,MAAS,EAE3D,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAAc,MAAS,EAC7D,CAACG,GAAQC,CAAS,EAAIJ,EAAAA,SAA6B,MAAS,EA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WAAAC,EACA,UAAAC,EACA,QACEC,IAAY,GACR,CAAE,SAAU,GAAK,KAAM,GAAM,OAAQ,EAAA,EACrCA,GAAW,CAAE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,UAAAC,EACA,aAAAC,EACA,QAAAG,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAEJ,EACCoD,GAAWE,EACVzB,EAAAA,kBAAAA,IAAC0E,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAU/G,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAA2D,EACA,SAAAE,EACA,MAAArF,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare interface AnimateDataType {
|
|
4
|
+
duration: number;
|
|
5
|
+
once: boolean;
|
|
6
|
+
amount: 'some' | 'all' | number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare interface AxesClassNameObject {
|
|
10
|
+
gridLines?: string;
|
|
11
|
+
labels?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
axis?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare interface AxesStyleObject {
|
|
17
|
+
gridLines?: React.CSSProperties;
|
|
18
|
+
labels?: React.CSSProperties;
|
|
19
|
+
title?: React.CSSProperties;
|
|
20
|
+
axis?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare function ChoroplethMap(props: Props): JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare interface ChoroplethMapDataType {
|
|
26
|
+
x?: number | string | null;
|
|
27
|
+
id: string;
|
|
28
|
+
date?: string | number;
|
|
29
|
+
data?: object;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare interface ClassNameObject {
|
|
33
|
+
title?: string;
|
|
34
|
+
footnote?: string;
|
|
35
|
+
source?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
tooltip?: string;
|
|
38
|
+
xAxis?: AxesClassNameObject;
|
|
39
|
+
yAxis?: AxesClassNameObject;
|
|
40
|
+
legend?: string;
|
|
41
|
+
graphContainer?: string;
|
|
42
|
+
graphObjectValues?: string;
|
|
43
|
+
dataConnectors?: string;
|
|
44
|
+
mouseOverLine?: string;
|
|
45
|
+
regLine?: string;
|
|
46
|
+
dataCards?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare interface CustomLayerDataType {
|
|
50
|
+
position: 'before' | 'after';
|
|
51
|
+
layer: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
55
|
+
|
|
56
|
+
declare type MapProjectionTypes = 'mercator' | 'equalEarth' | 'naturalEarth' | 'orthographic' | 'albersUSA';
|
|
57
|
+
|
|
58
|
+
declare interface Props {
|
|
59
|
+
/** Array of data objects */
|
|
60
|
+
data: ChoroplethMapDataType[];
|
|
61
|
+
/** Title of the graph */
|
|
62
|
+
graphTitle?: string | React.ReactNode;
|
|
63
|
+
/** Description of the graph */
|
|
64
|
+
graphDescription?: string | React.ReactNode;
|
|
65
|
+
/** Footnote for the graph */
|
|
66
|
+
footNote?: string | React.ReactNode;
|
|
67
|
+
/** Source data for the graph */
|
|
68
|
+
sources?: SourcesDataType[];
|
|
69
|
+
/** Accessibility label */
|
|
70
|
+
ariaLabel?: string;
|
|
71
|
+
/** Colors for the choropleth map */
|
|
72
|
+
colors?: string[];
|
|
73
|
+
/** Domain of colors for the graph */
|
|
74
|
+
colorDomain?: number[] | string[];
|
|
75
|
+
/** Title for the color legend */
|
|
76
|
+
colorLegendTitle?: string;
|
|
77
|
+
/** Color for the areas where data is no available */
|
|
78
|
+
mapNoDataColor?: string;
|
|
79
|
+
/** Background color of the graph */
|
|
80
|
+
backgroundColor?: string | boolean;
|
|
81
|
+
/** Custom styles for the graph. Each object should be a valid React CSS style object. */
|
|
82
|
+
styles?: StyleObject;
|
|
83
|
+
/** Custom class names */
|
|
84
|
+
classNames?: ClassNameObject;
|
|
85
|
+
/** Width of the graph */
|
|
86
|
+
width?: number;
|
|
87
|
+
/** Height of the graph */
|
|
88
|
+
height?: number;
|
|
89
|
+
/** Minimum height of the graph */
|
|
90
|
+
minHeight?: number;
|
|
91
|
+
/** Relative height scaling factor. This overwrites the height props */
|
|
92
|
+
relativeHeight?: number;
|
|
93
|
+
/** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
|
|
94
|
+
padding?: string;
|
|
95
|
+
/** Map data as an object in geoJson format or a url for geoJson */
|
|
96
|
+
mapData?: any;
|
|
97
|
+
/** Scaling factor for the map. Multiplies the scale number to scale. */
|
|
98
|
+
scale?: number;
|
|
99
|
+
/** Center point of the map */
|
|
100
|
+
centerPoint?: [number, number];
|
|
101
|
+
/** Defines the zoom mode for the map */
|
|
102
|
+
zoomInteraction?: ZoomInteractionTypes;
|
|
103
|
+
/** Stroke width of the regions in the map */
|
|
104
|
+
mapBorderWidth?: number;
|
|
105
|
+
/** Stroke color of the regions in the map */
|
|
106
|
+
mapBorderColor?: string;
|
|
107
|
+
/** Toggle if the map is a world map */
|
|
108
|
+
isWorldMap?: boolean;
|
|
109
|
+
/** Map projection type */
|
|
110
|
+
mapProjection?: MapProjectionTypes;
|
|
111
|
+
/** Extend of the allowed zoom in the map */
|
|
112
|
+
zoomScaleExtend?: [number, number];
|
|
113
|
+
/** Extend of the allowed panning in the map */
|
|
114
|
+
zoomTranslateExtend?: [[number, number], [number, number]];
|
|
115
|
+
/** Countries or regions to be highlighted */
|
|
116
|
+
highlightedIds?: string[];
|
|
117
|
+
/** Defines the opacity of the non-highlighted data */
|
|
118
|
+
dimmedOpacity?: number;
|
|
119
|
+
/** Toggles if the graph animates in when loaded. */
|
|
120
|
+
animate?: boolean | AnimateDataType;
|
|
121
|
+
/** Scale for the colors */
|
|
122
|
+
scaleType?: Exclude<ScaleDataType, 'linear'>;
|
|
123
|
+
/** Toggles if the color scaling is categorical or not */
|
|
124
|
+
categorical?: boolean;
|
|
125
|
+
/** Toggle visibility of color scale. */
|
|
126
|
+
showColorScale?: boolean;
|
|
127
|
+
/** Property in the property object in mapData geoJson object is used to match to the id in the data object */
|
|
128
|
+
mapProperty?: string;
|
|
129
|
+
/** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */
|
|
130
|
+
showAntarctica?: boolean;
|
|
131
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
132
|
+
customLayers?: CustomLayerDataType[];
|
|
133
|
+
/** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */
|
|
134
|
+
timeline?: TimelineDataType;
|
|
135
|
+
/** Enable graph download option as png */
|
|
136
|
+
graphDownload?: boolean;
|
|
137
|
+
/** Enable data download option as a csv */
|
|
138
|
+
dataDownload?: boolean;
|
|
139
|
+
/** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
|
|
140
|
+
resetSelectionOnDoubleClick?: boolean;
|
|
141
|
+
/** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */
|
|
142
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
143
|
+
/** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */
|
|
144
|
+
detailsOnClick?: string | ((_d: any) => React.ReactNode);
|
|
145
|
+
/** Callback for mouse over event */
|
|
146
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
147
|
+
/** Callback for mouse click event */
|
|
148
|
+
onSeriesMouseClick?: (_d: any) => void;
|
|
149
|
+
/** Language setting */
|
|
150
|
+
language?: Languages;
|
|
151
|
+
/** Color theme */
|
|
152
|
+
theme?: 'light' | 'dark';
|
|
153
|
+
/** Unique ID for the graph */
|
|
154
|
+
graphID?: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare type ScaleDataType = 'categorical' | 'linear' | 'threshold';
|
|
158
|
+
|
|
159
|
+
declare interface SourcesDataType {
|
|
160
|
+
source: string;
|
|
161
|
+
link?: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
declare interface StyleObject {
|
|
165
|
+
title?: React.CSSProperties;
|
|
166
|
+
footnote?: React.CSSProperties;
|
|
167
|
+
source?: React.CSSProperties;
|
|
168
|
+
description?: React.CSSProperties;
|
|
169
|
+
graphContainer?: React.CSSProperties;
|
|
170
|
+
tooltip?: React.CSSProperties;
|
|
171
|
+
xAxis?: AxesStyleObject;
|
|
172
|
+
yAxis?: AxesStyleObject;
|
|
173
|
+
graphObjectValues?: React.CSSProperties;
|
|
174
|
+
dataConnectors?: React.CSSProperties;
|
|
175
|
+
mouseOverLine?: React.CSSProperties;
|
|
176
|
+
regLine?: React.CSSProperties;
|
|
177
|
+
dataCards?: React.CSSProperties;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
declare interface TimelineDataType {
|
|
181
|
+
autoplay: boolean;
|
|
182
|
+
enabled: boolean;
|
|
183
|
+
showOnlyActiveDate: boolean;
|
|
184
|
+
speed?: number;
|
|
185
|
+
dateFormat?: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
declare type ZoomInteractionTypes = 'scroll' | 'ctrlScroll' | 'button' | 'noZoom';
|
|
189
|
+
|
|
190
|
+
export { }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BHm2KTjD-D8FylaKc.cjs"),d=require("react"),Ee=require("./Typography-CDR-DAHH.cjs"),je=require("./getSliderMarks-DDJ1CdhL.cjs"),Re=require("./Spinner-UmN-KPe9.cjs"),ke=require("./parse-hMnG_lRV.cjs"),we=require("./index-CZbIGs8q.cjs"),$e=require("./index-BXns0-ng.cjs"),T=require("./zoom-Lo7IAUfC.cjs"),Se=require("./Modal-cQF2UQIa.cjs"),Ce=require("./numberFormattingFunction.js"),Me=require("./Tooltip-BM18N_3l.cjs"),Ne=require("./string2HTML-X4ZYX5jI.cjs"),De=require("./checkIfNullOrUndefined.js"),be=require("./index-CEc_9zWy.cjs"),ae=require("./use-in-view-Dl1CsAIo.cjs"),qe=require("./ordinal-BOeNbyae.cjs"),Oe=require("./threshold-DNsSUf8Q.cjs"),ve=require("./select-Bnfk0lJx.cjs"),Ie=require("./index-a2C2Bqn2.cjs"),Pe=require("./GraphFooter.js"),Le=require("./GraphHeader.js"),de=require("./Colors.js"),Te=require("./fetchAndParseData.js"),ze=require("./getUniqValue.js"),We=require("./getJenks.js"),Be=require("./init-DU0ybBc_.cjs");function Ve(pe){const{data:E,colorDomain:h,colors:l,mapData:j,colorLegendTitle:V,categorical:D,height:x,width:c,scale:se,centerPoint:z,tooltip:ie,mapBorderWidth:q,mapBorderColor:F,mapNoDataColor:Y,onSeriesMouseOver:J,showColorScale:me,zoomScaleExtend:xe,zoomTranslateExtend:O,highlightedIds:H,onSeriesMouseClick:y,mapProperty:A,resetSelectionOnDoubleClick:he,detailsOnClick:$,styles:ge,classNames:ye,mapProjection:U,zoomInteraction:W,animate:b,dimmedOpacity:G,customLayers:ne}=pe,[k,S]=d.useState(void 0),K=d.useRef(null),[Z,v]=d.useState(!(c<680)),[C,Q]=d.useState(void 0),[X,ee]=d.useState(void 0),[M,R]=d.useState(void 0),[le,te]=d.useState(void 0),I=d.useRef(null),re=ae.useInView(I,{once:b.once,amount:b.amount}),ce=d.useRef(null),f=D?qe.ordinal().domain(h).range(l):Oe.threshold().domain(h).range(l);d.useEffect(()=>{const r=ve.select(ce.current),n=ve.select(I.current),p=a=>{if(W==="noZoom")return!1;if(W==="button")return!a.type.includes("wheel");const i=a.type==="wheel",e=a.type.startsWith("touch"),o=a.type==="mousedown"||a.type==="mousemove";return e?!0:i?W==="scroll"?!0:a.ctrlKey:o&&!a.button&&!a.ctrlKey},s=T.zoom().scaleExtent(xe).translateExtent(O||[[-20,-20],[c+20,x+20]]).filter(p).on("zoom",({transform:a})=>{r.attr("transform",a)});n.call(s),K.current=s},[x,c,W]);const g=T.turf_bbox_default(j),P=T.turf_centroid_default(j),oe=g[2]-g[0],ue=g[3]-g[1],B=c*190/960*360/oe,fe=x*190/678*180/ue,u=se*Math.min(B,fe),w=U==="mercator"?T.geoMercator().rotate([0,0]).center(z||P.geometry.coordinates).translate([c/2,x/2]).scale(u):U==="equalEarth"?T.geoEqualEarth().rotate([0,0]).center(z||P.geometry.coordinates).translate([c/2,x/2]).scale(u):U==="naturalEarth"?T.geoNaturalEarth1().rotate([0,0]).center(z||P.geometry.coordinates).translate([c/2,x/2]).scale(u):U==="orthographic"?T.geoOrthographic().rotate([0,0]).center(z||P.geometry.coordinates).translate([c/2,x/2]).scale(u):T.geoAlbersUsa().rotate([0,0]).center(z||P.geometry.coordinates).translate([c/2,x/2]).scale(u),_=r=>{if(!I.current||!K.current)return;ve.select(I.current).call(K.current.scaleBy,r==="in"?1.2:1/1.2)};return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:"relative",children:[t.jsxRuntimeExports.jsx(ae.motion.svg,{width:`${c}px`,height:`${x}px`,viewBox:`0 0 ${c} ${x}`,ref:I,direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{ref:ce,children:[ne.filter(r=>r.position==="before").map(r=>r.layer),j.features.map((r,n)=>E.findIndex(s=>s.id===r.properties[A])!==-1?null:t.jsxRuntimeExports.jsx("g",{opacity:k?G:H.length!==0?H.indexOf(r.properties[A])!==-1?1:G:1,children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((s,a)=>{let i="";return s.forEach(e=>{let o=" M";e.forEach((m,L)=>{const N=w([m[0],m[1]]);L!==e.length-1?o=`${o}${N[0]} ${N[1]}L`:o=`${o}${N[0]} ${N[1]}`}),i+=o}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:F,strokeWidth:q,fill:Y}},a)}):r.geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((e,o)=>{const m=w([e[0],e[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx("path",{d:i,style:{stroke:F,strokeWidth:q,fill:Y}},a)})},n)),t.jsxRuntimeExports.jsx(Ie.AnimatePresence,{children:E.map(r=>{const n=j.features.findIndex(s=>r.id===s.properties[A]),p=De.checkIfNullOrUndefined(r.x)?Y:f(r.x);return t.jsxRuntimeExports.jsx(ae.motion.g,{variants:{initial:{opacity:0},whileInView:{opacity:k?k===p?1:G:H.length!==0?H.indexOf(r.id)!==-1?1:G:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},onMouseEnter:s=>{ee(r),te(s.clientY),R(s.clientX),J?.(r)},onMouseMove:s=>{ee(r),te(s.clientY),R(s.clientX)},onMouseLeave:()=>{ee(void 0),R(void 0),te(void 0),J?.(void 0)},onClick:()=>{(y||$)&&($e.isEqual(C,r)&&he?(Q(void 0),y?.(void 0)):(Q(r),y?.(r)))},children:n===-1?null:j.features[n].geometry.type==="MultiPolygon"?j.features[n].geometry.coordinates.map((s,a)=>{let i="";return s.forEach(e=>{let o=" M";e.forEach((m,L)=>{const N=w([m[0],m[1]]);L!==e.length-1?o=`${o}${N[0]} ${N[1]}L`:o=`${o}${N[0]} ${N[1]}`}),i+=o}),t.jsxRuntimeExports.jsx(ae.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:F,strokeWidth:q}},`${r.id}-${a}`)}):j.features[n].geometry.coordinates.map((s,a)=>{let i="M";return s.forEach((e,o)=>{const m=w([e[0],e[1]]);o!==s.length-1?i=`${i}${m[0]} ${m[1]}L`:i=`${i}${m[0]} ${m[1]}`}),t.jsxRuntimeExports.jsx(ae.motion.path,{d:i,variants:{initial:{fill:p,opacity:0},whileInView:{fill:p,opacity:1,transition:{duration:b.duration}}},initial:"initial",animate:re?"whileInView":"initial",exit:{opacity:0,transition:{duration:b.duration}},style:{stroke:F,strokeWidth:q}},`${r.id}-${a}`)})},r.id)})}),X?j.features.filter(r=>r.properties[A]===X.id).map((r,n)=>t.jsxRuntimeExports.jsx("g",{children:r.geometry.type==="MultiPolygon"?r.geometry.coordinates.map((p,s)=>{let a="";return p.forEach(i=>{let e=" M";i.forEach((o,m)=>{const L=w([o[0],o[1]]);m!==i.length-1?e=`${e}${L[0]} ${L[1]}L`:e=`${e}${L[0]} ${L[1]}`}),a+=e}),t.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)}):r.geometry.coordinates.map((p,s)=>{let a="M";return p.forEach((i,e)=>{const o=w([i[0],i[1]]);e!==p.length-1?a=`${a}${o[0]} ${o[1]}L`:a=`${a}${o[0]} ${o[1]}`}),t.jsxRuntimeExports.jsx("path",{d:a,className:"stroke-primary-gray-700 dark:stroke-primary-gray-300",style:{fill:"none",fillOpacity:0,strokeWidth:"0.5"}},s)})},n)):null,ne.filter(r=>r.position==="after").map(r=>r.layer)]})}),me===!1?null:t.jsxRuntimeExports.jsx("div",{className:"absolute left-4 bottom-4",children:Z?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx("div",{style:{backgroundColor:"rgba(240,240,240, 0.7)",border:"1px solid var(--gray-400)",borderRadius:"999px",width:"24px",height:"24px",padding:"3px",cursor:"pointer",zIndex:10,position:"absolute",right:"-0.75rem",top:"-0.75rem"},onClick:()=>{v(!1)},children:t.jsxRuntimeExports.jsx(be.X,{})}),t.jsxRuntimeExports.jsxs("div",{className:"p-2",style:{backgroundColor:"rgba(240,240,240, 0.7)",width:D?void 0:"340px"},children:[V&&V!==""?t.jsxRuntimeExports.jsx(Ee.TypographyExports.P,{size:"xs",marginBottom:"xs",className:"p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300",style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical"},children:V}):null,D?t.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:h.map((r,n)=>t.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{S(l[n%l.length])},onMouseLeave:()=>{S(void 0)},children:[t.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:l[n%l.length]}}),t.jsxRuntimeExports.jsx(Ee.TypographyExports.P,{size:"sm",marginBottom:"none",leading:"none",children:r})]},n))}):t.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:t.jsxRuntimeExports.jsxs("g",{children:[h.map((r,n)=>t.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{S(l[n])},onMouseLeave:()=>{S(void 0)},className:"cursor-pointer",children:[t.jsxRuntimeExports.jsx("rect",{x:n*320/l.length+1,y:1,width:320/l.length-2,height:8,className:k===l[n]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:l[n],...k===l[n]?{}:{stroke:l[n]}}}),t.jsxRuntimeExports.jsx("text",{x:(n+1)*320/l.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:Ce.numberFormattingFunction(r,"NA")})]},n)),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{S(l[h.length])},onMouseLeave:()=>{S(void 0)},x:h.length*320/l.length+1,y:1,width:320/l.length-2,height:8,className:`cursor-pointer ${k===l[h.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:l[h.length],...k===l[h.length]?{}:{stroke:l[h.length]}}})})]})})]})]}):t.jsxRuntimeExports.jsx("button",{type:"button",className:"mb-0 border-0 bg-transparent p-0 self-start",onClick:()=>{v(!0)},children:t.jsxRuntimeExports.jsx("div",{className:"items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500",children:"Show Legend"})})}),W==="button"&&t.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col",children:[t.jsxRuntimeExports.jsx("button",{onClick:()=>_("in"),className:"leading-0 px-2 py-3.5 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),t.jsxRuntimeExports.jsx("button",{onClick:()=>_("out"),className:"leading-0 px-2 py-3.5 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),$&&C!==void 0?t.jsxRuntimeExports.jsx(Se.ModalExports.Modal,{open:C!==void 0,onClose:()=>{Q(void 0)},children:t.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:Ne.string2HTML($,C)}:void 0,children:typeof $=="function"?$(C):null})}):null,X&&ie&&M&&le?t.jsxRuntimeExports.jsx(Me.Tooltip,{data:X,body:ie,xPos:M,yPos:le,backgroundStyle:ge?.tooltip,className:ye?.tooltip}):null]})}function Fe(pe){const{data:E,mapData:h="https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json",graphTitle:l,colors:j,sources:V,graphDescription:D,height:x,width:c,footNote:se="The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.",colorDomain:z,colorLegendTitle:ie,scaleType:q="threshold",scale:F=.95,centerPoint:Y,padding:J,mapBorderWidth:me=.5,mapNoDataColor:xe=de.Colors.light.graphNoData,backgroundColor:O=!1,mapBorderColor:H=de.Colors.light.grays["gray-500"],relativeHeight:y,tooltip:A,onSeriesMouseOver:he,isWorldMap:$=!0,showColorScale:ge=!0,zoomScaleExtend:ye=[.8,6],zoomTranslateExtend:U,graphID:W,highlightedIds:b=[],onSeriesMouseClick:G,mapProperty:ne="ISO3",graphDownload:k=!1,dataDownload:S=!1,showAntarctica:K=!1,language:Z="en",minHeight:v=0,theme:C="light",ariaLabel:Q,resetSelectionOnDoubleClick:X=!0,detailsOnClick:ee,styles:M,classNames:R,mapProjection:le,zoomInteraction:te="button",animate:I=!1,dimmedOpacity:re=.3,customLayers:ce=[],timeline:f={enabled:!1,autoplay:!1,showOnlyActiveDate:!0}}=pe,[g,P]=d.useState(0),[oe,ue]=d.useState(0),[B,fe]=d.useState(f.autoplay),u=je.sort(we.uniqBy(E.filter(e=>e.date!==void 0&&e.date!==null),e=>e.date).map(e=>ke.parse(`${e.date}`,f.dateFormat||"yyyy",new Date).getTime()),(e,o)=>Be.ascending(e,o)),[w,_]=d.useState(f.autoplay?0:u.length-1),[r,n]=d.useState(void 0),p=d.useRef(null),s=d.useRef(null);d.useEffect(()=>{const e=new ResizeObserver(o=>{P(c||o[0].target.clientWidth||760),ue(x||o[0].target.clientHeight||480)});return p.current&&(ue(p.current.clientHeight||480),P(p.current.clientWidth||760),c||e.observe(p.current)),()=>e.disconnect()},[c,x]),d.useEffect(()=>{typeof h=="string"?Te.fetchAndParseJSON(h).then(o=>{n(o)}):n(h)},[h]);const a=z||(q==="categorical"?ze.getUniqValue(E,"x"):We.getJenks(E.map(e=>e.x),j?.length||4));d.useEffect(()=>{const e=setInterval(()=>{_(o=>o<u.length-1?o+1:0)},(f.speed||2)*1e3);return B||clearInterval(e),()=>clearInterval(e)},[u,B,f.speed]);const i=je.getSliderMarks(u,w,f.showOnlyActiveDate,f.dateFormat||"yyyy");return t.jsxRuntimeExports.jsx("div",{className:`${C||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:Z==="he"||Z==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:Ee.cnExports.cn(`${O?O===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${Z||"en"}`,R?.graphContainer),style:{...M?.graphContainer||{},...O&&O!==!0?{backgroundColor:O}:{}},id:W,ref:s,"aria-label":Q||`${l?`The graph shows ${l}. `:""}This is a choropleth map where geographic areas are colored in proportion to a specific variable.${D?` ${D}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:O?J||"1rem":J||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[l||D||k||S?t.jsxRuntimeExports.jsx(Le.GraphHeader,{styles:{title:M?.title,description:M?.description},classNames:{title:R?.title,description:R?.description},graphTitle:l,graphDescription:D,width:c,graphDownload:k?s.current:void 0,dataDownload:S?E.map(e=>e.data).filter(e=>e!==void 0).length>0?E.map(e=>e.data).filter(e=>e!==void 0):E.filter(e=>e!==void 0):null}):null,f.enabled&&u.length>0&&i?t.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[t.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{fe(!B)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":B?"Click to pause animation":"Click to play animation",children:B?t.jsxRuntimeExports.jsx(be.Pause,{}):t.jsxRuntimeExports.jsx(be.Play,{})}),t.jsxRuntimeExports.jsx(je.SliderUIExports.SliderUI,{min:u[0],max:u[u.length-1],marks:i,step:null,defaultValue:u[u.length-1],value:u[w],onChangeComplete:e=>{_(u.indexOf(e))},onChange:e=>{_(u.indexOf(e))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Map area",children:(c||g)&&(x||oe)&&r?t.jsxRuntimeExports.jsx(Ve,{data:E.filter(e=>f.enabled?e.date===ke.format(new Date(u[w]),f.dateFormat||"yyyy"):e),mapData:K?r:{...r,features:r.features.filter(e=>e.properties.NAME!=="Antarctica")},colorDomain:a,width:c||g,height:Math.max(v,x||(y?v?(c||g)*y>v?(c||g)*y:v:(c||g)*y:oe)),scale:F,centerPoint:Y,colors:j||(q==="categorical"?de.Colors[C].sequentialColors[`neutralColorsx0${a.length}`]:de.Colors[C].sequentialColors[`neutralColorsx0${a.length+1}`]),colorLegendTitle:ie,mapBorderWidth:me,mapNoDataColor:xe,categorical:q==="categorical",mapBorderColor:H,tooltip:A,onSeriesMouseOver:he,isWorldMap:$,showColorScale:ge,zoomScaleExtend:ye,zoomTranslateExtend:U,onSeriesMouseClick:G,mapProperty:ne,highlightedIds:b,resetSelectionOnDoubleClick:X,styles:M,classNames:R,detailsOnClick:ee,mapProjection:le||($?"naturalEarth":"mercator"),zoomInteraction:te,dimmedOpacity:re,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},customLayers:ce}):t.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(v,x||(y?v?(c||g)*y>v?(c||g)*y:v:(c||g)*y:oe))}px`},className:"flex items-center justify-center",children:t.jsxRuntimeExports.jsx(Re.SpinnerExports.Spinner,{"aria-label":"Loading graph"})})}),V||se?t.jsxRuntimeExports.jsx(Pe.GraphFooter,{styles:{footnote:M?.footnote,source:M?.source},classNames:{footnote:R?.footnote,source:R?.source},sources:V,footNote:se,width:c}):null]})})})})}exports.ChoroplethMap=Fe;
|
|
2
|
+
//# sourceMappingURL=ChoroplethMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChoroplethMap.js","sources":["../src/Components/Graphs/Maps/ChoroplethMap/Graph.tsx","../src/Components/Graphs/Maps/ChoroplethMap/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { useEffect, useRef, useState } from 'react';\r\nimport {\r\n geoAlbersUsa,\r\n geoEqualEarth,\r\n geoMercator,\r\n geoNaturalEarth1,\r\n geoOrthographic,\r\n} from 'd3-geo';\r\nimport { D3ZoomEvent, zoom, ZoomBehavior } from 'd3-zoom';\r\nimport { select } from 'd3-selection';\r\nimport { scaleThreshold, scaleOrdinal } from 'd3-scale';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { P } from '@undp/design-system-react/Typography';\r\nimport bbox from '@turf/bbox';\r\nimport centroid from '@turf/centroid';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ChoroplethMapDataType,\r\n ClassNameObject,\r\n CustomLayerDataType,\r\n MapProjectionTypes,\r\n StyleObject,\r\n ZoomInteractionTypes,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { X } from '@/Components/Icons';\r\n\r\ninterface Props {\r\n colorDomain: number[] | string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData: any;\r\n width: number;\r\n height: number;\r\n colors: string[];\r\n colorLegendTitle?: string;\r\n categorical: boolean;\r\n data: ChoroplethMapDataType[];\r\n scale: number;\r\n centerPoint?: [number, number];\r\n mapBorderWidth: number;\r\n mapNoDataColor: string;\r\n mapBorderColor: string;\r\n isWorldMap: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n showColorScale: boolean;\r\n zoomScaleExtend: [number, number];\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n highlightedIds: string[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n mapProperty: string;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n zoomInteraction: ZoomInteractionTypes;\r\n mapProjection: MapProjectionTypes;\r\n animate: AnimateDataType;\r\n dimmedOpacity: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n colorDomain,\r\n colors,\r\n mapData,\r\n colorLegendTitle,\r\n categorical,\r\n height,\r\n width,\r\n scale,\r\n centerPoint,\r\n tooltip,\r\n mapBorderWidth,\r\n mapBorderColor,\r\n mapNoDataColor,\r\n onSeriesMouseOver,\r\n showColorScale,\r\n zoomScaleExtend,\r\n zoomTranslateExtend,\r\n highlightedIds,\r\n onSeriesMouseClick,\r\n mapProperty,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction,\r\n animate,\r\n dimmedOpacity,\r\n customLayers,\r\n } = props;\r\n const [selectedColor, setSelectedColor] = useState<string | undefined>(undefined);\r\n const zoomRef = useRef<ZoomBehavior<SVGSVGElement, unknown> | null>(null);\r\n const [showLegend, setShowLegend] = useState(!(width < 680));\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const mapSvg = useRef<SVGSVGElement>(null);\r\n const isInView = useInView(mapSvg, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const mapG = useRef<SVGGElement>(null);\r\n const colorScale = categorical\r\n ? scaleOrdinal<number | string, string>().domain(colorDomain).range(colors)\r\n : scaleThreshold<number, string>()\r\n .domain(colorDomain as number[])\r\n .range(colors);\r\n\r\n useEffect(() => {\r\n const mapGSelect = select(mapG.current);\r\n const mapSvgSelect = select(mapSvg.current);\r\n const zoomFilter = (e: D3ZoomEvent<SVGSVGElement, unknown>['sourceEvent']) => {\r\n if (zoomInteraction === 'noZoom') return false;\r\n if (zoomInteraction === 'button') return !e.type.includes('wheel');\r\n const isWheel = e.type === 'wheel';\r\n const isTouch = e.type.startsWith('touch');\r\n const isDrag = e.type === 'mousedown' || e.type === 'mousemove';\r\n\r\n if (isTouch) return true;\r\n if (isWheel) {\r\n if (zoomInteraction === 'scroll') return true;\r\n return e.ctrlKey;\r\n }\r\n return isDrag && !e.button && !e.ctrlKey;\r\n };\r\n const zoomBehavior = zoom<SVGSVGElement, unknown>()\r\n .scaleExtent(zoomScaleExtend)\r\n .translateExtent(\r\n zoomTranslateExtend || [\r\n [-20, -20],\r\n [width + 20, height + 20],\r\n ],\r\n )\r\n .filter(zoomFilter)\r\n .on('zoom', ({ transform }) => {\r\n mapGSelect.attr('transform', transform);\r\n });\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapSvgSelect.call(zoomBehavior as any);\r\n\r\n zoomRef.current = zoomBehavior;\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [height, width, zoomInteraction]);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const bounds = bbox(mapData as any);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const center = centroid(mapData as any);\r\n const lonDiff = bounds[2] - bounds[0];\r\n const latDiff = bounds[3] - bounds[1];\r\n const scaleX = (((width * 190) / 960) * 360) / lonDiff;\r\n const scaleY = (((height * 190) / 678) * 180) / latDiff;\r\n const scaleVar = scale * Math.min(scaleX, scaleY);\r\n\r\n const projection =\r\n mapProjection === 'mercator'\r\n ? geoMercator()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'equalEarth'\r\n ? geoEqualEarth()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'naturalEarth'\r\n ? geoNaturalEarth1()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : mapProjection === 'orthographic'\r\n ? geoOrthographic()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar)\r\n : geoAlbersUsa()\r\n .rotate([0, 0])\r\n .center(centerPoint || (center.geometry.coordinates as [number, number]))\r\n .translate([width / 2, height / 2])\r\n .scale(scaleVar);\r\n const handleZoom = (direction: 'in' | 'out') => {\r\n if (!mapSvg.current || !zoomRef.current) return;\r\n const svg = select(mapSvg.current);\r\n svg.call(zoomRef.current.scaleBy, direction === 'in' ? 1.2 : 1 / 1.2);\r\n };\r\n return (\r\n <>\r\n <div className='relative'>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n ref={mapSvg}\r\n direction='ltr'\r\n >\r\n <g ref={mapG}>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData.features.map((d: any, i: number) => {\r\n const index = data.findIndex(el => el.id === d.properties[mapProperty]);\r\n if (index !== -1) return null;\r\n return (\r\n <g\r\n key={i}\r\n opacity={\r\n selectedColor\r\n ? dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.properties[mapProperty]) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1\r\n }\r\n >\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n fill: mapNoDataColor,\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n }\r\n <AnimatePresence>\r\n {data.map(d => {\r\n const index = mapData.features.findIndex(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => d.id === el.properties[mapProperty],\r\n );\r\n const color = !checkIfNullOrUndefined(d.x)\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n colorScale(d.x as any)\r\n : mapNoDataColor;\r\n return (\r\n <motion.g\r\n key={d.id}\r\n variants={{\r\n initial: { opacity: 0 },\r\n whileInView: {\r\n opacity: selectedColor\r\n ? selectedColor === color\r\n ? 1\r\n : dimmedOpacity\r\n : highlightedIds.length !== 0\r\n ? highlightedIds.indexOf(d.id) !== -1\r\n ? 1\r\n : dimmedOpacity\r\n : 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n >\r\n {index === -1\r\n ? null\r\n : mapData.features[index].geometry.type === 'MultiPolygon'\r\n ? mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={masterPath}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )\r\n : mapData.features[index].geometry.coordinates.map(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <motion.path\r\n key={`${d.id}-${j}`}\r\n d={path}\r\n variants={{\r\n initial: { fill: color, opacity: 0 },\r\n whileInView: {\r\n fill: color,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n style={{\r\n stroke: mapBorderColor,\r\n strokeWidth: mapBorderWidth,\r\n }}\r\n />\r\n );\r\n },\r\n )}\r\n </motion.g>\r\n );\r\n })}\r\n </AnimatePresence>\r\n {mouseOverData\r\n ? mapData.features\r\n .filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (d: { properties: any }) => d.properties[mapProperty] === mouseOverData.id,\r\n )\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n .map((d: any, i: number) => {\r\n return (\r\n <g key={i}>\r\n {d.geometry.type === 'MultiPolygon'\r\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: any) => {\r\n let masterPath = '';\r\n el.forEach((geo: number[][]) => {\r\n let path = ' M';\r\n geo.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== geo.length - 1)\r\n path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n masterPath += path;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={masterPath}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })\r\n : // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n d.geometry.coordinates.map((el: any, j: number) => {\r\n let path = 'M';\r\n el.forEach((c: number[], k: number) => {\r\n const point = projection([c[0], c[1]]) as [number, number];\r\n if (k !== el.length - 1) path = `${path}${point[0]} ${point[1]}L`;\r\n else path = `${path}${point[0]} ${point[1]}`;\r\n });\r\n return (\r\n <path\r\n key={j}\r\n d={path}\r\n className='stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n style={{\r\n fill: 'none',\r\n fillOpacity: 0,\r\n strokeWidth: '0.5',\r\n }}\r\n />\r\n );\r\n })}\r\n </g>\r\n );\r\n })\r\n : null}\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {showColorScale === false ? null : (\r\n <div className='absolute left-4 bottom-4'>\r\n {showLegend ? (\r\n <>\r\n <div\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n border: '1px solid var(--gray-400)',\r\n borderRadius: '999px',\r\n width: '24px',\r\n height: '24px',\r\n padding: '3px',\r\n cursor: 'pointer',\r\n zIndex: 10,\r\n position: 'absolute',\r\n right: '-0.75rem',\r\n top: '-0.75rem',\r\n }}\r\n onClick={() => {\r\n setShowLegend(false);\r\n }}\r\n >\r\n <X />\r\n </div>\r\n <div\r\n className='p-2'\r\n style={{\r\n backgroundColor: 'rgba(240,240,240, 0.7)',\r\n width: categorical ? undefined : '340px',\r\n }}\r\n >\r\n {colorLegendTitle && colorLegendTitle !== '' ? (\r\n <P\r\n size='xs'\r\n marginBottom='xs'\r\n className='p-0 leading-normal overflow-hidden text-primary-gray-700 dark:text-primary-gray-300'\r\n style={{\r\n display: '-webkit-box',\r\n WebkitLineClamp: '1',\r\n WebkitBoxOrient: 'vertical',\r\n }}\r\n >\r\n {colorLegendTitle}\r\n </P>\r\n ) : null}\r\n {!categorical ? (\r\n <svg width='100%' viewBox='0 0 320 30' direction='ltr'>\r\n <g>\r\n {colorDomain.map((d, i) => (\r\n <g\r\n key={i}\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n className='cursor-pointer'\r\n >\r\n <rect\r\n x={(i * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={\r\n selectedColor === colors[i]\r\n ? 'stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }\r\n style={{\r\n fill: colors[i],\r\n ...(selectedColor === colors[i] ? {} : { stroke: colors[i] }),\r\n }}\r\n />\r\n <text\r\n x={((i + 1) * 320) / colors.length}\r\n y={25}\r\n className='fill-primary-gray-700 dark:fill-primary-gray-300 text-xs'\r\n style={{ textAnchor: 'middle' }}\r\n >\r\n {numberFormattingFunction(d as number, 'NA')}\r\n </text>\r\n </g>\r\n ))}\r\n <g>\r\n <rect\r\n onMouseOver={() => {\r\n setSelectedColor(colors[colorDomain.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n x={(colorDomain.length * 320) / colors.length + 1}\r\n y={1}\r\n width={320 / colors.length - 2}\r\n height={8}\r\n className={`cursor-pointer ${\r\n selectedColor === colors[colorDomain.length]\r\n ? 'stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300'\r\n : ''\r\n }`}\r\n style={{\r\n fill: colors[colorDomain.length],\r\n ...(selectedColor === colors[colorDomain.length]\r\n ? {}\r\n : { stroke: colors[colorDomain.length] }),\r\n }}\r\n />\r\n </g>\r\n </g>\r\n </svg>\r\n ) : (\r\n <div className='flex flex-col gap-3'>\r\n {colorDomain.map((d, i) => (\r\n <div\r\n key={i}\r\n className='flex gap-2 items-center'\r\n onMouseOver={() => {\r\n setSelectedColor(colors[i % colors.length]);\r\n }}\r\n onMouseLeave={() => {\r\n setSelectedColor(undefined);\r\n }}\r\n >\r\n <div\r\n className='w-2 h-2 rounded-full'\r\n style={{ backgroundColor: colors[i % colors.length] }}\r\n />\r\n <P size='sm' marginBottom='none' leading='none'>\r\n {d}\r\n </P>\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n ) : (\r\n <button\r\n type='button'\r\n className='mb-0 border-0 bg-transparent p-0 self-start'\r\n onClick={() => {\r\n setShowLegend(true);\r\n }}\r\n >\r\n <div className='items-start text-sm font-medium cursor-pointer p-2 mb-0 flex text-primary-black dark:text-primary-gray-300 bg-primary-gray-300 dark:bg-primary-gray-550 border-primary-gray-400 dark:border-primary-gray-500'>\r\n Show Legend\r\n </div>\r\n </button>\r\n )}\r\n </div>\r\n )}\r\n {zoomInteraction === 'button' && (\r\n <div className='absolute left-4 top-4 flex flex-col'>\r\n <button\r\n onClick={() => handleZoom('in')}\r\n className='leading-0 px-2 py-3.5 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n +\r\n </button>\r\n <button\r\n onClick={() => handleZoom('out')}\r\n className='leading-0 px-2 py-3.5 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-400 dark:bg-primary-gray-600 dark:text-primary-gray-100'\r\n >\r\n –\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport {SliderUI } from '@undp/design-system-react/SliderUI';\r\nimport { Spinner } from '@undp/design-system-react/Spinner';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { ascending, sort } from 'd3-array';\r\nimport uniqBy from 'lodash.uniqby';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n ChoroplethMapDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n ScaleDataType,\r\n MapProjectionTypes,\r\n ZoomInteractionTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n TimelineDataType,\r\n} from '@/Types';\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { fetchAndParseJSON } from '@/Utils/fetchAndParseData';\r\nimport { getUniqValue } from '@/Utils/getUniqValue';\r\nimport { getJenks } from '@/Utils/getJenks';\r\nimport { Pause, Play } from '@/Components/Icons';\r\nimport { getSliderMarks } from '@/Utils/getSliderMarks';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: ChoroplethMapDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Colors for the choropleth map */\r\n colors?: string[];\r\n /** Domain of colors for the graph */\r\n colorDomain?: number[] | string[];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Color for the areas where data is no available */\r\n mapNoDataColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n\r\n // Graph Parameters\r\n /** Map data as an object in geoJson format or a url for geoJson */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n mapData?: any;\r\n /** Scaling factor for the map. Multiplies the scale number to scale. */\r\n scale?: number;\r\n /** Center point of the map */\r\n centerPoint?: [number, number];\r\n /** Defines the zoom mode for the map */\r\n zoomInteraction?: ZoomInteractionTypes;\r\n /** Stroke width of the regions in the map */\r\n mapBorderWidth?: number;\r\n /** Stroke color of the regions in the map */\r\n mapBorderColor?: string;\r\n /** Toggle if the map is a world map */\r\n isWorldMap?: boolean;\r\n /** Map projection type */\r\n mapProjection?: MapProjectionTypes;\r\n /** Extend of the allowed zoom in the map */\r\n zoomScaleExtend?: [number, number];\r\n /** Extend of the allowed panning in the map */\r\n zoomTranslateExtend?: [[number, number], [number, number]];\r\n /** Countries or regions to be highlighted */\r\n highlightedIds?: string[];\r\n /** Defines the opacity of the non-highlighted data */\r\n dimmedOpacity?: number;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Scale for the colors */\r\n scaleType?: Exclude<ScaleDataType, 'linear'>;\r\n /** Toggles if the color scaling is categorical or not */\r\n categorical?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Property in the property object in mapData geoJson object is used to match to the id in the data object */\r\n mapProperty?: string;\r\n /** Toggles the visibility of Antarctica in the default map. Only applicable for the default map. */\r\n showAntarctica?: boolean;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */\r\n timeline?: TimelineDataType;\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ChoroplethMap(props: Props) {\r\n const {\r\n data,\r\n mapData = 'https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap.json',\r\n graphTitle,\r\n colors,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote = 'The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.',\r\n colorDomain,\r\n colorLegendTitle,\r\n scaleType = 'threshold',\r\n scale = 0.95,\r\n centerPoint,\r\n padding,\r\n mapBorderWidth = 0.5,\r\n mapNoDataColor = Colors.light.graphNoData,\r\n backgroundColor = false,\r\n mapBorderColor = Colors.light.grays['gray-500'],\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n isWorldMap = true,\r\n showColorScale = true,\r\n zoomScaleExtend = [0.8, 6],\r\n zoomTranslateExtend,\r\n graphID,\r\n highlightedIds = [],\r\n onSeriesMouseClick,\r\n mapProperty = 'ISO3',\r\n graphDownload = false,\r\n dataDownload = false,\r\n showAntarctica = false,\r\n language = 'en',\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n styles,\r\n classNames,\r\n mapProjection,\r\n zoomInteraction = 'button',\r\n animate = false,\r\n dimmedOpacity = 0.3,\r\n customLayers = [],\r\n timeline = { enabled: false, autoplay: false, showOnlyActiveDate: true },\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n const [play, setPlay] = useState(timeline.autoplay);\r\n const uniqDatesSorted = sort(\r\n uniqBy(\r\n data.filter(d => d.date !== undefined && d.date !== null),\r\n d => d.date,\r\n ).map(d => parse(`${d.date}`, timeline.dateFormat || 'yyyy', new Date()).getTime()),\r\n (a, b) => ascending(a, b),\r\n );\r\n const [index, setIndex] = useState(timeline.autoplay ? 0 : uniqDatesSorted.length - 1);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mapShape, setMapShape] = useState<any>(undefined);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 760);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 760);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n useEffect(() => {\r\n if (typeof mapData === 'string') {\r\n const fetchData = fetchAndParseJSON(mapData);\r\n fetchData.then(d => {\r\n setMapShape(d);\r\n });\r\n } else {\r\n setMapShape(mapData);\r\n }\r\n }, [mapData]);\r\n\r\n const domain =\r\n colorDomain ||\r\n (scaleType === 'categorical'\r\n ? getUniqValue(data, 'x')\r\n : getJenks(\r\n data.map(d => d.x as number | null | undefined),\r\n colors?.length || 4,\r\n ));\r\n\r\n useEffect(() => {\r\n const interval = setInterval(\r\n () => {\r\n setIndex(i => (i < uniqDatesSorted.length - 1 ? i + 1 : 0));\r\n },\r\n (timeline.speed || 2) * 1000,\r\n );\r\n if (!play) clearInterval(interval);\r\n return () => clearInterval(interval);\r\n }, [uniqDatesSorted, play, timeline.speed]);\r\n\r\n const markObj = getSliderMarks(\r\n uniqDatesSorted,\r\n index,\r\n timeline.showOnlyActiveDate,\r\n timeline.dateFormat || 'yyyy',\r\n );\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a choropleth map where geographic areas are colored in proportion to a specific variable.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n {timeline.enabled && uniqDatesSorted.length > 0 && markObj ? (\r\n <div className='flex gap-6 items-center' dir='ltr'>\r\n <button\r\n type='button'\r\n onClick={() => {\r\n setPlay(!play);\r\n }}\r\n className='p-0 border-0 cursor-pointer bg-transparent'\r\n aria-label={play ? 'Click to pause animation' : 'Click to play animation'}\r\n >\r\n {play ? <Pause /> : <Play />}\r\n </button>\r\n <SliderUI\r\n min={uniqDatesSorted[0]}\r\n max={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n marks={markObj}\r\n step={null}\r\n defaultValue={uniqDatesSorted[uniqDatesSorted.length - 1]}\r\n value={uniqDatesSorted[index]}\r\n onChangeComplete={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n onChange={nextValue => {\r\n setIndex(uniqDatesSorted.indexOf(nextValue as number));\r\n }}\r\n aria-label='Time slider. Use arrow keys to adjust selected time period.'\r\n />\r\n </div>\r\n ) : null}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Map area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) && mapShape ? (\r\n <Graph\r\n data={data.filter(d =>\r\n timeline.enabled\r\n ? d.date ===\r\n format(new Date(uniqDatesSorted[index]), timeline.dateFormat || 'yyyy')\r\n : d,\r\n )}\r\n mapData={\r\n showAntarctica\r\n ? mapShape\r\n : {\r\n ...mapShape,\r\n features: mapShape.features.filter(\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n (el: any) => el.properties.NAME !== 'Antarctica',\r\n ),\r\n }\r\n }\r\n colorDomain={domain}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n scale={scale}\r\n centerPoint={centerPoint}\r\n colors={\r\n colors ||\r\n (scaleType === 'categorical'\r\n ? Colors[theme].sequentialColors[\r\n `neutralColorsx0${domain.length as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ]\r\n : Colors[theme].sequentialColors[\r\n `neutralColorsx0${(domain.length + 1) as 4 | 5 | 6 | 7 | 8 | 9}`\r\n ])\r\n }\r\n colorLegendTitle={colorLegendTitle}\r\n mapBorderWidth={mapBorderWidth}\r\n mapNoDataColor={mapNoDataColor}\r\n categorical={scaleType === 'categorical'}\r\n mapBorderColor={mapBorderColor}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n isWorldMap={isWorldMap}\r\n showColorScale={showColorScale}\r\n zoomScaleExtend={zoomScaleExtend}\r\n zoomTranslateExtend={zoomTranslateExtend}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n mapProperty={mapProperty}\r\n highlightedIds={highlightedIds}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n styles={styles}\r\n classNames={classNames}\r\n detailsOnClick={detailsOnClick}\r\n mapProjection={mapProjection || (isWorldMap ? 'naturalEarth' : 'mercator')}\r\n zoomInteraction={zoomInteraction}\r\n dimmedOpacity={dimmedOpacity}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n customLayers={customLayers}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n height: `${Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}px`,\r\n }}\r\n className='flex items-center justify-center'\r\n >\r\n <Spinner aria-label='Loading graph' />\r\n </div>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","colorDomain","colors","mapData","colorLegendTitle","categorical","height","width","scale","centerPoint","tooltip","mapBorderWidth","mapBorderColor","mapNoDataColor","onSeriesMouseOver","showColorScale","zoomScaleExtend","zoomTranslateExtend","highlightedIds","onSeriesMouseClick","mapProperty","resetSelectionOnDoubleClick","detailsOnClick","styles","classNames","mapProjection","zoomInteraction","animate","dimmedOpacity","customLayers","selectedColor","setSelectedColor","useState","zoomRef","useRef","showLegend","setShowLegend","mouseClickData","setMouseClickData","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","mapSvg","isInView","useInView","mapG","colorScale","scaleOrdinal","scaleThreshold","useEffect","mapGSelect","select","mapSvgSelect","zoomFilter","e","isWheel","isTouch","isDrag","zoomBehavior","zoom","transform","bounds","bbox","center","centroid","lonDiff","latDiff","scaleX","scaleY","scaleVar","projection","geoMercator","geoEqualEarth","geoNaturalEarth1","geoOrthographic","geoAlbersUsa","handleZoom","direction","jsxs","Fragment","jsx","motion","d","i","el","j","masterPath","geo","path","c","k","point","AnimatePresence","index","color","checkIfNullOrUndefined","event","isEqual","X","P","numberFormattingFunction","Modal","string2HTML","Tooltip","ChoroplethMap","graphTitle","sources","graphDescription","footNote","scaleType","padding","Colors","backgroundColor","relativeHeight","isWorldMap","graphID","graphDownload","dataDownload","showAntarctica","language","minHeight","theme","ariaLabel","timeline","svgWidth","setSvgWidth","svgHeight","setSvgHeight","play","setPlay","uniqDatesSorted","sort","uniqBy","parse","a","b","ascending","setIndex","mapShape","setMapShape","graphDiv","graphParentDiv","resizeObserver","entries","fetchAndParseJSON","domain","getUniqValue","getJenks","interval","markObj","getSliderMarks","cn","GraphHeader","Pause","Play","SliderUI","nextValue","format","Spinner","GraphFooter"],"mappings":"whCAwEO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,YAAAC,EACA,OAAAC,EACA,QAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,MAAAC,EACA,MAAAC,GACA,YAAAC,EACA,QAAAC,GACA,eAAAC,EACA,eAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,eAAAC,GACA,gBAAAC,GACA,oBAAAC,EACA,eAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,4BAAAC,GACA,eAAAC,EACA,OAAAC,GACA,WAAAC,GACA,cAAAC,EACA,gBAAAC,EACA,QAAAC,EACA,cAAAC,EACA,aAAAC,EAAA,EACE9B,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