@mui/x-charts-pro 9.0.0-alpha.2 → 9.0.0-alpha.3

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 (102) hide show
  1. package/BarChartPro/BarChartPro.js +5 -2
  2. package/BarChartPro/BarChartPro.mjs +5 -2
  3. package/CHANGELOG.md +123 -1
  4. package/ChartContainerPro/ChartContainerPro.d.mts +2 -2
  5. package/ChartContainerPro/ChartContainerPro.d.ts +2 -2
  6. package/ChartContainerPro/useChartContainerProProps.d.mts +2 -2
  7. package/ChartContainerPro/useChartContainerProProps.d.ts +2 -2
  8. package/ChartDataProviderPro/ChartDataProviderPro.d.mts +1 -1
  9. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +1 -1
  10. package/ChartDataProviderPro/useChartDataProviderProProps.d.mts +1 -1
  11. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +1 -1
  12. package/ChartsContainerPro/ChartsContainerPro.d.mts +2 -2
  13. package/ChartsContainerPro/ChartsContainerPro.d.ts +2 -2
  14. package/ChartsContainerPro/useChartsContainerProProps.d.mts +3 -3
  15. package/ChartsContainerPro/useChartsContainerProProps.d.ts +3 -3
  16. package/ChartsDataProviderPro/ChartsDataProviderPro.d.mts +2 -2
  17. package/ChartsDataProviderPro/ChartsDataProviderPro.d.ts +2 -2
  18. package/ChartsDataProviderPro/ChartsDataProviderPro.js +8 -5
  19. package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +8 -5
  20. package/ChartsDataProviderPro/useChartsDataProviderProProps.d.mts +1 -1
  21. package/ChartsDataProviderPro/useChartsDataProviderProProps.d.ts +1 -1
  22. package/FunnelChart/FunnelChart.js +5 -2
  23. package/FunnelChart/FunnelChart.mjs +5 -2
  24. package/FunnelChart/FunnelSection.js +3 -4
  25. package/FunnelChart/FunnelSection.mjs +4 -5
  26. package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.mts +3 -3
  27. package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +3 -3
  28. package/Heatmap/Heatmap.js +5 -4
  29. package/Heatmap/Heatmap.mjs +5 -4
  30. package/Heatmap/HeatmapItem.js +0 -1
  31. package/Heatmap/HeatmapItem.mjs +0 -1
  32. package/Heatmap/HeatmapSVGPlot.js +4 -4
  33. package/Heatmap/HeatmapSVGPlot.mjs +5 -5
  34. package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +16 -13
  35. package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +16 -13
  36. package/Heatmap/internals/HeatmapCell.js +1 -1
  37. package/Heatmap/internals/HeatmapCell.mjs +1 -1
  38. package/Heatmap/seriesConfig/getColor.js +5 -3
  39. package/Heatmap/seriesConfig/getColor.mjs +5 -3
  40. package/Heatmap/seriesConfig/getItemAtPosition.d.mts +2 -2
  41. package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
  42. package/Heatmap/seriesConfig/getItemAtPosition.js +3 -11
  43. package/Heatmap/seriesConfig/getItemAtPosition.mjs +3 -11
  44. package/Heatmap/seriesConfig/identifierCleaner.d.mts +3 -0
  45. package/Heatmap/seriesConfig/identifierCleaner.d.ts +3 -0
  46. package/Heatmap/seriesConfig/identifierCleaner.js +15 -0
  47. package/Heatmap/seriesConfig/identifierCleaner.mjs +9 -0
  48. package/Heatmap/seriesConfig/identifierSerializer.d.mts +3 -0
  49. package/Heatmap/seriesConfig/identifierSerializer.d.ts +3 -0
  50. package/Heatmap/seriesConfig/identifierSerializer.js +11 -0
  51. package/Heatmap/seriesConfig/identifierSerializer.mjs +5 -0
  52. package/Heatmap/seriesConfig/index.js +4 -2
  53. package/Heatmap/seriesConfig/index.mjs +5 -3
  54. package/Heatmap/seriesConfig/keyboardFocusHandler.js +6 -19
  55. package/Heatmap/seriesConfig/keyboardFocusHandler.mjs +6 -19
  56. package/Heatmap/seriesConfig/seriesProcessor.js +8 -3
  57. package/Heatmap/seriesConfig/seriesProcessor.mjs +8 -3
  58. package/Heatmap/seriesConfig/tooltip.js +7 -6
  59. package/Heatmap/seriesConfig/tooltip.mjs +7 -6
  60. package/Heatmap/seriesConfig/tooltipPosition.js +3 -4
  61. package/Heatmap/seriesConfig/tooltipPosition.mjs +3 -4
  62. package/Heatmap/useHeatmapProps.js +2 -2
  63. package/Heatmap/useHeatmapProps.mjs +2 -2
  64. package/LineChartPro/LineChartPro.js +5 -2
  65. package/LineChartPro/LineChartPro.mjs +5 -2
  66. package/PieChartPro/PieChartPro.js +5 -2
  67. package/PieChartPro/PieChartPro.mjs +5 -2
  68. package/RadarChartPro/RadarChartPro.js +5 -2
  69. package/RadarChartPro/RadarChartPro.mjs +5 -2
  70. package/SankeyChart/SankeyChart.js +5 -2
  71. package/SankeyChart/SankeyChart.mjs +5 -2
  72. package/SankeyChart/SankeyLinkElement.js +4 -3
  73. package/SankeyChart/SankeyLinkElement.mjs +5 -4
  74. package/SankeyChart/SankeyNodeElement.js +4 -3
  75. package/SankeyChart/SankeyNodeElement.mjs +5 -4
  76. package/SankeyChart/sankeyHighlightHooks.d.mts +2 -2
  77. package/SankeyChart/sankeyHighlightHooks.d.ts +2 -2
  78. package/SankeyChart/sankeyHighlightHooks.js +2 -10
  79. package/SankeyChart/sankeyHighlightHooks.mjs +3 -11
  80. package/ScatterChartPro/ScatterChartPro.js +5 -2
  81. package/ScatterChartPro/ScatterChartPro.mjs +5 -2
  82. package/index.js +1 -1
  83. package/index.mjs +1 -1
  84. package/internals/ChartsWatermark.d.mts +2 -2
  85. package/internals/ChartsWatermark.d.ts +2 -2
  86. package/internals/ChartsWatermark.js +5 -8
  87. package/internals/ChartsWatermark.mjs +3 -6
  88. package/internals/plugins/allPlugins.d.mts +4 -4
  89. package/internals/plugins/allPlugins.d.ts +4 -4
  90. package/internals/plugins/useChartProExport/exportImage.js +1 -1
  91. package/internals/plugins/useChartProExport/exportImage.mjs +1 -1
  92. package/models/seriesType/heatmap.d.mts +36 -9
  93. package/models/seriesType/heatmap.d.ts +36 -9
  94. package/models/seriesType/heatmap.js +28 -1
  95. package/models/seriesType/heatmap.mjs +25 -1
  96. package/package.json +128 -128
  97. package/plugins/selectors/useChartHeatmapPosition.selectors.d.mts +2 -2
  98. package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +2 -2
  99. package/plugins/selectors/useChartHeatmapPosition.selectors.js +4 -4
  100. package/plugins/selectors/useChartHeatmapPosition.selectors.mjs +4 -4
  101. package/typeOverloads/modules.d.mts +2 -2
  102. package/typeOverloads/modules.d.ts +2 -2
@@ -11,19 +11,20 @@ const tooltipGetter = params => {
11
11
  getColor,
12
12
  identifier
13
13
  } = params;
14
- if (!identifier || identifier.dataIndex === undefined) {
14
+ if (!identifier) {
15
15
  return null;
16
16
  }
17
+ const cellValue = series.heatmapData.getValue(identifier.xIndex, identifier.yIndex);
17
18
  const label = (0, _internals.getLabel)(series.label, 'tooltip');
18
- const value = series.data[identifier.dataIndex];
19
- const formattedValue = series.valueFormatter(value, {
20
- dataIndex: identifier.dataIndex
19
+ const formattedValue = series.valueFormatter(cellValue, {
20
+ xIndex: identifier.xIndex,
21
+ yIndex: identifier.yIndex
21
22
  });
22
23
  return {
23
24
  identifier,
24
- color: getColor(identifier.dataIndex),
25
+ color: getColor(cellValue),
25
26
  label,
26
- value,
27
+ value: cellValue,
27
28
  formattedValue,
28
29
  markType: series.labelMarkType
29
30
  };
@@ -5,19 +5,20 @@ const tooltipGetter = params => {
5
5
  getColor,
6
6
  identifier
7
7
  } = params;
8
- if (!identifier || identifier.dataIndex === undefined) {
8
+ if (!identifier) {
9
9
  return null;
10
10
  }
11
+ const cellValue = series.heatmapData.getValue(identifier.xIndex, identifier.yIndex);
11
12
  const label = getLabel(series.label, 'tooltip');
12
- const value = series.data[identifier.dataIndex];
13
- const formattedValue = series.valueFormatter(value, {
14
- dataIndex: identifier.dataIndex
13
+ const formattedValue = series.valueFormatter(cellValue, {
14
+ xIndex: identifier.xIndex,
15
+ yIndex: identifier.yIndex
15
16
  });
16
17
  return {
17
18
  identifier,
18
- color: getColor(identifier.dataIndex),
19
+ color: getColor(cellValue),
19
20
  label,
20
- value,
21
+ value: cellValue,
21
22
  formattedValue,
22
23
  markType: series.labelMarkType
23
24
  };
@@ -12,7 +12,7 @@ const tooltipItemPositionGetter = params => {
12
12
  axesConfig,
13
13
  placement
14
14
  } = params;
15
- if (!identifier || identifier.dataIndex === undefined) {
15
+ if (!identifier) {
16
16
  return null;
17
17
  }
18
18
  const itemSeries = series.heatmap?.series[identifier.seriesId];
@@ -22,9 +22,8 @@ const tooltipItemPositionGetter = params => {
22
22
  if (axesConfig.x === undefined || axesConfig.y === undefined || !(0, _internals.isBandScaleConfig)(axesConfig.x) || !(0, _internals.isBandScaleConfig)(axesConfig.y)) {
23
23
  return null;
24
24
  }
25
- const [xIndex, yIndex] = itemSeries.data[identifier.dataIndex];
26
- const x = axesConfig.x.scale(axesConfig.x.scale.domain()[xIndex]);
27
- const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
25
+ const x = axesConfig.x.scale(axesConfig.x.scale.domain()[identifier.xIndex]);
26
+ const y = axesConfig.y.scale(axesConfig.y.scale.domain()[identifier.yIndex]);
28
27
  if (x === undefined || y === undefined) {
29
28
  return null;
30
29
  }
@@ -6,7 +6,7 @@ const tooltipItemPositionGetter = params => {
6
6
  axesConfig,
7
7
  placement
8
8
  } = params;
9
- if (!identifier || identifier.dataIndex === undefined) {
9
+ if (!identifier) {
10
10
  return null;
11
11
  }
12
12
  const itemSeries = series.heatmap?.series[identifier.seriesId];
@@ -16,9 +16,8 @@ const tooltipItemPositionGetter = params => {
16
16
  if (axesConfig.x === undefined || axesConfig.y === undefined || !isBandScaleConfig(axesConfig.x) || !isBandScaleConfig(axesConfig.y)) {
17
17
  return null;
18
18
  }
19
- const [xIndex, yIndex] = itemSeries.data[identifier.dataIndex];
20
- const x = axesConfig.x.scale(axesConfig.x.scale.domain()[xIndex]);
21
- const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
19
+ const x = axesConfig.x.scale(axesConfig.x.scale.domain()[identifier.xIndex]);
20
+ const y = axesConfig.y.scale(axesConfig.y.scale.domain()[identifier.yIndex]);
22
21
  if (x === undefined || y === undefined) {
23
22
  return null;
24
23
  }
@@ -51,7 +51,7 @@ function useHeatmapProps(props) {
51
51
  loading,
52
52
  highlightedItem,
53
53
  onHighlightChange,
54
- enableKeyboardNavigation,
54
+ disableKeyboardNavigation,
55
55
  borderRadius,
56
56
  hideLegend
57
57
  } = props;
@@ -105,7 +105,7 @@ function useHeatmapProps(props) {
105
105
  disableAxisListener: true,
106
106
  highlightedItem,
107
107
  onHighlightChange,
108
- enableKeyboardNavigation,
108
+ disableKeyboardNavigation,
109
109
  onAxisClick,
110
110
  onItemClick,
111
111
  plugins: _Heatmap.HEATMAP_PLUGINS
@@ -43,7 +43,7 @@ export function useHeatmapProps(props) {
43
43
  loading,
44
44
  highlightedItem,
45
45
  onHighlightChange,
46
- enableKeyboardNavigation,
46
+ disableKeyboardNavigation,
47
47
  borderRadius,
48
48
  hideLegend
49
49
  } = props;
@@ -97,7 +97,7 @@ export function useHeatmapProps(props) {
97
97
  disableAxisListener: true,
98
98
  highlightedItem,
99
99
  onHighlightChange,
100
- enableKeyboardNavigation,
100
+ disableKeyboardNavigation,
101
101
  onAxisClick,
102
102
  onItemClick,
103
103
  plugins: HEATMAP_PLUGINS
@@ -150,11 +150,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
150
150
  * @default false
151
151
  */
152
152
  disableAxisListener: _propTypes.default.bool,
153
+ /**
154
+ * If `true`, disables keyboard navigation for the chart.
155
+ */
156
+ disableKeyboardNavigation: _propTypes.default.bool,
153
157
  /**
154
158
  * If `true`, render the line highlight item.
155
159
  */
156
160
  disableLineItemHighlight: _propTypes.default.bool,
157
- enableKeyboardNavigation: _propTypes.default.bool,
158
161
  /**
159
162
  * Options to enable features planned for the next major.
160
163
  */
@@ -339,7 +342,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
339
342
  /**
340
343
  * The callback fired when the tooltip item changes.
341
344
  *
342
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
345
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
343
346
  */
344
347
  onTooltipItemChange: _propTypes.default.func,
345
348
  /**
@@ -143,11 +143,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
143
143
  * @default false
144
144
  */
145
145
  disableAxisListener: PropTypes.bool,
146
+ /**
147
+ * If `true`, disables keyboard navigation for the chart.
148
+ */
149
+ disableKeyboardNavigation: PropTypes.bool,
146
150
  /**
147
151
  * If `true`, render the line highlight item.
148
152
  */
149
153
  disableLineItemHighlight: PropTypes.bool,
150
- enableKeyboardNavigation: PropTypes.bool,
151
154
  /**
152
155
  * Options to enable features planned for the next major.
153
156
  */
@@ -332,7 +335,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
332
335
  /**
333
336
  * The callback fired when the tooltip item changes.
334
337
  *
335
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
338
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
336
339
  */
337
340
  onTooltipItemChange: PropTypes.func,
338
341
  /**
@@ -120,7 +120,10 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
120
120
  */
121
121
  dataset: _propTypes.default.arrayOf(_propTypes.default.object),
122
122
  desc: _propTypes.default.string,
123
- enableKeyboardNavigation: _propTypes.default.bool,
123
+ /**
124
+ * If `true`, disables keyboard navigation for the chart.
125
+ */
126
+ disableKeyboardNavigation: _propTypes.default.bool,
124
127
  /**
125
128
  * The height of the chart in px. If not defined, it takes the height of the parent element.
126
129
  */
@@ -244,7 +247,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
244
247
  /**
245
248
  * The callback fired when the tooltip item changes.
246
249
  *
247
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
250
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
248
251
  */
249
252
  onTooltipItemChange: _propTypes.default.func,
250
253
  /**
@@ -112,7 +112,10 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
112
112
  */
113
113
  dataset: PropTypes.arrayOf(PropTypes.object),
114
114
  desc: PropTypes.string,
115
- enableKeyboardNavigation: PropTypes.bool,
115
+ /**
116
+ * If `true`, disables keyboard navigation for the chart.
117
+ */
118
+ disableKeyboardNavigation: PropTypes.bool,
116
119
  /**
117
120
  * The height of the chart in px. If not defined, it takes the height of the parent element.
118
121
  */
@@ -236,7 +239,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
236
239
  /**
237
240
  * The callback fired when the tooltip item changes.
238
241
  *
239
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
242
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
240
243
  */
241
244
  onTooltipItemChange: PropTypes.func,
242
245
  /**
@@ -85,12 +85,15 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
85
85
  * @default false
86
86
  */
87
87
  disableAxisListener: _propTypes.default.bool,
88
+ /**
89
+ * If `true`, disables keyboard navigation for the chart.
90
+ */
91
+ disableKeyboardNavigation: _propTypes.default.bool,
88
92
  /**
89
93
  * The number of divisions in the radar grid.
90
94
  * @default 5
91
95
  */
92
96
  divisions: _propTypes.default.number,
93
- enableKeyboardNavigation: _propTypes.default.bool,
94
97
  /**
95
98
  * The height of the chart in px. If not defined, it takes the height of the parent element.
96
99
  */
@@ -234,7 +237,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
234
237
  /**
235
238
  * The callback fired when the tooltip item changes.
236
239
  *
237
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
240
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
238
241
  */
239
242
  onTooltipItemChange: _propTypes.default.func,
240
243
  /**
@@ -78,12 +78,15 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
78
78
  * @default false
79
79
  */
80
80
  disableAxisListener: PropTypes.bool,
81
+ /**
82
+ * If `true`, disables keyboard navigation for the chart.
83
+ */
84
+ disableKeyboardNavigation: PropTypes.bool,
81
85
  /**
82
86
  * The number of divisions in the radar grid.
83
87
  * @default 5
84
88
  */
85
89
  divisions: PropTypes.number,
86
- enableKeyboardNavigation: PropTypes.bool,
87
90
  /**
88
91
  * The height of the chart in px. If not defined, it takes the height of the parent element.
89
92
  */
@@ -227,7 +230,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
227
230
  /**
228
231
  * The callback fired when the tooltip item changes.
229
232
  *
230
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
233
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
231
234
  */
232
235
  onTooltipItemChange: PropTypes.func,
233
236
  /**
@@ -95,7 +95,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
95
95
  */
96
96
  colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
97
97
  desc: _propTypes.default.string,
98
- enableKeyboardNavigation: _propTypes.default.bool,
98
+ /**
99
+ * If `true`, disables keyboard navigation for the chart.
100
+ */
101
+ disableKeyboardNavigation: _propTypes.default.bool,
99
102
  /**
100
103
  * Options to enable features planned for the next major.
101
104
  */
@@ -194,7 +197,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
194
197
  /**
195
198
  * The callback fired when the tooltip item changes.
196
199
  *
197
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
200
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
198
201
  */
199
202
  onTooltipItemChange: _propTypes.default.func,
200
203
  /**
@@ -88,7 +88,10 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
88
88
  */
89
89
  colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
90
90
  desc: PropTypes.string,
91
- enableKeyboardNavigation: PropTypes.bool,
91
+ /**
92
+ * If `true`, disables keyboard navigation for the chart.
93
+ */
94
+ disableKeyboardNavigation: PropTypes.bool,
92
95
  /**
93
96
  * Options to enable features planned for the next major.
94
97
  */
@@ -187,7 +190,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
187
190
  /**
188
191
  * The callback fired when the tooltip item changes.
189
192
  *
190
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
193
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
191
194
  */
192
195
  onTooltipItemChange: PropTypes.func,
193
196
  /**
@@ -11,6 +11,7 @@ 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");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  /**
16
17
  * @ignore - internal component.
@@ -22,7 +23,6 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
22
23
  onClick,
23
24
  seriesId
24
25
  } = props;
25
- const store = (0, _internals.useStore)();
26
26
  const identifier = {
27
27
  type: 'sankey',
28
28
  seriesId,
@@ -31,8 +31,9 @@ const SankeyLinkElement = exports.SankeyLinkElement = /*#__PURE__*/React.forward
31
31
  sourceId: link.source.id,
32
32
  link
33
33
  };
34
- const isHighlighted = store.use(_internals.selectorChartsIsHighlighted, identifier);
35
- const isFaded = store.use(_internals.selectorChartsIsFaded, identifier);
34
+ const highlightState = (0, _sankeyHighlightHooks.useSankeyLinkHighlightState)(identifier);
35
+ const isFaded = highlightState === 'faded';
36
+ const isHighlighted = highlightState === 'highlighted';
36
37
 
37
38
  // Add interaction props for tooltips
38
39
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
@@ -3,7 +3,8 @@
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 { selectorChartsIsFaded, selectorChartsIsHighlighted, useInteractionItemProps, useStore } from '@mui/x-charts/internals';
6
+ import { useInteractionItemProps } from '@mui/x-charts/internals';
7
+ import { useSankeyLinkHighlightState } from "./sankeyHighlightHooks.mjs";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  /**
9
10
  * @ignore - internal component.
@@ -15,7 +16,6 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
15
16
  onClick,
16
17
  seriesId
17
18
  } = props;
18
- const store = useStore();
19
19
  const identifier = {
20
20
  type: 'sankey',
21
21
  seriesId,
@@ -24,8 +24,9 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
24
24
  sourceId: link.source.id,
25
25
  link
26
26
  };
27
- const isHighlighted = store.use(selectorChartsIsHighlighted, identifier);
28
- const isFaded = store.use(selectorChartsIsFaded, identifier);
27
+ const highlightState = useSankeyLinkHighlightState(identifier);
28
+ const isFaded = highlightState === 'faded';
29
+ const isHighlighted = highlightState === 'highlighted';
29
30
 
30
31
  // Add interaction props for tooltips
31
32
  const interactionProps = useInteractionItemProps(identifier);
@@ -11,6 +11,7 @@ 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");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  /**
16
17
  * @ignore - internal component.
@@ -21,7 +22,6 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
21
22
  onClick,
22
23
  seriesId
23
24
  } = props;
24
- const store = (0, _internals.useStore)();
25
25
  const x0 = node.x0 ?? 0;
26
26
  const y0 = node.y0 ?? 0;
27
27
  const x1 = node.x1 ?? 0;
@@ -35,8 +35,9 @@ const SankeyNodeElement = exports.SankeyNodeElement = /*#__PURE__*/React.forward
35
35
  nodeId: node.id,
36
36
  node
37
37
  };
38
- const isHighlighted = store.use(_internals.selectorChartsIsHighlighted, identifier);
39
- const isFaded = store.use(_internals.selectorChartsIsFaded, identifier);
38
+ const highlightState = (0, _sankeyHighlightHooks.useSankeyNodeHighlightState)(identifier);
39
+ const isFaded = highlightState === 'faded';
40
+ const isHighlighted = highlightState === 'highlighted';
40
41
 
41
42
  // Add interaction props for tooltips
42
43
  const interactionProps = (0, _internals.useInteractionItemProps)(identifier);
@@ -3,7 +3,8 @@
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 { selectorChartsIsFaded, selectorChartsIsHighlighted, useInteractionItemProps, useStore } from '@mui/x-charts/internals';
6
+ import { useInteractionItemProps } from '@mui/x-charts/internals';
7
+ import { useSankeyNodeHighlightState } from "./sankeyHighlightHooks.mjs";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  /**
9
10
  * @ignore - internal component.
@@ -14,7 +15,6 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
14
15
  onClick,
15
16
  seriesId
16
17
  } = props;
17
- const store = useStore();
18
18
  const x0 = node.x0 ?? 0;
19
19
  const y0 = node.y0 ?? 0;
20
20
  const x1 = node.x1 ?? 0;
@@ -28,8 +28,9 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
28
28
  nodeId: node.id,
29
29
  node
30
30
  };
31
- const isHighlighted = store.use(selectorChartsIsHighlighted, identifier);
32
- const isFaded = store.use(selectorChartsIsFaded, identifier);
31
+ const highlightState = useSankeyNodeHighlightState(identifier);
32
+ const isFaded = highlightState === 'faded';
33
+ const isHighlighted = highlightState === 'highlighted';
33
34
 
34
35
  // Add interaction props for tooltips
35
36
  const interactionProps = useInteractionItemProps(identifier);
@@ -1,3 +1,3 @@
1
1
  import type { SankeyLinkIdentifier, SankeyNodeIdentifier } from "./sankey.types.mjs";
2
- export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): "none" | "highlighted" | "faded";
3
- export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): "none" | "highlighted" | "faded";
2
+ export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): import("@mui/x-charts").HighlightState;
3
+ export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): import("@mui/x-charts").HighlightState;
@@ -1,3 +1,3 @@
1
1
  import type { SankeyLinkIdentifier, SankeyNodeIdentifier } from "./sankey.types.js";
2
- export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): "none" | "highlighted" | "faded";
3
- export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): "none" | "highlighted" | "faded";
2
+ export declare function useSankeyNodeHighlightState(nodeIdentifier: SankeyNodeIdentifier): import("@mui/x-charts").HighlightState;
3
+ export declare function useSankeyLinkHighlightState(linkIdentifier: SankeyLinkIdentifier): import("@mui/x-charts").HighlightState;
@@ -8,17 +8,9 @@ exports.useSankeyNodeHighlightState = useSankeyNodeHighlightState;
8
8
  var _internals = require("@mui/x-charts/internals");
9
9
  function useSankeyNodeHighlightState(nodeIdentifier) {
10
10
  const store = (0, _internals.useStore)();
11
- const isHighlighted = store.use(_internals.selectorChartsIsHighlighted, nodeIdentifier);
12
- const isFaded = store.use(_internals.selectorChartsIsFaded, nodeIdentifier);
13
-
14
- // eslint-disable-next-line no-nested-ternary
15
- return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
11
+ return store.use(_internals.selectorChartsHighlightState, nodeIdentifier);
16
12
  }
17
13
  function useSankeyLinkHighlightState(linkIdentifier) {
18
14
  const store = (0, _internals.useStore)();
19
- const isHighlighted = store.use(_internals.selectorChartsIsHighlighted, linkIdentifier);
20
- const isFaded = store.use(_internals.selectorChartsIsFaded, linkIdentifier);
21
-
22
- // eslint-disable-next-line no-nested-ternary
23
- return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
15
+ return store.use(_internals.selectorChartsHighlightState, linkIdentifier);
24
16
  }
@@ -1,17 +1,9 @@
1
- import { selectorChartsIsFaded, selectorChartsIsHighlighted, useStore } from '@mui/x-charts/internals';
1
+ import { selectorChartsHighlightState, useStore } from '@mui/x-charts/internals';
2
2
  export function useSankeyNodeHighlightState(nodeIdentifier) {
3
3
  const store = useStore();
4
- const isHighlighted = store.use(selectorChartsIsHighlighted, nodeIdentifier);
5
- const isFaded = store.use(selectorChartsIsFaded, nodeIdentifier);
6
-
7
- // eslint-disable-next-line no-nested-ternary
8
- return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
4
+ return store.use(selectorChartsHighlightState, nodeIdentifier);
9
5
  }
10
6
  export function useSankeyLinkHighlightState(linkIdentifier) {
11
7
  const store = useStore();
12
- const isHighlighted = store.use(selectorChartsIsHighlighted, linkIdentifier);
13
- const isFaded = store.use(selectorChartsIsFaded, linkIdentifier);
14
-
15
- // eslint-disable-next-line no-nested-ternary
16
- return isHighlighted ? 'highlighted' : isFaded ? 'faded' : 'none';
8
+ return store.use(selectorChartsHighlightState, linkIdentifier);
17
9
  }
@@ -144,12 +144,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
144
144
  * @default false
145
145
  */
146
146
  disableAxisListener: _propTypes.default.bool,
147
+ /**
148
+ * If `true`, disables keyboard navigation for the chart.
149
+ */
150
+ disableKeyboardNavigation: _propTypes.default.bool,
147
151
  /**
148
152
  * If true, the interaction will not use the Voronoi cell and fall back to hover events.
149
153
  * @default false
150
154
  */
151
155
  disableVoronoi: _propTypes.default.bool,
152
- enableKeyboardNavigation: _propTypes.default.bool,
153
156
  /**
154
157
  * Option to display a cartesian grid in the background.
155
158
  */
@@ -306,7 +309,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
306
309
  /**
307
310
  * The callback fired when the tooltip item changes.
308
311
  *
309
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
312
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
310
313
  */
311
314
  onTooltipItemChange: _propTypes.default.func,
312
315
  /**
@@ -137,12 +137,15 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
137
137
  * @default false
138
138
  */
139
139
  disableAxisListener: PropTypes.bool,
140
+ /**
141
+ * If `true`, disables keyboard navigation for the chart.
142
+ */
143
+ disableKeyboardNavigation: PropTypes.bool,
140
144
  /**
141
145
  * If true, the interaction will not use the Voronoi cell and fall back to hover events.
142
146
  * @default false
143
147
  */
144
148
  disableVoronoi: PropTypes.bool,
145
- enableKeyboardNavigation: PropTypes.bool,
146
149
  /**
147
150
  * Option to display a cartesian grid in the background.
148
151
  */
@@ -299,7 +302,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
299
302
  /**
300
303
  * The callback fired when the tooltip item changes.
301
304
  *
302
- * @param {SeriesItemIdentifier<TSeries> | null} tooltipItem The newly highlighted item.
305
+ * @param {SeriesItemIdentifier<SeriesType> | null} tooltipItem The newly highlighted item.
303
306
  */
304
307
  onTooltipItemChange: PropTypes.func,
305
308
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v9.0.0-alpha.2
2
+ * @mui/x-charts-pro v9.0.0-alpha.3
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts-pro v9.0.0-alpha.2
2
+ * @mui/x-charts-pro v9.0.0-alpha.3
3
3
  *
4
4
  * @license SEE LICENSE IN LICENSE
5
5
  * This source code is licensed under the SEE LICENSE IN LICENSE license found in the
@@ -1,6 +1,6 @@
1
- import type { MuiCommercialPackageName } from '@mui/x-license/utils';
1
+ import { type CommercialPackageInfo } from '@mui/x-license/internals';
2
2
  interface ChartsWatermarkProps {
3
- packageName: MuiCommercialPackageName;
3
+ packageInfo: CommercialPackageInfo;
4
4
  }
5
5
  export declare function ChartsWatermark(props: ChartsWatermarkProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,6 +1,6 @@
1
- import type { MuiCommercialPackageName } from '@mui/x-license/utils';
1
+ import { type CommercialPackageInfo } from '@mui/x-license/internals';
2
2
  interface ChartsWatermarkProps {
3
- packageName: MuiCommercialPackageName;
3
+ packageInfo: CommercialPackageInfo;
4
4
  }
5
5
  export declare function ChartsWatermark(props: ChartsWatermarkProps): import("react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -8,20 +8,17 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.ChartsWatermark = ChartsWatermark;
9
9
  var React = _interopRequireWildcard(require("react"));
10
10
  var ReactDOM = _interopRequireWildcard(require("react-dom"));
11
- var _Watermark = require("@mui/x-license/Watermark");
11
+ var _internals = require("@mui/x-license/internals");
12
12
  var _hooks = require("../hooks");
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
15
14
  function ChartsWatermark(props) {
16
15
  const layerContainerRef = (0, _hooks.useChartsLayerContainerRef)();
17
16
  if (!layerContainerRef.current) {
18
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
19
- packageName: props.packageName,
20
- releaseInfo: releaseInfo
17
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.Watermark, {
18
+ packageInfo: props.packageInfo
21
19
  });
22
20
  }
23
- return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Watermark.Watermark, {
24
- packageName: props.packageName,
25
- releaseInfo: releaseInfo
21
+ return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.Watermark, {
22
+ packageInfo: props.packageInfo
26
23
  }), layerContainerRef.current);
27
24
  }
@@ -2,20 +2,17 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import * as ReactDOM from 'react-dom';
5
- import { Watermark } from '@mui/x-license/Watermark';
5
+ import { Watermark } from '@mui/x-license/internals';
6
6
  import { useChartsLayerContainerRef } from "../hooks/index.mjs";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const releaseInfo = "MTc3MjY2ODgwMDAwMA==";
9
8
  export function ChartsWatermark(props) {
10
9
  const layerContainerRef = useChartsLayerContainerRef();
11
10
  if (!layerContainerRef.current) {
12
11
  return /*#__PURE__*/_jsx(Watermark, {
13
- packageName: props.packageName,
14
- releaseInfo: releaseInfo
12
+ packageInfo: props.packageInfo
15
13
  });
16
14
  }
17
15
  return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/_jsx(Watermark, {
18
- packageName: props.packageName,
19
- releaseInfo: releaseInfo
16
+ packageInfo: props.packageInfo
20
17
  }), layerContainerRef.current);
21
18
  }