@mui/x-charts 9.1.0 → 9.3.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 (132) hide show
  1. package/BarChart/BarChart.js +10 -10
  2. package/BarChart/BarChart.mjs +10 -10
  3. package/BarChart/seriesConfig/bar/getColor.js +7 -53
  4. package/BarChart/seriesConfig/bar/getColor.mjs +7 -53
  5. package/BarChart/seriesConfig/bar/seriesProcessor.js +3 -1
  6. package/BarChart/seriesConfig/bar/seriesProcessor.mjs +3 -1
  7. package/BarChart/seriesConfig/bar/tooltip.js +4 -27
  8. package/BarChart/seriesConfig/bar/tooltip.mjs +4 -27
  9. package/CHANGELOG.md +221 -0
  10. package/ChartsContainer/ChartsContainer.js +9 -9
  11. package/ChartsContainer/ChartsContainer.mjs +9 -9
  12. package/ChartsLabel/ChartsLabelMark.js +0 -2
  13. package/ChartsLabel/ChartsLabelMark.mjs +0 -2
  14. package/ChartsLabel/labelMarkClasses.d.mts +0 -1
  15. package/ChartsLabel/labelMarkClasses.d.ts +0 -1
  16. package/ChartsLabel/labelMarkClasses.js +1 -2
  17. package/ChartsLabel/labelMarkClasses.mjs +2 -2
  18. package/ChartsLayerContainer/ChartsLayerContainer.js +36 -30
  19. package/ChartsLayerContainer/ChartsLayerContainer.mjs +36 -30
  20. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.mts +1 -1
  21. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.types.d.ts +1 -1
  22. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.js +31 -14
  23. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.mjs +32 -15
  24. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -47
  25. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -47
  26. package/ChartsRadiusAxis/ChartsRadiusAxis.js +20 -16
  27. package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +21 -15
  28. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -47
  29. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -47
  30. package/ChartsRotationAxis/ChartsRotationAxis.js +16 -19
  31. package/ChartsRotationAxis/ChartsRotationAxis.mjs +17 -18
  32. package/ChartsTooltip/useAxesTooltip.d.mts +1 -1
  33. package/ChartsTooltip/useAxesTooltip.d.ts +1 -1
  34. package/ChartsTooltip/useAxesTooltip.js +11 -2
  35. package/ChartsTooltip/useAxesTooltip.mjs +12 -3
  36. package/ChartsXAxis/ChartsXAxis.js +3 -1
  37. package/ChartsXAxis/ChartsXAxis.mjs +3 -1
  38. package/ChartsYAxis/ChartsYAxis.js +3 -1
  39. package/ChartsYAxis/ChartsYAxis.mjs +3 -1
  40. package/LineChart/LineChart.js +6 -6
  41. package/LineChart/LineChart.mjs +6 -6
  42. package/LineChart/seriesConfig/curveEvaluation.js +12 -1
  43. package/LineChart/seriesConfig/curveEvaluation.mjs +12 -1
  44. package/LineChart/seriesConfig/getColor.js +7 -54
  45. package/LineChart/seriesConfig/getColor.mjs +7 -54
  46. package/LineChart/seriesConfig/seriesProcessor.d.mts +2 -4
  47. package/LineChart/seriesConfig/seriesProcessor.d.ts +2 -4
  48. package/LineChart/seriesConfig/seriesProcessor.js +2 -139
  49. package/LineChart/seriesConfig/seriesProcessor.mjs +2 -138
  50. package/LineChart/seriesConfig/tooltip.js +4 -25
  51. package/LineChart/seriesConfig/tooltip.mjs +4 -25
  52. package/PieChart/PieChart.js +6 -6
  53. package/PieChart/PieChart.mjs +6 -6
  54. package/RadarChart/RadarAxis/useRadarAxis.js +1 -1
  55. package/RadarChart/RadarAxis/useRadarAxis.mjs +1 -1
  56. package/RadarChart/RadarChart.js +8 -8
  57. package/RadarChart/RadarChart.mjs +8 -8
  58. package/RadarChart/RadarGrid/CircularRadarStripes.js +2 -3
  59. package/RadarChart/RadarGrid/CircularRadarStripes.mjs +2 -3
  60. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
  61. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
  62. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -0
  63. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +1 -0
  64. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -0
  65. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +1 -0
  66. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -1
  67. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.mjs +2 -2
  68. package/ScatterChart/ScatterChart.js +11 -11
  69. package/ScatterChart/ScatterChart.mjs +11 -11
  70. package/ScatterChart/seriesConfig/tooltip.js +2 -24
  71. package/ScatterChart/seriesConfig/tooltip.mjs +2 -24
  72. package/SparkLineChart/SparkLineChart.js +27 -27
  73. package/SparkLineChart/SparkLineChart.mjs +27 -27
  74. package/index.js +1 -1
  75. package/index.mjs +1 -1
  76. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +1 -1
  77. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +1 -1
  78. package/internals/getLineLikeTooltip.d.mts +9 -0
  79. package/internals/getLineLikeTooltip.d.ts +9 -0
  80. package/internals/getLineLikeTooltip.js +38 -0
  81. package/internals/getLineLikeTooltip.mjs +31 -0
  82. package/internals/getRingPath.d.mts +16 -0
  83. package/internals/getRingPath.d.ts +16 -0
  84. package/internals/getRingPath.js +39 -0
  85. package/internals/getRingPath.mjs +33 -0
  86. package/internals/index.d.mts +7 -2
  87. package/internals/index.d.ts +7 -2
  88. package/internals/index.js +46 -3
  89. package/internals/index.mjs +6 -2
  90. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +4 -2
  91. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +4 -2
  92. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.mts +3 -3
  93. package/internals/plugins/featurePlugins/useChartCartesianAxis/createZoomLookup.d.ts +3 -3
  94. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +1 -0
  95. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  96. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +8 -0
  97. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
  98. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.mts +6 -1
  99. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +6 -1
  100. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +48 -36
  101. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.mjs +47 -36
  102. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +74 -1
  103. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +74 -1
  104. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +152 -2
  105. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +152 -2
  106. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.mts +2 -2
  107. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +2 -2
  108. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +3 -0
  109. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.mjs +3 -0
  110. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.mts +2 -2
  111. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisExtremum.d.ts +2 -2
  112. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.mts +6 -1
  113. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.d.ts +6 -1
  114. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +36 -2
  115. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.mjs +34 -1
  116. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +1 -1
  117. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +2 -2
  118. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.mts +22 -2
  119. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +22 -2
  120. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +73 -12
  121. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.mjs +74 -12
  122. package/internals/processLineLikeSeries.d.mts +6 -0
  123. package/internals/processLineLikeSeries.d.ts +6 -0
  124. package/internals/processLineLikeSeries.js +145 -0
  125. package/internals/processLineLikeSeries.mjs +138 -0
  126. package/internals/resolveColorProcessor.d.mts +11 -0
  127. package/internals/resolveColorProcessor.d.ts +11 -0
  128. package/internals/resolveColorProcessor.js +62 -0
  129. package/internals/resolveColorProcessor.mjs +56 -0
  130. package/models/axis.d.mts +55 -7
  131. package/models/axis.d.ts +55 -7
  132. package/package.json +3 -3
package/models/axis.d.mts CHANGED
@@ -10,6 +10,7 @@ import type { ChartsTextProps } from "../ChartsText/index.mjs";
10
10
  import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.mjs";
11
11
  import type { OrdinalTimeTicks } from "./timeTicks.mjs";
12
12
  import { type ChartsTypeFeatureFlags } from "./featureFlags.mjs";
13
+ import { type ChartsRadialAxisClasses } from "../ChartsRadiusAxis/sharedRadialAxisClasses.mjs";
13
14
  export type AxisId = string | number;
14
15
  export type D3Scale<Domain extends {
15
16
  toString(): string;
@@ -139,7 +140,9 @@ export interface ChartsXAxisProps extends ChartsAxisProps {
139
140
  */
140
141
  tickLabelMinGap?: number;
141
142
  }
142
- type AxisSideConfig<AxisProps extends ChartsXAxisProps | ChartsYAxisProps> = {
143
+ export type ChartsCartesianAxisProps = ChartsXAxisProps | ChartsYAxisProps;
144
+ export type ChartsRadialAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps;
145
+ type AxisSideConfig<AxisProps extends ChartsCartesianAxisProps> = {
143
146
  /**
144
147
  * Position of the axis.
145
148
  *
@@ -177,6 +180,28 @@ export interface ChartsRotationAxisProps extends ChartsAxisProps {
177
180
  * The gap between the axis and the label.
178
181
  */
179
182
  labelGap?: number;
183
+ /**
184
+ * The position of the rotation axis.
185
+ * It can be 'inside' or 'outside'.
186
+ * @default 'outside'
187
+ */
188
+ position?: 'inside' | 'outside' | 'none';
189
+ /**
190
+ * Set the position of the tick labels relative to the axis line.
191
+ * `'after'` places them outside the arc, `'before'` inside.
192
+ * @default position === 'outside' ? 'after' : 'before'
193
+ */
194
+ tickLabelPosition?: 'after' | 'before';
195
+ /**
196
+ * Set the position of the tick relative to the axis line.
197
+ * `'after'` places them outside the arc, `'before'` inside.
198
+ * @default position === 'outside' ? 'after' : 'before'
199
+ */
200
+ tickPosition?: 'after' | 'before';
201
+ /**
202
+ * Override or extend the styles applied to the component.
203
+ */
204
+ classes?: Partial<ChartsRadialAxisClasses>;
180
205
  }
181
206
  export interface ChartsRadiusAxisProps extends ChartsAxisProps {
182
207
  axis?: 'radius';
@@ -188,6 +213,29 @@ export interface ChartsRadiusAxisProps extends ChartsAxisProps {
188
213
  * The maximal radius.
189
214
  */
190
215
  maxRadius?: number;
216
+ /**
217
+ * The position of the axis in polar coordinates.
218
+ * It can be 'start', 'end', or a specific angle in degrees.
219
+ * @default 'start'
220
+ */
221
+ position?: 'start' | 'end' | number | 'none';
222
+ /**
223
+ * Set the position of the tick labels relative to the axis line.
224
+ * The before/after is defined based on clockwise direction.
225
+ * Using `'auto'` sets it to `'before'` if position is `'start'` and `'after'` otherwise.
226
+ * @default 'auto'
227
+ */
228
+ tickLabelPosition?: 'center' | 'after' | 'before' | 'auto';
229
+ /**
230
+ * Set the position of the tick relative to the axis line.
231
+ * The before/after is defined based on clockwise direction.
232
+ * @default position === 'start' ? 'before' : 'after'
233
+ */
234
+ tickPosition?: 'after' | 'before';
235
+ /**
236
+ * Override or extend the styles applied to the component.
237
+ */
238
+ classes?: Partial<ChartsRadialAxisClasses>;
191
239
  }
192
240
  export type ScaleName = keyof AxisScaleConfig;
193
241
  export type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc';
@@ -475,7 +523,7 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
475
523
  /**
476
524
  * Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
477
525
  */
478
- export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
526
+ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRadialAxisProps = ChartsRadialAxisProps> = {
479
527
  /**
480
528
  * The offset of the axis in pixels. It can be used to move the axis from its default position.
481
529
  * X-axis: A top axis will move up, and a bottom axis will move down.
@@ -487,7 +535,7 @@ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps
487
535
  /**
488
536
  * Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
489
537
  */
490
- export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsXAxisProps | ChartsYAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
538
+ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsCartesianAxisProps = ChartsCartesianAxisProps> = {
491
539
  /**
492
540
  * The offset of the axis in pixels. It can be used to move the axis from its default position.
493
541
  * X-axis: A top axis will move up, and a bottom axis will move down.
@@ -497,13 +545,13 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps exten
497
545
  offset?: number;
498
546
  } & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
499
547
  export interface AxisConfigExtension {}
500
- export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
548
+ export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRadialAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
501
549
  /**
502
550
  * If true, the contents of the axis will be displayed by a tooltip with `trigger='axis'`.
503
551
  */
504
552
  triggerTooltip?: boolean;
505
553
  };
506
- export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = MakeRequired<Omit<DefaultedAxis<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
554
+ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsCartesianAxisProps> = AxisProps extends any ? MakeRequired<Omit<DefaultedAxis<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
507
555
  /**
508
556
  * An indication of the expected number of ticks.
509
557
  */
@@ -518,7 +566,7 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
518
566
  height: number;
519
567
  } : {}) & (AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
520
568
  width: number;
521
- } : {});
569
+ } : {}) : never;
522
570
  export type ComputedXAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsXAxisProps>;
523
571
  export type ComputedYAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsYAxisProps>;
524
572
  export declare function isBandScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'band'> & {
@@ -580,7 +628,7 @@ export type RadiusAxis<S extends ScaleName = ScaleName, V = any> = S extends Sca
580
628
  /**
581
629
  * The axis configuration with missing values filled with default values.
582
630
  */
583
- export type DefaultedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = AxisConfig<S, V, AxisProps> & {
631
+ export type DefaultedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsCartesianAxisProps> = AxisConfig<S, V, AxisProps> & {
584
632
  zoom: DefaultizedZoomOptions | undefined;
585
633
  };
586
634
  /**
package/models/axis.d.ts CHANGED
@@ -10,6 +10,7 @@ import type { ChartsTextProps } from "../ChartsText/index.js";
10
10
  import type { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
11
11
  import type { OrdinalTimeTicks } from "./timeTicks.js";
12
12
  import { type ChartsTypeFeatureFlags } from "./featureFlags.js";
13
+ import { type ChartsRadialAxisClasses } from "../ChartsRadiusAxis/sharedRadialAxisClasses.js";
13
14
  export type AxisId = string | number;
14
15
  export type D3Scale<Domain extends {
15
16
  toString(): string;
@@ -139,7 +140,9 @@ export interface ChartsXAxisProps extends ChartsAxisProps {
139
140
  */
140
141
  tickLabelMinGap?: number;
141
142
  }
142
- type AxisSideConfig<AxisProps extends ChartsXAxisProps | ChartsYAxisProps> = {
143
+ export type ChartsCartesianAxisProps = ChartsXAxisProps | ChartsYAxisProps;
144
+ export type ChartsRadialAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps;
145
+ type AxisSideConfig<AxisProps extends ChartsCartesianAxisProps> = {
143
146
  /**
144
147
  * Position of the axis.
145
148
  *
@@ -177,6 +180,28 @@ export interface ChartsRotationAxisProps extends ChartsAxisProps {
177
180
  * The gap between the axis and the label.
178
181
  */
179
182
  labelGap?: number;
183
+ /**
184
+ * The position of the rotation axis.
185
+ * It can be 'inside' or 'outside'.
186
+ * @default 'outside'
187
+ */
188
+ position?: 'inside' | 'outside' | 'none';
189
+ /**
190
+ * Set the position of the tick labels relative to the axis line.
191
+ * `'after'` places them outside the arc, `'before'` inside.
192
+ * @default position === 'outside' ? 'after' : 'before'
193
+ */
194
+ tickLabelPosition?: 'after' | 'before';
195
+ /**
196
+ * Set the position of the tick relative to the axis line.
197
+ * `'after'` places them outside the arc, `'before'` inside.
198
+ * @default position === 'outside' ? 'after' : 'before'
199
+ */
200
+ tickPosition?: 'after' | 'before';
201
+ /**
202
+ * Override or extend the styles applied to the component.
203
+ */
204
+ classes?: Partial<ChartsRadialAxisClasses>;
180
205
  }
181
206
  export interface ChartsRadiusAxisProps extends ChartsAxisProps {
182
207
  axis?: 'radius';
@@ -188,6 +213,29 @@ export interface ChartsRadiusAxisProps extends ChartsAxisProps {
188
213
  * The maximal radius.
189
214
  */
190
215
  maxRadius?: number;
216
+ /**
217
+ * The position of the axis in polar coordinates.
218
+ * It can be 'start', 'end', or a specific angle in degrees.
219
+ * @default 'start'
220
+ */
221
+ position?: 'start' | 'end' | number | 'none';
222
+ /**
223
+ * Set the position of the tick labels relative to the axis line.
224
+ * The before/after is defined based on clockwise direction.
225
+ * Using `'auto'` sets it to `'before'` if position is `'start'` and `'after'` otherwise.
226
+ * @default 'auto'
227
+ */
228
+ tickLabelPosition?: 'center' | 'after' | 'before' | 'auto';
229
+ /**
230
+ * Set the position of the tick relative to the axis line.
231
+ * The before/after is defined based on clockwise direction.
232
+ * @default position === 'start' ? 'before' : 'after'
233
+ */
234
+ tickPosition?: 'after' | 'before';
235
+ /**
236
+ * Override or extend the styles applied to the component.
237
+ */
238
+ classes?: Partial<ChartsRadialAxisClasses>;
191
239
  }
192
240
  export type ScaleName = keyof AxisScaleConfig;
193
241
  export type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc';
@@ -475,7 +523,7 @@ type CommonAxisConfig<S extends ScaleName = ScaleName, V = any> = {
475
523
  /**
476
524
  * Use this type for advanced typing. For basic usage, use `RotationAxis` or `RadiusAxis`.
477
525
  */
478
- export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRotationAxisProps | ChartsRadiusAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = {
526
+ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsRadialAxisProps = ChartsRadialAxisProps> = {
479
527
  /**
480
528
  * The offset of the axis in pixels. It can be used to move the axis from its default position.
481
529
  * X-axis: A top axis will move up, and a bottom axis will move down.
@@ -487,7 +535,7 @@ export type PolarAxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps
487
535
  /**
488
536
  * Use this type for advanced typing. For basic usage, use `XAxis` or `YAxis`.
489
537
  */
490
- export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsXAxisProps | ChartsYAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
538
+ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsCartesianAxisProps = ChartsCartesianAxisProps> = {
491
539
  /**
492
540
  * The offset of the axis in pixels. It can be used to move the axis from its default position.
493
541
  * X-axis: A top axis will move up, and a bottom axis will move down.
@@ -497,13 +545,13 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps exten
497
545
  offset?: number;
498
546
  } & CommonAxisConfig<S, V> & MinMaxConfig<S> & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
499
547
  export interface AxisConfigExtension {}
500
- export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRotationAxisProps | ChartsRadiusAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
548
+ export type PolarAxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsRadialAxisProps> = Omit<PolarAxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
501
549
  /**
502
550
  * If true, the contents of the axis will be displayed by a tooltip with `trigger='axis'`.
503
551
  */
504
552
  triggerTooltip?: boolean;
505
553
  };
506
- export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = MakeRequired<Omit<DefaultedAxis<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
554
+ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsCartesianAxisProps> = AxisProps extends any ? MakeRequired<Omit<DefaultedAxis<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
507
555
  /**
508
556
  * An indication of the expected number of ticks.
509
557
  */
@@ -518,7 +566,7 @@ export type ComputedAxis<S extends ScaleName = ScaleName, V = any, AxisProps ext
518
566
  height: number;
519
567
  } : {}) & (AxisProps extends ChartsYAxisProps ? AxisSideConfig<AxisProps> & {
520
568
  width: number;
521
- } : {});
569
+ } : {}) : never;
522
570
  export type ComputedXAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsXAxisProps>;
523
571
  export type ComputedYAxis<S extends ScaleName = ScaleName, V = any> = ComputedAxis<S, V, ChartsYAxisProps>;
524
572
  export declare function isBandScaleConfig(scaleConfig: PolarAxisConfig<ScaleName>): scaleConfig is PolarAxisConfig<'band'> & {
@@ -580,7 +628,7 @@ export type RadiusAxis<S extends ScaleName = ScaleName, V = any> = S extends Sca
580
628
  /**
581
629
  * The axis configuration with missing values filled with default values.
582
630
  */
583
- export type DefaultedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = AxisConfig<S, V, AxisProps> & {
631
+ export type DefaultedAxis<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsCartesianAxisProps> = AxisConfig<S, V, AxisProps> & {
584
632
  zoom: DefaultizedZoomOptions | undefined;
585
633
  };
586
634
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "9.1.0",
3
+ "version": "9.3.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
6
  "license": "MIT",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.29.2",
31
- "@mui/utils": "9.0.0",
31
+ "@mui/utils": "9.0.1",
32
32
  "bezier-easing": "^2.1.0",
33
33
  "clsx": "^2.1.1",
34
34
  "prop-types": "^15.8.1",
35
35
  "reselect": "^5.1.1",
36
36
  "use-sync-external-store": "^1.6.0",
37
- "@mui/x-internal-gestures": "^9.1.0",
37
+ "@mui/x-internal-gestures": "^9.3.0",
38
38
  "@mui/x-charts-vendor": "^9.0.0",
39
39
  "@mui/x-internals": "^9.1.0"
40
40
  },