@mui/x-charts 8.11.0 → 8.11.1

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,80 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.11.1
9
+
10
+ _Sep 4, 2025_
11
+
12
+ We'd like to extend a big thank you to the 6 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ Special thanks go out to the community members for their valuable contributions:
15
+ @sai6855
16
+
17
+ The following are all team members who have contributed to this release:
18
+ @brijeshb42, @flaviendelangle, @JCQuintas, @mapache-salvaje, @oliviertassinari
19
+
20
+ ### Data Grid
21
+
22
+ #### `@mui/x-data-grid@8.11.1`
23
+
24
+ - [DataGrid] Refine types in `GridCell` component (#19384) @sai6855
25
+
26
+ #### `@mui/x-data-grid-pro@8.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
27
+
28
+ Same changes as in `@mui/x-data-grid@8.11.1`.
29
+
30
+ #### `@mui/x-data-grid-premium@8.11.1` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
31
+
32
+ Same changes as in `@mui/x-data-grid-pro@8.11.1`.
33
+
34
+ ### Date and Time Pickers
35
+
36
+ #### `@mui/x-date-pickers@8.11.1`
37
+
38
+ - [pickers] Merge `slotProps` for input adornment in `PickerFieldUI` component (#19399) @sai6855
39
+
40
+ #### `@mui/x-date-pickers-pro@8.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
41
+
42
+ Same changes as in `@mui/x-date-pickers@8.11.1`.
43
+
44
+ ### Charts
45
+
46
+ #### `@mui/x-charts@8.11.1`
47
+
48
+ - [charts] Prevent crash and warn user on incorrect `axisId` when composing (#19397) @JCQuintas
49
+
50
+ #### `@mui/x-charts-pro@8.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
51
+
52
+ Same changes as in `@mui/x-charts@8.11.1`.
53
+
54
+ ### Tree View
55
+
56
+ #### `@mui/x-tree-view@8.11.1`
57
+
58
+ - [tree view] Expose the methods to manually refetch the children of an item (#19248) @flaviendelangle
59
+ - [tree view] Use the shared store implementation instead of the custom one (#19261) @flaviendelangle
60
+
61
+ #### `@mui/x-tree-view-pro@8.11.1` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
62
+
63
+ Same changes as in `@mui/x-tree-view@8.11.1`.
64
+
65
+ ### Codemod
66
+
67
+ #### `@mui/x-codemod@8.11.1`
68
+
69
+ Internal changes.
70
+
71
+ ### Docs
72
+
73
+ - [docs] Fix grammar and spelling mistakes on the Date and Time Pickers pages (#19300) @mapache-salvaje
74
+ - [docs] Remove wrong legend info (#19383) @JCQuintas
75
+
76
+ ### Core
77
+
78
+ - [internal] Fix action alert (#19388) @oliviertassinari
79
+ - [internal] Fix pnpm valelint to have 0 errors @oliviertassinari
80
+ - [infra] Remove "main" fields from publishable packages (#19407) @brijeshb42
81
+
8
82
  ## 8.11.0
9
83
 
10
84
  _Aug 29, 2025_
@@ -9,7 +9,7 @@ import { ChartsXAxisProps } from "../models/axis.js";
9
9
  *
10
10
  * - [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/)
11
11
  */
12
- declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element;
12
+ declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsXAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -10,6 +10,7 @@ exports.ChartsXAxis = ChartsXAxis;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _warning = require("@mui/x-internals/warning");
13
14
  var _useAxis = require("../hooks/useAxis");
14
15
  var _ChartsSingleXAxis = require("./ChartsSingleXAxis");
15
16
  var _ChartsGroupedXAxis = require("./ChartsGroupedXAxis");
@@ -28,6 +29,10 @@ var _jsxRuntime = require("react/jsx-runtime");
28
29
  xAxisIds
29
30
  } = (0, _useAxis.useXAxes)();
30
31
  const axis = xAxis[inProps.axisId ?? xAxisIds[0]];
32
+ if (!axis) {
33
+ (0, _warning.warnOnce)(`MUI X Charts: No axis found. The axisId "${inProps.axisId}" is probably invalid.`);
34
+ return null;
35
+ }
31
36
  if ('groups' in axis && Array.isArray(axis.groups)) {
32
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGroupedXAxis.ChartsGroupedXAxis, (0, _extends2.default)({}, inProps));
33
38
  }
@@ -3446,7 +3446,7 @@ export declare const useAxisProps: (inProps: ChartsXAxisProps) => {
3446
3446
  strokeMiterlimit?: number | string | undefined | undefined;
3447
3447
  strokeOpacity?: number | string | undefined | undefined;
3448
3448
  strokeWidth?: number | string | undefined | undefined;
3449
- textAnchor?: string | undefined | undefined;
3449
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3450
3450
  vectorEffect?: number | string | undefined | undefined;
3451
3451
  key?: import("react").Key | null | undefined;
3452
3452
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -3937,7 +3937,7 @@ export declare const useAxisProps: (inProps: ChartsXAxisProps) => {
3937
3937
  strokeMiterlimit?: number | string | undefined | undefined;
3938
3938
  strokeOpacity?: number | string | undefined | undefined;
3939
3939
  strokeWidth?: number | string | undefined | undefined;
3940
- textAnchor?: string | undefined | undefined;
3940
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3941
3941
  vectorEffect?: number | string | undefined | undefined;
3942
3942
  key?: import("react").Key | null | undefined;
3943
3943
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -9,7 +9,7 @@ import { ChartsYAxisProps } from "../models/axis.js";
9
9
  *
10
10
  * - [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/)
11
11
  */
12
- declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element;
12
+ declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsYAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -10,6 +10,7 @@ exports.ChartsYAxis = ChartsYAxis;
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
+ var _warning = require("@mui/x-internals/warning");
13
14
  var _useAxis = require("../hooks/useAxis");
14
15
  var _ChartsSingleYAxis = require("./ChartsSingleYAxis");
15
16
  var _ChartsGroupedYAxis = require("./ChartsGroupedYAxis");
@@ -28,6 +29,10 @@ var _jsxRuntime = require("react/jsx-runtime");
28
29
  yAxisIds
29
30
  } = (0, _useAxis.useYAxes)();
30
31
  const axis = yAxis[inProps.axisId ?? yAxisIds[0]];
32
+ if (!axis) {
33
+ (0, _warning.warnOnce)(`MUI X Charts: No axis found. The axisId "${inProps.axisId}" is probably invalid.`);
34
+ return null;
35
+ }
31
36
  if ('groups' in axis && Array.isArray(axis.groups)) {
32
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGroupedYAxis.ChartsGroupedYAxis, (0, _extends2.default)({}, inProps));
33
38
  }
@@ -3365,7 +3365,7 @@ export declare const useAxisProps: (inProps: ChartsYAxisProps) => {
3365
3365
  strokeMiterlimit?: number | string | undefined | undefined;
3366
3366
  strokeOpacity?: number | string | undefined | undefined;
3367
3367
  strokeWidth?: number | string | undefined | undefined;
3368
- textAnchor?: string | undefined | undefined;
3368
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3369
3369
  vectorEffect?: number | string | undefined | undefined;
3370
3370
  key?: import("react").Key | null | undefined;
3371
3371
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -3856,7 +3856,7 @@ export declare const useAxisProps: (inProps: ChartsYAxisProps) => {
3856
3856
  strokeMiterlimit?: number | string | undefined | undefined;
3857
3857
  strokeOpacity?: number | string | undefined | undefined;
3858
3858
  strokeWidth?: number | string | undefined | undefined;
3859
- textAnchor?: string | undefined | undefined;
3859
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3860
3860
  vectorEffect?: number | string | undefined | undefined;
3861
3861
  key?: import("react").Key | null | undefined;
3862
3862
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -12,11 +12,11 @@ export interface RadarAxisProps extends UseRadarAxisParams {
12
12
  /**
13
13
  * The labels text anchor or a function returning the text anchor for a given axis angle (in degree).
14
14
  */
15
- textAnchor?: string | ((angle: number) => string);
15
+ textAnchor?: React.SVGProps<SVGTextElement>['textAnchor'] | ((angle: number) => React.SVGProps<SVGTextElement>['textAnchor']);
16
16
  /**
17
17
  * The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree).
18
18
  */
19
- dominantBaseline?: string | ((angle: number) => string);
19
+ dominantBaseline?: React.SVGProps<SVGTextElement>['dominantBaseline'] | ((angle: number) => React.SVGProps<SVGTextElement>['dominantBaseline']);
20
20
  /**
21
21
  * Override or extend the styles applied to the component.
22
22
  */
@@ -81,7 +81,7 @@ process.env.NODE_ENV !== "production" ? RadarAxis.propTypes = {
81
81
  /**
82
82
  * The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree).
83
83
  */
84
- dominantBaseline: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
84
+ dominantBaseline: _propTypes.default.oneOfType([_propTypes.default.oneOf(['alphabetic', 'auto', 'central', 'hanging', 'ideographic', 'inherit', 'mathematical', 'middle', 'no-change', 'reset-size', 'text-after-edge', 'text-before-edge', 'use-script']), _propTypes.default.func]),
85
85
  /**
86
86
  * Defines how label align with the axis.
87
87
  * - 'horizontal': labels stay horizontal and their placement change with the axis angle.
@@ -97,5 +97,5 @@ process.env.NODE_ENV !== "production" ? RadarAxis.propTypes = {
97
97
  /**
98
98
  * The labels text anchor or a function returning the text anchor for a given axis angle (in degree).
99
99
  */
100
- textAnchor: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string])
100
+ textAnchor: _propTypes.default.oneOfType([_propTypes.default.oneOf(['end', 'inherit', 'middle', 'start']), _propTypes.default.func])
101
101
  } : void 0;
@@ -7,14 +7,14 @@ interface GetLabelAttributesParams extends Required<Pick<RadarAxisProps, 'labelO
7
7
  export declare function getLabelAttributes(params: GetLabelAttributesParams): {
8
8
  x: number;
9
9
  y: number;
10
- textAnchor: string;
11
- dominantBaseline: string;
10
+ textAnchor: "inherit" | "end" | "start" | "middle" | undefined;
11
+ dominantBaseline: "inherit" | "auto" | "middle" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "text-before-edge" | "central" | "text-after-edge" | "use-script" | "no-change" | "reset-size" | undefined;
12
12
  transform?: undefined;
13
13
  } | {
14
14
  x: number;
15
15
  y: number;
16
- textAnchor: string;
17
- dominantBaseline: string;
16
+ textAnchor: "inherit" | "end" | "start" | "middle" | undefined;
17
+ dominantBaseline: "inherit" | "auto" | "middle" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "text-before-edge" | "central" | "text-after-edge" | "use-script" | "no-change" | "reset-size" | undefined;
18
18
  transform: string;
19
19
  };
20
20
  export {};
@@ -25,12 +25,12 @@ function getTextAnchor(angle) {
25
25
  }
26
26
  function getDominantBaseline(angle) {
27
27
  if (angle < 160) {
28
- return 'baseline';
28
+ return 'auto';
29
29
  }
30
30
  if (angle < 360 - 20) {
31
31
  return 'hanging';
32
32
  }
33
- return 'baseline';
33
+ return 'auto';
34
34
  }
35
35
  const LABEL_MARGIN = 2;
36
36
  function getLabelAttributes(params) {
@@ -43,7 +43,7 @@ function getLabelAttributes(params) {
43
43
  const textAnchor = typeof params.textAnchor === 'function' ? params.textAnchor(angle) : params.textAnchor ?? getTextAnchor(angle);
44
44
  const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? getDominantBaseline(angle);
45
45
  const marginX = textAnchor === 'start' ? LABEL_MARGIN : -LABEL_MARGIN;
46
- const marginY = dominantBaseline === 'baseline' ? -LABEL_MARGIN : LABEL_MARGIN;
46
+ const marginY = dominantBaseline === 'auto' ? -LABEL_MARGIN : LABEL_MARGIN;
47
47
  return {
48
48
  x: x + marginX,
49
49
  y: y + marginY,
@@ -55,7 +55,7 @@ function getLabelAttributes(params) {
55
55
  // orientation='rotated'
56
56
 
57
57
  const textAnchor = typeof params.textAnchor === 'function' ? params.textAnchor(angle) : params.textAnchor ?? 'start';
58
- const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? 'baseline';
58
+ const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? 'auto';
59
59
  return {
60
60
  x,
61
61
  y,
@@ -9,7 +9,7 @@ import { ChartsXAxisProps } from "../models/axis.js";
9
9
  *
10
10
  * - [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/)
11
11
  */
12
- declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element;
12
+ declare function ChartsXAxis(inProps: ChartsXAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsXAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { warnOnce } from '@mui/x-internals/warning';
6
7
  import { useXAxes } from "../hooks/useAxis.js";
7
8
  import { ChartsSingleXAxis } from "./ChartsSingleXAxis.js";
8
9
  import { ChartsGroupedXAxis } from "./ChartsGroupedXAxis.js";
@@ -23,6 +24,10 @@ function ChartsXAxis(inProps) {
23
24
  xAxisIds
24
25
  } = useXAxes();
25
26
  const axis = xAxis[inProps.axisId ?? xAxisIds[0]];
27
+ if (!axis) {
28
+ warnOnce(`MUI X Charts: No axis found. The axisId "${inProps.axisId}" is probably invalid.`);
29
+ return null;
30
+ }
26
31
  if ('groups' in axis && Array.isArray(axis.groups)) {
27
32
  return /*#__PURE__*/_jsx(ChartsGroupedXAxis, _extends({}, inProps));
28
33
  }
@@ -3446,7 +3446,7 @@ export declare const useAxisProps: (inProps: ChartsXAxisProps) => {
3446
3446
  strokeMiterlimit?: number | string | undefined | undefined;
3447
3447
  strokeOpacity?: number | string | undefined | undefined;
3448
3448
  strokeWidth?: number | string | undefined | undefined;
3449
- textAnchor?: string | undefined | undefined;
3449
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3450
3450
  vectorEffect?: number | string | undefined | undefined;
3451
3451
  key?: import("react").Key | null | undefined;
3452
3452
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -3937,7 +3937,7 @@ export declare const useAxisProps: (inProps: ChartsXAxisProps) => {
3937
3937
  strokeMiterlimit?: number | string | undefined | undefined;
3938
3938
  strokeOpacity?: number | string | undefined | undefined;
3939
3939
  strokeWidth?: number | string | undefined | undefined;
3940
- textAnchor?: string | undefined | undefined;
3940
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3941
3941
  vectorEffect?: number | string | undefined | undefined;
3942
3942
  key?: import("react").Key | null | undefined;
3943
3943
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -9,7 +9,7 @@ import { ChartsYAxisProps } from "../models/axis.js";
9
9
  *
10
10
  * - [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/)
11
11
  */
12
- declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element;
12
+ declare function ChartsYAxis(inProps: ChartsYAxisProps): React.JSX.Element | null;
13
13
  declare namespace ChartsYAxis {
14
14
  var propTypes: any;
15
15
  }
@@ -3,6 +3,7 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
+ import { warnOnce } from '@mui/x-internals/warning';
6
7
  import { useYAxes } from "../hooks/useAxis.js";
7
8
  import { ChartsSingleYAxis } from "./ChartsSingleYAxis.js";
8
9
  import { ChartsGroupedYAxis } from "./ChartsGroupedYAxis.js";
@@ -23,6 +24,10 @@ function ChartsYAxis(inProps) {
23
24
  yAxisIds
24
25
  } = useYAxes();
25
26
  const axis = yAxis[inProps.axisId ?? yAxisIds[0]];
27
+ if (!axis) {
28
+ warnOnce(`MUI X Charts: No axis found. The axisId "${inProps.axisId}" is probably invalid.`);
29
+ return null;
30
+ }
26
31
  if ('groups' in axis && Array.isArray(axis.groups)) {
27
32
  return /*#__PURE__*/_jsx(ChartsGroupedYAxis, _extends({}, inProps));
28
33
  }
@@ -3365,7 +3365,7 @@ export declare const useAxisProps: (inProps: ChartsYAxisProps) => {
3365
3365
  strokeMiterlimit?: number | string | undefined | undefined;
3366
3366
  strokeOpacity?: number | string | undefined | undefined;
3367
3367
  strokeWidth?: number | string | undefined | undefined;
3368
- textAnchor?: string | undefined | undefined;
3368
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3369
3369
  vectorEffect?: number | string | undefined | undefined;
3370
3370
  key?: import("react").Key | null | undefined;
3371
3371
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -3856,7 +3856,7 @@ export declare const useAxisProps: (inProps: ChartsYAxisProps) => {
3856
3856
  strokeMiterlimit?: number | string | undefined | undefined;
3857
3857
  strokeOpacity?: number | string | undefined | undefined;
3858
3858
  strokeWidth?: number | string | undefined | undefined;
3859
- textAnchor?: string | undefined | undefined;
3859
+ textAnchor?: "start" | "middle" | "end" | "inherit" | undefined | undefined;
3860
3860
  vectorEffect?: number | string | undefined | undefined;
3861
3861
  key?: import("react").Key | null | undefined;
3862
3862
  suppressHydrationWarning?: boolean | undefined | undefined;
@@ -12,11 +12,11 @@ export interface RadarAxisProps extends UseRadarAxisParams {
12
12
  /**
13
13
  * The labels text anchor or a function returning the text anchor for a given axis angle (in degree).
14
14
  */
15
- textAnchor?: string | ((angle: number) => string);
15
+ textAnchor?: React.SVGProps<SVGTextElement>['textAnchor'] | ((angle: number) => React.SVGProps<SVGTextElement>['textAnchor']);
16
16
  /**
17
17
  * The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree).
18
18
  */
19
- dominantBaseline?: string | ((angle: number) => string);
19
+ dominantBaseline?: React.SVGProps<SVGTextElement>['dominantBaseline'] | ((angle: number) => React.SVGProps<SVGTextElement>['dominantBaseline']);
20
20
  /**
21
21
  * Override or extend the styles applied to the component.
22
22
  */
@@ -73,7 +73,7 @@ process.env.NODE_ENV !== "production" ? RadarAxis.propTypes = {
73
73
  /**
74
74
  * The labels dominant baseline or a function returning the dominant baseline for a given axis angle (in degree).
75
75
  */
76
- dominantBaseline: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
76
+ dominantBaseline: PropTypes.oneOfType([PropTypes.oneOf(['alphabetic', 'auto', 'central', 'hanging', 'ideographic', 'inherit', 'mathematical', 'middle', 'no-change', 'reset-size', 'text-after-edge', 'text-before-edge', 'use-script']), PropTypes.func]),
77
77
  /**
78
78
  * Defines how label align with the axis.
79
79
  * - 'horizontal': labels stay horizontal and their placement change with the axis angle.
@@ -89,6 +89,6 @@ process.env.NODE_ENV !== "production" ? RadarAxis.propTypes = {
89
89
  /**
90
90
  * The labels text anchor or a function returning the text anchor for a given axis angle (in degree).
91
91
  */
92
- textAnchor: PropTypes.oneOfType([PropTypes.func, PropTypes.string])
92
+ textAnchor: PropTypes.oneOfType([PropTypes.oneOf(['end', 'inherit', 'middle', 'start']), PropTypes.func])
93
93
  } : void 0;
94
94
  export { RadarAxis };
@@ -7,14 +7,14 @@ interface GetLabelAttributesParams extends Required<Pick<RadarAxisProps, 'labelO
7
7
  export declare function getLabelAttributes(params: GetLabelAttributesParams): {
8
8
  x: number;
9
9
  y: number;
10
- textAnchor: string;
11
- dominantBaseline: string;
10
+ textAnchor: "inherit" | "end" | "start" | "middle" | undefined;
11
+ dominantBaseline: "inherit" | "auto" | "middle" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "text-before-edge" | "central" | "text-after-edge" | "use-script" | "no-change" | "reset-size" | undefined;
12
12
  transform?: undefined;
13
13
  } | {
14
14
  x: number;
15
15
  y: number;
16
- textAnchor: string;
17
- dominantBaseline: string;
16
+ textAnchor: "inherit" | "end" | "start" | "middle" | undefined;
17
+ dominantBaseline: "inherit" | "auto" | "middle" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "text-before-edge" | "central" | "text-after-edge" | "use-script" | "no-change" | "reset-size" | undefined;
18
18
  transform: string;
19
19
  };
20
20
  export {};
@@ -19,12 +19,12 @@ function getTextAnchor(angle) {
19
19
  }
20
20
  function getDominantBaseline(angle) {
21
21
  if (angle < 160) {
22
- return 'baseline';
22
+ return 'auto';
23
23
  }
24
24
  if (angle < 360 - 20) {
25
25
  return 'hanging';
26
26
  }
27
- return 'baseline';
27
+ return 'auto';
28
28
  }
29
29
  const LABEL_MARGIN = 2;
30
30
  export function getLabelAttributes(params) {
@@ -37,7 +37,7 @@ export function getLabelAttributes(params) {
37
37
  const textAnchor = typeof params.textAnchor === 'function' ? params.textAnchor(angle) : params.textAnchor ?? getTextAnchor(angle);
38
38
  const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? getDominantBaseline(angle);
39
39
  const marginX = textAnchor === 'start' ? LABEL_MARGIN : -LABEL_MARGIN;
40
- const marginY = dominantBaseline === 'baseline' ? -LABEL_MARGIN : LABEL_MARGIN;
40
+ const marginY = dominantBaseline === 'auto' ? -LABEL_MARGIN : LABEL_MARGIN;
41
41
  return {
42
42
  x: x + marginX,
43
43
  y: y + marginY,
@@ -49,7 +49,7 @@ export function getLabelAttributes(params) {
49
49
  // orientation='rotated'
50
50
 
51
51
  const textAnchor = typeof params.textAnchor === 'function' ? params.textAnchor(angle) : params.textAnchor ?? 'start';
52
- const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? 'baseline';
52
+ const dominantBaseline = typeof params.dominantBaseline === 'function' ? params.dominantBaseline(angle) : params.dominantBaseline ?? 'auto';
53
53
  return {
54
54
  x,
55
55
  y,
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.11.0
2
+ * @mui/x-charts v8.11.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,4 +1,5 @@
1
1
  export type ChartsTextBaseline = 'hanging' | 'central' | 'auto' | 'text-after-edge' | 'text-before-edge';
2
+ export type ChartsTextAnchor = 'start' | 'middle' | 'end';
2
3
  export interface ChartsTextStyle extends React.CSSProperties {
3
4
  angle?: number;
4
5
  /**
@@ -6,6 +7,11 @@ export interface ChartsTextStyle extends React.CSSProperties {
6
7
  * @default 'central'
7
8
  */
8
9
  dominantBaseline?: ChartsTextBaseline;
10
+ /**
11
+ * The text anchor
12
+ * @default 'middle'
13
+ */
14
+ textAnchor?: ChartsTextAnchor;
9
15
  }
10
16
  export interface GetWordsByLinesParams {
11
17
  /**
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.11.0
2
+ * @mui/x-charts v8.11.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,4 +1,5 @@
1
1
  export type ChartsTextBaseline = 'hanging' | 'central' | 'auto' | 'text-after-edge' | 'text-before-edge';
2
+ export type ChartsTextAnchor = 'start' | 'middle' | 'end';
2
3
  export interface ChartsTextStyle extends React.CSSProperties {
3
4
  angle?: number;
4
5
  /**
@@ -6,6 +7,11 @@ export interface ChartsTextStyle extends React.CSSProperties {
6
7
  * @default 'central'
7
8
  */
8
9
  dominantBaseline?: ChartsTextBaseline;
10
+ /**
11
+ * The text anchor
12
+ * @default 'middle'
13
+ */
14
+ textAnchor?: ChartsTextAnchor;
9
15
  }
10
16
  export interface GetWordsByLinesParams {
11
17
  /**
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "8.11.0",
3
+ "version": "8.11.1",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
- "main": "./index.js",
7
6
  "license": "MIT",
8
7
  "bugs": {
9
8
  "url": "https://github.com/mui/mui-x/issues"
@@ -35,9 +34,9 @@
35
34
  "prop-types": "^15.8.1",
36
35
  "reselect": "^5.1.1",
37
36
  "use-sync-external-store": "^1.5.0",
38
- "@mui/x-charts-vendor": "8.11.0",
39
37
  "@mui/x-internal-gestures": "0.2.5",
40
- "@mui/x-internals": "8.11.0"
38
+ "@mui/x-charts-vendor": "8.11.0",
39
+ "@mui/x-internals": "8.11.1"
41
40
  },
42
41
  "peerDependencies": {
43
42
  "@emotion/react": "^11.9.0",
@@ -59,27 +58,28 @@
59
58
  "node": ">=14.0.0"
60
59
  },
61
60
  "type": "commonjs",
61
+ "main": "./index.js",
62
62
  "types": "./index.d.ts",
63
63
  "exports": {
64
64
  "./package.json": "./package.json",
65
65
  ".": {
66
- "import": {
67
- "types": "./esm/index.d.ts",
68
- "default": "./esm/index.js"
69
- },
70
66
  "require": {
71
67
  "types": "./index.d.ts",
72
68
  "default": "./index.js"
69
+ },
70
+ "default": {
71
+ "types": "./esm/index.d.ts",
72
+ "default": "./esm/index.js"
73
73
  }
74
74
  },
75
75
  "./*": {
76
- "import": {
77
- "types": "./esm/*/index.d.ts",
78
- "default": "./esm/*/index.js"
79
- },
80
76
  "require": {
81
77
  "types": "./*/index.d.ts",
82
78
  "default": "./*/index.js"
79
+ },
80
+ "default": {
81
+ "types": "./esm/*/index.d.ts",
82
+ "default": "./esm/*/index.js"
83
83
  }
84
84
  },
85
85
  "./esm": null