@mui/x-charts 6.18.1 → 7.0.0-alpha.1
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 +558 -1
- 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
|
@@ -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.1
|
|
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.1
|
|
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
|
/**
|
|
@@ -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
|
const props = useThemeProps({
|
|
238
339
|
props: _extends({}, defaultProps, inProps),
|
|
239
340
|
name: 'MuiChartsLegend'
|
|
@@ -268,4 +369,39 @@ export function ChartsLegend(inProps) {
|
|
|
268
369
|
ownerState: {}
|
|
269
370
|
});
|
|
270
371
|
return /*#__PURE__*/_jsx(ChartLegendRender, _extends({}, chartLegendRenderProps));
|
|
271
|
-
}
|
|
372
|
+
}
|
|
373
|
+
process.env.NODE_ENV !== "production" ? ChartsLegend.propTypes = {
|
|
374
|
+
// ----------------------------- Warning --------------------------------
|
|
375
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
376
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
377
|
+
// ----------------------------------------------------------------------
|
|
378
|
+
/**
|
|
379
|
+
* Override or extend the styles applied to the component.
|
|
380
|
+
*/
|
|
381
|
+
classes: PropTypes.object,
|
|
382
|
+
/**
|
|
383
|
+
* The direction of the legend layout.
|
|
384
|
+
* The default depends on the chart.
|
|
385
|
+
*/
|
|
386
|
+
direction: PropTypes.oneOf(['column', 'row']),
|
|
387
|
+
/**
|
|
388
|
+
* Set to true to hide the legend.
|
|
389
|
+
* @default false
|
|
390
|
+
*/
|
|
391
|
+
hidden: PropTypes.bool,
|
|
392
|
+
position: PropTypes.shape({
|
|
393
|
+
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
394
|
+
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
395
|
+
}),
|
|
396
|
+
/**
|
|
397
|
+
* The props used for each component slot.
|
|
398
|
+
* @default {}
|
|
399
|
+
*/
|
|
400
|
+
slotProps: PropTypes.object,
|
|
401
|
+
/**
|
|
402
|
+
* Overridable component slots.
|
|
403
|
+
* @default {}
|
|
404
|
+
*/
|
|
405
|
+
slots: PropTypes.object
|
|
406
|
+
} : void 0;
|
|
407
|
+
export { ChartsLegend };
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts
|
|
2
|
+
* @mui/x-charts v7.0.0-alpha.1
|
|
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';
|