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

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 (286) hide show
  1. package/BarChart/BarChart.d.ts +19 -5
  2. package/BarChart/BarChart.js +52 -13
  3. package/BarChart/BarElement.d.ts +1319 -4
  4. package/BarChart/BarElement.js +10 -10
  5. package/BarChart/BarPlot.d.ts +17 -1
  6. package/BarChart/BarPlot.js +152 -66
  7. package/BarChart/formatter.js +2 -3
  8. package/BarChart/legend.js +1 -2
  9. package/CHANGELOG.md +786 -48
  10. package/ChartContainer/index.js +7 -5
  11. package/ChartsAxis/ChartsAxis.d.ts +9 -0
  12. package/ChartsAxis/ChartsAxis.js +28 -2
  13. package/ChartsAxis/axisClasses.d.ts +1 -1
  14. package/ChartsAxis/axisClasses.js +1 -2
  15. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +21 -0
  16. package/ChartsAxisHighlight/ChartsAxisHighlight.js +61 -22
  17. package/ChartsClipPath/ChartsClipPath.d.ts +5 -0
  18. package/ChartsClipPath/ChartsClipPath.js +7 -2
  19. package/ChartsLegend/ChartsLegend.d.ts +44 -24
  20. package/ChartsLegend/ChartsLegend.js +192 -150
  21. package/ChartsLegend/chartsLegendClasses.js +1 -2
  22. package/ChartsLegend/utils.d.ts +1 -6
  23. package/ChartsSurface.d.ts +1 -1
  24. package/ChartsSurface.js +9 -18
  25. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
  26. package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
  27. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
  28. package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
  29. package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
  30. package/ChartsTooltip/ChartsTooltip.js +62 -18
  31. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
  32. package/ChartsTooltip/ChartsTooltipTable.js +22 -20
  33. package/ChartsTooltip/tooltipClasses.js +1 -2
  34. package/ChartsTooltip/utils.js +2 -2
  35. package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
  36. package/ChartsXAxis/ChartsXAxis.js +161 -40
  37. package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
  38. package/ChartsYAxis/ChartsYAxis.js +86 -33
  39. package/LineChart/AreaElement.d.ts +12 -2
  40. package/LineChart/AreaElement.js +14 -6
  41. package/LineChart/AreaPlot.d.ts +11 -0
  42. package/LineChart/AreaPlot.js +27 -8
  43. package/LineChart/LineChart.d.ts +21 -3
  44. package/LineChart/LineChart.js +61 -14
  45. package/LineChart/LineElement.d.ts +12 -2
  46. package/LineChart/LineElement.js +14 -6
  47. package/LineChart/LineHighlightElement.d.ts +31 -0
  48. package/LineChart/LineHighlightElement.js +88 -0
  49. package/LineChart/LineHighlightPlot.d.ts +35 -0
  50. package/LineChart/LineHighlightPlot.js +110 -0
  51. package/LineChart/LinePlot.d.ts +10 -0
  52. package/LineChart/LinePlot.js +25 -12
  53. package/LineChart/MarkElement.d.ts +11 -1
  54. package/LineChart/MarkElement.js +15 -9
  55. package/LineChart/MarkPlot.d.ts +10 -0
  56. package/LineChart/MarkPlot.js +62 -15
  57. package/LineChart/formatter.js +5 -5
  58. package/LineChart/index.d.ts +2 -0
  59. package/LineChart/index.js +20 -0
  60. package/LineChart/legend.js +1 -2
  61. package/PieChart/PieArc.d.ts +12 -14
  62. package/PieChart/PieArc.js +28 -60
  63. package/PieChart/PieArcLabel.d.ts +9 -10
  64. package/PieChart/PieArcLabel.js +46 -38
  65. package/PieChart/PieArcLabelPlot.d.ts +28 -0
  66. package/PieChart/PieArcLabelPlot.js +99 -0
  67. package/PieChart/PieArcPlot.d.ts +35 -0
  68. package/PieChart/PieArcPlot.js +92 -0
  69. package/PieChart/PieChart.d.ts +19 -5
  70. package/PieChart/PieChart.js +61 -14
  71. package/PieChart/PiePlot.d.ts +15 -9
  72. package/PieChart/PiePlot.js +77 -55
  73. package/PieChart/dataTransform/transition.d.ts +4 -0
  74. package/PieChart/dataTransform/transition.js +136 -0
  75. package/PieChart/dataTransform/useTransformData.d.ts +15 -0
  76. package/PieChart/dataTransform/useTransformData.js +67 -0
  77. package/PieChart/formatter.js +1 -2
  78. package/PieChart/legend.js +1 -2
  79. package/README.md +8 -14
  80. package/ResponsiveChartContainer/index.js +7 -8
  81. package/ScatterChart/Scatter.d.ts +10 -0
  82. package/ScatterChart/Scatter.js +12 -2
  83. package/ScatterChart/ScatterChart.d.ts +16 -3
  84. package/ScatterChart/ScatterChart.js +43 -12
  85. package/ScatterChart/ScatterPlot.d.ts +10 -0
  86. package/ScatterChart/ScatterPlot.js +12 -2
  87. package/ScatterChart/formatter.js +1 -2
  88. package/ScatterChart/legend.js +1 -2
  89. package/SparkLineChart/SparkLineChart.d.ts +13 -3
  90. package/SparkLineChart/SparkLineChart.js +34 -18
  91. package/colorPalettes/colorPalettes.js +6 -12
  92. package/constants.js +5 -8
  93. package/context/CartesianContextProvider.d.ts +5 -0
  94. package/context/CartesianContextProvider.js +31 -16
  95. package/context/DrawingProvider.d.ts +7 -0
  96. package/context/DrawingProvider.js +12 -6
  97. package/context/HighlightProvider.js +3 -4
  98. package/context/InteractionProvider.js +3 -4
  99. package/context/SeriesContextProvider.js +3 -4
  100. package/esm/BarChart/BarChart.js +49 -9
  101. package/esm/BarChart/BarElement.js +7 -4
  102. package/esm/BarChart/BarPlot.js +152 -67
  103. package/esm/BarChart/formatter.js +1 -1
  104. package/esm/ChartContainer/index.js +3 -0
  105. package/esm/ChartsAxis/ChartsAxis.js +26 -0
  106. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  107. package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
  108. package/esm/ChartsLegend/ChartsLegend.js +188 -142
  109. package/esm/ChartsSurface.js +4 -12
  110. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  111. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  112. package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
  113. package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
  114. package/esm/ChartsXAxis/ChartsXAxis.js +158 -37
  115. package/esm/ChartsYAxis/ChartsYAxis.js +83 -30
  116. package/esm/LineChart/AreaElement.js +10 -0
  117. package/esm/LineChart/AreaPlot.js +26 -6
  118. package/esm/LineChart/LineChart.js +58 -10
  119. package/esm/LineChart/LineElement.js +10 -0
  120. package/esm/LineChart/LineHighlightElement.js +78 -0
  121. package/esm/LineChart/LineHighlightPlot.js +103 -0
  122. package/esm/LineChart/LinePlot.js +25 -14
  123. package/esm/LineChart/MarkElement.js +12 -5
  124. package/esm/LineChart/MarkPlot.js +60 -13
  125. package/esm/LineChart/formatter.js +7 -3
  126. package/esm/LineChart/index.js +3 -1
  127. package/esm/PieChart/PieArc.js +26 -58
  128. package/esm/PieChart/PieArcLabel.js +43 -34
  129. package/esm/PieChart/PieArcLabelPlot.js +92 -0
  130. package/esm/PieChart/PieArcPlot.js +84 -0
  131. package/esm/PieChart/PieChart.js +59 -12
  132. package/esm/PieChart/PiePlot.js +76 -57
  133. package/esm/PieChart/dataTransform/transition.js +130 -0
  134. package/esm/PieChart/dataTransform/useTransformData.js +59 -0
  135. package/esm/ResponsiveChartContainer/index.js +3 -3
  136. package/esm/ScatterChart/Scatter.js +10 -0
  137. package/esm/ScatterChart/ScatterChart.js +40 -8
  138. package/esm/ScatterChart/ScatterPlot.js +10 -0
  139. package/esm/SparkLineChart/SparkLineChart.js +32 -15
  140. package/esm/constants.js +1 -1
  141. package/esm/context/CartesianContextProvider.js +30 -14
  142. package/esm/context/DrawingProvider.js +8 -0
  143. package/esm/hooks/useChartDimensions.js +2 -0
  144. package/esm/hooks/useMounted.js +16 -0
  145. package/esm/hooks/useReducedMotion.js +27 -0
  146. package/esm/hooks/useTicks.js +15 -9
  147. package/esm/internals/components/AxisSharedComponents.js +15 -70
  148. package/esm/internals/components/ChartsText.js +77 -0
  149. package/esm/internals/domUtils.js +113 -0
  150. package/esm/internals/geometry.js +36 -0
  151. package/hooks/useAxisEvents.js +2 -2
  152. package/hooks/useChartDimensions.d.ts +2 -0
  153. package/hooks/useChartDimensions.js +5 -4
  154. package/hooks/useDrawingArea.js +2 -2
  155. package/hooks/useInteractionItemProps.js +2 -2
  156. package/hooks/useMounted.d.ts +1 -0
  157. package/hooks/useMounted.js +25 -0
  158. package/hooks/useReducedMotion.d.ts +8 -0
  159. package/hooks/useReducedMotion.js +33 -0
  160. package/hooks/useScale.d.ts +2 -2
  161. package/hooks/useScale.js +2 -2
  162. package/hooks/useTicks.d.ts +19 -11
  163. package/hooks/useTicks.js +19 -14
  164. package/index.js +1 -1
  165. package/internals/components/AxisSharedComponents.d.ts +0 -4
  166. package/internals/components/AxisSharedComponents.js +18 -78
  167. package/internals/components/ChartsText.d.ts +35 -0
  168. package/internals/components/ChartsText.js +87 -0
  169. package/internals/defaultizeColor.d.ts +8 -1
  170. package/internals/defaultizeValueFormatter.js +1 -2
  171. package/internals/domUtils.d.ts +13 -0
  172. package/internals/domUtils.js +122 -0
  173. package/internals/geometry.d.ts +9 -0
  174. package/internals/geometry.js +42 -0
  175. package/internals/stackSeries.js +2 -4
  176. package/legacy/BarChart/BarChart.js +49 -9
  177. package/legacy/BarChart/BarElement.js +6 -3
  178. package/legacy/BarChart/BarPlot.js +151 -63
  179. package/legacy/BarChart/formatter.js +1 -1
  180. package/legacy/ChartContainer/index.js +3 -0
  181. package/legacy/ChartsAxis/ChartsAxis.js +26 -0
  182. package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
  183. package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
  184. package/legacy/ChartsLegend/ChartsLegend.js +203 -140
  185. package/legacy/ChartsSurface.js +3 -12
  186. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
  187. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  188. package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
  189. package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
  190. package/legacy/ChartsXAxis/ChartsXAxis.js +162 -39
  191. package/legacy/ChartsYAxis/ChartsYAxis.js +83 -30
  192. package/legacy/LineChart/AreaElement.js +10 -0
  193. package/legacy/LineChart/AreaPlot.js +31 -7
  194. package/legacy/LineChart/LineChart.js +58 -10
  195. package/legacy/LineChart/LineElement.js +10 -0
  196. package/legacy/LineChart/LineHighlightElement.js +77 -0
  197. package/legacy/LineChart/LineHighlightPlot.js +96 -0
  198. package/legacy/LineChart/LinePlot.js +29 -12
  199. package/legacy/LineChart/MarkElement.js +12 -5
  200. package/legacy/LineChart/MarkPlot.js +50 -5
  201. package/legacy/LineChart/formatter.js +7 -3
  202. package/legacy/LineChart/index.js +3 -1
  203. package/legacy/PieChart/PieArc.js +30 -62
  204. package/legacy/PieChart/PieArcLabel.js +48 -34
  205. package/legacy/PieChart/PieArcLabelPlot.js +93 -0
  206. package/legacy/PieChart/PieArcPlot.js +84 -0
  207. package/legacy/PieChart/PieChart.js +59 -12
  208. package/legacy/PieChart/PiePlot.js +76 -59
  209. package/legacy/PieChart/dataTransform/transition.js +142 -0
  210. package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
  211. package/legacy/ResponsiveChartContainer/index.js +3 -3
  212. package/legacy/ScatterChart/Scatter.js +10 -0
  213. package/legacy/ScatterChart/ScatterChart.js +40 -8
  214. package/legacy/ScatterChart/ScatterPlot.js +10 -0
  215. package/legacy/SparkLineChart/SparkLineChart.js +32 -13
  216. package/legacy/constants.js +1 -1
  217. package/legacy/context/CartesianContextProvider.js +30 -14
  218. package/legacy/context/DrawingProvider.js +8 -0
  219. package/legacy/hooks/useChartDimensions.js +2 -0
  220. package/legacy/hooks/useMounted.js +21 -0
  221. package/legacy/hooks/useReducedMotion.js +27 -0
  222. package/legacy/hooks/useTicks.js +16 -9
  223. package/legacy/index.js +1 -1
  224. package/legacy/internals/components/AxisSharedComponents.js +11 -65
  225. package/legacy/internals/components/ChartsText.js +79 -0
  226. package/legacy/internals/domUtils.js +121 -0
  227. package/legacy/internals/geometry.js +37 -0
  228. package/models/axis.d.ts +27 -9
  229. package/models/layout.d.ts +7 -6
  230. package/models/seriesType/line.d.ts +39 -1
  231. package/models/seriesType/pie.d.ts +5 -1
  232. package/modern/BarChart/BarChart.js +49 -9
  233. package/modern/BarChart/BarElement.js +7 -4
  234. package/modern/BarChart/BarPlot.js +149 -65
  235. package/modern/BarChart/formatter.js +1 -1
  236. package/modern/ChartContainer/index.js +3 -0
  237. package/modern/ChartsAxis/ChartsAxis.js +26 -0
  238. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  239. package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
  240. package/modern/ChartsLegend/ChartsLegend.js +188 -142
  241. package/modern/ChartsSurface.js +4 -12
  242. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  243. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  244. package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
  245. package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
  246. package/modern/ChartsXAxis/ChartsXAxis.js +158 -37
  247. package/modern/ChartsYAxis/ChartsYAxis.js +83 -30
  248. package/modern/LineChart/AreaElement.js +10 -0
  249. package/modern/LineChart/AreaPlot.js +25 -6
  250. package/modern/LineChart/LineChart.js +58 -10
  251. package/modern/LineChart/LineElement.js +10 -0
  252. package/modern/LineChart/LineHighlightElement.js +78 -0
  253. package/modern/LineChart/LineHighlightPlot.js +102 -0
  254. package/modern/LineChart/LinePlot.js +23 -10
  255. package/modern/LineChart/MarkElement.js +12 -5
  256. package/modern/LineChart/MarkPlot.js +60 -13
  257. package/modern/LineChart/formatter.js +4 -3
  258. package/modern/LineChart/index.js +3 -1
  259. package/modern/PieChart/PieArc.js +26 -57
  260. package/modern/PieChart/PieArcLabel.js +43 -34
  261. package/modern/PieChart/PieArcLabelPlot.js +90 -0
  262. package/modern/PieChart/PieArcPlot.js +83 -0
  263. package/modern/PieChart/PieChart.js +59 -12
  264. package/modern/PieChart/PiePlot.js +76 -55
  265. package/modern/PieChart/dataTransform/transition.js +130 -0
  266. package/modern/PieChart/dataTransform/useTransformData.js +58 -0
  267. package/modern/ResponsiveChartContainer/index.js +3 -3
  268. package/modern/ScatterChart/Scatter.js +10 -0
  269. package/modern/ScatterChart/ScatterChart.js +40 -8
  270. package/modern/ScatterChart/ScatterPlot.js +10 -0
  271. package/modern/SparkLineChart/SparkLineChart.js +32 -15
  272. package/modern/constants.js +1 -1
  273. package/modern/context/CartesianContextProvider.js +29 -13
  274. package/modern/context/DrawingProvider.js +8 -0
  275. package/modern/hooks/useChartDimensions.js +2 -0
  276. package/modern/hooks/useMounted.js +16 -0
  277. package/modern/hooks/useReducedMotion.js +27 -0
  278. package/modern/hooks/useTicks.js +15 -9
  279. package/modern/index.js +1 -1
  280. package/modern/internals/components/AxisSharedComponents.js +15 -70
  281. package/modern/internals/components/ChartsText.js +77 -0
  282. package/modern/internals/domUtils.js +113 -0
  283. package/modern/internals/geometry.js +36 -0
  284. package/package.json +9 -6
  285. package/themeAugmentation/components.d.ts +1 -0
  286. package/themeAugmentation/overrides.d.ts +2 -0
@@ -17,8 +17,19 @@ var _useScale = require("../hooks/useScale");
17
17
  var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  const _excluded = ["slots", "slotProps"];
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); }
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; }
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ /**
23
+ * Demos:
24
+ *
25
+ * - [Lines](https://mui.com/x/react-charts/lines/)
26
+ * - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
27
+ * - [Stacking](https://mui.com/x/react-charts/stacking/)
28
+ *
29
+ * API:
30
+ *
31
+ * - [AreaPlot API](https://mui.com/x/api/charts/area-plot/)
32
+ */
22
33
  function AreaPlot(props) {
23
34
  const {
24
35
  slots,
@@ -50,20 +61,28 @@ function AreaPlot(props) {
50
61
  const {
51
62
  xAxisKey = defaultXAxisId,
52
63
  yAxisKey = defaultYAxisId,
53
- stackedData
64
+ stackedData,
65
+ data,
66
+ connectNulls
54
67
  } = series[seriesId];
55
68
  const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisKey].scale);
56
69
  const yScale = yAxis[yAxisKey].scale;
57
70
  const xData = xAxis[xAxisKey].data;
58
- if (xData === undefined) {
59
- throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
71
+ if (process.env.NODE_ENV !== 'production') {
72
+ if (xData === undefined) {
73
+ throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
74
+ }
75
+ if (xData.length < stackedData.length) {
76
+ throw new Error(`MUI: data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items)`);
77
+ }
60
78
  }
61
- const areaPath = (0, _d3Shape.area)().x(d => xScale(d.x)).y0(d => yScale(d.y[0])).y1(d => yScale(d.y[1]));
79
+ const areaPath = (0, _d3Shape.area)().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y0(d => d.y && yScale(d.y[0])).y1(d => d.y && yScale(d.y[1]));
62
80
  const curve = (0, _getCurve.default)(series[seriesId].curve);
63
- const d3Data = xData?.map((x, index) => ({
81
+ const formattedData = xData?.map((x, index) => ({
64
82
  x,
65
83
  y: stackedData[index]
66
- }));
84
+ })) ?? [];
85
+ const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
67
86
  return !!series[seriesId].area && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaElement.AreaElement, {
68
87
  id: seriesId,
69
88
  d: areaPath.curve(curve)(d3Data) || undefined,
@@ -6,19 +6,27 @@ import { MarkPlotSlotComponentProps, MarkPlotSlotsComponent } from './MarkPlot';
6
6
  import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
7
7
  import { LineSeriesType } from '../models/seriesType/line';
8
8
  import { MakeOptional } from '../models/helpers';
9
- import { ChartsTooltipProps } from '../ChartsTooltip';
9
+ import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
10
10
  import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
11
11
  import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
12
12
  import { ChartsAxisSlotComponentProps, ChartsAxisSlotsComponent } from '../models/axis';
13
- export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, ChartsLegendSlotsComponent {
13
+ import { LineHighlightPlotSlotsComponent, LineHighlightPlotSlotComponentProps } from './LineHighlightPlot';
14
+ export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
14
15
  }
15
- export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, ChartsLegendSlotComponentProps {
16
+ export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
16
17
  }
17
18
  export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
18
19
  series: MakeOptional<LineSeriesType, 'type'>[];
19
20
  tooltip?: ChartsTooltipProps;
20
21
  axisHighlight?: ChartsAxisHighlightProps;
22
+ /**
23
+ * @deprecated Consider using `slotProps.legend` instead.
24
+ */
21
25
  legend?: ChartsLegendProps;
26
+ /**
27
+ * If `true`, render the line highlight item.
28
+ */
29
+ disableLineItemHighlight?: boolean;
22
30
  /**
23
31
  * Overridable component slots.
24
32
  * @default {}
@@ -30,5 +38,15 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
30
38
  */
31
39
  slotProps?: LineChartSlotComponentProps;
32
40
  }
41
+ /**
42
+ * Demos:
43
+ *
44
+ * - [Lines](https://mui.com/x/react-charts/lines/)
45
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
46
+ *
47
+ * API:
48
+ *
49
+ * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
50
+ */
33
51
  declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<unknown>>;
34
52
  export { LineChart };
@@ -19,10 +19,21 @@ var _ChartsTooltip = require("../ChartsTooltip");
19
19
  var _ChartsLegend = require("../ChartsLegend");
20
20
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
21
21
  var _ChartsClipPath = require("../ChartsClipPath");
22
+ var _LineHighlightPlot = require("./LineHighlightPlot");
22
23
  var _jsxRuntime = require("react/jsx-runtime");
23
- 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
- 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
- const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
24
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
26
+ /**
27
+ * Demos:
28
+ *
29
+ * - [Lines](https://mui.com/x/react-charts/lines/)
30
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
31
+ *
32
+ * API:
33
+ *
34
+ * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
35
+ */
36
+ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
26
37
  const {
27
38
  xAxis,
28
39
  yAxis,
@@ -37,6 +48,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
37
48
  axisHighlight = {
38
49
  x: 'line'
39
50
  },
51
+ disableLineItemHighlight,
40
52
  legend,
41
53
  topAxis,
42
54
  leftAxis,
@@ -51,6 +63,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
51
63
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveChartContainer.ResponsiveChartContainer, {
52
64
  ref: ref,
53
65
  series: series.map(s => (0, _extends2.default)({
66
+ disableHighlight: !!disableLineItemHighlight,
54
67
  type: 'line'
55
68
  }, s)),
56
69
  width: width,
@@ -84,18 +97,23 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
84
97
  bottomAxis: bottomAxis,
85
98
  slots: slots,
86
99
  slotProps: slotProps
87
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MarkPlot.MarkPlot, {
100
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MarkPlot.MarkPlot, {
101
+ slots: slots,
102
+ slotProps: slotProps
103
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LineHighlightPlot.LineHighlightPlot, {
88
104
  slots: slots,
89
105
  slotProps: slotProps
90
106
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
91
107
  slots: slots,
92
108
  slotProps: slotProps
93
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
109
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
110
+ slots: slots,
111
+ slotProps: slotProps
112
+ })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
94
113
  id: clipPathId
95
114
  }), children]
96
115
  });
97
116
  });
98
- exports.LineChart = LineChart;
99
117
  process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
100
118
  // ----------------------------- Warning --------------------------------
101
119
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -118,11 +136,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
118
136
  fill: _propTypes.default.string,
119
137
  label: _propTypes.default.string,
120
138
  labelFontSize: _propTypes.default.number,
139
+ labelStyle: _propTypes.default.object,
121
140
  position: _propTypes.default.oneOf(['bottom', 'top']),
122
141
  slotProps: _propTypes.default.object,
123
142
  slots: _propTypes.default.object,
124
143
  stroke: _propTypes.default.string,
125
144
  tickFontSize: _propTypes.default.number,
145
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
146
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
147
+ tickLabelStyle: _propTypes.default.object,
126
148
  tickMaxStep: _propTypes.default.number,
127
149
  tickMinStep: _propTypes.default.number,
128
150
  tickNumber: _propTypes.default.number,
@@ -137,6 +159,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
137
159
  dataset: _propTypes.default.arrayOf(_propTypes.default.object),
138
160
  desc: _propTypes.default.string,
139
161
  disableAxisListener: _propTypes.default.bool,
162
+ /**
163
+ * If `true`, render the line highlight item.
164
+ */
165
+ disableLineItemHighlight: _propTypes.default.bool,
140
166
  height: _propTypes.default.number,
141
167
  /**
142
168
  * Indicate which axis to display the left of the charts.
@@ -151,33 +177,33 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
151
177
  fill: _propTypes.default.string,
152
178
  label: _propTypes.default.string,
153
179
  labelFontSize: _propTypes.default.number,
180
+ labelStyle: _propTypes.default.object,
154
181
  position: _propTypes.default.oneOf(['left', 'right']),
155
182
  slotProps: _propTypes.default.object,
156
183
  slots: _propTypes.default.object,
157
184
  stroke: _propTypes.default.string,
158
185
  tickFontSize: _propTypes.default.number,
186
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
187
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
188
+ tickLabelStyle: _propTypes.default.object,
159
189
  tickMaxStep: _propTypes.default.number,
160
190
  tickMinStep: _propTypes.default.number,
161
191
  tickNumber: _propTypes.default.number,
162
192
  tickSize: _propTypes.default.number
163
193
  }), _propTypes.default.string]),
194
+ /**
195
+ * @deprecated Consider using `slotProps.legend` instead.
196
+ */
164
197
  legend: _propTypes.default.shape({
165
198
  classes: _propTypes.default.object,
166
199
  direction: _propTypes.default.oneOf(['column', 'row']),
167
200
  hidden: _propTypes.default.bool,
168
- itemWidth: _propTypes.default.number,
169
- markSize: _propTypes.default.number,
170
- offset: _propTypes.default.shape({
171
- x: _propTypes.default.number,
172
- y: _propTypes.default.number
173
- }),
174
201
  position: _propTypes.default.shape({
175
202
  horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
176
203
  vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
177
204
  }),
178
205
  slotProps: _propTypes.default.object,
179
- slots: _propTypes.default.object,
180
- spacing: _propTypes.default.number
206
+ slots: _propTypes.default.object
181
207
  }),
182
208
  margin: _propTypes.default.shape({
183
209
  bottom: _propTypes.default.number,
@@ -198,11 +224,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
198
224
  fill: _propTypes.default.string,
199
225
  label: _propTypes.default.string,
200
226
  labelFontSize: _propTypes.default.number,
227
+ labelStyle: _propTypes.default.object,
201
228
  position: _propTypes.default.oneOf(['left', 'right']),
202
229
  slotProps: _propTypes.default.object,
203
230
  slots: _propTypes.default.object,
204
231
  stroke: _propTypes.default.string,
205
232
  tickFontSize: _propTypes.default.number,
233
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
234
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
235
+ tickLabelStyle: _propTypes.default.object,
206
236
  tickMaxStep: _propTypes.default.number,
207
237
  tickMinStep: _propTypes.default.number,
208
238
  tickNumber: _propTypes.default.number,
@@ -211,15 +241,18 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
211
241
  series: _propTypes.default.arrayOf(_propTypes.default.shape({
212
242
  area: _propTypes.default.bool,
213
243
  color: _propTypes.default.string,
244
+ connectNulls: _propTypes.default.bool,
214
245
  curve: _propTypes.default.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
215
246
  data: _propTypes.default.arrayOf(_propTypes.default.number),
216
247
  dataKey: _propTypes.default.string,
248
+ disableHighlight: _propTypes.default.bool,
217
249
  highlightScope: _propTypes.default.shape({
218
250
  faded: _propTypes.default.oneOf(['global', 'none', 'series']),
219
251
  highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
220
252
  }),
221
253
  id: _propTypes.default.string,
222
254
  label: _propTypes.default.string,
255
+ showMark: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.bool]),
223
256
  stack: _propTypes.default.string,
224
257
  stackOffset: _propTypes.default.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
225
258
  stackOrder: _propTypes.default.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
@@ -244,6 +277,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
244
277
  axisContent: _propTypes.default.elementType,
245
278
  classes: _propTypes.default.object,
246
279
  itemContent: _propTypes.default.elementType,
280
+ slotProps: _propTypes.default.object,
281
+ slots: _propTypes.default.object,
247
282
  trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
248
283
  }),
249
284
  /**
@@ -259,11 +294,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
259
294
  fill: _propTypes.default.string,
260
295
  label: _propTypes.default.string,
261
296
  labelFontSize: _propTypes.default.number,
297
+ labelStyle: _propTypes.default.object,
262
298
  position: _propTypes.default.oneOf(['bottom', 'top']),
263
299
  slotProps: _propTypes.default.object,
264
300
  slots: _propTypes.default.object,
265
301
  stroke: _propTypes.default.string,
266
302
  tickFontSize: _propTypes.default.number,
303
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
304
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
305
+ tickLabelStyle: _propTypes.default.object,
267
306
  tickMaxStep: _propTypes.default.number,
268
307
  tickMinStep: _propTypes.default.number,
269
308
  tickNumber: _propTypes.default.number,
@@ -288,6 +327,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
288
327
  id: _propTypes.default.string,
289
328
  label: _propTypes.default.string,
290
329
  labelFontSize: _propTypes.default.number,
330
+ labelStyle: _propTypes.default.object,
291
331
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
292
332
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
293
333
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
@@ -296,6 +336,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
296
336
  slots: _propTypes.default.object,
297
337
  stroke: _propTypes.default.string,
298
338
  tickFontSize: _propTypes.default.number,
339
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
340
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
341
+ tickLabelStyle: _propTypes.default.object,
299
342
  tickMaxStep: _propTypes.default.number,
300
343
  tickMinStep: _propTypes.default.number,
301
344
  tickNumber: _propTypes.default.number,
@@ -314,6 +357,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
314
357
  id: _propTypes.default.string,
315
358
  label: _propTypes.default.string,
316
359
  labelFontSize: _propTypes.default.number,
360
+ labelStyle: _propTypes.default.object,
317
361
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
318
362
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
319
363
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
@@ -322,6 +366,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
322
366
  slots: _propTypes.default.object,
323
367
  stroke: _propTypes.default.string,
324
368
  tickFontSize: _propTypes.default.number,
369
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
370
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
371
+ tickLabelStyle: _propTypes.default.object,
325
372
  tickMaxStep: _propTypes.default.number,
326
373
  tickMinStep: _propTypes.default.number,
327
374
  tickNumber: _propTypes.default.number,
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { SlotComponentProps } from '@mui/base';
2
+ import { SlotComponentProps } from '@mui/base/utils';
3
3
  import { HighlightScope } from '../context/HighlightProvider';
4
4
  export interface LineElementClasses {
5
5
  /** Styles applied to the root element. */
@@ -10,7 +10,7 @@ export interface LineElementClasses {
10
10
  faded: string;
11
11
  }
12
12
  export type LineElementClassKey = keyof LineElementClasses;
13
- export interface LineElementOwnerState {
13
+ interface LineElementOwnerState {
14
14
  id: string;
15
15
  color: string;
16
16
  isFaded: boolean;
@@ -43,6 +43,16 @@ export type LineElementProps = Omit<LineElementOwnerState, 'isFaded' | 'isHighli
43
43
  line?: React.ElementType;
44
44
  };
45
45
  };
46
+ /**
47
+ * Demos:
48
+ *
49
+ * - [Lines](https://mui.com/x/react-charts/lines/)
50
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
51
+ *
52
+ * API:
53
+ *
54
+ * - [LineElement API](https://mui.com/x/api/charts/line-element/)
55
+ */
46
56
  declare function LineElement(props: LineElementProps): React.JSX.Element;
47
57
  declare namespace LineElement {
48
58
  var propTypes: any;
@@ -22,13 +22,12 @@ var _InteractionProvider = require("../context/InteractionProvider");
22
22
  var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
24
24
  const _excluded = ["id", "classes", "color", "highlightScope", "slots", "slotProps"];
25
- 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); }
26
- 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
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
26
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
27
27
  function getLineElementUtilityClass(slot) {
28
28
  return (0, _generateUtilityClass.default)('MuiLineElement', slot);
29
29
  }
30
- const lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
31
- exports.lineElementClasses = lineElementClasses;
30
+ const lineElementClasses = exports.lineElementClasses = (0, _generateUtilityClasses.default)('MuiLineElement', ['root', 'highlighted', 'faded']);
32
31
  const useUtilityClasses = ownerState => {
33
32
  const {
34
33
  classes,
@@ -41,7 +40,7 @@ const useUtilityClasses = ownerState => {
41
40
  };
42
41
  return (0, _composeClasses.default)(slots, getLineElementUtilityClass, classes);
43
42
  };
44
- const LineElementPath = (0, _styles.styled)('path', {
43
+ const LineElementPath = exports.LineElementPath = (0, _styles.styled)('path', {
45
44
  name: 'MuiLineElement',
46
45
  slot: 'Root',
47
46
  overridesResolver: (_, styles) => styles.root
@@ -55,7 +54,6 @@ const LineElementPath = (0, _styles.styled)('path', {
55
54
  transition: 'opacity 0.2s ease-in, stroke 0.2s ease-in',
56
55
  opacity: ownerState.isFaded ? 0.3 : 1
57
56
  }));
58
- exports.LineElementPath = LineElementPath;
59
57
  LineElementPath.propTypes = {
60
58
  // ----------------------------- Warning --------------------------------
61
59
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -71,6 +69,16 @@ LineElementPath.propTypes = {
71
69
  }).isRequired,
72
70
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
73
71
  };
72
+ /**
73
+ * Demos:
74
+ *
75
+ * - [Lines](https://mui.com/x/react-charts/lines/)
76
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
77
+ *
78
+ * API:
79
+ *
80
+ * - [LineElement API](https://mui.com/x/api/charts/line-element/)
81
+ */
74
82
  function LineElement(props) {
75
83
  const {
76
84
  id,
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ export interface LineHighlightElementClasses {
3
+ /** Styles applied to the root element. */
4
+ root: string;
5
+ }
6
+ export type HighlightElementClassKey = keyof LineHighlightElementClasses;
7
+ interface LineHighlightElementOwnerState {
8
+ id: string;
9
+ color: string;
10
+ x: number;
11
+ y: number;
12
+ classes?: Partial<LineHighlightElementClasses>;
13
+ }
14
+ export declare function getHighlightElementUtilityClass(slot: string): string;
15
+ export declare const lineHighlightElementClasses: LineHighlightElementClasses;
16
+ export type LineHighlightElementProps = LineHighlightElementOwnerState & React.ComponentPropsWithoutRef<'circle'> & {};
17
+ /**
18
+ * Demos:
19
+ *
20
+ * - [Lines](https://mui.com/x/react-charts/lines/)
21
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
22
+ *
23
+ * API:
24
+ *
25
+ * - [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/)
26
+ */
27
+ declare function LineHighlightElement(props: LineHighlightElementProps): React.JSX.Element;
28
+ declare namespace LineHighlightElement {
29
+ var propTypes: any;
30
+ }
31
+ export { LineHighlightElement };
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.LineHighlightElement = LineHighlightElement;
8
+ exports.getHighlightElementUtilityClass = getHighlightElementUtilityClass;
9
+ exports.lineHighlightElementClasses = void 0;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
+ var React = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
15
+ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
16
+ var _styles = require("@mui/material/styles");
17
+ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ const _excluded = ["x", "y", "id", "classes", "color"];
20
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
+ function getHighlightElementUtilityClass(slot) {
23
+ return (0, _generateUtilityClass.default)('MuiHighlightElement', slot);
24
+ }
25
+ const lineHighlightElementClasses = exports.lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
26
+ const useUtilityClasses = ownerState => {
27
+ const {
28
+ classes,
29
+ id
30
+ } = ownerState;
31
+ const slots = {
32
+ root: ['root', `series-${id}`]
33
+ };
34
+ return (0, _composeClasses.default)(slots, getHighlightElementUtilityClass, classes);
35
+ };
36
+ const HighlightElement = (0, _styles.styled)('circle', {
37
+ name: 'MuiHighlightElement',
38
+ slot: 'Root',
39
+ overridesResolver: (_, styles) => styles.root
40
+ })(({
41
+ ownerState
42
+ }) => ({
43
+ transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
44
+ transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
45
+ fill: ownerState.color
46
+ }));
47
+ /**
48
+ * Demos:
49
+ *
50
+ * - [Lines](https://mui.com/x/react-charts/lines/)
51
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
52
+ *
53
+ * API:
54
+ *
55
+ * - [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/)
56
+ */
57
+ function LineHighlightElement(props) {
58
+ const {
59
+ x,
60
+ y,
61
+ id,
62
+ classes: innerClasses,
63
+ color
64
+ } = props,
65
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
66
+ const ownerState = {
67
+ id,
68
+ classes: innerClasses,
69
+ color,
70
+ x,
71
+ y
72
+ };
73
+ const classes = useUtilityClasses(ownerState);
74
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(HighlightElement, (0, _extends2.default)({}, other, {
75
+ ownerState: ownerState,
76
+ className: classes.root,
77
+ cx: 0,
78
+ cy: 0,
79
+ r: other.r === undefined ? 5 : other.r
80
+ }));
81
+ }
82
+ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
83
+ // ----------------------------- Warning --------------------------------
84
+ // | These PropTypes are generated from the TypeScript type definitions |
85
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
86
+ // ----------------------------------------------------------------------
87
+ classes: _propTypes.default.object
88
+ } : void 0;
@@ -0,0 +1,35 @@
1
+ import * as React from 'react';
2
+ import { LineHighlightElementProps } from './LineHighlightElement';
3
+ export interface LineHighlightPlotSlotsComponent {
4
+ lineHighlight?: React.JSXElementConstructor<LineHighlightElementProps>;
5
+ }
6
+ export interface LineHighlightPlotSlotComponentProps {
7
+ lineHighlight?: Partial<LineHighlightElementProps>;
8
+ }
9
+ export interface LineHighlightPlotProps extends React.SVGAttributes<SVGSVGElement> {
10
+ /**
11
+ * Overridable component slots.
12
+ * @default {}
13
+ */
14
+ slots?: LineHighlightPlotSlotsComponent;
15
+ /**
16
+ * The props used for each component slot.
17
+ * @default {}
18
+ */
19
+ slotProps?: LineHighlightPlotSlotComponentProps;
20
+ }
21
+ /**
22
+ * Demos:
23
+ *
24
+ * - [Lines](https://mui.com/x/react-charts/lines/)
25
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
26
+ *
27
+ * API:
28
+ *
29
+ * - [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/)
30
+ */
31
+ declare function LineHighlightPlot(props: LineHighlightPlotProps): React.JSX.Element | null;
32
+ declare namespace LineHighlightPlot {
33
+ var propTypes: any;
34
+ }
35
+ export { LineHighlightPlot };