@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,180 @@
|
|
|
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
|
+
declare interface ClassNameObject {
|
|
24
|
+
title?: string;
|
|
25
|
+
footnote?: string;
|
|
26
|
+
source?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
xAxis?: AxesClassNameObject;
|
|
30
|
+
yAxis?: AxesClassNameObject;
|
|
31
|
+
legend?: string;
|
|
32
|
+
graphContainer?: string;
|
|
33
|
+
graphObjectValues?: string;
|
|
34
|
+
dataConnectors?: string;
|
|
35
|
+
mouseOverLine?: string;
|
|
36
|
+
regLine?: string;
|
|
37
|
+
dataCards?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare type CurveTypes = 'linear' | 'curve' | 'step' | 'stepAfter' | 'stepBefore';
|
|
41
|
+
|
|
42
|
+
declare interface CustomLayerDataType {
|
|
43
|
+
position: 'before' | 'after';
|
|
44
|
+
layer: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export declare function DualAxisLineChart(props: Props): JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare interface DualAxisLineChartDataType {
|
|
50
|
+
date: number | string;
|
|
51
|
+
y1?: number | null;
|
|
52
|
+
y2?: number | null;
|
|
53
|
+
data?: object;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare interface HighlightAreaSettingsDataType {
|
|
57
|
+
coordinates: [number | string | null, number | string | null];
|
|
58
|
+
style?: React.CSSProperties;
|
|
59
|
+
className?: string;
|
|
60
|
+
color?: string;
|
|
61
|
+
strokeWidth?: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
65
|
+
|
|
66
|
+
declare interface Props {
|
|
67
|
+
/** Array of data objects */
|
|
68
|
+
data: DualAxisLineChartDataType[];
|
|
69
|
+
/** Title of the graph */
|
|
70
|
+
graphTitle?: string | React.ReactNode;
|
|
71
|
+
/** Description of the graph */
|
|
72
|
+
graphDescription?: string | React.ReactNode;
|
|
73
|
+
/** Footnote for the graph */
|
|
74
|
+
footNote?: string | React.ReactNode;
|
|
75
|
+
/** Source data for the graph */
|
|
76
|
+
sources?: SourcesDataType[];
|
|
77
|
+
/** Accessibility label */
|
|
78
|
+
ariaLabel?: string;
|
|
79
|
+
/** Array of colors for the 2 lines */
|
|
80
|
+
lineColors?: [string, string];
|
|
81
|
+
/** Title for the color legend */
|
|
82
|
+
colorLegendTitle?: string;
|
|
83
|
+
/** Background color of the graph */
|
|
84
|
+
backgroundColor?: string | boolean;
|
|
85
|
+
/** Custom styles for the graph. Each object should be a valid React CSS style object. */
|
|
86
|
+
styles?: StyleObject;
|
|
87
|
+
/** Custom class names */
|
|
88
|
+
classNames?: ClassNameObject;
|
|
89
|
+
/** Width of the graph */
|
|
90
|
+
width?: number;
|
|
91
|
+
/** Height of the graph */
|
|
92
|
+
height?: number;
|
|
93
|
+
/** Minimum height of the graph */
|
|
94
|
+
minHeight?: number;
|
|
95
|
+
/** Relative height scaling factor. This overwrites the height props */
|
|
96
|
+
relativeHeight?: number;
|
|
97
|
+
/** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
|
|
98
|
+
padding?: string;
|
|
99
|
+
/** Left margin of the graph */
|
|
100
|
+
leftMargin?: number;
|
|
101
|
+
/** Right margin of the graph */
|
|
102
|
+
rightMargin?: number;
|
|
103
|
+
/** Top margin of the graph */
|
|
104
|
+
topMargin?: number;
|
|
105
|
+
/** Bottom margin of the graph */
|
|
106
|
+
bottomMargin?: number;
|
|
107
|
+
/** Prefix for values of the lines */
|
|
108
|
+
linePrefixes?: [string, string];
|
|
109
|
+
/** Suffix for values of the lines */
|
|
110
|
+
lineSuffixes?: [string, string];
|
|
111
|
+
/** Maximum value of the date for the chart */
|
|
112
|
+
maxDate?: string | number;
|
|
113
|
+
/** Minimum value of the date for the chart */
|
|
114
|
+
minDate?: string | number;
|
|
115
|
+
/** No. of ticks on the x-axis */
|
|
116
|
+
noOfXTicks?: number;
|
|
117
|
+
/** No. of ticks on the y-axis */
|
|
118
|
+
noOfYTicks?: number;
|
|
119
|
+
/** Toggle visibility of values */
|
|
120
|
+
showValues?: boolean;
|
|
121
|
+
/** Toggle visibility of dots on the line */
|
|
122
|
+
showDots?: boolean;
|
|
123
|
+
/** Stroke width of the line */
|
|
124
|
+
strokeWidth?: number;
|
|
125
|
+
/** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */
|
|
126
|
+
animate?: boolean | AnimateDataType;
|
|
127
|
+
/** Enables same axis for the 2 lines */
|
|
128
|
+
sameAxes?: boolean;
|
|
129
|
+
/** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */
|
|
130
|
+
showColorScale?: boolean;
|
|
131
|
+
/** Labels for the lines */
|
|
132
|
+
labels: [string, string];
|
|
133
|
+
/** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */
|
|
134
|
+
dateFormat?: string;
|
|
135
|
+
/** Highlighted area(square) on the chart */
|
|
136
|
+
highlightAreaSettings?: HighlightAreaSettingsDataType[];
|
|
137
|
+
/** Curve type for the line */
|
|
138
|
+
curveType?: CurveTypes;
|
|
139
|
+
/** Specifies the number of decimal places to display in the value. */
|
|
140
|
+
precision?: number;
|
|
141
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
142
|
+
customLayers?: CustomLayerDataType[];
|
|
143
|
+
/** Enable graph download option as png */
|
|
144
|
+
graphDownload?: boolean;
|
|
145
|
+
/** Enable data download option as a csv */
|
|
146
|
+
dataDownload?: boolean;
|
|
147
|
+
/** 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 */
|
|
148
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
149
|
+
/** Callback for mouse over event */
|
|
150
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
151
|
+
/** Language setting */
|
|
152
|
+
language?: Languages;
|
|
153
|
+
/** Color theme */
|
|
154
|
+
theme?: 'light' | 'dark';
|
|
155
|
+
/** Unique ID for the graph */
|
|
156
|
+
graphID?: string;
|
|
157
|
+
}
|
|
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
|
+
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"),k=require("./Typography-CDR-DAHH.cjs"),C=require("./parse-hMnG_lRV.cjs"),Ne=require("./index-BzeLQvXk.cjs"),re=require("./numberFormattingFunction.js"),Ie=require("./Tooltip-BM18N_3l.cjs"),g=require("./checkIfNullOrUndefined.js"),Oe=require("./XTicksAndGridLines-DuK35ROS.cjs"),ye=require("./Axis-BlyBRMNw.cjs"),we=require("./AxisTitle-BY8MI9jC.cjs"),qe=require("./index-BYroABPm.cjs"),R=require("./use-in-view-Dl1CsAIo.cjs"),De=require("./time-Byw_jYQ7.cjs"),Ee=require("./linear-BVckp9RD.cjs"),ge=require("./line-DHV4JwCR.cjs"),ae=require("./step-BZ3C8QFW.cjs"),Le=require("./select-Bnfk0lJx.cjs"),Te=require("./init-DU0ybBc_.cjs"),Se=require("./pointer-Dkq5NV1q.cjs"),Me=require("./GraphFooter.js"),$e=require("./GraphHeader.js"),Ve=require("./ColorLegend.js"),Re=require("./Colors.js"),Fe=require("./EmptyState-BQguKAp5.cjs");function Ce(oe){const{data:N,width:A,height:S,lineColors:n,labels:p,sameAxes:c,dateFormat:j,showValues:W,noOfXTicks:le,rightMargin:xe,leftMargin:X,topMargin:Y,bottomMargin:ce,tooltip:v,highlightAreaSettings:ue,onSeriesMouseOver:H,animate:s,strokeWidth:B,showDots:P,noOfYTicks:z,lineSuffixes:M,linePrefixes:$,minDate:K,maxDate:I,curveType:V,styles:o,classNames:r,precision:b,customLayers:U}=oe,J=d.useRef(null),h=R.useInView(J,{once:s.once,amount:s.amount}),[m,me]=d.useState(!1);d.useEffect(()=>{if(h&&!m){const e=setTimeout(()=>{me(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[h,m,s.duration]);const O=V==="linear"?ge.curveLinear:V==="step"?ae.curveStep:V==="stepAfter"?ae.stepAfter:V==="stepBefore"?ae.stepBefore:ae.monotoneX,[q,Q]=d.useState(void 0),[Z,_]=d.useState(void 0),[ee,te]=d.useState(void 0),f={top:Y,bottom:ce,left:X+50,right:xe+65},w=d.useRef(null),i=Ne.sortBy(N.map(e=>({...e,date:C.parse(`${e.date}`,j,new Date)})),"date"),de=ue.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:C.parse(`${e.coordinates[0]}`,j,new Date),e.coordinates[1]===null?null:C.parse(`${e.coordinates[1]}`,j,new Date)]})),u=A-f.left-f.right,a=S-f.top-f.bottom,ie=K?C.parse(`${K}`,j,new Date):i[0].date,se=I?C.parse(`${I}`,j,new Date):i[i.length-1].date,F=Math.min(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y1).filter(e=>e!=null)):0,E=Math.min(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y2).filter(e=>e!=null)):0,D=Math.max(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y1).filter(e=>e!=null)):0,l=Math.max(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y2).filter(e=>e!=null)):0,G=F<E?F:E,ne=D>l?D:l,x=De.time().domain([ie,se]).range([0,u]),L=Ee.linear().domain([c?G:F,c?ne>0?ne:0:D>0?D:0]).range([a,0]).nice(),y=Ee.linear().domain([c?G:E,c?ne>0?ne:0:l>0?l:0]).range([a,0]).nice(),fe=ge.line().defined(e=>!g.checkIfNullOrUndefined(e.y1)).x(e=>x(e.date)).y(e=>L(e.y1)).curve(O),pe=ge.line().defined(e=>!g.checkIfNullOrUndefined(e.y2)).x(e=>x(e.date)).y(e=>y(e.y2)).curve(O),Ae=L.ticks(z),be=y.ticks(z),je=x.ticks(le);return d.useEffect(()=>{const e=he=>{const ve=i[Te.bisectCenter(i.map(ke=>ke.date),x.invert(Se.pointer(he)[0]),1)];Q(ve||i[i.length-1]),H?.(ve||i[i.length-1]),te(he.clientY),_(he.clientX)},T=()=>{Q(void 0),_(void 0),te(void 0),H?.(void 0)};Le.select(w.current).on("mousemove",e).on("mouseout",T)},[x,i,H]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(R.motion.svg,{width:`${A}px`,height:`${S}px`,viewBox:`0 0 ${A} ${S}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[t.jsxRuntimeExports.jsx(qe.HighlightArea,{areaSettings:de,width:u,height:a,scale:x,animate:s,isInView:h}),t.jsxRuntimeExports.jsxs("g",{children:[Ae.map((e,T)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:L(e),y2:L(e),x1:-15,x2:-20,style:{stroke:n[0],strokeWidth:1,...o?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:-25,y:L(e),dy:"0.33em",className:k.cnExports.cn("text-xs",r?.yAxis?.labels),style:{textAnchor:"end",fill:n[0],...o?.yAxis?.labels||{}},children:re.numberFormattingFunction(e,"NA",b,$[0],M[0])})]},T)),t.jsxRuntimeExports.jsx(ye.Axis,{y1:0,y2:a,x1:-15,x2:-15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[0],...o?.xAxis?.axis||{}}}}),t.jsxRuntimeExports.jsx(we.AxisTitle,{x:10-f.left,y:a/2,style:{fill:n[0],...o?.yAxis?.title||{}},className:r?.yAxis?.title,text:p[0].length>100?`${p[0].substring(0,100)}...`:p[0],rotate90:!0})]}),t.jsxRuntimeExports.jsxs("g",{children:[be.map((e,T)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:y(e),y2:y(e),x1:u+15,x2:u+20,style:{stroke:n[1],strokeWidth:1,...o?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:u+25,y:y(e),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:n[1],...o?.yAxis?.labels||{}},className:k.cnExports.cn("text-xs",r?.yAxis?.labels),children:re.numberFormattingFunction(e,"NA",b,$[1],M[1])})]},T)),t.jsxRuntimeExports.jsx(ye.Axis,{y1:0,y2:a,x1:u+15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[1],...o?.xAxis?.axis||{}}}}),t.jsxRuntimeExports.jsx(we.AxisTitle,{x:u+f.right-15,y:a/2,style:{fill:n[1],...o?.yAxis?.title||{}},className:r?.yAxis?.title,text:p[1].length>100?`${p[1].substring(0,100)}...`:p[1],rotate90:!0})]}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(ye.Axis,{y1:a,y2:a,x1:-15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:o?.xAxis?.axis}}),t.jsxRuntimeExports.jsx(Oe.XTicksAndGridLines,{values:je.map(e=>C.format(e,j)),x:je.map(e=>x(e)),y1:0,y2:a,styles:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},classNames:{gridLines:k.cnExports.cn("opacity-0",r?.xAxis?.gridLines),labels:k.cnExports.cn("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",r?.xAxis?.labels)},labelType:"primary",showGridLines:!0,precision:b})]}),U.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(R.motion.path,{style:{stroke:n[0],strokeWidth:B,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:fe(i.filter(e=>!g.checkIfNullOrUndefined(e.y1)))||"",opacity:1},whileInView:{pathLength:1,d:fe(i.filter(e=>!g.checkIfNullOrUndefined(e.y1)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:h?"whileInView":"initial"}),t.jsxRuntimeExports.jsx(R.motion.path,{d:pe(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",style:{stroke:n[1],strokeWidth:B,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:pe(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",opacity:1},whileInView:{pathLength:1,d:pe(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:h?"whileInView":"initial"}),q?t.jsxRuntimeExports.jsx("line",{y1:0,y2:a,x1:x(q.date),x2:x(q.date),className:k.cnExports.cn("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",r?.mouseOverLine),style:o?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,T)=>t.jsxRuntimeExports.jsxs(R.motion.g,{children:[g.checkIfNullOrUndefined(e.y1)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(R.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[0]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(e.date),cy:L(e.y1)},whileInView:{opacity:1,transition:{duration:m?s.duration:.5,delay:m?0:s.duration},cx:x(e.date),cy:L(e.y1)}},initial:"initial",animate:h?"whileInView":"initial"}):null,W?t.jsxRuntimeExports.jsx(R.motion.text,{dy:g.checkIfNullOrUndefined(e.y2)||e.y2<e.y1?-8:"1em",style:{fill:n[0],textAnchor:"middle",...o?.graphObjectValues||{}},className:k.cnExports.cn("graph-value graph-value-line-1 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(e.date),y:y(e.y1)},whileInView:{opacity:1,x:x(e.date),y:y(e.y1),transition:{duration:m?s.duration:.5,delay:m?0:s.duration}}},initial:"initial",animate:h?"whileInView":"initial",children:re.numberFormattingFunction(e.y1,"NA",b,$[0],M[0])}):null]}),g.checkIfNullOrUndefined(e.y2)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(R.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[1]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(e.date),cy:y(e.y2)},whileInView:{opacity:1,transition:{duration:m?s.duration:.5,delay:m?0:s.duration},cx:x(e.date),cy:y(e.y2)}},initial:"initial",animate:h?"whileInView":"initial"}):null,W?t.jsxRuntimeExports.jsx(R.motion.text,{dy:g.checkIfNullOrUndefined(e.y1)||e.y1<e.y2?-8:"1em",style:{fill:n[1],textAnchor:"middle",...o?.graphObjectValues||{}},className:k.cnExports.cn("graph-value graph-value-line-2 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(e.date),y:y(e.y2)},whileInView:{opacity:1,x:x(e.date),y:y(e.y2),transition:{duration:m?s.duration:.5,delay:m?0:s.duration}}},initial:"initial",animate:h?"whileInView":"initial",children:re.numberFormattingFunction(e.y2,"NA",b,$[1],M[1])}):null]})]},T))}),U.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:w,style:{fill:"none",pointerEvents:"all"},width:u,height:a})]})}),q&&v&&Z&&ee?t.jsxRuntimeExports.jsx(Ie.Tooltip,{data:q,body:v,xPos:Z,yPos:ee,backgroundStyle:o?.tooltip,className:r?.tooltip}):null]})}function He(oe){const{data:N,graphTitle:A,sources:S,graphDescription:n,height:p,width:c,footNote:j,noOfXTicks:W=10,dateFormat:le="yyyy",showValues:xe=!1,padding:X,lineColors:Y=[Re.Colors.light.categoricalColors.colors[0],Re.Colors.light.categoricalColors.colors[1]],sameAxes:ce=!1,backgroundColor:v=!1,leftMargin:ue=80,rightMargin:H=80,topMargin:s=20,bottomMargin:B=25,labels:P,lineSuffixes:z=["",""],linePrefixes:M=["",""],tooltip:$,highlightAreaSettings:K=[],relativeHeight:I,onSeriesMouseOver:V,graphID:o,graphDownload:r=!1,dataDownload:b=!1,animate:U=!1,strokeWidth:J=2,showDots:h=!0,language:m="en",showColorScale:me=!0,minHeight:O=0,colorLegendTitle:q,theme:Q="light",ariaLabel:Z,noOfYTicks:_=5,maxDate:ee,minDate:te,curveType:f="curve",styles:w,classNames:i,precision:de=2,customLayers:u=[]}=oe,[a,ie]=d.useState(0),[se,F]=d.useState(0),E=d.useRef(null),D=d.useRef(null);return d.useEffect(()=>{const l=new ResizeObserver(G=>{ie(c||G[0].target.clientWidth||620),F(p||G[0].target.clientHeight||480)});return E.current&&(F(E.current.clientHeight||480),ie(E.current.clientWidth||620),c||l.observe(E.current)),()=>l.disconnect()},[c,p]),t.jsxRuntimeExports.jsx("div",{className:`${Q||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:m==="he"||m==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:k.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 ${m||"en"}`,i?.graphContainer),style:{...w?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:o,ref:D,"aria-label":Z||`${A?`The graph shows ${A}. `:""}This is a line chart that show trends for two datasets over time.${n?` ${n}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?X||"1rem":X||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[A||n||r||b?t.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:i?.title,description:i?.description},graphTitle:A,graphDescription:n,width:c,graphDownload:r?D.current:void 0,dataDownload:b?N.map(l=>l.data).filter(l=>l!==void 0).length>0?N.map(l=>l.data).filter(l=>l!==void 0):N.filter(l=>l!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:N.length===0?t.jsxRuntimeExports.jsx(Fe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[me?null:t.jsxRuntimeExports.jsx(Ve.ColorLegend,{colorDomain:P,colorLegendTitle:q,colors:Y,showNAColor:!1}),t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:E,"aria-label":"Graph area",children:(c||a)&&(p||se)?t.jsxRuntimeExports.jsx(Ce,{data:N,sameAxes:ce,lineColors:Y,width:c||a,height:Math.max(O,p||(I?O?(c||a)*I>O?(c||a)*I:O:(c||a)*I:se)),dateFormat:le,showValues:xe,noOfXTicks:W,leftMargin:ue,rightMargin:H,topMargin:s,bottomMargin:B,labels:P,highlightAreaSettings:K,tooltip:$,onSeriesMouseOver:V,animate:U===!0?{duration:.5,once:!0,amount:.5}:U||{duration:0,once:!0,amount:0},strokeWidth:J,showDots:h,noOfYTicks:_,lineSuffixes:z,linePrefixes:M,minDate:te,maxDate:ee,curveType:f,styles:w,classNames:i,precision:de,customLayers:u}):null})]})}),S||j?t.jsxRuntimeExports.jsx(Me.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:i?.footnote,source:i?.source},sources:S,footNote:j,width:c}):null]})})})})}exports.DualAxisLineChart=He;
|
|
2
|
+
//# sourceMappingURL=DualAxisLineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DualAxisLineChart.js","sources":["../src/Components/Graphs/LineCharts/DualAxisLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DualAxisLineChart/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 { motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n DualAxisLineChartDataType,\r\n HighlightAreaSettingsDataType,\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 { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: DualAxisLineChartDataType[];\r\n lineColors: [string, string];\r\n labels: [string, string];\r\n width: number;\r\n height: number;\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 sameAxes: boolean;\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\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 animate: AnimateDataType;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n noOfYTicks: number;\r\n lineSuffixes: [string, string];\r\n linePrefixes: [string, string];\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 y1: number;\r\n y2: 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 lineColors,\r\n labels,\r\n sameAxes,\r\n dateFormat,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n highlightAreaSettings,\r\n onSeriesMouseOver,\r\n animate,\r\n strokeWidth,\r\n showDots,\r\n noOfYTicks,\r\n lineSuffixes,\r\n linePrefixes,\r\n minDate,\r\n maxDate,\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: leftMargin + 50,\r\n right: rightMargin + 65,\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 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 minParam1 =\r\n Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape1 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y1))\r\n .x(d => x(d.date))\r\n .y(d => y1(d.y1))\r\n .curve(curve);\r\n\r\n const lineShape2 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y2))\r\n .x(d => x(d.date))\r\n .y(d => y2(d.y2))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfYTicks);\r\n const y2Ticks = y2.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\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 <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: lineColors[0],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[0], lineSuffixes[0])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[0], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[0], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[0].length > 100 ? `${labels[0].substring(0, 100)}...` : labels[0]}\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColors[1],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[1], lineSuffixes[1])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[1], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[1], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[1].length > 100 ? `${labels[1].substring(0, 100)}...` : labels[1]}\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n <Axis\r\n y1={graphHeight}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\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 labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n </g>\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: lineColors[0],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\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 <motion.path\r\n d={\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || ''\r\n }\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\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.y1) ? (\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: lineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y1(d.y1 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: y1(d.y1 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={\r\n checkIfNullOrUndefined(d.y2)\r\n ? -8\r\n : (d.y2 as number) < (d.y1 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[0],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-1 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: y2(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y1 as number),\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(\r\n d.y1,\r\n 'NA',\r\n precision,\r\n linePrefixes[0],\r\n lineSuffixes[0],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n {!checkIfNullOrUndefined(d.y2) ? (\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: lineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y2(d.y2 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: y2(d.y2 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={\r\n checkIfNullOrUndefined(d.y1)\r\n ? -8\r\n : (d.y1 as number) < (d.y2 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[1],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-2 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: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\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(\r\n d.y2,\r\n 'NA',\r\n precision,\r\n linePrefixes[1],\r\n lineSuffixes[1],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\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 { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n DualAxisLineChartDataType,\r\n Languages,\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 { 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: DualAxisLineChartDataType[];\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 /** Array of colors for the 2 lines */\r\n lineColors?: [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\r\n // Values and Ticks\r\n /** Prefix for values of the lines */\r\n linePrefixes?: [string, string];\r\n /** Suffix for values of the lines */\r\n lineSuffixes?: [string, string];\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 /** Enables same axis for the 2 lines */\r\n sameAxes?: 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 /** Labels for the lines */\r\n labels: [string, string];\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 /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\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 DualAxisLineChart(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 noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n lineColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n labels,\r\n lineSuffixes = ['', ''],\r\n linePrefixes = ['', ''],\r\n tooltip,\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n strokeWidth = 2,\r\n showDots = true,\r\n language = 'en',\r\n showColorScale = true,\r\n minHeight = 0,\r\n colorLegendTitle,\r\n theme = 'light',\r\n ariaLabel,\r\n noOfYTicks = 5,\r\n maxDate,\r\n minDate,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\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\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 show trends for two datasets 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 <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 ? null : (\r\n <ColorLegend\r\n colorDomain={labels}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={lineColors}\r\n showNAColor={false}\r\n />\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 sameAxes={sameAxes}\r\n lineColors={lineColors}\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 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 labels={labels}\r\n highlightAreaSettings={highlightAreaSettings}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\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 strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n noOfYTicks={noOfYTicks}\r\n lineSuffixes={lineSuffixes}\r\n linePrefixes={linePrefixes}\r\n minDate={minDate}\r\n maxDate={maxDate}\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 )}\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","lineColors","labels","sameAxes","dateFormat","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","highlightAreaSettings","onSeriesMouseOver","animate","strokeWidth","showDots","noOfYTicks","lineSuffixes","linePrefixes","minDate","maxDate","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","graphWidth","graphHeight","minYear","maxYear","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","scaleTime","y1","scaleLinear","y2","lineShape1","line","checkIfNullOrUndefined","lineShape2","y1Ticks","y2Ticks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","jsxs","Fragment","jsx","motion","HighlightArea","i","cn","numberFormattingFunction","Axis","AxisTitle","XTicksAndGridLines","format","el","Tooltip","DualAxisLineChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","showColorScale","minHeight","colorLegendTitle","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":"k9BA2EO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,WAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,EACA,WAAAC,GACA,YAAAC,G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AAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,GACA,aAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAEJ,EACCyE,GAAWE,EACVhB,EAAAA,kBAAAA,IAACyC,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAUvG,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAA2E,EACA,SAAAE,EACA,MAAAtG,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
|
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
declare interface ClassNameObject {
|
|
24
|
+
title?: string;
|
|
25
|
+
footnote?: string;
|
|
26
|
+
source?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
xAxis?: AxesClassNameObject;
|
|
30
|
+
yAxis?: AxesClassNameObject;
|
|
31
|
+
legend?: string;
|
|
32
|
+
graphContainer?: string;
|
|
33
|
+
graphObjectValues?: string;
|
|
34
|
+
dataConnectors?: string;
|
|
35
|
+
mouseOverLine?: string;
|
|
36
|
+
regLine?: string;
|
|
37
|
+
dataCards?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare interface CustomLayerDataType {
|
|
41
|
+
position: 'before' | 'after';
|
|
42
|
+
layer: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export declare function DumbbellChart(props: Props): JSX.Element;
|
|
46
|
+
|
|
47
|
+
declare interface DumbbellChartDataType {
|
|
48
|
+
x: (number | null)[];
|
|
49
|
+
label: string;
|
|
50
|
+
date?: string | number;
|
|
51
|
+
data?: object;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
55
|
+
|
|
56
|
+
declare interface Props {
|
|
57
|
+
/** Array of data objects */
|
|
58
|
+
data: DumbbellChartDataType[];
|
|
59
|
+
/** Orientation of the graph */
|
|
60
|
+
orientation?: 'vertical' | 'horizontal';
|
|
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
|
+
/** Array of colors for the circle */
|
|
72
|
+
colors?: string[];
|
|
73
|
+
/** Domain of colors for the graph */
|
|
74
|
+
colorDomain: string[];
|
|
75
|
+
/** Title for the color legend */
|
|
76
|
+
colorLegendTitle?: string;
|
|
77
|
+
/** Color of value labels */
|
|
78
|
+
valueColor?: 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
|
+
/** Left margin of the graph */
|
|
96
|
+
leftMargin?: number;
|
|
97
|
+
/** Right margin of the graph */
|
|
98
|
+
rightMargin?: number;
|
|
99
|
+
/** Top margin of the graph */
|
|
100
|
+
topMargin?: number;
|
|
101
|
+
/** Bottom margin of the graph */
|
|
102
|
+
bottomMargin?: number;
|
|
103
|
+
/** Padding between bars */
|
|
104
|
+
barPadding?: number;
|
|
105
|
+
/** Maximum thickness of bars */
|
|
106
|
+
maxBarThickness?: number;
|
|
107
|
+
/** Minimum thickness of bars */
|
|
108
|
+
minBarThickness?: number;
|
|
109
|
+
/** Maximum number of bars shown in the graph */
|
|
110
|
+
maxNumberOfBars?: number;
|
|
111
|
+
/** Radius of the dots */
|
|
112
|
+
radius?: number;
|
|
113
|
+
/** Prefix for values */
|
|
114
|
+
prefix?: string;
|
|
115
|
+
/** Suffix for values */
|
|
116
|
+
suffix?: string;
|
|
117
|
+
/** Maximum value for the chart */
|
|
118
|
+
maxValue?: number;
|
|
119
|
+
/** Minimum value for the chart */
|
|
120
|
+
minValue?: number;
|
|
121
|
+
/** Truncate labels by specified length */
|
|
122
|
+
truncateBy?: number;
|
|
123
|
+
/** Reference values for comparison */
|
|
124
|
+
refValues?: ReferenceDataType[];
|
|
125
|
+
/** Number of ticks on the axis */
|
|
126
|
+
noOfTicks?: number;
|
|
127
|
+
/** Toggle visibility of labels */
|
|
128
|
+
showLabels?: boolean;
|
|
129
|
+
/** Toggle visibility of values */
|
|
130
|
+
showValues?: boolean;
|
|
131
|
+
/** Custom order for labels */
|
|
132
|
+
labelOrder?: string[];
|
|
133
|
+
/** Toggle visibility of axis ticks */
|
|
134
|
+
showTicks?: boolean;
|
|
135
|
+
/** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */
|
|
136
|
+
showColorScale?: boolean;
|
|
137
|
+
/** Toggle if the is a arrow head at the end of the connector */
|
|
138
|
+
arrowConnector?: boolean;
|
|
139
|
+
/** Data points to highlight. Use the label value from data to highlight the data point */
|
|
140
|
+
highlightedDataPoints?: (string | number)[];
|
|
141
|
+
/** Defines the opacity of the non-highlighted data */
|
|
142
|
+
dimmedOpacity?: number;
|
|
143
|
+
/** Stroke width of the connector */
|
|
144
|
+
connectorStrokeWidth?: number;
|
|
145
|
+
/** Title for the axis */
|
|
146
|
+
axisTitle?: string;
|
|
147
|
+
/** Sorting order for data. If this is a number then data is sorted by value at that index x array in the data props. If this is diff then data is sorted by the difference of the last and first element in the x array in the data props. This is overwritten by labelOrder prop */
|
|
148
|
+
sortParameter?: number | 'diff';
|
|
149
|
+
/** Toggles if data points which have all the values as undefined or null are filtered out. */
|
|
150
|
+
filterNA?: boolean;
|
|
151
|
+
/** Toggles if the graph animates in when loaded. */
|
|
152
|
+
animate?: boolean | AnimateDataType;
|
|
153
|
+
/** Specifies the number of decimal places to display in the value. */
|
|
154
|
+
precision?: number;
|
|
155
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
156
|
+
customLayers?: CustomLayerDataType[];
|
|
157
|
+
/** Configures playback and slider controls for animating the chart over time. The data must have a key date for it to work properly. */
|
|
158
|
+
timeline?: TimelineDataType;
|
|
159
|
+
/** Enable graph download option as png */
|
|
160
|
+
graphDownload?: boolean;
|
|
161
|
+
/** Enable data download option as a csv */
|
|
162
|
+
dataDownload?: boolean;
|
|
163
|
+
/** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
|
|
164
|
+
resetSelectionOnDoubleClick?: boolean;
|
|
165
|
+
/** 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 */
|
|
166
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
167
|
+
/** 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 */
|
|
168
|
+
detailsOnClick?: string | ((_d: any) => React.ReactNode);
|
|
169
|
+
/** Callback for mouse over event */
|
|
170
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
171
|
+
/** Callback for mouse click event */
|
|
172
|
+
onSeriesMouseClick?: (_d: any) => void;
|
|
173
|
+
/** Language setting */
|
|
174
|
+
language?: Languages;
|
|
175
|
+
/** Color theme */
|
|
176
|
+
theme?: 'light' | 'dark';
|
|
177
|
+
/** Unique ID for the graph */
|
|
178
|
+
graphID?: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
declare interface ReferenceDataType {
|
|
182
|
+
value: number | null;
|
|
183
|
+
text: string;
|
|
184
|
+
color?: string;
|
|
185
|
+
styles?: {
|
|
186
|
+
line?: React.CSSProperties;
|
|
187
|
+
text?: React.CSSProperties;
|
|
188
|
+
};
|
|
189
|
+
classNames?: {
|
|
190
|
+
line?: string;
|
|
191
|
+
text?: string;
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare interface SourcesDataType {
|
|
196
|
+
source: string;
|
|
197
|
+
link?: string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare interface StyleObject {
|
|
201
|
+
title?: React.CSSProperties;
|
|
202
|
+
footnote?: React.CSSProperties;
|
|
203
|
+
source?: React.CSSProperties;
|
|
204
|
+
description?: React.CSSProperties;
|
|
205
|
+
graphContainer?: React.CSSProperties;
|
|
206
|
+
tooltip?: React.CSSProperties;
|
|
207
|
+
xAxis?: AxesStyleObject;
|
|
208
|
+
yAxis?: AxesStyleObject;
|
|
209
|
+
graphObjectValues?: React.CSSProperties;
|
|
210
|
+
dataConnectors?: React.CSSProperties;
|
|
211
|
+
mouseOverLine?: React.CSSProperties;
|
|
212
|
+
regLine?: React.CSSProperties;
|
|
213
|
+
dataCards?: React.CSSProperties;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
declare interface TimelineDataType {
|
|
217
|
+
autoplay: boolean;
|
|
218
|
+
enabled: boolean;
|
|
219
|
+
showOnlyActiveDate: boolean;
|
|
220
|
+
speed?: number;
|
|
221
|
+
dateFormat?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { }
|