@mui/x-charts-pro 8.14.0 → 8.14.1

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  3. package/SankeyChart/SankeyChart.d.ts +1 -1
  4. package/SankeyChart/SankeyChart.js +30 -0
  5. package/SankeyChart/SankeyChart.plugins.d.ts +3 -2
  6. package/SankeyChart/SankeyChart.plugins.js +2 -1
  7. package/SankeyChart/SankeyLinkElement.d.ts +1 -1
  8. package/SankeyChart/SankeyLinkElement.js +15 -2
  9. package/SankeyChart/SankeyNodeElement.d.ts +1 -1
  10. package/SankeyChart/SankeyNodeElement.js +16 -1
  11. package/SankeyChart/SankeyPlot.js +13 -1
  12. package/SankeyChart/plugins/index.d.ts +3 -0
  13. package/SankeyChart/plugins/index.js +49 -0
  14. package/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
  15. package/SankeyChart/plugins/useSankeyHighlight.js +76 -0
  16. package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
  17. package/SankeyChart/plugins/useSankeyHighlight.selectors.js +126 -0
  18. package/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
  19. package/SankeyChart/plugins/useSankeyHighlight.types.js +5 -0
  20. package/SankeyChart/sankey.highlight.types.d.ts +42 -0
  21. package/SankeyChart/sankey.highlight.types.js +6 -0
  22. package/SankeyChart/sankey.types.d.ts +3 -2
  23. package/SankeyChart/sankeyClasses.d.ts +1 -1
  24. package/SankeyChart/useSankeyChartProps.js +5 -5
  25. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  26. package/esm/SankeyChart/SankeyChart.d.ts +1 -1
  27. package/esm/SankeyChart/SankeyChart.js +30 -0
  28. package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -2
  29. package/esm/SankeyChart/SankeyChart.plugins.js +3 -4
  30. package/esm/SankeyChart/SankeyLinkElement.d.ts +1 -1
  31. package/esm/SankeyChart/SankeyLinkElement.js +16 -3
  32. package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
  33. package/esm/SankeyChart/SankeyNodeElement.js +17 -2
  34. package/esm/SankeyChart/SankeyPlot.js +15 -3
  35. package/esm/SankeyChart/plugins/index.d.ts +3 -0
  36. package/esm/SankeyChart/plugins/index.js +3 -0
  37. package/esm/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
  38. package/esm/SankeyChart/plugins/useSankeyHighlight.js +68 -0
  39. package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
  40. package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.js +120 -0
  41. package/esm/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
  42. package/esm/SankeyChart/plugins/useSankeyHighlight.types.js +1 -0
  43. package/esm/SankeyChart/sankey.highlight.types.d.ts +42 -0
  44. package/esm/SankeyChart/sankey.highlight.types.js +3 -0
  45. package/esm/SankeyChart/sankey.types.d.ts +3 -2
  46. package/esm/SankeyChart/sankeyClasses.d.ts +1 -1
  47. package/esm/SankeyChart/useSankeyChartProps.js +5 -5
  48. package/esm/index.js +1 -1
  49. package/index.js +1 -1
  50. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -5,6 +5,101 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.14.1
9
+
10
+ _Oct 16, 2025_
11
+
12
+ We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 🚀 Charts have optimized data structures for closest point calculations — initial render times reduced by ~25% for 1,000+ data points, with greater gains at larger scales (#19790) @bernardobelchior
15
+ - 🐞 Bugfixes
16
+ - 📚 Documentation improvements
17
+
18
+ Special thanks go out to the community members for their valuable contributions:
19
+ @djpremier, @jacknot, @justdoit1897, @mellis481, @sai6855
20
+
21
+ The following are all team members who have contributed to this release:
22
+ @arminmeh, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @noraleonte, @siriwatknp
23
+
24
+ ### Data Grid
25
+
26
+ #### `@mui/x-data-grid@8.14.1`
27
+
28
+ - [DataGrid] Fix cell not rerendering on `isCellEditable` prop change (#19898) @cherniavskii
29
+ - [DataGrid] Fix virtualizer memory leaks (#19886) @cherniavskii
30
+ - [DataGrid] Fix tree data unable to deselect row for exclude model (#19846) @siriwatknp
31
+ - [l10n] Improve Italian (it-IT) locale (#19322) @jacknot and (#19940) @justdoit1897
32
+
33
+ #### `@mui/x-data-grid-pro@8.14.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
34
+
35
+ Same changes as in `@mui/x-data-grid@8.14.1`, plus:
36
+
37
+ - [DataGridPro] Clear cache before new request to the nested request queue after a row has been edited (#19873) @arminmeh
38
+
39
+ #### `@mui/x-data-grid-premium@8.14.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
40
+
41
+ Same changes as in `@mui/x-data-grid-pro@8.14.1`.
42
+
43
+ ### Date and Time Pickers
44
+
45
+ #### `@mui/x-date-pickers@8.14.1`
46
+
47
+ Internal changes.
48
+
49
+ #### `@mui/x-date-pickers-pro@8.14.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-date-pickers@8.14.1`.
52
+
53
+ ### Charts
54
+
55
+ #### `@mui/x-charts@8.14.1`
56
+
57
+ - [charts] Fix `minBarSize` when y-axis is reversed (#19932) @bernardobelchior
58
+ - [charts] Fix bar chart border radius when axis is reversed (#19895) @bernardobelchior
59
+ - [charts] Fix scatter chart `datasetKeys.id` not being optional (#19897) @bernardobelchior
60
+ - [charts] Use more performant data structure for closest point (#19790) @bernardobelchior
61
+ - [charts] Fix `GaugeValueArc` having wrong class (#19965) @bernardobelchior
62
+ - [charts] Fix `undefined` path when highlight empty line chart axis (#19969) @bernardobelchior
63
+
64
+ #### `@mui/x-charts-pro@8.14.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
65
+
66
+ Same changes as in `@mui/x-charts@8.14.1`, plus:
67
+
68
+ - [charts-pro] Add `highlighting` to Sankey chart (#19662) @JCQuintas
69
+
70
+ #### `@mui/x-charts-premium@8.14.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
71
+
72
+ Same changes as in `@mui/x-charts-pro@8.14.1`.
73
+
74
+ ### Tree View
75
+
76
+ #### `@mui/x-tree-view@8.14.1`
77
+
78
+ - [tree view] Do not forward the `ownerState` to the icon (#19772) @flaviendelangle
79
+
80
+ #### `@mui/x-tree-view-pro@8.14.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
81
+
82
+ Same changes as in `@mui/x-tree-view@8.14.1`.
83
+
84
+ ### Codemod
85
+
86
+ #### `@mui/x-codemod@8.14.0`
87
+
88
+ Internal changes.
89
+
90
+ ### Docs
91
+
92
+ - [docs] Add `'bumpX'` and `'bumpY'` curve types to the interpolation demo (#19676) @djpremier
93
+ - [docs] Add scatter chart with linear regression demo (#19900) @bernardobelchior
94
+ - [docs] Correctly describe Data Grid's row selection behavior (#19968) @arminmeh
95
+ - [docs] Fix `isExpanded` type in tree view docs (#19092) @mellis481
96
+
97
+ ### Core
98
+
99
+ - [code-infra] Disable Netlify cache plugin (#19950) @Janpot
100
+ - [code-infra] Lint json through eslint (#19890) @Janpot
101
+ - [docs-infra] Use published netlify cache plugin package (#19929) @brijeshb42
102
+
8
103
  ## 8.14.0
9
104
 
10
105
  _Oct 9, 2025_
@@ -18,7 +18,7 @@ var _material = require("../internals/material");
18
18
  var _allPlugins = require("../internals/plugins/allPlugins");
19
19
  var _useChartDataProviderProProps = require("./useChartDataProviderProProps");
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
- const releaseInfo = "MTc1OTk2ODAwMDAwMA==";
21
+ const releaseInfo = "MTc2MDU3MjgwMDAwMA==";
22
22
  const packageIdentifier = 'x-charts-pro';
23
23
  /**
24
24
  * Orchestrates the data providers for the chart components and hooks.
@@ -7,7 +7,7 @@ import { type SankeyChartPluginSignatures } from "./SankeyChart.plugins.js";
7
7
  import type { SankeySeriesType } from "./sankey.types.js";
8
8
  import type { SankeyChartSlotExtension } from "./sankeySlots.types.js";
9
9
  export type SankeySeries = MakeOptional<SankeySeriesType, 'type'>;
10
- export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation' | 'highlightedItem' | 'onHighlightChange'>, Omit<SankeyPlotProps, 'data'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, SankeyChartSlotExtension {
10
+ export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey', SankeyChartPluginSignatures>, 'plugins' | 'series' | 'slotProps' | 'slots' | 'dataset' | 'hideLegend' | 'skipAnimation'>, Omit<SankeyPlotProps, 'data'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, SankeyChartSlotExtension {
11
11
  /**
12
12
  * The series to display in the Sankey chart.
13
13
  * A single object is expected.
@@ -101,6 +101,30 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
101
101
  * The height of the chart in px. If not defined, it takes the height of the parent element.
102
102
  */
103
103
  height: _propTypes.default.number,
104
+ /**
105
+ * The highlighted item.
106
+ * Used when the highlight is controlled.
107
+ */
108
+ highlightedItem: _propTypes.default.oneOfType([_propTypes.default.shape({
109
+ nodeId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
110
+ seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
111
+ subType: _propTypes.default.oneOf([
112
+ /**
113
+ * Subtype to differentiate between node and link
114
+ */
115
+ 'node']).isRequired,
116
+ type: _propTypes.default.oneOf(['sankey']).isRequired
117
+ }), _propTypes.default.shape({
118
+ seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
119
+ sourceId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
120
+ subType: _propTypes.default.oneOf([
121
+ /**
122
+ * Subtype to differentiate between node and link
123
+ */
124
+ 'link']).isRequired,
125
+ targetId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
126
+ type: _propTypes.default.oneOf(['sankey']).isRequired
127
+ })]),
104
128
  /**
105
129
  * This prop is used to help implement the accessibility logic.
106
130
  * If you don't provide this prop. It falls back to a randomly generated id.
@@ -127,6 +151,12 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
127
151
  right: _propTypes.default.number,
128
152
  top: _propTypes.default.number
129
153
  })]),
154
+ /**
155
+ * The callback fired when the highlighted item changes.
156
+ *
157
+ * @param {SankeyHighlightItemData | null} highlightedItem The newly highlighted item.
158
+ */
159
+ onHighlightChange: _propTypes.default.func,
130
160
  /**
131
161
  * Callback fired when a sankey item is clicked.
132
162
  * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
@@ -1,4 +1,5 @@
1
- import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
1
+ import { ConvertSignaturesIntoPlugins, UseChartInteractionSignature } from '@mui/x-charts/internals';
2
2
  import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
3
- export type SankeyChartPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
3
+ import { type UseSankeyHighlightSignature } from "./plugins/index.js";
4
+ export type SankeyChartPluginSignatures = [UseChartInteractionSignature, UseSankeyHighlightSignature, UseChartProExportSignature];
4
5
  export declare const SANKEY_CHART_PLUGINS: ConvertSignaturesIntoPlugins<SankeyChartPluginSignatures>;
@@ -6,4 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.SANKEY_CHART_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
8
  var _useChartProExport = require("../internals/plugins/useChartProExport");
9
- const SANKEY_CHART_PLUGINS = exports.SANKEY_CHART_PLUGINS = [_internals.useChartInteraction, _internals.useChartHighlight, _useChartProExport.useChartProExport];
9
+ var _plugins = require("./plugins");
10
+ const SANKEY_CHART_PLUGINS = exports.SANKEY_CHART_PLUGINS = [_internals.useChartInteraction, _plugins.useSankeyHighlight, _useChartProExport.useChartProExport];
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { SeriesId } from '@mui/x-charts/internals';
3
- import { SankeyLayoutLink, type SankeyLinkIdentifierWithData } from "./sankey.types.js";
3
+ import type { SankeyLayoutLink, SankeyLinkIdentifierWithData } from "./sankey.types.js";
4
4
  export interface SankeyLinkElementProps {
5
5
  /**
6
6
  * The series ID to which the link belongs
@@ -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 _plugins = require("./plugins");
15
+ var _useSankeyHighlight = require("./plugins/useSankeyHighlight.selectors");
14
16
  var _jsxRuntime = require("react/jsx-runtime");
15
17
  /**
16
18
  * @ignore - internal component.
@@ -22,6 +24,7 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
22
24
  onClick,
23
25
  seriesId
24
26
  } = props;
27
+ const store = (0, _internals.useStore)();
25
28
  const identifier = {
26
29
  type: 'sankey',
27
30
  seriesId,
@@ -30,6 +33,8 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
30
33
  sourceId: link.source.id,
31
34
  link
32
35
  };
36
+ const isHighlighted = (0, _internals.useSelector)(store, _plugins.selectorIsLinkHighlighted, [link]);
37
+ const isFaded = (0, _internals.useSelector)(store, _useSankeyHighlight.selectorIsSankeyItemFaded, [isHighlighted]);
33
38
 
34
39
  // Add interaction props for tooltips
35
40
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
@@ -37,15 +42,23 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
37
42
  onClick?.(event, identifier);
38
43
  });
39
44
  if (!link.path) {
40
- return null; // No path defined, nothing to render
45
+ return null;
46
+ }
47
+ let finalOpacity = opacity;
48
+ if (isFaded) {
49
+ finalOpacity = opacity * 0.3;
50
+ } else if (isHighlighted) {
51
+ finalOpacity = Math.min(opacity * 1.2, 1);
41
52
  }
42
53
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("path", (0, _extends2.default)({
43
54
  ref: ref,
44
55
  d: link.path,
45
56
  fill: link.color,
46
- opacity: opacity,
57
+ opacity: finalOpacity,
47
58
  "data-link-source": link.source.id,
48
59
  "data-link-target": link.target.id,
60
+ "data-highlighted": isHighlighted || undefined,
61
+ "data-faded": isFaded || undefined,
49
62
  onClick: onClick ? handleClick : undefined,
50
63
  cursor: onClick ? 'pointer' : 'default'
51
64
  }, interactionProps));
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { SeriesId } from '@mui/x-charts/internals';
3
- import { SankeyLayoutNode, type SankeyNodeIdentifierWithData } from "./sankey.types.js";
3
+ import type { SankeyLayoutNode, SankeyNodeIdentifierWithData } from "./sankey.types.js";
4
4
  export interface SankeyNodeElementProps {
5
5
  /**
6
6
  * The series ID to which the node belongs
@@ -12,6 +12,8 @@ var React = _interopRequireWildcard(require("react"));
12
12
  var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
13
13
  var _internals = require("@mui/x-charts/internals");
14
14
  var _styles = require("@mui/material/styles");
15
+ var _plugins = require("./plugins");
16
+ var _useSankeyHighlight = require("./plugins/useSankeyHighlight.selectors");
15
17
  var _jsxRuntime = require("react/jsx-runtime");
16
18
  /**
17
19
  * @ignore - internal component.
@@ -24,6 +26,7 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
24
26
  seriesId
25
27
  } = props;
26
28
  const theme = (0, _styles.useTheme)();
29
+ const store = (0, _internals.useStore)();
27
30
  const x0 = node.x0 ?? 0;
28
31
  const y0 = node.y0 ?? 0;
29
32
  const x1 = node.x1 ?? 0;
@@ -43,12 +46,20 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
43
46
  nodeId: node.id,
44
47
  node
45
48
  };
49
+ const isHighlighted = (0, _internals.useSelector)(store, _plugins.selectorIsNodeHighlighted, [node]);
50
+ const isFaded = (0, _internals.useSelector)(store, _useSankeyHighlight.selectorIsSankeyItemFaded, [isHighlighted]);
46
51
 
47
52
  // Add interaction props for tooltips
48
53
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
49
54
  const handleClick = (0, _useEventCallback.default)(event => {
50
55
  onClick?.(event, identifier);
51
56
  });
57
+ let opacity = 1;
58
+ if (isFaded) {
59
+ opacity = 0.3;
60
+ } else if (isHighlighted) {
61
+ opacity = 1;
62
+ }
52
63
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
53
64
  ref: ref,
54
65
  "data-node": node.id,
@@ -58,9 +69,12 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
58
69
  width: nodeWidth,
59
70
  height: nodeHeight,
60
71
  fill: node.color,
72
+ opacity: opacity,
61
73
  onClick: onClick ? handleClick : undefined,
62
74
  cursor: onClick ? 'pointer' : 'default',
63
- stroke: "none"
75
+ stroke: "none",
76
+ "data-highlighted": isHighlighted || undefined,
77
+ "data-faded": isFaded || undefined
64
78
  }, interactionProps)), showLabel && node.label && /*#__PURE__*/(0, _jsxRuntime.jsx)("text", {
65
79
  x: labelX,
66
80
  y: (y0 + y1) / 2,
@@ -69,6 +83,7 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
69
83
  fontSize: theme.typography.caption.fontSize,
70
84
  fontFamily: theme.typography.fontFamily,
71
85
  pointerEvents: "none",
86
+ opacity: opacity,
72
87
  children: node.label
73
88
  })]
74
89
  });
@@ -18,6 +18,18 @@ var _SankeyLinkLabel = require("./SankeyLinkLabel");
18
18
  var _useSankeySeries = require("../hooks/useSankeySeries");
19
19
  var _sankeyClasses = require("./sankeyClasses");
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
+ const SankeyPlotRoot = (0, _styles.styled)('g')({
22
+ [`.${_sankeyClasses.sankeyPlotClasses.links} path, .${_sankeyClasses.sankeyPlotClasses.nodes} rect`]: {
23
+ transition: 'opacity 0.1s ease-out, filter 0.1s ease-out'
24
+ },
25
+ '& [data-faded=true]': {
26
+ filter: 'saturate(80%)'
27
+ },
28
+ '& [data-highlighted=true]': {
29
+ filter: 'saturate(120%)'
30
+ }
31
+ });
32
+
21
33
  /**
22
34
  * Renders a Sankey diagram plot.
23
35
  */
@@ -50,7 +62,7 @@ function SankeyPlot(props) {
50
62
  if (!data || !data.links) {
51
63
  return null;
52
64
  }
53
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
65
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SankeyPlotRoot, {
54
66
  className: classes.root,
55
67
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
56
68
  className: classes.links,
@@ -0,0 +1,3 @@
1
+ export { useSankeyHighlight } from "./useSankeyHighlight.js";
2
+ export * from "./useSankeyHighlight.types.js";
3
+ export { selectorIsSankeyItemFaded as selectorIsFaded, selectorIsLinkHighlighted, selectorIsNodeHighlighted } from "./useSankeyHighlight.selectors.js";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ useSankeyHighlight: true,
8
+ selectorIsFaded: true,
9
+ selectorIsLinkHighlighted: true,
10
+ selectorIsNodeHighlighted: true
11
+ };
12
+ Object.defineProperty(exports, "selectorIsFaded", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _useSankeyHighlight3.selectorIsSankeyItemFaded;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "selectorIsLinkHighlighted", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _useSankeyHighlight3.selectorIsLinkHighlighted;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "selectorIsNodeHighlighted", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _useSankeyHighlight3.selectorIsNodeHighlighted;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "useSankeyHighlight", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _useSankeyHighlight.useSankeyHighlight;
34
+ }
35
+ });
36
+ var _useSankeyHighlight = require("./useSankeyHighlight");
37
+ var _useSankeyHighlight2 = require("./useSankeyHighlight.types");
38
+ Object.keys(_useSankeyHighlight2).forEach(function (key) {
39
+ if (key === "default" || key === "__esModule") return;
40
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
41
+ if (key in exports && exports[key] === _useSankeyHighlight2[key]) return;
42
+ Object.defineProperty(exports, key, {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _useSankeyHighlight2[key];
46
+ }
47
+ });
48
+ });
49
+ var _useSankeyHighlight3 = require("./useSankeyHighlight.selectors");
@@ -0,0 +1,7 @@
1
+ import { ChartPlugin } from '@mui/x-charts/internals';
2
+ import type { UseSankeyHighlightSignature } from "./useSankeyHighlight.types.js";
3
+ /**
4
+ * Custom highlight plugin for Sankey charts that uses SankeyItemIdentifier
5
+ * instead of the standard HighlightItemData.
6
+ */
7
+ export declare const useSankeyHighlight: ChartPlugin<UseSankeyHighlightSignature>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useSankeyHighlight = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _useAssertModelConsistency = require("@mui/x-internals/useAssertModelConsistency");
10
+ var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
11
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
12
+ var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
13
+ /**
14
+ * Custom highlight plugin for Sankey charts that uses SankeyItemIdentifier
15
+ * instead of the standard HighlightItemData.
16
+ */
17
+ const useSankeyHighlight = ({
18
+ store,
19
+ params
20
+ }) => {
21
+ (0, _useAssertModelConsistency.useAssertModelConsistency)({
22
+ warningPrefix: 'MUI X Charts',
23
+ componentName: 'SankeyChart',
24
+ propName: 'highlightedItem',
25
+ controlled: params.highlightedItem,
26
+ defaultValue: null
27
+ });
28
+ (0, _useEnhancedEffect.default)(() => {
29
+ store.update(prevState => prevState.highlight.item === params.highlightedItem ? prevState : (0, _extends2.default)({}, prevState, {
30
+ highlight: (0, _extends2.default)({}, prevState.highlight, {
31
+ item: params.highlightedItem
32
+ })
33
+ }));
34
+ }, [store, params.highlightedItem]);
35
+ const clearHighlight = (0, _useEventCallback.default)(() => {
36
+ params.onHighlightChange?.(null);
37
+ store.update(prev => (0, _extends2.default)({}, prev, {
38
+ highlight: {
39
+ item: null
40
+ }
41
+ }));
42
+ });
43
+ const setHighlight = (0, _useEventCallback.default)(newItem => {
44
+ const prevItem = store.getSnapshot().highlight.item;
45
+ if ((0, _fastObjectShallowCompare.fastObjectShallowCompare)(prevItem, newItem)) {
46
+ return;
47
+ }
48
+ params.onHighlightChange?.(newItem);
49
+ store.update(prev => (0, _extends2.default)({}, prev, {
50
+ highlight: {
51
+ item: newItem
52
+ }
53
+ }));
54
+ });
55
+ return {
56
+ instance: {
57
+ clearHighlight,
58
+ setHighlight
59
+ }
60
+ };
61
+ };
62
+ exports.useSankeyHighlight = useSankeyHighlight;
63
+ useSankeyHighlight.getDefaultizedParams = ({
64
+ params
65
+ }) => (0, _extends2.default)({}, params, {
66
+ highlightedItem: params.highlightedItem ?? null
67
+ });
68
+ useSankeyHighlight.getInitialState = params => ({
69
+ highlight: {
70
+ item: params.highlightedItem
71
+ }
72
+ });
73
+ useSankeyHighlight.params = {
74
+ highlightedItem: true,
75
+ onHighlightChange: true
76
+ };
@@ -0,0 +1,68 @@
1
+ import type { SankeyLayoutLink, SankeyLayoutNode } from "../sankey.types.js";
2
+ import type { SankeyLinkFade, SankeyLinkHighlight, SankeyNodeFade, SankeyNodeHighlight } from "../sankey.highlight.types.js";
3
+ /**
4
+ * Get the node highlight configuration from the Sankey series.
5
+ * Defaults to 'nodes' if not specified.
6
+ */
7
+ export declare const selectorNodeHighlightConfig: import("reselect").Selector<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<{}> & {
8
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
9
+ } & {
10
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
11
+ }, SankeyNodeHighlight, any[]>;
12
+ /**
13
+ * Get the node fade configuration from the Sankey series.
14
+ * Defaults to 'none' if not specified.
15
+ */
16
+ export declare const selectorNodeFadeConfig: import("reselect").Selector<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<{}> & {
17
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
18
+ } & {
19
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
20
+ }, SankeyNodeFade, any[]>;
21
+ /**
22
+ * Get the link highlight configuration from the Sankey series.
23
+ * Defaults to 'links' if not specified.
24
+ */
25
+ export declare const selectorLinkHighlightConfig: import("reselect").Selector<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<{}> & {
26
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
27
+ } & {
28
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
29
+ }, SankeyLinkHighlight, any[]>;
30
+ /**
31
+ * Get the link fade configuration from the Sankey series.
32
+ * Defaults to 'none' if not specified.
33
+ */
34
+ export declare const selectorLinkFadeConfig: import("reselect").Selector<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<{}> & {
35
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
36
+ } & {
37
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
38
+ }, SankeyLinkFade, any[]>;
39
+ /**
40
+ * Get the currently highlighted item in the Sankey chart.
41
+ * @param {UseSankeyHighlightSignature['state']} state The state of the chart.
42
+ * @returns {SankeyItemIdentifier | null} The highlighted item identifier or null.
43
+ */
44
+ export declare const selectorSankeyHighlightedItem: import("reselect").Selector<import("./useSankeyHighlight.types.js").UseSankeyHighlightState & {
45
+ cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
46
+ }, import("../index.js").SankeyItemIdentifier | null, []>;
47
+ /**
48
+ * Determines if a specific node should be highlighted.
49
+ * A node is highlighted if:
50
+ * - It's the highlighted node (unless highlight mode is 'none')
51
+ * - It's connected to a highlighted link (based on linkOptions.highlight)
52
+ */
53
+ export declare const selectorIsNodeHighlighted: import("reselect").Selector<any, boolean, [node: SankeyLayoutNode]>;
54
+ /**
55
+ * Selector that determines if a specific link should be highlighted.
56
+ * A link is highlighted if:
57
+ * - It's the highlighted link (unless highlight mode is 'none')
58
+ * - It's connected to a highlighted node (based on nodeOptions.highlight)
59
+ */
60
+ export declare const selectorIsLinkHighlighted: import("reselect").Selector<any, boolean, [link: SankeyLayoutLink]>;
61
+ /**
62
+ * Selector that determines if an item should be faded.
63
+ * An item is faded if:
64
+ * - There's a highlighted item
65
+ * - This item is not highlighted
66
+ * - The fade mode is 'global' for the highlighted element type
67
+ */
68
+ export declare const selectorIsSankeyItemFaded: import("reselect").Selector<any, boolean, [isHighlighted: any]>;