@mui/x-charts-pro 8.14.0 → 8.15.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.
Files changed (88) hide show
  1. package/BarChartPro/BarChartPro.js +8 -0
  2. package/BarChartPro/BarChartPro.plugins.d.ts +2 -2
  3. package/BarChartPro/BarChartPro.plugins.js +1 -1
  4. package/CHANGELOG.md +202 -0
  5. package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  6. package/ChartsBrushOverlay/index.d.ts +1 -0
  7. package/ChartsBrushOverlay/index.js +16 -0
  8. package/LineChartPro/LineChartPro.js +8 -0
  9. package/LineChartPro/LineChartPro.plugins.d.ts +2 -2
  10. package/LineChartPro/LineChartPro.plugins.js +1 -1
  11. package/SankeyChart/SankeyChart.d.ts +1 -1
  12. package/SankeyChart/SankeyChart.js +30 -0
  13. package/SankeyChart/SankeyChart.plugins.d.ts +3 -2
  14. package/SankeyChart/SankeyChart.plugins.js +2 -1
  15. package/SankeyChart/SankeyLinkElement.d.ts +1 -1
  16. package/SankeyChart/SankeyLinkElement.js +15 -2
  17. package/SankeyChart/SankeyNodeElement.d.ts +1 -1
  18. package/SankeyChart/SankeyNodeElement.js +16 -1
  19. package/SankeyChart/SankeyPlot.js +13 -1
  20. package/SankeyChart/plugins/index.d.ts +3 -0
  21. package/SankeyChart/plugins/index.js +49 -0
  22. package/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
  23. package/SankeyChart/plugins/useSankeyHighlight.js +76 -0
  24. package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
  25. package/SankeyChart/plugins/useSankeyHighlight.selectors.js +126 -0
  26. package/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
  27. package/SankeyChart/plugins/useSankeyHighlight.types.js +5 -0
  28. package/SankeyChart/sankey.highlight.types.d.ts +42 -0
  29. package/SankeyChart/sankey.highlight.types.js +6 -0
  30. package/SankeyChart/sankey.types.d.ts +3 -2
  31. package/SankeyChart/sankeyClasses.d.ts +1 -1
  32. package/SankeyChart/useSankeyChartProps.js +5 -5
  33. package/ScatterChartPro/ScatterChartPro.js +8 -0
  34. package/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -2
  35. package/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
  36. package/esm/BarChartPro/BarChartPro.js +8 -0
  37. package/esm/BarChartPro/BarChartPro.plugins.d.ts +2 -2
  38. package/esm/BarChartPro/BarChartPro.plugins.js +2 -2
  39. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
  40. package/esm/ChartsBrushOverlay/index.d.ts +1 -0
  41. package/esm/ChartsBrushOverlay/index.js +2 -0
  42. package/esm/LineChartPro/LineChartPro.js +8 -0
  43. package/esm/LineChartPro/LineChartPro.plugins.d.ts +2 -2
  44. package/esm/LineChartPro/LineChartPro.plugins.js +2 -2
  45. package/esm/SankeyChart/SankeyChart.d.ts +1 -1
  46. package/esm/SankeyChart/SankeyChart.js +30 -0
  47. package/esm/SankeyChart/SankeyChart.plugins.d.ts +3 -2
  48. package/esm/SankeyChart/SankeyChart.plugins.js +3 -4
  49. package/esm/SankeyChart/SankeyLinkElement.d.ts +1 -1
  50. package/esm/SankeyChart/SankeyLinkElement.js +16 -3
  51. package/esm/SankeyChart/SankeyNodeElement.d.ts +1 -1
  52. package/esm/SankeyChart/SankeyNodeElement.js +17 -2
  53. package/esm/SankeyChart/SankeyPlot.js +15 -3
  54. package/esm/SankeyChart/plugins/index.d.ts +3 -0
  55. package/esm/SankeyChart/plugins/index.js +3 -0
  56. package/esm/SankeyChart/plugins/useSankeyHighlight.d.ts +7 -0
  57. package/esm/SankeyChart/plugins/useSankeyHighlight.js +68 -0
  58. package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +68 -0
  59. package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.js +120 -0
  60. package/esm/SankeyChart/plugins/useSankeyHighlight.types.d.ts +55 -0
  61. package/esm/SankeyChart/plugins/useSankeyHighlight.types.js +1 -0
  62. package/esm/SankeyChart/sankey.highlight.types.d.ts +42 -0
  63. package/esm/SankeyChart/sankey.highlight.types.js +3 -0
  64. package/esm/SankeyChart/sankey.types.d.ts +3 -2
  65. package/esm/SankeyChart/sankeyClasses.d.ts +1 -1
  66. package/esm/SankeyChart/useSankeyChartProps.js +5 -5
  67. package/esm/ScatterChartPro/ScatterChartPro.js +8 -0
  68. package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +2 -2
  69. package/esm/ScatterChartPro/ScatterChartPro.plugins.js +2 -2
  70. package/esm/index.js +1 -1
  71. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
  72. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
  73. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
  74. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +8 -5
  75. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +2 -2
  76. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +2 -2
  77. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +2 -2
  78. package/esm/tests/constants.js +1 -0
  79. package/index.js +1 -1
  80. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
  81. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
  82. package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
  83. package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +8 -5
  84. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +2 -2
  85. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +2 -2
  86. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +2 -2
  87. package/package.json +5 -5
  88. package/tests/constants.js +7 -0
@@ -125,6 +125,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
125
125
  * Defines the border radius of the bar element.
126
126
  */
127
127
  borderRadius: _propTypes.default.number,
128
+ /**
129
+ * Configuration for the brush interaction.
130
+ */
131
+ brushConfig: _propTypes.default.shape({
132
+ enabled: _propTypes.default.bool,
133
+ preventHighlight: _propTypes.default.bool,
134
+ preventTooltip: _propTypes.default.bool
135
+ }),
128
136
  children: _propTypes.default.node,
129
137
  className: _propTypes.default.string,
130
138
  /**
@@ -1,5 +1,5 @@
1
- import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
1
+ import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
2
  import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
3
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
4
- export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
+ export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
5
5
  export declare const BAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<BarChartProPluginSignatures>;
@@ -7,4 +7,4 @@ exports.BAR_CHART_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
8
  var _useChartProExport = require("../internals/plugins/useChartProExport");
9
9
  var _useChartProZoom = require("../internals/plugins/useChartProZoom");
10
- const BAR_CHART_PRO_PLUGINS = exports.BAR_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
10
+ const BAR_CHART_PRO_PLUGINS = exports.BAR_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
package/CHANGELOG.md CHANGED
@@ -5,6 +5,208 @@
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.15.0
9
+
10
+ _Oct 23, 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
+ - 🖌️ Add new [`brush` charts interaction](https://mui.com/x/react-charts/brush/) for building custom behavior.
15
+ ![brush visualization example](https://github.com/user-attachments/assets/60c382a1-e418-4736-8dcb-1567c4e361e3)
16
+ - ⚡️ Performance improvements for large bar charts
17
+ - 🤖 Data Grid AI assistant can now [visualize the query results](https://mui.com/x/react-data-grid/ai-assistant/#data-visualization) by controlling the chart integration settings
18
+ - 📦 DataGrid uses an internal MUI fork of ExcelJS that does not depend on vulnerable versions of NPM packages
19
+ - 🐞 Bugfixes
20
+ - 📚 Documentation improvements
21
+
22
+ Special thanks go out to the community members for their valuable contributions:
23
+ @ZagrebaAlex
24
+
25
+ The following are all team members who have contributed to this release:
26
+ @alexfauquette, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @prakhargupta1, @rita-codes, @siriwatknp, @arminmeh, @brijeshb42, @noraleonte
27
+
28
+ ### Data Grid
29
+
30
+ #### `@mui/x-data-grid@8.15.0`
31
+
32
+ - [DataGrid] Fix `dataSource.fetchRows` API's return type (#20068) @arminmeh
33
+
34
+ #### `@mui/x-data-grid-pro@8.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-data-grid@8.15.0`, plus:
37
+
38
+ - [DataGridPro] Keep children in the tree after parent row is re-fetched with the data source (#19934) @arminmeh
39
+ - [DataGridPro] Support scroll shadows customization (#19982) @KenanYusuf
40
+
41
+ #### `@mui/x-data-grid-premium@8.15.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
42
+
43
+ Same changes as in `@mui/x-data-grid-pro@8.15.0`, plus:
44
+
45
+ - [DataGridPremium] Use ExcelJS fork (#19796) @cherniavskii
46
+ - [DataGridPremium] Support data visualization in AI Assistant (#19831) @arminmeh
47
+
48
+ ### Date and Time Pickers
49
+
50
+ #### `@mui/x-date-pickers@8.15.0`
51
+
52
+ Internal changes.
53
+
54
+ #### `@mui/x-date-pickers-pro@8.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
55
+
56
+ Same changes as in `@mui/x-date-pickers@8.15.0`.
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.15.0`
61
+
62
+ - [charts] Add `ChartsBrushOverlay` and allow brush configuration (#19956) @JCQuintas
63
+ - [charts] Add `getStringSize` benchmark. Remove benchmarks from built package. (#19995) @bernardobelchior
64
+ - [charts] Batch string size measurement (#19994) @bernardobelchior
65
+ - [charts] Fix console issue (#20025) @JCQuintas
66
+ - [charts] Fix is[ZoomFeature]Enabled type (#20058) @alexfauquette
67
+ - [charts] Fix reference line middle spacing (#20004) @JCQuintas
68
+ - [charts] Improve `getStringSize` and `batchMeasureStrings` performance (#19996) @bernardobelchior
69
+ - [charts] Improve deep export script (#20007) @JCQuintas
70
+ - [charts] Improve string measurement benchmarks (#19999) @bernardobelchior
71
+ - [charts] Measure string sizes using SVG elements (#19981) @bernardobelchior
72
+ - [l10n] Improve Greek (gr-GR) locale (#20060) @ZagrebaAlex
73
+
74
+ #### `@mui/x-charts-pro@8.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
75
+
76
+ Same changes as in `@mui/x-charts@8.15.0`, plus:
77
+
78
+ - [charts-pro] Fix pan with `axis.reverse` (#20031) @JCQuintas
79
+
80
+ #### `@mui/x-charts-premium@8.15.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
81
+
82
+ Same changes as in `@mui/x-charts-pro@8.15.0`.
83
+
84
+ ### Tree View
85
+
86
+ #### `@mui/x-tree-view@8.15.0`
87
+
88
+ - [tree view] Multi character type-ahead (#19942) @noraleonte
89
+
90
+ #### `@mui/x-tree-view-pro@8.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
91
+
92
+ Same changes as in `@mui/x-tree-view@8.15.0`.
93
+
94
+ ### Codemod
95
+
96
+ #### `@mui/x-codemod@8.14.0`
97
+
98
+ Internal changes.
99
+
100
+ ### Docs
101
+
102
+ - [docs] Add overview section for scatter chart and heatmap (#19888) @prakhargupta1
103
+ - [docs] Add charts bell curve example (#20003) @JCQuintas
104
+ - [docs] Add grouped multiple fields for Data Grid row grouping recipe (#19964) @siriwatknp
105
+ - [docs] Add Data Grid loading state recipe (#19958) @siriwatknp
106
+
107
+ ### Core
108
+
109
+ - [code-infra] Remove @mui/monorepo usage for react versioning (#19894) @Janpot
110
+ - [code-infra] Remove invalid `environment: 'browser'` from vitest browser config (#19993) @bernardobelchior
111
+ - [code-infra] Remove unused babel aliases (#19987) @Janpot
112
+ - [code-infra] Turn on all testing-library eslint rules (#19946) @brijeshb42
113
+ - [docs-infra] Fix broken hash link (#20062) @Janpot
114
+
115
+ ## 8.14.1
116
+
117
+ _Oct 16, 2025_
118
+
119
+ We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
120
+
121
+ - 🚀 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
122
+ - 🐞 Bugfixes
123
+ - 📚 Documentation improvements
124
+
125
+ Special thanks go out to the community members for their valuable contributions:
126
+ @djpremier, @jacknot, @justdoit1897, @mellis481, @sai6855
127
+
128
+ The following are all team members who have contributed to this release:
129
+ @arminmeh, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @noraleonte, @siriwatknp
130
+
131
+ ### Data Grid
132
+
133
+ #### `@mui/x-data-grid@8.14.1`
134
+
135
+ - [DataGrid] Fix cell not rerendering on `isCellEditable` prop change (#19898) @cherniavskii
136
+ - [DataGrid] Fix virtualizer memory leaks (#19886) @cherniavskii
137
+ - [DataGrid] Fix tree data unable to deselect row for exclude model (#19846) @siriwatknp
138
+ - [l10n] Improve Italian (it-IT) locale (#19322) @jacknot and (#19940) @justdoit1897
139
+
140
+ #### `@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')
141
+
142
+ Same changes as in `@mui/x-data-grid@8.14.1`, plus:
143
+
144
+ - [DataGridPro] Clear cache before new request to the nested request queue after a row has been edited (#19873) @arminmeh
145
+
146
+ #### `@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')
147
+
148
+ Same changes as in `@mui/x-data-grid-pro@8.14.1`.
149
+
150
+ ### Date and Time Pickers
151
+
152
+ #### `@mui/x-date-pickers@8.14.1`
153
+
154
+ Internal changes.
155
+
156
+ #### `@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')
157
+
158
+ Same changes as in `@mui/x-date-pickers@8.14.1`.
159
+
160
+ ### Charts
161
+
162
+ #### `@mui/x-charts@8.14.1`
163
+
164
+ - [charts] Fix `minBarSize` when y-axis is reversed (#19932) @bernardobelchior
165
+ - [charts] Fix bar chart border radius when axis is reversed (#19895) @bernardobelchior
166
+ - [charts] Fix scatter chart `datasetKeys.id` not being optional (#19897) @bernardobelchior
167
+ - [charts] Use more performant data structure for closest point (#19790) @bernardobelchior
168
+ - [charts] Fix `GaugeValueArc` having wrong class (#19965) @bernardobelchior
169
+ - [charts] Fix `undefined` path when highlight empty line chart axis (#19969) @bernardobelchior
170
+
171
+ #### `@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')
172
+
173
+ Same changes as in `@mui/x-charts@8.14.1`, plus:
174
+
175
+ - [charts-pro] Add `highlighting` to Sankey chart (#19662) @JCQuintas
176
+
177
+ #### `@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')
178
+
179
+ Same changes as in `@mui/x-charts-pro@8.14.1`.
180
+
181
+ ### Tree View
182
+
183
+ #### `@mui/x-tree-view@8.14.1`
184
+
185
+ - [tree view] Do not forward the `ownerState` to the icon (#19772) @flaviendelangle
186
+
187
+ #### `@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')
188
+
189
+ Same changes as in `@mui/x-tree-view@8.14.1`.
190
+
191
+ ### Codemod
192
+
193
+ #### `@mui/x-codemod@8.14.0`
194
+
195
+ Internal changes.
196
+
197
+ ### Docs
198
+
199
+ - [docs] Add `'bumpX'` and `'bumpY'` curve types to the interpolation demo (#19676) @djpremier
200
+ - [docs] Add scatter chart with linear regression demo (#19900) @bernardobelchior
201
+ - [docs] Correctly describe Data Grid's row selection behavior (#19968) @arminmeh
202
+ - [docs] Fix `isExpanded` type in tree view docs (#19092) @mellis481
203
+
204
+ ### Core
205
+
206
+ - [code-infra] Disable Netlify cache plugin (#19950) @Janpot
207
+ - [code-infra] Lint json through eslint (#19890) @Janpot
208
+ - [docs-infra] Use published netlify cache plugin package (#19929) @brijeshb42
209
+
8
210
  ## 8.14.0
9
211
 
10
212
  _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 = "MTc2MTE3NzYwMDAwMA==";
22
22
  const packageIdentifier = 'x-charts-pro';
23
23
  /**
24
24
  * Orchestrates the data providers for the chart components and hooks.
@@ -0,0 +1 @@
1
+ export * from '@mui/x-charts/ChartsBrushOverlay';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _ChartsBrushOverlay = require("@mui/x-charts/ChartsBrushOverlay");
7
+ Object.keys(_ChartsBrushOverlay).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _ChartsBrushOverlay[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _ChartsBrushOverlay[key];
14
+ }
15
+ });
16
+ });
@@ -117,6 +117,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
117
117
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
118
118
  y: _propTypes.default.oneOf(['band', 'line', 'none'])
119
119
  }),
120
+ /**
121
+ * Configuration for the brush interaction.
122
+ */
123
+ brushConfig: _propTypes.default.shape({
124
+ enabled: _propTypes.default.bool,
125
+ preventHighlight: _propTypes.default.bool,
126
+ preventTooltip: _propTypes.default.bool
127
+ }),
120
128
  children: _propTypes.default.node,
121
129
  className: _propTypes.default.string,
122
130
  /**
@@ -1,5 +1,5 @@
1
- import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
1
+ import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
2
2
  import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
3
3
  import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
4
- export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
4
+ export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'line'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
5
5
  export declare const LINE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<LineChartProPluginSignatures>;
@@ -7,4 +7,4 @@ exports.LINE_CHART_PRO_PLUGINS = void 0;
7
7
  var _internals = require("@mui/x-charts/internals");
8
8
  var _useChartProExport = require("../internals/plugins/useChartProExport");
9
9
  var _useChartProZoom = require("../internals/plugins/useChartProZoom");
10
- const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
10
+ const LINE_CHART_PRO_PLUGINS = exports.LINE_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
@@ -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>;