@mui/x-charts-pro 8.0.0-alpha.0 → 8.0.0-alpha.10
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/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +74 -61
- package/CHANGELOG.md +2215 -119
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
- package/ChartContainerPro/ChartContainerPro.js +59 -51
- package/ChartContainerPro/useChartContainerProProps.d.ts +7 -43
- package/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/{context → ChartDataProviderPro}/package.json +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/Heatmap/Heatmap.d.ts +11 -4
- package/Heatmap/Heatmap.js +35 -43
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/HeatmapTooltip.d.ts +9 -0
- package/Heatmap/HeatmapTooltip.js +274 -0
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/heatmapClasses.js +2 -1
- package/Heatmap/index.d.ts +1 -1
- package/Heatmap/index.js +1 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +4 -2
- package/Heatmap/tooltip.d.ts +3 -0
- package/Heatmap/tooltip.js +25 -0
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +80 -82
- package/README.md +3 -3
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +51 -64
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useSeries.d.ts +2 -4
- package/hooks/zoom/index.d.ts +1 -0
- package/hooks/zoom/index.js +1 -0
- package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/index.d.ts +3 -1
- package/index.js +5 -5
- package/internals/plugins/allPlugins.d.ts +11 -0
- package/internals/plugins/allPlugins.js +5 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +3 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/internals/plugins/useChartProZoom/index.js +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +377 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +50 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
- package/internals/utils/releaseInfo.js +2 -2
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +74 -61
- package/modern/ChartContainerPro/ChartContainerPro.js +59 -51
- package/modern/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/modern/Heatmap/Heatmap.js +35 -43
- package/modern/Heatmap/HeatmapItem.js +1 -1
- package/modern/Heatmap/HeatmapTooltip.js +274 -0
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/heatmapClasses.js +2 -1
- package/modern/Heatmap/index.js +1 -1
- package/modern/Heatmap/plugin.js +4 -2
- package/modern/Heatmap/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.js +80 -82
- package/modern/ScatterChartPro/ScatterChartPro.js +51 -64
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/zoom/index.js +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/modern/index.js +5 -5
- package/modern/internals/plugins/allPlugins.js +5 -0
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -0
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/modern/internals/plugins/useChartProZoom/index.js +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +303 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
- package/modern/internals/utils/releaseInfo.js +2 -2
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +73 -60
- package/node/ChartContainerPro/ChartContainerPro.js +58 -50
- package/node/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -79
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- package/node/Heatmap/Heatmap.js +35 -43
- package/node/Heatmap/HeatmapItem.js +2 -2
- package/node/Heatmap/HeatmapTooltip.js +280 -0
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/heatmapClasses.js +5 -4
- package/node/Heatmap/index.js +4 -4
- package/node/Heatmap/plugin.js +4 -2
- package/node/Heatmap/tooltip.js +31 -0
- package/node/LineChartPro/LineChartPro.js +79 -81
- package/node/ScatterChartPro/ScatterChartPro.js +50 -63
- package/node/hooks/index.js +16 -1
- package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
- package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
- package/node/index.js +34 -12
- package/node/internals/plugins/allPlugins.js +11 -0
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +19 -0
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
- package/node/internals/plugins/useChartProZoom/index.js +38 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.js +310 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +18 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
- package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
- package/node/internals/utils/releaseInfo.js +4 -3
- package/package.json +8 -8
- package/typeOverloads/modules.d.ts +8 -1
- package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
- package/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
- package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -12
- package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/context/CartesianProviderPro/index.d.ts +0 -1
- package/context/CartesianProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -7
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -16
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/context/ZoomProvider/Zoom.types.d.ts +0 -144
- package/context/ZoomProvider/ZoomContext.d.ts +0 -4
- package/context/ZoomProvider/ZoomContext.js +0 -16
- package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
- package/context/ZoomProvider/ZoomProvider.js +0 -56
- package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
- package/context/ZoomProvider/ZoomSetup.js +0 -16
- package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
- package/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/context/ZoomProvider/index.d.ts +0 -3
- package/context/ZoomProvider/index.js +0 -3
- package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
- package/context/ZoomProvider/initializeZoomData.js +0 -13
- package/context/ZoomProvider/useSetupPan.d.ts +0 -1
- package/context/ZoomProvider/useSetupPan.js +0 -106
- package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
- package/context/ZoomProvider/useSetupZoom.js +0 -274
- package/context/ZoomProvider/useZoom.d.ts +0 -7
- package/context/ZoomProvider/useZoom.js +0 -19
- package/context/index.d.ts +0 -3
- package/context/index.js +0 -5
- package/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/modern/context/CartesianProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/modern/context/ZoomProvider/ZoomContext.js +0 -16
- package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
- package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
- package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/modern/context/ZoomProvider/index.js +0 -3
- package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
- package/modern/context/ZoomProvider/useSetupPan.js +0 -106
- package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
- package/modern/context/ZoomProvider/useZoom.js +0 -19
- package/modern/context/index.js +0 -5
- package/node/Heatmap/DefaultHeatmapTooltip.js +0 -105
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
- package/node/context/ZoomProvider/ZoomContext.js +0 -23
- package/node/context/ZoomProvider/ZoomProvider.js +0 -63
- package/node/context/ZoomProvider/ZoomSetup.js +0 -20
- package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
- package/node/context/ZoomProvider/index.js +0 -38
- package/node/context/ZoomProvider/initializeZoomData.js +0 -20
- package/node/context/ZoomProvider/useSetupPan.js +0 -114
- package/node/context/ZoomProvider/useSetupZoom.js +0 -281
- package/node/context/ZoomProvider/useZoom.js +0 -25
- package/node/context/index.js +0 -27
- /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.d.ts +0 -0
- /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
- /package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { ChartsSurfaceProps } from '@mui/x-charts/ChartsSurface';
|
|
3
|
+
import { ChartSeriesType } from '@mui/x-charts/internals';
|
|
4
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
5
|
+
import { ChartDataProviderProProps } from '../ChartDataProviderPro';
|
|
6
|
+
export interface ChartContainerProProps<TSeries extends ChartSeriesType = ChartSeriesType> extends ChartDataProviderProProps<TSeries, AllPluginSignatures<TSeries>>, ChartsSurfaceProps {
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
type ChartContainerProComponent = <TSeries extends ChartSeriesType = ChartSeriesType>(props: ChartContainerProProps<TSeries> & {
|
|
9
|
+
ref?: React.ForwardedRef<SVGSVGElement>;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
13
|
+
*
|
|
14
|
+
* This is a combination of both the `ChartDataProviderPro` and `ChartsSurface` components.
|
|
15
|
+
*
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [ChartContainer API](https://mui.com/x/api/charts/chart-container/)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```jsx
|
|
26
|
+
* <ChartContainerPro
|
|
27
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
28
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
29
|
+
* >
|
|
30
|
+
* <BarPlot />
|
|
31
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
32
|
+
* </ChartContainerPro>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const ChartContainerPro: ChartContainerProComponent;
|
|
7
36
|
export { ChartContainerPro };
|
|
@@ -3,31 +3,58 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
7
|
-
import { ResizableContainer } from '@mui/x-charts/internals';
|
|
8
|
-
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
9
|
-
import { ChartDataProviderPro } from "../context/ChartDataProviderPro/index.js";
|
|
6
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
10
7
|
import { useChartContainerProProps } from "./useChartContainerProProps.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
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 `ChartDataProviderPro` and `ChartsSurface` components.
|
|
14
|
+
*
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [ChartContainer API](https://mui.com/x/api/charts/chart-container/)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```jsx
|
|
25
|
+
* <ChartContainerPro
|
|
26
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
27
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
28
|
+
* >
|
|
29
|
+
* <BarPlot />
|
|
30
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
31
|
+
* </ChartContainerPro>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainerProInner(props, ref) {
|
|
14
35
|
const {
|
|
15
36
|
chartDataProviderProProps,
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
children,
|
|
38
|
+
chartsSurfaceProps
|
|
18
39
|
} = useChartContainerProProps(props, ref);
|
|
19
|
-
return /*#__PURE__*/
|
|
20
|
-
children:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
})]
|
|
40
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
41
|
+
children: /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
42
|
+
children: children
|
|
43
|
+
}))
|
|
24
44
|
}));
|
|
25
45
|
});
|
|
46
|
+
|
|
47
|
+
// @ts-expect-error the type coercion breaks the prop types
|
|
26
48
|
process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
27
49
|
// ----------------------------- Warning --------------------------------
|
|
28
50
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
29
51
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
30
52
|
// ----------------------------------------------------------------------
|
|
53
|
+
apiRef: PropTypes.shape({
|
|
54
|
+
current: PropTypes.shape({
|
|
55
|
+
setZoomData: PropTypes.func.isRequired
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
31
58
|
children: PropTypes.node,
|
|
32
59
|
className: PropTypes.string,
|
|
33
60
|
/**
|
|
@@ -51,17 +78,30 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
51
78
|
*/
|
|
52
79
|
height: PropTypes.number,
|
|
53
80
|
/**
|
|
54
|
-
* The
|
|
81
|
+
* The highlighted item.
|
|
82
|
+
* Used when the highlight is controlled.
|
|
55
83
|
*/
|
|
56
84
|
highlightedItem: PropTypes.shape({
|
|
57
85
|
dataIndex: PropTypes.number,
|
|
58
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
86
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
59
87
|
}),
|
|
88
|
+
/**
|
|
89
|
+
* This prop is used to help implement the accessibility logic.
|
|
90
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
91
|
+
*/
|
|
92
|
+
id: PropTypes.string,
|
|
93
|
+
/**
|
|
94
|
+
* The list of zoom data related to each axis.
|
|
95
|
+
*/
|
|
96
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
97
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
98
|
+
end: PropTypes.number.isRequired,
|
|
99
|
+
start: PropTypes.number.isRequired
|
|
100
|
+
})),
|
|
60
101
|
/**
|
|
61
102
|
* The margin between the SVG and the drawing area.
|
|
62
103
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
63
104
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
64
|
-
* @default object Depends on the charts type.
|
|
65
105
|
*/
|
|
66
106
|
margin: PropTypes.shape({
|
|
67
107
|
bottom: PropTypes.number,
|
|
@@ -81,40 +121,20 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
81
121
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
82
122
|
*/
|
|
83
123
|
onZoomChange: PropTypes.func,
|
|
84
|
-
/**
|
|
85
|
-
* An array of plugins defining how to preprocess data.
|
|
86
|
-
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
87
|
-
*/
|
|
88
|
-
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
89
|
-
/**
|
|
90
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
91
|
-
* before it renders for the first time.
|
|
92
|
-
*
|
|
93
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
94
|
-
* the first render, like when used inside a grid.
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
99
124
|
/**
|
|
100
125
|
* The array of series to display.
|
|
101
126
|
* Each type of series has its own specificity.
|
|
102
127
|
* Please refer to the appropriate docs page to learn more about it.
|
|
103
128
|
*/
|
|
104
|
-
series: PropTypes.arrayOf(PropTypes.object)
|
|
129
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
105
130
|
/**
|
|
106
131
|
* If `true`, animations are skipped.
|
|
107
132
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
108
133
|
*/
|
|
109
134
|
skipAnimation: PropTypes.bool,
|
|
110
135
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
136
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
111
137
|
title: PropTypes.string,
|
|
112
|
-
viewBox: PropTypes.shape({
|
|
113
|
-
height: PropTypes.number,
|
|
114
|
-
width: PropTypes.number,
|
|
115
|
-
x: PropTypes.number,
|
|
116
|
-
y: PropTypes.number
|
|
117
|
-
}),
|
|
118
138
|
/**
|
|
119
139
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
120
140
|
*/
|
|
@@ -150,7 +170,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
150
170
|
hideTooltip: PropTypes.bool,
|
|
151
171
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
152
172
|
label: PropTypes.string,
|
|
153
|
-
labelFontSize: PropTypes.number,
|
|
154
173
|
labelStyle: PropTypes.object,
|
|
155
174
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
156
175
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -161,7 +180,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
161
180
|
slots: PropTypes.object,
|
|
162
181
|
stroke: PropTypes.string,
|
|
163
182
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
164
|
-
tickFontSize: PropTypes.number,
|
|
165
183
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
166
184
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
167
185
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -213,7 +231,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
213
231
|
hideTooltip: PropTypes.bool,
|
|
214
232
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
215
233
|
label: PropTypes.string,
|
|
216
|
-
labelFontSize: PropTypes.number,
|
|
217
234
|
labelStyle: PropTypes.object,
|
|
218
235
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
219
236
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -224,7 +241,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
224
241
|
slots: PropTypes.object,
|
|
225
242
|
stroke: PropTypes.string,
|
|
226
243
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
227
|
-
tickFontSize: PropTypes.number,
|
|
228
244
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
229
245
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
230
246
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -269,14 +285,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
269
285
|
id: PropTypes.string,
|
|
270
286
|
max: PropTypes.number,
|
|
271
287
|
min: PropTypes.number
|
|
272
|
-
})),
|
|
273
|
-
/**
|
|
274
|
-
* The list of zoom data related to each axis.
|
|
275
|
-
*/
|
|
276
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
277
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
278
|
-
end: PropTypes.number.isRequired,
|
|
279
|
-
start: PropTypes.number.isRequired
|
|
280
288
|
}))
|
|
281
289
|
} : void 0;
|
|
282
290
|
export { ChartContainerPro };
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
import { UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
|
-
import
|
|
1
|
+
import { ChartSeriesType, UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ChartDataProviderProps } from '@mui/x-charts/ChartDataProvider';
|
|
3
4
|
import type { ChartContainerProProps } from './ChartContainerPro';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const useChartContainerProProps: (props: ChartContainerProProps, ref: React.Ref<SVGSVGElement>) => {
|
|
8
|
-
chartDataProviderProProps: {
|
|
9
|
-
zoom?: import("..").ZoomData[] | undefined;
|
|
10
|
-
onZoomChange?: ((zoomData: import("..").ZoomData[] | ((zoomData: import("..").ZoomData[]) => import("..").ZoomData[])) => void) | undefined;
|
|
11
|
-
height: number;
|
|
12
|
-
width: number;
|
|
13
|
-
margin?: Partial<import("@mui/x-charts").CardinalDirections<number>> | undefined;
|
|
14
|
-
title?: string | undefined;
|
|
15
|
-
desc?: string | undefined;
|
|
16
|
-
className?: string | undefined;
|
|
17
|
-
viewBox?: {
|
|
18
|
-
x?: number;
|
|
19
|
-
y?: number;
|
|
20
|
-
width?: number;
|
|
21
|
-
height?: number;
|
|
22
|
-
} | undefined;
|
|
23
|
-
plugins?: import("@mui/x-charts/internals").ChartsPlugin<import("@mui/x-charts/internals").ChartSeriesType>[] | undefined;
|
|
24
|
-
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
25
|
-
series: (import("@mui/x-charts").ScatterSeriesType | import("@mui/x-charts").LineSeriesType | import("@mui/x-charts").BarSeriesType | import("@mui/x-charts").PieSeriesType<import("@mui/x-internals/types").MakeOptional<import("@mui/x-charts").PieValueType, "id">> | import("../models").HeatmapSeriesType)[];
|
|
26
|
-
onHighlightChange?: ((highlightedItem: import("@mui/x-charts").HighlightItemData | null) => void) | undefined;
|
|
27
|
-
skipAnimation?: boolean | undefined;
|
|
28
|
-
zAxis?: import("@mui/x-internals/types").MakeOptional<import("@mui/x-charts/internals").ZAxisConfig, "id">[] | undefined;
|
|
29
|
-
dataset?: import("@mui/x-charts/internals").DatasetType | undefined;
|
|
30
|
-
colors?: import("@mui/x-charts").ChartsColorPalette | undefined;
|
|
31
|
-
disableAxisListener?: boolean | undefined;
|
|
32
|
-
highlightedItem?: (import("@mui/x-charts").HighlightItemData | null) | undefined;
|
|
33
|
-
xAxis?: import("@mui/x-internals/types").MakeOptional<import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsXAxisProps>, "id">[];
|
|
34
|
-
yAxis?: import("@mui/x-internals/types").MakeOptional<import("@mui/x-charts").AxisConfig<import("@mui/x-charts").ScaleName, any, import("@mui/x-charts").ChartsYAxisProps>, "id">[];
|
|
35
|
-
children?: React.ReactNode;
|
|
36
|
-
};
|
|
37
|
-
resizableChartContainerProps: {
|
|
38
|
-
ownerState: {
|
|
39
|
-
width: import("@mui/x-charts").ChartContainerProps["width"];
|
|
40
|
-
height: import("@mui/x-charts").ChartContainerProps["height"];
|
|
41
|
-
};
|
|
42
|
-
ref: React.Ref<HTMLDivElement>;
|
|
43
|
-
};
|
|
44
|
-
hasIntrinsicSize: boolean;
|
|
5
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
6
|
+
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType> = Pick<UseChartContainerPropsReturnValue<TSeries>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProps<TSeries, AllPluginSignatures<TSeries>>;
|
|
45
8
|
};
|
|
9
|
+
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = keyof import("@mui/x-charts/internals").ChartsSeriesConfig>(props: ChartContainerProProps<TSeries>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries>;
|
|
@@ -2,26 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["initialZoom", "onZoomChange", "plugins", "apiRef"];
|
|
6
6
|
import { useChartContainerProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { ALL_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
7
8
|
export const useChartContainerProProps = (props, ref) => {
|
|
8
9
|
const {
|
|
9
|
-
|
|
10
|
-
onZoomChange
|
|
10
|
+
initialZoom,
|
|
11
|
+
onZoomChange,
|
|
12
|
+
plugins,
|
|
13
|
+
apiRef
|
|
11
14
|
} = props,
|
|
12
15
|
baseProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
13
16
|
const chartDataProviderProProps = {
|
|
14
|
-
|
|
17
|
+
initialZoom,
|
|
15
18
|
onZoomChange
|
|
16
19
|
};
|
|
17
20
|
const {
|
|
18
21
|
chartDataProviderProps,
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
chartsSurfaceProps,
|
|
23
|
+
children
|
|
21
24
|
} = useChartContainerProps(baseProps, ref);
|
|
22
25
|
return {
|
|
23
|
-
chartDataProviderProProps: _extends({}, chartDataProviderProps, chartDataProviderProProps
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
chartDataProviderProProps: _extends({}, chartDataProviderProps, chartDataProviderProProps, {
|
|
27
|
+
apiRef,
|
|
28
|
+
plugins: plugins ?? ALL_PLUGINS
|
|
29
|
+
}),
|
|
30
|
+
chartsSurfaceProps,
|
|
31
|
+
children
|
|
26
32
|
};
|
|
27
33
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartSeriesType, ChartAnyPluginSignature, ChartProviderProps } from '@mui/x-charts/internals';
|
|
3
|
+
import { ChartDataProviderProps } from '@mui/x-charts/ChartDataProvider';
|
|
4
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
5
|
+
export type ChartDataProviderProProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartDataProviderProps<TSeries, TSignatures> & Omit<ChartProviderProps<TSeries, TSignatures>['pluginParams'], 'children'>;
|
|
6
|
+
/**
|
|
7
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
8
|
+
*
|
|
9
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
10
|
+
*
|
|
11
|
+
* Demos:
|
|
12
|
+
*
|
|
13
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
14
|
+
*
|
|
15
|
+
* API:
|
|
16
|
+
*
|
|
17
|
+
* - [ChartDataProviderPro API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```jsx
|
|
21
|
+
* <ChartDataProviderPro
|
|
22
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
23
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
24
|
+
* >
|
|
25
|
+
* <ChartsSurface>
|
|
26
|
+
* <BarPlot />
|
|
27
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
28
|
+
* </ChartsSurface>
|
|
29
|
+
* {'Custom Legend Component'}
|
|
30
|
+
* </ChartDataProviderPro>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare function ChartDataProviderPro<TSeries extends ChartSeriesType = ChartSeriesType>(props: ChartDataProviderProProps<TSeries>): React.JSX.Element;
|
|
34
|
+
declare namespace ChartDataProviderPro {
|
|
35
|
+
var propTypes: any;
|
|
36
|
+
}
|
|
37
|
+
export { ChartDataProviderPro };
|
|
@@ -3,59 +3,68 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { HighlightedProvider, ZAxisContextProvider } from '@mui/x-charts/context';
|
|
6
|
+
import { Watermark } from '@mui/x-license/Watermark';
|
|
7
|
+
import { ChartProvider, AnimationProvider } from '@mui/x-charts/internals';
|
|
9
8
|
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { ZoomProvider } from "../ZoomProvider/index.js";
|
|
13
|
-
import { useChartContainerProProps } from "./useChartDataProviderProProps.js";
|
|
9
|
+
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
10
|
+
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
14
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
12
|
const releaseInfo = getReleaseInfo();
|
|
16
|
-
const
|
|
13
|
+
const packageIdentifier = 'x-charts-pro';
|
|
14
|
+
/**
|
|
15
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
16
|
+
*
|
|
17
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
18
|
+
*
|
|
19
|
+
* Demos:
|
|
20
|
+
*
|
|
21
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [ChartDataProviderPro API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```jsx
|
|
29
|
+
* <ChartDataProviderPro
|
|
30
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
31
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
32
|
+
* >
|
|
33
|
+
* <ChartsSurface>
|
|
34
|
+
* <BarPlot />
|
|
35
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
36
|
+
* </ChartsSurface>
|
|
37
|
+
* {'Custom Legend Component'}
|
|
38
|
+
* </ChartDataProviderPro>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function ChartDataProviderPro(props) {
|
|
17
42
|
const {
|
|
18
|
-
|
|
19
|
-
drawingProviderProps,
|
|
20
|
-
seriesProviderProps,
|
|
21
|
-
zAxisContextProps,
|
|
22
|
-
highlightedProviderProps,
|
|
23
|
-
cartesianProviderProps,
|
|
24
|
-
chartsSurfaceProps,
|
|
25
|
-
pluginProviderProps,
|
|
43
|
+
children,
|
|
26
44
|
animationProviderProps,
|
|
27
|
-
|
|
28
|
-
} =
|
|
29
|
-
useLicenseVerifier(
|
|
30
|
-
return /*#__PURE__*/_jsx(
|
|
31
|
-
children: /*#__PURE__*/
|
|
32
|
-
children: /*#__PURE__*/_jsx(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
37
|
-
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
38
|
-
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
39
|
-
children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
40
|
-
children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), children]
|
|
41
|
-
}))
|
|
42
|
-
}))
|
|
43
|
-
})
|
|
44
|
-
}))
|
|
45
|
-
}))
|
|
46
|
-
}))
|
|
47
|
-
}))
|
|
48
|
-
}))
|
|
45
|
+
chartProviderProps
|
|
46
|
+
} = useChartDataProviderProProps(props);
|
|
47
|
+
useLicenseVerifier(packageIdentifier, releaseInfo);
|
|
48
|
+
return /*#__PURE__*/_jsx(ChartProvider, _extends({}, chartProviderProps, {
|
|
49
|
+
children: /*#__PURE__*/_jsxs(AnimationProvider, _extends({}, animationProviderProps, {
|
|
50
|
+
children: [children, /*#__PURE__*/_jsx(Watermark, {
|
|
51
|
+
packageName: packageIdentifier,
|
|
52
|
+
releaseInfo: releaseInfo
|
|
53
|
+
})]
|
|
49
54
|
}))
|
|
50
55
|
}));
|
|
51
|
-
}
|
|
56
|
+
}
|
|
52
57
|
process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
53
58
|
// ----------------------------- Warning --------------------------------
|
|
54
59
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
55
60
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
56
61
|
// ----------------------------------------------------------------------
|
|
62
|
+
apiRef: PropTypes.shape({
|
|
63
|
+
current: PropTypes.shape({
|
|
64
|
+
setZoomData: PropTypes.func.isRequired
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
57
67
|
children: PropTypes.node,
|
|
58
|
-
className: PropTypes.string,
|
|
59
68
|
/**
|
|
60
69
|
* Color palette used to colorize multiple series.
|
|
61
70
|
* @default blueberryTwilightPalette
|
|
@@ -65,29 +74,35 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
65
74
|
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
66
75
|
*/
|
|
67
76
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
68
|
-
desc: PropTypes.string,
|
|
69
|
-
/**
|
|
70
|
-
* If `true`, the charts will not listen to the mouse move event.
|
|
71
|
-
* It might break interactive features, but will improve performance.
|
|
72
|
-
* @default false
|
|
73
|
-
*/
|
|
74
|
-
disableAxisListener: PropTypes.bool,
|
|
75
77
|
/**
|
|
76
|
-
* The height of the chart in px.
|
|
78
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
77
79
|
*/
|
|
78
|
-
height: PropTypes.number
|
|
80
|
+
height: PropTypes.number,
|
|
79
81
|
/**
|
|
80
|
-
* The
|
|
82
|
+
* The highlighted item.
|
|
83
|
+
* Used when the highlight is controlled.
|
|
81
84
|
*/
|
|
82
85
|
highlightedItem: PropTypes.shape({
|
|
83
86
|
dataIndex: PropTypes.number,
|
|
84
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
87
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
85
88
|
}),
|
|
89
|
+
/**
|
|
90
|
+
* This prop is used to help implement the accessibility logic.
|
|
91
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
92
|
+
*/
|
|
93
|
+
id: PropTypes.string,
|
|
94
|
+
/**
|
|
95
|
+
* The list of zoom data related to each axis.
|
|
96
|
+
*/
|
|
97
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
98
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
99
|
+
end: PropTypes.number.isRequired,
|
|
100
|
+
start: PropTypes.number.isRequired
|
|
101
|
+
})),
|
|
86
102
|
/**
|
|
87
103
|
* The margin between the SVG and the drawing area.
|
|
88
104
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
89
105
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
90
|
-
* @default object Depends on the charts type.
|
|
91
106
|
*/
|
|
92
107
|
margin: PropTypes.shape({
|
|
93
108
|
bottom: PropTypes.number,
|
|
@@ -107,34 +122,22 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
107
122
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
108
123
|
*/
|
|
109
124
|
onZoomChange: PropTypes.func,
|
|
110
|
-
/**
|
|
111
|
-
* An array of plugins defining how to preprocess data.
|
|
112
|
-
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
113
|
-
*/
|
|
114
|
-
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
115
125
|
/**
|
|
116
126
|
* The array of series to display.
|
|
117
127
|
* Each type of series has its own specificity.
|
|
118
128
|
* Please refer to the appropriate docs page to learn more about it.
|
|
119
129
|
*/
|
|
120
|
-
series: PropTypes.arrayOf(PropTypes.object)
|
|
130
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
121
131
|
/**
|
|
122
132
|
* If `true`, animations are skipped.
|
|
123
133
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
124
134
|
*/
|
|
125
135
|
skipAnimation: PropTypes.bool,
|
|
126
|
-
|
|
127
|
-
title: PropTypes.string,
|
|
128
|
-
viewBox: PropTypes.shape({
|
|
129
|
-
height: PropTypes.number,
|
|
130
|
-
width: PropTypes.number,
|
|
131
|
-
x: PropTypes.number,
|
|
132
|
-
y: PropTypes.number
|
|
133
|
-
}),
|
|
136
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
134
137
|
/**
|
|
135
|
-
* The width of the chart in px.
|
|
138
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
136
139
|
*/
|
|
137
|
-
width: PropTypes.number
|
|
140
|
+
width: PropTypes.number,
|
|
138
141
|
/**
|
|
139
142
|
* The configuration of the x-axes.
|
|
140
143
|
* If not provided, a default axis config is used.
|
|
@@ -166,7 +169,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
166
169
|
hideTooltip: PropTypes.bool,
|
|
167
170
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
168
171
|
label: PropTypes.string,
|
|
169
|
-
labelFontSize: PropTypes.number,
|
|
170
172
|
labelStyle: PropTypes.object,
|
|
171
173
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
172
174
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -177,7 +179,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
177
179
|
slots: PropTypes.object,
|
|
178
180
|
stroke: PropTypes.string,
|
|
179
181
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
180
|
-
tickFontSize: PropTypes.number,
|
|
181
182
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
182
183
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
183
184
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -229,7 +230,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
229
230
|
hideTooltip: PropTypes.bool,
|
|
230
231
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
231
232
|
label: PropTypes.string,
|
|
232
|
-
labelFontSize: PropTypes.number,
|
|
233
233
|
labelStyle: PropTypes.object,
|
|
234
234
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
235
235
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -240,7 +240,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
240
240
|
slots: PropTypes.object,
|
|
241
241
|
stroke: PropTypes.string,
|
|
242
242
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
243
|
-
tickFontSize: PropTypes.number,
|
|
244
243
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
245
244
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
246
245
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -285,14 +284,6 @@ process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
|
285
284
|
id: PropTypes.string,
|
|
286
285
|
max: PropTypes.number,
|
|
287
286
|
min: PropTypes.number
|
|
288
|
-
})),
|
|
289
|
-
/**
|
|
290
|
-
* The list of zoom data related to each axis.
|
|
291
|
-
*/
|
|
292
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
293
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
294
|
-
end: PropTypes.number.isRequired,
|
|
295
|
-
start: PropTypes.number.isRequired
|
|
296
287
|
}))
|
|
297
288
|
} : void 0;
|
|
298
289
|
export { ChartDataProviderPro };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChartAnyPluginSignature, ChartSeriesType } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartDataProviderProProps } from './ChartDataProviderPro';
|
|
3
|
+
import type { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
4
|
+
export declare const useChartDataProviderProProps: <TSeries extends ChartSeriesType = keyof import("@mui/x-charts/internals").ChartsSeriesConfig, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>) => {
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
animationProviderProps: Omit<import("@mui/x-charts/internals").AnimationProviderProps, "children">;
|
|
7
|
+
chartProviderProps: Omit<import("@mui/x-charts/internals").ChartProviderProps<TSeries, TSignatures>, "children">;
|
|
8
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useChartDataProviderProps } from '@mui/x-charts/internals';
|
|
4
|
+
export const useChartDataProviderProProps = props => {
|
|
5
|
+
const {
|
|
6
|
+
animationProviderProps,
|
|
7
|
+
chartProviderProps,
|
|
8
|
+
children
|
|
9
|
+
} = useChartDataProviderProps(props);
|
|
10
|
+
return {
|
|
11
|
+
children,
|
|
12
|
+
animationProviderProps,
|
|
13
|
+
chartProviderProps
|
|
14
|
+
};
|
|
15
|
+
};
|