@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
|
@@ -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.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';
|