@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
|
@@ -80,7 +80,7 @@ const BarChartPro = exports.BarChartPro = /*#__PURE__*/React.forwardRef(function
|
|
|
80
80
|
const Toolbar = props.slots?.toolbar ?? _ChartsToolbarPro.ChartsToolbarPro;
|
|
81
81
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
82
82
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
83
|
-
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, {
|
|
83
|
+
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, {
|
|
84
84
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", (0, _extends2.default)({}, clipPathGroupProps, {
|
|
85
85
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.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))]
|
|
86
86
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartZoomSlider.ChartZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, (0, _extends2.default)({}, clipPathProps)), children]
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,118 @@
|
|
|
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.1
|
|
9
|
+
|
|
10
|
+
<!-- generated comparing v8.5.0..master -->
|
|
11
|
+
|
|
12
|
+
_Jun 5, 2025_
|
|
13
|
+
|
|
14
|
+
We'd like to extend a big thank you to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
15
|
+
|
|
16
|
+
- 📊 Allow exporting pie charts
|
|
17
|
+
- 📚 Documentation improvements
|
|
18
|
+
- 🌎 Improve Portuguese (ptPT) translations on the Data Grid
|
|
19
|
+
- 🌎 Improve Portuguese (ptPT, ptBR) translations on Charts
|
|
20
|
+
- 🌎 Improve Arabic (ar-SD) locale
|
|
21
|
+
- 🐞 Bugfixes
|
|
22
|
+
|
|
23
|
+
Special thanks go out to the community members for their valuable contributions: @moosekebab, @TiagoPortfolio.
|
|
24
|
+
The following are all team members who have contributed to this release:
|
|
25
|
+
@alexfauquette, @bernardobelchior, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen, @arminmeh.
|
|
26
|
+
|
|
27
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid@8.5.1`
|
|
32
|
+
|
|
33
|
+
- [DataGrid] Fix `registerPipeProcessor()` for Node v20 (#18241) @arminmeh
|
|
34
|
+
- [DataGrid] Fix background color in column header filler cells (#18188) @KenanYusuf
|
|
35
|
+
- [DataGrid] Keep pipe pre-processors execution order when callback reference changes (#17558) @arminmeh
|
|
36
|
+
- [DataGrid] Use `useComponentRenderer` from x-internals (#18203) @bernardobelchior
|
|
37
|
+
- [l10n] Improve Arabic (ar-SD) locale (#17959) @moosekebab
|
|
38
|
+
- [l10n] Improve Portuguese from Portugal (pt-PT) locale (#18064) @TiagoPortfolio
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-data-grid-pro@8.5.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-data-grid@8.5.1`, plus:
|
|
43
|
+
|
|
44
|
+
- [DataGridPro] Skip rendering detail panels of the rows turned into skeleton rows with lazy loading (#17958) @arminmeh
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-data-grid-premium@8.5.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
47
|
+
|
|
48
|
+
Same changes as in `@mui/x-data-grid-pro@8.5.1`.
|
|
49
|
+
|
|
50
|
+
### Date and Time Pickers
|
|
51
|
+
|
|
52
|
+
#### `@mui/x-date-pickers@8.5.1`
|
|
53
|
+
|
|
54
|
+
- [pickers] Fix `transformOrigin` resolving based on popper `placement` (#18206) @LukasTy
|
|
55
|
+
|
|
56
|
+
#### `@mui/x-date-pickers-pro@8.5.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
57
|
+
|
|
58
|
+
Same changes as in `@mui/x-date-pickers@8.5.1`.
|
|
59
|
+
|
|
60
|
+
### Charts
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-charts@8.5.1`
|
|
63
|
+
|
|
64
|
+
- [charts] Allow skipping tooltip render (#18050) @alexfauquette
|
|
65
|
+
- [charts] Fix act warnings in toolbar tests (#18212) @JCQuintas
|
|
66
|
+
- [charts] Fix prop typo in `extendVertically` (#18211) @JCQuintas
|
|
67
|
+
- [charts] Fix responsive height for ChartsWrapper (#18183) @alexfauquette
|
|
68
|
+
- [charts] Improve charts toolbar accessibility (#18056) @bernardobelchior
|
|
69
|
+
- [charts] Let line series propagate null from the dataset (#18223) @alexfauquette
|
|
70
|
+
- [l10n] Add Portuguese locales for charts (pt-PT, pt-BR) (#18069) @bernardobelchior
|
|
71
|
+
|
|
72
|
+
#### `@mui/x-charts-pro@8.5.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
73
|
+
|
|
74
|
+
Same changes as in `@mui/x-charts@8.5.1`, plus:
|
|
75
|
+
|
|
76
|
+
- [charts-pro] Add `linear-sharp` curve as alternative to square edge (#17966) @JCQuintas
|
|
77
|
+
- [charts-pro] Add correct classes to `FunnelSectionLabel` (#18061) @JCQuintas
|
|
78
|
+
- [charts-pro] Allow exporting a pie chart (#18063) @bernardobelchior
|
|
79
|
+
- [charts-pro] Fix initial render for zoom slider selection (#18208) @bernardobelchior
|
|
80
|
+
- [charts-pro] Fix props being passed to DOM in FunnelChart (#18192) @JCQuintas
|
|
81
|
+
- [charts-pro] Show axis value in zoom slider tooltip (#18054) @bernardobelchior
|
|
82
|
+
- [charts-pro] Render the toolbar in the heatmap chart (#18247) @bernardobelchior
|
|
83
|
+
|
|
84
|
+
### Tree View
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-tree-view@8.5.1`
|
|
87
|
+
|
|
88
|
+
Internal changes.
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-tree-view-pro@8.5.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
91
|
+
|
|
92
|
+
Same changes as in `@mui/x-tree-view@8.5.1`.
|
|
93
|
+
|
|
94
|
+
### Docs
|
|
95
|
+
|
|
96
|
+
- [docs] Update `valueFormatter` signature in migration guide (#18226) @michelengelen
|
|
97
|
+
|
|
98
|
+
### Core
|
|
99
|
+
|
|
100
|
+
- chore(deps): bump @next/eslint-plugin-next to 15.3.3 (#18155) @renovate[bot]
|
|
101
|
+
- chore(deps): bump @types/lodash to ^4.17.17 (#17990) @renovate[bot]
|
|
102
|
+
- chore(deps): bump babel (#18157) @renovate[bot]
|
|
103
|
+
- chore(deps): bump eslint to ^9.28.0 (#17352) @renovate[bot]
|
|
104
|
+
- chore(deps): bump material ui (#17802) @renovate[bot]
|
|
105
|
+
- chore(deps): bump next to ^15.3.3 (#18159) @renovate[bot]
|
|
106
|
+
- chore(deps): bump ossf/scorecard-action action to v2.4.2 (#18160) @renovate[bot]
|
|
107
|
+
- chore(deps): bump react-router to ^7.6.1 (#18162) @renovate[bot]
|
|
108
|
+
- chore(deps): bump yargs to ^18.0.0 (#18169) @renovate[bot]
|
|
109
|
+
- [code-infra] Different approach to console testing for `processRowUpdate` (#18213) @JCQuintas
|
|
110
|
+
- [code-infra] Fix act warnings in DataGrid/toolbar (#18207) @JCQuintas
|
|
111
|
+
- [code-infra] Remove `istanbul` references (#18194) @JCQuintas
|
|
112
|
+
- [code-infra] Remove codesandbox:ci (#18179) @JCQuintas
|
|
113
|
+
- [code-infra] Replace `mocha` with `vitest` on e2e and regression tests (#18071) @JCQuintas
|
|
114
|
+
- [code-infra] Upgrade @mui/internal-test-utils (#18191) @JCQuintas
|
|
115
|
+
- [code-infra] Use vitest for `no-direct-state-access` tests (#18209) @JCQuintas
|
|
116
|
+
- [infra] Improve test setup (#18228) @LukasTy
|
|
117
|
+
- [infra] Update bug and feature request templates to standardize label types (#18198) @michelengelen
|
|
118
|
+
- [infra] Use `playwright` docker image (#18186) @LukasTy
|
|
119
|
+
|
|
8
120
|
## 8.5.0
|
|
9
121
|
|
|
10
122
|
_May 29, 2025_
|
|
@@ -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
|
/**
|
|
@@ -18,7 +18,7 @@ var _material = require("../internals/material");
|
|
|
18
18
|
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
19
19
|
var _useChartDataProviderProProps = require("./useChartDataProviderProProps");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const releaseInfo = "
|
|
21
|
+
const releaseInfo = "MTc0OTA3MDgwMDAwMA==";
|
|
22
22
|
const packageIdentifier = 'x-charts-pro';
|
|
23
23
|
/**
|
|
24
24
|
* 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
|
|
@@ -25,17 +25,12 @@ const ZoomSliderActiveTrackRect = (0, _styles.styled)('rect')(({
|
|
|
25
25
|
cursor: 'grab'
|
|
26
26
|
}
|
|
27
27
|
}));
|
|
28
|
-
const formatter = Intl.NumberFormat(undefined, {
|
|
29
|
-
maximumFractionDigits: 0
|
|
30
|
-
});
|
|
31
|
-
const zoomValueFormatter = value => formatter.format(value);
|
|
32
28
|
function ChartAxisZoomSliderActiveTrack({
|
|
33
29
|
axisId,
|
|
34
30
|
axisDirection,
|
|
35
31
|
axisPosition,
|
|
36
32
|
zoomData,
|
|
37
33
|
reverse,
|
|
38
|
-
valueFormatter = zoomValueFormatter,
|
|
39
34
|
showTooltip,
|
|
40
35
|
onPointerEnter,
|
|
41
36
|
onPointerLeave
|
|
@@ -45,10 +40,15 @@ function ChartAxisZoomSliderActiveTrack({
|
|
|
45
40
|
svgRef
|
|
46
41
|
} = (0, _internals.useChartContext)();
|
|
47
42
|
const store = (0, _internals.useStore)();
|
|
43
|
+
const axis = (0, _internals.useSelector)(store, _internals.selectorChartAxis, axisId);
|
|
48
44
|
const drawingArea = (0, _internals.useDrawingArea)();
|
|
49
45
|
const activePreviewRectRef = React.useRef(null);
|
|
50
46
|
const [startThumbEl, setStartThumbEl] = React.useState(null);
|
|
51
47
|
const [endThumbEl, setEndThumbEl] = React.useState(null);
|
|
48
|
+
const {
|
|
49
|
+
tooltipStart,
|
|
50
|
+
tooltipEnd
|
|
51
|
+
} = getZoomSliderTooltipsText(axis, drawingArea);
|
|
52
52
|
const previewThumbWidth = axisDirection === 'x' ? _constants.ZOOM_SLIDER_THUMB_WIDTH : _constants.ZOOM_SLIDER_THUMB_HEIGHT;
|
|
53
53
|
const previewThumbHeight = axisDirection === 'x' ? _constants.ZOOM_SLIDER_THUMB_HEIGHT : _constants.ZOOM_SLIDER_THUMB_WIDTH;
|
|
54
54
|
React.useEffect(() => {
|
|
@@ -238,14 +238,46 @@ function ChartAxisZoomSliderActiveTrack({
|
|
|
238
238
|
placement: "end"
|
|
239
239
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipZoomSliderValue.ChartsTooltipZoomSliderValue, {
|
|
240
240
|
anchorEl: startThumbEl,
|
|
241
|
-
open: showTooltip,
|
|
241
|
+
open: showTooltip && tooltipStart !== '',
|
|
242
242
|
placement: axisPosition,
|
|
243
|
-
children:
|
|
243
|
+
children: tooltipStart
|
|
244
244
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipZoomSliderValue.ChartsTooltipZoomSliderValue, {
|
|
245
245
|
anchorEl: endThumbEl,
|
|
246
|
-
open: showTooltip,
|
|
246
|
+
open: showTooltip && tooltipEnd !== '',
|
|
247
247
|
placement: axisPosition,
|
|
248
|
-
children:
|
|
248
|
+
children: tooltipEnd
|
|
249
249
|
})]
|
|
250
250
|
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Returns the text for the tooltips on the thumbs of the zoom slider.
|
|
255
|
+
*/
|
|
256
|
+
function getZoomSliderTooltipsText(axis, drawingArea) {
|
|
257
|
+
const formatValue = value => {
|
|
258
|
+
if (axis.valueFormatter) {
|
|
259
|
+
return axis.valueFormatter(value, {
|
|
260
|
+
location: 'zoom-slider-tooltip'
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
return `${value}`;
|
|
264
|
+
};
|
|
265
|
+
const axisDirection = axis.position === 'top' || axis.position === 'bottom' ? 'x' : 'y';
|
|
266
|
+
let start = axisDirection === 'x' ? drawingArea.left : drawingArea.top;
|
|
267
|
+
const size = axisDirection === 'x' ? drawingArea.width : drawingArea.height;
|
|
268
|
+
let end = start + size;
|
|
269
|
+
if (axisDirection === 'y') {
|
|
270
|
+
[start, end] = [end, start]; // Invert for y-axis
|
|
271
|
+
}
|
|
272
|
+
if (axis.reverse) {
|
|
273
|
+
[start, end] = [end, start]; // Reverse the start and end if the axis is reversed
|
|
274
|
+
}
|
|
275
|
+
const startValue = (0, _internals.invertScale)(axis.scale, axis.data ?? [], start) ?? axis.data?.at(0);
|
|
276
|
+
const endValue = (0, _internals.invertScale)(axis.scale, axis.data ?? [], end) ?? axis.data?.at(-1);
|
|
277
|
+
const tooltipStart = formatValue(startValue);
|
|
278
|
+
const tooltipEnd = formatValue(endValue);
|
|
279
|
+
return {
|
|
280
|
+
tooltipStart,
|
|
281
|
+
tooltipEnd
|
|
282
|
+
};
|
|
251
283
|
}
|
|
@@ -74,14 +74,12 @@ function ChartAxisZoomSliderTrack(_ref) {
|
|
|
74
74
|
|
|
75
75
|
// Ensure the zoomFromPointerDown is within the min and max range
|
|
76
76
|
zoomFromPointerDown = Math.max(Math.min(zoomFromPointerDown, maxEnd), minStart);
|
|
77
|
-
let pointerMoved = false;
|
|
78
77
|
const onPointerMove = (0, _rafThrottle.rafThrottle)(function onPointerMove(pointerMoveEvent) {
|
|
79
78
|
const pointerMovePoint = (0, _internals.getSVGPoint)(element, pointerMoveEvent);
|
|
80
79
|
const zoomFromPointerMove = (0, _zoomUtils.calculateZoomFromPoint)(store.getSnapshot(), axisId, pointerMovePoint);
|
|
81
80
|
if (zoomFromPointerMove === null) {
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
84
|
-
pointerMoved = true;
|
|
85
83
|
const zoomOptions = (0, _internals.selectorChartAxisZoomOptionsLookup)(store.getSnapshot(), axisId);
|
|
86
84
|
instance.setAxisZoomData(axisId, prevZoomData => {
|
|
87
85
|
if (zoomFromPointerMove > zoomFromPointerDown) {
|
|
@@ -122,22 +120,6 @@ function ChartAxisZoomSliderTrack(_ref) {
|
|
|
122
120
|
document.removeEventListener('pointerup', onPointerUp);
|
|
123
121
|
setIsSelecting(false);
|
|
124
122
|
onSelectEnd?.();
|
|
125
|
-
if (pointerMoved) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// If the pointer didn't move, we still need to respect the zoom constraints (minSpan, etc.)
|
|
130
|
-
// In that case, we assume the start to be the pointerZoom and calculate the end.
|
|
131
|
-
const pointerUpPoint = (0, _internals.getSVGPoint)(element, pointerUpEvent);
|
|
132
|
-
const zoomFromPointerUp = (0, _zoomUtils.calculateZoomFromPoint)(store.getSnapshot(), axisId, pointerUpPoint);
|
|
133
|
-
if (zoomFromPointerUp === null) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const zoomOptions = (0, _internals.selectorChartAxisZoomOptionsLookup)(store.getSnapshot(), axisId);
|
|
137
|
-
instance.setAxisZoomData(axisId, prev => (0, _extends2.default)({}, prev, {
|
|
138
|
-
start: zoomFromPointerUp,
|
|
139
|
-
end: (0, _zoomUtils.calculateZoomEnd)(zoomFromPointerUp, prev, zoomOptions)
|
|
140
|
-
}));
|
|
141
123
|
};
|
|
142
124
|
event.preventDefault();
|
|
143
125
|
event.stopPropagation();
|
|
@@ -146,10 +128,6 @@ function ChartAxisZoomSliderTrack(_ref) {
|
|
|
146
128
|
rect.addEventListener('pointermove', onPointerMove);
|
|
147
129
|
onSelectStart?.();
|
|
148
130
|
setIsSelecting(true);
|
|
149
|
-
instance.setAxisZoomData(axisId, prev => (0, _extends2.default)({}, prev, {
|
|
150
|
-
start: zoomFromPointerDown,
|
|
151
|
-
end: zoomFromPointerDown
|
|
152
|
-
}));
|
|
153
131
|
};
|
|
154
132
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ZoomSliderTrack, (0, _extends2.default)({
|
|
155
133
|
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;
|
|
@@ -8,13 +8,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.ChartsToolbarPro = ChartsToolbarPro;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _Toolbar = require("@mui/x-charts/Toolbar");
|
|
11
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
11
|
var React = _interopRequireWildcard(require("react"));
|
|
13
12
|
var _internals = require("@mui/x-charts/internals");
|
|
14
13
|
var _hooks = require("@mui/x-charts/hooks");
|
|
15
14
|
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var _ChartsToolbarZoomInTrigger = require("./ChartsToolbarZoomInTrigger");
|
|
16
|
+
var _ChartsToolbarZoomOutTrigger = require("./ChartsToolbarZoomOutTrigger");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
18
|
/**
|
|
20
19
|
* The chart toolbar component for the pro package.
|
|
@@ -38,13 +37,15 @@ function ChartsToolbarPro(props) {
|
|
|
38
37
|
const ZoomInIcon = slots.zoomInIcon;
|
|
39
38
|
children.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, slotProps.baseTooltip, {
|
|
40
39
|
title: localeText.zoomIn,
|
|
41
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsToolbarZoomInTrigger.ChartsToolbarZoomInTrigger, {
|
|
41
|
+
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbar.ToolbarButton, {}),
|
|
42
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ZoomInIcon, (0, _extends2.default)({}, slotProps.zoomInIcon))
|
|
43
43
|
})
|
|
44
44
|
}), "zoom-in"));
|
|
45
45
|
children.push(/*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, slotProps.baseTooltip, {
|
|
46
46
|
title: localeText.zoomOut,
|
|
47
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
47
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsToolbarZoomOutTrigger.ChartsToolbarZoomOutTrigger, {
|
|
48
|
+
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbar.ToolbarButton, {}),
|
|
48
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ZoomOutIcon, (0, _extends2.default)({}, slotProps.zoomOutIcon))
|
|
49
50
|
})
|
|
50
51
|
}), "zoom-out"));
|
|
@@ -55,11 +56,4 @@ function ChartsToolbarPro(props) {
|
|
|
55
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toolbar.Toolbar, (0, _extends2.default)({}, props, {
|
|
56
57
|
children: children
|
|
57
58
|
}));
|
|
58
|
-
}
|
|
59
|
-
process.env.NODE_ENV !== "production" ? ChartsToolbarPro.propTypes = {
|
|
60
|
-
// ----------------------------- Warning --------------------------------
|
|
61
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
62
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
63
|
-
// ----------------------------------------------------------------------
|
|
64
|
-
className: _propTypes.default.string
|
|
65
|
-
} : void 0;
|
|
59
|
+
}
|
|
@@ -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 };
|
|
@@ -6,7 +6,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.
|
|
9
|
+
exports.ChartsToolbarZoomInTrigger = void 0;
|
|
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"));
|
|
@@ -17,9 +17,10 @@ var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
const _excluded = ["render"];
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* A button that zooms the chart in.
|
|
21
|
+
* It renders the `baseButton` slot.
|
|
21
22
|
*/
|
|
22
|
-
const
|
|
23
|
+
const ChartsToolbarZoomInTrigger = exports.ChartsToolbarZoomInTrigger = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomInTrigger(_ref, ref) {
|
|
23
24
|
let {
|
|
24
25
|
render
|
|
25
26
|
} = _ref,
|
|
@@ -33,7 +34,7 @@ const ChartsToolbarZoomInButton = exports.ChartsToolbarZoomInButton = /*#__PURE_
|
|
|
33
34
|
store
|
|
34
35
|
} = (0, _internals.useChartContext)();
|
|
35
36
|
const disabled = (0, _internals.useSelector)(store, _useChartProZoom.selectorChartCanZoomIn);
|
|
36
|
-
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.
|
|
37
|
+
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.baseButton, render, (0, _extends2.default)({}, slotProps.baseButton, {
|
|
37
38
|
onClick: () => instance.zoomIn(),
|
|
38
39
|
disabled
|
|
39
40
|
}, other, {
|
|
@@ -43,8 +44,8 @@ const ChartsToolbarZoomInButton = exports.ChartsToolbarZoomInButton = /*#__PURE_
|
|
|
43
44
|
children: element
|
|
44
45
|
});
|
|
45
46
|
});
|
|
46
|
-
if (process.env.NODE_ENV !== "production")
|
|
47
|
-
process.env.NODE_ENV !== "production" ?
|
|
47
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomInTrigger.displayName = "ChartsToolbarZoomInTrigger";
|
|
48
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInTrigger.propTypes = {
|
|
48
49
|
// ----------------------------- Warning --------------------------------
|
|
49
50
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
50
51
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
package/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 };
|
|
@@ -6,7 +6,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.
|
|
9
|
+
exports.ChartsToolbarZoomOutTrigger = void 0;
|
|
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"));
|
|
@@ -17,9 +17,10 @@ var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
const _excluded = ["render"];
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* A button that zooms the chart out.
|
|
21
|
+
* It renders the `baseButton` slot.
|
|
21
22
|
*/
|
|
22
|
-
const
|
|
23
|
+
const ChartsToolbarZoomOutTrigger = exports.ChartsToolbarZoomOutTrigger = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomOutTrigger(_ref, ref) {
|
|
23
24
|
let {
|
|
24
25
|
render
|
|
25
26
|
} = _ref,
|
|
@@ -33,7 +34,7 @@ const ChartsToolbarZoomOutButton = exports.ChartsToolbarZoomOutButton = /*#__PUR
|
|
|
33
34
|
store
|
|
34
35
|
} = (0, _internals.useChartContext)();
|
|
35
36
|
const disabled = (0, _internals.useSelector)(store, _useChartProZoom.selectorChartCanZoomOut);
|
|
36
|
-
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.
|
|
37
|
+
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.baseButton, render, (0, _extends2.default)({}, slotProps.baseButton, {
|
|
37
38
|
onClick: () => instance.zoomOut(),
|
|
38
39
|
disabled
|
|
39
40
|
}, other, {
|
|
@@ -43,8 +44,8 @@ const ChartsToolbarZoomOutButton = exports.ChartsToolbarZoomOutButton = /*#__PUR
|
|
|
43
44
|
children: element
|
|
44
45
|
});
|
|
45
46
|
});
|
|
46
|
-
if (process.env.NODE_ENV !== "production")
|
|
47
|
-
process.env.NODE_ENV !== "production" ?
|
|
47
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomOutTrigger.displayName = "ChartsToolbarZoomOutTrigger";
|
|
48
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomOutTrigger.propTypes = {
|
|
48
49
|
// ----------------------------- Warning --------------------------------
|
|
49
50
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
50
51
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./ChartsToolbarPro.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./ChartsToolbarZoomInTrigger.js";
|
|
3
|
+
export * from "./ChartsToolbarZoomOutTrigger.js";
|
|
@@ -14,25 +14,25 @@ Object.keys(_ChartsToolbarPro).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var
|
|
18
|
-
Object.keys(
|
|
17
|
+
var _ChartsToolbarZoomInTrigger = require("./ChartsToolbarZoomInTrigger");
|
|
18
|
+
Object.keys(_ChartsToolbarZoomInTrigger).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _ChartsToolbarZoomInTrigger[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function () {
|
|
24
|
-
return
|
|
24
|
+
return _ChartsToolbarZoomInTrigger[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
var
|
|
29
|
-
Object.keys(
|
|
28
|
+
var _ChartsToolbarZoomOutTrigger = require("./ChartsToolbarZoomOutTrigger");
|
|
29
|
+
Object.keys(_ChartsToolbarZoomOutTrigger).forEach(function (key) {
|
|
30
30
|
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] ===
|
|
31
|
+
if (key in exports && exports[key] === _ChartsToolbarZoomOutTrigger[key]) return;
|
|
32
32
|
Object.defineProperty(exports, key, {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function () {
|
|
35
|
-
return
|
|
35
|
+
return _ChartsToolbarZoomOutTrigger[key];
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -14,11 +14,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
14
14
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
15
15
|
var _internals = require("@mui/x-charts/internals");
|
|
16
16
|
var _hooks = require("@mui/x-charts/hooks");
|
|
17
|
-
var _styles = require("@mui/material/styles");
|
|
18
17
|
var _FunnelSection = require("./FunnelSection");
|
|
19
18
|
var _labelUtils = require("./labelUtils");
|
|
20
19
|
var _useFunnelSeries = require("../hooks/useFunnelSeries");
|
|
21
20
|
var _curves = require("./curves");
|
|
21
|
+
var _FunnelSectionLabel = require("./FunnelSectionLabel");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
const _excluded = ["onItemClick", "gap"];
|
|
24
24
|
_internals.cartesianSeriesTypes.addType('funnel');
|
|
@@ -130,7 +130,6 @@ function FunnelPlot(props) {
|
|
|
130
130
|
gap
|
|
131
131
|
} = props,
|
|
132
132
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
133
|
-
const theme = (0, _styles.useTheme)();
|
|
134
133
|
const data = useAggregatedData(gap);
|
|
135
134
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
136
135
|
children: [data.map(({
|
|
@@ -156,29 +155,18 @@ function FunnelPlot(props) {
|
|
|
156
155
|
})
|
|
157
156
|
}))), data.map(({
|
|
158
157
|
id,
|
|
159
|
-
label
|
|
158
|
+
label,
|
|
159
|
+
seriesId,
|
|
160
|
+
dataIndex
|
|
160
161
|
}) => {
|
|
161
|
-
if (!label) {
|
|
162
|
+
if (!label || !label.value) {
|
|
162
163
|
return null;
|
|
163
164
|
}
|
|
164
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
stroke: "none",
|
|
170
|
-
pointerEvents: "none",
|
|
171
|
-
fontFamily: theme.typography.body2.fontFamily,
|
|
172
|
-
fontSize: theme.typography.body2.fontSize,
|
|
173
|
-
fontSizeAdjust: theme.typography.body2.fontSizeAdjust,
|
|
174
|
-
fontWeight: theme.typography.body2.fontWeight,
|
|
175
|
-
letterSpacing: theme.typography.body2.letterSpacing,
|
|
176
|
-
fontStretch: theme.typography.body2.fontStretch,
|
|
177
|
-
fontStyle: theme.typography.body2.fontStyle,
|
|
178
|
-
fontVariant: theme.typography.body2.fontVariant,
|
|
179
|
-
fill: (theme.vars || theme)?.palette?.text?.primary,
|
|
180
|
-
children: label.value
|
|
181
|
-
}, id);
|
|
165
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FunnelSectionLabel.FunnelSectionLabel, (0, _extends2.default)({
|
|
166
|
+
label: label,
|
|
167
|
+
dataIndex: dataIndex,
|
|
168
|
+
seriesId: seriesId
|
|
169
|
+
}, other), id);
|
|
182
170
|
})]
|
|
183
171
|
});
|
|
184
172
|
}
|
|
@@ -8,7 +8,7 @@ export interface FunnelSectionProps extends Omit<React.SVGProps<SVGPathElement>,
|
|
|
8
8
|
classes?: Partial<FunnelSectionClasses>;
|
|
9
9
|
variant?: 'filled' | 'outlined';
|
|
10
10
|
}
|
|
11
|
-
export declare const FunnelSectionPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, React.SVGProps<SVGPathElement>, {}>;
|
|
11
|
+
export declare const FunnelSectionPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.SVGProps<SVGPathElement>, {}>;
|
|
12
12
|
/**
|
|
13
13
|
* @ignore - internal component.
|
|
14
14
|
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SeriesId } from '@mui/x-charts/internals';
|
|
3
|
+
import { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
4
|
+
export interface FunnelSectionLabelConfig {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
value: string | null;
|
|
8
|
+
textAnchor?: React.SVGProps<SVGTextElement>['textAnchor'];
|
|
9
|
+
dominantBaseline?: React.SVGProps<SVGTextElement>['dominantBaseline'];
|
|
10
|
+
}
|
|
11
|
+
export interface FunnelSectionLabelProps extends Omit<React.SVGProps<SVGTextElement>, 'ref' | 'id'> {
|
|
12
|
+
classes?: Partial<FunnelSectionClasses>;
|
|
13
|
+
label: FunnelSectionLabelConfig;
|
|
14
|
+
seriesId: SeriesId;
|
|
15
|
+
dataIndex: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @ignore - internal component.
|
|
19
|
+
*/
|
|
20
|
+
declare const FunnelSectionLabel: React.ForwardRefExoticComponent<FunnelSectionLabelProps & React.RefAttributes<{}>>;
|
|
21
|
+
export { FunnelSectionLabel };
|