@mui/x-charts-pro 7.0.0-beta.6 → 8.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 +1 -1
- package/BarChartPro/BarChartPro.js +9 -29
- package/CHANGELOG.md +161 -48
- package/ChartContainerPro/ChartContainerPro.d.ts +1 -1
- package/ChartContainerPro/ChartContainerPro.js +28 -42
- package/ChartContainerPro/useChartContainerProProps.d.ts +42 -13
- package/ChartContainerPro/useChartContainerProProps.js +11 -27
- package/Heatmap/Heatmap.d.ts +5 -4
- package/Heatmap/Heatmap.js +4 -2
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +9 -29
- package/README.md +2 -2
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +9 -29
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +7 -0
- package/{modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +49 -31
- package/context/ChartDataProviderPro/index.d.ts +1 -0
- package/context/ChartDataProviderPro/index.js +1 -0
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +16 -0
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
- package/context/ZoomProvider/ZoomProvider.js +1 -0
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/internals/utils/releaseInfo.js +1 -1
- package/models/seriesType/heatmap.d.ts +2 -1
- package/modern/BarChartPro/BarChartPro.js +9 -29
- package/modern/ChartContainerPro/ChartContainerPro.js +28 -42
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -27
- package/modern/Heatmap/Heatmap.js +4 -2
- package/modern/LineChartPro/LineChartPro.js +9 -29
- package/modern/ScatterChartPro/ScatterChartPro.js +9 -29
- package/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → modern/context/ChartDataProviderPro/ChartDataProviderPro.js} +49 -31
- package/modern/context/ChartDataProviderPro/index.js +1 -0
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +43 -0
- package/modern/context/ZoomProvider/ZoomProvider.js +1 -0
- package/modern/index.js +1 -2
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/BarChartPro/BarChartPro.js +9 -29
- package/node/ChartContainerPro/ChartContainerPro.js +27 -41
- package/node/ChartContainerPro/useChartContainerProProps.js +11 -27
- package/node/Heatmap/Heatmap.js +4 -2
- package/node/LineChartPro/LineChartPro.js +9 -29
- package/node/ScatterChartPro/ScatterChartPro.js +9 -29
- package/node/{ResponsiveChartContainerPro/ResponsiveChartContainerPro.js → context/ChartDataProviderPro/ChartDataProviderPro.js} +48 -30
- package/node/context/ChartDataProviderPro/index.js +16 -0
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +50 -0
- package/node/context/ZoomProvider/ZoomProvider.js +1 -0
- package/node/index.js +1 -12
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +6 -6
- package/typeOverloads/modules.d.ts +1 -1
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.d.ts +0 -7
- package/ResponsiveChartContainerPro/index.d.ts +0 -1
- package/ResponsiveChartContainerPro/index.js +0 -1
- package/ResponsiveChartContainerPro/package.json +0 -6
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +0 -42
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
- package/modern/ResponsiveChartContainerPro/index.js +0 -1
- package/modern/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -27
- package/node/ResponsiveChartContainerPro/index.js +0 -16
- package/node/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.js +0 -34
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
5
|
const _excluded = ["zoom", "onZoomChange"];
|
|
5
6
|
import { useChartContainerProps } from '@mui/x-charts/internals';
|
|
@@ -9,35 +10,18 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
9
10
|
onZoomChange
|
|
10
11
|
} = props,
|
|
11
12
|
baseProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
12
|
-
const {
|
|
13
|
-
children,
|
|
14
|
-
drawingProviderProps,
|
|
15
|
-
seriesProviderProps,
|
|
16
|
-
cartesianProviderProps,
|
|
17
|
-
zAxisContextProps,
|
|
18
|
-
highlightedProviderProps,
|
|
19
|
-
chartsSurfaceProps,
|
|
20
|
-
pluginProviderProps,
|
|
21
|
-
animationProviderProps,
|
|
22
|
-
xAxis,
|
|
23
|
-
yAxis
|
|
24
|
-
} = useChartContainerProps(baseProps, ref);
|
|
25
|
-
const zoomProviderProps = {
|
|
13
|
+
const chartDataProviderProProps = {
|
|
26
14
|
zoom,
|
|
27
|
-
onZoomChange
|
|
28
|
-
xAxis,
|
|
29
|
-
yAxis
|
|
15
|
+
onZoomChange
|
|
30
16
|
};
|
|
17
|
+
const {
|
|
18
|
+
chartDataProviderProps,
|
|
19
|
+
resizableChartContainerProps,
|
|
20
|
+
hasIntrinsicSize
|
|
21
|
+
} = useChartContainerProps(baseProps, ref);
|
|
31
22
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pluginProviderProps,
|
|
36
|
-
seriesProviderProps,
|
|
37
|
-
cartesianProviderProps,
|
|
38
|
-
zAxisContextProps,
|
|
39
|
-
highlightedProviderProps,
|
|
40
|
-
chartsSurfaceProps,
|
|
41
|
-
animationProviderProps
|
|
23
|
+
chartDataProviderProProps: _extends({}, chartDataProviderProps, chartDataProviderProProps),
|
|
24
|
+
resizableChartContainerProps,
|
|
25
|
+
hasIntrinsicSize
|
|
42
26
|
};
|
|
43
27
|
};
|
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { MakeOptional } from '@mui/x-internals/types';
|
|
2
3
|
import { ChartsAxisProps } from '@mui/x-charts/ChartsAxis';
|
|
3
4
|
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
|
|
4
|
-
import {
|
|
5
|
+
import { ChartsAxisSlots, ChartsAxisSlotProps, ChartsXAxisProps, ChartsYAxisProps, AxisConfig } from '@mui/x-charts/internals';
|
|
5
6
|
import { ChartsOnAxisClickHandlerProps } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
6
7
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
7
|
-
import {
|
|
8
|
+
import { ChartContainerProProps } from '../ChartContainerPro';
|
|
8
9
|
import { HeatmapSeriesType } from '../models/seriesType/heatmap';
|
|
9
10
|
import { HeatmapItemSlotProps, HeatmapItemSlots } from './HeatmapItem';
|
|
10
11
|
export interface HeatmapSlots extends ChartsAxisSlots, Omit<ChartsTooltipSlots<'heatmap'>, 'axisContent'>, ChartsOverlaySlots, HeatmapItemSlots {
|
|
11
12
|
}
|
|
12
13
|
export interface HeatmapSlotProps extends ChartsAxisSlotProps, Omit<ChartsTooltipSlotProps<'heatmap'>, 'axisContent'>, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
13
14
|
}
|
|
14
|
-
export interface HeatmapProps extends Omit<
|
|
15
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
15
16
|
/**
|
|
16
17
|
* The configuration of the x-axes.
|
|
17
18
|
* If not provided, a default axis config is used.
|
|
@@ -45,5 +46,5 @@ export interface HeatmapProps extends Omit<ResponsiveChartContainerProProps, 'se
|
|
|
45
46
|
*/
|
|
46
47
|
slotProps?: HeatmapSlotProps;
|
|
47
48
|
}
|
|
48
|
-
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<
|
|
49
|
+
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<SVGSVGElement>>;
|
|
49
50
|
export { Heatmap };
|
package/Heatmap/Heatmap.js
CHANGED
|
@@ -11,7 +11,7 @@ import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
|
11
11
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
12
12
|
import { ChartsOnAxisClickHandler } from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
13
13
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
14
|
-
import {
|
|
14
|
+
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
15
15
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
16
16
|
import { plugin as heatmapPlugin } from "./plugin.js";
|
|
17
17
|
import { DefaultHeatmapTooltip } from "./DefaultHeatmapTooltip.js";
|
|
@@ -65,7 +65,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
65
65
|
color: defaultColorMap
|
|
66
66
|
}
|
|
67
67
|
}], [zAxis]);
|
|
68
|
-
return /*#__PURE__*/_jsxs(
|
|
68
|
+
return /*#__PURE__*/_jsxs(ChartContainerPro, {
|
|
69
69
|
ref: ref,
|
|
70
70
|
plugins: [heatmapPlugin],
|
|
71
71
|
series: series.map(s => _extends({
|
|
@@ -279,6 +279,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
279
279
|
dataKey: PropTypes.string,
|
|
280
280
|
disableLine: PropTypes.bool,
|
|
281
281
|
disableTicks: PropTypes.bool,
|
|
282
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
282
283
|
fill: PropTypes.string,
|
|
283
284
|
hideTooltip: PropTypes.bool,
|
|
284
285
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -343,6 +344,7 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
343
344
|
dataKey: PropTypes.string,
|
|
344
345
|
disableLine: PropTypes.bool,
|
|
345
346
|
disableTicks: PropTypes.bool,
|
|
347
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
346
348
|
fill: PropTypes.string,
|
|
347
349
|
hideTooltip: PropTypes.bool,
|
|
348
350
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -13,5 +13,5 @@ export interface LineChartProProps extends LineChartProps, ZoomProps {
|
|
|
13
13
|
*
|
|
14
14
|
* - [LineChart API](https://mui.com/x/api/charts/line-chart/)
|
|
15
15
|
*/
|
|
16
|
-
declare const LineChartPro: React.ForwardRefExoticComponent<LineChartProProps & React.RefAttributes<
|
|
16
|
+
declare const LineChartPro: React.ForwardRefExoticComponent<LineChartProProps & React.RefAttributes<SVGSVGElement>>;
|
|
17
17
|
export { LineChartPro };
|
|
@@ -16,7 +16,7 @@ import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
|
16
16
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
17
17
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
18
18
|
import { useLineChartProps } from '@mui/x-charts/internals';
|
|
19
|
-
import {
|
|
19
|
+
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
20
20
|
import { ZoomSetup } from "../context/ZoomProvider/ZoomSetup.js";
|
|
21
21
|
import { useZoom } from "../context/ZoomProvider/useZoom.js";
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -168,7 +168,7 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
168
168
|
tooltipProps,
|
|
169
169
|
children
|
|
170
170
|
} = useLineChartProps(other);
|
|
171
|
-
return /*#__PURE__*/_jsxs(
|
|
171
|
+
return /*#__PURE__*/_jsxs(ChartContainerPro, _extends({
|
|
172
172
|
ref: ref
|
|
173
173
|
}, chartContainerProps, {
|
|
174
174
|
zoom: zoom,
|
|
@@ -178,7 +178,7 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
178
178
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
179
179
|
"data-drawing-container": true,
|
|
180
180
|
children: /*#__PURE__*/_jsx(MarkPlotZoom, _extends({}, markPlotProps))
|
|
181
|
-
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), /*#__PURE__*/_jsx(ZoomSetup, {}), children]
|
|
181
|
+
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), /*#__PURE__*/_jsx(ZoomSetup, {}), children]
|
|
182
182
|
}));
|
|
183
183
|
});
|
|
184
184
|
process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
@@ -238,6 +238,10 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
238
238
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
239
239
|
*/
|
|
240
240
|
height: PropTypes.number,
|
|
241
|
+
/**
|
|
242
|
+
* If `true`, the legend is not rendered.
|
|
243
|
+
*/
|
|
244
|
+
hideLegend: PropTypes.bool,
|
|
241
245
|
/**
|
|
242
246
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
243
247
|
*/
|
|
@@ -251,32 +255,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
251
255
|
* @default yAxisIds[0] The id of the first provided axis
|
|
252
256
|
*/
|
|
253
257
|
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
254
|
-
/**
|
|
255
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
256
|
-
*/
|
|
257
|
-
legend: PropTypes.shape({
|
|
258
|
-
classes: PropTypes.object,
|
|
259
|
-
direction: PropTypes.oneOf(['column', 'row']),
|
|
260
|
-
hidden: PropTypes.bool,
|
|
261
|
-
itemGap: PropTypes.number,
|
|
262
|
-
itemMarkHeight: PropTypes.number,
|
|
263
|
-
itemMarkWidth: PropTypes.number,
|
|
264
|
-
labelStyle: PropTypes.object,
|
|
265
|
-
markGap: PropTypes.number,
|
|
266
|
-
onItemClick: PropTypes.func,
|
|
267
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
268
|
-
bottom: PropTypes.number,
|
|
269
|
-
left: PropTypes.number,
|
|
270
|
-
right: PropTypes.number,
|
|
271
|
-
top: PropTypes.number
|
|
272
|
-
})]),
|
|
273
|
-
position: PropTypes.shape({
|
|
274
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
275
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
276
|
-
}),
|
|
277
|
-
slotProps: PropTypes.object,
|
|
278
|
-
slots: PropTypes.object
|
|
279
|
-
}),
|
|
280
258
|
/**
|
|
281
259
|
* If `true`, a loading overlay is displayed.
|
|
282
260
|
* @default false
|
|
@@ -418,6 +396,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
418
396
|
dataKey: PropTypes.string,
|
|
419
397
|
disableLine: PropTypes.bool,
|
|
420
398
|
disableTicks: PropTypes.bool,
|
|
399
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
421
400
|
fill: PropTypes.string,
|
|
422
401
|
hideTooltip: PropTypes.bool,
|
|
423
402
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -480,6 +459,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
480
459
|
dataKey: PropTypes.string,
|
|
481
460
|
disableLine: PropTypes.bool,
|
|
482
461
|
disableTicks: PropTypes.bool,
|
|
462
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
483
463
|
fill: PropTypes.string,
|
|
484
464
|
hideTooltip: PropTypes.bool,
|
|
485
465
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
package/README.md
CHANGED
|
@@ -11,11 +11,11 @@ Install the package in your project directory with:
|
|
|
11
11
|
npm install @mui/x-charts-pro
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
This component has the following peer dependencies that you
|
|
14
|
+
This component has the following peer dependencies that you need to install as well.
|
|
15
15
|
|
|
16
16
|
```json
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@mui/material": "^5.15.14",
|
|
18
|
+
"@mui/material": "^5.15.14 || ^6.0.0",
|
|
19
19
|
"react": "^17.0.0 || ^18.0.0",
|
|
20
20
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
21
21
|
},
|
|
@@ -13,5 +13,5 @@ export interface ScatterChartProProps extends ScatterChartProps, ZoomProps {
|
|
|
13
13
|
*
|
|
14
14
|
* - [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/)
|
|
15
15
|
*/
|
|
16
|
-
declare const ScatterChartPro: React.ForwardRefExoticComponent<ScatterChartProProps & React.RefAttributes<
|
|
16
|
+
declare const ScatterChartPro: React.ForwardRefExoticComponent<ScatterChartProProps & React.RefAttributes<SVGSVGElement>>;
|
|
17
17
|
export { ScatterChartPro };
|
|
@@ -16,7 +16,7 @@ import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
|
16
16
|
import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
17
17
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
18
18
|
import { useScatterChartProps } from '@mui/x-charts/internals';
|
|
19
|
-
import {
|
|
19
|
+
import { ChartContainerPro } from "../ChartContainerPro/index.js";
|
|
20
20
|
import { ZoomSetup } from "../context/ZoomProvider/ZoomSetup.js";
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
/**
|
|
@@ -52,7 +52,7 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
52
52
|
tooltipProps,
|
|
53
53
|
children
|
|
54
54
|
} = useScatterChartProps(other);
|
|
55
|
-
return /*#__PURE__*/_jsx(
|
|
55
|
+
return /*#__PURE__*/_jsx(ChartContainerPro, _extends({
|
|
56
56
|
ref: ref
|
|
57
57
|
}, chartContainerProps, {
|
|
58
58
|
zoom: zoom,
|
|
@@ -61,7 +61,7 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
61
61
|
children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
62
62
|
"data-drawing-container": true,
|
|
63
63
|
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
64
|
-
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ZoomSetup, {}), children]
|
|
64
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ZoomSetup, {}), children]
|
|
65
65
|
}))
|
|
66
66
|
}));
|
|
67
67
|
});
|
|
@@ -119,6 +119,10 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
119
119
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
120
120
|
*/
|
|
121
121
|
height: PropTypes.number,
|
|
122
|
+
/**
|
|
123
|
+
* If `true`, the legend is not rendered.
|
|
124
|
+
*/
|
|
125
|
+
hideLegend: PropTypes.bool,
|
|
122
126
|
/**
|
|
123
127
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
124
128
|
*/
|
|
@@ -132,32 +136,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
132
136
|
* @default yAxisIds[0] The id of the first provided axis
|
|
133
137
|
*/
|
|
134
138
|
leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated Consider using `slotProps.legend` instead.
|
|
137
|
-
*/
|
|
138
|
-
legend: PropTypes.shape({
|
|
139
|
-
classes: PropTypes.object,
|
|
140
|
-
direction: PropTypes.oneOf(['column', 'row']),
|
|
141
|
-
hidden: PropTypes.bool,
|
|
142
|
-
itemGap: PropTypes.number,
|
|
143
|
-
itemMarkHeight: PropTypes.number,
|
|
144
|
-
itemMarkWidth: PropTypes.number,
|
|
145
|
-
labelStyle: PropTypes.object,
|
|
146
|
-
markGap: PropTypes.number,
|
|
147
|
-
onItemClick: PropTypes.func,
|
|
148
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
149
|
-
bottom: PropTypes.number,
|
|
150
|
-
left: PropTypes.number,
|
|
151
|
-
right: PropTypes.number,
|
|
152
|
-
top: PropTypes.number
|
|
153
|
-
})]),
|
|
154
|
-
position: PropTypes.shape({
|
|
155
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
156
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
157
|
-
}),
|
|
158
|
-
slotProps: PropTypes.object,
|
|
159
|
-
slots: PropTypes.object
|
|
160
|
-
}),
|
|
161
139
|
/**
|
|
162
140
|
* If `true`, a loading overlay is displayed.
|
|
163
141
|
* @default false
|
|
@@ -291,6 +269,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
291
269
|
dataKey: PropTypes.string,
|
|
292
270
|
disableLine: PropTypes.bool,
|
|
293
271
|
disableTicks: PropTypes.bool,
|
|
272
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
294
273
|
fill: PropTypes.string,
|
|
295
274
|
hideTooltip: PropTypes.bool,
|
|
296
275
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -353,6 +332,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
353
332
|
dataKey: PropTypes.string,
|
|
354
333
|
disableLine: PropTypes.bool,
|
|
355
334
|
disableTicks: PropTypes.bool,
|
|
335
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
356
336
|
fill: PropTypes.string,
|
|
357
337
|
hideTooltip: PropTypes.bool,
|
|
358
338
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartDataProviderProps } from '@mui/x-charts/internals';
|
|
3
|
+
import { ZoomProps } from '../ZoomProvider';
|
|
4
|
+
export interface ChartDataProviderProProps extends ChartDataProviderProps, ZoomProps {
|
|
5
|
+
}
|
|
6
|
+
declare const ChartDataProviderPro: React.ForwardRefExoticComponent<ChartDataProviderProProps & React.RefAttributes<SVGSVGElement>>;
|
|
7
|
+
export { ChartDataProviderPro };
|
|
@@ -3,27 +3,53 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { ChartsAxesGradients, DrawingProvider, InteractionProvider, PluginProvider, SeriesProvider, AnimationProvider } from '@mui/x-charts/internals';
|
|
7
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
8
|
+
import { HighlightedProvider, ZAxisContextProvider } from '@mui/x-charts/context';
|
|
9
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
10
|
+
import { getReleaseInfo } from "../../internals/utils/releaseInfo.js";
|
|
11
|
+
import { CartesianProviderPro } from "../CartesianProviderPro/index.js";
|
|
12
|
+
import { ZoomProvider } from "../ZoomProvider/index.js";
|
|
13
|
+
import { useChartContainerProProps } from "./useChartDataProviderProProps.js";
|
|
11
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
15
|
const releaseInfo = getReleaseInfo();
|
|
13
|
-
const
|
|
16
|
+
const ChartDataProviderPro = /*#__PURE__*/React.forwardRef(function ChartDataProviderPro(props, ref) {
|
|
14
17
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
zoomProviderProps,
|
|
19
|
+
drawingProviderProps,
|
|
20
|
+
seriesProviderProps,
|
|
21
|
+
zAxisContextProps,
|
|
22
|
+
highlightedProviderProps,
|
|
23
|
+
cartesianProviderProps,
|
|
24
|
+
chartsSurfaceProps,
|
|
25
|
+
pluginProviderProps,
|
|
26
|
+
animationProviderProps,
|
|
27
|
+
children
|
|
28
|
+
} = useChartContainerProProps(props, ref);
|
|
29
|
+
useLicenseVerifier('x-charts-pro', releaseInfo);
|
|
30
|
+
return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
|
|
31
|
+
children: /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(ZoomProvider, _extends({}, zoomProviderProps, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
35
|
+
children: /*#__PURE__*/_jsx(CartesianProviderPro, _extends({}, cartesianProviderProps, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
37
|
+
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
39
|
+
children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
40
|
+
children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), children]
|
|
41
|
+
}))
|
|
42
|
+
}))
|
|
43
|
+
})
|
|
44
|
+
}))
|
|
45
|
+
}))
|
|
46
|
+
}))
|
|
47
|
+
}))
|
|
48
|
+
}))
|
|
49
|
+
}))
|
|
24
50
|
}));
|
|
25
51
|
});
|
|
26
|
-
process.env.NODE_ENV !== "production" ?
|
|
52
|
+
process.env.NODE_ENV !== "production" ? ChartDataProviderPro.propTypes = {
|
|
27
53
|
// ----------------------------- Warning --------------------------------
|
|
28
54
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
29
55
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -47,9 +73,9 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
47
73
|
*/
|
|
48
74
|
disableAxisListener: PropTypes.bool,
|
|
49
75
|
/**
|
|
50
|
-
* The height of the chart in px.
|
|
76
|
+
* The height of the chart in px.
|
|
51
77
|
*/
|
|
52
|
-
height: PropTypes.number,
|
|
78
|
+
height: PropTypes.number.isRequired,
|
|
53
79
|
/**
|
|
54
80
|
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
55
81
|
*/
|
|
@@ -86,16 +112,6 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
86
112
|
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
87
113
|
*/
|
|
88
114
|
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
89
|
-
/**
|
|
90
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
91
|
-
* before it renders for the first time.
|
|
92
|
-
*
|
|
93
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
94
|
-
* the first render, like when used inside a grid.
|
|
95
|
-
*
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
99
115
|
/**
|
|
100
116
|
* The array of series to display.
|
|
101
117
|
* Each type of series has its own specificity.
|
|
@@ -116,9 +132,9 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
116
132
|
y: PropTypes.number
|
|
117
133
|
}),
|
|
118
134
|
/**
|
|
119
|
-
* The width of the chart in px.
|
|
135
|
+
* The width of the chart in px.
|
|
120
136
|
*/
|
|
121
|
-
width: PropTypes.number,
|
|
137
|
+
width: PropTypes.number.isRequired,
|
|
122
138
|
/**
|
|
123
139
|
* The configuration of the x-axes.
|
|
124
140
|
* If not provided, a default axis config is used.
|
|
@@ -145,6 +161,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
145
161
|
dataKey: PropTypes.string,
|
|
146
162
|
disableLine: PropTypes.bool,
|
|
147
163
|
disableTicks: PropTypes.bool,
|
|
164
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
148
165
|
fill: PropTypes.string,
|
|
149
166
|
hideTooltip: PropTypes.bool,
|
|
150
167
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -207,6 +224,7 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
207
224
|
dataKey: PropTypes.string,
|
|
208
225
|
disableLine: PropTypes.bool,
|
|
209
226
|
disableTicks: PropTypes.bool,
|
|
227
|
+
domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
|
|
210
228
|
fill: PropTypes.string,
|
|
211
229
|
hideTooltip: PropTypes.bool,
|
|
212
230
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
@@ -277,4 +295,4 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
277
295
|
start: PropTypes.number.isRequired
|
|
278
296
|
}))
|
|
279
297
|
} : void 0;
|
|
280
|
-
export {
|
|
298
|
+
export { ChartDataProviderPro };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ChartDataProviderPro';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ChartDataProviderPro.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ZoomProviderProps } from '../ZoomProvider';
|
|
2
|
+
import type { ChartDataProviderProProps } from './ChartDataProviderPro';
|
|
3
|
+
export declare const useChartContainerProProps: (props: ChartDataProviderProProps, ref: React.Ref<SVGSVGElement>) => {
|
|
4
|
+
zoomProviderProps: Omit<ZoomProviderProps, "children">;
|
|
5
|
+
children: import("react").ReactNode;
|
|
6
|
+
drawingProviderProps: Omit<import("@mui/x-charts/internals").DrawingProviderProps, "children">;
|
|
7
|
+
pluginProviderProps: Omit<import("@mui/x-charts/internals").PluginProviderProps, "children">;
|
|
8
|
+
seriesProviderProps: Omit<import("@mui/x-charts/internals").SeriesProviderProps, "children">;
|
|
9
|
+
cartesianProviderProps: Omit<import("@mui/x-charts/internals").CartesianProviderProps, "children">;
|
|
10
|
+
zAxisContextProps: Omit<import("@mui/x-charts").ZAxisContextProviderProps, "children">;
|
|
11
|
+
highlightedProviderProps: Omit<import("@mui/x-charts").HighlightedProviderProps, "children">;
|
|
12
|
+
chartsSurfaceProps: import("@mui/x-charts").ChartsSurfaceProps & {
|
|
13
|
+
ref: any;
|
|
14
|
+
};
|
|
15
|
+
animationProviderProps: Omit<import("@mui/x-charts/internals").AnimationProviderProps, "children">;
|
|
16
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
const _excluded = ["zoom", "onZoomChange"];
|
|
5
|
+
import { useChartDataProviderProps } from '@mui/x-charts/internals';
|
|
6
|
+
export const useChartContainerProProps = (props, ref) => {
|
|
7
|
+
const {
|
|
8
|
+
zoom,
|
|
9
|
+
onZoomChange
|
|
10
|
+
} = props,
|
|
11
|
+
baseProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
drawingProviderProps,
|
|
15
|
+
seriesProviderProps,
|
|
16
|
+
cartesianProviderProps,
|
|
17
|
+
zAxisContextProps,
|
|
18
|
+
highlightedProviderProps,
|
|
19
|
+
chartsSurfaceProps,
|
|
20
|
+
pluginProviderProps,
|
|
21
|
+
animationProviderProps,
|
|
22
|
+
xAxis,
|
|
23
|
+
yAxis
|
|
24
|
+
} = useChartDataProviderProps(baseProps, ref);
|
|
25
|
+
const zoomProviderProps = {
|
|
26
|
+
zoom,
|
|
27
|
+
onZoomChange,
|
|
28
|
+
xAxis,
|
|
29
|
+
yAxis
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
zoomProviderProps,
|
|
33
|
+
children,
|
|
34
|
+
drawingProviderProps,
|
|
35
|
+
pluginProviderProps,
|
|
36
|
+
seriesProviderProps,
|
|
37
|
+
cartesianProviderProps,
|
|
38
|
+
zAxisContextProps,
|
|
39
|
+
highlightedProviderProps,
|
|
40
|
+
chartsSurfaceProps,
|
|
41
|
+
animationProviderProps
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -25,6 +25,7 @@ export function ZoomProvider({
|
|
|
25
25
|
const defaultZoomData = React.useRef(initializeZoomData(options));
|
|
26
26
|
const [zoomData, setZoomData] = useControlled({
|
|
27
27
|
controlled: zoom,
|
|
28
|
+
// eslint-disable-next-line react-compiler/react-compiler
|
|
28
29
|
default: defaultZoomData.current,
|
|
29
30
|
name: 'ZoomProvider',
|
|
30
31
|
state: 'zoom'
|
package/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export * from '@mui/x-charts/SparkLineChart';
|
|
|
23
23
|
export * from '@mui/x-charts/Gauge';
|
|
24
24
|
export * from '@mui/x-charts/ChartsSurface';
|
|
25
25
|
export * from './Heatmap';
|
|
26
|
-
export * from './ResponsiveChartContainerPro';
|
|
27
26
|
export * from './ChartContainerPro';
|
|
28
27
|
export * from './ScatterChartPro';
|
|
29
28
|
export * from './BarChartPro';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro
|
|
2
|
+
* @mui/x-charts-pro v8.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -35,7 +35,6 @@ export * from '@mui/x-charts/ChartsSurface';
|
|
|
35
35
|
|
|
36
36
|
// Pro components
|
|
37
37
|
export * from "./Heatmap/index.js";
|
|
38
|
-
export * from "./ResponsiveChartContainerPro/index.js";
|
|
39
38
|
export * from "./ChartContainerPro/index.js";
|
|
40
39
|
export * from "./ScatterChartPro/index.js";
|
|
41
40
|
export * from "./BarChartPro/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTczMTUzODgwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DefaultizedProps
|
|
1
|
+
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { CommonDefaultizedProps, CommonSeriesType, CartesianSeriesType } from '@mui/x-charts/internals';
|
|
2
3
|
export type HeatmapValueType = [number, number, number];
|
|
3
4
|
export interface HeatmapSeriesType extends Omit<CommonSeriesType<HeatmapValueType>, 'color'>, CartesianSeriesType {
|
|
4
5
|
type: 'heatmap';
|