@mui/x-charts-pro 8.27.2 → 9.0.0-alpha.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 (222) hide show
  1. package/BarChartPro/BarChartPro.d.ts +1 -1
  2. package/BarChartPro/BarChartPro.js +30 -8
  3. package/CHANGELOG.md +279 -34
  4. package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
  5. package/ChartContainerPro/ChartContainerPro.js +14 -287
  6. package/ChartContainerPro/useChartContainerProProps.d.ts +10 -7
  7. package/ChartContainerPro/useChartContainerProProps.js +10 -35
  8. package/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
  9. package/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
  10. package/ChartDataProviderPro/index.d.ts +1 -1
  11. package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
  12. package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -6
  13. package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +6 -4
  14. package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
  15. package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
  16. package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
  17. package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
  18. package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
  19. package/ChartsContainer/index.d.ts +1 -0
  20. package/ChartsContainer/index.js +16 -0
  21. package/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
  22. package/ChartsContainerPro/ChartsContainerPro.js +188 -0
  23. package/ChartsContainerPro/index.d.ts +9 -0
  24. package/ChartsContainerPro/index.js +17 -0
  25. package/ChartsContainerPro/useChartsContainerProProps.d.ts +8 -0
  26. package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
  27. package/FunnelChart/FunnelChart.d.ts +1 -1
  28. package/FunnelChart/FunnelChart.js +9 -8
  29. package/FunnelChart/FunnelSection.d.ts +1 -1
  30. package/FunnelChart/funnel.types.d.ts +1 -1
  31. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +12 -9
  32. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
  33. package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
  34. package/FunnelChart/funnelSlots.types.d.ts +3 -9
  35. package/FunnelChart/index.d.ts +2 -1
  36. package/FunnelChart/index.js +12 -0
  37. package/FunnelChart/seriesConfig/index.js +2 -1
  38. package/FunnelChart/seriesConfig/keyboardFocusHandler.js +1 -14
  39. package/FunnelChart/seriesConfig/legend.js +0 -1
  40. package/Heatmap/Heatmap.d.ts +6 -3
  41. package/Heatmap/Heatmap.js +46 -135
  42. package/Heatmap/Heatmap.types.d.ts +19 -0
  43. package/Heatmap/Heatmap.types.js +5 -0
  44. package/Heatmap/HeatmapItem.d.ts +6 -0
  45. package/Heatmap/HeatmapItem.js +11 -3
  46. package/Heatmap/HeatmapPlot.d.ts +7 -3
  47. package/Heatmap/HeatmapPlot.js +16 -54
  48. package/Heatmap/HeatmapSVGPlot.d.ts +2 -0
  49. package/Heatmap/HeatmapSVGPlot.js +70 -0
  50. package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +18 -2
  51. package/Heatmap/HeatmapTooltip/index.d.ts +1 -1
  52. package/Heatmap/index.d.ts +3 -2
  53. package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
  54. package/Heatmap/seriesConfig/getItemAtPosition.js +6 -2
  55. package/Heatmap/seriesConfig/index.js +1 -0
  56. package/Heatmap/useHeatmapProps.d.ts +24 -0
  57. package/Heatmap/useHeatmapProps.js +159 -0
  58. package/LineChartPro/LineChartPro.d.ts +1 -1
  59. package/LineChartPro/LineChartPro.js +30 -8
  60. package/PieChartPro/PieChartPro.d.ts +1 -1
  61. package/PieChartPro/PieChartPro.js +9 -8
  62. package/RadarChartPro/RadarChartPro.d.ts +1 -1
  63. package/RadarChartPro/RadarChartPro.js +8 -8
  64. package/SankeyChart/SankeyChart.d.ts +1 -1
  65. package/SankeyChart/SankeyChart.js +9 -23
  66. package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
  67. package/SankeyChart/SankeyTooltip/index.d.ts +1 -1
  68. package/SankeyChart/index.d.ts +1 -1
  69. package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
  70. package/SankeyChart/sankey.highlight.types.d.ts +4 -0
  71. package/SankeyChart/sankey.types.d.ts +6 -3
  72. package/SankeyChart/sankeySlots.types.d.ts +3 -9
  73. package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
  74. package/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
  75. package/SankeyChart/seriesConfig/identifierCleaner.js +24 -0
  76. package/SankeyChart/seriesConfig/index.js +3 -1
  77. package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
  78. package/ScatterChartPro/ScatterChartPro.js +30 -8
  79. package/esm/BarChartPro/BarChartPro.d.ts +1 -1
  80. package/esm/BarChartPro/BarChartPro.js +30 -8
  81. package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
  82. package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
  83. package/esm/ChartContainerPro/useChartContainerProProps.d.ts +10 -7
  84. package/esm/ChartContainerPro/useChartContainerProProps.js +11 -34
  85. package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
  86. package/esm/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
  87. package/esm/ChartDataProviderPro/index.d.ts +1 -1
  88. package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
  89. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +9 -7
  90. package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +7 -5
  91. package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
  92. package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
  93. package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
  94. package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
  95. package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
  96. package/esm/ChartsContainer/index.d.ts +1 -0
  97. package/esm/ChartsContainer/index.js +2 -0
  98. package/esm/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
  99. package/esm/ChartsContainerPro/ChartsContainerPro.js +182 -0
  100. package/esm/ChartsContainerPro/index.d.ts +9 -0
  101. package/esm/ChartsContainerPro/index.js +6 -0
  102. package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +8 -0
  103. package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
  104. package/esm/FunnelChart/FunnelChart.d.ts +1 -1
  105. package/esm/FunnelChart/FunnelChart.js +9 -8
  106. package/esm/FunnelChart/FunnelSection.d.ts +1 -1
  107. package/esm/FunnelChart/funnel.types.d.ts +1 -1
  108. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +13 -10
  109. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
  110. package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
  111. package/esm/FunnelChart/funnelSlots.types.d.ts +3 -9
  112. package/esm/FunnelChart/index.d.ts +2 -1
  113. package/esm/FunnelChart/index.js +1 -0
  114. package/esm/FunnelChart/seriesConfig/index.js +3 -2
  115. package/esm/FunnelChart/seriesConfig/keyboardFocusHandler.js +2 -15
  116. package/esm/FunnelChart/seriesConfig/legend.js +0 -1
  117. package/esm/Heatmap/Heatmap.d.ts +6 -3
  118. package/esm/Heatmap/Heatmap.js +47 -136
  119. package/esm/Heatmap/Heatmap.types.d.ts +19 -0
  120. package/esm/Heatmap/Heatmap.types.js +1 -0
  121. package/esm/Heatmap/HeatmapItem.d.ts +6 -0
  122. package/esm/Heatmap/HeatmapItem.js +11 -3
  123. package/esm/Heatmap/HeatmapPlot.d.ts +7 -3
  124. package/esm/Heatmap/HeatmapPlot.js +17 -56
  125. package/esm/Heatmap/HeatmapSVGPlot.d.ts +2 -0
  126. package/esm/Heatmap/HeatmapSVGPlot.js +64 -0
  127. package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +18 -2
  128. package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -1
  129. package/esm/Heatmap/index.d.ts +3 -2
  130. package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
  131. package/esm/Heatmap/seriesConfig/getItemAtPosition.js +6 -2
  132. package/esm/Heatmap/seriesConfig/index.js +2 -1
  133. package/esm/Heatmap/useHeatmapProps.d.ts +24 -0
  134. package/esm/Heatmap/useHeatmapProps.js +151 -0
  135. package/esm/LineChartPro/LineChartPro.d.ts +1 -1
  136. package/esm/LineChartPro/LineChartPro.js +30 -8
  137. package/esm/PieChartPro/PieChartPro.d.ts +1 -1
  138. package/esm/PieChartPro/PieChartPro.js +9 -8
  139. package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
  140. package/esm/RadarChartPro/RadarChartPro.js +8 -8
  141. package/esm/SankeyChart/SankeyChart.d.ts +1 -1
  142. package/esm/SankeyChart/SankeyChart.js +9 -23
  143. package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
  144. package/esm/SankeyChart/SankeyTooltip/index.d.ts +1 -1
  145. package/esm/SankeyChart/index.d.ts +1 -1
  146. package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
  147. package/esm/SankeyChart/sankey.highlight.types.d.ts +4 -0
  148. package/esm/SankeyChart/sankey.types.d.ts +6 -3
  149. package/esm/SankeyChart/sankeySlots.types.d.ts +3 -9
  150. package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
  151. package/esm/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
  152. package/esm/SankeyChart/seriesConfig/identifierCleaner.js +18 -0
  153. package/esm/SankeyChart/seriesConfig/index.js +3 -1
  154. package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
  155. package/esm/ScatterChartPro/ScatterChartPro.js +30 -8
  156. package/esm/index.d.ts +3 -1
  157. package/esm/index.js +2 -1
  158. package/esm/internals/index.d.ts +7 -1
  159. package/esm/internals/index.js +5 -1
  160. package/esm/internals/plugins/useChartProExport/common.d.ts +5 -1
  161. package/esm/internals/plugins/useChartProExport/common.js +36 -0
  162. package/esm/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
  163. package/esm/internals/plugins/useChartProExport/exportImage.js +2 -1
  164. package/esm/internals/plugins/useChartProExport/print.d.ts +1 -1
  165. package/esm/internals/plugins/useChartProExport/print.js +2 -1
  166. package/esm/internals/plugins/useChartProExport/useChartProExport.js +4 -2
  167. package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
  168. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
  169. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
  170. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
  171. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
  172. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
  173. package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +6 -4
  174. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
  175. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +7 -5
  176. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
  177. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
  178. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
  179. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +6 -4
  180. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
  181. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +6 -4
  182. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
  183. package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +6 -4
  184. package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
  185. package/esm/models/seriesType/heatmap.d.ts +3 -3
  186. package/esm/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
  187. package/esm/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
  188. package/esm/typeOverloads/modules.d.ts +9 -5
  189. package/index.d.ts +3 -1
  190. package/index.js +9 -1
  191. package/internals/index.d.ts +7 -1
  192. package/internals/index.js +43 -1
  193. package/internals/plugins/useChartProExport/common.d.ts +5 -1
  194. package/internals/plugins/useChartProExport/common.js +37 -0
  195. package/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
  196. package/internals/plugins/useChartProExport/exportImage.js +1 -0
  197. package/internals/plugins/useChartProExport/print.d.ts +1 -1
  198. package/internals/plugins/useChartProExport/print.js +1 -0
  199. package/internals/plugins/useChartProExport/useChartProExport.js +4 -2
  200. package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
  201. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
  202. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
  203. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
  204. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
  205. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
  206. package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +5 -3
  207. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
  208. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +6 -4
  209. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
  210. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
  211. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
  212. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +5 -3
  213. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
  214. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +5 -3
  215. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
  216. package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +5 -3
  217. package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
  218. package/models/seriesType/heatmap.d.ts +3 -3
  219. package/package.json +19 -11
  220. package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
  221. package/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
  222. package/typeOverloads/modules.d.ts +9 -5
@@ -0,0 +1,151 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import useId from '@mui/utils/useId';
3
+ import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
4
+ import * as React from 'react';
5
+ import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
6
+ import { ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
7
+ import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
8
+ import { heatmapSeriesConfig } from "./seriesConfig/index.js";
9
+ const seriesConfig = {
10
+ heatmap: heatmapSeriesConfig
11
+ };
12
+
13
+ // The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
14
+ const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
15
+ function getDefaultDataForAxis(series, dimension) {
16
+ if (series?.[0]?.data === undefined || series[0].data.length === 0) {
17
+ return [];
18
+ }
19
+ return Array.from({
20
+ length: Math.max(...series[0].data.map(dataPoint => dataPoint[dimension])) + 1
21
+ }, (_, index) => index);
22
+ }
23
+ const getDefaultDataForXAxis = series => getDefaultDataForAxis(series, 0);
24
+ const getDefaultDataForYAxis = series => getDefaultDataForAxis(series, 1);
25
+ export function useHeatmapProps(props) {
26
+ const {
27
+ apiRef,
28
+ xAxis,
29
+ yAxis,
30
+ zAxis,
31
+ series,
32
+ width,
33
+ height,
34
+ margin,
35
+ colors,
36
+ dataset,
37
+ sx,
38
+ onAxisClick,
39
+ onItemClick,
40
+ children,
41
+ slots,
42
+ slotProps,
43
+ loading,
44
+ highlightedItem,
45
+ onHighlightChange,
46
+ enableKeyboardNavigation,
47
+ borderRadius,
48
+ hideLegend
49
+ } = props;
50
+ const id = useId();
51
+ const clipPathId = `${id}-clip-path`;
52
+ const xAxisWithDefault = React.useMemo(() => (xAxis && xAxis.length > 0 ? xAxis : [{
53
+ id: DEFAULT_X_AXIS_KEY
54
+ }]).map(axis => _extends({
55
+ scaleType: 'band',
56
+ categoryGapRatio: 0
57
+ }, axis, {
58
+ data: axis.data ?? getDefaultDataForXAxis(series)
59
+ })), [series, xAxis]);
60
+ const yAxisWithDefault = React.useMemo(() => (yAxis && yAxis.length > 0 ? yAxis : [{
61
+ id: DEFAULT_Y_AXIS_KEY
62
+ }]).map(axis => _extends({
63
+ scaleType: 'band',
64
+ categoryGapRatio: 0
65
+ }, axis, {
66
+ data: axis.data ?? getDefaultDataForYAxis(series)
67
+ })), [series, yAxis]);
68
+ const zAxisWithDefault = React.useMemo(() => zAxis ?? [{
69
+ colorMap: {
70
+ type: 'continuous',
71
+ min: 0,
72
+ max: 100,
73
+ color: defaultColorMap
74
+ }
75
+ }], [zAxis]);
76
+ const seriesWithDefault = series.map(s => _extends({
77
+ type: 'heatmap'
78
+ }, s));
79
+ const chartsWrapperProps = {
80
+ sx,
81
+ legendPosition: props.slotProps?.legend?.position,
82
+ legendDirection: props.slotProps?.legend?.direction,
83
+ hideLegend
84
+ };
85
+ const chartDataProviderProProps = {
86
+ apiRef,
87
+ seriesConfig,
88
+ series: seriesWithDefault,
89
+ width,
90
+ height,
91
+ margin,
92
+ xAxis: xAxisWithDefault,
93
+ yAxis: yAxisWithDefault,
94
+ zAxis: zAxisWithDefault,
95
+ colors,
96
+ dataset,
97
+ disableAxisListener: true,
98
+ highlightedItem,
99
+ onHighlightChange,
100
+ enableKeyboardNavigation,
101
+ onAxisClick,
102
+ onItemClick,
103
+ plugins: HEATMAP_PLUGINS
104
+ };
105
+ const heatmapPlotProps = {
106
+ borderRadius,
107
+ slots,
108
+ slotProps
109
+ };
110
+ const overlayProps = {
111
+ slots,
112
+ slotProps,
113
+ loading
114
+ };
115
+ const clipPathGroupProps = {
116
+ clipPath: `url(#${clipPathId})`
117
+ };
118
+ const clipPathProps = {
119
+ id: clipPathId
120
+ };
121
+ const chartsAxisProps = {
122
+ slots,
123
+ slotProps
124
+ };
125
+ const legendProps = {
126
+ slots: _extends({}, slots, {
127
+ legend: slots?.legend ?? ContinuousColorLegend
128
+ }),
129
+ slotProps: {
130
+ legend: _extends({
131
+ labelPosition: 'extremes'
132
+ }, slotProps?.legend)
133
+ },
134
+ sx: slotProps?.legend?.direction === 'vertical' ? {
135
+ height: 150
136
+ } : {
137
+ width: '50%'
138
+ }
139
+ };
140
+ return {
141
+ chartDataProviderProProps,
142
+ chartsWrapperProps,
143
+ heatmapPlotProps,
144
+ clipPathProps,
145
+ clipPathGroupProps,
146
+ overlayProps,
147
+ chartsAxisProps,
148
+ legendProps,
149
+ children
150
+ };
151
+ }
@@ -28,5 +28,5 @@ export interface LineChartProProps extends Omit<LineChartProps, 'apiRef' | 'slot
28
28
  *
29
29
  * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
30
30
  */
31
- declare const LineChartPro: React.ForwardRefExoticComponent<LineChartProProps & React.RefAttributes<SVGSVGElement>>;
31
+ declare const LineChartPro: React.ForwardRefExoticComponent<LineChartProProps & React.RefAttributes<HTMLDivElement>>;
32
32
  export { LineChartPro };
@@ -72,11 +72,12 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
72
72
  onZoomChange,
73
73
  apiRef,
74
74
  plugins: LINE_CHART_PRO_PLUGINS
75
- }), ref);
75
+ }));
76
76
  const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
77
77
  const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
78
78
  return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
79
79
  children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
80
+ ref: ref,
80
81
  children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
81
82
  children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
82
83
  children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
@@ -102,6 +103,11 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
102
103
  setZoomData: PropTypes.func.isRequired
103
104
  })
104
105
  }),
106
+ /**
107
+ * A gap added between axes when multiple axes are rendered on the same side of the chart.
108
+ * @default 0
109
+ */
110
+ axesGap: PropTypes.number,
105
111
  /**
106
112
  * The configuration of axes highlight.
107
113
  * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
@@ -181,8 +187,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
181
187
  */
182
188
  hiddenItems: PropTypes.arrayOf(PropTypes.shape({
183
189
  dataIndex: PropTypes.number,
184
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
185
- type: PropTypes.oneOf(['line']).isRequired
190
+ seriesId: PropTypes.string.isRequired,
191
+ type: PropTypes.oneOf(['line'])
186
192
  })),
187
193
  /**
188
194
  * If `true`, the legend is not rendered.
@@ -202,7 +208,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
202
208
  */
203
209
  highlightedItem: PropTypes.shape({
204
210
  dataIndex: PropTypes.number,
205
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
211
+ seriesId: PropTypes.string.isRequired
206
212
  }),
207
213
  /**
208
214
  * This prop is used to help implement the accessibility logic.
@@ -232,8 +238,8 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
232
238
  */
233
239
  initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
234
240
  dataIndex: PropTypes.number,
235
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
236
- type: PropTypes.oneOf(['line']).isRequired
241
+ seriesId: PropTypes.string.isRequired,
242
+ type: PropTypes.oneOf(['line'])
237
243
  })),
238
244
  /**
239
245
  * The list of zoom data related to each axis.
@@ -303,6 +309,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
303
309
  * Callback fired when a mark element is clicked.
304
310
  */
305
311
  onMarkClick: PropTypes.func,
312
+ /**
313
+ * The function called when the pointer position corresponds to a new axis data item.
314
+ * This update can either be caused by a pointer movement, or an axis update.
315
+ * In case of multiple axes, the function is called if at least one axis is updated.
316
+ * The argument contains the identifier for all axes with a `data` property.
317
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
318
+ */
319
+ onTooltipAxisChange: PropTypes.func,
306
320
  /**
307
321
  * The callback fired when the tooltip item changes.
308
322
  *
@@ -343,14 +357,22 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
343
357
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
344
358
  theme: PropTypes.oneOf(['dark', 'light']),
345
359
  title: PropTypes.string,
360
+ /**
361
+ * The controlled axis tooltip.
362
+ * Identified by the axis id, and data index.
363
+ */
364
+ tooltipAxis: PropTypes.arrayOf(PropTypes.shape({
365
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
366
+ dataIndex: PropTypes.number.isRequired
367
+ })),
346
368
  /**
347
369
  * The tooltip item.
348
370
  * Used when the tooltip is controlled.
349
371
  */
350
372
  tooltipItem: PropTypes.shape({
351
373
  dataIndex: PropTypes.number,
352
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
353
- type: PropTypes.oneOf(['line']).isRequired
374
+ seriesId: PropTypes.string.isRequired,
375
+ type: PropTypes.oneOf(['line'])
354
376
  }),
355
377
  /**
356
378
  * The width of the chart in px. If not defined, it takes the width of the parent element.
@@ -18,5 +18,5 @@ export interface PieChartProProps extends Omit<PieChartProps, 'apiRef' | 'slots'
18
18
  */
19
19
  slotProps?: PieChartProSlotProps;
20
20
  }
21
- declare const PieChartPro: React.ForwardRefExoticComponent<PieChartProProps & React.RefAttributes<SVGSVGElement>>;
21
+ declare const PieChartPro: React.ForwardRefExoticComponent<PieChartProProps & React.RefAttributes<HTMLDivElement>>;
22
22
  export { PieChartPro };
@@ -58,7 +58,7 @@ const PieChartPro = /*#__PURE__*/React.forwardRef(function PieChartPro(inProps,
58
58
  className,
59
59
  skipAnimation,
60
60
  plugins: PIE_CHART_PRO_PLUGINS
61
- }), ref);
61
+ }));
62
62
  const Tooltip = slots?.tooltip ?? ChartsTooltip;
63
63
  const Toolbar = slots?.toolbar ?? ChartsToolbarPro;
64
64
  return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
@@ -67,6 +67,7 @@ const PieChartPro = /*#__PURE__*/React.forwardRef(function PieChartPro(inProps,
67
67
  legendDirection: slotProps?.legend?.direction ?? 'vertical',
68
68
  sx: sx,
69
69
  hideLegend: hideLegend ?? false,
70
+ ref: ref,
70
71
  children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
71
72
  direction: slotProps?.legend?.direction ?? 'vertical',
72
73
  slots: slots,
@@ -138,8 +139,8 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
138
139
  */
139
140
  hiddenItems: PropTypes.arrayOf(PropTypes.shape({
140
141
  dataIndex: PropTypes.number,
141
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
142
- type: PropTypes.oneOf(['pie']).isRequired
142
+ seriesId: PropTypes.string.isRequired,
143
+ type: PropTypes.oneOf(['pie'])
143
144
  })),
144
145
  /**
145
146
  * If `true`, the legend is not rendered.
@@ -151,7 +152,7 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
151
152
  */
152
153
  highlightedItem: PropTypes.shape({
153
154
  dataIndex: PropTypes.number,
154
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
155
+ seriesId: PropTypes.string.isRequired
155
156
  }),
156
157
  /**
157
158
  * This prop is used to help implement the accessibility logic.
@@ -181,8 +182,8 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
181
182
  */
182
183
  initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
183
184
  dataIndex: PropTypes.number,
184
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
185
- type: PropTypes.oneOf(['pie']).isRequired
185
+ seriesId: PropTypes.string.isRequired,
186
+ type: PropTypes.oneOf(['pie'])
186
187
  })),
187
188
  /**
188
189
  * If `true`, a loading overlay is displayed.
@@ -260,8 +261,8 @@ process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
260
261
  */
261
262
  tooltipItem: PropTypes.shape({
262
263
  dataIndex: PropTypes.number.isRequired,
263
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
264
- type: PropTypes.oneOf(['pie']).isRequired
264
+ seriesId: PropTypes.string.isRequired,
265
+ type: PropTypes.oneOf(['pie'])
265
266
  }),
266
267
  /**
267
268
  * The width of the chart in px. If not defined, it takes the width of the parent element.
@@ -26,5 +26,5 @@ export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'sl
26
26
  *
27
27
  * - [RadarChart API](https://mui.com/x/api/charts/radar-chart/)
28
28
  */
29
- declare const RadarChartPro: React.ForwardRefExoticComponent<RadarChartProProps & React.RefAttributes<SVGSVGElement>>;
29
+ declare const RadarChartPro: React.ForwardRefExoticComponent<RadarChartProProps & React.RefAttributes<HTMLDivElement>>;
30
30
  export { RadarChartPro };
@@ -46,8 +46,8 @@ const RadarChartPro = /*#__PURE__*/React.forwardRef(function RadarChartPro(inPro
46
46
  });
47
47
  return /*#__PURE__*/_jsx(RadarDataProvider, _extends({}, radarDataProviderProProps, {
48
48
  children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
49
+ ref: ref,
49
50
  children: [props.showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
50
- ref: ref,
51
51
  children: [/*#__PURE__*/_jsx(RadarGrid, _extends({}, radarGrid)), /*#__PURE__*/_jsx(RadarMetricLabels, {}), /*#__PURE__*/_jsx(RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/_jsx(RadarAxisHighlight, {}), /*#__PURE__*/_jsx(RadarSeriesMarks, {}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), children]
52
52
  })), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
53
53
  }))
@@ -110,8 +110,8 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
110
110
  */
111
111
  hiddenItems: PropTypes.arrayOf(PropTypes.shape({
112
112
  dataIndex: PropTypes.number,
113
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
114
- type: PropTypes.oneOf(['radar']).isRequired
113
+ seriesId: PropTypes.string.isRequired,
114
+ type: PropTypes.oneOf(['radar'])
115
115
  })),
116
116
  /**
117
117
  * If `true`, the legend is not rendered.
@@ -128,7 +128,7 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
128
128
  */
129
129
  highlightedItem: PropTypes.shape({
130
130
  dataIndex: PropTypes.number,
131
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
131
+ seriesId: PropTypes.string.isRequired
132
132
  }),
133
133
  /**
134
134
  * This prop is used to help implement the accessibility logic.
@@ -158,8 +158,8 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
158
158
  */
159
159
  initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
160
160
  dataIndex: PropTypes.number,
161
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
162
- type: PropTypes.oneOf(['radar']).isRequired
161
+ seriesId: PropTypes.string.isRequired,
162
+ type: PropTypes.oneOf(['radar'])
163
163
  })),
164
164
  /**
165
165
  * If `true`, a loading overlay is displayed.
@@ -278,8 +278,8 @@ process.env.NODE_ENV !== "production" ? RadarChartPro.propTypes = {
278
278
  */
279
279
  tooltipItem: PropTypes.shape({
280
280
  dataIndex: PropTypes.number,
281
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
282
- type: PropTypes.oneOf(['radar']).isRequired
281
+ seriesId: PropTypes.string.isRequired,
282
+ type: PropTypes.oneOf(['radar'])
283
283
  }),
284
284
  /**
285
285
  * The width of the chart in px. If not defined, it takes the width of the parent element.
@@ -28,5 +28,5 @@ export interface SankeyChartProps extends Omit<ChartContainerProProps<'sankey',
28
28
  *
29
29
  * - [SankeyChart API](https://mui.com/x/api/charts/sankey-chart/)
30
30
  */
31
- declare const SankeyChart: React.ForwardRefExoticComponent<SankeyChartProps & React.RefAttributes<SVGSVGElement>>;
31
+ declare const SankeyChart: React.ForwardRefExoticComponent<SankeyChartProps & React.RefAttributes<HTMLDivElement>>;
32
32
  export { SankeyChart };
@@ -43,7 +43,7 @@ const SankeyChart = /*#__PURE__*/React.forwardRef(function SankeyChart(props, re
43
43
  chartsWrapperProps,
44
44
  children
45
45
  } = useSankeyChartProps(themedProps);
46
- const _useChartContainerPro = useChartContainerProProps(chartContainerProps, ref),
46
+ const _useChartContainerPro = useChartContainerProProps(chartContainerProps),
47
47
  {
48
48
  chartDataProviderProProps: {
49
49
  series
@@ -56,6 +56,7 @@ const SankeyChart = /*#__PURE__*/React.forwardRef(function SankeyChart(props, re
56
56
  series: series
57
57
  }, chartDataProviderProProps, {
58
58
  children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
59
+ ref: ref,
59
60
  children: [/*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
60
61
  children: [/*#__PURE__*/_jsx(SankeyPlot, _extends({}, sankeyPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(FocusedSankeyNode, {}), /*#__PURE__*/_jsx(FocusedSankeyLink, {}), children]
61
62
  })), !themedProps.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
@@ -104,7 +105,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
104
105
  */
105
106
  highlightedItem: PropTypes.oneOfType([PropTypes.shape({
106
107
  nodeId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
107
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
108
+ seriesId: PropTypes.string.isRequired,
108
109
  subType: PropTypes.oneOf([
109
110
  /**
110
111
  * Subtype to differentiate between node and link
@@ -112,7 +113,7 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
112
113
  'node']).isRequired,
113
114
  type: PropTypes.oneOf(['sankey']).isRequired
114
115
  }), PropTypes.shape({
115
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
116
+ seriesId: PropTypes.string.isRequired,
116
117
  sourceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
117
118
  subType: PropTypes.oneOf([
118
119
  /**
@@ -194,26 +195,11 @@ process.env.NODE_ENV !== "production" ? SankeyChart.propTypes = {
194
195
  * The tooltip item.
195
196
  * Used when the tooltip is controlled.
196
197
  */
197
- tooltipItem: PropTypes.oneOfType([PropTypes.shape({
198
- nodeId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
199
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
200
- subType: PropTypes.oneOf([
201
- /**
202
- * Subtype to differentiate between node and link
203
- */
204
- 'node']).isRequired,
205
- type: PropTypes.oneOf(['sankey']).isRequired
206
- }), PropTypes.shape({
207
- seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
208
- sourceId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
209
- subType: PropTypes.oneOf([
210
- /**
211
- * Subtype to differentiate between node and link
212
- */
213
- 'link']).isRequired,
214
- targetId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
215
- type: PropTypes.oneOf(['sankey']).isRequired
216
- })]),
198
+ tooltipItem: PropTypes.shape({
199
+ seriesId: PropTypes.string.isRequired,
200
+ subType: PropTypes.oneOf(['link', 'node']).isRequired,
201
+ type: PropTypes.oneOf(['sankey'])
202
+ }),
217
203
  /**
218
204
  * The width of the chart in px. If not defined, it takes the width of the parent element.
219
205
  */
@@ -1,4 +1,8 @@
1
- import { type ChartsTooltipContainerProps } from '@mui/x-charts/ChartsTooltip';
1
+ import { type ChartsTooltipContainerProps, type ChartsTooltipClasses, type ChartsTooltipSlots, type ChartsTooltipSlotProps } from '@mui/x-charts/ChartsTooltip';
2
+ export interface SankeyTooltipSlots extends ChartsTooltipSlots {}
3
+ export interface SankeyTooltipSlotProps extends ChartsTooltipSlotProps {}
4
+ export interface SankeyTooltipClasses extends ChartsTooltipClasses {}
5
+ export interface SankeyTooltipContentClasses extends ChartsTooltipClasses {}
2
6
  export interface SankeyTooltipProps extends Omit<ChartsTooltipContainerProps, 'trigger' | 'children'> {
3
7
  /**
4
8
  * Select the kind of tooltip to display
@@ -1,3 +1,3 @@
1
1
  export * from "./SankeyTooltip.js";
2
2
  export * from "./SankeyTooltipContent.js";
3
- export type { SankeyTooltipProps } from "./SankeyTooltip.types.js";
3
+ export type { SankeyTooltipProps, SankeyTooltipClasses, SankeyTooltipContentClasses, SankeyTooltipSlots, SankeyTooltipSlotProps } from "./SankeyTooltip.types.js";
@@ -14,4 +14,4 @@ export * from "./sankeyHighlightHooks.js";
14
14
  export * from "../hooks/useSankeySeries.js";
15
15
  export { type SankeyPlotClasses, sankeyPlotClasses } from "./sankeyClasses.js";
16
16
  export { SankeyTooltip, SankeyTooltipContent } from "./SankeyTooltip/index.js";
17
- export type { SankeyTooltipProps } from "./SankeyTooltip/index.js";
17
+ export type { SankeyTooltipProps, SankeyTooltipClasses, SankeyTooltipContentClasses, SankeyTooltipSlots, SankeyTooltipSlotProps } from "./SankeyTooltip/index.js";
@@ -4,28 +4,28 @@ import type { SankeyLinkFade, SankeyLinkHighlight, SankeyNodeFade, SankeyNodeHig
4
4
  * Get the node highlight configuration from the Sankey series.
5
5
  * Defaults to 'nodes' if not specified.
6
6
  */
7
- export declare const selectorNodeHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
7
+ export declare const selectorNodeHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
8
8
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
9
9
  }) => SankeyNodeHighlight;
10
10
  /**
11
11
  * Get the node fade configuration from the Sankey series.
12
12
  * Defaults to 'none' if not specified.
13
13
  */
14
- export declare const selectorNodeFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
14
+ export declare const selectorNodeFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
15
15
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
16
16
  }) => SankeyNodeFade;
17
17
  /**
18
18
  * Get the link highlight configuration from the Sankey series.
19
19
  * Defaults to 'links' if not specified.
20
20
  */
21
- export declare const selectorLinkHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
21
+ export declare const selectorLinkHighlightConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
22
22
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
23
23
  }) => SankeyLinkHighlight;
24
24
  /**
25
25
  * Get the link fade configuration from the Sankey series.
26
26
  * Defaults to 'none' if not specified.
27
27
  */
28
- export declare const selectorLinkFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
28
+ export declare const selectorLinkFadeConfig: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
29
29
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
30
30
  }) => SankeyLinkFade;
31
31
  /**
@@ -40,7 +40,7 @@ export declare const selectorSankeyHighlightedItem: (args_0: import("./useSankey
40
40
  * - It's the highlighted node (unless highlight mode is 'none')
41
41
  * - It's connected to a highlighted link (based on linkOptions.highlight)
42
42
  */
43
- export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
43
+ export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
44
44
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
45
45
  }, nodeId: SankeyNodeId) => boolean;
46
46
  /**
@@ -49,7 +49,7 @@ export declare const selectorIsNodeHighlighted: (args_0: import("@mui/x-charts/i
49
49
  * - It's the highlighted link (unless highlight mode is 'none')
50
50
  * - It's connected to a highlighted node (based on nodeOptions.highlight)
51
51
  */
52
- export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
52
+ export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
53
53
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
54
54
  }, link: import("../index.js").SankeyLayoutLinkWithPosition) => boolean;
55
55
  /**
@@ -59,6 +59,6 @@ export declare const selectorIsLinkHighlighted: (args_0: import("@mui/x-charts/i
59
59
  * - This item is not highlighted
60
60
  * - The fade mode is 'global' for the highlighted element type
61
61
  */
62
- export declare const selectorIsSankeyItemFaded: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
62
+ export declare const selectorIsSankeyItemFaded: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<{}> & {
63
63
  cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
64
64
  }, isHighlighted: boolean) => boolean;
@@ -39,4 +39,8 @@ export type SankeyLinkHighlightScope = {
39
39
  * @default 'none'
40
40
  */
41
41
  fade?: SankeyLinkFade;
42
+ };
43
+ export type SankeyHighlightScope = {
44
+ nodes: SankeyNodeHighlightScope;
45
+ links: SankeyLinkHighlightScope;
42
46
  };
@@ -1,7 +1,7 @@
1
- import type { HighlightScope, SeriesId } from '@mui/x-charts/internals';
1
+ import type { SeriesId } from '@mui/x-charts/internals';
2
2
  import type { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
3
3
  import type { SankeyLink as D3SankeyLink, SankeyNode as D3SankeyNode } from "./d3Sankey/index.js";
4
- import type { SankeyLinkHighlightScope, SankeyNodeHighlightScope } from "./sankey.highlight.types.js";
4
+ import type { SankeyHighlightScope, SankeyLinkHighlightScope, SankeyNodeHighlightScope } from "./sankey.highlight.types.js";
5
5
  export type SankeyNodeId = string | number;
6
6
  export interface SankeyNode {
7
7
  /**
@@ -216,7 +216,10 @@ export interface SankeyLayout<WithPosition extends boolean = true> {
216
216
  }
217
217
  export interface DefaultizedSankeySeriesType extends DefaultizedProps<Omit<SankeySeriesType, 'data'>, 'id' | 'valueFormatter'> {
218
218
  data: SankeyLayout<false>;
219
- highlightScope?: HighlightScope;
219
+ /**
220
+ * Highlight scope for the series derived from nodeOptions and linksOptions
221
+ */
222
+ highlightScope: SankeyHighlightScope;
220
223
  }
221
224
  type SankeyNodeIdentifierBase = {
222
225
  type: 'sankey';
@@ -1,15 +1,9 @@
1
1
  import { type ChartsOverlaySlotProps, type ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
2
- import { type ChartsTooltipProps, type ChartsTooltipSlotProps, type ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
2
+ import { type ChartsTooltipSlotProps, type ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
3
3
  import { type ChartsSlotProps, type ChartsSlots } from '@mui/x-charts/internals';
4
4
  import { type ChartsToolbarSlotProps, type ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
5
- export interface SankeyChartSlots extends ChartsTooltipSlots, ChartsOverlaySlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
6
- export interface SankeyChartSlotProps extends Omit<ChartsTooltipSlotProps, 'tooltip'>, ChartsOverlaySlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {
7
- /**
8
- * Slot props for the tooltip component.
9
- * @default {}
10
- */
11
- tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
12
- }
5
+ export interface SankeyChartSlots extends ChartsTooltipSlots<'item' | 'none'>, ChartsOverlaySlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
6
+ export interface SankeyChartSlotProps extends ChartsTooltipSlotProps<'item' | 'none'>, ChartsOverlaySlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
13
7
  export interface SankeyChartSlotExtension {
14
8
  /**
15
9
  * Overridable component slots.