@mui/x-charts-pro 8.0.0-alpha.1 → 8.0.0-alpha.11
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 +75 -34
- package/BarChartPro/BarChartPro.plugins.d.ts +10 -0
- package/BarChartPro/BarChartPro.plugins.js +3 -0
- package/CHANGELOG.md +2007 -230
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -5
- package/ChartContainerPro/ChartContainerPro.js +55 -37
- package/ChartContainerPro/useChartContainerProProps.d.ts +6 -5
- package/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +105 -0
- 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 +1 -2
- package/Heatmap/Heatmap.js +36 -13
- package/Heatmap/Heatmap.plugins.d.ts +8 -0
- package/Heatmap/Heatmap.plugins.js +2 -0
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/HeatmapTooltip.js +8 -28
- 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/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 +81 -54
- package/LineChartPro/LineChartPro.plugins.d.ts +10 -0
- package/LineChartPro/LineChartPro.plugins.js +3 -0
- package/README.md +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +59 -34
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +10 -0
- package/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- 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 -2
- package/index.js +5 -6
- 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 +75 -34
- package/modern/BarChartPro/BarChartPro.plugins.js +3 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +55 -37
- package/modern/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +105 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/modern/Heatmap/Heatmap.js +36 -13
- package/modern/Heatmap/Heatmap.plugins.js +2 -0
- package/modern/Heatmap/HeatmapItem.js +1 -1
- package/modern/Heatmap/HeatmapTooltip.js +8 -28
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/heatmapClasses.js +2 -1
- package/modern/Heatmap/plugin.js +4 -2
- package/modern/Heatmap/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.js +81 -54
- package/modern/LineChartPro/LineChartPro.plugins.js +3 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +59 -34
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- 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 -6
- 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 +74 -33
- package/node/BarChartPro/BarChartPro.plugins.js +9 -0
- package/node/ChartContainerPro/ChartContainerPro.js +54 -36
- package/node/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/node/ChartDataProviderPro/ChartDataProviderPro.js +111 -0
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- package/node/Heatmap/Heatmap.js +36 -13
- package/node/Heatmap/Heatmap.plugins.js +8 -0
- package/node/Heatmap/HeatmapItem.js +2 -2
- package/node/Heatmap/HeatmapTooltip.js +6 -26
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/heatmapClasses.js +5 -4
- package/node/Heatmap/plugin.js +4 -2
- package/node/Heatmap/tooltip.js +31 -0
- package/node/LineChartPro/LineChartPro.js +80 -53
- package/node/LineChartPro/LineChartPro.plugins.js +9 -0
- package/node/ScatterChartPro/ScatterChartPro.js +58 -33
- package/node/ScatterChartPro/ScatterChartPro.plugins.js +9 -0
- 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 -23
- 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 +6 -6
- package/typeOverloads/modules.d.ts +8 -1
- 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 -10
- package/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -299
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -14
- 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/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/ChartDataProviderPro.js +0 -299
- 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/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- package/node/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -305
- 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,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
2
|
+
import { ChartsSurfaceProps } from '@mui/x-charts/ChartsSurface';
|
|
3
|
+
import { ChartAnyPluginSignature, ChartSeriesType } from '@mui/x-charts/internals';
|
|
4
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
5
|
+
import { ChartDataProviderProProps } from '../ChartDataProviderPro';
|
|
6
|
+
export type ChartContainerProProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartDataProviderProProps<TSeries, TSignatures> & ChartsSurfaceProps;
|
|
7
|
+
type ChartContainerProComponent = <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures> & {
|
|
8
|
+
ref?: React.ForwardedRef<SVGSVGElement>;
|
|
9
|
+
}) => React.JSX.Element;
|
|
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
|
+
declare const ChartContainerPro: ChartContainerProComponent;
|
|
7
35
|
export { ChartContainerPro };
|
|
@@ -3,37 +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 { ChartsSurface } from '@mui/x-charts';
|
|
9
|
-
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
10
|
-
import { ChartDataProviderPro } from "../context/ChartDataProviderPro/index.js";
|
|
6
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
11
7
|
import { useChartContainerProProps } from "./useChartContainerProProps.js";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
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) {
|
|
15
35
|
const {
|
|
16
36
|
chartDataProviderProProps,
|
|
17
37
|
children,
|
|
18
|
-
resizableContainerProps,
|
|
19
38
|
chartsSurfaceProps
|
|
20
39
|
} = useChartContainerProProps(props, ref);
|
|
21
40
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
22
|
-
children: /*#__PURE__*/
|
|
23
|
-
children:
|
|
24
|
-
children: children
|
|
25
|
-
})), /*#__PURE__*/_jsx(Watermark, {
|
|
26
|
-
packageName: "x-charts-pro",
|
|
27
|
-
releaseInfo: releaseInfo
|
|
28
|
-
})]
|
|
41
|
+
children: /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
42
|
+
children: children
|
|
29
43
|
}))
|
|
30
44
|
}));
|
|
31
45
|
});
|
|
46
|
+
|
|
47
|
+
// @ts-expect-error the type coercion breaks the prop types
|
|
32
48
|
process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
33
49
|
// ----------------------------- Warning --------------------------------
|
|
34
50
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
35
51
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
36
52
|
// ----------------------------------------------------------------------
|
|
53
|
+
apiRef: PropTypes.shape({
|
|
54
|
+
current: PropTypes.shape({
|
|
55
|
+
setZoomData: PropTypes.func.isRequired
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
37
58
|
children: PropTypes.node,
|
|
38
59
|
className: PropTypes.string,
|
|
39
60
|
/**
|
|
@@ -57,17 +78,30 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
57
78
|
*/
|
|
58
79
|
height: PropTypes.number,
|
|
59
80
|
/**
|
|
60
|
-
* The
|
|
81
|
+
* The highlighted item.
|
|
82
|
+
* Used when the highlight is controlled.
|
|
61
83
|
*/
|
|
62
84
|
highlightedItem: PropTypes.shape({
|
|
63
85
|
dataIndex: PropTypes.number,
|
|
64
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
86
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
65
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
|
+
})),
|
|
66
101
|
/**
|
|
67
102
|
* The margin between the SVG and the drawing area.
|
|
68
103
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
69
104
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
70
|
-
* @default object Depends on the charts type.
|
|
71
105
|
*/
|
|
72
106
|
margin: PropTypes.shape({
|
|
73
107
|
bottom: PropTypes.number,
|
|
@@ -87,23 +121,19 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
87
121
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
88
122
|
*/
|
|
89
123
|
onZoomChange: PropTypes.func,
|
|
90
|
-
/**
|
|
91
|
-
* An array of plugins defining how to preprocess data.
|
|
92
|
-
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
93
|
-
*/
|
|
94
|
-
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
95
124
|
/**
|
|
96
125
|
* The array of series to display.
|
|
97
126
|
* Each type of series has its own specificity.
|
|
98
127
|
* Please refer to the appropriate docs page to learn more about it.
|
|
99
128
|
*/
|
|
100
|
-
series: PropTypes.arrayOf(PropTypes.object)
|
|
129
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
101
130
|
/**
|
|
102
131
|
* If `true`, animations are skipped.
|
|
103
132
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
104
133
|
*/
|
|
105
134
|
skipAnimation: PropTypes.bool,
|
|
106
135
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
136
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
107
137
|
title: PropTypes.string,
|
|
108
138
|
/**
|
|
109
139
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
@@ -140,7 +170,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
140
170
|
hideTooltip: PropTypes.bool,
|
|
141
171
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
142
172
|
label: PropTypes.string,
|
|
143
|
-
labelFontSize: PropTypes.number,
|
|
144
173
|
labelStyle: PropTypes.object,
|
|
145
174
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
146
175
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -151,7 +180,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
151
180
|
slots: PropTypes.object,
|
|
152
181
|
stroke: PropTypes.string,
|
|
153
182
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
154
|
-
tickFontSize: PropTypes.number,
|
|
155
183
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
156
184
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
157
185
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -203,7 +231,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
203
231
|
hideTooltip: PropTypes.bool,
|
|
204
232
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
205
233
|
label: PropTypes.string,
|
|
206
|
-
labelFontSize: PropTypes.number,
|
|
207
234
|
labelStyle: PropTypes.object,
|
|
208
235
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
209
236
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -214,7 +241,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
214
241
|
slots: PropTypes.object,
|
|
215
242
|
stroke: PropTypes.string,
|
|
216
243
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
217
|
-
tickFontSize: PropTypes.number,
|
|
218
244
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
219
245
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
220
246
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -259,14 +285,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
259
285
|
id: PropTypes.string,
|
|
260
286
|
max: PropTypes.number,
|
|
261
287
|
min: PropTypes.number
|
|
262
|
-
})),
|
|
263
|
-
/**
|
|
264
|
-
* The list of zoom data related to each axis.
|
|
265
|
-
*/
|
|
266
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
267
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
268
|
-
end: PropTypes.number.isRequired,
|
|
269
|
-
start: PropTypes.number.isRequired
|
|
270
288
|
}))
|
|
271
289
|
} : void 0;
|
|
272
290
|
export { ChartContainerPro };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartAnyPluginSignature, ChartSeriesType, UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { ChartDataProviderProps } from '@mui/x-charts/ChartDataProvider';
|
|
4
4
|
import type { ChartContainerProProps } from './ChartContainerPro';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
6
|
+
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProps<TSeries, TSignatures>;
|
|
7
8
|
};
|
|
8
|
-
export declare const useChartContainerProProps: (props: ChartContainerProProps, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue
|
|
9
|
+
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = keyof import("@mui/x-charts/internals").ChartsSeriesConfig, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -2,27 +2,31 @@
|
|
|
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
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
9
|
+
const _ref = props,
|
|
10
|
+
{
|
|
11
|
+
initialZoom,
|
|
12
|
+
onZoomChange,
|
|
13
|
+
plugins,
|
|
14
|
+
apiRef
|
|
15
|
+
} = _ref,
|
|
16
|
+
baseProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
17
17
|
const {
|
|
18
18
|
chartDataProviderProps,
|
|
19
19
|
chartsSurfaceProps,
|
|
20
|
-
resizableContainerProps,
|
|
21
20
|
children
|
|
22
21
|
} = useChartContainerProps(baseProps, ref);
|
|
22
|
+
const chartDataProviderProProps = _extends({}, chartDataProviderProps, {
|
|
23
|
+
initialZoom,
|
|
24
|
+
onZoomChange,
|
|
25
|
+
apiRef,
|
|
26
|
+
plugins: plugins ?? ALL_PLUGINS
|
|
27
|
+
});
|
|
23
28
|
return {
|
|
24
|
-
chartDataProviderProProps
|
|
25
|
-
resizableContainerProps,
|
|
29
|
+
chartDataProviderProProps,
|
|
26
30
|
chartsSurfaceProps,
|
|
27
31
|
children
|
|
28
32
|
};
|
|
@@ -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, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProProps<TSeries, TSignatures>): React.JSX.Element;
|
|
34
|
+
declare namespace ChartDataProviderPro {
|
|
35
|
+
var propTypes: any;
|
|
36
|
+
}
|
|
37
|
+
export { ChartDataProviderPro };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { Watermark } from '@mui/x-license/Watermark';
|
|
7
|
+
import { ChartProvider, AnimationProvider } from '@mui/x-charts/internals';
|
|
8
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
9
|
+
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
10
|
+
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const releaseInfo = getReleaseInfo();
|
|
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) {
|
|
42
|
+
const {
|
|
43
|
+
children,
|
|
44
|
+
animationProviderProps,
|
|
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
|
+
})]
|
|
54
|
+
}))
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
58
|
+
// ----------------------------- Warning --------------------------------
|
|
59
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
60
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
61
|
+
// ----------------------------------------------------------------------
|
|
62
|
+
apiRef: PropTypes.any,
|
|
63
|
+
children: PropTypes.node,
|
|
64
|
+
/**
|
|
65
|
+
* Color palette used to colorize multiple series.
|
|
66
|
+
* @default rainbowSurgePalette
|
|
67
|
+
*/
|
|
68
|
+
colors: PropTypes.any,
|
|
69
|
+
/**
|
|
70
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
71
|
+
*/
|
|
72
|
+
dataset: PropTypes.any,
|
|
73
|
+
/**
|
|
74
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
75
|
+
*/
|
|
76
|
+
height: PropTypes.any,
|
|
77
|
+
/**
|
|
78
|
+
* This prop is used to help implement the accessibility logic.
|
|
79
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
80
|
+
*/
|
|
81
|
+
id: PropTypes.any,
|
|
82
|
+
/**
|
|
83
|
+
* The margin between the SVG and the drawing area.
|
|
84
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
85
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
86
|
+
*/
|
|
87
|
+
margin: PropTypes.any,
|
|
88
|
+
/**
|
|
89
|
+
* The array of series to display.
|
|
90
|
+
* Each type of series has its own specificity.
|
|
91
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
92
|
+
*/
|
|
93
|
+
series: PropTypes.any,
|
|
94
|
+
/**
|
|
95
|
+
* If `true`, animations are skipped.
|
|
96
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
97
|
+
*/
|
|
98
|
+
skipAnimation: PropTypes.any,
|
|
99
|
+
theme: PropTypes.any,
|
|
100
|
+
/**
|
|
101
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
102
|
+
*/
|
|
103
|
+
width: PropTypes.any
|
|
104
|
+
} : void 0;
|
|
105
|
+
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
|
+
};
|
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { MakeOptional } from '@mui/x-internals/types';
|
|
|
3
3
|
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
4
4
|
import { ChartsTooltipProps } from '@mui/x-charts/ChartsTooltip';
|
|
5
5
|
import { ChartsAxisSlots, ChartsAxisSlotProps, ChartsXAxisProps, ChartsYAxisProps, AxisConfig } from '@mui/x-charts/internals';
|
|
6
|
-
import { ChartsOnAxisClickHandlerProps } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
7
6
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
8
7
|
import { ChartContainerProProps } from '../ChartContainerPro';
|
|
9
8
|
import { HeatmapSeriesType } from '../models/seriesType/heatmap';
|
|
@@ -19,7 +18,7 @@ export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, Heatm
|
|
|
19
18
|
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
20
19
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
21
20
|
}
|
|
22
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'
|
|
21
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
23
22
|
/**
|
|
24
23
|
* The configuration of the x-axes.
|
|
25
24
|
* If not provided, a default axis config is used.
|
package/Heatmap/Heatmap.js
CHANGED
|
@@ -8,15 +8,18 @@ import useId from '@mui/utils/useId';
|
|
|
8
8
|
import { interpolateRgbBasis } from '@mui/x-charts-vendor/d3-interpolate';
|
|
9
9
|
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
10
10
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
11
|
-
import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
12
11
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
13
12
|
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
14
13
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
15
14
|
import { plugin as heatmapPlugin } from "./plugin.js";
|
|
16
15
|
import { HeatmapTooltip } from "./HeatmapTooltip.js";
|
|
16
|
+
import { HEATMAP_PLUGINS } from "./Heatmap.plugins.js";
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
// The GnBu: https://github.com/d3/d3-scale-chromatic/blob/main/src/sequential-multi/GnBu.js
|
|
19
19
|
const defaultColorMap = interpolateRgbBasis(['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081']);
|
|
20
|
+
const seriesConfig = {
|
|
21
|
+
heatmap: heatmapPlugin
|
|
22
|
+
};
|
|
20
23
|
const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
21
24
|
const props = useThemeProps({
|
|
22
25
|
props: inProps,
|
|
@@ -66,7 +69,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
66
69
|
const Tooltip = props.slots?.tooltip ?? HeatmapTooltip;
|
|
67
70
|
return /*#__PURE__*/_jsxs(ChartContainerPro, {
|
|
68
71
|
ref: ref,
|
|
69
|
-
|
|
72
|
+
seriesConfig: seriesConfig,
|
|
70
73
|
series: series.map(s => _extends({
|
|
71
74
|
type: 'heatmap'
|
|
72
75
|
}, s)),
|
|
@@ -82,9 +85,9 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
82
85
|
disableAxisListener: true,
|
|
83
86
|
highlightedItem: highlightedItem,
|
|
84
87
|
onHighlightChange: onHighlightChange,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
onAxisClick: onAxisClick,
|
|
89
|
+
plugins: HEATMAP_PLUGINS,
|
|
90
|
+
children: [/*#__PURE__*/_jsxs("g", {
|
|
88
91
|
clipPath: `url(#${clipPathId})`,
|
|
89
92
|
children: [/*#__PURE__*/_jsx(HeatmapPlot, {
|
|
90
93
|
slots: slots,
|
|
@@ -111,6 +114,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
111
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
112
115
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
113
116
|
// ----------------------------------------------------------------------
|
|
117
|
+
apiRef: PropTypes.shape({
|
|
118
|
+
current: PropTypes.shape({
|
|
119
|
+
setZoomData: PropTypes.func.isRequired
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
114
122
|
/**
|
|
115
123
|
* Indicate which axis to display the bottom of the charts.
|
|
116
124
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
@@ -121,7 +129,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
121
129
|
className: PropTypes.string,
|
|
122
130
|
/**
|
|
123
131
|
* Color palette used to colorize multiple series.
|
|
124
|
-
* @default
|
|
132
|
+
* @default rainbowSurgePalette
|
|
125
133
|
*/
|
|
126
134
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
127
135
|
/**
|
|
@@ -140,12 +148,26 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
140
148
|
*/
|
|
141
149
|
height: PropTypes.number,
|
|
142
150
|
/**
|
|
143
|
-
* The
|
|
151
|
+
* The highlighted item.
|
|
152
|
+
* Used when the highlight is controlled.
|
|
144
153
|
*/
|
|
145
154
|
highlightedItem: PropTypes.shape({
|
|
146
155
|
dataIndex: PropTypes.number,
|
|
147
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
156
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
148
157
|
}),
|
|
158
|
+
/**
|
|
159
|
+
* This prop is used to help implement the accessibility logic.
|
|
160
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
161
|
+
*/
|
|
162
|
+
id: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* The list of zoom data related to each axis.
|
|
165
|
+
*/
|
|
166
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
167
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
168
|
+
end: PropTypes.number.isRequired,
|
|
169
|
+
start: PropTypes.number.isRequired
|
|
170
|
+
})),
|
|
149
171
|
/**
|
|
150
172
|
* Indicate which axis to display the left of the charts.
|
|
151
173
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -161,7 +183,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
161
183
|
* The margin between the SVG and the drawing area.
|
|
162
184
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
163
185
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
164
|
-
* @default object Depends on the charts type.
|
|
165
186
|
*/
|
|
166
187
|
margin: PropTypes.shape({
|
|
167
188
|
bottom: PropTypes.number,
|
|
@@ -193,6 +214,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
193
214
|
* An array of [[HeatmapSeriesType]] objects.
|
|
194
215
|
*/
|
|
195
216
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
217
|
+
/**
|
|
218
|
+
* The configuration helpers used to compute attributes according to the serries type.
|
|
219
|
+
* @ignore Unstable props for internal usage.
|
|
220
|
+
*/
|
|
221
|
+
seriesConfig: PropTypes.object,
|
|
196
222
|
/**
|
|
197
223
|
* The props used for each component slot.
|
|
198
224
|
* @default {}
|
|
@@ -204,6 +230,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
204
230
|
*/
|
|
205
231
|
slots: PropTypes.object,
|
|
206
232
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
233
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
207
234
|
title: PropTypes.string,
|
|
208
235
|
/**
|
|
209
236
|
* The configuration of the tooltip.
|
|
@@ -253,7 +280,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
253
280
|
hideTooltip: PropTypes.bool,
|
|
254
281
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
255
282
|
label: PropTypes.string,
|
|
256
|
-
labelFontSize: PropTypes.number,
|
|
257
283
|
labelStyle: PropTypes.object,
|
|
258
284
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
259
285
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -264,7 +290,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
264
290
|
slots: PropTypes.object,
|
|
265
291
|
stroke: PropTypes.string,
|
|
266
292
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
267
|
-
tickFontSize: PropTypes.number,
|
|
268
293
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
269
294
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
270
295
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -318,7 +343,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
318
343
|
hideTooltip: PropTypes.bool,
|
|
319
344
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
320
345
|
label: PropTypes.string,
|
|
321
|
-
labelFontSize: PropTypes.number,
|
|
322
346
|
labelStyle: PropTypes.object,
|
|
323
347
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
324
348
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -329,7 +353,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
329
353
|
slots: PropTypes.object,
|
|
330
354
|
stroke: PropTypes.string,
|
|
331
355
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
332
|
-
tickFontSize: PropTypes.number,
|
|
333
356
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
334
357
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
335
358
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
+
export type HeatmapPluginsSignatures = [
|
|
3
|
+
UseChartZAxisSignature,
|
|
4
|
+
UseChartCartesianAxisSignature<'heatmap'>,
|
|
5
|
+
UseChartInteractionSignature,
|
|
6
|
+
UseChartHighlightSignature
|
|
7
|
+
];
|
|
8
|
+
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginsSignatures>;
|
package/Heatmap/HeatmapItem.js
CHANGED
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
-
import { useItemHighlighted } from '@mui/x-charts/
|
|
9
|
+
import { useItemHighlighted } from '@mui/x-charts/hooks';
|
|
10
10
|
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
11
11
|
import { getHeatmapUtilityClass } from "./heatmapClasses.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|