@mui/x-charts 7.16.0 → 7.17.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 (318) hide show
  1. package/BarChart/BarChart.js +3 -0
  2. package/BarChart/BarElement.js +2 -0
  3. package/BarChart/BarLabel/BarLabel.js +2 -0
  4. package/BarChart/BarPlot.js +2 -0
  5. package/BarChart/legend.js +3 -2
  6. package/BarChart/useBarChartProps.js +2 -0
  7. package/CHANGELOG.md +87 -0
  8. package/ChartContainer/ChartContainer.js +2 -0
  9. package/ChartContainer/useChartContainerProps.js +2 -0
  10. package/ChartContainer/useDefaultizeAxis.js +2 -0
  11. package/ChartsAxis/ChartsAxis.js +2 -0
  12. package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -0
  13. package/ChartsClipPath/ChartsClipPath.js +2 -0
  14. package/ChartsGrid/ChartsGrid.js +2 -0
  15. package/ChartsLegend/ChartsLegend.js +11 -1
  16. package/ChartsLegend/ChartsLegendItem.d.ts +26 -0
  17. package/ChartsLegend/ChartsLegendItem.js +65 -0
  18. package/ChartsLegend/ContinuousColorLegend.js +2 -0
  19. package/ChartsLegend/DefaultChartsLegend.d.ts +9 -1
  20. package/ChartsLegend/DefaultChartsLegend.js +26 -4
  21. package/ChartsLegend/LegendPerItem.d.ts +1 -0
  22. package/ChartsLegend/LegendPerItem.js +19 -28
  23. package/ChartsLegend/PiecewiseColorLegend.d.ts +9 -1
  24. package/ChartsLegend/PiecewiseColorLegend.js +28 -7
  25. package/ChartsLegend/chartsLegend.types.d.ts +39 -1
  26. package/ChartsLegend/chartsLegendClasses.d.ts +2 -0
  27. package/ChartsLegend/chartsLegendClasses.js +1 -1
  28. package/ChartsLegend/useAxis.js +2 -0
  29. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  30. package/ChartsOverlay/ChartsLoadingOverlay.js +2 -0
  31. package/ChartsOverlay/ChartsNoDataOverlay.js +2 -0
  32. package/ChartsOverlay/ChartsOverlay.js +2 -0
  33. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -0
  34. package/ChartsReferenceLine/ChartsXReferenceLine.js +3 -1
  35. package/ChartsReferenceLine/ChartsYReferenceLine.js +3 -1
  36. package/ChartsSurface/ChartsSurface.js +2 -0
  37. package/ChartsText/ChartsText.js +2 -0
  38. package/ChartsTooltip/ChartsTooltip.js +2 -0
  39. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -0
  40. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -0
  41. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -0
  42. package/ChartsXAxis/ChartsXAxis.js +2 -0
  43. package/ChartsYAxis/ChartsYAxis.js +2 -0
  44. package/Gauge/Gauge.js +2 -0
  45. package/Gauge/GaugeContainer.js +2 -0
  46. package/Gauge/GaugeReferenceArc.js +2 -0
  47. package/Gauge/GaugeValueArc.js +2 -0
  48. package/Gauge/GaugeValueText.js +2 -0
  49. package/LineChart/AnimatedArea.js +2 -0
  50. package/LineChart/AnimatedLine.js +2 -0
  51. package/LineChart/AreaElement.js +2 -0
  52. package/LineChart/AreaPlot.js +2 -0
  53. package/LineChart/CircleMarkElement.d.ts +34 -0
  54. package/LineChart/CircleMarkElement.js +107 -0
  55. package/LineChart/LineChart.d.ts +4 -0
  56. package/LineChart/LineChart.js +7 -0
  57. package/LineChart/LineElement.js +2 -0
  58. package/LineChart/LineHighlightElement.js +2 -0
  59. package/LineChart/LineHighlightPlot.js +2 -0
  60. package/LineChart/LinePlot.js +2 -0
  61. package/LineChart/MarkElement.d.ts +1 -19
  62. package/LineChart/MarkElement.js +3 -19
  63. package/LineChart/MarkPlot.d.ts +6 -0
  64. package/LineChart/MarkPlot.js +13 -3
  65. package/LineChart/index.d.ts +2 -0
  66. package/LineChart/index.js +2 -1
  67. package/LineChart/legend.js +3 -2
  68. package/LineChart/markElementClasses.d.ts +20 -0
  69. package/LineChart/markElementClasses.js +19 -0
  70. package/LineChart/useLineChartProps.js +7 -3
  71. package/PieChart/PieArc.js +2 -0
  72. package/PieChart/PieArcLabel.js +2 -0
  73. package/PieChart/PieArcLabelPlot.js +2 -0
  74. package/PieChart/PieArcPlot.js +2 -0
  75. package/PieChart/PieChart.js +3 -0
  76. package/PieChart/PiePlot.js +2 -0
  77. package/PieChart/dataTransform/useTransformData.js +2 -0
  78. package/PieChart/legend.js +3 -1
  79. package/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  80. package/ResponsiveChartContainer/useChartContainerDimensions.js +3 -1
  81. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +2 -0
  82. package/ScatterChart/Scatter.js +2 -0
  83. package/ScatterChart/ScatterChart.js +3 -0
  84. package/ScatterChart/ScatterPlot.js +2 -0
  85. package/ScatterChart/legend.js +3 -2
  86. package/ScatterChart/useScatterChartProps.js +2 -0
  87. package/SparkLineChart/SparkLineChart.js +2 -0
  88. package/context/CartesianProvider/CartesianProvider.js +2 -0
  89. package/context/CartesianProvider/useCartesianContext.js +2 -0
  90. package/context/DrawingProvider.js +2 -0
  91. package/context/HighlightedProvider/HighlightedProvider.js +2 -0
  92. package/context/HighlightedProvider/useHighlighted.js +2 -0
  93. package/context/HighlightedProvider/useItemHighlighted.js +2 -0
  94. package/context/InteractionProvider.js +2 -0
  95. package/context/PluginProvider/PluginProvider.js +2 -0
  96. package/context/PluginProvider/useColorProcessor.js +2 -0
  97. package/context/PluginProvider/useSeriesFormatter.js +2 -0
  98. package/context/SeriesProvider/SeriesProvider.js +2 -0
  99. package/context/ZAxisContextProvider.js +2 -0
  100. package/hooks/useAxis.js +2 -0
  101. package/hooks/useAxisEvents.js +2 -0
  102. package/hooks/useChartDimensions.js +2 -0
  103. package/hooks/useChartId.js +2 -0
  104. package/hooks/useColorScale.js +2 -0
  105. package/hooks/useDrawingArea.js +2 -0
  106. package/hooks/useInteractionItemProps.js +2 -0
  107. package/hooks/useMounted.js +2 -0
  108. package/hooks/useReducedMotion.js +2 -0
  109. package/hooks/useScale.js +2 -0
  110. package/hooks/useSeries.js +2 -0
  111. package/hooks/useSvgRef.js +2 -0
  112. package/hooks/useTicks.js +2 -0
  113. package/index.js +1 -1
  114. package/modern/BarChart/BarChart.js +3 -0
  115. package/modern/BarChart/BarElement.js +2 -0
  116. package/modern/BarChart/BarLabel/BarLabel.js +2 -0
  117. package/modern/BarChart/BarPlot.js +2 -0
  118. package/modern/BarChart/legend.js +3 -2
  119. package/modern/BarChart/useBarChartProps.js +2 -0
  120. package/modern/ChartContainer/ChartContainer.js +2 -0
  121. package/modern/ChartContainer/useChartContainerProps.js +2 -0
  122. package/modern/ChartContainer/useDefaultizeAxis.js +2 -0
  123. package/modern/ChartsAxis/ChartsAxis.js +2 -0
  124. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -0
  125. package/modern/ChartsClipPath/ChartsClipPath.js +2 -0
  126. package/modern/ChartsGrid/ChartsGrid.js +2 -0
  127. package/modern/ChartsLegend/ChartsLegend.js +11 -1
  128. package/modern/ChartsLegend/ChartsLegendItem.js +65 -0
  129. package/modern/ChartsLegend/ContinuousColorLegend.js +2 -0
  130. package/modern/ChartsLegend/DefaultChartsLegend.js +26 -4
  131. package/modern/ChartsLegend/LegendPerItem.js +19 -28
  132. package/modern/ChartsLegend/PiecewiseColorLegend.js +28 -7
  133. package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
  134. package/modern/ChartsLegend/useAxis.js +2 -0
  135. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  136. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +2 -0
  137. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +2 -0
  138. package/modern/ChartsOverlay/ChartsOverlay.js +2 -0
  139. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -0
  140. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +3 -1
  141. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +3 -1
  142. package/modern/ChartsSurface/ChartsSurface.js +2 -0
  143. package/modern/ChartsText/ChartsText.js +2 -0
  144. package/modern/ChartsTooltip/ChartsTooltip.js +2 -0
  145. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -0
  146. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +2 -0
  147. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +2 -0
  148. package/modern/ChartsXAxis/ChartsXAxis.js +2 -0
  149. package/modern/ChartsYAxis/ChartsYAxis.js +2 -0
  150. package/modern/Gauge/Gauge.js +2 -0
  151. package/modern/Gauge/GaugeContainer.js +2 -0
  152. package/modern/Gauge/GaugeReferenceArc.js +2 -0
  153. package/modern/Gauge/GaugeValueArc.js +2 -0
  154. package/modern/Gauge/GaugeValueText.js +2 -0
  155. package/modern/LineChart/AnimatedArea.js +2 -0
  156. package/modern/LineChart/AnimatedLine.js +2 -0
  157. package/modern/LineChart/AreaElement.js +2 -0
  158. package/modern/LineChart/AreaPlot.js +2 -0
  159. package/modern/LineChart/CircleMarkElement.js +107 -0
  160. package/modern/LineChart/LineChart.js +7 -0
  161. package/modern/LineChart/LineElement.js +2 -0
  162. package/modern/LineChart/LineHighlightElement.js +2 -0
  163. package/modern/LineChart/LineHighlightPlot.js +2 -0
  164. package/modern/LineChart/LinePlot.js +2 -0
  165. package/modern/LineChart/MarkElement.js +3 -19
  166. package/modern/LineChart/MarkPlot.js +13 -3
  167. package/modern/LineChart/index.js +2 -1
  168. package/modern/LineChart/legend.js +3 -2
  169. package/modern/LineChart/markElementClasses.js +19 -0
  170. package/modern/LineChart/useLineChartProps.js +7 -3
  171. package/modern/PieChart/PieArc.js +2 -0
  172. package/modern/PieChart/PieArcLabel.js +2 -0
  173. package/modern/PieChart/PieArcLabelPlot.js +2 -0
  174. package/modern/PieChart/PieArcPlot.js +2 -0
  175. package/modern/PieChart/PieChart.js +3 -0
  176. package/modern/PieChart/PiePlot.js +2 -0
  177. package/modern/PieChart/dataTransform/useTransformData.js +2 -0
  178. package/modern/PieChart/legend.js +3 -1
  179. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  180. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +3 -1
  181. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +2 -0
  182. package/modern/ScatterChart/Scatter.js +2 -0
  183. package/modern/ScatterChart/ScatterChart.js +3 -0
  184. package/modern/ScatterChart/ScatterPlot.js +2 -0
  185. package/modern/ScatterChart/legend.js +3 -2
  186. package/modern/ScatterChart/useScatterChartProps.js +2 -0
  187. package/modern/SparkLineChart/SparkLineChart.js +2 -0
  188. package/modern/context/CartesianProvider/CartesianProvider.js +2 -0
  189. package/modern/context/CartesianProvider/useCartesianContext.js +2 -0
  190. package/modern/context/DrawingProvider.js +2 -0
  191. package/modern/context/HighlightedProvider/HighlightedProvider.js +2 -0
  192. package/modern/context/HighlightedProvider/useHighlighted.js +2 -0
  193. package/modern/context/HighlightedProvider/useItemHighlighted.js +2 -0
  194. package/modern/context/InteractionProvider.js +2 -0
  195. package/modern/context/PluginProvider/PluginProvider.js +2 -0
  196. package/modern/context/PluginProvider/useColorProcessor.js +2 -0
  197. package/modern/context/PluginProvider/useSeriesFormatter.js +2 -0
  198. package/modern/context/SeriesProvider/SeriesProvider.js +2 -0
  199. package/modern/context/ZAxisContextProvider.js +2 -0
  200. package/modern/hooks/useAxis.js +2 -0
  201. package/modern/hooks/useAxisEvents.js +2 -0
  202. package/modern/hooks/useChartDimensions.js +2 -0
  203. package/modern/hooks/useChartId.js +2 -0
  204. package/modern/hooks/useColorScale.js +2 -0
  205. package/modern/hooks/useDrawingArea.js +2 -0
  206. package/modern/hooks/useInteractionItemProps.js +2 -0
  207. package/modern/hooks/useMounted.js +2 -0
  208. package/modern/hooks/useReducedMotion.js +2 -0
  209. package/modern/hooks/useScale.js +2 -0
  210. package/modern/hooks/useSeries.js +2 -0
  211. package/modern/hooks/useSvgRef.js +2 -0
  212. package/modern/hooks/useTicks.js +2 -0
  213. package/modern/index.js +1 -1
  214. package/node/BarChart/BarChart.js +2 -0
  215. package/node/BarChart/BarElement.js +1 -0
  216. package/node/BarChart/BarLabel/BarLabel.js +1 -0
  217. package/node/BarChart/BarPlot.js +1 -0
  218. package/node/BarChart/legend.js +3 -2
  219. package/node/BarChart/useBarChartProps.js +1 -0
  220. package/node/ChartContainer/ChartContainer.js +1 -0
  221. package/node/ChartContainer/useChartContainerProps.js +1 -0
  222. package/node/ChartContainer/useDefaultizeAxis.js +1 -0
  223. package/node/ChartsAxis/ChartsAxis.js +1 -0
  224. package/node/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -0
  225. package/node/ChartsClipPath/ChartsClipPath.js +1 -0
  226. package/node/ChartsGrid/ChartsGrid.js +1 -0
  227. package/node/ChartsLegend/ChartsLegend.js +10 -1
  228. package/node/ChartsLegend/ChartsLegendItem.js +72 -0
  229. package/node/ChartsLegend/ContinuousColorLegend.js +1 -0
  230. package/node/ChartsLegend/DefaultChartsLegend.js +25 -4
  231. package/node/ChartsLegend/LegendPerItem.js +18 -28
  232. package/node/ChartsLegend/PiecewiseColorLegend.js +27 -7
  233. package/node/ChartsLegend/chartsLegendClasses.js +1 -1
  234. package/node/ChartsLegend/useAxis.js +1 -0
  235. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -1
  236. package/node/ChartsOverlay/ChartsLoadingOverlay.js +1 -0
  237. package/node/ChartsOverlay/ChartsNoDataOverlay.js +1 -0
  238. package/node/ChartsOverlay/ChartsOverlay.js +1 -0
  239. package/node/ChartsReferenceLine/ChartsReferenceLine.js +1 -0
  240. package/node/ChartsReferenceLine/ChartsXReferenceLine.js +2 -1
  241. package/node/ChartsReferenceLine/ChartsYReferenceLine.js +2 -1
  242. package/node/ChartsSurface/ChartsSurface.js +1 -0
  243. package/node/ChartsText/ChartsText.js +1 -0
  244. package/node/ChartsTooltip/ChartsTooltip.js +1 -0
  245. package/node/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -0
  246. package/node/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -0
  247. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +1 -0
  248. package/node/ChartsXAxis/ChartsXAxis.js +1 -0
  249. package/node/ChartsYAxis/ChartsYAxis.js +1 -0
  250. package/node/Gauge/Gauge.js +1 -0
  251. package/node/Gauge/GaugeContainer.js +1 -0
  252. package/node/Gauge/GaugeReferenceArc.js +1 -0
  253. package/node/Gauge/GaugeValueArc.js +1 -0
  254. package/node/Gauge/GaugeValueText.js +1 -0
  255. package/node/LineChart/AnimatedArea.js +1 -0
  256. package/node/LineChart/AnimatedLine.js +1 -0
  257. package/node/LineChart/AreaElement.js +1 -0
  258. package/node/LineChart/AreaPlot.js +1 -0
  259. package/node/LineChart/CircleMarkElement.js +113 -0
  260. package/node/LineChart/LineChart.js +6 -0
  261. package/node/LineChart/LineElement.js +1 -0
  262. package/node/LineChart/LineHighlightElement.js +1 -0
  263. package/node/LineChart/LineHighlightPlot.js +1 -0
  264. package/node/LineChart/LinePlot.js +1 -0
  265. package/node/LineChart/MarkElement.js +3 -22
  266. package/node/LineChart/MarkPlot.js +12 -3
  267. package/node/LineChart/index.js +29 -1
  268. package/node/LineChart/legend.js +3 -2
  269. package/node/LineChart/markElementClasses.js +28 -0
  270. package/node/LineChart/useLineChartProps.js +6 -3
  271. package/node/PieChart/PieArc.js +1 -0
  272. package/node/PieChart/PieArcLabel.js +1 -0
  273. package/node/PieChart/PieArcLabelPlot.js +1 -0
  274. package/node/PieChart/PieArcPlot.js +1 -0
  275. package/node/PieChart/PieChart.js +2 -0
  276. package/node/PieChart/PiePlot.js +1 -0
  277. package/node/PieChart/dataTransform/useTransformData.js +1 -0
  278. package/node/PieChart/legend.js +3 -1
  279. package/node/ResponsiveChartContainer/ResponsiveChartContainer.js +1 -0
  280. package/node/ResponsiveChartContainer/useChartContainerDimensions.js +2 -1
  281. package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +1 -0
  282. package/node/ScatterChart/Scatter.js +1 -0
  283. package/node/ScatterChart/ScatterChart.js +2 -0
  284. package/node/ScatterChart/ScatterPlot.js +1 -0
  285. package/node/ScatterChart/legend.js +3 -2
  286. package/node/ScatterChart/useScatterChartProps.js +1 -0
  287. package/node/SparkLineChart/SparkLineChart.js +1 -0
  288. package/node/context/CartesianProvider/CartesianProvider.js +1 -0
  289. package/node/context/CartesianProvider/useCartesianContext.js +1 -0
  290. package/node/context/DrawingProvider.js +1 -0
  291. package/node/context/HighlightedProvider/HighlightedProvider.js +1 -0
  292. package/node/context/HighlightedProvider/useHighlighted.js +1 -0
  293. package/node/context/HighlightedProvider/useItemHighlighted.js +1 -0
  294. package/node/context/InteractionProvider.js +1 -0
  295. package/node/context/PluginProvider/PluginProvider.js +1 -0
  296. package/node/context/PluginProvider/useColorProcessor.js +1 -0
  297. package/node/context/PluginProvider/useSeriesFormatter.js +1 -0
  298. package/node/context/SeriesProvider/SeriesProvider.js +1 -0
  299. package/node/context/ZAxisContextProvider.js +1 -0
  300. package/node/hooks/useAxis.js +1 -0
  301. package/node/hooks/useAxisEvents.js +1 -0
  302. package/node/hooks/useChartDimensions.js +1 -0
  303. package/node/hooks/useChartId.js +1 -0
  304. package/node/hooks/useColorScale.js +1 -0
  305. package/node/hooks/useDrawingArea.js +1 -0
  306. package/node/hooks/useInteractionItemProps.js +1 -0
  307. package/node/hooks/useMounted.js +1 -0
  308. package/node/hooks/useReducedMotion.js +1 -0
  309. package/node/hooks/useScale.js +1 -0
  310. package/node/hooks/useSeries.js +1 -0
  311. package/node/hooks/useSvgRef.js +1 -0
  312. package/node/hooks/useTicks.js +1 -0
  313. package/node/index.js +1 -1
  314. package/package.json +3 -3
  315. package/internals/warning.d.ts +0 -2
  316. package/internals/warning.js +0 -21
  317. package/modern/internals/warning.js +0 -21
  318. package/node/internals/warning.js +0 -28
@@ -10,9 +10,10 @@ const legendGetter = params => {
10
10
  return acc;
11
11
  }
12
12
  acc.push({
13
+ id: seriesId,
14
+ seriesId,
13
15
  color: series[seriesId].color,
14
- label: formattedLabel,
15
- id: seriesId
16
+ label: formattedLabel
16
17
  });
17
18
  return acc;
18
19
  }, []);
@@ -0,0 +1,20 @@
1
+ import { SeriesId } from '../models/seriesType/common';
2
+ export interface MarkElementClasses {
3
+ /** Styles applied to the root element. */
4
+ root: string;
5
+ /** Styles applied to the root element when highlighted. */
6
+ highlighted: string;
7
+ /** Styles applied to the root element when faded. */
8
+ faded: string;
9
+ }
10
+ export type MarkElementClassKey = keyof MarkElementClasses;
11
+ export interface MarkElementOwnerState {
12
+ id: SeriesId;
13
+ color: string;
14
+ isFaded: boolean;
15
+ isHighlighted: boolean;
16
+ classes?: Partial<MarkElementClasses>;
17
+ }
18
+ export declare function getMarkElementUtilityClass(slot: string): string;
19
+ export declare const markElementClasses: MarkElementClasses;
20
+ export declare const useUtilityClasses: (ownerState: MarkElementOwnerState) => Record<"root", string>;
@@ -0,0 +1,19 @@
1
+ import composeClasses from '@mui/utils/composeClasses';
2
+ import generateUtilityClass from '@mui/utils/generateUtilityClass';
3
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
4
+ export function getMarkElementUtilityClass(slot) {
5
+ return generateUtilityClass('MuiMarkElement', slot);
6
+ }
7
+ export const markElementClasses = generateUtilityClasses('MuiMarkElement', ['root', 'highlighted', 'faded']);
8
+ export const useUtilityClasses = ownerState => {
9
+ const {
10
+ classes,
11
+ id,
12
+ isFaded,
13
+ isHighlighted
14
+ } = ownerState;
15
+ const slots = {
16
+ root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
17
+ };
18
+ return composeClasses(slots, getMarkElementUtilityClass, classes);
19
+ };
@@ -1,6 +1,8 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className", "experimentalMarkRendering"];
4
6
  import useId from '@mui/utils/useId';
5
7
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
6
8
  /**
@@ -41,7 +43,8 @@ export const useLineChartProps = props => {
41
43
  loading,
42
44
  highlightedItem,
43
45
  onHighlightChange,
44
- className
46
+ className,
47
+ experimentalMarkRendering
45
48
  } = props,
46
49
  other = _objectWithoutPropertiesLoose(props, _excluded);
47
50
  const id = useId();
@@ -99,7 +102,8 @@ export const useLineChartProps = props => {
99
102
  slots,
100
103
  slotProps,
101
104
  onItemClick: onMarkClick,
102
- skipAnimation
105
+ skipAnimation,
106
+ experimentalRendering: experimentalMarkRendering
103
107
  };
104
108
  const overlayProps = {
105
109
  slots,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle", "highlightScope"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["arcLabel", "arcLabelMinAngle", "arcLabelRadius", "cornerRadius", "data", "faded", "highlighted", "id", "innerRadius", "outerRadius", "paddingAngle", "skipAnimation", "slotProps", "slots"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"],
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "tooltip", "axisHighlight", "skipAnimation", "legend", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
@@ -197,6 +199,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
197
199
  itemMarkWidth: PropTypes.number,
198
200
  labelStyle: PropTypes.object,
199
201
  markGap: PropTypes.number,
202
+ onItemClick: PropTypes.func,
200
203
  padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
201
204
  bottom: PropTypes.number,
202
205
  left: PropTypes.number,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import PropTypes from 'prop-types';
3
5
  import { DrawingContext } from "../context/DrawingProvider.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { useHighlighted } from "../../context/index.js";
@@ -11,9 +11,11 @@ const legendGetter = params => {
11
11
  return;
12
12
  }
13
13
  acc.push({
14
+ id: item.id,
15
+ seriesId,
14
16
  color: item.color,
15
17
  label: formattedLabel,
16
- id: item.id
18
+ itemId: item.id
17
19
  });
18
20
  });
19
21
  return acc;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
3
5
  import ownerWindow from '@mui/utils/ownerWindow';
@@ -45,7 +47,7 @@ export const useChartContainerDimensions = (inWidth, inHeight) => {
45
47
  }
46
48
  return () => {
47
49
  if (animationFrame) {
48
- window.cancelAnimationFrame(animationFrame);
50
+ cancelAnimationFrame(animationFrame);
49
51
  }
50
52
  if (elementToObserve) {
51
53
  observer.unobserve(elementToObserve);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "sx", "title", "viewBox", "xAxis", "yAxis", "zAxis"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -132,6 +134,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
132
134
  itemMarkWidth: PropTypes.number,
133
135
  labelStyle: PropTypes.object,
134
136
  markGap: PropTypes.number,
137
+ onItemClick: PropTypes.func,
135
138
  padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
136
139
  bottom: PropTypes.number,
137
140
  left: PropTypes.number,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -10,9 +10,10 @@ const legendGetter = params => {
10
10
  return acc;
11
11
  }
12
12
  acc.push({
13
+ id: seriesId,
14
+ seriesId,
13
15
  color: series[seriesId].color,
14
- label: formattedLabel,
15
- id: seriesId
16
+ label: formattedLabel
16
17
  });
17
18
  return acc;
18
19
  }, []);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["xAxis", "yAxis", "zAxis", "series", "tooltip", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "legend", "width", "height", "margin", "colors", "sx", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "colors", "sx", "showTooltip", "tooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useDrawingArea } from "../../hooks/useDrawingArea.js";
3
5
  import { useSeries } from "../../hooks/useSeries.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { CartesianContext } from "./CartesianContext.js";
3
5
  export const useCartesianContext = () => {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import useId from '@mui/utils/useId';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["highlighted", "faded"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { HighlightedContext } from "./HighlightedContext.js";
3
5
 
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { useHighlighted } from "./useHighlighted.js";
2
4
  /**
3
5
  * A hook to check the highlighted state of the item.
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { PluginContext } from "./PluginContext.js";
3
5
  import { mergePlugins } from "./mergePlugins.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { PluginContext } from "./PluginContext.js";
3
5
  export function useColorProcessor(seriesType) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { PluginContext } from "./PluginContext.js";
3
5
  export function useSeriesFormatter(seriesType) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useTheme } from '@mui/material/styles';
3
5
  import { blueberryTwilightPalette } from "../../colorPalettes/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
package/hooks/useAxis.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
2
4
  export function useXAxis(identifier) {
3
5
  const {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { InteractionContext } from "../context/InteractionProvider.js";
3
5
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { DEFAULT_MARGINS } from "../constants/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { DrawingContext } from "../context/DrawingProvider.js";
3
5
  export function useChartId() {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { useCartesianContext } from "../context/CartesianProvider/index.js";
3
5
  import { ZAxisContext } from "../context/ZAxisContextProvider.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { DrawingContext } from "../context/DrawingProvider.js";
3
5
  export function useDrawingArea() {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { InteractionContext } from "../context/InteractionProvider.js";
3
5
  import { useHighlighted } from "../context/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
3
5
  export function useMounted(defer = false) {
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { useIsomorphicLayoutEffect, Globals } from '@react-spring/web';
2
4
  const handleMediaChange = e => {
3
5
  Globals.assign({
package/hooks/useScale.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { isBandScale } from "../internals/isBandScale.js";
2
4
  import { useXAxis, useYAxis } from "./useAxis.js";
3
5
 
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { SeriesContext } from "../context/SeriesProvider/index.js";
3
5
 
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { SvgContext } from "../context/DrawingProvider.js";
3
5
  export function useSvgRef() {
package/hooks/useTicks.js CHANGED
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import * as React from 'react';
2
4
  import { isBandScale } from "../internals/isBandScale.js";
3
5
  import { isInfinity } from "../internals/isInfinity.js";
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.16.0
2
+ * @mui/x-charts v7.17.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -144,6 +146,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
144
146
  itemMarkWidth: PropTypes.number,
145
147
  labelStyle: PropTypes.object,
146
148
  markGap: PropTypes.number,
149
+ onItemClick: PropTypes.func,
147
150
  padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
148
151
  bottom: PropTypes.number,
149
152
  left: PropTypes.number,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["skipAnimation", "onItemClick", "borderRadius", "barLabel"];
@@ -10,9 +10,10 @@ const legendGetter = params => {
10
10
  return acc;
11
11
  }
12
12
  acc.push({
13
+ id: seriesId,
14
+ seriesId,
13
15
  color: series[seriesId].color,
14
- label: formattedLabel,
15
- id: seriesId
16
+ label: formattedLabel
16
17
  });
17
18
  return acc;
18
19
  }, []);
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "tooltip", "onAxisClick", "axisHighlight", "legend", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["width", "height", "series", "margin", "xAxis", "yAxis", "zAxis", "colors", "dataset", "sx", "title", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "children"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import * as React from 'react';
3
5
  import PropTypes from 'prop-types';
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _extends from "@babel/runtime/helpers/esm/extends";
2
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
5
  const _excluded = ["vertical", "horizontal"];
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
5
  const _excluded = ["slots", "slotProps"];
@@ -21,7 +23,8 @@ const useUtilityClasses = ownerState => {
21
23
  root: ['root', direction],
22
24
  mark: ['mark'],
23
25
  label: ['label'],
24
- series: ['series']
26
+ series: ['series'],
27
+ itemBackground: ['itemBackground']
25
28
  };
26
29
  return composeClasses(slots, getLegendUtilityClass, classes);
27
30
  };
@@ -108,6 +111,13 @@ process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
108
111
  * @default 5
109
112
  */
110
113
  markGap: PropTypes.number,
114
+ /**
115
+ * Callback fired when a legend item is clicked.
116
+ * @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
117
+ * @param {SeriesLegendItemContext} legendItem The legend item data.
118
+ * @param {number} index The index of the clicked legend item.
119
+ */
120
+ onItemClick: PropTypes.func,
111
121
  /**
112
122
  * Legend padding (in px).
113
123
  * Can either be a single number, or an object with top, left, bottom, right properties.