@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
@@ -10,6 +10,17 @@ import { AreaElement } from './AreaElement';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import getCurveFactory from '../internals/getCurve';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * Demos:
15
+ *
16
+ * - [Lines](https://mui.com/x/react-charts/lines/)
17
+ * - [Areas demonstration](https://mui.com/x/react-charts/areas-demo/)
18
+ * - [Stacking](https://mui.com/x/react-charts/stacking/)
19
+ *
20
+ * API:
21
+ *
22
+ * - [AreaPlot API](https://mui.com/x/api/charts/area-plot/)
23
+ */
13
24
  function AreaPlot(props) {
14
25
  const {
15
26
  slots,
@@ -41,20 +52,28 @@ function AreaPlot(props) {
41
52
  const {
42
53
  xAxisKey = defaultXAxisId,
43
54
  yAxisKey = defaultYAxisId,
44
- stackedData
55
+ stackedData,
56
+ data,
57
+ connectNulls
45
58
  } = series[seriesId];
46
59
  const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
47
60
  const yScale = yAxis[yAxisKey].scale;
48
61
  const xData = xAxis[xAxisKey].data;
49
- if (xData === undefined) {
50
- throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
62
+ if (process.env.NODE_ENV !== 'production') {
63
+ if (xData === undefined) {
64
+ throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
65
+ }
66
+ if (xData.length < stackedData.length) {
67
+ throw new Error(`MUI: data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items)`);
68
+ }
51
69
  }
52
- const areaPath = d3Area().x(d => xScale(d.x)).y0(d => yScale(d.y[0])).y1(d => yScale(d.y[1]));
70
+ const areaPath = d3Area().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]));
53
71
  const curve = getCurveFactory(series[seriesId].curve);
54
- const d3Data = xData?.map((x, index) => ({
72
+ const formattedData = xData?.map((x, index) => ({
55
73
  x,
56
74
  y: stackedData[index]
57
- }));
75
+ })) ?? [];
76
+ const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
58
77
  return !!series[seriesId].area && /*#__PURE__*/_jsx(AreaElement, {
59
78
  id: seriesId,
60
79
  d: areaPath.curve(curve)(d3Data) || undefined,
@@ -12,8 +12,19 @@ import { ChartsTooltip } from '../ChartsTooltip';
12
12
  import { ChartsLegend } from '../ChartsLegend';
13
13
  import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
14
14
  import { ChartsClipPath } from '../ChartsClipPath';
15
+ import { LineHighlightPlot } from './LineHighlightPlot';
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
+ /**
19
+ * Demos:
20
+ *
21
+ * - [Lines](https://mui.com/x/react-charts/lines/)
22
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
23
+ *
24
+ * API:
25
+ *
26
+ * - [LineChart API](https://mui.com/x/api/charts/line-chart/)
27
+ */
17
28
  const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
18
29
  const {
19
30
  xAxis,
@@ -29,6 +40,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
29
40
  axisHighlight = {
30
41
  x: 'line'
31
42
  },
43
+ disableLineItemHighlight,
32
44
  legend,
33
45
  topAxis,
34
46
  leftAxis,
@@ -43,6 +55,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
43
55
  return /*#__PURE__*/_jsxs(ResponsiveChartContainer, {
44
56
  ref: ref,
45
57
  series: series.map(s => _extends({
58
+ disableHighlight: !!disableLineItemHighlight,
46
59
  type: 'line'
47
60
  }, s)),
48
61
  width: width,
@@ -76,13 +89,19 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
76
89
  bottomAxis: bottomAxis,
77
90
  slots: slots,
78
91
  slotProps: slotProps
79
- }), /*#__PURE__*/_jsx(MarkPlot, {
92
+ }), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(MarkPlot, {
93
+ slots: slots,
94
+ slotProps: slotProps
95
+ }), /*#__PURE__*/_jsx(LineHighlightPlot, {
80
96
  slots: slots,
81
97
  slotProps: slotProps
82
98
  }), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legend, {
83
99
  slots: slots,
84
100
  slotProps: slotProps
85
- })), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlight)), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, {
101
+ })), /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltip, {
102
+ slots: slots,
103
+ slotProps: slotProps
104
+ })), /*#__PURE__*/_jsx(ChartsClipPath, {
86
105
  id: clipPathId
87
106
  }), children]
88
107
  });
@@ -109,11 +128,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
109
128
  fill: PropTypes.string,
110
129
  label: PropTypes.string,
111
130
  labelFontSize: PropTypes.number,
131
+ labelStyle: PropTypes.object,
112
132
  position: PropTypes.oneOf(['bottom', 'top']),
113
133
  slotProps: PropTypes.object,
114
134
  slots: PropTypes.object,
115
135
  stroke: PropTypes.string,
116
136
  tickFontSize: PropTypes.number,
137
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
138
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
139
+ tickLabelStyle: PropTypes.object,
117
140
  tickMaxStep: PropTypes.number,
118
141
  tickMinStep: PropTypes.number,
119
142
  tickNumber: PropTypes.number,
@@ -128,6 +151,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
128
151
  dataset: PropTypes.arrayOf(PropTypes.object),
129
152
  desc: PropTypes.string,
130
153
  disableAxisListener: PropTypes.bool,
154
+ /**
155
+ * If `true`, render the line highlight item.
156
+ */
157
+ disableLineItemHighlight: PropTypes.bool,
131
158
  height: PropTypes.number,
132
159
  /**
133
160
  * Indicate which axis to display the left of the charts.
@@ -142,33 +169,33 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
142
169
  fill: PropTypes.string,
143
170
  label: PropTypes.string,
144
171
  labelFontSize: PropTypes.number,
172
+ labelStyle: PropTypes.object,
145
173
  position: PropTypes.oneOf(['left', 'right']),
146
174
  slotProps: PropTypes.object,
147
175
  slots: PropTypes.object,
148
176
  stroke: PropTypes.string,
149
177
  tickFontSize: PropTypes.number,
178
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
179
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
180
+ tickLabelStyle: PropTypes.object,
150
181
  tickMaxStep: PropTypes.number,
151
182
  tickMinStep: PropTypes.number,
152
183
  tickNumber: PropTypes.number,
153
184
  tickSize: PropTypes.number
154
185
  }), PropTypes.string]),
186
+ /**
187
+ * @deprecated Consider using `slotProps.legend` instead.
188
+ */
155
189
  legend: PropTypes.shape({
156
190
  classes: PropTypes.object,
157
191
  direction: PropTypes.oneOf(['column', 'row']),
158
192
  hidden: PropTypes.bool,
159
- itemWidth: PropTypes.number,
160
- markSize: PropTypes.number,
161
- offset: PropTypes.shape({
162
- x: PropTypes.number,
163
- y: PropTypes.number
164
- }),
165
193
  position: PropTypes.shape({
166
194
  horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
167
195
  vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
168
196
  }),
169
197
  slotProps: PropTypes.object,
170
- slots: PropTypes.object,
171
- spacing: PropTypes.number
198
+ slots: PropTypes.object
172
199
  }),
173
200
  margin: PropTypes.shape({
174
201
  bottom: PropTypes.number,
@@ -189,11 +216,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
189
216
  fill: PropTypes.string,
190
217
  label: PropTypes.string,
191
218
  labelFontSize: PropTypes.number,
219
+ labelStyle: PropTypes.object,
192
220
  position: PropTypes.oneOf(['left', 'right']),
193
221
  slotProps: PropTypes.object,
194
222
  slots: PropTypes.object,
195
223
  stroke: PropTypes.string,
196
224
  tickFontSize: PropTypes.number,
225
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
226
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
227
+ tickLabelStyle: PropTypes.object,
197
228
  tickMaxStep: PropTypes.number,
198
229
  tickMinStep: PropTypes.number,
199
230
  tickNumber: PropTypes.number,
@@ -202,15 +233,18 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
202
233
  series: PropTypes.arrayOf(PropTypes.shape({
203
234
  area: PropTypes.bool,
204
235
  color: PropTypes.string,
236
+ connectNulls: PropTypes.bool,
205
237
  curve: PropTypes.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
206
238
  data: PropTypes.arrayOf(PropTypes.number),
207
239
  dataKey: PropTypes.string,
240
+ disableHighlight: PropTypes.bool,
208
241
  highlightScope: PropTypes.shape({
209
242
  faded: PropTypes.oneOf(['global', 'none', 'series']),
210
243
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
211
244
  }),
212
245
  id: PropTypes.string,
213
246
  label: PropTypes.string,
247
+ showMark: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]),
214
248
  stack: PropTypes.string,
215
249
  stackOffset: PropTypes.oneOf(['diverging', 'expand', 'none', 'silhouette', 'wiggle']),
216
250
  stackOrder: PropTypes.oneOf(['appearance', 'ascending', 'descending', 'insideOut', 'none', 'reverse']),
@@ -235,6 +269,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
235
269
  axisContent: PropTypes.elementType,
236
270
  classes: PropTypes.object,
237
271
  itemContent: PropTypes.elementType,
272
+ slotProps: PropTypes.object,
273
+ slots: PropTypes.object,
238
274
  trigger: PropTypes.oneOf(['axis', 'item', 'none'])
239
275
  }),
240
276
  /**
@@ -250,11 +286,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
250
286
  fill: PropTypes.string,
251
287
  label: PropTypes.string,
252
288
  labelFontSize: PropTypes.number,
289
+ labelStyle: PropTypes.object,
253
290
  position: PropTypes.oneOf(['bottom', 'top']),
254
291
  slotProps: PropTypes.object,
255
292
  slots: PropTypes.object,
256
293
  stroke: PropTypes.string,
257
294
  tickFontSize: PropTypes.number,
295
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
296
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
297
+ tickLabelStyle: PropTypes.object,
258
298
  tickMaxStep: PropTypes.number,
259
299
  tickMinStep: PropTypes.number,
260
300
  tickNumber: PropTypes.number,
@@ -279,6 +319,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
279
319
  id: PropTypes.string,
280
320
  label: PropTypes.string,
281
321
  labelFontSize: PropTypes.number,
322
+ labelStyle: PropTypes.object,
282
323
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
283
324
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
284
325
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -287,6 +328,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
287
328
  slots: PropTypes.object,
288
329
  stroke: PropTypes.string,
289
330
  tickFontSize: PropTypes.number,
331
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
332
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
333
+ tickLabelStyle: PropTypes.object,
290
334
  tickMaxStep: PropTypes.number,
291
335
  tickMinStep: PropTypes.number,
292
336
  tickNumber: PropTypes.number,
@@ -305,6 +349,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
305
349
  id: PropTypes.string,
306
350
  label: PropTypes.string,
307
351
  labelFontSize: PropTypes.number,
352
+ labelStyle: PropTypes.object,
308
353
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
309
354
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
310
355
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
@@ -313,6 +358,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
313
358
  slots: PropTypes.object,
314
359
  stroke: PropTypes.string,
315
360
  tickFontSize: PropTypes.number,
361
+ tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
362
+ tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
363
+ tickLabelStyle: PropTypes.object,
316
364
  tickMaxStep: PropTypes.number,
317
365
  tickMinStep: PropTypes.number,
318
366
  tickNumber: PropTypes.number,
@@ -57,6 +57,16 @@ LineElementPath.propTypes = {
57
57
  }).isRequired,
58
58
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
59
59
  };
60
+ /**
61
+ * Demos:
62
+ *
63
+ * - [Lines](https://mui.com/x/react-charts/lines/)
64
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
65
+ *
66
+ * API:
67
+ *
68
+ * - [LineElement API](https://mui.com/x/api/charts/line-element/)
69
+ */
60
70
  function LineElement(props) {
61
71
  const {
62
72
  id,
@@ -0,0 +1,78 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["x", "y", "id", "classes", "color"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import composeClasses from '@mui/utils/composeClasses';
7
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
8
+ import { styled } from '@mui/material/styles';
9
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ export function getHighlightElementUtilityClass(slot) {
12
+ return generateUtilityClass('MuiHighlightElement', slot);
13
+ }
14
+ export const lineHighlightElementClasses = generateUtilityClasses('MuiHighlightElement', ['root']);
15
+ const useUtilityClasses = ownerState => {
16
+ const {
17
+ classes,
18
+ id
19
+ } = ownerState;
20
+ const slots = {
21
+ root: ['root', `series-${id}`]
22
+ };
23
+ return composeClasses(slots, getHighlightElementUtilityClass, classes);
24
+ };
25
+ const HighlightElement = styled('circle', {
26
+ name: 'MuiHighlightElement',
27
+ slot: 'Root',
28
+ overridesResolver: (_, styles) => styles.root
29
+ })(({
30
+ ownerState
31
+ }) => ({
32
+ transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
33
+ transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
34
+ fill: ownerState.color
35
+ }));
36
+ /**
37
+ * Demos:
38
+ *
39
+ * - [Lines](https://mui.com/x/react-charts/lines/)
40
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
41
+ *
42
+ * API:
43
+ *
44
+ * - [LineHighlightElement API](https://mui.com/x/api/charts/line-highlight-element/)
45
+ */
46
+ function LineHighlightElement(props) {
47
+ const {
48
+ x,
49
+ y,
50
+ id,
51
+ classes: innerClasses,
52
+ color
53
+ } = props,
54
+ other = _objectWithoutPropertiesLoose(props, _excluded);
55
+ const ownerState = {
56
+ id,
57
+ classes: innerClasses,
58
+ color,
59
+ x,
60
+ y
61
+ };
62
+ const classes = useUtilityClasses(ownerState);
63
+ return /*#__PURE__*/_jsx(HighlightElement, _extends({}, other, {
64
+ ownerState: ownerState,
65
+ className: classes.root,
66
+ cx: 0,
67
+ cy: 0,
68
+ r: other.r === undefined ? 5 : other.r
69
+ }));
70
+ }
71
+ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
72
+ // ----------------------------- Warning --------------------------------
73
+ // | These PropTypes are generated from the TypeScript type definitions |
74
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
75
+ // ----------------------------------------------------------------------
76
+ classes: PropTypes.object
77
+ } : void 0;
78
+ export { LineHighlightElement };
@@ -0,0 +1,102 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["slots", "slotProps"];
4
+ import * as React from 'react';
5
+ import PropTypes from 'prop-types';
6
+ import { SeriesContext } from '../context/SeriesContextProvider';
7
+ import { CartesianContext } from '../context/CartesianContextProvider';
8
+ import { LineHighlightElement } from './LineHighlightElement';
9
+ import { getValueToPositionMapper } from '../hooks/useScale';
10
+ import { InteractionContext } from '../context/InteractionProvider';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ /**
13
+ * Demos:
14
+ *
15
+ * - [Lines](https://mui.com/x/react-charts/lines/)
16
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
17
+ *
18
+ * API:
19
+ *
20
+ * - [LineHighlightPlot API](https://mui.com/x/api/charts/line-highlight-plot/)
21
+ */
22
+ function LineHighlightPlot(props) {
23
+ const {
24
+ slots,
25
+ slotProps
26
+ } = props,
27
+ other = _objectWithoutPropertiesLoose(props, _excluded);
28
+ const seriesData = React.useContext(SeriesContext).line;
29
+ const axisData = React.useContext(CartesianContext);
30
+ const {
31
+ axis
32
+ } = React.useContext(InteractionContext);
33
+ const highlightedIndex = axis.x?.index;
34
+ if (highlightedIndex === undefined) {
35
+ return null;
36
+ }
37
+ if (seriesData === undefined) {
38
+ return null;
39
+ }
40
+ const {
41
+ series,
42
+ stackingGroups
43
+ } = seriesData;
44
+ const {
45
+ xAxis,
46
+ yAxis,
47
+ xAxisIds,
48
+ yAxisIds
49
+ } = axisData;
50
+ const defaultXAxisId = xAxisIds[0];
51
+ const defaultYAxisId = yAxisIds[0];
52
+ const Element = slots?.lineHighlight ?? LineHighlightElement;
53
+ return /*#__PURE__*/_jsx("g", _extends({}, other, {
54
+ children: stackingGroups.flatMap(({
55
+ ids: groupIds
56
+ }) => {
57
+ return groupIds.flatMap(seriesId => {
58
+ const {
59
+ xAxisKey = defaultXAxisId,
60
+ yAxisKey = defaultYAxisId,
61
+ stackedData,
62
+ data,
63
+ disableHighlight
64
+ } = series[seriesId];
65
+ if (disableHighlight || data[highlightedIndex] == null) {
66
+ return null;
67
+ }
68
+ const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
69
+ const yScale = yAxis[yAxisKey].scale;
70
+ const xData = xAxis[xAxisKey].data;
71
+ if (xData === undefined) {
72
+ throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
73
+ }
74
+ const x = xScale(xData[highlightedIndex]);
75
+ const y = yScale(stackedData[highlightedIndex][1]);
76
+ return /*#__PURE__*/_jsx(Element, _extends({
77
+ id: seriesId,
78
+ color: series[seriesId].color,
79
+ x: x,
80
+ y: y
81
+ }, slotProps?.lineHighlight), `${seriesId}`);
82
+ });
83
+ })
84
+ }));
85
+ }
86
+ process.env.NODE_ENV !== "production" ? LineHighlightPlot.propTypes = {
87
+ // ----------------------------- Warning --------------------------------
88
+ // | These PropTypes are generated from the TypeScript type definitions |
89
+ // | To update them edit the TypeScript types and run "yarn proptypes" |
90
+ // ----------------------------------------------------------------------
91
+ /**
92
+ * The props used for each component slot.
93
+ * @default {}
94
+ */
95
+ slotProps: PropTypes.object,
96
+ /**
97
+ * Overridable component slots.
98
+ * @default {}
99
+ */
100
+ slots: PropTypes.object
101
+ } : void 0;
102
+ export { LineHighlightPlot };
@@ -10,6 +10,16 @@ import { LineElement } from './LineElement';
10
10
  import { getValueToPositionMapper } from '../hooks/useScale';
11
11
  import getCurveFactory from '../internals/getCurve';
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ /**
14
+ * Demos:
15
+ *
16
+ * - [Lines](https://mui.com/x/react-charts/lines/)
17
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [LinePlot API](https://mui.com/x/api/charts/line-plot/)
22
+ */
13
23
  function LinePlot(props) {
14
24
  const {
15
25
  slots,
@@ -41,25 +51,28 @@ function LinePlot(props) {
41
51
  const {
42
52
  xAxisKey = defaultXAxisId,
43
53
  yAxisKey = defaultYAxisId,
44
- stackedData
54
+ stackedData,
55
+ data,
56
+ connectNulls
45
57
  } = series[seriesId];
46
58
  const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
47
59
  const yScale = yAxis[yAxisKey].scale;
48
60
  const xData = xAxis[xAxisKey].data;
49
- if (xData === undefined) {
50
- throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot`);
51
- }
52
- const linePath = d3Line().x(d => xScale(d.x)).y(d => yScale(d.y[1]));
53
61
  if (process.env.NODE_ENV !== 'production') {
54
- if (xData.length !== stackedData.length) {
55
- throw new Error(`MUI: data length of the x axis (${xData.length} items) does not match length of series (${stackedData.length} items)`);
62
+ if (xData === undefined) {
63
+ throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot`);
64
+ }
65
+ if (xData.length < stackedData.length) {
66
+ throw new Error(`MUI: data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items)`);
56
67
  }
57
68
  }
69
+ const linePath = d3Line().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y(d => yScale(d.y[1]));
58
70
  const curve = getCurveFactory(series[seriesId].curve);
59
- const d3Data = xData?.map((x, index) => ({
71
+ const formattedData = xData?.map((x, index) => ({
60
72
  x,
61
- y: stackedData[index] ?? [0, 0]
62
- }));
73
+ y: stackedData[index]
74
+ })) ?? [];
75
+ const d3Data = connectNulls ? formattedData.filter((_, i) => data[i] != null) : formattedData;
63
76
  return /*#__PURE__*/_jsx(LineElement, {
64
77
  id: seriesId,
65
78
  d: linePath.curve(curve)(d3Data) || undefined,
@@ -38,12 +38,9 @@ const MarkElementPath = styled('path', {
38
38
  }) => ({
39
39
  transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
40
40
  transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
41
- fill: theme.palette.background.paper,
41
+ fill: (theme.vars || theme).palette.background.paper,
42
42
  stroke: ownerState.color,
43
- strokeWidth: 2,
44
- '&.MuiMarkElement-highlighted': {
45
- fill: ownerState.color
46
- }
43
+ strokeWidth: 2
47
44
  }));
48
45
  MarkElementPath.propTypes = {
49
46
  // ----------------------------- Warning --------------------------------
@@ -62,6 +59,16 @@ MarkElementPath.propTypes = {
62
59
  }).isRequired,
63
60
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
64
61
  };
62
+ /**
63
+ * Demos:
64
+ *
65
+ * - [Lines](https://mui.com/x/react-charts/lines/)
66
+ * - [Line demonstration](https://mui.com/x/react-charts/line-demo/)
67
+ *
68
+ * API:
69
+ *
70
+ * - [MarkElement API](https://mui.com/x/api/charts/mark-element/)
71
+ */
65
72
  function MarkElement(props) {
66
73
  const {
67
74
  x,
@@ -8,6 +8,16 @@ import { CartesianContext } from '../context/CartesianContextProvider';
8
8
  import { MarkElement } from './MarkElement';
9
9
  import { getValueToPositionMapper } from '../hooks/useScale';
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
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
+ * - [MarkPlot API](https://mui.com/x/api/charts/mark-plot/)
20
+ */
11
21
  function MarkPlot(props) {
12
22
  const {
13
23
  slots,
@@ -40,8 +50,13 @@ function MarkPlot(props) {
40
50
  const {
41
51
  xAxisKey = defaultXAxisId,
42
52
  yAxisKey = defaultYAxisId,
43
- stackedData
53
+ stackedData,
54
+ data,
55
+ showMark = true
44
56
  } = series[seriesId];
57
+ if (showMark === false) {
58
+ return null;
59
+ }
45
60
  const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
46
61
  const yScale = yAxis[yAxisKey].scale;
47
62
  const xData = xAxis[xAxisKey].data;
@@ -63,25 +78,57 @@ function MarkPlot(props) {
63
78
  throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot`);
64
79
  }
65
80
  return xData?.map((x, index) => {
66
- const y = stackedData[index][1];
81
+ const value = data[index] == null ? null : stackedData[index][1];
67
82
  return {
68
83
  x: xScale(x),
69
- y: yScale(y),
84
+ y: value === null ? null : yScale(value),
85
+ position: x,
86
+ value,
70
87
  index
71
88
  };
72
- }).filter(isInRange).map(({
89
+ }).filter(({
90
+ x,
91
+ y,
92
+ index,
93
+ position,
94
+ value
95
+ }) => {
96
+ if (value === null || y === null) {
97
+ // Remove missing data point
98
+ return false;
99
+ }
100
+ if (!isInRange({
101
+ x,
102
+ y
103
+ })) {
104
+ // Remove out of range
105
+ return false;
106
+ }
107
+ if (showMark === true) {
108
+ return true;
109
+ }
110
+ return showMark({
111
+ x,
112
+ y,
113
+ index,
114
+ position,
115
+ value
116
+ });
117
+ }).map(({
73
118
  x,
74
119
  y,
75
120
  index
76
- }) => /*#__PURE__*/_jsx(Mark, _extends({
77
- id: seriesId,
78
- dataIndex: index,
79
- shape: "circle",
80
- color: series[seriesId].color,
81
- x: x,
82
- y: y,
83
- highlightScope: series[seriesId].highlightScope
84
- }, slotProps?.mark), `${seriesId}-${index}`));
121
+ }) => {
122
+ return /*#__PURE__*/_jsx(Mark, _extends({
123
+ id: seriesId,
124
+ dataIndex: index,
125
+ shape: "circle",
126
+ color: series[seriesId].color,
127
+ x: x,
128
+ y: y,
129
+ highlightScope: series[seriesId].highlightScope
130
+ }, slotProps?.mark), `${seriesId}-${index}`);
131
+ });
85
132
  });
86
133
  })
87
134
  }));