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