@mui/x-charts-pro 8.26.0 → 9.0.0-alpha.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 +1 -1
- package/BarChartPro/BarChartPro.js +9 -4
- package/CHANGELOG.md +355 -3
- package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/ChartContainerPro/ChartContainerPro.js +14 -287
- package/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/ChartContainerPro/useChartContainerProProps.js +9 -34
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/ChartDataProviderPro/index.d.ts +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -6
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +6 -4
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/ChartsContainer/index.d.ts +1 -0
- package/ChartsContainer/index.js +16 -0
- package/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/ChartsContainerPro/ChartsContainerPro.js +187 -0
- package/ChartsContainerPro/index.d.ts +9 -0
- package/ChartsContainerPro/index.js +17 -0
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
- package/FunnelChart/FunnelChart.js +4 -4
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/funnel.types.d.ts +1 -1
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +12 -9
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/seriesConfig/index.js +2 -1
- package/FunnelChart/seriesConfig/legend.js +0 -1
- package/Heatmap/Heatmap.d.ts +14 -2
- package/Heatmap/Heatmap.js +36 -130
- package/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/Heatmap.types.d.ts +19 -0
- package/Heatmap/Heatmap.types.js +5 -0
- package/Heatmap/HeatmapItem.d.ts +6 -0
- package/Heatmap/HeatmapItem.js +11 -3
- package/Heatmap/HeatmapPlot.d.ts +7 -3
- package/Heatmap/HeatmapPlot.js +16 -54
- package/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/Heatmap/HeatmapSVGPlot.js +70 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/Heatmap/index.d.ts +3 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/Heatmap/seriesConfig/getItemAtPosition.js +45 -0
- package/Heatmap/seriesConfig/index.js +3 -0
- package/Heatmap/useHeatmapProps.d.ts +24 -0
- package/Heatmap/useHeatmapProps.js +159 -0
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +9 -4
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/PieChartPro/PieChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyChart.js +4 -4
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/SankeyChart/index.d.ts +1 -1
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/SankeyChart/sankey.types.d.ts +6 -3
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/SankeyChart/seriesConfig/identifierCleaner.js +24 -0
- package/SankeyChart/seriesConfig/index.js +3 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.js +9 -4
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/esm/ChartContainerPro/useChartContainerProProps.js +10 -33
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/esm/ChartDataProviderPro/index.d.ts +1 -1
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +9 -7
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +7 -5
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/esm/ChartsContainer/index.d.ts +1 -0
- package/esm/ChartsContainer/index.js +2 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.js +181 -0
- package/esm/ChartsContainerPro/index.d.ts +9 -0
- package/esm/ChartsContainerPro/index.js +6 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
- package/esm/FunnelChart/FunnelChart.js +4 -4
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/funnel.types.d.ts +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +13 -10
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/seriesConfig/index.js +3 -2
- package/esm/FunnelChart/seriesConfig/legend.js +0 -1
- package/esm/Heatmap/Heatmap.d.ts +14 -2
- package/esm/Heatmap/Heatmap.js +37 -131
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/esm/Heatmap/Heatmap.plugins.js +2 -2
- package/esm/Heatmap/Heatmap.types.d.ts +19 -0
- package/esm/Heatmap/Heatmap.types.js +1 -0
- package/esm/Heatmap/HeatmapItem.d.ts +6 -0
- package/esm/Heatmap/HeatmapItem.js +11 -3
- package/esm/Heatmap/HeatmapPlot.d.ts +7 -3
- package/esm/Heatmap/HeatmapPlot.js +17 -56
- package/esm/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/esm/Heatmap/HeatmapSVGPlot.js +64 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/esm/Heatmap/index.d.ts +3 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/esm/Heatmap/seriesConfig/getItemAtPosition.js +39 -0
- package/esm/Heatmap/seriesConfig/index.js +4 -1
- package/esm/Heatmap/useHeatmapProps.d.ts +24 -0
- package/esm/Heatmap/useHeatmapProps.js +151 -0
- package/esm/LineChartPro/LineChartPro.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.js +9 -4
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/PieChartPro/PieChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/esm/RadarChartPro/RadarChartPro.plugins.js +2 -2
- package/esm/SankeyChart/SankeyChart.js +4 -4
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/esm/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/esm/SankeyChart/index.d.ts +1 -1
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/esm/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/esm/SankeyChart/sankey.types.d.ts +6 -3
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/esm/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/esm/SankeyChart/seriesConfig/identifierCleaner.js +18 -0
- package/esm/SankeyChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/index.d.ts +3 -1
- package/esm/index.js +2 -1
- package/esm/internals/index.d.ts +8 -1
- package/esm/internals/index.js +6 -1
- package/esm/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/esm/internals/plugins/useChartProExport/common.js +36 -0
- package/esm/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/exportImage.js +10 -1
- package/esm/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/print.js +2 -1
- package/esm/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +7 -5
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/esm/models/seriesType/heatmap.d.ts +3 -3
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/esm/typeOverloads/modules.d.ts +9 -5
- package/index.d.ts +3 -1
- package/index.js +9 -1
- package/internals/index.d.ts +8 -1
- package/internals/index.js +50 -1
- package/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/internals/plugins/useChartProExport/common.js +37 -0
- package/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/internals/plugins/useChartProExport/exportImage.js +9 -0
- package/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/internals/plugins/useChartProExport/print.js +1 -0
- package/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +6 -4
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/models/seriesType/heatmap.d.ts +3 -3
- package/package.json +8 -8
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/typeOverloads/modules.d.ts +9 -5
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { cartesianSeriesTypes, identifierSerializerSeriesIdDataIndex } from '@mui/x-charts/internals';
|
|
1
|
+
import { cartesianSeriesTypes, identifierSerializerSeriesIdDataIndex, identifierCleanerSeriesIdDataIndex } from '@mui/x-charts/internals';
|
|
2
2
|
import { getBaseExtremum } from "./extremums.js";
|
|
3
3
|
import seriesProcessor from "./seriesProcessor.js";
|
|
4
4
|
import getColor from "./getColor.js";
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
8
|
+
import getItemAtPosition from "./getItemAtPosition.js";
|
|
8
9
|
import keyboardFocusHandler from "./keyboardFocusHandler.js";
|
|
9
10
|
cartesianSeriesTypes.addType('heatmap');
|
|
10
11
|
export const heatmapSeriesConfig = {
|
|
@@ -17,5 +18,7 @@ export const heatmapSeriesConfig = {
|
|
|
17
18
|
yExtremumGetter: getBaseExtremum,
|
|
18
19
|
getSeriesWithDefaultValues,
|
|
19
20
|
identifierSerializer: identifierSerializerSeriesIdDataIndex,
|
|
21
|
+
identifierCleaner: identifierCleanerSeriesIdDataIndex,
|
|
22
|
+
getItemAtPosition,
|
|
20
23
|
keyboardFocusHandler
|
|
21
24
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChartsWrapperProps } from '@mui/x-charts/ChartsWrapper';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type ChartsLegendProps, type ChartsLegendSlotExtension } from '@mui/x-charts/ChartsLegend';
|
|
4
|
+
import type { ChartsOverlayProps } from '@mui/x-charts/ChartsOverlay';
|
|
5
|
+
import { type ChartsClipPathProps } from '@mui/x-charts/ChartsClipPath';
|
|
6
|
+
import type { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
7
|
+
import { type HeatmapPluginSignatures } from "./Heatmap.plugins.js";
|
|
8
|
+
import { type HeatmapProps } from "./Heatmap.js";
|
|
9
|
+
import { type ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
10
|
+
import { type HeatmapPlotProps } from "./HeatmapPlot.js";
|
|
11
|
+
export type UseHeatmapProps = HeatmapProps;
|
|
12
|
+
export declare function useHeatmapProps(props: UseHeatmapProps): {
|
|
13
|
+
chartDataProviderProProps: ChartDataProviderProProps<"heatmap", HeatmapPluginSignatures>;
|
|
14
|
+
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
15
|
+
heatmapPlotProps: HeatmapPlotProps;
|
|
16
|
+
clipPathProps: ChartsClipPathProps;
|
|
17
|
+
clipPathGroupProps: {
|
|
18
|
+
clipPath: string;
|
|
19
|
+
};
|
|
20
|
+
overlayProps: ChartsOverlayProps;
|
|
21
|
+
chartsAxisProps: ChartsAxisProps;
|
|
22
|
+
legendProps: ChartsLegendProps | ChartsLegendSlotExtension;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import useId from '@mui/utils/useId';
|
|
3
|
+
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
6
|
+
import { ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
|
|
7
|
+
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
8
|
+
import { heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
9
|
+
const seriesConfig = {
|
|
10
|
+
heatmap: heatmapSeriesConfig
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
14
|
+
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
15
|
+
function getDefaultDataForAxis(series, dimension) {
|
|
16
|
+
if (series?.[0]?.data === undefined || series[0].data.length === 0) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return Array.from({
|
|
20
|
+
length: Math.max(...series[0].data.map(dataPoint => dataPoint[dimension])) + 1
|
|
21
|
+
}, (_, index) => index);
|
|
22
|
+
}
|
|
23
|
+
const getDefaultDataForXAxis = series => getDefaultDataForAxis(series, 0);
|
|
24
|
+
const getDefaultDataForYAxis = series => getDefaultDataForAxis(series, 1);
|
|
25
|
+
export function useHeatmapProps(props) {
|
|
26
|
+
const {
|
|
27
|
+
apiRef,
|
|
28
|
+
xAxis,
|
|
29
|
+
yAxis,
|
|
30
|
+
zAxis,
|
|
31
|
+
series,
|
|
32
|
+
width,
|
|
33
|
+
height,
|
|
34
|
+
margin,
|
|
35
|
+
colors,
|
|
36
|
+
dataset,
|
|
37
|
+
sx,
|
|
38
|
+
onAxisClick,
|
|
39
|
+
onItemClick,
|
|
40
|
+
children,
|
|
41
|
+
slots,
|
|
42
|
+
slotProps,
|
|
43
|
+
loading,
|
|
44
|
+
highlightedItem,
|
|
45
|
+
onHighlightChange,
|
|
46
|
+
enableKeyboardNavigation,
|
|
47
|
+
borderRadius,
|
|
48
|
+
hideLegend
|
|
49
|
+
} = props;
|
|
50
|
+
const id = useId();
|
|
51
|
+
const clipPathId = `${id}-clip-path`;
|
|
52
|
+
const xAxisWithDefault = React.useMemo(() => (xAxis && xAxis.length > 0 ? xAxis : [{
|
|
53
|
+
id: DEFAULT_X_AXIS_KEY
|
|
54
|
+
}]).map(axis => _extends({
|
|
55
|
+
scaleType: 'band',
|
|
56
|
+
categoryGapRatio: 0
|
|
57
|
+
}, axis, {
|
|
58
|
+
data: axis.data ?? getDefaultDataForXAxis(series)
|
|
59
|
+
})), [series, xAxis]);
|
|
60
|
+
const yAxisWithDefault = React.useMemo(() => (yAxis && yAxis.length > 0 ? yAxis : [{
|
|
61
|
+
id: DEFAULT_Y_AXIS_KEY
|
|
62
|
+
}]).map(axis => _extends({
|
|
63
|
+
scaleType: 'band',
|
|
64
|
+
categoryGapRatio: 0
|
|
65
|
+
}, axis, {
|
|
66
|
+
data: axis.data ?? getDefaultDataForYAxis(series)
|
|
67
|
+
})), [series, yAxis]);
|
|
68
|
+
const zAxisWithDefault = React.useMemo(() => zAxis ?? [{
|
|
69
|
+
colorMap: {
|
|
70
|
+
type: 'continuous',
|
|
71
|
+
min: 0,
|
|
72
|
+
max: 100,
|
|
73
|
+
color: defaultColorMap
|
|
74
|
+
}
|
|
75
|
+
}], [zAxis]);
|
|
76
|
+
const seriesWithDefault = series.map(s => _extends({
|
|
77
|
+
type: 'heatmap'
|
|
78
|
+
}, s));
|
|
79
|
+
const chartsWrapperProps = {
|
|
80
|
+
sx,
|
|
81
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
82
|
+
legendDirection: props.slotProps?.legend?.direction,
|
|
83
|
+
hideLegend
|
|
84
|
+
};
|
|
85
|
+
const chartDataProviderProProps = {
|
|
86
|
+
apiRef,
|
|
87
|
+
seriesConfig,
|
|
88
|
+
series: seriesWithDefault,
|
|
89
|
+
width,
|
|
90
|
+
height,
|
|
91
|
+
margin,
|
|
92
|
+
xAxis: xAxisWithDefault,
|
|
93
|
+
yAxis: yAxisWithDefault,
|
|
94
|
+
zAxis: zAxisWithDefault,
|
|
95
|
+
colors,
|
|
96
|
+
dataset,
|
|
97
|
+
disableAxisListener: true,
|
|
98
|
+
highlightedItem,
|
|
99
|
+
onHighlightChange,
|
|
100
|
+
enableKeyboardNavigation,
|
|
101
|
+
onAxisClick,
|
|
102
|
+
onItemClick,
|
|
103
|
+
plugins: HEATMAP_PLUGINS
|
|
104
|
+
};
|
|
105
|
+
const heatmapPlotProps = {
|
|
106
|
+
borderRadius,
|
|
107
|
+
slots,
|
|
108
|
+
slotProps
|
|
109
|
+
};
|
|
110
|
+
const overlayProps = {
|
|
111
|
+
slots,
|
|
112
|
+
slotProps,
|
|
113
|
+
loading
|
|
114
|
+
};
|
|
115
|
+
const clipPathGroupProps = {
|
|
116
|
+
clipPath: `url(#${clipPathId})`
|
|
117
|
+
};
|
|
118
|
+
const clipPathProps = {
|
|
119
|
+
id: clipPathId
|
|
120
|
+
};
|
|
121
|
+
const chartsAxisProps = {
|
|
122
|
+
slots,
|
|
123
|
+
slotProps
|
|
124
|
+
};
|
|
125
|
+
const legendProps = {
|
|
126
|
+
slots: _extends({}, slots, {
|
|
127
|
+
legend: slots?.legend ?? ContinuousColorLegend
|
|
128
|
+
}),
|
|
129
|
+
slotProps: {
|
|
130
|
+
legend: _extends({
|
|
131
|
+
labelPosition: 'extremes'
|
|
132
|
+
}, slotProps?.legend)
|
|
133
|
+
},
|
|
134
|
+
sx: slotProps?.legend?.direction === 'vertical' ? {
|
|
135
|
+
height: 150
|
|
136
|
+
} : {
|
|
137
|
+
width: '50%'
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
chartDataProviderProProps,
|
|
142
|
+
chartsWrapperProps,
|
|
143
|
+
heatmapPlotProps,
|
|
144
|
+
clipPathProps,
|
|
145
|
+
clipPathGroupProps,
|
|
146
|
+
overlayProps,
|
|
147
|
+
chartsAxisProps,
|
|
148
|
+
legendProps,
|
|
149
|
+
children
|
|
150
|
+
};
|
|
151
|
+
}
|
|
@@ -6,7 +6,7 @@ import { type ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
6
6
|
import { type LineChartProPluginSignatures } from "./LineChartPro.plugins.js";
|
|
7
7
|
export interface LineChartProSlots extends Omit<LineChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface LineChartProSlotProps extends Omit<LineChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'line', LineChartProPluginSignatures>, 'series' | 'slots' | 'slotProps'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -102,6 +102,11 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
102
102
|
setZoomData: PropTypes.func.isRequired
|
|
103
103
|
})
|
|
104
104
|
}),
|
|
105
|
+
/**
|
|
106
|
+
* A gap added between axes when multiple axes are rendered on the same side of the chart.
|
|
107
|
+
* @default 0
|
|
108
|
+
*/
|
|
109
|
+
axesGap: PropTypes.number,
|
|
105
110
|
/**
|
|
106
111
|
* The configuration of axes highlight.
|
|
107
112
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -181,7 +186,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
181
186
|
*/
|
|
182
187
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
183
188
|
dataIndex: PropTypes.number,
|
|
184
|
-
seriesId: PropTypes.
|
|
189
|
+
seriesId: PropTypes.string,
|
|
185
190
|
type: PropTypes.oneOf(['line']).isRequired
|
|
186
191
|
})),
|
|
187
192
|
/**
|
|
@@ -202,7 +207,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
202
207
|
*/
|
|
203
208
|
highlightedItem: PropTypes.shape({
|
|
204
209
|
dataIndex: PropTypes.number,
|
|
205
|
-
seriesId: PropTypes.
|
|
210
|
+
seriesId: PropTypes.string.isRequired
|
|
206
211
|
}),
|
|
207
212
|
/**
|
|
208
213
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -232,7 +237,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
232
237
|
*/
|
|
233
238
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
234
239
|
dataIndex: PropTypes.number,
|
|
235
|
-
seriesId: PropTypes.
|
|
240
|
+
seriesId: PropTypes.string,
|
|
236
241
|
type: PropTypes.oneOf(['line']).isRequired
|
|
237
242
|
})),
|
|
238
243
|
/**
|
|
@@ -349,7 +354,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
349
354
|
*/
|
|
350
355
|
tooltipItem: PropTypes.shape({
|
|
351
356
|
dataIndex: PropTypes.number,
|
|
352
|
-
seriesId: PropTypes.
|
|
357
|
+
seriesId: PropTypes.string.isRequired,
|
|
353
358
|
type: PropTypes.oneOf(['line']).isRequired
|
|
354
359
|
}),
|
|
355
360
|
/**
|
|
@@ -6,7 +6,7 @@ import { type PieChartProPluginSignatures } from "./PieChartPro.plugins.js";
|
|
|
6
6
|
import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
7
|
export interface PieChartProSlots extends Omit<PieChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
8
|
export interface PieChartProSlotProps extends Omit<PieChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
9
|
-
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | '
|
|
9
|
+
export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'pie', PieChartProPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
10
10
|
/**
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
@@ -138,7 +138,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
138
138
|
*/
|
|
139
139
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
140
140
|
dataIndex: PropTypes.number,
|
|
141
|
-
seriesId: PropTypes.
|
|
141
|
+
seriesId: PropTypes.string,
|
|
142
142
|
type: PropTypes.oneOf(['pie']).isRequired
|
|
143
143
|
})),
|
|
144
144
|
/**
|
|
@@ -151,7 +151,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
151
151
|
*/
|
|
152
152
|
highlightedItem: PropTypes.shape({
|
|
153
153
|
dataIndex: PropTypes.number,
|
|
154
|
-
seriesId: PropTypes.
|
|
154
|
+
seriesId: PropTypes.string.isRequired
|
|
155
155
|
}),
|
|
156
156
|
/**
|
|
157
157
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -181,7 +181,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
181
181
|
*/
|
|
182
182
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
183
183
|
dataIndex: PropTypes.number,
|
|
184
|
-
seriesId: PropTypes.
|
|
184
|
+
seriesId: PropTypes.string,
|
|
185
185
|
type: PropTypes.oneOf(['pie']).isRequired
|
|
186
186
|
})),
|
|
187
187
|
/**
|
|
@@ -260,7 +260,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
|
260
260
|
*/
|
|
261
261
|
tooltipItem: PropTypes.shape({
|
|
262
262
|
dataIndex: PropTypes.number.isRequired,
|
|
263
|
-
seriesId: PropTypes.
|
|
263
|
+
seriesId: PropTypes.string.isRequired,
|
|
264
264
|
type: PropTypes.oneOf(['pie']).isRequired
|
|
265
265
|
}),
|
|
266
266
|
/**
|
|
@@ -5,7 +5,7 @@ import { type ChartsToolbarProSlotProps, type ChartsToolbarProSlots } from "../C
|
|
|
5
5
|
import { type ChartsSlotPropsPro, type ChartsSlotsPro } from "../internals/material/index.js";
|
|
6
6
|
export interface RadarChartProSlots extends Omit<RadarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
7
7
|
export interface RadarChartProSlotProps extends Omit<RadarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
-
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps'
|
|
8
|
+
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<RadarDataProviderProps<RadarChartProPluginSignatures>, 'slots' | 'slotProps' | 'experimentalFeatures'> {
|
|
9
9
|
/**
|
|
10
10
|
* Overridable component slots.
|
|
11
11
|
* @default {}
|
|
@@ -110,7 +110,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
110
110
|
*/
|
|
111
111
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
112
112
|
dataIndex: PropTypes.number,
|
|
113
|
-
seriesId: PropTypes.
|
|
113
|
+
seriesId: PropTypes.string,
|
|
114
114
|
type: PropTypes.oneOf(['radar']).isRequired
|
|
115
115
|
})),
|
|
116
116
|
/**
|
|
@@ -128,7 +128,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
128
128
|
*/
|
|
129
129
|
highlightedItem: PropTypes.shape({
|
|
130
130
|
dataIndex: PropTypes.number,
|
|
131
|
-
seriesId: PropTypes.
|
|
131
|
+
seriesId: PropTypes.string.isRequired
|
|
132
132
|
}),
|
|
133
133
|
/**
|
|
134
134
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -158,7 +158,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
158
158
|
*/
|
|
159
159
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
160
160
|
dataIndex: PropTypes.number,
|
|
161
|
-
seriesId: PropTypes.
|
|
161
|
+
seriesId: PropTypes.string,
|
|
162
162
|
type: PropTypes.oneOf(['radar']).isRequired
|
|
163
163
|
})),
|
|
164
164
|
/**
|
|
@@ -278,7 +278,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
|
|
|
278
278
|
*/
|
|
279
279
|
tooltipItem: PropTypes.shape({
|
|
280
280
|
dataIndex: PropTypes.number,
|
|
281
|
-
seriesId: PropTypes.
|
|
281
|
+
seriesId: PropTypes.string.isRequired,
|
|
282
282
|
type: PropTypes.oneOf(['radar']).isRequired
|
|
283
283
|
}),
|
|
284
284
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartVisibilityManagerSignature, UseChartKeyboardNavigationSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
3
|
+
export type RadarChartProPluginSignatures = [UseChartTooltipSignature<'radar'>, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartVisibilityManagerSignature<'radar'>, UseChartProExportSignature];
|
|
4
4
|
export declare const RADAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<RadarChartProPluginSignatures>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RADAR_PLUGINS } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export const RADAR_CHART_PRO_PLUGINS = [
|
|
3
|
+
export const RADAR_CHART_PRO_PLUGINS = [...RADAR_PLUGINS, useChartProExport];
|
|
@@ -104,7 +104,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
104
104
|
*/
|
|
105
105
|
highlightedItem: PropTypes.oneOfType([PropTypes.shape({
|
|
106
106
|
nodeId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
107
|
-
seriesId: PropTypes.
|
|
107
|
+
seriesId: PropTypes.string.isRequired,
|
|
108
108
|
subType: PropTypes.oneOf([
|
|
109
109
|
/**
|
|
110
110
|
* Subtype to differentiate between node and link
|
|
@@ -112,7 +112,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
112
112
|
'node']).isRequired,
|
|
113
113
|
type: PropTypes.oneOf(['sankey']).isRequired
|
|
114
114
|
}), PropTypes.shape({
|
|
115
|
-
seriesId: PropTypes.
|
|
115
|
+
seriesId: PropTypes.string.isRequired,
|
|
116
116
|
sourceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
117
117
|
subType: PropTypes.oneOf([
|
|
118
118
|
/**
|
|
@@ -196,7 +196,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
196
196
|
*/
|
|
197
197
|
tooltipItem: PropTypes.oneOfType([PropTypes.shape({
|
|
198
198
|
nodeId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
199
|
-
seriesId: PropTypes.
|
|
199
|
+
seriesId: PropTypes.string.isRequired,
|
|
200
200
|
subType: PropTypes.oneOf([
|
|
201
201
|
/**
|
|
202
202
|
* Subtype to differentiate between node and link
|
|
@@ -204,7 +204,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
204
204
|
'node']).isRequired,
|
|
205
205
|
type: PropTypes.oneOf(['sankey']).isRequired
|
|
206
206
|
}), PropTypes.shape({
|
|
207
|
-
seriesId: PropTypes.
|
|
207
|
+
seriesId: PropTypes.string.isRequired,
|
|
208
208
|
sourceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
209
209
|
subType: PropTypes.oneOf([
|
|
210
210
|
/**
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { type ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
|
|
1
|
+
import { type ChartsTooltipContainerProps, type ChartsTooltipClasses, type ChartsTooltipSlots, type ChartsTooltipSlotProps } from '@mui/x-charts/ChartsTooltip';
|
|
2
|
+
export interface SankeyTooltipSlots extends ChartsTooltipSlots {}
|
|
3
|
+
export interface SankeyTooltipSlotProps extends ChartsTooltipSlotProps {}
|
|
4
|
+
export interface SankeyTooltipClasses extends ChartsTooltipClasses {}
|
|
5
|
+
export interface SankeyTooltipContentClasses extends ChartsTooltipClasses {}
|
|
2
6
|
export interface SankeyTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
|
|
3
7
|
/**
|
|
4
8
|
* Select the kind of tooltip to display
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./SankeyTooltip.js";
|
|
2
2
|
export * from "./SankeyTooltipContent.js";
|
|
3
|
-
export type { SankeyTooltipProps } from "./SankeyTooltip.types.js";
|
|
3
|
+
export type { SankeyTooltipProps, SankeyTooltipClasses, SankeyTooltipContentClasses, SankeyTooltipSlots, SankeyTooltipSlotProps } from "./SankeyTooltip.types.js";
|
|
@@ -14,4 +14,4 @@ export * from "./sankeyHighlightHooks.js";
|
|
|
14
14
|
export * from "../hooks/useSankeySeries.js";
|
|
15
15
|
export { type SankeyPlotClasses, sankeyPlotClasses } from "./sankeyClasses.js";
|
|
16
16
|
export { SankeyTooltip, SankeyTooltipContent } from "./SankeyTooltip/index.js";
|
|
17
|
-
export type { SankeyTooltipProps } from "./SankeyTooltip/index.js";
|
|
17
|
+
export type { SankeyTooltipProps, SankeyTooltipClasses, SankeyTooltipContentClasses, SankeyTooltipSlots, SankeyTooltipSlotProps } from "./SankeyTooltip/index.js";
|
|
@@ -4,28 +4,28 @@ import type { SankeyLinkFade, SankeyLinkHighlight, SankeyNodeFade, SankeyNodeHig
|
|
|
4
4
|
* Get the node highlight configuration from the Sankey series.
|
|
5
5
|
* Defaults to 'nodes' if not specified.
|
|
6
6
|
*/
|
|
7
|
-
export declare const selectorNodeHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
|
+
export declare const selectorNodeHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
8
8
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
9
9
|
}) => SankeyNodeHighlight;
|
|
10
10
|
/**
|
|
11
11
|
* Get the node fade configuration from the Sankey series.
|
|
12
12
|
* Defaults to 'none' if not specified.
|
|
13
13
|
*/
|
|
14
|
-
export declare const selectorNodeFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
14
|
+
export declare const selectorNodeFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
15
15
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
16
16
|
}) => SankeyNodeFade;
|
|
17
17
|
/**
|
|
18
18
|
* Get the link highlight configuration from the Sankey series.
|
|
19
19
|
* Defaults to 'links' if not specified.
|
|
20
20
|
*/
|
|
21
|
-
export declare const selectorLinkHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
21
|
+
export declare const selectorLinkHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
22
22
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
23
23
|
}) => SankeyLinkHighlight;
|
|
24
24
|
/**
|
|
25
25
|
* Get the link fade configuration from the Sankey series.
|
|
26
26
|
* Defaults to 'none' if not specified.
|
|
27
27
|
*/
|
|
28
|
-
export declare const selectorLinkFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
28
|
+
export declare const selectorLinkFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
29
29
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
30
30
|
}) => SankeyLinkFade;
|
|
31
31
|
/**
|
|
@@ -40,7 +40,7 @@ export declare const selectorSankeyHighlightedItem: (args_0: import("./useSankey
|
|
|
40
40
|
* - It's the highlighted node (unless highlight mode is 'none')
|
|
41
41
|
* - It's connected to a highlighted link (based on linkOptions.highlight)
|
|
42
42
|
*/
|
|
43
|
-
export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
43
|
+
export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
44
44
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
45
45
|
}, nodeId: SankeyNodeId) => boolean;
|
|
46
46
|
/**
|
|
@@ -49,7 +49,7 @@ export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/i
|
|
|
49
49
|
* - It's the highlighted link (unless highlight mode is 'none')
|
|
50
50
|
* - It's connected to a highlighted node (based on nodeOptions.highlight)
|
|
51
51
|
*/
|
|
52
|
-
export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
52
|
+
export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
53
53
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
54
54
|
}, link: import("../index.js").SankeyLayoutLinkWithPosition) => boolean;
|
|
55
55
|
/**
|
|
@@ -59,6 +59,6 @@ export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/i
|
|
|
59
59
|
* - This item is not highlighted
|
|
60
60
|
* - The fade mode is 'global' for the highlighted element type
|
|
61
61
|
*/
|
|
62
|
-
export declare const selectorIsSankeyItemFaded: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
62
|
+
export declare const selectorIsSankeyItemFaded: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
|
|
63
63
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
64
64
|
}, isHighlighted: boolean) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SeriesId } from '@mui/x-charts/internals';
|
|
2
2
|
import type { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
3
3
|
import type { SankeyLink as D3SankeyLink, SankeyNode as D3SankeyNode } from "./d3Sankey/index.js";
|
|
4
|
-
import type { SankeyLinkHighlightScope, SankeyNodeHighlightScope } from "./sankey.highlight.types.js";
|
|
4
|
+
import type { SankeyHighlightScope, SankeyLinkHighlightScope, SankeyNodeHighlightScope } from "./sankey.highlight.types.js";
|
|
5
5
|
export type SankeyNodeId = string | number;
|
|
6
6
|
export interface SankeyNode {
|
|
7
7
|
/**
|
|
@@ -216,7 +216,10 @@ export interface SankeyLayout<WithPosition extends boolean = true> {
|
|
|
216
216
|
}
|
|
217
217
|
export interface DefaultizedSankeySeriesType extends DefaultizedProps<Omit<SankeySeriesType, 'data'>, 'id' | 'valueFormatter'> {
|
|
218
218
|
data: SankeyLayout<false>;
|
|
219
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Highlight scope for the series derived from nodeOptions and linksOptions
|
|
221
|
+
*/
|
|
222
|
+
highlightScope: SankeyHighlightScope;
|
|
220
223
|
}
|
|
221
224
|
type SankeyNodeIdentifierBase = {
|
|
222
225
|
type: 'sankey';
|
|
@@ -54,6 +54,16 @@ export const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
|
54
54
|
color: resolvedColor
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
|
+
const highlightScope = {
|
|
58
|
+
nodes: {
|
|
59
|
+
highlight: seriesData.nodeOptions?.highlight ?? 'links',
|
|
60
|
+
fade: seriesData.nodeOptions?.fade ?? 'none'
|
|
61
|
+
},
|
|
62
|
+
links: {
|
|
63
|
+
highlight: seriesData.linkOptions?.highlight ?? 'links',
|
|
64
|
+
fade: seriesData.linkOptions?.fade ?? 'none'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
57
67
|
if (!seriesData.data || !links) {
|
|
58
68
|
return _extends({
|
|
59
69
|
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
@@ -62,7 +72,8 @@ export const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
|
62
72
|
data: {
|
|
63
73
|
nodes: [],
|
|
64
74
|
links: []
|
|
65
|
-
}
|
|
75
|
+
},
|
|
76
|
+
highlightScope
|
|
66
77
|
});
|
|
67
78
|
}
|
|
68
79
|
|
|
@@ -93,6 +104,7 @@ export const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
|
93
104
|
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
94
105
|
}, seriesData, {
|
|
95
106
|
valueFormatter: seriesData.valueFormatter ?? defaultSankeyValueFormatter,
|
|
107
|
+
highlightScope,
|
|
96
108
|
data
|
|
97
109
|
});
|
|
98
110
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const identifierCleaner = identifier => {
|
|
2
|
+
if (identifier.subType === 'node') {
|
|
3
|
+
return {
|
|
4
|
+
type: identifier.type,
|
|
5
|
+
seriesId: identifier.seriesId,
|
|
6
|
+
subType: 'node',
|
|
7
|
+
nodeId: identifier.nodeId
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
type: identifier.type,
|
|
12
|
+
seriesId: identifier.seriesId,
|
|
13
|
+
subType: 'link',
|
|
14
|
+
sourceId: identifier.sourceId,
|
|
15
|
+
targetId: identifier.targetId
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default identifierCleaner;
|
|
@@ -4,6 +4,7 @@ import { calculateSankeyLayout } from "../calculateSankeyLayout.js";
|
|
|
4
4
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
5
5
|
import keyboardFocusHandler from "./keyboardFocusHandler.js";
|
|
6
6
|
import identifierSerializer from "./identifierSerializer.js";
|
|
7
|
+
import identifierCleaner from "./identifierCleaner.js";
|
|
7
8
|
|
|
8
9
|
// Simple passthrough functions for sankey chart
|
|
9
10
|
const seriesProcessor = series => series;
|
|
@@ -28,5 +29,6 @@ export const sankeySeriesConfig = {
|
|
|
28
29
|
tooltipItemPositionGetter,
|
|
29
30
|
getSeriesWithDefaultValues,
|
|
30
31
|
keyboardFocusHandler,
|
|
31
|
-
identifierSerializer
|
|
32
|
+
identifierSerializer,
|
|
33
|
+
identifierCleaner
|
|
32
34
|
};
|
|
@@ -13,7 +13,7 @@ export interface ScatterChartProSlotProps extends Omit<ScatterChartSlotProps, 't
|
|
|
13
13
|
*/
|
|
14
14
|
tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
|
|
15
15
|
}
|
|
16
|
-
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | '
|
|
16
|
+
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps' | 'plugins' | 'seriesConfig'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginSignatures>, 'series' | 'onItemClick' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'> {
|
|
17
17
|
/**
|
|
18
18
|
* Overridable component slots.
|
|
19
19
|
* @default {}
|