@mui/x-charts 6.0.0-alpha.4 → 6.0.0-alpha.6
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.js +18 -10
- package/BarChart/formatter.js +23 -12
- package/CHANGELOG.md +156 -0
- package/ChartContainer/index.js +3 -0
- package/ChartsAxis/ChartsAxis.d.ts +4 -4
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/LineChart/AreaPlot.d.ts +1 -1
- package/LineChart/AreaPlot.js +4 -3
- package/LineChart/LineChart.js +18 -10
- package/LineChart/LinePlot.d.ts +1 -1
- package/LineChart/LinePlot.js +4 -3
- package/LineChart/MarkElement.js +1 -1
- package/LineChart/MarkPlot.d.ts +1 -1
- package/LineChart/MarkPlot.js +5 -3
- package/LineChart/formatter.js +23 -12
- package/PieChart/PieChart.js +13 -8
- package/ScatterChart/Scatter.js +39 -53
- package/ScatterChart/ScatterChart.js +13 -8
- package/SparkLineChart/SparkLineChart.d.ts +55 -0
- package/SparkLineChart/SparkLineChart.js +195 -0
- package/SparkLineChart/index.d.ts +1 -0
- package/SparkLineChart/index.js +12 -0
- package/SparkLineChart/package.json +6 -0
- package/context/CartesianContextProvider.d.ts +3 -1
- package/context/CartesianContextProvider.js +36 -6
- package/context/DrawingProvider.d.ts +1 -1
- package/context/DrawingProvider.js +1 -1
- package/context/SeriesContextProvider.d.ts +3 -2
- package/context/SeriesContextProvider.js +5 -3
- package/esm/BarChart/BarChart.js +21 -10
- package/esm/BarChart/formatter.js +23 -12
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/esm/LineChart/AreaPlot.js +4 -3
- package/esm/LineChart/LineChart.js +21 -10
- package/esm/LineChart/LinePlot.js +4 -3
- package/esm/LineChart/MarkElement.js +1 -1
- package/esm/LineChart/MarkPlot.js +4 -3
- package/esm/LineChart/formatter.js +23 -13
- package/esm/PieChart/PieChart.js +13 -8
- package/esm/ScatterChart/Scatter.js +39 -53
- package/esm/ScatterChart/ScatterChart.js +13 -8
- package/esm/SparkLineChart/SparkLineChart.js +187 -0
- package/esm/SparkLineChart/index.js +1 -0
- package/esm/context/CartesianContextProvider.js +36 -6
- package/esm/context/DrawingProvider.js +1 -1
- package/esm/context/SeriesContextProvider.js +5 -3
- package/esm/index.js +1 -0
- package/esm/models/index.js +3 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/defaultizeColor.d.ts +4 -2
- package/legacy/BarChart/BarChart.js +19 -10
- package/legacy/BarChart/formatter.js +23 -10
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +4 -4
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/legacy/LineChart/AreaPlot.js +4 -3
- package/legacy/LineChart/LineChart.js +19 -10
- package/legacy/LineChart/LinePlot.js +4 -3
- package/legacy/LineChart/MarkElement.js +1 -1
- package/legacy/LineChart/MarkPlot.js +4 -3
- package/legacy/LineChart/formatter.js +23 -11
- package/legacy/PieChart/PieChart.js +13 -8
- package/legacy/ScatterChart/Scatter.js +35 -46
- package/legacy/ScatterChart/ScatterChart.js +13 -8
- package/legacy/SparkLineChart/SparkLineChart.js +191 -0
- package/legacy/SparkLineChart/index.js +1 -0
- package/legacy/context/CartesianContextProvider.js +45 -7
- package/legacy/context/DrawingProvider.js +1 -1
- package/legacy/context/SeriesContextProvider.js +6 -4
- package/legacy/index.js +2 -1
- package/legacy/models/index.js +3 -1
- package/models/axis.d.ts +10 -2
- package/models/index.d.ts +2 -0
- package/models/index.js +11 -0
- package/models/seriesType/bar.d.ts +8 -1
- package/models/seriesType/common.d.ts +2 -2
- package/models/seriesType/config.d.ts +4 -1
- package/models/seriesType/line.d.ts +8 -1
- package/modern/BarChart/BarChart.js +18 -10
- package/modern/BarChart/formatter.js +23 -12
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/modern/LineChart/AreaPlot.js +4 -3
- package/modern/LineChart/LineChart.js +18 -10
- package/modern/LineChart/LinePlot.js +4 -3
- package/modern/LineChart/MarkElement.js +1 -1
- package/modern/LineChart/MarkPlot.js +4 -3
- package/modern/LineChart/formatter.js +23 -13
- package/modern/PieChart/PieChart.js +13 -8
- package/modern/ScatterChart/Scatter.js +39 -53
- package/modern/ScatterChart/ScatterChart.js +13 -8
- package/modern/SparkLineChart/SparkLineChart.js +187 -0
- package/modern/SparkLineChart/index.js +1 -0
- package/modern/context/CartesianContextProvider.js +36 -6
- package/modern/context/DrawingProvider.js +1 -1
- package/modern/context/SeriesContextProvider.js +5 -3
- package/modern/index.js +2 -1
- package/modern/models/index.js +3 -1
- package/package.json +3 -1
package/BarChart/BarChart.js
CHANGED
|
@@ -29,6 +29,7 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
29
29
|
height,
|
|
30
30
|
margin,
|
|
31
31
|
colors,
|
|
32
|
+
dataset,
|
|
32
33
|
sx,
|
|
33
34
|
tooltip,
|
|
34
35
|
axisHighlight,
|
|
@@ -53,11 +54,12 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
53
54
|
id: _constants.DEFAULT_X_AXIS_KEY,
|
|
54
55
|
scaleType: 'band',
|
|
55
56
|
data: Array.from({
|
|
56
|
-
length: Math.max(...series.map(s => s.data.length))
|
|
57
|
+
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
57
58
|
}, (_, index) => index)
|
|
58
59
|
}],
|
|
59
60
|
yAxis: yAxis,
|
|
60
61
|
colors: colors,
|
|
62
|
+
dataset: dataset,
|
|
61
63
|
sx: sx,
|
|
62
64
|
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
63
65
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
@@ -87,7 +89,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
87
89
|
}),
|
|
88
90
|
/**
|
|
89
91
|
* Indicate which axis to display the bottom of the charts.
|
|
90
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
92
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
91
93
|
* @default xAxisIds[0] The id of the first provided axis
|
|
92
94
|
*/
|
|
93
95
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -109,12 +111,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
109
111
|
* Color palette used to colorize multiple series.
|
|
110
112
|
*/
|
|
111
113
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
114
|
+
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
112
115
|
desc: _propTypes.default.string,
|
|
113
116
|
disableAxisListener: _propTypes.default.bool,
|
|
114
117
|
height: _propTypes.default.number,
|
|
115
118
|
/**
|
|
116
119
|
* Indicate which axis to display the left of the charts.
|
|
117
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
120
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
118
121
|
* @default yAxisIds[0] The id of the first provided axis
|
|
119
122
|
*/
|
|
120
123
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -154,7 +157,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
154
157
|
}),
|
|
155
158
|
/**
|
|
156
159
|
* Indicate which axis to display the right of the charts.
|
|
157
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
160
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
158
161
|
* @default null
|
|
159
162
|
*/
|
|
160
163
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -172,7 +175,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
172
175
|
}), _propTypes.default.string]),
|
|
173
176
|
series: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
174
177
|
color: _propTypes.default.string,
|
|
175
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number)
|
|
178
|
+
data: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
179
|
+
dataKey: _propTypes.default.string,
|
|
176
180
|
highlightScope: _propTypes.default.shape({
|
|
177
181
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
178
182
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
@@ -197,7 +201,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
197
201
|
}),
|
|
198
202
|
/**
|
|
199
203
|
* Indicate which axis to display the top of the charts.
|
|
200
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
204
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
201
205
|
* @default null
|
|
202
206
|
*/
|
|
203
207
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -224,15 +228,17 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
224
228
|
axisId: _propTypes.default.string,
|
|
225
229
|
classes: _propTypes.default.object,
|
|
226
230
|
data: _propTypes.default.array,
|
|
231
|
+
dataKey: _propTypes.default.string,
|
|
227
232
|
disableLine: _propTypes.default.bool,
|
|
228
233
|
disableTicks: _propTypes.default.bool,
|
|
229
234
|
fill: _propTypes.default.string,
|
|
235
|
+
hideTooltip: _propTypes.default.bool,
|
|
230
236
|
id: _propTypes.default.string,
|
|
231
237
|
label: _propTypes.default.string,
|
|
232
238
|
labelFontSize: _propTypes.default.number,
|
|
233
|
-
max: _propTypes.default.number,
|
|
239
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
234
240
|
maxTicks: _propTypes.default.number,
|
|
235
|
-
min: _propTypes.default.number,
|
|
241
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
236
242
|
minTicks: _propTypes.default.number,
|
|
237
243
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
238
244
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
@@ -246,15 +252,17 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
246
252
|
axisId: _propTypes.default.string,
|
|
247
253
|
classes: _propTypes.default.object,
|
|
248
254
|
data: _propTypes.default.array,
|
|
255
|
+
dataKey: _propTypes.default.string,
|
|
249
256
|
disableLine: _propTypes.default.bool,
|
|
250
257
|
disableTicks: _propTypes.default.bool,
|
|
251
258
|
fill: _propTypes.default.string,
|
|
259
|
+
hideTooltip: _propTypes.default.bool,
|
|
252
260
|
id: _propTypes.default.string,
|
|
253
261
|
label: _propTypes.default.string,
|
|
254
262
|
labelFontSize: _propTypes.default.number,
|
|
255
|
-
max: _propTypes.default.number,
|
|
263
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
256
264
|
maxTicks: _propTypes.default.number,
|
|
257
|
-
min: _propTypes.default.number,
|
|
265
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
258
266
|
minTicks: _propTypes.default.number,
|
|
259
267
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
260
268
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
package/BarChart/formatter.js
CHANGED
|
@@ -9,7 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _d3Shape = require("d3-shape");
|
|
10
10
|
var _stackSeries = require("../internals/stackSeries");
|
|
11
11
|
var _defaultizeValueFormatter = _interopRequireDefault(require("../internals/defaultizeValueFormatter"));
|
|
12
|
-
const formatter = params => {
|
|
12
|
+
const formatter = (params, dataset) => {
|
|
13
13
|
const {
|
|
14
14
|
seriesOrder,
|
|
15
15
|
series
|
|
@@ -17,17 +17,22 @@ const formatter = params => {
|
|
|
17
17
|
const stackingGroups = (0, _stackSeries.getStackingGroups)(params);
|
|
18
18
|
|
|
19
19
|
// Create a data set with format adapted to d3
|
|
20
|
-
const d3Dataset = [];
|
|
20
|
+
const d3Dataset = dataset ?? [];
|
|
21
21
|
seriesOrder.forEach(id => {
|
|
22
|
-
series[id].data
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
const data = series[id].data;
|
|
23
|
+
if (data !== undefined) {
|
|
24
|
+
data.forEach((value, index) => {
|
|
25
|
+
if (d3Dataset.length <= index) {
|
|
26
|
+
d3Dataset.push({
|
|
27
|
+
[id]: value
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
d3Dataset[index][id] = value;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
} else if (dataset === undefined) {
|
|
34
|
+
throw new Error([`MUI: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
35
|
+
}
|
|
31
36
|
});
|
|
32
37
|
const completedSeries = {};
|
|
33
38
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -37,9 +42,15 @@ const formatter = params => {
|
|
|
37
42
|
stackingOrder
|
|
38
43
|
} = stackingGroup;
|
|
39
44
|
// Get stacked values, and derive the domain
|
|
40
|
-
const stackedSeries = (0, _d3Shape.stack)().keys(ids
|
|
45
|
+
const stackedSeries = (0, _d3Shape.stack)().keys(ids.map(id => {
|
|
46
|
+
// Use dataKey if needed and available
|
|
47
|
+
const dataKey = series[id].dataKey;
|
|
48
|
+
return series[id].data === undefined && dataKey !== undefined ? dataKey : id;
|
|
49
|
+
})).order(stackingOrder).offset(stackingOffset)(d3Dataset);
|
|
41
50
|
ids.forEach((id, index) => {
|
|
51
|
+
const dataKey = series[id].dataKey;
|
|
42
52
|
completedSeries[id] = (0, _extends2.default)({}, series[id], {
|
|
53
|
+
data: dataKey ? dataset.map(d => d[dataKey]) : series[id].data,
|
|
43
54
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
44
55
|
});
|
|
45
56
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,162 @@
|
|
|
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.11.0
|
|
7
|
+
|
|
8
|
+
_Aug 4, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- ⌚️ Move the tree view component from `@mui/lab` package
|
|
13
|
+
|
|
14
|
+
The `<TreeView />` component has been moved to the MUI X repository.
|
|
15
|
+
It is now accessible from its own package: `@mui/x-tree-view`.
|
|
16
|
+
|
|
17
|
+
- 🌍 Improve Hebrew (he-IL), Finnish (fi-FI), and Italian (it-IT) locales on the data grid
|
|
18
|
+
- 🐞 Bugfixes
|
|
19
|
+
- 📚 Documentation improvements
|
|
20
|
+
|
|
21
|
+
### Data Grid
|
|
22
|
+
|
|
23
|
+
#### `@mui/x-data-grid@v6.11.0`
|
|
24
|
+
|
|
25
|
+
- [DataGrid] Add `ariaV7` experimental flag (#9496) @cherniavskii
|
|
26
|
+
- [DataGrid] Fix cell size when column width is set to `undefined` (#9871) @gitstart
|
|
27
|
+
- [l10n] Improve Hebrew (he-IL) locale (#9820) @itayG98
|
|
28
|
+
- [l10n] Improve Finnish (fi-FI) locale (#9848) @sambbaahh
|
|
29
|
+
- [l10n] Improve Italian (it-IT) locale (#9627) @fabio-rizzello-omnia
|
|
30
|
+
|
|
31
|
+
#### `@mui/x-data-grid-pro@v6.11.0` [](https://mui.com/r/x-pro-svg-link)
|
|
32
|
+
|
|
33
|
+
Same changes as in `@mui/x-data-grid@v6.11.0`.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid-premium@v6.11.0` [](https://mui.com/r/x-premium-svg-link)
|
|
36
|
+
|
|
37
|
+
Same changes as in `@mui/x-data-grid-pro@v6.11.0`.
|
|
38
|
+
|
|
39
|
+
### Date Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@v6.11.0`
|
|
42
|
+
|
|
43
|
+
- [fields] Correctly handle events with a complete value insertion (#9896) @LukasTy
|
|
44
|
+
- [fields] Fix hours editing on dayjs with timezone and DST (#9901) @flaviendelangle
|
|
45
|
+
- [fields] Fix section clearing with timezone (#9819) @flaviendelangle
|
|
46
|
+
- [pickers] Add `CalendarHeader` slot (#7784) @flaviendelangle
|
|
47
|
+
- [pickers] Allow to override the `InputProps` of the `TextField` using the `slotProps` (#9849) @flaviendelangle
|
|
48
|
+
- [pickers] Allow to override the opening aria text using the `localeText` prop on the pickers (#9870) @flaviendelangle
|
|
49
|
+
- [pickers] Fix `sx` and `className` props on `MobileDateRangePicker` (#9853) @flaviendelangle
|
|
50
|
+
- [pickers] Fix default descriptions (#9887) @LukasTy
|
|
51
|
+
- [pickers] Fix offset management on dayjs adapter (#9884) @flaviendelangle
|
|
52
|
+
- [pickers] Use device motion reduction preference (#9823) @LukasTy
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@v6.11.0` [](https://mui.com/r/x-pro-svg-link)
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@v6.11.0`.
|
|
57
|
+
|
|
58
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.6`
|
|
59
|
+
|
|
60
|
+
- [charts] Add TS definition to the exported elements (#9885) @alexfauquette
|
|
61
|
+
- [charts] Add sparkline (#9662) @alexfauquette
|
|
62
|
+
- [charts] Fix missing configuration types (#9886) @alexfauquette
|
|
63
|
+
- [charts] Introduce dataset to simplify plot of data from API (#9774) @alexfauquette
|
|
64
|
+
|
|
65
|
+
### Tree View / `@mui/x-tree-view@v6.0.0-alpha.0`
|
|
66
|
+
|
|
67
|
+
- [TreeView] Add missing exported types (#9862) @flaviendelangle
|
|
68
|
+
- [TreeView] Add tree view to changelog generator script (#9903) @MBilalShafi
|
|
69
|
+
- [TreeView] Create the package on the X repository (#9798) @flaviendelangle
|
|
70
|
+
- [TreeView] Improve props typing (#9855) @flaviendelangle
|
|
71
|
+
|
|
72
|
+
### Docs
|
|
73
|
+
|
|
74
|
+
- [docs] Add Tree View doc (#9825) @flaviendelangle
|
|
75
|
+
- [docs] Add charts nav item (#9821) @LukasTy
|
|
76
|
+
- [docs] Add charts to MUI X introduction pages (#9704) @joserodolfofreitas
|
|
77
|
+
- [docs] Add example for avoiding picker views layout shift (#9781) @noraleonte
|
|
78
|
+
- [docs] Consistency of Next.js App Router @oliviertassinari
|
|
79
|
+
- [docs] Fix API page regression: bring back slots section (#9866) @alexfauquette
|
|
80
|
+
- [docs] Fix demo using Pro while it's MIT (#9842) @oliviertassinari
|
|
81
|
+
- [docs] Get ready for next docs-infra change @oliviertassinari
|
|
82
|
+
- [docs] Improve the slots documentation `Recommended usage` section (#9892) @flaviendelangle
|
|
83
|
+
|
|
84
|
+
### Core
|
|
85
|
+
|
|
86
|
+
- [core] Fix font loading issue dev-mode (#9843) @oliviertassinari
|
|
87
|
+
- [core] Fix pipeline (#9894) @LukasTy
|
|
88
|
+
- [core] Fix the link-check script on Windows (#9888) @alexfauquette
|
|
89
|
+
- [core] Fix v7 capitalization (#9878) @oliviertassinari
|
|
90
|
+
- [core] Regen doc (#9902) @flaviendelangle
|
|
91
|
+
- [core] Remove benchmark package (#9413) @LukasTy
|
|
92
|
+
- [core] Stop using the deprecated `JSX` global namespace (#9854) @flaviendelangle
|
|
93
|
+
- [core] Update monorepo (#9846) @flaviendelangle
|
|
94
|
+
- [core] Update tree data API docs (#9827) @cherniavskii
|
|
95
|
+
- [test] Add pickers e2e tests (#9747) @LukasTy
|
|
96
|
+
- [test] Data grid e2e tests follow-up (#9822) @cherniavskii
|
|
97
|
+
|
|
98
|
+
## 6.10.2
|
|
99
|
+
|
|
100
|
+
_Jul 27, 2023_
|
|
101
|
+
|
|
102
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
103
|
+
|
|
104
|
+
- 🚀 Improve scatter charts performance
|
|
105
|
+
- 📚 Redesigned component API documentation and side navigation
|
|
106
|
+
- 🐞 Bugfixes
|
|
107
|
+
|
|
108
|
+
### Data Grid
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-data-grid@v6.10.2`
|
|
111
|
+
|
|
112
|
+
- [DataGrid] Fix quick filter & aggregation error (#9729) @romgrk
|
|
113
|
+
- [DataGrid] Fix row click propagation causing error in nested grid (#9741) @cherniavskii
|
|
114
|
+
- [DataGrid] Keep focused cell in the DOM (#7357) @yaredtsy
|
|
115
|
+
- [l10n] Improve Finnish (fi-FI) locale (#9746) @sambbaahh
|
|
116
|
+
|
|
117
|
+
#### `@mui/x-data-grid-pro@v6.10.2` [](https://mui.com/r/x-pro-svg-link)
|
|
118
|
+
|
|
119
|
+
Same changes as in `@mui/x-data-grid@v6.10.2`.
|
|
120
|
+
|
|
121
|
+
#### `@mui/x-data-grid-premium@v6.10.2` [](https://mui.com/r/x-premium-svg-link)
|
|
122
|
+
|
|
123
|
+
Same changes as in `@mui/x-data-grid-pro@v6.10.2`, plus:
|
|
124
|
+
|
|
125
|
+
- [DataGridPremium] Allow to customize grouping cell offset (#9417) @cherniavskii
|
|
126
|
+
|
|
127
|
+
### Date Pickers
|
|
128
|
+
|
|
129
|
+
#### `@mui/x-date-pickers@v6.10.2`
|
|
130
|
+
|
|
131
|
+
- [pickers] Remove the `endOfDate` from `DigitalClock` timeOptions (#9800) @noraleonte
|
|
132
|
+
|
|
133
|
+
#### `@mui/x-date-pickers-pro@v6.10.2` [](https://mui.com/r/x-pro-svg-link)
|
|
134
|
+
|
|
135
|
+
Same changes as in `@mui/x-date-pickers@v6.10.2`.
|
|
136
|
+
|
|
137
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.5`
|
|
138
|
+
|
|
139
|
+
- [charts] Improve JSDoc for axis-related props (#9779) @flaviendelangle
|
|
140
|
+
- [charts] Improve performances of Scatter component (#9527) @flaviendelangle
|
|
141
|
+
|
|
142
|
+
### Docs
|
|
143
|
+
|
|
144
|
+
- [docs] Add `pnpm` in more places @oliviertassinari
|
|
145
|
+
- [docs] Add `pnpm` installation instructions for MUI X (#9707) @richbustos
|
|
146
|
+
- [docs] Align pickers "uncontrolled vs controlled" sections (#9772) @LukasTy
|
|
147
|
+
- [docs] Apply style guide to the data grid Layout page (#9673) @richbustos
|
|
148
|
+
- [docs] Differentiate between packages in `slotProps` docs (#9668) @cherniavskii
|
|
149
|
+
- [docs] Fix charts width in axis pages (#9801) @alexfauquette
|
|
150
|
+
- [docs] Fix wrong prop name in the Editing page (#9753) @m4theushw
|
|
151
|
+
- [docs] New component API page and side nav design (#9187) @alexfauquette
|
|
152
|
+
- [docs] Update overview page with up to date information about the plans (#9512) @joserodolfofreitas
|
|
153
|
+
|
|
154
|
+
### Core
|
|
155
|
+
|
|
156
|
+
- [core] Use PR charts version in preview (#9787) @alexfauquette
|
|
157
|
+
- [license] Allow overriding the license on specific parts of the page (#9717) @Janpot
|
|
158
|
+
- [license] Throw in dev mode after 30 days (#9701) @oliviertassinari
|
|
159
|
+
- [license] Only throw in dev mode (#9803) @oliviertassinari
|
|
160
|
+
- [test] Fail the CI when new unexpected files are created (#9728) @oliviertassinari
|
|
161
|
+
|
|
6
162
|
## 6.10.1
|
|
7
163
|
|
|
8
164
|
_Jul 20, 2023_
|
package/ChartContainer/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
|
|
|
25
25
|
xAxis,
|
|
26
26
|
yAxis,
|
|
27
27
|
colors,
|
|
28
|
+
dataset,
|
|
28
29
|
sx,
|
|
29
30
|
title,
|
|
30
31
|
desc,
|
|
@@ -41,9 +42,11 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
|
|
|
41
42
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SeriesContextProvider.SeriesContextProvider, {
|
|
42
43
|
series: series,
|
|
43
44
|
colors: colors,
|
|
45
|
+
dataset: dataset,
|
|
44
46
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianContextProvider.CartesianContextProvider, {
|
|
45
47
|
xAxis: xAxis,
|
|
46
48
|
yAxis: yAxis,
|
|
49
|
+
dataset: dataset,
|
|
47
50
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InteractionProvider.InteractionProvider, {
|
|
48
51
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlightProvider.HighlightProvider, {
|
|
49
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, {
|
|
@@ -3,25 +3,25 @@ import { ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
|
3
3
|
export interface ChartsAxisProps {
|
|
4
4
|
/**
|
|
5
5
|
* Indicate which axis to display the top of the charts.
|
|
6
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
6
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
7
7
|
* @default null
|
|
8
8
|
*/
|
|
9
9
|
topAxis?: null | string | ChartsXAxisProps;
|
|
10
10
|
/**
|
|
11
11
|
* Indicate which axis to display the bottom of the charts.
|
|
12
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
12
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
13
13
|
* @default xAxisIds[0] The id of the first provided axis
|
|
14
14
|
*/
|
|
15
15
|
bottomAxis?: null | string | ChartsXAxisProps;
|
|
16
16
|
/**
|
|
17
17
|
* Indicate which axis to display the left of the charts.
|
|
18
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
18
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
19
19
|
* @default yAxisIds[0] The id of the first provided axis
|
|
20
20
|
*/
|
|
21
21
|
leftAxis?: null | string | ChartsYAxisProps;
|
|
22
22
|
/**
|
|
23
23
|
* Indicate which axis to display the right of the charts.
|
|
24
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
24
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
25
25
|
* @default null
|
|
26
26
|
*/
|
|
27
27
|
rightAxis?: null | string | ChartsYAxisProps;
|
package/ChartsAxis/ChartsAxis.js
CHANGED
|
@@ -79,7 +79,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
79
79
|
// ----------------------------------------------------------------------
|
|
80
80
|
/**
|
|
81
81
|
* Indicate which axis to display the bottom of the charts.
|
|
82
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
82
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
83
83
|
* @default xAxisIds[0] The id of the first provided axis
|
|
84
84
|
*/
|
|
85
85
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -97,7 +97,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
97
97
|
}), _propTypes.default.string]),
|
|
98
98
|
/**
|
|
99
99
|
* Indicate which axis to display the left of the charts.
|
|
100
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
100
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
101
101
|
* @default yAxisIds[0] The id of the first provided axis
|
|
102
102
|
*/
|
|
103
103
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -115,7 +115,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
115
115
|
}), _propTypes.default.string]),
|
|
116
116
|
/**
|
|
117
117
|
* Indicate which axis to display the right of the charts.
|
|
118
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
118
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
119
119
|
* @default null
|
|
120
120
|
*/
|
|
121
121
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -133,7 +133,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
133
133
|
}), _propTypes.default.string]),
|
|
134
134
|
/**
|
|
135
135
|
* Indicate which axis to display the top of the charts.
|
|
136
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
136
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
137
137
|
* @default null
|
|
138
138
|
*/
|
|
139
139
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -32,7 +32,7 @@ function DefaultChartsAxisContent(props) {
|
|
|
32
32
|
variant: "outlined",
|
|
33
33
|
className: classes.root,
|
|
34
34
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsTooltipTable.ChartsTooltipTable, {
|
|
35
|
-
children: [axisValue != null && /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
35
|
+
children: [axisValue != null && !axis.hideTooltip && /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
36
36
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipRow, {
|
|
37
37
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltipTable.ChartsTooltipCell, {
|
|
38
38
|
colSpan: 3,
|
package/LineChart/AreaPlot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function AreaPlot(): React.JSX.Element | null;
|
|
2
|
+
export declare function AreaPlot(props: React.SVGAttributes<SVGSVGElement>): React.JSX.Element | null;
|
package/LineChart/AreaPlot.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.AreaPlot = AreaPlot;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _d3Shape = require("d3-shape");
|
|
10
11
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
@@ -15,7 +16,7 @@ var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
|
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
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); }
|
|
17
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; }
|
|
18
|
-
function AreaPlot() {
|
|
19
|
+
function AreaPlot(props) {
|
|
19
20
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).line;
|
|
20
21
|
const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
|
|
21
22
|
if (seriesData === undefined) {
|
|
@@ -33,7 +34,7 @@ function AreaPlot() {
|
|
|
33
34
|
} = axisData;
|
|
34
35
|
const defaultXAxisId = xAxisIds[0];
|
|
35
36
|
const defaultYAxisId = yAxisIds[0];
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, props, {
|
|
37
38
|
children: stackingGroups.flatMap(({
|
|
38
39
|
ids: groupIds
|
|
39
40
|
}) => {
|
|
@@ -63,5 +64,5 @@ function AreaPlot() {
|
|
|
63
64
|
}, seriesId);
|
|
64
65
|
});
|
|
65
66
|
})
|
|
66
|
-
});
|
|
67
|
+
}));
|
|
67
68
|
}
|
package/LineChart/LineChart.js
CHANGED
|
@@ -31,6 +31,7 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
31
31
|
height,
|
|
32
32
|
margin,
|
|
33
33
|
colors,
|
|
34
|
+
dataset,
|
|
34
35
|
sx,
|
|
35
36
|
tooltip,
|
|
36
37
|
axisHighlight = {
|
|
@@ -57,11 +58,12 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
|
|
|
57
58
|
id: _constants.DEFAULT_X_AXIS_KEY,
|
|
58
59
|
scaleType: 'point',
|
|
59
60
|
data: Array.from({
|
|
60
|
-
length: Math.max(...series.map(s => s.data.length))
|
|
61
|
+
length: Math.max(...series.map(s => (s.data ?? dataset ?? []).length))
|
|
61
62
|
}, (_, index) => index)
|
|
62
63
|
}],
|
|
63
64
|
yAxis: yAxis,
|
|
64
65
|
colors: colors,
|
|
66
|
+
dataset: dataset,
|
|
65
67
|
sx: sx,
|
|
66
68
|
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
67
69
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
@@ -89,7 +91,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
89
91
|
}),
|
|
90
92
|
/**
|
|
91
93
|
* Indicate which axis to display the bottom of the charts.
|
|
92
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
94
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
93
95
|
* @default xAxisIds[0] The id of the first provided axis
|
|
94
96
|
*/
|
|
95
97
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -111,12 +113,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
111
113
|
* Color palette used to colorize multiple series.
|
|
112
114
|
*/
|
|
113
115
|
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
116
|
+
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
114
117
|
desc: _propTypes.default.string,
|
|
115
118
|
disableAxisListener: _propTypes.default.bool,
|
|
116
119
|
height: _propTypes.default.number,
|
|
117
120
|
/**
|
|
118
121
|
* Indicate which axis to display the left of the charts.
|
|
119
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
122
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
120
123
|
* @default yAxisIds[0] The id of the first provided axis
|
|
121
124
|
*/
|
|
122
125
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -156,7 +159,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
156
159
|
}),
|
|
157
160
|
/**
|
|
158
161
|
* Indicate which axis to display the right of the charts.
|
|
159
|
-
* Can be a string (the id of the axis) or an object `ChartsYAxisProps
|
|
162
|
+
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
160
163
|
* @default null
|
|
161
164
|
*/
|
|
162
165
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -176,7 +179,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
176
179
|
area: _propTypes.default.bool,
|
|
177
180
|
color: _propTypes.default.string,
|
|
178
181
|
curve: _propTypes.default.oneOf(['catmullRom', 'linear', 'monotoneX', 'monotoneY', 'natural', 'step', 'stepAfter', 'stepBefore']),
|
|
179
|
-
data: _propTypes.default.arrayOf(_propTypes.default.number)
|
|
182
|
+
data: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
183
|
+
dataKey: _propTypes.default.string,
|
|
180
184
|
highlightScope: _propTypes.default.shape({
|
|
181
185
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
182
186
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
@@ -201,7 +205,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
201
205
|
}),
|
|
202
206
|
/**
|
|
203
207
|
* Indicate which axis to display the top of the charts.
|
|
204
|
-
* Can be a string (the id of the axis) or an object `ChartsXAxisProps
|
|
208
|
+
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
205
209
|
* @default null
|
|
206
210
|
*/
|
|
207
211
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
@@ -228,15 +232,17 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
228
232
|
axisId: _propTypes.default.string,
|
|
229
233
|
classes: _propTypes.default.object,
|
|
230
234
|
data: _propTypes.default.array,
|
|
235
|
+
dataKey: _propTypes.default.string,
|
|
231
236
|
disableLine: _propTypes.default.bool,
|
|
232
237
|
disableTicks: _propTypes.default.bool,
|
|
233
238
|
fill: _propTypes.default.string,
|
|
239
|
+
hideTooltip: _propTypes.default.bool,
|
|
234
240
|
id: _propTypes.default.string,
|
|
235
241
|
label: _propTypes.default.string,
|
|
236
242
|
labelFontSize: _propTypes.default.number,
|
|
237
|
-
max: _propTypes.default.number,
|
|
243
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
238
244
|
maxTicks: _propTypes.default.number,
|
|
239
|
-
min: _propTypes.default.number,
|
|
245
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
240
246
|
minTicks: _propTypes.default.number,
|
|
241
247
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
242
248
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
@@ -250,15 +256,17 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
250
256
|
axisId: _propTypes.default.string,
|
|
251
257
|
classes: _propTypes.default.object,
|
|
252
258
|
data: _propTypes.default.array,
|
|
259
|
+
dataKey: _propTypes.default.string,
|
|
253
260
|
disableLine: _propTypes.default.bool,
|
|
254
261
|
disableTicks: _propTypes.default.bool,
|
|
255
262
|
fill: _propTypes.default.string,
|
|
263
|
+
hideTooltip: _propTypes.default.bool,
|
|
256
264
|
id: _propTypes.default.string,
|
|
257
265
|
label: _propTypes.default.string,
|
|
258
266
|
labelFontSize: _propTypes.default.number,
|
|
259
|
-
max: _propTypes.default.number,
|
|
267
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
260
268
|
maxTicks: _propTypes.default.number,
|
|
261
|
-
min: _propTypes.default.number,
|
|
269
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
262
270
|
minTicks: _propTypes.default.number,
|
|
263
271
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
264
272
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
package/LineChart/LinePlot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function LinePlot(): React.JSX.Element | null;
|
|
2
|
+
export declare function LinePlot(props: React.SVGAttributes<SVGSVGElement>): React.JSX.Element | null;
|
package/LineChart/LinePlot.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LinePlot = LinePlot;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var React = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _d3Shape = require("d3-shape");
|
|
10
11
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
@@ -15,7 +16,7 @@ var _getCurve = _interopRequireDefault(require("../internals/getCurve"));
|
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
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); }
|
|
17
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; }
|
|
18
|
-
function LinePlot() {
|
|
19
|
+
function LinePlot(props) {
|
|
19
20
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).line;
|
|
20
21
|
const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
|
|
21
22
|
if (seriesData === undefined) {
|
|
@@ -33,7 +34,7 @@ function LinePlot() {
|
|
|
33
34
|
} = axisData;
|
|
34
35
|
const defaultXAxisId = xAxisIds[0];
|
|
35
36
|
const defaultYAxisId = yAxisIds[0];
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, props, {
|
|
37
38
|
children: stackingGroups.flatMap(({
|
|
38
39
|
ids: groupIds
|
|
39
40
|
}) => {
|
|
@@ -63,5 +64,5 @@ function LinePlot() {
|
|
|
63
64
|
}, seriesId);
|
|
64
65
|
});
|
|
65
66
|
})
|
|
66
|
-
});
|
|
67
|
+
}));
|
|
67
68
|
}
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -50,7 +50,7 @@ const MarkElementPath = (0, _styles.styled)('path', {
|
|
|
50
50
|
}) => ({
|
|
51
51
|
transform: `translate(${ownerState.x}px, ${ownerState.y}px)`,
|
|
52
52
|
transformOrigin: `${ownerState.x}px ${ownerState.y}px`,
|
|
53
|
-
fill:
|
|
53
|
+
fill: theme.palette.background.paper,
|
|
54
54
|
stroke: ownerState.color,
|
|
55
55
|
strokeWidth: 2,
|
|
56
56
|
'&.MuiMarkElement-highlighted': {
|
package/LineChart/MarkPlot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function MarkPlot(): React.JSX.Element | null;
|
|
2
|
+
export declare function MarkPlot(props: React.SVGAttributes<SVGSVGElement>): React.JSX.Element | null;
|