@mui/x-charts-pro 8.5.0 → 8.5.1
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.js +1 -1
- package/CHANGELOG.md +112 -0
- package/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +41 -9
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +1 -4
- package/ChartsToolbarPro/ChartsToolbarPro.js +7 -13
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +7 -6
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +7 -6
- package/ChartsToolbarPro/index.d.ts +2 -2
- package/ChartsToolbarPro/index.js +8 -8
- package/FunnelChart/FunnelPlot.js +10 -22
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/FunnelChart/FunnelSectionLabel.js +52 -0
- package/FunnelChart/curves/bump.d.ts +10 -4
- package/FunnelChart/curves/bump.js +73 -41
- package/FunnelChart/curves/curve.types.d.ts +6 -1
- package/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/FunnelChart/curves/linear.d.ts +9 -1
- package/FunnelChart/curves/linear.js +82 -5
- package/FunnelChart/funnel.types.d.ts +1 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/FunnelChart/funnelSectionClasses.js +17 -4
- package/FunnelChart/index.d.ts +3 -1
- package/FunnelChart/index.js +18 -2
- package/Heatmap/Heatmap.d.ts +5 -0
- package/Heatmap/Heatmap.js +10 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +1 -1
- package/PieChartPro/PieChartPro.d.ts +21 -0
- package/PieChartPro/PieChartPro.js +204 -0
- package/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/PieChartPro/PieChartPro.plugins.js +9 -0
- package/PieChartPro/index.d.ts +1 -0
- package/PieChartPro/index.js +16 -0
- package/RadarChartPro/RadarChartPro.js +1 -1
- package/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/BarChartPro/BarChartPro.js +1 -1
- package/esm/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +42 -10
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +1 -4
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +8 -14
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/index.d.ts +2 -2
- package/esm/ChartsToolbarPro/index.js +2 -2
- package/esm/FunnelChart/FunnelPlot.js +10 -22
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/esm/FunnelChart/FunnelSectionLabel.js +46 -0
- package/esm/FunnelChart/curves/bump.d.ts +10 -4
- package/esm/FunnelChart/curves/bump.js +73 -41
- package/esm/FunnelChart/curves/curve.types.d.ts +6 -1
- package/esm/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/esm/FunnelChart/curves/linear.d.ts +9 -1
- package/esm/FunnelChart/curves/linear.js +82 -5
- package/esm/FunnelChart/funnel.types.d.ts +1 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/esm/FunnelChart/funnelSectionClasses.js +15 -3
- package/esm/FunnelChart/index.d.ts +3 -1
- package/esm/FunnelChart/index.js +3 -1
- package/esm/Heatmap/Heatmap.d.ts +5 -0
- package/esm/Heatmap/Heatmap.js +10 -2
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.js +1 -1
- package/esm/PieChartPro/PieChartPro.d.ts +21 -0
- package/esm/PieChartPro/PieChartPro.js +197 -0
- package/esm/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/esm/PieChartPro/PieChartPro.plugins.js +3 -0
- package/esm/PieChartPro/index.d.ts +1 -0
- package/esm/PieChartPro/index.js +1 -0
- package/esm/RadarChartPro/RadarChartPro.js +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/package.json +7 -7
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.PieChartPro = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var _internals = require("@mui/x-charts/internals");
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _styles = require("@mui/material/styles");
|
|
14
|
+
var _ChartsOverlay = require("@mui/x-charts/ChartsOverlay");
|
|
15
|
+
var React = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _ChartsTooltip = require("@mui/x-charts/ChartsTooltip");
|
|
17
|
+
var _ChartsLegend = require("@mui/x-charts/ChartsLegend");
|
|
18
|
+
var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
|
|
19
|
+
var _PieChart = require("@mui/x-charts/PieChart");
|
|
20
|
+
var _useChartContainerProProps = require("../ChartContainerPro/useChartContainerProProps");
|
|
21
|
+
var _ChartDataProviderPro = require("../ChartDataProviderPro");
|
|
22
|
+
var _ChartsToolbarPro = require("../ChartsToolbarPro");
|
|
23
|
+
var _PieChartPro2 = require("./PieChartPro.plugins");
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
const _excluded = ["series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
26
|
+
const PieChartPro = exports.PieChartPro = /*#__PURE__*/React.forwardRef(function PieChartPro(inProps, ref) {
|
|
27
|
+
const props = (0, _styles.useThemeProps)({
|
|
28
|
+
props: inProps,
|
|
29
|
+
name: 'MuiPieChartPro'
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
series,
|
|
33
|
+
width,
|
|
34
|
+
height,
|
|
35
|
+
margin: marginProps,
|
|
36
|
+
colors,
|
|
37
|
+
sx,
|
|
38
|
+
skipAnimation,
|
|
39
|
+
hideLegend,
|
|
40
|
+
children,
|
|
41
|
+
slots,
|
|
42
|
+
slotProps,
|
|
43
|
+
onItemClick,
|
|
44
|
+
loading,
|
|
45
|
+
highlightedItem,
|
|
46
|
+
onHighlightChange,
|
|
47
|
+
className,
|
|
48
|
+
showToolbar
|
|
49
|
+
} = props,
|
|
50
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
51
|
+
const margin = (0, _internals.defaultizeMargin)(marginProps, _internals.DEFAULT_PIE_CHART_MARGIN);
|
|
52
|
+
const {
|
|
53
|
+
chartDataProviderProProps,
|
|
54
|
+
chartsSurfaceProps
|
|
55
|
+
} = (0, _useChartContainerProProps.useChartContainerProProps)((0, _extends2.default)({}, other, {
|
|
56
|
+
series: series.map(s => (0, _extends2.default)({
|
|
57
|
+
type: 'pie'
|
|
58
|
+
}, s)),
|
|
59
|
+
width,
|
|
60
|
+
height,
|
|
61
|
+
margin,
|
|
62
|
+
colors,
|
|
63
|
+
highlightedItem,
|
|
64
|
+
onHighlightChange,
|
|
65
|
+
className,
|
|
66
|
+
skipAnimation,
|
|
67
|
+
plugins: _PieChartPro2.PIE_CHART_PRO_PLUGINS
|
|
68
|
+
}), ref);
|
|
69
|
+
const Tooltip = slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
70
|
+
const Toolbar = props.slots?.toolbar ?? _ChartsToolbarPro.ChartsToolbarPro;
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
72
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, {
|
|
73
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
74
|
+
legendDirection: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
75
|
+
sx: sx,
|
|
76
|
+
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
77
|
+
direction: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
78
|
+
slots: slots,
|
|
79
|
+
slotProps: slotProps
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_PieChart.PiePlot, {
|
|
82
|
+
slots: slots,
|
|
83
|
+
slotProps: slotProps,
|
|
84
|
+
onItemClick: onItemClick
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, {
|
|
86
|
+
loading: loading,
|
|
87
|
+
slots: slots,
|
|
88
|
+
slotProps: slotProps
|
|
89
|
+
}), children]
|
|
90
|
+
})), !loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({
|
|
91
|
+
trigger: "item"
|
|
92
|
+
}, slotProps?.tooltip))]
|
|
93
|
+
})
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
if (process.env.NODE_ENV !== "production") PieChartPro.displayName = "PieChartPro";
|
|
97
|
+
process.env.NODE_ENV !== "production" ? PieChartPro.propTypes = {
|
|
98
|
+
// ----------------------------- Warning --------------------------------
|
|
99
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
100
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
101
|
+
// ----------------------------------------------------------------------
|
|
102
|
+
apiRef: _propTypes.default.shape({
|
|
103
|
+
current: _propTypes.default.shape({
|
|
104
|
+
exportAsImage: _propTypes.default.func.isRequired,
|
|
105
|
+
exportAsPrint: _propTypes.default.func.isRequired
|
|
106
|
+
})
|
|
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
|
+
/**
|
|
116
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
117
|
+
*/
|
|
118
|
+
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
119
|
+
desc: _propTypes.default.string,
|
|
120
|
+
/**
|
|
121
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
122
|
+
*/
|
|
123
|
+
height: _propTypes.default.number,
|
|
124
|
+
/**
|
|
125
|
+
* If `true`, the legend is not rendered.
|
|
126
|
+
*/
|
|
127
|
+
hideLegend: _propTypes.default.bool,
|
|
128
|
+
/**
|
|
129
|
+
* The highlighted item.
|
|
130
|
+
* Used when the highlight is controlled.
|
|
131
|
+
*/
|
|
132
|
+
highlightedItem: _propTypes.default.shape({
|
|
133
|
+
dataIndex: _propTypes.default.number,
|
|
134
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
135
|
+
}),
|
|
136
|
+
/**
|
|
137
|
+
* This prop is used to help implement the accessibility logic.
|
|
138
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
139
|
+
*/
|
|
140
|
+
id: _propTypes.default.string,
|
|
141
|
+
/**
|
|
142
|
+
* If `true`, a loading overlay is displayed.
|
|
143
|
+
* @default false
|
|
144
|
+
*/
|
|
145
|
+
loading: _propTypes.default.bool,
|
|
146
|
+
/**
|
|
147
|
+
* Localized text for chart components.
|
|
148
|
+
*/
|
|
149
|
+
localeText: _propTypes.default.object,
|
|
150
|
+
/**
|
|
151
|
+
* The margin between the SVG and the drawing area.
|
|
152
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
153
|
+
*
|
|
154
|
+
* Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
155
|
+
*/
|
|
156
|
+
margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
157
|
+
bottom: _propTypes.default.number,
|
|
158
|
+
left: _propTypes.default.number,
|
|
159
|
+
right: _propTypes.default.number,
|
|
160
|
+
top: _propTypes.default.number
|
|
161
|
+
})]),
|
|
162
|
+
/**
|
|
163
|
+
* The callback fired when the highlighted item changes.
|
|
164
|
+
*
|
|
165
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
166
|
+
*/
|
|
167
|
+
onHighlightChange: _propTypes.default.func,
|
|
168
|
+
/**
|
|
169
|
+
* Callback fired when a pie arc is clicked.
|
|
170
|
+
*/
|
|
171
|
+
onItemClick: _propTypes.default.func,
|
|
172
|
+
/**
|
|
173
|
+
* The series to display in the pie chart.
|
|
174
|
+
* An array of [[PieSeriesType]] objects.
|
|
175
|
+
*/
|
|
176
|
+
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
177
|
+
/**
|
|
178
|
+
* If true, shows the default chart toolbar.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
showToolbar: _propTypes.default.bool,
|
|
182
|
+
/**
|
|
183
|
+
* If `true`, animations are skipped.
|
|
184
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
185
|
+
*/
|
|
186
|
+
skipAnimation: _propTypes.default.bool,
|
|
187
|
+
/**
|
|
188
|
+
* The props used for each component slot.
|
|
189
|
+
* @default {}
|
|
190
|
+
*/
|
|
191
|
+
slotProps: _propTypes.default.object,
|
|
192
|
+
/**
|
|
193
|
+
* Overridable component slots.
|
|
194
|
+
* @default {}
|
|
195
|
+
*/
|
|
196
|
+
slots: _propTypes.default.object,
|
|
197
|
+
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]),
|
|
198
|
+
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
199
|
+
title: _propTypes.default.string,
|
|
200
|
+
/**
|
|
201
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
202
|
+
*/
|
|
203
|
+
width: _propTypes.default.number
|
|
204
|
+
} : void 0;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export type PieChartProPluginSignatures = [UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
|
+
export declare const PIE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<PieChartProPluginSignatures>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PIE_CHART_PRO_PLUGINS = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
|
+
const PIE_CHART_PRO_PLUGINS = exports.PIE_CHART_PRO_PLUGINS = [..._internals.PIE_CHART_PLUGINS, _useChartProExport.useChartProExport];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./PieChartPro.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _PieChartPro = require("./PieChartPro");
|
|
7
|
+
Object.keys(_PieChartPro).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _PieChartPro[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _PieChartPro[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -51,7 +51,7 @@ const RadarChartPro = exports.RadarChartPro = /*#__PURE__*/React.forwardRef(func
|
|
|
51
51
|
});
|
|
52
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarDataProvider, (0, _extends2.default)({}, radarDataProviderProProps, {
|
|
53
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
54
|
-
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, {
|
|
54
|
+
children: [props.showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
55
55
|
ref: ref,
|
|
56
56
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarSeriesMarks, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
|
|
57
57
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
@@ -76,7 +76,7 @@ const ScatterChartPro = exports.ScatterChartPro = /*#__PURE__*/React.forwardRef(
|
|
|
76
76
|
const Toolbar = props.slots?.toolbar ?? _ChartsToolbarPro.ChartsToolbarPro;
|
|
77
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
78
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
79
|
-
children: [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, {
|
|
79
|
+
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
80
80
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartZoomSlider.ChartZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
81
81
|
"data-drawing-container": true,
|
|
82
82
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterChart.ScatterPlot, (0, _extends2.default)({}, scatterPlotProps))
|
|
@@ -73,7 +73,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
73
73
|
const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
|
|
74
74
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
75
75
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
76
|
-
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
76
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
77
77
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
78
78
|
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
79
79
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
@@ -6,6 +6,7 @@ import { BarChartProPluginsSignatures } from "../BarChartPro/BarChartPro.plugins
|
|
|
6
6
|
import { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
7
7
|
import { FunnelChartPluginsSignatures } from "../FunnelChart/FunnelChart.plugins.js";
|
|
8
8
|
import { RadarChartProPluginsSignatures } from "../RadarChartPro/RadarChartPro.plugins.js";
|
|
9
|
+
import { PieChartProPluginSignatures } from "../PieChartPro/PieChartPro.plugins.js";
|
|
9
10
|
type PluginsPerSeriesType = {
|
|
10
11
|
heatmap: HeatmapPluginsSignatures;
|
|
11
12
|
line: LineChartProPluginsSignatures;
|
|
@@ -13,6 +14,7 @@ type PluginsPerSeriesType = {
|
|
|
13
14
|
bar: BarChartProPluginsSignatures;
|
|
14
15
|
funnel: FunnelChartPluginsSignatures;
|
|
15
16
|
radar: RadarChartProPluginsSignatures;
|
|
17
|
+
pie: PieChartProPluginSignatures;
|
|
16
18
|
composition: DefaultPluginSignatures;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
@@ -11,7 +11,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
11
11
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
12
12
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const releaseInfo = "
|
|
14
|
+
const releaseInfo = "MTc0OTA3MDgwMDAwMA==";
|
|
15
15
|
const packageIdentifier = 'x-charts-pro';
|
|
16
16
|
/**
|
|
17
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -6,7 +6,6 @@ export interface ChartAxisZoomSliderActiveTrackProps {
|
|
|
6
6
|
axisPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
7
7
|
zoomData: ZoomData;
|
|
8
8
|
reverse?: boolean;
|
|
9
|
-
valueFormatter?: (value: number) => string;
|
|
10
9
|
showTooltip: boolean;
|
|
11
10
|
onPointerEnter?: () => void;
|
|
12
11
|
onPointerLeave?: () => void;
|
|
@@ -17,7 +16,6 @@ export declare function ChartAxisZoomSliderActiveTrack({
|
|
|
17
16
|
axisPosition,
|
|
18
17
|
zoomData,
|
|
19
18
|
reverse,
|
|
20
|
-
valueFormatter,
|
|
21
19
|
showTooltip,
|
|
22
20
|
onPointerEnter,
|
|
23
21
|
onPointerLeave
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import { getSVGPoint, selectorChartAxisZoomOptionsLookup, selectorChartDrawingArea, useChartContext, useDrawingArea, useStore } from '@mui/x-charts/internals';
|
|
3
|
+
import { getSVGPoint, invertScale, selectorChartAxis, selectorChartAxisZoomOptionsLookup, selectorChartDrawingArea, useChartContext, useDrawingArea, useSelector, useStore } from '@mui/x-charts/internals';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { selectorChartAxisZoomData } from "../../internals/plugins/useChartProZoom/index.js";
|
|
@@ -17,17 +17,12 @@ const ZoomSliderActiveTrackRect = styled('rect')(({
|
|
|
17
17
|
cursor: 'grab'
|
|
18
18
|
}
|
|
19
19
|
}));
|
|
20
|
-
const formatter = Intl.NumberFormat(undefined, {
|
|
21
|
-
maximumFractionDigits: 0
|
|
22
|
-
});
|
|
23
|
-
const zoomValueFormatter = value => formatter.format(value);
|
|
24
20
|
export function ChartAxisZoomSliderActiveTrack({
|
|
25
21
|
axisId,
|
|
26
22
|
axisDirection,
|
|
27
23
|
axisPosition,
|
|
28
24
|
zoomData,
|
|
29
25
|
reverse,
|
|
30
|
-
valueFormatter = zoomValueFormatter,
|
|
31
26
|
showTooltip,
|
|
32
27
|
onPointerEnter,
|
|
33
28
|
onPointerLeave
|
|
@@ -37,10 +32,15 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
37
32
|
svgRef
|
|
38
33
|
} = useChartContext();
|
|
39
34
|
const store = useStore();
|
|
35
|
+
const axis = useSelector(store, selectorChartAxis, axisId);
|
|
40
36
|
const drawingArea = useDrawingArea();
|
|
41
37
|
const activePreviewRectRef = React.useRef(null);
|
|
42
38
|
const [startThumbEl, setStartThumbEl] = React.useState(null);
|
|
43
39
|
const [endThumbEl, setEndThumbEl] = React.useState(null);
|
|
40
|
+
const {
|
|
41
|
+
tooltipStart,
|
|
42
|
+
tooltipEnd
|
|
43
|
+
} = getZoomSliderTooltipsText(axis, drawingArea);
|
|
44
44
|
const previewThumbWidth = axisDirection === 'x' ? ZOOM_SLIDER_THUMB_WIDTH : ZOOM_SLIDER_THUMB_HEIGHT;
|
|
45
45
|
const previewThumbHeight = axisDirection === 'x' ? ZOOM_SLIDER_THUMB_HEIGHT : ZOOM_SLIDER_THUMB_WIDTH;
|
|
46
46
|
React.useEffect(() => {
|
|
@@ -230,14 +230,46 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
230
230
|
placement: "end"
|
|
231
231
|
}), /*#__PURE__*/_jsx(ChartsTooltipZoomSliderValue, {
|
|
232
232
|
anchorEl: startThumbEl,
|
|
233
|
-
open: showTooltip,
|
|
233
|
+
open: showTooltip && tooltipStart !== '',
|
|
234
234
|
placement: axisPosition,
|
|
235
|
-
children:
|
|
235
|
+
children: tooltipStart
|
|
236
236
|
}), /*#__PURE__*/_jsx(ChartsTooltipZoomSliderValue, {
|
|
237
237
|
anchorEl: endThumbEl,
|
|
238
|
-
open: showTooltip,
|
|
238
|
+
open: showTooltip && tooltipEnd !== '',
|
|
239
239
|
placement: axisPosition,
|
|
240
|
-
children:
|
|
240
|
+
children: tooltipEnd
|
|
241
241
|
})]
|
|
242
242
|
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Returns the text for the tooltips on the thumbs of the zoom slider.
|
|
247
|
+
*/
|
|
248
|
+
function getZoomSliderTooltipsText(axis, drawingArea) {
|
|
249
|
+
const formatValue = value => {
|
|
250
|
+
if (axis.valueFormatter) {
|
|
251
|
+
return axis.valueFormatter(value, {
|
|
252
|
+
location: 'zoom-slider-tooltip'
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return `${value}`;
|
|
256
|
+
};
|
|
257
|
+
const axisDirection = axis.position === 'top' || axis.position === 'bottom' ? 'x' : 'y';
|
|
258
|
+
let start = axisDirection === 'x' ? drawingArea.left : drawingArea.top;
|
|
259
|
+
const size = axisDirection === 'x' ? drawingArea.width : drawingArea.height;
|
|
260
|
+
let end = start + size;
|
|
261
|
+
if (axisDirection === 'y') {
|
|
262
|
+
[start, end] = [end, start]; // Invert for y-axis
|
|
263
|
+
}
|
|
264
|
+
if (axis.reverse) {
|
|
265
|
+
[start, end] = [end, start]; // Reverse the start and end if the axis is reversed
|
|
266
|
+
}
|
|
267
|
+
const startValue = invertScale(axis.scale, axis.data ?? [], start) ?? axis.data?.at(0);
|
|
268
|
+
const endValue = invertScale(axis.scale, axis.data ?? [], end) ?? axis.data?.at(-1);
|
|
269
|
+
const tooltipStart = formatValue(startValue);
|
|
270
|
+
const tooltipEnd = formatValue(endValue);
|
|
271
|
+
return {
|
|
272
|
+
tooltipStart,
|
|
273
|
+
tooltipEnd
|
|
274
|
+
};
|
|
243
275
|
}
|
|
@@ -66,14 +66,12 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
66
66
|
|
|
67
67
|
// Ensure the zoomFromPointerDown is within the min and max range
|
|
68
68
|
zoomFromPointerDown = Math.max(Math.min(zoomFromPointerDown, maxEnd), minStart);
|
|
69
|
-
let pointerMoved = false;
|
|
70
69
|
const onPointerMove = rafThrottle(function onPointerMove(pointerMoveEvent) {
|
|
71
70
|
const pointerMovePoint = getSVGPoint(element, pointerMoveEvent);
|
|
72
71
|
const zoomFromPointerMove = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerMovePoint);
|
|
73
72
|
if (zoomFromPointerMove === null) {
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
76
|
-
pointerMoved = true;
|
|
77
75
|
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
78
76
|
instance.setAxisZoomData(axisId, prevZoomData => {
|
|
79
77
|
if (zoomFromPointerMove > zoomFromPointerDown) {
|
|
@@ -114,22 +112,6 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
114
112
|
document.removeEventListener('pointerup', onPointerUp);
|
|
115
113
|
setIsSelecting(false);
|
|
116
114
|
onSelectEnd?.();
|
|
117
|
-
if (pointerMoved) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// If the pointer didn't move, we still need to respect the zoom constraints (minSpan, etc.)
|
|
122
|
-
// In that case, we assume the start to be the pointerZoom and calculate the end.
|
|
123
|
-
const pointerUpPoint = getSVGPoint(element, pointerUpEvent);
|
|
124
|
-
const zoomFromPointerUp = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerUpPoint);
|
|
125
|
-
if (zoomFromPointerUp === null) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
129
|
-
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
130
|
-
start: zoomFromPointerUp,
|
|
131
|
-
end: calculateZoomEnd(zoomFromPointerUp, prev, zoomOptions)
|
|
132
|
-
}));
|
|
133
115
|
};
|
|
134
116
|
event.preventDefault();
|
|
135
117
|
event.stopPropagation();
|
|
@@ -138,10 +120,6 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
138
120
|
rect.addEventListener('pointermove', onPointerMove);
|
|
139
121
|
onSelectStart?.();
|
|
140
122
|
setIsSelecting(true);
|
|
141
|
-
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
142
|
-
start: zoomFromPointerDown,
|
|
143
|
-
end: zoomFromPointerDown
|
|
144
|
-
}));
|
|
145
123
|
};
|
|
146
124
|
return /*#__PURE__*/_jsx(ZoomSliderTrack, _extends({
|
|
147
125
|
ref: ref,
|
|
@@ -3,7 +3,4 @@ import * as React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* The chart toolbar component for the pro package.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ChartsToolbarPro(props:
|
|
7
|
-
export declare namespace ChartsToolbarPro {
|
|
8
|
-
var propTypes: any;
|
|
9
|
-
}
|
|
6
|
+
export declare function ChartsToolbarPro(props: ChartsToolbarProps): React.JSX.Element | null;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { Toolbar } from '@mui/x-charts/Toolbar';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import { Toolbar, ToolbarButton } from '@mui/x-charts/Toolbar';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
6
5
|
import { useChartsLocalization } from '@mui/x-charts/hooks';
|
|
7
6
|
import { selectorChartZoomIsEnabled } from "../internals/plugins/useChartProZoom/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ChartsToolbarZoomInTrigger } from "./ChartsToolbarZoomInTrigger.js";
|
|
8
|
+
import { ChartsToolbarZoomOutTrigger } from "./ChartsToolbarZoomOutTrigger.js";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
/**
|
|
12
11
|
* The chart toolbar component for the pro package.
|
|
@@ -30,13 +29,15 @@ export function ChartsToolbarPro(props) {
|
|
|
30
29
|
const ZoomInIcon = slots.zoomInIcon;
|
|
31
30
|
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
32
31
|
title: localeText.zoomIn,
|
|
33
|
-
children: /*#__PURE__*/_jsx(
|
|
32
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomInTrigger, {
|
|
33
|
+
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
34
34
|
children: /*#__PURE__*/_jsx(ZoomInIcon, _extends({}, slotProps.zoomInIcon))
|
|
35
35
|
})
|
|
36
36
|
}), "zoom-in"));
|
|
37
37
|
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
38
38
|
title: localeText.zoomOut,
|
|
39
|
-
children: /*#__PURE__*/_jsx(
|
|
39
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomOutTrigger, {
|
|
40
|
+
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
40
41
|
children: /*#__PURE__*/_jsx(ZoomOutIcon, _extends({}, slotProps.zoomOutIcon))
|
|
41
42
|
})
|
|
42
43
|
}), "zoom-out"));
|
|
@@ -47,11 +48,4 @@ export function ChartsToolbarPro(props) {
|
|
|
47
48
|
return /*#__PURE__*/_jsx(Toolbar, _extends({}, props, {
|
|
48
49
|
children: children
|
|
49
50
|
}));
|
|
50
|
-
}
|
|
51
|
-
process.env.NODE_ENV !== "production" ? ChartsToolbarPro.propTypes = {
|
|
52
|
-
// ----------------------------- Warning --------------------------------
|
|
53
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
55
|
-
// ----------------------------------------------------------------------
|
|
56
|
-
className: PropTypes.string
|
|
57
|
-
} : void 0;
|
|
51
|
+
}
|
package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
-
interface
|
|
4
|
+
interface ChartsToolbarZoomInTriggerProps {
|
|
5
5
|
/**
|
|
6
6
|
* A function to customize the rendering of the component.
|
|
7
7
|
*/
|
|
8
|
-
render?: RenderProp<ChartsSlotProps['
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseButton']>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A button that zooms the chart in.
|
|
12
|
+
* It renders the `baseButton` slot.
|
|
12
13
|
*/
|
|
13
|
-
declare const
|
|
14
|
+
declare const ChartsToolbarZoomInTrigger: React.ForwardRefExoticComponent<ChartsToolbarZoomInTriggerProps & {
|
|
14
15
|
children?: React.ReactNode | undefined;
|
|
15
16
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
export {
|
|
17
|
+
export { ChartsToolbarZoomInTrigger };
|
|
@@ -5,14 +5,15 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["render"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useChartContext,
|
|
8
|
+
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
9
9
|
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
10
|
import { selectorChartCanZoomIn } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* A button that zooms the chart in.
|
|
14
|
+
* It renders the `baseButton` slot.
|
|
14
15
|
*/
|
|
15
|
-
const
|
|
16
|
+
const ChartsToolbarZoomInTrigger = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomInTrigger(_ref, ref) {
|
|
16
17
|
let {
|
|
17
18
|
render
|
|
18
19
|
} = _ref,
|
|
@@ -26,7 +27,7 @@ const ChartsToolbarZoomInButton = /*#__PURE__*/React.forwardRef(function ChartsT
|
|
|
26
27
|
store
|
|
27
28
|
} = useChartContext();
|
|
28
29
|
const disabled = useSelector(store, selectorChartCanZoomIn);
|
|
29
|
-
const element = useComponentRenderer(slots.
|
|
30
|
+
const element = useComponentRenderer(slots.baseButton, render, _extends({}, slotProps.baseButton, {
|
|
30
31
|
onClick: () => instance.zoomIn(),
|
|
31
32
|
disabled
|
|
32
33
|
}, other, {
|
|
@@ -36,8 +37,8 @@ const ChartsToolbarZoomInButton = /*#__PURE__*/React.forwardRef(function ChartsT
|
|
|
36
37
|
children: element
|
|
37
38
|
});
|
|
38
39
|
});
|
|
39
|
-
if (process.env.NODE_ENV !== "production")
|
|
40
|
-
process.env.NODE_ENV !== "production" ?
|
|
40
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomInTrigger.displayName = "ChartsToolbarZoomInTrigger";
|
|
41
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInTrigger.propTypes = {
|
|
41
42
|
// ----------------------------- Warning --------------------------------
|
|
42
43
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
43
44
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -47,4 +48,4 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInButton.propTypes = {
|
|
|
47
48
|
*/
|
|
48
49
|
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
49
50
|
} : void 0;
|
|
50
|
-
export {
|
|
51
|
+
export { ChartsToolbarZoomInTrigger };
|
package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
-
interface
|
|
4
|
+
interface ChartsToolbarZoomOutTriggerProps {
|
|
5
5
|
/**
|
|
6
6
|
* A function to customize the rendering of the component.
|
|
7
7
|
*/
|
|
8
|
-
render?: RenderProp<ChartsSlotProps['
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseButton']>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A button that zooms the chart out.
|
|
12
|
+
* It renders the `baseButton` slot.
|
|
12
13
|
*/
|
|
13
|
-
declare const
|
|
14
|
+
declare const ChartsToolbarZoomOutTrigger: React.ForwardRefExoticComponent<ChartsToolbarZoomOutTriggerProps & {
|
|
14
15
|
children?: React.ReactNode | undefined;
|
|
15
16
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
export {
|
|
17
|
+
export { ChartsToolbarZoomOutTrigger };
|