@mui/x-charts 6.18.1 → 7.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +8 -8
- package/BarChart/BarPlot.d.ts +2 -2
- package/CHANGELOG.md +149 -0
- package/ChartsAxis/ChartsAxis.d.ts +3 -3
- package/ChartsLegend/ChartsLegend.d.ts +9 -6
- package/ChartsLegend/ChartsLegend.js +136 -1
- package/ChartsTooltip/ChartsTooltip.d.ts +4 -4
- package/LineChart/AreaPlot.d.ts +2 -2
- package/LineChart/LineChart.d.ts +11 -11
- package/LineChart/LineHighlightPlot.d.ts +4 -4
- package/LineChart/LinePlot.d.ts +2 -2
- package/LineChart/MarkPlot.d.ts +4 -4
- package/PieChart/PieArcLabelPlot.d.ts +4 -4
- package/PieChart/PieArcPlot.d.ts +4 -4
- package/PieChart/PieChart.d.ts +8 -8
- package/PieChart/PiePlot.d.ts +6 -6
- package/ScatterChart/ScatterChart.d.ts +8 -8
- package/ScatterChart/ScatterPlot.d.ts +4 -4
- package/SparkLineChart/SparkLineChart.d.ts +10 -10
- package/esm/ChartsLegend/ChartsLegend.js +138 -2
- package/esm/index.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/legacy/ChartsLegend/ChartsLegend.js +138 -2
- package/legacy/index.js +2 -1
- package/models/axis.d.ts +4 -4
- package/modern/ChartsLegend/ChartsLegend.js +138 -2
- package/modern/index.js +2 -1
- package/package.json +1 -1
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BarPlotProps,
|
|
2
|
+
import { BarPlotProps, BarPlotSlotProps, BarPlotSlots } from './BarPlot';
|
|
3
3
|
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,
|
|
8
|
-
import { ChartsLegendProps,
|
|
7
|
+
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
8
|
+
import { ChartsLegendProps, ChartsLegendSlots, ChartsLegendSlotProps } from '../ChartsLegend';
|
|
9
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
|
-
import {
|
|
11
|
-
export interface
|
|
10
|
+
import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
|
|
11
|
+
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
14
14
|
}
|
|
15
15
|
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<BarPlotProps, 'skipAnimation'> {
|
|
16
16
|
series: MakeOptional<BarSeriesType, 'type'>[];
|
|
@@ -31,12 +31,12 @@ export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'seri
|
|
|
31
31
|
* Overridable component slots.
|
|
32
32
|
* @default {}
|
|
33
33
|
*/
|
|
34
|
-
slots?:
|
|
34
|
+
slots?: BarChartSlots;
|
|
35
35
|
/**
|
|
36
36
|
* The props used for each component slot.
|
|
37
37
|
* @default {}
|
|
38
38
|
*/
|
|
39
|
-
slotProps?:
|
|
39
|
+
slotProps?: BarChartSlotProps;
|
|
40
40
|
layout?: BarSeriesType['layout'];
|
|
41
41
|
}
|
|
42
42
|
/**
|
package/BarChart/BarPlot.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BarElementProps } from './BarElement';
|
|
3
|
-
export interface
|
|
3
|
+
export interface BarPlotSlots {
|
|
4
4
|
bar?: React.JSXElementConstructor<BarElementProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface BarPlotSlotProps {
|
|
7
7
|
bar?: Partial<BarElementProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface BarPlotProps extends Pick<BarElementProps, 'slots' | 'slotProps'> {
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,155 @@
|
|
|
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
|
+
## 7.0.0-alpha.0
|
|
7
|
+
|
|
8
|
+
_Nov 10, 2023_
|
|
9
|
+
|
|
10
|
+
We're thrilled to announce the first alpha release of our next major version, v7.
|
|
11
|
+
This release introduces a few breaking changes, paving the way for the upcoming features like Pivoting and DateTimeRangePicker.
|
|
12
|
+
|
|
13
|
+
A special shoutout to thank the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
14
|
+
|
|
15
|
+
- 🚀 First v7 alpha release
|
|
16
|
+
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
17
|
+
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/)
|
|
18
|
+
- 💫 New recipes added for the data grid
|
|
19
|
+
- 📈 `<ChartsReferenceLine />` component is now available
|
|
20
|
+
- 🌍 Add Basque (eu) locale, improve Czech (cs-CZ) and Spanish (es-ES) locales
|
|
21
|
+
- 🐞 Bugfixes
|
|
22
|
+
- 📚 Documentation improvements
|
|
23
|
+
|
|
24
|
+
### Data Grid
|
|
25
|
+
|
|
26
|
+
#### Breaking changes
|
|
27
|
+
|
|
28
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead. See [components section](/x/react-data-grid/components/) for more details.
|
|
29
|
+
- The print export will now only print the selected rows if there are any.
|
|
30
|
+
If there are no selected rows, it will print all rows. This makes the print export consistent with the other exports.
|
|
31
|
+
You can [customize the rows to export by using the `getRowsToExport` function](/x/react-data-grid/export/#customizing-the-rows-to-export).
|
|
32
|
+
- The `getApplyFilterFnV7` in `GridFilterOperator` was renamed to `getApplyFilterFn`.
|
|
33
|
+
If you use `getApplyFilterFnV7` directly - rename it to `getApplyFilterFn`.
|
|
34
|
+
- The signature of the function returned by `getApplyFilterFn` has changed for performance reasons:
|
|
35
|
+
|
|
36
|
+
```diff
|
|
37
|
+
const getApplyFilterFn: GetApplyFilterFn<any, unknown> = (filterItem) => {
|
|
38
|
+
if (!filterItem.value) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');
|
|
42
|
+
- return (cellParams) => {
|
|
43
|
+
- const { value } = cellParams;
|
|
44
|
+
+ return (value, row, colDef, apiRef) => {
|
|
45
|
+
return value != null ? filterRegex.test(String(value)) : false;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- The `getApplyQuickFilterFnV7` in `GridColDef` was renamed to `getApplyQuickFilterFn`.
|
|
51
|
+
If you use `getApplyQuickFilterFnV7` directly - rename it to `getApplyQuickFilterFn`.
|
|
52
|
+
- The signature of the function returned by `getApplyQuickFilterFn` has changed for performance reasons:
|
|
53
|
+
|
|
54
|
+
```diff
|
|
55
|
+
const getGridStringQuickFilterFn: GetApplyQuickFilterFn<any, unknown> = (value) => {
|
|
56
|
+
if (!value) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const filterRegex = new RegExp(escapeRegExp(value), 'i');
|
|
60
|
+
- return (cellParams) => {
|
|
61
|
+
- const { formattedValue } = cellParams;
|
|
62
|
+
+ return (value, row, column, apiRef) => {
|
|
63
|
+
+ let formattedValue = apiRef.current.getRowFormattedValue(row, column);
|
|
64
|
+
return formattedValue != null ? filterRegex.test(formattedValue.toString()) : false;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### `@mui/x-data-grid@7.0.0-alpha.0`
|
|
70
|
+
|
|
71
|
+
- [DataGrid] Fix for error thrown when removing skeleton rows, after sorting is applied (#10807) @benjaminbialy
|
|
72
|
+
- [DataGrid] Fix: `undefined` slot value (#10937) @romgrk
|
|
73
|
+
- [DataGrid] Print selected rows by default (#10846) @cherniavskii
|
|
74
|
+
- [DataGrid] Remove deprecated `components` and `componentsProps` (#10911) @MBilalShafi
|
|
75
|
+
- [DataGrid] Remove legacy filtering API (#10897) @cherniavskii
|
|
76
|
+
- [DataGrid] Fix keyboard navigation for actions cell with disabled buttons (#10882) @michelengelen
|
|
77
|
+
- [DataGrid] Added a recipe for using non-native select in filter panel (#10916) @michelengelen
|
|
78
|
+
- [DataGrid] Added a recipe to style cells without impacting the aggregation cells (#10913) @michelengelen
|
|
79
|
+
- [l10n] Improve Czech (cs-CZ) locale (#10949) @luborepka
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-data-grid-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-data-grid@7.0.0-alpha.0`, plus:
|
|
84
|
+
|
|
85
|
+
- [DataGridPro] Autosize Columns - Fix headers being cut off (#10666) @gitstart
|
|
86
|
+
- [DataGridPro] Add data source interface and basic documentation (#10543) @MBilalShafi
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-data-grid-premium@7.0.0-alpha.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [DataGridPremium] Render aggregation label when `renderHeader` is used (#10936) @cherniavskii
|
|
93
|
+
|
|
94
|
+
### Date Pickers
|
|
95
|
+
|
|
96
|
+
#### Breaking changes
|
|
97
|
+
|
|
98
|
+
- The deprecated `components` and `componentsProps` props have been removed. Use `slots` and `slotProps` instead.
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-date-pickers@7.0.0-alpha.0`
|
|
101
|
+
|
|
102
|
+
- [pickers] Escape non tokens words (#10400) @alexfauquette
|
|
103
|
+
- [fields] Fix `MultiInputTimeRangeField` section selection (#10922) @noraleonte
|
|
104
|
+
- [pickers] Refine `referenceDate` behavior in views (#10863) @LukasTy
|
|
105
|
+
- [pickers] Remove `components` and `componentsProps` props (#10700) @alexfauquette
|
|
106
|
+
- [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10819) @lajtomekadimon
|
|
107
|
+
- [pickers] Add short weekdays token (#10988) @alexfauquette
|
|
108
|
+
|
|
109
|
+
#### `@mui/x-date-pickers-pro@7.0.0-alpha.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
110
|
+
|
|
111
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-alpha.0`.
|
|
112
|
+
|
|
113
|
+
### Charts / `@mui/x-charts@7.0.0-alpha.0`
|
|
114
|
+
|
|
115
|
+
#### Breaking changes
|
|
116
|
+
|
|
117
|
+
Types for `slots` and `slotProps` got renamed by removing the "Component" which is meaningless for charts.
|
|
118
|
+
Unless you imported those types, to create a wrapper, you should not be impacted by this breaking change.
|
|
119
|
+
|
|
120
|
+
Here is an example of the renaming for the `<ChartsTooltip />` component.
|
|
121
|
+
|
|
122
|
+
```diff
|
|
123
|
+
-ChartsTooltipSlotsComponent
|
|
124
|
+
+ChartsTooltipSlots
|
|
125
|
+
|
|
126
|
+
-ChartsTooltipSlotComponentProps
|
|
127
|
+
+ChartsTooltipSlotProps
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
- [charts] Add `<ChartsReferenceLine />` component (#10597) (#10946) @alexfauquette
|
|
131
|
+
- [charts] Improve properties JSDoc (#10931) (#10955) @alexfauquette
|
|
132
|
+
- [charts] Rename `slots` and `slotProps` types (#10875) @alexfauquette
|
|
133
|
+
|
|
134
|
+
### `@mui/x-codemod@7.0.0-alpha.0`
|
|
135
|
+
|
|
136
|
+
- [codemod] Add `v7.0.0/preset-safe` (#10973) @LukasTy
|
|
137
|
+
|
|
138
|
+
### Docs
|
|
139
|
+
|
|
140
|
+
- [docs] Add `@next` tag to the installation instructions (#10963) @MBilalShafi
|
|
141
|
+
- [docs] Document how to hide the legend (#10951) @alexfauquette
|
|
142
|
+
- [docs] Fix typo in the migration guide (#10972) @flaviendelangle
|
|
143
|
+
|
|
144
|
+
### Core
|
|
145
|
+
|
|
146
|
+
- [core] Adds migration docs for charts, pickers and tree view (#10926) @michelengelen
|
|
147
|
+
- [core] Bump monorepo (#10959) @LukasTy
|
|
148
|
+
- [core] Changed prettier branch value to next (#10917) @michelengelen
|
|
149
|
+
- [core] Fix GitHub title tag consistency @oliviertassinari
|
|
150
|
+
- [core] Fixed wrong package names in migration docs (#10953) @michelengelen
|
|
151
|
+
- [core] Merge `master` into `next` (#10929) @cherniavskii
|
|
152
|
+
- [core] Update release instructions as per v7 configuration (#10962) @MBilalShafi
|
|
153
|
+
- [license] Correctly throw errors (#10924) @oliviertassinari
|
|
154
|
+
|
|
6
155
|
## 6.18.1
|
|
7
156
|
|
|
8
157
|
_Nov 9, 2023_
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots, ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
3
3
|
export interface ChartsAxisProps {
|
|
4
4
|
/**
|
|
5
5
|
* Indicate which axis to display the top of the charts.
|
|
@@ -29,12 +29,12 @@ export interface ChartsAxisProps {
|
|
|
29
29
|
* Overridable component slots.
|
|
30
30
|
* @default {}
|
|
31
31
|
*/
|
|
32
|
-
slots?:
|
|
32
|
+
slots?: ChartsAxisSlots;
|
|
33
33
|
/**
|
|
34
34
|
* The props used for each component slot.
|
|
35
35
|
* @default {}
|
|
36
36
|
*/
|
|
37
|
-
slotProps?:
|
|
37
|
+
slotProps?: ChartsAxisSlotProps;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Demos:
|
|
@@ -8,10 +8,10 @@ import { DefaultizedProps } from '../models/helpers';
|
|
|
8
8
|
import { LegendParams } from '../models/seriesType/config';
|
|
9
9
|
import { ChartsTextStyle } from '../internals/components/ChartsText';
|
|
10
10
|
import { CardinalDirections } from '../models/layout';
|
|
11
|
-
export interface
|
|
11
|
+
export interface ChartsLegendSlots {
|
|
12
12
|
legend?: React.JSXElementConstructor<LegendRendererProps>;
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface ChartsLegendSlotProps {
|
|
15
15
|
legend?: Partial<LegendRendererProps>;
|
|
16
16
|
}
|
|
17
17
|
export type ChartsLegendProps = {
|
|
@@ -34,12 +34,12 @@ export type ChartsLegendProps = {
|
|
|
34
34
|
* Overridable component slots.
|
|
35
35
|
* @default {}
|
|
36
36
|
*/
|
|
37
|
-
slots?:
|
|
37
|
+
slots?: ChartsLegendSlots;
|
|
38
38
|
/**
|
|
39
39
|
* The props used for each component slot.
|
|
40
40
|
* @default {}
|
|
41
41
|
*/
|
|
42
|
-
slotProps?:
|
|
42
|
+
slotProps?: ChartsLegendSlotProps;
|
|
43
43
|
};
|
|
44
44
|
type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
|
|
45
45
|
export type ChartsLegendRootOwnerState = {
|
|
@@ -88,5 +88,8 @@ export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps,
|
|
|
88
88
|
*/
|
|
89
89
|
padding?: number | Partial<CardinalDirections<number>>;
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element;
|
|
92
|
+
declare namespace ChartsLegend {
|
|
93
|
+
var propTypes: any;
|
|
94
|
+
}
|
|
95
|
+
export { ChartsLegend };
|
|
@@ -9,6 +9,7 @@ exports.ChartsLegendRoot = void 0;
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _utils = require("@mui/base/utils");
|
|
13
14
|
var _NoSsr = require("@mui/base/NoSsr");
|
|
14
15
|
var _utils2 = require("@mui/utils");
|
|
@@ -242,6 +243,106 @@ function DefaultChartsLegend(props) {
|
|
|
242
243
|
})
|
|
243
244
|
});
|
|
244
245
|
}
|
|
246
|
+
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
247
|
+
// ----------------------------- Warning --------------------------------
|
|
248
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
249
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
250
|
+
// ----------------------------------------------------------------------
|
|
251
|
+
/**
|
|
252
|
+
* Override or extend the styles applied to the component.
|
|
253
|
+
*/
|
|
254
|
+
classes: _propTypes.default.object.isRequired,
|
|
255
|
+
/**
|
|
256
|
+
* The direction of the legend layout.
|
|
257
|
+
* The default depends on the chart.
|
|
258
|
+
*/
|
|
259
|
+
direction: _propTypes.default.oneOf(['column', 'row']).isRequired,
|
|
260
|
+
drawingArea: _propTypes.default.shape({
|
|
261
|
+
bottom: _propTypes.default.number.isRequired,
|
|
262
|
+
height: _propTypes.default.number.isRequired,
|
|
263
|
+
left: _propTypes.default.number.isRequired,
|
|
264
|
+
right: _propTypes.default.number.isRequired,
|
|
265
|
+
top: _propTypes.default.number.isRequired,
|
|
266
|
+
width: _propTypes.default.number.isRequired
|
|
267
|
+
}).isRequired,
|
|
268
|
+
/**
|
|
269
|
+
* Set to true to hide the legend.
|
|
270
|
+
*/
|
|
271
|
+
hidden: _propTypes.default.bool,
|
|
272
|
+
/**
|
|
273
|
+
* Space between two legend items (in px).
|
|
274
|
+
* @default 10
|
|
275
|
+
*/
|
|
276
|
+
itemGap: _propTypes.default.number,
|
|
277
|
+
/**
|
|
278
|
+
* Height of the item mark (in px).
|
|
279
|
+
* @default 20
|
|
280
|
+
*/
|
|
281
|
+
itemMarkHeight: _propTypes.default.number,
|
|
282
|
+
/**
|
|
283
|
+
* Width of the item mark (in px).
|
|
284
|
+
* @default 20
|
|
285
|
+
*/
|
|
286
|
+
itemMarkWidth: _propTypes.default.number,
|
|
287
|
+
/**
|
|
288
|
+
* Style applied to legend labels.
|
|
289
|
+
* @default theme.typography.subtitle1
|
|
290
|
+
*/
|
|
291
|
+
labelStyle: _propTypes.default.object,
|
|
292
|
+
/**
|
|
293
|
+
* Space between the mark and the label (in px).
|
|
294
|
+
* @default 5
|
|
295
|
+
*/
|
|
296
|
+
markGap: _propTypes.default.number,
|
|
297
|
+
/**
|
|
298
|
+
* Legend padding (in px).
|
|
299
|
+
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
300
|
+
* @default 0
|
|
301
|
+
*/
|
|
302
|
+
padding: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
303
|
+
bottom: _propTypes.default.number,
|
|
304
|
+
left: _propTypes.default.number,
|
|
305
|
+
right: _propTypes.default.number,
|
|
306
|
+
top: _propTypes.default.number
|
|
307
|
+
})]),
|
|
308
|
+
position: _propTypes.default.shape({
|
|
309
|
+
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
310
|
+
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
311
|
+
}).isRequired,
|
|
312
|
+
series: _propTypes.default.shape({
|
|
313
|
+
bar: _propTypes.default.shape({
|
|
314
|
+
series: _propTypes.default.object.isRequired,
|
|
315
|
+
seriesOrder: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
316
|
+
stackingGroups: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
317
|
+
ids: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
318
|
+
stackingOffset: _propTypes.default.func.isRequired,
|
|
319
|
+
stackingOrder: _propTypes.default.func.isRequired
|
|
320
|
+
})).isRequired
|
|
321
|
+
}),
|
|
322
|
+
line: _propTypes.default.shape({
|
|
323
|
+
series: _propTypes.default.object.isRequired,
|
|
324
|
+
seriesOrder: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
325
|
+
stackingGroups: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
326
|
+
ids: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
327
|
+
stackingOffset: _propTypes.default.func.isRequired,
|
|
328
|
+
stackingOrder: _propTypes.default.func.isRequired
|
|
329
|
+
})).isRequired
|
|
330
|
+
}),
|
|
331
|
+
pie: _propTypes.default.shape({
|
|
332
|
+
series: _propTypes.default.object.isRequired,
|
|
333
|
+
seriesOrder: _propTypes.default.arrayOf(_propTypes.default.string).isRequired
|
|
334
|
+
}),
|
|
335
|
+
scatter: _propTypes.default.shape({
|
|
336
|
+
series: _propTypes.default.object.isRequired,
|
|
337
|
+
seriesOrder: _propTypes.default.arrayOf(_propTypes.default.string).isRequired
|
|
338
|
+
})
|
|
339
|
+
}).isRequired,
|
|
340
|
+
seriesToDisplay: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
341
|
+
color: _propTypes.default.string.isRequired,
|
|
342
|
+
id: _propTypes.default.string.isRequired,
|
|
343
|
+
label: _propTypes.default.string.isRequired
|
|
344
|
+
})).isRequired
|
|
345
|
+
} : void 0;
|
|
245
346
|
function ChartsLegend(inProps) {
|
|
246
347
|
const props = (0, _styles.useThemeProps)({
|
|
247
348
|
props: (0, _extends2.default)({}, defaultProps, inProps),
|
|
@@ -277,4 +378,38 @@ function ChartsLegend(inProps) {
|
|
|
277
378
|
ownerState: {}
|
|
278
379
|
});
|
|
279
380
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartLegendRender, (0, _extends2.default)({}, chartLegendRenderProps));
|
|
280
|
-
}
|
|
381
|
+
}
|
|
382
|
+
process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
|
|
383
|
+
// ----------------------------- Warning --------------------------------
|
|
384
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
385
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
386
|
+
// ----------------------------------------------------------------------
|
|
387
|
+
/**
|
|
388
|
+
* Override or extend the styles applied to the component.
|
|
389
|
+
*/
|
|
390
|
+
classes: _propTypes.default.object,
|
|
391
|
+
/**
|
|
392
|
+
* The direction of the legend layout.
|
|
393
|
+
* The default depends on the chart.
|
|
394
|
+
*/
|
|
395
|
+
direction: _propTypes.default.oneOf(['column', 'row']),
|
|
396
|
+
/**
|
|
397
|
+
* Set to true to hide the legend.
|
|
398
|
+
* @default false
|
|
399
|
+
*/
|
|
400
|
+
hidden: _propTypes.default.bool,
|
|
401
|
+
position: _propTypes.default.shape({
|
|
402
|
+
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
403
|
+
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
404
|
+
}),
|
|
405
|
+
/**
|
|
406
|
+
* The props used for each component slot.
|
|
407
|
+
* @default {}
|
|
408
|
+
*/
|
|
409
|
+
slotProps: _propTypes.default.object,
|
|
410
|
+
/**
|
|
411
|
+
* Overridable component slots.
|
|
412
|
+
* @default {}
|
|
413
|
+
*/
|
|
414
|
+
slots: _propTypes.default.object
|
|
415
|
+
} : void 0;
|
|
@@ -4,12 +4,12 @@ import { TriggerOptions } from './utils';
|
|
|
4
4
|
import { ChartsItemContentProps } from './ChartsItemTooltipContent';
|
|
5
5
|
import { ChartsAxisContentProps } from './ChartsAxisTooltipContent';
|
|
6
6
|
import { ChartsTooltipClasses } from './tooltipClasses';
|
|
7
|
-
export interface
|
|
7
|
+
export interface ChartsTooltipSlots {
|
|
8
8
|
popper?: React.ElementType<PopperProps>;
|
|
9
9
|
axisContent?: React.ElementType<ChartsAxisContentProps>;
|
|
10
10
|
itemContent?: React.ElementType<ChartsItemContentProps>;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface ChartsTooltipSlotProps {
|
|
13
13
|
popper?: Partial<PopperProps>;
|
|
14
14
|
axisContent?: Partial<ChartsAxisContentProps>;
|
|
15
15
|
itemContent?: Partial<ChartsItemContentProps>;
|
|
@@ -41,12 +41,12 @@ export type ChartsTooltipProps = {
|
|
|
41
41
|
* Overridable component slots.
|
|
42
42
|
* @default {}
|
|
43
43
|
*/
|
|
44
|
-
slots?:
|
|
44
|
+
slots?: ChartsTooltipSlots;
|
|
45
45
|
/**
|
|
46
46
|
* The props used for each component slot.
|
|
47
47
|
* @default {}
|
|
48
48
|
*/
|
|
49
|
-
slotProps?:
|
|
49
|
+
slotProps?: ChartsTooltipSlotProps;
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
* Demos:
|
package/LineChart/AreaPlot.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AreaElementProps } from './AreaElement';
|
|
3
|
-
export interface
|
|
3
|
+
export interface AreaPlotSlots {
|
|
4
4
|
area?: React.JSXElementConstructor<AreaElementProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface AreaPlotSlotProps {
|
|
7
7
|
area?: Partial<AreaElementProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface AreaPlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<AreaElementProps, 'slots' | 'slotProps'> {
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { AreaPlotSlotProps, AreaPlotSlots } from './AreaPlot';
|
|
3
|
+
import { LinePlotSlotProps, LinePlotSlots } from './LinePlot';
|
|
4
4
|
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
5
|
-
import {
|
|
5
|
+
import { MarkPlotSlotProps, MarkPlotSlots } from './MarkPlot';
|
|
6
6
|
import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
|
|
7
7
|
import { LineSeriesType } from '../models/seriesType/line';
|
|
8
8
|
import { MakeOptional } from '../models/helpers';
|
|
9
|
-
import { ChartsTooltipProps,
|
|
10
|
-
import { ChartsLegendProps,
|
|
9
|
+
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
10
|
+
import { ChartsLegendProps, ChartsLegendSlotProps, ChartsLegendSlots } from '../ChartsLegend';
|
|
11
11
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
export interface
|
|
12
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots } from '../models/axis';
|
|
13
|
+
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from './LineHighlightPlot';
|
|
14
|
+
export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
17
17
|
}
|
|
18
18
|
export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
19
19
|
series: MakeOptional<LineSeriesType, 'type'>[];
|
|
@@ -38,12 +38,12 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
|
|
|
38
38
|
* Overridable component slots.
|
|
39
39
|
* @default {}
|
|
40
40
|
*/
|
|
41
|
-
slots?:
|
|
41
|
+
slots?: LineChartSlots;
|
|
42
42
|
/**
|
|
43
43
|
* The props used for each component slot.
|
|
44
44
|
* @default {}
|
|
45
45
|
*/
|
|
46
|
-
slotProps?:
|
|
46
|
+
slotProps?: LineChartSlotProps;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Demos:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LineHighlightElementProps } from './LineHighlightElement';
|
|
3
|
-
export interface
|
|
3
|
+
export interface LineHighlightPlotSlots {
|
|
4
4
|
lineHighlight?: React.JSXElementConstructor<LineHighlightElementProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface LineHighlightPlotSlotProps {
|
|
7
7
|
lineHighlight?: Partial<LineHighlightElementProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface LineHighlightPlotProps extends React.SVGAttributes<SVGSVGElement> {
|
|
@@ -11,12 +11,12 @@ export interface LineHighlightPlotProps extends React.SVGAttributes<SVGSVGElemen
|
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
13
13
|
*/
|
|
14
|
-
slots?:
|
|
14
|
+
slots?: LineHighlightPlotSlots;
|
|
15
15
|
/**
|
|
16
16
|
* The props used for each component slot.
|
|
17
17
|
* @default {}
|
|
18
18
|
*/
|
|
19
|
-
slotProps?:
|
|
19
|
+
slotProps?: LineHighlightPlotSlotProps;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Demos:
|
package/LineChart/LinePlot.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { LineElementProps } from './LineElement';
|
|
3
|
-
export interface
|
|
3
|
+
export interface LinePlotSlots {
|
|
4
4
|
line?: React.JSXElementConstructor<LineElementProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface LinePlotSlotProps {
|
|
7
7
|
line?: Partial<LineElementProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface LinePlotProps extends React.SVGAttributes<SVGSVGElement>, Pick<LineElementProps, 'slots' | 'slotProps'> {
|
package/LineChart/MarkPlot.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MarkElementProps } from './MarkElement';
|
|
3
|
-
export interface
|
|
3
|
+
export interface MarkPlotSlots {
|
|
4
4
|
mark?: React.JSXElementConstructor<MarkElementProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface MarkPlotSlotProps {
|
|
7
7
|
mark?: Partial<MarkElementProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface MarkPlotProps extends React.SVGAttributes<SVGSVGElement> {
|
|
@@ -11,12 +11,12 @@ export interface MarkPlotProps extends React.SVGAttributes<SVGSVGElement> {
|
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
13
13
|
*/
|
|
14
|
-
slots?:
|
|
14
|
+
slots?: MarkPlotSlots;
|
|
15
15
|
/**
|
|
16
16
|
* The props used for each component slot.
|
|
17
17
|
* @default {}
|
|
18
18
|
*/
|
|
19
|
-
slotProps?:
|
|
19
|
+
slotProps?: MarkPlotSlotProps;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Demos:
|
|
@@ -2,10 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { DefaultizedPieSeriesType } from '../models/seriesType/pie';
|
|
3
3
|
import { PieArcLabelProps } from './PieArcLabel';
|
|
4
4
|
import { DefaultizedProps } from '../models/helpers';
|
|
5
|
-
export interface
|
|
5
|
+
export interface PieArcLabelPlotSlots {
|
|
6
6
|
pieArcLabel?: React.JSXElementConstructor<PieArcLabelProps>;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface PieArcLabelPlotSlotProps {
|
|
9
9
|
pieArcLabel?: Partial<PieArcLabelProps>;
|
|
10
10
|
}
|
|
11
11
|
export interface PieArcLabelPlotProps extends DefaultizedProps<Pick<DefaultizedPieSeriesType, 'data' | 'faded' | 'highlighted' | 'innerRadius' | 'outerRadius' | 'cornerRadius' | 'paddingAngle' | 'arcLabel' | 'arcLabelMinAngle' | 'id' | 'highlightScope'>, 'outerRadius'> {
|
|
@@ -13,12 +13,12 @@ export interface PieArcLabelPlotProps extends DefaultizedProps<Pick<DefaultizedP
|
|
|
13
13
|
* Overridable component slots.
|
|
14
14
|
* @default {}
|
|
15
15
|
*/
|
|
16
|
-
slots?:
|
|
16
|
+
slots?: PieArcLabelPlotSlots;
|
|
17
17
|
/**
|
|
18
18
|
* The props used for each component slot.
|
|
19
19
|
* @default {}
|
|
20
20
|
*/
|
|
21
|
-
slotProps?:
|
|
21
|
+
slotProps?: PieArcLabelPlotSlotProps;
|
|
22
22
|
/**
|
|
23
23
|
* If `true`, animations are skiped.
|
|
24
24
|
* @default false
|
package/PieChart/PieArcPlot.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { PieArcProps } from './PieArc';
|
|
3
3
|
import { DefaultizedPieSeriesType, DefaultizedPieValueType, PieItemIdentifier } from '../models/seriesType/pie';
|
|
4
4
|
import { DefaultizedProps } from '../models/helpers';
|
|
5
|
-
export interface
|
|
5
|
+
export interface PieArcPlotSlots {
|
|
6
6
|
pieArc?: React.JSXElementConstructor<PieArcProps>;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface PieArcPlotSlotProps {
|
|
9
9
|
pieArc?: Partial<PieArcProps>;
|
|
10
10
|
}
|
|
11
11
|
export interface PieArcPlotProps extends DefaultizedProps<Pick<DefaultizedPieSeriesType, 'data' | 'faded' | 'highlighted' | 'innerRadius' | 'outerRadius' | 'cornerRadius' | 'paddingAngle' | 'id' | 'highlightScope'>, 'outerRadius'> {
|
|
@@ -13,12 +13,12 @@ export interface PieArcPlotProps extends DefaultizedProps<Pick<DefaultizedPieSer
|
|
|
13
13
|
* Overridable component slots.
|
|
14
14
|
* @default {}
|
|
15
15
|
*/
|
|
16
|
-
slots?:
|
|
16
|
+
slots?: PieArcPlotSlots;
|
|
17
17
|
/**
|
|
18
18
|
* The props used for each component slot.
|
|
19
19
|
* @default {}
|
|
20
20
|
*/
|
|
21
|
-
slotProps?:
|
|
21
|
+
slotProps?: PieArcPlotSlotProps;
|
|
22
22
|
/**
|
|
23
23
|
* Callback fired when a pie item is clicked.
|
|
24
24
|
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|