@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,178 @@
|
|
|
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
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
48
|
+
|
|
49
|
+
export declare function ParetoChart(props: Props): JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare interface ParetoChartDataType {
|
|
52
|
+
label: number | string;
|
|
53
|
+
bar?: number;
|
|
54
|
+
line?: number;
|
|
55
|
+
data?: object;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare interface Props {
|
|
59
|
+
/** Array of data objects */
|
|
60
|
+
data: ParetoChartDataType[];
|
|
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
|
+
/** Color of the bars */
|
|
72
|
+
barColor?: string;
|
|
73
|
+
/** Color of the line */
|
|
74
|
+
lineColor?: string;
|
|
75
|
+
/** Title for the color legend */
|
|
76
|
+
colorLegendTitle?: string;
|
|
77
|
+
/** Background color of the graph */
|
|
78
|
+
backgroundColor?: string | boolean;
|
|
79
|
+
/** Custom styles for the graph. Each object should be a valid React CSS style object. */
|
|
80
|
+
styles?: StyleObject;
|
|
81
|
+
/** Custom class names */
|
|
82
|
+
classNames?: ClassNameObject;
|
|
83
|
+
/** Width of the graph */
|
|
84
|
+
width?: number;
|
|
85
|
+
/** Height of the graph */
|
|
86
|
+
height?: number;
|
|
87
|
+
/** Minimum height of the graph */
|
|
88
|
+
minHeight?: number;
|
|
89
|
+
/** Relative height scaling factor. This overwrites the height props */
|
|
90
|
+
relativeHeight?: number;
|
|
91
|
+
/** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
|
|
92
|
+
padding?: string;
|
|
93
|
+
/** Left margin of the graph */
|
|
94
|
+
leftMargin?: number;
|
|
95
|
+
/** Right margin of the graph */
|
|
96
|
+
rightMargin?: number;
|
|
97
|
+
/** Top margin of the graph */
|
|
98
|
+
topMargin?: number;
|
|
99
|
+
/** Bottom margin of the graph */
|
|
100
|
+
bottomMargin?: number;
|
|
101
|
+
/** Padding between bars */
|
|
102
|
+
barPadding?: number;
|
|
103
|
+
/** Suffix for values of the lines */
|
|
104
|
+
lineSuffix?: string;
|
|
105
|
+
/** Suffix for values of the bars */
|
|
106
|
+
barSuffix?: string;
|
|
107
|
+
/** Prefix for values of the lines */
|
|
108
|
+
linePrefix?: string;
|
|
109
|
+
/** Prefix for values of the bars */
|
|
110
|
+
barPrefix?: string;
|
|
111
|
+
/** Truncate labels by specified length */
|
|
112
|
+
truncateBy?: number;
|
|
113
|
+
/** Number of ticks on the axis */
|
|
114
|
+
noOfTicks?: number;
|
|
115
|
+
/** Toggle visibility of labels */
|
|
116
|
+
showLabels?: boolean;
|
|
117
|
+
/** Toggle visibility of values */
|
|
118
|
+
showValues?: boolean;
|
|
119
|
+
/** Curve type for the line */
|
|
120
|
+
curveType?: CurveTypes;
|
|
121
|
+
/** Enables same axis for bars and line */
|
|
122
|
+
sameAxes?: boolean;
|
|
123
|
+
/** Title for the bar axis */
|
|
124
|
+
barAxisTitle?: string;
|
|
125
|
+
/** Title for the line axis */
|
|
126
|
+
lineAxisTitle?: string;
|
|
127
|
+
/** Defines how “NA” values should be displayed/labelled in the graph */
|
|
128
|
+
naLabel?: string;
|
|
129
|
+
/** Toggles if the graph animates in when loaded. */
|
|
130
|
+
animate?: boolean | AnimateDataType;
|
|
131
|
+
/** Specifies the number of decimal places to display in the value. */
|
|
132
|
+
precision?: number;
|
|
133
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
134
|
+
customLayers?: CustomLayerDataType[];
|
|
135
|
+
/** Enable graph download option as png */
|
|
136
|
+
graphDownload?: boolean;
|
|
137
|
+
/** Enable data download option as a csv */
|
|
138
|
+
dataDownload?: boolean;
|
|
139
|
+
/** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
|
|
140
|
+
resetSelectionOnDoubleClick?: boolean;
|
|
141
|
+
/** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */
|
|
142
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
143
|
+
/** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */
|
|
144
|
+
detailsOnClick?: string | ((_d: any) => React.ReactNode);
|
|
145
|
+
/** Callback for mouse over event */
|
|
146
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
147
|
+
/** Callback for mouse click event */
|
|
148
|
+
onSeriesMouseClick?: (_d: any) => void;
|
|
149
|
+
/** Language setting */
|
|
150
|
+
language?: Languages;
|
|
151
|
+
/** Color theme */
|
|
152
|
+
theme?: 'light' | 'dark';
|
|
153
|
+
/** Unique ID for the graph */
|
|
154
|
+
graphID?: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare interface SourcesDataType {
|
|
158
|
+
source: string;
|
|
159
|
+
link?: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare interface StyleObject {
|
|
163
|
+
title?: React.CSSProperties;
|
|
164
|
+
footnote?: React.CSSProperties;
|
|
165
|
+
source?: React.CSSProperties;
|
|
166
|
+
description?: React.CSSProperties;
|
|
167
|
+
graphContainer?: React.CSSProperties;
|
|
168
|
+
tooltip?: React.CSSProperties;
|
|
169
|
+
xAxis?: AxesStyleObject;
|
|
170
|
+
yAxis?: AxesStyleObject;
|
|
171
|
+
graphObjectValues?: React.CSSProperties;
|
|
172
|
+
dataConnectors?: React.CSSProperties;
|
|
173
|
+
mouseOverLine?: React.CSSProperties;
|
|
174
|
+
regLine?: React.CSSProperties;
|
|
175
|
+
dataCards?: React.CSSProperties;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export { }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHm2KTjD-D8FylaKc.cjs"),y=require("react"),B=require("./Typography-CDR-DAHH.cjs"),gt=require("./index-BXns0-ng.cjs"),wt=require("./Modal-cQF2UQIa.cjs"),at=require("./numberFormattingFunction.js"),Et=require("./Tooltip-BM18N_3l.cjs"),Rt=require("./string2HTML-X4ZYX5jI.cjs"),pt=require("./checkIfNullOrUndefined.js"),ht=require("./Axis-BlyBRMNw.cjs"),ft=require("./AxisTitle-BY8MI9jC.cjs"),At=require("./XAxesLabels-C9REbQQs.cjs"),q=require("./use-in-view-Dl1CsAIo.cjs"),Mt=require("./band-CAApY4Pd.cjs"),yt=require("./linear-BVckp9RD.cjs"),jt=require("./line-DHV4JwCR.cjs"),ot=require("./step-BZ3C8QFW.cjs"),Ct=require("./index-a2C2Bqn2.cjs"),Nt=require("./GraphFooter.js"),kt=require("./GraphHeader.js"),$t=require("./ColorLegend.js"),lt=require("./Colors.js"),qt=require("./EmptyState-BQguKAp5.cjs");function St(xt){const{data:S,width:R,height:V,barColor:d,lineColor:p,axisTitles:n,sameAxes:j,rightMargin:G,leftMargin:U,topMargin:z,bottomMargin:ct,tooltip:b,showValues:_,onSeriesMouseOver:D,barPadding:ut,truncateBy:K,showLabels:J,onSeriesMouseClick:v,resetSelectionOnDoubleClick:Q,detailsOnClick:h,noOfTicks:Z,lineSuffix:tt,barSuffix:W,linePrefix:X,barPrefix:et,curveType:F,styles:o,classNames:l,animate:r,precision:H,customLayers:I,naLabel:A}=xt,it=y.useRef(null),M=q.useInView(it,{once:r.once,amount:r.amount}),mt=F==="linear"?jt.curveLinear:F==="step"?ot.curveStep:F==="stepAfter"?ot.stepAfter:F==="stepBefore"?ot.stepBefore:ot.monotoneX,[st,C]=y.useState(void 0),[N,T]=y.useState(void 0),[nt,k]=y.useState(void 0),[rt,u]=y.useState(void 0),a={top:z,bottom:ct,left:U+50,right:G+65},m=R-a.left-a.right,g=V-a.top-a.bottom,s=S.map((t,E)=>({...t,id:`${E}`})),x=Mt.band().domain(s.map(t=>`${t.id}`)).range([0,m]).paddingInner(ut),w=Math.min(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.bar).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.bar).filter(t=>t!=null)):0,Y=Math.min(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.min(...s.map(t=>t.line).filter(t=>t!=null))>0?0:Math.min(...s.map(t=>t.line).filter(t=>t!=null)):0,L=Math.max(...s.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.bar).filter(t=>t!=null)):0,O=Math.max(...s.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.max(...s.map(t=>t.line).filter(t=>t!=null)):0,$=w<Y?w:Y,P=L>O?L:O,i=yt.linear().domain([j?$:w,j?P>0?P:0:L>0?L:0]).range([g,0]).nice(),c=yt.linear().domain([j?$:Y,j?P>0?P:0:O>0?O:0]).range([g,0]).nice(),dt=jt.line().defined(t=>!pt.checkIfNullOrUndefined(t.line)).x(t=>x(`${t.id}`)+x.bandwidth()/2).y(t=>c(t.line)).curve(mt),bt=i.ticks(Z),vt=c.ticks(Z);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(q.motion.svg,{width:`${R}px`,height:`${V}px`,viewBox:`0 0 ${R} ${V}`,direction:"ltr",ref:it,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${a.left},${a.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[bt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:i(t),y2:i(t),x1:-15,x2:-20,style:{stroke:d,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:-25,y:i(t),dy:"0.33em",className:B.cnExports.cn("text-xs",l?.yAxis?.labels),style:{textAnchor:"end",fill:d,...o?.yAxis?.labels||{}},children:at.numberFormattingFunction(t,A,H,et,W)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:-15,x2:-15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:d,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:10-a.left,y:g/2,style:{fill:d,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[0].length>100?`${n[0].substring(0,100)}...`:n[0],rotate90:!0})]}),e.jsxRuntimeExports.jsxs("g",{children:[vt.map((t,E)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:c(t),y2:c(t),x1:m+15,x2:m+20,style:{stroke:p,strokeWidth:1,...o?.yAxis?.gridLines||{}},className:l?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:m+25,y:c(t),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:p,...o?.yAxis?.labels||{}},className:B.cnExports.cn("text-xs",l?.yAxis?.labels),children:at.numberFormattingFunction(t,A,H,X,tt)})]},E)),e.jsxRuntimeExports.jsx(ht.Axis,{y1:0,y2:g,x1:m+15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:{stroke:p,...o?.xAxis?.axis||{}}}}),e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:m+a.right-15,y:g/2,style:{fill:p,...o?.yAxis?.title||{}},className:l?.yAxis?.title,text:n[1].length>100?`${n[1].substring(0,100)}...`:n[1],rotate90:!0})]}),e.jsxRuntimeExports.jsx(ht.Axis,{y1:j?i(0):g,y2:j?i(0):g,x1:-15,x2:m+15,classNames:{axis:l?.xAxis?.axis},styles:{axis:o?.xAxis?.axis}}),I.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(Ct.AnimatePresence,{children:[s.map((t,E)=>e.jsxRuntimeExports.jsxs(q.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||h)&&(gt.isEqual(N,t)&&Q?(T(void 0),v?.(void 0)):(T(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(q.motion.rect,{variants:{initial:{attrY:i(0),height:0,opacity:1},whileInView:{attrY:t.bar?t.bar>0?i(t.bar):i(0):0,height:t.bar?Math.abs(i(t.bar)-i(0)):0,opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:M?"whileInView":"initial",exit:{attrY:i(0),height:0,opacity:0,transition:{duration:r.duration}},x:x(`${E}`),width:x.bandwidth(),style:{fill:d}}),_&&!pt.checkIfNullOrUndefined(t.bar)?e.jsxRuntimeExports.jsx(q.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{attrY:i(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{attrY:i(0),opacity:0},whileInView:{attrY:i(t.bar||0),opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{fill:d,textAnchor:"middle",...o?.graphObjectValues||{}},className:B.cnExports.cn("graph-value text-sm",l?.graphObjectValues),dy:t.bar?t.bar>=0?"-5px":"1em":"-5px",children:at.numberFormattingFunction(t.bar,A,H,et,W)}):null,J?e.jsxRuntimeExports.jsx(At.XAxesLabels,{value:`${t.label}`.length<K?`${t.label}`:`${`${t.label}`.substring(0,K)}...`,y:g+5,x:x(`${t.id}`),width:x.bandwidth(),height:a.bottom,style:o?.xAxis?.labels,className:l?.xAxis?.labels,alignment:"top",animate:r,isInView:M}):null]},t.label)),e.jsxRuntimeExports.jsx(q.motion.path,{exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{d:dt(s.map(t=>({...t,line:0}))),opacity:0},whileInView:{d:dt(s),opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:M?"whileInView":"initial",style:{stroke:p,fill:"none",strokeWidth:2}}),s.map((t,E)=>e.jsxRuntimeExports.jsx("g",{children:pt.checkIfNullOrUndefined(t.line)?null:e.jsxRuntimeExports.jsxs("g",{onMouseEnter:f=>{C(t),u(f.clientY),k(f.clientX),D?.(t)},onClick:()=>{(v||h)&&(gt.isEqual(N,t)&&Q?(T(void 0),v?.(void 0)):(T(t),v?.(t)))},onMouseMove:f=>{C(t),u(f.clientY),k(f.clientX)},onMouseLeave:()=>{C(void 0),k(void 0),u(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(q.motion.circle,{exit:{cy:c(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{cy:c(0),opacity:0},whileInView:{cy:c(t.line),opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:M?"whileInView":"initial",cx:x(t.id)+x.bandwidth()/2,r:m/s.length<5?0:m/s.length<20?2:4,style:{fill:p}}),_?e.jsxRuntimeExports.jsx(q.motion.text,{x:x(`${t.id}`)+x.bandwidth()/2,exit:{y:c(0),opacity:0,transition:{duration:r.duration}},style:{fill:p,textAnchor:"middle",...o?.graphObjectValues||{}},variants:{initial:{y:c(0),opacity:0},whileInView:{y:c(t.line),opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:M?"whileInView":"initial",className:B.cnExports.cn("graph-value text-sm",l?.graphObjectValues),dy:"-5px",children:at.numberFormattingFunction(t.line,A,H,X,tt)}):null]})},E))]}),I.filter(t=>t.position==="after").map(t=>t.layer)]})}),st&&b&&nt&&rt?e.jsxRuntimeExports.jsx(Et.Tooltip,{data:st,body:b,xPos:nt,yPos:rt,backgroundStyle:o?.tooltip,className:l?.tooltip}):null,h&&N!==void 0?e.jsxRuntimeExports.jsx(wt.ModalExports.Modal,{open:N!==void 0,onClose:()=>{T(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof h=="string"?{__html:Rt.string2HTML(h,N)}:void 0,children:typeof h=="function"?h(N):null})}):null]})}function It(xt){const{data:S,graphTitle:R,sources:V,graphDescription:d,height:p,width:n,footNote:j,padding:G,lineColor:U=lt.Colors.light.categoricalColors.colors[1],barColor:z=lt.Colors.light.categoricalColors.colors[0],sameAxes:ct=!1,backgroundColor:b=!1,leftMargin:_=80,rightMargin:D=80,topMargin:ut=20,bottomMargin:K=25,lineAxisTitle:J="Line chart",barAxisTitle:v="Bar graph",tooltip:Q,relativeHeight:h,onSeriesMouseOver:Z,graphID:tt,graphDownload:W=!1,dataDownload:X=!1,barPadding:et=.25,truncateBy:F=999,showLabels:o=!0,onSeriesMouseClick:l,language:r="en",colorLegendTitle:H,minHeight:I=0,theme:A="light",ariaLabel:it,resetSelectionOnDoubleClick:M=!0,detailsOnClick:mt,showValues:st=!0,noOfTicks:C=5,lineSuffix:N="",barSuffix:T="",linePrefix:nt="",barPrefix:k="",curveType:rt="curve",styles:u,classNames:a,animate:m=!1,precision:g=2,customLayers:s=[],naLabel:x="NA"}=xt,[w,Y]=y.useState(0),[L,O]=y.useState(0),$=y.useRef(null),P=y.useRef(null);return y.useEffect(()=>{const i=new ResizeObserver(c=>{Y(n||c[0].target.clientWidth||620),O(p||c[0].target.clientHeight||480)});return $.current&&(O($.current.clientHeight||480),Y($.current.clientWidth||620),n||i.observe($.current)),()=>i.disconnect()},[n,p]),e.jsxRuntimeExports.jsx("div",{className:`${A||"light"} flex ${n?"w-fit grow-0":"w-full grow"}`,dir:r==="he"||r==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:B.cnExports.cn(`${b?b===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${r||"en"}`,a?.graphContainer),style:{...u?.graphContainer||{},...b&&b!==!0?{backgroundColor:b}:{}},id:tt,ref:P,"aria-label":it||`${R?`The graph shows ${R}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${d?` ${d}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:b?G||"1rem":G||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||d||W||X?e.jsxRuntimeExports.jsx(kt.GraphHeader,{styles:{title:u?.title,description:u?.description},classNames:{title:a?.title,description:a?.description},graphTitle:R,graphDescription:d,width:n,graphDownload:W?P.current:void 0,dataDownload:X?S.map(i=>i.data).filter(i=>i!==void 0).length>0?S.map(i=>i.data).filter(i=>i!==void 0):S.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:S.length===0?e.jsxRuntimeExports.jsx(qt.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx($t.ColorLegend,{colorDomain:[v,J],colors:[z||lt.Colors[A].categoricalColors.colors[0],U||lt.Colors[A].categoricalColors.colors[1]],colorLegendTitle:H,showNAColor:!1}),e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:$,"aria-label":"Graph area",children:(n||w)&&(p||L)?e.jsxRuntimeExports.jsx(St,{data:S,sameAxes:ct,lineColor:U,barColor:z,width:n||w,height:Math.max(I,p||(h?I?(n||w)*h>I?(n||w)*h:I:(n||w)*h:L)),truncateBy:F,leftMargin:_,rightMargin:D,topMargin:ut,bottomMargin:K,axisTitles:[v,J],tooltip:Q,onSeriesMouseOver:Z,barPadding:et,showLabels:o,onSeriesMouseClick:l,resetSelectionOnDoubleClick:M,detailsOnClick:mt,noOfTicks:C,lineSuffix:N,barSuffix:T,linePrefix:nt,barPrefix:k,curveType:rt,showValues:st,styles:u,classNames:a,animate:m===!0?{duration:.5,once:!0,amount:.5}:m||{duration:0,once:!0,amount:0},precision:g,customLayers:s,naLabel:x}):null})]})}),V||j?e.jsxRuntimeExports.jsx(Nt.GraphFooter,{styles:{footnote:u?.footnote,source:u?.source},classNames:{footnote:a?.footnote,source:a?.source},sources:V,footNote:j,width:n}):null]})})})})}exports.ParetoChart=It;
|
|
2
|
+
//# sourceMappingURL=ParetoChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParetoChart.js","sources":["../src/Components/Graphs/ParetoChart/Graph.tsx","../src/Components/Graphs/ParetoChart/index.tsx"],"sourcesContent":["import isEqual from 'fast-deep-equal';\r\nimport { 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 { scaleBand, scaleLinear } from 'd3-scale';\r\nimport { cn } from '@undp/design-system-react/cn';\r\nimport { Modal } from '@undp/design-system-react/Modal';\r\nimport { AnimatePresence, motion, useInView } from 'motion/react';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n ParetoChartDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { string2HTML } from '@/Utils/string2HTML';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { XAxesLabels } from '@/Components/Elements/Axes/XAxesLabels';\r\n\r\ninterface Props {\r\n data: ParetoChartDataType[];\r\n barColor: string;\r\n lineColor: string;\r\n axisTitles: [string, string];\r\n width: number;\r\n height: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n barPadding: number;\r\n truncateBy: number;\r\n showLabels: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n resetSelectionOnDoubleClick: boolean;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n noOfTicks: number;\r\n lineSuffix: string;\r\n barSuffix: string;\r\n linePrefix: string;\r\n showValues: boolean;\r\n barPrefix: string;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n animate: AnimateDataType;\r\n precision: number;\r\n naLabel: string;\r\n customLayers: CustomLayerDataType[];\r\n}\r\ninterface DataFormattedType {\r\n id: string;\r\n label: number | string;\r\n line?: number;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n barColor,\r\n lineColor,\r\n axisTitles,\r\n sameAxes,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n showValues,\r\n onSeriesMouseOver,\r\n barPadding,\r\n truncateBy,\r\n showLabels,\r\n onSeriesMouseClick,\r\n resetSelectionOnDoubleClick,\r\n detailsOnClick,\r\n noOfTicks,\r\n lineSuffix,\r\n barSuffix,\r\n linePrefix,\r\n barPrefix,\r\n curveType,\r\n styles,\r\n classNames,\r\n animate,\r\n precision,\r\n customLayers,\r\n naLabel,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n 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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseClickData, setMouseClickData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n\r\n const dataWithId = data.map((d, i) => ({ ...d, id: `${i}` }));\r\n const x = scaleBand()\r\n .domain(dataWithId.map(d => `${d.id}`))\r\n .range([0, graphWidth])\r\n .paddingInner(barPadding);\r\n const minParam1 =\r\n Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.bar).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataWithId.map(d => d.line).filter(d => d !== undefined && d !== null)) !== Infinity\r\n ? Math.max(...dataWithId.map(d => d.line).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\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 lineShape = line<DataFormattedType>()\r\n .defined(d => !checkIfNullOrUndefined(d.line))\r\n .x(d => (x(`${d.id}`) as number) + x.bandwidth() / 2)\r\n .y(d => y2(d.line as number))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfTicks);\r\n const y2Ticks = y2.ticks(noOfTicks);\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <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: barColor,\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: barColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, barPrefix, barSuffix)}\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: barColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: barColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[0].length > 100 ? `${axisTitles[0].substring(0, 100)}...` : axisTitles[0]\r\n }\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: lineColor,\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: lineColor,\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, naLabel, precision, linePrefix, lineSuffix)}\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: lineColor, ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColor, ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={\r\n axisTitles[1].length > 100 ? `${axisTitles[1].substring(0, 100)}...` : axisTitles[1]\r\n }\r\n rotate90\r\n />\r\n </g>\r\n <Axis\r\n y1={sameAxes ? y1(0) : graphHeight}\r\n y2={sameAxes ? y1(0) : 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 {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <AnimatePresence>\r\n {dataWithId.map((d, i) => {\r\n return (\r\n <motion.g\r\n className='undp-viz-g-with-hover'\r\n key={d.label}\r\n opacity={0.85}\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.rect\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n attrY: d.bar ? (d.bar > 0 ? y1(d.bar) : y1(0)) : 0,\r\n height: d.bar ? Math.abs(y1(d.bar) - y1(0)) : 0,\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n exit={{\r\n attrY: y1(0),\r\n height: 0,\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n x={x(`${i}`)}\r\n width={x.bandwidth()}\r\n style={{ fill: barColor }}\r\n />\r\n {showValues && !checkIfNullOrUndefined(d.bar) ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n attrY: y1(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n attrY: y1(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n attrY: y1(d.bar || 0),\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 style={{\r\n fill: barColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy={d.bar ? (d.bar >= 0 ? '-5px' : '1em') : '-5px'}\r\n >\r\n {numberFormattingFunction(d.bar, naLabel, precision, barPrefix, barSuffix)}\r\n </motion.text>\r\n ) : null}\r\n {showLabels ? (\r\n <XAxesLabels\r\n value={\r\n `${d.label}`.length < truncateBy\r\n ? `${d.label}`\r\n : `${`${d.label}`.substring(0, truncateBy)}...`\r\n }\r\n y={graphHeight + 5}\r\n x={x(`${d.id}`) as number}\r\n width={x.bandwidth()}\r\n height={margin.bottom}\r\n style={styles?.xAxis?.labels}\r\n className={classNames?.xAxis?.labels}\r\n alignment='top'\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n ) : null}\r\n </motion.g>\r\n );\r\n })}\r\n <motion.path\r\n exit={{\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n d: lineShape(dataWithId.map(d => ({ ...d, line: 0 }))) as string,\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n d: lineShape(dataWithId) as string,\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 style={{\r\n stroke: lineColor,\r\n fill: 'none',\r\n strokeWidth: 2,\r\n }}\r\n />\r\n {dataWithId.map((d, i) => (\r\n <g key={i}>\r\n {!checkIfNullOrUndefined(d.line) ? (\r\n <g\r\n onMouseEnter={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n onSeriesMouseOver?.(d);\r\n }}\r\n onClick={() => {\r\n if (onSeriesMouseClick || detailsOnClick) {\r\n if (isEqual(mouseClickData, d) && resetSelectionOnDoubleClick) {\r\n setMouseClickData(undefined);\r\n onSeriesMouseClick?.(undefined);\r\n } else {\r\n setMouseClickData(d);\r\n onSeriesMouseClick?.(d);\r\n }\r\n }\r\n }}\r\n onMouseMove={event => {\r\n setMouseOverData(d);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n }}\r\n onMouseLeave={() => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n }}\r\n >\r\n <motion.circle\r\n exit={{\r\n cy: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n variants={{\r\n initial: {\r\n cy: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n cy: y2(d.line as number),\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 cx={(x(d.id) as number) + x.bandwidth() / 2}\r\n r={\r\n graphWidth / dataWithId.length < 5\r\n ? 0\r\n : graphWidth / dataWithId.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColor }}\r\n />\r\n {showValues ? (\r\n <motion.text\r\n x={(x(`${d.id}`) as number) + x.bandwidth() / 2}\r\n exit={{\r\n y: y2(0),\r\n opacity: 0,\r\n transition: { duration: animate.duration },\r\n }}\r\n style={{\r\n fill: lineColor,\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n variants={{\r\n initial: {\r\n y: y2(0),\r\n opacity: 0,\r\n },\r\n whileInView: {\r\n y: y2(d.line as number),\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 className={cn('graph-value text-sm', classNames?.graphObjectValues)}\r\n dy='-5px'\r\n >\r\n {numberFormattingFunction(\r\n d.line,\r\n naLabel,\r\n precision,\r\n linePrefix,\r\n lineSuffix,\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </g>\r\n ) : null}\r\n </g>\r\n ))}\r\n </AnimatePresence>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n {detailsOnClick && mouseClickData !== undefined ? (\r\n <Modal\r\n open={mouseClickData !== undefined}\r\n onClose={() => {\r\n setMouseClickData(undefined);\r\n }}\r\n >\r\n <div\r\n className='graph-modal-content m-0'\r\n dangerouslySetInnerHTML={\r\n typeof detailsOnClick === 'string'\r\n ? { __html: string2HTML(detailsOnClick, mouseClickData) }\r\n : undefined\r\n }\r\n >\r\n {typeof detailsOnClick === 'function' ? detailsOnClick(mouseClickData) : null}\r\n </div>\r\n </Modal>\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\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 Languages,\r\n ParetoChartDataType,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\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: ParetoChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Color of the bars */\r\n barColor?: string;\r\n /** Color of the line */\r\n lineColor?: string;\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n /** Padding between bars */\r\n barPadding?: number;\r\n\r\n // Values and Ticks\r\n /** Suffix for values of the lines */\r\n lineSuffix?: string;\r\n /** Suffix for values of the bars */\r\n barSuffix?: string;\r\n /** Prefix for values of the lines */\r\n linePrefix?: string;\r\n /** Prefix for values of the bars */\r\n barPrefix?: string;\r\n /** Truncate labels by specified length */\r\n truncateBy?: number;\r\n /** Number of ticks on the axis */\r\n noOfTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of labels */\r\n showLabels?: boolean;\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Enables same axis for bars and line */\r\n sameAxes?: boolean;\r\n /** Title for the bar axis */\r\n barAxisTitle?: string;\r\n /** Title for the line axis */\r\n lineAxisTitle?: string;\r\n /** Defines how “NA” values should be displayed/labelled in the graph */\r\n naLabel?: string;\r\n /** Toggles if the graph animates in when loaded. */\r\n animate?: boolean | AnimateDataType;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n /** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */\r\n resetSelectionOnDoubleClick?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Details displayed on the modal when user clicks of a data point. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n detailsOnClick?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n /** Callback for mouse click event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseClick?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function ParetoChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n padding,\r\n lineColor = Colors.light.categoricalColors.colors[1],\r\n barColor = Colors.light.categoricalColors.colors[0],\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 lineAxisTitle = 'Line chart',\r\n barAxisTitle = 'Bar graph',\r\n tooltip,\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n barPadding = 0.25,\r\n truncateBy = 999,\r\n showLabels = true,\r\n onSeriesMouseClick,\r\n language = 'en',\r\n colorLegendTitle,\r\n minHeight = 0,\r\n theme = 'light',\r\n ariaLabel,\r\n resetSelectionOnDoubleClick = true,\r\n detailsOnClick,\r\n showValues = true,\r\n noOfTicks = 5,\r\n lineSuffix = '',\r\n barSuffix = '',\r\n linePrefix = '',\r\n barPrefix = '',\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n animate = false,\r\n precision = 2,\r\n customLayers = [],\r\n naLabel = 'NA',\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 pareto chart that shows a variable as bars and another as line chart.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <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 <ColorLegend\r\n colorDomain={[barAxisTitle, lineAxisTitle]}\r\n colors={[\r\n barColor || Colors[theme].categoricalColors.colors[0],\r\n lineColor || Colors[theme].categoricalColors.colors[1],\r\n ]}\r\n colorLegendTitle={colorLegendTitle}\r\n showNAColor={false}\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 lineColor={lineColor}\r\n barColor={barColor}\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 truncateBy={truncateBy}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n axisTitles={[barAxisTitle, lineAxisTitle]}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n barPadding={barPadding}\r\n showLabels={showLabels}\r\n onSeriesMouseClick={onSeriesMouseClick}\r\n resetSelectionOnDoubleClick={resetSelectionOnDoubleClick}\r\n detailsOnClick={detailsOnClick}\r\n noOfTicks={noOfTicks}\r\n lineSuffix={lineSuffix}\r\n barSuffix={barSuffix}\r\n linePrefix={linePrefix}\r\n barPrefix={barPrefix}\r\n curveType={curveType}\r\n showValues={showValues}\r\n styles={styles}\r\n classNames={classNames}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n precision={precision}\r\n customLayers={customLayers}\r\n naLabel={naLabel}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","barColor","lineColor","axisTitles","sameAxes","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","showValues","onSeriesMouseOver","barPadding","truncateBy","showLabels","onSeriesMouseClick","resetSelectionOnDoubleClick","detailsOnClick","noOfTicks","lineSuffix","barSuffix","linePrefix","barPrefix","curveType","styles","classNames","animate","precision","customLayers","naLabel","svgRef","useRef","isInView","useInView","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","useState","mouseClickData","setMouseClickData","eventX","setEventX","eventY","setEventY","margin","graphWidth","graphHeight","dataWithId","d","i","scaleBand","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","y1","scaleLinear","y2","lineShape","line","checkIfNullOrUndefined","y1Ticks","y2Ticks","jsxs","Fragment","jsx","motion","cn","numberFormattingFunction","Axis","AxisTitle","AnimatePresence","event","isEqual","XAxesLabels","Tooltip","Modal","string2HTML","ParetoChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","lineAxisTitle","barAxisTitle","relativeHeight","graphID","graphDownload","dataDownload","language","colorLegendTitle","minHeight","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","useEffect","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":"24BA2EO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,SAAAC,EACA,UAAAC,EACA,WAAAC,EACA,SAAAC,EACA,YAAAC,EACA,WAAAC,EACA,UAAAC,EACA,aAAAC,GACA,QAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,WAAAC,GACA,WAAAC,EACA,WAAAC,EACA,mBAAAC,EACA,4BAAAC,EACA,eAAAC,EACA,UAAAC,EACA,WAAAC,GACA,UAAAC,EACA,WAAAC,EACA,UAAAC,GACA,UAAAC,EACA,OAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,QAAAC,CAAA,EACEhC,GACEiC,GAASC,EAAAA,OAAO,IAAI,EACpBC,EAAWC,EAAAA,UAAUH,GAAQ,CACjC,KAAMJ,EAAQ,KACd,OAAQA,EAAQ,MAAA,CACjB,EACKQ,GACJX,IAAc,SACVY,GAAAA,YACAZ,IAAc,OACZa,GAAAA,UACAb,IAAc,YACZc,GAAAA,UACAd,IAAc,aACZe,GAAAA,WACAC,GAAAA,UAEN,CAACC,GAAeC,CAAgB,EAAIC,EAAAA,SAAc,MAAS,EAE3D,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAAc,MAAS,EAC7D,CAACG,GAAQC,CAAS,EAAIJ,EAAAA,SAA6B,MAAS,EAC5D,CAACK,GAAQC,CAAS,EAAIN,EAAAA,SAA6B,MAAS,EAC5DO,EAAS,CACb,IAAK1C,EACL,OAAQC,GACR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AE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,UAAAC,EACA,aAAAC,EACA,QAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAEJ,EACC0D,GAAWE,EACVjB,EAAAA,kBAAAA,IAAC4C,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAU5F,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAA8D,EACA,SAAAE,EACA,MAAA1F,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
|
|
@@ -0,0 +1,176 @@
|
|
|
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
|
+
declare type Languages = 'en' | 'ar' | 'az' | 'bn' | 'cy' | 'he' | 'hi' | 'jp' | 'ka' | 'km' | 'ko' | 'my' | 'ne' | 'zh' | 'custom';
|
|
46
|
+
|
|
47
|
+
declare interface Props {
|
|
48
|
+
/** Array of data objects */
|
|
49
|
+
data: RadarChartDataType[];
|
|
50
|
+
/** Title of the graph */
|
|
51
|
+
graphTitle?: string | React.ReactNode;
|
|
52
|
+
/** Description of the graph */
|
|
53
|
+
graphDescription?: string | React.ReactNode;
|
|
54
|
+
/** Footnote for the graph */
|
|
55
|
+
footNote?: string | React.ReactNode;
|
|
56
|
+
/** Source data for the graph */
|
|
57
|
+
sources?: SourcesDataType[];
|
|
58
|
+
/** Accessibility label */
|
|
59
|
+
ariaLabel?: string;
|
|
60
|
+
/** Color or array of colors for each line */
|
|
61
|
+
colors?: string | string[];
|
|
62
|
+
/** Domain of colors for the graph */
|
|
63
|
+
colorDomain?: string[];
|
|
64
|
+
/** Title for the color legend */
|
|
65
|
+
colorLegendTitle?: string;
|
|
66
|
+
/** Background color of the graph */
|
|
67
|
+
backgroundColor?: string | boolean;
|
|
68
|
+
/** Custom styles for the graph. Each object should be a valid React CSS style object. */
|
|
69
|
+
styles?: StyleObject;
|
|
70
|
+
/** Custom class names */
|
|
71
|
+
classNames?: ClassNameObject;
|
|
72
|
+
/** Width of the graph */
|
|
73
|
+
width?: number;
|
|
74
|
+
/** Height of the graph */
|
|
75
|
+
height?: number;
|
|
76
|
+
/** Minimum height of the graph */
|
|
77
|
+
minHeight?: number;
|
|
78
|
+
/** Relative height scaling factor. This overwrites the height props */
|
|
79
|
+
relativeHeight?: number;
|
|
80
|
+
/** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */
|
|
81
|
+
padding?: string;
|
|
82
|
+
/** Radius of the radar chart */
|
|
83
|
+
radius?: number;
|
|
84
|
+
/** Left margin of the graph */
|
|
85
|
+
leftMargin?: number;
|
|
86
|
+
/** Right margin of the graph */
|
|
87
|
+
rightMargin?: number;
|
|
88
|
+
/** Top margin of the graph */
|
|
89
|
+
topMargin?: number;
|
|
90
|
+
/** Bottom margin of the graph */
|
|
91
|
+
bottomMargin?: number;
|
|
92
|
+
/** Maximum value for the chart */
|
|
93
|
+
maxValue?: number;
|
|
94
|
+
/** Minimum value for the chart */
|
|
95
|
+
minValue?: number;
|
|
96
|
+
/** Toggle visibility of values */
|
|
97
|
+
showValues?: boolean;
|
|
98
|
+
/** Toggle visibility of dots on the line */
|
|
99
|
+
showDots?: boolean;
|
|
100
|
+
/** Stroke width of the line */
|
|
101
|
+
strokeWidth?: number;
|
|
102
|
+
/** Toggle is the shape is filled or not */
|
|
103
|
+
fillShape?: boolean;
|
|
104
|
+
/** No. of ticks on the x-axis */
|
|
105
|
+
noOfTicks?: number;
|
|
106
|
+
/** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */
|
|
107
|
+
showColorScale?: boolean;
|
|
108
|
+
/** Toggle visibility of NA color in the color scale. This is only applicable if the data props hae color parameter and showColorScale prop is true */
|
|
109
|
+
showNAColor?: boolean;
|
|
110
|
+
/** Data points to highlight. Use the label value from data to highlight the data point */
|
|
111
|
+
highlightedLines?: (string | number)[];
|
|
112
|
+
/** Defines the opacity of the non-highlighted data */
|
|
113
|
+
dimmedOpacity?: number;
|
|
114
|
+
/** Toggles if the graph animates in when loaded. */
|
|
115
|
+
animate?: boolean | AnimateDataType;
|
|
116
|
+
/** Labels for the axes */
|
|
117
|
+
axisLabels: (string | number)[];
|
|
118
|
+
/** Curve type for the line */
|
|
119
|
+
curveType?: 'linear' | 'curve';
|
|
120
|
+
/** Reset selection on double-click. Only applicable when used in a dashboard context with filters. */
|
|
121
|
+
resetSelectionOnDoubleClick?: boolean;
|
|
122
|
+
/** Specifies the number of decimal places to display in the value. */
|
|
123
|
+
precision?: number;
|
|
124
|
+
/** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */
|
|
125
|
+
customLayers?: CustomLayerDataType[];
|
|
126
|
+
/** Enable graph download option as png */
|
|
127
|
+
graphDownload?: boolean;
|
|
128
|
+
/** Enable data download option as a csv */
|
|
129
|
+
dataDownload?: boolean;
|
|
130
|
+
/** 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 */
|
|
131
|
+
tooltip?: string | ((_d: any) => React.ReactNode);
|
|
132
|
+
/** 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 */
|
|
133
|
+
detailsOnClick?: string | ((_d: any) => React.ReactNode);
|
|
134
|
+
/** Callback for mouse over event */
|
|
135
|
+
onSeriesMouseOver?: (_d: any) => void;
|
|
136
|
+
/** Callback for mouse click event */
|
|
137
|
+
onSeriesMouseClick?: (_d: any) => void;
|
|
138
|
+
/** Language setting */
|
|
139
|
+
language?: Languages;
|
|
140
|
+
/** Color theme */
|
|
141
|
+
theme?: 'light' | 'dark';
|
|
142
|
+
/** Unique ID for the graph */
|
|
143
|
+
graphID?: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export declare function RadarChart(props: Props): JSX.Element;
|
|
147
|
+
|
|
148
|
+
declare interface RadarChartDataType {
|
|
149
|
+
values: number[];
|
|
150
|
+
label?: string | number;
|
|
151
|
+
color?: string;
|
|
152
|
+
data?: object;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare interface SourcesDataType {
|
|
156
|
+
source: string;
|
|
157
|
+
link?: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare interface StyleObject {
|
|
161
|
+
title?: React.CSSProperties;
|
|
162
|
+
footnote?: React.CSSProperties;
|
|
163
|
+
source?: React.CSSProperties;
|
|
164
|
+
description?: React.CSSProperties;
|
|
165
|
+
graphContainer?: React.CSSProperties;
|
|
166
|
+
tooltip?: React.CSSProperties;
|
|
167
|
+
xAxis?: AxesStyleObject;
|
|
168
|
+
yAxis?: AxesStyleObject;
|
|
169
|
+
graphObjectValues?: React.CSSProperties;
|
|
170
|
+
dataConnectors?: React.CSSProperties;
|
|
171
|
+
mouseOverLine?: React.CSSProperties;
|
|
172
|
+
regLine?: React.CSSProperties;
|
|
173
|
+
dataCards?: React.CSSProperties;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { }
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-BHm2KTjD-D8FylaKc.cjs"),f=require("react"),D=require("./Typography-CDR-DAHH.cjs"),dt=require("./index-CZbIGs8q.cjs"),wt=require("./index-BXns0-ng.cjs"),bt=require("./Modal-cQF2UQIa.cjs"),kt=require("./Tooltip-BM18N_3l.cjs"),V=require("./Colors.js"),pt=require("./numberFormattingFunction.js"),Rt=require("./string2HTML-X4ZYX5jI.cjs"),N=require("./checkIfNullOrUndefined.js"),q=require("./use-in-view-Dl1CsAIo.cjs"),mt=require("./linear-BVckp9RD.cjs"),ft=require("./line-DHV4JwCR.cjs"),It=require("./index-a2C2Bqn2.cjs"),Ct=require("./GraphFooter.js"),St=require("./GraphHeader.js"),Nt=require("./EmptyState-BQguKAp5.cjs"),Ot=require("./ColorLegendWithMouseOver.js");var Pt=_t(ft.curveLinear);function gt(t){this._curve=t}gt.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};function _t(t){function e(o){return new gt(t(o))}return e._curve=t,e}function Tt(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(o){return arguments.length?e(_t(o)):e()._curve},t}function $t(){return Tt(ft.line().curve(Pt))}function et(){}function ut(t,e,o){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-o),t._x2,t._y2)}function yt(t,e){this._context=t,this._k=(1-e)/6}yt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ut(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ut(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function o(c){return new yt(c,e)}return o.tension=function(c){return t(+c)},o})(0);function vt(t,e){this._context=t,this._k=(1-e)/6}vt.prototype={areaStart:et,areaEnd:et,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ut(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const qt=function t(e){function o(c){return new vt(c,e)}return o.tension=function(c){return t(+c)},o}(0);function Mt(t){this._context=t}Mt.prototype={areaStart:et,areaEnd:et,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Dt(t){return new Mt(t)}function Vt(t){const{data:e,radius:o,lineColors:c,tooltip:k,onSeriesMouseOver:L,onSeriesMouseClick:M,colorDomain:u,detailsOnClick:j,styles:y,classNames:d,selectedColor:O,axisLabels:G,strokeWidth:nt,showValues:st,showDots:rt,rightMargin:ot,topMargin:B,bottomMargin:at,leftMargin:A,curveType:X,noOfTicks:Y,minValue:P,maxValue:T,resetSelectionOnDoubleClick:lt,fillShape:h,highlightedLines:g,animate:x,dimmedOpacity:_,precision:R,customLayers:z}=t,K=f.useRef(null),$=q.useInView(K,{once:x.once,amount:x.amount}),E=X==="linear"?Dt:qt,w={top:B,left:A},v=Math.min((2*o-A-ot)/2,(2*o-B-at)/2),[b,H]=f.useState(void 0),[I,F]=f.useState(void 0),[J,W]=f.useState(void 0),[Q,U]=f.useState(void 0),l=mt.linear().domain([0,e[0].values.length]).range([0,2*Math.PI]),Z=N.checkIfNullOrUndefined(T)?Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))<0?0:Math.max(...e.map(i=>Math.max(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):T,ct=N.checkIfNullOrUndefined(P)?Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s)))))>=0?0:Math.min(...e.map(i=>Math.min(...i.values.filter(s=>!N.checkIfNullOrUndefined(s))))):P,p=mt.linear().domain([ct,Z]).range([0,v]).nice(),ht=p.ticks(Y),C=$t().radius(i=>p(i)).angle((i,s)=>l(s)).curve(E);return n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[n.jsxRuntimeExports.jsx(q.motion.svg,{width:`${o*2}px`,height:`${o*2}px`,viewBox:`0 0 ${o*2} ${o*2}`,direction:"ltr",ref:K,children:n.jsxRuntimeExports.jsxs("g",{transform:`translate(${w.left},${w.top})`,children:[z.filter(i=>i.position==="before").map(i=>i.layer),n.jsxRuntimeExports.jsxs("g",{transform:`translate(${v},${v})`,children:[G.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("line",{x1:0,y1:0,x2:Math.cos(l(s)-Math.PI/2)*v,y2:Math.sin(l(s)-Math.PI/2)*v,className:D.cnExports.cn("stroke-1 stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.axis),style:y?.xAxis?.axis},s),n.jsxRuntimeExports.jsx("text",{x:Math.cos(l(s)-Math.PI/2)*(v+6),y:Math.sin(l(s)-Math.PI/2)*(v+6),style:{textAnchor:Math.cos(l(s)-Math.PI/2)<0?"end":Math.cos(l(s)-Math.PI/2)<1e-5?"middle":"start",...y?.xAxis?.labels||""},dy:Math.sin(l(s)-Math.PI/2)<0?0:Math.sin(l(s)-Math.PI/2)<1e-5?5:10,className:D.cnExports.cn("fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",d?.xAxis?.labels),children:i})]},s)),ht.map((i,s)=>n.jsxRuntimeExports.jsxs("g",{children:[n.jsxRuntimeExports.jsx("path",{d:C(Array(G.length).fill(i))||"",className:D.cnExports.cn("stroke-primary-gray-500 dark:stroke-primary-gray-550",d?.xAxis?.gridLines),style:{...y?.xAxis?.gridLines,fill:"none"}}),n.jsxRuntimeExports.jsx("foreignObject",{x:-25,y:Math.sin(-Math.PI/2)*p(i)>-1e-4?Math.sin(-Math.PI/2)*p(i)-7:Math.sin(-Math.PI/2)*p(i)-5,width:50,height:12,children:n.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:n.jsxRuntimeExports.jsx("p",{className:D.cnExports.cn("fill-primary-gray-500 dark:fill-primary-gray-550 text-xs m-0 py-0 px-1.5 text-center leading-none bg-primary-white dark:bg-primary-gray-700",d?.xAxis?.labels),style:y?.xAxis?.labels,children:pt.numberFormattingFunction(i,"NA",R)})})})]},s)),n.jsxRuntimeExports.jsx(It.AnimatePresence,{children:e.map((i,s)=>n.jsxRuntimeExports.jsxs(q.motion.g,{variants:{initial:{opacity:b?i.label===b.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:.3:1},whileInView:{opacity:b?i.label===b.label?1:_:O?i.color&&c[u.indexOf(i.color)]===O?1:_:g.length!==0?i.label&&g.indexOf(i.label)!==-1?1:_:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},onMouseEnter:a=>{H(i),U(a.clientY),W(a.clientX),L?.(i)},onMouseMove:a=>{H(i),U(a.clientY),W(a.clientX)},onMouseLeave:()=>{H(void 0),W(void 0),U(void 0),L?.(void 0)},onClick:()=>{(M||j)&&(wt.isEqual(I,i)&<?(F(void 0),M?.(void 0)):(F(i),M?.(i)))},children:[n.jsxRuntimeExports.jsx(q.motion.path,{d:C(i.values)||"",variants:{initial:{d:C(i.values.map(a=>0))||""},whileInView:{d:C(i.values)||"",transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},style:{stroke:e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:V.Colors.gray,fill:h?e.filter(a=>a.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:V.Colors.gray:"none",fillOpacity:.1,strokeWidth:nt}}),n.jsxRuntimeExports.jsx("g",{children:i.values.map((a,m)=>n.jsxRuntimeExports.jsx("g",{children:N.checkIfNullOrUndefined(a)?null:n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[rt?n.jsxRuntimeExports.jsx(q.motion.circle,{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),r:4,style:{fill:e.filter(tt=>tt.color).length===0?c[0]:i.color?c[u.indexOf(i.color)]:V.Colors.gray},variants:{initial:{cx:0,cy:0,opacity:0},whileInView:{cx:Math.cos(l(m)-Math.PI/2)*p(a),cy:Math.sin(l(m)-Math.PI/2)*p(a),opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}}}):null,st?n.jsxRuntimeExports.jsx(q.motion.text,{x:Math.cos(l(m)-Math.PI/2)*(p(a)+6),y:Math.sin(l(m)-Math.PI/2)*(p(a)+6),style:{fill:c[s],textAnchor:Math.cos(l(m)-Math.PI/2)<0?"end":Math.cos(l(m)-Math.PI/2)<1e-5?"middle":"start",...y?.graphObjectValues||{}},dy:Math.sin(l(m)-Math.PI/2)<0?10:(Math.sin(l(m)-Math.PI/2)<1e-5,0),className:D.cnExports.cn("graph-value text-xs font-bold",d?.graphObjectValues),variants:{initial:{opacity:0},whileInView:{opacity:1,transition:{duration:x.duration}}},initial:"initial",animate:$?"whileInView":"initial",exit:{opacity:0,transition:{duration:x.duration}},children:pt.numberFormattingFunction(a,"NA",R)}):null]})},m))})]},i.label||s))})]}),z.filter(i=>i.position==="after").map(i=>i.layer)]})}),b&&k&&J&&Q?n.jsxRuntimeExports.jsx(kt.Tooltip,{data:b,body:k,xPos:J,yPos:Q,backgroundStyle:y?.tooltip,className:d?.tooltip}):null,j&&I!==void 0?n.jsxRuntimeExports.jsx(bt.ModalExports.Modal,{open:I!==void 0,onClose:()=>{F(void 0)},children:n.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof j=="string"?{__html:Rt.string2HTML(j,I)}:void 0,children:typeof j=="function"?j(I):null})}):null]})}function Lt(t){const{graphTitle:e,colors:o,sources:c,graphDescription:k,footNote:L,radius:M,data:u,showColorScale:j=!0,padding:y,backgroundColor:d=!1,tooltip:O,onSeriesMouseOver:G,graphID:nt,onSeriesMouseClick:st,topMargin:rt=75,bottomMargin:ot=75,leftMargin:B=75,rightMargin:at=75,graphDownload:A=!1,dataDownload:X=!1,colorDomain:Y,language:P="en",theme:T="light",highlightedLines:lt=[],width:h,height:g,minHeight:x=0,strokeWidth:_=2,relativeHeight:R,ariaLabel:z,colorLegendTitle:K,detailsOnClick:$,styles:E,classNames:w,showNAColor:v=!0,axisLabels:b,showDots:H=!0,showValues:I=!1,curveType:F="curve",noOfTicks:J=5,minValue:W,maxValue:Q,fillShape:U=!1,resetSelectionOnDoubleClick:l=!0,animate:Z=!1,dimmedOpacity:ct=.3,precision:p=2,customLayers:ht=[]}=t,[C,i]=f.useState(0),[s,a]=f.useState(0),[m,tt]=f.useState(0),[jt,Et]=f.useState(void 0),S=f.useRef(null),xt=f.useRef(null);return f.useEffect(()=>{const r=new ResizeObserver(it=>{a(h||it[0].target.clientWidth||420),tt(g||it[0].target.clientHeight||420),i((Math.min(h||it[0].target.clientWidth||620,g||it[0].target.clientHeight||480)||420)/2)});return S.current&&(tt(S.current.clientHeight||420),a(S.current.clientWidth||420),i((Math.min(S.current.clientWidth,S.current.clientHeight)||420)/2),(!h||!M)&&r.observe(S.current)),()=>r.disconnect()},[h,g,M]),n.jsxRuntimeExports.jsx("div",{className:`${T||"light"} flex ${h?"w-fit grow-0":"w-full grow"}`,dir:P==="he"||P==="ar"?"rtl":void 0,children:n.jsxRuntimeExports.jsx("div",{className:D.cnExports.cn(`${d?d===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${P||"en"}`,w?.graphContainer),style:{...E?.graphContainer||{},minHeight:"inherit",...d&&d!==!0?{backgroundColor:d}:{}},id:nt,ref:xt,"aria-label":z||`${e?`The graph shows ${e}. `:""}This is a donut or pie chart chart. ${k?` ${k}`:""}`,children:n.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:d?y||"1rem":y||0},children:n.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-2 w-full grow justify-between",children:[e||k||A||X?n.jsxRuntimeExports.jsx(St.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:w?.title,description:w?.description},graphTitle:e,graphDescription:k,width:h,graphDownload:A?xt.current:void 0,dataDownload:X?u.map(r=>r.data).filter(r=>r!==void 0).length>0?u.map(r=>r.data).filter(r=>r!==void 0):u.filter(r=>r!==void 0):null}):null,n.jsxRuntimeExports.jsx("div",{className:"flex grow flex-col justify-center items-stretch gap-8 flex-wrap",style:{width:h?`${h}px`:"100%"},children:u.length===0?n.jsxRuntimeExports.jsx(Nt.EmptyState,{}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[j&&u.filter(r=>r.color).length!==0?n.jsxRuntimeExports.jsx(Ot.ColorLegendWithMouseOver,{width:h,colorLegendTitle:K,colors:o||V.Colors[T].categoricalColors.colors,colorDomain:Y||dt.uniqBy(u.filter(r=>r.color),"color").map(r=>r.color),setSelectedColor:Et,showNAColor:v}):null,n.jsxRuntimeExports.jsx("div",{className:`flex ${h?"grow-0":"grow"} items-center justify-center leading-0`,style:{width:h?`${h}px`:"100%",height:g?`${Math.max(x,g||(R?x?(h||s)*R>x?(h||s)*R:x:(h||s)*R:m))}px`:"auto"},ref:S,"aria-label":"Graph area",children:n.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center leading-0",children:M||C?n.jsxRuntimeExports.jsx(Vt,{data:u,lineColors:u.filter(r=>r.color).length===0?o?[o]:[V.Colors.primaryColors["blue-600"]]:o||V.Colors[T].categoricalColors.colors,radius:M||C,tooltip:O,colorDomain:Y||dt.uniqBy(u.filter(r=>r.color),"color").map(r=>r.color),onSeriesMouseOver:G,onSeriesMouseClick:st,styles:E,detailsOnClick:$,selectedColor:jt,axisLabels:b,strokeWidth:_,showValues:I,showDots:H,topMargin:rt,bottomMargin:ot,leftMargin:B,rightMargin:at,curveType:F,noOfTicks:J,minValue:W,maxValue:Q,fillShape:U,highlightedLines:lt,resetSelectionOnDoubleClick:l,animate:Z===!0?{duration:.5,once:!0,amount:.5}:Z||{duration:0,once:!0,amount:0},dimmedOpacity:ct,precision:p,customLayers:ht}):null})})]})}),c||L?n.jsxRuntimeExports.jsx(Ct.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:w?.footnote,source:w?.source},sources:c,footNote:L,width:h}):n.jsxRuntimeExports.jsx("div",{})]})})})})}exports.RadarChart=Lt;
|
|
2
|
+
//# sourceMappingURL=RadarChart.js.map
|