@mui/x-charts 6.0.0-alpha.9 → 6.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/BarChart/BarChart.d.ts +26 -5
  2. package/BarChart/BarChart.js +93 -17
  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 +797 -59
  10. package/ChartContainer/index.js +7 -5
  11. package/ChartsAxis/ChartsAxis.d.ts +9 -0
  12. package/ChartsAxis/ChartsAxis.js +33 -7
  13. package/ChartsAxis/axisClasses.d.ts +3 -3
  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 +45 -24
  20. package/ChartsLegend/ChartsLegend.js +193 -151
  21. package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  22. package/ChartsLegend/chartsLegendClasses.js +3 -4
  23. package/ChartsLegend/utils.d.ts +1 -6
  24. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
  25. package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
  26. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
  27. package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
  28. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
  29. package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
  30. package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
  31. package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
  32. package/ChartsReferenceLine/common.d.ts +41 -0
  33. package/ChartsReferenceLine/common.js +27 -0
  34. package/ChartsReferenceLine/index.d.ts +2 -0
  35. package/ChartsReferenceLine/index.js +27 -0
  36. package/ChartsReferenceLine/package.json +6 -0
  37. package/ChartsSurface.d.ts +12 -1
  38. package/ChartsSurface.js +9 -18
  39. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
  40. package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
  41. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
  42. package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
  43. package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
  44. package/ChartsTooltip/ChartsTooltip.js +62 -18
  45. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
  46. package/ChartsTooltip/ChartsTooltipTable.js +22 -20
  47. package/ChartsTooltip/tooltipClasses.js +1 -2
  48. package/ChartsTooltip/utils.js +2 -2
  49. package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
  50. package/ChartsXAxis/ChartsXAxis.js +170 -45
  51. package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
  52. package/ChartsYAxis/ChartsYAxis.js +95 -38
  53. package/LineChart/AreaElement.d.ts +11 -1
  54. package/LineChart/AreaElement.js +14 -6
  55. package/LineChart/AreaPlot.d.ts +11 -0
  56. package/LineChart/AreaPlot.js +27 -8
  57. package/LineChart/LineChart.d.ts +23 -3
  58. package/LineChart/LineChart.js +89 -17
  59. package/LineChart/LineElement.d.ts +11 -1
  60. package/LineChart/LineElement.js +14 -6
  61. package/LineChart/LineHighlightElement.d.ts +10 -0
  62. package/LineChart/LineHighlightElement.js +13 -4
  63. package/LineChart/LineHighlightPlot.d.ts +10 -0
  64. package/LineChart/LineHighlightPlot.js +15 -4
  65. package/LineChart/LinePlot.d.ts +10 -0
  66. package/LineChart/LinePlot.js +25 -12
  67. package/LineChart/MarkElement.d.ts +10 -0
  68. package/LineChart/MarkElement.js +14 -5
  69. package/LineChart/MarkPlot.d.ts +10 -0
  70. package/LineChart/MarkPlot.js +42 -10
  71. package/LineChart/formatter.js +5 -5
  72. package/LineChart/legend.js +1 -2
  73. package/PieChart/PieArc.d.ts +11 -13
  74. package/PieChart/PieArc.js +28 -60
  75. package/PieChart/PieArcLabel.d.ts +8 -9
  76. package/PieChart/PieArcLabel.js +46 -38
  77. package/PieChart/PieArcLabelPlot.d.ts +28 -0
  78. package/PieChart/PieArcLabelPlot.js +99 -0
  79. package/PieChart/PieArcPlot.d.ts +35 -0
  80. package/PieChart/PieArcPlot.js +92 -0
  81. package/PieChart/PieChart.d.ts +19 -5
  82. package/PieChart/PieChart.js +95 -18
  83. package/PieChart/PiePlot.d.ts +15 -9
  84. package/PieChart/PiePlot.js +77 -55
  85. package/PieChart/dataTransform/transition.d.ts +4 -0
  86. package/PieChart/dataTransform/transition.js +136 -0
  87. package/PieChart/dataTransform/useTransformData.d.ts +15 -0
  88. package/PieChart/dataTransform/useTransformData.js +67 -0
  89. package/PieChart/formatter.js +1 -2
  90. package/PieChart/legend.js +1 -2
  91. package/README.md +8 -14
  92. package/ResponsiveChartContainer/index.d.ts +13 -3
  93. package/ResponsiveChartContainer/index.js +7 -8
  94. package/ScatterChart/Scatter.d.ts +10 -0
  95. package/ScatterChart/Scatter.js +12 -2
  96. package/ScatterChart/ScatterChart.d.ts +16 -3
  97. package/ScatterChart/ScatterChart.js +77 -16
  98. package/ScatterChart/ScatterPlot.d.ts +10 -0
  99. package/ScatterChart/ScatterPlot.js +12 -2
  100. package/ScatterChart/formatter.js +1 -2
  101. package/ScatterChart/legend.js +1 -2
  102. package/SparkLineChart/SparkLineChart.d.ts +12 -3
  103. package/SparkLineChart/SparkLineChart.js +50 -7
  104. package/colorPalettes/colorPalettes.js +6 -12
  105. package/constants.js +5 -8
  106. package/context/CartesianContextProvider.d.ts +26 -1
  107. package/context/CartesianContextProvider.js +42 -16
  108. package/context/DrawingProvider.d.ts +25 -0
  109. package/context/DrawingProvider.js +18 -6
  110. package/context/HighlightProvider.d.ts +17 -0
  111. package/context/HighlightProvider.js +3 -4
  112. package/context/InteractionProvider.d.ts +6 -0
  113. package/context/InteractionProvider.js +3 -4
  114. package/context/SeriesContextProvider.d.ts +5 -0
  115. package/context/SeriesContextProvider.js +3 -4
  116. package/esm/BarChart/BarChart.js +90 -13
  117. package/esm/BarChart/BarElement.js +7 -4
  118. package/esm/BarChart/BarPlot.js +152 -67
  119. package/esm/BarChart/formatter.js +1 -1
  120. package/esm/ChartContainer/index.js +3 -0
  121. package/esm/ChartsAxis/ChartsAxis.js +32 -5
  122. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  123. package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
  124. package/esm/ChartsLegend/ChartsLegend.js +190 -144
  125. package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
  126. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  127. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
  128. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
  129. package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  130. package/esm/ChartsReferenceLine/common.js +20 -0
  131. package/esm/ChartsReferenceLine/index.js +2 -0
  132. package/esm/ChartsSurface.js +4 -12
  133. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  134. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  135. package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
  136. package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
  137. package/esm/ChartsXAxis/ChartsXAxis.js +168 -43
  138. package/esm/ChartsYAxis/ChartsYAxis.js +93 -36
  139. package/esm/LineChart/AreaElement.js +10 -0
  140. package/esm/LineChart/AreaPlot.js +26 -6
  141. package/esm/LineChart/LineChart.js +86 -13
  142. package/esm/LineChart/LineElement.js +10 -0
  143. package/esm/LineChart/LineHighlightElement.js +10 -0
  144. package/esm/LineChart/LineHighlightPlot.js +13 -2
  145. package/esm/LineChart/LinePlot.js +25 -14
  146. package/esm/LineChart/MarkElement.js +11 -1
  147. package/esm/LineChart/MarkPlot.js +40 -8
  148. package/esm/LineChart/formatter.js +7 -3
  149. package/esm/PieChart/PieArc.js +26 -58
  150. package/esm/PieChart/PieArcLabel.js +43 -34
  151. package/esm/PieChart/PieArcLabelPlot.js +92 -0
  152. package/esm/PieChart/PieArcPlot.js +84 -0
  153. package/esm/PieChart/PieChart.js +93 -16
  154. package/esm/PieChart/PiePlot.js +76 -57
  155. package/esm/PieChart/dataTransform/transition.js +130 -0
  156. package/esm/PieChart/dataTransform/useTransformData.js +59 -0
  157. package/esm/ResponsiveChartContainer/index.js +3 -3
  158. package/esm/ScatterChart/Scatter.js +10 -0
  159. package/esm/ScatterChart/ScatterChart.js +74 -12
  160. package/esm/ScatterChart/ScatterPlot.js +10 -0
  161. package/esm/SparkLineChart/SparkLineChart.js +47 -3
  162. package/esm/constants.js +1 -1
  163. package/esm/context/CartesianContextProvider.js +41 -14
  164. package/esm/context/DrawingProvider.js +14 -0
  165. package/esm/hooks/useChartDimensions.js +2 -0
  166. package/esm/hooks/useMounted.js +16 -0
  167. package/esm/hooks/useReducedMotion.js +27 -0
  168. package/esm/hooks/useTicks.js +15 -9
  169. package/esm/index.js +1 -0
  170. package/esm/internals/components/AxisSharedComponents.js +15 -70
  171. package/esm/internals/components/ChartsText.js +77 -0
  172. package/esm/internals/domUtils.js +113 -0
  173. package/esm/internals/geometry.js +36 -0
  174. package/hooks/useAxisEvents.js +2 -2
  175. package/hooks/useChartDimensions.d.ts +2 -0
  176. package/hooks/useChartDimensions.js +5 -4
  177. package/hooks/useDrawingArea.js +2 -2
  178. package/hooks/useInteractionItemProps.js +2 -2
  179. package/hooks/useMounted.d.ts +1 -0
  180. package/hooks/useMounted.js +25 -0
  181. package/hooks/useReducedMotion.d.ts +8 -0
  182. package/hooks/useReducedMotion.js +33 -0
  183. package/hooks/useScale.d.ts +2 -2
  184. package/hooks/useScale.js +2 -2
  185. package/hooks/useTicks.d.ts +19 -11
  186. package/hooks/useTicks.js +19 -14
  187. package/index.d.ts +1 -0
  188. package/index.js +12 -1
  189. package/internals/components/AxisSharedComponents.d.ts +0 -4
  190. package/internals/components/AxisSharedComponents.js +18 -78
  191. package/internals/components/ChartsText.d.ts +35 -0
  192. package/internals/components/ChartsText.js +87 -0
  193. package/internals/defaultizeColor.d.ts +7 -2
  194. package/internals/defaultizeValueFormatter.js +1 -2
  195. package/internals/domUtils.d.ts +13 -0
  196. package/internals/domUtils.js +122 -0
  197. package/internals/geometry.d.ts +9 -0
  198. package/internals/geometry.js +42 -0
  199. package/internals/isBandScale.d.ts +3 -1
  200. package/internals/stackSeries.js +2 -4
  201. package/internals/utils.d.ts +5 -0
  202. package/legacy/BarChart/BarChart.js +90 -13
  203. package/legacy/BarChart/BarElement.js +6 -3
  204. package/legacy/BarChart/BarPlot.js +151 -63
  205. package/legacy/BarChart/formatter.js +1 -1
  206. package/legacy/ChartContainer/index.js +3 -0
  207. package/legacy/ChartsAxis/ChartsAxis.js +32 -5
  208. package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
  209. package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
  210. package/legacy/ChartsLegend/ChartsLegend.js +205 -142
  211. package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
  212. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  213. package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
  214. package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
  215. package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  216. package/legacy/ChartsReferenceLine/common.js +20 -0
  217. package/legacy/ChartsReferenceLine/index.js +2 -0
  218. package/legacy/ChartsSurface.js +3 -12
  219. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
  220. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  221. package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
  222. package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
  223. package/legacy/ChartsXAxis/ChartsXAxis.js +176 -50
  224. package/legacy/ChartsYAxis/ChartsYAxis.js +97 -41
  225. package/legacy/LineChart/AreaElement.js +10 -0
  226. package/legacy/LineChart/AreaPlot.js +31 -7
  227. package/legacy/LineChart/LineChart.js +86 -13
  228. package/legacy/LineChart/LineElement.js +10 -0
  229. package/legacy/LineChart/LineHighlightElement.js +10 -0
  230. package/legacy/LineChart/LineHighlightPlot.js +13 -2
  231. package/legacy/LineChart/LinePlot.js +29 -12
  232. package/legacy/LineChart/MarkElement.js +11 -1
  233. package/legacy/LineChart/MarkPlot.js +39 -8
  234. package/legacy/LineChart/formatter.js +7 -3
  235. package/legacy/PieChart/PieArc.js +30 -62
  236. package/legacy/PieChart/PieArcLabel.js +48 -34
  237. package/legacy/PieChart/PieArcLabelPlot.js +93 -0
  238. package/legacy/PieChart/PieArcPlot.js +84 -0
  239. package/legacy/PieChart/PieChart.js +93 -16
  240. package/legacy/PieChart/PiePlot.js +76 -59
  241. package/legacy/PieChart/dataTransform/transition.js +142 -0
  242. package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
  243. package/legacy/ResponsiveChartContainer/index.js +3 -3
  244. package/legacy/ScatterChart/Scatter.js +10 -0
  245. package/legacy/ScatterChart/ScatterChart.js +74 -12
  246. package/legacy/ScatterChart/ScatterPlot.js +10 -0
  247. package/legacy/SparkLineChart/SparkLineChart.js +47 -3
  248. package/legacy/constants.js +1 -1
  249. package/legacy/context/CartesianContextProvider.js +41 -14
  250. package/legacy/context/DrawingProvider.js +14 -0
  251. package/legacy/hooks/useChartDimensions.js +2 -0
  252. package/legacy/hooks/useMounted.js +21 -0
  253. package/legacy/hooks/useReducedMotion.js +27 -0
  254. package/legacy/hooks/useTicks.js +16 -9
  255. package/legacy/index.js +2 -1
  256. package/legacy/internals/components/AxisSharedComponents.js +11 -65
  257. package/legacy/internals/components/ChartsText.js +79 -0
  258. package/legacy/internals/domUtils.js +121 -0
  259. package/legacy/internals/geometry.js +37 -0
  260. package/models/axis.d.ts +58 -20
  261. package/models/layout.d.ts +13 -6
  262. package/models/seriesType/common.d.ts +16 -0
  263. package/models/seriesType/line.d.ts +8 -3
  264. package/models/seriesType/pie.d.ts +5 -1
  265. package/modern/BarChart/BarChart.js +90 -13
  266. package/modern/BarChart/BarElement.js +7 -4
  267. package/modern/BarChart/BarPlot.js +149 -65
  268. package/modern/BarChart/formatter.js +1 -1
  269. package/modern/ChartContainer/index.js +3 -0
  270. package/modern/ChartsAxis/ChartsAxis.js +31 -5
  271. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
  272. package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
  273. package/modern/ChartsLegend/ChartsLegend.js +190 -144
  274. package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
  275. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
  276. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
  277. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
  278. package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
  279. package/modern/ChartsReferenceLine/common.js +20 -0
  280. package/modern/ChartsReferenceLine/index.js +2 -0
  281. package/modern/ChartsSurface.js +4 -12
  282. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
  283. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
  284. package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
  285. package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
  286. package/modern/ChartsXAxis/ChartsXAxis.js +167 -42
  287. package/modern/ChartsYAxis/ChartsYAxis.js +92 -35
  288. package/modern/LineChart/AreaElement.js +10 -0
  289. package/modern/LineChart/AreaPlot.js +25 -6
  290. package/modern/LineChart/LineChart.js +86 -13
  291. package/modern/LineChart/LineElement.js +10 -0
  292. package/modern/LineChart/LineHighlightElement.js +10 -0
  293. package/modern/LineChart/LineHighlightPlot.js +13 -2
  294. package/modern/LineChart/LinePlot.js +23 -10
  295. package/modern/LineChart/MarkElement.js +11 -1
  296. package/modern/LineChart/MarkPlot.js +40 -8
  297. package/modern/LineChart/formatter.js +4 -3
  298. package/modern/PieChart/PieArc.js +26 -57
  299. package/modern/PieChart/PieArcLabel.js +43 -34
  300. package/modern/PieChart/PieArcLabelPlot.js +90 -0
  301. package/modern/PieChart/PieArcPlot.js +83 -0
  302. package/modern/PieChart/PieChart.js +93 -16
  303. package/modern/PieChart/PiePlot.js +76 -55
  304. package/modern/PieChart/dataTransform/transition.js +130 -0
  305. package/modern/PieChart/dataTransform/useTransformData.js +58 -0
  306. package/modern/ResponsiveChartContainer/index.js +3 -3
  307. package/modern/ScatterChart/Scatter.js +10 -0
  308. package/modern/ScatterChart/ScatterChart.js +74 -12
  309. package/modern/ScatterChart/ScatterPlot.js +10 -0
  310. package/modern/SparkLineChart/SparkLineChart.js +47 -3
  311. package/modern/constants.js +1 -1
  312. package/modern/context/CartesianContextProvider.js +40 -13
  313. package/modern/context/DrawingProvider.js +14 -0
  314. package/modern/hooks/useChartDimensions.js +2 -0
  315. package/modern/hooks/useMounted.js +16 -0
  316. package/modern/hooks/useReducedMotion.js +27 -0
  317. package/modern/hooks/useTicks.js +15 -9
  318. package/modern/index.js +2 -1
  319. package/modern/internals/components/AxisSharedComponents.js +15 -70
  320. package/modern/internals/components/ChartsText.js +77 -0
  321. package/modern/internals/domUtils.js +113 -0
  322. package/modern/internals/geometry.js +36 -0
  323. package/package.json +9 -6
  324. package/themeAugmentation/components.d.ts +1 -0
  325. 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,29 @@ 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
13
  import { LineHighlightPlotSlotsComponent, LineHighlightPlotSlotComponentProps } from './LineHighlightPlot';
14
- export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent {
14
+ export interface LineChartSlotsComponent extends ChartsAxisSlotsComponent, AreaPlotSlotsComponent, LinePlotSlotsComponent, MarkPlotSlotsComponent, LineHighlightPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
15
15
  }
16
- export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps {
16
+ export interface LineChartSlotComponentProps extends ChartsAxisSlotComponentProps, AreaPlotSlotComponentProps, LinePlotSlotComponentProps, MarkPlotSlotComponentProps, LineHighlightPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
17
17
  }
18
18
  export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
19
19
  series: MakeOptional<LineSeriesType, 'type'>[];
20
20
  tooltip?: ChartsTooltipProps;
21
+ /**
22
+ * Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
23
+ * The two properties accept the following values:
24
+ * - 'none': display nothing.
25
+ * - 'line': display a line at the current mouse position.
26
+ * - 'band': display a band at the current mouse position. Only available with band scale.
27
+ */
21
28
  axisHighlight?: ChartsAxisHighlightProps;
29
+ /**
30
+ * @deprecated Consider using `slotProps.legend` instead.
31
+ */
22
32
  legend?: ChartsLegendProps;
23
33
  /**
24
34
  * If `true`, render the line highlight item.
@@ -35,5 +45,15 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
35
45
  */
36
46
  slotProps?: LineChartSlotComponentProps;
37
47
  }
48
+ /**
49
+ * Demos:
50
+ *
51
+ * - [Lines](https://mui.com/x/react-charts/lines/)
52
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
53
+ *
54
+ * API:
55
+ *
56
+ * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
57
+ */
38
58
  declare const LineChart: React.ForwardRefExoticComponent<LineChartProps & React.RefAttributes<unknown>>;
39
59
  export { LineChart };
@@ -21,9 +21,19 @@ var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
21
21
  var _ChartsClipPath = require("../ChartsClipPath");
22
22
  var _LineHighlightPlot = require("./LineHighlightPlot");
23
23
  var _jsxRuntime = require("react/jsx-runtime");
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); }
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; }
26
- 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) {
27
37
  const {
28
38
  xAxis,
29
39
  yAxis,
@@ -96,17 +106,26 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
96
106
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
97
107
  slots: slots,
98
108
  slotProps: slotProps
99
- })), /*#__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, {
100
113
  id: clipPathId
101
114
  }), children]
102
115
  });
103
116
  });
104
- exports.LineChart = LineChart;
105
117
  process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
106
118
  // ----------------------------- Warning --------------------------------
107
119
  // | These PropTypes are generated from the TypeScript type definitions |
108
120
  // | To update them edit the TypeScript types and run "yarn proptypes" |
109
121
  // ----------------------------------------------------------------------
122
+ /**
123
+ * Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
124
+ * The two properties accept the following values:
125
+ * - 'none': display nothing.
126
+ * - 'line': display a line at the current mouse position.
127
+ * - 'band': display a band at the current mouse position. Only available with band scale.
128
+ */
110
129
  axisHighlight: _propTypes.default.shape({
111
130
  x: _propTypes.default.oneOf(['band', 'line', 'none']),
112
131
  y: _propTypes.default.oneOf(['band', 'line', 'none'])
@@ -117,18 +136,22 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
117
136
  * @default xAxisIds[0] The id of the first provided axis
118
137
  */
119
138
  bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
120
- axisId: _propTypes.default.string.isRequired,
139
+ axisId: _propTypes.default.string,
121
140
  classes: _propTypes.default.object,
122
141
  disableLine: _propTypes.default.bool,
123
142
  disableTicks: _propTypes.default.bool,
124
143
  fill: _propTypes.default.string,
125
144
  label: _propTypes.default.string,
126
145
  labelFontSize: _propTypes.default.number,
146
+ labelStyle: _propTypes.default.object,
127
147
  position: _propTypes.default.oneOf(['bottom', 'top']),
128
148
  slotProps: _propTypes.default.object,
129
149
  slots: _propTypes.default.object,
130
150
  stroke: _propTypes.default.string,
131
151
  tickFontSize: _propTypes.default.number,
152
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
153
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
154
+ tickLabelStyle: _propTypes.default.object,
132
155
  tickMaxStep: _propTypes.default.number,
133
156
  tickMinStep: _propTypes.default.number,
134
157
  tickNumber: _propTypes.default.number,
@@ -140,13 +163,25 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
140
163
  * Color palette used to colorize multiple series.
141
164
  */
142
165
  colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
166
+ /**
167
+ * An array of objects that can be used to populate series and axes data using their `dataKey` property.
168
+ */
143
169
  dataset: _propTypes.default.arrayOf(_propTypes.default.object),
144
170
  desc: _propTypes.default.string,
171
+ /**
172
+ * If `true`, the charts will not listen to the mouse move event.
173
+ * It might break interactive features, but will improve performance.
174
+ * @default false
175
+ */
145
176
  disableAxisListener: _propTypes.default.bool,
146
177
  /**
147
178
  * If `true`, render the line highlight item.
148
179
  */
149
180
  disableLineItemHighlight: _propTypes.default.bool,
181
+ /**
182
+ * The height of the chart in px. If not defined, it takes the height of the parent element.
183
+ * @default undefined
184
+ */
150
185
  height: _propTypes.default.number,
151
186
  /**
152
187
  * Indicate which axis to display the left of the charts.
@@ -154,41 +189,47 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
154
189
  * @default yAxisIds[0] The id of the first provided axis
155
190
  */
156
191
  leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
157
- axisId: _propTypes.default.string.isRequired,
192
+ axisId: _propTypes.default.string,
158
193
  classes: _propTypes.default.object,
159
194
  disableLine: _propTypes.default.bool,
160
195
  disableTicks: _propTypes.default.bool,
161
196
  fill: _propTypes.default.string,
162
197
  label: _propTypes.default.string,
163
198
  labelFontSize: _propTypes.default.number,
199
+ labelStyle: _propTypes.default.object,
164
200
  position: _propTypes.default.oneOf(['left', 'right']),
165
201
  slotProps: _propTypes.default.object,
166
202
  slots: _propTypes.default.object,
167
203
  stroke: _propTypes.default.string,
168
204
  tickFontSize: _propTypes.default.number,
205
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
206
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
207
+ tickLabelStyle: _propTypes.default.object,
169
208
  tickMaxStep: _propTypes.default.number,
170
209
  tickMinStep: _propTypes.default.number,
171
210
  tickNumber: _propTypes.default.number,
172
211
  tickSize: _propTypes.default.number
173
212
  }), _propTypes.default.string]),
213
+ /**
214
+ * @deprecated Consider using `slotProps.legend` instead.
215
+ */
174
216
  legend: _propTypes.default.shape({
175
217
  classes: _propTypes.default.object,
176
218
  direction: _propTypes.default.oneOf(['column', 'row']),
177
219
  hidden: _propTypes.default.bool,
178
- itemWidth: _propTypes.default.number,
179
- markSize: _propTypes.default.number,
180
- offset: _propTypes.default.shape({
181
- x: _propTypes.default.number,
182
- y: _propTypes.default.number
183
- }),
184
220
  position: _propTypes.default.shape({
185
221
  horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
186
222
  vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
187
223
  }),
188
224
  slotProps: _propTypes.default.object,
189
- slots: _propTypes.default.object,
190
- spacing: _propTypes.default.number
225
+ slots: _propTypes.default.object
191
226
  }),
227
+ /**
228
+ * The margin between the SVG and the drawing area.
229
+ * It's used for leaving some space for extra information such as the x- and y-axis or legend.
230
+ * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
231
+ * @default object Depends on the charts type.
232
+ */
192
233
  margin: _propTypes.default.shape({
193
234
  bottom: _propTypes.default.number,
194
235
  left: _propTypes.default.number,
@@ -201,18 +242,22 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
201
242
  * @default null
202
243
  */
203
244
  rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
204
- axisId: _propTypes.default.string.isRequired,
245
+ axisId: _propTypes.default.string,
205
246
  classes: _propTypes.default.object,
206
247
  disableLine: _propTypes.default.bool,
207
248
  disableTicks: _propTypes.default.bool,
208
249
  fill: _propTypes.default.string,
209
250
  label: _propTypes.default.string,
210
251
  labelFontSize: _propTypes.default.number,
252
+ labelStyle: _propTypes.default.object,
211
253
  position: _propTypes.default.oneOf(['left', 'right']),
212
254
  slotProps: _propTypes.default.object,
213
255
  slots: _propTypes.default.object,
214
256
  stroke: _propTypes.default.string,
215
257
  tickFontSize: _propTypes.default.number,
258
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
259
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
260
+ tickLabelStyle: _propTypes.default.object,
216
261
  tickMaxStep: _propTypes.default.number,
217
262
  tickMinStep: _propTypes.default.number,
218
263
  tickNumber: _propTypes.default.number,
@@ -221,6 +266,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
221
266
  series: _propTypes.default.arrayOf(_propTypes.default.shape({
222
267
  area: _propTypes.default.bool,
223
268
  color: _propTypes.default.string,
269
+ connectNulls: _propTypes.default.bool,
224
270
  curve: _propTypes.default.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
225
271
  data: _propTypes.default.arrayOf(_propTypes.default.number),
226
272
  dataKey: _propTypes.default.string,
@@ -256,6 +302,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
256
302
  axisContent: _propTypes.default.elementType,
257
303
  classes: _propTypes.default.object,
258
304
  itemContent: _propTypes.default.elementType,
305
+ slotProps: _propTypes.default.object,
306
+ slots: _propTypes.default.object,
259
307
  trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
260
308
  }),
261
309
  /**
@@ -264,18 +312,22 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
264
312
  * @default null
265
313
  */
266
314
  topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
267
- axisId: _propTypes.default.string.isRequired,
315
+ axisId: _propTypes.default.string,
268
316
  classes: _propTypes.default.object,
269
317
  disableLine: _propTypes.default.bool,
270
318
  disableTicks: _propTypes.default.bool,
271
319
  fill: _propTypes.default.string,
272
320
  label: _propTypes.default.string,
273
321
  labelFontSize: _propTypes.default.number,
322
+ labelStyle: _propTypes.default.object,
274
323
  position: _propTypes.default.oneOf(['bottom', 'top']),
275
324
  slotProps: _propTypes.default.object,
276
325
  slots: _propTypes.default.object,
277
326
  stroke: _propTypes.default.string,
278
327
  tickFontSize: _propTypes.default.number,
328
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
329
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
330
+ tickLabelStyle: _propTypes.default.object,
279
331
  tickMaxStep: _propTypes.default.number,
280
332
  tickMinStep: _propTypes.default.number,
281
333
  tickNumber: _propTypes.default.number,
@@ -287,7 +339,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
287
339
  x: _propTypes.default.number,
288
340
  y: _propTypes.default.number
289
341
  }),
342
+ /**
343
+ * The width of the chart in px. If not defined, it takes the width of the parent element.
344
+ * @default undefined
345
+ */
290
346
  width: _propTypes.default.number,
347
+ /**
348
+ * The configuration of the x-axes.
349
+ * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
350
+ */
291
351
  xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
292
352
  axisId: _propTypes.default.string,
293
353
  classes: _propTypes.default.object,
@@ -300,6 +360,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
300
360
  id: _propTypes.default.string,
301
361
  label: _propTypes.default.string,
302
362
  labelFontSize: _propTypes.default.number,
363
+ labelStyle: _propTypes.default.object,
303
364
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
304
365
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
305
366
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
@@ -308,12 +369,19 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
308
369
  slots: _propTypes.default.object,
309
370
  stroke: _propTypes.default.string,
310
371
  tickFontSize: _propTypes.default.number,
372
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
373
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
374
+ tickLabelStyle: _propTypes.default.object,
311
375
  tickMaxStep: _propTypes.default.number,
312
376
  tickMinStep: _propTypes.default.number,
313
377
  tickNumber: _propTypes.default.number,
314
378
  tickSize: _propTypes.default.number,
315
379
  valueFormatter: _propTypes.default.func
316
380
  })),
381
+ /**
382
+ * The configuration of the y-axes.
383
+ * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
384
+ */
317
385
  yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
318
386
  axisId: _propTypes.default.string,
319
387
  classes: _propTypes.default.object,
@@ -326,6 +394,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
326
394
  id: _propTypes.default.string,
327
395
  label: _propTypes.default.string,
328
396
  labelFontSize: _propTypes.default.number,
397
+ labelStyle: _propTypes.default.object,
329
398
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
330
399
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
331
400
  position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
@@ -334,6 +403,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
334
403
  slots: _propTypes.default.object,
335
404
  stroke: _propTypes.default.string,
336
405
  tickFontSize: _propTypes.default.number,
406
+ tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
407
+ tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
408
+ tickLabelStyle: _propTypes.default.object,
337
409
  tickMaxStep: _propTypes.default.number,
338
410
  tickMinStep: _propTypes.default.number,
339
411
  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. */
@@ -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,
@@ -14,6 +14,16 @@ interface LineHighlightElementOwnerState {
14
14
  export declare function getHighlightElementUtilityClass(slot: string): string;
15
15
  export declare const lineHighlightElementClasses: LineHighlightElementClasses;
16
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
+ */
17
27
  declare function LineHighlightElement(props: LineHighlightElementProps): React.JSX.Element;
18
28
  declare namespace LineHighlightElement {
19
29
  var propTypes: any;
@@ -17,13 +17,12 @@ var _styles = require("@mui/material/styles");
17
17
  var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  const _excluded = ["x", "y", "id", "classes", "color"];
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
22
  function getHighlightElementUtilityClass(slot) {
23
23
  return (0, _generateUtilityClass.default)('MuiHighlightElement', slot);
24
24
  }
25
- const lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
26
- exports.lineHighlightElementClasses = lineHighlightElementClasses;
25
+ const lineHighlightElementClasses = exports.lineHighlightElementClasses = (0, _generateUtilityClasses.default)('MuiHighlightElement', ['root']);
27
26
  const useUtilityClasses = ownerState => {
28
27
  const {
29
28
  classes,
@@ -45,6 +44,16 @@ const HighlightElement = (0, _styles.styled)('circle', {
45
44
  transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
46
45
  fill: ownerState.color
47
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
+ */
48
57
  function LineHighlightElement(props) {
49
58
  const {
50
59
  x,
@@ -18,6 +18,16 @@ export interface LineHighlightPlotProps extends React.SVGAttributes<SVGSVGElemen
18
18
  */
19
19
  slotProps?: LineHighlightPlotSlotComponentProps;
20
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
+ */
21
31
  declare function LineHighlightPlot(props: LineHighlightPlotProps): React.JSX.Element | null;
22
32
  declare namespace LineHighlightPlot {
23
33
  var propTypes: any;
@@ -16,8 +16,18 @@ var _useScale = require("../hooks/useScale");
16
16
  var _InteractionProvider = require("../context/InteractionProvider");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
18
  const _excluded = ["slots", "slotProps"];
19
- 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); }
20
- 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
+ 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); }
20
+ 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; }
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
+ */
21
31
  function LineHighlightPlot(props) {
22
32
  const {
23
33
  slots,
@@ -58,9 +68,10 @@ function LineHighlightPlot(props) {
58
68
  xAxisKey = defaultXAxisId,
59
69
  yAxisKey = defaultYAxisId,
60
70
  stackedData,
71
+ data,
61
72
  disableHighlight
62
73
  } = series[seriesId];
63
- if (disableHighlight) {
74
+ if (disableHighlight || data[highlightedIndex] == null) {
64
75
  return null;
65
76
  }
66
77
  const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisKey].scale);
@@ -70,7 +81,7 @@ function LineHighlightPlot(props) {
70
81
  throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
71
82
  }
72
83
  const x = xScale(xData[highlightedIndex]);
73
- const y = yScale(stackedData[highlightedIndex][1]);
84
+ const y = yScale(stackedData[highlightedIndex][1]); // This should not be undefined since y should not be a band scale
74
85
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Element, (0, _extends2.default)({
75
86
  id: seriesId,
76
87
  color: series[seriesId].color,
@@ -8,6 +8,16 @@ export interface LinePlotSlotComponentProps {
8
8
  }
9
9
  export interface LinePlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<LineElementProps, 'slots' | 'slotProps'> {
10
10
  }
11
+ /**
12
+ * Demos:
13
+ *
14
+ * - [Lines](https://mui.com/x/react-charts/lines/)
15
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
16
+ *
17
+ * API:
18
+ *
19
+ * - [LinePlot API](https://mui.com/x/api/charts/line-plot/)
20
+ */
11
21
  declare function LinePlot(props: LinePlotProps): React.JSX.Element | null;
12
22
  declare namespace LinePlot {
13
23
  var propTypes: any;