@mui/x-charts 7.0.0-beta.3 → 7.0.0-beta.4

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 (218) hide show
  1. package/BarChart/BarChart.js +0 -2
  2. package/CHANGELOG.md +226 -15
  3. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
  4. package/ChartsTooltip/utils.js +1 -1
  5. package/ChartsVoronoiHandler/ChartsVoronoiHandler.d.ts +0 -1
  6. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -2
  7. package/ChartsXAxis/ChartsXAxis.js +1 -1
  8. package/ChartsYAxis/ChartsYAxis.js +1 -1
  9. package/Gauge/Gauge.js +0 -2
  10. package/Gauge/GaugeContainer.d.ts +0 -2
  11. package/Gauge/GaugeContainer.js +0 -2
  12. package/Gauge/GaugeProvider.js +3 -0
  13. package/Gauge/GaugeValueText.js +1 -1
  14. package/LineChart/LineChart.js +0 -2
  15. package/PieChart/PieChart.js +0 -2
  16. package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -2
  17. package/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  18. package/ScatterChart/ScatterChart.js +0 -3
  19. package/SparkLineChart/SparkLineChart.js +0 -2
  20. package/context/CartesianContextProvider.d.ts +0 -8
  21. package/context/CartesianContextProvider.js +4 -89
  22. package/context/DrawingProvider.d.ts +2 -11
  23. package/context/DrawingProvider.js +10 -35
  24. package/context/HighlightProvider.js +3 -0
  25. package/context/InteractionProvider.js +3 -0
  26. package/context/SeriesContextProvider.js +3 -0
  27. package/context/index.d.ts +0 -2
  28. package/context/index.js +1 -15
  29. package/esm/BarChart/BarChart.js +0 -2
  30. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  31. package/esm/ChartsTooltip/utils.js +2 -2
  32. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -3
  33. package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
  34. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  35. package/esm/Gauge/Gauge.js +0 -2
  36. package/esm/Gauge/GaugeContainer.js +0 -2
  37. package/esm/Gauge/GaugeProvider.js +3 -0
  38. package/esm/Gauge/GaugeValueText.js +1 -1
  39. package/esm/LineChart/LineChart.js +0 -2
  40. package/esm/PieChart/PieChart.js +0 -2
  41. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  42. package/esm/ScatterChart/ScatterChart.js +0 -3
  43. package/esm/SparkLineChart/SparkLineChart.js +0 -2
  44. package/esm/context/CartesianContextProvider.js +3 -88
  45. package/esm/context/DrawingProvider.js +10 -36
  46. package/esm/context/HighlightProvider.js +3 -0
  47. package/esm/context/InteractionProvider.js +3 -0
  48. package/esm/context/SeriesContextProvider.js +3 -0
  49. package/esm/context/index.js +1 -2
  50. package/esm/hooks/useAxisEvents.js +2 -2
  51. package/hooks/useAxisEvents.js +1 -1
  52. package/hooks/useTicks.d.ts +1 -1
  53. package/index.js +1 -1
  54. package/modern/BarChart/BarChart.js +0 -2
  55. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  56. package/modern/ChartsTooltip/utils.js +2 -2
  57. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -3
  58. package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
  59. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  60. package/modern/Gauge/Gauge.js +0 -2
  61. package/modern/Gauge/GaugeContainer.js +0 -2
  62. package/modern/Gauge/GaugeProvider.js +3 -0
  63. package/modern/Gauge/GaugeValueText.js +1 -1
  64. package/modern/LineChart/LineChart.js +0 -2
  65. package/modern/PieChart/PieChart.js +0 -2
  66. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  67. package/modern/ScatterChart/ScatterChart.js +0 -3
  68. package/modern/SparkLineChart/SparkLineChart.js +0 -2
  69. package/modern/context/CartesianContextProvider.js +3 -88
  70. package/modern/context/DrawingProvider.js +10 -36
  71. package/modern/context/HighlightProvider.js +3 -0
  72. package/modern/context/InteractionProvider.js +3 -0
  73. package/modern/context/SeriesContextProvider.js +3 -0
  74. package/modern/context/index.js +1 -2
  75. package/modern/hooks/useAxisEvents.js +2 -2
  76. package/modern/index.js +1 -1
  77. package/package.json +1 -1
  78. package/legacy/BarChart/BarChart.js +0 -440
  79. package/legacy/BarChart/BarElement.js +0 -119
  80. package/legacy/BarChart/BarPlot.js +0 -232
  81. package/legacy/BarChart/extremums.js +0 -45
  82. package/legacy/BarChart/formatter.js +0 -78
  83. package/legacy/BarChart/index.js +0 -3
  84. package/legacy/BarChart/legend.js +0 -15
  85. package/legacy/ChartContainer/ChartContainer.js +0 -189
  86. package/legacy/ChartContainer/index.js +0 -1
  87. package/legacy/ChartsAxis/ChartsAxis.js +0 -215
  88. package/legacy/ChartsAxis/axisClasses.js +0 -5
  89. package/legacy/ChartsAxis/index.js +0 -2
  90. package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +0 -105
  91. package/legacy/ChartsAxisHighlight/index.js +0 -1
  92. package/legacy/ChartsClipPath/ChartsClipPath.js +0 -48
  93. package/legacy/ChartsClipPath/index.js +0 -1
  94. package/legacy/ChartsGrid/ChartsGrid.js +0 -119
  95. package/legacy/ChartsGrid/chartsGridClasses.js +0 -6
  96. package/legacy/ChartsGrid/index.js +0 -2
  97. package/legacy/ChartsLegend/ChartsLegend.js +0 -100
  98. package/legacy/ChartsLegend/DefaultChartsLegend.js +0 -302
  99. package/legacy/ChartsLegend/chartsLegendClasses.js +0 -5
  100. package/legacy/ChartsLegend/index.js +0 -4
  101. package/legacy/ChartsLegend/utils.js +0 -15
  102. package/legacy/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +0 -75
  103. package/legacy/ChartsOnAxisClickHandler/index.js +0 -1
  104. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +0 -72
  105. package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +0 -105
  106. package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +0 -105
  107. package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +0 -6
  108. package/legacy/ChartsReferenceLine/common.js +0 -19
  109. package/legacy/ChartsReferenceLine/index.js +0 -2
  110. package/legacy/ChartsSurface.js +0 -78
  111. package/legacy/ChartsText/ChartsText.js +0 -95
  112. package/legacy/ChartsText/index.js +0 -1
  113. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +0 -96
  114. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +0 -53
  115. package/legacy/ChartsTooltip/ChartsTooltip.js +0 -148
  116. package/legacy/ChartsTooltip/ChartsTooltipTable.js +0 -80
  117. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +0 -118
  118. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +0 -78
  119. package/legacy/ChartsTooltip/chartsTooltipClasses.js +0 -5
  120. package/legacy/ChartsTooltip/index.js +0 -6
  121. package/legacy/ChartsTooltip/utils.js +0 -103
  122. package/legacy/ChartsVoronoiHandler/ChartsVoronoiHandler.js +0 -206
  123. package/legacy/ChartsVoronoiHandler/index.js +0 -1
  124. package/legacy/ChartsXAxis/ChartsXAxis.js +0 -339
  125. package/legacy/ChartsXAxis/index.js +0 -1
  126. package/legacy/ChartsYAxis/ChartsYAxis.js +0 -267
  127. package/legacy/ChartsYAxis/index.js +0 -1
  128. package/legacy/Gauge/Gauge.js +0 -146
  129. package/legacy/Gauge/GaugeContainer.js +0 -215
  130. package/legacy/Gauge/GaugeProvider.js +0 -87
  131. package/legacy/Gauge/GaugeReferenceArc.js +0 -37
  132. package/legacy/Gauge/GaugeValueArc.js +0 -44
  133. package/legacy/Gauge/GaugeValueText.js +0 -66
  134. package/legacy/Gauge/gaugeClasses.js +0 -7
  135. package/legacy/Gauge/index.js +0 -7
  136. package/legacy/Gauge/utils.js +0 -84
  137. package/legacy/LineChart/AnimatedArea.js +0 -102
  138. package/legacy/LineChart/AnimatedLine.js +0 -104
  139. package/legacy/LineChart/AreaElement.js +0 -112
  140. package/legacy/LineChart/AreaPlot.js +0 -149
  141. package/legacy/LineChart/LineChart.js +0 -452
  142. package/legacy/LineChart/LineElement.js +0 -112
  143. package/legacy/LineChart/LineHighlightElement.js +0 -79
  144. package/legacy/LineChart/LineHighlightPlot.js +0 -97
  145. package/legacy/LineChart/LinePlot.js +0 -144
  146. package/legacy/LineChart/MarkElement.js +0 -153
  147. package/legacy/LineChart/MarkPlot.js +0 -178
  148. package/legacy/LineChart/extremums.js +0 -54
  149. package/legacy/LineChart/formatter.js +0 -82
  150. package/legacy/LineChart/index.js +0 -11
  151. package/legacy/LineChart/legend.js +0 -15
  152. package/legacy/PieChart/PieArc.js +0 -103
  153. package/legacy/PieChart/PieArcLabel.js +0 -112
  154. package/legacy/PieChart/PieArcLabelPlot.js +0 -193
  155. package/legacy/PieChart/PieArcPlot.js +0 -180
  156. package/legacy/PieChart/PieChart.js +0 -404
  157. package/legacy/PieChart/PiePlot.js +0 -137
  158. package/legacy/PieChart/dataTransform/transition.js +0 -149
  159. package/legacy/PieChart/dataTransform/useTransformData.js +0 -63
  160. package/legacy/PieChart/formatter.js +0 -55
  161. package/legacy/PieChart/index.js +0 -6
  162. package/legacy/PieChart/legend.js +0 -16
  163. package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -185
  164. package/legacy/ResponsiveChartContainer/index.js +0 -1
  165. package/legacy/ResponsiveChartContainer/useChartContainerDimensions.js +0 -73
  166. package/legacy/ScatterChart/Scatter.js +0 -110
  167. package/legacy/ScatterChart/ScatterChart.js +0 -395
  168. package/legacy/ScatterChart/ScatterPlot.js +0 -80
  169. package/legacy/ScatterChart/extremums.js +0 -39
  170. package/legacy/ScatterChart/formatter.js +0 -12
  171. package/legacy/ScatterChart/index.js +0 -3
  172. package/legacy/ScatterChart/legend.js +0 -15
  173. package/legacy/SparkLineChart/SparkLineChart.js +0 -266
  174. package/legacy/SparkLineChart/index.js +0 -1
  175. package/legacy/colorPalettes/colorPalettes.js +0 -15
  176. package/legacy/colorPalettes/index.js +0 -1
  177. package/legacy/constants.js +0 -8
  178. package/legacy/context/CartesianContextProvider.js +0 -327
  179. package/legacy/context/DrawingProvider.js +0 -74
  180. package/legacy/context/HighlightProvider.js +0 -56
  181. package/legacy/context/InteractionProvider.js +0 -81
  182. package/legacy/context/SeriesContextProvider.js +0 -74
  183. package/legacy/context/index.js +0 -2
  184. package/legacy/hooks/index.js +0 -2
  185. package/legacy/hooks/useAxisEvents.js +0 -120
  186. package/legacy/hooks/useChartDimensions.js +0 -18
  187. package/legacy/hooks/useDrawingArea.js +0 -21
  188. package/legacy/hooks/useInteractionItemProps.js +0 -71
  189. package/legacy/hooks/useMounted.js +0 -21
  190. package/legacy/hooks/useReducedMotion.js +0 -27
  191. package/legacy/hooks/useScale.js +0 -33
  192. package/legacy/hooks/useTicks.js +0 -65
  193. package/legacy/index.js +0 -33
  194. package/legacy/internals/components/AxisSharedComponents.js +0 -25
  195. package/legacy/internals/defaultizeColor.js +0 -17
  196. package/legacy/internals/defaultizeValueFormatter.js +0 -12
  197. package/legacy/internals/domUtils.js +0 -121
  198. package/legacy/internals/geometry.js +0 -37
  199. package/legacy/internals/getCurve.js +0 -39
  200. package/legacy/internals/getScale.js +0 -17
  201. package/legacy/internals/getWordsByLines.js +0 -15
  202. package/legacy/internals/isBandScale.js +0 -3
  203. package/legacy/internals/stackSeries.js +0 -92
  204. package/legacy/internals/useAnimatedPath.js +0 -32
  205. package/legacy/internals/utils.js +0 -52
  206. package/legacy/models/axis.js +0 -6
  207. package/legacy/models/helpers.js +0 -1
  208. package/legacy/models/index.js +0 -4
  209. package/legacy/models/layout.js +0 -1
  210. package/legacy/models/seriesType/bar.js +0 -1
  211. package/legacy/models/seriesType/common.js +0 -1
  212. package/legacy/models/seriesType/config.js +0 -1
  213. package/legacy/models/seriesType/index.js +0 -5
  214. package/legacy/models/seriesType/line.js +0 -1
  215. package/legacy/models/seriesType/pie.js +0 -1
  216. package/legacy/models/seriesType/scatter.js +0 -1
  217. package/legacy/models/stacking.js +0 -1
  218. package/legacy/themeAugmentation/index.js +0 -3
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import useId from '@mui/utils/useId';
5
4
  import useChartDimensions from '../hooks/useChartDimensions';
6
5
 
@@ -17,16 +16,16 @@ export const DrawingContext = /*#__PURE__*/React.createContext({
17
16
  width: 400,
18
17
  chartId: ''
19
18
  });
20
- export const SVGContext = /*#__PURE__*/React.createContext({
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ DrawingContext.displayName = 'DrawingContext';
21
+ }
22
+ export const SvgContext = /*#__PURE__*/React.createContext({
21
23
  current: null
22
24
  });
23
-
24
- /**
25
- * API:
26
- *
27
- * - [DrawingProvider API](https://mui.com/x/api/charts/drawing-provider/)
28
- */
29
- function DrawingProvider(props) {
25
+ if (process.env.NODE_ENV !== 'production') {
26
+ SvgContext.displayName = 'SvgContext';
27
+ }
28
+ export function DrawingProvider(props) {
30
29
  const {
31
30
  width,
32
31
  height,
@@ -39,36 +38,11 @@ function DrawingProvider(props) {
39
38
  const value = React.useMemo(() => _extends({
40
39
  chartId: chartId != null ? chartId : ''
41
40
  }, drawingArea), [chartId, drawingArea]);
42
- return /*#__PURE__*/_jsx(SVGContext.Provider, {
41
+ return /*#__PURE__*/_jsx(SvgContext.Provider, {
43
42
  value: svgRef,
44
43
  children: /*#__PURE__*/_jsx(DrawingContext.Provider, {
45
44
  value: value,
46
45
  children: children
47
46
  })
48
47
  });
49
- }
50
- process.env.NODE_ENV !== "production" ? DrawingProvider.propTypes = {
51
- // ----------------------------- Warning --------------------------------
52
- // | These PropTypes are generated from the TypeScript type definitions |
53
- // | To update them edit the TypeScript types and run "yarn proptypes" |
54
- // ----------------------------------------------------------------------
55
- children: PropTypes.node,
56
- height: PropTypes.number.isRequired,
57
- /**
58
- * The margin between the SVG and the drawing area.
59
- * It's used for leaving some space for extra information such as the x- and y-axis or legend.
60
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
61
- * @default object Depends on the charts type.
62
- */
63
- margin: PropTypes.shape({
64
- bottom: PropTypes.number,
65
- left: PropTypes.number,
66
- right: PropTypes.number,
67
- top: PropTypes.number
68
- }),
69
- svgRef: PropTypes.shape({
70
- current: PropTypes.object
71
- }).isRequired,
72
- width: PropTypes.number.isRequired
73
- } : void 0;
74
- export { DrawingProvider };
48
+ }
@@ -10,6 +10,9 @@ export const HighlighContext = /*#__PURE__*/React.createContext({
10
10
  scope: defaultScope,
11
11
  dispatch: () => null
12
12
  });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ HighlighContext.displayName = 'HighlighContext';
15
+ }
13
16
  const dataReducer = (prevState, action) => {
14
17
  switch (action.type) {
15
18
  case 'enterItem':
@@ -10,6 +10,9 @@ export const InteractionContext = /*#__PURE__*/React.createContext({
10
10
  useVoronoiInteraction: false,
11
11
  dispatch: () => null
12
12
  });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ InteractionContext.displayName = 'InteractionContext';
15
+ }
13
16
  const dataReducer = (prevState, action) => {
14
17
  switch (action.type) {
15
18
  case 'enterItem':
@@ -9,6 +9,9 @@ import { defaultizeColor } from '../internals/defaultizeColor';
9
9
  import { blueberryTwilightPalette } from '../colorPalettes';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  export const SeriesContext = /*#__PURE__*/React.createContext({});
12
+ if (process.env.NODE_ENV !== 'production') {
13
+ SeriesContext.displayName = 'SeriesContext';
14
+ }
12
15
  const seriesTypeFormatter = {
13
16
  bar: barSeriesFormatter,
14
17
  scatter: scatterSeriesFormatter,
@@ -1,2 +1 @@
1
- export { CartesianContextProvider } from './CartesianContextProvider';
2
- export { DrawingProvider } from './DrawingProvider';
1
+ export {};
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { InteractionContext } from '../context/InteractionProvider';
3
3
  import { CartesianContext } from '../context/CartesianContextProvider';
4
- import { SVGContext, DrawingContext } from '../context/DrawingProvider';
4
+ import { SvgContext, DrawingContext } from '../context/DrawingProvider';
5
5
  import { isBandScale } from '../internals/isBandScale';
6
6
  import { getSVGPoint } from '../internals/utils';
7
7
  function getAsANumber(value) {
8
8
  return value instanceof Date ? value.getTime() : value;
9
9
  }
10
10
  export const useAxisEvents = disableAxisListener => {
11
- const svgRef = React.useContext(SVGContext);
11
+ const svgRef = React.useContext(SvgContext);
12
12
  const {
13
13
  width,
14
14
  height,
@@ -16,7 +16,7 @@ function getAsANumber(value) {
16
16
  return value instanceof Date ? value.getTime() : value;
17
17
  }
18
18
  const useAxisEvents = disableAxisListener => {
19
- const svgRef = React.useContext(_DrawingProvider.SVGContext);
19
+ const svgRef = React.useContext(_DrawingProvider.SvgContext);
20
20
  const {
21
21
  width,
22
22
  height,
@@ -7,7 +7,7 @@ export interface TickParams {
7
7
  */
8
8
  tickMaxStep?: number;
9
9
  /**
10
- * Maximal step between two ticks.
10
+ * Minimal step between two ticks.
11
11
  * When using time data, the value is assumed to be in ms.
12
12
  * Not supported by categorical axis (band, points).
13
13
  */
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-beta.3
2
+ * @mui/x-charts v7.0.0-beta.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -186,7 +186,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
186
186
  }),
187
187
  /**
188
188
  * The height of the chart in px. If not defined, it takes the height of the parent element.
189
- * @default undefined
190
189
  */
191
190
  height: PropTypes.number,
192
191
  /**
@@ -355,7 +354,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
355
354
  }),
356
355
  /**
357
356
  * The width of the chart in px. If not defined, it takes the width of the parent element.
358
- * @default undefined
359
357
  */
360
358
  width: PropTypes.number,
361
359
  /**
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { SVGContext } from '../context/DrawingProvider';
3
+ import { SvgContext } from '../context/DrawingProvider';
4
4
  import { InteractionContext } from '../context/InteractionProvider';
5
5
  import { CartesianContext } from '../context/CartesianContextProvider';
6
6
  import { SeriesContext } from '../context/SeriesContextProvider';
@@ -9,7 +9,7 @@ function ChartsOnAxisClickHandler(props) {
9
9
  const {
10
10
  onAxisClick
11
11
  } = props;
12
- const svgRef = React.useContext(SVGContext);
12
+ const svgRef = React.useContext(SvgContext);
13
13
  const series = React.useContext(SeriesContext);
14
14
  const {
15
15
  axis
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SVGContext } from '../context/DrawingProvider';
2
+ import { SvgContext } from '../context/DrawingProvider';
3
3
  export function generateVirtualElement(mousePosition) {
4
4
  if (mousePosition === null) {
5
5
  return {
@@ -44,7 +44,7 @@ export function generateVirtualElement(mousePosition) {
44
44
  };
45
45
  }
46
46
  export function useMouseTracker() {
47
- const svgRef = React.useContext(SVGContext);
47
+ const svgRef = React.useContext(SvgContext);
48
48
 
49
49
  // Use a ref to avoid rerendering on every mousemove event.
50
50
  const [mousePosition, setMousePosition] = React.useState(null);
@@ -4,7 +4,7 @@ import { Delaunay } from 'd3-delaunay';
4
4
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
5
5
  import { InteractionContext } from '../context/InteractionProvider';
6
6
  import { CartesianContext } from '../context/CartesianContextProvider';
7
- import { SVGContext, DrawingContext } from '../context/DrawingProvider';
7
+ import { SvgContext, DrawingContext } from '../context/DrawingProvider';
8
8
  import { SeriesContext } from '../context/SeriesContextProvider';
9
9
  import { getValueToPositionMapper } from '../hooks/useScale';
10
10
  import { getSVGPoint } from '../internals/utils';
@@ -14,7 +14,7 @@ function ChartsVoronoiHandler(props) {
14
14
  voronoiMaxRadius,
15
15
  onItemClick
16
16
  } = props;
17
- const svgRef = React.useContext(SVGContext);
17
+ const svgRef = React.useContext(SvgContext);
18
18
  const {
19
19
  width,
20
20
  height,
@@ -207,7 +207,6 @@ process.env.NODE_ENV !== "production" ? ChartsVoronoiHandler.propTypes = {
207
207
  /**
208
208
  * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
209
209
  * If `undefined`, the radius is assumed to be infinite.
210
- * @default undefined
211
210
  */
212
211
  voronoiMaxRadius: PropTypes.number
213
212
  } : void 0;
@@ -330,7 +330,7 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
330
330
  */
331
331
  tickMaxStep: PropTypes.number,
332
332
  /**
333
- * Maximal step between two ticks.
333
+ * Minimal step between two ticks.
334
334
  * When using time data, the value is assumed to be in ms.
335
335
  * Not supported by categorical axis (band, points).
336
336
  */
@@ -260,7 +260,7 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
260
260
  */
261
261
  tickMaxStep: PropTypes.number,
262
262
  /**
263
- * Maximal step between two ticks.
263
+ * Minimal step between two ticks.
264
264
  * When using time data, the value is assumed to be in ms.
265
265
  * Not supported by categorical axis (band, points).
266
266
  */
@@ -82,7 +82,6 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
82
82
  endAngle: PropTypes.number,
83
83
  /**
84
84
  * The height of the chart in px. If not defined, it takes the height of the parent element.
85
- * @default undefined
86
85
  */
87
86
  height: PropTypes.number,
88
87
  /**
@@ -142,7 +141,6 @@ process.env.NODE_ENV !== "production" ? Gauge.propTypes = {
142
141
  }),
143
142
  /**
144
143
  * The width of the chart in px. If not defined, it takes the width of the parent element.
145
- * @default undefined
146
144
  */
147
145
  width: PropTypes.number
148
146
  } : void 0;
@@ -142,7 +142,6 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
142
142
  endAngle: PropTypes.number,
143
143
  /**
144
144
  * The height of the chart in px. If not defined, it takes the height of the parent element.
145
- * @default undefined
146
145
  */
147
146
  height: PropTypes.number,
148
147
  /**
@@ -201,7 +200,6 @@ process.env.NODE_ENV !== "production" ? GaugeContainer.propTypes = {
201
200
  }),
202
201
  /**
203
202
  * The width of the chart in px. If not defined, it takes the width of the parent element.
204
- * @default undefined
205
203
  */
206
204
  width: PropTypes.number
207
205
  } : void 0;
@@ -18,6 +18,9 @@ export const GaugeContext = /*#__PURE__*/React.createContext({
18
18
  maxRadius: 0,
19
19
  valueAngle: null
20
20
  });
21
+ if (process.env.NODE_ENV !== 'production') {
22
+ GaugeContext.displayName = 'GaugeContext';
23
+ }
21
24
  export function GaugeProvider(props) {
22
25
  const {
23
26
  value = null,
@@ -9,7 +9,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  function defaultFormatter({
10
10
  value
11
11
  }) {
12
- return value === null ? 'NaN' : value.toLocaleString();
12
+ return value === null ? null : value.toLocaleString();
13
13
  }
14
14
  function GaugeValueText(props) {
15
15
  const {
@@ -197,7 +197,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
197
197
  }),
198
198
  /**
199
199
  * The height of the chart in px. If not defined, it takes the height of the parent element.
200
- * @default undefined
201
200
  */
202
201
  height: PropTypes.number,
203
202
  /**
@@ -368,7 +367,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
368
367
  }),
369
368
  /**
370
369
  * The width of the chart in px. If not defined, it takes the width of the parent element.
371
- * @default undefined
372
370
  */
373
371
  width: PropTypes.number,
374
372
  /**
@@ -157,7 +157,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
157
157
  disableAxisListener: PropTypes.bool,
158
158
  /**
159
159
  * The height of the chart in px. If not defined, it takes the height of the parent element.
160
- * @default undefined
161
160
  */
162
161
  height: PropTypes.number,
163
162
  /**
@@ -315,7 +314,6 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
315
314
  }),
316
315
  /**
317
316
  * The width of the chart in px. If not defined, it takes the width of the parent element.
318
- * @default undefined
319
317
  */
320
318
  width: PropTypes.number,
321
319
  /**
@@ -72,7 +72,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
72
72
  disableAxisListener: PropTypes.bool,
73
73
  /**
74
74
  * The height of the chart in px. If not defined, it takes the height of the parent element.
75
- * @default undefined
76
75
  */
77
76
  height: PropTypes.number,
78
77
  /**
@@ -103,7 +102,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
103
102
  }),
104
103
  /**
105
104
  * The width of the chart in px. If not defined, it takes the width of the parent element.
106
- * @default undefined
107
105
  */
108
106
  width: PropTypes.number,
109
107
  /**
@@ -159,7 +159,6 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
159
159
  }),
160
160
  /**
161
161
  * The height of the chart in px. If not defined, it takes the height of the parent element.
162
- * @default undefined
163
162
  */
164
163
  height: PropTypes.number,
165
164
  /**
@@ -313,12 +312,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
313
312
  /**
314
313
  * Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
315
314
  * If `undefined`, the radius is assumed to be infinite.
316
- * @default undefined
317
315
  */
318
316
  voronoiMaxRadius: PropTypes.number,
319
317
  /**
320
318
  * The width of the chart in px. If not defined, it takes the width of the parent element.
321
- * @default undefined
322
319
  */
323
320
  width: PropTypes.number,
324
321
  /**
@@ -146,7 +146,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
146
146
  disableAxisListener: PropTypes.bool,
147
147
  /**
148
148
  * The height of the chart in px. If not defined, it takes the height of the parent element.
149
- * @default undefined
150
149
  */
151
150
  height: PropTypes.number,
152
151
  /**
@@ -218,7 +217,6 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
218
217
  }),
219
218
  /**
220
219
  * The width of the chart in px. If not defined, it takes the width of the parent element.
221
- * @default undefined
222
220
  */
223
221
  width: PropTypes.number,
224
222
  /**
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { scaleBand, scalePoint } from 'd3-scale';
4
- import PropTypes from 'prop-types';
5
4
  import { getExtremumX as getBarExtremumX, getExtremumY as getBarExtremumY } from '../BarChart/extremums';
6
5
  import { getExtremumX as getScatterExtremumX, getExtremumY as getScatterExtremumY } from '../ScatterChart/extremums';
7
6
  import { getExtremumX as getLineExtremumX, getExtremumY as getLineExtremumY } from '../LineChart/extremums';
@@ -32,12 +31,9 @@ export const CartesianContext = /*#__PURE__*/React.createContext({
32
31
  xAxisIds: [],
33
32
  yAxisIds: []
34
33
  });
35
-
36
- /**
37
- * API:
38
- *
39
- * - [CartesianContextProvider API](https://mui.com/x/api/charts/cartesian-context-provider/)
40
- */
34
+ if (process.env.NODE_ENV !== 'production') {
35
+ CartesianContext.displayName = 'CartesianContext';
36
+ }
41
37
  function CartesianContextProvider(props) {
42
38
  const {
43
39
  xAxis: inXAxis,
@@ -210,85 +206,4 @@ function CartesianContextProvider(props) {
210
206
  children: children
211
207
  });
212
208
  }
213
- process.env.NODE_ENV !== "production" ? CartesianContextProvider.propTypes = {
214
- // ----------------------------- Warning --------------------------------
215
- // | These PropTypes are generated from the TypeScript type definitions |
216
- // | To update them edit the TypeScript types and run "yarn proptypes" |
217
- // ----------------------------------------------------------------------
218
- children: PropTypes.node,
219
- /**
220
- * An array of objects that can be used to populate series and axes data using their `dataKey` property.
221
- */
222
- dataset: PropTypes.arrayOf(PropTypes.object),
223
- /**
224
- * The configuration of the x-axes.
225
- * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
226
- */
227
- xAxis: PropTypes.arrayOf(PropTypes.shape({
228
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
229
- classes: PropTypes.object,
230
- data: PropTypes.array,
231
- dataKey: PropTypes.string,
232
- disableLine: PropTypes.bool,
233
- disableTicks: PropTypes.bool,
234
- fill: PropTypes.string,
235
- hideTooltip: PropTypes.bool,
236
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
237
- label: PropTypes.string,
238
- labelFontSize: PropTypes.number,
239
- labelStyle: PropTypes.object,
240
- max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
241
- min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
242
- position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
243
- reverse: PropTypes.bool,
244
- scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
245
- slotProps: PropTypes.object,
246
- slots: PropTypes.object,
247
- stroke: PropTypes.string,
248
- tickFontSize: PropTypes.number,
249
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
250
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
251
- tickLabelStyle: PropTypes.object,
252
- tickMaxStep: PropTypes.number,
253
- tickMinStep: PropTypes.number,
254
- tickNumber: PropTypes.number,
255
- tickSize: PropTypes.number,
256
- valueFormatter: PropTypes.func
257
- })),
258
- /**
259
- * The configuration of the y-axes.
260
- * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
261
- */
262
- yAxis: PropTypes.arrayOf(PropTypes.shape({
263
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
264
- classes: PropTypes.object,
265
- data: PropTypes.array,
266
- dataKey: PropTypes.string,
267
- disableLine: PropTypes.bool,
268
- disableTicks: PropTypes.bool,
269
- fill: PropTypes.string,
270
- hideTooltip: PropTypes.bool,
271
- id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
272
- label: PropTypes.string,
273
- labelFontSize: PropTypes.number,
274
- labelStyle: PropTypes.object,
275
- max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
276
- min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
277
- position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
278
- reverse: PropTypes.bool,
279
- scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
280
- slotProps: PropTypes.object,
281
- slots: PropTypes.object,
282
- stroke: PropTypes.string,
283
- tickFontSize: PropTypes.number,
284
- tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
285
- tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
286
- tickLabelStyle: PropTypes.object,
287
- tickMaxStep: PropTypes.number,
288
- tickMinStep: PropTypes.number,
289
- tickNumber: PropTypes.number,
290
- tickSize: PropTypes.number,
291
- valueFormatter: PropTypes.func
292
- }))
293
- } : void 0;
294
209
  export { CartesianContextProvider };
@@ -1,6 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import useId from '@mui/utils/useId';
5
4
  import useChartDimensions from '../hooks/useChartDimensions';
6
5
 
@@ -17,16 +16,16 @@ export const DrawingContext = /*#__PURE__*/React.createContext({
17
16
  width: 400,
18
17
  chartId: ''
19
18
  });
20
- export const SVGContext = /*#__PURE__*/React.createContext({
19
+ if (process.env.NODE_ENV !== 'production') {
20
+ DrawingContext.displayName = 'DrawingContext';
21
+ }
22
+ export const SvgContext = /*#__PURE__*/React.createContext({
21
23
  current: null
22
24
  });
23
-
24
- /**
25
- * API:
26
- *
27
- * - [DrawingProvider API](https://mui.com/x/api/charts/drawing-provider/)
28
- */
29
- function DrawingProvider(props) {
25
+ if (process.env.NODE_ENV !== 'production') {
26
+ SvgContext.displayName = 'SvgContext';
27
+ }
28
+ export function DrawingProvider(props) {
30
29
  const {
31
30
  width,
32
31
  height,
@@ -39,36 +38,11 @@ function DrawingProvider(props) {
39
38
  const value = React.useMemo(() => _extends({
40
39
  chartId: chartId ?? ''
41
40
  }, drawingArea), [chartId, drawingArea]);
42
- return /*#__PURE__*/_jsx(SVGContext.Provider, {
41
+ return /*#__PURE__*/_jsx(SvgContext.Provider, {
43
42
  value: svgRef,
44
43
  children: /*#__PURE__*/_jsx(DrawingContext.Provider, {
45
44
  value: value,
46
45
  children: children
47
46
  })
48
47
  });
49
- }
50
- process.env.NODE_ENV !== "production" ? DrawingProvider.propTypes = {
51
- // ----------------------------- Warning --------------------------------
52
- // | These PropTypes are generated from the TypeScript type definitions |
53
- // | To update them edit the TypeScript types and run "yarn proptypes" |
54
- // ----------------------------------------------------------------------
55
- children: PropTypes.node,
56
- height: PropTypes.number.isRequired,
57
- /**
58
- * The margin between the SVG and the drawing area.
59
- * It's used for leaving some space for extra information such as the x- and y-axis or legend.
60
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
61
- * @default object Depends on the charts type.
62
- */
63
- margin: PropTypes.shape({
64
- bottom: PropTypes.number,
65
- left: PropTypes.number,
66
- right: PropTypes.number,
67
- top: PropTypes.number
68
- }),
69
- svgRef: PropTypes.shape({
70
- current: PropTypes.object
71
- }).isRequired,
72
- width: PropTypes.number.isRequired
73
- } : void 0;
74
- export { DrawingProvider };
48
+ }
@@ -10,6 +10,9 @@ export const HighlighContext = /*#__PURE__*/React.createContext({
10
10
  scope: defaultScope,
11
11
  dispatch: () => null
12
12
  });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ HighlighContext.displayName = 'HighlighContext';
15
+ }
13
16
  const dataReducer = (prevState, action) => {
14
17
  switch (action.type) {
15
18
  case 'enterItem':
@@ -10,6 +10,9 @@ export const InteractionContext = /*#__PURE__*/React.createContext({
10
10
  useVoronoiInteraction: false,
11
11
  dispatch: () => null
12
12
  });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ InteractionContext.displayName = 'InteractionContext';
15
+ }
13
16
  const dataReducer = (prevState, action) => {
14
17
  switch (action.type) {
15
18
  case 'enterItem':
@@ -9,6 +9,9 @@ import { defaultizeColor } from '../internals/defaultizeColor';
9
9
  import { blueberryTwilightPalette } from '../colorPalettes';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  export const SeriesContext = /*#__PURE__*/React.createContext({});
12
+ if (process.env.NODE_ENV !== 'production') {
13
+ SeriesContext.displayName = 'SeriesContext';
14
+ }
12
15
  const seriesTypeFormatter = {
13
16
  bar: barSeriesFormatter,
14
17
  scatter: scatterSeriesFormatter,
@@ -1,2 +1 @@
1
- export { CartesianContextProvider } from './CartesianContextProvider';
2
- export { DrawingProvider } from './DrawingProvider';
1
+ export {};
@@ -1,14 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { InteractionContext } from '../context/InteractionProvider';
3
3
  import { CartesianContext } from '../context/CartesianContextProvider';
4
- import { SVGContext, DrawingContext } from '../context/DrawingProvider';
4
+ import { SvgContext, DrawingContext } from '../context/DrawingProvider';
5
5
  import { isBandScale } from '../internals/isBandScale';
6
6
  import { getSVGPoint } from '../internals/utils';
7
7
  function getAsANumber(value) {
8
8
  return value instanceof Date ? value.getTime() : value;
9
9
  }
10
10
  export const useAxisEvents = disableAxisListener => {
11
- const svgRef = React.useContext(SVGContext);
11
+ const svgRef = React.useContext(SvgContext);
12
12
  const {
13
13
  width,
14
14
  height,
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-beta.3
2
+ * @mui/x-charts v7.0.0-beta.4
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-beta.4",
4
4
  "description": "The community edition of the charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",