@mui/x-charts-pro 9.0.0-alpha.2 → 9.0.0-alpha.4
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.mts +2 -2
- package/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +43 -10
- package/BarChartPro/BarChartPro.mjs +43 -10
- package/CHANGELOG.md +246 -1
- package/ChartsContainerPro/ChartsContainerPro.d.mts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.d.ts +2 -2
- package/ChartsContainerPro/ChartsContainerPro.js +2 -2
- package/ChartsContainerPro/ChartsContainerPro.mjs +2 -2
- package/ChartsContainerPro/useChartsContainerProProps.d.mts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +4 -4
- package/ChartsContainerPro/useChartsContainerProProps.js +3 -3
- package/ChartsContainerPro/useChartsContainerProProps.mjs +3 -3
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.mts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +2 -2
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +8 -11
- package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +8 -11
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.mts +1 -1
- package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.mjs +2 -2
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.mjs +2 -2
- package/ChartsToolbarPro/index.d.mts +2 -1
- package/ChartsToolbarPro/index.d.ts +2 -1
- package/ChartsToolbarPro/index.mjs +2 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderActiveTrack.mjs +2 -2
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.js +1 -1
- package/ChartsZoomSlider/internals/ChartsAxisZoomSliderTrack.mjs +2 -2
- package/FunnelChart/FunnelChart.d.mts +2 -2
- package/FunnelChart/FunnelChart.d.ts +2 -2
- package/FunnelChart/FunnelChart.js +23 -8
- package/FunnelChart/FunnelChart.mjs +23 -8
- package/FunnelChart/FunnelPlot.js +8 -3
- package/FunnelChart/FunnelPlot.mjs +8 -3
- package/FunnelChart/FunnelSection.d.mts +3 -3
- package/FunnelChart/FunnelSection.d.ts +3 -3
- package/FunnelChart/FunnelSection.js +8 -9
- package/FunnelChart/FunnelSection.mjs +8 -9
- package/FunnelChart/FunnelSectionLabel.d.mts +9 -3
- package/FunnelChart/FunnelSectionLabel.d.ts +9 -3
- package/FunnelChart/FunnelSectionLabel.js +15 -6
- package/FunnelChart/FunnelSectionLabel.mjs +15 -6
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.mts +3 -3
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +3 -3
- package/FunnelChart/funnelClasses.d.mts +29 -0
- package/FunnelChart/funnelClasses.d.ts +29 -0
- package/FunnelChart/funnelClasses.js +29 -0
- package/FunnelChart/funnelClasses.mjs +19 -0
- package/FunnelChart/index.d.mts +2 -2
- package/FunnelChart/index.d.ts +2 -2
- package/FunnelChart/index.js +4 -4
- package/FunnelChart/index.mjs +1 -1
- package/FunnelChart/seriesConfig/legend.js +0 -2
- package/FunnelChart/seriesConfig/legend.mjs +0 -2
- package/FunnelChart/useFunnelChartProps.d.mts +2 -2
- package/FunnelChart/useFunnelChartProps.d.ts +2 -2
- package/FunnelChart/useFunnelChartProps.js +2 -2
- package/FunnelChart/useFunnelChartProps.mjs +2 -2
- package/Heatmap/Heatmap.d.mts +2 -11
- package/Heatmap/Heatmap.d.ts +2 -11
- package/Heatmap/Heatmap.js +25 -19
- package/Heatmap/Heatmap.mjs +25 -19
- package/Heatmap/HeatmapCell.d.mts +33 -0
- package/Heatmap/HeatmapCell.d.ts +33 -0
- package/Heatmap/HeatmapCell.js +62 -0
- package/Heatmap/HeatmapCell.mjs +55 -0
- package/Heatmap/HeatmapItem.d.mts +1 -9
- package/Heatmap/HeatmapItem.d.ts +1 -9
- package/Heatmap/HeatmapItem.js +5 -23
- package/Heatmap/HeatmapItem.mjs +5 -23
- package/Heatmap/HeatmapSVGPlot.js +14 -7
- package/Heatmap/HeatmapSVGPlot.mjs +15 -8
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +2 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.mjs +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +16 -13
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +16 -13
- package/Heatmap/heatmapClasses.d.mts +6 -1
- package/Heatmap/heatmapClasses.d.ts +6 -1
- package/Heatmap/heatmapClasses.js +18 -3
- package/Heatmap/heatmapClasses.mjs +16 -2
- package/Heatmap/index.d.mts +4 -2
- package/Heatmap/index.d.ts +4 -2
- package/Heatmap/index.js +17 -13
- package/Heatmap/index.mjs +2 -1
- package/Heatmap/seriesConfig/getColor.js +5 -3
- package/Heatmap/seriesConfig/getColor.mjs +5 -3
- package/Heatmap/seriesConfig/getItemAtPosition.d.mts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.js +3 -11
- package/Heatmap/seriesConfig/getItemAtPosition.mjs +3 -11
- package/Heatmap/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierCleaner.js +15 -0
- package/Heatmap/seriesConfig/identifierCleaner.mjs +9 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Heatmap/seriesConfig/identifierSerializer.js +11 -0
- package/Heatmap/seriesConfig/identifierSerializer.mjs +5 -0
- package/Heatmap/seriesConfig/index.js +4 -2
- package/Heatmap/seriesConfig/index.mjs +5 -3
- package/Heatmap/seriesConfig/keyboardFocusHandler.js +6 -19
- package/Heatmap/seriesConfig/keyboardFocusHandler.mjs +6 -19
- package/Heatmap/seriesConfig/seriesProcessor.js +8 -3
- package/Heatmap/seriesConfig/seriesProcessor.mjs +8 -3
- package/Heatmap/seriesConfig/tooltip.js +7 -6
- package/Heatmap/seriesConfig/tooltip.mjs +7 -6
- package/Heatmap/seriesConfig/tooltipPosition.js +3 -4
- package/Heatmap/seriesConfig/tooltipPosition.mjs +3 -4
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.js +1 -1
- package/Heatmap/shouldRegisterPointerInteractionsGlobally.mjs +1 -1
- package/Heatmap/useHeatmapProps.d.mts +2 -2
- package/Heatmap/useHeatmapProps.d.ts +2 -2
- package/Heatmap/useHeatmapProps.js +4 -6
- package/Heatmap/useHeatmapProps.mjs +4 -6
- package/LineChartPro/LineChartPro.d.mts +2 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +40 -13
- package/LineChartPro/LineChartPro.mjs +40 -13
- package/PieChartPro/PieChartPro.d.mts +2 -2
- package/PieChartPro/PieChartPro.d.ts +2 -2
- package/PieChartPro/PieChartPro.js +22 -7
- package/PieChartPro/PieChartPro.mjs +22 -7
- package/RadarChartPro/RadarChartPro.d.mts +1 -1
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +20 -2
- package/RadarChartPro/RadarChartPro.mjs +20 -2
- package/SankeyChart/SankeyChart.d.mts +2 -2
- package/SankeyChart/SankeyChart.d.ts +2 -2
- package/SankeyChart/SankeyChart.js +21 -12
- package/SankeyChart/SankeyChart.mjs +21 -12
- package/SankeyChart/SankeyDataProvider.d.mts +2 -2
- package/SankeyChart/SankeyDataProvider.d.ts +2 -2
- package/SankeyChart/SankeyDataProvider.js +2 -2
- package/SankeyChart/SankeyDataProvider.mjs +2 -2
- package/SankeyChart/SankeyLinkElement.js +7 -3
- package/SankeyChart/SankeyLinkElement.mjs +8 -4
- package/SankeyChart/SankeyLinkLabel.js +3 -0
- package/SankeyChart/SankeyLinkLabel.mjs +3 -0
- package/SankeyChart/SankeyLinkLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkLabelPlot.js +1 -1
- package/SankeyChart/SankeyLinkLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyLinkPlot.d.mts +2 -2
- package/SankeyChart/SankeyLinkPlot.d.ts +2 -2
- package/SankeyChart/SankeyLinkPlot.js +1 -1
- package/SankeyChart/SankeyLinkPlot.mjs +1 -1
- package/SankeyChart/SankeyNodeElement.d.mts +1 -1
- package/SankeyChart/SankeyNodeElement.d.ts +1 -1
- package/SankeyChart/SankeyNodeElement.js +20 -18
- package/SankeyChart/SankeyNodeElement.mjs +21 -19
- package/SankeyChart/SankeyNodeLabel.js +3 -0
- package/SankeyChart/SankeyNodeLabel.mjs +3 -0
- package/SankeyChart/SankeyNodeLabelPlot.d.mts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.d.ts +2 -2
- package/SankeyChart/SankeyNodeLabelPlot.js +1 -1
- package/SankeyChart/SankeyNodeLabelPlot.mjs +1 -1
- package/SankeyChart/SankeyNodePlot.d.mts +2 -2
- package/SankeyChart/SankeyNodePlot.d.ts +2 -2
- package/SankeyChart/SankeyNodePlot.js +1 -1
- package/SankeyChart/SankeyNodePlot.mjs +1 -1
- package/SankeyChart/SankeyPlot.d.mts +2 -2
- package/SankeyChart/SankeyPlot.d.ts +2 -2
- package/SankeyChart/SankeyPlot.js +3 -3
- package/SankeyChart/SankeyPlot.mjs +3 -3
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.js +2 -2
- package/SankeyChart/SankeyTooltip/SankeyTooltip.classes.mjs +1 -1
- package/SankeyChart/index.d.mts +2 -1
- package/SankeyChart/index.d.ts +2 -1
- package/SankeyChart/index.js +3 -3
- package/SankeyChart/index.mjs +1 -1
- package/SankeyChart/sankeyClasses.d.mts +15 -6
- package/SankeyChart/sankeyClasses.d.ts +15 -6
- package/SankeyChart/sankeyClasses.js +12 -8
- package/SankeyChart/sankeyClasses.mjs +10 -6
- package/SankeyChart/sankeyHighlightHooks.d.mts +2 -2
- package/SankeyChart/sankeyHighlightHooks.d.ts +2 -2
- package/SankeyChart/sankeyHighlightHooks.js +2 -10
- package/SankeyChart/sankeyHighlightHooks.mjs +3 -11
- package/SankeyChart/useSankeyChartProps.d.mts +2 -2
- package/SankeyChart/useSankeyChartProps.d.ts +2 -2
- package/SankeyChart/useSankeyChartProps.js +2 -2
- package/SankeyChart/useSankeyChartProps.mjs +2 -2
- package/ScatterChartPro/ScatterChartPro.d.mts +2 -2
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +62 -17
- package/ScatterChartPro/ScatterChartPro.mjs +62 -17
- package/context/useChartProApiContext.d.mts +1 -1
- package/context/useChartProApiContext.d.ts +1 -1
- package/context/useChartProApiContext.js +1 -1
- package/context/useChartProApiContext.mjs +1 -1
- package/index.d.mts +0 -4
- package/index.d.ts +0 -4
- package/index.js +2 -34
- package/index.mjs +1 -4
- package/internals/ChartsWatermark.d.mts +2 -2
- package/internals/ChartsWatermark.d.ts +2 -2
- package/internals/ChartsWatermark.js +5 -8
- package/internals/ChartsWatermark.mjs +3 -6
- package/internals/index.d.mts +0 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -8
- package/internals/index.mjs +0 -1
- package/internals/plugins/allPlugins.d.mts +4 -4
- package/internals/plugins/allPlugins.d.ts +4 -4
- package/internals/plugins/useChartProExport/common.js +4 -8
- package/internals/plugins/useChartProExport/common.mjs +4 -8
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProExport/exportImage.mjs +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.mts +1 -1
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +16 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.mjs +16 -1
- package/models/seriesType/heatmap.d.mts +36 -9
- package/models/seriesType/heatmap.d.ts +36 -9
- package/models/seriesType/heatmap.js +28 -1
- package/models/seriesType/heatmap.mjs +25 -1
- package/package.json +5 -61
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.mts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +2 -2
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +4 -4
- package/plugins/selectors/useChartHeatmapPosition.selectors.mjs +4 -4
- package/themeAugmentation/components.d.mts +19 -1
- package/themeAugmentation/components.d.ts +19 -1
- package/themeAugmentation/overrides.d.mts +5 -2
- package/themeAugmentation/overrides.d.ts +5 -2
- package/themeAugmentation/props.d.mts +8 -0
- package/themeAugmentation/props.d.ts +8 -0
- package/typeOverloads/modules.d.mts +2 -2
- package/typeOverloads/modules.d.ts +2 -2
- package/ChartContainer/index.d.mts +0 -1
- package/ChartContainer/index.d.ts +0 -1
- package/ChartContainer/index.js +0 -16
- package/ChartContainer/index.mjs +0 -2
- package/ChartContainerPro/ChartContainerPro.d.mts +0 -21
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -21
- package/ChartContainerPro/ChartContainerPro.js +0 -24
- package/ChartContainerPro/ChartContainerPro.mjs +0 -20
- package/ChartContainerPro/index.d.mts +0 -9
- package/ChartContainerPro/index.d.ts +0 -9
- package/ChartContainerPro/index.js +0 -17
- package/ChartContainerPro/index.mjs +0 -6
- package/ChartContainerPro/useChartContainerProProps.d.mts +0 -12
- package/ChartContainerPro/useChartContainerProProps.d.ts +0 -12
- package/ChartContainerPro/useChartContainerProProps.js +0 -19
- package/ChartContainerPro/useChartContainerProProps.mjs +0 -14
- package/ChartDataProvider/index.d.mts +0 -1
- package/ChartDataProvider/index.d.ts +0 -1
- package/ChartDataProvider/index.js +0 -16
- package/ChartDataProvider/index.mjs +0 -2
- package/ChartDataProviderPro/ChartDataProviderPro.d.mts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -20
- package/ChartDataProviderPro/ChartDataProviderPro.js +0 -30
- package/ChartDataProviderPro/ChartDataProviderPro.mjs +0 -21
- package/ChartDataProviderPro/index.d.mts +0 -2
- package/ChartDataProviderPro/index.d.ts +0 -2
- package/ChartDataProviderPro/index.js +0 -13
- package/ChartDataProviderPro/index.mjs +0 -2
- package/ChartDataProviderPro/useChartDataProviderProProps.d.mts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -10
- package/ChartDataProviderPro/useChartDataProviderProProps.js +0 -12
- package/ChartDataProviderPro/useChartDataProviderProProps.mjs +0 -8
- package/FunnelChart/funnelSectionClasses.d.mts +0 -30
- package/FunnelChart/funnelSectionClasses.d.ts +0 -30
- package/FunnelChart/funnelSectionClasses.js +0 -44
- package/FunnelChart/funnelSectionClasses.mjs +0 -35
- package/Heatmap/internals/HeatmapCell.d.mts +0 -21
- package/Heatmap/internals/HeatmapCell.d.ts +0 -21
- package/Heatmap/internals/HeatmapCell.js +0 -18
- package/Heatmap/internals/HeatmapCell.mjs +0 -12
- package/tests/constants.js +0 -7
- package/tests/constants.mjs +0 -1
|
@@ -15,7 +15,7 @@ var _styles = require("@mui/material/styles");
|
|
|
15
15
|
var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
|
|
16
16
|
var _ChartsOverlay = require("@mui/x-charts/ChartsOverlay");
|
|
17
17
|
var _ChartsWrapper = require("@mui/x-charts/ChartsWrapper");
|
|
18
|
-
var
|
|
18
|
+
var _useChartsContainerProProps = require("../ChartsContainerPro/useChartsContainerProProps");
|
|
19
19
|
var _SankeyPlot = require("./SankeyPlot");
|
|
20
20
|
var _useSankeyChartProps = require("./useSankeyChartProps");
|
|
21
21
|
var _SankeyTooltip = require("./SankeyTooltip");
|
|
@@ -44,24 +44,24 @@ const SankeyChart = exports.SankeyChart = /*#__PURE__*/React.forwardRef(function
|
|
|
44
44
|
name: 'MuiSankeyChart'
|
|
45
45
|
});
|
|
46
46
|
const {
|
|
47
|
-
|
|
47
|
+
chartsContainerProps,
|
|
48
48
|
sankeyPlotProps,
|
|
49
49
|
overlayProps,
|
|
50
50
|
chartsWrapperProps,
|
|
51
51
|
children
|
|
52
52
|
} = (0, _useSankeyChartProps.useSankeyChartProps)(themedProps);
|
|
53
|
-
const
|
|
53
|
+
const _useChartsContainerPr = (0, _useChartsContainerProProps.useChartsContainerProProps)(chartsContainerProps),
|
|
54
54
|
{
|
|
55
|
-
|
|
55
|
+
chartsDataProviderProProps: {
|
|
56
56
|
series
|
|
57
57
|
},
|
|
58
58
|
chartsSurfaceProps
|
|
59
|
-
} =
|
|
60
|
-
|
|
59
|
+
} = _useChartsContainerPr,
|
|
60
|
+
chartsDataProviderProProps = (0, _objectWithoutPropertiesLoose2.default)(_useChartsContainerPr.chartsDataProviderProProps, _excluded);
|
|
61
61
|
const Tooltip = themedProps.slots?.tooltip ?? _SankeyTooltip.SankeyTooltip;
|
|
62
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SankeyDataProvider.SankeyDataProvider, (0, _extends2.default)({
|
|
63
63
|
series: series
|
|
64
|
-
},
|
|
64
|
+
}, chartsDataProviderProProps, {
|
|
65
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
66
66
|
ref: ref,
|
|
67
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
@@ -94,14 +94,19 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
94
94
|
* @default rainbowSurgePalette
|
|
95
95
|
*/
|
|
96
96
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
97
|
+
/**
|
|
98
|
+
* The description of the chart.
|
|
99
|
+
* Used to provide an accessible description for the chart.
|
|
100
|
+
*/
|
|
97
101
|
desc: _propTypes.default.string,
|
|
98
|
-
|
|
102
|
+
/**
|
|
103
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
104
|
+
*/
|
|
105
|
+
disableKeyboardNavigation: _propTypes.default.bool,
|
|
99
106
|
/**
|
|
100
107
|
* Options to enable features planned for the next major.
|
|
101
108
|
*/
|
|
102
|
-
experimentalFeatures: _propTypes.default.
|
|
103
|
-
preferStrictDomainInLineCharts: _propTypes.default.bool
|
|
104
|
-
}),
|
|
109
|
+
experimentalFeatures: _propTypes.default.object,
|
|
105
110
|
/**
|
|
106
111
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
107
112
|
*/
|
|
@@ -194,7 +199,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
194
199
|
/**
|
|
195
200
|
* The callback fired when the tooltip item changes.
|
|
196
201
|
*
|
|
197
|
-
* @param {SeriesItemIdentifier<
|
|
202
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
198
203
|
*/
|
|
199
204
|
onTooltipItemChange: _propTypes.default.func,
|
|
200
205
|
/**
|
|
@@ -214,6 +219,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
214
219
|
slots: _propTypes.default.object,
|
|
215
220
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
216
221
|
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
222
|
+
/**
|
|
223
|
+
* The title of the chart.
|
|
224
|
+
* Used to provide an accessible label for the chart.
|
|
225
|
+
*/
|
|
217
226
|
title: _propTypes.default.string,
|
|
218
227
|
/**
|
|
219
228
|
* The tooltip item.
|
|
@@ -9,7 +9,7 @@ import { useThemeProps } from '@mui/material/styles';
|
|
|
9
9
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
10
10
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
11
11
|
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
12
|
-
import {
|
|
12
|
+
import { useChartsContainerProProps } from "../ChartsContainerPro/useChartsContainerProProps.mjs";
|
|
13
13
|
import { SankeyPlot } from "./SankeyPlot.mjs";
|
|
14
14
|
import { useSankeyChartProps } from "./useSankeyChartProps.mjs";
|
|
15
15
|
import { SankeyTooltip } from "./SankeyTooltip/index.mjs";
|
|
@@ -37,24 +37,24 @@ const SankeyChart = /*#__PURE__*/React.forwardRef(function SankeyChart(props, re
|
|
|
37
37
|
name: 'MuiSankeyChart'
|
|
38
38
|
});
|
|
39
39
|
const {
|
|
40
|
-
|
|
40
|
+
chartsContainerProps,
|
|
41
41
|
sankeyPlotProps,
|
|
42
42
|
overlayProps,
|
|
43
43
|
chartsWrapperProps,
|
|
44
44
|
children
|
|
45
45
|
} = useSankeyChartProps(themedProps);
|
|
46
|
-
const
|
|
46
|
+
const _useChartsContainerPr = useChartsContainerProProps(chartsContainerProps),
|
|
47
47
|
{
|
|
48
|
-
|
|
48
|
+
chartsDataProviderProProps: {
|
|
49
49
|
series
|
|
50
50
|
},
|
|
51
51
|
chartsSurfaceProps
|
|
52
|
-
} =
|
|
53
|
-
|
|
52
|
+
} = _useChartsContainerPr,
|
|
53
|
+
chartsDataProviderProProps = _objectWithoutPropertiesLoose(_useChartsContainerPr.chartsDataProviderProProps, _excluded);
|
|
54
54
|
const Tooltip = themedProps.slots?.tooltip ?? SankeyTooltip;
|
|
55
55
|
return /*#__PURE__*/_jsx(SankeyDataProvider, _extends({
|
|
56
56
|
series: series
|
|
57
|
-
},
|
|
57
|
+
}, chartsDataProviderProProps, {
|
|
58
58
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
59
59
|
ref: ref,
|
|
60
60
|
children: [/*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
@@ -87,14 +87,19 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
87
87
|
* @default rainbowSurgePalette
|
|
88
88
|
*/
|
|
89
89
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
90
|
+
/**
|
|
91
|
+
* The description of the chart.
|
|
92
|
+
* Used to provide an accessible description for the chart.
|
|
93
|
+
*/
|
|
90
94
|
desc: PropTypes.string,
|
|
91
|
-
|
|
95
|
+
/**
|
|
96
|
+
* If `true`, disables keyboard navigation for the chart.
|
|
97
|
+
*/
|
|
98
|
+
disableKeyboardNavigation: PropTypes.bool,
|
|
92
99
|
/**
|
|
93
100
|
* Options to enable features planned for the next major.
|
|
94
101
|
*/
|
|
95
|
-
experimentalFeatures: PropTypes.
|
|
96
|
-
preferStrictDomainInLineCharts: PropTypes.bool
|
|
97
|
-
}),
|
|
102
|
+
experimentalFeatures: PropTypes.object,
|
|
98
103
|
/**
|
|
99
104
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
100
105
|
*/
|
|
@@ -187,7 +192,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
187
192
|
/**
|
|
188
193
|
* The callback fired when the tooltip item changes.
|
|
189
194
|
*
|
|
190
|
-
* @param {SeriesItemIdentifier<
|
|
195
|
+
* @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
|
|
191
196
|
*/
|
|
192
197
|
onTooltipItemChange: PropTypes.func,
|
|
193
198
|
/**
|
|
@@ -207,6 +212,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
|
|
|
207
212
|
slots: PropTypes.object,
|
|
208
213
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
209
214
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
215
|
+
/**
|
|
216
|
+
* The title of the chart.
|
|
217
|
+
* Used to provide an accessible label for the chart.
|
|
218
|
+
*/
|
|
210
219
|
title: PropTypes.string,
|
|
211
220
|
/**
|
|
212
221
|
* The tooltip item.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartsContainerProProps } from "../ChartsContainerPro/index.mjs";
|
|
3
3
|
import type { SankeySeriesType } from "./sankey.types.mjs";
|
|
4
4
|
import { type SankeyChartPluginSignatures } from "./SankeyChart.plugins.mjs";
|
|
5
|
-
export interface SankeyDataProviderProps extends Omit<
|
|
5
|
+
export interface SankeyDataProviderProps extends Omit<ChartsContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation'> {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
series: readonly SankeySeriesType[];
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChartsContainerProProps } from "../ChartsContainerPro/index.js";
|
|
3
3
|
import type { SankeySeriesType } from "./sankey.types.js";
|
|
4
4
|
import { type SankeyChartPluginSignatures } from "./SankeyChart.plugins.js";
|
|
5
|
-
export interface SankeyDataProviderProps extends Omit<
|
|
5
|
+
export interface SankeyDataProviderProps extends Omit<ChartsContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation'> {
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
series: readonly SankeySeriesType[];
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ exports.SankeyDataProvider = SankeyDataProvider;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _SankeyChart = require("./SankeyChart.plugins");
|
|
13
|
-
var
|
|
13
|
+
var _ChartsDataProviderPro = require("../ChartsDataProviderPro");
|
|
14
14
|
var _seriesConfig = require("./seriesConfig");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const seriesConfig = {
|
|
@@ -26,7 +26,7 @@ const seriesConfig = {
|
|
|
26
26
|
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
27
27
|
*/
|
|
28
28
|
function SankeyDataProvider(props) {
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsDataProviderPro.ChartsDataProviderPro, (0, _extends2.default)({}, props, {
|
|
30
30
|
seriesConfig: seriesConfig,
|
|
31
31
|
plugins: _SankeyChart.SANKEY_CHART_PLUGINS
|
|
32
32
|
}));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { SANKEY_CHART_PLUGINS } from "./SankeyChart.plugins.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { ChartsDataProviderPro } from "../ChartsDataProviderPro/index.mjs";
|
|
7
7
|
import { sankeySeriesConfig } from "./seriesConfig/index.mjs";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const seriesConfig = {
|
|
@@ -19,7 +19,7 @@ const seriesConfig = {
|
|
|
19
19
|
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
20
20
|
*/
|
|
21
21
|
function SankeyDataProvider(props) {
|
|
22
|
-
return /*#__PURE__*/_jsx(
|
|
22
|
+
return /*#__PURE__*/_jsx(ChartsDataProviderPro, _extends({}, props, {
|
|
23
23
|
seriesConfig: seriesConfig,
|
|
24
24
|
plugins: SANKEY_CHART_PLUGINS
|
|
25
25
|
}));
|
|
@@ -11,6 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
|
|
15
|
+
var _sankeyClasses = require("./sankeyClasses");
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
17
|
/**
|
|
16
18
|
* @ignore - internal component.
|
|
@@ -22,7 +24,6 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
|
|
|
22
24
|
onClick,
|
|
23
25
|
seriesId
|
|
24
26
|
} = props;
|
|
25
|
-
const store = (0, _internals.useStore)();
|
|
26
27
|
const identifier = {
|
|
27
28
|
type: 'sankey',
|
|
28
29
|
seriesId,
|
|
@@ -31,11 +32,13 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
|
|
|
31
32
|
sourceId: link.source.id,
|
|
32
33
|
link
|
|
33
34
|
};
|
|
34
|
-
const
|
|
35
|
-
const isFaded =
|
|
35
|
+
const highlightState = (0, _sankeyHighlightHooks.useSankeyLinkHighlightState)(identifier);
|
|
36
|
+
const isFaded = highlightState === 'faded';
|
|
37
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
36
38
|
|
|
37
39
|
// Add interaction props for tooltips
|
|
38
40
|
const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
|
|
41
|
+
const classes = (0, _sankeyClasses.useUtilityClasses)();
|
|
39
42
|
const handleClick = (0, _useEventCallback.default)(event => {
|
|
40
43
|
onClick?.(event, identifier);
|
|
41
44
|
});
|
|
@@ -50,6 +53,7 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
|
|
|
50
53
|
}
|
|
51
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
|
|
52
55
|
ref: ref,
|
|
56
|
+
className: classes.link,
|
|
53
57
|
d: link.path,
|
|
54
58
|
fill: link.color,
|
|
55
59
|
opacity: finalOpacity,
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import {
|
|
6
|
+
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { useSankeyLinkHighlightState } from "./sankeyHighlightHooks.mjs";
|
|
8
|
+
import { useUtilityClasses } from "./sankeyClasses.mjs";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
/**
|
|
9
11
|
* @ignore - internal component.
|
|
@@ -15,7 +17,6 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
15
17
|
onClick,
|
|
16
18
|
seriesId
|
|
17
19
|
} = props;
|
|
18
|
-
const store = useStore();
|
|
19
20
|
const identifier = {
|
|
20
21
|
type: 'sankey',
|
|
21
22
|
seriesId,
|
|
@@ -24,11 +25,13 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
24
25
|
sourceId: link.source.id,
|
|
25
26
|
link
|
|
26
27
|
};
|
|
27
|
-
const
|
|
28
|
-
const isFaded =
|
|
28
|
+
const highlightState = useSankeyLinkHighlightState(identifier);
|
|
29
|
+
const isFaded = highlightState === 'faded';
|
|
30
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
29
31
|
|
|
30
32
|
// Add interaction props for tooltips
|
|
31
33
|
const interactionProps = useInteractionItemProps(identifier);
|
|
34
|
+
const classes = useUtilityClasses();
|
|
32
35
|
const handleClick = useEventCallback(event => {
|
|
33
36
|
onClick?.(event, identifier);
|
|
34
37
|
});
|
|
@@ -43,6 +46,7 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
43
46
|
}
|
|
44
47
|
return /*#__PURE__*/_jsx("path", _extends({
|
|
45
48
|
ref: ref,
|
|
49
|
+
className: classes.link,
|
|
46
50
|
d: link.path,
|
|
47
51
|
fill: link.color,
|
|
48
52
|
opacity: finalOpacity,
|
|
@@ -9,6 +9,7 @@ exports.SankeyLinkLabel = void 0;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _useSankeySeries = require("../hooks/useSankeySeries");
|
|
12
|
+
var _sankeyClasses = require("./sankeyClasses");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
const getLinkMidpoint = link => {
|
|
14
15
|
if (link.y0 === undefined || link.y1 === undefined) {
|
|
@@ -38,6 +39,7 @@ const SankeyLinkLabel = exports.SankeyLinkLabel = /*#__PURE__*/React.forwardRef(
|
|
|
38
39
|
} = props;
|
|
39
40
|
const theme = (0, _styles.useTheme)();
|
|
40
41
|
const series = (0, _useSankeySeries.useSankeySeries)()[0];
|
|
42
|
+
const classes = (0, _sankeyClasses.useUtilityClasses)();
|
|
41
43
|
if (!link.path || link.y0 === undefined || link.y1 === undefined) {
|
|
42
44
|
return null; // No path defined or invalid coordinates, nothing to render
|
|
43
45
|
}
|
|
@@ -52,6 +54,7 @@ const SankeyLinkLabel = exports.SankeyLinkLabel = /*#__PURE__*/React.forwardRef(
|
|
|
52
54
|
}) : link.value;
|
|
53
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
|
|
54
56
|
ref: ref,
|
|
57
|
+
className: classes.linkLabel,
|
|
55
58
|
x: midpoint.x,
|
|
56
59
|
y: midpoint.y,
|
|
57
60
|
textAnchor: "middle",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useTheme } from '@mui/material/styles';
|
|
5
5
|
import { useSankeySeries } from "../hooks/useSankeySeries.mjs";
|
|
6
|
+
import { useUtilityClasses } from "./sankeyClasses.mjs";
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
const getLinkMidpoint = link => {
|
|
8
9
|
if (link.y0 === undefined || link.y1 === undefined) {
|
|
@@ -32,6 +33,7 @@ export const SankeyLinkLabel = /*#__PURE__*/React.forwardRef(function SankeyLink
|
|
|
32
33
|
} = props;
|
|
33
34
|
const theme = useTheme();
|
|
34
35
|
const series = useSankeySeries()[0];
|
|
36
|
+
const classes = useUtilityClasses();
|
|
35
37
|
if (!link.path || link.y0 === undefined || link.y1 === undefined) {
|
|
36
38
|
return null; // No path defined or invalid coordinates, nothing to render
|
|
37
39
|
}
|
|
@@ -46,6 +48,7 @@ export const SankeyLinkLabel = /*#__PURE__*/React.forwardRef(function SankeyLink
|
|
|
46
48
|
}) : link.value;
|
|
47
49
|
return /*#__PURE__*/_jsx("text", {
|
|
48
50
|
ref: ref,
|
|
51
|
+
className: classes.linkLabel,
|
|
49
52
|
x: midpoint.x,
|
|
50
53
|
y: midpoint.y,
|
|
51
54
|
textAnchor: "middle",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SankeyClasses } from "./sankeyClasses.mjs";
|
|
2
2
|
export interface SankeyLinkLabelPlotProps {
|
|
3
3
|
/**
|
|
4
4
|
* Classes applied to the various elements.
|
|
5
5
|
*/
|
|
6
|
-
classes?: Partial<
|
|
6
|
+
classes?: Partial<SankeyClasses>;
|
|
7
7
|
}
|
|
8
8
|
declare function SankeyLinkLabelPlot(props: SankeyLinkLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
export { SankeyLinkLabelPlot };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SankeyClasses } from "./sankeyClasses.js";
|
|
2
2
|
export interface SankeyLinkLabelPlotProps {
|
|
3
3
|
/**
|
|
4
4
|
* Classes applied to the various elements.
|
|
5
5
|
*/
|
|
6
|
-
classes?: Partial<
|
|
6
|
+
classes?: Partial<SankeyClasses>;
|
|
7
7
|
}
|
|
8
8
|
declare function SankeyLinkLabelPlot(props: SankeyLinkLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
export { SankeyLinkLabelPlot };
|
|
@@ -21,7 +21,7 @@ function SankeyLinkLabelPlot(props) {
|
|
|
21
21
|
const sankeySeries = (0, _useSankeySeries.useSankeySeries)()[0];
|
|
22
22
|
const layout = (0, _useSankeySeries.useSankeyLayout)();
|
|
23
23
|
if (!sankeySeries) {
|
|
24
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured
|
|
24
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartsDataProviderPro.` : (0, _formatErrorMessage2.default)(46));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// Early return if no data or dimensions
|
|
@@ -15,7 +15,7 @@ function SankeyLinkLabelPlot(props) {
|
|
|
15
15
|
const sankeySeries = useSankeySeries()[0];
|
|
16
16
|
const layout = useSankeyLayout();
|
|
17
17
|
if (!sankeySeries) {
|
|
18
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured
|
|
18
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartsDataProviderPro.` : _formatErrorMessage(46));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// Early return if no data or dimensions
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SankeyLinkIdentifierWithData } from "./sankey.types.mjs";
|
|
3
|
-
import { type
|
|
3
|
+
import { type SankeyClasses } from "./sankeyClasses.mjs";
|
|
4
4
|
export interface SankeyLinkPlotProps {
|
|
5
5
|
/**
|
|
6
6
|
* Classes applied to the various elements.
|
|
7
7
|
*/
|
|
8
|
-
classes?: Partial<
|
|
8
|
+
classes?: Partial<SankeyClasses>;
|
|
9
9
|
/**
|
|
10
10
|
* Callback fired when a sankey item is clicked.
|
|
11
11
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { SankeyLinkIdentifierWithData } from "./sankey.types.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type SankeyClasses } from "./sankeyClasses.js";
|
|
4
4
|
export interface SankeyLinkPlotProps {
|
|
5
5
|
/**
|
|
6
6
|
* Classes applied to the various elements.
|
|
7
7
|
*/
|
|
8
|
-
classes?: Partial<
|
|
8
|
+
classes?: Partial<SankeyClasses>;
|
|
9
9
|
/**
|
|
10
10
|
* Callback fired when a sankey item is clicked.
|
|
11
11
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
@@ -37,7 +37,7 @@ function SankeyLinkPlot(props) {
|
|
|
37
37
|
const sankeySeries = (0, _useSankeySeries.useSankeySeries)()[0];
|
|
38
38
|
const layout = (0, _useSankeySeries.useSankeyLayout)();
|
|
39
39
|
if (!sankeySeries) {
|
|
40
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured
|
|
40
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartsDataProviderPro.` : (0, _formatErrorMessage2.default)(46));
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// Early return if no data or dimensions
|
|
@@ -30,7 +30,7 @@ function SankeyLinkPlot(props) {
|
|
|
30
30
|
const sankeySeries = useSankeySeries()[0];
|
|
31
31
|
const layout = useSankeyLayout();
|
|
32
32
|
if (!sankeySeries) {
|
|
33
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured
|
|
33
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Sankey series context is missing. Ensure the SankeyPlot is used inside a properly configured ChartsDataProviderPro.` : _formatErrorMessage(46));
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// Early return if no data or dimensions
|
|
@@ -20,4 +20,4 @@ export interface SankeyNodeElementProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @ignore - internal component.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<
|
|
23
|
+
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGRectElement>>;
|
|
@@ -20,4 +20,4 @@ export interface SankeyNodeElementProps {
|
|
|
20
20
|
/**
|
|
21
21
|
* @ignore - internal component.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<
|
|
23
|
+
export declare const SankeyNodeElement: React.ForwardRefExoticComponent<SankeyNodeElementProps & React.RefAttributes<SVGRectElement>>;
|
|
@@ -11,6 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
13
|
var _internals = require("@mui/x-charts/internals");
|
|
14
|
+
var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
|
|
15
|
+
var _sankeyClasses = require("./sankeyClasses");
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
17
|
/**
|
|
16
18
|
* @ignore - internal component.
|
|
@@ -21,7 +23,6 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
|
|
|
21
23
|
onClick,
|
|
22
24
|
seriesId
|
|
23
25
|
} = props;
|
|
24
|
-
const store = (0, _internals.useStore)();
|
|
25
26
|
const x0 = node.x0 ?? 0;
|
|
26
27
|
const y0 = node.y0 ?? 0;
|
|
27
28
|
const x1 = node.x1 ?? 0;
|
|
@@ -35,11 +36,13 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
|
|
|
35
36
|
nodeId: node.id,
|
|
36
37
|
node
|
|
37
38
|
};
|
|
38
|
-
const
|
|
39
|
-
const isFaded =
|
|
39
|
+
const highlightState = (0, _sankeyHighlightHooks.useSankeyNodeHighlightState)(identifier);
|
|
40
|
+
const isFaded = highlightState === 'faded';
|
|
41
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
40
42
|
|
|
41
43
|
// Add interaction props for tooltips
|
|
42
44
|
const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
|
|
45
|
+
const classes = (0, _sankeyClasses.useUtilityClasses)();
|
|
43
46
|
const handleClick = (0, _useEventCallback.default)(event => {
|
|
44
47
|
onClick?.(event, identifier);
|
|
45
48
|
});
|
|
@@ -49,22 +52,21 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
|
|
|
49
52
|
} else if (isHighlighted) {
|
|
50
53
|
opacity = 1;
|
|
51
54
|
}
|
|
52
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", (0, _extends2.default)({
|
|
56
|
+
x: node.x0,
|
|
57
|
+
y: node.y0,
|
|
58
|
+
width: nodeWidth,
|
|
59
|
+
height: nodeHeight,
|
|
60
|
+
fill: node.color,
|
|
61
|
+
opacity: opacity,
|
|
62
|
+
onClick: onClick ? handleClick : undefined,
|
|
63
|
+
cursor: onClick ? 'pointer' : 'default',
|
|
64
|
+
stroke: "none",
|
|
65
|
+
"data-highlighted": isHighlighted || undefined,
|
|
66
|
+
"data-faded": isFaded || undefined,
|
|
53
67
|
ref: ref,
|
|
54
68
|
"data-node": node.id,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
y: node.y0,
|
|
58
|
-
width: nodeWidth,
|
|
59
|
-
height: nodeHeight,
|
|
60
|
-
fill: node.color,
|
|
61
|
-
opacity: opacity,
|
|
62
|
-
onClick: onClick ? handleClick : undefined,
|
|
63
|
-
cursor: onClick ? 'pointer' : 'default',
|
|
64
|
-
stroke: "none",
|
|
65
|
-
"data-highlighted": isHighlighted || undefined,
|
|
66
|
-
"data-faded": isFaded || undefined
|
|
67
|
-
}, interactionProps))
|
|
68
|
-
});
|
|
69
|
+
className: classes.node
|
|
70
|
+
}, interactionProps));
|
|
69
71
|
});
|
|
70
72
|
if (process.env.NODE_ENV !== "production") SankeyNodeElement.displayName = "SankeyNodeElement";
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import {
|
|
6
|
+
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { useSankeyNodeHighlightState } from "./sankeyHighlightHooks.mjs";
|
|
8
|
+
import { useUtilityClasses } from "./sankeyClasses.mjs";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
/**
|
|
9
11
|
* @ignore - internal component.
|
|
@@ -14,7 +16,6 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
14
16
|
onClick,
|
|
15
17
|
seriesId
|
|
16
18
|
} = props;
|
|
17
|
-
const store = useStore();
|
|
18
19
|
const x0 = node.x0 ?? 0;
|
|
19
20
|
const y0 = node.y0 ?? 0;
|
|
20
21
|
const x1 = node.x1 ?? 0;
|
|
@@ -28,11 +29,13 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
28
29
|
nodeId: node.id,
|
|
29
30
|
node
|
|
30
31
|
};
|
|
31
|
-
const
|
|
32
|
-
const isFaded =
|
|
32
|
+
const highlightState = useSankeyNodeHighlightState(identifier);
|
|
33
|
+
const isFaded = highlightState === 'faded';
|
|
34
|
+
const isHighlighted = highlightState === 'highlighted';
|
|
33
35
|
|
|
34
36
|
// Add interaction props for tooltips
|
|
35
37
|
const interactionProps = useInteractionItemProps(identifier);
|
|
38
|
+
const classes = useUtilityClasses();
|
|
36
39
|
const handleClick = useEventCallback(event => {
|
|
37
40
|
onClick?.(event, identifier);
|
|
38
41
|
});
|
|
@@ -42,22 +45,21 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
42
45
|
} else if (isHighlighted) {
|
|
43
46
|
opacity = 1;
|
|
44
47
|
}
|
|
45
|
-
return /*#__PURE__*/_jsx("
|
|
48
|
+
return /*#__PURE__*/_jsx("rect", _extends({
|
|
49
|
+
x: node.x0,
|
|
50
|
+
y: node.y0,
|
|
51
|
+
width: nodeWidth,
|
|
52
|
+
height: nodeHeight,
|
|
53
|
+
fill: node.color,
|
|
54
|
+
opacity: opacity,
|
|
55
|
+
onClick: onClick ? handleClick : undefined,
|
|
56
|
+
cursor: onClick ? 'pointer' : 'default',
|
|
57
|
+
stroke: "none",
|
|
58
|
+
"data-highlighted": isHighlighted || undefined,
|
|
59
|
+
"data-faded": isFaded || undefined,
|
|
46
60
|
ref: ref,
|
|
47
61
|
"data-node": node.id,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
y: node.y0,
|
|
51
|
-
width: nodeWidth,
|
|
52
|
-
height: nodeHeight,
|
|
53
|
-
fill: node.color,
|
|
54
|
-
opacity: opacity,
|
|
55
|
-
onClick: onClick ? handleClick : undefined,
|
|
56
|
-
cursor: onClick ? 'pointer' : 'default',
|
|
57
|
-
stroke: "none",
|
|
58
|
-
"data-highlighted": isHighlighted || undefined,
|
|
59
|
-
"data-faded": isFaded || undefined
|
|
60
|
-
}, interactionProps))
|
|
61
|
-
});
|
|
62
|
+
className: classes.node
|
|
63
|
+
}, interactionProps));
|
|
62
64
|
});
|
|
63
65
|
if (process.env.NODE_ENV !== "production") SankeyNodeElement.displayName = "SankeyNodeElement";
|
|
@@ -9,6 +9,7 @@ exports.SankeyNodeLabel = void 0;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _styles = require("@mui/material/styles");
|
|
11
11
|
var _sankeyHighlightHooks = require("./sankeyHighlightHooks");
|
|
12
|
+
var _sankeyClasses = require("./sankeyClasses");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
/**
|
|
14
15
|
* @ignore - internal component.
|
|
@@ -30,6 +31,7 @@ const SankeyNodeLabel = exports.SankeyNodeLabel = /*#__PURE__*/React.forwardRef(
|
|
|
30
31
|
: x0 - 6; // Left side for other columns
|
|
31
32
|
|
|
32
33
|
const labelAnchor = isRightSide ? 'start' : 'end';
|
|
34
|
+
const classes = (0, _sankeyClasses.useUtilityClasses)();
|
|
33
35
|
const highlightState = (0, _sankeyHighlightHooks.useSankeyNodeHighlightState)(React.useMemo(() => ({
|
|
34
36
|
type: 'sankey',
|
|
35
37
|
subType: 'node',
|
|
@@ -47,6 +49,7 @@ const SankeyNodeLabel = exports.SankeyNodeLabel = /*#__PURE__*/React.forwardRef(
|
|
|
47
49
|
}
|
|
48
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
|
|
49
51
|
ref: ref,
|
|
52
|
+
className: classes.nodeLabel,
|
|
50
53
|
x: labelX,
|
|
51
54
|
y: (y0 + y1) / 2,
|
|
52
55
|
textAnchor: labelAnchor,
|