@undp/data-viz 1.5.8 → 1.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.js +13 -13
- package/dist/{Axis-Ddg-seDi.js → Axis-4gUOL8B7.js} +2 -2
- package/dist/{Axis-Ddg-seDi.js.map → Axis-4gUOL8B7.js.map} +1 -1
- package/dist/{Axis-DE7dSn1_.cjs → Axis-CkNn1wit.cjs} +2 -2
- package/dist/{Axis-DE7dSn1_.cjs.map → Axis-CkNn1wit.cjs.map} +1 -1
- package/dist/{AxisTitle-CK9YeovX.cjs → AxisTitle-Wkz-xeQL.cjs} +2 -2
- package/dist/{AxisTitle-CK9YeovX.cjs.map → AxisTitle-Wkz-xeQL.cjs.map} +1 -1
- package/dist/{AxisTitle-BmHLMRJZ.js → AxisTitle-v6_xcXZ-.js} +2 -2
- package/dist/{AxisTitle-BmHLMRJZ.js.map → AxisTitle-v6_xcXZ-.js.map} +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.js +16 -16
- package/dist/BasicStatCard.cjs +1 -1
- package/dist/BasicStatCard.js +2 -2
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.js +42 -42
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.d.ts +2 -0
- package/dist/BiVariateChoroplethMap.js +257 -264
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.js +14 -14
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.js +45 -45
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.d.ts +2 -0
- package/dist/ChoroplethMap.js +296 -304
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +3 -3
- package/dist/ColorLegend.cjs +1 -1
- package/dist/ColorLegend.js +2 -2
- package/dist/ColorLegendWithMouseOver.cjs +1 -1
- package/dist/ColorLegendWithMouseOver.js +2 -2
- package/dist/CopyTextButton.cjs +4 -4
- package/dist/CopyTextButton.cjs.map +1 -1
- package/dist/CopyTextButton.js +27 -27
- package/dist/CopyTextButton.js.map +1 -1
- package/dist/CsvDownloadButton.cjs +1 -1
- package/dist/CsvDownloadButton.js +2 -2
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +16 -16
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.js +3 -3
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.js +12 -12
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.js +20 -20
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.d.ts +2 -0
- package/dist/DotDensityMap.js +282 -289
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CtOKZHD0.js → DropdownSelect-6kjXM6oW.js} +2 -2
- package/dist/DropdownSelect-6kjXM6oW.js.map +1 -0
- package/dist/{DropdownSelect-DBDM64B5.cjs → DropdownSelect-vt8yiB-g.cjs} +5 -5
- package/dist/DropdownSelect-vt8yiB-g.cjs.map +1 -0
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.js +9 -9
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.js +50 -50
- package/dist/{EmptyState-DdTp-Mdn.js → EmptyState-36lXXyui.js} +4 -4
- package/dist/{EmptyState-DdTp-Mdn.js.map → EmptyState-36lXXyui.js.map} +1 -1
- package/dist/{EmptyState-d8_8SxeW.cjs → EmptyState-B8IpKGcL.cjs} +2 -2
- package/dist/{EmptyState-d8_8SxeW.cjs.map → EmptyState-B8IpKGcL.cjs.map} +1 -1
- package/dist/ExcelDownloadButton.cjs +1 -1
- package/dist/ExcelDownloadButton.js +2 -2
- package/dist/FootNote.cjs +1 -1
- package/dist/FootNote.js +2 -2
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +65 -80
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +95 -125
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +73 -88
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/GraphDescription.cjs +1 -1
- package/dist/GraphDescription.js +2 -2
- package/dist/{GraphEl-CqWzvOyr.js → GraphEl-2IiUDxjR.js} +15 -12
- package/dist/GraphEl-2IiUDxjR.js.map +1 -0
- package/dist/GraphEl-qrlfGPe3.cjs +2 -0
- package/dist/GraphEl-qrlfGPe3.cjs.map +1 -0
- package/dist/GraphFooter.cjs +1 -1
- package/dist/GraphFooter.js +1 -1
- package/dist/GraphHeader.cjs +1 -1
- package/dist/GraphHeader.js +1 -1
- package/dist/GraphTitle.cjs +1 -1
- package/dist/GraphTitle.js +2 -2
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +5 -5
- package/dist/GriddedGraphsFromConfig.cjs +1 -1
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/GriddedGraphsFromConfig.js +2 -2
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.js +19 -19
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +3 -3
- package/dist/ImageDownloadButton.cjs +1 -1
- package/dist/ImageDownloadButton.js +2 -2
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.js +12 -12
- package/dist/LinearColorLegend.cjs +1 -1
- package/dist/LinearColorLegend.js +2 -2
- package/dist/{Modal-DVVwpKhP.js → Modal-Cg8daIlV.js} +198 -187
- package/dist/Modal-Cg8daIlV.js.map +1 -0
- package/dist/Modal-CuuJdWkD.cjs +46 -0
- package/dist/Modal-CuuJdWkD.cjs.map +1 -0
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +3 -3
- package/dist/MultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardFromConfig.js +2 -2
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +4 -4
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormatFromConfig.js +2 -2
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.js +12 -12
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.js +12 -12
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.js +26 -26
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +3 -3
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.js +2 -2
- package/dist/PerformanceIntensiveScrollStory.cjs +1 -1
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.js +3 -3
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.js +7 -7
- package/dist/{ReferenceLine-CfAW3vKJ.js → ReferenceLine-CPMaAX0r.js} +3 -3
- package/dist/{ReferenceLine-CfAW3vKJ.js.map → ReferenceLine-CPMaAX0r.js.map} +1 -1
- package/dist/{ReferenceLine-CFVBBN__.cjs → ReferenceLine-D04j-zeV.cjs} +2 -2
- package/dist/{ReferenceLine-CFVBBN__.cjs.map → ReferenceLine-D04j-zeV.cjs.map} +1 -1
- package/dist/{RegressionLine-C2--oMQq.js → RegressionLine-CW7iViH2.js} +4 -4
- package/dist/{RegressionLine-C2--oMQq.js.map → RegressionLine-CW7iViH2.js.map} +1 -1
- package/dist/{RegressionLine-Dj0GSiAp.cjs → RegressionLine-D-49RaHa.cjs} +2 -2
- package/dist/{RegressionLine-Dj0GSiAp.cjs.map → RegressionLine-D-49RaHa.cjs.map} +1 -1
- package/dist/SVGDownloadButton.cjs +1 -1
- package/dist/SVGDownloadButton.js +2 -2
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.js +27 -27
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.js +17 -17
- package/dist/ScrollStory.cjs +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/ScrollStory.js +3 -3
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.js +13 -13
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +6 -6
- package/dist/SingleGraphDashboardFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardFromConfig.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMaps.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.js +2 -2
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.js +2 -2
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.cjs.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +14 -13
- package/dist/SingleGraphDashboardThreeDGraphs.js.map +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.js +2 -2
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.js +26 -26
- package/dist/Source.cjs +1 -1
- package/dist/Source.js +2 -2
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.js +2 -2
- package/dist/{Spinner-C85UF28E.js → Spinner-Bpz70q_g.js} +2 -2
- package/dist/{Spinner-C85UF28E.js.map → Spinner-Bpz70q_g.js.map} +1 -1
- package/dist/{Spinner-DA6Z5E4n.cjs → Spinner-C6wLp85s.cjs} +2 -2
- package/dist/{Spinner-DA6Z5E4n.cjs.map → Spinner-C6wLp85s.cjs.map} +1 -1
- package/dist/StatCardFromData.cjs +1 -1
- package/dist/StatCardFromData.js +2 -2
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.js +29 -29
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.d.ts +2 -0
- package/dist/ThreeDGlobe.js +220 -228
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.cjs +1 -1
- package/dist/ThresholdColorLegendWithMouseOver.js +2 -2
- package/dist/{Tooltip-CVCGWyzw.js → Tooltip-6LIdPQGC.js} +2 -2
- package/dist/{Tooltip-CVCGWyzw.js.map → Tooltip-6LIdPQGC.js.map} +1 -1
- package/dist/{Tooltip-De16GWhY.cjs → Tooltip-Cpv0QohJ.cjs} +2 -2
- package/dist/{Tooltip-De16GWhY.cjs.map → Tooltip-Cpv0QohJ.cjs.map} +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.js +24 -24
- package/dist/Types.d.ts +1 -0
- package/dist/{Typography-k-kOjICQ.cjs → Typography-BDULiwlF.cjs} +2 -2
- package/dist/{Typography-k-kOjICQ.cjs.map → Typography-BDULiwlF.cjs.map} +1 -1
- package/dist/{Typography-Ctgfl1J5.js → Typography-LmZ9LEpe.js} +2 -2
- package/dist/{Typography-Ctgfl1J5.js.map → Typography-LmZ9LEpe.js.map} +1 -1
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.js +5 -5
- package/dist/{XAxesLabels-Drf7M3YK.cjs → XAxesLabels-CLZnBgSr.cjs} +2 -2
- package/dist/{XAxesLabels-Drf7M3YK.cjs.map → XAxesLabels-CLZnBgSr.cjs.map} +1 -1
- package/dist/{XAxesLabels-loO78vUO.js → XAxesLabels-SOSmso5J.js} +3 -3
- package/dist/{XAxesLabels-loO78vUO.js.map → XAxesLabels-SOSmso5J.js.map} +1 -1
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js → XTicksAndGridLines-DuydSnZ_.js} +2 -2
- package/dist/{XTicksAndGridLines-Bn9u5gOM.js.map → XTicksAndGridLines-DuydSnZ_.js.map} +1 -1
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs → XTicksAndGridLines-RKy7BVCO.cjs} +2 -2
- package/dist/{XTicksAndGridLines-CCzXIV8d.cjs.map → XTicksAndGridLines-RKy7BVCO.cjs.map} +1 -1
- package/dist/{YAxesLabels-DECkMgq8.js → YAxesLabels-DlDyLvhi.js} +3 -3
- package/dist/{YAxesLabels-DECkMgq8.js.map → YAxesLabels-DlDyLvhi.js.map} +1 -1
- package/dist/{YAxesLabels-yRFFdx1s.cjs → YAxesLabels-Dqd259-t.cjs} +2 -2
- package/dist/{YAxesLabels-yRFFdx1s.cjs.map → YAxesLabels-Dqd259-t.cjs.map} +1 -1
- package/dist/{YTicksAndGridLines-B6ah7CRf.js → YTicksAndGridLines-7t4MKtGw.js} +2 -2
- package/dist/{YTicksAndGridLines-B6ah7CRf.js.map → YTicksAndGridLines-7t4MKtGw.js.map} +1 -1
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs → YTicksAndGridLines-qGpRo_t1.cjs} +2 -2
- package/dist/{YTicksAndGridLines-DBDuz6vb.cjs.map → YTicksAndGridLines-qGpRo_t1.cjs.map} +1 -1
- package/dist/checkIfMultiple-Dko_cBvE.cjs +12 -0
- package/dist/checkIfMultiple-Dko_cBvE.cjs.map +1 -0
- package/dist/{checkIfMultiple-ChTJk2Tk.js → checkIfMultiple-u2SmbiCf.js} +11 -11
- package/dist/checkIfMultiple-u2SmbiCf.js.map +1 -0
- package/dist/{customArea-CK768gCn.cjs → customArea-1G1S78s_.cjs} +2 -2
- package/dist/{customArea-CK768gCn.cjs.map → customArea-1G1S78s_.cjs.map} +1 -1
- package/dist/{customArea-B-dWU0zZ.js → customArea-x4L4xwLl.js} +3 -3
- package/dist/{customArea-B-dWU0zZ.js.map → customArea-x4L4xwLl.js.map} +1 -1
- package/dist/getSliderMarks-CUxPy36E.cjs +6 -0
- package/dist/getSliderMarks-CUxPy36E.cjs.map +1 -0
- package/dist/{getSliderMarks-9cNoRkDx.js → getSliderMarks-_pYOWEtO.js} +3 -3
- package/dist/getSliderMarks-_pYOWEtO.js.map +1 -0
- package/dist/{index-BYzIB5V6.cjs → index-BHe3wsWF.cjs} +2 -2
- package/dist/{index-BYzIB5V6.cjs.map → index-BHe3wsWF.cjs.map} +1 -1
- package/dist/{index-DKCxu1Gh.js → index-Bw_eHBVN.js} +3 -3
- package/dist/{index-DKCxu1Gh.js.map → index-Bw_eHBVN.js.map} +1 -1
- package/dist/{index-BW_-wD2k.cjs → index-C0bpbS4F.cjs} +2 -2
- package/dist/{index-BW_-wD2k.cjs.map → index-C0bpbS4F.cjs.map} +1 -1
- package/dist/{index-37q0ULNQ.js → index-CE9pmfxt.js} +17 -17
- package/dist/{index-37q0ULNQ.js.map → index-CE9pmfxt.js.map} +1 -1
- package/dist/{index-CVlCtJbC.cjs → index-CEJwW3lL.cjs} +2 -2
- package/dist/{index-CVlCtJbC.cjs.map → index-CEJwW3lL.cjs.map} +1 -1
- package/dist/{index-CHPV5EwG-BPSP-7Jg.js → index-CHPV5EwG-DBWUSD9b.js} +539 -543
- package/dist/index-CHPV5EwG-DBWUSD9b.js.map +1 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs +44 -0
- package/dist/index-CHPV5EwG-DjM48pIC.cjs.map +1 -0
- package/dist/{index-BW8iNx7E.cjs → index-Cm8NIdOO.cjs} +2 -2
- package/dist/{index-BW8iNx7E.cjs.map → index-Cm8NIdOO.cjs.map} +1 -1
- package/dist/{index-tvAyXPPW-DBlMKnNB.js → index-Cw8sCyo_-BuI_jX5Z.js} +3 -3
- package/dist/{index-tvAyXPPW-DBlMKnNB.js.map → index-Cw8sCyo_-BuI_jX5Z.js.map} +1 -1
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs +2 -0
- package/dist/index-Cw8sCyo_-gxT8ADyn.cjs.map +1 -0
- package/dist/{index-CNvov0eg.js → index-Cwgh7i7X.js} +3 -3
- package/dist/{index-CNvov0eg.js.map → index-Cwgh7i7X.js.map} +1 -1
- package/dist/{index-DG3YrCr5-D3FrrXj8.js → index-Dzc_aaI9-BKklH89r.js} +2 -2
- package/dist/{index-DG3YrCr5-D3FrrXj8.js.map → index-Dzc_aaI9-BKklH89r.js.map} +1 -1
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs → index-Dzc_aaI9-RIk2GRHD.cjs} +2 -2
- package/dist/{index-DG3YrCr5-v7rayV3N.cjs.map → index-Dzc_aaI9-RIk2GRHD.cjs.map} +1 -1
- package/dist/{index-BmCqpO1B.js → index-zZjQEHlm.js} +2 -2
- package/dist/{index-BmCqpO1B.js.map → index-zZjQEHlm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/{proxy-CkpFesk1.js → proxy-BYIC9BuT.js} +2 -2
- package/dist/{proxy-CkpFesk1.js.map → proxy-BYIC9BuT.js.map} +1 -1
- package/dist/{proxy-BHRoeZgd.cjs → proxy-CKadx4lC.cjs} +2 -2
- package/dist/{proxy-BHRoeZgd.cjs.map → proxy-CKadx4lC.cjs.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{use-in-view-sQJZ_xDO.cjs → use-in-view-CEwlc_dd.cjs} +2 -2
- package/dist/{use-in-view-sQJZ_xDO.cjs.map → use-in-view-CEwlc_dd.cjs.map} +1 -1
- package/dist/{use-in-view-yS6jzJAp.js → use-in-view-DR-UTB96.js} +2 -2
- package/dist/{use-in-view-yS6jzJAp.js.map → use-in-view-DR-UTB96.js.map} +1 -1
- package/package.json +4 -4
- package/dist/DropdownSelect-CtOKZHD0.js.map +0 -1
- package/dist/DropdownSelect-DBDM64B5.cjs.map +0 -1
- package/dist/GraphEl-C6yjl1VM.cjs +0 -2
- package/dist/GraphEl-C6yjl1VM.cjs.map +0 -1
- package/dist/GraphEl-CqWzvOyr.js.map +0 -1
- package/dist/Modal-DVVwpKhP.js.map +0 -1
- package/dist/Modal-tXZlLE5s.cjs +0 -46
- package/dist/Modal-tXZlLE5s.cjs.map +0 -1
- package/dist/checkIfMultiple-BXbHUCWM.cjs +0 -12
- package/dist/checkIfMultiple-BXbHUCWM.cjs.map +0 -1
- package/dist/checkIfMultiple-ChTJk2Tk.js.map +0 -1
- package/dist/getSliderMarks-9cNoRkDx.js.map +0 -1
- package/dist/getSliderMarks-CRIbTGYV.cjs +0 -6
- package/dist/getSliderMarks-CRIbTGYV.cjs.map +0 -1
- package/dist/index-CHPV5EwG-BPSP-7Jg.js.map +0 -1
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs +0 -44
- package/dist/index-CHPV5EwG-DDoeWRVt.cjs.map +0 -1
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs +0 -2
- package/dist/index-tvAyXPPW-DPOG-C2i.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-CHPV5EwG-DjM48pIC.cjs"),o=require("react"),n=require("./Spinner-C6wLp85s.cjs"),d=require("./MultiGraphDashboardWideToLongFormat.cjs"),u=require("./fetchAndParseData-Ba-_CgxS.cjs");function h(s){const{config:t}=s,[e,r]=o.useState(void 0);return o.useEffect(()=>{typeof t=="string"?u.fetchAndParseJSON(t).then(i=>{r(i)}):r(t)},[t]),e?a.jsxRuntimeExports.jsx(d.MultiGraphDashboardWideToLongFormat,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}):a.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:a.jsxRuntimeExports.jsx(n.y,{})})}exports.MultiGraphDashboardWideToLongFormatFromConfig=h;
|
|
2
2
|
//# sourceMappingURL=MultiGraphDashboardWideToLongFormatFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as a } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as a } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as d, useEffect as i } from "react";
|
|
3
|
-
import { y as n } from "./Spinner-
|
|
3
|
+
import { y as n } from "./Spinner-Bpz70q_g.js";
|
|
4
4
|
import { MultiGraphDashboardWideToLongFormat as f } from "./MultiGraphDashboardWideToLongFormat.js";
|
|
5
5
|
import { f as h } from "./fetchAndParseData-sapWbnYk.js";
|
|
6
6
|
function b(r) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),g=require("react"),d=require("./parse-hMnG_lRV.cjs"),De=require("./index-CQ3e6Ewi.cjs"),qe=require("./numberFormattingFunction-02t-wJta.cjs"),Me=require("./Tooltip-De16GWhY.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./customArea-CK768gCn.cjs"),$e=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),Ve=require("./XTicksAndGridLines-CCzXIV8d.cjs"),Ue=require("./ReferenceLine-CFVBBN__.cjs"),Fe=require("./YTicksAndGridLines-DBDuz6vb.cjs"),He=require("./index-BYzIB5V6.cjs"),A=require("./Colors.cjs"),fe=require("./uniqBy-O05lp2S5.cjs"),We=require("./sort-O96oMZLb.cjs"),Le=require("./init-DU0ybBc_.cjs"),Ge=require("./time-Byw_jYQ7.cjs"),Ye=require("./linear-BVckp9RD.cjs"),Pe=require("./delaunay-rcy0HhZi.cjs"),Ie=require("./line-DHV4JwCR.cjs"),he=require("./step-BZ3C8QFW.cjs"),Xe=require("./select-Bnfk0lJx.cjs"),Be=require("./pointer-Dkq5NV1q.cjs"),ze=require("./use-in-view-sQJZ_xDO.cjs"),Y=require("./proxy-BHRoeZgd.cjs"),Je=require("./GraphFooter.cjs"),Ke=require("./GraphHeader.cjs"),Qe=require("./EmptyState-d8_8SxeW.cjs"),Ze=require("./ColorLegendWithMouseOver.cjs");function _e(de){const{data:n,width:I,height:K,lineColors:r,dateFormat:x,noOfXTicks:ge,rightMargin:_,topMargin:pe,bottomMargin:P,suffix:N,prefix:m,leftMargin:C,tooltip:ee,onSeriesMouseOver:T,refValues:Q,highlightAreaSettings:S,minValue:X,maxValue:te,highlightedLines:k,animate:s,rtl:ie,strokeWidth:D,showDots:B,annotations:ye,customHighlightAreaSettings:je,yAxisTitle:oe,noOfYTicks:we,minDate:re,maxDate:ne,curveType:z,styles:O,colorDomain:p,selectedColor:V,classNames:y,showLabels:U,dimmedOpacity:R,precision:q,naLabel:be,customLayers:se}=de,ae=g.useRef(null),j=ze.useInView(ae,{once:s.once,amount:s.amount}),[E,ve]=g.useState(!1);g.useEffect(()=>{if(j&&!E){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[j,E,s.duration]);const Oe=z==="linear"?Ie.curveLinear:z==="step"?he.curveStep:z==="stepAfter"?he.stepAfter:z==="stepBefore"?he.stepBefore:he.monotoneX,l=De.orderBy(n.map(e=>({...e,date:d.parse(`${e.date}`,x,new Date)})),["date"],["asc"]).filter(e=>!h.checkIfNullOrUndefined(e.y)),Ce=fe.uniqBy(l,"label",!0),Z=We.sort(fe.uniqBy(n,"date",!0).map(e=>d.parse(`${e}`,x,new Date)),(e,i)=>Le.ascending(e,i)),[f,w]=g.useState(void 0),[L,F]=g.useState(void 0),[le,H]=g.useState(void 0),b={top:pe,bottom:P,left:oe?C+30:C,right:_},W=g.useRef(null),ce=Ce.map(e=>De.orderBy(l.filter(i=>i.label==e),["date"],["asc"])),ue=S.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,x,new Date)]})),xe=je.map(e=>({...e,coordinates:e.coordinates.map((i,u)=>u%2===0?d.parse(`${i}`,x,new Date):i)})),v=I-b.left-b.right,M=K-b.top-b.bottom,G=re?d.parse(`${re}`,x,new Date):Z[0],me=ne?d.parse(`${ne}`,x,new Date):Z[Z.length-1],o=h.checkIfNullOrUndefined(X)?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))>0?0:Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0:X,J=Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0,a=Ge.time().domain([G,me]).range([0,v]),c=Ye.linear().domain([h.checkIfNullOrUndefined(X)?o:X,h.checkIfNullOrUndefined(te)?J>0?J:0:te]).range([M,0]).nice(),Se=Pe.Delaunay.from(l.filter(e=>!h.checkIfNullOrUndefined(e.date)&&!h.checkIfNullOrUndefined(e.y)),e=>a(e.date),e=>c(e.y)).voronoi([0,0,v<0?0:v,M<0?0:M]),Re=Ie.line().x(e=>a(e.date)).y(e=>c(e.y)).curve(Oe),Ne=c.ticks(we),ke=a.ticks(ge);return g.useEffect(()=>{const e=u=>{const $=l[Le.bisectCenter(l.map(Ee=>Ee.date),a.invert(Be.pointer(u)[0]),0)];w($||l[l.length-1]),H(u.clientY),F(u.clientX),T?.($||l[l.length-1])},i=()=>{w(void 0),F(void 0),H(void 0)};Xe.select(W.current).on("mousemove",e).on("mouseout",i),T?.(void 0)},[a,l,T]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y.motion.svg,{width:`${I}px`,height:`${K}px`,viewBox:`0 0 ${I} ${K}`,direction:"ltr",ref:ae,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[t.jsxRuntimeExports.jsx(He.HighlightArea,{areaSettings:ue,width:v,height:M,scale:a,animate:s,isInView:j}),t.jsxRuntimeExports.jsx(Ae.CustomArea,{areaSettings:xe,scaleX:a,scaleY:c,animate:s,isInView:j}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:Ne.filter(e=>e!==0),y:Ne.filter(e=>e!==0).map(e=>c(e)),x1:0-C,x2:v+b.right,styles:{gridLines:O?.yAxis?.gridLines,labels:O?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:N,prefix:m,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:q}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:c(o<0?0:o),y2:c(o<0?0:o),x1:0-C,x2:v+b.right,label:qe.numberFormattingFunction(o<0?0:o,"NA",q,m,N),labelPos:{x:0-C,y:c(o<0?0:o),dx:0,dy:J<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:O?.xAxis?.axis,label:O?.yAxis?.labels}}),t.jsxRuntimeExports.jsx($e.AxisTitle,{x:0-C-15,y:M/2,style:O?.yAxis?.title,className:y?.yAxis?.title,text:oe,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(Ve.XTicksAndGridLines,{values:ke.map(e=>d.format(e,x)),x:ke.map(e=>a(e)),y1:0,y2:M,styles:{gridLines:O?.xAxis?.gridLines,labels:O?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:N,prefix:m,labelType:"primary",showGridLines:!0,precision:q})}),se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs(Y.motion.g,{children:[ce.map(e=>t.jsxRuntimeExports.jsxs(Y.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1},whileInView:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(Y.motion.path,{d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",style:{fill:"none",strokeWidth:f?e[0].label===f.label?D+Math.max(2,.5*D):D:k.length!==0&&k.indexOf(e[0].label)!==-1?D+Math.max(2,.5*D):D},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray},whileInView:{pathLength:1,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),e.map((i,u)=>t.jsxRuntimeExports.jsx(Y.motion.g,{children:h.checkIfNullOrUndefined(i.y)?null:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:B?t.jsxRuntimeExports.jsx(Y.motion.circle,{r:v/e.length<5?0:v/e.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,cx:a(i.date),cy:c(i.y)},whileInView:{opacity:1,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:E?s.duration:.5,delay:E?0:s.duration},cx:a(i.date),cy:c(i.y)}},initial:"initial",animate:j?"whileInView":"initial"}):null})},u)),(k.indexOf(e[0].label)!==-1||f?.label===e[0].label)&&U?t.jsxRuntimeExports.jsx(Y.motion.text,{className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y)},whileInView:{opacity:1,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y),transition:{duration:E?s.duration:.5,delay:E?0:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:e[0].label}):null]},e[0].label)),f?t.jsxRuntimeExports.jsx("text",{y:c(f.y)-8,x:a(f.date),className:t.mo("graph-value text-sm font-bold",y?.graphObjectValues),style:{fill:n.filter(e=>e.color).length===0?r[0]:f.color?r[p.indexOf(f.color)]:A.Colors.gray,textAnchor:"middle",...O?.graphObjectValues||{}},children:qe.numberFormattingFunction(f.y,be,q,m,N)}):null]}),l.filter(e=>!h.checkIfNullOrUndefined(e.y)).map((e,i)=>t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:Se.renderCell(l.findIndex(u=>u.label===e.label&&u.date===e.date)),opacity:0,onMouseEnter:u=>{w(e),H(u.clientY),F(u.clientX),T?.(e)},onMouseMove:u=>{w(e),H(u.clientY),F(u.clientX)},onMouseLeave:()=>{w(void 0),F(void 0),H(void 0),T?.(void 0)}})},i)),Q?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Q.map((e,i)=>t.jsxRuntimeExports.jsx(Ue.RefLineY,{text:e.text,color:e.color,y:c(e.value),x1:0-C,x2:v+b.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i))}):null,t.jsxRuntimeExports.jsx("g",{children:ye.map((e,i)=>{const u=Ae.getLineEndPoint({x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?c(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),$=e.showConnector?{y1:u.y,x1:u.x,y2:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?c(e.yCoordinate):0,cx:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Ee={y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:ie?0:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:ie?e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):v+b.right-(e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(Ae.Annotation,{color:e.color,connectorsSettings:$,labelSettings:Ee,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i)})}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),f&&ee&&L&&le?t.jsxRuntimeExports.jsx(Me.Tooltip,{data:f,body:ee,xPos:L,yPos:le,backgroundStyle:O?.tooltip,className:y?.tooltip}):null]})}function et(de){const{data:n,graphTitle:I,showNAColor:K=!0,colors:r,colorDomain:x,suffix:ge="",sources:_,prefix:pe="",graphDescription:P,height:N,width:m,footNote:C,noOfXTicks:ee=10,dateFormat:T="yyyy",padding:Q,backgroundColor:S=!1,leftMargin:X=30,rightMargin:te=50,topMargin:k=20,bottomMargin:s=25,showColorScale:ie=!0,tooltip:D,relativeHeight:B,onSeriesMouseOver:ye,showLabels:je=!0,refValues:oe=[],highlightAreaSettings:we=[],graphID:re,minValue:ne,maxValue:z,highlightedLines:O=[],graphDownload:p=!1,dataDownload:V=!1,animate:y=!1,language:U="en",colorLegendTitle:R,minHeight:q=0,strokeWidth:be=2,showDots:se=!0,annotations:ae=[],customHighlightAreaSettings:j=[],theme:E="light",ariaLabel:ve,yAxisTitle:Oe,noOfYTicks:l=5,minDate:Ce,maxDate:Z,curveType:f="curve",styles:w,classNames:L,dimmedOpacity:F=.3,precision:le=2,customLayers:H=[],naLabel:b="NA"}=de,[W,ce]=g.useState(0),[ue,xe]=g.useState(0),[v,M]=g.useState(void 0),G=g.useRef(null),me=g.useRef(null);return g.useEffect(()=>{const o=new ResizeObserver(J=>{ce(m||J[0].target.clientWidth||620),xe(N||J[0].target.clientHeight||480)});return G.current&&(xe(G.current.clientHeight||480),ce(G.current.clientWidth||620),m||o.observe(G.current)),()=>o.disconnect()},[m,N]),t.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:U==="he"||U==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${U||"en"}`,m?"w-fit":"w-full",L?.graphContainer),style:{...w?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:re,ref:me,"aria-label":ve||`${I?`The graph shows ${I}. `:""}This is a multi-line chart that shows trends over time.${P?` ${P}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?Q||"1rem":Q||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[I||P||p||V?t.jsxRuntimeExports.jsx(Ke.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:L?.title,description:L?.description},graphTitle:I,graphDescription:P,width:m,graphDownload:p?me.current:void 0,dataDownload:V?n.map(o=>o.data).filter(o=>o!==void 0).length>0?n.map(o=>o.data).filter(o=>o!==void 0):n.filter(o=>o!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?t.jsxRuntimeExports.jsx(Qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ie&&n.filter(o=>o.color).length!==0?t.jsxRuntimeExports.jsx(Ze.ColorLegendWithMouseOver,{width:m,colorLegendTitle:R,colors:r||A.Colors[E].categoricalColors.colors,colorDomain:x||fe.uniqBy(n,"color",!0),setSelectedColor:M,showNAColor:K}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:G,"aria-label":"Graph area",children:(m||W)&&(N||ue)?t.jsxRuntimeExports.jsx(_e,{data:n,lineColors:n.filter(o=>o.color).length===0?r?[r]:[A.Colors.primaryColors["blue-600"]]:r||A.Colors[E].categoricalColors.colors,width:m||W,height:Math.max(q,N||(B?q?(m||W)*B>q?(m||W)*B:q:(m||W)*B:ue)),dateFormat:T,noOfXTicks:ee,leftMargin:X,rightMargin:te,topMargin:k,bottomMargin:s,tooltip:D,onSeriesMouseOver:ye,suffix:ge,prefix:pe,highlightAreaSettings:we,refValues:oe,minValue:ne,maxValue:z,highlightedLines:O,animate:y===!0?{duration:.5,once:!0,amount:.5}:y||{duration:0,once:!0,amount:0},rtl:U==="he"||U==="ar",strokeWidth:be,showDots:se,annotations:ae,customHighlightAreaSettings:j,yAxisTitle:Oe,noOfYTicks:l,minDate:Ce,maxDate:Z,curveType:f,styles:w,classNames:L,selectedColor:v,showLabels:je,colorDomain:n.filter(o=>o.color).length===0?[]:x||fe.uniqBy(n,"color",!0),dimmedOpacity:F,precision:le,customLayers:H,naLabel:b}):null})]})}),_||C?t.jsxRuntimeExports.jsx(Je.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:L?.footnote,source:L?.source},sources:_,footNote:C,width:m}):null]})})})})}exports.MultiLineAltChart=et;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),g=require("react"),d=require("./parse-hMnG_lRV.cjs"),De=require("./index-CQ3e6Ewi.cjs"),qe=require("./numberFormattingFunction-02t-wJta.cjs"),Me=require("./Tooltip-Cpv0QohJ.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ae=require("./customArea-1G1S78s_.cjs"),$e=require("./AxisTitle-Wkz-xeQL.cjs"),Te=require("./Axis-CkNn1wit.cjs"),Ve=require("./XTicksAndGridLines-RKy7BVCO.cjs"),Ue=require("./ReferenceLine-D04j-zeV.cjs"),Fe=require("./YTicksAndGridLines-qGpRo_t1.cjs"),He=require("./index-BHe3wsWF.cjs"),A=require("./Colors.cjs"),fe=require("./uniqBy-O05lp2S5.cjs"),We=require("./sort-O96oMZLb.cjs"),Le=require("./init-DU0ybBc_.cjs"),Ge=require("./time-Byw_jYQ7.cjs"),Ye=require("./linear-BVckp9RD.cjs"),Pe=require("./delaunay-rcy0HhZi.cjs"),Ie=require("./line-DHV4JwCR.cjs"),he=require("./step-BZ3C8QFW.cjs"),Xe=require("./select-Bnfk0lJx.cjs"),Be=require("./pointer-Dkq5NV1q.cjs"),ze=require("./use-in-view-CEwlc_dd.cjs"),Y=require("./proxy-CKadx4lC.cjs"),Je=require("./GraphFooter.cjs"),Ke=require("./GraphHeader.cjs"),Qe=require("./EmptyState-B8IpKGcL.cjs"),Ze=require("./ColorLegendWithMouseOver.cjs");function _e(de){const{data:n,width:I,height:K,lineColors:r,dateFormat:x,noOfXTicks:ge,rightMargin:_,topMargin:pe,bottomMargin:P,suffix:N,prefix:m,leftMargin:C,tooltip:ee,onSeriesMouseOver:T,refValues:Q,highlightAreaSettings:S,minValue:X,maxValue:te,highlightedLines:k,animate:s,rtl:ie,strokeWidth:D,showDots:B,annotations:ye,customHighlightAreaSettings:je,yAxisTitle:oe,noOfYTicks:we,minDate:re,maxDate:ne,curveType:z,styles:O,colorDomain:p,selectedColor:V,classNames:y,showLabels:U,dimmedOpacity:R,precision:q,naLabel:be,customLayers:se}=de,ae=g.useRef(null),j=ze.useInView(ae,{once:s.once,amount:s.amount}),[E,ve]=g.useState(!1);g.useEffect(()=>{if(j&&!E){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[j,E,s.duration]);const Oe=z==="linear"?Ie.curveLinear:z==="step"?he.curveStep:z==="stepAfter"?he.stepAfter:z==="stepBefore"?he.stepBefore:he.monotoneX,l=De.orderBy(n.map(e=>({...e,date:d.parse(`${e.date}`,x,new Date)})),["date"],["asc"]).filter(e=>!h.checkIfNullOrUndefined(e.y)),Ce=fe.uniqBy(l,"label",!0),Z=We.sort(fe.uniqBy(n,"date",!0).map(e=>d.parse(`${e}`,x,new Date)),(e,i)=>Le.ascending(e,i)),[f,w]=g.useState(void 0),[L,F]=g.useState(void 0),[le,H]=g.useState(void 0),b={top:pe,bottom:P,left:oe?C+30:C,right:_},W=g.useRef(null),ce=Ce.map(e=>De.orderBy(l.filter(i=>i.label==e),["date"],["asc"])),ue=S.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:d.parse(`${e.coordinates[0]}`,x,new Date),e.coordinates[1]===null?null:d.parse(`${e.coordinates[1]}`,x,new Date)]})),xe=je.map(e=>({...e,coordinates:e.coordinates.map((i,u)=>u%2===0?d.parse(`${i}`,x,new Date):i)})),v=I-b.left-b.right,M=K-b.top-b.bottom,G=re?d.parse(`${re}`,x,new Date):Z[0],me=ne?d.parse(`${ne}`,x,new Date):Z[Z.length-1],o=h.checkIfNullOrUndefined(X)?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))>0?0:Math.min(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0:X,J=Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e)))?Math.max(...l.map(e=>e.y).filter(e=>!h.checkIfNullOrUndefined(e))):0,a=Ge.time().domain([G,me]).range([0,v]),c=Ye.linear().domain([h.checkIfNullOrUndefined(X)?o:X,h.checkIfNullOrUndefined(te)?J>0?J:0:te]).range([M,0]).nice(),Se=Pe.Delaunay.from(l.filter(e=>!h.checkIfNullOrUndefined(e.date)&&!h.checkIfNullOrUndefined(e.y)),e=>a(e.date),e=>c(e.y)).voronoi([0,0,v<0?0:v,M<0?0:M]),Re=Ie.line().x(e=>a(e.date)).y(e=>c(e.y)).curve(Oe),Ne=c.ticks(we),ke=a.ticks(ge);return g.useEffect(()=>{const e=u=>{const $=l[Le.bisectCenter(l.map(Ee=>Ee.date),a.invert(Be.pointer(u)[0]),0)];w($||l[l.length-1]),H(u.clientY),F(u.clientX),T?.($||l[l.length-1])},i=()=>{w(void 0),F(void 0),H(void 0)};Xe.select(W.current).on("mousemove",e).on("mouseout",i),T?.(void 0)},[a,l,T]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y.motion.svg,{width:`${I}px`,height:`${K}px`,viewBox:`0 0 ${I} ${K}`,direction:"ltr",ref:ae,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${b.left},${b.top})`,children:[t.jsxRuntimeExports.jsx(He.HighlightArea,{areaSettings:ue,width:v,height:M,scale:a,animate:s,isInView:j}),t.jsxRuntimeExports.jsx(Ae.CustomArea,{areaSettings:xe,scaleX:a,scaleY:c,animate:s,isInView:j}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Fe.YTicksAndGridLines,{values:Ne.filter(e=>e!==0),y:Ne.filter(e=>e!==0).map(e=>c(e)),x1:0-C,x2:v+b.right,styles:{gridLines:O?.yAxis?.gridLines,labels:O?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:N,prefix:m,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:q}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:c(o<0?0:o),y2:c(o<0?0:o),x1:0-C,x2:v+b.right,label:qe.numberFormattingFunction(o<0?0:o,"NA",q,m,N),labelPos:{x:0-C,y:c(o<0?0:o),dx:0,dy:J<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:O?.xAxis?.axis,label:O?.yAxis?.labels}}),t.jsxRuntimeExports.jsx($e.AxisTitle,{x:0-C-15,y:M/2,style:O?.yAxis?.title,className:y?.yAxis?.title,text:oe,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(Ve.XTicksAndGridLines,{values:ke.map(e=>d.format(e,x)),x:ke.map(e=>a(e)),y1:0,y2:M,styles:{gridLines:O?.xAxis?.gridLines,labels:O?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:N,prefix:m,labelType:"primary",showGridLines:!0,precision:q})}),se.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs(Y.motion.g,{children:[ce.map(e=>t.jsxRuntimeExports.jsxs(Y.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1},whileInView:{opacity:f?e[0].label===f.label?1:R:V?e[0].color&&r[p.indexOf(e[0].color)]===V?1:R:k.length!==0?k.indexOf(e[0].label)!==-1?1:R:1,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(Y.motion.path,{d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",style:{fill:"none",strokeWidth:f?e[0].label===f.label?D+Math.max(2,.5*D):D:k.length!==0&&k.indexOf(e[0].label)!==-1?D+Math.max(2,.5*D):D},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray},whileInView:{pathLength:1,d:Re(e.filter(i=>!h.checkIfNullOrUndefined(i.y)))||"",opacity:1,stroke:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:s.duration}}},initial:"initial",animate:j?"whileInView":"initial"}),e.map((i,u)=>t.jsxRuntimeExports.jsx(Y.motion.g,{children:h.checkIfNullOrUndefined(i.y)?null:t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:B?t.jsxRuntimeExports.jsx(Y.motion.circle,{r:v/e.length<5?0:v/e.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,cx:a(i.date),cy:c(i.y)},whileInView:{opacity:1,fill:n.filter($=>$.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,transition:{duration:E?s.duration:.5,delay:E?0:s.duration},cx:a(i.date),cy:c(i.y)}},initial:"initial",animate:j?"whileInView":"initial"}):null})},u)),(k.indexOf(e[0].label)!==-1||f?.label===e[0].label)&&U?t.jsxRuntimeExports.jsx(Y.motion.text,{className:"text-sm font-bold",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y)},whileInView:{opacity:1,fill:n.filter(i=>i.color).length===0?r[0]:e[0].color?r[p.indexOf(e[0].color)]:A.Colors.gray,x:a(e[e.length-1].date),y:c(e[e.length-1].y),transition:{duration:E?s.duration:.5,delay:E?0:s.duration}}},initial:"initial",animate:j?"whileInView":"initial",children:e[0].label}):null]},e[0].label)),f?t.jsxRuntimeExports.jsx("text",{y:c(f.y)-8,x:a(f.date),className:t.mo("graph-value text-sm font-bold",y?.graphObjectValues),style:{fill:n.filter(e=>e.color).length===0?r[0]:f.color?r[p.indexOf(f.color)]:A.Colors.gray,textAnchor:"middle",...O?.graphObjectValues||{}},children:qe.numberFormattingFunction(f.y,be,q,m,N)}):null]}),l.filter(e=>!h.checkIfNullOrUndefined(e.y)).map((e,i)=>t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx("path",{d:Se.renderCell(l.findIndex(u=>u.label===e.label&&u.date===e.date)),opacity:0,onMouseEnter:u=>{w(e),H(u.clientY),F(u.clientX),T?.(e)},onMouseMove:u=>{w(e),H(u.clientY),F(u.clientX)},onMouseLeave:()=>{w(void 0),F(void 0),H(void 0),T?.(void 0)}})},i)),Q?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:Q.map((e,i)=>t.jsxRuntimeExports.jsx(Ue.RefLineY,{text:e.text,color:e.color,y:c(e.value),x1:0-C,x2:v+b.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i))}):null,t.jsxRuntimeExports.jsx("g",{children:ye.map((e,i)=>{const u=Ae.getLineEndPoint({x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,y:e.yCoordinate?c(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),$=e.showConnector?{y1:u.y,x1:u.x,y2:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?c(e.yCoordinate):0,cx:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Ee={y:e.yCoordinate?c(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:ie?0:e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:ie?e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0):v+b.right-(e.xCoordinate?a(d.parse(`${e.xCoordinate}`,x,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(Ae.Annotation,{color:e.color,connectorsSettings:$,labelSettings:Ee,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:j},i)})}),se.filter(e=>e.position==="after").map(e=>e.layer)]})}),f&&ee&&L&&le?t.jsxRuntimeExports.jsx(Me.Tooltip,{data:f,body:ee,xPos:L,yPos:le,backgroundStyle:O?.tooltip,className:y?.tooltip}):null]})}function et(de){const{data:n,graphTitle:I,showNAColor:K=!0,colors:r,colorDomain:x,suffix:ge="",sources:_,prefix:pe="",graphDescription:P,height:N,width:m,footNote:C,noOfXTicks:ee=10,dateFormat:T="yyyy",padding:Q,backgroundColor:S=!1,leftMargin:X=30,rightMargin:te=50,topMargin:k=20,bottomMargin:s=25,showColorScale:ie=!0,tooltip:D,relativeHeight:B,onSeriesMouseOver:ye,showLabels:je=!0,refValues:oe=[],highlightAreaSettings:we=[],graphID:re,minValue:ne,maxValue:z,highlightedLines:O=[],graphDownload:p=!1,dataDownload:V=!1,animate:y=!1,language:U="en",colorLegendTitle:R,minHeight:q=0,strokeWidth:be=2,showDots:se=!0,annotations:ae=[],customHighlightAreaSettings:j=[],theme:E="light",ariaLabel:ve,yAxisTitle:Oe,noOfYTicks:l=5,minDate:Ce,maxDate:Z,curveType:f="curve",styles:w,classNames:L,dimmedOpacity:F=.3,precision:le=2,customLayers:H=[],naLabel:b="NA"}=de,[W,ce]=g.useState(0),[ue,xe]=g.useState(0),[v,M]=g.useState(void 0),G=g.useRef(null),me=g.useRef(null);return g.useEffect(()=>{const o=new ResizeObserver(J=>{ce(m||J[0].target.clientWidth||620),xe(N||J[0].target.clientHeight||480)});return G.current&&(xe(G.current.clientHeight||480),ce(G.current.clientWidth||620),m||o.observe(G.current)),()=>o.disconnect()},[m,N]),t.jsxRuntimeExports.jsx("div",{className:`${E||"light"} flex ${m?"w-fit grow-0":"w-full grow"}`,dir:U==="he"||U==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${S?S===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${U||"en"}`,m?"w-fit":"w-full",L?.graphContainer),style:{...w?.graphContainer||{},...S&&S!==!0?{backgroundColor:S}:{}},id:re,ref:me,"aria-label":ve||`${I?`The graph shows ${I}. `:""}This is a multi-line chart that shows trends over time.${P?` ${P}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:S?Q||"1rem":Q||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[I||P||p||V?t.jsxRuntimeExports.jsx(Ke.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:L?.title,description:L?.description},graphTitle:I,graphDescription:P,width:m,graphDownload:p?me.current:void 0,dataDownload:V?n.map(o=>o.data).filter(o=>o!==void 0).length>0?n.map(o=>o.data).filter(o=>o!==void 0):n.filter(o=>o!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:n.length===0?t.jsxRuntimeExports.jsx(Qe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ie&&n.filter(o=>o.color).length!==0?t.jsxRuntimeExports.jsx(Ze.ColorLegendWithMouseOver,{width:m,colorLegendTitle:R,colors:r||A.Colors[E].categoricalColors.colors,colorDomain:x||fe.uniqBy(n,"color",!0),setSelectedColor:M,showNAColor:K}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:G,"aria-label":"Graph area",children:(m||W)&&(N||ue)?t.jsxRuntimeExports.jsx(_e,{data:n,lineColors:n.filter(o=>o.color).length===0?r?[r]:[A.Colors.primaryColors["blue-600"]]:r||A.Colors[E].categoricalColors.colors,width:m||W,height:Math.max(q,N||(B?q?(m||W)*B>q?(m||W)*B:q:(m||W)*B:ue)),dateFormat:T,noOfXTicks:ee,leftMargin:X,rightMargin:te,topMargin:k,bottomMargin:s,tooltip:D,onSeriesMouseOver:ye,suffix:ge,prefix:pe,highlightAreaSettings:we,refValues:oe,minValue:ne,maxValue:z,highlightedLines:O,animate:y===!0?{duration:.5,once:!0,amount:.5}:y||{duration:0,once:!0,amount:0},rtl:U==="he"||U==="ar",strokeWidth:be,showDots:se,annotations:ae,customHighlightAreaSettings:j,yAxisTitle:Oe,noOfYTicks:l,minDate:Ce,maxDate:Z,curveType:f,styles:w,classNames:L,selectedColor:v,showLabels:je,colorDomain:n.filter(o=>o.color).length===0?[]:x||fe.uniqBy(n,"color",!0),dimmedOpacity:F,precision:le,customLayers:H,naLabel:b}):null})]})}),_||C?t.jsxRuntimeExports.jsx(Je.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:L?.footnote,source:L?.source},sources:_,footNote:C,width:m}):null]})})})})}exports.MultiLineAltChart=et;
|
|
2
2
|
//# sourceMappingURL=MultiLineAltChart.cjs.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as t, m as xe } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as t, m as xe } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as ge, useState as G, useEffect as $e } from "react";
|
|
3
3
|
import { p as u, f as Ve } from "./parse-DlCRUFh_.js";
|
|
4
4
|
import { o as Te } from "./index-DvVprvy6.js";
|
|
5
5
|
import { n as Se } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
-
import { T as He } from "./Tooltip-
|
|
6
|
+
import { T as He } from "./Tooltip-6LIdPQGC.js";
|
|
7
7
|
import { c as x } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
|
-
import { C as We, g as Ie, A as Re } from "./customArea-
|
|
9
|
-
import { A as Ye } from "./AxisTitle-
|
|
10
|
-
import { A as Fe } from "./Axis-
|
|
11
|
-
import { X as Xe } from "./XTicksAndGridLines-
|
|
12
|
-
import { R as Pe } from "./ReferenceLine-
|
|
13
|
-
import { Y as Ee } from "./YTicksAndGridLines-
|
|
14
|
-
import { H as Ge } from "./index-
|
|
8
|
+
import { C as We, g as Ie, A as Re } from "./customArea-x4L4xwLl.js";
|
|
9
|
+
import { A as Ye } from "./AxisTitle-v6_xcXZ-.js";
|
|
10
|
+
import { A as Fe } from "./Axis-4gUOL8B7.js";
|
|
11
|
+
import { X as Xe } from "./XTicksAndGridLines-DuydSnZ_.js";
|
|
12
|
+
import { R as Pe } from "./ReferenceLine-CPMaAX0r.js";
|
|
13
|
+
import { Y as Ee } from "./YTicksAndGridLines-7t4MKtGw.js";
|
|
14
|
+
import { H as Ge } from "./index-Bw_eHBVN.js";
|
|
15
15
|
import { Colors as D } from "./Colors.js";
|
|
16
16
|
import { u as ue } from "./uniqBy-BHy4I8PK.js";
|
|
17
17
|
import { s as Be } from "./sort-DfK1b0F5.js";
|
|
@@ -23,11 +23,11 @@ import { l as Qe, c as Ze } from "./line-CPfhohvF.js";
|
|
|
23
23
|
import { c as _e, s as et, a as tt, m as it } from "./step-BrDul-H4.js";
|
|
24
24
|
import { s as ot } from "./select-DKy99ogv.js";
|
|
25
25
|
import { p as at } from "./pointer-CWRWOsrb.js";
|
|
26
|
-
import { u as rt } from "./use-in-view-
|
|
27
|
-
import { m as E } from "./proxy-
|
|
26
|
+
import { u as rt } from "./use-in-view-DR-UTB96.js";
|
|
27
|
+
import { m as E } from "./proxy-BYIC9BuT.js";
|
|
28
28
|
import { GraphFooter as nt } from "./GraphFooter.js";
|
|
29
29
|
import { GraphHeader as st } from "./GraphHeader.js";
|
|
30
|
-
import { E as lt } from "./EmptyState-
|
|
30
|
+
import { E as lt } from "./EmptyState-36lXXyui.js";
|
|
31
31
|
import { ColorLegendWithMouseOver as ct } from "./ColorLegendWithMouseOver.js";
|
|
32
32
|
function mt(pe) {
|
|
33
33
|
const {
|
package/dist/MultiLineChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),f=require("react"),m=require("./parse-hMnG_lRV.cjs"),Ie=require("./index-CQ3e6Ewi.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),Se=require("./Tooltip-De16GWhY.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./customArea-CK768gCn.cjs"),De=require("./AxisTitle-CK9YeovX.cjs"),Te=require("./Axis-DE7dSn1_.cjs"),qe=require("./XTicksAndGridLines-CCzXIV8d.cjs"),$e=require("./ReferenceLine-CFVBBN__.cjs"),Me=require("./YTicksAndGridLines-DBDuz6vb.cjs"),Ve=require("./index-BYzIB5V6.cjs"),Fe=require("./time-Byw_jYQ7.cjs"),He=require("./linear-BVckp9RD.cjs"),Le=require("./line-DHV4JwCR.cjs"),xe=require("./step-BZ3C8QFW.cjs"),Ue=require("./select-Bnfk0lJx.cjs"),Ge=require("./init-DU0ybBc_.cjs"),Pe=require("./pointer-Dkq5NV1q.cjs"),We=require("./use-in-view-sQJZ_xDO.cjs"),T=require("./proxy-BHRoeZgd.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs"),ze=require("./Colors.cjs"),_e=require("./EmptyState-d8_8SxeW.cjs"),Je=require("./generateRandomString-B5zBiJzS.cjs");function Ke(ue){const{data:L,width:k,height:q,lineColors:E,dateFormat:l,noOfXTicks:de,labels:R,rightMargin:$,topMargin:x,bottomMargin:_,suffix:M,prefix:V,leftMargin:O,tooltip:G,onSeriesMouseOver:P,showValues:N,showColorLegendAtTop:me,refValues:J,highlightAreaSettings:he,minValue:F,maxValue:K,highlightedLines:C,animate:s,rtl:W,strokeWidth:pe,showDots:ge,annotations:fe,customHighlightAreaSettings:ye,yAxisTitle:Q,noOfYTicks:je,minDate:Y,maxDate:X,curveType:I,styles:c,classNames:y,dimmedOpacity:S,precision:H,customLayers:Z,dashedLines:B,dashSettings:ee,labelsToBeHidden:we,revealClipId:te}=ue,ie=f.useRef(null),u=We.useInView(ie,{once:s.once,amount:s.amount}),[b,ve]=f.useState(!1);f.useEffect(()=>{if(u&&!b){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[u,b,s.duration]);const Re=I==="linear"?Le.curveLinear:I==="step"?xe.curveStep:I==="stepAfter"?xe.stepAfter:I==="stepBefore"?xe.stepBefore:xe.monotoneX,[j,A]=f.useState(void 0),[ne,se]=f.useState(void 0),[re,ae]=f.useState(void 0),w={top:x,bottom:_,left:Q?O+30:O,right:$},z=f.useRef(null),r=Ie.orderBy(L.map(e=>({...e,date:m.parse(`${e.date}`,l,new Date)})),["date"],["asc"]),D=r[0].y.map((e,i)=>r.map(n=>({...n,y:n.y[i]})).filter(n=>!h.checkIfNullOrUndefined(n.y))),oe=he.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:m.parse(`${e.coordinates[0]}`,l,new Date),e.coordinates[1]===null?null:m.parse(`${e.coordinates[1]}`,l,new Date)]})),le=ye.map(e=>({...e,coordinates:e.coordinates.map((i,n)=>n%2===0?m.parse(`${i}`,l,new Date):i)})),p=k-w.left-w.right,g=q-w.top-w.bottom,ce=Y?m.parse(`${Y}`,l,new Date):r[0].date,d=X?m.parse(`${X}`,l,new Date):r[r.length-1].date,v=h.checkIfNullOrUndefined(F)?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))>0?0:Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i))))):0:F,Ee=Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))?Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!h.checkIfNullOrUndefined(i))))):0,a=Fe.time().domain([ce,d]).range([0,p]),o=He.linear().domain([h.checkIfNullOrUndefined(F)?v:F,h.checkIfNullOrUndefined(K)?Ee>0?Ee:0:K]).range([g,0]).nice(),Ce=Le.line().x(e=>a(e.date)).y(e=>o(e.y)).curve(Re),Ae=o.ticks(je),ke=a.ticks(de);return f.useEffect(()=>{const e=n=>{const U=r[Ge.bisectCenter(r.map(Oe=>Oe.date),a.invert(Pe.pointer(n)[0]),0)];A(U||r[r.length-1]),ae(n.clientY),se(n.clientX),P?.(U||r[r.length-1])},i=()=>{A(void 0),se(void 0),ae(void 0)};Ue.select(z.current).on("mousemove",e).on("mouseout",i),P?.(void 0)},[a,r,P]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${k}px`,height:`${q}px`,viewBox:`0 0 ${k} ${q}`,direction:"ltr",ref:ie,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${w.left},${w.top})`,children:[t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",{id:te,children:t.jsxRuntimeExports.jsx(T.motion.rect,{x:0,y:0,height:g,variants:{initial:{width:0},whileInView:{width:p,transition:{duration:s.duration}}},initial:"initial",animate:u?"whileInView":"initial"})})}),t.jsxRuntimeExports.jsx(Ve.HighlightArea,{areaSettings:oe,width:p,height:g,scale:a,animate:s,isInView:u}),t.jsxRuntimeExports.jsx(be.CustomArea,{areaSettings:le,scaleX:a,scaleY:o,animate:s,isInView:u}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Me.YTicksAndGridLines,{values:Ae.filter(e=>e!==0),y:Ae.filter(e=>e!==0).map(e=>o(e)),x1:0-O,x2:p+w.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:M,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:H}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:o(v<0?0:v),y2:o(v<0?0:v),x1:0-O,x2:p+w.right,label:Ne.numberFormattingFunction(v<0?0:v,"NA",H,V,M),labelPos:{x:0-O,y:o(v<0?0:v),dx:0,dy:Ee<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(De.AxisTitle,{x:0-O-15,y:g/2,style:c?.yAxis?.title,className:y?.yAxis?.title,text:Q,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(qe.XTicksAndGridLines,{values:ke.map(e=>m.format(e,l)),x:ke.map(e=>a(e)),y1:0,y2:g,styles:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:M,prefix:V,labelType:"primary",showGridLines:!0,precision:H})}),Z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[D.map((e,i)=>t.jsxRuntimeExports.jsxs(T.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:C.length!==0?C.indexOf(R[i])!==-1?1:S:1},whileInView:{opacity:C.length!==0?C.indexOf(R[i])!==-1?1:S:1,transition:{duration:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(T.motion.path,{style:{fill:"none",strokeWidth:pe},clipPath:`url(#${te})`,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{...B.length===0?{pathLength:0}:{},d:Ce(e.filter(n=>!h.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:E[i]},whileInView:{...B.length===0?{pathLength:1}:{},d:Ce(e.filter(n=>!h.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:E[i],transition:{duration:s.duration}}},strokeDasharray:B.includes(R[i])?ee[i%ee.length]:void 0,initial:"initial",animate:u?"whileInView":"initial"}),e.map((n,U)=>t.jsxRuntimeExports.jsx("g",{children:h.checkIfNullOrUndefined(n.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ge?t.jsxRuntimeExports.jsx(T.motion.circle,{r:p/r.length<5?0:p/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],cx:a(n.date),cy:o(n.y)},whileInView:{opacity:1,fill:E[i],transition:{duration:b?s.duration:.5,delay:b?0:s.duration},cx:a(n.date),cy:o(n.y)}},initial:"initial",animate:u?"whileInView":"initial"}):null,N?t.jsxRuntimeExports.jsx(T.motion.text,{dy:-8,style:{textAnchor:"middle",...c?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",y?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],x:a(n.date),y:o(n.y)},whileInView:{opacity:1,fill:E[i],x:a(n.date),y:o(n.y),transition:{duration:b?s.duration:.5,delay:b?0:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:Ne.numberFormattingFunction(n.y,"NA",H,V,M)}):null]})},U)),me||we.includes(R[i])?null:t.jsxRuntimeExports.jsx(T.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],x:a(e[e.length-1].date),y:o(e[e.length-1].y)},whileInView:{opacity:1,fill:E[i],x:a(e[e.length-1].date),y:o(e[e.length-1].y),transition:{duration:b?s.duration:.5,delay:b?0:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:R[i]})]},R[i])),j?t.jsxRuntimeExports.jsx("line",{y1:0,y2:g,x1:a(j.date),x2:a(j.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",y?.mouseOverLine),style:c?.mouseOverLine}):null]}),J?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:J.map((e,i)=>t.jsxRuntimeExports.jsx($e.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-O,x2:p+w.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:u},i))}):null,t.jsxRuntimeExports.jsx("g",{children:fe.map((e,i)=>{const n=be.getLineEndPoint({x:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),U=e.showConnector?{y1:n.y,x1:n.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Oe={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0):p+w.right-(e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(be.Annotation,{color:e.color,connectorsSettings:U,labelSettings:Oe,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:u},i)})}),Z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:z,style:{fill:"none",pointerEvents:"all"},width:p,height:g})]})}),j&&G&&ne&&re?t.jsxRuntimeExports.jsx(Se.Tooltip,{data:j,body:G,xPos:ne,yPos:re,backgroundStyle:c?.tooltip,className:y?.tooltip}):null]})}function Qe(ue){const{data:L,graphTitle:k,lineColors:q=ze.Colors.light.categoricalColors.colors,suffix:E="",sources:l,prefix:de="",graphDescription:R,height:$,width:x,footNote:_,noOfXTicks:M=10,dateFormat:V="yyyy",labels:O,padding:G,showValues:P=!1,backgroundColor:N=!1,leftMargin:me=30,rightMargin:J=50,topMargin:he=20,bottomMargin:F=25,tooltip:K,relativeHeight:C,onSeriesMouseOver:s,showColorLegendAtTop:W=!1,refValues:pe=[],highlightAreaSettings:ge=[],graphID:fe,minValue:ye,maxValue:Q,highlightedLines:je=[],graphDownload:Y=!1,dataDownload:X=!1,animate:I=!1,language:c="en",colorLegendTitle:y,minHeight:S=0,strokeWidth:H=2,showDots:Z=!0,annotations:B=[],customHighlightAreaSettings:ee=[],theme:we="light",ariaLabel:te,yAxisTitle:ie,noOfYTicks:u=5,minDate:b,maxDate:ve,curveType:Re="curve",styles:j,classNames:A,dimmedOpacity:ne=.3,precision:se=2,customLayers:re=[],dashedLines:ae=[],dashSettings:w=["5 5"],labelsToBeHidden:z=[],showColorScale:r=!0}=ue,[D,oe]=f.useState(0),[le,p]=f.useState(0),g=f.useRef(null),ce=f.useRef(null);return f.useEffect(()=>{const d=new ResizeObserver(v=>{oe(x||v[0].target.clientWidth||620),p($||v[0].target.clientHeight||480)});return g.current&&(p(g.current.clientHeight||480),oe(g.current.clientWidth||620),x||d.observe(g.current)),()=>d.disconnect()},[x,$]),t.jsxRuntimeExports.jsx("div",{className:`${we||"light"} flex ${x?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${N?N===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,x?"w-fit":"w-full",A?.graphContainer),style:{...j?.graphContainer||{},...N&&N!==!0?{backgroundColor:N}:{}},id:fe,ref:ce,"aria-label":te||`${k?`The graph shows ${k}. `:""}This is a multi-line chart that shows trends over time.${R?` ${R}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:N?G||"1rem":G||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||R||Y||X?t.jsxRuntimeExports.jsx(Xe.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:A?.title,description:A?.description},graphTitle:k,graphDescription:R,width:x,graphDownload:Y?ce.current:void 0,dataDownload:X?L.map(d=>d.data).filter(d=>d!==void 0).length>0?L.map(d=>d.data).filter(d=>d!==void 0):L.filter(d=>d!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:L.length===0?t.jsxRuntimeExports.jsx(_e.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[W&&r?t.jsxRuntimeExports.jsx(Be.ColorLegend,{colorDomain:O,colorLegendTitle:y,labelsToBeHidden:z,colors:q,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:g,"aria-label":"Graph area",children:(x||D)&&($||le)?t.jsxRuntimeExports.jsx(Ke,{data:L,lineColors:q,width:x||D,height:Math.max(S,$||(C?S?(x||D)*C>S?(x||D)*C:S:(x||D)*C:le)),dateFormat:V,noOfXTicks:M,leftMargin:me,rightMargin:J,topMargin:he,bottomMargin:F,labels:O,tooltip:K,onSeriesMouseOver:s,showColorLegendAtTop:r?W:!0,showValues:P,suffix:E,prefix:de,highlightAreaSettings:ge,refValues:pe,minValue:ye,maxValue:Q,highlightedLines:je,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:H,showDots:Z,annotations:B,customHighlightAreaSettings:ee,yAxisTitle:ie,noOfYTicks:u,minDate:b,maxDate:ve,curveType:Re,styles:j,classNames:A,dimmedOpacity:ne,precision:se,customLayers:re,labelsToBeHidden:z,dashedLines:ae,dashSettings:w,revealClipId:Je.generateRandomString(8)}):null})]})}),l||_?t.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:A?.footnote,source:A?.source},sources:l,footNote:_,width:x}):null]})})})})}exports.MultiLineChart=Qe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DjM48pIC.cjs"),f=require("react"),m=require("./parse-hMnG_lRV.cjs"),Ie=require("./index-CQ3e6Ewi.cjs"),Ne=require("./numberFormattingFunction-02t-wJta.cjs"),Se=require("./Tooltip-Cpv0QohJ.cjs"),h=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),be=require("./customArea-1G1S78s_.cjs"),De=require("./AxisTitle-Wkz-xeQL.cjs"),Te=require("./Axis-CkNn1wit.cjs"),qe=require("./XTicksAndGridLines-RKy7BVCO.cjs"),$e=require("./ReferenceLine-D04j-zeV.cjs"),Me=require("./YTicksAndGridLines-qGpRo_t1.cjs"),Ve=require("./index-BHe3wsWF.cjs"),Fe=require("./time-Byw_jYQ7.cjs"),He=require("./linear-BVckp9RD.cjs"),Le=require("./line-DHV4JwCR.cjs"),xe=require("./step-BZ3C8QFW.cjs"),Ue=require("./select-Bnfk0lJx.cjs"),Ge=require("./init-DU0ybBc_.cjs"),Pe=require("./pointer-Dkq5NV1q.cjs"),We=require("./use-in-view-CEwlc_dd.cjs"),T=require("./proxy-CKadx4lC.cjs"),Ye=require("./GraphFooter.cjs"),Xe=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs"),ze=require("./Colors.cjs"),_e=require("./EmptyState-B8IpKGcL.cjs"),Je=require("./generateRandomString-B5zBiJzS.cjs");function Ke(ue){const{data:L,width:k,height:q,lineColors:E,dateFormat:l,noOfXTicks:de,labels:R,rightMargin:$,topMargin:x,bottomMargin:_,suffix:M,prefix:V,leftMargin:O,tooltip:G,onSeriesMouseOver:P,showValues:N,showColorLegendAtTop:me,refValues:J,highlightAreaSettings:he,minValue:F,maxValue:K,highlightedLines:C,animate:s,rtl:W,strokeWidth:pe,showDots:ge,annotations:fe,customHighlightAreaSettings:ye,yAxisTitle:Q,noOfYTicks:je,minDate:Y,maxDate:X,curveType:I,styles:c,classNames:y,dimmedOpacity:S,precision:H,customLayers:Z,dashedLines:B,dashSettings:ee,labelsToBeHidden:we,revealClipId:te}=ue,ie=f.useRef(null),u=We.useInView(ie,{once:s.once,amount:s.amount}),[b,ve]=f.useState(!1);f.useEffect(()=>{if(u&&!b){const e=setTimeout(()=>{ve(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[u,b,s.duration]);const Re=I==="linear"?Le.curveLinear:I==="step"?xe.curveStep:I==="stepAfter"?xe.stepAfter:I==="stepBefore"?xe.stepBefore:xe.monotoneX,[j,A]=f.useState(void 0),[ne,se]=f.useState(void 0),[re,ae]=f.useState(void 0),w={top:x,bottom:_,left:Q?O+30:O,right:$},z=f.useRef(null),r=Ie.orderBy(L.map(e=>({...e,date:m.parse(`${e.date}`,l,new Date)})),["date"],["asc"]),D=r[0].y.map((e,i)=>r.map(n=>({...n,y:n.y[i]})).filter(n=>!h.checkIfNullOrUndefined(n.y))),oe=he.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:m.parse(`${e.coordinates[0]}`,l,new Date),e.coordinates[1]===null?null:m.parse(`${e.coordinates[1]}`,l,new Date)]})),le=ye.map(e=>({...e,coordinates:e.coordinates.map((i,n)=>n%2===0?m.parse(`${i}`,l,new Date):i)})),p=k-w.left-w.right,g=q-w.top-w.bottom,ce=Y?m.parse(`${Y}`,l,new Date):r[0].date,d=X?m.parse(`${X}`,l,new Date):r[r.length-1].date,v=h.checkIfNullOrUndefined(F)?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))?Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))>0?0:Math.min(...r.map(e=>Math.min(...e.y.filter(i=>!h.checkIfNullOrUndefined(i))))):0:F,Ee=Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!h.checkIfNullOrUndefined(i)))))?Math.max(...r.map(e=>Math.max(...e.y.filter(i=>!h.checkIfNullOrUndefined(i))))):0,a=Fe.time().domain([ce,d]).range([0,p]),o=He.linear().domain([h.checkIfNullOrUndefined(F)?v:F,h.checkIfNullOrUndefined(K)?Ee>0?Ee:0:K]).range([g,0]).nice(),Ce=Le.line().x(e=>a(e.date)).y(e=>o(e.y)).curve(Re),Ae=o.ticks(je),ke=a.ticks(de);return f.useEffect(()=>{const e=n=>{const U=r[Ge.bisectCenter(r.map(Oe=>Oe.date),a.invert(Pe.pointer(n)[0]),0)];A(U||r[r.length-1]),ae(n.clientY),se(n.clientX),P?.(U||r[r.length-1])},i=()=>{A(void 0),se(void 0),ae(void 0)};Ue.select(z.current).on("mousemove",e).on("mouseout",i),P?.(void 0)},[a,r,P]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(T.motion.svg,{width:`${k}px`,height:`${q}px`,viewBox:`0 0 ${k} ${q}`,direction:"ltr",ref:ie,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${w.left},${w.top})`,children:[t.jsxRuntimeExports.jsx("defs",{children:t.jsxRuntimeExports.jsx("clipPath",{id:te,children:t.jsxRuntimeExports.jsx(T.motion.rect,{x:0,y:0,height:g,variants:{initial:{width:0},whileInView:{width:p,transition:{duration:s.duration}}},initial:"initial",animate:u?"whileInView":"initial"})})}),t.jsxRuntimeExports.jsx(Ve.HighlightArea,{areaSettings:oe,width:p,height:g,scale:a,animate:s,isInView:u}),t.jsxRuntimeExports.jsx(be.CustomArea,{areaSettings:le,scaleX:a,scaleY:o,animate:s,isInView:u}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(Me.YTicksAndGridLines,{values:Ae.filter(e=>e!==0),y:Ae.filter(e=>e!==0).map(e=>o(e)),x1:0-O,x2:p+w.right,styles:{gridLines:c?.yAxis?.gridLines,labels:c?.yAxis?.labels},classNames:{gridLines:y?.yAxis?.gridLines,labels:y?.yAxis?.labels},suffix:M,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:H}),t.jsxRuntimeExports.jsx(Te.Axis,{y1:o(v<0?0:v),y2:o(v<0?0:v),x1:0-O,x2:p+w.right,label:Ne.numberFormattingFunction(v<0?0:v,"NA",H,V,M),labelPos:{x:0-O,y:o(v<0?0:v),dx:0,dy:Ee<0?"1em":-5},classNames:{axis:y?.xAxis?.axis,label:y?.yAxis?.labels},styles:{axis:c?.xAxis?.axis,label:c?.yAxis?.labels}}),t.jsxRuntimeExports.jsx(De.AxisTitle,{x:0-O-15,y:g/2,style:c?.yAxis?.title,className:y?.yAxis?.title,text:Q,rotate90:!0})]}),t.jsxRuntimeExports.jsx("g",{children:t.jsxRuntimeExports.jsx(qe.XTicksAndGridLines,{values:ke.map(e=>m.format(e,l)),x:ke.map(e=>a(e)),y1:0,y2:g,styles:{gridLines:c?.xAxis?.gridLines,labels:c?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",y?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",y?.xAxis?.labels)},suffix:M,prefix:V,labelType:"primary",showGridLines:!0,precision:H})}),Z.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[D.map((e,i)=>t.jsxRuntimeExports.jsxs(T.motion.g,{exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:C.length!==0?C.indexOf(R[i])!==-1?1:S:1},whileInView:{opacity:C.length!==0?C.indexOf(R[i])!==-1?1:S:1,transition:{duration:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:[t.jsxRuntimeExports.jsx(T.motion.path,{style:{fill:"none",strokeWidth:pe},clipPath:`url(#${te})`,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{...B.length===0?{pathLength:0}:{},d:Ce(e.filter(n=>!h.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:E[i]},whileInView:{...B.length===0?{pathLength:1}:{},d:Ce(e.filter(n=>!h.checkIfNullOrUndefined(n.y)))||"",opacity:1,stroke:E[i],transition:{duration:s.duration}}},strokeDasharray:B.includes(R[i])?ee[i%ee.length]:void 0,initial:"initial",animate:u?"whileInView":"initial"}),e.map((n,U)=>t.jsxRuntimeExports.jsx("g",{children:h.checkIfNullOrUndefined(n.y)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ge?t.jsxRuntimeExports.jsx(T.motion.circle,{r:p/r.length<5?0:p/r.length<20?2:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],cx:a(n.date),cy:o(n.y)},whileInView:{opacity:1,fill:E[i],transition:{duration:b?s.duration:.5,delay:b?0:s.duration},cx:a(n.date),cy:o(n.y)}},initial:"initial",animate:u?"whileInView":"initial"}):null,N?t.jsxRuntimeExports.jsx(T.motion.text,{dy:-8,style:{textAnchor:"middle",...c?.graphObjectValues||{}},className:t.mo("graph-value text-xs font-bold",y?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],x:a(n.date),y:o(n.y)},whileInView:{opacity:1,fill:E[i],x:a(n.date),y:o(n.y),transition:{duration:b?s.duration:.5,delay:b?0:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:Ne.numberFormattingFunction(n.y,"NA",H,V,M)}):null]})},U)),me||we.includes(R[i])?null:t.jsxRuntimeExports.jsx(T.motion.text,{className:"text-xs",dx:5,dy:4,exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,fill:E[i],x:a(e[e.length-1].date),y:o(e[e.length-1].y)},whileInView:{opacity:1,fill:E[i],x:a(e[e.length-1].date),y:o(e[e.length-1].y),transition:{duration:b?s.duration:.5,delay:b?0:s.duration}}},initial:"initial",animate:u?"whileInView":"initial",children:R[i]})]},R[i])),j?t.jsxRuntimeExports.jsx("line",{y1:0,y2:g,x1:a(j.date),x2:a(j.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",y?.mouseOverLine),style:c?.mouseOverLine}):null]}),J?t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:J.map((e,i)=>t.jsxRuntimeExports.jsx($e.RefLineY,{text:e.text,color:e.color,y:o(e.value),x1:0-O,x2:p+w.right,classNames:e.classNames,styles:e.styles,animate:s,isInView:u},i))}):null,t.jsxRuntimeExports.jsx("g",{children:fe.map((e,i)=>{const n=be.getLineEndPoint({x:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8},{x:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date)):0,y:e.yCoordinate?o(e.yCoordinate):0},h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius),U=e.showConnector?{y1:n.y,x1:n.x,y2:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0):0+(e.yOffset||0),x2:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),cy:e.yCoordinate?o(e.yCoordinate):0,cx:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date)):0,circleRadius:h.checkIfNullOrUndefined(e.connectorRadius)?3.5:e.connectorRadius,strokeWidth:e.showConnector===!0?2:Math.min(e.showConnector||0,1)}:void 0,Oe={y:e.yCoordinate?o(e.yCoordinate)+(e.yOffset||0)-8:0+(e.yOffset||0)-8,x:W?0:e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0),width:W?e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0):p+w.right-(e.xCoordinate?a(m.parse(`${e.xCoordinate}`,l,new Date))+(e.xOffset||0):0+(e.xOffset||0)),maxWidth:e.maxWidth,fontWeight:e.fontWeight,align:e.align};return t.jsxRuntimeExports.jsx(be.Annotation,{color:e.color,connectorsSettings:U,labelSettings:Oe,text:e.text,classNames:e.classNames,styles:e.styles,animate:s,isInView:u},i)})}),Z.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:z,style:{fill:"none",pointerEvents:"all"},width:p,height:g})]})}),j&&G&&ne&&re?t.jsxRuntimeExports.jsx(Se.Tooltip,{data:j,body:G,xPos:ne,yPos:re,backgroundStyle:c?.tooltip,className:y?.tooltip}):null]})}function Qe(ue){const{data:L,graphTitle:k,lineColors:q=ze.Colors.light.categoricalColors.colors,suffix:E="",sources:l,prefix:de="",graphDescription:R,height:$,width:x,footNote:_,noOfXTicks:M=10,dateFormat:V="yyyy",labels:O,padding:G,showValues:P=!1,backgroundColor:N=!1,leftMargin:me=30,rightMargin:J=50,topMargin:he=20,bottomMargin:F=25,tooltip:K,relativeHeight:C,onSeriesMouseOver:s,showColorLegendAtTop:W=!1,refValues:pe=[],highlightAreaSettings:ge=[],graphID:fe,minValue:ye,maxValue:Q,highlightedLines:je=[],graphDownload:Y=!1,dataDownload:X=!1,animate:I=!1,language:c="en",colorLegendTitle:y,minHeight:S=0,strokeWidth:H=2,showDots:Z=!0,annotations:B=[],customHighlightAreaSettings:ee=[],theme:we="light",ariaLabel:te,yAxisTitle:ie,noOfYTicks:u=5,minDate:b,maxDate:ve,curveType:Re="curve",styles:j,classNames:A,dimmedOpacity:ne=.3,precision:se=2,customLayers:re=[],dashedLines:ae=[],dashSettings:w=["5 5"],labelsToBeHidden:z=[],showColorScale:r=!0}=ue,[D,oe]=f.useState(0),[le,p]=f.useState(0),g=f.useRef(null),ce=f.useRef(null);return f.useEffect(()=>{const d=new ResizeObserver(v=>{oe(x||v[0].target.clientWidth||620),p($||v[0].target.clientHeight||480)});return g.current&&(p(g.current.clientHeight||480),oe(g.current.clientWidth||620),x||d.observe(g.current)),()=>d.disconnect()},[x,$]),t.jsxRuntimeExports.jsx("div",{className:`${we||"light"} flex ${x?"w-fit grow-0":"w-full grow"}`,dir:c==="he"||c==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${N?N===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${c||"en"}`,x?"w-fit":"w-full",A?.graphContainer),style:{...j?.graphContainer||{},...N&&N!==!0?{backgroundColor:N}:{}},id:fe,ref:ce,"aria-label":te||`${k?`The graph shows ${k}. `:""}This is a multi-line chart that shows trends over time.${R?` ${R}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:N?G||"1rem":G||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[k||R||Y||X?t.jsxRuntimeExports.jsx(Xe.GraphHeader,{styles:{title:j?.title,description:j?.description},classNames:{title:A?.title,description:A?.description},graphTitle:k,graphDescription:R,width:x,graphDownload:Y?ce.current:void 0,dataDownload:X?L.map(d=>d.data).filter(d=>d!==void 0).length>0?L.map(d=>d.data).filter(d=>d!==void 0):L.filter(d=>d!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:L.length===0?t.jsxRuntimeExports.jsx(_e.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[W&&r?t.jsxRuntimeExports.jsx(Be.ColorLegend,{colorDomain:O,colorLegendTitle:y,labelsToBeHidden:z,colors:q,showNAColor:!1}):null,t.jsxRuntimeExports.jsx("div",{className:"w-full grow leading-0",ref:g,"aria-label":"Graph area",children:(x||D)&&($||le)?t.jsxRuntimeExports.jsx(Ke,{data:L,lineColors:q,width:x||D,height:Math.max(S,$||(C?S?(x||D)*C>S?(x||D)*C:S:(x||D)*C:le)),dateFormat:V,noOfXTicks:M,leftMargin:me,rightMargin:J,topMargin:he,bottomMargin:F,labels:O,tooltip:K,onSeriesMouseOver:s,showColorLegendAtTop:r?W:!0,showValues:P,suffix:E,prefix:de,highlightAreaSettings:ge,refValues:pe,minValue:ye,maxValue:Q,highlightedLines:je,animate:I===!0?{duration:.5,once:!0,amount:.5}:I||{duration:0,once:!0,amount:0},rtl:c==="he"||c==="ar",strokeWidth:H,showDots:Z,annotations:B,customHighlightAreaSettings:ee,yAxisTitle:ie,noOfYTicks:u,minDate:b,maxDate:ve,curveType:Re,styles:j,classNames:A,dimmedOpacity:ne,precision:se,customLayers:re,labelsToBeHidden:z,dashedLines:ae,dashSettings:w,revealClipId:Je.generateRandomString(8)}):null})]})}),l||_?t.jsxRuntimeExports.jsx(Ye.GraphFooter,{styles:{footnote:j?.footnote,source:j?.source},classNames:{footnote:A?.footnote,source:A?.source},sources:l,footNote:_,width:x}):null]})})})})}exports.MultiLineChart=Qe;
|
|
2
2
|
//# sourceMappingURL=MultiLineChart.cjs.map
|
package/dist/MultiLineChart.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { j as e, m as q } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as e, m as q } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useRef as ht, useState as Y, useEffect as Dt } from "react";
|
|
3
3
|
import { p as u, f as kt } from "./parse-DlCRUFh_.js";
|
|
4
4
|
import { o as Mt } from "./index-DvVprvy6.js";
|
|
5
5
|
import { n as Nt } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
-
import { T as St } from "./Tooltip-
|
|
6
|
+
import { T as St } from "./Tooltip-6LIdPQGC.js";
|
|
7
7
|
import { c as x } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
8
|
-
import { C as Vt, g as It, A as Ht } from "./customArea-
|
|
9
|
-
import { A as Rt } from "./AxisTitle-
|
|
10
|
-
import { A as Ft } from "./Axis-
|
|
11
|
-
import { X as Wt } from "./XTicksAndGridLines-
|
|
12
|
-
import { R as Pt } from "./ReferenceLine-
|
|
13
|
-
import { Y as Yt } from "./YTicksAndGridLines-
|
|
14
|
-
import { H as Xt } from "./index-
|
|
8
|
+
import { C as Vt, g as It, A as Ht } from "./customArea-x4L4xwLl.js";
|
|
9
|
+
import { A as Rt } from "./AxisTitle-v6_xcXZ-.js";
|
|
10
|
+
import { A as Ft } from "./Axis-4gUOL8B7.js";
|
|
11
|
+
import { X as Wt } from "./XTicksAndGridLines-DuydSnZ_.js";
|
|
12
|
+
import { R as Pt } from "./ReferenceLine-CPMaAX0r.js";
|
|
13
|
+
import { Y as Yt } from "./YTicksAndGridLines-7t4MKtGw.js";
|
|
14
|
+
import { H as Xt } from "./index-Bw_eHBVN.js";
|
|
15
15
|
import { t as Et } from "./time-BzJP5SPC.js";
|
|
16
16
|
import { a as Gt } from "./linear-DUdu7l2G.js";
|
|
17
17
|
import { l as Bt, c as zt } from "./line-CPfhohvF.js";
|
|
@@ -19,13 +19,13 @@ import { c as Ut, s as _t, a as qt, m as Jt } from "./step-BrDul-H4.js";
|
|
|
19
19
|
import { s as Kt } from "./select-DKy99ogv.js";
|
|
20
20
|
import { a as Qt } from "./init-BhZylTFx.js";
|
|
21
21
|
import { p as Zt } from "./pointer-CWRWOsrb.js";
|
|
22
|
-
import { u as te } from "./use-in-view-
|
|
23
|
-
import { m as S } from "./proxy-
|
|
22
|
+
import { u as te } from "./use-in-view-DR-UTB96.js";
|
|
23
|
+
import { m as S } from "./proxy-BYIC9BuT.js";
|
|
24
24
|
import { GraphFooter as ee } from "./GraphFooter.js";
|
|
25
25
|
import { GraphHeader as ie } from "./GraphHeader.js";
|
|
26
26
|
import { ColorLegend as ae } from "./ColorLegend.js";
|
|
27
27
|
import { Colors as oe } from "./Colors.js";
|
|
28
|
-
import { E as ne } from "./EmptyState-
|
|
28
|
+
import { E as ne } from "./EmptyState-36lXXyui.js";
|
|
29
29
|
import { g as se } from "./generateRandomString-za3IQGfQ.js";
|
|
30
30
|
function re(dt) {
|
|
31
31
|
const {
|
package/dist/ParetoChart.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DDoeWRVt.cjs"),j=require("react"),gt=require("./index-DQA8q5sC.cjs"),wt=require("./Modal-tXZlLE5s.cjs"),ot=require("./numberFormattingFunction-02t-wJta.cjs"),Et=require("./Tooltip-De16GWhY.cjs"),Rt=require("./string2HTML-z7CwHXcx.cjs"),pt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./Axis-DE7dSn1_.cjs"),ft=require("./AxisTitle-CK9YeovX.cjs"),At=require("./XAxesLabels-Drf7M3YK.cjs"),Mt=require("./band-CAApY4Pd.cjs"),yt=require("./linear-BVckp9RD.cjs"),jt=require("./line-DHV4JwCR.cjs"),lt=require("./step-BZ3C8QFW.cjs"),Ct=require("./use-in-view-sQJZ_xDO.cjs"),P=require("./proxy-BHRoeZgd.cjs"),kt=require("./index-BW8iNx7E.cjs"),Nt=require("./GraphFooter.cjs"),$t=require("./GraphHeader.cjs"),St=require("./ColorLegend.cjs"),xt=require("./Colors.cjs"),qt=require("./EmptyState-d8_8SxeW.cjs");function It(ct){const{data:q,width:M,height:V,barColor:u,lineColor:o,axisTitles:s,sameAxes:b,rightMargin:U,leftMargin:z,topMargin:_,bottomMargin:ut,tooltip:v,showValues:J,onSeriesMouseOver:D,barPadding:mt,truncateBy:K,showLabels:Q,onSeriesMouseClick:w,resetSelectionOnDoubleClick:Z,detailsOnClick:h,noOfTicks:tt,lineSuffix:et,barSuffix:Y,linePrefix:X,barPrefix:it,curveType:F,styles:l,classNames:x,animate:r,precision:H,customLayers:I,naLabel:C,showAxisLabels:st}=ct,nt=j.useRef(null),k=Ct.useInView(nt,{once:r.once,amount:r.amount}),ht=F==="linear"?jt.curveLinear:F==="step"?lt.curveStep:F==="stepAfter"?lt.stepAfter:F==="stepBefore"?lt.stepBefore:lt.monotoneX,[at,N]=j.useState(void 0),[$,L]=j.useState(void 0),[rt,S]=j.useState(void 0),[E,m]=j.useState(void 0),p={top:_,bottom:ut,left:z+50,right:U+65},d=M-p.left-p.right,g=V-p.top-p.bottom,n=q.map((t,A)=>({...t,id:`${A}`})),c=Mt.band().domain(n.map(t=>`${t.id}`)).range([0,d]).paddingInner(mt),W=Math.min(...n.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.min(...n.map(t=>t.bar).filter(t=>t!=null))>0?0:Math.min(...n.map(t=>t.bar).filter(t=>t!=null)):0,R=Math.min(...n.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.min(...n.map(t=>t.line).filter(t=>t!=null))>0?0:Math.min(...n.map(t=>t.line).filter(t=>t!=null)):0,T=Math.max(...n.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.max(...n.map(t=>t.bar).filter(t=>t!=null)):0,O=Math.max(...n.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.max(...n.map(t=>t.line).filter(t=>t!=null)):0,G=W<R?W:R,y=T>O?T:O,a=yt.linear().domain([b?G:W,b?y>0?y:0:T>0?T:0]).range([g,0]).nice(),i=yt.linear().domain([b?G:R,b?y>0?y:0:O>0?O:0]).range([g,0]).nice(),B=jt.line().defined(t=>!pt.checkIfNullOrUndefined(t.line)).x(t=>c(`${t.id}`)+c.bandwidth()/2).y(t=>i(t.line)).curve(ht),bt=a.ticks(tt),vt=i.ticks(tt);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P.motion.svg,{width:`${M}px`,height:`${V}px`,viewBox:`0 0 ${M} ${V}`,direction:"ltr",ref:nt,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${p.left},${p.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[bt.map((t,A)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:a(t),y2:a(t),x1:-15,x2:-20,style:{stroke:u,strokeWidth:1,...l?.yAxis?.gridLines||{}},className:x?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:-25,y:a(t),dy:"0.33em",className:e.mo("text-xs",x?.yAxis?.labels),style:{textAnchor:"end",fill:u,...l?.yAxis?.labels||{}},children:ot.numberFormattingFunction(t,C,H,it,Y)})]},A)),e.jsxRuntimeExports.jsx(dt.Axis,{y1:0,y2:g,x1:-15,x2:-15,classNames:{axis:x?.xAxis?.axis},styles:{axis:{stroke:u,...l?.xAxis?.axis||{}}}}),st?e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:10-p.left,y:g/2,style:{fill:u,...l?.yAxis?.title||{}},className:x?.yAxis?.title,text:s[0].length>100?`${s[0].substring(0,100)}...`:s[0],rotate90:!0}):null]}),e.jsxRuntimeExports.jsxs("g",{children:[vt.map((t,A)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:i(t),y2:i(t),x1:d+15,x2:d+20,style:{stroke:o,strokeWidth:1,...l?.yAxis?.gridLines||{}},className:x?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:d+25,y:i(t),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o,...l?.yAxis?.labels||{}},className:e.mo("text-xs",x?.yAxis?.labels),children:ot.numberFormattingFunction(t,C,H,X,et)})]},A)),e.jsxRuntimeExports.jsx(dt.Axis,{y1:0,y2:g,x1:d+15,x2:d+15,classNames:{axis:x?.xAxis?.axis},styles:{axis:{stroke:o,...l?.xAxis?.axis||{}}}}),st?e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:d+p.right-15,y:g/2,style:{fill:o,...l?.yAxis?.title||{}},className:x?.yAxis?.title,text:s[1].length>100?`${s[1].substring(0,100)}...`:s[1],rotate90:!0}):null]}),e.jsxRuntimeExports.jsx(dt.Axis,{y1:b?a(0):g,y2:b?a(0):g,x1:-15,x2:d+15,classNames:{axis:x?.xAxis?.axis},styles:{axis:l?.xAxis?.axis}}),I.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(kt.AnimatePresence,{children:[n.map((t,A)=>e.jsxRuntimeExports.jsxs(P.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{N(t),m(f.clientY),S(f.clientX),D?.(t)},onClick:()=>{(w||h)&&(gt.isEqual($,t)&&Z?(L(void 0),w?.(void 0)):(L(t),w?.(t)))},onMouseMove:f=>{N(t),m(f.clientY),S(f.clientX)},onMouseLeave:()=>{N(void 0),S(void 0),m(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.rect,{variants:{initial:{attrY:a(0),height:0,opacity:1,fill:u},whileInView:{attrY:t.bar?t.bar>0?a(t.bar):a(0):0,height:t.bar?Math.abs(a(t.bar)-a(0)):0,opacity:1,fill:u,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",exit:{attrY:a(0),height:0,opacity:0,transition:{duration:r.duration}},x:c(`${A}`),width:c.bandwidth()}),J&&!pt.checkIfNullOrUndefined(t.bar)?e.jsxRuntimeExports.jsx(P.motion.text,{x:c(`${t.id}`)+c.bandwidth()/2,exit:{attrY:a(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{attrY:a(0),opacity:0,fill:u},whileInView:{attrY:a(t.bar||0),opacity:1,fill:u,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",style:{textAnchor:"middle",...l?.graphObjectValues||{}},className:e.mo("graph-value text-sm",x?.graphObjectValues),dy:t.bar?t.bar>=0?"-5px":"1em":"-5px",children:ot.numberFormattingFunction(t.bar,C,H,it,Y)}):null,Q?e.jsxRuntimeExports.jsx(At.XAxesLabels,{value:`${t.label}`.length<K?`${t.label}`:`${`${t.label}`.substring(0,K)}...`,y:g+5,x:c(`${t.id}`),width:c.bandwidth(),height:p.bottom,style:l?.xAxis?.labels,className:x?.xAxis?.labels,alignment:"top",animate:r,isInView:k}):null]},t.label)),e.jsxRuntimeExports.jsx(P.motion.path,{exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{d:B(n.map(t=>({...t,line:0}))),opacity:0,stroke:o},whileInView:{d:B(n),opacity:1,stroke:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",style:{fill:"none",strokeWidth:2}}),n.map((t,A)=>e.jsxRuntimeExports.jsx("g",{children:pt.checkIfNullOrUndefined(t.line)?null:e.jsxRuntimeExports.jsxs("g",{onMouseEnter:f=>{N(t),m(f.clientY),S(f.clientX),D?.(t)},onClick:()=>{(w||h)&&(gt.isEqual($,t)&&Z?(L(void 0),w?.(void 0)):(L(t),w?.(t)))},onMouseMove:f=>{N(t),m(f.clientY),S(f.clientX)},onMouseLeave:()=>{N(void 0),S(void 0),m(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.circle,{exit:{cy:i(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{cy:i(0),opacity:0,fill:o},whileInView:{cy:i(t.line),opacity:1,fill:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",cx:c(t.id)+c.bandwidth()/2,r:d/n.length<5?0:d/n.length<20?2:4}),J?e.jsxRuntimeExports.jsx(P.motion.text,{x:c(`${t.id}`)+c.bandwidth()/2,exit:{y:i(0),opacity:0,transition:{duration:r.duration}},style:{textAnchor:"middle",...l?.graphObjectValues||{}},variants:{initial:{y:i(0),opacity:0,fill:o},whileInView:{y:i(t.line),opacity:1,fill:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",className:e.mo("graph-value text-sm",x?.graphObjectValues),dy:"-5px",children:ot.numberFormattingFunction(t.line,C,H,X,et)}):null]})},A))]}),I.filter(t=>t.position==="after").map(t=>t.layer)]})}),at&&v&&rt&&E?e.jsxRuntimeExports.jsx(Et.Tooltip,{data:at,body:v,xPos:rt,yPos:E,backgroundStyle:l?.tooltip,className:x?.tooltip}):null,h&&$!==void 0?e.jsxRuntimeExports.jsx(wt.X,{open:$!==void 0,onClose:()=>{L(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof h=="string"?{__html:Rt.string2HTML(h,$)}:void 0,children:typeof h=="function"?h($):null})}):null]})}function Lt(ct){const{data:q,graphTitle:M,sources:V,graphDescription:u,height:o,width:s,footNote:b,padding:U,lineColor:z=xt.Colors.light.categoricalColors.colors[1],barColor:_=xt.Colors.light.categoricalColors.colors[0],sameAxes:ut=!1,backgroundColor:v=!1,leftMargin:J=80,rightMargin:D=80,topMargin:mt=20,bottomMargin:K=25,lineAxisTitle:Q="Line chart",barAxisTitle:w="Bar graph",tooltip:Z,relativeHeight:h,onSeriesMouseOver:tt,graphID:et,graphDownload:Y=!1,dataDownload:X=!1,barPadding:it=.25,truncateBy:F=999,showLabels:l=!0,onSeriesMouseClick:x,language:r="en",colorLegendTitle:H,minHeight:I=0,theme:C="light",ariaLabel:st,resetSelectionOnDoubleClick:nt=!0,detailsOnClick:k,showValues:ht=!0,noOfTicks:at=5,lineSuffix:N="",barSuffix:$="",linePrefix:L="",barPrefix:rt="",curveType:S="curve",styles:E,classNames:m,animate:p=!1,precision:d=2,customLayers:g=[],naLabel:n="NA",showColorScale:c=!0,showAxisLabels:W=!0}=ct,[R,T]=j.useState(0),[O,G]=j.useState(0),y=j.useRef(null),a=j.useRef(null);return j.useEffect(()=>{const i=new ResizeObserver(B=>{T(s||B[0].target.clientWidth||620),G(o||B[0].target.clientHeight||480)});return y.current&&(G(y.current.clientHeight||480),T(y.current.clientWidth||620),s||i.observe(y.current)),()=>i.disconnect()},[s,o]),e.jsxRuntimeExports.jsx("div",{className:`${C||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:r==="he"||r==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${r||"en"}`,s?"w-fit":"w-full",m?.graphContainer),style:{...E?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:et,ref:a,"aria-label":st||`${M?`The graph shows ${M}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${u?` ${u}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?U||"1rem":U||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||u||Y||X?e.jsxRuntimeExports.jsx($t.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:m?.title,description:m?.description},graphTitle:M,graphDescription:u,width:s,graphDownload:Y?a.current:void 0,dataDownload:X?q.map(i=>i.data).filter(i=>i!==void 0).length>0?q.map(i=>i.data).filter(i=>i!==void 0):q.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:q.length===0?e.jsxRuntimeExports.jsx(qt.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsx(St.ColorLegend,{colorDomain:[w,Q],colors:[_||xt.Colors[C].categoricalColors.colors[0],z||xt.Colors[C].categoricalColors.colors[1]],colorLegendTitle:H,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:y,"aria-label":"Graph area",children:(s||R)&&(o||O)?e.jsxRuntimeExports.jsx(It,{data:q,sameAxes:ut,lineColor:z,barColor:_,width:s||R,height:Math.max(I,o||(h?I?(s||R)*h>I?(s||R)*h:I:(s||R)*h:O)),truncateBy:F,leftMargin:J,rightMargin:D,topMargin:mt,bottomMargin:K,axisTitles:[w,Q],tooltip:Z,onSeriesMouseOver:tt,barPadding:it,showLabels:l,onSeriesMouseClick:x,resetSelectionOnDoubleClick:nt,detailsOnClick:k,noOfTicks:at,lineSuffix:N,barSuffix:$,linePrefix:L,barPrefix:rt,curveType:S,showValues:ht,styles:E,classNames:m,animate:p===!0?{duration:.5,once:!0,amount:.5}:p||{duration:0,once:!0,amount:0},precision:d,customLayers:g,naLabel:n,showAxisLabels:W}):null})]})}),V||b?e.jsxRuntimeExports.jsx(Nt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:V,footNote:b,width:s}):null]})})})})}exports.ParetoChart=Lt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CHPV5EwG-DjM48pIC.cjs"),j=require("react"),gt=require("./index-DQA8q5sC.cjs"),wt=require("./Modal-CuuJdWkD.cjs"),ot=require("./numberFormattingFunction-02t-wJta.cjs"),Et=require("./Tooltip-Cpv0QohJ.cjs"),Rt=require("./string2HTML-z7CwHXcx.cjs"),pt=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),dt=require("./Axis-CkNn1wit.cjs"),ft=require("./AxisTitle-Wkz-xeQL.cjs"),At=require("./XAxesLabels-CLZnBgSr.cjs"),Mt=require("./band-CAApY4Pd.cjs"),yt=require("./linear-BVckp9RD.cjs"),jt=require("./line-DHV4JwCR.cjs"),lt=require("./step-BZ3C8QFW.cjs"),Ct=require("./use-in-view-CEwlc_dd.cjs"),P=require("./proxy-CKadx4lC.cjs"),kt=require("./index-Cm8NIdOO.cjs"),Nt=require("./GraphFooter.cjs"),$t=require("./GraphHeader.cjs"),St=require("./ColorLegend.cjs"),xt=require("./Colors.cjs"),qt=require("./EmptyState-B8IpKGcL.cjs");function It(ct){const{data:q,width:M,height:V,barColor:u,lineColor:o,axisTitles:s,sameAxes:b,rightMargin:U,leftMargin:z,topMargin:_,bottomMargin:ut,tooltip:v,showValues:J,onSeriesMouseOver:D,barPadding:mt,truncateBy:K,showLabels:Q,onSeriesMouseClick:w,resetSelectionOnDoubleClick:Z,detailsOnClick:h,noOfTicks:tt,lineSuffix:et,barSuffix:Y,linePrefix:W,barPrefix:it,curveType:F,styles:l,classNames:x,animate:r,precision:H,customLayers:I,naLabel:C,showAxisLabels:st}=ct,nt=j.useRef(null),k=Ct.useInView(nt,{once:r.once,amount:r.amount}),ht=F==="linear"?jt.curveLinear:F==="step"?lt.curveStep:F==="stepAfter"?lt.stepAfter:F==="stepBefore"?lt.stepBefore:lt.monotoneX,[at,N]=j.useState(void 0),[$,L]=j.useState(void 0),[rt,S]=j.useState(void 0),[E,m]=j.useState(void 0),p={top:_,bottom:ut,left:z+50,right:U+65},d=M-p.left-p.right,g=V-p.top-p.bottom,n=q.map((t,A)=>({...t,id:`${A}`})),c=Mt.band().domain(n.map(t=>`${t.id}`)).range([0,d]).paddingInner(mt),X=Math.min(...n.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.min(...n.map(t=>t.bar).filter(t=>t!=null))>0?0:Math.min(...n.map(t=>t.bar).filter(t=>t!=null)):0,R=Math.min(...n.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.min(...n.map(t=>t.line).filter(t=>t!=null))>0?0:Math.min(...n.map(t=>t.line).filter(t=>t!=null)):0,T=Math.max(...n.map(t=>t.bar).filter(t=>t!=null))!==1/0?Math.max(...n.map(t=>t.bar).filter(t=>t!=null)):0,O=Math.max(...n.map(t=>t.line).filter(t=>t!=null))!==1/0?Math.max(...n.map(t=>t.line).filter(t=>t!=null)):0,G=X<R?X:R,y=T>O?T:O,a=yt.linear().domain([b?G:X,b?y>0?y:0:T>0?T:0]).range([g,0]).nice(),i=yt.linear().domain([b?G:R,b?y>0?y:0:O>0?O:0]).range([g,0]).nice(),B=jt.line().defined(t=>!pt.checkIfNullOrUndefined(t.line)).x(t=>c(`${t.id}`)+c.bandwidth()/2).y(t=>i(t.line)).curve(ht),bt=a.ticks(tt),vt=i.ticks(tt);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(P.motion.svg,{width:`${M}px`,height:`${V}px`,viewBox:`0 0 ${M} ${V}`,direction:"ltr",ref:nt,children:e.jsxRuntimeExports.jsxs("g",{transform:`translate(${p.left},${p.top})`,children:[e.jsxRuntimeExports.jsxs("g",{children:[bt.map((t,A)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:a(t),y2:a(t),x1:-15,x2:-20,style:{stroke:u,strokeWidth:1,...l?.yAxis?.gridLines||{}},className:x?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:-25,y:a(t),dy:"0.33em",className:e.mo("text-xs",x?.yAxis?.labels),style:{textAnchor:"end",fill:u,...l?.yAxis?.labels||{}},children:ot.numberFormattingFunction(t,C,H,it,Y)})]},A)),e.jsxRuntimeExports.jsx(dt.Axis,{y1:0,y2:g,x1:-15,x2:-15,classNames:{axis:x?.xAxis?.axis},styles:{axis:{stroke:u,...l?.xAxis?.axis||{}}}}),st?e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:10-p.left,y:g/2,style:{fill:u,...l?.yAxis?.title||{}},className:x?.yAxis?.title,text:s[0].length>100?`${s[0].substring(0,100)}...`:s[0],rotate90:!0}):null]}),e.jsxRuntimeExports.jsxs("g",{children:[vt.map((t,A)=>e.jsxRuntimeExports.jsxs("g",{children:[e.jsxRuntimeExports.jsx("line",{y1:i(t),y2:i(t),x1:d+15,x2:d+20,style:{stroke:o,strokeWidth:1,...l?.yAxis?.gridLines||{}},className:x?.yAxis?.gridLines}),e.jsxRuntimeExports.jsx("text",{x:d+25,y:i(t),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:o,...l?.yAxis?.labels||{}},className:e.mo("text-xs",x?.yAxis?.labels),children:ot.numberFormattingFunction(t,C,H,W,et)})]},A)),e.jsxRuntimeExports.jsx(dt.Axis,{y1:0,y2:g,x1:d+15,x2:d+15,classNames:{axis:x?.xAxis?.axis},styles:{axis:{stroke:o,...l?.xAxis?.axis||{}}}}),st?e.jsxRuntimeExports.jsx(ft.AxisTitle,{x:d+p.right-15,y:g/2,style:{fill:o,...l?.yAxis?.title||{}},className:x?.yAxis?.title,text:s[1].length>100?`${s[1].substring(0,100)}...`:s[1],rotate90:!0}):null]}),e.jsxRuntimeExports.jsx(dt.Axis,{y1:b?a(0):g,y2:b?a(0):g,x1:-15,x2:d+15,classNames:{axis:x?.xAxis?.axis},styles:{axis:l?.xAxis?.axis}}),I.filter(t=>t.position==="before").map(t=>t.layer),e.jsxRuntimeExports.jsxs(kt.AnimatePresence,{children:[n.map((t,A)=>e.jsxRuntimeExports.jsxs(P.motion.g,{className:"undp-viz-g-with-hover",opacity:.85,onMouseEnter:f=>{N(t),m(f.clientY),S(f.clientX),D?.(t)},onClick:()=>{(w||h)&&(gt.isEqual($,t)&&Z?(L(void 0),w?.(void 0)):(L(t),w?.(t)))},onMouseMove:f=>{N(t),m(f.clientY),S(f.clientX)},onMouseLeave:()=>{N(void 0),S(void 0),m(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.rect,{variants:{initial:{attrY:a(0),height:0,opacity:1,fill:u},whileInView:{attrY:t.bar?t.bar>0?a(t.bar):a(0):0,height:t.bar?Math.abs(a(t.bar)-a(0)):0,opacity:1,fill:u,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",exit:{attrY:a(0),height:0,opacity:0,transition:{duration:r.duration}},x:c(`${A}`),width:c.bandwidth()}),J&&!pt.checkIfNullOrUndefined(t.bar)?e.jsxRuntimeExports.jsx(P.motion.text,{x:c(`${t.id}`)+c.bandwidth()/2,exit:{attrY:a(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{attrY:a(0),opacity:0,fill:u},whileInView:{attrY:a(t.bar||0),opacity:1,fill:u,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",style:{textAnchor:"middle",...l?.graphObjectValues||{}},className:e.mo("graph-value text-sm",x?.graphObjectValues),dy:t.bar?t.bar>=0?"-5px":"1em":"-5px",children:ot.numberFormattingFunction(t.bar,C,H,it,Y)}):null,Q?e.jsxRuntimeExports.jsx(At.XAxesLabels,{value:`${t.label}`.length<K?`${t.label}`:`${`${t.label}`.substring(0,K)}...`,y:g+5,x:c(`${t.id}`),width:c.bandwidth(),height:p.bottom,style:l?.xAxis?.labels,className:x?.xAxis?.labels,alignment:"top",animate:r,isInView:k}):null]},t.label)),e.jsxRuntimeExports.jsx(P.motion.path,{exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{d:B(n.map(t=>({...t,line:0}))),opacity:0,stroke:o},whileInView:{d:B(n),opacity:1,stroke:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",style:{fill:"none",strokeWidth:2}}),n.map((t,A)=>e.jsxRuntimeExports.jsx("g",{children:pt.checkIfNullOrUndefined(t.line)?null:e.jsxRuntimeExports.jsxs("g",{onMouseEnter:f=>{N(t),m(f.clientY),S(f.clientX),D?.(t)},onClick:()=>{(w||h)&&(gt.isEqual($,t)&&Z?(L(void 0),w?.(void 0)):(L(t),w?.(t)))},onMouseMove:f=>{N(t),m(f.clientY),S(f.clientX)},onMouseLeave:()=>{N(void 0),S(void 0),m(void 0),D?.(void 0)},children:[e.jsxRuntimeExports.jsx(P.motion.circle,{exit:{cy:i(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{cy:i(0),opacity:0,fill:o},whileInView:{cy:i(t.line),opacity:1,fill:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",cx:c(t.id)+c.bandwidth()/2,r:d/n.length<5?0:d/n.length<20?2:4}),J?e.jsxRuntimeExports.jsx(P.motion.text,{x:c(`${t.id}`)+c.bandwidth()/2,exit:{y:i(0),opacity:0,transition:{duration:r.duration}},style:{textAnchor:"middle",...l?.graphObjectValues||{}},variants:{initial:{y:i(0),opacity:0,fill:o},whileInView:{y:i(t.line),opacity:1,fill:o,transition:{duration:r.duration}}},initial:"initial",animate:k?"whileInView":"initial",className:e.mo("graph-value text-sm",x?.graphObjectValues),dy:"-5px",children:ot.numberFormattingFunction(t.line,C,H,W,et)}):null]})},A))]}),I.filter(t=>t.position==="after").map(t=>t.layer)]})}),at&&v&&rt&&E?e.jsxRuntimeExports.jsx(Et.Tooltip,{data:at,body:v,xPos:rt,yPos:E,backgroundStyle:l?.tooltip,className:x?.tooltip}):null,h&&$!==void 0?e.jsxRuntimeExports.jsx(wt.G,{open:$!==void 0,onClose:()=>{L(void 0)},children:e.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof h=="string"?{__html:Rt.string2HTML(h,$)}:void 0,children:typeof h=="function"?h($):null})}):null]})}function Lt(ct){const{data:q,graphTitle:M,sources:V,graphDescription:u,height:o,width:s,footNote:b,padding:U,lineColor:z=xt.Colors.light.categoricalColors.colors[1],barColor:_=xt.Colors.light.categoricalColors.colors[0],sameAxes:ut=!1,backgroundColor:v=!1,leftMargin:J=80,rightMargin:D=80,topMargin:mt=20,bottomMargin:K=25,lineAxisTitle:Q="Line chart",barAxisTitle:w="Bar graph",tooltip:Z,relativeHeight:h,onSeriesMouseOver:tt,graphID:et,graphDownload:Y=!1,dataDownload:W=!1,barPadding:it=.25,truncateBy:F=999,showLabels:l=!0,onSeriesMouseClick:x,language:r="en",colorLegendTitle:H,minHeight:I=0,theme:C="light",ariaLabel:st,resetSelectionOnDoubleClick:nt=!0,detailsOnClick:k,showValues:ht=!0,noOfTicks:at=5,lineSuffix:N="",barSuffix:$="",linePrefix:L="",barPrefix:rt="",curveType:S="curve",styles:E,classNames:m,animate:p=!1,precision:d=2,customLayers:g=[],naLabel:n="NA",showColorScale:c=!0,showAxisLabels:X=!0}=ct,[R,T]=j.useState(0),[O,G]=j.useState(0),y=j.useRef(null),a=j.useRef(null);return j.useEffect(()=>{const i=new ResizeObserver(B=>{T(s||B[0].target.clientWidth||620),G(o||B[0].target.clientHeight||480)});return y.current&&(G(y.current.clientHeight||480),T(y.current.clientWidth||620),s||i.observe(y.current)),()=>i.disconnect()},[s,o]),e.jsxRuntimeExports.jsx("div",{className:`${C||"light"} flex ${s?"w-fit grow-0":"w-full grow"}`,dir:r==="he"||r==="ar"?"rtl":void 0,children:e.jsxRuntimeExports.jsx("div",{className:e.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${r||"en"}`,s?"w-fit":"w-full",m?.graphContainer),style:{...E?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:et,ref:a,"aria-label":st||`${M?`The graph shows ${M}. `:""}This is a pareto chart that shows a variable as bars and another as line chart.${u?` ${u}`:""}`,children:e.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?U||"1rem":U||0},children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[M||u||Y||W?e.jsxRuntimeExports.jsx($t.GraphHeader,{styles:{title:E?.title,description:E?.description},classNames:{title:m?.title,description:m?.description},graphTitle:M,graphDescription:u,width:s,graphDownload:Y?a.current:void 0,dataDownload:W?q.map(i=>i.data).filter(i=>i!==void 0).length>0?q.map(i=>i.data).filter(i=>i!==void 0):q.filter(i=>i!==void 0):null}):null,e.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:q.length===0?e.jsxRuntimeExports.jsx(qt.EmptyState,{}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[c?e.jsxRuntimeExports.jsx(St.ColorLegend,{colorDomain:[w,Q],colors:[_||xt.Colors[C].categoricalColors.colors[0],z||xt.Colors[C].categoricalColors.colors[1]],colorLegendTitle:H,showNAColor:!1}):null,e.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:y,"aria-label":"Graph area",children:(s||R)&&(o||O)?e.jsxRuntimeExports.jsx(It,{data:q,sameAxes:ut,lineColor:z,barColor:_,width:s||R,height:Math.max(I,o||(h?I?(s||R)*h>I?(s||R)*h:I:(s||R)*h:O)),truncateBy:F,leftMargin:J,rightMargin:D,topMargin:mt,bottomMargin:K,axisTitles:[w,Q],tooltip:Z,onSeriesMouseOver:tt,barPadding:it,showLabels:l,onSeriesMouseClick:x,resetSelectionOnDoubleClick:nt,detailsOnClick:k,noOfTicks:at,lineSuffix:N,barSuffix:$,linePrefix:L,barPrefix:rt,curveType:S,showValues:ht,styles:E,classNames:m,animate:p===!0?{duration:.5,once:!0,amount:.5}:p||{duration:0,once:!0,amount:0},precision:d,customLayers:g,naLabel:n,showAxisLabels:X}):null})]})}),V||b?e.jsxRuntimeExports.jsx(Nt.GraphFooter,{styles:{footnote:E?.footnote,source:E?.source},classNames:{footnote:m?.footnote,source:m?.source},sources:V,footNote:b,width:s}):null]})})})})}exports.ParetoChart=Lt;
|
|
2
2
|
//# sourceMappingURL=ParetoChart.cjs.map
|
package/dist/ParetoChart.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { j as t, m as _ } from "./index-CHPV5EwG-
|
|
2
|
-
import { useRef as fi, useState as
|
|
1
|
+
import { j as t, m as _ } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
|
+
import { useRef as fi, useState as X, useEffect as ji } from "react";
|
|
3
3
|
import { i as gi } from "./index-Bwrro8-q.js";
|
|
4
|
-
import {
|
|
4
|
+
import { G as Ai } from "./Modal-Cg8daIlV.js";
|
|
5
5
|
import { n as oi } from "./numberFormattingFunction-14YCbkN2.js";
|
|
6
|
-
import { T as Mi } from "./Tooltip-
|
|
6
|
+
import { T as Mi } from "./Tooltip-6LIdPQGC.js";
|
|
7
7
|
import { s as ki } from "./string2HTML-oFCROsus.js";
|
|
8
8
|
import { c as di } from "./checkIfNullOrUndefined-DmfiKkNw.js";
|
|
9
|
-
import { A as pi } from "./Axis-
|
|
10
|
-
import { A as yi } from "./AxisTitle-
|
|
11
|
-
import { X as Ni } from "./XAxesLabels-
|
|
9
|
+
import { A as pi } from "./Axis-4gUOL8B7.js";
|
|
10
|
+
import { A as yi } from "./AxisTitle-v6_xcXZ-.js";
|
|
11
|
+
import { X as Ni } from "./XAxesLabels-SOSmso5J.js";
|
|
12
12
|
import { b as Ci } from "./band-BEjh2CHI.js";
|
|
13
13
|
import { a as bi } from "./linear-DUdu7l2G.js";
|
|
14
14
|
import { l as $i, c as Li } from "./line-CPfhohvF.js";
|
|
15
15
|
import { c as Ii, s as Si, a as Ti, m as Vi } from "./step-BrDul-H4.js";
|
|
16
|
-
import { u as Oi } from "./use-in-view-
|
|
17
|
-
import { m as D } from "./proxy-
|
|
18
|
-
import { A as Pi } from "./index-
|
|
16
|
+
import { u as Oi } from "./use-in-view-DR-UTB96.js";
|
|
17
|
+
import { m as D } from "./proxy-BYIC9BuT.js";
|
|
18
|
+
import { A as Pi } from "./index-Cwgh7i7X.js";
|
|
19
19
|
import { GraphFooter as Di } from "./GraphFooter.js";
|
|
20
20
|
import { GraphHeader as Yi } from "./GraphHeader.js";
|
|
21
21
|
import { ColorLegend as Hi } from "./ColorLegend.js";
|
|
22
22
|
import { Colors as ci } from "./Colors.js";
|
|
23
|
-
import { E as
|
|
24
|
-
function
|
|
23
|
+
import { E as Ei } from "./EmptyState-36lXXyui.js";
|
|
24
|
+
function Wi(mi) {
|
|
25
25
|
const {
|
|
26
26
|
data: S,
|
|
27
27
|
width: k,
|
|
@@ -48,18 +48,18 @@ function Ei(mi) {
|
|
|
48
48
|
barSuffix: B,
|
|
49
49
|
linePrefix: F,
|
|
50
50
|
barPrefix: ai,
|
|
51
|
-
curveType:
|
|
51
|
+
curveType: E,
|
|
52
52
|
styles: o,
|
|
53
53
|
classNames: c,
|
|
54
54
|
animate: r,
|
|
55
|
-
precision:
|
|
55
|
+
precision: W,
|
|
56
56
|
customLayers: T,
|
|
57
57
|
naLabel: N,
|
|
58
58
|
showAxisLabels: si
|
|
59
59
|
} = mi, li = fi(null), C = Oi(li, {
|
|
60
60
|
once: r.once,
|
|
61
61
|
amount: r.amount
|
|
62
|
-
}), ui =
|
|
62
|
+
}), ui = E === "linear" ? Li : E === "step" ? Ii : E === "stepAfter" ? Si : E === "stepBefore" ? Ti : Vi, [ri, $] = X(void 0), [L, V] = X(void 0), [ni, I] = X(void 0), [j, h] = X(void 0), d = {
|
|
63
63
|
top: J,
|
|
64
64
|
bottom: xi,
|
|
65
65
|
left: U + 50,
|
|
@@ -110,7 +110,7 @@ function Ei(mi) {
|
|
|
110
110
|
fill: x,
|
|
111
111
|
...o?.yAxis?.labels || {}
|
|
112
112
|
},
|
|
113
|
-
children: oi(i, N,
|
|
113
|
+
children: oi(i, N, W, ai, B)
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
] }, M)),
|
|
@@ -167,7 +167,7 @@ function Ei(mi) {
|
|
|
167
167
|
...o?.yAxis?.labels || {}
|
|
168
168
|
},
|
|
169
169
|
className: _("text-xs", c?.yAxis?.labels),
|
|
170
|
-
children: oi(i, N,
|
|
170
|
+
children: oi(i, N, W, F, ei)
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] }, M)),
|
|
@@ -285,7 +285,7 @@ function Ei(mi) {
|
|
|
285
285
|
},
|
|
286
286
|
className: _("graph-value text-sm", c?.graphObjectValues),
|
|
287
287
|
dy: i.bar ? i.bar >= 0 ? "-5px" : "1em" : "-5px",
|
|
288
|
-
children: oi(i.bar, N,
|
|
288
|
+
children: oi(i.bar, N, W, ai, B)
|
|
289
289
|
}
|
|
290
290
|
) : null,
|
|
291
291
|
Z ? /* @__PURE__ */ t.jsx(
|
|
@@ -411,7 +411,7 @@ function Ei(mi) {
|
|
|
411
411
|
children: oi(
|
|
412
412
|
i.line,
|
|
413
413
|
N,
|
|
414
|
-
|
|
414
|
+
W,
|
|
415
415
|
F,
|
|
416
416
|
ei
|
|
417
417
|
)
|
|
@@ -482,11 +482,11 @@ function mt(mi) {
|
|
|
482
482
|
graphDownload: B = !1,
|
|
483
483
|
dataDownload: F = !1,
|
|
484
484
|
barPadding: ai = 0.25,
|
|
485
|
-
truncateBy:
|
|
485
|
+
truncateBy: E = 999,
|
|
486
486
|
showLabels: o = !0,
|
|
487
487
|
onSeriesMouseClick: c,
|
|
488
488
|
language: r = "en",
|
|
489
|
-
colorLegendTitle:
|
|
489
|
+
colorLegendTitle: W,
|
|
490
490
|
minHeight: T = 0,
|
|
491
491
|
theme: N = "light",
|
|
492
492
|
ariaLabel: si,
|
|
@@ -507,7 +507,7 @@ function mt(mi) {
|
|
|
507
507
|
naLabel: s = "NA",
|
|
508
508
|
showColorScale: m = !0,
|
|
509
509
|
showAxisLabels: G = !0
|
|
510
|
-
} = mi, [A, O] =
|
|
510
|
+
} = mi, [A, O] = X(0), [P, R] = X(0), y = fi(null), l = fi(null);
|
|
511
511
|
return ji(() => {
|
|
512
512
|
const e = new ResizeObserver((z) => {
|
|
513
513
|
O(a || z[0].target.clientWidth || 620), R(n || z[0].target.clientHeight || 480);
|
|
@@ -557,7 +557,7 @@ function mt(mi) {
|
|
|
557
557
|
dataDownload: F ? S.map((e) => e.data).filter((e) => e !== void 0).length > 0 ? S.map((e) => e.data).filter((e) => e !== void 0) : S.filter((e) => e !== void 0) : null
|
|
558
558
|
}
|
|
559
559
|
) : null,
|
|
560
|
-
/* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: S.length === 0 ? /* @__PURE__ */ t.jsx(
|
|
560
|
+
/* @__PURE__ */ t.jsx("div", { className: "grow flex flex-col justify-center gap-3 w-full", children: S.length === 0 ? /* @__PURE__ */ t.jsx(Ei, {}) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
561
561
|
m ? /* @__PURE__ */ t.jsx(
|
|
562
562
|
Hi,
|
|
563
563
|
{
|
|
@@ -566,7 +566,7 @@ function mt(mi) {
|
|
|
566
566
|
J || ci[N].categoricalColors.colors[0],
|
|
567
567
|
U || ci[N].categoricalColors.colors[1]
|
|
568
568
|
],
|
|
569
|
-
colorLegendTitle:
|
|
569
|
+
colorLegendTitle: W,
|
|
570
570
|
showNAColor: !1
|
|
571
571
|
}
|
|
572
572
|
) : null,
|
|
@@ -577,7 +577,7 @@ function mt(mi) {
|
|
|
577
577
|
ref: y,
|
|
578
578
|
"aria-label": "Graph area",
|
|
579
579
|
children: (a || A) && (n || P) ? /* @__PURE__ */ t.jsx(
|
|
580
|
-
|
|
580
|
+
Wi,
|
|
581
581
|
{
|
|
582
582
|
data: S,
|
|
583
583
|
sameAxes: xi,
|
|
@@ -588,7 +588,7 @@ function mt(mi) {
|
|
|
588
588
|
T,
|
|
589
589
|
n || (u ? T ? (a || A) * u > T ? (a || A) * u : T : (a || A) * u : P)
|
|
590
590
|
),
|
|
591
|
-
truncateBy:
|
|
591
|
+
truncateBy: E,
|
|
592
592
|
leftMargin: K,
|
|
593
593
|
rightMargin: H,
|
|
594
594
|
topMargin: hi,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),o=require("react"),I=require("./index-D72cOtq7.cjs"),j=require("./index-BS2TADPj.cjs"),b=require("./DropdownSelect-vt8yiB-g.cjs"),z=require("./checkIfMultiple-Dko_cBvE.cjs"),L=require("./SingleGraphDashboard.cjs"),U=require("./SingleGraphDashboardThreeDGraphs.cjs"),Z=require("./SingleGraphDashboardGeoHubMaps.cjs"),p=require("./fetchAndParseData-Ba-_CgxS.cjs"),J=require("./getUniqValue-RViz8tTw.cjs"),B=require("./GraphHeader.cjs"),k=require("./filterData-BoYadk0l.cjs"),V=require("./transformDataForSelect-YmStusCI.cjs"),w=y=>y.map(a=>a.columnWidth||1).reduce((a,h)=>a+h,0),K=["barChart","choroplethMap","biVariateChoroplethMap","circlePacking","treeMap"];function Q(y){const{dashboardID:C,dashboardLayout:s,dataSettings:a,filters:h,debugMode:c,theme:g="light",readableHeader:T,dataFilters:R,noOfFiltersPerRow:v=4,filterPosition:F,uiMode:d="normal",graphStyles:S,graphClassNames:D}=y,[m,H]=o.useState(void 0),[f,q]=o.useState(void 0),[u,E]=o.useState([]),A=["threeDGlobe"],N=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],G=o.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),O=o.useMemo(()=>!f||u.length===0?f:f.filter(l=>u.every(e=>e.value&&j.flattenDeep([e.value]).length>0?I.intersection(j.flattenDeep([l[e.filter]]),j.flattenDeep([e.value]).map(i=>i.value)).length>0:!0)),[u,f]);o.useEffect(()=>{H(O)},[O]);const M=o.useCallback(async()=>{if(a)try{const l=await(a.dataURL?typeof a.dataURL=="string"?a.fileType==="json"?p.fetchAndParseJSON(a.dataURL,a.columnsToArray,a.dataTransformation,c):a.fileType==="api"?p.fetchAndTransformDataFromAPI(a.dataURL,a.apiHeaders,a.columnsToArray,a.dataTransformation,c):p.fetchAndParseCSV(a.dataURL,a.dataTransformation,a.columnsToArray,c,a.delimiter,!0):p.fetchAndParseMultipleDataSources(a.dataURL,a.idColumnTitle):p.transformColumnsToArray(a.data,a.columnsToArray));q(l);const e=(h||[]).map(i=>({filter:i.column,label:i.label||`Filter by ${i.column}`,singleSelect:i.singleSelect,clearable:i.clearable,defaultValue:V.transformDefaultValue(i.defaultValue),value:V.transformDefaultValue(i.defaultValue),availableValues:J.getUniqValue(l,i.column).filter(n=>!i.excludeValues?.includes(`${n}`)).map(n=>({value:n,label:n})),allowSelectAll:i.allowSelectAll,width:i.width}));E(e)}catch(t){console.error("Data fetching error:",t)}},[a,h,c]);o.useEffect(()=>{M()},[M]);const x=o.useCallback((t,l)=>{E(e=>e.map(i=>i.filter===t?{...i,value:l}:i))},[]);return r.jsxRuntimeExports.jsx("div",{className:`${g||"light"} flex grow`,dir:s.language==="he"||s.language==="ar"?"rtl":void 0,children:r.jsxRuntimeExports.jsx("div",{className:`${s.backgroundColor?s.backgroundColor===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto gap-4 flex flex-col w-full grow h-inherit ${s.language||"en"}`,style:{...s.backgroundColor&&s.backgroundColor!==!0?{backgroundColor:s.backgroundColor}:{}},id:C,children:r.jsxRuntimeExports.jsx("div",{style:{padding:s.backgroundColor?s.padding||"1rem":s.padding||0,flexGrow:1,display:"flex"},children:r.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[s.title||s.description?r.jsxRuntimeExports.jsx(B.GraphHeader,{graphTitle:s.title,graphDescription:s.description,isDashboard:!0}):null,r.jsxRuntimeExports.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[u.length!==0?r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"280px":"100%",flexGrow:1,flexShrink:0},children:r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"flex-start",width:"100%",position:"sticky",top:"1rem"},children:u?.map((t,l)=>r.jsxRuntimeExports.jsxs("div",{style:{width:t.width||`calc(${100/v}% - ${(v-1)/v}rem)`,flexGrow:1,flexShrink:0,minWidth:"240px"},children:[r.jsxRuntimeExports.jsx(z.f,{className:"mb-2",children:t.label}),t.singleSelect?r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isClearable:t.clearable===void 0?!0:t.clearable,size:"sm",variant:d,isMulti:!1,isSearchable:!0,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},defaultValue:t.defaultValue,value:t.value}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(b.Za,{options:t.availableValues,isMulti:!0,size:"sm",isClearable:t.clearable===void 0?!0:t.clearable,variant:d,isSearchable:!0,controlShouldRenderValue:!0,closeMenuOnSelect:!1,hideSelectedOptions:!1,filterOption:b.Hu(G),onChange:e=>{x(t.filter,e)},value:t.value,defaultValue:t.defaultValue}),t.allowSelectAll?r.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{x(t.filter,t.availableValues)},children:"Select all options"}):null]})]},l))})}):null,r.jsxRuntimeExports.jsx("div",{style:{width:F==="side"?"calc(100% - 280px - 1rem)":"100%",minWidth:"280px",flexGrow:1,display:"flex",gap:"1rem",flexWrap:"wrap",flexShrink:"0"},children:s.rows.map((t,l)=>r.jsxRuntimeExports.jsx("div",{style:{display:"flex",gap:"1rem",alignItems:"stretch",minHeight:`${t.height||0}px`,height:"auto",width:"100%",flexWrap:"wrap"},children:t.columns.map((e,i)=>r.jsxRuntimeExports.jsx("div",{className:"flex bg-transparent h-inherit grow min-w-60",style:{width:`calc(${100*(e.columnWidth||1)/w(t.columns)}% - ${(w(t.columns)-(e.columnWidth||1))/w(t.columns)}rem)`,minHeight:"inherit"},children:A.includes(e.graphType)?r.jsxRuntimeExports.jsx(U.SingleGraphDashboardThreeDGraphs,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]}):N.includes(e.graphType)?r.jsxRuntimeExports.jsx(Z.SingleGraphDashboardGeoHubMaps,{graphType:e.graphType,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},debugMode:c}):r.jsxRuntimeExports.jsx(L.SingleGraphDashboard,{graphType:e.graphType,dataFilters:e.dataFilters,uiMode:d,graphSettings:{...e.settings||{},width:void 0,height:void 0,resetSelectionOnDoubleClick:e.attachedFilter?!1:e.settings?.resetSelectionOnDoubleClick,styles:e.settings?.styles||S,classNames:e.settings?.classNames||D,radius:e.graphType==="donutChart"?void 0:e.settings?.radius,size:e.graphType==="unitChart"?e.settings?.size:void 0,language:e.settings?.language||s.language,theme:e.settings?.theme||g},dataSettings:{data:m?k.filterData(m,R||[]):void 0},updateFilters:e.attachedFilter&&K.indexOf(e.graphType)!==-1&&u.findIndex(n=>n.filter===e.attachedFilter)!==-1?n=>{const W=u.findIndex($=>$.filter===e.attachedFilter),P=n?u[W].singleSelect?{value:n,label:n}:[{value:n,label:n}]:void 0;x(e.attachedFilter,P)}:void 0,dataTransform:e.dataTransform,dataSelectionOptions:e.dataSelectionOptions,advancedDataSelectionOptions:e.advancedDataSelectionOptions,graphDataConfiguration:e.graphDataConfiguration,debugMode:c,readableHeader:T||[]})},i))},l))})]})]})})})})}exports.PerformanceIntensiveMultiGraphDashboard=Q;
|
|
2
2
|
//# sourceMappingURL=PerformanceIntensiveMultiGraphDashboard.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { j as r } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as r } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as v, useMemo as M, useEffect as A, useCallback as H } from "react";
|
|
3
3
|
import { i as Z } from "./index-V_JXij1_.js";
|
|
4
4
|
import { f as S } from "./index-EArKRVKg.js";
|
|
5
|
-
import { Z as G, H as N } from "./DropdownSelect-
|
|
6
|
-
import { f as q } from "./checkIfMultiple-
|
|
5
|
+
import { Z as G, H as N } from "./DropdownSelect-6kjXM6oW.js";
|
|
6
|
+
import { f as q } from "./checkIfMultiple-u2SmbiCf.js";
|
|
7
7
|
import { SingleGraphDashboard as J } from "./SingleGraphDashboard.js";
|
|
8
8
|
import { SingleGraphDashboardThreeDGraphs as B } from "./SingleGraphDashboardThreeDGraphs.js";
|
|
9
9
|
import { SingleGraphDashboardGeoHubMaps as K } from "./SingleGraphDashboardGeoHubMaps.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),s=require("react"),o=require("./Spinner-C6wLp85s.cjs"),d=require("./PerformanceIntensiveMultiGraphDashboard.cjs"),f=require("./fetchAndParseData-Ba-_CgxS.cjs");function u(i){const{config:t}=i,[e,a]=s.useState(void 0);return s.useEffect(()=>{(async()=>{if(typeof t=="string"){const n=await f.fetchAndParseJSON(t);a(n)}else a(t)})()},[t]),e?r.jsxRuntimeExports.jsx(d.PerformanceIntensiveMultiGraphDashboard,{dashboardID:e.dashboardID,dashboardLayout:e.dashboardLayout,dataSettings:e.dataSettings,filters:e.filters,debugMode:e.debugMode,theme:e.theme,readableHeader:e.readableHeader,dataFilters:e.dataFilters,noOfFiltersPerRow:e.noOfFiltersPerRow,filterPosition:e.filterPosition,uiMode:e.uiMode,graphStyles:e.graphStyles,graphClassNames:e.graphClassNames}):r.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:r.jsxRuntimeExports.jsx(o.y,{})})}exports.PerformanceIntensiveMultiGraphDashboardFromConfig=u;
|
|
2
2
|
//# sourceMappingURL=PerformanceIntensiveMultiGraphDashboardFromConfig.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as a } from "./index-CHPV5EwG-
|
|
1
|
+
import { j as a } from "./index-CHPV5EwG-DBWUSD9b.js";
|
|
2
2
|
import { useState as i, useEffect as n } from "react";
|
|
3
|
-
import { y as f } from "./Spinner-
|
|
3
|
+
import { y as f } from "./Spinner-Bpz70q_g.js";
|
|
4
4
|
import { PerformanceIntensiveMultiGraphDashboard as d } from "./PerformanceIntensiveMultiGraphDashboard.js";
|
|
5
5
|
import { f as l } from "./fetchAndParseData-sapWbnYk.js";
|
|
6
6
|
function b(s) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-DjM48pIC.cjs"),d=require("react"),y=require("./SingleGraphDashboard.cjs"),m=require("./SingleGraphDashboardThreeDGraphs.cjs"),j=require("./SingleGraphDashboardGeoHubMaps.cjs"),b=require("./proxy-CKadx4lC.cjs"),D=require("./use-in-view-CEwlc_dd.cjs");function v(s){const{chapters:h,visibilityThreshold:g=.5,mode:i="overlay",infoWidth:n="320px",infoPosition:o="left",infoBackgroundColor:c="rgba(255,255,255,0.8)"}=s,[e,p]=d.useState(0),x=["threeDGlobe"],f=["geoHubCompareMap","geoHubMap","geoHubMapWithLayerSelection"],t=[];return h.forEach((a,u)=>{a.sections.forEach((l,S)=>{t.push({chapter:u,dataSettings:a.dataSettings,section:S,graphType:a.graphType,infoBox:l.infoBox,graphSettings:{...a.graphSettings,...l.graphSettings||{},animate:!0},graphDataConfiguration:l.graphDataConfiguration||a.graphDataConfiguration||[]})})}),r.jsxRuntimeExports.jsxs("div",{className:"relative w-full h-full",children:[r.jsxRuntimeExports.jsx(b.motion.div,{className:"fixed top-0 h-full -z-10",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},style:{left:i==="overlay"||o==="right"?0:n,width:i==="overlay"?"100%":`calc(100% - ${n})`},children:x.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(m.SingleGraphDashboardThreeDGraphs,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration}):f.includes(t[e].graphType)?r.jsxRuntimeExports.jsx(j.SingleGraphDashboardGeoHubMaps,{graphType:t[e].graphType,graphSettings:t[e].graphSettings}):r.jsxRuntimeExports.jsx(y.SingleGraphDashboard,{graphType:t[e].graphType,dataSettings:t[e].dataSettings,graphSettings:t[e].graphSettings,graphDataConfiguration:t[e].graphDataConfiguration})},t[e].chapter),r.jsxRuntimeExports.jsx("div",{children:t.map((a,u)=>r.jsxRuntimeExports.jsx(T,{width:n,index:u,infoBox:a.infoBox,setActiveIndex:p,position:o,mode:i,visibilityThreshold:g,backgroundColor:c},`${a.chapter}-${a.section}`))})]})}function T({infoBox:s,index:h,setActiveIndex:g,position:i,mode:n,visibilityThreshold:o,backgroundColor:c,width:e}){const p=d.useRef(null);return D.useInView(p,{once:!1,amount:o})&&g(h),r.jsxRuntimeExports.jsx("section",{ref:p,className:`min-h-screen flex ${i==="center"?"justify-center":i==="right"?"justify-end":"justify-start"}`,children:r.jsxRuntimeExports.jsxs("div",{className:`p-8 ${n==="overlay"?"h-fit mx-10 ":""}`,style:{backgroundColor:c,width:e},children:[s.title,s.description]})})}exports.PerformanceIntensiveScrollStory=v;
|
|
2
2
|
//# sourceMappingURL=PerformanceIntensiveScrollStory.cjs.map
|