@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,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-BHm2KTjD-D8FylaKc.cjs"),x=require("react"),m=require("./SingleGraphDashboard.js"),f=require("./use-in-view-Dl1CsAIo.cjs");function y(o){const{chapters:l,visibilityThreshold:h=.5,mode:n="overlay",infoWidth:a="320px",infoPosition:s="left",infoBackgroundColor:u="rgba(255,255,255,0.8)"}=o,[i,c]=x.useState(0),e=[];return l.forEach((t,p)=>{t.sections.forEach((g,d)=>{e.push({chapter:p,dataSettings:t.dataSettings,section:d,graphType:t.graphType,infoBox:g.infoBox,graphSettings:{...t.graphSettings,...g.graphSettings||{},animate:!0},graphDataConfiguration:g.graphDataConfiguration||t.graphDataConfiguration||[]})})}),r.jsxRuntimeExports.jsxs("div",{className:"relative w-full h-full",children:[r.jsxRuntimeExports.jsx(f.motion.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:n==="overlay"||s==="right"?0:a,width:n==="overlay"?"100%":`calc(100% - ${a})`},children:r.jsxRuntimeExports.jsx(m.SingleGraphDashboard,{graphType:e[i].graphType,dataSettings:e[i].dataSettings,graphSettings:e[i].graphSettings,graphDataConfiguration:e[i].graphDataConfiguration})},e[i].chapter),r.jsxRuntimeExports.jsx("div",{children:e.map((t,p)=>r.jsxRuntimeExports.jsx(S,{width:a,index:p,infoBox:t.infoBox,setActiveIndex:c,position:s,mode:n,visibilityThreshold:h,backgroundColor:u},`${t.chapter}-${t.section}`))})]})}function S({infoBox:o,index:l,setActiveIndex:h,position:n,mode:a,visibilityThreshold:s,backgroundColor:u,width:i}){const c=x.useRef(null);return f.useInView(c,{once:!1,amount:s})&&h(l),r.jsxRuntimeExports.jsx("section",{ref:c,className:`min-h-screen flex ${n==="center"?"justify-center":n==="right"?"justify-end":"justify-start"}`,children:r.jsxRuntimeExports.jsxs("div",{className:`p-8 ${a==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:u,width:i},children:[o.title,o.description]})})}exports.ScrollStory=y;
|
|
2
|
+
//# sourceMappingURL=ScrollStory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollStory.js","sources":["../src/Components/Dashboard/ScrollStory.tsx"],"sourcesContent":["// Scrollytelling.tsx\r\nimport { motion, useInView } from 'motion/react';\r\nimport { useRef, useState } from 'react';\r\n\r\nimport { SingleGraphDashboard } from './SingleGraphDashboard';\r\n\r\nimport { ChaptersDataType, InfoBoxDataType, SectionsArrDataType } from '@/Types';\r\n\r\ninterface Props {\r\n /** Defines if the information is shown as overlay or on the side */\r\n mode?: 'overlay' | 'side';\r\n /** Defines the width of the info section */\r\n infoWidth?: string;\r\n /** Defined the different chapters for the story and different sections within the story */\r\n chapters: ChaptersDataType[];\r\n /** Position of info on the page */\r\n infoPosition?: 'left' | 'right' | 'center';\r\n /** Sets how much of the element (from 0 to 1) must be visible before it's considered in view and it trigger the animation in the scrollytelling */\r\n visibilityThreshold?: number;\r\n /** Sets background color of the info box. */\r\n infoBackgroundColor?: string;\r\n}\r\n\r\n/** ScrollStory is a scrollytelling container component that reveals content step-by-step as the user scrolls through the page. */\r\nexport function ScrollStory(props: Props) {\r\n const {\r\n chapters,\r\n visibilityThreshold = 0.5,\r\n mode = 'overlay',\r\n infoWidth = '320px',\r\n infoPosition = 'left',\r\n infoBackgroundColor = 'rgba(255,255,255,0.8)',\r\n } = props;\r\n const [activeIndex, setActiveIndex] = useState(0);\r\n const sectionsArr: SectionsArrDataType[] = [];\r\n chapters.forEach((d, i) => {\r\n d.sections.forEach((s, j) => {\r\n sectionsArr.push({\r\n chapter: i,\r\n dataSettings: d.dataSettings,\r\n section: j,\r\n graphType: d.graphType,\r\n infoBox: s.infoBox,\r\n graphSettings: { ...d.graphSettings, ...(s.graphSettings || {}), animate: true },\r\n graphDataConfiguration: s.graphDataConfiguration || d.graphDataConfiguration || [],\r\n });\r\n });\r\n });\r\n return (\r\n <div className='relative w-full h-full'>\r\n {/* Background Layer */}\r\n <motion.div\r\n key={sectionsArr[activeIndex].chapter}\r\n className='fixed top-0 h-full -z-10'\r\n initial={{ opacity: 0 }}\r\n animate={{ opacity: 1 }}\r\n transition={{ duration: 0.5 }}\r\n style={{\r\n left: mode === 'overlay' ? 0 : infoPosition === 'right' ? 0 : infoWidth,\r\n width: mode === 'overlay' ? '100%' : `calc(100% - ${infoWidth})`,\r\n }}\r\n >\r\n <SingleGraphDashboard\r\n graphType={sectionsArr[activeIndex].graphType}\r\n dataSettings={sectionsArr[activeIndex].dataSettings}\r\n graphSettings={sectionsArr[activeIndex].graphSettings}\r\n graphDataConfiguration={sectionsArr[activeIndex].graphDataConfiguration}\r\n />\r\n </motion.div>\r\n <div>\r\n {sectionsArr.map((section, idx) => (\r\n <ScrollySection\r\n width={infoWidth}\r\n key={`${section.chapter}-${section.section}`}\r\n index={idx}\r\n infoBox={section.infoBox}\r\n setActiveIndex={setActiveIndex}\r\n position={infoPosition}\r\n mode={mode}\r\n visibilityThreshold={visibilityThreshold}\r\n backgroundColor={infoBackgroundColor}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n}\r\n\r\nfunction ScrollySection({\r\n infoBox,\r\n index,\r\n setActiveIndex,\r\n position,\r\n mode,\r\n visibilityThreshold,\r\n backgroundColor,\r\n width,\r\n}: {\r\n infoBox: InfoBoxDataType;\r\n index: number;\r\n setActiveIndex: (idx: number) => void;\r\n position: 'left' | 'right' | 'center';\r\n mode: 'overlay' | 'side';\r\n visibilityThreshold: number;\r\n backgroundColor: string;\r\n width: string;\r\n}) {\r\n const ref = useRef(null);\r\n const isInView = useInView(ref, {\r\n once: false,\r\n amount: visibilityThreshold,\r\n });\r\n if (isInView) setActiveIndex(index);\r\n return (\r\n <section\r\n ref={ref}\r\n className={`min-h-screen flex ${position === 'center' ? 'justify-center' : position === 'right' ? 'justify-end' : 'justify-start'}`}\r\n >\r\n <div\r\n className={`p-8 ${mode === 'overlay' ? 'h-fit mx-10 ' : ''}`}\r\n style={{\r\n backgroundColor,\r\n width,\r\n }}\r\n >\r\n {infoBox.title}\r\n {infoBox.description}\r\n </div>\r\n </section>\r\n );\r\n}\r\n"],"names":["ScrollStory","props","chapters","visibilityThreshold","mode","infoWidth","infoPosition","infoBackgroundColor","activeIndex","setActiveIndex","useState","sectionsArr","d","i","s","j","jsxs","jsx","motion","SingleGraphDashboard","section","idx","ScrollySection","infoBox","index","position","backgroundColor","width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EAAAA,kBAAAA,IAACK,EAAA,CACC,MAAOjB,EAEP,MAAOgB,EACP,QAASD,EAAQ,QACjB,eAAAX,EACA,SAAUH,EACV,KAAAF,EACA,oBAAAD,EACA,gBAAiBI,CAAA,EAPZ,GAAGa,EAAQ,OAAO,IAAIA,EAAQ,OAAO,EAAA,CAS7C,CAAA,CACH,CAAA,EACF,CAEJ,CAEA,SAASE,EAAe,CACtB,QAAAC,EACA,MAAAC,EACA,eAAAf,EACA,SAAAgB,EACA,KAAArB,EACA,oBAAAD,EACA,gBAAAuB,EACA,MAAAC,CACF,EASG,CACD,MAAMC,EAAMC,EAAAA,OAAO,IAAI,EAKvB,OAJiBC,EAAAA,UAAUF,EAAK,CAC9B,KAAM,GACN,OAAQzB,CAAA,CACT,KAC4BqB,CAAK,EAEhCP,EAAAA,kBAAAA,IAAC,UAAA,CACC,IAAAW,EACA,UAAW,qBAAqBH,IAAa,SAAW,iBAAmBA,IAAa,QAAU,cAAgB,eAAe,GAEjI,SAAAT,EAAAA,kBAAAA,KAAC,MAAA,CACC,UAAW,OAAOZ,IAAS,UAAY,eAAiB,EAAE,GAC1D,MAAO,CACL,gBAAAsB,EACA,MAAAC,CAAA,EAGD,SAAA,CAAAJ,EAAQ,MACRA,EAAQ,WAAA,CAAA,CAAA,CACX,CAAA,CAGN"}
|
|
@@ -0,0 +1,230 @@
|
|
|
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 AnnotationSettingsDataType {
|
|
10
|
+
text: string;
|
|
11
|
+
maxWidth?: number;
|
|
12
|
+
xCoordinate?: number | string;
|
|
13
|
+
yCoordinate?: number | string;
|
|
14
|
+
xOffset?: number;
|
|
15
|
+
yOffset?: number;
|
|
16
|
+
align?: 'center' | 'left' | 'right';
|
|
17
|
+
color?: string;
|
|
18
|
+
fontWeight?: 'regular' | 'bold' | 'medium';
|
|
19
|
+
showConnector?: boolean | number;
|
|
20
|
+
connectorRadius?: number;
|
|
21
|
+
classNames?: {
|
|
22
|
+
connector?: string;
|
|
23
|
+
text?: string;
|
|
24
|
+
};
|
|
25
|
+
styles?: {
|
|
26
|
+
connector?: React.CSSProperties;
|
|
27
|
+
text?: React.CSSProperties;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare interface AxesClassNameObject {
|
|
32
|
+
gridLines?: string;
|
|
33
|
+
labels?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
axis?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare interface AxesStyleObject {
|
|
39
|
+
gridLines?: React.CSSProperties;
|
|
40
|
+
labels?: React.CSSProperties;
|
|
41
|
+
title?: React.CSSProperties;
|
|
42
|
+
axis?: React.CSSProperties;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare interface ClassNameObject {
|
|
46
|
+
title?: string;
|
|
47
|
+
footnote?: string;
|
|
48
|
+
source?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
tooltip?: string;
|
|
51
|
+
xAxis?: AxesClassNameObject;
|
|
52
|
+
yAxis?: AxesClassNameObject;
|
|
53
|
+
legend?: string;
|
|
54
|
+
graphContainer?: string;
|
|
55
|
+
graphObjectValues?: string;
|
|
56
|
+
dataConnectors?: string;
|
|
57
|
+
mouseOverLine?: string;
|
|
58
|
+
regLine?: string;
|
|
59
|
+
dataCards?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare type CurveTypes = 'linear' | 'curve' | 'step' | 'stepAfter' | 'stepBefore';
|
|
63
|
+
|
|
64
|
+
declare interface CustomHighlightAreaSettingsDataType {
|
|
65
|
+
coordinates: (number | string)[];
|
|
66
|
+
closePath?: boolean;
|
|
67
|
+
style?: React.CSSProperties;
|
|
68
|
+
className?: string;
|
|
69
|
+
color?: string;
|
|
70
|
+
strokeWidth?: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare interface CustomLayerDataType {
|
|
74
|
+
position: 'before' | 'after';
|
|
75
|
+
layer: React.ReactNode;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface HighlightAreaSettingsDataType {
|
|
79
|
+
coordinates: [number | string | null, number | string | null];
|
|
80
|
+
style?: React.CSSProperties;
|
|
81
|
+
className?: string;
|
|
82
|
+
color?: string;
|
|
83
|
+
strokeWidth?: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
87
|
+
|
|
88
|
+
declare interface LineChartDataType {
|
|
89
|
+
date: number | string;
|
|
90
|
+
y: number;
|
|
91
|
+
data?: object;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare interface Props {
|
|
95
|
+
/** Array of data objects */
|
|
96
|
+
data: LineChartDataType[];
|
|
97
|
+
/** Title of the graph */
|
|
98
|
+
graphTitle?: string | React.ReactNode;
|
|
99
|
+
/** Description of the graph */
|
|
100
|
+
graphDescription?: string | React.ReactNode;
|
|
101
|
+
/** Footnote for the graph */
|
|
102
|
+
footNote?: string | React.ReactNode;
|
|
103
|
+
/** Source data for the graph */
|
|
104
|
+
sources?: SourcesDataType[];
|
|
105
|
+
/** Accessibility label */
|
|
106
|
+
ariaLabel?: string;
|
|
107
|
+
/** Colors of the lines */
|
|
108
|
+
lineColor?: string;
|
|
109
|
+
/** Background color of the graph */
|
|
110
|
+
backgroundColor?: string | boolean;
|
|
111
|
+
/** Custom styles for the graph. Each object should be a valid React CSS style object. */
|
|
112
|
+
styles?: StyleObject;
|
|
113
|
+
/** Custom class names */
|
|
114
|
+
classNames?: ClassNameObject;
|
|
115
|
+
/** Width of the graph */
|
|
116
|
+
width?: number;
|
|
117
|
+
/** Height of the graph */
|
|
118
|
+
height?: number;
|
|
119
|
+
/** Minimum height of the graph */
|
|
120
|
+
minHeight?: number;
|
|
121
|
+
/** Relative height scaling factor. This overwrites the height props */
|
|
122
|
+
relativeHeight?: number;
|
|
123
|
+
/** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
|
|
124
|
+
padding?: string;
|
|
125
|
+
/** Left margin of the graph */
|
|
126
|
+
leftMargin?: number;
|
|
127
|
+
/** Right margin of the graph */
|
|
128
|
+
rightMargin?: number;
|
|
129
|
+
/** Top margin of the graph */
|
|
130
|
+
topMargin?: number;
|
|
131
|
+
/** Bottom margin of the graph */
|
|
132
|
+
bottomMargin?: number;
|
|
133
|
+
/** Prefix for values */
|
|
134
|
+
prefix?: string;
|
|
135
|
+
/** Suffix for values */
|
|
136
|
+
suffix?: string;
|
|
137
|
+
/** Maximum value for the chart */
|
|
138
|
+
maxValue?: number;
|
|
139
|
+
/** Minimum value for the chart */
|
|
140
|
+
minValue?: number;
|
|
141
|
+
/** Reference values for comparison */
|
|
142
|
+
refValues?: ReferenceDataType[];
|
|
143
|
+
/** Maximum value of the date for the chart */
|
|
144
|
+
maxDate?: string | number;
|
|
145
|
+
/** Minimum value of the date for the chart */
|
|
146
|
+
minDate?: string | number;
|
|
147
|
+
/** No. of ticks on the x-axis */
|
|
148
|
+
noOfXTicks?: number;
|
|
149
|
+
/** No. of ticks on the y-axis */
|
|
150
|
+
noOfYTicks?: number;
|
|
151
|
+
/** Toggle visibility of values */
|
|
152
|
+
showValues?: boolean;
|
|
153
|
+
/** Toggle visibility of dots on the line */
|
|
154
|
+
showDots?: boolean;
|
|
155
|
+
/** Stroke width of the line */
|
|
156
|
+
strokeWidth?: number;
|
|
157
|
+
/** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */
|
|
158
|
+
animate?: boolean | AnimateDataType;
|
|
159
|
+
/** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */
|
|
160
|
+
dateFormat?: string;
|
|
161
|
+
/** Title for the Y-axis */
|
|
162
|
+
yAxisTitle?: string;
|
|
163
|
+
/** Annotations on the chart */
|
|
164
|
+
annotations?: AnnotationSettingsDataType[];
|
|
165
|
+
/** Highlighted area(square) on the chart */
|
|
166
|
+
highlightAreaSettings?: HighlightAreaSettingsDataType[];
|
|
167
|
+
/** Highlighted area(custom shape) on the chart */
|
|
168
|
+
customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];
|
|
169
|
+
/** Toggles the visibility of the regression line for the data. If the type is string then string is use to define the color of the line. */
|
|
170
|
+
regressionLine?: boolean | string;
|
|
171
|
+
/** Curve type for the line */
|
|
172
|
+
curveType?: CurveTypes;
|
|
173
|
+
/** Specifies the number of decimal places to display in the value. */
|
|
174
|
+
precision?: number;
|
|
175
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
176
|
+
customLayers?: CustomLayerDataType[];
|
|
177
|
+
/** Enable graph download option as png */
|
|
178
|
+
graphDownload?: boolean;
|
|
179
|
+
/** Enable data download option as a csv */
|
|
180
|
+
dataDownload?: boolean;
|
|
181
|
+
/** 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 */
|
|
182
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
183
|
+
/** Callback for mouse over event */
|
|
184
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
185
|
+
/** Language setting */
|
|
186
|
+
language?: Languages;
|
|
187
|
+
/** Color theme */
|
|
188
|
+
theme?: 'light' | 'dark';
|
|
189
|
+
/** Unique ID for the graph */
|
|
190
|
+
graphID?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare interface ReferenceDataType {
|
|
194
|
+
value: number | null;
|
|
195
|
+
text: string;
|
|
196
|
+
color?: string;
|
|
197
|
+
styles?: {
|
|
198
|
+
line?: React.CSSProperties;
|
|
199
|
+
text?: React.CSSProperties;
|
|
200
|
+
};
|
|
201
|
+
classNames?: {
|
|
202
|
+
line?: string;
|
|
203
|
+
text?: string;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export declare function SimpleLineChart(props: Props): JSX.Element;
|
|
208
|
+
|
|
209
|
+
declare interface SourcesDataType {
|
|
210
|
+
source: string;
|
|
211
|
+
link?: string;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare interface StyleObject {
|
|
215
|
+
title?: React.CSSProperties;
|
|
216
|
+
footnote?: React.CSSProperties;
|
|
217
|
+
source?: React.CSSProperties;
|
|
218
|
+
description?: React.CSSProperties;
|
|
219
|
+
graphContainer?: React.CSSProperties;
|
|
220
|
+
tooltip?: React.CSSProperties;
|
|
221
|
+
xAxis?: AxesStyleObject;
|
|
222
|
+
yAxis?: AxesStyleObject;
|
|
223
|
+
graphObjectValues?: React.CSSProperties;
|
|
224
|
+
dataConnectors?: React.CSSProperties;
|
|
225
|
+
mouseOverLine?: React.CSSProperties;
|
|
226
|
+
regLine?: React.CSSProperties;
|
|
227
|
+
dataCards?: React.CSSProperties;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BHm2KTjD-D8FylaKc.cjs"),h=require("react"),H=require("./Typography-CDR-DAHH.cjs"),x=require("./parse-hMnG_lRV.cjs"),Ce=require("./index-BzeLQvXk.cjs"),Ee=require("./simple-statistics-xm8c0LQQ.cjs"),be=require("./numberFormattingFunction.js"),Le=require("./Tooltip-BM18N_3l.cjs"),D=require("./checkIfNullOrUndefined.js"),ye=require("./customArea-B47Ew5cT.cjs"),Ne=require("./Axis-BlyBRMNw.cjs"),ke=require("./AxisTitle-BY8MI9jC.cjs"),De=require("./XTicksAndGridLines-DuK35ROS.cjs"),Se=require("./ReferenceLine-Bsb5jeE4.cjs"),qe=require("./RegressionLine-BfpCuD7B.cjs"),$e=require("./YTicksAndGridLines-CtLvzExe.cjs"),Te=require("./index-BYroABPm.cjs"),$=require("./use-in-view-Dl1CsAIo.cjs"),Ie=require("./time-Byw_jYQ7.cjs"),Me=require("./linear-BVckp9RD.cjs"),Ae=require("./line-DHV4JwCR.cjs"),re=require("./step-BZ3C8QFW.cjs"),Ve=require("./select-Bnfk0lJx.cjs"),Fe=require("./init-DU0ybBc_.cjs"),He=require("./pointer-Dkq5NV1q.cjs"),Ge=require("./GraphFooter.js"),We=require("./GraphHeader.js"),Pe=require("./Colors.js"),Ye=require("./EmptyState-BQguKAp5.cjs");function Xe(oe){const{data:C,width:b,height:T,lineColor:G,suffix:L,prefix:S,dateFormat:r,highlightAreaSettings:q,showValues:u,noOfXTicks:W,rightMargin:ae,leftMargin:j,topMargin:le,bottomMargin:P,tooltip:v,onSeriesMouseOver:I,refValues:Y,minValue:X,maxValue:U,animate:s,rtl:B,strokeWidth:ce,showDots:xe,annotations:ue,customHighlightAreaSettings:me,regressionLine:M,yAxisTitle:z,noOfYTicks:pe,maxDate:V,minDate:F,curveType:N,styles:a,classNames:m,precision:w,customLayers:K}=oe,J=h.useRef(null),d=$.useInView(J,{once:s.once,amount:s.amount}),[A,he]=h.useState(!1);h.useEffect(()=>{if(d&&!A){const e=setTimeout(()=>{he(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,A,s.duration]);const de=N==="linear"?Ae.curveLinear:N==="step"?re.curveStep:N==="stepAfter"?re.stepAfter:N==="stepBefore"?re.stepBefore:re.monotoneX,[k,Q]=h.useState(void 0),[Z,_]=h.useState(void 0),[R,E]=h.useState(void 0),f={top:le,bottom:P,left:z?j+30:j,right:ae},ee=h.useRef(null),i=Ce.sortBy(C.map(e=>({...e,date:x.parse(`${e.date}`,r,new Date)})),"date"),te=q.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:x.parse(`${e.coordinates[0]}`,r,new Date),e.coordinates[1]===null?null:x.parse(`${e.coordinates[1]}`,r,new Date)]})),ie=me.map(e=>({...e,coordinates:e.coordinates.map((y,O)=>O%2===0?x.parse(`${y}`,r,new Date):y)})),l=b-f.left-f.right,p=T-f.top-f.bottom,se=F?x.parse(`${F}`,r,new Date):i[0].date,c=V?x.parse(`${V}`,r,new Date):i[i.length-1].date,g=D.checkIfNullOrUndefined(X)?Math.min(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y).filter(e=>e!=null)):0:X,ge=Math.max(...i.map(e=>e.y).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y).filter(e=>e!=null)):0,n=Ie.time().domain([se,c]).range([0,l]),o=Me.linear().domain([g,D.checkIfNullOrUndefined(U)?ge>0?ge:0:U]).range([p,0]).nice(),je=Ae.line().x(e=>n(e.date)).y(e=>o(e.y)).curve(de),ve=o.ticks(pe),we=n.ticks(W);h.useEffect(()=>{const e=O=>{const ne=i[Fe.bisectCenter(i.map(fe=>fe.date),n.invert(He.pointer(O)[0]),1)];Q(ne||i[i.length-1]),I?.(ne||i[i.length-1]),E(O.clientY),_(O.clientX)},y=()=>{Q(void 0),_(void 0),E(void 0),I?.(void 0)};Ve.select(ee.current).on("mousemove",e).on("mouseout",y)},[n,i,I]);const Oe=Ee.linearRegression(i.filter(e=>!D.checkIfNullOrUndefined(e.date)&&!D.checkIfNullOrUndefined(e.y)).map(e=>[n(e.date),o(e.y)])),Re=Ee.linearRegressionLine(Oe);return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx($.motion.svg,{width:`${b}px`,height:`${T}px`,viewBox:`0 0 ${b} ${T}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[t.jsxRuntimeExports.jsx(Te.HighlightArea,{areaSettings:te,width:l,height:p,scale:n,animate:s,isInView:d}),t.jsxRuntimeExports.jsx(ye.CustomArea,{areaSettings:ie,scaleX:n,scaleY:o,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx($e.YTicksAndGridLines,{values:ve.filter(e=>e!==0),y:ve.filter(e=>e!==0).map(e=>o(e)),x1:0-j,x2:l+f.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},suffix:L,prefix:S,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:w}),t.jsxRuntimeExports.jsx(Ne.Axis,{y1:o(g<0?0:g),y2:o(g<0?0:g),x1:0-j,x2:l+f.right,label:be.numberFormattingFunction(g<0?0:g,"NA",w,S,L),labelPos:{x:0-j,y:o(g<0?0:g),dx:0,dy:ge<0?"1em":-5},classNames:{axis:m?.xAxis?.axis,label:m?.yAxis?.labels},styles:{axis:a?.xAxis?.axis,label:a?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(ke.AxisTitle,{x:0-j-15,y:p/2,style:a?.yAxis?.title,className:m?.yAxis?.title,text:z,rotate90:!0})]}),t.jsxRuntimeExports.jsx(De.XTicksAndGridLines,{values:we.map(e=>x.format(e,r)),x:we.map(e=>n(e)),y1:0,y2:p,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:H.cnExports.cn("opacity-0",m?.xAxis?.gridLines),labels:H.cnExports.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",m?.xAxis?.labels)},suffix:L,prefix:S,labelType:"primary",showGridLines:!0,precision:w}),K.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx($.motion.path,{style:{stroke:G,fill:"none",strokeWidth:ce},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:je(i)||"",opacity:1},whileInView:{pathLength:1,d:je(i)||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),k?t.jsxRuntimeExports.jsx("line",{y1:0,y2:p,x1:n(k.date),x2:n(k.date),className:H.cnExports.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",m?.mouseOverLine),style:a?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,y)=>t.jsxRuntimeExports.jsx($.motion.g,{children:D.checkIfNullOrUndefined(e.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[xe?t.jsxRuntimeExports.jsx($.motion.circle,{r:l/i.length<5?0:l/i.length<20?2:4,style:{fill:G},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:n(e.date),cy:o(e.y)},whileInView:{opacity:1,transition:{duration:A?s.duration:.5,delay:A?0:s.duration},cx:n(e.date),cy:o(e.y)}},initial:"initial",animate:d?"whileInView":"initial"}):null,u?t.jsxRuntimeExports.jsx($.motion.text,{dy:-8,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:H.cnExports.cn("graph-value text-xs font-bold",m?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:n(e.date),y:o(e.y)},whileInView:{opacity:1,x:n(e.date),y:o(e.y),transition:{duration:A?s.duration:.5,delay:A?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:be.numberFormattingFunction(e.y,"NA",w,S,L)}):null]})},y))}),Y?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Y.map((e,y)=>t.jsxRuntimeExports.jsx(Se.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-j,x2:l+f.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y))}):null,t.jsxRuntimeExports.jsx("g",{children:ue.map((e,y)=>{const O=ye.getLineEndPoint({x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},D.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),ne=e.showConnector?{y1:O.y,x1:O.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date)):0,circleRadius:D.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,fe={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:B?0:e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:B?e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0):l-(e.xCoordinate?n(x.parse(`${e.xCoordinate}`,r,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(ye.Annotation,{color:e.color,connectorsSettings:ne,labelSettings:fe,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:d},y)})}),t.jsxRuntimeExports.jsx("g",{children:M?t.jsxRuntimeExports.jsx(qe.RegressionLine,{x1:0,x2:l,y1:Re(0),y2:Re(l),graphHeight:p,graphWidth:l,className:m?.regLine,style:a?.regLine,color:typeof M=="string"?M:void 0,animate:s,isInView:d}):null}),K.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:ee,style:{fill:"none",pointerEvents:"all"},width:l,height:p})]})}),k&&v&&Z&&R?t.jsxRuntimeExports.jsx(Le.Tooltip,{data:k,body:v,xPos:Z,yPos:R,backgroundStyle:a?.tooltip,className:m?.tooltip}):null]})}function Ue(oe){const{data:C,graphTitle:b,lineColor:T,suffix:G="",sources:L,prefix:S="",graphDescription:r,height:q,width:u,footNote:W,noOfXTicks:ae=10,dateFormat:j="yyyy",showValues:le=!1,padding:P,backgroundColor:v=!1,leftMargin:I=30,rightMargin:Y=30,topMargin:X=20,bottomMargin:U=25,relativeHeight:s,tooltip:B,onSeriesMouseOver:ce,highlightAreaSettings:xe=[],graphID:ue,minValue:me,maxValue:M,maxDate:z,minDate:pe,graphDownload:V=!1,dataDownload:F=!1,animate:N=!1,language:a="en",refValues:m=[],minHeight:w=0,strokeWidth:K=2,showDots:J=!0,annotations:d=[],customHighlightAreaSettings:A=[],theme:he="light",ariaLabel:de,regressionLine:k=!1,yAxisTitle:Q,noOfYTicks:Z=5,curveType:_="curve",styles:R,classNames:E,precision:f=2,customLayers:ee=[]}=oe,[i,te]=h.useState(0),[ie,l]=h.useState(0),p=h.useRef(null),se=h.useRef(null);return h.useEffect(()=>{const c=new ResizeObserver(g=>{te(u||g[0].target.clientWidth||620),l(q||g[0].target.clientHeight||480)});return p.current&&(l(p.current.clientHeight||480),te(p.current.clientWidth||620),u||c.observe(p.current)),()=>c.disconnect()},[u,q]),t.jsxRuntimeExports.jsx("div",{className:`${he||"light"} flex ${u?"w-fit grow-0":"w-full grow"}`,dir:a==="he"||a==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:H.cnExports.cn(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${a||"en"}`,E?.graphContainer),style:{...R?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:ue,ref:se,"aria-label":de||`${b?`The graph shows ${b}. `:""}This is a line chart that shows trends over time.${r?` ${r}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?P||"1rem":P||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[b||r||V||F?t.jsxRuntimeExports.jsx(We.GraphHeader,{styles:{title:R?.title,description:R?.description},classNames:{title:E?.title,description:E?.description},graphTitle:b,graphDescription:r,width:u,graphDownload:V?se.current:void 0,dataDownload:F?C.map(c=>c.data).filter(c=>c!==void 0).length>0?C.map(c=>c.data).filter(c=>c!==void 0):C.filter(c=>c!==void 0):null}):null,C.length===0?t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:t.jsxRuntimeExports.jsx(Ye.EmptyState,{})}):t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:p,"aria-label":"Graph area",children:(u||i)&&(q||ie)?t.jsxRuntimeExports.jsx(Xe,{data:C,lineColor:T||Pe.Colors.primaryColors["blue-600"],width:u||i,height:Math.max(w,q||(s?w?(u||i)*s>w?(u||i)*s:w:(u||i)*s:ie)),suffix:G,prefix:S,dateFormat:j,showValues:le,noOfXTicks:ae,leftMargin:I,rightMargin:Y,topMargin:X,bottomMargin:U,tooltip:B,highlightAreaSettings:xe,onSeriesMouseOver:ce,refValues:m,minValue:me,maxValue:M,animate:N===!0?{duration:.5,once:!0,amount:.5}:N||{duration:0,once:!0,amount:0},rtl:a==="he"||a==="ar",strokeWidth:K,showDots:J,annotations:d,customHighlightAreaSettings:A,regressionLine:k,yAxisTitle:Q,noOfYTicks:Z,maxDate:z,minDate:pe,curveType:_,styles:R,classNames:E,precision:f,customLayers:ee}):null}),L||W?t.jsxRuntimeExports.jsx(Ge.GraphFooter,{styles:{footnote:R?.footnote,source:R?.source},classNames:{footnote:E?.footnote,source:E?.source},sources:L,footNote:W,width:u}):null]})})})})}exports.SimpleLineChart=Ue;
|
|
2
|
+
//# sourceMappingURL=SimpleLineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleLineChart.js","sources":["../src/Components/Graphs/LineCharts/LineChart/Graph.tsx","../src/Components/Graphs/LineCharts/LineChart/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport sortBy from 'lodash.sortby';\r\nimport { linearRegression, linearRegressionLine } from 'simple-statistics';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n AnnotationSettingsDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomHighlightAreaSettingsDataType,\r\n CustomLayerDataType,\r\n HighlightAreaSettingsDataType,\r\n LineChartDataType,\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 { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { getLineEndPoint } from '@/Utils/getLineEndPoint';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { RefLineY } from '@/Components/Elements/ReferenceLine';\r\nimport { RegressionLine } from '@/Components/Elements/RegressionLine';\r\nimport { Annotation } from '@/Components/Elements/Annotations';\r\nimport { YTicksAndGridLines } from '@/Components/Elements/Axes/YTicksAndGridLines';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\nimport { CustomArea } from '@/Components/Elements/HighlightArea/customArea';\r\n\r\ninterface Props {\r\n data: LineChartDataType[];\r\n lineColor: string;\r\n width: number;\r\n height: number;\r\n suffix: string;\r\n prefix: string;\r\n dateFormat: string;\r\n showValues: boolean;\r\n noOfXTicks: 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 refValues: ReferenceDataType[];\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\r\n maxValue?: number;\r\n minValue?: number;\r\n animate: AnimateDataType;\r\n rtl: boolean;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n annotations: AnnotationSettingsDataType[];\r\n customHighlightAreaSettings: CustomHighlightAreaSettingsDataType[];\r\n regressionLine: boolean | string;\r\n yAxisTitle?: string;\r\n noOfYTicks: number;\r\n minDate?: string | number;\r\n maxDate?: string | number;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\ninterface FormattedDataType {\r\n y: number;\r\n date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColor,\r\n suffix,\r\n prefix,\r\n dateFormat,\r\n highlightAreaSettings,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n onSeriesMouseOver,\r\n refValues,\r\n minValue,\r\n maxValue,\r\n animate,\r\n rtl,\r\n strokeWidth,\r\n showDots,\r\n annotations,\r\n customHighlightAreaSettings,\r\n regressionLine,\r\n yAxisTitle,\r\n noOfYTicks,\r\n maxDate,\r\n minDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\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 const [hasAnimatedOnce, setHasAnimatedOnce] = useState(false);\r\n\r\n useEffect(() => {\r\n if (isInView && !hasAnimatedOnce) {\r\n const timeout = setTimeout(\r\n () => {\r\n setHasAnimatedOnce(true);\r\n },\r\n (animate.duration + 0.5) * 1000,\r\n );\r\n return () => clearTimeout(timeout);\r\n }\r\n }, [isInView, hasAnimatedOnce, animate.duration]);\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\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 margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: yAxisTitle ? leftMargin + 30 : leftMargin,\r\n right: rightMargin,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted = sortBy(\r\n data.map(d => ({\r\n ...d,\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n })),\r\n 'date',\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const customHighlightAreaSettingsFormatted = customHighlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: d.coordinates.map((el, j) =>\r\n j % 2 === 0 ? parse(`${el}`, dateFormat, new Date()) : (el as number),\r\n ),\r\n }));\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minYear = minDate ? parse(`${minDate}`, dateFormat, new Date()) : dataFormatted[0].date;\r\n const maxYear = maxDate\r\n ? parse(`${maxDate}`, dateFormat, new Date())\r\n : dataFormatted[dataFormatted.length - 1].date;\r\n const minParam: number = !checkIfNullOrUndefined(minValue)\r\n ? (minValue as number)\r\n : Math.min(...dataFormatted.map(d => d.y).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam: number =\r\n Math.max(...dataFormatted.map(d => d.y).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n const y = scaleLinear()\r\n .domain([\r\n minParam,\r\n checkIfNullOrUndefined(maxValue) ? (maxParam > 0 ? maxParam : 0) : (maxValue as number),\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape = line<FormattedDataType>()\r\n .x(d => x(d.date))\r\n .y(d => y(d.y))\r\n .curve(curve);\r\n const yTicks = y.ticks(noOfYTicks);\r\n const xTicks = x.ticks(noOfXTicks);\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mousemove = (event: any) => {\r\n const selectedData =\r\n dataFormatted[\r\n bisectCenter(\r\n dataFormatted.map(d => d.date),\r\n x.invert(pointer(event)[0]),\r\n 1,\r\n )\r\n ];\r\n setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n };\r\n const mouseout = () => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n };\r\n select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n }, [x, dataFormatted, onSeriesMouseOver]);\r\n const regressionLineParam = linearRegression(\r\n dataFormatted\r\n .filter(d => !checkIfNullOrUndefined(d.date) && !checkIfNullOrUndefined(d.y))\r\n .map(d => [x(d.date), y(d.y as number)]),\r\n );\r\n const predict = linearRegressionLine(regressionLineParam);\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 <HighlightArea\r\n areaSettings={highlightAreaSettingsFormatted}\r\n width={graphWidth}\r\n height={graphHeight}\r\n scale={x}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <CustomArea\r\n areaSettings={customHighlightAreaSettingsFormatted}\r\n scaleX={x}\r\n scaleY={y}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <g>\r\n <YTicksAndGridLines\r\n values={yTicks.filter(d => d !== 0)}\r\n y={yTicks.filter(d => d !== 0).map(d => y(d))}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.right}\r\n styles={{\r\n gridLines: styles?.yAxis?.gridLines,\r\n labels: styles?.yAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: classNames?.yAxis?.gridLines,\r\n labels: classNames?.yAxis?.labels,\r\n }}\r\n suffix={suffix}\r\n prefix={prefix}\r\n labelType='secondary'\r\n showGridLines\r\n labelPos='vertical'\r\n precision={precision}\r\n />\r\n <Axis\r\n y1={y(minParam < 0 ? 0 : minParam)}\r\n y2={y(minParam < 0 ? 0 : minParam)}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.right}\r\n label={numberFormattingFunction(\r\n minParam < 0 ? 0 : minParam,\r\n 'NA',\r\n precision,\r\n prefix,\r\n suffix,\r\n )}\r\n labelPos={{\r\n x: 0 - leftMargin,\r\n y: y(minParam < 0 ? 0 : minParam),\r\n dx: 0,\r\n dy: maxParam < 0 ? '1em' : -5,\r\n }}\r\n classNames={{\r\n axis: classNames?.xAxis?.axis,\r\n label: classNames?.yAxis?.labels,\r\n }}\r\n styles={{\r\n axis: styles?.xAxis?.axis,\r\n label: styles?.yAxis?.labels,\r\n }}\r\n />\r\n <AxisTitle\r\n x={0 - leftMargin - 15}\r\n y={graphHeight / 2}\r\n style={styles?.yAxis?.title}\r\n className={classNames?.yAxis?.title}\r\n text={yAxisTitle}\r\n rotate90\r\n />\r\n </g>\r\n <XTicksAndGridLines\r\n values={xTicks.map(d => format(d, dateFormat))}\r\n x={xTicks.map(d => x(d))}\r\n y1={0}\r\n y2={graphHeight}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n labels: cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs',\r\n classNames?.xAxis?.labels,\r\n ),\r\n }}\r\n suffix={suffix}\r\n prefix={prefix}\r\n labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g>\r\n <motion.path\r\n style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth,\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d: lineShape(dataFormatted) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d: lineShape(dataFormatted) || '',\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 {mouseOverData ? (\r\n <line\r\n y1={0}\r\n y2={graphHeight}\r\n x1={x(mouseOverData.date)}\r\n x2={x(mouseOverData.date)}\r\n className={cn(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y(d.y as number) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y(d.y as number),\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 dy={-8}\r\n style={{\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y(d.y) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y(d.y),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(d.y, 'NA', precision, prefix, suffix)}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {refValues ? (\r\n <>\r\n {refValues.map((el, i) => (\r\n <RefLineY\r\n key={i}\r\n text={el.text}\r\n color={el.color}\r\n y={y(el.value as number)}\r\n x1={0 - leftMargin}\r\n x2={graphWidth + margin.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 <g>\r\n {annotations.map((d, i) => {\r\n const endPoints = getLineEndPoint(\r\n {\r\n x: d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n y: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n : 0 + (d.yOffset || 0) - 8,\r\n },\r\n {\r\n x: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n y: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n },\r\n checkIfNullOrUndefined(d.connectorRadius) ? 3.5 : (d.connectorRadius as number),\r\n );\r\n const connectorSettings = d.showConnector\r\n ? {\r\n y1: endPoints.y,\r\n x1: endPoints.x,\r\n y2: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0)\r\n : 0 + (d.yOffset || 0),\r\n x2: d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n cy: d.yCoordinate ? y(d.yCoordinate as number) : 0,\r\n cx: d.xCoordinate ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) : 0,\r\n circleRadius: checkIfNullOrUndefined(d.connectorRadius)\r\n ? 3.5\r\n : (d.connectorRadius as number),\r\n strokeWidth: d.showConnector === true ? 2 : Math.min(d.showConnector || 0, 1),\r\n }\r\n : undefined;\r\n const labelSettings = {\r\n y: d.yCoordinate\r\n ? y(d.yCoordinate as number) + (d.yOffset || 0) - 8\r\n : 0 + (d.yOffset || 0) - 8,\r\n x: rtl\r\n ? 0\r\n : d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0),\r\n width: rtl\r\n ? d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0)\r\n : graphWidth -\r\n (d.xCoordinate\r\n ? x(parse(`${d.xCoordinate}`, dateFormat, new Date())) + (d.xOffset || 0)\r\n : 0 + (d.xOffset || 0)),\r\n maxWidth: d.maxWidth,\r\n fontWeight: d.fontWeight,\r\n align: d.align,\r\n };\r\n return (\r\n <Annotation\r\n key={i}\r\n color={d.color}\r\n connectorsSettings={connectorSettings}\r\n labelSettings={labelSettings}\r\n text={d.text}\r\n classNames={d.classNames}\r\n styles={d.styles}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n );\r\n })}\r\n </g>\r\n <g>\r\n {regressionLine ? (\r\n <RegressionLine\r\n x1={0}\r\n x2={graphWidth}\r\n y1={predict(0)}\r\n y2={predict(graphWidth)}\r\n graphHeight={graphHeight}\r\n graphWidth={graphWidth}\r\n className={classNames?.regLine}\r\n style={styles?.regLine}\r\n color={typeof regressionLine === 'string' ? regressionLine : undefined}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n <rect\r\n ref={MouseoverRectRef}\r\n style={{\r\n fill: 'none',\r\n pointerEvents: 'all',\r\n }}\r\n width={graphWidth}\r\n height={graphHeight}\r\n />\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 </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport {\r\n AnnotationSettingsDataType,\r\n CustomHighlightAreaSettingsDataType,\r\n Languages,\r\n LineChartDataType,\r\n ReferenceDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\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 { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: LineChartDataType[];\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 of the lines */\r\n lineColor?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values */\r\n prefix?: string;\r\n /** Suffix for values */\r\n suffix?: string;\r\n /** Maximum value for the chart */\r\n maxValue?: number;\r\n /** Minimum value for the chart */\r\n minValue?: number;\r\n /** Reference values for comparison */\r\n refValues?: ReferenceDataType[];\r\n /** Maximum value of the date for the chart */\r\n maxDate?: string | number;\r\n /** Minimum value of the date for the chart */\r\n minDate?: string | number;\r\n /** No. of ticks on the x-axis */\r\n noOfXTicks?: number;\r\n /** No. of ticks on the y-axis */\r\n noOfYTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of dots on the line */\r\n showDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Title for the Y-axis */\r\n yAxisTitle?: string;\r\n /** Annotations on the chart */\r\n annotations?: AnnotationSettingsDataType[];\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\r\n /** Highlighted area(custom shape) on the chart */\r\n customHighlightAreaSettings?: CustomHighlightAreaSettingsDataType[];\r\n /** Toggles the visibility of the regression line for the data. If the type is string then string is use to define the color of the line. */\r\n regressionLine?: boolean | string;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\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 /** 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\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 /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_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 SimpleLineChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n lineColor,\r\n suffix = '',\r\n sources,\r\n prefix = '',\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n backgroundColor = false,\r\n leftMargin = 30,\r\n rightMargin = 30,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n relativeHeight,\r\n tooltip,\r\n onSeriesMouseOver,\r\n highlightAreaSettings = [],\r\n graphID,\r\n minValue,\r\n maxValue,\r\n maxDate,\r\n minDate,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n language = 'en',\r\n refValues = [],\r\n minHeight = 0,\r\n strokeWidth = 2,\r\n showDots = true,\r\n annotations = [],\r\n customHighlightAreaSettings = [],\r\n theme = 'light',\r\n ariaLabel,\r\n regressionLine = false,\r\n yAxisTitle,\r\n noOfYTicks = 5,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\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 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 line chart that shows trends over time.${\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 {data.length === 0 ? (\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n <EmptyState />\r\n </div>\r\n ) : (\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={data}\r\n lineColor={lineColor || Colors.primaryColors['blue-600']}\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 suffix={suffix}\r\n prefix={prefix}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\r\n noOfXTicks={noOfXTicks}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n tooltip={tooltip}\r\n highlightAreaSettings={highlightAreaSettings}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n refValues={refValues}\r\n minValue={minValue}\r\n maxValue={maxValue}\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 rtl={language === 'he' || language === 'ar'}\r\n strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n annotations={annotations}\r\n customHighlightAreaSettings={customHighlightAreaSettings}\r\n regressionLine={regressionLine}\r\n yAxisTitle={yAxisTitle}\r\n noOfYTicks={noOfYTicks}\r\n maxDate={maxDate}\r\n minDate={minDate}\r\n curveType={curveType}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n )}\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","lineColor","suffix","prefix","dateFormat","highlightAreaSettings","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","onSeriesMouseOver","refValues","minValue","maxValue","animate","rtl","strokeWidth","showDots","annotations","customHighlightAreaSettings","regressionLine","yAxisTitle","noOfYTicks","maxDate","minDate","curveType","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","sortBy","d","parse","highlightAreaSettingsFormatted","customHighlightAreaSettingsFormatted","el","j","graphWidth","graphHeight","minYear","maxYear","minParam","checkIfNullOrUndefined","maxParam","x","scaleTime","y","scaleLinear","lineShape","line","yTicks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","regressionLineParam","linearRegression","predict","linearRegressionLine","jsxs","Fragment","jsx","motion","HighlightArea","CustomArea","YTicksAndGridLines","Axis","numberFormattingFunction","AxisTitle","XTicksAndGridLines","format","cn","i","RefLineY","endPoints","getLineEndPoint","connectorSettings","labelSettings","Annotation","RegressionLine","Tooltip","SimpleLineChart","graphTitle","sources","graphDescription","footNote","padding","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","Colors","GraphFooter"],"mappings":"ipCA0FO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,UAAAC,EACA,OAAAC,EACA,OAAAC,EACA,WAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,WAAAC,EACA,YAAAC,GACA,WAAAC,EACA,UAAAC,GACA,aAAAC,EACA,QAAA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