@mui/x-charts 6.0.0-alpha.5 → 6.0.0-alpha.7

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 (163) hide show
  1. package/BarChart/BarChart.d.ts +18 -2
  2. package/BarChart/BarChart.js +74 -17
  3. package/BarChart/BarElement.d.ts +22 -0
  4. package/BarChart/BarElement.js +21 -10
  5. package/BarChart/BarPlot.d.ts +14 -1
  6. package/BarChart/BarPlot.js +23 -4
  7. package/BarChart/formatter.js +23 -12
  8. package/CHANGELOG.md +154 -0
  9. package/ChartContainer/index.js +3 -0
  10. package/ChartsAxis/ChartsAxis.d.ts +11 -1
  11. package/ChartsAxis/ChartsAxis.js +51 -6
  12. package/ChartsLegend/ChartsLegend.d.ts +25 -2
  13. package/ChartsLegend/ChartsLegend.js +49 -17
  14. package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  15. package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
  16. package/ChartsXAxis/ChartsXAxis.js +44 -9
  17. package/ChartsYAxis/ChartsYAxis.js +44 -9
  18. package/LineChart/AreaElement.d.ts +22 -0
  19. package/LineChart/AreaElement.js +31 -11
  20. package/LineChart/AreaPlot.d.ts +14 -1
  21. package/LineChart/AreaPlot.js +32 -5
  22. package/LineChart/LineChart.d.ts +20 -2
  23. package/LineChart/LineChart.js +76 -16
  24. package/LineChart/LineElement.d.ts +22 -0
  25. package/LineChart/LineElement.js +31 -10
  26. package/LineChart/LinePlot.d.ts +14 -1
  27. package/LineChart/LinePlot.js +38 -6
  28. package/LineChart/MarkElement.js +1 -1
  29. package/LineChart/MarkPlot.d.ts +24 -1
  30. package/LineChart/MarkPlot.js +30 -6
  31. package/LineChart/formatter.js +23 -12
  32. package/PieChart/PieArcLabel.js +0 -1
  33. package/PieChart/PieChart.d.ts +14 -2
  34. package/PieChart/PieChart.js +60 -13
  35. package/PieChart/PiePlot.d.ts +27 -1
  36. package/PieChart/PiePlot.js +29 -6
  37. package/ScatterChart/ScatterChart.d.ts +18 -2
  38. package/ScatterChart/ScatterChart.js +64 -13
  39. package/ScatterChart/ScatterPlot.d.ts +24 -1
  40. package/ScatterChart/ScatterPlot.js +28 -4
  41. package/SparkLineChart/SparkLineChart.d.ts +73 -0
  42. package/SparkLineChart/SparkLineChart.js +218 -0
  43. package/SparkLineChart/index.d.ts +1 -0
  44. package/SparkLineChart/index.js +12 -0
  45. package/SparkLineChart/package.json +6 -0
  46. package/colorPalettes/colorPalettes.js +2 -2
  47. package/context/CartesianContextProvider.d.ts +3 -1
  48. package/context/CartesianContextProvider.js +50 -14
  49. package/context/SeriesContextProvider.d.ts +3 -2
  50. package/context/SeriesContextProvider.js +5 -3
  51. package/esm/BarChart/BarChart.js +77 -17
  52. package/esm/BarChart/BarElement.js +21 -11
  53. package/esm/BarChart/BarPlot.js +23 -4
  54. package/esm/BarChart/formatter.js +23 -12
  55. package/esm/ChartContainer/index.js +3 -0
  56. package/esm/ChartsAxis/ChartsAxis.js +51 -6
  57. package/esm/ChartsLegend/ChartsLegend.js +47 -14
  58. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  59. package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
  60. package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
  61. package/esm/LineChart/AreaElement.js +31 -11
  62. package/esm/LineChart/AreaPlot.js +33 -5
  63. package/esm/LineChart/LineChart.js +79 -16
  64. package/esm/LineChart/LineElement.js +31 -11
  65. package/esm/LineChart/LinePlot.js +45 -9
  66. package/esm/LineChart/MarkElement.js +1 -1
  67. package/esm/LineChart/MarkPlot.js +31 -6
  68. package/esm/LineChart/formatter.js +23 -13
  69. package/esm/PieChart/PieArcLabel.js +0 -1
  70. package/esm/PieChart/PieChart.js +60 -13
  71. package/esm/PieChart/PiePlot.js +31 -6
  72. package/esm/ScatterChart/ScatterChart.js +64 -13
  73. package/esm/ScatterChart/ScatterPlot.js +29 -4
  74. package/esm/SparkLineChart/SparkLineChart.js +210 -0
  75. package/esm/SparkLineChart/index.js +1 -0
  76. package/esm/colorPalettes/colorPalettes.js +2 -2
  77. package/esm/context/CartesianContextProvider.js +50 -14
  78. package/esm/context/SeriesContextProvider.js +5 -3
  79. package/esm/hooks/useTicks.js +9 -6
  80. package/esm/index.js +1 -0
  81. package/esm/internals/components/AxisSharedComponents.js +10 -10
  82. package/esm/models/index.js +3 -1
  83. package/hooks/useTicks.d.ts +20 -5
  84. package/hooks/useTicks.js +9 -6
  85. package/index.d.ts +1 -0
  86. package/index.js +12 -1
  87. package/internals/components/AxisSharedComponents.d.ts +4 -4
  88. package/internals/components/AxisSharedComponents.js +15 -15
  89. package/internals/defaultizeColor.d.ts +4 -2
  90. package/legacy/BarChart/BarChart.js +75 -17
  91. package/legacy/BarChart/BarElement.js +20 -10
  92. package/legacy/BarChart/BarPlot.js +23 -4
  93. package/legacy/BarChart/formatter.js +23 -10
  94. package/legacy/ChartContainer/index.js +3 -0
  95. package/legacy/ChartsAxis/ChartsAxis.js +51 -6
  96. package/legacy/ChartsLegend/ChartsLegend.js +46 -15
  97. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  98. package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
  99. package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
  100. package/legacy/LineChart/AreaElement.js +30 -10
  101. package/legacy/LineChart/AreaPlot.js +31 -5
  102. package/legacy/LineChart/LineChart.js +77 -16
  103. package/legacy/LineChart/LineElement.js +30 -10
  104. package/legacy/LineChart/LinePlot.js +38 -6
  105. package/legacy/LineChart/MarkElement.js +1 -1
  106. package/legacy/LineChart/MarkPlot.js +29 -6
  107. package/legacy/LineChart/formatter.js +23 -11
  108. package/legacy/PieChart/PieArcLabel.js +0 -1
  109. package/legacy/PieChart/PieChart.js +60 -13
  110. package/legacy/PieChart/PiePlot.js +29 -6
  111. package/legacy/ScatterChart/ScatterChart.js +64 -13
  112. package/legacy/ScatterChart/ScatterPlot.js +27 -4
  113. package/legacy/SparkLineChart/SparkLineChart.js +214 -0
  114. package/legacy/SparkLineChart/index.js +1 -0
  115. package/legacy/colorPalettes/colorPalettes.js +2 -2
  116. package/legacy/context/CartesianContextProvider.js +59 -15
  117. package/legacy/context/SeriesContextProvider.js +6 -4
  118. package/legacy/hooks/useTicks.js +9 -9
  119. package/legacy/index.js +2 -1
  120. package/legacy/internals/components/AxisSharedComponents.js +10 -10
  121. package/legacy/models/index.js +3 -1
  122. package/models/axis.d.ts +34 -3
  123. package/models/index.d.ts +2 -0
  124. package/models/index.js +11 -0
  125. package/models/seriesType/bar.d.ts +8 -1
  126. package/models/seriesType/common.d.ts +2 -2
  127. package/models/seriesType/config.d.ts +4 -1
  128. package/models/seriesType/line.d.ts +8 -1
  129. package/modern/BarChart/BarChart.js +74 -17
  130. package/modern/BarChart/BarElement.js +20 -11
  131. package/modern/BarChart/BarPlot.js +23 -4
  132. package/modern/BarChart/formatter.js +23 -12
  133. package/modern/ChartContainer/index.js +3 -0
  134. package/modern/ChartsAxis/ChartsAxis.js +51 -6
  135. package/modern/ChartsLegend/ChartsLegend.js +46 -14
  136. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
  137. package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
  138. package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
  139. package/modern/LineChart/AreaElement.js +30 -11
  140. package/modern/LineChart/AreaPlot.js +33 -5
  141. package/modern/LineChart/LineChart.js +76 -16
  142. package/modern/LineChart/LineElement.js +30 -11
  143. package/modern/LineChart/LinePlot.js +39 -6
  144. package/modern/LineChart/MarkElement.js +1 -1
  145. package/modern/LineChart/MarkPlot.js +30 -6
  146. package/modern/LineChart/formatter.js +23 -13
  147. package/modern/PieChart/PieArcLabel.js +0 -1
  148. package/modern/PieChart/PieChart.js +60 -13
  149. package/modern/PieChart/PiePlot.js +30 -6
  150. package/modern/ScatterChart/ScatterChart.js +64 -13
  151. package/modern/ScatterChart/ScatterPlot.js +28 -4
  152. package/modern/SparkLineChart/SparkLineChart.js +210 -0
  153. package/modern/SparkLineChart/index.js +1 -0
  154. package/modern/colorPalettes/colorPalettes.js +2 -2
  155. package/modern/context/CartesianContextProvider.js +50 -14
  156. package/modern/context/SeriesContextProvider.js +5 -3
  157. package/modern/hooks/useTicks.js +9 -6
  158. package/modern/index.js +2 -1
  159. package/modern/internals/components/AxisSharedComponents.js +10 -10
  160. package/modern/models/index.js +3 -1
  161. package/package.json +4 -2
  162. package/themeAugmentation/components.d.ts +0 -10
  163. package/themeAugmentation/overrides.d.ts +0 -2
@@ -25,6 +25,7 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
25
25
  xAxis,
26
26
  yAxis,
27
27
  colors,
28
+ dataset,
28
29
  sx,
29
30
  title,
30
31
  desc,
@@ -41,9 +42,11 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
41
42
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, {
42
43
  series: series,
43
44
  colors: colors,
45
+ dataset: dataset,
44
46
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianContextProvider.CartesianContextProvider, {
45
47
  xAxis: xAxis,
46
48
  yAxis: yAxis,
49
+ dataset: dataset,
47
50
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InteractionProvider.InteractionProvider, {
48
51
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightProvider.HighlightProvider, {
49
52
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
2
+ import { ChartsAxisSlotComponentProps, ChartsAxisSlotsComponent, ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
3
3
  export interface ChartsAxisProps {
4
4
  /**
5
5
  * Indicate which axis to display the top of the charts.
@@ -25,6 +25,16 @@ export interface ChartsAxisProps {
25
25
  * @default null
26
26
  */
27
27
  rightAxis?: null | string | ChartsYAxisProps;
28
+ /**
29
+ * Overridable component slots.
30
+ * @default {}
31
+ */
32
+ slots?: ChartsAxisSlotsComponent;
33
+ /**
34
+ * The props used for each component slot.
35
+ * @default {}
36
+ */
37
+ slotProps?: ChartsAxisSlotComponentProps;
28
38
  }
29
39
  declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
30
40
  declare namespace ChartsAxis {
@@ -23,12 +23,23 @@ const getAxisId = propsValue => {
23
23
  }
24
24
  return propsValue;
25
25
  };
26
+ const mergeProps = (axisConfig, slots, slotProps) => {
27
+ return typeof axisConfig === 'object' ? (0, _extends2.default)({}, axisConfig, {
28
+ slots: (0, _extends2.default)({}, slots, axisConfig?.slots),
29
+ slotProps: (0, _extends2.default)({}, slotProps, axisConfig?.slotProps)
30
+ }) : {
31
+ slots,
32
+ slotProps
33
+ };
34
+ };
26
35
  function ChartsAxis(props) {
27
36
  const {
28
37
  topAxis,
29
38
  leftAxis,
30
39
  rightAxis,
31
- bottomAxis
40
+ bottomAxis,
41
+ slots,
42
+ slotProps
32
43
  } = props;
33
44
  const {
34
45
  xAxis,
@@ -56,20 +67,24 @@ function ChartsAxis(props) {
56
67
  if (bottomId !== null && !xAxis[bottomId]) {
57
68
  throw Error(`MUI: id used for bottom axis "${bottomId}" is not defined`);
58
69
  }
70
+ const topAxisProps = mergeProps(topAxis, slots, slotProps);
71
+ const bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
72
+ const leftAxisProps = mergeProps(leftAxis, slots, slotProps);
73
+ const rightAxisProps = mergeProps(rightAxis, slots, slotProps);
59
74
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
60
- children: [topId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({
75
+ children: [topId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({}, topAxisProps, {
61
76
  position: "top",
62
77
  axisId: topId
63
- }, typeof topAxis === 'object' ? topAxis : {})), bottomId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({
78
+ })), bottomId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({}, bottomAxisProps, {
64
79
  position: "bottom",
65
80
  axisId: bottomId
66
- }, typeof bottomAxis === 'object' ? bottomAxis : {})), leftId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({
81
+ })), leftId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({}, leftAxisProps, {
67
82
  position: "left",
68
83
  axisId: leftId
69
- }, typeof leftAxis === 'object' ? leftAxis : {})), rightId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({
84
+ })), rightId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({}, rightAxisProps, {
70
85
  position: "right",
71
86
  axisId: rightId
72
- }, typeof rightAxis === 'object' ? rightAxis : {}))]
87
+ }))]
73
88
  });
74
89
  }
75
90
  process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
@@ -91,8 +106,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
91
106
  label: _propTypes.default.string,
92
107
  labelFontSize: _propTypes.default.number,
93
108
  position: _propTypes.default.oneOf(['bottom', 'top']),
109
+ slotProps: _propTypes.default.object,
110
+ slots: _propTypes.default.object,
94
111
  stroke: _propTypes.default.string,
95
112
  tickFontSize: _propTypes.default.number,
113
+ tickMaxStep: _propTypes.default.number,
114
+ tickMinStep: _propTypes.default.number,
115
+ tickNumber: _propTypes.default.number,
96
116
  tickSize: _propTypes.default.number
97
117
  }), _propTypes.default.string]),
98
118
  /**
@@ -109,8 +129,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
109
129
  label: _propTypes.default.string,
110
130
  labelFontSize: _propTypes.default.number,
111
131
  position: _propTypes.default.oneOf(['left', 'right']),
132
+ slotProps: _propTypes.default.object,
133
+ slots: _propTypes.default.object,
112
134
  stroke: _propTypes.default.string,
113
135
  tickFontSize: _propTypes.default.number,
136
+ tickMaxStep: _propTypes.default.number,
137
+ tickMinStep: _propTypes.default.number,
138
+ tickNumber: _propTypes.default.number,
114
139
  tickSize: _propTypes.default.number
115
140
  }), _propTypes.default.string]),
116
141
  /**
@@ -127,10 +152,25 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
127
152
  label: _propTypes.default.string,
128
153
  labelFontSize: _propTypes.default.number,
129
154
  position: _propTypes.default.oneOf(['left', 'right']),
155
+ slotProps: _propTypes.default.object,
156
+ slots: _propTypes.default.object,
130
157
  stroke: _propTypes.default.string,
131
158
  tickFontSize: _propTypes.default.number,
159
+ tickMaxStep: _propTypes.default.number,
160
+ tickMinStep: _propTypes.default.number,
161
+ tickNumber: _propTypes.default.number,
132
162
  tickSize: _propTypes.default.number
133
163
  }), _propTypes.default.string]),
164
+ /**
165
+ * The props used for each component slot.
166
+ * @default {}
167
+ */
168
+ slotProps: _propTypes.default.object,
169
+ /**
170
+ * Overridable component slots.
171
+ * @default {}
172
+ */
173
+ slots: _propTypes.default.object,
134
174
  /**
135
175
  * Indicate which axis to display the top of the charts.
136
176
  * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
@@ -145,8 +185,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
145
185
  label: _propTypes.default.string,
146
186
  labelFontSize: _propTypes.default.number,
147
187
  position: _propTypes.default.oneOf(['bottom', 'top']),
188
+ slotProps: _propTypes.default.object,
189
+ slots: _propTypes.default.object,
148
190
  stroke: _propTypes.default.string,
149
191
  tickFontSize: _propTypes.default.number,
192
+ tickMaxStep: _propTypes.default.number,
193
+ tickMinStep: _propTypes.default.number,
194
+ tickNumber: _propTypes.default.number,
150
195
  tickSize: _propTypes.default.number
151
196
  }), _propTypes.default.string])
152
197
  } : void 0;
@@ -2,9 +2,16 @@ import * as React from 'react';
2
2
  import { Theme } from '@mui/material/styles';
3
3
  import { DrawingArea } from '../context/DrawingProvider';
4
4
  import { AnchorPosition, SizingParams } from './utils';
5
+ import { FormattedSeries } from '../context/SeriesContextProvider';
5
6
  import { ChartsLegendClasses } from './chartsLegendClasses';
6
7
  import { DefaultizedProps } from '../models/helpers';
7
- import { ChartSeriesDefaultized } from '../models/seriesType/config';
8
+ import { ChartSeriesDefaultized, LegendParams } from '../models/seriesType/config';
9
+ export interface ChartsLegendSlotsComponent {
10
+ legend?: React.JSXElementConstructor<LegendRendererProps>;
11
+ }
12
+ export interface ChartsLegendSlotComponentProps {
13
+ legend?: Partial<LegendRendererProps>;
14
+ }
8
15
  export type ChartsLegendProps = {
9
16
  position?: AnchorPosition;
10
17
  offset?: Partial<{
@@ -19,6 +26,16 @@ export type ChartsLegendProps = {
19
26
  * Set to true to hide the legend.
20
27
  */
21
28
  hidden?: boolean;
29
+ /**
30
+ * Overridable component slots.
31
+ * @default {}
32
+ */
33
+ slots?: ChartsLegendSlotsComponent;
34
+ /**
35
+ * The props used for each component slot.
36
+ * @default {}
37
+ */
38
+ slotProps?: ChartsLegendSlotComponentProps;
22
39
  } & SizingParams;
23
40
  type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
24
41
  type SeriesLegendOwnerState = ChartSeriesDefaultized<any> & Pick<DefaultizedChartsLegendProps, 'direction'> & {
@@ -44,5 +61,11 @@ export declare const ChartsLegendMark: import("@emotion/styled").StyledComponent
44
61
  };
45
62
  }, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
46
63
  export declare const ChartsLegendLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
47
- export declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element | null;
64
+ export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps, 'slots' | 'slotProps'> {
65
+ series: FormattedSeries;
66
+ seriesToDisplay: LegendParams[];
67
+ drawingArea: DrawingArea;
68
+ classes: Record<'label' | 'mark' | 'series' | 'root', string>;
69
+ }
70
+ export declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element;
48
71
  export {};
@@ -8,10 +8,11 @@ exports.ChartsLegend = ChartsLegend;
8
8
  exports.ChartsSeriesLegendGroup = exports.ChartsLegendRoot = exports.ChartsLegendMark = exports.ChartsLegendLabel = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
- var _utils = require("@mui/utils");
11
+ var _utils = require("@mui/base/utils");
12
+ var _utils2 = require("@mui/utils");
12
13
  var _styles = require("@mui/material/styles");
13
14
  var _DrawingProvider = require("../context/DrawingProvider");
14
- var _utils2 = require("./utils");
15
+ var _utils3 = require("./utils");
15
16
  var _SeriesContextProvider = require("../context/SeriesContextProvider");
16
17
  var _chartsLegendClasses = require("./chartsLegendClasses");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
@@ -28,7 +29,7 @@ const useUtilityClasses = ownerState => {
28
29
  label: ['label'],
29
30
  series: ['series']
30
31
  };
31
- return (0, _utils.unstable_composeClasses)(slots, _chartsLegendClasses.getChartsLegendUtilityClass, classes);
32
+ return (0, _utils2.unstable_composeClasses)(slots, _chartsLegendClasses.getChartsLegendUtilityClass, classes);
32
33
  };
33
34
  function getTranslePosition({
34
35
  position,
@@ -138,7 +139,7 @@ const ChartsLegendLabel = (0, _styles.styled)('text', {
138
139
  calc(0.5 * var(--ChartsLegend-itemMarkSize))
139
140
  )`,
140
141
  fill: theme.palette.text.primary,
141
- alignmentBaseline: 'central'
142
+ dominantBaseline: 'central'
142
143
  }));
143
144
  exports.ChartsLegendLabel = ChartsLegendLabel;
144
145
  const defaultProps = {
@@ -151,27 +152,20 @@ const defaultProps = {
151
152
  itemWidth: 100,
152
153
  spacing: 2
153
154
  };
154
- function ChartsLegend(inProps) {
155
- const props = (0, _styles.useThemeProps)({
156
- props: (0, _extends2.default)({}, defaultProps, inProps),
157
- name: 'MuiChartsLegend'
158
- });
155
+ function DefaultChartsLegend(props) {
159
156
  const {
157
+ hidden,
160
158
  position,
161
159
  direction,
162
160
  offset,
163
- hidden
161
+ series,
162
+ seriesToDisplay,
163
+ drawingArea,
164
+ classes
164
165
  } = props;
165
- const theme = (0, _styles.useTheme)();
166
- const classes = useUtilityClasses((0, _extends2.default)({}, props, {
167
- theme
168
- }));
169
- const drawingArea = React.useContext(_DrawingProvider.DrawingContext);
170
- const series = React.useContext(_SeriesContextProvider.SeriesContext);
171
166
  if (hidden) {
172
167
  return null;
173
168
  }
174
- const seriesToDisplay = (0, _utils2.getSeriesToDisplay)(series);
175
169
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsLegendRoot, {
176
170
  ownerState: {
177
171
  direction,
@@ -203,4 +197,42 @@ function ChartsLegend(inProps) {
203
197
  })]
204
198
  }, id))
205
199
  });
200
+ }
201
+ function ChartsLegend(inProps) {
202
+ const props = (0, _styles.useThemeProps)({
203
+ props: (0, _extends2.default)({}, defaultProps, inProps),
204
+ name: 'MuiChartsLegend'
205
+ });
206
+ const {
207
+ position,
208
+ direction,
209
+ offset,
210
+ hidden,
211
+ slots,
212
+ slotProps
213
+ } = props;
214
+ const theme = (0, _styles.useTheme)();
215
+ const classes = useUtilityClasses((0, _extends2.default)({}, props, {
216
+ theme
217
+ }));
218
+ const drawingArea = React.useContext(_DrawingProvider.DrawingContext);
219
+ const series = React.useContext(_SeriesContextProvider.SeriesContext);
220
+ const seriesToDisplay = (0, _utils3.getSeriesToDisplay)(series);
221
+ const ChartLegendRender = slots?.legend ?? DefaultChartsLegend;
222
+ const chartLegendRenderProps = (0, _utils.useSlotProps)({
223
+ elementType: ChartLegendRender,
224
+ externalSlotProps: slotProps?.legend,
225
+ additionalProps: {
226
+ position,
227
+ direction,
228
+ offset,
229
+ classes,
230
+ drawingArea,
231
+ series,
232
+ hidden,
233
+ seriesToDisplay
234
+ },
235
+ ownerState: {}
236
+ });
237
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartLegendRender, (0, _extends2.default)({}, chartLegendRenderProps));
206
238
  }
@@ -32,7 +32,7 @@ function DefaultChartsAxisContent(props) {
32
32
  variant: "outlined",
33
33
  className: classes.root,
34
34
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltipTable.ChartsTooltipTable, {
35
- children: [axisValue != null && /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
35
+ children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
36
36
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipRow, {
37
37
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipCell, {
38
38
  colSpan: 3,
@@ -1,14 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const ChartsTooltipPaper: import("@emotion/styled").StyledComponent<Pick<{
3
- children?: import("react").ReactNode;
4
- classes?: Partial<import("@mui/material/Paper").PaperClasses> | undefined;
5
- elevation?: number | undefined;
6
- square?: boolean | undefined;
7
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
8
- variant?: import("@mui/types").OverridableStringUnion<"elevation" | "outlined", import("@mui/material/Paper").PaperPropsVariantOverrides> | undefined;
9
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
2
+ export declare const ChartsTooltipPaper: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Paper").PaperOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
3
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
- }, "square" | "elevation" | "children" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant">, "hidden" | "color" | "content" | "translate" | "square" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "elevation" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
4
+ }, "style" | "square" | "className" | "elevation" | "children" | "sx" | "classes" | "variant">, "hidden" | "color" | "content" | "style" | "translate" | "square" | "slot" | "title" | "ref" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "elevation" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "classes" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
12
5
  export declare const ChartsTooltipTable: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, keyof import("react").ClassAttributes<HTMLTableElement> | keyof import("react").TableHTMLAttributes<HTMLTableElement>>, {}>;
13
6
  export declare const ChartsTooltipRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, keyof import("react").ClassAttributes<HTMLTableRowElement> | keyof import("react").HTMLAttributes<HTMLTableRowElement>>, {}>;
14
7
  export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, keyof import("react").ClassAttributes<HTMLTableDataCellElement> | keyof import("react").TdHTMLAttributes<HTMLTableDataCellElement>>, {}>;
@@ -68,7 +68,9 @@ function ChartsXAxis(inProps) {
68
68
  label,
69
69
  labelFontSize,
70
70
  tickSize: tickSizeProp,
71
- valueFormatter
71
+ valueFormatter,
72
+ slots,
73
+ slotProps
72
74
  } = defaultizedProps;
73
75
  const theme = (0, _styles.useTheme)();
74
76
  const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
@@ -91,14 +93,18 @@ function ChartsXAxis(inProps) {
91
93
  x: left + width / 2,
92
94
  y: positionSigne * (tickFontSize + tickSize + 10)
93
95
  };
96
+ const Line = slots?.axisLine ?? _AxisSharedComponents.ChartsLine;
97
+ const Tick = slots?.axisTick ?? _AxisSharedComponents.ChartsTick;
98
+ const TickLabel = slots?.axisTickLabel ?? _AxisSharedComponents.ChartsTickLabel;
99
+ const Label = slots?.axisLabel ?? _AxisSharedComponents.ChartsLabel;
94
100
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
95
101
  transform: `translate(0, ${position === 'bottom' ? top + height : top})`,
96
102
  className: classes.root,
97
- children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Line, {
103
+ children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(Line, (0, _extends2.default)({
98
104
  x1: xScale.range()[0],
99
105
  x2: xScale.range()[1],
100
106
  className: classes.line
101
- }), xTicks.map(({
107
+ }, slotProps?.axisLine)), xTicks.map(({
102
108
  formattedValue,
103
109
  offset,
104
110
  labelOffset
@@ -108,26 +114,28 @@ function ChartsXAxis(inProps) {
108
114
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
109
115
  transform: `translate(${offset}, 0)`,
110
116
  className: classes.tickContainer,
111
- children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Tick, {
117
+ children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
112
118
  y2: positionSigne * tickSize,
113
119
  className: classes.tick
114
- }), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.TickLabel, {
120
+ }, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
115
121
  x: xTickLabel,
116
122
  y: yTickLabel,
117
123
  "transform-origin": `${xTickLabel}px ${yTickLabel}px`,
118
124
  sx: {
119
125
  fontSize: tickFontSize
120
126
  },
121
- className: classes.tickLabel,
127
+ className: classes.tickLabel
128
+ }, slotProps?.axisTickLabel, {
122
129
  children: formattedValue
123
- })]
130
+ }))]
124
131
  }, index);
125
- }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Label, (0, _extends2.default)({}, labelRefPoint, {
132
+ }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, {
126
133
  sx: {
127
134
  fontSize: labelFontSize,
128
135
  transformOrigin: `${labelRefPoint.x}px ${labelRefPoint.y}px`
129
136
  },
130
- className: classes.label,
137
+ className: classes.label
138
+ }, slotProps?.axisLabel, {
131
139
  children: label
132
140
  }))]
133
141
  });
@@ -173,6 +181,16 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
173
181
  * Position of the axis.
174
182
  */
175
183
  position: _propTypes.default.oneOf(['bottom', 'top']),
184
+ /**
185
+ * The props used for each component slot.
186
+ * @default {}
187
+ */
188
+ slotProps: _propTypes.default.object,
189
+ /**
190
+ * Overridable component slots.
191
+ * @default {}
192
+ */
193
+ slots: _propTypes.default.object,
176
194
  /**
177
195
  * The stroke color of the axis line.
178
196
  * @default 'currentColor'
@@ -183,6 +201,23 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
183
201
  * @default 12
184
202
  */
185
203
  tickFontSize: _propTypes.default.number,
204
+ /**
205
+ * Maximal step between two ticks.
206
+ * When using time data, the value is assumed to be in ms.
207
+ * Not supported by categorical axis (band, points).
208
+ */
209
+ tickMaxStep: _propTypes.default.number,
210
+ /**
211
+ * Maximal step between two ticks.
212
+ * When using time data, the value is assumed to be in ms.
213
+ * Not supported by categorical axis (band, points).
214
+ */
215
+ tickMinStep: _propTypes.default.number,
216
+ /**
217
+ * The number of ticks. This number is not guaranted.
218
+ * Not supported by categorical axis (band, points).
219
+ */
220
+ tickNumber: _propTypes.default.number,
186
221
  /**
187
222
  * The size of the ticks.
188
223
  * @default 6
@@ -68,7 +68,9 @@ function ChartsYAxis(inProps) {
68
68
  label,
69
69
  labelFontSize,
70
70
  tickSize: tickSizeProp,
71
- valueFormatter
71
+ valueFormatter,
72
+ slots,
73
+ slotProps
72
74
  } = defaultizedProps;
73
75
  const theme = (0, _styles.useTheme)();
74
76
  const classes = useUtilityClasses((0, _extends2.default)({}, defaultizedProps, {
@@ -91,14 +93,18 @@ function ChartsYAxis(inProps) {
91
93
  x: positionSigne * (tickFontSize + tickSize + 10),
92
94
  y: top + height / 2
93
95
  };
96
+ const Line = slots?.axisLine ?? _AxisSharedComponents.ChartsLine;
97
+ const Tick = slots?.axisTick ?? _AxisSharedComponents.ChartsTick;
98
+ const TickLabel = slots?.axisTickLabel ?? _AxisSharedComponents.ChartsTickLabel;
99
+ const Label = slots?.axisLabel ?? _AxisSharedComponents.ChartsLabel;
94
100
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AxisSharedComponents.AxisRoot, {
95
101
  transform: `translate(${position === 'right' ? left + width : left}, 0)`,
96
102
  className: classes.root,
97
- children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Line, {
103
+ children: [!disableLine && /*#__PURE__*/(0, _jsxRuntime.jsx)(Line, (0, _extends2.default)({
98
104
  y1: yScale.range()[0],
99
105
  y2: yScale.range()[1],
100
106
  className: classes.line
101
- }), yTicks.map(({
107
+ }, slotProps?.axisLine)), yTicks.map(({
102
108
  formattedValue,
103
109
  offset,
104
110
  labelOffset
@@ -108,27 +114,29 @@ function ChartsYAxis(inProps) {
108
114
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
109
115
  transform: `translate(0, ${offset})`,
110
116
  className: classes.tickContainer,
111
- children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Tick, {
117
+ children: [!disableTicks && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tick, (0, _extends2.default)({
112
118
  x2: positionSigne * tickSize,
113
119
  className: classes.tick
114
- }), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.TickLabel, {
120
+ }, slotProps?.axisTick)), formattedValue !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(TickLabel, (0, _extends2.default)({
115
121
  x: xTickLabel,
116
122
  y: yTickLabel,
117
123
  "transform-origin": `${xTickLabel}px ${yTickLabel}px`,
118
124
  sx: {
119
125
  fontSize: tickFontSize
120
126
  },
121
- className: classes.tickLabel,
127
+ className: classes.tickLabel
128
+ }, slotProps?.axisTickLabel, {
122
129
  children: formattedValue.toLocaleString()
123
- })]
130
+ }))]
124
131
  }, index);
125
- }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AxisSharedComponents.Label, (0, _extends2.default)({}, labelRefPoint, {
132
+ }), label && /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({}, labelRefPoint, {
126
133
  sx: {
127
134
  fontSize: labelFontSize,
128
135
  transform: `rotate(${positionSigne * 90}deg)`,
129
136
  transformOrigin: `${labelRefPoint.x}px ${labelRefPoint.y}px`
130
137
  },
131
- className: classes.label,
138
+ className: classes.label
139
+ }, slotProps?.axisLabel, {
132
140
  children: label
133
141
  }))]
134
142
  });
@@ -174,6 +182,16 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
174
182
  * Position of the axis.
175
183
  */
176
184
  position: _propTypes.default.oneOf(['left', 'right']),
185
+ /**
186
+ * The props used for each component slot.
187
+ * @default {}
188
+ */
189
+ slotProps: _propTypes.default.object,
190
+ /**
191
+ * Overridable component slots.
192
+ * @default {}
193
+ */
194
+ slots: _propTypes.default.object,
177
195
  /**
178
196
  * The stroke color of the axis line.
179
197
  * @default 'currentColor'
@@ -184,6 +202,23 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
184
202
  * @default 12
185
203
  */
186
204
  tickFontSize: _propTypes.default.number,
205
+ /**
206
+ * Maximal step between two ticks.
207
+ * When using time data, the value is assumed to be in ms.
208
+ * Not supported by categorical axis (band, points).
209
+ */
210
+ tickMaxStep: _propTypes.default.number,
211
+ /**
212
+ * Maximal step between two ticks.
213
+ * When using time data, the value is assumed to be in ms.
214
+ * Not supported by categorical axis (band, points).
215
+ */
216
+ tickMinStep: _propTypes.default.number,
217
+ /**
218
+ * The number of ticks. This number is not guaranted.
219
+ * Not supported by categorical axis (band, points).
220
+ */
221
+ tickNumber: _propTypes.default.number,
187
222
  /**
188
223
  * The size of the ticks.
189
224
  * @default 6
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { SlotComponentProps } from '@mui/base';
2
3
  import { HighlightScope } from '../context/HighlightProvider';
3
4
  export interface AreaElementClasses {
4
5
  /** Styles applied to the root element. */
@@ -18,8 +19,29 @@ export interface AreaElementOwnerState {
18
19
  }
19
20
  export declare function getAreaElementUtilityClass(slot: string): string;
20
21
  export declare const areaElementClasses: AreaElementClasses;
22
+ export declare const AreaElementPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
23
+ ownerState: AreaElementOwnerState;
24
+ }, Pick<React.SVGProps<SVGPathElement>, keyof React.SVGProps<SVGPathElement>>, {}>;
21
25
  export type AreaElementProps = Omit<AreaElementOwnerState, 'isFaded' | 'isHighlighted'> & React.ComponentPropsWithoutRef<'path'> & {
22
26
  highlightScope?: Partial<HighlightScope>;
27
+ /**
28
+ * The props used for each component slot.
29
+ * @default {}
30
+ */
31
+ slotProps?: {
32
+ area?: SlotComponentProps<'path', {}, AreaElementOwnerState>;
33
+ };
34
+ /**
35
+ * Overridable component slots.
36
+ * @default {}
37
+ */
38
+ slots?: {
39
+ /**
40
+ * The component that renders the root.
41
+ * @default AreaElementPath
42
+ */
43
+ area?: React.ElementType;
44
+ };
23
45
  };
24
46
  declare function AreaElement(props: AreaElementProps): React.JSX.Element;
25
47
  declare namespace AreaElement {