@mui/x-charts 8.0.0-alpha.5 → 8.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/AnimatedBarElement.js +1 -0
- package/BarChart/BarChart.js +17 -7
- package/BarChart/BarLabel/BarLabel.d.ts +1 -479
- package/BarChart/BarLabel/barLabelClasses.d.ts +1 -1
- package/BarChart/legend.js +1 -0
- package/BarChart/useBarChartProps.d.ts +4 -2
- package/BarChart/useBarChartProps.js +16 -3
- package/CHANGELOG.md +206 -1
- package/ChartsLabel/ChartsLabel.d.ts +2 -3
- package/ChartsLabel/ChartsLabel.js +3 -18
- package/ChartsLabel/ChartsLabelGradient.d.ts +9 -8
- package/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/ChartsLabel/ChartsLabelMark.d.ts +2 -3
- package/ChartsLabel/ChartsLabelMark.js +5 -2
- package/ChartsLabel/index.d.ts +7 -0
- package/ChartsLabel/index.js +6 -0
- package/ChartsLabel/labelClasses.d.ts +0 -1
- package/ChartsLabel/labelGradientClasses.d.ts +5 -4
- package/ChartsLabel/labelGradientClasses.js +3 -2
- package/ChartsLabel/labelMarkClasses.d.ts +3 -2
- package/ChartsLabel/labelMarkClasses.js +3 -2
- package/ChartsLabel/package.json +6 -0
- package/ChartsLegend/ChartsLegend.d.ts +18 -22
- package/ChartsLegend/ChartsLegend.js +100 -109
- package/ChartsLegend/ContinuousColorLegend.d.ts +29 -38
- package/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/ChartsLegend/PiecewiseColorLegend.d.ts +27 -19
- package/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/ChartsLegend/chartsLegend.types.d.ts +17 -60
- package/ChartsLegend/chartsLegendClasses.d.ts +7 -8
- package/ChartsLegend/chartsLegendClasses.js +16 -2
- package/ChartsLegend/colorLegend.types.d.ts +13 -0
- package/ChartsLegend/colorLegend.types.js +1 -0
- package/ChartsLegend/continuousColorLegendClasses.d.ts +26 -0
- package/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/ChartsLegend/direction.d.ts +1 -0
- package/ChartsLegend/direction.js +1 -0
- package/ChartsLegend/index.d.ts +13 -3
- package/ChartsLegend/index.js +9 -3
- package/ChartsLegend/legend.types.d.ts +10 -54
- package/ChartsLegend/legendContext.types.d.ts +55 -0
- package/ChartsLegend/legendContext.types.js +1 -0
- package/ChartsLegend/onClickContextBuilder.d.ts +2 -0
- package/ChartsLegend/onClickContextBuilder.js +7 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.d.ts +2 -0
- package/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/ChartsLegend/piecewiseColorLegend.types.d.ts +26 -0
- package/ChartsLegend/piecewiseColorLegend.types.js +1 -0
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +28 -0
- package/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/ChartsLegend/useAxis.d.ts +1 -1
- package/ChartsLegend/useAxis.js +0 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsSurface/ChartsSurface.js +0 -1
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/LineChart/AnimatedArea.js +1 -0
- package/LineChart/AnimatedLine.js +1 -0
- package/LineChart/AppearingMask.js +1 -0
- package/LineChart/CircleMarkElement.js +1 -0
- package/LineChart/LineChart.js +20 -10
- package/LineChart/MarkElement.js +3 -1
- package/LineChart/legend.js +1 -0
- package/LineChart/useLineChartProps.d.ts +4 -2
- package/LineChart/useLineChartProps.js +15 -2
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PieArcLabel.js +13 -9
- package/PieChart/PieArcLabelPlot.js +1 -0
- package/PieChart/PieArcPlot.js +1 -0
- package/PieChart/PieChart.js +42 -41
- package/PieChart/legend.js +1 -0
- package/ScatterChart/ScatterChart.js +21 -11
- package/ScatterChart/legend.js +1 -0
- package/ScatterChart/useScatterChartProps.d.ts +4 -2
- package/ScatterChart/useScatterChartProps.js +15 -2
- package/SparkLineChart/SparkLineChart.js +1 -4
- package/constants/index.d.ts +1 -0
- package/constants/index.js +2 -1
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -9
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +18 -18
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -9
- package/context/ChartProvider/ChartProvider.types.d.ts +1 -1
- package/context/InteractionSelectors.d.ts +11 -11
- package/context/PluginProvider/SeriesFormatter.types.d.ts +1 -1
- package/context/PluginProvider/mergePlugins.d.ts +8 -8
- package/context/SizeProvider/Size.types.d.ts +1 -1
- package/context/SizeProvider/useChartContainerDimensions.d.ts +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useLegend.d.ts +13 -0
- package/{modern/ChartsLegend/utils.js → hooks/useLegend.js} +20 -1
- package/hooks/useSvgRef.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/internals/calculateMargins.d.ts +7 -0
- package/internals/calculateMargins.js +25 -0
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +60 -16
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +13 -0
- package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.d.ts +17 -0
- package/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/internals/components/ChartsWrapper/index.d.ts +1 -0
- package/internals/components/ChartsWrapper/index.js +1 -0
- package/internals/consumeSlots.d.ts +48 -0
- package/internals/consumeSlots.js +101 -0
- package/internals/consumeThemeProps.d.ts +3 -7
- package/internals/consumeThemeProps.js +18 -27
- package/internals/defaultizeColor.d.ts +6 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +11 -11
- package/internals/plugins/models/plugin.d.ts +1 -1
- package/internals/store/useCharts.d.ts +2 -2
- package/internals/store/useCharts.types.d.ts +1 -1
- package/models/seriesType/common.d.ts +9 -0
- package/models/seriesType/pie.d.ts +9 -0
- package/modern/BarChart/AnimatedBarElement.js +1 -0
- package/modern/BarChart/BarChart.js +17 -7
- package/modern/BarChart/legend.js +1 -0
- package/modern/BarChart/useBarChartProps.js +16 -3
- package/modern/ChartsLabel/ChartsLabel.js +3 -18
- package/modern/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/modern/ChartsLabel/ChartsLabelMark.js +5 -2
- package/modern/ChartsLabel/index.js +6 -0
- package/modern/ChartsLabel/labelGradientClasses.js +3 -2
- package/modern/ChartsLabel/labelMarkClasses.js +3 -2
- package/modern/ChartsLegend/ChartsLegend.js +100 -109
- package/modern/ChartsLegend/ContinuousColorLegend.js +198 -321
- package/modern/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/modern/ChartsLegend/chartsLegendClasses.js +16 -2
- package/modern/ChartsLegend/colorLegend.types.js +1 -0
- package/modern/ChartsLegend/continuousColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/direction.js +1 -0
- package/modern/ChartsLegend/index.js +9 -3
- package/modern/ChartsLegend/legendContext.types.js +1 -0
- package/modern/ChartsLegend/onClickContextBuilder.js +7 -0
- package/modern/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +9 -0
- package/modern/ChartsLegend/piecewiseColorLegend.types.js +1 -0
- package/modern/ChartsLegend/piecewiseColorLegendClasses.js +23 -0
- package/modern/ChartsLegend/useAxis.js +0 -1
- package/modern/ChartsSurface/ChartsSurface.js +0 -1
- package/modern/LineChart/AnimatedArea.js +1 -0
- package/modern/LineChart/AnimatedLine.js +1 -0
- package/modern/LineChart/AppearingMask.js +1 -0
- package/modern/LineChart/CircleMarkElement.js +1 -0
- package/modern/LineChart/LineChart.js +20 -10
- package/modern/LineChart/MarkElement.js +3 -1
- package/modern/LineChart/legend.js +1 -0
- package/modern/LineChart/useLineChartProps.js +15 -2
- package/modern/PieChart/PieArc.js +3 -1
- package/modern/PieChart/PieArcLabel.js +13 -9
- package/modern/PieChart/PieArcLabelPlot.js +1 -0
- package/modern/PieChart/PieArcPlot.js +1 -0
- package/modern/PieChart/PieChart.js +42 -41
- package/modern/PieChart/legend.js +1 -0
- package/modern/ScatterChart/ScatterChart.js +21 -11
- package/modern/ScatterChart/legend.js +1 -0
- package/modern/ScatterChart/useScatterChartProps.js +15 -2
- package/modern/SparkLineChart/SparkLineChart.js +1 -4
- package/modern/constants/index.js +2 -1
- package/modern/hooks/index.js +2 -1
- package/{ChartsLegend/utils.js → modern/hooks/useLegend.js} +20 -1
- package/modern/index.js +2 -1
- package/modern/internals/calculateMargins.js +25 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +60 -16
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +61 -0
- package/modern/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/modern/internals/components/ChartsWrapper/ChartsWrapper.js +66 -0
- package/modern/internals/components/ChartsWrapper/index.js +1 -0
- package/modern/internals/consumeSlots.js +101 -0
- package/modern/internals/consumeThemeProps.js +18 -27
- package/modern/internals/index.js +1 -0
- package/node/BarChart/AnimatedBarElement.js +1 -0
- package/node/BarChart/BarChart.js +17 -7
- package/node/BarChart/legend.js +1 -0
- package/node/BarChart/useBarChartProps.js +15 -3
- package/node/ChartsLabel/ChartsLabel.js +3 -18
- package/node/ChartsLabel/ChartsLabelGradient.js +21 -18
- package/node/ChartsLabel/ChartsLabelMark.js +5 -2
- package/node/ChartsLabel/index.js +26 -0
- package/node/ChartsLabel/labelGradientClasses.js +3 -2
- package/node/ChartsLabel/labelMarkClasses.js +3 -2
- package/node/ChartsLegend/ChartsLegend.js +99 -108
- package/node/ChartsLegend/ContinuousColorLegend.js +199 -322
- package/node/ChartsLegend/PiecewiseColorLegend.js +201 -111
- package/node/ChartsLegend/chartsLegendClasses.js +17 -3
- package/node/ChartsLegend/colorLegend.types.js +5 -0
- package/node/ChartsLegend/continuousColorLegendClasses.js +31 -0
- package/node/ChartsLegend/direction.js +5 -0
- package/node/ChartsLegend/index.js +80 -16
- package/node/ChartsLegend/legendContext.types.js +5 -0
- package/node/ChartsLegend/onClickContextBuilder.js +14 -0
- package/node/ChartsLegend/piecewiseColorDefaultLabelFormatter.js +15 -0
- package/node/ChartsLegend/piecewiseColorLegend.types.js +5 -0
- package/node/ChartsLegend/piecewiseColorLegendClasses.js +31 -0
- package/node/ChartsSurface/ChartsSurface.js +0 -1
- package/node/LineChart/AnimatedArea.js +1 -0
- package/node/LineChart/AnimatedLine.js +1 -0
- package/node/LineChart/AppearingMask.js +1 -0
- package/node/LineChart/CircleMarkElement.js +1 -0
- package/node/LineChart/LineChart.js +20 -10
- package/node/LineChart/MarkElement.js +3 -1
- package/node/LineChart/legend.js +1 -0
- package/node/LineChart/useLineChartProps.js +14 -2
- package/node/PieChart/PieArc.js +3 -1
- package/node/PieChart/PieArcLabel.js +13 -9
- package/node/PieChart/PieArcLabelPlot.js +1 -0
- package/node/PieChart/PieArcPlot.js +1 -0
- package/node/PieChart/PieChart.js +42 -41
- package/node/PieChart/legend.js +1 -0
- package/node/ScatterChart/ScatterChart.js +21 -11
- package/node/ScatterChart/legend.js +1 -0
- package/node/ScatterChart/useScatterChartProps.js +14 -2
- package/node/SparkLineChart/SparkLineChart.js +1 -4
- package/node/constants/index.js +3 -2
- package/node/hooks/index.js +13 -1
- package/node/{ChartsLegend/utils.js → hooks/useLegend.js} +19 -1
- package/node/index.js +12 -1
- package/node/internals/calculateMargins.js +33 -0
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +61 -16
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +6 -6
- package/node/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +69 -0
- package/node/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.js +3 -0
- package/node/internals/components/ChartsWrapper/ChartsWrapper.js +72 -0
- package/node/internals/components/ChartsWrapper/index.js +16 -0
- package/node/internals/consumeSlots.js +109 -0
- package/node/internals/consumeThemeProps.js +18 -27
- package/node/internals/index.js +12 -0
- package/package.json +4 -4
- package/ChartsLegend/ChartsLegendItem.d.ts +0 -26
- package/ChartsLegend/ChartsLegendItem.js +0 -65
- package/ChartsLegend/DefaultChartsLegend.d.ts +0 -25
- package/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/ChartsLegend/LegendPerItem.d.ts +0 -65
- package/ChartsLegend/LegendPerItem.js +0 -129
- package/ChartsLegend/legendItemsPlacement.d.ts +0 -3
- package/ChartsLegend/legendItemsPlacement.js +0 -72
- package/ChartsLegend/utils.d.ts +0 -2
- package/modern/ChartsLegend/ChartsLegendItem.js +0 -65
- package/modern/ChartsLegend/DefaultChartsLegend.js +0 -112
- package/modern/ChartsLegend/LegendPerItem.js +0 -129
- package/modern/ChartsLegend/legendItemsPlacement.js +0 -72
- package/node/ChartsLegend/ChartsLegendItem.js +0 -72
- package/node/ChartsLegend/DefaultChartsLegend.js +0 -118
- package/node/ChartsLegend/LegendPerItem.js +0 -137
- package/node/ChartsLegend/legendItemsPlacement.js +0 -79
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["seriesToDisplay", "hidden", "onItemClick"];
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { LegendPerItem } from "./LegendPerItem.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const seriesContextBuilder = context => ({
|
|
11
|
-
type: 'series',
|
|
12
|
-
color: context.color,
|
|
13
|
-
label: context.label,
|
|
14
|
-
seriesId: context.seriesId,
|
|
15
|
-
itemId: context.itemId
|
|
16
|
-
});
|
|
17
|
-
function DefaultChartsLegend(props) {
|
|
18
|
-
const {
|
|
19
|
-
seriesToDisplay,
|
|
20
|
-
hidden,
|
|
21
|
-
onItemClick
|
|
22
|
-
} = props,
|
|
23
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
|
-
if (hidden) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, {
|
|
28
|
-
itemsToDisplay: seriesToDisplay,
|
|
29
|
-
onItemClick: onItemClick ? (event, i) => onItemClick(event, seriesContextBuilder(seriesToDisplay[i]), i) : undefined
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
33
|
-
// ----------------------------- Warning --------------------------------
|
|
34
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
35
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
36
|
-
// ----------------------------------------------------------------------
|
|
37
|
-
/**
|
|
38
|
-
* Override or extend the styles applied to the component.
|
|
39
|
-
*/
|
|
40
|
-
classes: PropTypes.object,
|
|
41
|
-
/**
|
|
42
|
-
* The direction of the legend layout.
|
|
43
|
-
* The default depends on the chart.
|
|
44
|
-
*/
|
|
45
|
-
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
46
|
-
/**
|
|
47
|
-
* Set to true to hide the legend.
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
hidden: PropTypes.bool,
|
|
51
|
-
/**
|
|
52
|
-
* Space between two legend items (in px).
|
|
53
|
-
* @default 10
|
|
54
|
-
*/
|
|
55
|
-
itemGap: PropTypes.number,
|
|
56
|
-
/**
|
|
57
|
-
* Height of the item mark (in px).
|
|
58
|
-
* @default 20
|
|
59
|
-
*/
|
|
60
|
-
itemMarkHeight: PropTypes.number,
|
|
61
|
-
/**
|
|
62
|
-
* Width of the item mark (in px).
|
|
63
|
-
* @default 20
|
|
64
|
-
*/
|
|
65
|
-
itemMarkWidth: PropTypes.number,
|
|
66
|
-
/**
|
|
67
|
-
* Style applied to legend labels.
|
|
68
|
-
* @default theme.typography.subtitle1
|
|
69
|
-
*/
|
|
70
|
-
labelStyle: PropTypes.object,
|
|
71
|
-
/**
|
|
72
|
-
* Space between the mark and the label (in px).
|
|
73
|
-
* @default 5
|
|
74
|
-
*/
|
|
75
|
-
markGap: PropTypes.number,
|
|
76
|
-
/**
|
|
77
|
-
* Callback fired when a legend item is clicked.
|
|
78
|
-
* @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
|
|
79
|
-
* @param {SeriesLegendItemContext} legendItem The legend item data.
|
|
80
|
-
* @param {number} index The index of the clicked legend item.
|
|
81
|
-
*/
|
|
82
|
-
onItemClick: PropTypes.func,
|
|
83
|
-
/**
|
|
84
|
-
* Legend padding (in px).
|
|
85
|
-
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
86
|
-
* @default 10
|
|
87
|
-
*/
|
|
88
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
89
|
-
bottom: PropTypes.number,
|
|
90
|
-
left: PropTypes.number,
|
|
91
|
-
right: PropTypes.number,
|
|
92
|
-
top: PropTypes.number
|
|
93
|
-
})]),
|
|
94
|
-
/**
|
|
95
|
-
* The position of the legend.
|
|
96
|
-
*/
|
|
97
|
-
position: PropTypes.shape({
|
|
98
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
99
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
100
|
-
}).isRequired,
|
|
101
|
-
series: PropTypes.object.isRequired,
|
|
102
|
-
seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({
|
|
103
|
-
color: PropTypes.string.isRequired,
|
|
104
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
105
|
-
itemId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
106
|
-
label: PropTypes.string.isRequired,
|
|
107
|
-
maxValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
108
|
-
minValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
109
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
110
|
-
})).isRequired
|
|
111
|
-
} : void 0;
|
|
112
|
-
export { DefaultChartsLegend };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
3
|
-
import { DrawingAreaState } from '../context/DrawingAreaProvider';
|
|
4
|
-
import { ChartsTextStyle } from '../ChartsText';
|
|
5
|
-
import { CardinalDirections } from '../models/layout';
|
|
6
|
-
import { LegendItemParams } from './chartsLegend.types';
|
|
7
|
-
import { AnchorPosition, Direction, LegendPlacement } from './legend.types';
|
|
8
|
-
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
9
|
-
export type ChartsLegendRootOwnerState = {
|
|
10
|
-
position: AnchorPosition;
|
|
11
|
-
direction: Direction;
|
|
12
|
-
drawingArea: DrawingAreaState;
|
|
13
|
-
offsetX?: number;
|
|
14
|
-
offsetY?: number;
|
|
15
|
-
seriesNumber: number;
|
|
16
|
-
};
|
|
17
|
-
export declare const ChartsLegendRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
|
|
18
|
-
export interface LegendPerItemProps extends DefaultizedProps<LegendPlacement, keyof LegendPlacement> {
|
|
19
|
-
/**
|
|
20
|
-
* The ordered array of item to display in the legend.
|
|
21
|
-
*/
|
|
22
|
-
itemsToDisplay: LegendItemParams[];
|
|
23
|
-
/**
|
|
24
|
-
* Override or extend the styles applied to the component.
|
|
25
|
-
*/
|
|
26
|
-
classes?: Partial<ChartsLegendClasses>;
|
|
27
|
-
/**
|
|
28
|
-
* Style applied to legend labels.
|
|
29
|
-
* @default theme.typography.subtitle1
|
|
30
|
-
*/
|
|
31
|
-
labelStyle?: ChartsTextStyle;
|
|
32
|
-
/**
|
|
33
|
-
* Width of the item mark (in px).
|
|
34
|
-
* @default 20
|
|
35
|
-
*/
|
|
36
|
-
itemMarkWidth?: number;
|
|
37
|
-
/**
|
|
38
|
-
* Height of the item mark (in px).
|
|
39
|
-
* @default 20
|
|
40
|
-
*/
|
|
41
|
-
itemMarkHeight?: number;
|
|
42
|
-
/**
|
|
43
|
-
* Space between the mark and the label (in px).
|
|
44
|
-
* @default 5
|
|
45
|
-
*/
|
|
46
|
-
markGap?: number;
|
|
47
|
-
/**
|
|
48
|
-
* Space between two legend items (in px).
|
|
49
|
-
* @default 10
|
|
50
|
-
*/
|
|
51
|
-
itemGap?: number;
|
|
52
|
-
/**
|
|
53
|
-
* Legend padding (in px).
|
|
54
|
-
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
55
|
-
* @default 10
|
|
56
|
-
*/
|
|
57
|
-
padding?: number | Partial<CardinalDirections<number>>;
|
|
58
|
-
onItemClick?: (event: React.MouseEvent<SVGRectElement, MouseEvent>, index: number) => void;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Internal component to display an array of items as a legend.
|
|
62
|
-
* Used for series legend, and threshold color legend.
|
|
63
|
-
* @ignore - Do not document
|
|
64
|
-
*/
|
|
65
|
-
export declare function LegendPerItem(props: LegendPerItemProps): React.JSX.Element;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["rotate", "dominantBaseline"];
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import NoSsr from '@mui/material/NoSsr';
|
|
8
|
-
import { useTheme, styled } from '@mui/material/styles';
|
|
9
|
-
import { getWordsByLines } from "../internals/getWordsByLines.js";
|
|
10
|
-
import { legendItemPlacements } from "./legendItemsPlacement.js";
|
|
11
|
-
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
12
|
-
import { ChartsLegendItem } from "./ChartsLegendItem.js";
|
|
13
|
-
import { createElement as _createElement } from "react";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
export const ChartsLegendRoot = styled('g', {
|
|
16
|
-
name: 'MuiChartsLegend',
|
|
17
|
-
slot: 'Root',
|
|
18
|
-
overridesResolver: (props, styles) => styles.root
|
|
19
|
-
})({});
|
|
20
|
-
/**
|
|
21
|
-
* Transforms number or partial padding object to a defaultized padding object.
|
|
22
|
-
*/
|
|
23
|
-
const getStandardizedPadding = padding => {
|
|
24
|
-
if (typeof padding === 'number') {
|
|
25
|
-
return {
|
|
26
|
-
left: padding,
|
|
27
|
-
right: padding,
|
|
28
|
-
top: padding,
|
|
29
|
-
bottom: padding
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return _extends({
|
|
33
|
-
left: 0,
|
|
34
|
-
right: 0,
|
|
35
|
-
top: 0,
|
|
36
|
-
bottom: 0
|
|
37
|
-
}, padding);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Internal component to display an array of items as a legend.
|
|
42
|
-
* Used for series legend, and threshold color legend.
|
|
43
|
-
* @ignore - Do not document
|
|
44
|
-
*/
|
|
45
|
-
export function LegendPerItem(props) {
|
|
46
|
-
const {
|
|
47
|
-
position,
|
|
48
|
-
direction,
|
|
49
|
-
itemsToDisplay,
|
|
50
|
-
classes,
|
|
51
|
-
itemMarkWidth = 20,
|
|
52
|
-
itemMarkHeight = 20,
|
|
53
|
-
markGap = 5,
|
|
54
|
-
itemGap = 10,
|
|
55
|
-
padding: paddingProps = 10,
|
|
56
|
-
labelStyle: inLabelStyle,
|
|
57
|
-
onItemClick
|
|
58
|
-
} = props;
|
|
59
|
-
const theme = useTheme();
|
|
60
|
-
const drawingArea = useDrawingArea();
|
|
61
|
-
const labelStyle = React.useMemo(() => _extends({}, theme.typography.subtitle1, {
|
|
62
|
-
color: 'inherit',
|
|
63
|
-
dominantBaseline: 'central',
|
|
64
|
-
textAnchor: 'start',
|
|
65
|
-
fill: (theme.vars || theme).palette.text.primary,
|
|
66
|
-
lineHeight: 1
|
|
67
|
-
}, inLabelStyle),
|
|
68
|
-
// To say to TS that the dominantBaseline and textAnchor are correct
|
|
69
|
-
[inLabelStyle, theme]);
|
|
70
|
-
const padding = React.useMemo(() => getStandardizedPadding(paddingProps), [paddingProps]);
|
|
71
|
-
const getItemSpace = React.useCallback((label, inStyle = {}) => {
|
|
72
|
-
const style = _objectWithoutPropertiesLoose(inStyle, _excluded);
|
|
73
|
-
const linesSize = getWordsByLines({
|
|
74
|
-
style,
|
|
75
|
-
needsComputation: true,
|
|
76
|
-
text: label
|
|
77
|
-
});
|
|
78
|
-
const innerSize = {
|
|
79
|
-
innerWidth: itemMarkWidth + markGap + Math.max(...linesSize.map(size => size.width)),
|
|
80
|
-
innerHeight: Math.max(itemMarkHeight, linesSize.length * linesSize[0].height)
|
|
81
|
-
};
|
|
82
|
-
return _extends({}, innerSize, {
|
|
83
|
-
outerWidth: innerSize.innerWidth + itemGap,
|
|
84
|
-
outerHeight: innerSize.innerHeight + itemGap
|
|
85
|
-
});
|
|
86
|
-
}, [itemGap, itemMarkHeight, itemMarkWidth, markGap]);
|
|
87
|
-
const totalWidth = drawingArea.left + drawingArea.width + drawingArea.right;
|
|
88
|
-
const totalHeight = drawingArea.top + drawingArea.height + drawingArea.bottom;
|
|
89
|
-
const availableWidth = totalWidth - padding.left - padding.right;
|
|
90
|
-
const availableHeight = totalHeight - padding.top - padding.bottom;
|
|
91
|
-
const [itemsWithPosition, legendWidth, legendHeight] = React.useMemo(() => legendItemPlacements(itemsToDisplay, getItemSpace, labelStyle, direction, availableWidth, availableHeight, itemGap), [itemsToDisplay, getItemSpace, labelStyle, direction, availableWidth, availableHeight, itemGap]);
|
|
92
|
-
const gapX = React.useMemo(() => {
|
|
93
|
-
switch (position.horizontal) {
|
|
94
|
-
case 'left':
|
|
95
|
-
return padding.left;
|
|
96
|
-
case 'right':
|
|
97
|
-
return totalWidth - padding.right - legendWidth;
|
|
98
|
-
default:
|
|
99
|
-
return (totalWidth - legendWidth) / 2;
|
|
100
|
-
}
|
|
101
|
-
}, [position.horizontal, padding.left, padding.right, totalWidth, legendWidth]);
|
|
102
|
-
const gapY = React.useMemo(() => {
|
|
103
|
-
switch (position.vertical) {
|
|
104
|
-
case 'top':
|
|
105
|
-
return padding.top;
|
|
106
|
-
case 'bottom':
|
|
107
|
-
return totalHeight - padding.bottom - legendHeight;
|
|
108
|
-
default:
|
|
109
|
-
return (totalHeight - legendHeight) / 2;
|
|
110
|
-
}
|
|
111
|
-
}, [position.vertical, padding.top, padding.bottom, totalHeight, legendHeight]);
|
|
112
|
-
return /*#__PURE__*/_jsx(NoSsr, {
|
|
113
|
-
children: /*#__PURE__*/_jsx(ChartsLegendRoot, {
|
|
114
|
-
className: classes?.root,
|
|
115
|
-
children: itemsWithPosition.map((item, i) => /*#__PURE__*/_createElement(ChartsLegendItem, _extends({}, item, {
|
|
116
|
-
key: item.id,
|
|
117
|
-
gapX: gapX,
|
|
118
|
-
gapY: gapY,
|
|
119
|
-
legendWidth: legendWidth,
|
|
120
|
-
itemMarkHeight: itemMarkHeight,
|
|
121
|
-
itemMarkWidth: itemMarkWidth,
|
|
122
|
-
markGap: markGap,
|
|
123
|
-
labelStyle: labelStyle,
|
|
124
|
-
classes: classes,
|
|
125
|
-
onClick: onItemClick ? event => onItemClick(event, i) : undefined
|
|
126
|
-
})))
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ChartsTextStyle } from '../ChartsText';
|
|
2
|
-
import { GetItemSpaceType, LegendItemParams, LegendItemWithPosition } from './chartsLegend.types';
|
|
3
|
-
export declare function legendItemPlacements(itemsToDisplay: LegendItemParams[], getItemSpace: GetItemSpaceType, labelStyle: ChartsTextStyle, direction: string, availableWidth: number, availableHeight: number, itemGap: number): [LegendItemWithPosition[], number, number];
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["label"];
|
|
4
|
-
export function legendItemPlacements(itemsToDisplay, getItemSpace, labelStyle, direction, availableWidth, availableHeight, itemGap) {
|
|
5
|
-
// Start at 0, 0. Will be modified later by padding and position.
|
|
6
|
-
let x = 0;
|
|
7
|
-
let y = 0;
|
|
8
|
-
|
|
9
|
-
// total values used to align legend later.
|
|
10
|
-
let totalWidthUsed = 0;
|
|
11
|
-
let totalHeightUsed = 0;
|
|
12
|
-
let rowIndex = 0;
|
|
13
|
-
const rowMaxHeight = [0];
|
|
14
|
-
const seriesWithRawPosition = itemsToDisplay.map(_ref => {
|
|
15
|
-
let {
|
|
16
|
-
label
|
|
17
|
-
} = _ref,
|
|
18
|
-
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
-
const itemSpace = getItemSpace(label, labelStyle);
|
|
20
|
-
const rep = _extends({}, other, {
|
|
21
|
-
label,
|
|
22
|
-
positionX: x,
|
|
23
|
-
positionY: y,
|
|
24
|
-
innerHeight: itemSpace.innerHeight,
|
|
25
|
-
innerWidth: itemSpace.innerWidth,
|
|
26
|
-
outerHeight: itemSpace.outerHeight,
|
|
27
|
-
outerWidth: itemSpace.outerWidth,
|
|
28
|
-
rowIndex
|
|
29
|
-
});
|
|
30
|
-
if (direction === 'row') {
|
|
31
|
-
if (x + itemSpace.innerWidth > availableWidth) {
|
|
32
|
-
// This legend item would create overflow along the x-axis, so we start a new row.
|
|
33
|
-
x = 0;
|
|
34
|
-
y += rowMaxHeight[rowIndex];
|
|
35
|
-
rowIndex += 1;
|
|
36
|
-
if (rowMaxHeight.length <= rowIndex) {
|
|
37
|
-
rowMaxHeight.push(0);
|
|
38
|
-
}
|
|
39
|
-
rep.positionX = x;
|
|
40
|
-
rep.positionY = y;
|
|
41
|
-
rep.rowIndex = rowIndex;
|
|
42
|
-
}
|
|
43
|
-
totalWidthUsed = Math.max(totalWidthUsed, x + itemSpace.outerWidth);
|
|
44
|
-
totalHeightUsed = Math.max(totalHeightUsed, y + itemSpace.outerHeight);
|
|
45
|
-
rowMaxHeight[rowIndex] = Math.max(rowMaxHeight[rowIndex], itemSpace.outerHeight);
|
|
46
|
-
x += itemSpace.outerWidth;
|
|
47
|
-
}
|
|
48
|
-
if (direction === 'column') {
|
|
49
|
-
if (y + itemSpace.innerHeight > availableHeight) {
|
|
50
|
-
// This legend item would create overflow along the y-axis, so we start a new column.
|
|
51
|
-
x = totalWidthUsed + itemGap;
|
|
52
|
-
y = 0;
|
|
53
|
-
rowIndex = 0;
|
|
54
|
-
rep.positionX = x;
|
|
55
|
-
rep.positionY = y;
|
|
56
|
-
rep.rowIndex = rowIndex;
|
|
57
|
-
}
|
|
58
|
-
if (rowMaxHeight.length <= rowIndex) {
|
|
59
|
-
rowMaxHeight.push(0);
|
|
60
|
-
}
|
|
61
|
-
totalWidthUsed = Math.max(totalWidthUsed, x + itemSpace.outerWidth);
|
|
62
|
-
totalHeightUsed = Math.max(totalHeightUsed, y + itemSpace.outerHeight);
|
|
63
|
-
rowIndex += 1;
|
|
64
|
-
y += itemSpace.outerHeight;
|
|
65
|
-
}
|
|
66
|
-
return rep;
|
|
67
|
-
});
|
|
68
|
-
return [seriesWithRawPosition.map(item => _extends({}, item, {
|
|
69
|
-
positionY: item.positionY + (direction === 'row' ? rowMaxHeight[item.rowIndex] / 2 // Get the center of the entire row
|
|
70
|
-
: item.outerHeight / 2) // Get the center of the item
|
|
71
|
-
})), totalWidthUsed, totalHeightUsed];
|
|
72
|
-
}
|
package/ChartsLegend/utils.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useRtl } from '@mui/system/RtlProvider';
|
|
5
|
-
import { ChartsText } from "../ChartsText/index.js";
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
/**
|
|
8
|
-
* @ignore - internal component.
|
|
9
|
-
*/
|
|
10
|
-
function ChartsLegendItem(props) {
|
|
11
|
-
const isRTL = useRtl();
|
|
12
|
-
const {
|
|
13
|
-
id,
|
|
14
|
-
positionY,
|
|
15
|
-
label,
|
|
16
|
-
positionX,
|
|
17
|
-
innerHeight,
|
|
18
|
-
innerWidth,
|
|
19
|
-
legendWidth,
|
|
20
|
-
color,
|
|
21
|
-
gapX,
|
|
22
|
-
gapY,
|
|
23
|
-
itemMarkHeight,
|
|
24
|
-
itemMarkWidth,
|
|
25
|
-
markGap,
|
|
26
|
-
labelStyle,
|
|
27
|
-
classes,
|
|
28
|
-
onClick
|
|
29
|
-
} = props;
|
|
30
|
-
return /*#__PURE__*/_jsxs("g", {
|
|
31
|
-
className: clsx(classes?.series, `${classes?.series}-${id}`),
|
|
32
|
-
transform: `translate(${gapX + (isRTL ? legendWidth - positionX : positionX)} ${gapY + positionY})`,
|
|
33
|
-
children: [/*#__PURE__*/_jsx("rect", {
|
|
34
|
-
x: isRTL ? -(innerWidth + 2) : -2,
|
|
35
|
-
y: -itemMarkHeight / 2 - 2,
|
|
36
|
-
width: innerWidth + 4,
|
|
37
|
-
height: innerHeight + 4,
|
|
38
|
-
fill: "transparent",
|
|
39
|
-
className: classes?.itemBackground,
|
|
40
|
-
onClick: onClick,
|
|
41
|
-
style: {
|
|
42
|
-
pointerEvents: onClick ? 'all' : 'none',
|
|
43
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
44
|
-
}
|
|
45
|
-
}), /*#__PURE__*/_jsx("rect", {
|
|
46
|
-
className: classes?.mark,
|
|
47
|
-
x: isRTL ? -itemMarkWidth : 0,
|
|
48
|
-
y: -itemMarkHeight / 2,
|
|
49
|
-
width: itemMarkWidth,
|
|
50
|
-
height: itemMarkHeight,
|
|
51
|
-
fill: color,
|
|
52
|
-
style: {
|
|
53
|
-
pointerEvents: 'none'
|
|
54
|
-
}
|
|
55
|
-
}), /*#__PURE__*/_jsx(ChartsText, {
|
|
56
|
-
style: _extends({
|
|
57
|
-
pointerEvents: 'none'
|
|
58
|
-
}, labelStyle),
|
|
59
|
-
text: label,
|
|
60
|
-
x: (isRTL ? -1 : 1) * (itemMarkWidth + markGap),
|
|
61
|
-
y: 0
|
|
62
|
-
})]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
export { ChartsLegendItem };
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["seriesToDisplay", "hidden", "onItemClick"];
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { LegendPerItem } from "./LegendPerItem.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const seriesContextBuilder = context => ({
|
|
11
|
-
type: 'series',
|
|
12
|
-
color: context.color,
|
|
13
|
-
label: context.label,
|
|
14
|
-
seriesId: context.seriesId,
|
|
15
|
-
itemId: context.itemId
|
|
16
|
-
});
|
|
17
|
-
function DefaultChartsLegend(props) {
|
|
18
|
-
const {
|
|
19
|
-
seriesToDisplay,
|
|
20
|
-
hidden,
|
|
21
|
-
onItemClick
|
|
22
|
-
} = props,
|
|
23
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
|
-
if (hidden) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/_jsx(LegendPerItem, _extends({}, other, {
|
|
28
|
-
itemsToDisplay: seriesToDisplay,
|
|
29
|
-
onItemClick: onItemClick ? (event, i) => onItemClick(event, seriesContextBuilder(seriesToDisplay[i]), i) : undefined
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
process.env.NODE_ENV !== "production" ? DefaultChartsLegend.propTypes = {
|
|
33
|
-
// ----------------------------- Warning --------------------------------
|
|
34
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
35
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
36
|
-
// ----------------------------------------------------------------------
|
|
37
|
-
/**
|
|
38
|
-
* Override or extend the styles applied to the component.
|
|
39
|
-
*/
|
|
40
|
-
classes: PropTypes.object,
|
|
41
|
-
/**
|
|
42
|
-
* The direction of the legend layout.
|
|
43
|
-
* The default depends on the chart.
|
|
44
|
-
*/
|
|
45
|
-
direction: PropTypes.oneOf(['column', 'row']).isRequired,
|
|
46
|
-
/**
|
|
47
|
-
* Set to true to hide the legend.
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
hidden: PropTypes.bool,
|
|
51
|
-
/**
|
|
52
|
-
* Space between two legend items (in px).
|
|
53
|
-
* @default 10
|
|
54
|
-
*/
|
|
55
|
-
itemGap: PropTypes.number,
|
|
56
|
-
/**
|
|
57
|
-
* Height of the item mark (in px).
|
|
58
|
-
* @default 20
|
|
59
|
-
*/
|
|
60
|
-
itemMarkHeight: PropTypes.number,
|
|
61
|
-
/**
|
|
62
|
-
* Width of the item mark (in px).
|
|
63
|
-
* @default 20
|
|
64
|
-
*/
|
|
65
|
-
itemMarkWidth: PropTypes.number,
|
|
66
|
-
/**
|
|
67
|
-
* Style applied to legend labels.
|
|
68
|
-
* @default theme.typography.subtitle1
|
|
69
|
-
*/
|
|
70
|
-
labelStyle: PropTypes.object,
|
|
71
|
-
/**
|
|
72
|
-
* Space between the mark and the label (in px).
|
|
73
|
-
* @default 5
|
|
74
|
-
*/
|
|
75
|
-
markGap: PropTypes.number,
|
|
76
|
-
/**
|
|
77
|
-
* Callback fired when a legend item is clicked.
|
|
78
|
-
* @param {React.MouseEvent<SVGRectElement, MouseEvent>} event The click event.
|
|
79
|
-
* @param {SeriesLegendItemContext} legendItem The legend item data.
|
|
80
|
-
* @param {number} index The index of the clicked legend item.
|
|
81
|
-
*/
|
|
82
|
-
onItemClick: PropTypes.func,
|
|
83
|
-
/**
|
|
84
|
-
* Legend padding (in px).
|
|
85
|
-
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
86
|
-
* @default 10
|
|
87
|
-
*/
|
|
88
|
-
padding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
89
|
-
bottom: PropTypes.number,
|
|
90
|
-
left: PropTypes.number,
|
|
91
|
-
right: PropTypes.number,
|
|
92
|
-
top: PropTypes.number
|
|
93
|
-
})]),
|
|
94
|
-
/**
|
|
95
|
-
* The position of the legend.
|
|
96
|
-
*/
|
|
97
|
-
position: PropTypes.shape({
|
|
98
|
-
horizontal: PropTypes.oneOf(['left', 'middle', 'right']).isRequired,
|
|
99
|
-
vertical: PropTypes.oneOf(['bottom', 'middle', 'top']).isRequired
|
|
100
|
-
}).isRequired,
|
|
101
|
-
series: PropTypes.object.isRequired,
|
|
102
|
-
seriesToDisplay: PropTypes.arrayOf(PropTypes.shape({
|
|
103
|
-
color: PropTypes.string.isRequired,
|
|
104
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
105
|
-
itemId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
106
|
-
label: PropTypes.string.isRequired,
|
|
107
|
-
maxValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
108
|
-
minValue: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
109
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
110
|
-
})).isRequired
|
|
111
|
-
} : void 0;
|
|
112
|
-
export { DefaultChartsLegend };
|