@mui/x-charts 8.26.0 → 8.27.4

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 (124) hide show
  1. package/CHANGELOG.md +314 -0
  2. package/ChartContainer/ChartContainer.d.ts +16 -29
  3. package/ChartContainer/ChartContainer.js +14 -1691
  4. package/ChartContainer/useChartContainerProps.d.ts +9 -10
  5. package/ChartContainer/useChartContainerProps.js +9 -94
  6. package/ChartDataProvider/ChartDataProvider.d.ts +15 -44
  7. package/ChartDataProvider/ChartDataProvider.js +16 -130
  8. package/ChartDataProvider/useChartDataProviderProps.d.ts +7 -10
  9. package/ChartDataProvider/useChartDataProviderProps.js +5 -38
  10. package/ChartsAxis/axisClasses.d.ts +2 -0
  11. package/ChartsContainer/ChartsContainer.d.ts +37 -0
  12. package/ChartsContainer/ChartsContainer.js +1702 -0
  13. package/ChartsContainer/index.d.ts +1 -0
  14. package/ChartsContainer/index.js +16 -0
  15. package/ChartsContainer/useChartsContainerProps.d.ts +15 -0
  16. package/ChartsContainer/useChartsContainerProps.js +104 -0
  17. package/ChartsDataProvider/ChartsDataProvider.d.ts +51 -0
  18. package/ChartsDataProvider/ChartsDataProvider.js +138 -0
  19. package/ChartsDataProvider/index.d.ts +1 -0
  20. package/ChartsDataProvider/index.js +16 -0
  21. package/ChartsDataProvider/useChartsDataProviderProps.d.ts +13 -0
  22. package/ChartsDataProvider/useChartsDataProviderProps.js +45 -0
  23. package/ChartsSurface/ChartsSurface.js +4 -0
  24. package/ChartsXAxis/ChartsXAxisImpl.js +1 -0
  25. package/ChartsYAxis/ChartsYAxisImpl.js +1 -0
  26. package/RadarChart/RadarChart.d.ts +1 -1
  27. package/RadarChart/useRadarChartProps.js +1 -1
  28. package/context/ChartProvider/ChartContext.d.ts +2 -3
  29. package/context/ChartProvider/ChartContext.js +3 -4
  30. package/context/ChartProvider/ChartProvider.d.ts +5 -8
  31. package/context/ChartProvider/ChartProvider.js +6 -41
  32. package/context/ChartProvider/ChartProvider.types.d.ts +14 -41
  33. package/context/ChartProvider/useChartContext.d.ts +4 -3
  34. package/context/ChartProvider/useChartContext.js +5 -11
  35. package/context/ChartsProvider/ChartsContext.d.ts +6 -0
  36. package/context/ChartsProvider/ChartsContext.js +14 -0
  37. package/context/ChartsProvider/ChartsProvider.d.ts +8 -0
  38. package/context/ChartsProvider/ChartsProvider.js +47 -0
  39. package/context/ChartsProvider/ChartsProvider.types.d.ts +40 -0
  40. package/context/ChartsProvider/ChartsProvider.types.js +5 -0
  41. package/context/ChartsProvider/index.d.ts +3 -0
  42. package/context/ChartsProvider/index.js +38 -0
  43. package/context/ChartsProvider/useChartsContext.d.ts +3 -0
  44. package/context/ChartsProvider/useChartsContext.js +18 -0
  45. package/context/ChartsSlotsContext.d.ts +1 -1
  46. package/context/ChartsSlotsContext.js +1 -1
  47. package/esm/ChartContainer/ChartContainer.d.ts +16 -29
  48. package/esm/ChartContainer/ChartContainer.js +15 -1690
  49. package/esm/ChartContainer/useChartContainerProps.d.ts +9 -10
  50. package/esm/ChartContainer/useChartContainerProps.js +10 -93
  51. package/esm/ChartDataProvider/ChartDataProvider.d.ts +15 -44
  52. package/esm/ChartDataProvider/ChartDataProvider.js +16 -128
  53. package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +7 -10
  54. package/esm/ChartDataProvider/useChartDataProviderProps.js +6 -36
  55. package/esm/ChartsAxis/axisClasses.d.ts +2 -0
  56. package/esm/ChartsContainer/ChartsContainer.d.ts +37 -0
  57. package/esm/ChartsContainer/ChartsContainer.js +1696 -0
  58. package/esm/ChartsContainer/index.d.ts +1 -0
  59. package/esm/ChartsContainer/index.js +1 -0
  60. package/esm/ChartsContainer/useChartsContainerProps.d.ts +15 -0
  61. package/esm/ChartsContainer/useChartsContainerProps.js +97 -0
  62. package/esm/ChartsDataProvider/ChartsDataProvider.d.ts +51 -0
  63. package/esm/ChartsDataProvider/ChartsDataProvider.js +132 -0
  64. package/esm/ChartsDataProvider/index.d.ts +1 -0
  65. package/esm/ChartsDataProvider/index.js +1 -0
  66. package/esm/ChartsDataProvider/useChartsDataProviderProps.d.ts +13 -0
  67. package/esm/ChartsDataProvider/useChartsDataProviderProps.js +38 -0
  68. package/esm/ChartsSurface/ChartsSurface.js +4 -0
  69. package/esm/ChartsXAxis/ChartsXAxisImpl.js +1 -0
  70. package/esm/ChartsYAxis/ChartsYAxisImpl.js +1 -0
  71. package/esm/RadarChart/RadarChart.d.ts +1 -1
  72. package/esm/RadarChart/useRadarChartProps.js +1 -1
  73. package/esm/context/ChartProvider/ChartContext.d.ts +2 -3
  74. package/esm/context/ChartProvider/ChartContext.js +4 -3
  75. package/esm/context/ChartProvider/ChartProvider.d.ts +5 -8
  76. package/esm/context/ChartProvider/ChartProvider.js +5 -38
  77. package/esm/context/ChartProvider/ChartProvider.types.d.ts +14 -41
  78. package/esm/context/ChartProvider/useChartContext.d.ts +4 -3
  79. package/esm/context/ChartProvider/useChartContext.js +6 -9
  80. package/esm/context/ChartsProvider/ChartsContext.d.ts +6 -0
  81. package/esm/context/ChartsProvider/ChartsContext.js +8 -0
  82. package/esm/context/ChartsProvider/ChartsProvider.d.ts +8 -0
  83. package/esm/context/ChartsProvider/ChartsProvider.js +41 -0
  84. package/esm/context/ChartsProvider/ChartsProvider.types.d.ts +40 -0
  85. package/esm/context/ChartsProvider/ChartsProvider.types.js +1 -0
  86. package/esm/context/ChartsProvider/index.d.ts +3 -0
  87. package/esm/context/ChartsProvider/index.js +3 -0
  88. package/esm/context/ChartsProvider/useChartsContext.d.ts +3 -0
  89. package/esm/context/ChartsProvider/useChartsContext.js +11 -0
  90. package/esm/context/ChartsSlotsContext.d.ts +1 -1
  91. package/esm/context/ChartsSlotsContext.js +1 -1
  92. package/esm/index.d.ts +4 -1
  93. package/esm/index.js +3 -1
  94. package/esm/internals/index.d.ts +4 -0
  95. package/esm/internals/index.js +4 -0
  96. package/esm/internals/plugins/featurePlugins/useChartItemClick/index.d.ts +2 -0
  97. package/esm/internals/plugins/featurePlugins/useChartItemClick/index.js +1 -0
  98. package/esm/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.d.ts +3 -0
  99. package/esm/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.js +48 -0
  100. package/esm/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +22 -0
  101. package/esm/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.js +1 -0
  102. package/esm/internals/plugins/models/seriesConfig/getItemAtPosition.types.d.ts +8 -0
  103. package/esm/internals/plugins/models/seriesConfig/getItemAtPosition.types.js +1 -0
  104. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +10 -1
  105. package/esm/internals/store/useStore.js +1 -1
  106. package/esm/themeAugmentation/components.d.ts +4 -0
  107. package/esm/themeAugmentation/props.d.ts +4 -2
  108. package/index.d.ts +4 -1
  109. package/index.js +21 -1
  110. package/internals/index.d.ts +4 -0
  111. package/internals/index.js +48 -0
  112. package/internals/plugins/featurePlugins/useChartItemClick/index.d.ts +2 -0
  113. package/internals/plugins/featurePlugins/useChartItemClick/index.js +12 -0
  114. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.d.ts +3 -0
  115. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.js +54 -0
  116. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +22 -0
  117. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.js +5 -0
  118. package/internals/plugins/models/seriesConfig/getItemAtPosition.types.d.ts +8 -0
  119. package/internals/plugins/models/seriesConfig/getItemAtPosition.types.js +5 -0
  120. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +10 -1
  121. package/internals/store/useStore.js +1 -1
  122. package/package.json +3 -3
  123. package/themeAugmentation/components.d.ts +4 -0
  124. package/themeAugmentation/props.d.ts +4 -2
@@ -1,15 +1,14 @@
1
1
  import type * as React from 'react';
2
- import { type ChartsSurfaceProps } from "../ChartsSurface/index.js";
3
- import { type ChartDataProviderProps } from "../ChartDataProvider/index.js";
4
- import type { ChartContainerProps } from "./ChartContainer.js";
5
2
  import { type ChartSeriesType } from "../models/seriesType/config.js";
6
3
  import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
7
4
  import { type ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
8
- export type UseChartContainerPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = {
9
- chartDataProviderProps: Omit<ChartDataProviderProps<TSeries, TSignatures>, 'children'>;
10
- chartsSurfaceProps: ChartsSurfaceProps & {
11
- ref: React.Ref<SVGSVGElement>;
12
- };
13
- children: React.ReactNode;
14
- };
5
+ import { type UseChartsContainerPropsReturnValue } from "../ChartsContainer/useChartsContainerProps.js";
6
+ import type { ChartContainerProps } from "./ChartContainer.js";
7
+ /**
8
+ * @deprecated Use `UseChartsContainerPropsReturnValue` instead.
9
+ */
10
+ export type UseChartContainerPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = UseChartsContainerPropsReturnValue<TSeries, TSignatures>;
11
+ /**
12
+ * @deprecated Use `useChartsContainerProps` instead.
13
+ */
15
14
  export declare const useChartContainerProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerPropsReturnValue<TSeries, TSignatures>;
@@ -1,97 +1,14 @@
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 = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "tooltipItem", "onTooltipItemChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation", "brushConfig", "onHiddenItemsChange", "hiddenItems", "initialHiddenItems"];
6
- import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
3
+ import { useChartsContainerProps } from "../ChartsContainer/useChartsContainerProps.js";
4
+
5
+ /**
6
+ * @deprecated Use `UseChartsContainerPropsReturnValue` instead.
7
+ */
8
+
9
+ /**
10
+ * @deprecated Use `useChartsContainerProps` instead.
11
+ */
7
12
  export const useChartContainerProps = (props, ref) => {
8
- const _ref = props,
9
- {
10
- width,
11
- height,
12
- margin,
13
- children,
14
- series,
15
- colors,
16
- dataset,
17
- desc,
18
- onAxisClick,
19
- highlightedAxis,
20
- onHighlightedAxisChange,
21
- tooltipItem,
22
- onTooltipItemChange,
23
- disableVoronoi,
24
- voronoiMaxRadius,
25
- onItemClick,
26
- disableAxisListener,
27
- highlightedItem,
28
- onHighlightChange,
29
- sx,
30
- title,
31
- xAxis,
32
- yAxis,
33
- zAxis,
34
- rotationAxis,
35
- radiusAxis,
36
- skipAnimation,
37
- seriesConfig,
38
- plugins,
39
- localeText,
40
- slots,
41
- slotProps,
42
- experimentalFeatures,
43
- enableKeyboardNavigation,
44
- brushConfig,
45
- onHiddenItemsChange,
46
- hiddenItems,
47
- initialHiddenItems
48
- } = _ref,
49
- other = _objectWithoutPropertiesLoose(_ref, _excluded);
50
- const chartsSurfaceProps = _extends({
51
- title,
52
- desc,
53
- sx,
54
- ref
55
- }, other);
56
- const chartDataProviderProps = {
57
- margin,
58
- series,
59
- colors,
60
- dataset,
61
- disableAxisListener,
62
- highlightedItem,
63
- onHighlightChange,
64
- onAxisClick,
65
- highlightedAxis,
66
- onHighlightedAxisChange,
67
- tooltipItem,
68
- onTooltipItemChange,
69
- disableVoronoi,
70
- voronoiMaxRadius,
71
- onItemClick,
72
- xAxis,
73
- yAxis,
74
- zAxis,
75
- rotationAxis,
76
- radiusAxis,
77
- skipAnimation,
78
- width,
79
- height,
80
- localeText,
81
- seriesConfig,
82
- experimentalFeatures,
83
- enableKeyboardNavigation,
84
- brushConfig,
85
- onHiddenItemsChange,
86
- hiddenItems,
87
- initialHiddenItems,
88
- plugins: plugins ?? DEFAULT_PLUGINS,
89
- slots,
90
- slotProps
91
- };
92
- return {
93
- chartDataProviderProps,
94
- chartsSurfaceProps,
95
- children
96
- };
13
+ return useChartsContainerProps(props, ref);
97
14
  };
@@ -1,49 +1,20 @@
1
- import * as React from 'react';
2
- import { type ChartsSlotProps, type ChartsSlots } from "../internals/material/index.js";
3
- import { type ChartProviderProps } from "../context/ChartProvider/index.js";
4
1
  import { type ChartSeriesType } from "../models/seriesType/config.js";
5
2
  import { type ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
6
3
  import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
7
- import { type ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
8
- export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps & {
9
- /**
10
- * Slots to customize charts' components.
11
- */
12
- slots?: Partial<ChartsSlots>;
13
- /**
14
- * The props for the slots.
15
- */
16
- slotProps?: Partial<ChartsSlotProps>;
17
- };
4
+ import { ChartsDataProvider, type ChartsDataProviderProps, type ChartsDataProviderSlots, type ChartsDataProviderSlotProps } from "../ChartsDataProvider/index.js";
18
5
  /**
19
- * Orchestrates the data providers for the chart components and hooks.
20
- *
21
- * Use this component if you have custom HTML components that need to access the chart data.
22
- *
23
- * Demos:
24
- *
25
- * - [Composition](https://mui.com/x/react-charts/composition/)
26
- *
27
- * API:
28
- *
29
- * - [ChartDataProvider API](https://mui.com/x/api/charts/chart-data-provider/)
30
- *
31
- * @example
32
- * ```jsx
33
- * <ChartDataProvider
34
- * series={[{ label: "Label", type: "bar", data: [10, 20] }]}
35
- * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
36
- * >
37
- * <ChartsSurface>
38
- * <BarPlot />
39
- * <ChartsXAxis axisId="x-axis" />
40
- * </ChartsSurface>
41
- * {'Custom Legend Component'}
42
- * </ChartDataProvider>
43
- * ```
6
+ * @deprecated Use `ChartsDataProviderSlots` instead. We added S to the charts prefix to align with other components.
44
7
  */
45
- declare function ChartDataProvider<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProps<TSeries, TSignatures>): import("react/jsx-runtime").JSX.Element;
46
- declare namespace ChartDataProvider {
47
- var propTypes: any;
48
- }
49
- export { ChartDataProvider };
8
+ export type ChartDataProviderSlots = ChartsDataProviderSlots;
9
+ /**
10
+ * @deprecated Use `ChartsDataProviderSlotProps` instead. We added S to the charts prefix to align with other components.
11
+ */
12
+ export type ChartDataProviderSlotProps = ChartsDataProviderSlotProps;
13
+ /**
14
+ * @deprecated Use `ChartsDataProviderProps` instead. We added S to the charts prefix to align with other components.
15
+ */
16
+ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartsDataProviderProps<TSeries, TSignatures>;
17
+ /**
18
+ * @deprecated Use `ChartsDataProvider` instead. We added S to the charts prefix to align with other components.
19
+ */
20
+ export declare const ChartDataProvider: typeof ChartsDataProvider;
@@ -1,132 +1,20 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
- import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
- import { defaultSlotsMaterial } from "../internals/material/index.js";
7
- import { ChartsSlotsProvider } from "../context/ChartsSlotsContext.js";
8
- import { useChartDataProviderProps } from "./useChartDataProviderProps.js";
9
- import { ChartProvider } from "../context/ChartProvider/index.js";
10
- import { ChartsLocalizationProvider } from "../ChartsLocalizationProvider/index.js";
11
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { ChartsDataProvider } from "../ChartsDataProvider/index.js";
4
+
5
+ /**
6
+ * @deprecated Use `ChartsDataProviderSlots` instead. We added S to the charts prefix to align with other components.
7
+ */
8
+
9
+ /**
10
+ * @deprecated Use `ChartsDataProviderSlotProps` instead. We added S to the charts prefix to align with other components.
11
+ */
12
+
13
+ /**
14
+ * @deprecated Use `ChartsDataProviderProps` instead. We added S to the charts prefix to align with other components.
15
+ */
16
+
12
17
  /**
13
- * Orchestrates the data providers for the chart components and hooks.
14
- *
15
- * Use this component if you have custom HTML components that need to access the chart data.
16
- *
17
- * Demos:
18
- *
19
- * - [Composition](https://mui.com/x/react-charts/composition/)
20
- *
21
- * API:
22
- *
23
- * - [ChartDataProvider API](https://mui.com/x/api/charts/chart-data-provider/)
24
- *
25
- * @example
26
- * ```jsx
27
- * <ChartDataProvider
28
- * series={[{ label: "Label", type: "bar", data: [10, 20] }]}
29
- * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
30
- * >
31
- * <ChartsSurface>
32
- * <BarPlot />
33
- * <ChartsXAxis axisId="x-axis" />
34
- * </ChartsSurface>
35
- * {'Custom Legend Component'}
36
- * </ChartDataProvider>
37
- * ```
18
+ * @deprecated Use `ChartsDataProvider` instead. We added S to the charts prefix to align with other components.
38
19
  */
39
- function ChartDataProvider(props) {
40
- const {
41
- children,
42
- localeText,
43
- chartProviderProps,
44
- slots,
45
- slotProps
46
- } = useChartDataProviderProps(props);
47
- return /*#__PURE__*/_jsx(ChartProvider, _extends({}, chartProviderProps, {
48
- children: /*#__PURE__*/_jsx(ChartsLocalizationProvider, {
49
- localeText: localeText,
50
- children: /*#__PURE__*/_jsx(ChartsSlotsProvider, {
51
- slots: slots,
52
- slotProps: slotProps,
53
- defaultSlots: defaultSlotsMaterial,
54
- children: children
55
- })
56
- })
57
- }));
58
- }
59
- process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
60
- // ----------------------------- Warning --------------------------------
61
- // | These PropTypes are generated from the TypeScript type definitions |
62
- // | To update them edit the TypeScript types and run "pnpm proptypes" |
63
- // ----------------------------------------------------------------------
64
- apiRef: PropTypes.shape({
65
- current: PropTypes.any
66
- }),
67
- /**
68
- * Color palette used to colorize multiple series.
69
- * @default rainbowSurgePalette
70
- */
71
- colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
72
- /**
73
- * An array of objects that can be used to populate series and axes data using their `dataKey` property.
74
- */
75
- dataset: PropTypes.arrayOf(PropTypes.object),
76
- /**
77
- * Options to enable features planned for the next major.
78
- */
79
- experimentalFeatures: PropTypes.shape({
80
- preferStrictDomainInLineCharts: PropTypes.bool
81
- }),
82
- /**
83
- * The height of the chart in px. If not defined, it takes the height of the parent element.
84
- */
85
- height: PropTypes.number,
86
- /**
87
- * This prop is used to help implement the accessibility logic.
88
- * If you don't provide this prop. It falls back to a randomly generated id.
89
- */
90
- id: PropTypes.string,
91
- /**
92
- * Localized text for chart components.
93
- */
94
- localeText: PropTypes.object,
95
- /**
96
- * The margin between the SVG and the drawing area.
97
- * It's used for leaving some space for extra information such as the x- and y-axis or legend.
98
- *
99
- * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
100
- */
101
- margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
102
- bottom: PropTypes.number,
103
- left: PropTypes.number,
104
- right: PropTypes.number,
105
- top: PropTypes.number
106
- })]),
107
- /**
108
- * The array of series to display.
109
- * Each type of series has its own specificity.
110
- * Please refer to the appropriate docs page to learn more about it.
111
- */
112
- series: PropTypes.arrayOf(PropTypes.object),
113
- /**
114
- * If `true`, animations are skipped.
115
- * If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
116
- */
117
- skipAnimation: PropTypes.bool,
118
- /**
119
- * The props for the slots.
120
- */
121
- slotProps: PropTypes.object,
122
- /**
123
- * Slots to customize charts' components.
124
- */
125
- slots: PropTypes.object,
126
- theme: PropTypes.oneOf(['dark', 'light']),
127
- /**
128
- * The width of the chart in px. If not defined, it takes the width of the parent element.
129
- */
130
- width: PropTypes.number
131
- } : void 0;
132
- export { ChartDataProvider };
20
+ export const ChartDataProvider = ChartsDataProvider;
@@ -1,13 +1,10 @@
1
- import type { ChartDataProviderProps } from "./ChartDataProvider.js";
2
- import { type ChartProviderProps } from "../context/ChartProvider/index.js";
3
- import { type ChartAnyPluginSignature } from "../internals/plugins/models/index.js";
4
- import { type ChartSeriesType } from "../models/seriesType/config.js";
5
- import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
6
- import { type ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
7
- export declare const useChartDataProviderProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(inProps: ChartDataProviderProps<TSeries, TSignatures> & ChartsLocalizationProviderProps) => {
1
+ /**
2
+ * @deprecated Use `useChartsDataProviderProps` instead. We added S to the charts prefix to align with other components.
3
+ */
4
+ export declare const useChartDataProviderProps: <TSeries extends import("../internals/index.js").ChartSeriesType = keyof import("../internals/index.js").ChartsSeriesConfig, TSignatures extends readonly import("../internals/index.js").ChartAnyPluginSignature[] = import("../internals/plugins/allPlugins.js").AllPluginSignatures<TSeries>>(inProps: import("../index.js").ChartsDataProviderProps<TSeries, TSignatures> & import("../index.js").ChartsLocalizationProviderProps) => {
8
5
  children: import("react").ReactNode;
9
6
  localeText: Partial<import("../locales/index.js").ChartsLocaleText> | undefined;
10
- chartProviderProps: ChartProviderProps<TSeries, TSignatures>;
11
- slots: Partial<import("../internals/index.js").ChartsSlots> | undefined;
12
- slotProps: Partial<import("../internals/index.js").ChartsSlotProps> | undefined;
7
+ chartProviderProps: import("../internals/index.js").ChartsProviderProps<TSeries, TSignatures>;
8
+ slots: Partial<import("../index.js").ChartsDataProviderSlots> | undefined;
9
+ slotProps: Partial<import("../index.js").ChartsDataProviderSlotProps> | undefined;
13
10
  };
@@ -1,38 +1,8 @@
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 = ["children", "localeText", "plugins", "seriesConfig", "slots", "slotProps"];
6
- import { useTheme, useThemeProps } from '@mui/material/styles';
7
- import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
8
- export const useChartDataProviderProps = inProps => {
9
- // eslint-disable-next-line material-ui/mui-name-matches-component-name
10
- const props = useThemeProps({
11
- props: inProps,
12
- name: 'MuiChartDataProvider'
13
- });
14
- const {
15
- children,
16
- localeText,
17
- plugins = DEFAULT_PLUGINS,
18
- seriesConfig,
19
- slots,
20
- slotProps
21
- } = props,
22
- other = _objectWithoutPropertiesLoose(props, _excluded);
23
- const theme = useTheme();
24
- const chartProviderProps = {
25
- plugins: plugins,
26
- seriesConfig,
27
- pluginParams: _extends({
28
- theme: theme.palette.mode
29
- }, other)
30
- };
31
- return {
32
- children,
33
- localeText,
34
- chartProviderProps,
35
- slots,
36
- slotProps
37
- };
38
- };
3
+ import { useChartsDataProviderProps } from "../ChartsDataProvider/useChartsDataProviderProps.js";
4
+
5
+ /**
6
+ * @deprecated Use `useChartsDataProviderProps` instead. We added S to the charts prefix to align with other components.
7
+ */
8
+ export const useChartDataProviderProps = useChartsDataProviderProps;
@@ -30,6 +30,8 @@ export interface ChartsAxisClasses {
30
30
  /**
31
31
  * Styles applied to the root element for the axis with the given ID.
32
32
  * Needs to be suffixed with the axis ID: `.${axisClasses.id}-${axisId}`.
33
+ *
34
+ * @deprecated Use the data attribute `data-axis-id` instead.
33
35
  */
34
36
  id: string;
35
37
  }
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { type ChartSeriesType } from "../models/seriesType/config.js";
3
+ import { type ChartsDataProviderProps, type ChartsDataProviderSlotProps, type ChartsDataProviderSlots } from "../ChartsDataProvider/index.js";
4
+ import { type ChartsSurfaceProps } from "../ChartsSurface/index.js";
5
+ import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
6
+ import { type ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
7
+ export interface ChartsContainerSlots extends ChartsDataProviderSlots {}
8
+ export interface ChartsContainerSlotProps extends ChartsDataProviderSlotProps {}
9
+ export type ChartsContainerProps<SeriesType extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<SeriesType>> = Omit<ChartsDataProviderProps<SeriesType, TSignatures>, 'children'> & ChartsSurfaceProps;
10
+ /**
11
+ * It sets up the data providers as well as the `<svg>` for the chart.
12
+ *
13
+ * This is a combination of both the `ChartsDataProvider` and `ChartsSurface` components.
14
+ *
15
+ * Demos:
16
+ *
17
+ * - [Composition](https://mui.com/x/api/charts/composition/)
18
+ *
19
+ * API:
20
+ *
21
+ * - [ChartsContainer API](https://mui.com/x/api/charts/charts-container/)
22
+ *
23
+ * @example
24
+ * ```jsx
25
+ * <ChartsContainer
26
+ * series={[{ label: "Label", type: "bar", data: [10, 20] }]}
27
+ * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
28
+ * >
29
+ * <BarPlot />
30
+ * <ChartsXAxis axisId="x-axis" />
31
+ * </ChartsContainer>
32
+ * ```
33
+ */
34
+ declare const ChartsContainer: <TSeries extends ChartSeriesType>(props: ChartsContainerProps<TSeries> & {
35
+ ref?: React.ForwardedRef<SVGSVGElement>;
36
+ }) => React.JSX.Element;
37
+ export { ChartsContainer };