@mui/x-charts-pro 7.0.0-alpha.0
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 +18 -0
- package/BarChartPro/BarChartPro.js +417 -0
- package/BarChartPro/index.d.ts +1 -0
- package/BarChartPro/index.js +1 -0
- package/BarChartPro/package.json +6 -0
- package/CHANGELOG.md +4404 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +7 -0
- package/ChartContainerPro/ChartContainerPro.js +282 -0
- package/ChartContainerPro/index.d.ts +1 -0
- package/ChartContainerPro/index.js +1 -0
- package/ChartContainerPro/package.json +6 -0
- package/ChartContainerPro/useChartContainerProProps.d.ts +15 -0
- package/ChartContainerPro/useChartContainerProProps.js +39 -0
- package/Heatmap/DefaultHeatmapTooltip.d.ts +7 -0
- package/Heatmap/DefaultHeatmapTooltip.js +97 -0
- package/Heatmap/Heatmap.d.ts +49 -0
- package/Heatmap/Heatmap.js +387 -0
- package/Heatmap/HeatmapItem.d.ts +49 -0
- package/Heatmap/HeatmapItem.js +106 -0
- package/Heatmap/HeatmapPlot.d.ts +9 -0
- package/Heatmap/HeatmapPlot.js +57 -0
- package/Heatmap/extremums.d.ts +2 -0
- package/Heatmap/extremums.js +8 -0
- package/Heatmap/formatter.d.ts +3 -0
- package/Heatmap/formatter.js +20 -0
- package/Heatmap/getColor.d.ts +3 -0
- package/Heatmap/getColor.js +15 -0
- package/Heatmap/heatmapClasses.d.ts +11 -0
- package/Heatmap/heatmapClasses.js +13 -0
- package/Heatmap/index.d.ts +4 -0
- package/Heatmap/index.js +4 -0
- package/Heatmap/package.json +6 -0
- package/Heatmap/plugin.d.ts +2 -0
- package/Heatmap/plugin.js +10 -0
- package/LICENSE +11 -0
- package/LineChartPro/LineChartPro.d.ts +17 -0
- package/LineChartPro/LineChartPro.js +473 -0
- package/LineChartPro/index.d.ts +1 -0
- package/LineChartPro/index.js +1 -0
- package/LineChartPro/package.json +6 -0
- package/README.md +26 -0
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.d.ts +7 -0
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +259 -0
- package/ResponsiveChartContainerPro/index.d.ts +1 -0
- package/ResponsiveChartContainerPro/index.js +1 -0
- package/ResponsiveChartContainerPro/package.json +6 -0
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +41 -0
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +25 -0
- package/ScatterChartPro/ScatterChartPro.d.ts +17 -0
- package/ScatterChartPro/ScatterChartPro.js +388 -0
- package/ScatterChartPro/index.d.ts +1 -0
- package/ScatterChartPro/index.js +1 -0
- package/ScatterChartPro/package.json +6 -0
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +6 -0
- package/context/CartesianProviderPro/CartesianProviderPro.js +54 -0
- package/context/CartesianProviderPro/index.d.ts +1 -0
- package/context/CartesianProviderPro/index.js +1 -0
- package/context/ZoomProvider/Zoom.types.d.ts +134 -0
- package/context/ZoomProvider/Zoom.types.js +1 -0
- package/context/ZoomProvider/ZoomContext.d.ts +4 -0
- package/context/ZoomProvider/ZoomContext.js +16 -0
- package/context/ZoomProvider/ZoomProvider.d.ts +3 -0
- package/context/ZoomProvider/ZoomProvider.js +53 -0
- package/context/ZoomProvider/ZoomSetup.d.ts +9 -0
- package/context/ZoomProvider/ZoomSetup.js +16 -0
- package/context/ZoomProvider/defaultizeZoom.d.ts +2 -0
- package/context/ZoomProvider/defaultizeZoom.js +31 -0
- package/context/ZoomProvider/index.d.ts +3 -0
- package/context/ZoomProvider/index.js +3 -0
- package/context/ZoomProvider/initializeZoomData.d.ts +6 -0
- package/context/ZoomProvider/initializeZoomData.js +13 -0
- package/context/ZoomProvider/useSetupPan.d.ts +1 -0
- package/context/ZoomProvider/useSetupPan.js +104 -0
- package/context/ZoomProvider/useSetupZoom.d.ts +1 -0
- package/context/ZoomProvider/useSetupZoom.js +272 -0
- package/context/ZoomProvider/useZoom.d.ts +7 -0
- package/context/ZoomProvider/useZoom.js +17 -0
- package/context/index.d.ts +3 -0
- package/context/index.js +5 -0
- package/context/package.json +6 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/package.json +6 -0
- package/hooks/useSeries.d.ts +11 -0
- package/hooks/useSeries.js +14 -0
- package/index.d.ts +31 -0
- package/index.js +45 -0
- package/internals/utils/releaseInfo.d.ts +1 -0
- package/internals/utils/releaseInfo.js +13 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +1 -0
- package/models/package.json +6 -0
- package/models/seriesType/heatmap.d.ts +28 -0
- package/models/seriesType/heatmap.js +1 -0
- package/models/seriesType/index.d.ts +1 -0
- package/models/seriesType/index.js +1 -0
- package/modern/BarChartPro/BarChartPro.js +417 -0
- package/modern/BarChartPro/index.js +1 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +282 -0
- package/modern/ChartContainerPro/index.js +1 -0
- package/modern/ChartContainerPro/useChartContainerProProps.js +39 -0
- package/modern/Heatmap/DefaultHeatmapTooltip.js +97 -0
- package/modern/Heatmap/Heatmap.js +387 -0
- package/modern/Heatmap/HeatmapItem.js +106 -0
- package/modern/Heatmap/HeatmapPlot.js +57 -0
- package/modern/Heatmap/extremums.js +8 -0
- package/modern/Heatmap/formatter.js +20 -0
- package/modern/Heatmap/getColor.js +15 -0
- package/modern/Heatmap/heatmapClasses.js +13 -0
- package/modern/Heatmap/index.js +4 -0
- package/modern/Heatmap/plugin.js +10 -0
- package/modern/LineChartPro/LineChartPro.js +473 -0
- package/modern/LineChartPro/index.js +1 -0
- package/modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +259 -0
- package/modern/ResponsiveChartContainerPro/index.js +1 -0
- package/modern/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +25 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +388 -0
- package/modern/ScatterChartPro/index.js +1 -0
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +54 -0
- package/modern/context/CartesianProviderPro/index.js +1 -0
- package/modern/context/ZoomProvider/Zoom.types.js +1 -0
- package/modern/context/ZoomProvider/ZoomContext.js +16 -0
- package/modern/context/ZoomProvider/ZoomProvider.js +53 -0
- package/modern/context/ZoomProvider/ZoomSetup.js +16 -0
- package/modern/context/ZoomProvider/defaultizeZoom.js +31 -0
- package/modern/context/ZoomProvider/index.js +3 -0
- package/modern/context/ZoomProvider/initializeZoomData.js +13 -0
- package/modern/context/ZoomProvider/useSetupPan.js +104 -0
- package/modern/context/ZoomProvider/useSetupZoom.js +272 -0
- package/modern/context/ZoomProvider/useZoom.js +17 -0
- package/modern/context/index.js +5 -0
- package/modern/hooks/index.js +1 -0
- package/modern/hooks/useSeries.js +14 -0
- package/modern/index.js +45 -0
- package/modern/internals/utils/releaseInfo.js +13 -0
- package/modern/models/index.js +1 -0
- package/modern/models/seriesType/heatmap.js +1 -0
- package/modern/models/seriesType/index.js +1 -0
- package/modern/typeOverloads/index.js +1 -0
- package/modern/typeOverloads/modules.js +1 -0
- package/node/BarChartPro/BarChartPro.js +425 -0
- package/node/BarChartPro/index.js +16 -0
- package/node/ChartContainerPro/ChartContainerPro.js +290 -0
- package/node/ChartContainerPro/index.js +16 -0
- package/node/ChartContainerPro/useChartContainerProProps.js +47 -0
- package/node/Heatmap/DefaultHeatmapTooltip.js +105 -0
- package/node/Heatmap/Heatmap.js +395 -0
- package/node/Heatmap/HeatmapItem.js +114 -0
- package/node/Heatmap/HeatmapPlot.js +65 -0
- package/node/Heatmap/extremums.js +15 -0
- package/node/Heatmap/formatter.js +27 -0
- package/node/Heatmap/getColor.js +21 -0
- package/node/Heatmap/heatmapClasses.js +21 -0
- package/node/Heatmap/index.js +47 -0
- package/node/Heatmap/plugin.js +17 -0
- package/node/LineChartPro/LineChartPro.js +481 -0
- package/node/LineChartPro/index.js +16 -0
- package/node/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +267 -0
- package/node/ResponsiveChartContainerPro/index.js +16 -0
- package/node/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +33 -0
- package/node/ScatterChartPro/ScatterChartPro.js +396 -0
- package/node/ScatterChartPro/index.js +16 -0
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +61 -0
- package/node/context/CartesianProviderPro/index.js +16 -0
- package/node/context/ZoomProvider/Zoom.types.js +5 -0
- package/node/context/ZoomProvider/ZoomContext.js +24 -0
- package/node/context/ZoomProvider/ZoomProvider.js +62 -0
- package/node/context/ZoomProvider/ZoomSetup.js +20 -0
- package/node/context/ZoomProvider/defaultizeZoom.js +39 -0
- package/node/context/ZoomProvider/index.js +38 -0
- package/node/context/ZoomProvider/initializeZoomData.js +20 -0
- package/node/context/ZoomProvider/useSetupPan.js +114 -0
- package/node/context/ZoomProvider/useSetupZoom.js +281 -0
- package/node/context/ZoomProvider/useZoom.js +25 -0
- package/node/context/index.js +27 -0
- package/node/hooks/index.js +12 -0
- package/node/hooks/useSeries.js +21 -0
- package/node/index.js +354 -0
- package/node/internals/utils/releaseInfo.js +20 -0
- package/node/models/index.js +16 -0
- package/node/models/seriesType/heatmap.js +5 -0
- package/node/models/seriesType/index.js +16 -0
- package/node/typeOverloads/index.js +6 -0
- package/node/typeOverloads/modules.js +5 -0
- package/package.json +64 -0
- package/typeOverloads/index.d.ts +1 -0
- package/typeOverloads/index.js +1 -0
- package/typeOverloads/modules.d.ts +17 -0
- package/typeOverloads/modules.js +1 -0
- package/typeOverloads/package.json +6 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
5
|
+
import { HighlightedProvider, ZAxisContextProvider } from '@mui/x-charts/context';
|
|
6
|
+
import { ChartsAxesGradients, DrawingProvider, InteractionProvider, PluginProvider, SeriesProvider } from '@mui/x-charts/internals';
|
|
7
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
8
|
+
import { getReleaseInfo } from '../internals/utils/releaseInfo';
|
|
9
|
+
import { CartesianContextProviderPro } from '../context/CartesianProviderPro';
|
|
10
|
+
import { ZoomProvider } from '../context/ZoomProvider';
|
|
11
|
+
import { useChartContainerProProps } from './useChartContainerProProps';
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const releaseInfo = getReleaseInfo();
|
|
14
|
+
const ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
15
|
+
const {
|
|
16
|
+
zoomProviderProps,
|
|
17
|
+
drawingProviderProps,
|
|
18
|
+
seriesProviderProps,
|
|
19
|
+
zAxisContextProps,
|
|
20
|
+
highlightedProviderProps,
|
|
21
|
+
cartesianContextProps,
|
|
22
|
+
chartsSurfaceProps,
|
|
23
|
+
pluginProviderProps,
|
|
24
|
+
children
|
|
25
|
+
} = useChartContainerProProps(props, ref);
|
|
26
|
+
useLicenseVerifier('x-charts-pro', releaseInfo);
|
|
27
|
+
return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
|
|
28
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
29
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
30
|
+
children: /*#__PURE__*/_jsx(ZoomProvider, _extends({}, zoomProviderProps, {
|
|
31
|
+
children: /*#__PURE__*/_jsx(CartesianContextProviderPro, _extends({}, cartesianContextProps, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
35
|
+
children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
36
|
+
children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), children]
|
|
37
|
+
}))
|
|
38
|
+
}))
|
|
39
|
+
})
|
|
40
|
+
}))
|
|
41
|
+
}))
|
|
42
|
+
}))
|
|
43
|
+
}))
|
|
44
|
+
}))
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
48
|
+
// ----------------------------- Warning --------------------------------
|
|
49
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
50
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
51
|
+
// ----------------------------------------------------------------------
|
|
52
|
+
children: PropTypes.node,
|
|
53
|
+
className: PropTypes.string,
|
|
54
|
+
/**
|
|
55
|
+
* Color palette used to colorize multiple series.
|
|
56
|
+
* @default blueberryTwilightPalette
|
|
57
|
+
*/
|
|
58
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
59
|
+
/**
|
|
60
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
61
|
+
*/
|
|
62
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
63
|
+
desc: PropTypes.string,
|
|
64
|
+
/**
|
|
65
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
66
|
+
* It might break interactive features, but will improve performance.
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
disableAxisListener: PropTypes.bool,
|
|
70
|
+
/**
|
|
71
|
+
* The height of the chart in px.
|
|
72
|
+
*/
|
|
73
|
+
height: PropTypes.number.isRequired,
|
|
74
|
+
/**
|
|
75
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
76
|
+
*/
|
|
77
|
+
highlightedItem: PropTypes.shape({
|
|
78
|
+
dataIndex: PropTypes.number,
|
|
79
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
80
|
+
}),
|
|
81
|
+
/**
|
|
82
|
+
* The margin between the SVG and the drawing area.
|
|
83
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
84
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
85
|
+
* @default object Depends on the charts type.
|
|
86
|
+
*/
|
|
87
|
+
margin: PropTypes.shape({
|
|
88
|
+
bottom: PropTypes.number,
|
|
89
|
+
left: PropTypes.number,
|
|
90
|
+
right: PropTypes.number,
|
|
91
|
+
top: PropTypes.number
|
|
92
|
+
}),
|
|
93
|
+
/**
|
|
94
|
+
* The callback fired when the highlighted item changes.
|
|
95
|
+
*
|
|
96
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
97
|
+
*/
|
|
98
|
+
onHighlightChange: PropTypes.func,
|
|
99
|
+
/**
|
|
100
|
+
* Callback fired when the zoom has changed.
|
|
101
|
+
*
|
|
102
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
103
|
+
*/
|
|
104
|
+
onZoomChange: PropTypes.func,
|
|
105
|
+
/**
|
|
106
|
+
* An array of plugins defining how to preprocess data.
|
|
107
|
+
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
108
|
+
*/
|
|
109
|
+
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
110
|
+
/**
|
|
111
|
+
* The array of series to display.
|
|
112
|
+
* Each type of series has its own specificity.
|
|
113
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
114
|
+
*/
|
|
115
|
+
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
116
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
117
|
+
title: PropTypes.string,
|
|
118
|
+
viewBox: PropTypes.shape({
|
|
119
|
+
height: PropTypes.number,
|
|
120
|
+
width: PropTypes.number,
|
|
121
|
+
x: PropTypes.number,
|
|
122
|
+
y: PropTypes.number
|
|
123
|
+
}),
|
|
124
|
+
/**
|
|
125
|
+
* The width of the chart in px.
|
|
126
|
+
*/
|
|
127
|
+
width: PropTypes.number.isRequired,
|
|
128
|
+
/**
|
|
129
|
+
* The configuration of the x-axes.
|
|
130
|
+
* If not provided, a default axis config is used.
|
|
131
|
+
* An array of [[AxisConfig]] objects.
|
|
132
|
+
*/
|
|
133
|
+
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
134
|
+
classes: PropTypes.object,
|
|
135
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
136
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
137
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
138
|
+
unknownColor: PropTypes.string,
|
|
139
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
140
|
+
}), PropTypes.shape({
|
|
141
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
142
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
143
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
144
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
145
|
+
}), PropTypes.shape({
|
|
146
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
147
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
148
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
149
|
+
})]),
|
|
150
|
+
data: PropTypes.array,
|
|
151
|
+
dataKey: PropTypes.string,
|
|
152
|
+
disableLine: PropTypes.bool,
|
|
153
|
+
disableTicks: PropTypes.bool,
|
|
154
|
+
fill: PropTypes.string,
|
|
155
|
+
hideTooltip: PropTypes.bool,
|
|
156
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
157
|
+
label: PropTypes.string,
|
|
158
|
+
labelFontSize: PropTypes.number,
|
|
159
|
+
labelStyle: PropTypes.object,
|
|
160
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
161
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
162
|
+
position: PropTypes.oneOf(['bottom', 'top']),
|
|
163
|
+
reverse: PropTypes.bool,
|
|
164
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
165
|
+
slotProps: PropTypes.object,
|
|
166
|
+
slots: PropTypes.object,
|
|
167
|
+
stroke: PropTypes.string,
|
|
168
|
+
tickFontSize: PropTypes.number,
|
|
169
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
170
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
171
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
172
|
+
tickLabelStyle: PropTypes.object,
|
|
173
|
+
tickMaxStep: PropTypes.number,
|
|
174
|
+
tickMinStep: PropTypes.number,
|
|
175
|
+
tickNumber: PropTypes.number,
|
|
176
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
177
|
+
tickSize: PropTypes.number,
|
|
178
|
+
valueFormatter: PropTypes.func,
|
|
179
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
180
|
+
maxEnd: PropTypes.number,
|
|
181
|
+
maxSpan: PropTypes.number,
|
|
182
|
+
minSpan: PropTypes.number,
|
|
183
|
+
minStart: PropTypes.number,
|
|
184
|
+
panning: PropTypes.bool,
|
|
185
|
+
step: PropTypes.number
|
|
186
|
+
}), PropTypes.bool])
|
|
187
|
+
})),
|
|
188
|
+
/**
|
|
189
|
+
* The configuration of the y-axes.
|
|
190
|
+
* If not provided, a default axis config is used.
|
|
191
|
+
* An array of [[AxisConfig]] objects.
|
|
192
|
+
*/
|
|
193
|
+
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
194
|
+
classes: PropTypes.object,
|
|
195
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
196
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
197
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
198
|
+
unknownColor: PropTypes.string,
|
|
199
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
200
|
+
}), PropTypes.shape({
|
|
201
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
202
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
203
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
204
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
205
|
+
}), PropTypes.shape({
|
|
206
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
207
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
208
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
209
|
+
})]),
|
|
210
|
+
data: PropTypes.array,
|
|
211
|
+
dataKey: PropTypes.string,
|
|
212
|
+
disableLine: PropTypes.bool,
|
|
213
|
+
disableTicks: PropTypes.bool,
|
|
214
|
+
fill: PropTypes.string,
|
|
215
|
+
hideTooltip: PropTypes.bool,
|
|
216
|
+
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
217
|
+
label: PropTypes.string,
|
|
218
|
+
labelFontSize: PropTypes.number,
|
|
219
|
+
labelStyle: PropTypes.object,
|
|
220
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
221
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
222
|
+
position: PropTypes.oneOf(['left', 'right']),
|
|
223
|
+
reverse: PropTypes.bool,
|
|
224
|
+
scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
225
|
+
slotProps: PropTypes.object,
|
|
226
|
+
slots: PropTypes.object,
|
|
227
|
+
stroke: PropTypes.string,
|
|
228
|
+
tickFontSize: PropTypes.number,
|
|
229
|
+
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
230
|
+
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
231
|
+
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
232
|
+
tickLabelStyle: PropTypes.object,
|
|
233
|
+
tickMaxStep: PropTypes.number,
|
|
234
|
+
tickMinStep: PropTypes.number,
|
|
235
|
+
tickNumber: PropTypes.number,
|
|
236
|
+
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
237
|
+
tickSize: PropTypes.number,
|
|
238
|
+
valueFormatter: PropTypes.func,
|
|
239
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
240
|
+
maxEnd: PropTypes.number,
|
|
241
|
+
maxSpan: PropTypes.number,
|
|
242
|
+
minSpan: PropTypes.number,
|
|
243
|
+
minStart: PropTypes.number,
|
|
244
|
+
panning: PropTypes.bool,
|
|
245
|
+
step: PropTypes.number
|
|
246
|
+
}), PropTypes.bool])
|
|
247
|
+
})),
|
|
248
|
+
/**
|
|
249
|
+
* The configuration of the z-axes.
|
|
250
|
+
*/
|
|
251
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
252
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
253
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
254
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
255
|
+
unknownColor: PropTypes.string,
|
|
256
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
257
|
+
}), PropTypes.shape({
|
|
258
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
259
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
260
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
261
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
262
|
+
}), PropTypes.shape({
|
|
263
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
264
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
265
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
266
|
+
})]),
|
|
267
|
+
data: PropTypes.array,
|
|
268
|
+
dataKey: PropTypes.string,
|
|
269
|
+
id: PropTypes.string,
|
|
270
|
+
max: PropTypes.number,
|
|
271
|
+
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
|
+
}))
|
|
281
|
+
} : void 0;
|
|
282
|
+
export { ChartContainerPro };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChartContainerPro';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
const _excluded = ["zoom", "onZoomChange"];
|
|
3
|
+
import { useChartContainerProps } from '@mui/x-charts/internals';
|
|
4
|
+
export const useChartContainerProProps = (props, ref) => {
|
|
5
|
+
const {
|
|
6
|
+
zoom,
|
|
7
|
+
onZoomChange
|
|
8
|
+
} = props,
|
|
9
|
+
baseProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
10
|
+
const {
|
|
11
|
+
children,
|
|
12
|
+
drawingProviderProps,
|
|
13
|
+
seriesProviderProps,
|
|
14
|
+
cartesianContextProps,
|
|
15
|
+
zAxisContextProps,
|
|
16
|
+
highlightedProviderProps,
|
|
17
|
+
chartsSurfaceProps,
|
|
18
|
+
pluginProviderProps,
|
|
19
|
+
xAxis,
|
|
20
|
+
yAxis
|
|
21
|
+
} = useChartContainerProps(baseProps, ref);
|
|
22
|
+
const zoomProviderProps = {
|
|
23
|
+
zoom,
|
|
24
|
+
onZoomChange,
|
|
25
|
+
xAxis,
|
|
26
|
+
yAxis
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
zoomProviderProps,
|
|
30
|
+
children,
|
|
31
|
+
drawingProviderProps,
|
|
32
|
+
pluginProviderProps,
|
|
33
|
+
seriesProviderProps,
|
|
34
|
+
cartesianContextProps,
|
|
35
|
+
zAxisContextProps,
|
|
36
|
+
highlightedProviderProps,
|
|
37
|
+
chartsSurfaceProps
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { ChartsTooltipPaper, ChartsTooltipTable, ChartsTooltipRow, ChartsTooltipCell, ChartsTooltipMark } from '@mui/x-charts/ChartsTooltip';
|
|
5
|
+
import { useXAxis, useYAxis } from '@mui/x-charts/hooks';
|
|
6
|
+
import { getLabel } from '@mui/x-charts/internals';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
function DefaultHeatmapTooltip(props) {
|
|
9
|
+
const {
|
|
10
|
+
series,
|
|
11
|
+
itemData,
|
|
12
|
+
sx,
|
|
13
|
+
classes,
|
|
14
|
+
getColor
|
|
15
|
+
} = props;
|
|
16
|
+
const xAxis = useXAxis();
|
|
17
|
+
const yAxis = useYAxis();
|
|
18
|
+
if (itemData.dataIndex === undefined || !series.data[itemData.dataIndex]) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const color = getColor(itemData.dataIndex);
|
|
22
|
+
const valueItem = series.data[itemData.dataIndex];
|
|
23
|
+
const [xIndex, yIndex] = valueItem;
|
|
24
|
+
const formattedX = xAxis.valueFormatter?.(xAxis.data[xIndex], {
|
|
25
|
+
location: 'tooltip'
|
|
26
|
+
}) ?? xAxis.data[xIndex].toLocaleString();
|
|
27
|
+
const formattedY = yAxis.valueFormatter?.(yAxis.data[yIndex], {
|
|
28
|
+
location: 'tooltip'
|
|
29
|
+
}) ?? yAxis.data[yIndex].toLocaleString();
|
|
30
|
+
const formattedValue = series.valueFormatter(valueItem, {
|
|
31
|
+
dataIndex: itemData.dataIndex
|
|
32
|
+
});
|
|
33
|
+
const seriesLabel = getLabel(series.label, 'tooltip');
|
|
34
|
+
return /*#__PURE__*/_jsx(ChartsTooltipPaper, {
|
|
35
|
+
sx: sx,
|
|
36
|
+
className: classes.root,
|
|
37
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipTable, {
|
|
38
|
+
className: classes.table,
|
|
39
|
+
children: [/*#__PURE__*/_jsx("thead", {
|
|
40
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
41
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
42
|
+
children: formattedX
|
|
43
|
+
}), formattedX && formattedY && /*#__PURE__*/_jsx(ChartsTooltipCell, {}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
44
|
+
children: formattedY
|
|
45
|
+
})]
|
|
46
|
+
})
|
|
47
|
+
}), /*#__PURE__*/_jsx("tbody", {
|
|
48
|
+
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
49
|
+
className: classes.row,
|
|
50
|
+
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
51
|
+
className: clsx(classes.markCell, classes.cell),
|
|
52
|
+
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
53
|
+
color: color,
|
|
54
|
+
className: classes.mark
|
|
55
|
+
})
|
|
56
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
57
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
58
|
+
children: seriesLabel
|
|
59
|
+
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
60
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
61
|
+
children: formattedValue
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
process.env.NODE_ENV !== "production" ? DefaultHeatmapTooltip.propTypes = {
|
|
69
|
+
// ----------------------------- Warning --------------------------------
|
|
70
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
72
|
+
// ----------------------------------------------------------------------
|
|
73
|
+
/**
|
|
74
|
+
* Override or extend the styles applied to the component.
|
|
75
|
+
*/
|
|
76
|
+
classes: PropTypes.object.isRequired,
|
|
77
|
+
/**
|
|
78
|
+
* Get the color of the item with index `dataIndex`.
|
|
79
|
+
* @param {number} dataIndex The data index of the item.
|
|
80
|
+
* @returns {string} The color to display.
|
|
81
|
+
*/
|
|
82
|
+
getColor: PropTypes.func.isRequired,
|
|
83
|
+
/**
|
|
84
|
+
* The data used to identify the triggered item.
|
|
85
|
+
*/
|
|
86
|
+
itemData: PropTypes.shape({
|
|
87
|
+
dataIndex: PropTypes.number.isRequired,
|
|
88
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
89
|
+
type: PropTypes.oneOf(['heatmap']).isRequired
|
|
90
|
+
}).isRequired,
|
|
91
|
+
/**
|
|
92
|
+
* The series linked to the triggered axis.
|
|
93
|
+
*/
|
|
94
|
+
series: PropTypes.object.isRequired,
|
|
95
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
96
|
+
} : void 0;
|
|
97
|
+
export { DefaultHeatmapTooltip };
|