@mui/x-charts 6.0.0-alpha.12 → 6.0.0-alpha.14
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 +3 -3
- package/BarChart/BarChart.js +3 -2
- package/BarChart/BarElement.js +2 -4
- package/BarChart/formatter.js +1 -2
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +144 -0
- package/ChartContainer/index.js +2 -3
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsLegend/ChartsLegend.js +4 -8
- package/ChartsLegend/chartsLegendClasses.js +1 -2
- package/ChartsSurface.js +2 -3
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +16 -6
- package/ChartsTooltip/ChartsTooltip.d.ts +23 -0
- package/ChartsTooltip/ChartsTooltip.js +47 -13
- package/ChartsTooltip/ChartsTooltipTable.js +6 -11
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/LineChart/AreaElement.js +2 -4
- package/LineChart/LineChart.d.ts +3 -3
- package/LineChart/LineChart.js +7 -3
- package/LineChart/LineElement.js +2 -4
- package/LineChart/LineHighlightElement.js +1 -2
- package/LineChart/MarkElement.js +1 -2
- package/LineChart/formatter.js +1 -2
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +1 -0
- package/PieChart/PieArc.js +6 -4
- package/PieChart/PieArcLabel.js +1 -2
- package/PieChart/PieChart.d.ts +5 -4
- package/PieChart/PieChart.js +7 -2
- package/PieChart/PiePlot.d.ts +8 -0
- package/PieChart/PiePlot.js +21 -5
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/ResponsiveChartContainer/index.js +2 -3
- package/ScatterChart/ScatterChart.d.ts +3 -3
- package/ScatterChart/ScatterChart.js +3 -2
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +3 -3
- package/SparkLineChart/SparkLineChart.js +7 -3
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +4 -7
- package/context/CartesianContextProvider.js +1 -2
- package/context/DrawingProvider.js +2 -4
- package/context/HighlightProvider.js +1 -2
- package/context/InteractionProvider.js +1 -2
- package/context/SeriesContextProvider.js +1 -2
- package/esm/BarChart/BarChart.js +2 -0
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/esm/ChartsTooltip/ChartsTooltip.js +47 -12
- package/esm/LineChart/LineChart.js +6 -1
- package/esm/PieChart/PieArc.js +5 -2
- package/esm/PieChart/PieChart.js +7 -2
- package/esm/PieChart/PiePlot.js +17 -2
- package/esm/ScatterChart/ScatterChart.js +2 -0
- package/esm/SparkLineChart/SparkLineChart.js +6 -1
- package/hooks/useChartDimensions.js +1 -2
- package/hooks/useTicks.js +1 -2
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.js +6 -11
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/stackSeries.js +2 -4
- package/legacy/BarChart/BarChart.js +2 -0
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/legacy/ChartsTooltip/ChartsTooltip.js +50 -12
- package/legacy/LineChart/LineChart.js +6 -1
- package/legacy/PieChart/PieArc.js +4 -1
- package/legacy/PieChart/PieChart.js +7 -2
- package/legacy/PieChart/PiePlot.js +17 -2
- package/legacy/ScatterChart/ScatterChart.js +2 -0
- package/legacy/SparkLineChart/SparkLineChart.js +6 -1
- package/legacy/index.js +1 -1
- package/modern/BarChart/BarChart.js +2 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +17 -8
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -6
- package/modern/ChartsTooltip/ChartsTooltip.js +46 -12
- package/modern/LineChart/LineChart.js +6 -1
- package/modern/PieChart/PieArc.js +5 -2
- package/modern/PieChart/PieChart.js +7 -2
- package/modern/PieChart/PiePlot.js +17 -2
- package/modern/ScatterChart/ScatterChart.js +2 -0
- package/modern/SparkLineChart/SparkLineChart.js +6 -1
- package/modern/index.js +1 -1
- package/package.json +3 -3
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
|
4
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
5
5
|
import { BarSeriesType } from '../models/seriesType/bar';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
7
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
8
8
|
import { ChartsLegendProps, ChartsLegendSlotsComponent, ChartsLegendSlotComponentProps } from '../ChartsLegend';
|
|
9
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
10
|
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
11
|
-
export interface BarChartSlotsComponent extends ChartsAxisSlotsComponent, BarPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
11
|
+
export interface BarChartSlotsComponent extends ChartsAxisSlotsComponent, BarPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
12
12
|
}
|
|
13
|
-
export interface BarChartSlotComponentProps extends ChartsAxisSlotComponentProps, BarPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
13
|
+
export interface BarChartSlotComponentProps extends ChartsAxisSlotComponentProps, BarPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
14
14
|
}
|
|
15
15
|
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
16
16
|
series: MakeOptional<BarSeriesType, 'type'>[];
|
package/BarChart/BarChart.js
CHANGED
|
@@ -20,7 +20,7 @@ var _ChartsClipPath = require("../ChartsClipPath");
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
23
|
+
const BarChart = exports.BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
24
24
|
const {
|
|
25
25
|
xAxis,
|
|
26
26
|
yAxis,
|
|
@@ -101,7 +101,6 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
101
101
|
}), children]
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
|
-
exports.BarChart = BarChart;
|
|
105
104
|
process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
106
105
|
// ----------------------------- Warning --------------------------------
|
|
107
106
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -250,6 +249,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
250
249
|
axisContent: _propTypes.default.elementType,
|
|
251
250
|
classes: _propTypes.default.object,
|
|
252
251
|
itemContent: _propTypes.default.elementType,
|
|
252
|
+
slotProps: _propTypes.default.object,
|
|
253
|
+
slots: _propTypes.default.object,
|
|
253
254
|
trigger: _propTypes.default.oneOf(['axis', 'item', 'none'])
|
|
254
255
|
}),
|
|
255
256
|
/**
|
package/BarChart/BarElement.js
CHANGED
|
@@ -26,8 +26,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
26
|
function getBarElementUtilityClass(slot) {
|
|
27
27
|
return (0, _generateUtilityClass.default)('MuiBarElement', slot);
|
|
28
28
|
}
|
|
29
|
-
const lineElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root']);
|
|
30
|
-
exports.lineElementClasses = lineElementClasses;
|
|
29
|
+
const lineElementClasses = exports.lineElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root']);
|
|
31
30
|
const useUtilityClasses = ownerState => {
|
|
32
31
|
const {
|
|
33
32
|
classes,
|
|
@@ -38,7 +37,7 @@ const useUtilityClasses = ownerState => {
|
|
|
38
37
|
};
|
|
39
38
|
return (0, _composeClasses.default)(slots, getBarElementUtilityClass, classes);
|
|
40
39
|
};
|
|
41
|
-
const BarElementPath = (0, _styles.styled)('rect', {
|
|
40
|
+
const BarElementPath = exports.BarElementPath = (0, _styles.styled)('rect', {
|
|
42
41
|
name: 'MuiBarElement',
|
|
43
42
|
slot: 'Root',
|
|
44
43
|
overridesResolver: (_, styles) => styles.root
|
|
@@ -51,7 +50,6 @@ const BarElementPath = (0, _styles.styled)('rect', {
|
|
|
51
50
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
52
51
|
opacity: ownerState.isFaded && 0.3 || 1
|
|
53
52
|
}));
|
|
54
|
-
exports.BarElementPath = BarElementPath;
|
|
55
53
|
function BarElement(props) {
|
|
56
54
|
const {
|
|
57
55
|
id,
|
package/BarChart/formatter.js
CHANGED
package/BarChart/legend.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,150 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.16.1
|
|
7
|
+
|
|
8
|
+
_Oct 6, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🥧 Support interaction with pie chart
|
|
13
|
+
- 🐞 Bugfixes
|
|
14
|
+
- 📚 Documentation improvements
|
|
15
|
+
|
|
16
|
+
### Data Grid
|
|
17
|
+
|
|
18
|
+
#### `@mui/x-data-grid@6.16.1`
|
|
19
|
+
|
|
20
|
+
- [DataGrid] Add a new demo with sparklines (#9228) @flaviendelangle
|
|
21
|
+
- [DataGrid] Fix autosize missing a few pixels (#10471) @romgrk
|
|
22
|
+
- [DataGrid] Make `disableColumnSelector` demo idempotent (#10548) @MBilalShafi
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
25
|
+
|
|
26
|
+
Same changes as in `@mui/x-data-grid@6.16.1`.
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid-premium@6.16.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
29
|
+
|
|
30
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.1`.
|
|
31
|
+
|
|
32
|
+
### Date Pickers
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers@6.16.1`
|
|
35
|
+
|
|
36
|
+
- [pickers] Avoid calendar layout shifting when changing views (#10541) @LukasTy
|
|
37
|
+
- [pickers] Fix clearable behavior when disabled (#10542) @noraleonte
|
|
38
|
+
- [pickers] Improve customization playground examples (#10544) @noraleonte
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@6.16.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@6.16.1`, plus:
|
|
43
|
+
|
|
44
|
+
- [DateRangePicker] Fix `InputProps` propagation in multi input (#10564) @alexfauquette
|
|
45
|
+
|
|
46
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.14`
|
|
47
|
+
|
|
48
|
+
- [charts] Display cursor pointer for pie chart only if `onClick` is provided (#10551) @giladappsforce
|
|
49
|
+
- [charts] Add `onClick` prop to PieChart (#10506) @giladappsforce
|
|
50
|
+
- [charts] Support `slots`/`slotProps` for the tooltip (#10515) @alexfauquette
|
|
51
|
+
|
|
52
|
+
### Docs
|
|
53
|
+
|
|
54
|
+
- [docs] Add `DateRangePicker` example with a `Button` trigger (#10485) @LukasTy
|
|
55
|
+
- [docs] Add section about disabling columns panel (#10328) @MBilalShafi
|
|
56
|
+
- [docs] Add section about overriding slots to base concepts (#10421) @noraleonte
|
|
57
|
+
- [docs] Add "What's new" page listing all release announcements (#9727) @joserodolfofreitas
|
|
58
|
+
- [docs] Update RTL Support section of the grid localization docs (#10561) @MBilalShafi
|
|
59
|
+
|
|
60
|
+
### Core
|
|
61
|
+
|
|
62
|
+
- [core] Fix casing consistency with legal and marketing content @oliviertassinari
|
|
63
|
+
- [core] Revert the link in the priority support ticket description (#10517) @michelengelen
|
|
64
|
+
- [CHANGELOG] Polish image @oliviertassinari
|
|
65
|
+
|
|
66
|
+
## 6.16.0
|
|
67
|
+
|
|
68
|
+
_Sep 29, 2023_
|
|
69
|
+
|
|
70
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
71
|
+
|
|
72
|
+
- 🎁 Add a clearable behavior to all the single input pickers and fields (#9095) @noraleonte
|
|
73
|
+
|
|
74
|
+
The pickers and fields now have an out-of-the box implementation for clearing the field value. You can see the documentation for this behavior on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value).
|
|
75
|
+
|
|
76
|
+
<img width="337" height="139" alt="Clearable behavior" src="https://github.com/mui/mui-x/assets/3165635/a5407cb6-0b8a-443c-b4b9-1f81ceb4d087">
|
|
77
|
+
|
|
78
|
+
- 💫 Add Date Picker customization playground (#9581) @noraleonte
|
|
79
|
+
|
|
80
|
+
You can play around with style customization options on the [Date Picker documentation](https://mui.com/x/react-date-pickers/date-picker/#customization).
|
|
81
|
+
|
|
82
|
+
We are thrilled to hear your feedback about this functionality!
|
|
83
|
+
|
|
84
|
+
- 🚀 Fix header filters menu auto closing on render (#10483) @MBilalShafi
|
|
85
|
+
- 🎯 Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
|
|
86
|
+
- 🌍 Improve Russian (ru-RU) locale on the data grid
|
|
87
|
+
- 🐞 Bugfixes
|
|
88
|
+
- 📚 Documentation improvements
|
|
89
|
+
|
|
90
|
+
### Data Grid
|
|
91
|
+
|
|
92
|
+
#### `@mui/x-data-grid@6.16.0`
|
|
93
|
+
|
|
94
|
+
- [DataGrid] Fix column headers scroll when theme scoping is used (#10437) @cherniavskii
|
|
95
|
+
- [DataGrid] Rename `global` to `globalScope` due to Jest issue (#10470) @romgrk
|
|
96
|
+
- [l10n] Improve Russian (ru-RU) locale (#10464 and #10407) @NKodos
|
|
97
|
+
|
|
98
|
+
#### `@mui/x-data-grid-pro@6.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
99
|
+
|
|
100
|
+
Same changes as in `@mui/x-data-grid@6.16.0`, plus:
|
|
101
|
+
|
|
102
|
+
- [DataGridPro] Fix header filters menu auto closing on render (#10483) @MBilalShafi
|
|
103
|
+
|
|
104
|
+
#### `@mui/x-data-grid-premium@6.16.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
105
|
+
|
|
106
|
+
Same changes as in `@mui/x-data-grid-pro@6.16.0`.
|
|
107
|
+
|
|
108
|
+
### Date Pickers
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-date-pickers@6.16.0`
|
|
111
|
+
|
|
112
|
+
- [pickers] Add warning to `shouldDisableDate` validation (#10502) @michelengelen
|
|
113
|
+
- [pickers] Implement `clearable` field behavior (#9095) @noraleonte
|
|
114
|
+
- [pickers] Refactor `dayOfWeekFormatter` (#10345) @michelengelen
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-date-pickers-pro@6.16.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
117
|
+
|
|
118
|
+
Same changes as in `@mui/x-date-pickers@6.16.0`.
|
|
119
|
+
|
|
120
|
+
### Charts / `@mui/x-charts@6.0.0-alpha.13`
|
|
121
|
+
|
|
122
|
+
- [charts] Share upfront future Pro features (#10465) @oliviertassinari
|
|
123
|
+
|
|
124
|
+
### Tree View / `@mui/x-tree-view@6.0.0-beta.0`
|
|
125
|
+
|
|
126
|
+
- [TreeView] Do not try to focus a collapsed node when re-focusing the TreeView (#10422) @flaviendelangle
|
|
127
|
+
- [TreeView] Fix the typing of the `Multiple` generic (#10478) @flaviendelangle
|
|
128
|
+
|
|
129
|
+
### Docs
|
|
130
|
+
|
|
131
|
+
- [docs] Correct the typo in data grid api docs (#10477) @MBilalShafi
|
|
132
|
+
- [docs] Add customization playground (#9581) @noraleonte
|
|
133
|
+
- [docs] Fix Tree View product ID (#10428) @oliviertassinari
|
|
134
|
+
- [docs] Fix demo crashing when all rows are deleted (#10438) @cherniavskii
|
|
135
|
+
- [docs] Fix mobile scrollbar column resize (#10455) @oliviertassinari
|
|
136
|
+
- [docs] Fix usage of `GridRenderCellParams` interface (#10435) @cherniavskii
|
|
137
|
+
|
|
138
|
+
### Core
|
|
139
|
+
|
|
140
|
+
- [core] Fix typo in header data grid quick filter @oliviertassinari
|
|
141
|
+
- [core] Group D3 renovate PRs (#10480) @flaviendelangle
|
|
142
|
+
- [core] Link the priority support page (#10495) @michelengelen
|
|
143
|
+
- [core] Move the pickers describes to the test utils folder (#10490) @flaviendelangle
|
|
144
|
+
- [core] Priority Support casing normalization @oliviertassinari
|
|
145
|
+
- [core] Remove automated DataGrid performance tests (#10414) @romgrk
|
|
146
|
+
- [core] Sync `prism-okaidia.css` with docs-infra @oliviertassinari
|
|
147
|
+
- [core] Update issue actions & templates (#10375) @romgrk
|
|
148
|
+
- [core] Update release guide (#10468) @DanailH
|
|
149
|
+
|
|
6
150
|
## 6.15.0
|
|
7
151
|
|
|
8
152
|
_Sep 22, 2023_
|
package/ChartContainer/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var _HighlightProvider = require("../context/HighlightProvider");
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
-
const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
19
|
+
const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
20
20
|
const {
|
|
21
21
|
width,
|
|
22
22
|
height,
|
|
@@ -64,5 +64,4 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
|
|
|
64
64
|
})
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
|
-
});
|
|
68
|
-
exports.ChartContainer = ChartContainer;
|
|
67
|
+
});
|
|
@@ -9,5 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getAxisUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiChartsAxis', slot);
|
|
11
11
|
}
|
|
12
|
-
const axisClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsAxis', ['root', 'line', 'tickContainer', 'tick', 'tickLabel', 'label', 'directionX', 'directionY', 'top', 'bottom', 'left', 'right']);
|
|
13
|
-
exports.axisClasses = axisClasses;
|
|
12
|
+
const axisClasses = exports.axisClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsAxis', ['root', 'line', 'tickContainer', 'tick', 'tickLabel', 'label', 'directionX', 'directionY', 'top', 'bottom', 'left', 'right']);
|
|
@@ -63,7 +63,7 @@ function getTranslePosition({
|
|
|
63
63
|
transform: `translate(${xValue}, ${yValue})`
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const ChartsLegendRoot = (0, _styles.styled)('g', {
|
|
66
|
+
const ChartsLegendRoot = exports.ChartsLegendRoot = (0, _styles.styled)('g', {
|
|
67
67
|
name: 'MuiChartsLegend',
|
|
68
68
|
slot: 'Root',
|
|
69
69
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -90,8 +90,7 @@ const ChartsLegendRoot = (0, _styles.styled)('g', {
|
|
|
90
90
|
offsetY
|
|
91
91
|
}));
|
|
92
92
|
});
|
|
93
|
-
exports.
|
|
94
|
-
const ChartsSeriesLegendGroup = (0, _styles.styled)('g', {
|
|
93
|
+
const ChartsSeriesLegendGroup = exports.ChartsSeriesLegendGroup = (0, _styles.styled)('g', {
|
|
95
94
|
name: 'MuiChartsLegend',
|
|
96
95
|
slot: 'ChartsSeriesLegendGroup',
|
|
97
96
|
overridesResolver: (props, styles) => styles.series
|
|
@@ -111,8 +110,7 @@ const ChartsSeriesLegendGroup = (0, _styles.styled)('g', {
|
|
|
111
110
|
transform: `translate(0, calc(${seriesIndex} * (var(--ChartsLegend-itemMarkSize) + var(--ChartsLegend-rootSpacing))))`
|
|
112
111
|
};
|
|
113
112
|
});
|
|
114
|
-
exports.
|
|
115
|
-
const ChartsLegendMark = (0, _styles.styled)('rect', {
|
|
113
|
+
const ChartsLegendMark = exports.ChartsLegendMark = (0, _styles.styled)('rect', {
|
|
116
114
|
name: 'MuiChartsLegend',
|
|
117
115
|
slot: 'Mark',
|
|
118
116
|
overridesResolver: (props, styles) => styles.mark
|
|
@@ -125,8 +123,7 @@ const ChartsLegendMark = (0, _styles.styled)('rect', {
|
|
|
125
123
|
height: 'var(--ChartsLegend-itemMarkSize)',
|
|
126
124
|
fill: ownerState.color
|
|
127
125
|
}));
|
|
128
|
-
exports.
|
|
129
|
-
const ChartsLegendLabel = (0, _styles.styled)('text', {
|
|
126
|
+
const ChartsLegendLabel = exports.ChartsLegendLabel = (0, _styles.styled)('text', {
|
|
130
127
|
name: 'MuiChartsLegend',
|
|
131
128
|
slot: 'Label',
|
|
132
129
|
overridesResolver: (props, styles) => styles.label
|
|
@@ -141,7 +138,6 @@ const ChartsLegendLabel = (0, _styles.styled)('text', {
|
|
|
141
138
|
fill: (theme.vars || theme).palette.text.primary,
|
|
142
139
|
dominantBaseline: 'central'
|
|
143
140
|
}));
|
|
144
|
-
exports.ChartsLegendLabel = ChartsLegendLabel;
|
|
145
141
|
const defaultProps = {
|
|
146
142
|
position: {
|
|
147
143
|
horizontal: 'middle',
|
|
@@ -9,5 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getChartsLegendUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiChartsLegend', slot);
|
|
11
11
|
}
|
|
12
|
-
const legendClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsLegend', ['root', 'series', 'mark', 'label', 'column', 'row']);
|
|
13
|
-
exports.legendClasses = legendClasses;
|
|
12
|
+
const legendClasses = exports.legendClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsLegend', ['root', 'series', 'mark', 'label', 'column', 'row']);
|
package/ChartsSurface.js
CHANGED
|
@@ -18,7 +18,7 @@ const ChartChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
|
18
18
|
name: 'MuiChartsSurface',
|
|
19
19
|
slot: 'Root'
|
|
20
20
|
})(() => ({}));
|
|
21
|
-
const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
|
|
21
|
+
const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props, ref) {
|
|
22
22
|
const {
|
|
23
23
|
children,
|
|
24
24
|
width,
|
|
@@ -54,5 +54,4 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(props
|
|
|
54
54
|
children: props.desc
|
|
55
55
|
}), children]
|
|
56
56
|
}));
|
|
57
|
-
});
|
|
58
|
-
exports.ChartsSurface = ChartsSurface;
|
|
57
|
+
});
|
|
@@ -35,6 +35,7 @@ export declare function DefaultChartsAxisContent(props: ChartsAxisContentProps):
|
|
|
35
35
|
export declare function ChartsAxisTooltipContent(props: {
|
|
36
36
|
axisData: AxisInteractionData;
|
|
37
37
|
content?: React.ElementType<ChartsAxisContentProps>;
|
|
38
|
+
contentProps?: Partial<ChartsAxisContentProps>;
|
|
38
39
|
sx?: SxProps<Theme>;
|
|
39
40
|
classes: ChartsAxisContentProps['classes'];
|
|
40
41
|
}): React.JSX.Element;
|
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ChartsAxisTooltipContent = ChartsAxisTooltipContent;
|
|
8
8
|
exports.DefaultChartsAxisContent = DefaultChartsAxisContent;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var React = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
12
|
+
var _utils = require("@mui/base/utils");
|
|
11
13
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
12
14
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
13
15
|
var _ChartsTooltipTable = require("./ChartsTooltipTable");
|
|
@@ -75,6 +77,7 @@ function DefaultChartsAxisContent(props) {
|
|
|
75
77
|
function ChartsAxisTooltipContent(props) {
|
|
76
78
|
const {
|
|
77
79
|
content,
|
|
80
|
+
contentProps,
|
|
78
81
|
axisData,
|
|
79
82
|
sx,
|
|
80
83
|
classes
|
|
@@ -107,13 +110,19 @@ function ChartsAxisTooltipContent(props) {
|
|
|
107
110
|
return isXaxis ? xAxis[USED_AXIS_ID] : yAxis[USED_AXIS_ID];
|
|
108
111
|
}, [USED_AXIS_ID, isXaxis, xAxis, yAxis]);
|
|
109
112
|
const Content = content ?? DefaultChartsAxisContent;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
const chartTooltipContentProps = (0, _utils.useSlotProps)({
|
|
114
|
+
elementType: Content,
|
|
115
|
+
externalSlotProps: contentProps,
|
|
116
|
+
additionalProps: {
|
|
117
|
+
axisData,
|
|
118
|
+
series: relevantSeries,
|
|
119
|
+
axis: relevantAxis,
|
|
120
|
+
dataIndex,
|
|
121
|
+
axisValue,
|
|
122
|
+
sx,
|
|
123
|
+
classes
|
|
124
|
+
},
|
|
125
|
+
ownerState: {}
|
|
118
126
|
});
|
|
127
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, (0, _extends2.default)({}, chartTooltipContentProps));
|
|
119
128
|
}
|
|
@@ -3,7 +3,7 @@ import { SxProps, Theme } from '@mui/material/styles';
|
|
|
3
3
|
import { ItemInteractionData } from '../context/InteractionProvider';
|
|
4
4
|
import { ChartSeriesDefaultized, ChartSeriesType } from '../models/seriesType/config';
|
|
5
5
|
import { ChartsTooltipClasses } from './tooltipClasses';
|
|
6
|
-
export type ChartsItemContentProps<T extends ChartSeriesType> = {
|
|
6
|
+
export type ChartsItemContentProps<T extends ChartSeriesType = ChartSeriesType> = {
|
|
7
7
|
/**
|
|
8
8
|
* The data used to identify the triggered item.
|
|
9
9
|
*/
|
|
@@ -18,10 +18,11 @@ export type ChartsItemContentProps<T extends ChartSeriesType> = {
|
|
|
18
18
|
classes: ChartsTooltipClasses;
|
|
19
19
|
sx?: SxProps<Theme>;
|
|
20
20
|
};
|
|
21
|
-
export declare function DefaultChartsItemContent<T extends ChartSeriesType>(props: ChartsItemContentProps<T>): React.JSX.Element | null;
|
|
21
|
+
export declare function DefaultChartsItemContent<T extends ChartSeriesType = ChartSeriesType>(props: ChartsItemContentProps<T>): React.JSX.Element | null;
|
|
22
22
|
export declare function ChartsItemTooltipContent<T extends ChartSeriesType>(props: {
|
|
23
23
|
itemData: ItemInteractionData<T>;
|
|
24
24
|
content?: React.ElementType<ChartsItemContentProps<T>>;
|
|
25
|
+
contentProps?: Partial<ChartsItemContentProps<T>>;
|
|
25
26
|
sx?: SxProps<Theme>;
|
|
26
27
|
classes: ChartsItemContentProps<T>['classes'];
|
|
27
28
|
}): React.JSX.Element;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.ChartsItemTooltipContent = ChartsItemTooltipContent;
|
|
7
8
|
exports.DefaultChartsItemContent = DefaultChartsItemContent;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _utils = require("@mui/base/utils");
|
|
9
12
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
10
13
|
var _ChartsTooltipTable = require("./ChartsTooltipTable");
|
|
11
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -65,14 +68,21 @@ function ChartsItemTooltipContent(props) {
|
|
|
65
68
|
content,
|
|
66
69
|
itemData,
|
|
67
70
|
sx,
|
|
68
|
-
classes
|
|
71
|
+
classes,
|
|
72
|
+
contentProps
|
|
69
73
|
} = props;
|
|
70
74
|
const series = React.useContext(_SeriesContextProvider.SeriesContext)[itemData.type].series[itemData.seriesId];
|
|
71
75
|
const Content = content ?? DefaultChartsItemContent;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
const chartTooltipContentProps = (0, _utils.useSlotProps)({
|
|
77
|
+
elementType: Content,
|
|
78
|
+
externalSlotProps: contentProps,
|
|
79
|
+
additionalProps: {
|
|
80
|
+
itemData,
|
|
81
|
+
series,
|
|
82
|
+
sx,
|
|
83
|
+
classes
|
|
84
|
+
},
|
|
85
|
+
ownerState: {}
|
|
77
86
|
});
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, (0, _extends2.default)({}, chartTooltipContentProps));
|
|
78
88
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { PopperProps } from '@mui/base/Popper';
|
|
2
3
|
import { TriggerOptions } from './utils';
|
|
3
4
|
import { ChartsItemContentProps } from './ChartsItemTooltipContent';
|
|
4
5
|
import { ChartsAxisContentProps } from './ChartsAxisTooltipContent';
|
|
5
6
|
import { ChartsTooltipClasses } from './tooltipClasses';
|
|
7
|
+
export interface ChartsTooltipSlotsComponent {
|
|
8
|
+
popper?: React.ElementType<PopperProps>;
|
|
9
|
+
axisContent?: React.ElementType<ChartsAxisContentProps>;
|
|
10
|
+
itemContent?: React.ElementType<ChartsItemContentProps>;
|
|
11
|
+
}
|
|
12
|
+
export interface ChartsTooltipSlotComponentProps {
|
|
13
|
+
popper?: Partial<PopperProps>;
|
|
14
|
+
axisContent?: Partial<ChartsAxisContentProps>;
|
|
15
|
+
itemContent?: Partial<ChartsItemContentProps>;
|
|
16
|
+
}
|
|
6
17
|
export type ChartsTooltipProps = {
|
|
7
18
|
/**
|
|
8
19
|
* Select the kind of tooltip to display
|
|
@@ -14,16 +25,28 @@ export type ChartsTooltipProps = {
|
|
|
14
25
|
trigger?: TriggerOptions;
|
|
15
26
|
/**
|
|
16
27
|
* Component to override the tooltip content when triger is set to 'item'.
|
|
28
|
+
* @deprecated Use slots.itemContent instead
|
|
17
29
|
*/
|
|
18
30
|
itemContent?: React.ElementType<ChartsItemContentProps<any>>;
|
|
19
31
|
/**
|
|
20
32
|
* Component to override the tooltip content when triger is set to 'axis'.
|
|
33
|
+
* @deprecated Use slots.axisContent instead
|
|
21
34
|
*/
|
|
22
35
|
axisContent?: React.ElementType<ChartsAxisContentProps>;
|
|
23
36
|
/**
|
|
24
37
|
* Override or extend the styles applied to the component.
|
|
25
38
|
*/
|
|
26
39
|
classes?: Partial<ChartsTooltipClasses>;
|
|
40
|
+
/**
|
|
41
|
+
* Overridable component slots.
|
|
42
|
+
* @default {}
|
|
43
|
+
*/
|
|
44
|
+
slots?: ChartsTooltipSlotsComponent;
|
|
45
|
+
/**
|
|
46
|
+
* The props used for each component slot.
|
|
47
|
+
* @default {}
|
|
48
|
+
*/
|
|
49
|
+
slotProps?: ChartsTooltipSlotComponentProps;
|
|
27
50
|
};
|
|
28
51
|
declare function ChartsTooltip(props: ChartsTooltipProps): React.JSX.Element | null;
|
|
29
52
|
declare namespace ChartsTooltip {
|
|
@@ -5,11 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ChartsTooltip = ChartsTooltip;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var
|
|
11
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
12
|
+
var _styles = require("@mui/material/styles");
|
|
11
13
|
var _Popper = require("@mui/base/Popper");
|
|
12
14
|
var _NoSsr = require("@mui/base/NoSsr");
|
|
15
|
+
var _utils = require("@mui/base/utils");
|
|
13
16
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
14
17
|
var _utils2 = require("./utils");
|
|
15
18
|
var _ChartsItemTooltipContent = require("./ChartsItemTooltipContent");
|
|
@@ -28,13 +31,25 @@ const useUtilityClasses = ownerState => {
|
|
|
28
31
|
labelCell: ['labelCell'],
|
|
29
32
|
valueCell: ['valueCell']
|
|
30
33
|
};
|
|
31
|
-
return (0,
|
|
34
|
+
return (0, _composeClasses.default)(slots, _tooltipClasses.getTooltipUtilityClass, classes);
|
|
32
35
|
};
|
|
36
|
+
const ChartsTooltipRoot = (0, _styles.styled)(_Popper.Popper, {
|
|
37
|
+
name: 'MuiChartsTooltip',
|
|
38
|
+
slot: 'Root',
|
|
39
|
+
overridesResolver: (_, styles) => styles.root
|
|
40
|
+
})(({
|
|
41
|
+
theme
|
|
42
|
+
}) => ({
|
|
43
|
+
pointerEvents: 'none',
|
|
44
|
+
zIndex: theme.zIndex.modal
|
|
45
|
+
}));
|
|
33
46
|
function ChartsTooltip(props) {
|
|
34
47
|
const {
|
|
35
48
|
trigger = 'axis',
|
|
36
49
|
itemContent,
|
|
37
|
-
axisContent
|
|
50
|
+
axisContent,
|
|
51
|
+
slots,
|
|
52
|
+
slotProps
|
|
38
53
|
} = props;
|
|
39
54
|
const mousePosition = (0, _utils2.useMouseTracker)();
|
|
40
55
|
const {
|
|
@@ -47,33 +62,40 @@ function ChartsTooltip(props) {
|
|
|
47
62
|
const classes = useUtilityClasses({
|
|
48
63
|
classes: props.classes
|
|
49
64
|
});
|
|
65
|
+
const PopperComponent = slots?.popper ?? ChartsTooltipRoot;
|
|
66
|
+
const popperProps = (0, _utils.useSlotProps)({
|
|
67
|
+
elementType: PopperComponent,
|
|
68
|
+
externalSlotProps: slotProps?.popper,
|
|
69
|
+
additionalProps: {
|
|
70
|
+
open: popperOpen,
|
|
71
|
+
placement: 'right-start',
|
|
72
|
+
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition)
|
|
73
|
+
},
|
|
74
|
+
ownerState: {}
|
|
75
|
+
});
|
|
50
76
|
if (trigger === 'none') {
|
|
51
77
|
return null;
|
|
52
78
|
}
|
|
53
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoSsr.NoSsr, {
|
|
54
|
-
children: popperOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
55
|
-
open: popperOpen,
|
|
56
|
-
placement: "right-start",
|
|
57
|
-
anchorEl: (0, _utils2.generateVirtualElement)(mousePosition),
|
|
58
|
-
style: {
|
|
59
|
-
pointerEvents: 'none'
|
|
60
|
-
},
|
|
80
|
+
children: popperOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(PopperComponent, (0, _extends2.default)({}, popperProps, {
|
|
61
81
|
children: trigger === 'item' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsItemTooltipContent.ChartsItemTooltipContent, {
|
|
62
82
|
itemData: displayedData,
|
|
63
|
-
content: itemContent,
|
|
83
|
+
content: slots?.itemContent ?? itemContent,
|
|
84
|
+
contentProps: slotProps?.itemContent,
|
|
64
85
|
sx: {
|
|
65
86
|
mx: 2
|
|
66
87
|
},
|
|
67
88
|
classes: classes
|
|
68
89
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisTooltipContent.ChartsAxisTooltipContent, {
|
|
69
90
|
axisData: displayedData,
|
|
70
|
-
content: axisContent,
|
|
91
|
+
content: slots?.axisContent ?? axisContent,
|
|
92
|
+
contentProps: slotProps?.axisContent,
|
|
71
93
|
sx: {
|
|
72
94
|
mx: 2
|
|
73
95
|
},
|
|
74
96
|
classes: classes
|
|
75
97
|
})
|
|
76
|
-
})
|
|
98
|
+
}))
|
|
77
99
|
});
|
|
78
100
|
}
|
|
79
101
|
process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
@@ -83,6 +105,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
83
105
|
// ----------------------------------------------------------------------
|
|
84
106
|
/**
|
|
85
107
|
* Component to override the tooltip content when triger is set to 'axis'.
|
|
108
|
+
* @deprecated Use slots.axisContent instead
|
|
86
109
|
*/
|
|
87
110
|
axisContent: _propTypes.default.elementType,
|
|
88
111
|
/**
|
|
@@ -91,8 +114,19 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
91
114
|
classes: _propTypes.default.object,
|
|
92
115
|
/**
|
|
93
116
|
* Component to override the tooltip content when triger is set to 'item'.
|
|
117
|
+
* @deprecated Use slots.itemContent instead
|
|
94
118
|
*/
|
|
95
119
|
itemContent: _propTypes.default.elementType,
|
|
120
|
+
/**
|
|
121
|
+
* The props used for each component slot.
|
|
122
|
+
* @default {}
|
|
123
|
+
*/
|
|
124
|
+
slotProps: _propTypes.default.object,
|
|
125
|
+
/**
|
|
126
|
+
* Overridable component slots.
|
|
127
|
+
* @default {}
|
|
128
|
+
*/
|
|
129
|
+
slots: _propTypes.default.object,
|
|
96
130
|
/**
|
|
97
131
|
* Select the kind of tooltip to display
|
|
98
132
|
* - 'item': Shows data about the item below the mouse.
|