@mui/x-charts-pro 8.20.0 → 8.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.d.ts +5 -5
- package/BarChartPro/BarChartPro.js +38 -0
- package/BarChartPro/BarChartPro.plugins.d.ts +4 -4
- package/BarChartPro/BarChartPro.plugins.js +1 -1
- package/CHANGELOG.md +248 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +4 -4
- package/ChartContainerPro/useChartContainerProProps.d.ts +4 -4
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +4 -4
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -8
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +3 -3
- package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +2 -2
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +3 -3
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +2 -2
- package/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/ScatterPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/zoom-utils.d.ts +2 -2
- package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +3 -3
- package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +3 -3
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +3 -3
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.d.ts +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.d.ts +2 -2
- package/ChartsToolbarPro/Toolbar.types.d.ts +2 -2
- package/ChartsToolbarPro/internals/ChartsMenu.d.ts +1 -1
- package/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +1 -1
- package/FunnelChart/FunnelChart.d.ts +9 -9
- package/FunnelChart/FunnelChart.plugins.d.ts +4 -4
- package/FunnelChart/FunnelChart.plugins.js +1 -1
- package/FunnelChart/FunnelPlot.d.ts +2 -2
- package/FunnelChart/FunnelSection.d.ts +2 -2
- package/FunnelChart/FunnelSectionLabel.d.ts +2 -2
- package/FunnelChart/categoryAxis.types.d.ts +2 -2
- package/FunnelChart/coordinateMapper.d.ts +2 -2
- package/FunnelChart/curves/borderRadiusPolygon.d.ts +1 -1
- package/FunnelChart/curves/bump.d.ts +1 -1
- package/FunnelChart/curves/curve.types.d.ts +1 -1
- package/FunnelChart/curves/getFunnelCurve.d.ts +1 -1
- package/FunnelChart/curves/linear.d.ts +1 -1
- package/FunnelChart/curves/pyramid.d.ts +1 -1
- package/FunnelChart/curves/step-pyramid.d.ts +1 -1
- package/FunnelChart/curves/step.d.ts +1 -1
- package/FunnelChart/funnel.types.d.ts +5 -5
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +4 -4
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +2 -2
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +1 -1
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +2 -2
- package/FunnelChart/funnelPlotSlots.types.d.ts +2 -2
- package/FunnelChart/funnelSlots.types.d.ts +6 -6
- package/FunnelChart/labelUtils.d.ts +2 -2
- package/FunnelChart/seriesConfig/extremums.d.ts +1 -1
- package/FunnelChart/seriesConfig/getColor.d.ts +1 -1
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/FunnelChart/seriesConfig/legend.d.ts +1 -1
- package/FunnelChart/seriesConfig/seriesProcessor.d.ts +1 -1
- package/FunnelChart/seriesConfig/tooltip.d.ts +1 -1
- package/FunnelChart/seriesConfig/tooltipPosition.d.ts +1 -1
- package/FunnelChart/useFunnelChartProps.d.ts +7 -7
- package/Heatmap/Heatmap.d.ts +13 -13
- package/Heatmap/Heatmap.js +12 -0
- package/Heatmap/Heatmap.plugins.d.ts +3 -3
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/HeatmapItem.d.ts +2 -2
- package/Heatmap/HeatmapPlot.d.ts +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +1 -1
- package/Heatmap/seriesConfig/extremums.d.ts +1 -1
- package/Heatmap/seriesConfig/getColor.d.ts +1 -1
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/Heatmap/seriesConfig/index.d.ts +1 -1
- package/Heatmap/seriesConfig/seriesProcessor.d.ts +1 -1
- package/Heatmap/seriesConfig/tooltip.d.ts +1 -1
- package/Heatmap/seriesConfig/tooltipPosition.d.ts +1 -1
- package/LineChartPro/LineChartPro.d.ts +5 -5
- package/LineChartPro/LineChartPro.js +38 -0
- package/LineChartPro/LineChartPro.plugins.d.ts +4 -4
- package/LineChartPro/LineChartPro.plugins.js +1 -1
- package/PieChartPro/PieChartPro.d.ts +5 -5
- package/PieChartPro/PieChartPro.plugins.d.ts +3 -3
- package/RadarChartPro/RadarChartPro.d.ts +4 -4
- package/RadarChartPro/RadarChartPro.plugins.d.ts +3 -3
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyChart.d.ts +1 -1
- package/SankeyChart/SankeyChart.plugins.d.ts +3 -3
- package/SankeyChart/SankeyChart.plugins.js +1 -1
- package/SankeyChart/SankeyLinkLabel.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.d.ts +0 -4
- package/SankeyChart/SankeyNodeElement.js +3 -22
- package/SankeyChart/SankeyNodeLabel.d.ts +12 -0
- package/SankeyChart/SankeyNodeLabel.js +61 -0
- package/SankeyChart/SankeyPlot.js +21 -22
- package/SankeyChart/SankeyTooltip/SankeyTooltip.d.ts +1 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +1 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltipContent.d.ts +1 -1
- package/SankeyChart/calculateSankeyLayout.d.ts +3 -4
- package/SankeyChart/calculateSankeyLayout.js +15 -35
- package/SankeyChart/d3Sankey/align.d.ts +33 -0
- package/SankeyChart/d3Sankey/align.js +63 -0
- package/SankeyChart/d3Sankey/index.d.ts +4 -0
- package/SankeyChart/d3Sankey/index.js +49 -0
- package/SankeyChart/d3Sankey/sankey.d.ts +42 -0
- package/SankeyChart/d3Sankey/sankey.js +457 -0
- package/SankeyChart/d3Sankey/sankey.types.d.ts +381 -0
- package/SankeyChart/d3Sankey/sankey.types.js +5 -0
- package/SankeyChart/d3Sankey/sankeyLinkHorizontal.d.ts +22 -0
- package/SankeyChart/d3Sankey/sankeyLinkHorizontal.js +37 -0
- package/SankeyChart/plugins/useSankeyHighlight.d.ts +1 -1
- package/SankeyChart/plugins/useSankeyHighlight.js +1 -1
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +2 -2
- package/SankeyChart/plugins/useSankeyHighlight.types.d.ts +3 -3
- package/SankeyChart/sankey.types.d.ts +33 -25
- package/SankeyChart/sankeyClasses.d.ts +3 -1
- package/SankeyChart/sankeyClasses.js +2 -1
- package/SankeyChart/sankeySlots.types.d.ts +4 -4
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +63 -14
- package/SankeyChart/seriesConfig/index.js +15 -0
- package/SankeyChart/seriesConfig/tooltipGetter.js +5 -2
- package/SankeyChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/SankeyChart/seriesConfig/tooltipPosition.js +96 -0
- package/SankeyChart/utils.d.ts +2 -2
- package/SankeyChart/utils.js +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +6 -6
- package/ScatterChartPro/ScatterChartPro.js +38 -0
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -4
- package/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
- package/context/ChartProApi.d.ts +10 -10
- package/context/useChartProApiContext.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.d.ts +5 -5
- package/esm/BarChartPro/BarChartPro.js +38 -0
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +4 -4
- package/esm/BarChartPro/BarChartPro.plugins.js +2 -2
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +4 -4
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +4 -4
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +4 -4
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -8
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +3 -3
- package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +2 -2
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +3 -3
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +2 -2
- package/esm/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/ScatterPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/zoom-utils.d.ts +2 -2
- package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.d.ts +3 -3
- package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.d.ts +3 -3
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +3 -3
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInTrigger.d.ts +2 -2
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.d.ts +2 -2
- package/esm/ChartsToolbarPro/Toolbar.types.d.ts +2 -2
- package/esm/ChartsToolbarPro/internals/ChartsMenu.d.ts +1 -1
- package/esm/ChartsToolbarPro/internals/ChartsToolbarDivider.d.ts +1 -1
- package/esm/FunnelChart/FunnelChart.d.ts +9 -9
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +4 -4
- package/esm/FunnelChart/FunnelChart.plugins.js +2 -2
- package/esm/FunnelChart/FunnelPlot.d.ts +2 -2
- package/esm/FunnelChart/FunnelSection.d.ts +2 -2
- package/esm/FunnelChart/FunnelSectionLabel.d.ts +2 -2
- package/esm/FunnelChart/categoryAxis.types.d.ts +2 -2
- package/esm/FunnelChart/coordinateMapper.d.ts +2 -2
- package/esm/FunnelChart/curves/borderRadiusPolygon.d.ts +1 -1
- package/esm/FunnelChart/curves/bump.d.ts +1 -1
- package/esm/FunnelChart/curves/curve.types.d.ts +1 -1
- package/esm/FunnelChart/curves/getFunnelCurve.d.ts +1 -1
- package/esm/FunnelChart/curves/linear.d.ts +1 -1
- package/esm/FunnelChart/curves/pyramid.d.ts +1 -1
- package/esm/FunnelChart/curves/step-pyramid.d.ts +1 -1
- package/esm/FunnelChart/curves/step.d.ts +1 -1
- package/esm/FunnelChart/funnel.types.d.ts +5 -5
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +4 -4
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +2 -2
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +2 -2
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +2 -2
- package/esm/FunnelChart/funnelSlots.types.d.ts +6 -6
- package/esm/FunnelChart/labelUtils.d.ts +2 -2
- package/esm/FunnelChart/seriesConfig/extremums.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/getColor.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/legend.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/seriesProcessor.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/tooltip.d.ts +1 -1
- package/esm/FunnelChart/seriesConfig/tooltipPosition.d.ts +1 -1
- package/esm/FunnelChart/useFunnelChartProps.d.ts +7 -7
- package/esm/Heatmap/Heatmap.d.ts +13 -13
- package/esm/Heatmap/Heatmap.js +12 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +3 -3
- package/esm/Heatmap/Heatmap.plugins.js +2 -2
- package/esm/Heatmap/HeatmapItem.d.ts +2 -2
- package/esm/Heatmap/HeatmapPlot.d.ts +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/extremums.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/getColor.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/index.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/seriesProcessor.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/tooltip.d.ts +1 -1
- package/esm/Heatmap/seriesConfig/tooltipPosition.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.d.ts +5 -5
- package/esm/LineChartPro/LineChartPro.js +38 -0
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +4 -4
- package/esm/LineChartPro/LineChartPro.plugins.js +2 -2
- package/esm/PieChartPro/PieChartPro.d.ts +5 -5
- package/esm/PieChartPro/PieChartPro.plugins.d.ts +3 -3
- package/esm/RadarChartPro/RadarChartPro.d.ts +4 -4
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +3 -3
- package/esm/RadarChartPro/RadarChartPro.plugins.js +2 -2
- package/esm/SankeyChart/SankeyChart.d.ts +1 -1
- package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -3
- package/esm/SankeyChart/SankeyChart.plugins.js +2 -2
- package/esm/SankeyChart/SankeyLinkLabel.d.ts +1 -1
- package/esm/SankeyChart/SankeyNodeElement.d.ts +0 -4
- package/esm/SankeyChart/SankeyNodeElement.js +4 -23
- package/esm/SankeyChart/SankeyNodeLabel.d.ts +12 -0
- package/esm/SankeyChart/SankeyNodeLabel.js +55 -0
- package/esm/SankeyChart/SankeyPlot.js +23 -24
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.d.ts +1 -1
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +1 -1
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltipContent.d.ts +1 -1
- package/esm/SankeyChart/calculateSankeyLayout.d.ts +3 -4
- package/esm/SankeyChart/calculateSankeyLayout.js +15 -35
- package/esm/SankeyChart/d3Sankey/align.d.ts +33 -0
- package/esm/SankeyChart/d3Sankey/align.js +54 -0
- package/esm/SankeyChart/d3Sankey/index.d.ts +4 -0
- package/esm/SankeyChart/d3Sankey/index.js +4 -0
- package/esm/SankeyChart/d3Sankey/sankey.d.ts +42 -0
- package/esm/SankeyChart/d3Sankey/sankey.js +451 -0
- package/esm/SankeyChart/d3Sankey/sankey.types.d.ts +381 -0
- package/esm/SankeyChart/d3Sankey/sankey.types.js +1 -0
- package/esm/SankeyChart/d3Sankey/sankeyLinkHorizontal.d.ts +22 -0
- package/esm/SankeyChart/d3Sankey/sankeyLinkHorizontal.js +31 -0
- package/esm/SankeyChart/plugins/useSankeyHighlight.d.ts +1 -1
- package/esm/SankeyChart/plugins/useSankeyHighlight.js +1 -1
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +2 -2
- package/esm/SankeyChart/plugins/useSankeyHighlight.types.d.ts +3 -3
- package/esm/SankeyChart/sankey.types.d.ts +33 -25
- package/esm/SankeyChart/sankeyClasses.d.ts +3 -1
- package/esm/SankeyChart/sankeyClasses.js +2 -1
- package/esm/SankeyChart/sankeySlots.types.d.ts +4 -4
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +63 -14
- package/esm/SankeyChart/seriesConfig/index.js +14 -0
- package/esm/SankeyChart/seriesConfig/tooltipGetter.js +5 -2
- package/esm/SankeyChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/SankeyChart/seriesConfig/tooltipPosition.js +90 -0
- package/esm/SankeyChart/utils.d.ts +2 -2
- package/esm/SankeyChart/utils.js +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +6 -6
- package/esm/ScatterChartPro/ScatterChartPro.js +38 -0
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +4 -4
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -2
- package/esm/context/ChartProApi.d.ts +10 -10
- package/esm/context/useChartProApiContext.d.ts +1 -1
- package/esm/hooks/useChartProApiRef.d.ts +3 -3
- package/esm/hooks/useFunnelSeries.d.ts +1 -1
- package/esm/hooks/useHeatmapSeries.d.ts +1 -1
- package/esm/hooks/useSankeySeries.d.ts +9 -2
- package/esm/hooks/useSankeySeries.js +16 -1
- package/esm/index.js +1 -1
- package/esm/internals/material/components/BaseMenuItem.d.ts +1 -1
- package/esm/internals/material/components/BasePopper.d.ts +1 -1
- package/esm/internals/material/index.d.ts +3 -3
- package/esm/internals/plugins/allPlugins.d.ts +7 -7
- package/esm/internals/plugins/allPlugins.js +3 -3
- package/esm/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/useChartProExport.d.ts +2 -2
- package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/calculateZoom.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/esm/internals/slots/chartBaseSlotProps.d.ts +1 -1
- package/esm/internals/slots/chartsBaseSlots.d.ts +3 -3
- package/esm/internals/slots/chartsIconSlots.d.ts +2 -2
- package/esm/models/seriesType/heatmap.d.ts +2 -2
- package/esm/themeAugmentation/components.d.ts +1 -1
- package/esm/themeAugmentation/overrides.d.ts +1 -1
- package/esm/themeAugmentation/props.d.ts +4 -4
- package/esm/typeOverloads/modules.d.ts +11 -6
- package/hooks/useChartProApiRef.d.ts +3 -3
- package/hooks/useFunnelSeries.d.ts +1 -1
- package/hooks/useHeatmapSeries.d.ts +1 -1
- package/hooks/useSankeySeries.d.ts +9 -2
- package/hooks/useSankeySeries.js +16 -0
- package/index.js +1 -1
- package/internals/material/components/BaseMenuItem.d.ts +1 -1
- package/internals/material/components/BasePopper.d.ts +1 -1
- package/internals/material/index.d.ts +3 -3
- package/internals/plugins/allPlugins.d.ts +7 -7
- package/internals/plugins/allPlugins.js +2 -2
- package/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/internals/plugins/useChartProExport/useChartProExport.d.ts +2 -2
- package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +1 -1
- package/internals/plugins/useChartProZoom/calculateZoom.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +2 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/internals/slots/chartBaseSlotProps.d.ts +1 -1
- package/internals/slots/chartsBaseSlots.d.ts +3 -3
- package/internals/slots/chartsIconSlots.d.ts +2 -2
- package/models/seriesType/heatmap.d.ts +2 -2
- package/package.json +5 -5
- package/themeAugmentation/components.d.ts +1 -1
- package/themeAugmentation/overrides.d.ts +1 -1
- package/themeAugmentation/props.d.ts +4 -4
- package/typeOverloads/modules.d.ts +11 -6
|
@@ -10,13 +10,12 @@ exports.SankeyPlot = SankeyPlot;
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
|
-
var _hooks = require("@mui/x-charts/hooks");
|
|
14
|
-
var _calculateSankeyLayout = require("./calculateSankeyLayout");
|
|
15
13
|
var _SankeyNodeElement = require("./SankeyNodeElement");
|
|
16
14
|
var _SankeyLinkElement = require("./SankeyLinkElement");
|
|
17
15
|
var _SankeyLinkLabel = require("./SankeyLinkLabel");
|
|
18
16
|
var _useSankeySeries = require("../hooks/useSankeySeries");
|
|
19
17
|
var _sankeyClasses = require("./sankeyClasses");
|
|
18
|
+
var _SankeyNodeLabel = require("./SankeyNodeLabel");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
20
|
const SankeyPlotRoot = (0, _styles.styled)('g')({
|
|
22
21
|
[`.${_sankeyClasses.sankeyPlotClasses.links} path, .${_sankeyClasses.sankeyPlotClasses.nodes} rect`]: {
|
|
@@ -39,35 +38,31 @@ function SankeyPlot(props) {
|
|
|
39
38
|
onLinkClick,
|
|
40
39
|
onNodeClick
|
|
41
40
|
} = props;
|
|
42
|
-
const seriesContext = (0, _useSankeySeries.useSankeySeriesContext)();
|
|
43
|
-
if (!seriesContext) {
|
|
44
|
-
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
45
|
-
}
|
|
46
|
-
const series = seriesContext.series[seriesContext.seriesOrder?.[0]];
|
|
47
41
|
const classes = (0, _sankeyClasses.useUtilityClasses)({
|
|
48
42
|
classes: inputClasses
|
|
49
43
|
});
|
|
50
|
-
const
|
|
44
|
+
const sankeyContext = (0, _useSankeySeries.useSankeySeriesContext)();
|
|
45
|
+
const sankeySeries = sankeyContext?.series[sankeyContext?.seriesOrder[0]];
|
|
46
|
+
const layout = (0, _useSankeySeries.useSankeyLayout)();
|
|
47
|
+
if (!sankeySeries) {
|
|
48
|
+
throw new Error(`MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartDataProviderPro.`);
|
|
49
|
+
}
|
|
50
|
+
if (!layout || !layout.links) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
51
53
|
const {
|
|
52
|
-
data,
|
|
53
54
|
linkOptions,
|
|
54
55
|
nodeOptions
|
|
55
|
-
} =
|
|
56
|
-
const theme = (0, _styles.useTheme)();
|
|
57
|
-
|
|
58
|
-
// Calculate layout based on data and dimensions
|
|
59
|
-
const layout = React.useMemo(() => (0, _calculateSankeyLayout.calculateSankeyLayout)(data, drawingArea, theme, series), [drawingArea, data, series, theme]);
|
|
60
|
-
|
|
56
|
+
} = sankeySeries;
|
|
61
57
|
// Early return if no data or dimensions
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
58
|
+
|
|
59
|
+
const showNodeLabels = nodeOptions?.showLabels ?? true;
|
|
65
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SankeyPlotRoot, {
|
|
66
61
|
className: classes.root,
|
|
67
62
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
68
63
|
className: classes.links,
|
|
69
64
|
children: layout.links.map(link => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyLinkElement.SankeyLinkElement, {
|
|
70
|
-
seriesId:
|
|
65
|
+
seriesId: sankeySeries.id,
|
|
71
66
|
link: link,
|
|
72
67
|
opacity: linkOptions?.opacity,
|
|
73
68
|
onClick: onLinkClick
|
|
@@ -75,16 +70,20 @@ function SankeyPlot(props) {
|
|
|
75
70
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
76
71
|
className: classes.nodes,
|
|
77
72
|
children: layout.nodes.map(node => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyNodeElement.SankeyNodeElement, {
|
|
78
|
-
seriesId:
|
|
73
|
+
seriesId: sankeySeries.id,
|
|
79
74
|
node: node,
|
|
80
|
-
showLabel: nodeOptions?.showLabels,
|
|
81
75
|
onClick: onNodeClick
|
|
82
76
|
}, node.id))
|
|
83
77
|
}), linkOptions?.showValues && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
84
78
|
className: classes.linkLabels,
|
|
85
79
|
children: layout.links.map(link => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyLinkLabel.SankeyLinkLabel, {
|
|
86
80
|
link: link
|
|
87
|
-
}, `label-${link.source.id}-${link.target.id}`))
|
|
81
|
+
}, `label-link-${link.source.id}-${link.target.id}`))
|
|
82
|
+
}), showNodeLabels && /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
83
|
+
className: classes.nodeLabels,
|
|
84
|
+
children: layout.nodes.map(node => /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyNodeLabel.SankeyNodeLabel, {
|
|
85
|
+
node: node
|
|
86
|
+
}, `label-node-${node.id}`))
|
|
88
87
|
})]
|
|
89
88
|
});
|
|
90
89
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SankeyTooltipProps } from "./SankeyTooltip.types.js";
|
|
1
|
+
import { type SankeyTooltipProps } from "./SankeyTooltip.types.js";
|
|
2
2
|
declare function SankeyTooltip(props: SankeyTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
declare namespace SankeyTooltip {
|
|
4
4
|
var propTypes: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
1
|
+
import { type ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
2
2
|
export interface SankeyTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
|
|
3
3
|
/**
|
|
4
4
|
* Select the kind of tooltip to display
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SankeyTooltipProps } from "./SankeyTooltip.types.js";
|
|
1
|
+
import { type SankeyTooltipProps } from "./SankeyTooltip.types.js";
|
|
2
2
|
export interface SankeyTooltipContentProps extends Pick<SankeyTooltipProps, 'classes'> {}
|
|
3
3
|
export declare function SankeyTooltipContent(props: SankeyTooltipContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
export declare namespace SankeyTooltipContent {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ChartDrawingArea } from '@mui/x-charts/hooks';
|
|
2
|
-
import type {
|
|
3
|
-
import type { SankeySeriesType, SankeyLayout, SankeyLayoutLink, DefaultizedSankeySeriesType } from "./sankey.types.js";
|
|
2
|
+
import type { SankeyLayout, SankeyLayoutLink, DefaultizedSankeySeriesType } from "./sankey.types.js";
|
|
4
3
|
/**
|
|
5
4
|
* Calculates the layout for a Sankey diagram using d3-sankey
|
|
6
5
|
*
|
|
@@ -9,5 +8,5 @@ import type { SankeySeriesType, SankeyLayout, SankeyLayoutLink, DefaultizedSanke
|
|
|
9
8
|
* @param options Layout configuration options
|
|
10
9
|
* @returns The calculated layout
|
|
11
10
|
*/
|
|
12
|
-
export declare function calculateSankeyLayout(
|
|
13
|
-
export declare function improvedNaiveSankeyLinkPathHorizontal(link: SankeyLayoutLink
|
|
11
|
+
export declare function calculateSankeyLayout(series: DefaultizedSankeySeriesType, drawingArea: ChartDrawingArea): SankeyLayout<true>;
|
|
12
|
+
export declare function improvedNaiveSankeyLinkPathHorizontal(link: SankeyLayoutLink<true>, curveCorrection?: number): string;
|
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.calculateSankeyLayout = calculateSankeyLayout;
|
|
9
9
|
exports.improvedNaiveSankeyLinkPathHorizontal = improvedNaiveSankeyLinkPathHorizontal;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _d3Sankey = require("@mui/x-charts-vendor/d3-sankey");
|
|
12
11
|
var _d3Path = require("@mui/x-charts-vendor/d3-path");
|
|
12
|
+
var _d3Sankey = require("./d3Sankey");
|
|
13
13
|
var _utils = require("./utils");
|
|
14
14
|
/**
|
|
15
15
|
* Calculates the layout for a Sankey diagram using d3-sankey
|
|
@@ -20,8 +20,9 @@ var _utils = require("./utils");
|
|
|
20
20
|
* @returns The calculated layout
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
function calculateSankeyLayout(
|
|
23
|
+
function calculateSankeyLayout(series, drawingArea) {
|
|
24
24
|
const {
|
|
25
|
+
data,
|
|
25
26
|
iterations = 6,
|
|
26
27
|
nodeOptions,
|
|
27
28
|
linkOptions
|
|
@@ -29,14 +30,19 @@ function calculateSankeyLayout(data, drawingArea, theme, series = {}) {
|
|
|
29
30
|
const {
|
|
30
31
|
width: nodeWidth = 15,
|
|
31
32
|
padding: nodePadding = 10,
|
|
32
|
-
align: nodeAlign
|
|
33
|
+
align: nodeAlign,
|
|
33
34
|
sort: nodeSort
|
|
34
35
|
} = nodeOptions ?? {};
|
|
35
36
|
const {
|
|
36
|
-
color: linkColor = 'source',
|
|
37
37
|
sort: linkSort,
|
|
38
38
|
curveCorrection = 10
|
|
39
39
|
} = linkOptions ?? {};
|
|
40
|
+
if (!data || !data.links) {
|
|
41
|
+
return {
|
|
42
|
+
nodes: [],
|
|
43
|
+
links: []
|
|
44
|
+
};
|
|
45
|
+
}
|
|
40
46
|
const {
|
|
41
47
|
width,
|
|
42
48
|
height,
|
|
@@ -45,21 +51,9 @@ function calculateSankeyLayout(data, drawingArea, theme, series = {}) {
|
|
|
45
51
|
bottom,
|
|
46
52
|
right
|
|
47
53
|
} = drawingArea;
|
|
48
|
-
if (!data || !data.links) {
|
|
49
|
-
return {
|
|
50
|
-
nodes: [],
|
|
51
|
-
links: []
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Prepare the data structure expected by d3-sankey
|
|
56
|
-
const graph = {
|
|
57
|
-
nodes: data.nodes.values().toArray().map(v => (0, _extends2.default)({}, v)),
|
|
58
|
-
links: data.links.map(v => (0, _extends2.default)({}, v))
|
|
59
|
-
};
|
|
60
54
|
|
|
61
55
|
// Create the sankey layout generator
|
|
62
|
-
const sankeyGenerator = (0, _d3Sankey.sankey)().nodeWidth(nodeWidth).nodePadding(nodePadding).nodeAlign((0, _utils.getNodeAlignFunction)(nodeAlign)).extent([[left, top], [width + right, height + bottom]]).
|
|
56
|
+
const sankeyGenerator = (0, _d3Sankey.sankey)(true).nodeWidth(nodeWidth).nodePadding(nodePadding).nodeAlign((0, _utils.getNodeAlignFunction)(nodeAlign)).nodeId(d => d.id).extent([[left, top], [width + right, height + bottom]]).iterations(iterations);
|
|
63
57
|
|
|
64
58
|
// For 'auto' or undefined, don't set anything (use d3-sankey default behavior)
|
|
65
59
|
if (typeof nodeSort === 'function') {
|
|
@@ -79,7 +73,7 @@ function calculateSankeyLayout(data, drawingArea, theme, series = {}) {
|
|
|
79
73
|
// Generate the layout
|
|
80
74
|
let result;
|
|
81
75
|
try {
|
|
82
|
-
result = sankeyGenerator(
|
|
76
|
+
result = sankeyGenerator(data);
|
|
83
77
|
} catch (error) {
|
|
84
78
|
// There are two errors that can occur:
|
|
85
79
|
// 1. If the data contains circular references, d3-sankey will throw an error.
|
|
@@ -97,27 +91,13 @@ function calculateSankeyLayout(data, drawingArea, theme, series = {}) {
|
|
|
97
91
|
|
|
98
92
|
// Convert d3-sankey links to our format
|
|
99
93
|
const layoutLinks = links.map(link => {
|
|
100
|
-
|
|
101
|
-
const originalLink = data.links.find(l => {
|
|
102
|
-
return l.source === link.source.id && l.target === link.target.id;
|
|
103
|
-
});
|
|
104
|
-
let resolvedColor = originalLink?.color ?? linkColor;
|
|
105
|
-
if (resolvedColor === 'source') {
|
|
106
|
-
resolvedColor = link.source.color ?? linkColor;
|
|
107
|
-
} else if (resolvedColor === 'target') {
|
|
108
|
-
resolvedColor = link.target.color ?? linkColor;
|
|
109
|
-
}
|
|
110
|
-
return (0, _extends2.default)({}, originalLink, link, {
|
|
111
|
-
color: resolvedColor,
|
|
94
|
+
const rep = (0, _extends2.default)({}, link, {
|
|
112
95
|
path: improvedNaiveSankeyLinkPathHorizontal(link, curveCorrection)
|
|
113
96
|
});
|
|
114
|
-
|
|
115
|
-
const layoutNodes = nodes.map(node => {
|
|
116
|
-
const originalNode = data.nodes.get(node.id) || {};
|
|
117
|
-
return (0, _extends2.default)({}, originalNode, node);
|
|
97
|
+
return rep;
|
|
118
98
|
});
|
|
119
99
|
return {
|
|
120
|
-
nodes
|
|
100
|
+
nodes,
|
|
121
101
|
links: layoutLinks
|
|
122
102
|
};
|
|
123
103
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SankeyNode } from "./sankey.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the horizontal node position of a node in a Sankey layout with left alignment.
|
|
4
|
+
* Returns (node.depth) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
5
|
+
*
|
|
6
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
7
|
+
*/
|
|
8
|
+
export declare function sankeyLeft<WithPosition extends boolean>(node: SankeyNode<WithPosition, {}, {}>): number;
|
|
9
|
+
/**
|
|
10
|
+
* Compute the horizontal node position of a node in a Sankey layout with right alignment.
|
|
11
|
+
* Returns (n - 1 - node.height) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
12
|
+
*
|
|
13
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
14
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
15
|
+
*/
|
|
16
|
+
export declare function sankeyRight<WithPosition extends boolean>(node: SankeyNode<WithPosition, {}, {}>, n: number): number;
|
|
17
|
+
/**
|
|
18
|
+
* Compute the horizontal node position of a node in a Sankey layout with justified alignment.
|
|
19
|
+
* Like d3.sankeyLeft, except that nodes without any outgoing links are moved to the far right.
|
|
20
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
21
|
+
*
|
|
22
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
23
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
24
|
+
*/
|
|
25
|
+
export declare function sankeyJustify<WithPosition extends boolean>(node: SankeyNode<WithPosition, {}, {}>, n: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* Compute the horizontal node position of a node in a Sankey layout with center alignment.
|
|
28
|
+
* Like d3.sankeyLeft, except that nodes without any incoming links are moved as right as possible.
|
|
29
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
30
|
+
*
|
|
31
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sankeyCenter<WithPosition extends boolean>(node: SankeyNode<WithPosition, {}, {}>): number;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sankeyCenter = sankeyCenter;
|
|
7
|
+
exports.sankeyJustify = sankeyJustify;
|
|
8
|
+
exports.sankeyLeft = sankeyLeft;
|
|
9
|
+
exports.sankeyRight = sankeyRight;
|
|
10
|
+
var _d3Array = require("@mui/x-charts-vendor/d3-array");
|
|
11
|
+
function targetDepth(d) {
|
|
12
|
+
return d.target.depth ?? 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Compute the horizontal node position of a node in a Sankey layout with left alignment.
|
|
17
|
+
* Returns (node.depth) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
18
|
+
*
|
|
19
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
20
|
+
*/
|
|
21
|
+
function sankeyLeft(node) {
|
|
22
|
+
return node.depth ?? 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Compute the horizontal node position of a node in a Sankey layout with right alignment.
|
|
27
|
+
* Returns (n - 1 - node.height) to indicate the desired horizontal position of the node in the generated Sankey diagram.
|
|
28
|
+
*
|
|
29
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
30
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
31
|
+
*/
|
|
32
|
+
function sankeyRight(node, n) {
|
|
33
|
+
return n - 1 - (node.height ?? 0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Compute the horizontal node position of a node in a Sankey layout with justified alignment.
|
|
38
|
+
* Like d3.sankeyLeft, except that nodes without any outgoing links are moved to the far right.
|
|
39
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
40
|
+
*
|
|
41
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
42
|
+
* @param n Total depth n of the graph (one plus the maximum node.depth)
|
|
43
|
+
*/
|
|
44
|
+
function sankeyJustify(node, n) {
|
|
45
|
+
return node.sourceLinks?.length ? node.depth ?? 0 : n - 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Compute the horizontal node position of a node in a Sankey layout with center alignment.
|
|
50
|
+
* Like d3.sankeyLeft, except that nodes without any incoming links are moved as right as possible.
|
|
51
|
+
* Returns an integer between 0 and n - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.
|
|
52
|
+
*
|
|
53
|
+
* @param node Sankey node for which to calculate the horizontal node position.
|
|
54
|
+
*/
|
|
55
|
+
function sankeyCenter(node) {
|
|
56
|
+
if (node.targetLinks?.length) {
|
|
57
|
+
return node.depth ?? 0;
|
|
58
|
+
}
|
|
59
|
+
if (node.sourceLinks?.length) {
|
|
60
|
+
return ((0, _d3Array.min)(node.sourceLinks, targetDepth) ?? 0) - 1;
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _sankey = require("./sankey");
|
|
7
|
+
Object.keys(_sankey).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _sankey[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _sankey[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _align = require("./align");
|
|
18
|
+
Object.keys(_align).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _align[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _align[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _sankeyLinkHorizontal = require("./sankeyLinkHorizontal");
|
|
29
|
+
Object.keys(_sankeyLinkHorizontal).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _sankeyLinkHorizontal[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _sankeyLinkHorizontal[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _sankey2 = require("./sankey.types");
|
|
40
|
+
Object.keys(_sankey2).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _sankey2[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _sankey2[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SankeyExtraProperties, SankeyGraph, SankeyLayout } from "./sankey.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get a Sankey layout generator.
|
|
4
|
+
*
|
|
5
|
+
* Invoking sankey() without generics, means the node type and link type assume no user-defined attributes, i.e.
|
|
6
|
+
* only the attributes internally used by the Sankey layout generator.
|
|
7
|
+
*
|
|
8
|
+
* Default nodes/links accessors are assumed.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sankey<WithPosition extends boolean>(withoutPositions?: WithPosition): SankeyLayout<WithPosition, SankeyGraph<WithPosition, {}, {}>, {}, {}>;
|
|
11
|
+
/**
|
|
12
|
+
* Get a Sankey layout generator.
|
|
13
|
+
*
|
|
14
|
+
* Default nodes/links accessors are assumed.
|
|
15
|
+
*
|
|
16
|
+
* The first generic N refers to user-defined properties contained in the node data passed into
|
|
17
|
+
* Sankey layout generator. These properties are IN EXCESS to the properties explicitly identified in the
|
|
18
|
+
* SankeyNodeMinimal interface.
|
|
19
|
+
*
|
|
20
|
+
* The second generic L refers to user-defined properties contained in the link data passed into
|
|
21
|
+
* Sankey layout generator. These properties are IN EXCESS to the properties explicitly identified in the
|
|
22
|
+
* SankeyLinkMinimal interface.
|
|
23
|
+
*/
|
|
24
|
+
export declare function sankey<N extends SankeyExtraProperties, L extends SankeyExtraProperties, WithPosition extends boolean>(withoutPositions?: WithPosition): SankeyLayout<WithPosition, SankeyGraph<WithPosition, N, L>, N, L>;
|
|
25
|
+
/**
|
|
26
|
+
* Get a Sankey layout generator.
|
|
27
|
+
*
|
|
28
|
+
* The nodes/links accessors need to be configured to work with the data type of the first argument passed
|
|
29
|
+
* in when invoking the Sankey layout generator.
|
|
30
|
+
*
|
|
31
|
+
* The first generic corresponds to the data type of the first argument passed in when invoking the Sankey layout generator,
|
|
32
|
+
* and its nodes/links accessors.
|
|
33
|
+
*
|
|
34
|
+
* The second generic N refers to user-defined properties contained in the node data passed into
|
|
35
|
+
* Sankey layout generator. These properties are IN EXCESS to the properties explicitly identified in the
|
|
36
|
+
* SankeyNodeMinimal interface.
|
|
37
|
+
*
|
|
38
|
+
* The third generic L refers to user-defined properties contained in the link data passed into
|
|
39
|
+
* Sankey layout generator. These properties are IN EXCESS to the properties explicitly identified in the
|
|
40
|
+
* SankeyLinkMinimal interface.
|
|
41
|
+
*/
|
|
42
|
+
export declare function sankey<Data, N extends SankeyExtraProperties, L extends SankeyExtraProperties, WithPosition extends boolean>(withPositions?: WithPosition): SankeyLayout<WithPosition, Data, N, L>;
|