@mui/x-charts 6.0.0-alpha.6 → 6.0.0-alpha.7
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 +18 -2
- package/BarChart/BarChart.js +60 -11
- package/BarChart/BarElement.d.ts +22 -0
- package/BarChart/BarElement.js +21 -10
- package/BarChart/BarPlot.d.ts +14 -1
- package/BarChart/BarPlot.js +23 -4
- package/CHANGELOG.md +62 -0
- package/ChartsAxis/ChartsAxis.d.ts +11 -1
- package/ChartsAxis/ChartsAxis.js +51 -6
- package/ChartsLegend/ChartsLegend.d.ts +25 -2
- package/ChartsLegend/ChartsLegend.js +49 -17
- package/ChartsTooltip/ChartsTooltipTable.d.ts +2 -9
- package/ChartsXAxis/ChartsXAxis.js +44 -9
- package/ChartsYAxis/ChartsYAxis.js +44 -9
- package/LineChart/AreaElement.d.ts +22 -0
- package/LineChart/AreaElement.js +31 -11
- package/LineChart/AreaPlot.d.ts +14 -1
- package/LineChart/AreaPlot.js +29 -3
- package/LineChart/LineChart.d.ts +20 -2
- package/LineChart/LineChart.js +62 -10
- package/LineChart/LineElement.d.ts +22 -0
- package/LineChart/LineElement.js +31 -10
- package/LineChart/LinePlot.d.ts +14 -1
- package/LineChart/LinePlot.js +35 -4
- package/LineChart/MarkPlot.d.ts +24 -1
- package/LineChart/MarkPlot.js +25 -3
- package/PieChart/PieArcLabel.js +0 -1
- package/PieChart/PieChart.d.ts +14 -2
- package/PieChart/PieChart.js +51 -9
- package/PieChart/PiePlot.d.ts +27 -1
- package/PieChart/PiePlot.js +29 -6
- package/ScatterChart/ScatterChart.d.ts +18 -2
- package/ScatterChart/ScatterChart.js +55 -9
- package/ScatterChart/ScatterPlot.d.ts +24 -1
- package/ScatterChart/ScatterPlot.js +28 -4
- package/SparkLineChart/SparkLineChart.d.ts +18 -0
- package/SparkLineChart/SparkLineChart.js +28 -5
- package/colorPalettes/colorPalettes.js +2 -2
- package/context/CartesianContextProvider.js +14 -8
- package/esm/BarChart/BarChart.js +60 -11
- package/esm/BarChart/BarElement.js +21 -11
- package/esm/BarChart/BarPlot.js +23 -4
- package/esm/ChartsAxis/ChartsAxis.js +51 -6
- package/esm/ChartsLegend/ChartsLegend.js +47 -14
- package/esm/ChartsXAxis/ChartsXAxis.js +45 -9
- package/esm/ChartsYAxis/ChartsYAxis.js +45 -9
- package/esm/LineChart/AreaElement.js +31 -11
- package/esm/LineChart/AreaPlot.js +31 -4
- package/esm/LineChart/LineChart.js +62 -10
- package/esm/LineChart/LineElement.js +31 -11
- package/esm/LineChart/LinePlot.js +43 -8
- package/esm/LineChart/MarkPlot.js +28 -4
- package/esm/PieChart/PieArcLabel.js +0 -1
- package/esm/PieChart/PieChart.js +51 -9
- package/esm/PieChart/PiePlot.js +31 -6
- package/esm/ScatterChart/ScatterChart.js +55 -9
- package/esm/ScatterChart/ScatterPlot.js +29 -4
- package/esm/SparkLineChart/SparkLineChart.js +28 -5
- package/esm/colorPalettes/colorPalettes.js +2 -2
- package/esm/context/CartesianContextProvider.js +14 -8
- package/esm/hooks/useTicks.js +9 -6
- package/esm/internals/components/AxisSharedComponents.js +10 -10
- package/hooks/useTicks.d.ts +20 -5
- package/hooks/useTicks.js +9 -6
- package/index.js +1 -1
- package/internals/components/AxisSharedComponents.d.ts +4 -4
- package/internals/components/AxisSharedComponents.js +15 -15
- package/legacy/BarChart/BarChart.js +60 -11
- package/legacy/BarChart/BarElement.js +20 -10
- package/legacy/BarChart/BarPlot.js +23 -4
- package/legacy/ChartsAxis/ChartsAxis.js +51 -6
- package/legacy/ChartsLegend/ChartsLegend.js +46 -15
- package/legacy/ChartsXAxis/ChartsXAxis.js +45 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +45 -9
- package/legacy/LineChart/AreaElement.js +30 -10
- package/legacy/LineChart/AreaPlot.js +29 -4
- package/legacy/LineChart/LineChart.js +62 -10
- package/legacy/LineChart/LineElement.js +30 -10
- package/legacy/LineChart/LinePlot.js +36 -5
- package/legacy/LineChart/MarkPlot.js +26 -4
- package/legacy/PieChart/PieArcLabel.js +0 -1
- package/legacy/PieChart/PieChart.js +51 -9
- package/legacy/PieChart/PiePlot.js +29 -6
- package/legacy/ScatterChart/ScatterChart.js +55 -9
- package/legacy/ScatterChart/ScatterPlot.js +27 -4
- package/legacy/SparkLineChart/SparkLineChart.js +28 -5
- package/legacy/colorPalettes/colorPalettes.js +2 -2
- package/legacy/context/CartesianContextProvider.js +14 -8
- package/legacy/hooks/useTicks.js +9 -9
- package/legacy/index.js +1 -1
- package/legacy/internals/components/AxisSharedComponents.js +10 -10
- package/models/axis.d.ts +24 -1
- package/modern/BarChart/BarChart.js +60 -11
- package/modern/BarChart/BarElement.js +20 -11
- package/modern/BarChart/BarPlot.js +23 -4
- package/modern/ChartsAxis/ChartsAxis.js +51 -6
- package/modern/ChartsLegend/ChartsLegend.js +46 -14
- package/modern/ChartsXAxis/ChartsXAxis.js +44 -9
- package/modern/ChartsYAxis/ChartsYAxis.js +44 -9
- package/modern/LineChart/AreaElement.js +30 -11
- package/modern/LineChart/AreaPlot.js +31 -4
- package/modern/LineChart/LineChart.js +62 -10
- package/modern/LineChart/LineElement.js +30 -11
- package/modern/LineChart/LinePlot.js +37 -5
- package/modern/LineChart/MarkPlot.js +27 -4
- package/modern/PieChart/PieArcLabel.js +0 -1
- package/modern/PieChart/PieChart.js +51 -9
- package/modern/PieChart/PiePlot.js +30 -6
- package/modern/ScatterChart/ScatterChart.js +55 -9
- package/modern/ScatterChart/ScatterPlot.js +28 -4
- package/modern/SparkLineChart/SparkLineChart.js +28 -5
- package/modern/colorPalettes/colorPalettes.js +2 -2
- package/modern/context/CartesianContextProvider.js +14 -8
- package/modern/hooks/useTicks.js +9 -6
- package/modern/index.js +1 -1
- package/modern/internals/components/AxisSharedComponents.js +10 -10
- package/package.json +2 -2
- package/themeAugmentation/components.d.ts +0 -10
- package/themeAugmentation/overrides.d.ts +0 -2
package/BarChart/BarChart.d.ts
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BarPlotSlotComponentProps, BarPlotSlotsComponent } from './BarPlot';
|
|
2
3
|
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
3
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
4
5
|
import { BarSeriesType } from '../models/seriesType/bar';
|
|
5
6
|
import { MakeOptional } from '../models/helpers';
|
|
6
7
|
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
7
|
-
import { ChartsLegendProps } from '../ChartsLegend';
|
|
8
|
+
import { ChartsLegendProps, ChartsLegendSlotsComponent, ChartsLegendSlotComponentProps } from '../ChartsLegend';
|
|
8
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
9
|
-
|
|
10
|
+
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
11
|
+
export interface BarChartSlotsComponent extends ChartsAxisSlotsComponent, BarPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
12
|
+
}
|
|
13
|
+
export interface BarChartSlotComponentProps extends ChartsAxisSlotComponentProps, BarPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
14
|
+
}
|
|
15
|
+
export interface BarChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
10
16
|
series: MakeOptional<BarSeriesType, 'type'>[];
|
|
11
17
|
tooltip?: ChartsTooltipProps;
|
|
12
18
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
13
19
|
legend?: ChartsLegendProps;
|
|
20
|
+
/**
|
|
21
|
+
* Overridable component slots.
|
|
22
|
+
* @default {}
|
|
23
|
+
*/
|
|
24
|
+
slots?: BarChartSlotsComponent;
|
|
25
|
+
/**
|
|
26
|
+
* The props used for each component slot.
|
|
27
|
+
* @default {}
|
|
28
|
+
*/
|
|
29
|
+
slotProps?: BarChartSlotComponentProps;
|
|
14
30
|
}
|
|
15
31
|
declare const BarChart: React.ForwardRefExoticComponent<BarChartProps & React.RefAttributes<unknown>>;
|
|
16
32
|
export { BarChart };
|
package/BarChart/BarChart.js
CHANGED
|
@@ -38,7 +38,9 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
38
38
|
leftAxis,
|
|
39
39
|
rightAxis,
|
|
40
40
|
bottomAxis,
|
|
41
|
-
children
|
|
41
|
+
children,
|
|
42
|
+
slots,
|
|
43
|
+
slotProps
|
|
42
44
|
} = props;
|
|
43
45
|
const id = (0, _useId.default)();
|
|
44
46
|
const clipPathId = `${id}-clip-path`;
|
|
@@ -64,15 +66,26 @@ const BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
|
|
|
64
66
|
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
|
|
65
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
66
68
|
clipPath: `url(#${clipPathId})`,
|
|
67
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, {
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarPlot.BarPlot, {
|
|
70
|
+
slots: slots,
|
|
71
|
+
slotProps: slotProps
|
|
72
|
+
})
|
|
68
73
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, {
|
|
69
74
|
topAxis: topAxis,
|
|
70
75
|
leftAxis: leftAxis,
|
|
71
76
|
rightAxis: rightAxis,
|
|
72
|
-
bottomAxis: bottomAxis
|
|
73
|
-
|
|
77
|
+
bottomAxis: bottomAxis,
|
|
78
|
+
slots: slots,
|
|
79
|
+
slotProps: slotProps
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legend, {
|
|
81
|
+
slots: slots,
|
|
82
|
+
slotProps: slotProps
|
|
83
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({
|
|
74
84
|
x: "band"
|
|
75
|
-
}, axisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip
|
|
85
|
+
}, axisHighlight)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsTooltip.ChartsTooltip, (0, _extends2.default)({}, tooltip, {
|
|
86
|
+
slots: slots,
|
|
87
|
+
slotProps: slotProps
|
|
88
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
76
89
|
id: clipPathId
|
|
77
90
|
}), children]
|
|
78
91
|
});
|
|
@@ -101,8 +114,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
101
114
|
label: _propTypes.default.string,
|
|
102
115
|
labelFontSize: _propTypes.default.number,
|
|
103
116
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
117
|
+
slotProps: _propTypes.default.object,
|
|
118
|
+
slots: _propTypes.default.object,
|
|
104
119
|
stroke: _propTypes.default.string,
|
|
105
120
|
tickFontSize: _propTypes.default.number,
|
|
121
|
+
tickMaxStep: _propTypes.default.number,
|
|
122
|
+
tickMinStep: _propTypes.default.number,
|
|
123
|
+
tickNumber: _propTypes.default.number,
|
|
106
124
|
tickSize: _propTypes.default.number
|
|
107
125
|
}), _propTypes.default.string]),
|
|
108
126
|
children: _propTypes.default.node,
|
|
@@ -129,8 +147,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
129
147
|
label: _propTypes.default.string,
|
|
130
148
|
labelFontSize: _propTypes.default.number,
|
|
131
149
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
150
|
+
slotProps: _propTypes.default.object,
|
|
151
|
+
slots: _propTypes.default.object,
|
|
132
152
|
stroke: _propTypes.default.string,
|
|
133
153
|
tickFontSize: _propTypes.default.number,
|
|
154
|
+
tickMaxStep: _propTypes.default.number,
|
|
155
|
+
tickMinStep: _propTypes.default.number,
|
|
156
|
+
tickNumber: _propTypes.default.number,
|
|
134
157
|
tickSize: _propTypes.default.number
|
|
135
158
|
}), _propTypes.default.string]),
|
|
136
159
|
legend: _propTypes.default.shape({
|
|
@@ -147,6 +170,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
147
170
|
horizontal: _propTypes.default.oneOf(['left', 'middle', 'right']).isRequired,
|
|
148
171
|
vertical: _propTypes.default.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
149
172
|
}),
|
|
173
|
+
slotProps: _propTypes.default.object,
|
|
174
|
+
slots: _propTypes.default.object,
|
|
150
175
|
spacing: _propTypes.default.number
|
|
151
176
|
}),
|
|
152
177
|
margin: _propTypes.default.shape({
|
|
@@ -169,8 +194,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
169
194
|
label: _propTypes.default.string,
|
|
170
195
|
labelFontSize: _propTypes.default.number,
|
|
171
196
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
197
|
+
slotProps: _propTypes.default.object,
|
|
198
|
+
slots: _propTypes.default.object,
|
|
172
199
|
stroke: _propTypes.default.string,
|
|
173
200
|
tickFontSize: _propTypes.default.number,
|
|
201
|
+
tickMaxStep: _propTypes.default.number,
|
|
202
|
+
tickMinStep: _propTypes.default.number,
|
|
203
|
+
tickNumber: _propTypes.default.number,
|
|
174
204
|
tickSize: _propTypes.default.number
|
|
175
205
|
}), _propTypes.default.string]),
|
|
176
206
|
series: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
@@ -191,6 +221,16 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
191
221
|
xAxisKey: _propTypes.default.string,
|
|
192
222
|
yAxisKey: _propTypes.default.string
|
|
193
223
|
})).isRequired,
|
|
224
|
+
/**
|
|
225
|
+
* The props used for each component slot.
|
|
226
|
+
* @default {}
|
|
227
|
+
*/
|
|
228
|
+
slotProps: _propTypes.default.object,
|
|
229
|
+
/**
|
|
230
|
+
* Overridable component slots.
|
|
231
|
+
* @default {}
|
|
232
|
+
*/
|
|
233
|
+
slots: _propTypes.default.object,
|
|
194
234
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
195
235
|
title: _propTypes.default.string,
|
|
196
236
|
tooltip: _propTypes.default.shape({
|
|
@@ -213,8 +253,13 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
213
253
|
label: _propTypes.default.string,
|
|
214
254
|
labelFontSize: _propTypes.default.number,
|
|
215
255
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
256
|
+
slotProps: _propTypes.default.object,
|
|
257
|
+
slots: _propTypes.default.object,
|
|
216
258
|
stroke: _propTypes.default.string,
|
|
217
259
|
tickFontSize: _propTypes.default.number,
|
|
260
|
+
tickMaxStep: _propTypes.default.number,
|
|
261
|
+
tickMinStep: _propTypes.default.number,
|
|
262
|
+
tickNumber: _propTypes.default.number,
|
|
218
263
|
tickSize: _propTypes.default.number
|
|
219
264
|
}), _propTypes.default.string]),
|
|
220
265
|
viewBox: _propTypes.default.shape({
|
|
@@ -237,15 +282,17 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
237
282
|
label: _propTypes.default.string,
|
|
238
283
|
labelFontSize: _propTypes.default.number,
|
|
239
284
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
240
|
-
maxTicks: _propTypes.default.number,
|
|
241
285
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
242
|
-
minTicks: _propTypes.default.number,
|
|
243
286
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
244
287
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
288
|
+
slotProps: _propTypes.default.object,
|
|
289
|
+
slots: _propTypes.default.object,
|
|
245
290
|
stroke: _propTypes.default.string,
|
|
246
291
|
tickFontSize: _propTypes.default.number,
|
|
292
|
+
tickMaxStep: _propTypes.default.number,
|
|
293
|
+
tickMinStep: _propTypes.default.number,
|
|
294
|
+
tickNumber: _propTypes.default.number,
|
|
247
295
|
tickSize: _propTypes.default.number,
|
|
248
|
-
tickSpacing: _propTypes.default.number,
|
|
249
296
|
valueFormatter: _propTypes.default.func
|
|
250
297
|
})),
|
|
251
298
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
@@ -261,15 +308,17 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
261
308
|
label: _propTypes.default.string,
|
|
262
309
|
labelFontSize: _propTypes.default.number,
|
|
263
310
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
264
|
-
maxTicks: _propTypes.default.number,
|
|
265
311
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
266
|
-
minTicks: _propTypes.default.number,
|
|
267
312
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
268
313
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
314
|
+
slotProps: _propTypes.default.object,
|
|
315
|
+
slots: _propTypes.default.object,
|
|
269
316
|
stroke: _propTypes.default.string,
|
|
270
317
|
tickFontSize: _propTypes.default.number,
|
|
318
|
+
tickMaxStep: _propTypes.default.number,
|
|
319
|
+
tickMinStep: _propTypes.default.number,
|
|
320
|
+
tickNumber: _propTypes.default.number,
|
|
271
321
|
tickSize: _propTypes.default.number,
|
|
272
|
-
tickSpacing: _propTypes.default.number,
|
|
273
322
|
valueFormatter: _propTypes.default.func
|
|
274
323
|
}))
|
|
275
324
|
} : void 0;
|
package/BarChart/BarElement.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SlotComponentProps } from '@mui/base';
|
|
2
3
|
import { HighlightScope } from '../context/HighlightProvider';
|
|
3
4
|
export interface BarElementClasses {
|
|
4
5
|
/** Styles applied to the root element. */
|
|
@@ -15,7 +16,28 @@ export interface BarElementOwnerState {
|
|
|
15
16
|
}
|
|
16
17
|
export declare function getBarElementUtilityClass(slot: string): string;
|
|
17
18
|
export declare const lineElementClasses: BarElementClasses;
|
|
19
|
+
export declare const BarElementPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
20
|
+
ownerState: BarElementOwnerState;
|
|
21
|
+
}, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
|
|
18
22
|
export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighlighted'> & React.ComponentPropsWithoutRef<'path'> & {
|
|
19
23
|
highlightScope?: Partial<HighlightScope>;
|
|
24
|
+
/**
|
|
25
|
+
* The props used for each component slot.
|
|
26
|
+
* @default {}
|
|
27
|
+
*/
|
|
28
|
+
slotProps?: {
|
|
29
|
+
bar?: SlotComponentProps<'path', {}, BarElementOwnerState>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Overridable component slots.
|
|
33
|
+
* @default {}
|
|
34
|
+
*/
|
|
35
|
+
slots?: {
|
|
36
|
+
/**
|
|
37
|
+
* The component that renders the root.
|
|
38
|
+
* @default BarElementPath
|
|
39
|
+
*/
|
|
40
|
+
bar?: React.ElementType;
|
|
41
|
+
};
|
|
20
42
|
};
|
|
21
43
|
export declare function BarElement(props: BarElementProps): React.JSX.Element;
|
package/BarChart/BarElement.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.BarElement = BarElement;
|
|
8
|
+
exports.BarElementPath = void 0;
|
|
8
9
|
exports.getBarElementUtilityClass = getBarElementUtilityClass;
|
|
9
10
|
exports.lineElementClasses = void 0;
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
13
|
var React = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
|
+
var _utils = require("@mui/base/utils");
|
|
14
16
|
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
15
17
|
var _styles = require("@mui/material/styles");
|
|
16
18
|
var _d3Color = require("d3-color");
|
|
@@ -18,7 +20,7 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
18
20
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
19
21
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope"];
|
|
23
|
+
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps"];
|
|
22
24
|
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); }
|
|
23
25
|
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; }
|
|
24
26
|
function getBarElementUtilityClass(slot) {
|
|
@@ -49,13 +51,16 @@ const BarElementPath = (0, _styles.styled)('rect', {
|
|
|
49
51
|
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
|
|
50
52
|
opacity: ownerState.isFaded && 0.3 || 1
|
|
51
53
|
}));
|
|
54
|
+
exports.BarElementPath = BarElementPath;
|
|
52
55
|
function BarElement(props) {
|
|
53
56
|
const {
|
|
54
57
|
id,
|
|
55
58
|
dataIndex,
|
|
56
59
|
classes: innerClasses,
|
|
57
60
|
color,
|
|
58
|
-
highlightScope
|
|
61
|
+
highlightScope,
|
|
62
|
+
slots,
|
|
63
|
+
slotProps
|
|
59
64
|
} = props,
|
|
60
65
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
61
66
|
const getInteractionItemProps = (0, _useInteractionItemProps.useInteractionItemProps)(highlightScope);
|
|
@@ -81,12 +86,18 @@ function BarElement(props) {
|
|
|
81
86
|
isHighlighted
|
|
82
87
|
};
|
|
83
88
|
const classes = useUtilityClasses(ownerState);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const Bar = slots?.bar ?? BarElementPath;
|
|
90
|
+
const barProps = (0, _utils.useSlotProps)({
|
|
91
|
+
elementType: Bar,
|
|
92
|
+
externalSlotProps: slotProps?.bar,
|
|
93
|
+
additionalProps: (0, _extends2.default)({}, other, getInteractionItemProps({
|
|
94
|
+
type: 'bar',
|
|
95
|
+
seriesId: id,
|
|
96
|
+
dataIndex
|
|
97
|
+
}), {
|
|
98
|
+
className: classes.root
|
|
99
|
+
}),
|
|
100
|
+
ownerState
|
|
101
|
+
});
|
|
102
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Bar, (0, _extends2.default)({}, barProps));
|
|
92
103
|
}
|
package/BarChart/BarPlot.d.ts
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
import { BarElementProps } from './BarElement';
|
|
3
|
+
export interface BarPlotSlotsComponent {
|
|
4
|
+
bar?: React.JSXElementConstructor<BarElementProps>;
|
|
5
|
+
}
|
|
6
|
+
export interface BarPlotSlotComponentProps {
|
|
7
|
+
bar?: Partial<BarElementProps>;
|
|
8
|
+
}
|
|
9
|
+
export interface BarPlotProps extends Pick<BarElementProps, 'slots' | 'slotProps'> {
|
|
10
|
+
}
|
|
11
|
+
declare function BarPlot(props: BarPlotProps): React.JSX.Element | null;
|
|
12
|
+
declare namespace BarPlot {
|
|
13
|
+
var propTypes: any;
|
|
14
|
+
}
|
|
15
|
+
export { BarPlot };
|
package/BarChart/BarPlot.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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.BarPlot = BarPlot;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
7
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
11
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
9
12
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
10
13
|
var _BarElement = require("./BarElement");
|
|
@@ -38,7 +41,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
41
|
offset
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
|
-
function BarPlot() {
|
|
44
|
+
function BarPlot(props) {
|
|
42
45
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).bar;
|
|
43
46
|
const axisData = React.useContext(_CartesianContextProvider.CartesianContext);
|
|
44
47
|
if (seriesData === undefined) {
|
|
@@ -93,7 +96,7 @@ function BarPlot() {
|
|
|
93
96
|
return stackedData.map((values, dataIndex) => {
|
|
94
97
|
const baseline = Math.min(...values);
|
|
95
98
|
const value = Math.max(...values);
|
|
96
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, {
|
|
99
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, (0, _extends2.default)({
|
|
97
100
|
id: seriesId,
|
|
98
101
|
dataIndex: dataIndex,
|
|
99
102
|
x: xScale(xAxis[xAxisKey].data?.[dataIndex]) + groupIndex * (barWidth + offset),
|
|
@@ -102,9 +105,25 @@ function BarPlot() {
|
|
|
102
105
|
width: barWidth,
|
|
103
106
|
color: color,
|
|
104
107
|
highlightScope: series[seriesId].highlightScope
|
|
105
|
-
}, `${seriesId}-${dataIndex}`);
|
|
108
|
+
}, props), `${seriesId}-${dataIndex}`);
|
|
106
109
|
});
|
|
107
110
|
});
|
|
108
111
|
})
|
|
109
112
|
});
|
|
110
|
-
}
|
|
113
|
+
}
|
|
114
|
+
process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
|
|
115
|
+
// ----------------------------- Warning --------------------------------
|
|
116
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
117
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
118
|
+
// ----------------------------------------------------------------------
|
|
119
|
+
/**
|
|
120
|
+
* The props used for each component slot.
|
|
121
|
+
* @default {}
|
|
122
|
+
*/
|
|
123
|
+
slotProps: _propTypes.default.object,
|
|
124
|
+
/**
|
|
125
|
+
* Overridable component slots.
|
|
126
|
+
* @default {}
|
|
127
|
+
*/
|
|
128
|
+
slots: _propTypes.default.object
|
|
129
|
+
} : void 0;
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,68 @@
|
|
|
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.1
|
|
7
|
+
|
|
8
|
+
_Aug 11, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 💫 Add theme augmentation to `@mui/x-tree-view`
|
|
13
|
+
- 📈 Enable charts customization using `slot` and `slotProps` props
|
|
14
|
+
- 🌍 Improve Finnish (fi-FI) and Icelandic (is-IS) locales on the pickers
|
|
15
|
+
- 🐞 Bugfixes
|
|
16
|
+
- 📚 Documentation improvements
|
|
17
|
+
|
|
18
|
+
### Data Grid
|
|
19
|
+
|
|
20
|
+
#### `@mui/x-data-grid@6.11.1`
|
|
21
|
+
|
|
22
|
+
- [DataGrid] `getCellAggregationResult`: Handle `null` `rowNode` case (#9915) @romgrk
|
|
23
|
+
|
|
24
|
+
#### `@mui/x-data-grid-pro@6.11.1` [](https://mui.com/r/x-pro-svg-link)
|
|
25
|
+
|
|
26
|
+
Same changes as in `@mui/x-data-grid@6.11.1`.
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid-premium@6.11.1` [](https://mui.com/r/x-premium-svg-link)
|
|
29
|
+
|
|
30
|
+
Same changes as in `@mui/x-data-grid-pro@6.11.1`.
|
|
31
|
+
|
|
32
|
+
### Date Pickers
|
|
33
|
+
|
|
34
|
+
#### `@mui/x-date-pickers@6.11.1`
|
|
35
|
+
|
|
36
|
+
- [fields] Use `numeric` `inputmode` instead of `tel` (#9918) @LukasTy
|
|
37
|
+
- [pickers] Always respect locale when formatting meridiem (#9979) @flaviendelangle
|
|
38
|
+
- [pickers] Call `onChange` when selecting a shortcut with `changeImportance="set"` (#9974) @flaviendelangle
|
|
39
|
+
- [pickers] Refactor `themeAugmentation` `styleOverrides` (#9978) @LukasTy
|
|
40
|
+
- [l10n] Improve Finnish (fi-FI) locale (#9795) @kurkle
|
|
41
|
+
- [l10n] Improve Icelandic (is-IS) locale (#9639) @magnimarels
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-date-pickers-pro@6.11.1` [](https://mui.com/r/x-pro-svg-link)
|
|
44
|
+
|
|
45
|
+
Same changes as in `@mui/x-date-pickers@6.11.1`.
|
|
46
|
+
|
|
47
|
+
### Charts / `@mui/x-charts@v6.0.0-alpha.7`
|
|
48
|
+
|
|
49
|
+
- [charts] Fix label and tick alignment (#9952) @LukasTy
|
|
50
|
+
- [charts] Remove not functional component `styleOverrides` (#9996) @LukasTy
|
|
51
|
+
- [charts] Set custom ticks number (#9922) @alexfauquette
|
|
52
|
+
- [charts] Use `slot`/`slotProps` for customization (#9744) @alexfauquette
|
|
53
|
+
- [charts] Extend cheerful fiesta palette (#9980) @noraleonte
|
|
54
|
+
|
|
55
|
+
### Tree View / `@mui/x-tree-view@v6.0.0-alpha.1`
|
|
56
|
+
|
|
57
|
+
- [TreeView] Add theme augmentation (#9967) @flaviendelangle
|
|
58
|
+
|
|
59
|
+
### Docs
|
|
60
|
+
|
|
61
|
+
- [docs] Clarify the `shouldDisableClock` migration code options (#9920) @LukasTy
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [core] Port GitHub workflow for ensuring triage label is present (#9924) @DanailH
|
|
66
|
+
- [docs-infra] Fix the import samples in Api pages (#9898) @alexfauquette
|
|
67
|
+
|
|
6
68
|
## 6.11.0
|
|
7
69
|
|
|
8
70
|
_Aug 4, 2023_
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
2
|
+
import { ChartsAxisSlotComponentProps, ChartsAxisSlotsComponent, ChartsXAxisProps, ChartsYAxisProps } from '../models/axis';
|
|
3
3
|
export interface ChartsAxisProps {
|
|
4
4
|
/**
|
|
5
5
|
* Indicate which axis to display the top of the charts.
|
|
@@ -25,6 +25,16 @@ export interface ChartsAxisProps {
|
|
|
25
25
|
* @default null
|
|
26
26
|
*/
|
|
27
27
|
rightAxis?: null | string | ChartsYAxisProps;
|
|
28
|
+
/**
|
|
29
|
+
* Overridable component slots.
|
|
30
|
+
* @default {}
|
|
31
|
+
*/
|
|
32
|
+
slots?: ChartsAxisSlotsComponent;
|
|
33
|
+
/**
|
|
34
|
+
* The props used for each component slot.
|
|
35
|
+
* @default {}
|
|
36
|
+
*/
|
|
37
|
+
slotProps?: ChartsAxisSlotComponentProps;
|
|
28
38
|
}
|
|
29
39
|
declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
|
|
30
40
|
declare namespace ChartsAxis {
|
package/ChartsAxis/ChartsAxis.js
CHANGED
|
@@ -23,12 +23,23 @@ const getAxisId = propsValue => {
|
|
|
23
23
|
}
|
|
24
24
|
return propsValue;
|
|
25
25
|
};
|
|
26
|
+
const mergeProps = (axisConfig, slots, slotProps) => {
|
|
27
|
+
return typeof axisConfig === 'object' ? (0, _extends2.default)({}, axisConfig, {
|
|
28
|
+
slots: (0, _extends2.default)({}, slots, axisConfig?.slots),
|
|
29
|
+
slotProps: (0, _extends2.default)({}, slotProps, axisConfig?.slotProps)
|
|
30
|
+
}) : {
|
|
31
|
+
slots,
|
|
32
|
+
slotProps
|
|
33
|
+
};
|
|
34
|
+
};
|
|
26
35
|
function ChartsAxis(props) {
|
|
27
36
|
const {
|
|
28
37
|
topAxis,
|
|
29
38
|
leftAxis,
|
|
30
39
|
rightAxis,
|
|
31
|
-
bottomAxis
|
|
40
|
+
bottomAxis,
|
|
41
|
+
slots,
|
|
42
|
+
slotProps
|
|
32
43
|
} = props;
|
|
33
44
|
const {
|
|
34
45
|
xAxis,
|
|
@@ -56,20 +67,24 @@ function ChartsAxis(props) {
|
|
|
56
67
|
if (bottomId !== null && !xAxis[bottomId]) {
|
|
57
68
|
throw Error(`MUI: id used for bottom axis "${bottomId}" is not defined`);
|
|
58
69
|
}
|
|
70
|
+
const topAxisProps = mergeProps(topAxis, slots, slotProps);
|
|
71
|
+
const bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
|
|
72
|
+
const leftAxisProps = mergeProps(leftAxis, slots, slotProps);
|
|
73
|
+
const rightAxisProps = mergeProps(rightAxis, slots, slotProps);
|
|
59
74
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
60
|
-
children: [topId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({
|
|
75
|
+
children: [topId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({}, topAxisProps, {
|
|
61
76
|
position: "top",
|
|
62
77
|
axisId: topId
|
|
63
|
-
}
|
|
78
|
+
})), bottomId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsXAxis.ChartsXAxis, (0, _extends2.default)({}, bottomAxisProps, {
|
|
64
79
|
position: "bottom",
|
|
65
80
|
axisId: bottomId
|
|
66
|
-
}
|
|
81
|
+
})), leftId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({}, leftAxisProps, {
|
|
67
82
|
position: "left",
|
|
68
83
|
axisId: leftId
|
|
69
|
-
}
|
|
84
|
+
})), rightId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsYAxis.ChartsYAxis, (0, _extends2.default)({}, rightAxisProps, {
|
|
70
85
|
position: "right",
|
|
71
86
|
axisId: rightId
|
|
72
|
-
}
|
|
87
|
+
}))]
|
|
73
88
|
});
|
|
74
89
|
}
|
|
75
90
|
process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
@@ -91,8 +106,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
91
106
|
label: _propTypes.default.string,
|
|
92
107
|
labelFontSize: _propTypes.default.number,
|
|
93
108
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
109
|
+
slotProps: _propTypes.default.object,
|
|
110
|
+
slots: _propTypes.default.object,
|
|
94
111
|
stroke: _propTypes.default.string,
|
|
95
112
|
tickFontSize: _propTypes.default.number,
|
|
113
|
+
tickMaxStep: _propTypes.default.number,
|
|
114
|
+
tickMinStep: _propTypes.default.number,
|
|
115
|
+
tickNumber: _propTypes.default.number,
|
|
96
116
|
tickSize: _propTypes.default.number
|
|
97
117
|
}), _propTypes.default.string]),
|
|
98
118
|
/**
|
|
@@ -109,8 +129,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
109
129
|
label: _propTypes.default.string,
|
|
110
130
|
labelFontSize: _propTypes.default.number,
|
|
111
131
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
132
|
+
slotProps: _propTypes.default.object,
|
|
133
|
+
slots: _propTypes.default.object,
|
|
112
134
|
stroke: _propTypes.default.string,
|
|
113
135
|
tickFontSize: _propTypes.default.number,
|
|
136
|
+
tickMaxStep: _propTypes.default.number,
|
|
137
|
+
tickMinStep: _propTypes.default.number,
|
|
138
|
+
tickNumber: _propTypes.default.number,
|
|
114
139
|
tickSize: _propTypes.default.number
|
|
115
140
|
}), _propTypes.default.string]),
|
|
116
141
|
/**
|
|
@@ -127,10 +152,25 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
127
152
|
label: _propTypes.default.string,
|
|
128
153
|
labelFontSize: _propTypes.default.number,
|
|
129
154
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
155
|
+
slotProps: _propTypes.default.object,
|
|
156
|
+
slots: _propTypes.default.object,
|
|
130
157
|
stroke: _propTypes.default.string,
|
|
131
158
|
tickFontSize: _propTypes.default.number,
|
|
159
|
+
tickMaxStep: _propTypes.default.number,
|
|
160
|
+
tickMinStep: _propTypes.default.number,
|
|
161
|
+
tickNumber: _propTypes.default.number,
|
|
132
162
|
tickSize: _propTypes.default.number
|
|
133
163
|
}), _propTypes.default.string]),
|
|
164
|
+
/**
|
|
165
|
+
* The props used for each component slot.
|
|
166
|
+
* @default {}
|
|
167
|
+
*/
|
|
168
|
+
slotProps: _propTypes.default.object,
|
|
169
|
+
/**
|
|
170
|
+
* Overridable component slots.
|
|
171
|
+
* @default {}
|
|
172
|
+
*/
|
|
173
|
+
slots: _propTypes.default.object,
|
|
134
174
|
/**
|
|
135
175
|
* Indicate which axis to display the top of the charts.
|
|
136
176
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
@@ -145,8 +185,13 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
145
185
|
label: _propTypes.default.string,
|
|
146
186
|
labelFontSize: _propTypes.default.number,
|
|
147
187
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
188
|
+
slotProps: _propTypes.default.object,
|
|
189
|
+
slots: _propTypes.default.object,
|
|
148
190
|
stroke: _propTypes.default.string,
|
|
149
191
|
tickFontSize: _propTypes.default.number,
|
|
192
|
+
tickMaxStep: _propTypes.default.number,
|
|
193
|
+
tickMinStep: _propTypes.default.number,
|
|
194
|
+
tickNumber: _propTypes.default.number,
|
|
150
195
|
tickSize: _propTypes.default.number
|
|
151
196
|
}), _propTypes.default.string])
|
|
152
197
|
} : void 0;
|
|
@@ -2,9 +2,16 @@ import * as React from 'react';
|
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
3
|
import { DrawingArea } from '../context/DrawingProvider';
|
|
4
4
|
import { AnchorPosition, SizingParams } from './utils';
|
|
5
|
+
import { FormattedSeries } from '../context/SeriesContextProvider';
|
|
5
6
|
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
6
7
|
import { DefaultizedProps } from '../models/helpers';
|
|
7
|
-
import { ChartSeriesDefaultized } from '../models/seriesType/config';
|
|
8
|
+
import { ChartSeriesDefaultized, LegendParams } from '../models/seriesType/config';
|
|
9
|
+
export interface ChartsLegendSlotsComponent {
|
|
10
|
+
legend?: React.JSXElementConstructor<LegendRendererProps>;
|
|
11
|
+
}
|
|
12
|
+
export interface ChartsLegendSlotComponentProps {
|
|
13
|
+
legend?: Partial<LegendRendererProps>;
|
|
14
|
+
}
|
|
8
15
|
export type ChartsLegendProps = {
|
|
9
16
|
position?: AnchorPosition;
|
|
10
17
|
offset?: Partial<{
|
|
@@ -19,6 +26,16 @@ export type ChartsLegendProps = {
|
|
|
19
26
|
* Set to true to hide the legend.
|
|
20
27
|
*/
|
|
21
28
|
hidden?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Overridable component slots.
|
|
31
|
+
* @default {}
|
|
32
|
+
*/
|
|
33
|
+
slots?: ChartsLegendSlotsComponent;
|
|
34
|
+
/**
|
|
35
|
+
* The props used for each component slot.
|
|
36
|
+
* @default {}
|
|
37
|
+
*/
|
|
38
|
+
slotProps?: ChartsLegendSlotComponentProps;
|
|
22
39
|
} & SizingParams;
|
|
23
40
|
type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
|
|
24
41
|
type SeriesLegendOwnerState = ChartSeriesDefaultized<any> & Pick<DefaultizedChartsLegendProps, 'direction'> & {
|
|
@@ -44,5 +61,11 @@ export declare const ChartsLegendMark: import("@emotion/styled").StyledComponent
|
|
|
44
61
|
};
|
|
45
62
|
}, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
|
|
46
63
|
export declare const ChartsLegendLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
|
|
47
|
-
export
|
|
64
|
+
export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps, 'slots' | 'slotProps'> {
|
|
65
|
+
series: FormattedSeries;
|
|
66
|
+
seriesToDisplay: LegendParams[];
|
|
67
|
+
drawingArea: DrawingArea;
|
|
68
|
+
classes: Record<'label' | 'mark' | 'series' | 'root', string>;
|
|
69
|
+
}
|
|
70
|
+
export declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element;
|
|
48
71
|
export {};
|