@mui/x-charts 8.4.0 → 8.5.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/BarChart/BarChart.d.ts +9 -2
- package/BarChart/BarChart.js +8 -1
- package/BarChart/useBarChartProps.js +1 -1
- package/CHANGELOG.md +103 -0
- package/ChartContainer/ChartContainer.d.ts +21 -2
- package/ChartContainer/ChartContainer.js +16 -0
- package/ChartContainer/useChartContainerProps.js +7 -3
- package/ChartDataProvider/ChartDataProvider.d.ts +11 -1
- package/ChartDataProvider/ChartDataProvider.js +19 -2
- package/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
- package/ChartDataProvider/useChartDataProviderProps.js +7 -3
- package/LineChart/LineChart.d.ts +9 -2
- package/LineChart/LineChart.js +8 -1
- package/LineChart/useLineChartProps.js +1 -1
- package/PieChart/PieChart.d.ts +10 -3
- package/PieChart/PieChart.js +11 -3
- package/RadarChart/RadarChart.d.ts +21 -3
- package/RadarChart/RadarChart.js +17 -2
- package/RadarChart/RadarChart.plugins.d.ts +5 -0
- package/RadarChart/RadarChart.plugins.js +10 -0
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
- package/RadarChart/RadarDataProvider/RadarDataProvider.js +6 -116
- package/RadarChart/index.d.ts +2 -0
- package/RadarChart/index.js +15 -1
- package/RadarChart/useRadarChartProps.d.ts +2 -1
- package/RadarChart/useRadarChartProps.js +3 -1
- package/ScatterChart/ScatterChart.d.ts +9 -2
- package/ScatterChart/ScatterChart.js +8 -1
- package/ScatterChart/useScatterChartProps.js +4 -2
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/Toolbar/Toolbar.d.ts +9 -3
- package/Toolbar/Toolbar.js +23 -7
- package/Toolbar/Toolbar.types.d.ts +15 -0
- package/Toolbar/Toolbar.types.js +5 -0
- package/Toolbar/ToolbarButton.d.ts +8 -2
- package/Toolbar/ToolbarButton.js +24 -6
- package/Toolbar/chartToolbarClasses.d.ts +6 -0
- package/Toolbar/chartToolbarClasses.js +9 -0
- package/Toolbar/index.d.ts +3 -1
- package/Toolbar/index.js +22 -0
- package/Toolbar/internals/ChartsToolbar.d.ts +6 -0
- package/Toolbar/internals/ChartsToolbar.js +14 -0
- package/context/ChartsSlotsContext.d.ts +20 -0
- package/context/ChartsSlotsContext.js +44 -0
- package/context/index.d.ts +2 -1
- package/context/index.js +11 -0
- package/context/useChartApiContext.d.ts +10 -0
- package/context/useChartApiContext.js +27 -0
- package/esm/BarChart/BarChart.d.ts +9 -2
- package/esm/BarChart/BarChart.js +8 -1
- package/esm/BarChart/useBarChartProps.js +1 -1
- package/esm/ChartContainer/ChartContainer.d.ts +21 -2
- package/esm/ChartContainer/ChartContainer.js +16 -0
- package/esm/ChartContainer/useChartContainerProps.js +7 -3
- package/esm/ChartDataProvider/ChartDataProvider.d.ts +11 -1
- package/esm/ChartDataProvider/ChartDataProvider.js +19 -2
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +2 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -3
- package/esm/LineChart/LineChart.d.ts +9 -2
- package/esm/LineChart/LineChart.js +8 -1
- package/esm/LineChart/useLineChartProps.js +1 -1
- package/esm/PieChart/PieChart.d.ts +10 -3
- package/esm/PieChart/PieChart.js +11 -3
- package/esm/RadarChart/RadarChart.d.ts +21 -3
- package/esm/RadarChart/RadarChart.js +17 -2
- package/esm/RadarChart/RadarChart.plugins.d.ts +5 -0
- package/esm/RadarChart/RadarChart.plugins.js +4 -0
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +6 -11
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.js +5 -115
- package/esm/RadarChart/index.d.ts +2 -0
- package/esm/RadarChart/index.js +2 -0
- package/esm/RadarChart/useRadarChartProps.d.ts +2 -1
- package/esm/RadarChart/useRadarChartProps.js +3 -1
- package/esm/ScatterChart/ScatterChart.d.ts +9 -2
- package/esm/ScatterChart/ScatterChart.js +8 -1
- package/esm/ScatterChart/useScatterChartProps.js +4 -2
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/Toolbar/Toolbar.d.ts +9 -3
- package/esm/Toolbar/Toolbar.js +22 -7
- package/esm/Toolbar/Toolbar.types.d.ts +15 -0
- package/esm/Toolbar/Toolbar.types.js +1 -0
- package/esm/Toolbar/ToolbarButton.d.ts +8 -2
- package/esm/Toolbar/ToolbarButton.js +23 -5
- package/esm/Toolbar/chartToolbarClasses.d.ts +6 -0
- package/esm/Toolbar/chartToolbarClasses.js +2 -0
- package/esm/Toolbar/index.d.ts +3 -1
- package/esm/Toolbar/index.js +3 -1
- package/esm/Toolbar/internals/ChartsToolbar.d.ts +6 -0
- package/esm/Toolbar/internals/ChartsToolbar.js +8 -0
- package/esm/context/ChartsSlotsContext.d.ts +20 -0
- package/esm/context/ChartsSlotsContext.js +35 -0
- package/esm/context/index.d.ts +2 -1
- package/esm/context/index.js +1 -0
- package/esm/context/useChartApiContext.d.ts +10 -0
- package/esm/context/useChartApiContext.js +21 -0
- package/esm/hooks/index.d.ts +1 -0
- package/esm/hooks/index.js +1 -0
- package/esm/index.js +1 -1
- package/esm/internals/constants.d.ts +3 -1
- package/esm/internals/constants.js +2 -1
- package/esm/internals/dateHelpers.d.ts +15 -0
- package/esm/internals/dateHelpers.js +20 -0
- package/esm/internals/domUtils.d.ts +1 -2
- package/esm/internals/domUtils.js +8 -19
- package/esm/internals/index.d.ts +4 -1
- package/esm/internals/index.js +4 -1
- package/esm/internals/material/index.d.ts +2 -0
- package/esm/internals/plugins/allPlugins.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +2 -8
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +83 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +9 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -8
- package/esm/models/index.d.ts +2 -2
- package/esm/models/index.js +1 -0
- package/esm/models/slots/chartsBaseSlotProps.d.ts +1 -0
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +12 -0
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -1
- package/internals/constants.js +3 -2
- package/internals/dateHelpers.d.ts +15 -0
- package/internals/dateHelpers.js +28 -0
- package/internals/domUtils.d.ts +1 -2
- package/internals/domUtils.js +8 -20
- package/internals/index.d.ts +4 -1
- package/internals/index.js +44 -8
- package/internals/material/index.d.ts +2 -0
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +5 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +14 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +83 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +9 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +5 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +11 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +5 -11
- package/models/index.d.ts +2 -2
- package/models/index.js +11 -0
- package/models/slots/chartsBaseSlotProps.d.ts +1 -0
- package/package.json +2 -2
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
4
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
|
|
3
5
|
import { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from "./BarPlot.js";
|
|
4
6
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
5
7
|
import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
@@ -11,8 +13,8 @@ import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
|
11
13
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
12
14
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
13
15
|
import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
14
|
-
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots {}
|
|
15
|
-
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps {}
|
|
16
|
+
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
17
|
+
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
16
18
|
export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
17
19
|
/**
|
|
18
20
|
* The series to display in the bar chart.
|
|
@@ -50,6 +52,11 @@ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartP
|
|
|
50
52
|
* @default 'vertical'
|
|
51
53
|
*/
|
|
52
54
|
layout?: BarSeriesType['layout'];
|
|
55
|
+
/**
|
|
56
|
+
* If true, shows the default chart toolbar.
|
|
57
|
+
* @default false
|
|
58
|
+
*/
|
|
59
|
+
showToolbar?: boolean;
|
|
53
60
|
}
|
|
54
61
|
/**
|
|
55
62
|
* Demos:
|
package/BarChart/BarChart.js
CHANGED
|
@@ -24,6 +24,7 @@ var _ChartDataProvider = require("../ChartDataProvider");
|
|
|
24
24
|
var _ChartsSurface = require("../ChartsSurface");
|
|
25
25
|
var _useChartContainerProps = require("../ChartContainer/useChartContainerProps");
|
|
26
26
|
var _ChartsWrapper = require("../internals/components/ChartsWrapper");
|
|
27
|
+
var _ChartsToolbar = require("../Toolbar/internals/ChartsToolbar");
|
|
27
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
29
|
/**
|
|
29
30
|
* Demos:
|
|
@@ -59,9 +60,10 @@ const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarCh
|
|
|
59
60
|
chartsSurfaceProps
|
|
60
61
|
} = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
|
|
61
62
|
const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
63
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbar.ChartsToolbar;
|
|
62
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
63
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
64
|
-
children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
66
|
+
children: [props.showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
65
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
66
68
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, (0, _extends2.default)({}, barPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
|
|
67
69
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
|
@@ -196,6 +198,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
196
198
|
* An array of [[BarSeriesType]] objects.
|
|
197
199
|
*/
|
|
198
200
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
201
|
+
/**
|
|
202
|
+
* If true, shows the default chart toolbar.
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
showToolbar: _propTypes.default.bool,
|
|
199
206
|
/**
|
|
200
207
|
* If `true`, animations are skipped.
|
|
201
208
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
14
14
|
var _constants = require("../constants");
|
|
15
15
|
var _BarChart = require("./BarChart.plugins");
|
|
16
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
|
|
16
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend", "showToolbar"];
|
|
17
17
|
/**
|
|
18
18
|
* A helper function that extracts BarChartProps from the input props
|
|
19
19
|
* and returns an object with props for the children components of BarChart.
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,109 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.5.0
|
|
9
|
+
|
|
10
|
+
_May 29, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 📊 Add support for exporting `RadarChartPro`, `FunnelChart` and `Heatmap` as image and PDF.
|
|
15
|
+
- 📊 `RadarChart` is now stable.
|
|
16
|
+
|
|
17
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
18
|
+
@xBlizZer, @sai6855, @alisasanib.
|
|
19
|
+
Following are all team members who have contributed to this release:
|
|
20
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @oliviertassinari.
|
|
21
|
+
|
|
22
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid@8.5.0`
|
|
27
|
+
|
|
28
|
+
- [DataGrid] Avoid ResizeObserver loop error (#17984) @cherniavskii
|
|
29
|
+
- [DataGrid] Fix column management `toggleColumn` event type (#18023) @KenanYusuf
|
|
30
|
+
- [DataGrid] Remove unnecessary `any` type (#17979) @sai6855
|
|
31
|
+
|
|
32
|
+
#### `@mui/x-data-grid-pro@8.5.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
33
|
+
|
|
34
|
+
Same changes as in `@mui/x-data-grid@8.5.0`, plus:
|
|
35
|
+
|
|
36
|
+
- [DataGridPro] Allow multi sorting without modifier key (#17925) @cherniavskii
|
|
37
|
+
- [DataGridPro] Row reordering icon improvements (#17947) @KenanYusuf
|
|
38
|
+
- [DataGridPro] Fix pinned columns order in column management (#17950) @alisasanib
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-premium@8.5.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid-pro@8.5.0`, plus:
|
|
43
|
+
|
|
44
|
+
- [DataGridPremium] Export `GridApiPremium` type (#18037) @arminmeh
|
|
45
|
+
|
|
46
|
+
### Date and Time Pickers
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers@8.5.0`
|
|
49
|
+
|
|
50
|
+
Internal changes.
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers-pro@8.5.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
53
|
+
|
|
54
|
+
Same changes as in `@mui/x-date-pickers@8.5.0`, plus:
|
|
55
|
+
|
|
56
|
+
- [DateRangePicker] Allow to override the format in the field (#17972) @flaviendelangle
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@8.5.0`
|
|
61
|
+
|
|
62
|
+
- [charts] Add `render` prop to charts toolbar components (#17649) @bernardobelchior
|
|
63
|
+
- [charts] Add configurable slots to toolbar (#17712) @bernardobelchior
|
|
64
|
+
- [charts] Export `useFunnelSeries` and `useRadarSeries` (#18034) @JCQuintas
|
|
65
|
+
- [charts] Expose `ChartApi` through context (#18004) @bernardobelchior
|
|
66
|
+
- [charts] Mark Radar chart as stable (#17946) @alexfauquette
|
|
67
|
+
- [charts] Only update store if interaction item is different (#17851) @bernardobelchior
|
|
68
|
+
- [charts] Reuse shared date utils (#18014) @JCQuintas
|
|
69
|
+
- [charts] Use Map for string cache instead of object (#17982) @bernardobelchior
|
|
70
|
+
- [charts] Fix Population pyramid demo (#17987) @oliviertassinari
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-charts-pro@8.5.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-charts@8.5.0`, plus:
|
|
75
|
+
|
|
76
|
+
- [charts-pro] Add range selection to zoom slider (#17949) @bernardobelchior
|
|
77
|
+
- [charts-pro] Allow configuring zoom slider tooltip (#18030) @bernardobelchior
|
|
78
|
+
- [charts-pro] Allow exporting a funnel chart (#17957) @bernardobelchior
|
|
79
|
+
- [charts-pro] Allow exporting a heatmap chart (#17916) @bernardobelchior
|
|
80
|
+
- [charts-pro] Allow exporting a radar chart (#17968) @bernardobelchior
|
|
81
|
+
- [charts-pro] Always show both zoom slider tooltips (#18027) @bernardobelchior
|
|
82
|
+
- [charts-pro] Show zoom slider tooltip when selecting range (#18028) @bernardobelchior
|
|
83
|
+
- [charts-pro] Split `ChartAxisZoomSlider` into smaller files (#18011) @bernardobelchior
|
|
84
|
+
- [charts-pro] Update zoom slider range selection cursor (#17977) @bernardobelchior
|
|
85
|
+
- [charts-pro] Add support for Heatmap legend (#17943) @alexfauquette
|
|
86
|
+
|
|
87
|
+
### Tree View
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@8.5.0`
|
|
90
|
+
|
|
91
|
+
Internal changes.
|
|
92
|
+
|
|
93
|
+
#### `@mui/x-tree-view-pro@8.5.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
94
|
+
|
|
95
|
+
Same changes as in `@mui/x-tree-view@8.5.0`.
|
|
96
|
+
|
|
97
|
+
### Docs
|
|
98
|
+
|
|
99
|
+
- [docs] Fix derived column pivoting demo crash (#17944) @arminmeh
|
|
100
|
+
- [docs] Fix light/dark mode blink on pickers overview (#18002) @alexfauquette
|
|
101
|
+
- [docs] Fix scatter shape demo causing horizontal overflow (#17974) @bernardobelchior
|
|
102
|
+
|
|
103
|
+
### Core
|
|
104
|
+
|
|
105
|
+
- [code-infra] Add bundle size monitor (#17754) @Janpot
|
|
106
|
+
- [code-infra] Enable `babel-plugin-display-name` in vitest (#17903) @JCQuintas
|
|
107
|
+
- [infra] Remove last deprecated `ponyfillGlobal` usage (#18003) @LukasTy
|
|
108
|
+
- [infra] Use `babel-plugin-display-name` from npm (#18040) @LukasTy
|
|
109
|
+
- [x-telemetry] Remove deprecated `ponyfillGlobal` (#17986) @xBlizZer
|
|
110
|
+
|
|
8
111
|
## 8.4.0
|
|
9
112
|
|
|
10
113
|
_May 21, 2025_
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
|
|
3
|
+
import { BarChartPluginsSignatures } from "../BarChart/BarChart.plugins.js";
|
|
4
|
+
import { ScatterChartPluginsSignatures } from "../ScatterChart/ScatterChart.plugins.js";
|
|
5
|
+
import { LineChartPluginsSignatures } from "../LineChart/LineChart.plugins.js";
|
|
2
6
|
import { ChartSeriesType } from "../models/seriesType/config.js";
|
|
3
7
|
import { ChartDataProviderProps } from "../ChartDataProvider/index.js";
|
|
4
8
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
5
|
-
import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
9
|
+
import { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
10
|
import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
|
|
11
|
+
import { ChartPublicAPI } from "../internals/plugins/models/index.js";
|
|
7
12
|
export type ChartContainerProps<SeriesType extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<SeriesType>> = Omit<ChartDataProviderProps<SeriesType, TSignatures>, 'children'> & ChartsSurfaceProps;
|
|
8
|
-
|
|
13
|
+
type PluginsPerSeriesType = {
|
|
14
|
+
line: LineChartPluginsSignatures;
|
|
15
|
+
scatter: ScatterChartPluginsSignatures;
|
|
16
|
+
bar: BarChartPluginsSignatures;
|
|
17
|
+
pie: PieChartPluginSignatures;
|
|
18
|
+
composition: DefaultPluginSignatures;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The API of the chart `apiRef` object.
|
|
22
|
+
* The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
|
|
23
|
+
* @example ChartApi<'bar'>
|
|
24
|
+
* If the chart is being created using composition, the `composition` value can be used.
|
|
25
|
+
* @example ChartApi<'composition'>
|
|
26
|
+
*/
|
|
27
|
+
export type ChartApi<TSeries extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (TSeries extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[TSeries] : AllPluginSignatures)> = ChartPublicAPI<TSignatures>;
|
|
9
28
|
/**
|
|
10
29
|
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
11
30
|
*
|
|
@@ -14,6 +14,14 @@ var _ChartDataProvider = require("../ChartDataProvider");
|
|
|
14
14
|
var _useChartContainerProps = require("./useChartContainerProps");
|
|
15
15
|
var _ChartsSurface = require("../ChartsSurface");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
/**
|
|
18
|
+
* The API of the chart `apiRef` object.
|
|
19
|
+
* The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
|
|
20
|
+
* @example ChartApi<'bar'>
|
|
21
|
+
* If the chart is being created using composition, the `composition` value can be used.
|
|
22
|
+
* @example ChartApi<'composition'>
|
|
23
|
+
*/
|
|
24
|
+
|
|
17
25
|
/**
|
|
18
26
|
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
19
27
|
*
|
|
@@ -593,6 +601,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
593
601
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
594
602
|
*/
|
|
595
603
|
skipAnimation: _propTypes.default.bool,
|
|
604
|
+
/**
|
|
605
|
+
* The props for the slots.
|
|
606
|
+
*/
|
|
607
|
+
slotProps: _propTypes.default.object,
|
|
608
|
+
/**
|
|
609
|
+
* Slots to customize charts' components.
|
|
610
|
+
*/
|
|
611
|
+
slots: _propTypes.default.object,
|
|
596
612
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
597
613
|
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
598
614
|
title: _propTypes.default.string,
|
|
@@ -9,7 +9,7 @@ exports.useChartContainerProps = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
12
|
-
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText"];
|
|
12
|
+
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps"];
|
|
13
13
|
const useChartContainerProps = (props, ref) => {
|
|
14
14
|
const _ref = props,
|
|
15
15
|
{
|
|
@@ -38,7 +38,9 @@ const useChartContainerProps = (props, ref) => {
|
|
|
38
38
|
skipAnimation,
|
|
39
39
|
seriesConfig,
|
|
40
40
|
plugins,
|
|
41
|
-
localeText
|
|
41
|
+
localeText,
|
|
42
|
+
slots,
|
|
43
|
+
slotProps
|
|
42
44
|
} = _ref,
|
|
43
45
|
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
44
46
|
const chartsSurfaceProps = (0, _extends2.default)({
|
|
@@ -69,7 +71,9 @@ const useChartContainerProps = (props, ref) => {
|
|
|
69
71
|
height,
|
|
70
72
|
localeText,
|
|
71
73
|
seriesConfig,
|
|
72
|
-
plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS
|
|
74
|
+
plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS,
|
|
75
|
+
slots,
|
|
76
|
+
slotProps
|
|
73
77
|
};
|
|
74
78
|
return {
|
|
75
79
|
chartDataProviderProps,
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
2
3
|
import { ChartProviderProps } from "../context/ChartProvider/index.js";
|
|
3
4
|
import { ChartSeriesType } from "../models/seriesType/config.js";
|
|
4
5
|
import { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
|
|
5
6
|
import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
7
|
import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
|
|
7
|
-
export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps
|
|
8
|
+
export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = React.PropsWithChildren<ChartProviderProps<TSeries, TSignatures>['pluginParams'] & Pick<ChartProviderProps<TSeries, TSignatures>, 'seriesConfig' | 'plugins'>> & ChartsLocalizationProviderProps & {
|
|
9
|
+
/**
|
|
10
|
+
* Slots to customize charts' components.
|
|
11
|
+
*/
|
|
12
|
+
slots?: Partial<ChartsSlots>;
|
|
13
|
+
/**
|
|
14
|
+
* The props for the slots.
|
|
15
|
+
*/
|
|
16
|
+
slotProps?: Partial<ChartsSlotProps>;
|
|
17
|
+
};
|
|
8
18
|
/**
|
|
9
19
|
* Orchestrates the data providers for the chart components and hooks.
|
|
10
20
|
*
|
|
@@ -10,6 +10,8 @@ exports.ChartDataProvider = ChartDataProvider;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _material = require("../internals/material");
|
|
14
|
+
var _ChartsSlotsContext = require("../context/ChartsSlotsContext");
|
|
13
15
|
var _useChartDataProviderProps = require("./useChartDataProviderProps");
|
|
14
16
|
var _ChartProvider = require("../context/ChartProvider");
|
|
15
17
|
var _ChartsLocalizationProvider = require("../ChartsLocalizationProvider");
|
|
@@ -45,12 +47,19 @@ function ChartDataProvider(props) {
|
|
|
45
47
|
const {
|
|
46
48
|
children,
|
|
47
49
|
localeText,
|
|
48
|
-
chartProviderProps
|
|
50
|
+
chartProviderProps,
|
|
51
|
+
slots,
|
|
52
|
+
slotProps
|
|
49
53
|
} = (0, _useChartDataProviderProps.useChartDataProviderProps)(props);
|
|
50
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartProvider.ChartProvider, (0, _extends2.default)({}, chartProviderProps, {
|
|
51
55
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLocalizationProvider.ChartsLocalizationProvider, {
|
|
52
56
|
localeText: localeText,
|
|
53
|
-
children:
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSlotsContext.ChartsSlotsProvider, {
|
|
58
|
+
slots: slots,
|
|
59
|
+
slotProps: slotProps,
|
|
60
|
+
defaultSlots: _material.defaultSlotsMaterial,
|
|
61
|
+
children: children
|
|
62
|
+
})
|
|
54
63
|
})
|
|
55
64
|
}));
|
|
56
65
|
}
|
|
@@ -107,6 +116,14 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
|
|
|
107
116
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
108
117
|
*/
|
|
109
118
|
skipAnimation: _propTypes.default.bool,
|
|
119
|
+
/**
|
|
120
|
+
* The props for the slots.
|
|
121
|
+
*/
|
|
122
|
+
slotProps: _propTypes.default.object,
|
|
123
|
+
/**
|
|
124
|
+
* Slots to customize charts' components.
|
|
125
|
+
*/
|
|
126
|
+
slots: _propTypes.default.object,
|
|
110
127
|
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
111
128
|
/**
|
|
112
129
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
@@ -8,4 +8,6 @@ export declare const useChartDataProviderProps: <TSeries extends ChartSeriesType
|
|
|
8
8
|
children: import("react").ReactNode;
|
|
9
9
|
localeText: Partial<import("../locales/index.js").ChartsLocaleText> | undefined;
|
|
10
10
|
chartProviderProps: ChartProviderProps<TSeries, TSignatures>;
|
|
11
|
+
slots: Partial<import("../internals/index.js").ChartsSlots> | undefined;
|
|
12
|
+
slotProps: Partial<import("../internals/index.js").ChartsSlotProps> | undefined;
|
|
11
13
|
};
|
|
@@ -10,13 +10,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var _styles = require("@mui/material/styles");
|
|
12
12
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
13
|
-
const _excluded = ["children", "localeText", "plugins", "seriesConfig"];
|
|
13
|
+
const _excluded = ["children", "localeText", "plugins", "seriesConfig", "slots", "slotProps"];
|
|
14
14
|
const useChartDataProviderProps = props => {
|
|
15
15
|
const {
|
|
16
16
|
children,
|
|
17
17
|
localeText,
|
|
18
18
|
plugins = _allPlugins.DEFAULT_PLUGINS,
|
|
19
|
-
seriesConfig
|
|
19
|
+
seriesConfig,
|
|
20
|
+
slots,
|
|
21
|
+
slotProps
|
|
20
22
|
} = props,
|
|
21
23
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
22
24
|
const theme = (0, _styles.useTheme)();
|
|
@@ -30,7 +32,9 @@ const useChartDataProviderProps = props => {
|
|
|
30
32
|
return {
|
|
31
33
|
children,
|
|
32
34
|
localeText,
|
|
33
|
-
chartProviderProps
|
|
35
|
+
chartProviderProps,
|
|
36
|
+
slots,
|
|
37
|
+
slotProps
|
|
34
38
|
};
|
|
35
39
|
};
|
|
36
40
|
exports.useChartDataProviderProps = useChartDataProviderProps;
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { ChartsSlots, ChartsSlotProps } from "../internals/material/index.js";
|
|
3
4
|
import { AreaPlotProps, AreaPlotSlotProps, AreaPlotSlots } from "./AreaPlot.js";
|
|
4
5
|
import { LinePlotProps, LinePlotSlotProps, LinePlotSlots } from "./LinePlot.js";
|
|
5
6
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
@@ -14,8 +15,9 @@ import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from "./LineHighli
|
|
|
14
15
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
15
16
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/index.js";
|
|
16
17
|
import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
|
|
17
|
-
|
|
18
|
-
export interface
|
|
18
|
+
import { ChartsToolbarSlots, ChartsToolbarSlotProps } from "../Toolbar/index.js";
|
|
19
|
+
export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
20
|
+
export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
19
21
|
export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
20
22
|
/**
|
|
21
23
|
* The series to display in the line chart.
|
|
@@ -67,6 +69,11 @@ export interface LineChartProps extends Omit<ChartContainerProps<'line', LineCha
|
|
|
67
69
|
* @default false
|
|
68
70
|
*/
|
|
69
71
|
skipAnimation?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* If true, shows the default chart toolbar.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
showToolbar?: boolean;
|
|
70
77
|
}
|
|
71
78
|
/**
|
|
72
79
|
* Demos:
|
package/LineChart/LineChart.js
CHANGED
|
@@ -11,6 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _ChartsToolbar = require("../Toolbar/internals/ChartsToolbar");
|
|
14
15
|
var _AreaPlot = require("./AreaPlot");
|
|
15
16
|
var _LinePlot = require("./LinePlot");
|
|
16
17
|
var _MarkPlot = require("./MarkPlot");
|
|
@@ -64,9 +65,10 @@ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function Lin
|
|
|
64
65
|
chartsSurfaceProps
|
|
65
66
|
} = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
|
|
66
67
|
const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
68
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbar.ChartsToolbar;
|
|
67
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
68
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
69
|
-
children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
71
|
+
children: [props.showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
70
72
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
71
73
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaPlot.AreaPlot, (0, _extends2.default)({}, areaPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinePlot.LinePlot, (0, _extends2.default)({}, linePlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps))]
|
|
72
74
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
@@ -196,6 +198,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
196
198
|
* An array of [[LineSeriesType]] objects.
|
|
197
199
|
*/
|
|
198
200
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
201
|
+
/**
|
|
202
|
+
* If true, shows the default chart toolbar.
|
|
203
|
+
* @default false
|
|
204
|
+
*/
|
|
205
|
+
showToolbar: _propTypes.default.bool,
|
|
199
206
|
/**
|
|
200
207
|
* If `true`, animations are skipped.
|
|
201
208
|
* @default false
|
|
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
14
14
|
var _constants = require("../constants");
|
|
15
15
|
var _LineChart = require("./LineChart.plugins");
|
|
16
|
-
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
16
|
+
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "onAreaClick", "onLineClick", "onMarkClick", "axisHighlight", "disableLineItemHighlight", "hideLegend", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
17
17
|
/**
|
|
18
18
|
* A helper function that extracts LineChartProps from the input props
|
|
19
19
|
* and returns an object with props for the children components of LineChart.
|
package/PieChart/PieChart.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
|
|
4
|
+
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
3
5
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
4
6
|
import { PieSeriesType } from "../models/seriesType/index.js";
|
|
5
7
|
import { ChartsTooltipSlots, ChartsTooltipSlotProps } from "../ChartsTooltip/ChartTooltip.types.js";
|
|
@@ -8,9 +10,9 @@ import { PiePlotProps, PiePlotSlotProps, PiePlotSlots } from "./PiePlot.js";
|
|
|
8
10
|
import { PieValueType } from "../models/seriesType/pie.js";
|
|
9
11
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/index.js";
|
|
10
12
|
import { PieChartPluginSignatures } from "./PieChart.plugins.js";
|
|
11
|
-
export interface PieChartSlots extends PiePlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots {}
|
|
12
|
-
export interface PieChartSlotProps extends PiePlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps {}
|
|
13
|
-
export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartPluginSignatures>, 'series'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
|
|
13
|
+
export interface PieChartSlots extends PiePlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
14
|
+
export interface PieChartSlotProps extends PiePlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
15
|
+
export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartPluginSignatures>, 'series' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
|
|
14
16
|
/**
|
|
15
17
|
* The series to display in the pie chart.
|
|
16
18
|
* An array of [[PieSeriesType]] objects.
|
|
@@ -24,6 +26,11 @@ export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartP
|
|
|
24
26
|
* Callback fired when a pie arc is clicked.
|
|
25
27
|
*/
|
|
26
28
|
onItemClick?: PiePlotProps['onItemClick'];
|
|
29
|
+
/**
|
|
30
|
+
* If true, shows the default chart toolbar.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
showToolbar?: boolean;
|
|
27
34
|
/**
|
|
28
35
|
* Overridable component slots.
|
|
29
36
|
* @default {}
|
package/PieChart/PieChart.js
CHANGED
|
@@ -12,6 +12,7 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
|
+
var _ChartsToolbar = require("../Toolbar/internals/ChartsToolbar");
|
|
15
16
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
16
17
|
var _ChartsLegend = require("../ChartsLegend");
|
|
17
18
|
var _PiePlot = require("./PiePlot");
|
|
@@ -23,7 +24,7 @@ var _ChartsWrapper = require("../internals/components/ChartsWrapper");
|
|
|
23
24
|
var _PieChart2 = require("./PieChart.plugins");
|
|
24
25
|
var _defaultizeMargin = require("../internals/defaultizeMargin");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
27
|
+
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
27
28
|
const defaultMargin = {
|
|
28
29
|
top: 5,
|
|
29
30
|
bottom: 5,
|
|
@@ -62,7 +63,8 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
62
63
|
loading,
|
|
63
64
|
highlightedItem,
|
|
64
65
|
onHighlightChange,
|
|
65
|
-
className
|
|
66
|
+
className,
|
|
67
|
+
showToolbar
|
|
66
68
|
} = props,
|
|
67
69
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
68
70
|
const margin = (0, _defaultizeMargin.defaultizeMargin)(marginProps, defaultMargin);
|
|
@@ -84,12 +86,13 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
84
86
|
plugins: _PieChart2.PIE_CHART_PLUGINS
|
|
85
87
|
}), ref);
|
|
86
88
|
const Tooltip = slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
89
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbar.ChartsToolbar;
|
|
87
90
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
88
91
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, {
|
|
89
92
|
legendPosition: props.slotProps?.legend?.position,
|
|
90
93
|
legendDirection: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
91
94
|
sx: sx,
|
|
92
|
-
children: [!hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
95
|
+
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
93
96
|
direction: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
94
97
|
slots: slots,
|
|
95
98
|
slotProps: slotProps
|
|
@@ -187,6 +190,11 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
187
190
|
* An array of [[PieSeriesType]] objects.
|
|
188
191
|
*/
|
|
189
192
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
193
|
+
/**
|
|
194
|
+
* If true, shows the default chart toolbar.
|
|
195
|
+
* @default false
|
|
196
|
+
*/
|
|
197
|
+
showToolbar: _propTypes.default.bool,
|
|
190
198
|
/**
|
|
191
199
|
* If `true`, animations are skipped.
|
|
192
200
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from "../ChartsLegend/index.js";
|
|
3
3
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
4
|
+
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
5
|
+
import { ChartsWrapperProps } from "../internals/components/ChartsWrapper/index.js";
|
|
4
6
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
5
7
|
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
6
8
|
import { RadarAxisHighlightProps } from "./RadarAxisHighlight/index.js";
|
|
7
9
|
import { ChartsTooltipSlotProps, ChartsTooltipSlots } from "../ChartsTooltip/index.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface
|
|
10
|
+
import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
|
|
11
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
|
|
12
|
+
export interface RadarChartSlots extends ChartsTooltipSlots, ChartsOverlaySlots, ChartsLegendSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
13
|
+
export interface RadarChartSlotProps extends ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsLegendSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
14
|
+
export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridProps, 'classes'>, Omit<Partial<RadarAxisHighlightProps>, 'classes'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ChartsWrapperProps, 'sx'>, Omit<ChartsSurfaceProps, 'sx'> {
|
|
11
15
|
/**
|
|
12
16
|
* If `true`, the legend is not rendered.
|
|
13
17
|
*/
|
|
14
18
|
hideLegend?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* If true, shows the default chart toolbar.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
showToolbar?: boolean;
|
|
15
24
|
/**
|
|
16
25
|
* Overridable component slots.
|
|
17
26
|
* @default {}
|
|
@@ -23,5 +32,14 @@ export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridP
|
|
|
23
32
|
*/
|
|
24
33
|
slotProps?: RadarChartSlotProps;
|
|
25
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Demos:
|
|
37
|
+
*
|
|
38
|
+
* - [Radar Chart](https://mui.com/x/react-charts/radar/)
|
|
39
|
+
*
|
|
40
|
+
* API:
|
|
41
|
+
*
|
|
42
|
+
* - [RadarChart API](https://mui.com/x/api/charts/radar-chart/)
|
|
43
|
+
*/
|
|
26
44
|
declare const RadarChart: React.ForwardRefExoticComponent<RadarChartProps & React.RefAttributes<SVGSVGElement>>;
|
|
27
45
|
export { RadarChart };
|