@mui/x-charts-pro 8.0.0-alpha.7 → 8.0.0-alpha.9
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 +55 -20
- package/CHANGELOG.md +551 -3
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
- package/ChartContainerPro/ChartContainerPro.js +52 -27
- package/ChartContainerPro/useChartContainerProProps.d.ts +6 -5
- package/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +292 -0
- package/{context → ChartDataProviderPro}/package.json +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +17 -0
- package/Heatmap/Heatmap.js +28 -2
- package/Heatmap/HeatmapTooltip.js +6 -4
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +2 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +58 -37
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +36 -28
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- 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 +10 -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 +1 -1
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +55 -20
- package/modern/ChartContainerPro/ChartContainerPro.js +52 -27
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +292 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +17 -0
- package/modern/Heatmap/Heatmap.js +28 -2
- package/modern/Heatmap/HeatmapTooltip.js +6 -4
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/plugin.js +2 -2
- package/modern/LineChartPro/LineChartPro.js +58 -37
- package/modern/ScatterChartPro/ScatterChartPro.js +36 -28
- 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 +1 -1
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +55 -20
- package/node/ChartContainerPro/ChartContainerPro.js +51 -26
- package/node/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/node/ChartDataProviderPro/ChartDataProviderPro.js +298 -0
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +23 -0
- package/node/Heatmap/Heatmap.js +28 -2
- package/node/Heatmap/HeatmapTooltip.js +4 -2
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/plugin.js +2 -2
- package/node/LineChartPro/LineChartPro.js +58 -37
- package/node/ScatterChartPro/ScatterChartPro.js +36 -28
- 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 +1 -1
- package/package.json +5 -5
- 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 -13
- 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/ChartDataProviderPro.js +0 -50
- 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 -50
- 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 -56
- 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
|
@@ -0,0 +1,292 @@
|
|
|
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 { HighlightedProvider } from '@mui/x-charts/context';
|
|
9
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
10
|
+
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
11
|
+
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const releaseInfo = getReleaseInfo();
|
|
14
|
+
const packageIdentifier = 'x-charts-pro';
|
|
15
|
+
/**
|
|
16
|
+
* Orchestrates the data providers for the chart components and hooks.
|
|
17
|
+
*
|
|
18
|
+
* Use this component if you have custom HTML components that need to access the chart data.
|
|
19
|
+
*
|
|
20
|
+
* Demos:
|
|
21
|
+
*
|
|
22
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
23
|
+
*
|
|
24
|
+
* API:
|
|
25
|
+
*
|
|
26
|
+
* - [ChartDataProviderPro API](https://mui.com/x/api/charts/chart-data-provider/)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* <ChartDataProviderPro
|
|
31
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
32
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
33
|
+
* >
|
|
34
|
+
* <ChartsSurface>
|
|
35
|
+
* <BarPlot />
|
|
36
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
37
|
+
* </ChartsSurface>
|
|
38
|
+
* {'Custom Legend Component'}
|
|
39
|
+
* </ChartDataProviderPro>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
function ChartDataProviderPro(props) {
|
|
43
|
+
const {
|
|
44
|
+
children,
|
|
45
|
+
highlightedProviderProps,
|
|
46
|
+
animationProviderProps,
|
|
47
|
+
chartProviderProps
|
|
48
|
+
} = useChartDataProviderProProps(props);
|
|
49
|
+
useLicenseVerifier(packageIdentifier, releaseInfo);
|
|
50
|
+
return /*#__PURE__*/_jsx(ChartProvider, _extends({}, chartProviderProps, {
|
|
51
|
+
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
52
|
+
children: /*#__PURE__*/_jsxs(AnimationProvider, _extends({}, animationProviderProps, {
|
|
53
|
+
children: [children, /*#__PURE__*/_jsx(Watermark, {
|
|
54
|
+
packageName: packageIdentifier,
|
|
55
|
+
releaseInfo: releaseInfo
|
|
56
|
+
})]
|
|
57
|
+
}))
|
|
58
|
+
}))
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
62
|
+
// ----------------------------- Warning --------------------------------
|
|
63
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
64
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
65
|
+
// ----------------------------------------------------------------------
|
|
66
|
+
apiRef: PropTypes.shape({
|
|
67
|
+
current: PropTypes.shape({
|
|
68
|
+
setZoomData: PropTypes.func.isRequired
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
children: PropTypes.node,
|
|
72
|
+
/**
|
|
73
|
+
* Color palette used to colorize multiple series.
|
|
74
|
+
* @default blueberryTwilightPalette
|
|
75
|
+
*/
|
|
76
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
77
|
+
/**
|
|
78
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
79
|
+
*/
|
|
80
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
81
|
+
/**
|
|
82
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
83
|
+
*/
|
|
84
|
+
height: PropTypes.number,
|
|
85
|
+
/**
|
|
86
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
87
|
+
*/
|
|
88
|
+
highlightedItem: PropTypes.shape({
|
|
89
|
+
dataIndex: PropTypes.number,
|
|
90
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
91
|
+
}),
|
|
92
|
+
/**
|
|
93
|
+
* This prop is used to help implement the accessibility logic.
|
|
94
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
95
|
+
*/
|
|
96
|
+
id: PropTypes.string,
|
|
97
|
+
/**
|
|
98
|
+
* The list of zoom data related to each axis.
|
|
99
|
+
*/
|
|
100
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
101
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
102
|
+
end: PropTypes.number.isRequired,
|
|
103
|
+
start: PropTypes.number.isRequired
|
|
104
|
+
})),
|
|
105
|
+
/**
|
|
106
|
+
* The margin between the SVG and the drawing area.
|
|
107
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
108
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
109
|
+
*/
|
|
110
|
+
margin: PropTypes.shape({
|
|
111
|
+
bottom: PropTypes.number,
|
|
112
|
+
left: PropTypes.number,
|
|
113
|
+
right: PropTypes.number,
|
|
114
|
+
top: PropTypes.number
|
|
115
|
+
}),
|
|
116
|
+
/**
|
|
117
|
+
* The callback fired when the highlighted item changes.
|
|
118
|
+
*
|
|
119
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
120
|
+
*/
|
|
121
|
+
onHighlightChange: PropTypes.func,
|
|
122
|
+
/**
|
|
123
|
+
* Callback fired when the zoom has changed.
|
|
124
|
+
*
|
|
125
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
126
|
+
*/
|
|
127
|
+
onZoomChange: PropTypes.func,
|
|
128
|
+
/**
|
|
129
|
+
* The array of series to display.
|
|
130
|
+
* Each type of series has its own specificity.
|
|
131
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
132
|
+
*/
|
|
133
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
134
|
+
/**
|
|
135
|
+
* If `true`, animations are skipped.
|
|
136
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
137
|
+
*/
|
|
138
|
+
skipAnimation: PropTypes.bool,
|
|
139
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
140
|
+
/**
|
|
141
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
142
|
+
*/
|
|
143
|
+
width: PropTypes.number,
|
|
144
|
+
/**
|
|
145
|
+
* The configuration of the x-axes.
|
|
146
|
+
* If not provided, a default axis config is used.
|
|
147
|
+
* An array of [[AxisConfig]] objects.
|
|
148
|
+
*/
|
|
149
|
+
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
150
|
+
classes: PropTypes.object,
|
|
151
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
152
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
153
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
154
|
+
unknownColor: PropTypes.string,
|
|
155
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
156
|
+
}), PropTypes.shape({
|
|
157
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
158
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
159
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
160
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
161
|
+
}), PropTypes.shape({
|
|
162
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
163
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
164
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
165
|
+
})]),
|
|
166
|
+
data: PropTypes.array,
|
|
167
|
+
dataKey: PropTypes.string,
|
|
168
|
+
disableLine: PropTypes.bool,
|
|
169
|
+
disableTicks: PropTypes.bool,
|
|
170
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
171
|
+
fill: PropTypes.string,
|
|
172
|
+
hideTooltip: PropTypes.bool,
|
|
173
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
174
|
+
label: PropTypes.string,
|
|
175
|
+
labelStyle: PropTypes.object,
|
|
176
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
177
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
178
|
+
position: PropTypes.oneOf(['bottom', 'top']),
|
|
179
|
+
reverse: PropTypes.bool,
|
|
180
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
181
|
+
slotProps: PropTypes.object,
|
|
182
|
+
slots: PropTypes.object,
|
|
183
|
+
stroke: PropTypes.string,
|
|
184
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
185
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
186
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
187
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
188
|
+
tickLabelStyle: PropTypes.object,
|
|
189
|
+
tickMaxStep: PropTypes.number,
|
|
190
|
+
tickMinStep: PropTypes.number,
|
|
191
|
+
tickNumber: PropTypes.number,
|
|
192
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
193
|
+
tickSize: PropTypes.number,
|
|
194
|
+
valueFormatter: PropTypes.func,
|
|
195
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
196
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
197
|
+
maxEnd: PropTypes.number,
|
|
198
|
+
maxSpan: PropTypes.number,
|
|
199
|
+
minSpan: PropTypes.number,
|
|
200
|
+
minStart: PropTypes.number,
|
|
201
|
+
panning: PropTypes.bool,
|
|
202
|
+
step: PropTypes.number
|
|
203
|
+
}), PropTypes.bool])
|
|
204
|
+
})),
|
|
205
|
+
/**
|
|
206
|
+
* The configuration of the y-axes.
|
|
207
|
+
* If not provided, a default axis config is used.
|
|
208
|
+
* An array of [[AxisConfig]] objects.
|
|
209
|
+
*/
|
|
210
|
+
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
211
|
+
classes: PropTypes.object,
|
|
212
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
213
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
214
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
215
|
+
unknownColor: PropTypes.string,
|
|
216
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
217
|
+
}), PropTypes.shape({
|
|
218
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
219
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
220
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
221
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
222
|
+
}), PropTypes.shape({
|
|
223
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
224
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
225
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
226
|
+
})]),
|
|
227
|
+
data: PropTypes.array,
|
|
228
|
+
dataKey: PropTypes.string,
|
|
229
|
+
disableLine: PropTypes.bool,
|
|
230
|
+
disableTicks: PropTypes.bool,
|
|
231
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
232
|
+
fill: PropTypes.string,
|
|
233
|
+
hideTooltip: PropTypes.bool,
|
|
234
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
235
|
+
label: PropTypes.string,
|
|
236
|
+
labelStyle: PropTypes.object,
|
|
237
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
238
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
239
|
+
position: PropTypes.oneOf(['left', 'right']),
|
|
240
|
+
reverse: PropTypes.bool,
|
|
241
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
242
|
+
slotProps: PropTypes.object,
|
|
243
|
+
slots: PropTypes.object,
|
|
244
|
+
stroke: PropTypes.string,
|
|
245
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
246
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
247
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
248
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
249
|
+
tickLabelStyle: PropTypes.object,
|
|
250
|
+
tickMaxStep: PropTypes.number,
|
|
251
|
+
tickMinStep: PropTypes.number,
|
|
252
|
+
tickNumber: PropTypes.number,
|
|
253
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
254
|
+
tickSize: PropTypes.number,
|
|
255
|
+
valueFormatter: PropTypes.func,
|
|
256
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
257
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
258
|
+
maxEnd: PropTypes.number,
|
|
259
|
+
maxSpan: PropTypes.number,
|
|
260
|
+
minSpan: PropTypes.number,
|
|
261
|
+
minStart: PropTypes.number,
|
|
262
|
+
panning: PropTypes.bool,
|
|
263
|
+
step: PropTypes.number
|
|
264
|
+
}), PropTypes.bool])
|
|
265
|
+
})),
|
|
266
|
+
/**
|
|
267
|
+
* The configuration of the z-axes.
|
|
268
|
+
*/
|
|
269
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
270
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
271
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
272
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
273
|
+
unknownColor: PropTypes.string,
|
|
274
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
275
|
+
}), PropTypes.shape({
|
|
276
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
277
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
278
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
279
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
280
|
+
}), PropTypes.shape({
|
|
281
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
282
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
283
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
284
|
+
})]),
|
|
285
|
+
data: PropTypes.array,
|
|
286
|
+
dataKey: PropTypes.string,
|
|
287
|
+
id: PropTypes.string,
|
|
288
|
+
max: PropTypes.number,
|
|
289
|
+
min: PropTypes.number
|
|
290
|
+
}))
|
|
291
|
+
} : void 0;
|
|
292
|
+
export { ChartDataProviderPro };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useChartDataProviderProps } from '@mui/x-charts/internals';
|
|
4
|
+
export const useChartDataProviderProProps = props => {
|
|
5
|
+
const {
|
|
6
|
+
animationProviderProps,
|
|
7
|
+
chartProviderProps,
|
|
8
|
+
highlightedProviderProps,
|
|
9
|
+
children
|
|
10
|
+
} = useChartDataProviderProps(props);
|
|
11
|
+
return {
|
|
12
|
+
children,
|
|
13
|
+
highlightedProviderProps,
|
|
14
|
+
animationProviderProps,
|
|
15
|
+
chartProviderProps
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -17,6 +17,9 @@ import { HeatmapTooltip } from "./HeatmapTooltip.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)),
|
|
@@ -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`.
|
|
@@ -146,6 +154,19 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
146
154
|
dataIndex: PropTypes.number,
|
|
147
155
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
148
156
|
}),
|
|
157
|
+
/**
|
|
158
|
+
* This prop is used to help implement the accessibility logic.
|
|
159
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
160
|
+
*/
|
|
161
|
+
id: PropTypes.string,
|
|
162
|
+
/**
|
|
163
|
+
* The list of zoom data related to each axis.
|
|
164
|
+
*/
|
|
165
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
166
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
167
|
+
end: PropTypes.number.isRequired,
|
|
168
|
+
start: PropTypes.number.isRequired
|
|
169
|
+
})),
|
|
149
170
|
/**
|
|
150
171
|
* Indicate which axis to display the left of the charts.
|
|
151
172
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -161,7 +182,6 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
161
182
|
* The margin between the SVG and the drawing area.
|
|
162
183
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
163
184
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
164
|
-
* @default object Depends on the charts type.
|
|
165
185
|
*/
|
|
166
186
|
margin: PropTypes.shape({
|
|
167
187
|
bottom: PropTypes.number,
|
|
@@ -193,6 +213,11 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
193
213
|
* An array of [[HeatmapSeriesType]] objects.
|
|
194
214
|
*/
|
|
195
215
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
216
|
+
/**
|
|
217
|
+
* The configuration helpers used to compute attributes according to the serries type.
|
|
218
|
+
* @ignore Unstable props for internal usage.
|
|
219
|
+
*/
|
|
220
|
+
seriesConfig: PropTypes.object,
|
|
196
221
|
/**
|
|
197
222
|
* The props used for each component slot.
|
|
198
223
|
* @default {}
|
|
@@ -204,6 +229,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
204
229
|
*/
|
|
205
230
|
slots: PropTypes.object,
|
|
206
231
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
232
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
207
233
|
title: PropTypes.string,
|
|
208
234
|
/**
|
|
209
235
|
* The configuration of the tooltip.
|
|
@@ -6,9 +6,9 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
-
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell,
|
|
9
|
+
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, useItemTooltip, getChartsTooltipUtilityClass, ChartsTooltipContainer } from '@mui/x-charts/ChartsTooltip';
|
|
10
10
|
import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
|
|
11
|
-
import { getLabel } from '@mui/x-charts/internals';
|
|
11
|
+
import { getLabel, ChartsLabelMark } from '@mui/x-charts/internals';
|
|
12
12
|
import { useHeatmapSeries } from "../hooks/useSeries.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const useUtilityClasses = ownerState => {
|
|
@@ -47,7 +47,8 @@ function DefaultHeatmapTooltipContent(props) {
|
|
|
47
47
|
const {
|
|
48
48
|
color,
|
|
49
49
|
value,
|
|
50
|
-
identifier
|
|
50
|
+
identifier,
|
|
51
|
+
markType
|
|
51
52
|
} = tooltipData;
|
|
52
53
|
const [xIndex, yIndex] = value;
|
|
53
54
|
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
@@ -80,7 +81,8 @@ function DefaultHeatmapTooltipContent(props) {
|
|
|
80
81
|
className: classes?.row,
|
|
81
82
|
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
82
83
|
className: clsx(classes?.markCell, classes?.cell),
|
|
83
|
-
children: /*#__PURE__*/_jsx(
|
|
84
|
+
children: /*#__PURE__*/_jsx(ChartsLabelMark, {
|
|
85
|
+
type: markType,
|
|
84
86
|
color: color,
|
|
85
87
|
className: classes?.mark
|
|
86
88
|
})
|
package/modern/Heatmap/plugin.js
CHANGED
|
@@ -2,9 +2,9 @@ import { getBaseExtremum } from "./extremums.js";
|
|
|
2
2
|
import formatter from "./formatter.js";
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
export const plugin = {
|
|
5
|
-
|
|
6
|
-
seriesFormatter: formatter,
|
|
5
|
+
seriesProcessor: formatter,
|
|
7
6
|
colorProcessor: getColor,
|
|
7
|
+
legendGetter: () => [],
|
|
8
8
|
xExtremumGetter: getBaseExtremum,
|
|
9
9
|
yExtremumGetter: getBaseExtremum
|
|
10
10
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["initialZoom", "onZoomChange", "apiRef"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
@@ -17,17 +17,14 @@ import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
|
17
17
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
18
18
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
19
19
|
import { useLineChartProps, ChartsWrapper } from '@mui/x-charts/internals';
|
|
20
|
-
import {
|
|
21
|
-
import { useZoom } from "../context/ZoomProvider/useZoom.js";
|
|
22
|
-
import { ChartDataProviderPro } from "../context/ChartDataProviderPro/index.js";
|
|
20
|
+
import { useIsZoomInteracting } from "../hooks/zoom/index.js";
|
|
23
21
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
22
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
24
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
24
|
function AreaPlotZoom(props) {
|
|
26
|
-
const
|
|
27
|
-
isInteracting
|
|
28
|
-
} = useZoom();
|
|
25
|
+
const isInteracting = useIsZoomInteracting();
|
|
29
26
|
return /*#__PURE__*/_jsx(AreaPlot, _extends({}, props, {
|
|
30
|
-
skipAnimation: isInteracting ||
|
|
27
|
+
skipAnimation: isInteracting || props.skipAnimation
|
|
31
28
|
}));
|
|
32
29
|
}
|
|
33
30
|
process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
@@ -58,11 +55,9 @@ process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
|
58
55
|
slots: PropTypes.object
|
|
59
56
|
} : void 0;
|
|
60
57
|
function LinePlotZoom(props) {
|
|
61
|
-
const
|
|
62
|
-
isInteracting
|
|
63
|
-
} = useZoom();
|
|
58
|
+
const isInteracting = useIsZoomInteracting();
|
|
64
59
|
return /*#__PURE__*/_jsx(LinePlot, _extends({}, props, {
|
|
65
|
-
skipAnimation: isInteracting ||
|
|
60
|
+
skipAnimation: isInteracting || props.skipAnimation
|
|
66
61
|
}));
|
|
67
62
|
}
|
|
68
63
|
process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
@@ -93,9 +88,7 @@ process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
|
93
88
|
slots: PropTypes.object
|
|
94
89
|
} : void 0;
|
|
95
90
|
function MarkPlotZoom(props) {
|
|
96
|
-
const
|
|
97
|
-
isInteracting
|
|
98
|
-
} = useZoom();
|
|
91
|
+
const isInteracting = useIsZoomInteracting();
|
|
99
92
|
return /*#__PURE__*/_jsx(MarkPlot, _extends({}, props, {
|
|
100
93
|
skipAnimation: isInteracting || undefined
|
|
101
94
|
}));
|
|
@@ -105,12 +98,6 @@ process.env.NODE_ENV !== "production" ? MarkPlotZoom.propTypes = {
|
|
|
105
98
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
106
99
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
107
100
|
// ----------------------------------------------------------------------
|
|
108
|
-
/**
|
|
109
|
-
* If `true` the mark element will only be able to render circle.
|
|
110
|
-
* Giving fewer customization options, but saving around 40ms per 1.000 marks.
|
|
111
|
-
* @default false
|
|
112
|
-
*/
|
|
113
|
-
experimentalRendering: PropTypes.bool,
|
|
114
101
|
/**
|
|
115
102
|
* Callback fired when a line mark item is clicked.
|
|
116
103
|
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
@@ -149,8 +136,9 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
149
136
|
name: 'MuiLineChartPro'
|
|
150
137
|
});
|
|
151
138
|
const {
|
|
152
|
-
|
|
153
|
-
onZoomChange
|
|
139
|
+
initialZoom,
|
|
140
|
+
onZoomChange,
|
|
141
|
+
apiRef
|
|
154
142
|
} = props,
|
|
155
143
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
156
144
|
const {
|
|
@@ -173,11 +161,13 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
173
161
|
const {
|
|
174
162
|
chartDataProviderProProps,
|
|
175
163
|
chartsSurfaceProps
|
|
176
|
-
} = useChartContainerProProps(chartContainerProps,
|
|
164
|
+
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
165
|
+
initialZoom,
|
|
166
|
+
onZoomChange,
|
|
167
|
+
apiRef
|
|
168
|
+
}), ref);
|
|
177
169
|
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
178
170
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
179
|
-
zoom: zoom,
|
|
180
|
-
onZoomChange: onZoomChange,
|
|
181
171
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
182
172
|
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
183
173
|
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
@@ -185,7 +175,7 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
185
175
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
186
176
|
"data-drawing-container": true,
|
|
187
177
|
children: /*#__PURE__*/_jsx(MarkPlotZoom, _extends({}, markPlotProps))
|
|
188
|
-
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)),
|
|
178
|
+
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
189
179
|
}))]
|
|
190
180
|
}))
|
|
191
181
|
}));
|
|
@@ -195,6 +185,11 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
195
185
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
196
186
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
197
187
|
// ----------------------------------------------------------------------
|
|
188
|
+
apiRef: PropTypes.shape({
|
|
189
|
+
current: PropTypes.shape({
|
|
190
|
+
setZoomData: PropTypes.func.isRequired
|
|
191
|
+
})
|
|
192
|
+
}),
|
|
198
193
|
/**
|
|
199
194
|
* The configuration of axes highlight.
|
|
200
195
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -232,10 +227,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
232
227
|
* If `true`, render the line highlight item.
|
|
233
228
|
*/
|
|
234
229
|
disableLineItemHighlight: PropTypes.bool,
|
|
235
|
-
/**
|
|
236
|
-
* If `true` marks will render `<circle />` instead of `<path />` and drop theme override for faster rendering.
|
|
237
|
-
*/
|
|
238
|
-
experimentalMarkRendering: PropTypes.bool,
|
|
239
230
|
/**
|
|
240
231
|
* Option to display a cartesian grid in the background.
|
|
241
232
|
*/
|
|
@@ -258,6 +249,19 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
258
249
|
dataIndex: PropTypes.number,
|
|
259
250
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
260
251
|
}),
|
|
252
|
+
/**
|
|
253
|
+
* This prop is used to help implement the accessibility logic.
|
|
254
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
255
|
+
*/
|
|
256
|
+
id: PropTypes.string,
|
|
257
|
+
/**
|
|
258
|
+
* The list of zoom data related to each axis.
|
|
259
|
+
*/
|
|
260
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
261
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
262
|
+
end: PropTypes.number.isRequired,
|
|
263
|
+
start: PropTypes.number.isRequired
|
|
264
|
+
})),
|
|
261
265
|
/**
|
|
262
266
|
* Indicate which axis to display the left of the charts.
|
|
263
267
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -273,7 +277,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
273
277
|
* The margin between the SVG and the drawing area.
|
|
274
278
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
275
279
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
276
|
-
* @default object Depends on the charts type.
|
|
277
280
|
*/
|
|
278
281
|
margin: PropTypes.shape({
|
|
279
282
|
bottom: PropTypes.number,
|
|
@@ -339,6 +342,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
339
342
|
*/
|
|
340
343
|
slots: PropTypes.object,
|
|
341
344
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
345
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
342
346
|
title: PropTypes.string,
|
|
343
347
|
/**
|
|
344
348
|
* Indicate which axis to display the top of the charts.
|
|
@@ -473,12 +477,29 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
473
477
|
}), PropTypes.bool])
|
|
474
478
|
})),
|
|
475
479
|
/**
|
|
476
|
-
* The
|
|
480
|
+
* The configuration of the z-axes.
|
|
477
481
|
*/
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
483
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
484
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
485
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
486
|
+
unknownColor: PropTypes.string,
|
|
487
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
488
|
+
}), PropTypes.shape({
|
|
489
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
490
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
491
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
492
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
493
|
+
}), PropTypes.shape({
|
|
494
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
495
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
496
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
497
|
+
})]),
|
|
498
|
+
data: PropTypes.array,
|
|
499
|
+
dataKey: PropTypes.string,
|
|
500
|
+
id: PropTypes.string,
|
|
501
|
+
max: PropTypes.number,
|
|
502
|
+
min: PropTypes.number
|
|
482
503
|
}))
|
|
483
504
|
} : void 0;
|
|
484
505
|
export { LineChartPro };
|