@mui/x-charts 6.0.0-alpha.6 → 6.0.0-alpha.8

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 (142) hide show
  1. package/BarChart/BarChart.d.ts +19 -2
  2. package/BarChart/BarChart.js +84 -22
  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 +48 -19
  7. package/BarChart/extremums.js +19 -3
  8. package/BarChart/formatter.js +3 -1
  9. package/CHANGELOG.md +213 -28
  10. package/ChartsAxis/ChartsAxis.d.ts +11 -1
  11. package/ChartsAxis/ChartsAxis.js +51 -6
  12. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +3 -2
  13. package/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
  14. package/ChartsLegend/ChartsLegend.d.ts +25 -2
  15. package/ChartsLegend/ChartsLegend.js +49 -17
  16. package/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
  17. package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
  18. package/ChartsXAxis/ChartsXAxis.js +44 -9
  19. package/ChartsYAxis/ChartsYAxis.js +44 -9
  20. package/LineChart/AreaElement.d.ts +22 -0
  21. package/LineChart/AreaElement.js +31 -11
  22. package/LineChart/AreaPlot.d.ts +14 -1
  23. package/LineChart/AreaPlot.js +29 -3
  24. package/LineChart/LineChart.d.ts +20 -2
  25. package/LineChart/LineChart.js +63 -11
  26. package/LineChart/LineElement.d.ts +22 -0
  27. package/LineChart/LineElement.js +31 -10
  28. package/LineChart/LinePlot.d.ts +14 -1
  29. package/LineChart/LinePlot.js +35 -4
  30. package/LineChart/MarkPlot.d.ts +24 -1
  31. package/LineChart/MarkPlot.js +29 -4
  32. package/PieChart/PieArcLabel.js +0 -1
  33. package/PieChart/PieChart.d.ts +14 -2
  34. package/PieChart/PieChart.js +52 -10
  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 +56 -10
  39. package/ScatterChart/ScatterPlot.d.ts +24 -1
  40. package/ScatterChart/ScatterPlot.js +28 -4
  41. package/SparkLineChart/SparkLineChart.d.ts +18 -0
  42. package/SparkLineChart/SparkLineChart.js +29 -6
  43. package/colorPalettes/colorPalettes.js +2 -2
  44. package/context/CartesianContextProvider.js +18 -12
  45. package/esm/BarChart/BarChart.js +88 -26
  46. package/esm/BarChart/BarElement.js +21 -11
  47. package/esm/BarChart/BarPlot.js +49 -20
  48. package/esm/BarChart/extremums.js +18 -2
  49. package/esm/BarChart/formatter.js +3 -1
  50. package/esm/ChartsAxis/ChartsAxis.js +51 -6
  51. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
  52. package/esm/ChartsLegend/ChartsLegend.js +47 -14
  53. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
  54. package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
  55. package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
  56. package/esm/LineChart/AreaElement.js +31 -11
  57. package/esm/LineChart/AreaPlot.js +31 -4
  58. package/esm/LineChart/LineChart.js +63 -11
  59. package/esm/LineChart/LineElement.js +31 -11
  60. package/esm/LineChart/LinePlot.js +43 -8
  61. package/esm/LineChart/MarkPlot.js +32 -5
  62. package/esm/PieChart/PieArcLabel.js +0 -1
  63. package/esm/PieChart/PieChart.js +52 -10
  64. package/esm/PieChart/PiePlot.js +31 -6
  65. package/esm/ScatterChart/ScatterChart.js +56 -10
  66. package/esm/ScatterChart/ScatterPlot.js +29 -4
  67. package/esm/SparkLineChart/SparkLineChart.js +29 -6
  68. package/esm/colorPalettes/colorPalettes.js +2 -2
  69. package/esm/context/CartesianContextProvider.js +18 -12
  70. package/esm/hooks/useAxisEvents.js +21 -38
  71. package/esm/hooks/useTicks.js +11 -8
  72. package/esm/internals/components/AxisSharedComponents.js +10 -10
  73. package/hooks/useAxisEvents.js +21 -38
  74. package/hooks/useTicks.d.ts +20 -5
  75. package/hooks/useTicks.js +11 -8
  76. package/index.js +1 -1
  77. package/internals/components/AxisSharedComponents.d.ts +4 -4
  78. package/internals/components/AxisSharedComponents.js +15 -15
  79. package/internals/defaultizeColor.d.ts +1 -0
  80. package/legacy/BarChart/BarChart.js +93 -29
  81. package/legacy/BarChart/BarElement.js +20 -10
  82. package/legacy/BarChart/BarPlot.js +49 -20
  83. package/legacy/BarChart/extremums.js +22 -2
  84. package/legacy/BarChart/formatter.js +3 -1
  85. package/legacy/ChartsAxis/ChartsAxis.js +51 -6
  86. package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
  87. package/legacy/ChartsLegend/ChartsLegend.js +46 -15
  88. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
  89. package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
  90. package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
  91. package/legacy/LineChart/AreaElement.js +30 -10
  92. package/legacy/LineChart/AreaPlot.js +29 -4
  93. package/legacy/LineChart/LineChart.js +63 -11
  94. package/legacy/LineChart/LineElement.js +30 -10
  95. package/legacy/LineChart/LinePlot.js +36 -5
  96. package/legacy/LineChart/MarkPlot.js +30 -5
  97. package/legacy/PieChart/PieArcLabel.js +0 -1
  98. package/legacy/PieChart/PieChart.js +52 -10
  99. package/legacy/PieChart/PiePlot.js +29 -6
  100. package/legacy/ScatterChart/ScatterChart.js +56 -10
  101. package/legacy/ScatterChart/ScatterPlot.js +27 -4
  102. package/legacy/SparkLineChart/SparkLineChart.js +29 -6
  103. package/legacy/colorPalettes/colorPalettes.js +2 -2
  104. package/legacy/context/CartesianContextProvider.js +18 -12
  105. package/legacy/hooks/useAxisEvents.js +21 -37
  106. package/legacy/hooks/useTicks.js +11 -11
  107. package/legacy/index.js +1 -1
  108. package/legacy/internals/components/AxisSharedComponents.js +10 -10
  109. package/models/axis.d.ts +24 -1
  110. package/models/seriesType/bar.d.ts +6 -1
  111. package/modern/BarChart/BarChart.js +85 -23
  112. package/modern/BarChart/BarElement.js +20 -11
  113. package/modern/BarChart/BarPlot.js +48 -19
  114. package/modern/BarChart/extremums.js +18 -2
  115. package/modern/BarChart/formatter.js +3 -1
  116. package/modern/ChartsAxis/ChartsAxis.js +51 -6
  117. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +11 -3
  118. package/modern/ChartsLegend/ChartsLegend.js +46 -14
  119. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +13 -9
  120. package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
  121. package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
  122. package/modern/LineChart/AreaElement.js +30 -11
  123. package/modern/LineChart/AreaPlot.js +31 -4
  124. package/modern/LineChart/LineChart.js +63 -11
  125. package/modern/LineChart/LineElement.js +30 -11
  126. package/modern/LineChart/LinePlot.js +37 -5
  127. package/modern/LineChart/MarkPlot.js +31 -5
  128. package/modern/PieChart/PieArcLabel.js +0 -1
  129. package/modern/PieChart/PieChart.js +52 -10
  130. package/modern/PieChart/PiePlot.js +30 -6
  131. package/modern/ScatterChart/ScatterChart.js +56 -10
  132. package/modern/ScatterChart/ScatterPlot.js +28 -4
  133. package/modern/SparkLineChart/SparkLineChart.js +29 -6
  134. package/modern/colorPalettes/colorPalettes.js +2 -2
  135. package/modern/context/CartesianContextProvider.js +18 -12
  136. package/modern/hooks/useAxisEvents.js +21 -38
  137. package/modern/hooks/useTicks.js +11 -8
  138. package/modern/index.js +1 -1
  139. package/modern/internals/components/AxisSharedComponents.js +10 -10
  140. package/package.json +5 -5
  141. package/themeAugmentation/components.d.ts +0 -10
  142. package/themeAugmentation/overrides.d.ts +0 -2
@@ -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
  }
@@ -80,29 +80,33 @@ function ChartsAxisTooltipContent(props) {
80
80
  sx,
81
81
  classes
82
82
  } = props;
83
- const dataIndex = axisData.x && axisData.x.index;
84
- const axisValue = axisData.x && axisData.x.value;
83
+ const isXaxis = (axisData.x && axisData.x.index) !== undefined;
84
+ const dataIndex = isXaxis ? axisData.x && axisData.x.index : axisData.y && axisData.y.index;
85
+ const axisValue = isXaxis ? axisData.x && axisData.x.value : axisData.y && axisData.y.value;
85
86
  const {
86
87
  xAxisIds,
87
- xAxis
88
+ xAxis,
89
+ yAxisIds,
90
+ yAxis
88
91
  } = React.useContext(_CartesianContextProvider.CartesianContext);
89
92
  const series = React.useContext(_SeriesContextProvider.SeriesContext);
90
- const USED_X_AXIS_ID = xAxisIds[0];
93
+ const USED_AXIS_ID = isXaxis ? xAxisIds[0] : yAxisIds[0];
91
94
  const relevantSeries = React.useMemo(() => {
92
95
  const rep = [];
93
96
  Object.keys(series).filter(seriesType => ['bar', 'line', 'scatter'].includes(seriesType)).forEach(seriesType => {
94
97
  series[seriesType].seriesOrder.forEach(seriesId => {
95
- const axisKey = series[seriesType].series[seriesId].xAxisKey;
96
- if (axisKey === undefined || axisKey === USED_X_AXIS_ID) {
98
+ const item = series[seriesType].series[seriesId];
99
+ const axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
100
+ if (axisKey === undefined || axisKey === USED_AXIS_ID) {
97
101
  rep.push(series[seriesType].series[seriesId]);
98
102
  }
99
103
  });
100
104
  });
101
105
  return rep;
102
- }, [USED_X_AXIS_ID, series]);
106
+ }, [USED_AXIS_ID, isXaxis, series]);
103
107
  const relevantAxis = React.useMemo(() => {
104
- return xAxis[USED_X_AXIS_ID];
105
- }, [USED_X_AXIS_ID, xAxis]);
108
+ return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
109
+ }, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
106
110
  const Content = content ?? DefaultChartsAxisContent;
107
111
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, {
108
112
  axisData: axisData,
@@ -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 {
@@ -5,13 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.AreaElement = AreaElement;
8
- exports.areaElementClasses = void 0;
8
+ exports.areaElementClasses = exports.AreaElementPath = void 0;
9
9
  exports.getAreaElementUtilityClass = getAreaElementUtilityClass;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
+ var _utils = require("@mui/base/utils");
15
16
  var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
16
17
  var _styles = require("@mui/material/styles");
17
18
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
@@ -19,7 +20,7 @@ var _d3Color = require("d3-color");
19
20
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
20
21
  var _InteractionProvider = require("../context/InteractionProvider");
21
22
  var _jsxRuntime = require("react/jsx-runtime");
22
- const _excluded = ["id", "classes", "color", "highlightScope"];
23
+ const _excluded = ["id", "classes", "color", "highlightScope", "slots", "slotProps"];
23
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
26
  function getAreaElementUtilityClass(slot) {
@@ -51,6 +52,7 @@ const AreaElementPath = (0, _styles.styled)('path', {
51
52
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
52
53
  opacity: ownerState.isFaded ? 0.3 : 1
53
54
  }));
55
+ exports.AreaElementPath = AreaElementPath;
54
56
  AreaElementPath.propTypes = {
55
57
  // ----------------------------- Warning --------------------------------
56
58
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -71,7 +73,9 @@ function AreaElement(props) {
71
73
  id,
72
74
  classes: innerClasses,
73
75
  color,
74
- highlightScope
76
+ highlightScope,
77
+ slots,
78
+ slotProps
75
79
  } = props,
76
80
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
77
81
  const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(highlightScope);
@@ -94,13 +98,19 @@ function AreaElement(props) {
94
98
  isHighlighted
95
99
  };
96
100
  const classes = useUtilityClasses(ownerState);
97
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(AreaElementPath, (0, _extends2.default)({}, other, {
98
- ownerState: ownerState,
99
- className: classes.root
100
- }, getInteractionItemProps({
101
- type: 'line',
102
- seriesId: id
103
- })));
101
+ const Area = slots?.area ?? AreaElementPath;
102
+ const areaProps = (0, _utils.useSlotProps)({
103
+ elementType: Area,
104
+ externalSlotProps: slotProps?.area,
105
+ additionalProps: (0, _extends2.default)({}, other, getInteractionItemProps({
106
+ type: 'line',
107
+ seriesId: id
108
+ }), {
109
+ className: classes.root
110
+ }),
111
+ ownerState
112
+ });
113
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Area, (0, _extends2.default)({}, areaProps));
104
114
  }
105
115
  process.env.NODE_ENV !== "production" ? AreaElement.propTypes = {
106
116
  // ----------------------------- Warning --------------------------------
@@ -111,5 +121,15 @@ process.env.NODE_ENV !== "production" ? AreaElement.propTypes = {
111
121
  highlightScope: _propTypes.default.shape({
112
122
  faded: _propTypes.default.oneOf(['global', 'none', 'series']),
113
123
  highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
114
- })
124
+ }),
125
+ /**
126
+ * The props used for each component slot.
127
+ * @default {}
128
+ */
129
+ slotProps: _propTypes.default.object,
130
+ /**
131
+ * Overridable component slots.
132
+ * @default {}
133
+ */
134
+ slots: _propTypes.default.object
115
135
  } : void 0;
@@ -1,2 +1,15 @@
1
1
  import * as React from 'react';
2
- export declare function AreaPlot(props: React.SVGAttributes<SVGSVGElement>): React.JSX.Element | null;
2
+ import { AreaElementProps } from './AreaElement';
3
+ export interface AreaPlotSlotsComponent {
4
+ area?: React.JSXElementConstructor<AreaElementProps>;
5
+ }
6
+ export interface AreaPlotSlotComponentProps {
7
+ area?: Partial<AreaElementProps>;
8
+ }
9
+ export interface AreaPlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<AreaElementProps, 'slots' | 'slotProps'> {
10
+ }
11
+ declare function AreaPlot(props: AreaPlotProps): React.JSX.Element | null;
12
+ declare namespace AreaPlot {
13
+ var propTypes: any;
14
+ }
15
+ export { AreaPlot };
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.AreaPlot = AreaPlot;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
12
  var _d3Shape = require("d3-shape");
11
13
  var _SeriesContextProvider = require("../context/SeriesContextProvider");
12
14
  var _CartesianContextProvider = require("../context/CartesianContextProvider");
@@ -14,9 +16,15 @@ var _AreaElement = require("./AreaElement");
14
16
  var _useScale = require("../hooks/useScale");
15
17
  var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
16
18
  var _jsxRuntime = require("react/jsx-runtime");
19
+ const _excluded = ["slots", "slotProps"];
17
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
18
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
22
  function AreaPlot(props) {
23
+ const {
24
+ slots,
25
+ slotProps
26
+ } = props,
27
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
20
28
  const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).line;
21
29
  const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
22
30
  if (seriesData === undefined) {
@@ -34,7 +42,7 @@ function AreaPlot(props) {
34
42
  } = axisData;
35
43
  const defaultXAxisId = xAxisIds[0];
36
44
  const defaultYAxisId = yAxisIds[0];
37
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, props, {
45
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, other, {
38
46
  children: stackingGroups.flatMap(({
39
47
  ids: groupIds
40
48
  }) => {
@@ -60,9 +68,27 @@ function AreaPlot(props) {
60
68
  id: seriesId,
61
69
  d: areaPath.curve(curve)(d3Data) || undefined,
62
70
  color: series[seriesId].color,
63
- highlightScope: series[seriesId].highlightScope
71
+ highlightScope: series[seriesId].highlightScope,
72
+ slots: slots,
73
+ slotProps: slotProps
64
74
  }, seriesId);
65
75
  });
66
76
  })
67
77
  }));
68
- }
78
+ }
79
+ process.env.NODE_ENV !== "production" ? AreaPlot.propTypes = {
80
+ // ----------------------------- Warning --------------------------------
81
+ // | These PropTypes are generated from the TypeScript type definitions |
82
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
83
+ // ----------------------------------------------------------------------
84
+ /**
85
+ * The props used for each component slot.
86
+ * @default {}
87
+ */
88
+ slotProps: _propTypes.default.object,
89
+ /**
90
+ * Overridable component slots.
91
+ * @default {}
92
+ */
93
+ slots: _propTypes.default.object
94
+ } : void 0;