@mui/x-charts 7.22.2 → 8.0.0-alpha.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 (189) hide show
  1. package/BarChart/BarChart.d.ts +7 -7
  2. package/BarChart/BarChart.js +7 -29
  3. package/BarChart/BarElement.d.ts +1 -1
  4. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  5. package/BarChart/BarPlot.js +12 -4
  6. package/BarChart/extremums.js +3 -3
  7. package/BarChart/useBarChartProps.d.ts +2 -2
  8. package/BarChart/useBarChartProps.js +3 -4
  9. package/CHANGELOG.md +142 -155
  10. package/ChartContainer/ChartContainer.d.ts +16 -33
  11. package/ChartContainer/ChartContainer.js +22 -41
  12. package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.d.ts +2 -2
  13. package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.d.ts +1 -1
  14. package/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  15. package/ChartContainer/useChartContainerProps.d.ts +11 -94
  16. package/ChartContainer/useChartContainerProps.js +42 -58
  17. package/ChartsLegend/ChartsLegend.js +0 -3
  18. package/ChartsLegend/DefaultChartsLegend.d.ts +0 -5
  19. package/ChartsLegend/DefaultChartsLegend.js +1 -12
  20. package/ChartsLegend/LegendPerItem.d.ts +1 -1
  21. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  22. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  23. package/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  24. package/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  25. package/ChartsTooltip/ChartsTooltip.js +45 -6
  26. package/ChartsTooltip/useAxisTooltip.js +3 -3
  27. package/ChartsTooltip/useItemTooltip.js +3 -3
  28. package/ChartsTooltip/utils.d.ts +5 -13
  29. package/ChartsTooltip/utils.js +45 -42
  30. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  31. package/Gauge/GaugeContainer.js +1 -1
  32. package/LineChart/AreaElement.d.ts +1 -1
  33. package/LineChart/AreaPlot.js +2 -6
  34. package/LineChart/LineChart.d.ts +7 -7
  35. package/LineChart/LineChart.js +7 -29
  36. package/LineChart/LineElement.d.ts +1 -1
  37. package/LineChart/LineHighlightPlot.d.ts +1 -1
  38. package/LineChart/LineHighlightPlot.js +2 -6
  39. package/LineChart/LinePlot.js +2 -6
  40. package/LineChart/MarkPlot.js +2 -6
  41. package/LineChart/extremums.js +10 -6
  42. package/LineChart/useLineChartProps.d.ts +2 -2
  43. package/LineChart/useLineChartProps.js +3 -4
  44. package/PieChart/PieArc.d.ts +0 -5
  45. package/PieChart/PieArc.js +1 -10
  46. package/PieChart/PieArcPlot.js +0 -5
  47. package/PieChart/PieChart.d.ts +9 -32
  48. package/PieChart/PieChart.js +17 -102
  49. package/README.md +2 -2
  50. package/ScatterChart/ScatterChart.d.ts +7 -7
  51. package/ScatterChart/ScatterChart.js +7 -29
  52. package/ScatterChart/ScatterPlot.js +3 -6
  53. package/ScatterChart/extremums.js +6 -6
  54. package/ScatterChart/useScatterChartProps.d.ts +2 -2
  55. package/ScatterChart/useScatterChartProps.js +3 -4
  56. package/SparkLineChart/SparkLineChart.d.ts +4 -4
  57. package/SparkLineChart/SparkLineChart.js +2 -2
  58. package/context/CartesianProvider/defaultizeAxis.d.ts +1 -1
  59. package/context/ChartDataProvider/ChartDataProvider.d.ts +41 -0
  60. package/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
  61. package/context/ChartDataProvider/index.d.ts +1 -0
  62. package/context/ChartDataProvider/index.js +1 -0
  63. package/context/ChartDataProvider/useChartDataProviderProps.d.ts +97 -0
  64. package/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
  65. package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.d.ts +12 -12
  66. package/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  67. package/context/HighlightedProvider/HighlightedContext.d.ts +0 -8
  68. package/context/HighlightedProvider/HighlightedProvider.js +1 -16
  69. package/context/PluginProvider/ExtremumGetter.types.d.ts +2 -2
  70. package/context/ZAxisContextProvider.d.ts +1 -1
  71. package/index.d.ts +1 -2
  72. package/index.js +2 -3
  73. package/internals/defaultizeColor.d.ts +1 -8
  74. package/internals/getSymbol.js +19 -3
  75. package/internals/index.d.ts +5 -5
  76. package/internals/index.js +5 -5
  77. package/internals/useStringInterpolator.js +1 -0
  78. package/models/seriesType/bar.d.ts +1 -1
  79. package/models/seriesType/common.d.ts +0 -10
  80. package/models/seriesType/config.d.ts +1 -1
  81. package/models/seriesType/line.d.ts +1 -1
  82. package/models/seriesType/pie.d.ts +1 -1
  83. package/models/seriesType/scatter.d.ts +1 -6
  84. package/modern/BarChart/BarChart.js +7 -29
  85. package/modern/BarChart/BarPlot.js +12 -4
  86. package/modern/BarChart/extremums.js +3 -3
  87. package/modern/BarChart/useBarChartProps.js +3 -4
  88. package/modern/ChartContainer/ChartContainer.js +22 -41
  89. package/modern/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  90. package/modern/ChartContainer/useChartContainerProps.js +42 -58
  91. package/modern/ChartsLegend/ChartsLegend.js +0 -3
  92. package/modern/ChartsLegend/DefaultChartsLegend.js +1 -12
  93. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  94. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  95. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  96. package/modern/ChartsTooltip/ChartsTooltip.js +45 -6
  97. package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
  98. package/modern/ChartsTooltip/useItemTooltip.js +3 -3
  99. package/modern/ChartsTooltip/utils.js +45 -42
  100. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  101. package/modern/Gauge/GaugeContainer.js +1 -1
  102. package/modern/LineChart/AreaPlot.js +2 -6
  103. package/modern/LineChart/LineChart.js +7 -29
  104. package/modern/LineChart/LineHighlightPlot.js +2 -6
  105. package/modern/LineChart/LinePlot.js +2 -6
  106. package/modern/LineChart/MarkPlot.js +2 -6
  107. package/modern/LineChart/extremums.js +10 -6
  108. package/modern/LineChart/useLineChartProps.js +3 -4
  109. package/modern/PieChart/PieArc.js +1 -10
  110. package/modern/PieChart/PieArcPlot.js +0 -5
  111. package/modern/PieChart/PieChart.js +17 -102
  112. package/modern/ScatterChart/ScatterChart.js +7 -29
  113. package/modern/ScatterChart/ScatterPlot.js +3 -6
  114. package/modern/ScatterChart/extremums.js +6 -6
  115. package/modern/ScatterChart/useScatterChartProps.js +3 -4
  116. package/modern/SparkLineChart/SparkLineChart.js +2 -2
  117. package/modern/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +46 -27
  118. package/modern/context/ChartDataProvider/index.js +1 -0
  119. package/modern/context/ChartDataProvider/useChartDataProviderProps.js +86 -0
  120. package/modern/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  121. package/modern/context/HighlightedProvider/HighlightedProvider.js +1 -16
  122. package/modern/index.js +2 -3
  123. package/modern/internals/getSymbol.js +19 -3
  124. package/modern/internals/index.js +5 -5
  125. package/modern/internals/useStringInterpolator.js +1 -0
  126. package/node/BarChart/BarChart.js +7 -29
  127. package/node/BarChart/BarPlot.js +11 -3
  128. package/node/BarChart/extremums.js +3 -3
  129. package/node/BarChart/useBarChartProps.js +3 -4
  130. package/node/ChartContainer/ChartContainer.js +21 -40
  131. package/node/{ResponsiveChartContainer → ChartContainer}/useChartContainerDimensions.js +6 -4
  132. package/node/ChartContainer/useChartContainerProps.js +42 -59
  133. package/node/ChartsLegend/ChartsLegend.js +0 -3
  134. package/node/ChartsLegend/DefaultChartsLegend.js +1 -12
  135. package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +2 -2
  136. package/node/ChartsTooltip/ChartsAxisTooltipContent.js +3 -3
  137. package/node/ChartsTooltip/ChartsItemTooltipContent.js +3 -3
  138. package/node/ChartsTooltip/ChartsTooltip.js +44 -5
  139. package/node/ChartsTooltip/useAxisTooltip.js +3 -3
  140. package/node/ChartsTooltip/useItemTooltip.js +3 -3
  141. package/node/ChartsTooltip/utils.js +46 -44
  142. package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -5
  143. package/node/Gauge/GaugeContainer.js +1 -1
  144. package/node/LineChart/AreaPlot.js +2 -6
  145. package/node/LineChart/LineChart.js +7 -29
  146. package/node/LineChart/LineHighlightPlot.js +2 -6
  147. package/node/LineChart/LinePlot.js +2 -6
  148. package/node/LineChart/MarkPlot.js +2 -6
  149. package/node/LineChart/extremums.js +10 -6
  150. package/node/LineChart/useLineChartProps.js +3 -4
  151. package/node/PieChart/PieArc.js +1 -10
  152. package/node/PieChart/PieArcPlot.js +0 -5
  153. package/node/PieChart/PieChart.js +17 -102
  154. package/node/ScatterChart/ScatterChart.js +7 -29
  155. package/node/ScatterChart/ScatterPlot.js +3 -6
  156. package/node/ScatterChart/extremums.js +6 -6
  157. package/node/ScatterChart/useScatterChartProps.js +3 -4
  158. package/node/SparkLineChart/SparkLineChart.js +2 -2
  159. package/node/{ResponsiveChartContainer/ResponsiveChartContainer.js → context/ChartDataProvider/ChartDataProvider.js} +45 -26
  160. package/node/context/ChartDataProvider/index.js +16 -0
  161. package/node/context/ChartDataProvider/useChartDataProviderProps.js +94 -0
  162. package/node/{ChartContainer → context/ChartDataProvider}/useDefaultizeAxis.js +1 -1
  163. package/node/context/HighlightedProvider/HighlightedProvider.js +1 -16
  164. package/node/index.js +5 -16
  165. package/node/internals/getSymbol.js +19 -3
  166. package/node/internals/index.js +37 -29
  167. package/node/internals/useStringInterpolator.js +2 -0
  168. package/package.json +4 -4
  169. package/ResponsiveChartContainer/ResponsiveChartContainer.d.ts +0 -24
  170. package/ResponsiveChartContainer/index.d.ts +0 -1
  171. package/ResponsiveChartContainer/index.js +0 -1
  172. package/ResponsiveChartContainer/package.json +0 -6
  173. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +0 -19
  174. package/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  175. package/internals/SlotComponentPropsFromProps.d.ts +0 -1
  176. package/internals/SlotComponentPropsFromProps.js +0 -1
  177. package/models/helpers.d.ts +0 -3
  178. package/models/helpers.js +0 -1
  179. package/modern/ResponsiveChartContainer/index.js +0 -1
  180. package/modern/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -70
  181. package/modern/internals/SlotComponentPropsFromProps.js +0 -1
  182. package/modern/models/helpers.js +0 -1
  183. package/node/ResponsiveChartContainer/index.js +0 -16
  184. package/node/ResponsiveChartContainer/useResponsiveChartContainerProps.js +0 -77
  185. package/node/internals/SlotComponentPropsFromProps.js +0 -5
  186. package/node/models/helpers.js +0 -5
  187. /package/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
  188. /package/modern/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
  189. /package/node/{ResponsiveChartContainer → ChartContainer}/ResizableContainer.js +0 -0
@@ -0,0 +1 @@
1
+ export * from "./ChartDataProvider.js";
@@ -0,0 +1,97 @@
1
+ import * as React from 'react';
2
+ import type { DrawingProviderProps } from '../DrawingProvider';
3
+ import type { CartesianProviderProps } from '../CartesianProvider';
4
+ import type { SeriesProviderProps } from '../SeriesProvider';
5
+ import type { ZAxisContextProviderProps } from '../ZAxisContextProvider';
6
+ import type { ChartDataProviderProps } from './ChartDataProvider';
7
+ import { HighlightedProviderProps } from '..';
8
+ import { ChartsSurfaceProps } from '../../ChartsSurface';
9
+ import { PluginProviderProps } from '../PluginProvider';
10
+ import { AnimationProviderProps } from '../AnimationProvider';
11
+ export declare const useChartDataProviderProps: (props: ChartDataProviderProps, ref: React.Ref<SVGSVGElement>) => {
12
+ children: React.ReactNode;
13
+ drawingProviderProps: Omit<DrawingProviderProps, "children">;
14
+ seriesProviderProps: Omit<SeriesProviderProps, "children">;
15
+ cartesianProviderProps: Omit<CartesianProviderProps, "children">;
16
+ zAxisContextProps: Omit<ZAxisContextProviderProps, "children">;
17
+ highlightedProviderProps: Omit<HighlightedProviderProps, "children">;
18
+ chartsSurfaceProps: ChartsSurfaceProps & {
19
+ ref: any;
20
+ };
21
+ pluginProviderProps: Omit<PluginProviderProps, "children">;
22
+ animationProviderProps: Omit<AnimationProviderProps, "children">;
23
+ xAxis: {
24
+ reverse?: boolean | undefined;
25
+ fill?: string | undefined;
26
+ stroke?: string | undefined;
27
+ data?: any[] | undefined;
28
+ label?: string | undefined;
29
+ max?: (number | Date) | undefined;
30
+ min?: (number | Date) | undefined;
31
+ valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
32
+ dataKey?: string | undefined;
33
+ sx?: import("@mui/system").SxProps | undefined;
34
+ classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
35
+ tickMaxStep?: number | undefined;
36
+ tickMinStep?: number | undefined;
37
+ tickNumber?: number | undefined;
38
+ disableLine?: boolean | undefined;
39
+ disableTicks?: boolean | undefined;
40
+ tickFontSize?: number | undefined;
41
+ tickLabelStyle?: import("../..").ChartsTextProps["style"];
42
+ labelStyle?: import("../..").ChartsTextProps["style"];
43
+ tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
44
+ labelFontSize?: number | undefined;
45
+ tickSize?: number | undefined;
46
+ slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
47
+ slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
48
+ tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
49
+ tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
50
+ tickLabelPlacement?: ("middle" | "tick") | undefined;
51
+ scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
52
+ colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
53
+ hideTooltip?: boolean | undefined;
54
+ domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
55
+ min: number;
56
+ max: number;
57
+ })) | undefined;
58
+ id: import("../../internals").AxisId;
59
+ }[];
60
+ yAxis: {
61
+ reverse?: boolean | undefined;
62
+ fill?: string | undefined;
63
+ stroke?: string | undefined;
64
+ data?: any[] | undefined;
65
+ label?: string | undefined;
66
+ max?: (number | Date) | undefined;
67
+ min?: (number | Date) | undefined;
68
+ valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
69
+ dataKey?: string | undefined;
70
+ sx?: import("@mui/system").SxProps | undefined;
71
+ classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
72
+ tickMaxStep?: number | undefined;
73
+ tickMinStep?: number | undefined;
74
+ tickNumber?: number | undefined;
75
+ disableLine?: boolean | undefined;
76
+ disableTicks?: boolean | undefined;
77
+ tickFontSize?: number | undefined;
78
+ tickLabelStyle?: import("../..").ChartsTextProps["style"];
79
+ labelStyle?: import("../..").ChartsTextProps["style"];
80
+ tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
81
+ labelFontSize?: number | undefined;
82
+ tickSize?: number | undefined;
83
+ slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
84
+ slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
85
+ tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
86
+ tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
87
+ tickLabelPlacement?: ("middle" | "tick") | undefined;
88
+ scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
89
+ colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
90
+ hideTooltip?: boolean | undefined;
91
+ domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
92
+ min: number;
93
+ max: number;
94
+ })) | undefined;
95
+ id: import("../../internals").AxisId;
96
+ }[];
97
+ };
@@ -0,0 +1,86 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
+ const _excluded = ["width", "height", "series", "margin", "xAxis", "yAxis", "zAxis", "colors", "dataset", "sx", "title", "desc", "disableAxisListener", "highlightedItem", "onHighlightChange", "plugins", "children", "skipAnimation"];
6
+ import * as React from 'react';
7
+ import useForkRef from '@mui/utils/useForkRef';
8
+ import { useDefaultizeAxis } from "./useDefaultizeAxis.js";
9
+ export const useChartDataProviderProps = (props, ref) => {
10
+ const {
11
+ width,
12
+ height,
13
+ series,
14
+ margin,
15
+ xAxis,
16
+ yAxis,
17
+ zAxis,
18
+ colors,
19
+ dataset,
20
+ sx,
21
+ title,
22
+ desc,
23
+ disableAxisListener,
24
+ highlightedItem,
25
+ onHighlightChange,
26
+ plugins,
27
+ children,
28
+ skipAnimation
29
+ } = props,
30
+ other = _objectWithoutPropertiesLoose(props, _excluded);
31
+ const svgRef = React.useRef(null);
32
+ const chartSurfaceRef = useForkRef(ref, svgRef);
33
+ const [defaultizedXAxis, defaultizedYAxis] = useDefaultizeAxis(xAxis, yAxis, dataset);
34
+ const drawingProviderProps = {
35
+ width,
36
+ height,
37
+ margin,
38
+ svgRef
39
+ };
40
+ const animationProviderProps = {
41
+ skipAnimation
42
+ };
43
+ const pluginProviderProps = {
44
+ plugins
45
+ };
46
+ const seriesProviderProps = {
47
+ series,
48
+ colors,
49
+ dataset
50
+ };
51
+ const cartesianProviderProps = {
52
+ xAxis: defaultizedXAxis,
53
+ yAxis: defaultizedYAxis,
54
+ dataset
55
+ };
56
+ const zAxisContextProps = {
57
+ zAxis,
58
+ dataset
59
+ };
60
+ const highlightedProviderProps = {
61
+ highlightedItem,
62
+ onHighlightChange
63
+ };
64
+ const chartsSurfaceProps = _extends({}, other, {
65
+ width,
66
+ height,
67
+ ref: chartSurfaceRef,
68
+ sx,
69
+ title,
70
+ desc,
71
+ disableAxisListener
72
+ });
73
+ return {
74
+ children,
75
+ drawingProviderProps,
76
+ seriesProviderProps,
77
+ cartesianProviderProps,
78
+ zAxisContextProps,
79
+ highlightedProviderProps,
80
+ chartsSurfaceProps,
81
+ pluginProviderProps,
82
+ animationProviderProps,
83
+ xAxis: defaultizedXAxis,
84
+ yAxis: defaultizedYAxis
85
+ };
86
+ };
@@ -1,7 +1,7 @@
1
- import { MakeOptional } from '../models/helpers';
2
- import { AxisConfig, ScaleName } from '../models';
3
- import { ChartsAxisProps } from '../models/axis';
4
- import { DatasetType } from '../models/seriesType/config';
1
+ import { MakeOptional } from '@mui/x-internals/types';
2
+ import { AxisConfig, ScaleName } from '../../models';
3
+ import { ChartsAxisProps } from '../../models/axis';
4
+ import { DatasetType } from '../../models/seriesType/config';
5
5
  export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, inYAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, dataset: DatasetType | undefined) => {
6
6
  reverse?: boolean | undefined;
7
7
  fill?: string | undefined;
@@ -10,32 +10,32 @@ export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleN
10
10
  label?: string | undefined;
11
11
  max?: (number | Date) | undefined;
12
12
  min?: (number | Date) | undefined;
13
- valueFormatter?: ((value: any, context: import("../internals").AxisValueFormatterContext) => string) | undefined;
13
+ valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
14
14
  dataKey?: string | undefined;
15
15
  sx?: import("@mui/system").SxProps | undefined;
16
- classes?: Partial<import("..").ChartsAxisClasses> | undefined;
16
+ classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
17
17
  tickMaxStep?: number | undefined;
18
18
  tickMinStep?: number | undefined;
19
19
  tickNumber?: number | undefined;
20
20
  disableLine?: boolean | undefined;
21
21
  disableTicks?: boolean | undefined;
22
22
  tickFontSize?: number | undefined;
23
- tickLabelStyle?: import("..").ChartsTextProps["style"];
24
- labelStyle?: import("..").ChartsTextProps["style"];
23
+ tickLabelStyle?: import("../..").ChartsTextProps["style"];
24
+ labelStyle?: import("../..").ChartsTextProps["style"];
25
25
  tickLabelInterval?: ("auto" | ((value: any, index: number) => boolean)) | undefined;
26
26
  labelFontSize?: number | undefined;
27
27
  tickSize?: number | undefined;
28
- slots?: Partial<import("../internals").ChartsAxisSlots> | undefined;
29
- slotProps?: Partial<import("../internals").ChartsAxisSlotProps> | undefined;
28
+ slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
29
+ slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
30
30
  tickInterval?: ("auto" | ((value: any, index: number) => boolean) | any[]) | undefined;
31
31
  tickPlacement?: ("start" | "end" | "middle" | "extremities") | undefined;
32
32
  tickLabelPlacement?: ("middle" | "tick") | undefined;
33
33
  scaleType?: "linear" | "time" | "log" | "band" | "point" | "pow" | "sqrt" | "utc" | undefined;
34
- colorMap?: import("../models/colorMapping").ContinuousColorConfig<number | Date> | import("../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
34
+ colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
35
35
  hideTooltip?: boolean | undefined;
36
36
  domainLimit?: ("nice" | "strict" | ((min: number, max: number) => {
37
37
  min: number;
38
38
  max: number;
39
39
  })) | undefined;
40
- id: import("../internals").AxisId;
40
+ id: import("../../internals").AxisId;
41
41
  }[][];
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import * as React from 'react';
5
- import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
5
+ import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../../constants/index.js";
6
6
  const defaultizeAxis = (inAxis, dataset, axisName) => {
7
7
  const DEFAULT_AXIS_KEY = axisName === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY;
8
8
  return [...(inAxis?.map((axis, index) => _extends({
@@ -30,10 +30,6 @@ export type HighlightItemData = {
30
30
  export type HighlightOptions = 'none' | 'item' | 'series';
31
31
  export type FadeOptions = 'none' | 'series' | 'global';
32
32
  export type HighlightScope = {
33
- /**
34
- * @deprecated Use `highlight` instead.
35
- */
36
- highlighted?: HighlightOptions;
37
33
  /**
38
34
  * The scope of highlighted elements.
39
35
  * - 'none': no highlight.
@@ -42,10 +38,6 @@ export type HighlightScope = {
42
38
  * @default 'none'
43
39
  */
44
40
  highlight?: HighlightOptions;
45
- /**
46
- * @deprecated Use `fade` instead.
47
- */
48
- faded?: FadeOptions;
49
41
  /**
50
42
  * The scope of faded elements.
51
43
  * - 'none': no fading.
@@ -1,8 +1,5 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["highlighted", "faded"];
6
3
  import * as React from 'react';
7
4
  import PropTypes from 'prop-types';
8
5
  import useControlled from '@mui/utils/useControlled';
@@ -11,18 +8,6 @@ import { createIsFaded } from "./createIsFaded.js";
11
8
  import { createIsHighlighted } from "./createIsHighlighted.js";
12
9
  import { useSeries } from "../../hooks/useSeries.js";
13
10
  import { jsx as _jsx } from "react/jsx-runtime";
14
- const mergeDeprecatedOptions = options => {
15
- const _ref = options ?? {},
16
- {
17
- highlighted,
18
- faded
19
- } = _ref,
20
- other = _objectWithoutPropertiesLoose(_ref, _excluded);
21
- return _extends({
22
- highlight: highlighted,
23
- fade: faded
24
- }, other);
25
- };
26
11
  function HighlightedProvider({
27
12
  children,
28
13
  highlightedItem: highlightedItemProps,
@@ -41,7 +26,7 @@ function HighlightedProvider({
41
26
  const seriesData = series[seriesType];
42
27
  Object.keys(seriesData?.series ?? {}).forEach(seriesId => {
43
28
  const seriesItem = seriesData?.series[seriesId];
44
- map.set(seriesId, mergeDeprecatedOptions(seriesItem?.highlightScope));
29
+ map.set(seriesId, seriesItem?.highlightScope);
45
30
  });
46
31
  });
47
32
  return map;
@@ -1,11 +1,11 @@
1
- import type { CartesianChartSeriesType, ChartSeries, ChartSeriesType } from '../../models/seriesType/config';
1
+ import type { CartesianChartSeriesType, ChartSeriesDefaultized, ChartSeriesType } from '../../models/seriesType/config';
2
2
  import type { AxisConfig, AxisId } from '../../models/axis';
3
3
  import type { SeriesId } from '../../models/seriesType/common';
4
4
  export type ExtremumGettersConfig<T extends ChartSeriesType = CartesianChartSeriesType> = {
5
5
  [K in T]?: ExtremumGetter<K>;
6
6
  };
7
7
  type ExtremumGetterParams<T extends ChartSeriesType> = {
8
- series: Record<SeriesId, ChartSeries<T>>;
8
+ series: Record<SeriesId, ChartSeriesDefaultized<T>>;
9
9
  axis: AxisConfig;
10
10
  axisIndex: number;
11
11
  isDefaultAxis: boolean;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
+ import { MakeOptional } from '@mui/x-internals/types';
2
3
  import { DatasetType } from '../models/seriesType/config';
3
- import { MakeOptional } from '../models/helpers';
4
4
  import { ZAxisConfig, ZAxisDefaultized } from '../models/z-axis';
5
5
  export type ZAxisContextProviderProps = {
6
6
  /**
package/index.d.ts CHANGED
@@ -21,6 +21,5 @@ export * from './PieChart';
21
21
  export * from './ScatterChart';
22
22
  export * from './SparkLineChart';
23
23
  export * from './Gauge';
24
- export * from './ChartContainer';
25
24
  export * from './ChartsSurface';
26
- export * from './ResponsiveChartContainer';
25
+ export * from './ChartContainer';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.22.2
2
+ * @mui/x-charts v8.0.0-alpha.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -28,6 +28,5 @@ export * from "./PieChart/index.js";
28
28
  export * from "./ScatterChart/index.js";
29
29
  export * from "./SparkLineChart/index.js";
30
30
  export * from "./Gauge/index.js";
31
- export * from "./ChartContainer/index.js";
32
31
  export * from "./ChartsSurface/index.js";
33
- export * from "./ResponsiveChartContainer/index.js";
32
+ export * from "./ChartContainer/index.js";
@@ -41,7 +41,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
41
41
  };
42
42
  id?: import(".").SeriesId;
43
43
  color?: string;
44
- valueFormatter?: import(".").SeriesValueFormatter<import(".").MakeOptional<import("..").PieValueType, "id">> | undefined;
44
+ valueFormatter?: import(".").SeriesValueFormatter<import("@mui/x-internals/types").MakeOptional<import("..").PieValueType, "id">> | undefined;
45
45
  highlightScope?: Partial<import("..").HighlightScope>;
46
46
  } | {
47
47
  type: "bar";
@@ -54,8 +54,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
54
54
  color: string;
55
55
  valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
56
56
  highlightScope?: Partial<import("..").HighlightScope>;
57
- xAxisKey?: string;
58
- yAxisKey?: string;
59
57
  xAxisId?: string;
60
58
  yAxisId?: string;
61
59
  stack?: string;
@@ -66,7 +64,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
66
64
  markerSize?: number;
67
65
  label?: string | ((location: "tooltip" | "legend") => string);
68
66
  disableHover?: boolean;
69
- zAxisKey?: string;
70
67
  zAxisId?: string;
71
68
  datasetKeys?: {
72
69
  x: string;
@@ -78,8 +75,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
78
75
  color: string;
79
76
  valueFormatter?: import(".").SeriesValueFormatter<import("..").ScatterValueType> | undefined;
80
77
  highlightScope?: Partial<import("..").HighlightScope>;
81
- xAxisKey?: string;
82
- yAxisKey?: string;
83
78
  xAxisId?: string;
84
79
  yAxisId?: string;
85
80
  } | {
@@ -99,8 +94,6 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
99
94
  color: string;
100
95
  valueFormatter?: import(".").SeriesValueFormatter<number | null> | undefined;
101
96
  highlightScope?: Partial<import("..").HighlightScope>;
102
- xAxisKey?: string;
103
- yAxisKey?: string;
104
97
  xAxisId?: string;
105
98
  yAxisId?: string;
106
99
  stackOrder?: import("..").StackOrderType;
@@ -1,5 +1,21 @@
1
- // Returns the index of a defined shape
2
1
  export function getSymbol(shape) {
3
- const symbolNames = 'circle cross diamond square star triangle wye'.split(/ /);
4
- return symbolNames.indexOf(shape) || 0;
2
+ // prettier-ignore
3
+ switch (shape) {
4
+ case 'circle':
5
+ return 0;
6
+ case 'cross':
7
+ return 1;
8
+ case 'diamond':
9
+ return 2;
10
+ case 'square':
11
+ return 3;
12
+ case 'star':
13
+ return 4;
14
+ case 'triangle':
15
+ return 5;
16
+ case 'wye':
17
+ return 6;
18
+ default:
19
+ return 0;
20
+ }
5
21
  }
@@ -1,14 +1,14 @@
1
1
  export * from './components/ChartsAxesGradients';
2
- export * from '../ResponsiveChartContainer/useChartContainerDimensions';
3
- export * from '../ResponsiveChartContainer/ResizableContainer';
2
+ export * from '../ChartContainer/useChartContainerDimensions';
3
+ export * from '../ChartContainer/ResizableContainer';
4
4
  export { useSeries } from '../hooks/useSeries';
5
5
  export { useInteractionItemProps } from '../hooks/useInteractionItemProps';
6
6
  export { useDrawingArea } from '../hooks/useDrawingArea';
7
7
  export { useScatterChartProps } from '../ScatterChart/useScatterChartProps';
8
8
  export { useLineChartProps } from '../LineChart/useLineChartProps';
9
9
  export { useBarChartProps } from '../BarChart/useBarChartProps';
10
- export { useResponsiveChartContainerProps } from '../ResponsiveChartContainer/useResponsiveChartContainerProps';
11
- export { useChartContainerProps } from '../ChartContainer/useChartContainerProps';
10
+ export * from '../ChartContainer/useChartContainerProps';
11
+ export * from '../context/ChartDataProvider/useChartDataProviderProps';
12
12
  export * from './defaultizeValueFormatter';
13
13
  export * from './configInit';
14
14
  export * from './getLabel';
@@ -26,8 +26,8 @@ export * from '../context/PluginProvider';
26
26
  export * from '../context/AnimationProvider';
27
27
  export type * from '../context/context.types';
28
28
  export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
29
+ export * from '../context/ChartDataProvider';
29
30
  export * from '../models/seriesType/config';
30
31
  export * from '../models/seriesType/common';
31
- export * from '../models/helpers';
32
32
  export * from '../models/z-axis';
33
33
  export * from '../models/axis';
@@ -1,7 +1,7 @@
1
1
  // Components
2
2
  export * from "./components/ChartsAxesGradients/index.js";
3
- export * from "../ResponsiveChartContainer/useChartContainerDimensions.js";
4
- export * from "../ResponsiveChartContainer/ResizableContainer.js";
3
+ export * from "../ChartContainer/useChartContainerDimensions.js";
4
+ export * from "../ChartContainer/ResizableContainer.js";
5
5
 
6
6
  // hooks
7
7
  export { useSeries } from "../hooks/useSeries.js";
@@ -10,8 +10,8 @@ export { useDrawingArea } from "../hooks/useDrawingArea.js";
10
10
  export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
11
11
  export { useLineChartProps } from "../LineChart/useLineChartProps.js";
12
12
  export { useBarChartProps } from "../BarChart/useBarChartProps.js";
13
- export { useResponsiveChartContainerProps } from "../ResponsiveChartContainer/useResponsiveChartContainerProps.js";
14
- export { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
13
+ export * from "../ChartContainer/useChartContainerProps.js";
14
+ export * from "../context/ChartDataProvider/useChartDataProviderProps.js";
15
15
 
16
16
  // utils
17
17
  export * from "./defaultizeValueFormatter.js";
@@ -33,10 +33,10 @@ export * from "../context/ZAxisContextProvider.js";
33
33
  export * from "../context/PluginProvider/index.js";
34
34
  export * from "../context/AnimationProvider/index.js";
35
35
  export { getAxisExtremum } from "../context/CartesianProvider/getAxisExtremum.js";
36
+ export * from "../context/ChartDataProvider/index.js";
36
37
 
37
38
  // series configuration
38
39
  export * from "../models/seriesType/config.js";
39
40
  export * from "../models/seriesType/common.js";
40
- export * from "../models/helpers.js";
41
41
  export * from "../models/z-axis.js";
42
42
  export * from "../models/axis.js";
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react-compiler/react-compiler */
1
2
  import * as React from 'react';
2
3
  import { interpolateString } from '@mui/x-charts-vendor/d3-interpolate';
3
4
  function usePrevious(value) {
@@ -1,4 +1,4 @@
1
- import { DefaultizedProps } from '../helpers';
1
+ import { DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { StackOffsetType } from '../stacking';
3
3
  import { CartesianSeriesType, CommonSeriesType, CommonDefaultizedProps, StackableSeriesType } from './common';
4
4
  export interface BarSeriesType extends CommonSeriesType<number | null>, CartesianSeriesType, StackableSeriesType {
@@ -25,16 +25,6 @@ export type CommonSeriesType<TValue> = {
25
25
  };
26
26
  export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
27
27
  export type CartesianSeriesType = {
28
- /**
29
- * The id of the x-axis used to render the series.
30
- * @deprecated Use `xAxisId` instead
31
- */
32
- xAxisKey?: string;
33
- /**
34
- * The id of the y-axis used to render the series.
35
- * @deprecated Use `xAxisId` instead
36
- */
37
- yAxisKey?: string;
38
28
  /**
39
29
  * The id of the x-axis used to render the series.
40
30
  */
@@ -1,8 +1,8 @@
1
+ import { DefaultizedProps, MakeOptional } from '@mui/x-internals/types';
1
2
  import { ScatterSeriesType, DefaultizedScatterSeriesType, ScatterItemIdentifier, ScatterValueType } from './scatter';
2
3
  import { LineSeriesType, DefaultizedLineSeriesType, LineItemIdentifier } from './line';
3
4
  import { BarItemIdentifier, BarSeriesType, DefaultizedBarSeriesType } from './bar';
4
5
  import { PieSeriesType, DefaultizedPieSeriesType, PieItemIdentifier, PieValueType, DefaultizedPieValueType } from './pie';
5
- import { DefaultizedProps, MakeOptional } from '../helpers';
6
6
  export interface ChartsSeriesConfig {
7
7
  bar: {
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { DefaultizedProps } from '../helpers';
1
+ import { DefaultizedProps } from '@mui/x-internals/types';
2
2
  import type { StackOffsetType } from '../stacking';
3
3
  import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId, StackableSeriesType } from './common';
4
4
  export type CurveType = 'catmullRom' | 'linear' | 'monotoneX' | 'monotoneY' | 'natural' | 'step' | 'stepBefore' | 'stepAfter';
@@ -1,5 +1,5 @@
1
1
  import { PieArcDatum as D3PieArcDatum } from '@mui/x-charts-vendor/d3-shape';
2
- import { DefaultizedProps } from '../helpers';
2
+ import { DefaultizedProps } from '@mui/x-internals/types';
3
3
  import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
4
4
  export type PieItemId = string | number;
5
5
  export type PieValueType = {
@@ -1,4 +1,4 @@
1
- import { DefaultizedProps } from '../helpers';
1
+ import { DefaultizedProps } from '@mui/x-internals/types';
2
2
  import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
3
3
  export type ScatterValueType = {
4
4
  x: number;
@@ -22,11 +22,6 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType>, C
22
22
  * @default false
23
23
  */
24
24
  disableHover?: boolean;
25
- /**
26
- * The id of the z-axis used to render the series.
27
- * @deprecated Use `zAxisId` instead.
28
- */
29
- zAxisKey?: string;
30
25
  /**
31
26
  * The id of the z-axis used to render the series.
32
27
  */
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { useThemeProps } from '@mui/material/styles';
7
7
  import { BarPlot } from "./BarPlot.js";
8
- import { ResponsiveChartContainer } from "../ResponsiveChartContainer/index.js";
8
+ import { ChartContainer } from "../ChartContainer/index.js";
9
9
  import { ChartsAxis } from "../ChartsAxis/index.js";
10
10
  import { ChartsTooltip } from "../ChartsTooltip/index.js";
11
11
  import { ChartsLegend } from "../ChartsLegend/index.js";
@@ -46,12 +46,12 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(inProps, ref) {
46
46
  tooltipProps,
47
47
  children
48
48
  } = useBarChartProps(props);
49
- return /*#__PURE__*/_jsxs(ResponsiveChartContainer, _extends({
49
+ return /*#__PURE__*/_jsxs(ChartContainer, _extends({
50
50
  ref: ref
51
51
  }, chartContainerProps, {
52
52
  children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
53
53
  children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
54
- })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
54
+ })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
55
55
  }));
56
56
  });
57
57
  process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
@@ -116,6 +116,10 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
116
116
  * The height of the chart in px. If not defined, it takes the height of the parent element.
117
117
  */
118
118
  height: PropTypes.number,
119
+ /**
120
+ * If `true`, the legend is not rendered.
121
+ */
122
+ hideLegend: PropTypes.bool,
119
123
  /**
120
124
  * The item currently highlighted. Turns highlighting into a controlled prop.
121
125
  */
@@ -134,32 +138,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
134
138
  * @default yAxisIds[0] The id of the first provided axis
135
139
  */
136
140
  leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
137
- /**
138
- * @deprecated Consider using `slotProps.legend` instead.
139
- */
140
- legend: PropTypes.shape({
141
- classes: PropTypes.object,
142
- direction: PropTypes.oneOf(['column', 'row']),
143
- hidden: PropTypes.bool,
144
- itemGap: PropTypes.number,
145
- itemMarkHeight: PropTypes.number,
146
- itemMarkWidth: PropTypes.number,
147
- labelStyle: PropTypes.object,
148
- markGap: PropTypes.number,
149
- onItemClick: PropTypes.func,
150
- padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
151
- bottom: PropTypes.number,
152
- left: PropTypes.number,
153
- right: PropTypes.number,
154
- top: PropTypes.number
155
- })]),
156
- position: PropTypes.shape({
157
- horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
158
- vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
159
- }),
160
- slotProps: PropTypes.object,
161
- slots: PropTypes.object
162
- }),
163
141
  /**
164
142
  * If `true`, a loading overlay is displayed.
165
143
  * @default false