@mui/x-charts 9.3.0 → 9.5.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 (264) hide show
  1. package/BarChart/BarElement.d.mts +3 -2
  2. package/BarChart/BarElement.d.ts +3 -2
  3. package/BarChart/BarLabel/BarLabelItem.d.mts +3 -2
  4. package/BarChart/BarLabel/BarLabelItem.d.ts +3 -2
  5. package/BarChart/seriesConfig/bar/extremums.js +7 -2
  6. package/BarChart/seriesConfig/bar/extremums.mjs +7 -2
  7. package/CHANGELOG.md +296 -0
  8. package/ChartsContainer/ChartsContainer.js +21 -0
  9. package/ChartsContainer/ChartsContainer.mjs +21 -0
  10. package/ChartsLabel/ChartsLabelMark.js +1 -21
  11. package/ChartsLabel/ChartsLabelMark.mjs +0 -20
  12. package/ChartsLegend/chartsLegend.types.d.mts +3 -2
  13. package/ChartsLegend/chartsLegend.types.d.ts +3 -2
  14. package/ChartsLegend/piecewiseColorLegendClasses.js +8 -2
  15. package/ChartsLegend/piecewiseColorLegendClasses.mjs +8 -2
  16. package/ChartsOverlay/ChartsOverlay.d.mts +5 -4
  17. package/ChartsOverlay/ChartsOverlay.d.ts +5 -4
  18. package/ChartsRadialAxisHighlight/index.d.mts +6 -1
  19. package/ChartsRadialAxisHighlight/index.d.ts +6 -1
  20. package/ChartsRadialAxisHighlight/index.js +9 -2
  21. package/ChartsRadialAxisHighlight/index.mjs +8 -1
  22. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
  23. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
  24. package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +1 -1
  25. package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +1 -1
  26. package/ChartsRadialDataProvider/index.d.mts +5 -0
  27. package/ChartsRadialDataProvider/index.d.ts +5 -0
  28. package/ChartsRadialDataProvider/index.js +12 -1
  29. package/ChartsRadialDataProvider/index.mjs +7 -0
  30. package/ChartsRadialGrid/index.d.mts +6 -1
  31. package/ChartsRadialGrid/index.d.ts +6 -1
  32. package/ChartsRadialGrid/index.js +8 -2
  33. package/ChartsRadialGrid/index.mjs +8 -1
  34. package/ChartsRadiusAxis/index.d.mts +6 -1
  35. package/ChartsRadiusAxis/index.d.ts +6 -1
  36. package/ChartsRadiusAxis/index.js +10 -2
  37. package/ChartsRadiusAxis/index.mjs +7 -1
  38. package/ChartsReferenceLine/ChartsXReferenceLine.js +6 -1
  39. package/ChartsReferenceLine/ChartsXReferenceLine.mjs +6 -1
  40. package/ChartsReferenceLine/ChartsYReferenceLine.js +5 -0
  41. package/ChartsReferenceLine/ChartsYReferenceLine.mjs +5 -0
  42. package/ChartsRotationAxis/index.d.mts +6 -1
  43. package/ChartsRotationAxis/index.d.ts +6 -1
  44. package/ChartsRotationAxis/index.js +10 -2
  45. package/ChartsRotationAxis/index.mjs +7 -1
  46. package/ChartsTooltip/ChartTooltip.types.d.mts +3 -2
  47. package/ChartsTooltip/ChartTooltip.types.d.ts +3 -2
  48. package/ChartsTooltip/ChartsTooltipContainer.js +11 -4
  49. package/ChartsTooltip/ChartsTooltipContainer.mjs +11 -4
  50. package/ChartsTooltip/useAxesTooltip.js +2 -2
  51. package/ChartsTooltip/useAxesTooltip.mjs +2 -2
  52. package/ChartsTooltip/useItemTooltip.js +2 -2
  53. package/ChartsTooltip/useItemTooltip.mjs +2 -2
  54. package/ChartsXAxis/useAxisTicksProps.d.mts +84 -3
  55. package/ChartsXAxis/useAxisTicksProps.d.ts +84 -3
  56. package/ChartsYAxis/useAxisTicksProps.d.mts +84 -3
  57. package/ChartsYAxis/useAxisTicksProps.d.ts +84 -3
  58. package/LineChart/AreaElement.d.mts +3 -2
  59. package/LineChart/AreaElement.d.ts +3 -2
  60. package/LineChart/AreaElement.js +1 -1
  61. package/LineChart/AreaElement.mjs +1 -1
  62. package/LineChart/CircleMarkElement.js +1 -1
  63. package/LineChart/CircleMarkElement.mjs +1 -1
  64. package/LineChart/LineElement.d.mts +3 -2
  65. package/LineChart/LineElement.d.ts +3 -2
  66. package/LineChart/LineElement.js +1 -1
  67. package/LineChart/LineElement.mjs +1 -1
  68. package/LineChart/LineHighlightPlot.d.mts +3 -2
  69. package/LineChart/LineHighlightPlot.d.ts +3 -2
  70. package/LineChart/LineHighlightPlot.js +65 -45
  71. package/LineChart/LineHighlightPlot.mjs +65 -45
  72. package/LineChart/MarkElement.js +1 -1
  73. package/LineChart/MarkElement.mjs +1 -1
  74. package/LineChart/MarkPlot.d.mts +3 -2
  75. package/LineChart/MarkPlot.d.ts +3 -2
  76. package/LineChart/seriesConfig/curveEvaluation.js +28 -14
  77. package/LineChart/seriesConfig/curveEvaluation.mjs +27 -14
  78. package/LineChart/seriesConfig/extremums.js +5 -1
  79. package/LineChart/seriesConfig/extremums.mjs +5 -1
  80. package/LineChart/useMarkPlotData.js +3 -1
  81. package/LineChart/useMarkPlotData.mjs +3 -1
  82. package/PieChart/PieArcLabelPlot.d.mts +3 -2
  83. package/PieChart/PieArcLabelPlot.d.ts +3 -2
  84. package/PieChart/PieArcPlot.d.mts +3 -2
  85. package/PieChart/PieArcPlot.d.ts +3 -2
  86. package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +2 -2
  87. package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
  88. package/ScatterChart/BatchScatter.d.mts +2 -8
  89. package/ScatterChart/BatchScatter.d.ts +2 -8
  90. package/ScatterChart/BatchScatter.js +17 -12
  91. package/ScatterChart/BatchScatter.mjs +17 -12
  92. package/ScatterChart/FocusedScatterMark.js +2 -2
  93. package/ScatterChart/FocusedScatterMark.mjs +2 -2
  94. package/ScatterChart/HighlightedScatterMark.js +3 -3
  95. package/ScatterChart/HighlightedScatterMark.mjs +3 -3
  96. package/ScatterChart/Scatter.d.mts +5 -0
  97. package/ScatterChart/Scatter.d.ts +5 -0
  98. package/ScatterChart/Scatter.js +7 -2
  99. package/ScatterChart/Scatter.mjs +7 -2
  100. package/ScatterChart/ScatterChart.d.mts +2 -1
  101. package/ScatterChart/ScatterChart.d.ts +2 -1
  102. package/ScatterChart/ScatterChart.js +28 -3
  103. package/ScatterChart/ScatterChart.mjs +28 -3
  104. package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
  105. package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  106. package/ScatterChart/ScatterChart.plugins.js +2 -1
  107. package/ScatterChart/ScatterChart.plugins.mjs +2 -1
  108. package/ScatterChart/ScatterMarker.types.d.mts +3 -2
  109. package/ScatterChart/ScatterMarker.types.d.ts +3 -2
  110. package/ScatterChart/ScatterPlot.d.mts +7 -4
  111. package/ScatterChart/ScatterPlot.d.ts +7 -4
  112. package/ScatterChart/ScatterPlot.js +31 -4
  113. package/ScatterChart/ScatterPlot.mjs +31 -4
  114. package/ScatterChart/async/ScatterAsync.d.mts +9 -0
  115. package/ScatterChart/async/ScatterAsync.d.ts +9 -0
  116. package/ScatterChart/async/ScatterAsync.js +71 -0
  117. package/ScatterChart/async/ScatterAsync.mjs +67 -0
  118. package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
  119. package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
  120. package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
  121. package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
  122. package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
  123. package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
  124. package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
  125. package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
  126. package/ScatterChart/seriesConfig/extremums.js +6 -0
  127. package/ScatterChart/seriesConfig/extremums.mjs +6 -0
  128. package/ScatterChart/seriesConfig/getColor.js +1 -1
  129. package/ScatterChart/seriesConfig/getColor.mjs +1 -1
  130. package/ScatterChart/seriesConfig/getMarkerSize.d.mts +18 -0
  131. package/ScatterChart/seriesConfig/getMarkerSize.d.ts +18 -0
  132. package/ScatterChart/seriesConfig/getMarkerSize.js +43 -0
  133. package/ScatterChart/seriesConfig/getMarkerSize.mjs +37 -0
  134. package/ScatterChart/seriesConfig/seriesProcessor.js +23 -8
  135. package/ScatterChart/seriesConfig/seriesProcessor.mjs +23 -8
  136. package/ScatterChart/useScatterItemPosition.d.mts +4 -0
  137. package/ScatterChart/useScatterItemPosition.d.ts +4 -0
  138. package/ScatterChart/useScatterItemPosition.js +9 -0
  139. package/ScatterChart/useScatterItemPosition.mjs +8 -0
  140. package/SparkLineChart/SparkLineChart.js +2 -1
  141. package/SparkLineChart/SparkLineChart.mjs +2 -1
  142. package/Toolbar/Toolbar.types.d.mts +3 -2
  143. package/Toolbar/Toolbar.types.d.ts +3 -2
  144. package/index.js +1 -1
  145. package/index.mjs +1 -1
  146. package/internals/animation/animation.d.mts +1 -2
  147. package/internals/animation/animation.d.ts +1 -2
  148. package/internals/commonNextFocusItem.d.mts +10 -2
  149. package/internals/commonNextFocusItem.d.ts +10 -2
  150. package/internals/commonNextFocusItem.js +12 -4
  151. package/internals/commonNextFocusItem.mjs +12 -4
  152. package/internals/createCommonKeyboardFocusHandler.d.mts +1 -1
  153. package/internals/createCommonKeyboardFocusHandler.d.ts +1 -1
  154. package/internals/createCommonKeyboardFocusHandler.js +3 -3
  155. package/internals/createCommonKeyboardFocusHandler.mjs +3 -3
  156. package/internals/getSeriesColorFn.d.mts +5 -5
  157. package/internals/getSeriesColorFn.d.ts +5 -5
  158. package/internals/incompleteDatasetKeysError.d.mts +1 -0
  159. package/internals/incompleteDatasetKeysError.d.ts +1 -0
  160. package/internals/incompleteDatasetKeysError.js +11 -0
  161. package/internals/incompleteDatasetKeysError.mjs +4 -0
  162. package/internals/index.d.mts +3 -0
  163. package/internals/index.d.ts +3 -0
  164. package/internals/index.js +36 -0
  165. package/internals/index.mjs +3 -0
  166. package/internals/plugins/allPlugins.d.mts +4 -3
  167. package/internals/plugins/allPlugins.d.ts +4 -3
  168. package/internals/plugins/allPlugins.js +2 -1
  169. package/internals/plugins/allPlugins.mjs +2 -1
  170. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
  171. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
  172. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
  173. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
  174. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
  175. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
  176. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.js +3 -2
  177. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.mjs +4 -3
  178. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +2 -2
  179. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +3 -3
  180. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.mts +10 -1
  181. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +10 -1
  182. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +18 -1
  183. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.mjs +16 -0
  184. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
  185. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
  186. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
  187. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
  188. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -3
  189. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -3
  190. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +24 -5
  191. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +24 -5
  192. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.mts +1 -1
  193. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.d.ts +1 -1
  194. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +46 -2
  195. package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.mjs +47 -2
  196. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +46 -11
  197. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +46 -11
  198. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +2 -1
  199. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +2 -1
  200. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +3 -2
  201. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +3 -2
  202. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.mts +4 -0
  203. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +4 -0
  204. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +3 -1
  205. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.mjs +1 -0
  206. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +5 -3
  207. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +7 -5
  208. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +17 -3
  209. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.mjs +17 -3
  210. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
  211. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
  212. package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
  213. package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
  214. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
  215. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
  216. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
  217. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
  218. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
  219. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
  220. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
  221. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
  222. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
  223. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
  224. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
  225. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
  226. package/internals/scales/scaleBand.js +70 -43
  227. package/internals/scales/scaleBand.mjs +71 -44
  228. package/internals/sizeScale.d.mts +6 -0
  229. package/internals/sizeScale.d.ts +6 -0
  230. package/internals/sizeScale.js +46 -0
  231. package/internals/sizeScale.mjs +38 -0
  232. package/models/axis.d.mts +18 -12
  233. package/models/axis.d.ts +18 -12
  234. package/models/chartsSlotsComponentsProps.d.mts +25 -0
  235. package/models/chartsSlotsComponentsProps.d.ts +25 -0
  236. package/models/chartsSlotsComponentsProps.js +5 -0
  237. package/models/chartsSlotsComponentsProps.mjs +1 -0
  238. package/models/index.d.mts +1 -0
  239. package/models/index.d.ts +1 -0
  240. package/models/index.js +11 -0
  241. package/models/index.mjs +1 -0
  242. package/models/seriesType/bar.d.mts +1 -1
  243. package/models/seriesType/bar.d.ts +1 -1
  244. package/models/seriesType/common.d.mts +4 -4
  245. package/models/seriesType/common.d.ts +4 -4
  246. package/models/seriesType/config.d.mts +3 -3
  247. package/models/seriesType/config.d.ts +3 -3
  248. package/models/seriesType/line.d.mts +6 -3
  249. package/models/seriesType/line.d.ts +6 -3
  250. package/models/seriesType/pie.d.mts +1 -1
  251. package/models/seriesType/pie.d.ts +1 -1
  252. package/models/seriesType/radar.d.mts +1 -1
  253. package/models/seriesType/radar.d.ts +1 -1
  254. package/models/seriesType/scatter.d.mts +35 -3
  255. package/models/seriesType/scatter.d.ts +35 -3
  256. package/models/sizeMapping.d.mts +64 -0
  257. package/models/sizeMapping.d.ts +64 -0
  258. package/models/sizeMapping.js +5 -0
  259. package/models/sizeMapping.mjs +1 -0
  260. package/models/slots/chartsBaseSlots.d.mts +6 -5
  261. package/models/slots/chartsBaseSlots.d.ts +6 -5
  262. package/models/z-axis.d.mts +10 -1
  263. package/models/z-axis.d.ts +10 -1
  264. package/package.json +5 -5
@@ -2,7 +2,7 @@ import type { DefaultizedProps, MakeOptional, MakeRequired } from '@mui/x-intern
2
2
  import type { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from "./scatter.js";
3
3
  import type { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from "./line.js";
4
4
  import type { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from "./bar.js";
5
- import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType, PieSeriesLayout } from "./pie.js";
5
+ import type { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, PieSeriesLayout } from "./pie.js";
6
6
  import type { DefaultizedRadarSeriesType, RadarItemIdentifier, RadarSeriesType } from "./radar.js";
7
7
  import type { SeriesColor, SeriesId } from "./common.js";
8
8
  import type { ChartsRadiusAxisProps, ChartsRotationAxisProps, ComputedXAxis, ComputedYAxis, PolarAxisDefaultized } from "../axis.js";
@@ -74,7 +74,7 @@ export interface ChartsSeriesConfig {
74
74
  };
75
75
  };
76
76
  scatter: {
77
- seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType | null>, 'color'>;
77
+ seriesInput: DefaultizedProps<ScatterSeriesType, 'id'> & MakeRequired<SeriesColor<ScatterValueType>, 'color'>;
78
78
  series: DefaultizedScatterSeriesType;
79
79
  seriesLayout: {};
80
80
  seriesProp: ScatterSeriesType;
@@ -104,7 +104,7 @@ export interface ChartsSeriesConfig {
104
104
  seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
105
105
  itemIdentifier: PieItemIdentifier;
106
106
  itemIdentifierWithData: PieItemIdentifier;
107
- valueType: DefaultizedPieValueType;
107
+ valueType: PieValueType;
108
108
  highlightScope: CommonHighlightScope;
109
109
  descriptionGetterParams: {
110
110
  identifier: PieItemIdentifier;
@@ -61,10 +61,13 @@ export interface CommonLineSeriesType {
61
61
  strictStepCurve?: boolean;
62
62
  /**
63
63
  * Define which items of the series should display a mark.
64
- * If can be a boolean that applies to all items.
64
+ * It can be a boolean that applies to all items.
65
+ * It can be `'start'` or `'end'` to only display a mark on the first or last item. Such marks reuse
66
+ * the line highlight element, so they are replaced by the highlighted item when the pointer
67
+ * highlights a value.
65
68
  * Or a callback that gets some item properties and returns true if the item should be displayed.
66
69
  */
67
- showMark?: boolean | ((params: ShowMarkParams) => boolean);
70
+ showMark?: boolean | 'start' | 'end' | ((params: ShowMarkParams) => boolean);
68
71
  /**
69
72
  * The shape of the mark elements.
70
73
  * Using 'circle' renders a `<circle />` element, while all other options render a `<path />` instead. The path causes a small decrease in performance.
@@ -93,7 +96,7 @@ export interface CommonLineSeriesType {
93
96
  */
94
97
  baseline?: number | 'min' | 'max';
95
98
  }
96
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
99
+ export interface LineSeriesType extends CommonSeriesType<'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
97
100
  type: 'line';
98
101
  /**
99
102
  * Defines how stacked series handle negative values.
@@ -61,10 +61,13 @@ export interface CommonLineSeriesType {
61
61
  strictStepCurve?: boolean;
62
62
  /**
63
63
  * Define which items of the series should display a mark.
64
- * If can be a boolean that applies to all items.
64
+ * It can be a boolean that applies to all items.
65
+ * It can be `'start'` or `'end'` to only display a mark on the first or last item. Such marks reuse
66
+ * the line highlight element, so they are replaced by the highlighted item when the pointer
67
+ * highlights a value.
65
68
  * Or a callback that gets some item properties and returns true if the item should be displayed.
66
69
  */
67
- showMark?: boolean | ((params: ShowMarkParams) => boolean);
70
+ showMark?: boolean | 'start' | 'end' | ((params: ShowMarkParams) => boolean);
68
71
  /**
69
72
  * The shape of the mark elements.
70
73
  * Using 'circle' renders a `<circle />` element, while all other options render a `<path />` instead. The path causes a small decrease in performance.
@@ -93,7 +96,7 @@ export interface CommonLineSeriesType {
93
96
  */
94
97
  baseline?: number | 'min' | 'max';
95
98
  }
96
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
99
+ export interface LineSeriesType extends CommonSeriesType<'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
97
100
  type: 'line';
98
101
  /**
99
102
  * Defines how stacked series handle negative values.
@@ -26,7 +26,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
26
26
  hidden: boolean;
27
27
  };
28
28
  export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
29
- export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData, 'pie'> {
29
+ export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<'pie'> {
30
30
  type: 'pie';
31
31
  data: Readonly<TData[]>;
32
32
  /**
@@ -26,7 +26,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
26
26
  hidden: boolean;
27
27
  };
28
28
  export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
29
- export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData, 'pie'> {
29
+ export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<'pie'> {
30
30
  type: 'pie';
31
31
  data: Readonly<TData[]>;
32
32
  /**
@@ -1,6 +1,6 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { SeriesId, CommonDefaultizedProps, CommonSeriesType } from "./common.mjs";
3
- export interface RadarSeriesType extends CommonSeriesType<number, 'radar'> {
3
+ export interface RadarSeriesType extends CommonSeriesType<'radar'> {
4
4
  type: 'radar';
5
5
  data: number[];
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { SeriesId, CommonDefaultizedProps, CommonSeriesType } from "./common.js";
3
- export interface RadarSeriesType extends CommonSeriesType<number, 'radar'> {
3
+ export interface RadarSeriesType extends CommonSeriesType<'radar'> {
4
4
  type: 'radar';
5
5
  data: number[];
6
6
  /**
@@ -4,13 +4,25 @@ import { type DatasetElementType } from "./config.mjs";
4
4
  export type ScatterValueType = {
5
5
  x: number;
6
6
  y: number;
7
+ /**
8
+ * The value used to compute the color of the scatter point through a color axis.
9
+ */
10
+ colorValue?: any;
11
+ /**
12
+ * The value used to compute the size of the scatter point through a size axis.
13
+ */
14
+ sizeValue?: any;
15
+ /**
16
+ * The value used to compute the color of the scatter point through a color axis.
17
+ * @deprecated Use `colorValue` instead.
18
+ */
7
19
  z?: any;
8
20
  /**
9
21
  * A unique identifier for the scatter point
10
22
  */
11
23
  id?: string | number;
12
24
  };
13
- export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null, 'scatter'>, CartesianSeriesType {
25
+ export interface ScatterSeriesType extends CommonSeriesType<'scatter'>, CartesianSeriesType {
14
26
  type: 'scatter';
15
27
  data?: readonly ScatterValueType[];
16
28
  /**
@@ -21,8 +33,19 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
21
33
  * The label to display on the tooltip or the legend. It can be a string or a function.
22
34
  */
23
35
  label?: string | ((location: 'tooltip' | 'legend') => string);
36
+ /**
37
+ * The id of the color axis used to compute the color of the scatter points.
38
+ * It points to the id of an axis defined with the `zAxis` prop.
39
+ */
40
+ colorAxisId?: string;
41
+ /**
42
+ * The id of the size axis used to compute the size of the scatter points.
43
+ * It points to the id of an axis defined with the `zAxis` prop.
44
+ */
45
+ sizeAxisId?: string;
24
46
  /**
25
47
  * The id of the z-axis used to render the series.
48
+ * @deprecated Use `colorAxisId` instead.
26
49
  */
27
50
  zAxisId?: string;
28
51
  /**
@@ -36,8 +59,8 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
36
59
  /**
37
60
  * The keys used to retrieve data from the dataset.
38
61
  *
39
- * When this prop is provided, all of `x`, `y`, and `id` must be provided.
40
- * While `z` is optional.
62
+ * When this prop is provided, both `x` and `y` must be provided.
63
+ * While `color`, `size`, and `id` are optional.
41
64
  */
42
65
  datasetKeys?: {
43
66
  /**
@@ -48,8 +71,17 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
48
71
  * The key used to retrieve data from the dataset for the Y axis.
49
72
  */
50
73
  y: string;
74
+ /**
75
+ * The key used to retrieve data from the dataset for the color value.
76
+ */
77
+ colorValue?: string;
78
+ /**
79
+ * The key used to retrieve data from the dataset for the size value.
80
+ */
81
+ sizeValue?: string;
51
82
  /**
52
83
  * The key used to retrieve data from the dataset for the Z axis.
84
+ * @deprecated Use `colorValue` instead.
53
85
  */
54
86
  z?: string;
55
87
  /**
@@ -4,13 +4,25 @@ import { type DatasetElementType } from "./config.js";
4
4
  export type ScatterValueType = {
5
5
  x: number;
6
6
  y: number;
7
+ /**
8
+ * The value used to compute the color of the scatter point through a color axis.
9
+ */
10
+ colorValue?: any;
11
+ /**
12
+ * The value used to compute the size of the scatter point through a size axis.
13
+ */
14
+ sizeValue?: any;
15
+ /**
16
+ * The value used to compute the color of the scatter point through a color axis.
17
+ * @deprecated Use `colorValue` instead.
18
+ */
7
19
  z?: any;
8
20
  /**
9
21
  * A unique identifier for the scatter point
10
22
  */
11
23
  id?: string | number;
12
24
  };
13
- export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null, 'scatter'>, CartesianSeriesType {
25
+ export interface ScatterSeriesType extends CommonSeriesType<'scatter'>, CartesianSeriesType {
14
26
  type: 'scatter';
15
27
  data?: readonly ScatterValueType[];
16
28
  /**
@@ -21,8 +33,19 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
21
33
  * The label to display on the tooltip or the legend. It can be a string or a function.
22
34
  */
23
35
  label?: string | ((location: 'tooltip' | 'legend') => string);
36
+ /**
37
+ * The id of the color axis used to compute the color of the scatter points.
38
+ * It points to the id of an axis defined with the `zAxis` prop.
39
+ */
40
+ colorAxisId?: string;
41
+ /**
42
+ * The id of the size axis used to compute the size of the scatter points.
43
+ * It points to the id of an axis defined with the `zAxis` prop.
44
+ */
45
+ sizeAxisId?: string;
24
46
  /**
25
47
  * The id of the z-axis used to render the series.
48
+ * @deprecated Use `colorAxisId` instead.
26
49
  */
27
50
  zAxisId?: string;
28
51
  /**
@@ -36,8 +59,8 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
36
59
  /**
37
60
  * The keys used to retrieve data from the dataset.
38
61
  *
39
- * When this prop is provided, all of `x`, `y`, and `id` must be provided.
40
- * While `z` is optional.
62
+ * When this prop is provided, both `x` and `y` must be provided.
63
+ * While `color`, `size`, and `id` are optional.
41
64
  */
42
65
  datasetKeys?: {
43
66
  /**
@@ -48,8 +71,17 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
48
71
  * The key used to retrieve data from the dataset for the Y axis.
49
72
  */
50
73
  y: string;
74
+ /**
75
+ * The key used to retrieve data from the dataset for the color value.
76
+ */
77
+ colorValue?: string;
78
+ /**
79
+ * The key used to retrieve data from the dataset for the size value.
80
+ */
81
+ sizeValue?: string;
51
82
  /**
52
83
  * The key used to retrieve data from the dataset for the Z axis.
84
+ * @deprecated Use `colorValue` instead.
53
85
  */
54
86
  z?: string;
55
87
  /**
@@ -0,0 +1,64 @@
1
+ type SharedContinuousSizeConfig<Value> = {
2
+ type: 'continuous';
3
+ /**
4
+ * The minimal value of the size scale.
5
+ * @default 0
6
+ */
7
+ min?: Value;
8
+ /**
9
+ * The maximal value of the size scale.
10
+ * @default 100
11
+ */
12
+ max?: Value;
13
+ };
14
+ type ContinuousSizeConfigWithNamedInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
15
+ /**
16
+ * The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
17
+ */
18
+ size: readonly [number, number];
19
+ /**
20
+ * The interpolator to use when `size` is an array of two numbers. It defines how the size should interpolate between the minimum and maximum values.
21
+ * Default is set to 'sqrt' to map values to surfaces instead of radii.
22
+ * @default 'sqrt'
23
+ */
24
+ interpolator?: 'sqrt' | 'linear' | 'log';
25
+ };
26
+ export type ContinuousSizeConfigWithFunctionInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
27
+ /**
28
+ * The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
29
+ * @param {number} t the interpolation factor. Varies from 0 to 1 when values are from min to max.
30
+ * @returns {number} The size to render for the interpolation factor `t`.
31
+ */
32
+ size: (t: number) => number;
33
+ };
34
+ export type ContinuousSizeConfig<Value = number | Date> = ContinuousSizeConfigWithNamedInterpolator<Value> | ContinuousSizeConfigWithFunctionInterpolator<Value>;
35
+ export interface PiecewiseSizeConfig<Value = number | Date> {
36
+ type: 'piecewise';
37
+ /**
38
+ * The thresholds where size should change from one category to another.
39
+ */
40
+ thresholds: Value[];
41
+ /**
42
+ * The sizes used for each band defined by `thresholds`.
43
+ * Should contain N+1 sizes, where N is the number of thresholds.
44
+ */
45
+ sizes: number[];
46
+ }
47
+ export interface OrdinalSizeConfig<Value = number | Date | string> {
48
+ type: 'ordinal';
49
+ /**
50
+ * The value to map.
51
+ * If undefined, it will be integers from 0 to the number of sizes.
52
+ */
53
+ values?: readonly Value[];
54
+ /**
55
+ * The size palette.
56
+ * Items equal to `values[k]` will get the size of `sizes[k]`.
57
+ */
58
+ sizes: number[];
59
+ /**
60
+ * The size to use when an element is not part of the values.
61
+ */
62
+ unknownSize?: number;
63
+ }
64
+ export {};
@@ -0,0 +1,64 @@
1
+ type SharedContinuousSizeConfig<Value> = {
2
+ type: 'continuous';
3
+ /**
4
+ * The minimal value of the size scale.
5
+ * @default 0
6
+ */
7
+ min?: Value;
8
+ /**
9
+ * The maximal value of the size scale.
10
+ * @default 100
11
+ */
12
+ max?: Value;
13
+ };
14
+ type ContinuousSizeConfigWithNamedInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
15
+ /**
16
+ * The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
17
+ */
18
+ size: readonly [number, number];
19
+ /**
20
+ * The interpolator to use when `size` is an array of two numbers. It defines how the size should interpolate between the minimum and maximum values.
21
+ * Default is set to 'sqrt' to map values to surfaces instead of radii.
22
+ * @default 'sqrt'
23
+ */
24
+ interpolator?: 'sqrt' | 'linear' | 'log';
25
+ };
26
+ export type ContinuousSizeConfigWithFunctionInterpolator<Value = number | Date> = SharedContinuousSizeConfig<Value> & {
27
+ /**
28
+ * The sizes to render. It can be an array with the extremum sizes, or an interpolation function.
29
+ * @param {number} t the interpolation factor. Varies from 0 to 1 when values are from min to max.
30
+ * @returns {number} The size to render for the interpolation factor `t`.
31
+ */
32
+ size: (t: number) => number;
33
+ };
34
+ export type ContinuousSizeConfig<Value = number | Date> = ContinuousSizeConfigWithNamedInterpolator<Value> | ContinuousSizeConfigWithFunctionInterpolator<Value>;
35
+ export interface PiecewiseSizeConfig<Value = number | Date> {
36
+ type: 'piecewise';
37
+ /**
38
+ * The thresholds where size should change from one category to another.
39
+ */
40
+ thresholds: Value[];
41
+ /**
42
+ * The sizes used for each band defined by `thresholds`.
43
+ * Should contain N+1 sizes, where N is the number of thresholds.
44
+ */
45
+ sizes: number[];
46
+ }
47
+ export interface OrdinalSizeConfig<Value = number | Date | string> {
48
+ type: 'ordinal';
49
+ /**
50
+ * The value to map.
51
+ * If undefined, it will be integers from 0 to the number of sizes.
52
+ */
53
+ values?: readonly Value[];
54
+ /**
55
+ * The size palette.
56
+ * Items equal to `values[k]` will get the size of `sizes[k]`.
57
+ */
58
+ sizes: number[];
59
+ /**
60
+ * The size to use when an element is not part of the values.
61
+ */
62
+ unknownSize?: number;
63
+ }
64
+ export {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ export {};
@@ -1,12 +1,13 @@
1
1
  import type * as React from 'react';
2
2
  import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.mjs";
3
+ import type { BaseButtonPropsOverrides, BaseIconButtonPropsOverrides, BaseToggleButtonPropsOverrides, BaseToggleButtonGroupPropsOverrides } from "../chartsSlotsComponentsProps.mjs";
3
4
  export interface ChartsBaseSlots {
4
- baseButton: React.ComponentType<ChartBaseButtonProps>;
5
- baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
5
+ baseButton: React.ComponentType<ChartBaseButtonProps & BaseButtonPropsOverrides>;
6
+ baseIconButton: React.ComponentType<ChartBaseIconButtonProps & BaseIconButtonPropsOverrides>;
6
7
  /**
7
8
  * Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
8
- * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
9
+ * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>`.
9
10
  */
10
- baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
11
- baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
11
+ baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>;
12
+ baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps & BaseToggleButtonGroupPropsOverrides>;
12
13
  }
@@ -1,12 +1,13 @@
1
1
  import type * as React from 'react';
2
2
  import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.js";
3
+ import type { BaseButtonPropsOverrides, BaseIconButtonPropsOverrides, BaseToggleButtonPropsOverrides, BaseToggleButtonGroupPropsOverrides } from "../chartsSlotsComponentsProps.js";
3
4
  export interface ChartsBaseSlots {
4
- baseButton: React.ComponentType<ChartBaseButtonProps>;
5
- baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
5
+ baseButton: React.ComponentType<ChartBaseButtonProps & BaseButtonPropsOverrides>;
6
+ baseIconButton: React.ComponentType<ChartBaseIconButtonProps & BaseIconButtonPropsOverrides>;
6
7
  /**
7
8
  * Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
8
- * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
9
+ * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>`.
9
10
  */
10
- baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
11
- baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
11
+ baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps & BaseToggleButtonPropsOverrides>;
12
+ baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps & BaseToggleButtonGroupPropsOverrides>;
12
13
  }
@@ -1,5 +1,6 @@
1
1
  import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
- import { type ContinuousColorConfig, type OrdinalColorConfig, type PiecewiseColorConfig } from "./colorMapping.mjs";
2
+ import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.mjs";
3
+ import type { OrdinalSizeConfig, ContinuousSizeConfig, PiecewiseSizeConfig } from "./sizeMapping.mjs";
3
4
  import { type DatasetElementType } from "./seriesType/config.mjs";
4
5
  export interface ZAxisConfig<V = any> {
5
6
  id: string;
@@ -24,8 +25,16 @@ export interface ZAxisConfig<V = any> {
24
25
  * The maximal value of the scale.
25
26
  */
26
27
  max?: number;
28
+ /**
29
+ * The config that defines how the values should be mapped to colors.
30
+ */
27
31
  colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig;
32
+ /**
33
+ * The config that defines how the values should be mapped to sizes.
34
+ */
35
+ sizeMap?: OrdinalSizeConfig | ContinuousSizeConfig | PiecewiseSizeConfig;
28
36
  }
29
37
  export interface ZAxisDefaultized extends ZAxisConfig {
30
38
  colorScale?: ScaleOrdinal<string | number | Date, string, string | null> | ScaleOrdinal<number, string, string | null> | ScaleSequential<string, string | null> | ScaleThreshold<number | Date, string | null>;
39
+ sizeScale?: ScaleOrdinal<string | number | Date, number, number | null> | ScaleOrdinal<number, number, number | null> | ScaleSequential<number, number | null> | ScaleThreshold<number | Date, number | null>;
31
40
  }
@@ -1,5 +1,6 @@
1
1
  import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
- import { type ContinuousColorConfig, type OrdinalColorConfig, type PiecewiseColorConfig } from "./colorMapping.js";
2
+ import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
3
+ import type { OrdinalSizeConfig, ContinuousSizeConfig, PiecewiseSizeConfig } from "./sizeMapping.js";
3
4
  import { type DatasetElementType } from "./seriesType/config.js";
4
5
  export interface ZAxisConfig<V = any> {
5
6
  id: string;
@@ -24,8 +25,16 @@ export interface ZAxisConfig<V = any> {
24
25
  * The maximal value of the scale.
25
26
  */
26
27
  max?: number;
28
+ /**
29
+ * The config that defines how the values should be mapped to colors.
30
+ */
27
31
  colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig;
32
+ /**
33
+ * The config that defines how the values should be mapped to sizes.
34
+ */
35
+ sizeMap?: OrdinalSizeConfig | ContinuousSizeConfig | PiecewiseSizeConfig;
28
36
  }
29
37
  export interface ZAxisDefaultized extends ZAxisConfig {
30
38
  colorScale?: ScaleOrdinal<string | number | Date, string, string | null> | ScaleOrdinal<number, string, string | null> | ScaleSequential<string, string | null> | ScaleThreshold<number | Date, string | null>;
39
+ sizeScale?: ScaleOrdinal<string | number | Date, number, number | null> | ScaleOrdinal<number, number, number | null> | ScaleSequential<number, number | null> | ScaleThreshold<number | Date, number | null>;
31
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "9.3.0",
3
+ "version": "9.5.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
6
  "license": "MIT",
@@ -27,15 +27,15 @@
27
27
  "directory": "packages/x-charts"
28
28
  },
29
29
  "dependencies": {
30
- "@babel/runtime": "^7.29.2",
30
+ "@babel/runtime": "^7.29.7",
31
31
  "@mui/utils": "9.0.1",
32
- "bezier-easing": "^2.1.0",
32
+ "bezier-easing": "^3.0.0",
33
33
  "clsx": "^2.1.1",
34
34
  "prop-types": "^15.8.1",
35
- "reselect": "^5.1.1",
35
+ "reselect": "^5.2.0",
36
36
  "use-sync-external-store": "^1.6.0",
37
+ "@mui/x-charts-vendor": "^9.4.0",
37
38
  "@mui/x-internal-gestures": "^9.3.0",
38
- "@mui/x-charts-vendor": "^9.0.0",
39
39
  "@mui/x-internals": "^9.1.0"
40
40
  },
41
41
  "peerDependencies": {