@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/PieChart/PieChart.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
|
3
3
|
import { ChartsAxisProps } from '../ChartsAxis/ChartsAxis';
|
|
4
4
|
import { PieSeriesType } from '../models/seriesType';
|
|
5
5
|
import { MakeOptional } from '../models/helpers';
|
|
6
|
-
import { ChartsTooltipProps,
|
|
7
|
-
import { ChartsLegendProps,
|
|
6
|
+
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
7
|
+
import { ChartsLegendProps, ChartsLegendSlotProps, ChartsLegendSlots } from '../ChartsLegend';
|
|
8
8
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
9
|
-
import { PiePlotProps,
|
|
9
|
+
import { PiePlotProps, PiePlotSlotProps, PiePlotSlots } from './PiePlot';
|
|
10
10
|
import { PieValueType } from '../models/seriesType/pie';
|
|
11
|
-
import {
|
|
12
|
-
export interface
|
|
11
|
+
import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
|
|
12
|
+
export interface PieChartSlots extends ChartsAxisSlots, PiePlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
|
|
13
13
|
}
|
|
14
|
-
export interface
|
|
14
|
+
export interface PieChartSlotProps extends ChartsAxisSlotProps, PiePlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
15
15
|
}
|
|
16
16
|
export interface PieChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
|
|
17
17
|
series: MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[];
|
|
@@ -22,12 +22,12 @@ export interface PieChartProps extends Omit<ResponsiveChartContainerProps, 'seri
|
|
|
22
22
|
*/
|
|
23
23
|
legend?: ChartsLegendProps;
|
|
24
24
|
onClick?: PiePlotProps['onClick'];
|
|
25
|
-
slots?:
|
|
25
|
+
slots?: PieChartSlots;
|
|
26
26
|
/**
|
|
27
27
|
* The props used for each component slot.
|
|
28
28
|
* @default {}
|
|
29
29
|
*/
|
|
30
|
-
slotProps?:
|
|
30
|
+
slotProps?: PieChartSlotProps;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Demos:
|
package/PieChart/PiePlot.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PieArcPlotProps,
|
|
3
|
-
import {
|
|
4
|
-
export interface
|
|
2
|
+
import { PieArcPlotProps, PieArcPlotSlotProps, PieArcPlotSlots } from './PieArcPlot';
|
|
3
|
+
import { PieArcLabelPlotSlots, PieArcLabelPlotSlotProps } from './PieArcLabelPlot';
|
|
4
|
+
export interface PiePlotSlots extends PieArcPlotSlots, PieArcLabelPlotSlots {
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface PiePlotSlotProps extends PieArcPlotSlotProps, PieArcLabelPlotSlotProps {
|
|
7
7
|
}
|
|
8
8
|
export interface PiePlotProps extends Pick<PieArcPlotProps, 'skipAnimation' | 'onClick'> {
|
|
9
9
|
/**
|
|
10
10
|
* Overridable component slots.
|
|
11
11
|
* @default {}
|
|
12
12
|
*/
|
|
13
|
-
slots?:
|
|
13
|
+
slots?: PiePlotSlots;
|
|
14
14
|
/**
|
|
15
15
|
* The props used for each component slot.
|
|
16
16
|
* @default {}
|
|
17
17
|
*/
|
|
18
|
-
slotProps?:
|
|
18
|
+
slotProps?: PiePlotSlotProps;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Demos:
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ScatterPlotSlotProps, ScatterPlotSlots } from './ScatterPlot';
|
|
3
3
|
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
4
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
5
5
|
import { ScatterSeriesType } from '../models/seriesType/scatter';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
|
-
import { ChartsTooltipProps,
|
|
8
|
-
import { ChartsLegendProps,
|
|
7
|
+
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
8
|
+
import { ChartsLegendProps, ChartsLegendSlotProps, ChartsLegendSlots } from '../ChartsLegend';
|
|
9
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
|
-
import {
|
|
11
|
-
export interface
|
|
10
|
+
import { ChartsAxisSlots, ChartsAxisSlotProps } from '../models/axis';
|
|
11
|
+
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
|
|
12
12
|
}
|
|
13
|
-
export interface
|
|
13
|
+
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
14
14
|
}
|
|
15
15
|
export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
16
16
|
series: MakeOptional<ScatterSeriesType, 'type'>[];
|
|
@@ -24,12 +24,12 @@ export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, '
|
|
|
24
24
|
* Overridable component slots.
|
|
25
25
|
* @default {}
|
|
26
26
|
*/
|
|
27
|
-
slots?:
|
|
27
|
+
slots?: ScatterChartSlots;
|
|
28
28
|
/**
|
|
29
29
|
* The props used for each component slot.
|
|
30
30
|
* @default {}
|
|
31
31
|
*/
|
|
32
|
-
slotProps?:
|
|
32
|
+
slotProps?: ScatterChartSlotProps;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Demos:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScatterProps } from './Scatter';
|
|
3
|
-
export interface
|
|
3
|
+
export interface ScatterPlotSlots {
|
|
4
4
|
scatter?: React.JSXElementConstructor<ScatterProps>;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface ScatterPlotSlotProps {
|
|
7
7
|
scatter?: Partial<ScatterProps>;
|
|
8
8
|
}
|
|
9
9
|
export interface ScatterPlotProps {
|
|
@@ -11,12 +11,12 @@ export interface ScatterPlotProps {
|
|
|
11
11
|
* Overridable component slots.
|
|
12
12
|
* @default {}
|
|
13
13
|
*/
|
|
14
|
-
slots?:
|
|
14
|
+
slots?: ScatterPlotSlots;
|
|
15
15
|
/**
|
|
16
16
|
* The props used for each component slot.
|
|
17
17
|
* @default {}
|
|
18
18
|
*/
|
|
19
|
-
slotProps?:
|
|
19
|
+
slotProps?: ScatterPlotSlotProps;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Demos:
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
3
|
-
import { ChartsTooltipProps,
|
|
3
|
+
import { ChartsTooltipProps, ChartsTooltipSlotProps, ChartsTooltipSlots } from '../ChartsTooltip';
|
|
4
4
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
5
5
|
import { AxisConfig } from '../models/axis';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
7
|
import { LineSeriesType } from '../models/seriesType/line';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
export interface
|
|
8
|
+
import { AreaPlotSlots, AreaPlotSlotProps } from '../LineChart/AreaPlot';
|
|
9
|
+
import { LinePlotSlots, LinePlotSlotProps } from '../LineChart/LinePlot';
|
|
10
|
+
import { MarkPlotSlots, MarkPlotSlotProps } from '../LineChart/MarkPlot';
|
|
11
|
+
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from '../LineChart/LineHighlightPlot';
|
|
12
|
+
import { BarPlotSlots, BarPlotSlotProps } from '../BarChart/BarPlot';
|
|
13
|
+
export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, BarPlotSlots, ChartsTooltipSlots {
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {
|
|
16
16
|
}
|
|
17
17
|
export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps, 'series' | 'xAxis' | 'yAxis'> {
|
|
18
18
|
/**
|
|
@@ -63,12 +63,12 @@ export interface SparkLineChartProps extends Omit<ResponsiveChartContainerProps,
|
|
|
63
63
|
* Overridable component slots.
|
|
64
64
|
* @default {}
|
|
65
65
|
*/
|
|
66
|
-
slots?:
|
|
66
|
+
slots?: SparkLineChartSlots;
|
|
67
67
|
/**
|
|
68
68
|
* The props used for each component slot.
|
|
69
69
|
* @default {}
|
|
70
70
|
*/
|
|
71
|
-
slotProps?:
|
|
71
|
+
slotProps?: SparkLineChartSlotProps;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Demos:
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
const _excluded = ["rotate", "dominantBaseline"],
|
|
4
4
|
_excluded2 = ["label"];
|
|
5
5
|
import * as React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
6
7
|
import { useSlotProps } from '@mui/base/utils';
|
|
7
8
|
import { NoSsr } from '@mui/base/NoSsr';
|
|
8
9
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
@@ -233,7 +234,107 @@ function DefaultChartsLegend(props) {
|
|
|
233
234
|
})
|
|
234
235
|
});
|
|
235
236
|
}
|
|
236
|
-
|
|
237
|
+
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
238
|
+
// ----------------------------- Warning --------------------------------
|
|
239
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
240
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
241
|
+
// ----------------------------------------------------------------------
|
|
242
|
+
/**
|
|
243
|
+
* Override or extend the styles applied to the component.
|
|
244
|
+
*/
|
|
245
|
+
classes: PropTypes.object.isRequired,
|
|
246
|
+
/**
|
|
247
|
+
* The direction of the legend layout.
|
|
248
|
+
* The default depends on the chart.
|
|
249
|
+
*/
|
|
250
|
+
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
251
|
+
drawingArea: PropTypes.shape({
|
|
252
|
+
bottom: PropTypes.number.isRequired,
|
|
253
|
+
height: PropTypes.number.isRequired,
|
|
254
|
+
left: PropTypes.number.isRequired,
|
|
255
|
+
right: PropTypes.number.isRequired,
|
|
256
|
+
top: PropTypes.number.isRequired,
|
|
257
|
+
width: PropTypes.number.isRequired
|
|
258
|
+
}).isRequired,
|
|
259
|
+
/**
|
|
260
|
+
* Set to true to hide the legend.
|
|
261
|
+
*/
|
|
262
|
+
hidden: PropTypes.bool,
|
|
263
|
+
/**
|
|
264
|
+
* Space between two legend items (in px).
|
|
265
|
+
* @default 10
|
|
266
|
+
*/
|
|
267
|
+
itemGap: PropTypes.number,
|
|
268
|
+
/**
|
|
269
|
+
* Height of the item mark (in px).
|
|
270
|
+
* @default 20
|
|
271
|
+
*/
|
|
272
|
+
itemMarkHeight: PropTypes.number,
|
|
273
|
+
/**
|
|
274
|
+
* Width of the item mark (in px).
|
|
275
|
+
* @default 20
|
|
276
|
+
*/
|
|
277
|
+
itemMarkWidth: PropTypes.number,
|
|
278
|
+
/**
|
|
279
|
+
* Style applied to legend labels.
|
|
280
|
+
* @default theme.typography.subtitle1
|
|
281
|
+
*/
|
|
282
|
+
labelStyle: PropTypes.object,
|
|
283
|
+
/**
|
|
284
|
+
* Space between the mark and the label (in px).
|
|
285
|
+
* @default 5
|
|
286
|
+
*/
|
|
287
|
+
markGap: PropTypes.number,
|
|
288
|
+
/**
|
|
289
|
+
* Legend padding (in px).
|
|
290
|
+
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
291
|
+
* @default 0
|
|
292
|
+
*/
|
|
293
|
+
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
294
|
+
bottom: PropTypes.number,
|
|
295
|
+
left: PropTypes.number,
|
|
296
|
+
right: PropTypes.number,
|
|
297
|
+
top: PropTypes.number
|
|
298
|
+
})]),
|
|
299
|
+
position: PropTypes.shape({
|
|
300
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
301
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
302
|
+
}).isRequired,
|
|
303
|
+
series: PropTypes.shape({
|
|
304
|
+
bar: PropTypes.shape({
|
|
305
|
+
series: PropTypes.object.isRequired,
|
|
306
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
307
|
+
stackingGroups: PropTypes.arrayOf(PropTypes.shape({
|
|
308
|
+
ids: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
309
|
+
stackingOffset: PropTypes.func.isRequired,
|
|
310
|
+
stackingOrder: PropTypes.func.isRequired
|
|
311
|
+
})).isRequired
|
|
312
|
+
}),
|
|
313
|
+
line: PropTypes.shape({
|
|
314
|
+
series: PropTypes.object.isRequired,
|
|
315
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
316
|
+
stackingGroups: PropTypes.arrayOf(PropTypes.shape({
|
|
317
|
+
ids: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
318
|
+
stackingOffset: PropTypes.func.isRequired,
|
|
319
|
+
stackingOrder: PropTypes.func.isRequired
|
|
320
|
+
})).isRequired
|
|
321
|
+
}),
|
|
322
|
+
pie: PropTypes.shape({
|
|
323
|
+
series: PropTypes.object.isRequired,
|
|
324
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
325
|
+
}),
|
|
326
|
+
scatter: PropTypes.shape({
|
|
327
|
+
series: PropTypes.object.isRequired,
|
|
328
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
329
|
+
})
|
|
330
|
+
}).isRequired,
|
|
331
|
+
seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({
|
|
332
|
+
color: PropTypes.string.isRequired,
|
|
333
|
+
id: PropTypes.string.isRequired,
|
|
334
|
+
label: PropTypes.string.isRequired
|
|
335
|
+
})).isRequired
|
|
336
|
+
} : void 0;
|
|
337
|
+
function ChartsLegend(inProps) {
|
|
237
338
|
var _slots$legend;
|
|
238
339
|
const props = useThemeProps({
|
|
239
340
|
props: _extends({}, defaultProps, inProps),
|
|
@@ -269,4 +370,39 @@ export function ChartsLegend(inProps) {
|
|
|
269
370
|
ownerState: {}
|
|
270
371
|
});
|
|
271
372
|
return /*#__PURE__*/_jsx(ChartLegendRender, _extends({}, chartLegendRenderProps));
|
|
272
|
-
}
|
|
373
|
+
}
|
|
374
|
+
process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
|
|
375
|
+
// ----------------------------- Warning --------------------------------
|
|
376
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
377
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
378
|
+
// ----------------------------------------------------------------------
|
|
379
|
+
/**
|
|
380
|
+
* Override or extend the styles applied to the component.
|
|
381
|
+
*/
|
|
382
|
+
classes: PropTypes.object,
|
|
383
|
+
/**
|
|
384
|
+
* The direction of the legend layout.
|
|
385
|
+
* The default depends on the chart.
|
|
386
|
+
*/
|
|
387
|
+
direction: PropTypes.oneOf(['column', 'row']),
|
|
388
|
+
/**
|
|
389
|
+
* Set to true to hide the legend.
|
|
390
|
+
* @default false
|
|
391
|
+
*/
|
|
392
|
+
hidden: PropTypes.bool,
|
|
393
|
+
position: PropTypes.shape({
|
|
394
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
395
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
396
|
+
}),
|
|
397
|
+
/**
|
|
398
|
+
* The props used for each component slot.
|
|
399
|
+
* @default {}
|
|
400
|
+
*/
|
|
401
|
+
slotProps: PropTypes.object,
|
|
402
|
+
/**
|
|
403
|
+
* Overridable component slots.
|
|
404
|
+
* @default {}
|
|
405
|
+
*/
|
|
406
|
+
slots: PropTypes.object
|
|
407
|
+
} : void 0;
|
|
408
|
+
export { ChartsLegend };
|
package/esm/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from './ChartsAxis';
|
|
|
9
9
|
export * from './ChartsXAxis';
|
|
10
10
|
export * from './ChartsYAxis';
|
|
11
11
|
export * from './ChartsTooltip';
|
|
12
|
+
export * from './ChartsLegend';
|
|
12
13
|
export * from './ChartsAxisHighlight';
|
|
13
14
|
export * from './BarChart';
|
|
14
15
|
export * from './LineChart';
|
package/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './ChartsAxis';
|
|
|
9
9
|
export * from './ChartsXAxis';
|
|
10
10
|
export * from './ChartsYAxis';
|
|
11
11
|
export * from './ChartsTooltip';
|
|
12
|
+
export * from './ChartsLegend';
|
|
12
13
|
export * from './ChartsAxisHighlight';
|
|
13
14
|
export * from './BarChart';
|
|
14
15
|
export * from './LineChart';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts
|
|
2
|
+
* @mui/x-charts v7.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -131,6 +131,17 @@ Object.keys(_ChartsTooltip).forEach(function (key) {
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
|
+
var _ChartsLegend = require("./ChartsLegend");
|
|
135
|
+
Object.keys(_ChartsLegend).forEach(function (key) {
|
|
136
|
+
if (key === "default" || key === "__esModule") return;
|
|
137
|
+
if (key in exports && exports[key] === _ChartsLegend[key]) return;
|
|
138
|
+
Object.defineProperty(exports, key, {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _ChartsLegend[key];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
134
145
|
var _ChartsAxisHighlight = require("./ChartsAxisHighlight");
|
|
135
146
|
Object.keys(_ChartsAxisHighlight).forEach(function (key) {
|
|
136
147
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -4,6 +4,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
var _excluded = ["rotate", "dominantBaseline"],
|
|
5
5
|
_excluded2 = ["label"];
|
|
6
6
|
import * as React from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import { useSlotProps } from '@mui/base/utils';
|
|
8
9
|
import { NoSsr } from '@mui/base/NoSsr';
|
|
9
10
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
@@ -247,7 +248,107 @@ function DefaultChartsLegend(props) {
|
|
|
247
248
|
})
|
|
248
249
|
});
|
|
249
250
|
}
|
|
250
|
-
|
|
251
|
+
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
252
|
+
// ----------------------------- Warning --------------------------------
|
|
253
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
254
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
255
|
+
// ----------------------------------------------------------------------
|
|
256
|
+
/**
|
|
257
|
+
* Override or extend the styles applied to the component.
|
|
258
|
+
*/
|
|
259
|
+
classes: PropTypes.object.isRequired,
|
|
260
|
+
/**
|
|
261
|
+
* The direction of the legend layout.
|
|
262
|
+
* The default depends on the chart.
|
|
263
|
+
*/
|
|
264
|
+
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
265
|
+
drawingArea: PropTypes.shape({
|
|
266
|
+
bottom: PropTypes.number.isRequired,
|
|
267
|
+
height: PropTypes.number.isRequired,
|
|
268
|
+
left: PropTypes.number.isRequired,
|
|
269
|
+
right: PropTypes.number.isRequired,
|
|
270
|
+
top: PropTypes.number.isRequired,
|
|
271
|
+
width: PropTypes.number.isRequired
|
|
272
|
+
}).isRequired,
|
|
273
|
+
/**
|
|
274
|
+
* Set to true to hide the legend.
|
|
275
|
+
*/
|
|
276
|
+
hidden: PropTypes.bool,
|
|
277
|
+
/**
|
|
278
|
+
* Space between two legend items (in px).
|
|
279
|
+
* @default 10
|
|
280
|
+
*/
|
|
281
|
+
itemGap: PropTypes.number,
|
|
282
|
+
/**
|
|
283
|
+
* Height of the item mark (in px).
|
|
284
|
+
* @default 20
|
|
285
|
+
*/
|
|
286
|
+
itemMarkHeight: PropTypes.number,
|
|
287
|
+
/**
|
|
288
|
+
* Width of the item mark (in px).
|
|
289
|
+
* @default 20
|
|
290
|
+
*/
|
|
291
|
+
itemMarkWidth: PropTypes.number,
|
|
292
|
+
/**
|
|
293
|
+
* Style applied to legend labels.
|
|
294
|
+
* @default theme.typography.subtitle1
|
|
295
|
+
*/
|
|
296
|
+
labelStyle: PropTypes.object,
|
|
297
|
+
/**
|
|
298
|
+
* Space between the mark and the label (in px).
|
|
299
|
+
* @default 5
|
|
300
|
+
*/
|
|
301
|
+
markGap: PropTypes.number,
|
|
302
|
+
/**
|
|
303
|
+
* Legend padding (in px).
|
|
304
|
+
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
305
|
+
* @default 0
|
|
306
|
+
*/
|
|
307
|
+
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
308
|
+
bottom: PropTypes.number,
|
|
309
|
+
left: PropTypes.number,
|
|
310
|
+
right: PropTypes.number,
|
|
311
|
+
top: PropTypes.number
|
|
312
|
+
})]),
|
|
313
|
+
position: PropTypes.shape({
|
|
314
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
315
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
316
|
+
}).isRequired,
|
|
317
|
+
series: PropTypes.shape({
|
|
318
|
+
bar: PropTypes.shape({
|
|
319
|
+
series: PropTypes.object.isRequired,
|
|
320
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
321
|
+
stackingGroups: PropTypes.arrayOf(PropTypes.shape({
|
|
322
|
+
ids: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
323
|
+
stackingOffset: PropTypes.func.isRequired,
|
|
324
|
+
stackingOrder: PropTypes.func.isRequired
|
|
325
|
+
})).isRequired
|
|
326
|
+
}),
|
|
327
|
+
line: PropTypes.shape({
|
|
328
|
+
series: PropTypes.object.isRequired,
|
|
329
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
330
|
+
stackingGroups: PropTypes.arrayOf(PropTypes.shape({
|
|
331
|
+
ids: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
332
|
+
stackingOffset: PropTypes.func.isRequired,
|
|
333
|
+
stackingOrder: PropTypes.func.isRequired
|
|
334
|
+
})).isRequired
|
|
335
|
+
}),
|
|
336
|
+
pie: PropTypes.shape({
|
|
337
|
+
series: PropTypes.object.isRequired,
|
|
338
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
339
|
+
}),
|
|
340
|
+
scatter: PropTypes.shape({
|
|
341
|
+
series: PropTypes.object.isRequired,
|
|
342
|
+
seriesOrder: PropTypes.arrayOf(PropTypes.string).isRequired
|
|
343
|
+
})
|
|
344
|
+
}).isRequired,
|
|
345
|
+
seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({
|
|
346
|
+
color: PropTypes.string.isRequired,
|
|
347
|
+
id: PropTypes.string.isRequired,
|
|
348
|
+
label: PropTypes.string.isRequired
|
|
349
|
+
})).isRequired
|
|
350
|
+
} : void 0;
|
|
351
|
+
function ChartsLegend(inProps) {
|
|
251
352
|
var _slots$legend;
|
|
252
353
|
var props = useThemeProps({
|
|
253
354
|
props: _extends({}, defaultProps, inProps),
|
|
@@ -281,4 +382,39 @@ export function ChartsLegend(inProps) {
|
|
|
281
382
|
ownerState: {}
|
|
282
383
|
});
|
|
283
384
|
return /*#__PURE__*/_jsx(ChartLegendRender, _extends({}, chartLegendRenderProps));
|
|
284
|
-
}
|
|
385
|
+
}
|
|
386
|
+
process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
|
|
387
|
+
// ----------------------------- Warning --------------------------------
|
|
388
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
389
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
390
|
+
// ----------------------------------------------------------------------
|
|
391
|
+
/**
|
|
392
|
+
* Override or extend the styles applied to the component.
|
|
393
|
+
*/
|
|
394
|
+
classes: PropTypes.object,
|
|
395
|
+
/**
|
|
396
|
+
* The direction of the legend layout.
|
|
397
|
+
* The default depends on the chart.
|
|
398
|
+
*/
|
|
399
|
+
direction: PropTypes.oneOf(['column', 'row']),
|
|
400
|
+
/**
|
|
401
|
+
* Set to true to hide the legend.
|
|
402
|
+
* @default false
|
|
403
|
+
*/
|
|
404
|
+
hidden: PropTypes.bool,
|
|
405
|
+
position: PropTypes.shape({
|
|
406
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
407
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
408
|
+
}),
|
|
409
|
+
/**
|
|
410
|
+
* The props used for each component slot.
|
|
411
|
+
* @default {}
|
|
412
|
+
*/
|
|
413
|
+
slotProps: PropTypes.object,
|
|
414
|
+
/**
|
|
415
|
+
* Overridable component slots.
|
|
416
|
+
* @default {}
|
|
417
|
+
*/
|
|
418
|
+
slots: PropTypes.object
|
|
419
|
+
} : void 0;
|
|
420
|
+
export { ChartsLegend };
|
package/legacy/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts
|
|
2
|
+
* @mui/x-charts v7.0.0-alpha.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -16,6 +16,7 @@ export * from './ChartsAxis';
|
|
|
16
16
|
export * from './ChartsXAxis';
|
|
17
17
|
export * from './ChartsYAxis';
|
|
18
18
|
export * from './ChartsTooltip';
|
|
19
|
+
export * from './ChartsLegend';
|
|
19
20
|
export * from './ChartsAxisHighlight';
|
|
20
21
|
export * from './BarChart';
|
|
21
22
|
export * from './LineChart';
|
package/models/axis.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ export type D3Scale<Domain extends {
|
|
|
7
7
|
toString(): string;
|
|
8
8
|
} = number | Date | string, Range = number, Output = number> = ScaleBand<Domain> | ScaleLogarithmic<Range, Output> | ScalePoint<Domain> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
|
|
9
9
|
export type D3ContinuouseScale<Range = number, Output = number> = ScaleLogarithmic<Range, Output> | ScalePower<Range, Output> | ScaleTime<Range, Output> | ScaleLinear<Range, Output>;
|
|
10
|
-
export interface
|
|
10
|
+
export interface ChartsAxisSlots {
|
|
11
11
|
axisLine?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement>>;
|
|
12
12
|
axisTick?: React.JSXElementConstructor<React.SVGAttributes<SVGPathElement>>;
|
|
13
13
|
axisTickLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
14
14
|
axisLabel?: React.JSXElementConstructor<ChartsTextProps>;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface ChartsAxisSlotProps {
|
|
17
17
|
axisLine?: Partial<React.SVGAttributes<SVGPathElement>>;
|
|
18
18
|
axisTick?: Partial<React.SVGAttributes<SVGPathElement>>;
|
|
19
19
|
axisTickLabel?: Partial<ChartsTextProps>;
|
|
@@ -89,12 +89,12 @@ export interface ChartsAxisProps extends TickParams {
|
|
|
89
89
|
* Overridable component slots.
|
|
90
90
|
* @default {}
|
|
91
91
|
*/
|
|
92
|
-
slots?: Partial<
|
|
92
|
+
slots?: Partial<ChartsAxisSlots>;
|
|
93
93
|
/**
|
|
94
94
|
* The props used for each component slot.
|
|
95
95
|
* @default {}
|
|
96
96
|
*/
|
|
97
|
-
slotProps?: Partial<
|
|
97
|
+
slotProps?: Partial<ChartsAxisSlotProps>;
|
|
98
98
|
}
|
|
99
99
|
export interface ChartsYAxisProps extends ChartsAxisProps {
|
|
100
100
|
/**
|