@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
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Returns the marker size of a scatter item given its data index.
3
+ * @param {number} dataIndex The index of the scatter item.
4
+ * @returns {number} The marker size in pixels.
5
+ */
6
+
7
+ /**
8
+ * Builds a getter returning the marker size of each scatter item.
9
+ *
10
+ * When the size axis defines a `sizeMap`, the size is computed by mapping a value
11
+ * through the resulting `sizeScale`. The mapped value is taken from the size axis
12
+ * `data` when available, otherwise from the `sizeValue` of the scatter point.
13
+ * It falls back to the series `markerSize` when no size can be computed.
14
+ */
15
+ const getMarkerSize = (series, sizeZAxis) => {
16
+ const sizeScale = sizeZAxis?.sizeScale;
17
+ if (!sizeScale) {
18
+ return () => series.markerSize;
19
+ }
20
+ return dataIndex => {
21
+ if (sizeZAxis?.data?.[dataIndex] !== undefined) {
22
+ const size = sizeScale(sizeZAxis.data[dataIndex]);
23
+ if (size != null && !Number.isNaN(size)) {
24
+ return size;
25
+ }
26
+ }
27
+ const value = series.data[dataIndex];
28
+ if (value != null) {
29
+ const size = sizeScale(value.sizeValue);
30
+ if (size != null && !Number.isNaN(size)) {
31
+ return size;
32
+ }
33
+ }
34
+ return series.markerSize;
35
+ };
36
+ };
37
+ export default getMarkerSize;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
9
+ var _incompleteDatasetKeysError = require("../../internals/incompleteDatasetKeysError");
10
10
  const seriesProcessor = ({
11
11
  series,
12
12
  seriesOrder
@@ -15,18 +15,33 @@ const seriesProcessor = ({
15
15
  const datasetKeys = seriesData?.datasetKeys;
16
16
  const missingKeys = ['x', 'y'].filter(key => typeof datasetKeys?.[key] !== 'string');
17
17
  if (seriesData?.datasetKeys && missingKeys.length > 0) {
18
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Scatter series with id="${seriesId}" has incomplete datasetKeys. ` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing. ` + 'Scatter plots require both "x" and "y" keys to map dataset values to coordinates. ' + 'Add the missing datasetKeys to the series configuration.' : (0, _formatErrorMessage2.default)(29, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
18
+ (0, _incompleteDatasetKeysError.incompleteDatasetKeysError)('Scatter', seriesId, missingKeys);
19
19
  }
20
20
  let data;
21
21
  if (seriesData.valueGetter) {
22
22
  data = dataset?.map(seriesData.valueGetter) ?? [];
23
23
  } else if (datasetKeys) {
24
- data = dataset?.map(d => ({
25
- x: d[datasetKeys.x] ?? null,
26
- y: d[datasetKeys.y] ?? null,
27
- z: datasetKeys.z && d[datasetKeys.z],
28
- id: datasetKeys.id && d[datasetKeys.id]
29
- })) ?? [];
24
+ data = dataset?.map(d => {
25
+ const x = d[datasetKeys.x];
26
+ const y = d[datasetKeys.y];
27
+ const rep = {
28
+ x,
29
+ y
30
+ };
31
+ if (datasetKeys.colorValue !== undefined) {
32
+ rep.colorValue = d[datasetKeys.colorValue];
33
+ }
34
+ if (datasetKeys.sizeValue !== undefined) {
35
+ rep.sizeValue = d[datasetKeys.sizeValue];
36
+ }
37
+ if (datasetKeys.z !== undefined) {
38
+ rep.z = d[datasetKeys.z];
39
+ }
40
+ if (datasetKeys.id !== undefined) {
41
+ rep.id = d[datasetKeys.id];
42
+ }
43
+ return rep;
44
+ }) ?? [];
30
45
  } else {
31
46
  data = seriesData.data ?? [];
32
47
  }
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
2
+ import { incompleteDatasetKeysError } from "../../internals/incompleteDatasetKeysError.mjs";
3
3
  const seriesProcessor = ({
4
4
  series,
5
5
  seriesOrder
@@ -8,18 +8,33 @@ const seriesProcessor = ({
8
8
  const datasetKeys = seriesData?.datasetKeys;
9
9
  const missingKeys = ['x', 'y'].filter(key => typeof datasetKeys?.[key] !== 'string');
10
10
  if (seriesData?.datasetKeys && missingKeys.length > 0) {
11
- throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: Scatter series with id="${seriesId}" has incomplete datasetKeys. ` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing. ` + 'Scatter plots require both "x" and "y" keys to map dataset values to coordinates. ' + 'Add the missing datasetKeys to the series configuration.' : _formatErrorMessage(29, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
11
+ incompleteDatasetKeysError('Scatter', seriesId, missingKeys);
12
12
  }
13
13
  let data;
14
14
  if (seriesData.valueGetter) {
15
15
  data = dataset?.map(seriesData.valueGetter) ?? [];
16
16
  } else if (datasetKeys) {
17
- data = dataset?.map(d => ({
18
- x: d[datasetKeys.x] ?? null,
19
- y: d[datasetKeys.y] ?? null,
20
- z: datasetKeys.z && d[datasetKeys.z],
21
- id: datasetKeys.id && d[datasetKeys.id]
22
- })) ?? [];
17
+ data = dataset?.map(d => {
18
+ const x = d[datasetKeys.x];
19
+ const y = d[datasetKeys.y];
20
+ const rep = {
21
+ x,
22
+ y
23
+ };
24
+ if (datasetKeys.colorValue !== undefined) {
25
+ rep.colorValue = d[datasetKeys.colorValue];
26
+ }
27
+ if (datasetKeys.sizeValue !== undefined) {
28
+ rep.sizeValue = d[datasetKeys.sizeValue];
29
+ }
30
+ if (datasetKeys.z !== undefined) {
31
+ rep.z = d[datasetKeys.z];
32
+ }
33
+ if (datasetKeys.id !== undefined) {
34
+ rep.id = d[datasetKeys.id];
35
+ }
36
+ return rep;
37
+ }) ?? [];
23
38
  } else {
24
39
  data = seriesData.data ?? [];
25
40
  }
@@ -2,6 +2,10 @@ import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier, type Sca
2
2
  export interface ResolvedScatterItem {
3
3
  cx: number;
4
4
  cy: number;
5
+ /**
6
+ * The resolved marker size of the scatter point, accounting for any size axis.
7
+ */
8
+ markerSize: number;
5
9
  series: DefaultizedScatterSeriesType;
6
10
  scatterPoint: ScatterValueType;
7
11
  }
@@ -2,6 +2,10 @@ import { type DefaultizedScatterSeriesType, type ScatterItemIdentifier, type Sca
2
2
  export interface ResolvedScatterItem {
3
3
  cx: number;
4
4
  cy: number;
5
+ /**
6
+ * The resolved marker size of the scatter point, accounting for any size axis.
7
+ */
8
+ markerSize: number;
5
9
  series: DefaultizedScatterSeriesType;
6
10
  scatterPoint: ScatterValueType;
7
11
  }
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.useScatterItemPosition = useScatterItemPosition;
7
8
  var _hooks = require("../hooks");
9
+ var _useZAxis = require("../hooks/useZAxis");
10
+ var _getMarkerSize = _interopRequireDefault(require("./seriesConfig/getMarkerSize"));
8
11
  /**
9
12
  * Resolves a scatter item identifier to its on-screen position and the owning
10
13
  * series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
@@ -23,6 +26,10 @@ function useScatterItemPosition(item) {
23
26
  yAxis,
24
27
  yAxisIds
25
28
  } = (0, _hooks.useYAxes)();
29
+ const {
30
+ zAxis,
31
+ zAxisIds
32
+ } = (0, _useZAxis.useZAxes)();
26
33
  if (!item || !scatterSeries) {
27
34
  return null;
28
35
  }
@@ -38,9 +45,11 @@ function useScatterItemPosition(item) {
38
45
  const yAxisId = series.yAxisId ?? yAxisIds[0];
39
46
  const cx = (0, _hooks.getValueToPositionMapper)(xAxis[xAxisId].scale)(scatterPoint.x);
40
47
  const cy = (0, _hooks.getValueToPositionMapper)(yAxis[yAxisId].scale)(scatterPoint.y);
48
+ const markerSize = (0, _getMarkerSize.default)(series, zAxis[series.sizeAxisId ?? zAxisIds[0]])(item.dataIndex);
41
49
  return {
42
50
  cx,
43
51
  cy,
52
+ markerSize,
44
53
  series,
45
54
  scatterPoint
46
55
  };
@@ -1,4 +1,6 @@
1
1
  import { getValueToPositionMapper, useScatterSeriesContext, useXAxes, useYAxes } from "../hooks/index.mjs";
2
+ import { useZAxes } from "../hooks/useZAxis.mjs";
3
+ import getMarkerSize from "./seriesConfig/getMarkerSize.mjs";
2
4
  /**
3
5
  * Resolves a scatter item identifier to its on-screen position and the owning
4
6
  * series. Shared by `FocusedScatterMark`, `HighlightedScatterMark`, and other
@@ -17,6 +19,10 @@ export function useScatterItemPosition(item) {
17
19
  yAxis,
18
20
  yAxisIds
19
21
  } = useYAxes();
22
+ const {
23
+ zAxis,
24
+ zAxisIds
25
+ } = useZAxes();
20
26
  if (!item || !scatterSeries) {
21
27
  return null;
22
28
  }
@@ -32,9 +38,11 @@ export function useScatterItemPosition(item) {
32
38
  const yAxisId = series.yAxisId ?? yAxisIds[0];
33
39
  const cx = getValueToPositionMapper(xAxis[xAxisId].scale)(scatterPoint.x);
34
40
  const cy = getValueToPositionMapper(yAxis[yAxisId].scale)(scatterPoint.y);
41
+ const markerSize = getMarkerSize(series, zAxis[series.sizeAxisId ?? zAxisIds[0]])(item.dataIndex);
35
42
  return {
36
43
  cx,
37
44
  cy,
45
+ markerSize,
38
46
  series,
39
47
  scatterPoint
40
48
  };
@@ -255,7 +255,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
255
255
  * Options to enable features planned for the next major.
256
256
  */
257
257
  experimentalFeatures: _propTypes.default.shape({
258
- enablePositionBasedPointerInteraction: _propTypes.default.bool
258
+ enablePositionBasedPointerInteraction: _propTypes.default.bool,
259
+ progressiveRendering: _propTypes.default.bool
259
260
  }),
260
261
  /**
261
262
  * The height of the chart in px. If not defined, it takes the height of the parent element.
@@ -248,7 +248,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
248
248
  * Options to enable features planned for the next major.
249
249
  */
250
250
  experimentalFeatures: PropTypes.shape({
251
- enablePositionBasedPointerInteraction: PropTypes.bool
251
+ enablePositionBasedPointerInteraction: PropTypes.bool,
252
+ progressiveRendering: PropTypes.bool
252
253
  }),
253
254
  /**
254
255
  * The height of the chart in px. If not defined, it takes the height of the parent element.
@@ -1,15 +1,16 @@
1
1
  import type * as React from 'react';
2
+ import type { ToolbarPropsOverrides } from "../models/chartsSlotsComponentsProps.mjs";
2
3
  export interface ChartsToolbarProps {}
3
4
  export interface ChartsToolbarSlots {
4
5
  /**
5
6
  * Custom component for the toolbar.
6
7
  * @default ChartsToolbar
7
8
  */
8
- toolbar?: React.ElementType<ChartsToolbarProps>;
9
+ toolbar?: React.ElementType<ChartsToolbarProps & ToolbarPropsOverrides>;
9
10
  }
10
11
  export interface ChartsToolbarSlotProps {
11
12
  /**
12
13
  * Props for the toolbar component.
13
14
  */
14
- toolbar?: Partial<ChartsToolbarProps>;
15
+ toolbar?: Partial<ChartsToolbarProps> & ToolbarPropsOverrides;
15
16
  }
@@ -1,15 +1,16 @@
1
1
  import type * as React from 'react';
2
+ import type { ToolbarPropsOverrides } from "../models/chartsSlotsComponentsProps.js";
2
3
  export interface ChartsToolbarProps {}
3
4
  export interface ChartsToolbarSlots {
4
5
  /**
5
6
  * Custom component for the toolbar.
6
7
  * @default ChartsToolbar
7
8
  */
8
- toolbar?: React.ElementType<ChartsToolbarProps>;
9
+ toolbar?: React.ElementType<ChartsToolbarProps & ToolbarPropsOverrides>;
9
10
  }
10
11
  export interface ChartsToolbarSlotProps {
11
12
  /**
12
13
  * Props for the toolbar component.
13
14
  */
14
- toolbar?: Partial<ChartsToolbarProps>;
15
+ toolbar?: Partial<ChartsToolbarProps> & ToolbarPropsOverrides;
15
16
  }
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v9.3.0
2
+ * @mui/x-charts v9.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v9.3.0
2
+ * @mui/x-charts v9.5.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,4 +1,3 @@
1
- import BezierEasing from 'bezier-easing';
2
1
  export declare const ANIMATION_DURATION_MS = 300;
3
2
  export declare const ANIMATION_TIMING_FUNCTION = "cubic-bezier(0.66, 0, 0.34, 1)";
4
- export declare const ANIMATION_TIMING_FUNCTION_JS: BezierEasing.EasingFunction;
3
+ export declare const ANIMATION_TIMING_FUNCTION_JS: import("bezier-easing").EasingFunction;
@@ -1,4 +1,3 @@
1
- import BezierEasing from 'bezier-easing';
2
1
  export declare const ANIMATION_DURATION_MS = 300;
3
2
  export declare const ANIMATION_TIMING_FUNCTION = "cubic-bezier(0.66, 0, 0.34, 1)";
4
- export declare const ANIMATION_TIMING_FUNCTION_JS: BezierEasing.EasingFunction;
3
+ export declare const ANIMATION_TIMING_FUNCTION_JS: import("bezier-easing").EasingFunction;
@@ -16,7 +16,11 @@ compatibleSeriesTypes: Set<OutSeriesType>,
16
16
  /**
17
17
  * If true, allows cycling from the last item to the first one.
18
18
  */
19
- allowCycles?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
19
+ allowCycles?: boolean,
20
+ /**
21
+ * If true, series max index is defined by the current series length and not all series.
22
+ */
23
+ useCurrentSeriesMaxLength?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
20
24
  export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
21
25
  /**
22
26
  * The set of series types compatible with this navigation action.
@@ -25,7 +29,11 @@ compatibleSeriesTypes: Set<OutSeriesType>,
25
29
  /**
26
30
  * If true, allows cycling from the last item to the first one.
27
31
  */
28
- allowCycles?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
32
+ allowCycles?: boolean,
33
+ /**
34
+ * If true, series max index is defined by the current series length and not all series.
35
+ */
36
+ useCurrentSeriesMaxLength?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
29
37
  export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
30
38
  /**
31
39
  * The set of series types compatible with this navigation action.
@@ -16,7 +16,11 @@ compatibleSeriesTypes: Set<OutSeriesType>,
16
16
  /**
17
17
  * If true, allows cycling from the last item to the first one.
18
18
  */
19
- allowCycles?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
19
+ allowCycles?: boolean,
20
+ /**
21
+ * If true, series max index is defined by the current series length and not all series.
22
+ */
23
+ useCurrentSeriesMaxLength?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
20
24
  export declare function createGetPreviousIndexFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
21
25
  /**
22
26
  * The set of series types compatible with this navigation action.
@@ -25,7 +29,11 @@ compatibleSeriesTypes: Set<OutSeriesType>,
25
29
  /**
26
30
  * If true, allows cycling from the last item to the first one.
27
31
  */
28
- allowCycles?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
32
+ allowCycles?: boolean,
33
+ /**
34
+ * If true, series max index is defined by the current series length and not all series.
35
+ */
36
+ useCurrentSeriesMaxLength?: boolean): (currentItem: FocusedItemIdentifier<InSeriesType> | null, state: StateParameters<InSeriesType>) => ReturnedItem<OutSeriesType>;
29
37
  export declare function createGetNextSeriesFocusedItem<InSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, OutSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = InSeriesType>(
30
38
  /**
31
39
  * The set of series types compatible with this navigation action.
@@ -25,7 +25,11 @@ compatibleSeriesTypes,
25
25
  /**
26
26
  * If true, allows cycling from the last item to the first one.
27
27
  */
28
- allowCycles = false) {
28
+ allowCycles = false,
29
+ /**
30
+ * If true, series max index is defined by the current series length and not all series.
31
+ */
32
+ useCurrentSeriesMaxLength = false) {
29
33
  return function getNextIndexFocusedItem(currentItem, state) {
30
34
  const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
31
35
  let seriesId = currentItem?.seriesId;
@@ -38,7 +42,7 @@ allowCycles = false) {
38
42
  type = nextSeries.type;
39
43
  seriesId = nextSeries.seriesId;
40
44
  }
41
- const maxLength = (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
45
+ const maxLength = useCurrentSeriesMaxLength ? processedSeries[type]?.series[seriesId]?.data.length ?? 0 : (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
42
46
  let dataIndex = currentItem?.dataIndex == null ? 0 : currentItem.dataIndex + 1;
43
47
  if (allowCycles) {
44
48
  dataIndex = dataIndex % maxLength;
@@ -72,7 +76,11 @@ compatibleSeriesTypes,
72
76
  /**
73
77
  * If true, allows cycling from the last item to the first one.
74
78
  */
75
- allowCycles = false) {
79
+ allowCycles = false,
80
+ /**
81
+ * If true, series max index is defined by the current series length and not all series.
82
+ */
83
+ useCurrentSeriesMaxLength = false) {
76
84
  return function getPreviousIndexFocusedItem(currentItem, state) {
77
85
  const processedSeries = (0, _useChartSeries.selectorChartSeriesProcessed)(state);
78
86
  let seriesId = currentItem?.seriesId;
@@ -85,7 +93,7 @@ allowCycles = false) {
85
93
  type = previousSeries.type;
86
94
  seriesId = previousSeries.seriesId;
87
95
  }
88
- const maxLength = (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
96
+ const maxLength = useCurrentSeriesMaxLength ? processedSeries[type]?.series[seriesId]?.data.length ?? 0 : (0, _getMaxSeriesLength.getMaxSeriesLength)(processedSeries, compatibleSeriesTypes);
89
97
  let dataIndex = currentItem?.dataIndex == null ? maxLength - 1 : currentItem.dataIndex - 1;
90
98
  if (allowCycles) {
91
99
  dataIndex = (maxLength + dataIndex) % maxLength;
@@ -16,7 +16,11 @@ compatibleSeriesTypes,
16
16
  /**
17
17
  * If true, allows cycling from the last item to the first one.
18
18
  */
19
- allowCycles = false) {
19
+ allowCycles = false,
20
+ /**
21
+ * If true, series max index is defined by the current series length and not all series.
22
+ */
23
+ useCurrentSeriesMaxLength = false) {
20
24
  return function getNextIndexFocusedItem(currentItem, state) {
21
25
  const processedSeries = selectorChartSeriesProcessed(state);
22
26
  let seriesId = currentItem?.seriesId;
@@ -29,7 +33,7 @@ allowCycles = false) {
29
33
  type = nextSeries.type;
30
34
  seriesId = nextSeries.seriesId;
31
35
  }
32
- const maxLength = getMaxSeriesLength(processedSeries, compatibleSeriesTypes);
36
+ const maxLength = useCurrentSeriesMaxLength ? processedSeries[type]?.series[seriesId]?.data.length ?? 0 : getMaxSeriesLength(processedSeries, compatibleSeriesTypes);
33
37
  let dataIndex = currentItem?.dataIndex == null ? 0 : currentItem.dataIndex + 1;
34
38
  if (allowCycles) {
35
39
  dataIndex = dataIndex % maxLength;
@@ -63,7 +67,11 @@ compatibleSeriesTypes,
63
67
  /**
64
68
  * If true, allows cycling from the last item to the first one.
65
69
  */
66
- allowCycles = false) {
70
+ allowCycles = false,
71
+ /**
72
+ * If true, series max index is defined by the current series length and not all series.
73
+ */
74
+ useCurrentSeriesMaxLength = false) {
67
75
  return function getPreviousIndexFocusedItem(currentItem, state) {
68
76
  const processedSeries = selectorChartSeriesProcessed(state);
69
77
  let seriesId = currentItem?.seriesId;
@@ -76,7 +84,7 @@ allowCycles = false) {
76
84
  type = previousSeries.type;
77
85
  seriesId = previousSeries.seriesId;
78
86
  }
79
- const maxLength = getMaxSeriesLength(processedSeries, compatibleSeriesTypes);
87
+ const maxLength = useCurrentSeriesMaxLength ? processedSeries[type]?.series[seriesId]?.data.length ?? 0 : getMaxSeriesLength(processedSeries, compatibleSeriesTypes);
80
88
  let dataIndex = currentItem?.dataIndex == null ? maxLength - 1 : currentItem.dataIndex - 1;
81
89
  if (allowCycles) {
82
90
  dataIndex = (maxLength + dataIndex) % maxLength;
@@ -2,7 +2,7 @@ import type { ChartSeriesType } from "../models/seriesType/config.mjs";
2
2
  /**
3
3
  * Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
4
4
  */
5
- export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean): (event: KeyboardEvent) => ((currentItem: import("../index.mjs").FocusedItemIdentifier<TInputSeriesType> | null, state: {
5
+ export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: import("../index.mjs").FocusedItemIdentifier<TInputSeriesType> | null, state: {
6
6
  series: {
7
7
  defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.mjs").DefaultizedSeriesGroups<TInputSeriesType>;
8
8
  idToType: import("./index.mjs").SeriesIdToType;
@@ -2,7 +2,7 @@ import type { ChartSeriesType } from "../models/seriesType/config.js";
2
2
  /**
3
3
  * Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
4
4
  */
5
- export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean): (event: KeyboardEvent) => ((currentItem: import("../index.js").FocusedItemIdentifier<TInputSeriesType> | null, state: {
5
+ export declare function createCommonKeyboardFocusHandler<SeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'>, TInputSeriesType extends Exclude<ChartSeriesType, 'sankey' | 'heatmap'> = SeriesType>(outSeriesTypes: Set<SeriesType>, allowCycles?: boolean, useCurrentSeriesMaxLength?: boolean): (event: KeyboardEvent) => ((currentItem: import("../index.js").FocusedItemIdentifier<TInputSeriesType> | null, state: {
6
6
  series: {
7
7
  defaultizedSeries: import("./plugins/corePlugins/useChartSeries/useChartSeries.types.js").DefaultizedSeriesGroups<TInputSeriesType>;
8
8
  idToType: import("./index.js").SeriesIdToType;
@@ -8,13 +8,13 @@ var _commonNextFocusItem = require("./commonNextFocusItem");
8
8
  /**
9
9
  * Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
10
10
  */
11
- function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles) {
11
+ function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength) {
12
12
  const keyboardFocusHandler = event => {
13
13
  switch (event.key) {
14
14
  case 'ArrowRight':
15
- return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes, allowCycles);
15
+ return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
16
16
  case 'ArrowLeft':
17
- return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes, allowCycles);
17
+ return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
18
18
  case 'ArrowDown':
19
19
  return (0, _commonNextFocusItem.createGetPreviousSeriesFocusedItem)(outSeriesTypes);
20
20
  case 'ArrowUp':
@@ -3,13 +3,13 @@ import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, creat
3
3
  /**
4
4
  * Create a keyboard focus handler for common use cases where focused item are defined by the series is and data index.
5
5
  */
6
- export function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles) {
6
+ export function createCommonKeyboardFocusHandler(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength) {
7
7
  const keyboardFocusHandler = event => {
8
8
  switch (event.key) {
9
9
  case 'ArrowRight':
10
- return createGetNextIndexFocusedItem(outSeriesTypes, allowCycles);
10
+ return createGetNextIndexFocusedItem(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
11
11
  case 'ArrowLeft':
12
- return createGetPreviousIndexFocusedItem(outSeriesTypes, allowCycles);
12
+ return createGetPreviousIndexFocusedItem(outSeriesTypes, allowCycles, useCurrentSeriesMaxLength);
13
13
  case 'ArrowDown':
14
14
  return createGetPreviousSeriesFocusedItem(outSeriesTypes);
15
15
  case 'ArrowUp':
@@ -1,6 +1,6 @@
1
- import { type CommonSeriesType, type ColorCallbackValue } from "../models/seriesType/common.mjs";
2
- import { type ChartSeriesType } from "../models/seriesType/config.mjs";
3
- export declare function getSeriesColorFn<TValue>(series: {
4
- color: NonNullable<CommonSeriesType<TValue, ChartSeriesType>['color']>;
5
- colorGetter?: CommonSeriesType<TValue, ChartSeriesType>['colorGetter'];
1
+ import { type ColorCallbackValue, type SeriesColor } from "../models/seriesType/common.mjs";
2
+ import { type ChartSeriesType, type ChartsSeriesConfig } from "../models/seriesType/config.mjs";
3
+ export declare function getSeriesColorFn<TValue extends ChartsSeriesConfig[ChartSeriesType]['valueType']>(series: {
4
+ color: NonNullable<SeriesColor<TValue>['color']>;
5
+ colorGetter?: SeriesColor<TValue>['colorGetter'];
6
6
  }): (data: ColorCallbackValue<TValue>) => string;
@@ -1,6 +1,6 @@
1
- import { type CommonSeriesType, type ColorCallbackValue } from "../models/seriesType/common.js";
2
- import { type ChartSeriesType } from "../models/seriesType/config.js";
3
- export declare function getSeriesColorFn<TValue>(series: {
4
- color: NonNullable<CommonSeriesType<TValue, ChartSeriesType>['color']>;
5
- colorGetter?: CommonSeriesType<TValue, ChartSeriesType>['colorGetter'];
1
+ import { type ColorCallbackValue, type SeriesColor } from "../models/seriesType/common.js";
2
+ import { type ChartSeriesType, type ChartsSeriesConfig } from "../models/seriesType/config.js";
3
+ export declare function getSeriesColorFn<TValue extends ChartsSeriesConfig[ChartSeriesType]['valueType']>(series: {
4
+ color: NonNullable<SeriesColor<TValue>['color']>;
5
+ colorGetter?: SeriesColor<TValue>['colorGetter'];
6
6
  }): (data: ColorCallbackValue<TValue>) => string;
@@ -0,0 +1 @@
1
+ export declare function incompleteDatasetKeysError(seriesType: string, seriesId: string, missingKeys: string[]): void;
@@ -0,0 +1 @@
1
+ export declare function incompleteDatasetKeysError(seriesType: string, seriesId: string, missingKeys: string[]): void;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.incompleteDatasetKeysError = incompleteDatasetKeysError;
8
+ var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
9
+ function incompleteDatasetKeysError(seriesType, seriesId, missingKeys) {
10
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: ${seriesType} series with id="${seriesId}" has incomplete datasetKeys.` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : (0, _formatErrorMessage2.default)(279, seriesType, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
11
+ }
@@ -0,0 +1,4 @@
1
+ import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
2
+ export function incompleteDatasetKeysError(seriesType, seriesId, missingKeys) {
3
+ throw new Error(process.env.NODE_ENV !== "production" ? `MUI X Charts: ${seriesType} series with id="${seriesId}" has incomplete datasetKeys.` + `Properties ${missingKeys.map(key => `"${key}"`).join(', ')} are missing.` : _formatErrorMessage(279, seriesType, seriesId, missingKeys.map(key => `"${key}"`).join(', ')));
4
+ }
@@ -38,6 +38,7 @@ export * from "./plugins/featurePlugins/useChartKeyboardNavigation/index.mjs";
38
38
  export * from "./plugins/featurePlugins/useChartClosestPoint/index.mjs";
39
39
  export * from "./plugins/featurePlugins/useChartBrush/index.mjs";
40
40
  export * from "./plugins/featurePlugins/useChartItemClick/index.mjs";
41
+ export * from "./plugins/featurePlugins/useProgressiveRendering/index.mjs";
41
42
  export * from "./plugins/utils/selectors.mjs";
42
43
  export { getAxisTriggerTooltip as getCartesianAxisTriggerTooltip } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.mjs";
43
44
  export { getAxisIndex as getCartesianAxisIndex } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisValue.mjs";
@@ -65,6 +66,8 @@ export * from "./consumeSlots.mjs";
65
66
  export * from "./consumeThemeProps.mjs";
66
67
  export * from "./defaultizeMargin.mjs";
67
68
  export * from "./colorScale.mjs";
69
+ export * from "./sizeScale.mjs";
70
+ export * from "./incompleteDatasetKeysError.mjs";
68
71
  export * from "./ticks.mjs";
69
72
  export * from "./dateHelpers.mjs";
70
73
  export * from "./invertScale.mjs";
@@ -38,6 +38,7 @@ export * from "./plugins/featurePlugins/useChartKeyboardNavigation/index.js";
38
38
  export * from "./plugins/featurePlugins/useChartClosestPoint/index.js";
39
39
  export * from "./plugins/featurePlugins/useChartBrush/index.js";
40
40
  export * from "./plugins/featurePlugins/useChartItemClick/index.js";
41
+ export * from "./plugins/featurePlugins/useProgressiveRendering/index.js";
41
42
  export * from "./plugins/utils/selectors.js";
42
43
  export { getAxisTriggerTooltip as getCartesianAxisTriggerTooltip } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js";
43
44
  export { getAxisIndex as getCartesianAxisIndex } from "./plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js";
@@ -65,6 +66,8 @@ export * from "./consumeSlots.js";
65
66
  export * from "./consumeThemeProps.js";
66
67
  export * from "./defaultizeMargin.js";
67
68
  export * from "./colorScale.js";
69
+ export * from "./sizeScale.js";
70
+ export * from "./incompleteDatasetKeysError.js";
68
71
  export * from "./ticks.js";
69
72
  export * from "./dateHelpers.js";
70
73
  export * from "./invertScale.js";