@mui/x-charts 9.0.1 → 9.0.3

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 (206) hide show
  1. package/BarChart/BarChart.js +29 -10
  2. package/BarChart/BarChart.mjs +29 -10
  3. package/BarChart/BarElement.js +1 -5
  4. package/BarChart/BarElement.mjs +1 -5
  5. package/BarChart/BarPlot.js +2 -1
  6. package/BarChart/BarPlot.mjs +2 -1
  7. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +8 -7
  8. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +8 -7
  9. package/BarChart/seriesConfig/bar/seriesProcessor.js +37 -13
  10. package/BarChart/seriesConfig/bar/seriesProcessor.mjs +37 -13
  11. package/CHANGELOG.md +257 -0
  12. package/ChartsContainer/ChartsContainer.js +59 -30
  13. package/ChartsContainer/ChartsContainer.mjs +59 -30
  14. package/ChartsDataProvider/useChartsDataProviderProps.js +1 -6
  15. package/ChartsDataProvider/useChartsDataProviderProps.mjs +1 -6
  16. package/ChartsGrid/styledComponents.js +2 -2
  17. package/ChartsGrid/styledComponents.mjs +2 -2
  18. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +38 -0
  19. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +38 -0
  20. package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +115 -0
  21. package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +109 -0
  22. package/ChartsRadialDataProvider/ChartsRadialDataProvider.plugins.d.mts +9 -0
  23. package/ChartsRadialDataProvider/ChartsRadialDataProvider.plugins.d.ts +9 -0
  24. package/ChartsRadialDataProvider/ChartsRadialDataProvider.plugins.js +13 -0
  25. package/ChartsRadialDataProvider/ChartsRadialDataProvider.plugins.mjs +7 -0
  26. package/ChartsRadialDataProvider/index.d.mts +2 -0
  27. package/ChartsRadialDataProvider/index.d.ts +2 -0
  28. package/ChartsRadialDataProvider/index.js +27 -0
  29. package/ChartsRadialDataProvider/index.mjs +2 -0
  30. package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.d.mts +13 -0
  31. package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.d.ts +13 -0
  32. package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.js +46 -0
  33. package/ChartsRadialDataProvider/useChartsRadialDataProviderProps.mjs +39 -0
  34. package/ChartsRadialGrid/ChartsRadialGrid.d.mts +33 -0
  35. package/ChartsRadialGrid/ChartsRadialGrid.d.ts +33 -0
  36. package/ChartsRadialGrid/ChartsRadialGrid.js +101 -0
  37. package/ChartsRadialGrid/ChartsRadialGrid.mjs +96 -0
  38. package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +14 -0
  39. package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +14 -0
  40. package/ChartsRadialGrid/ChartsRadiusGrid.js +72 -0
  41. package/ChartsRadialGrid/ChartsRadiusGrid.mjs +65 -0
  42. package/ChartsRadialGrid/ChartsRotationGrid.d.mts +13 -0
  43. package/ChartsRadialGrid/ChartsRotationGrid.d.ts +13 -0
  44. package/ChartsRadialGrid/ChartsRotationGrid.js +65 -0
  45. package/ChartsRadialGrid/ChartsRotationGrid.mjs +58 -0
  46. package/ChartsRadialGrid/chartsRadialGridClasses.d.mts +13 -0
  47. package/ChartsRadialGrid/chartsRadialGridClasses.d.ts +13 -0
  48. package/ChartsRadialGrid/chartsRadialGridClasses.js +14 -0
  49. package/ChartsRadialGrid/chartsRadialGridClasses.mjs +6 -0
  50. package/ChartsRadialGrid/index.d.mts +3 -0
  51. package/ChartsRadialGrid/index.d.ts +3 -0
  52. package/ChartsRadialGrid/index.js +19 -0
  53. package/ChartsRadialGrid/index.mjs +2 -0
  54. package/ChartsRadialGrid/styledComponents.d.mts +4 -0
  55. package/ChartsRadialGrid/styledComponents.d.ts +4 -0
  56. package/ChartsRadialGrid/styledComponents.js +50 -0
  57. package/ChartsRadialGrid/styledComponents.mjs +44 -0
  58. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +48 -0
  59. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +48 -0
  60. package/ChartsRadiusAxis/ChartsRadiusAxis.js +147 -0
  61. package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +141 -0
  62. package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.mts +6 -0
  63. package/ChartsRadiusAxis/chartsRadiusAxisClasses.d.ts +6 -0
  64. package/ChartsRadiusAxis/chartsRadiusAxisClasses.js +30 -0
  65. package/ChartsRadiusAxis/chartsRadiusAxisClasses.mjs +17 -0
  66. package/ChartsRadiusAxis/createGetLabelTextAnchors.d.mts +10 -0
  67. package/ChartsRadiusAxis/createGetLabelTextAnchors.d.ts +10 -0
  68. package/ChartsRadiusAxis/createGetLabelTextAnchors.js +46 -0
  69. package/ChartsRadiusAxis/createGetLabelTextAnchors.mjs +39 -0
  70. package/ChartsRadiusAxis/getLabelTransform.d.mts +11 -0
  71. package/ChartsRadiusAxis/getLabelTransform.d.ts +11 -0
  72. package/ChartsRadiusAxis/getLabelTransform.js +37 -0
  73. package/ChartsRadiusAxis/getLabelTransform.mjs +31 -0
  74. package/ChartsRadiusAxis/index.d.mts +3 -0
  75. package/ChartsRadiusAxis/index.d.ts +3 -0
  76. package/ChartsRadiusAxis/index.js +19 -0
  77. package/ChartsRadiusAxis/index.mjs +2 -0
  78. package/ChartsRadiusAxis/sharedRadialAxisClasses.d.mts +21 -0
  79. package/ChartsRadiusAxis/sharedRadialAxisClasses.d.ts +21 -0
  80. package/ChartsRadiusAxis/sharedRadialAxisClasses.js +14 -0
  81. package/ChartsRadiusAxis/sharedRadialAxisClasses.mjs +6 -0
  82. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +48 -0
  83. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +48 -0
  84. package/ChartsRotationAxis/ChartsRotationAxis.js +141 -0
  85. package/ChartsRotationAxis/ChartsRotationAxis.mjs +135 -0
  86. package/ChartsRotationAxis/chartsRotationAxisClasses.d.mts +5 -0
  87. package/ChartsRotationAxis/chartsRotationAxisClasses.d.ts +5 -0
  88. package/ChartsRotationAxis/chartsRotationAxisClasses.js +29 -0
  89. package/ChartsRotationAxis/chartsRotationAxisClasses.mjs +16 -0
  90. package/ChartsRotationAxis/getLabelTransform.d.mts +11 -0
  91. package/ChartsRotationAxis/getLabelTransform.d.ts +11 -0
  92. package/ChartsRotationAxis/getLabelTransform.js +37 -0
  93. package/ChartsRotationAxis/getLabelTransform.mjs +31 -0
  94. package/ChartsRotationAxis/index.d.mts +2 -0
  95. package/ChartsRotationAxis/index.d.ts +2 -0
  96. package/ChartsRotationAxis/index.js +19 -0
  97. package/ChartsRotationAxis/index.mjs +2 -0
  98. package/ChartsTooltip/useAxesTooltip.js +7 -4
  99. package/ChartsTooltip/useAxesTooltip.mjs +8 -5
  100. package/ChartsTooltip/useItemTooltip.d.mts +1 -1
  101. package/ChartsTooltip/useItemTooltip.d.ts +1 -1
  102. package/ChartsTooltip/useItemTooltip.js +17 -2
  103. package/ChartsTooltip/useItemTooltip.mjs +18 -3
  104. package/ChartsXAxis/useAxisTicksProps.d.mts +652 -490
  105. package/ChartsXAxis/useAxisTicksProps.d.ts +652 -490
  106. package/ChartsYAxis/useAxisTicksProps.d.mts +652 -490
  107. package/ChartsYAxis/useAxisTicksProps.d.ts +652 -490
  108. package/LineChart/LineChart.js +27 -9
  109. package/LineChart/LineChart.mjs +27 -9
  110. package/LineChart/seriesConfig/curveEvaluation.js +24 -19
  111. package/LineChart/seriesConfig/curveEvaluation.mjs +24 -19
  112. package/LineChart/seriesConfig/getItemAtPosition.js +14 -3
  113. package/LineChart/seriesConfig/getItemAtPosition.mjs +14 -3
  114. package/LineChart/seriesConfig/getSeriesWithDefaultValues.js +4 -6
  115. package/LineChart/seriesConfig/getSeriesWithDefaultValues.mjs +4 -6
  116. package/LineChart/seriesConfig/seriesProcessor.d.mts +4 -2
  117. package/LineChart/seriesConfig/seriesProcessor.d.ts +4 -2
  118. package/LineChart/seriesConfig/seriesProcessor.js +39 -15
  119. package/LineChart/seriesConfig/seriesProcessor.mjs +39 -15
  120. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.mts +2 -2
  121. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
  122. package/ScatterChart/Scatter.d.mts +11 -0
  123. package/ScatterChart/Scatter.d.ts +11 -0
  124. package/ScatterChart/Scatter.js +11 -0
  125. package/ScatterChart/Scatter.mjs +14 -0
  126. package/ScatterChart/ScatterChart.js +29 -10
  127. package/ScatterChart/ScatterChart.mjs +29 -10
  128. package/ScatterChart/seriesConfig/seriesProcessor.js +9 -4
  129. package/ScatterChart/seriesConfig/seriesProcessor.mjs +9 -4
  130. package/SparkLineChart/SparkLineChart.js +27 -9
  131. package/SparkLineChart/SparkLineChart.mjs +27 -9
  132. package/hooks/useAxis.d.mts +2 -2
  133. package/hooks/useAxis.d.ts +2 -2
  134. package/hooks/useTicks.d.mts +1 -1
  135. package/hooks/useTicks.d.ts +1 -1
  136. package/hooks/useTicks.js +21 -3
  137. package/hooks/useTicks.mjs +21 -3
  138. package/index.d.mts +4 -0
  139. package/index.d.ts +4 -0
  140. package/index.js +46 -2
  141. package/index.mjs +5 -1
  142. package/internals/cubiqSolver.d.mts +5 -0
  143. package/internals/cubiqSolver.d.ts +5 -0
  144. package/internals/cubiqSolver.js +62 -0
  145. package/internals/cubiqSolver.mjs +56 -0
  146. package/internals/index.d.mts +5 -1
  147. package/internals/index.d.ts +5 -1
  148. package/internals/index.js +47 -2
  149. package/internals/index.mjs +5 -1
  150. package/internals/isPolar.d.mts +3 -2
  151. package/internals/isPolar.d.ts +3 -2
  152. package/internals/isPolar.js +4 -0
  153. package/internals/isPolar.mjs +3 -0
  154. package/internals/material/index.js +6 -1
  155. package/internals/material/index.mjs +6 -1
  156. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +8 -9
  157. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +8 -9
  158. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +8 -12
  159. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +8 -12
  160. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +1 -0
  161. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +1 -0
  162. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.mts +3 -2
  163. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.d.ts +3 -2
  164. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +29 -16
  165. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +30 -17
  166. package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.js +3 -3
  167. package/internals/plugins/featurePlugins/useChartPolarAxis/defaultizeAxis.mjs +3 -3
  168. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +2 -2
  169. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
  170. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +3 -3
  171. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.mjs +3 -3
  172. package/models/axis.d.mts +13 -2
  173. package/models/axis.d.ts +13 -2
  174. package/models/seriesType/bar.d.mts +21 -7
  175. package/models/seriesType/bar.d.ts +21 -7
  176. package/models/seriesType/common.d.mts +10 -0
  177. package/models/seriesType/common.d.ts +10 -0
  178. package/models/seriesType/composition.d.mts +3 -1
  179. package/models/seriesType/composition.d.ts +3 -1
  180. package/models/seriesType/composition.js +6 -2
  181. package/models/seriesType/composition.mjs +5 -1
  182. package/models/seriesType/index.d.mts +3 -3
  183. package/models/seriesType/index.d.ts +3 -3
  184. package/models/seriesType/index.js +0 -22
  185. package/models/seriesType/index.mjs +0 -2
  186. package/models/seriesType/line.d.mts +22 -8
  187. package/models/seriesType/line.d.ts +22 -8
  188. package/models/seriesType/scatter.d.mts +9 -0
  189. package/models/seriesType/scatter.d.ts +9 -0
  190. package/models/slots/chartsBaseSlotProps.d.mts +17 -0
  191. package/models/slots/chartsBaseSlotProps.d.ts +17 -0
  192. package/models/slots/chartsBaseSlots.d.mts +7 -1
  193. package/models/slots/chartsBaseSlots.d.ts +7 -1
  194. package/models/z-axis.d.mts +9 -0
  195. package/models/z-axis.d.ts +9 -0
  196. package/package.json +182 -126
  197. package/themeAugmentation/components.d.mts +4 -0
  198. package/themeAugmentation/components.d.ts +4 -0
  199. package/themeAugmentation/overrides.d.mts +2 -0
  200. package/themeAugmentation/overrides.d.ts +2 -0
  201. package/themeAugmentation/props.d.mts +2 -0
  202. package/themeAugmentation/props.d.ts +2 -0
  203. package/utils/epsilon.d.mts +1 -0
  204. package/utils/epsilon.d.ts +1 -0
  205. package/utils/epsilon.js +7 -0
  206. package/utils/epsilon.mjs +1 -0
@@ -1,6 +1,7 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { StackOffsetType } from "../stacking.mjs";
3
- import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId, type StackableSeriesType } from "./common.mjs";
3
+ import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from "./common.mjs";
4
+ import { type DatasetElementType } from "./config.mjs";
4
5
  import { type CurveType } from "../curve.mjs";
5
6
  export interface ShowMarkParams<AxisValue = number | Date> {
6
7
  /**
@@ -25,8 +26,10 @@ export interface ShowMarkParams<AxisValue = number | Date> {
25
26
  value: number;
26
27
  }
27
28
  export type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
28
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType {
29
- type: 'line';
29
+ /**
30
+ * @internal The series type shared by the line and radialLine charts
31
+ */
32
+ export interface CommonLineSeriesType {
30
33
  /**
31
34
  * Data associated to the line.
32
35
  */
@@ -35,6 +38,14 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
35
38
  * The key used to retrieve data from the dataset.
36
39
  */
37
40
  dataKey?: string;
41
+ /**
42
+ * A function to extract and transform the value from the `dataset` item.
43
+ * It receives the full dataset item and should return the series value.
44
+ * Can be used as an alternative to `dataKey`.
45
+ * @param {DatasetElementType<unknown>} item The full dataset item.
46
+ * @returns {number | null} The transformed value.
47
+ */
48
+ valueGetter?: (item: DatasetElementType<unknown>) => number | null;
38
49
  /**
39
50
  * If `true`, the series is rendered as an area instead of a line.
40
51
  */
@@ -77,11 +88,6 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
77
88
  * @default false
78
89
  */
79
90
  connectNulls?: boolean;
80
- /**
81
- * Defines how stacked series handle negative values.
82
- * @default 'none'
83
- */
84
- stackOffset?: StackOffsetType;
85
91
  /**
86
92
  * The value of the line at the base of the series area.
87
93
  *
@@ -93,6 +99,14 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
93
99
  */
94
100
  baseline?: number | 'min' | 'max';
95
101
  }
102
+ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
103
+ type: 'line';
104
+ /**
105
+ * Defines how stacked series handle negative values.
106
+ * @default 'none'
107
+ */
108
+ stackOffset?: StackOffsetType;
109
+ }
96
110
  /**
97
111
  * An object that allows to identify a single line.
98
112
  * Used for item interaction
@@ -1,6 +1,7 @@
1
1
  import { type DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { StackOffsetType } from "../stacking.js";
3
- import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId, type StackableSeriesType } from "./common.js";
3
+ import type { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from "./common.js";
4
+ import { type DatasetElementType } from "./config.js";
4
5
  import { type CurveType } from "../curve.js";
5
6
  export interface ShowMarkParams<AxisValue = number | Date> {
6
7
  /**
@@ -25,8 +26,10 @@ export interface ShowMarkParams<AxisValue = number | Date> {
25
26
  value: number;
26
27
  }
27
28
  export type MarkShape = 'circle' | 'cross' | 'diamond' | 'square' | 'star' | 'triangle' | 'wye';
28
- export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType {
29
- type: 'line';
29
+ /**
30
+ * @internal The series type shared by the line and radialLine charts
31
+ */
32
+ export interface CommonLineSeriesType {
30
33
  /**
31
34
  * Data associated to the line.
32
35
  */
@@ -35,6 +38,14 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
35
38
  * The key used to retrieve data from the dataset.
36
39
  */
37
40
  dataKey?: string;
41
+ /**
42
+ * A function to extract and transform the value from the `dataset` item.
43
+ * It receives the full dataset item and should return the series value.
44
+ * Can be used as an alternative to `dataKey`.
45
+ * @param {DatasetElementType<unknown>} item The full dataset item.
46
+ * @returns {number | null} The transformed value.
47
+ */
48
+ valueGetter?: (item: DatasetElementType<unknown>) => number | null;
38
49
  /**
39
50
  * If `true`, the series is rendered as an area instead of a line.
40
51
  */
@@ -77,11 +88,6 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
77
88
  * @default false
78
89
  */
79
90
  connectNulls?: boolean;
80
- /**
81
- * Defines how stacked series handle negative values.
82
- * @default 'none'
83
- */
84
- stackOffset?: StackOffsetType;
85
91
  /**
86
92
  * The value of the line at the base of the series area.
87
93
  *
@@ -93,6 +99,14 @@ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>,
93
99
  */
94
100
  baseline?: number | 'min' | 'max';
95
101
  }
102
+ export interface LineSeriesType extends CommonSeriesType<number | null, 'line'>, CartesianSeriesType, StackableSeriesType, CommonLineSeriesType {
103
+ type: 'line';
104
+ /**
105
+ * Defines how stacked series handle negative values.
106
+ * @default 'none'
107
+ */
108
+ stackOffset?: StackOffsetType;
109
+ }
96
110
  /**
97
111
  * An object that allows to identify a single line.
98
112
  * Used for item interaction
@@ -1,5 +1,6 @@
1
1
  import { type DefaultizedProps, type MakeRequired } from '@mui/x-internals/types';
2
2
  import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId } from "./common.mjs";
3
+ import { type DatasetElementType } from "./config.mjs";
3
4
  export type ScatterValueType = {
4
5
  x: number;
5
6
  y: number;
@@ -24,6 +25,14 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
24
25
  * The id of the z-axis used to render the series.
25
26
  */
26
27
  zAxisId?: string;
28
+ /**
29
+ * A function to extract and transform the value from the `dataset` item.
30
+ * It receives the full dataset item and should return a scatter value.
31
+ * Can be used as an alternative to `datasetKeys`.
32
+ * @param {DatasetElementType<unknown>} item The full dataset item.
33
+ * @returns {ScatterValueType} The transformed value.
34
+ */
35
+ valueGetter?: (item: DatasetElementType<unknown>) => ScatterValueType;
27
36
  /**
28
37
  * The keys used to retrieve data from the dataset.
29
38
  *
@@ -1,5 +1,6 @@
1
1
  import { type DefaultizedProps, type MakeRequired } from '@mui/x-internals/types';
2
2
  import { type CartesianSeriesType, type CommonDefaultizedProps, type CommonSeriesType, type SeriesId } from "./common.js";
3
+ import { type DatasetElementType } from "./config.js";
3
4
  export type ScatterValueType = {
4
5
  x: number;
5
6
  y: number;
@@ -24,6 +25,14 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
24
25
  * The id of the z-axis used to render the series.
25
26
  */
26
27
  zAxisId?: string;
28
+ /**
29
+ * A function to extract and transform the value from the `dataset` item.
30
+ * It receives the full dataset item and should return a scatter value.
31
+ * Can be used as an alternative to `datasetKeys`.
32
+ * @param {DatasetElementType<unknown>} item The full dataset item.
33
+ * @returns {ScatterValueType} The transformed value.
34
+ */
35
+ valueGetter?: (item: DatasetElementType<unknown>) => ScatterValueType;
27
36
  /**
28
37
  * The keys used to retrieve data from the dataset.
29
38
  *
@@ -14,6 +14,7 @@ export type ChartBaseButtonProps = ChartBaseCommonProps & {
14
14
  id?: string;
15
15
  disabled?: boolean;
16
16
  tabIndex?: number;
17
+ size?: 'small' | 'medium' | 'large';
17
18
  };
18
19
  export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
19
20
  ref?: React.Ref<HTMLButtonElement>;
@@ -21,4 +22,20 @@ export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
21
22
  disabled?: boolean;
22
23
  tabIndex?: number;
23
24
  size?: 'small' | 'medium' | 'large';
25
+ };
26
+ export type ChartBaseToggleButtonProps = ChartBaseCommonProps & {
27
+ ref?: React.Ref<HTMLButtonElement>;
28
+ id?: string;
29
+ disabled?: boolean;
30
+ tabIndex?: number;
31
+ size?: 'small' | 'medium' | 'large';
32
+ selected?: boolean;
33
+ value: unknown;
34
+ };
35
+ export type ChartBaseToggleButtonGroupProps = ChartBaseCommonProps<HTMLDivElement> & {
36
+ ref?: React.Ref<HTMLDivElement>;
37
+ value?: unknown;
38
+ exclusive?: boolean;
39
+ size?: 'small' | 'medium' | 'large';
40
+ onChange?: (event: React.MouseEvent<HTMLElement>, value: unknown) => void;
24
41
  };
@@ -14,6 +14,7 @@ export type ChartBaseButtonProps = ChartBaseCommonProps & {
14
14
  id?: string;
15
15
  disabled?: boolean;
16
16
  tabIndex?: number;
17
+ size?: 'small' | 'medium' | 'large';
17
18
  };
18
19
  export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
19
20
  ref?: React.Ref<HTMLButtonElement>;
@@ -21,4 +22,20 @@ export type ChartBaseIconButtonProps = ChartBaseCommonProps & {
21
22
  disabled?: boolean;
22
23
  tabIndex?: number;
23
24
  size?: 'small' | 'medium' | 'large';
25
+ };
26
+ export type ChartBaseToggleButtonProps = ChartBaseCommonProps & {
27
+ ref?: React.Ref<HTMLButtonElement>;
28
+ id?: string;
29
+ disabled?: boolean;
30
+ tabIndex?: number;
31
+ size?: 'small' | 'medium' | 'large';
32
+ selected?: boolean;
33
+ value: unknown;
34
+ };
35
+ export type ChartBaseToggleButtonGroupProps = ChartBaseCommonProps<HTMLDivElement> & {
36
+ ref?: React.Ref<HTMLDivElement>;
37
+ value?: unknown;
38
+ exclusive?: boolean;
39
+ size?: 'small' | 'medium' | 'large';
40
+ onChange?: (event: React.MouseEvent<HTMLElement>, value: unknown) => void;
24
41
  };
@@ -1,6 +1,12 @@
1
1
  import type * as React from 'react';
2
- import { type ChartBaseButtonProps, type ChartBaseIconButtonProps } from "./chartsBaseSlotProps.mjs";
2
+ import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.mjs";
3
3
  export interface ChartsBaseSlots {
4
4
  baseButton: React.ComponentType<ChartBaseButtonProps>;
5
5
  baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
6
+ /**
7
+ * Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
8
+ * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
9
+ */
10
+ baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
11
+ baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
6
12
  }
@@ -1,6 +1,12 @@
1
1
  import type * as React from 'react';
2
- import { type ChartBaseButtonProps, type ChartBaseIconButtonProps } from "./chartsBaseSlotProps.js";
2
+ import { type ChartBaseButtonProps, type ChartBaseIconButtonProps, type ChartBaseToggleButtonProps, type ChartBaseToggleButtonGroupProps } from "./chartsBaseSlotProps.js";
3
3
  export interface ChartsBaseSlots {
4
4
  baseButton: React.ComponentType<ChartBaseButtonProps>;
5
5
  baseIconButton: React.ComponentType<ChartBaseIconButtonProps>;
6
+ /**
7
+ * Note: MUI's `ToggleButton` has an incompatible `href` prop, so it must be cast:
8
+ * `ToggleButton as unknown as React.ComponentType<ChartBaseToggleButtonProps>`.
9
+ */
10
+ baseToggleButton: React.ComponentType<ChartBaseToggleButtonProps>;
11
+ baseToggleButtonGroup: React.ComponentType<ChartBaseToggleButtonGroupProps>;
6
12
  }
@@ -1,5 +1,6 @@
1
1
  import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { type ContinuousColorConfig, type OrdinalColorConfig, type PiecewiseColorConfig } from "./colorMapping.mjs";
3
+ import { type DatasetElementType } from "./seriesType/config.mjs";
3
4
  export interface ZAxisConfig<V = any> {
4
5
  id: string;
5
6
  data?: readonly V[];
@@ -7,6 +8,14 @@ export interface ZAxisConfig<V = any> {
7
8
  * The key used to retrieve `data` from the `dataset` prop.
8
9
  */
9
10
  dataKey?: string;
11
+ /**
12
+ * A function to extract and transform the value from the `dataset` item.
13
+ * It receives the full dataset item and should return the axis value.
14
+ * Can be used as an alternative to `dataKey`.
15
+ * @param {DatasetElementType<unknown>} item The full dataset item.
16
+ * @returns {V} The transformed value.
17
+ */
18
+ valueGetter?: (item: DatasetElementType<unknown>) => V;
10
19
  /**
11
20
  * The minimal value of the scale.
12
21
  */
@@ -1,5 +1,6 @@
1
1
  import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { type ContinuousColorConfig, type OrdinalColorConfig, type PiecewiseColorConfig } from "./colorMapping.js";
3
+ import { type DatasetElementType } from "./seriesType/config.js";
3
4
  export interface ZAxisConfig<V = any> {
4
5
  id: string;
5
6
  data?: readonly V[];
@@ -7,6 +8,14 @@ export interface ZAxisConfig<V = any> {
7
8
  * The key used to retrieve `data` from the `dataset` prop.
8
9
  */
9
10
  dataKey?: string;
11
+ /**
12
+ * A function to extract and transform the value from the `dataset` item.
13
+ * It receives the full dataset item and should return the axis value.
14
+ * Can be used as an alternative to `dataKey`.
15
+ * @param {DatasetElementType<unknown>} item The full dataset item.
16
+ * @returns {V} The transformed value.
17
+ */
18
+ valueGetter?: (item: DatasetElementType<unknown>) => V;
10
19
  /**
11
20
  * The minimal value of the scale.
12
21
  */