@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/RadarChart/RadarChart.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 _ChartsLegend = require("../ChartsLegend");
|
|
15
16
|
var _ChartsOverlay = require("../ChartsOverlay/ChartsOverlay");
|
|
16
17
|
var _useRadarChartProps = require("./useRadarChartProps");
|
|
@@ -23,6 +24,15 @@ var _RadarAxisHighlight = require("./RadarAxisHighlight");
|
|
|
23
24
|
var _RadarMetricLabels = require("./RadarMetricLabels");
|
|
24
25
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
/**
|
|
28
|
+
* Demos:
|
|
29
|
+
*
|
|
30
|
+
* - [Radar Chart](https://mui.com/x/react-charts/radar/)
|
|
31
|
+
*
|
|
32
|
+
* API:
|
|
33
|
+
*
|
|
34
|
+
* - [RadarChart API](https://mui.com/x/api/charts/radar-chart/)
|
|
35
|
+
*/
|
|
26
36
|
const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function RadarChart(inProps, ref) {
|
|
27
37
|
const props = (0, _styles.useThemeProps)({
|
|
28
38
|
props: inProps,
|
|
@@ -39,9 +49,10 @@ const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function R
|
|
|
39
49
|
children
|
|
40
50
|
} = (0, _useRadarChartProps.useRadarChartProps)(props);
|
|
41
51
|
const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
52
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbar.ChartsToolbar;
|
|
42
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarDataProvider.RadarDataProvider, (0, _extends2.default)({}, radarDataProviderProps, {
|
|
43
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
44
|
-
children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
55
|
+
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, {
|
|
45
56
|
ref: ref,
|
|
46
57
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarGrid.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarMetricLabels.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarAxisHighlight.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesMarks, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
|
|
47
58
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
@@ -57,7 +68,6 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
57
68
|
apiRef: _propTypes.default.shape({
|
|
58
69
|
current: _propTypes.default.object
|
|
59
70
|
}),
|
|
60
|
-
children: _propTypes.default.node,
|
|
61
71
|
className: _propTypes.default.string,
|
|
62
72
|
/**
|
|
63
73
|
* Color palette used to colorize multiple series.
|
|
@@ -153,6 +163,11 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
153
163
|
* @default 'sharp'
|
|
154
164
|
*/
|
|
155
165
|
shape: _propTypes.default.oneOf(['circular', 'sharp']),
|
|
166
|
+
/**
|
|
167
|
+
* If true, shows the default chart toolbar.
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
showToolbar: _propTypes.default.bool,
|
|
156
171
|
/**
|
|
157
172
|
* If `true`, animations are skipped.
|
|
158
173
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UseChartPolarAxisSignature } from "../internals/plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
2
|
+
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
3
|
+
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
|
+
export declare const RADAR_PLUGINS: readonly [import("../internals/index.js").ChartPlugin<UseChartPolarAxisSignature<any>>, import("../internals/index.js").ChartPlugin<UseChartInteractionSignature>, import("../internals/index.js").ChartPlugin<UseChartHighlightSignature>];
|
|
5
|
+
export type RadarChartPluginsSignatures = [UseChartPolarAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RADAR_PLUGINS = void 0;
|
|
7
|
+
var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPolarAxis");
|
|
8
|
+
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
9
|
+
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
10
|
+
const RADAR_PLUGINS = exports.RADAR_PLUGINS = [_useChartPolarAxis.useChartPolarAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight];
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
-
import {
|
|
3
|
+
import { RadarChartPluginsSignatures } from "../RadarChart.plugins.js";
|
|
4
4
|
import { RadarSeriesType } from "../../models/seriesType/radar.js";
|
|
5
|
-
import {
|
|
6
|
-
import { UseChartHighlightSignature } from "../../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
7
|
-
import { UseChartInteractionSignature } from "../../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
5
|
+
import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
|
|
8
6
|
import { RadarConfig } from "./radar.types.js";
|
|
9
|
-
|
|
10
|
-
export
|
|
7
|
+
import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
|
|
8
|
+
export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset'> & {
|
|
11
9
|
/**
|
|
12
10
|
* The series to display in the bar chart.
|
|
13
11
|
* An array of [[RadarSeriesType]] objects.
|
|
@@ -22,9 +20,6 @@ export interface RadarDataProviderProps extends Omit<ChartContainerProps<'radar'
|
|
|
22
20
|
* @default 'axis'
|
|
23
21
|
*/
|
|
24
22
|
highlight?: 'axis' | 'series' | 'none';
|
|
25
|
-
}
|
|
26
|
-
declare function RadarDataProvider(props: RadarDataProviderProps): React.JSX.Element;
|
|
27
|
-
declare namespace RadarDataProvider {
|
|
28
|
-
var propTypes: any;
|
|
29
|
-
}
|
|
23
|
+
};
|
|
24
|
+
declare function RadarDataProvider<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures>(props: RadarDataProviderProps<TSignatures>): React.JSX.Element;
|
|
30
25
|
export { RadarDataProvider };
|
|
@@ -10,19 +10,15 @@ exports.RadarDataProvider = RadarDataProvider;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
var
|
|
13
|
+
var _RadarChart = require("../RadarChart.plugins");
|
|
14
14
|
var _ChartDataProvider = require("../../ChartDataProvider");
|
|
15
15
|
var _defaultizeMargin = require("../../internals/defaultizeMargin");
|
|
16
|
-
var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
|
|
17
|
-
var _useChartHighlight = require("../../internals/plugins/featurePlugins/useChartHighlight");
|
|
18
|
-
var _useChartInteraction = require("../../internals/plugins/featurePlugins/useChartInteraction");
|
|
19
16
|
var _seriesConfig = require("../seriesConfig");
|
|
20
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["series", "children", "width", "height", "colors", "
|
|
18
|
+
const _excluded = ["series", "children", "width", "height", "colors", "skipAnimation", "margin", "radar", "highlight", "plugins"];
|
|
22
19
|
const RADAR_SERIES_CONFIG = {
|
|
23
20
|
radar: _seriesConfig.radarSeriesConfig
|
|
24
21
|
};
|
|
25
|
-
const RADAR_PLUGINS = [_useChartPolarAxis.useChartPolarAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight];
|
|
26
22
|
const DEFAULT_RADAR_MARGIN = {
|
|
27
23
|
top: 30,
|
|
28
24
|
bottom: 30,
|
|
@@ -36,12 +32,11 @@ function RadarDataProvider(props) {
|
|
|
36
32
|
width,
|
|
37
33
|
height,
|
|
38
34
|
colors,
|
|
39
|
-
highlightedItem,
|
|
40
|
-
onHighlightChange,
|
|
41
35
|
skipAnimation,
|
|
42
36
|
margin,
|
|
43
37
|
radar,
|
|
44
|
-
highlight
|
|
38
|
+
highlight,
|
|
39
|
+
plugins
|
|
45
40
|
} = props,
|
|
46
41
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
42
|
const rotationAxes = React.useMemo(() => [{
|
|
@@ -87,116 +82,11 @@ function RadarDataProvider(props) {
|
|
|
87
82
|
height: height,
|
|
88
83
|
margin: defaultizedMargin,
|
|
89
84
|
colors: colors,
|
|
90
|
-
highlightedItem: highlightedItem,
|
|
91
|
-
onHighlightChange: onHighlightChange,
|
|
92
85
|
skipAnimation: skipAnimation,
|
|
93
|
-
plugins: RADAR_PLUGINS,
|
|
86
|
+
plugins: plugins ?? _RadarChart.RADAR_PLUGINS,
|
|
94
87
|
rotationAxis: rotationAxes,
|
|
95
88
|
radiusAxis: radiusAxis,
|
|
96
89
|
seriesConfig: RADAR_SERIES_CONFIG,
|
|
97
90
|
children: children
|
|
98
91
|
}));
|
|
99
|
-
}
|
|
100
|
-
process.env.NODE_ENV !== "production" ? RadarDataProvider.propTypes = {
|
|
101
|
-
// ----------------------------- Warning --------------------------------
|
|
102
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
103
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
104
|
-
// ----------------------------------------------------------------------
|
|
105
|
-
apiRef: _propTypes.default.shape({
|
|
106
|
-
current: _propTypes.default.object
|
|
107
|
-
}),
|
|
108
|
-
children: _propTypes.default.node,
|
|
109
|
-
className: _propTypes.default.string,
|
|
110
|
-
/**
|
|
111
|
-
* Color palette used to colorize multiple series.
|
|
112
|
-
* @default rainbowSurgePalette
|
|
113
|
-
*/
|
|
114
|
-
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
115
|
-
desc: _propTypes.default.string,
|
|
116
|
-
/**
|
|
117
|
-
* If `true`, the charts will not listen to the mouse move event.
|
|
118
|
-
* It might break interactive features, but will improve performance.
|
|
119
|
-
* @default false
|
|
120
|
-
*/
|
|
121
|
-
disableAxisListener: _propTypes.default.bool,
|
|
122
|
-
/**
|
|
123
|
-
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
124
|
-
*/
|
|
125
|
-
height: _propTypes.default.number,
|
|
126
|
-
/**
|
|
127
|
-
* Indicates if the chart should highlight items per axis or per series.
|
|
128
|
-
* @default 'axis'
|
|
129
|
-
*/
|
|
130
|
-
highlight: _propTypes.default.oneOf(['axis', 'none', 'series']),
|
|
131
|
-
/**
|
|
132
|
-
* The highlighted item.
|
|
133
|
-
* Used when the highlight is controlled.
|
|
134
|
-
*/
|
|
135
|
-
highlightedItem: _propTypes.default.shape({
|
|
136
|
-
dataIndex: _propTypes.default.number,
|
|
137
|
-
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
138
|
-
}),
|
|
139
|
-
/**
|
|
140
|
-
* This prop is used to help implement the accessibility logic.
|
|
141
|
-
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
142
|
-
*/
|
|
143
|
-
id: _propTypes.default.string,
|
|
144
|
-
/**
|
|
145
|
-
* Localized text for chart components.
|
|
146
|
-
*/
|
|
147
|
-
localeText: _propTypes.default.object,
|
|
148
|
-
/**
|
|
149
|
-
* The margin between the SVG and the drawing area.
|
|
150
|
-
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
151
|
-
*
|
|
152
|
-
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
153
|
-
*/
|
|
154
|
-
margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
155
|
-
bottom: _propTypes.default.number,
|
|
156
|
-
left: _propTypes.default.number,
|
|
157
|
-
right: _propTypes.default.number,
|
|
158
|
-
top: _propTypes.default.number
|
|
159
|
-
})]),
|
|
160
|
-
/**
|
|
161
|
-
* The callback fired when the highlighted item changes.
|
|
162
|
-
*
|
|
163
|
-
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
164
|
-
*/
|
|
165
|
-
onHighlightChange: _propTypes.default.func,
|
|
166
|
-
/**
|
|
167
|
-
* The configuration of the radar scales.
|
|
168
|
-
*/
|
|
169
|
-
radar: _propTypes.default.shape({
|
|
170
|
-
labelFormatter: _propTypes.default.func,
|
|
171
|
-
labelGap: _propTypes.default.number,
|
|
172
|
-
max: _propTypes.default.number,
|
|
173
|
-
metrics: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
174
|
-
max: _propTypes.default.number,
|
|
175
|
-
min: _propTypes.default.number,
|
|
176
|
-
name: _propTypes.default.string.isRequired
|
|
177
|
-
}))]).isRequired,
|
|
178
|
-
startAngle: _propTypes.default.number
|
|
179
|
-
}).isRequired,
|
|
180
|
-
/**
|
|
181
|
-
* The series to display in the bar chart.
|
|
182
|
-
* An array of [[RadarSeriesType]] objects.
|
|
183
|
-
*/
|
|
184
|
-
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
185
|
-
/**
|
|
186
|
-
* The configuration helpers used to compute attributes according to the series type.
|
|
187
|
-
* @ignore Unstable props for internal usage.
|
|
188
|
-
*/
|
|
189
|
-
seriesConfig: _propTypes.default.object,
|
|
190
|
-
/**
|
|
191
|
-
* If `true`, animations are skipped.
|
|
192
|
-
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
193
|
-
*/
|
|
194
|
-
skipAnimation: _propTypes.default.bool,
|
|
195
|
-
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]),
|
|
196
|
-
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
197
|
-
title: _propTypes.default.string,
|
|
198
|
-
/**
|
|
199
|
-
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
200
|
-
*/
|
|
201
|
-
width: _propTypes.default.number
|
|
202
|
-
} : void 0;
|
|
92
|
+
}
|
package/RadarChart/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { RadarChart as Unstable_RadarChart } from "./RadarChart.js";
|
|
2
|
+
export { RadarChart } from "./RadarChart.js";
|
|
2
3
|
export { RadarDataProvider as Unstable_RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
4
|
+
export { RadarDataProvider } from "./RadarDataProvider/index.js";
|
|
3
5
|
export type { RadarChartProps } from "./RadarChart.js";
|
|
4
6
|
export type { RadarDataProviderProps } from "./RadarDataProvider/index.js";
|
|
5
7
|
export * from "./RadarGrid/index.js";
|
package/RadarChart/index.js
CHANGED
|
@@ -5,8 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Unstable_RadarChart: true,
|
|
8
|
-
|
|
8
|
+
RadarChart: true,
|
|
9
|
+
Unstable_RadarDataProvider: true,
|
|
10
|
+
RadarDataProvider: true
|
|
9
11
|
};
|
|
12
|
+
Object.defineProperty(exports, "RadarChart", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _RadarChart.RadarChart;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "RadarDataProvider", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _RadarDataProvider.RadarDataProvider;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
10
24
|
Object.defineProperty(exports, "Unstable_RadarChart", {
|
|
11
25
|
enumerable: true,
|
|
12
26
|
get: function () {
|
|
@@ -5,6 +5,7 @@ import type { ChartsWrapperProps } from "../internals/components/ChartsWrapper/i
|
|
|
5
5
|
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
6
6
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
7
7
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
8
|
+
import { RadarChartPluginsSignatures } from "./RadarChart.plugins.js";
|
|
8
9
|
/**
|
|
9
10
|
* A helper function that extracts RadarChartProps from the input props
|
|
10
11
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -16,7 +17,7 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
|
|
|
16
17
|
highlight: "none" | "series" | "axis";
|
|
17
18
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
18
19
|
chartsSurfaceProps: ChartsSurfaceProps;
|
|
19
|
-
radarDataProviderProps: RadarDataProviderProps
|
|
20
|
+
radarDataProviderProps: RadarDataProviderProps<RadarChartPluginsSignatures>;
|
|
20
21
|
radarGrid: RadarGridProps;
|
|
21
22
|
overlayProps: ChartsOverlayProps;
|
|
22
23
|
legendProps: ChartsLegendSlotExtension;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.useRadarChartProps = void 0;
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
-
const _excluded = ["series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight"];
|
|
10
|
+
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar"];
|
|
11
11
|
/**
|
|
12
12
|
* A helper function that extracts RadarChartProps from the input props
|
|
13
13
|
* and returns an object with props for the children components of RadarChart.
|
|
@@ -17,6 +17,7 @@ const _excluded = ["series", "radar", "width", "height", "margin", "colors", "sx
|
|
|
17
17
|
*/
|
|
18
18
|
const useRadarChartProps = props => {
|
|
19
19
|
const {
|
|
20
|
+
apiRef,
|
|
20
21
|
series,
|
|
21
22
|
radar,
|
|
22
23
|
width,
|
|
@@ -38,6 +39,7 @@ const useRadarChartProps = props => {
|
|
|
38
39
|
} = props,
|
|
39
40
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
40
41
|
const radarDataProviderProps = {
|
|
42
|
+
apiRef,
|
|
41
43
|
series,
|
|
42
44
|
radar,
|
|
43
45
|
highlight,
|
|
@@ -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 { ChartsSlots, ChartsSlotProps } from "../internals/material/index.js";
|
|
3
5
|
import { ScatterPlotProps, ScatterPlotSlotProps, ScatterPlotSlots } from "./ScatterPlot.js";
|
|
4
6
|
import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
5
7
|
import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
@@ -12,8 +14,8 @@ import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
|
12
14
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
13
15
|
import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/useChartVoronoi/index.js";
|
|
14
16
|
import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
|
|
15
|
-
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots {}
|
|
16
|
-
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps {}
|
|
17
|
+
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
18
|
+
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
17
19
|
export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
18
20
|
/**
|
|
19
21
|
* The series to display in the scatter chart.
|
|
@@ -39,6 +41,11 @@ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', S
|
|
|
39
41
|
* If `true`, the legend is not rendered.
|
|
40
42
|
*/
|
|
41
43
|
hideLegend?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If true, shows the default chart toolbar.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
showToolbar?: boolean;
|
|
42
49
|
/**
|
|
43
50
|
* Overridable component slots.
|
|
44
51
|
* @default {}
|
|
@@ -23,6 +23,7 @@ var _useChartContainerProps = require("../ChartContainer/useChartContainerProps"
|
|
|
23
23
|
var _ChartDataProvider = require("../ChartDataProvider");
|
|
24
24
|
var _ChartsSurface = require("../ChartsSurface");
|
|
25
25
|
var _ChartsWrapper = require("../internals/components/ChartsWrapper");
|
|
26
|
+
var _ChartsToolbar = require("../Toolbar/internals/ChartsToolbar");
|
|
26
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
28
|
/**
|
|
28
29
|
* Demos:
|
|
@@ -55,9 +56,10 @@ const ScatterChart = exports.ScatterChart = /*#__PURE__*/React.forwardRef(functi
|
|
|
55
56
|
chartsSurfaceProps
|
|
56
57
|
} = (0, _useChartContainerProps.useChartContainerProps)(chartContainerProps, ref);
|
|
57
58
|
const Tooltip = props.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
59
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbar.ChartsToolbar;
|
|
58
60
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
59
61
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
60
|
-
children: [!props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
62
|
+
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, {
|
|
61
63
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
62
64
|
"data-drawing-container": true,
|
|
63
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterPlot.ScatterPlot, (0, _extends2.default)({}, scatterPlotProps))
|
|
@@ -182,6 +184,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
182
184
|
* An array of [[ScatterSeriesType]] objects.
|
|
183
185
|
*/
|
|
184
186
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
187
|
+
/**
|
|
188
|
+
* If true, shows the default chart toolbar.
|
|
189
|
+
* @default false
|
|
190
|
+
*/
|
|
191
|
+
showToolbar: _propTypes.default.bool,
|
|
185
192
|
/**
|
|
186
193
|
* If `true`, animations are skipped.
|
|
187
194
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _ScatterChart = require("./ScatterChart.plugins");
|
|
14
|
-
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
14
|
+
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
15
15
|
/**
|
|
16
16
|
* A helper function that extracts ScatterChartProps from the input props
|
|
17
17
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -62,7 +62,9 @@ const useScatterChartProps = props => {
|
|
|
62
62
|
voronoiMaxRadius,
|
|
63
63
|
onItemClick: disableVoronoi ? undefined : onItemClick,
|
|
64
64
|
className,
|
|
65
|
-
plugins: _ScatterChart.SCATTER_CHART_PLUGINS
|
|
65
|
+
plugins: _ScatterChart.SCATTER_CHART_PLUGINS,
|
|
66
|
+
slots,
|
|
67
|
+
slotProps
|
|
66
68
|
});
|
|
67
69
|
const chartsAxisProps = {
|
|
68
70
|
slots,
|
|
@@ -13,7 +13,7 @@ import { BarPlotSlots, BarPlotSlotProps } from "../BarChart/BarPlot.js";
|
|
|
13
13
|
import { ChartMargin } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js";
|
|
14
14
|
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {}
|
|
15
15
|
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {}
|
|
16
|
-
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors'> {
|
|
16
|
+
export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps'> {
|
|
17
17
|
/**
|
|
18
18
|
* The xAxis configuration.
|
|
19
19
|
* Notice it is a single [[AxisConfig]] object, not an array of configuration.
|
package/Toolbar/Toolbar.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ChartsToolbarProps extends React.ComponentProps<'div'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
3
5
|
export declare function Toolbar({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
className,
|
|
7
|
+
...other
|
|
8
|
+
}: ChartsToolbarProps): React.JSX.Element;
|
|
9
|
+
export declare namespace Toolbar {
|
|
10
|
+
var propTypes: any;
|
|
11
|
+
}
|
package/Toolbar/Toolbar.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.Toolbar = Toolbar;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
13
|
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
15
|
+
var _chartToolbarClasses = require("./chartToolbarClasses");
|
|
10
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["className"];
|
|
11
18
|
const ToolbarRoot = (0, _styles.styled)('div', {
|
|
12
19
|
name: 'MuiChartsToolbar',
|
|
13
20
|
slot: 'Root'
|
|
@@ -25,10 +32,19 @@ const ToolbarRoot = (0, _styles.styled)('div', {
|
|
|
25
32
|
border: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
26
33
|
borderRadius: 4
|
|
27
34
|
}));
|
|
28
|
-
function Toolbar({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
function Toolbar(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
className
|
|
38
|
+
} = _ref,
|
|
39
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarRoot, (0, _extends2.default)({
|
|
41
|
+
className: (0, _clsx.default)(_chartToolbarClasses.chartsToolbarClasses.root, className)
|
|
42
|
+
}, other));
|
|
43
|
+
}
|
|
44
|
+
process.env.NODE_ENV !== "production" ? Toolbar.propTypes = {
|
|
45
|
+
// ----------------------------- Warning --------------------------------
|
|
46
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
47
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
48
|
+
// ----------------------------------------------------------------------
|
|
49
|
+
className: _propTypes.default.string
|
|
50
|
+
} : void 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsToolbarProps } from "./Toolbar.js";
|
|
3
|
+
export interface ChartsToolbarSlots {
|
|
4
|
+
/**
|
|
5
|
+
* Custom component for the toolbar.
|
|
6
|
+
* @default ChartsToolbar
|
|
7
|
+
*/
|
|
8
|
+
toolbar?: React.ElementType<ChartsToolbarProps>;
|
|
9
|
+
}
|
|
10
|
+
export interface ChartsToolbarSlotProps {
|
|
11
|
+
/**
|
|
12
|
+
* Props for the toolbar component.
|
|
13
|
+
*/
|
|
14
|
+
toolbar?: Partial<ChartsToolbarProps>;
|
|
15
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
|
+
import { ChartsSlotProps } from "../internals/material/index.js";
|
|
4
|
+
export type ToolbarButtonProps = ChartsSlotProps['baseIconButton'] & {
|
|
5
|
+
/**
|
|
6
|
+
* A function to customize the rendering of the component.
|
|
7
|
+
*/
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseIconButton']>;
|
|
9
|
+
};
|
|
4
10
|
declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
11
|
export { ToolbarButton };
|
package/Toolbar/ToolbarButton.js
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.ToolbarButton = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var
|
|
13
|
+
var _useComponentRenderer = require("@mui/x-internals/useComponentRenderer");
|
|
14
|
+
var _ChartsSlotsContext = require("../context/ChartsSlotsContext");
|
|
13
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
const _excluded = ["render"];
|
|
14
17
|
const ToolbarButton = exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function ToolbarButton(props, ref) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const {
|
|
19
|
+
render
|
|
20
|
+
} = props,
|
|
21
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
22
|
+
const {
|
|
23
|
+
slots,
|
|
24
|
+
slotProps
|
|
25
|
+
} = (0, _ChartsSlotsContext.useChartsSlots)();
|
|
26
|
+
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.baseIconButton, render, (0, _extends2.default)({}, slotProps?.baseIconButton, other, {
|
|
27
|
+
ref
|
|
28
|
+
}));
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
30
|
+
children: element
|
|
31
|
+
});
|
|
19
32
|
});
|
|
20
33
|
if (process.env.NODE_ENV !== "production") ToolbarButton.displayName = "ToolbarButton";
|
|
21
34
|
process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
|
|
@@ -24,5 +37,10 @@ process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
|
|
|
24
37
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
25
38
|
// ----------------------------------------------------------------------
|
|
26
39
|
className: _propTypes.default.string,
|
|
40
|
+
disabled: _propTypes.default.bool,
|
|
41
|
+
/**
|
|
42
|
+
* A function to customize the rendering of the component.
|
|
43
|
+
*/
|
|
44
|
+
render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
27
45
|
style: _propTypes.default.object
|
|
28
46
|
} : void 0;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.chartsToolbarClasses = void 0;
|
|
8
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
9
|
+
const chartsToolbarClasses = exports.chartsToolbarClasses = (0, _generateUtilityClasses.default)('MuiChartsToolbar', ['root']);
|
package/Toolbar/index.d.ts
CHANGED