@mui/x-charts 8.10.2 → 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.
Files changed (92) hide show
  1. package/BarChart/BarChart.js +0 -36
  2. package/CHANGELOG.md +214 -13
  3. package/ChartContainer/ChartContainer.js +0 -56
  4. package/ChartsLabel/labelGradientClasses.d.ts +1 -1
  5. package/ChartsLabel/labelMarkClasses.d.ts +1 -1
  6. package/ChartsOverlay/ChartsOverlay.js +11 -1
  7. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  8. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  9. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  10. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
  11. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  12. package/ChartsXAxis/ChartsXAxis.js +5 -10
  13. package/ChartsXAxis/useAxisProps.d.ts +11 -173
  14. package/ChartsXAxis/utilities.d.ts +1 -1
  15. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  16. package/ChartsYAxis/ChartsYAxis.js +5 -10
  17. package/ChartsYAxis/useAxisProps.d.ts +11 -173
  18. package/ChartsYAxis/utilities.d.ts +1 -1
  19. package/LineChart/LineChart.js +0 -36
  20. package/PieChart/PieChart.js +2 -2
  21. package/RadarChart/RadarAxis/RadarAxis.d.ts +29 -0
  22. package/RadarChart/RadarAxis/RadarAxis.js +101 -0
  23. package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +20 -0
  24. package/RadarChart/RadarAxis/RadarAxis.utils.js +66 -0
  25. package/RadarChart/RadarAxis/index.d.ts +3 -0
  26. package/RadarChart/RadarAxis/index.js +39 -0
  27. package/RadarChart/RadarAxis/radarAxisClasses.d.ts +12 -0
  28. package/RadarChart/RadarAxis/radarAxisClasses.js +25 -0
  29. package/RadarChart/RadarAxis/useRadarAxis.d.ts +34 -0
  30. package/RadarChart/RadarAxis/useRadarAxis.js +82 -0
  31. package/RadarChart/RadarGrid/useRadarGridData.js +8 -5
  32. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +1 -1
  33. package/RadarChart/index.d.ts +1 -0
  34. package/RadarChart/index.js +12 -0
  35. package/ScatterChart/ScatterChart.js +0 -36
  36. package/SparkLineChart/SparkLineChart.js +0 -36
  37. package/esm/BarChart/BarChart.js +0 -36
  38. package/esm/ChartContainer/ChartContainer.js +0 -56
  39. package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
  40. package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
  41. package/esm/ChartsOverlay/ChartsOverlay.js +11 -1
  42. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  43. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  44. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  45. package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
  46. package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  47. package/esm/ChartsXAxis/ChartsXAxis.js +5 -10
  48. package/esm/ChartsXAxis/useAxisProps.d.ts +11 -173
  49. package/esm/ChartsXAxis/utilities.d.ts +1 -1
  50. package/esm/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  51. package/esm/ChartsYAxis/ChartsYAxis.js +5 -10
  52. package/esm/ChartsYAxis/useAxisProps.d.ts +11 -173
  53. package/esm/ChartsYAxis/utilities.d.ts +1 -1
  54. package/esm/LineChart/LineChart.js +0 -36
  55. package/esm/PieChart/PieChart.js +2 -2
  56. package/esm/RadarChart/RadarAxis/RadarAxis.d.ts +29 -0
  57. package/esm/RadarChart/RadarAxis/RadarAxis.js +94 -0
  58. package/esm/RadarChart/RadarAxis/RadarAxis.utils.d.ts +20 -0
  59. package/esm/RadarChart/RadarAxis/RadarAxis.utils.js +60 -0
  60. package/esm/RadarChart/RadarAxis/index.d.ts +3 -0
  61. package/esm/RadarChart/RadarAxis/index.js +3 -0
  62. package/esm/RadarChart/RadarAxis/radarAxisClasses.d.ts +12 -0
  63. package/esm/RadarChart/RadarAxis/radarAxisClasses.js +15 -0
  64. package/esm/RadarChart/RadarAxis/useRadarAxis.d.ts +34 -0
  65. package/esm/RadarChart/RadarAxis/useRadarAxis.js +76 -0
  66. package/esm/RadarChart/RadarGrid/useRadarGridData.js +8 -5
  67. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +1 -1
  68. package/esm/RadarChart/index.d.ts +1 -0
  69. package/esm/RadarChart/index.js +1 -0
  70. package/esm/ScatterChart/ScatterChart.js +0 -36
  71. package/esm/SparkLineChart/SparkLineChart.js +0 -36
  72. package/esm/hooks/animation/useAnimatePieArcLabel.js +2 -2
  73. package/esm/hooks/useInteractionItemProps.d.ts +5 -5
  74. package/esm/hooks/useInteractionItemProps.js +6 -20
  75. package/esm/index.js +1 -1
  76. package/esm/internals/getWordsByLines.d.ts +6 -0
  77. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +3 -3
  78. package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +3 -3
  79. package/esm/models/axis.d.ts +0 -10
  80. package/esm/models/seriesType/config.d.ts +6 -0
  81. package/esm/models/seriesType/index.d.ts +1 -0
  82. package/hooks/animation/useAnimatePieArcLabel.js +2 -2
  83. package/hooks/useInteractionItemProps.d.ts +5 -5
  84. package/hooks/useInteractionItemProps.js +6 -20
  85. package/index.js +1 -1
  86. package/internals/getWordsByLines.d.ts +6 -0
  87. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +3 -3
  88. package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +3 -3
  89. package/models/axis.d.ts +0 -10
  90. package/models/seriesType/config.d.ts +6 -0
  91. package/models/seriesType/index.d.ts +1 -0
  92. package/package.json +13 -13
@@ -14,25 +14,14 @@ export const useInteractionItemProps = (data, skip) => {
14
14
  const interactionActive = React.useRef(false);
15
15
  const onPointerEnter = React.useCallback(() => {
16
16
  interactionActive.current = true;
17
- instance.setItemInteraction({
18
- type: data.type,
19
- seriesId: data.seriesId,
20
- dataIndex: data.dataIndex
21
- });
22
- instance.setHighlight({
23
- seriesId: data.seriesId,
24
- dataIndex: data.dataIndex
25
- });
26
- }, [instance, data.type, data.seriesId, data.dataIndex]);
17
+ instance.setItemInteraction(data);
18
+ instance.setHighlight(data);
19
+ }, [instance, data]);
27
20
  const onPointerLeave = React.useCallback(() => {
28
21
  interactionActive.current = false;
29
- instance.removeItemInteraction({
30
- type: data.type,
31
- seriesId: data.seriesId,
32
- dataIndex: data.dataIndex
33
- });
22
+ instance.removeItemInteraction(data);
34
23
  instance.clearHighlight();
35
- }, [instance, data.type, data.seriesId, data.dataIndex]);
24
+ }, [instance, data]);
36
25
  React.useEffect(() => {
37
26
  return () => {
38
27
  /* Clean up state if this item is unmounted while active. */
@@ -67,10 +56,7 @@ export function getInteractionItemProps(instance, item) {
67
56
  return;
68
57
  }
69
58
  instance.setItemInteraction(item);
70
- instance.setHighlight({
71
- seriesId: item.seriesId,
72
- dataIndex: item.dataIndex
73
- });
59
+ instance.setHighlight(item);
74
60
  }
75
61
  function onPointerLeave() {
76
62
  if (!item) {
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.10.2
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
  /**
@@ -1,5 +1,5 @@
1
1
  import { ChartPluginSignature } from "../../models/index.js";
2
- import { ChartItemIdentifier, ChartSeriesType } from "../../../../models/seriesType/config.js";
2
+ import { ChartItemIdentifier, ChartSeriesType, type ChartItemIdentifierWithData } from "../../../../models/seriesType/config.js";
3
3
  export type Coordinate = {
4
4
  x: number;
5
5
  y: number;
@@ -13,7 +13,7 @@ export interface UseChartInteractionInstance {
13
13
  * Setter for the item the user is interacting with.
14
14
  * @param {ChartItemIdentifier} newItem The identifier of the item.
15
15
  */
16
- setItemInteraction: (newItem: ChartItemIdentifier<ChartSeriesType>) => void;
16
+ setItemInteraction: (newItem: ChartItemIdentifierWithData<ChartSeriesType>) => void;
17
17
  /**
18
18
  * Remove item interaction if the current if the provided item is still the one interacting.
19
19
  * @param {ChartItemIdentifier} itemToRemove The identifier of the item.
@@ -30,7 +30,7 @@ export interface UseChartInteractionState {
30
30
  /**
31
31
  * The item currently interacting.
32
32
  */
33
- item: null | ChartItemIdentifier<ChartSeriesType>;
33
+ item: null | ChartItemIdentifierWithData<ChartSeriesType>;
34
34
  /**
35
35
  * The x/y SVG coordinate of the "main" pointer
36
36
  */
@@ -1,4 +1,4 @@
1
- import type { ChartItemIdentifier, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
1
+ import type { ChartItemIdentifierWithData, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
2
2
  import { SeriesId } from "../../../../models/seriesType/common.js";
3
3
  import { AxisId, ChartsRotationAxisProps, ChartsRadiusAxisProps, PolarAxisDefaultized, ComputedXAxis, ComputedYAxis } from "../../../../models/axis.js";
4
4
  import { ChartsLabelMarkProps } from "../../../../ChartsLabel/ChartsLabelMark.js";
@@ -7,7 +7,7 @@ export interface ItemTooltip<T extends ChartSeriesType> {
7
7
  /**
8
8
  * An object that identifies the item to display.
9
9
  */
10
- identifier: ChartItemIdentifier<T>;
10
+ identifier: ChartItemIdentifierWithData<T>;
11
11
  /**
12
12
  * The color associated with the item.
13
13
  */
@@ -59,7 +59,7 @@ export type TooltipGetter<TSeriesType extends ChartSeriesType> = (params: {
59
59
  series: ChartSeriesDefaultized<TSeriesType>;
60
60
  axesConfig: TooltipGetterAxesConfig;
61
61
  getColor: ColorGetter<TSeriesType>;
62
- identifier: ChartItemIdentifier<TSeriesType> | null;
62
+ identifier: ChartItemIdentifierWithData<TSeriesType> | null;
63
63
  }) => (TSeriesType extends 'radar' ? ItemTooltipWithMultipleValues<TSeriesType> : ItemTooltip<TSeriesType>) | null;
64
64
  /**
65
65
  * If `axisId` is set to undefined, the default axis will be used.
@@ -55,11 +55,6 @@ export interface ChartsAxisProps extends TickParams {
55
55
  * @default false
56
56
  */
57
57
  disableTicks?: boolean;
58
- /**
59
- * The fill color of the axis text.
60
- * @default 'currentColor'
61
- */
62
- fill?: string;
63
58
  /**
64
59
  * The style applied to ticks text.
65
60
  */
@@ -79,11 +74,6 @@ export interface ChartsAxisProps extends TickParams {
79
74
  * The label of the axis.
80
75
  */
81
76
  label?: string;
82
- /**
83
- * The stroke color of the axis line.
84
- * @default 'currentColor'
85
- */
86
- stroke?: string;
87
77
  /**
88
78
  * The size of the ticks.
89
79
  * @default 6
@@ -21,6 +21,7 @@ export interface ChartsSeriesConfig {
21
21
  */
22
22
  seriesProp: BarSeriesType;
23
23
  itemIdentifier: BarItemIdentifier;
24
+ itemIdentifierWithData: BarItemIdentifier;
24
25
  valueType: number | null;
25
26
  canBeStacked: true;
26
27
  axisType: 'cartesian';
@@ -32,6 +33,7 @@ export interface ChartsSeriesConfig {
32
33
  series: DefaultizedLineSeriesType;
33
34
  seriesProp: LineSeriesType;
34
35
  itemIdentifier: LineItemIdentifier;
36
+ itemIdentifierWithData: LineItemIdentifier;
35
37
  valueType: number | null;
36
38
  canBeStacked: true;
37
39
  axisType: 'cartesian';
@@ -44,6 +46,7 @@ export interface ChartsSeriesConfig {
44
46
  seriesProp: ScatterSeriesType;
45
47
  valueType: ScatterValueType;
46
48
  itemIdentifier: ScatterItemIdentifier;
49
+ itemIdentifierWithData: ScatterItemIdentifier;
47
50
  axisType: 'cartesian';
48
51
  };
49
52
  pie: {
@@ -55,6 +58,7 @@ export interface ChartsSeriesConfig {
55
58
  series: DefaultizedPieSeriesType;
56
59
  seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
57
60
  itemIdentifier: PieItemIdentifier;
61
+ itemIdentifierWithData: PieItemIdentifier;
58
62
  valueType: DefaultizedPieValueType;
59
63
  };
60
64
  radar: {
@@ -64,6 +68,7 @@ export interface ChartsSeriesConfig {
64
68
  series: DefaultizedRadarSeriesType;
65
69
  seriesProp: RadarSeriesType;
66
70
  itemIdentifier: RadarItemIdentifier;
71
+ itemIdentifierWithData: RadarItemIdentifier;
67
72
  valueType: number;
68
73
  axisType: 'polar';
69
74
  };
@@ -85,6 +90,7 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
85
90
  stackedData: [number, number][];
86
91
  } : ChartsSeriesConfig[T]['series'];
87
92
  export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
93
+ export type ChartItemIdentifierWithData<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
88
94
  export type DatasetElementType<T> = {
89
95
  [key: string]: Readonly<T>;
90
96
  };
@@ -18,6 +18,7 @@ type DefaultizedCartesianSeriesType = DefaultizedSeriesType<CartesianChartSeries
18
18
  */
19
19
  type StackableSeriesType = DefaultizedSeriesType<StackableChartSeriesType>;
20
20
  export type SeriesItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
21
+ export type SeriesItemIdentifierWithData<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
21
22
  export * from "./line.js";
22
23
  export * from "./bar.js";
23
24
  export * from "./scatter.js";
@@ -41,8 +41,8 @@ function useAnimatePieArcLabel(props) {
41
41
  return (0, _useAnimate.useAnimate)({
42
42
  startAngle: props.startAngle,
43
43
  endAngle: props.endAngle,
44
- innerRadius: props?.arcLabelRadius ?? props.innerRadius,
45
- outerRadius: props?.arcLabelRadius ?? props.outerRadius,
44
+ innerRadius: props.arcLabelRadius ?? props.innerRadius,
45
+ outerRadius: props.arcLabelRadius ?? props.outerRadius,
46
46
  paddingAngle: props.paddingAngle,
47
47
  cornerRadius: props.cornerRadius
48
48
  }, {
@@ -1,20 +1,20 @@
1
1
  import * as React from 'react';
2
- import { SeriesItemIdentifier } from "../models/index.js";
2
+ import { SeriesItemIdentifierWithData } from "../models/index.js";
3
3
  import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
4
4
  import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
5
- import { ChartItemIdentifier, ChartSeriesType } from "../models/seriesType/config.js";
5
+ import { ChartSeriesType, type ChartItemIdentifierWithData } from "../models/seriesType/config.js";
6
6
  import { ChartInstance } from "../internals/plugins/models/index.js";
7
- export declare const useInteractionItemProps: (data: SeriesItemIdentifier, skip?: boolean) => {
7
+ export declare const useInteractionItemProps: (data: SeriesItemIdentifierWithData, skip?: boolean) => {
8
8
  onPointerEnter?: () => void;
9
9
  onPointerLeave?: () => void;
10
10
  onPointerDown?: (event: React.PointerEvent) => void;
11
11
  };
12
- export declare const useInteractionAllItemProps: (data: SeriesItemIdentifier[], skip?: boolean) => {
12
+ export declare const useInteractionAllItemProps: (data: SeriesItemIdentifierWithData[], skip?: boolean) => {
13
13
  onPointerEnter?: () => void;
14
14
  onPointerLeave?: () => void;
15
15
  onPointerDown?: (event: React.PointerEvent) => void;
16
16
  }[];
17
- export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item: ChartItemIdentifier<ChartSeriesType>): {
17
+ export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item: ChartItemIdentifierWithData<ChartSeriesType>): {
18
18
  onPointerEnter?: () => void;
19
19
  onPointerLeave?: () => void;
20
20
  onPointerDown?: (event: React.PointerEvent) => void;
@@ -21,25 +21,14 @@ const useInteractionItemProps = (data, skip) => {
21
21
  const interactionActive = React.useRef(false);
22
22
  const onPointerEnter = React.useCallback(() => {
23
23
  interactionActive.current = true;
24
- instance.setItemInteraction({
25
- type: data.type,
26
- seriesId: data.seriesId,
27
- dataIndex: data.dataIndex
28
- });
29
- instance.setHighlight({
30
- seriesId: data.seriesId,
31
- dataIndex: data.dataIndex
32
- });
33
- }, [instance, data.type, data.seriesId, data.dataIndex]);
24
+ instance.setItemInteraction(data);
25
+ instance.setHighlight(data);
26
+ }, [instance, data]);
34
27
  const onPointerLeave = React.useCallback(() => {
35
28
  interactionActive.current = false;
36
- instance.removeItemInteraction({
37
- type: data.type,
38
- seriesId: data.seriesId,
39
- dataIndex: data.dataIndex
40
- });
29
+ instance.removeItemInteraction(data);
41
30
  instance.clearHighlight();
42
- }, [instance, data.type, data.seriesId, data.dataIndex]);
31
+ }, [instance, data]);
43
32
  React.useEffect(() => {
44
33
  return () => {
45
34
  /* Clean up state if this item is unmounted while active. */
@@ -76,10 +65,7 @@ function getInteractionItemProps(instance, item) {
76
65
  return;
77
66
  }
78
67
  instance.setItemInteraction(item);
79
- instance.setHighlight({
80
- seriesId: item.seriesId,
81
- dataIndex: item.dataIndex
82
- });
68
+ instance.setHighlight(item);
83
69
  }
84
70
  function onPointerLeave() {
85
71
  if (!item) {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v8.10.2
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
  /**
@@ -1,5 +1,5 @@
1
1
  import { ChartPluginSignature } from "../../models/index.js";
2
- import { ChartItemIdentifier, ChartSeriesType } from "../../../../models/seriesType/config.js";
2
+ import { ChartItemIdentifier, ChartSeriesType, type ChartItemIdentifierWithData } from "../../../../models/seriesType/config.js";
3
3
  export type Coordinate = {
4
4
  x: number;
5
5
  y: number;
@@ -13,7 +13,7 @@ export interface UseChartInteractionInstance {
13
13
  * Setter for the item the user is interacting with.
14
14
  * @param {ChartItemIdentifier} newItem The identifier of the item.
15
15
  */
16
- setItemInteraction: (newItem: ChartItemIdentifier<ChartSeriesType>) => void;
16
+ setItemInteraction: (newItem: ChartItemIdentifierWithData<ChartSeriesType>) => void;
17
17
  /**
18
18
  * Remove item interaction if the current if the provided item is still the one interacting.
19
19
  * @param {ChartItemIdentifier} itemToRemove The identifier of the item.
@@ -30,7 +30,7 @@ export interface UseChartInteractionState {
30
30
  /**
31
31
  * The item currently interacting.
32
32
  */
33
- item: null | ChartItemIdentifier<ChartSeriesType>;
33
+ item: null | ChartItemIdentifierWithData<ChartSeriesType>;
34
34
  /**
35
35
  * The x/y SVG coordinate of the "main" pointer
36
36
  */
@@ -1,4 +1,4 @@
1
- import type { ChartItemIdentifier, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
1
+ import type { ChartItemIdentifierWithData, ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig } from "../../../../models/seriesType/config.js";
2
2
  import { SeriesId } from "../../../../models/seriesType/common.js";
3
3
  import { AxisId, ChartsRotationAxisProps, ChartsRadiusAxisProps, PolarAxisDefaultized, ComputedXAxis, ComputedYAxis } from "../../../../models/axis.js";
4
4
  import { ChartsLabelMarkProps } from "../../../../ChartsLabel/ChartsLabelMark.js";
@@ -7,7 +7,7 @@ export interface ItemTooltip<T extends ChartSeriesType> {
7
7
  /**
8
8
  * An object that identifies the item to display.
9
9
  */
10
- identifier: ChartItemIdentifier<T>;
10
+ identifier: ChartItemIdentifierWithData<T>;
11
11
  /**
12
12
  * The color associated with the item.
13
13
  */
@@ -59,7 +59,7 @@ export type TooltipGetter<TSeriesType extends ChartSeriesType> = (params: {
59
59
  series: ChartSeriesDefaultized<TSeriesType>;
60
60
  axesConfig: TooltipGetterAxesConfig;
61
61
  getColor: ColorGetter<TSeriesType>;
62
- identifier: ChartItemIdentifier<TSeriesType> | null;
62
+ identifier: ChartItemIdentifierWithData<TSeriesType> | null;
63
63
  }) => (TSeriesType extends 'radar' ? ItemTooltipWithMultipleValues<TSeriesType> : ItemTooltip<TSeriesType>) | null;
64
64
  /**
65
65
  * If `axisId` is set to undefined, the default axis will be used.
package/models/axis.d.ts CHANGED
@@ -55,11 +55,6 @@ export interface ChartsAxisProps extends TickParams {
55
55
  * @default false
56
56
  */
57
57
  disableTicks?: boolean;
58
- /**
59
- * The fill color of the axis text.
60
- * @default 'currentColor'
61
- */
62
- fill?: string;
63
58
  /**
64
59
  * The style applied to ticks text.
65
60
  */
@@ -79,11 +74,6 @@ export interface ChartsAxisProps extends TickParams {
79
74
  * The label of the axis.
80
75
  */
81
76
  label?: string;
82
- /**
83
- * The stroke color of the axis line.
84
- * @default 'currentColor'
85
- */
86
- stroke?: string;
87
77
  /**
88
78
  * The size of the ticks.
89
79
  * @default 6
@@ -21,6 +21,7 @@ export interface ChartsSeriesConfig {
21
21
  */
22
22
  seriesProp: BarSeriesType;
23
23
  itemIdentifier: BarItemIdentifier;
24
+ itemIdentifierWithData: BarItemIdentifier;
24
25
  valueType: number | null;
25
26
  canBeStacked: true;
26
27
  axisType: 'cartesian';
@@ -32,6 +33,7 @@ export interface ChartsSeriesConfig {
32
33
  series: DefaultizedLineSeriesType;
33
34
  seriesProp: LineSeriesType;
34
35
  itemIdentifier: LineItemIdentifier;
36
+ itemIdentifierWithData: LineItemIdentifier;
35
37
  valueType: number | null;
36
38
  canBeStacked: true;
37
39
  axisType: 'cartesian';
@@ -44,6 +46,7 @@ export interface ChartsSeriesConfig {
44
46
  seriesProp: ScatterSeriesType;
45
47
  valueType: ScatterValueType;
46
48
  itemIdentifier: ScatterItemIdentifier;
49
+ itemIdentifierWithData: ScatterItemIdentifier;
47
50
  axisType: 'cartesian';
48
51
  };
49
52
  pie: {
@@ -55,6 +58,7 @@ export interface ChartsSeriesConfig {
55
58
  series: DefaultizedPieSeriesType;
56
59
  seriesProp: PieSeriesType<MakeOptional<PieValueType, 'id'>>;
57
60
  itemIdentifier: PieItemIdentifier;
61
+ itemIdentifierWithData: PieItemIdentifier;
58
62
  valueType: DefaultizedPieValueType;
59
63
  };
60
64
  radar: {
@@ -64,6 +68,7 @@ export interface ChartsSeriesConfig {
64
68
  series: DefaultizedRadarSeriesType;
65
69
  seriesProp: RadarSeriesType;
66
70
  itemIdentifier: RadarItemIdentifier;
71
+ itemIdentifierWithData: RadarItemIdentifier;
67
72
  valueType: number;
68
73
  axisType: 'polar';
69
74
  };
@@ -85,6 +90,7 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
85
90
  stackedData: [number, number][];
86
91
  } : ChartsSeriesConfig[T]['series'];
87
92
  export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
93
+ export type ChartItemIdentifierWithData<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
88
94
  export type DatasetElementType<T> = {
89
95
  [key: string]: Readonly<T>;
90
96
  };
@@ -18,6 +18,7 @@ type DefaultizedCartesianSeriesType = DefaultizedSeriesType<CartesianChartSeries
18
18
  */
19
19
  type StackableSeriesType = DefaultizedSeriesType<StackableChartSeriesType>;
20
20
  export type SeriesItemIdentifier<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
21
+ export type SeriesItemIdentifierWithData<T extends ChartSeriesType = ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifierWithData'];
21
22
  export * from "./line.js";
22
23
  export * from "./bar.js";
23
24
  export * from "./scatter.js";
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "8.10.2",
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-internals": "8.10.2",
39
- "@mui/x-charts-vendor": "8.6.0",
40
- "@mui/x-internal-gestures": "0.2.4"
37
+ "@mui/x-internal-gestures": "0.2.5",
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