@mui/x-charts 6.18.0 → 6.18.2
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 +7 -0
- package/BarChart/BarChart.js +41 -4
- package/CHANGELOG.md +116 -5
- package/ChartsAxis/ChartsAxis.js +5 -5
- package/ChartsAxis/axisClasses.d.ts +2 -2
- package/ChartsLegend/ChartsLegend.d.ts +1 -0
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/chartsLegendClasses.js +2 -2
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
- package/ChartsReferenceLine/common.d.ts +41 -0
- package/ChartsReferenceLine/common.js +27 -0
- package/ChartsReferenceLine/index.d.ts +2 -0
- package/ChartsReferenceLine/index.js +27 -0
- package/ChartsReferenceLine/package.json +6 -0
- package/ChartsSurface.d.ts +11 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltip.js +13 -5
- package/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/ChartsTooltip/chartsTooltipClasses.d.ts +21 -0
- package/ChartsTooltip/chartsTooltipClasses.js +12 -0
- package/ChartsTooltip/index.d.ts +1 -0
- package/ChartsTooltip/index.js +11 -0
- package/ChartsTooltip/utils.d.ts +1 -1
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.js +9 -5
- package/ChartsYAxis/ChartsYAxis.js +9 -5
- package/LineChart/LineChart.d.ts +7 -0
- package/LineChart/LineChart.js +41 -4
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/MarkPlot.js +2 -1
- package/PieChart/PieArc.d.ts +5 -2
- package/PieChart/PieArc.js +17 -2
- package/PieChart/PieArcLabel.d.ts +1 -1
- package/PieChart/PieArcLabel.js +5 -10
- package/PieChart/PieArcLabelPlot.js +2 -2
- package/PieChart/PieArcPlot.js +2 -2
- package/PieChart/PieChart.js +34 -4
- package/PieChart/index.d.ts +4 -2
- package/PieChart/index.js +37 -27
- package/ResponsiveChartContainer/index.d.ts +13 -3
- package/ScatterChart/ScatterChart.js +34 -4
- package/SparkLineChart/SparkLineChart.js +22 -0
- package/context/CartesianContextProvider.d.ts +21 -1
- package/context/CartesianContextProvider.js +11 -0
- package/context/DrawingProvider.d.ts +18 -0
- package/context/DrawingProvider.js +6 -0
- package/context/HighlightProvider.d.ts +17 -0
- package/context/InteractionProvider.d.ts +6 -0
- package/context/SeriesContextProvider.d.ts +5 -0
- package/esm/BarChart/BarChart.js +41 -4
- package/esm/ChartsAxis/ChartsAxis.js +6 -5
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/esm/ChartsReferenceLine/common.js +20 -0
- package/esm/ChartsReferenceLine/index.js +2 -0
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/esm/ChartsTooltip/ChartsTooltip.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/esm/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/esm/ChartsTooltip/index.js +2 -1
- package/esm/ChartsTooltip/utils.js +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +10 -6
- package/esm/ChartsYAxis/ChartsYAxis.js +10 -6
- package/esm/LineChart/LineChart.js +41 -4
- package/esm/LineChart/LineHighlightPlot.js +1 -1
- package/esm/LineChart/MarkPlot.js +2 -1
- package/esm/PieChart/PieArc.js +18 -2
- package/esm/PieChart/PieArcLabel.js +7 -11
- package/esm/PieChart/PieArcLabelPlot.js +1 -1
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +34 -4
- package/esm/PieChart/index.js +2 -2
- package/esm/ScatterChart/ScatterChart.js +34 -4
- package/esm/SparkLineChart/SparkLineChart.js +22 -0
- package/esm/context/CartesianContextProvider.js +11 -0
- package/esm/context/DrawingProvider.js +6 -0
- package/esm/index.js +1 -0
- package/esm/internals/geometry.js +2 -2
- package/hooks/useScale.d.ts +2 -2
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/components/ChartsText.d.ts +1 -1
- package/internals/geometry.d.ts +2 -2
- package/internals/geometry.js +2 -2
- package/internals/isBandScale.d.ts +3 -1
- package/internals/utils.d.ts +5 -0
- package/legacy/BarChart/BarChart.js +41 -4
- package/legacy/ChartsAxis/ChartsAxis.js +6 -5
- package/legacy/ChartsLegend/ChartsLegend.js +2 -2
- package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/legacy/ChartsReferenceLine/common.js +20 -0
- package/legacy/ChartsReferenceLine/index.js +2 -0
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/legacy/ChartsTooltip/ChartsTooltip.js +20 -12
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/legacy/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/legacy/ChartsTooltip/index.js +2 -1
- package/legacy/ChartsTooltip/utils.js +1 -1
- package/legacy/ChartsXAxis/ChartsXAxis.js +15 -12
- package/legacy/ChartsYAxis/ChartsYAxis.js +15 -12
- package/legacy/LineChart/LineChart.js +41 -4
- package/legacy/LineChart/LineHighlightPlot.js +1 -1
- package/legacy/LineChart/MarkPlot.js +2 -1
- package/legacy/PieChart/PieArc.js +18 -2
- package/legacy/PieChart/PieArcLabel.js +7 -11
- package/legacy/PieChart/PieArcLabelPlot.js +1 -1
- package/legacy/PieChart/PieArcPlot.js +1 -1
- package/legacy/PieChart/PieChart.js +34 -4
- package/legacy/PieChart/index.js +2 -2
- package/legacy/ScatterChart/ScatterChart.js +34 -4
- package/legacy/SparkLineChart/SparkLineChart.js +22 -0
- package/legacy/context/CartesianContextProvider.js +11 -0
- package/legacy/context/DrawingProvider.js +6 -0
- package/legacy/index.js +2 -1
- package/legacy/internals/geometry.js +2 -2
- package/models/axis.d.ts +33 -13
- package/models/layout.d.ts +6 -0
- package/models/seriesType/common.d.ts +16 -0
- package/modern/BarChart/BarChart.js +41 -4
- package/modern/ChartsAxis/ChartsAxis.js +5 -5
- package/modern/ChartsLegend/ChartsLegend.js +2 -2
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/modern/ChartsReferenceLine/common.js +20 -0
- package/modern/ChartsReferenceLine/index.js +2 -0
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +8 -4
- package/modern/ChartsTooltip/ChartsTooltip.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/modern/ChartsTooltip/chartsTooltipClasses.js +5 -0
- package/modern/ChartsTooltip/index.js +2 -1
- package/modern/ChartsTooltip/utils.js +1 -1
- package/modern/ChartsXAxis/ChartsXAxis.js +9 -5
- package/modern/ChartsYAxis/ChartsYAxis.js +9 -5
- package/modern/LineChart/LineChart.js +41 -4
- package/modern/LineChart/LineHighlightPlot.js +1 -1
- package/modern/LineChart/MarkPlot.js +2 -1
- package/modern/PieChart/PieArc.js +18 -2
- package/modern/PieChart/PieArcLabel.js +7 -11
- package/modern/PieChart/PieArcLabelPlot.js +1 -1
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +34 -4
- package/modern/PieChart/index.js +2 -2
- package/modern/ScatterChart/ScatterChart.js +34 -4
- package/modern/SparkLineChart/SparkLineChart.js +22 -0
- package/modern/context/CartesianContextProvider.js +11 -0
- package/modern/context/DrawingProvider.js +6 -0
- package/modern/index.js +2 -1
- package/modern/internals/geometry.js +2 -2
- package/package.json +1 -1
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
- package/ChartsTooltip/tooltipClasses.d.ts +0 -13
- package/ChartsTooltip/tooltipClasses.js +0 -12
- package/esm/ChartsTooltip/tooltipClasses.js +0 -5
- package/legacy/ChartsTooltip/tooltipClasses.js +0 -5
- package/modern/ChartsTooltip/tooltipClasses.js +0 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
3
4
|
import { useSlotProps } from '@mui/base/utils';
|
|
4
5
|
import { SeriesContext } from '../context/SeriesContextProvider';
|
|
5
6
|
import { ChartsTooltipTable, ChartsTooltipCell, ChartsTooltipMark, ChartsTooltipPaper, ChartsTooltipRow } from './ChartsTooltipTable';
|
|
@@ -33,20 +34,23 @@ export function DefaultChartsItemContent(props) {
|
|
|
33
34
|
sx: sx,
|
|
34
35
|
className: classes.root,
|
|
35
36
|
children: /*#__PURE__*/_jsx(ChartsTooltipTable, {
|
|
37
|
+
className: classes.table,
|
|
36
38
|
children: /*#__PURE__*/_jsx("tbody", {
|
|
37
39
|
children: /*#__PURE__*/_jsxs(ChartsTooltipRow, {
|
|
40
|
+
className: classes.row,
|
|
38
41
|
children: [/*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
39
|
-
className: classes.markCell,
|
|
42
|
+
className: clsx(classes.markCell, classes.cell),
|
|
40
43
|
children: /*#__PURE__*/_jsx(ChartsTooltipMark, {
|
|
41
44
|
ownerState: {
|
|
42
45
|
color
|
|
43
|
-
}
|
|
46
|
+
},
|
|
47
|
+
className: classes.mark
|
|
44
48
|
})
|
|
45
49
|
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
46
|
-
className: classes.labelCell,
|
|
50
|
+
className: clsx(classes.labelCell, classes.cell),
|
|
47
51
|
children: displayedLabel
|
|
48
52
|
}), /*#__PURE__*/_jsx(ChartsTooltipCell, {
|
|
49
|
-
className: classes.valueCell,
|
|
53
|
+
className: clsx(classes.valueCell, classes.cell),
|
|
50
54
|
children: formattedValue
|
|
51
55
|
})]
|
|
52
56
|
})
|
|
@@ -2,15 +2,15 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import composeClasses from '@mui/utils/composeClasses';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { styled, useThemeProps } from '@mui/material/styles';
|
|
6
6
|
import { Popper } from '@mui/base/Popper';
|
|
7
7
|
import { NoSsr } from '@mui/base/NoSsr';
|
|
8
8
|
import { useSlotProps } from '@mui/base/utils';
|
|
9
9
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
10
|
-
import { generateVirtualElement, useMouseTracker,
|
|
10
|
+
import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
|
|
11
11
|
import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
|
|
12
12
|
import { ChartsAxisTooltipContent } from './ChartsAxisTooltipContent';
|
|
13
|
-
import {
|
|
13
|
+
import { getChartsTooltipUtilityClass } from './chartsTooltipClasses';
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
const useUtilityClasses = ownerState => {
|
|
16
16
|
const {
|
|
@@ -18,11 +18,15 @@ const useUtilityClasses = ownerState => {
|
|
|
18
18
|
} = ownerState;
|
|
19
19
|
const slots = {
|
|
20
20
|
root: ['root'],
|
|
21
|
+
table: ['table'],
|
|
22
|
+
row: ['row'],
|
|
23
|
+
cell: ['cell'],
|
|
24
|
+
mark: ['mark'],
|
|
21
25
|
markCell: ['markCell'],
|
|
22
26
|
labelCell: ['labelCell'],
|
|
23
27
|
valueCell: ['valueCell']
|
|
24
28
|
};
|
|
25
|
-
return composeClasses(slots,
|
|
29
|
+
return composeClasses(slots, getChartsTooltipUtilityClass, classes);
|
|
26
30
|
};
|
|
27
31
|
const ChartsTooltipRoot = styled(Popper, {
|
|
28
32
|
name: 'MuiChartsTooltip',
|
|
@@ -46,23 +50,27 @@ const ChartsTooltipRoot = styled(Popper, {
|
|
|
46
50
|
*/
|
|
47
51
|
function ChartsTooltip(props) {
|
|
48
52
|
var _slots$popper, _slots$itemContent, _slots$axisContent;
|
|
53
|
+
const themeProps = useThemeProps({
|
|
54
|
+
props,
|
|
55
|
+
name: 'MuiChartsTooltip'
|
|
56
|
+
});
|
|
49
57
|
const {
|
|
50
58
|
trigger = 'axis',
|
|
51
59
|
itemContent,
|
|
52
60
|
axisContent,
|
|
53
61
|
slots,
|
|
54
62
|
slotProps
|
|
55
|
-
} =
|
|
63
|
+
} = themeProps;
|
|
56
64
|
const mousePosition = useMouseTracker();
|
|
57
65
|
const {
|
|
58
66
|
item,
|
|
59
67
|
axis
|
|
60
68
|
} = React.useContext(InteractionContext);
|
|
61
69
|
const displayedData = trigger === 'item' ? item : axis;
|
|
62
|
-
const tooltipHasData =
|
|
70
|
+
const tooltipHasData = getTooltipHasData(trigger, displayedData);
|
|
63
71
|
const popperOpen = mousePosition !== null && tooltipHasData;
|
|
64
72
|
const classes = useUtilityClasses({
|
|
65
|
-
classes:
|
|
73
|
+
classes: themeProps.classes
|
|
66
74
|
});
|
|
67
75
|
const PopperComponent = (_slots$popper = slots == null ? void 0 : slots.popper) != null ? _slots$popper : ChartsTooltipRoot;
|
|
68
76
|
const popperProps = useSlotProps({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Box from '@mui/system/Box';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import {
|
|
3
|
+
import { chartsTooltipClasses } from './chartsTooltipClasses';
|
|
4
4
|
export const ChartsTooltipPaper = styled('div', {
|
|
5
5
|
name: 'MuiChartsTooltip',
|
|
6
6
|
slot: 'Container'
|
|
@@ -45,10 +45,10 @@ export const ChartsTooltipCell = styled('td', {
|
|
|
45
45
|
}) => ({
|
|
46
46
|
verticalAlign: 'middle',
|
|
47
47
|
color: (theme.vars || theme).palette.text.secondary,
|
|
48
|
-
[`&.${
|
|
48
|
+
[`&.${chartsTooltipClasses.labelCell}`]: {
|
|
49
49
|
paddingLeft: theme.spacing(1)
|
|
50
50
|
},
|
|
51
|
-
[`&.${
|
|
51
|
+
[`&.${chartsTooltipClasses.valueCell}`]: {
|
|
52
52
|
paddingLeft: theme.spacing(4),
|
|
53
53
|
color: (theme.vars || theme).palette.text.primary
|
|
54
54
|
},
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
|
|
2
|
+
export function getChartsTooltipUtilityClass(slot) {
|
|
3
|
+
return generateUtilityClass('MuiChartsTooltip', slot);
|
|
4
|
+
}
|
|
5
|
+
export const chartsTooltipClasses = generateUtilityClasses('MuiChartsTooltip', ['root', 'table', 'row', 'cell', 'mark', 'markCell', 'labelCell', 'valueCell']);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './ChartsTooltip';
|
|
1
|
+
export * from './ChartsTooltip';
|
|
2
|
+
export * from './chartsTooltipClasses';
|
|
@@ -71,7 +71,7 @@ export function useMouseTracker() {
|
|
|
71
71
|
}, [svgRef]);
|
|
72
72
|
return mousePosition;
|
|
73
73
|
}
|
|
74
|
-
export function
|
|
74
|
+
export function getTooltipHasData(trigger, displayedData) {
|
|
75
75
|
if (trigger === 'item') {
|
|
76
76
|
return displayedData !== null;
|
|
77
77
|
}
|
|
@@ -102,22 +102,25 @@ const defaultProps = {
|
|
|
102
102
|
* - [ChartsXAxis API](https://mui.com/x/api/charts/charts-x-axis/)
|
|
103
103
|
*/
|
|
104
104
|
function ChartsXAxis(inProps) {
|
|
105
|
-
var _slots$axisLine, _slots$axisTick, _slots$axisTickLabel, _slots$axisLabel;
|
|
105
|
+
var _props$axisId, _slots$axisLine, _slots$axisTick, _slots$axisTickLabel, _slots$axisLabel;
|
|
106
106
|
const props = useThemeProps({
|
|
107
107
|
props: _extends({}, defaultProps, inProps),
|
|
108
108
|
name: 'MuiChartsXAxis'
|
|
109
109
|
});
|
|
110
|
+
const {
|
|
111
|
+
xAxisIds
|
|
112
|
+
} = React.useContext(CartesianContext);
|
|
110
113
|
const _React$useContext = React.useContext(CartesianContext),
|
|
111
|
-
_props$axisId = props.axisId,
|
|
114
|
+
_ref = (_props$axisId = props.axisId) != null ? _props$axisId : xAxisIds[0],
|
|
112
115
|
{
|
|
113
116
|
xAxis: {
|
|
114
|
-
[
|
|
117
|
+
[_ref]: {
|
|
115
118
|
scale: xScale,
|
|
116
119
|
tickNumber
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
} = _React$useContext,
|
|
120
|
-
settings = _objectWithoutPropertiesLoose(_React$useContext.xAxis[
|
|
123
|
+
settings = _objectWithoutPropertiesLoose(_React$useContext.xAxis[_ref], _excluded);
|
|
121
124
|
const isMounted = useMounted();
|
|
122
125
|
const defaultizedProps = _extends({}, defaultProps, settings, props);
|
|
123
126
|
const {
|
|
@@ -235,9 +238,10 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
235
238
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
236
239
|
// ----------------------------------------------------------------------
|
|
237
240
|
/**
|
|
238
|
-
*
|
|
241
|
+
* The id of the axis to render.
|
|
242
|
+
* If undefined, it will be the first defined axis.
|
|
239
243
|
*/
|
|
240
|
-
axisId: PropTypes.string
|
|
244
|
+
axisId: PropTypes.string,
|
|
241
245
|
/**
|
|
242
246
|
* Override or extend the styles applied to the component.
|
|
243
247
|
*/
|
|
@@ -48,22 +48,25 @@ const defaultProps = {
|
|
|
48
48
|
* - [ChartsYAxis API](https://mui.com/x/api/charts/charts-y-axis/)
|
|
49
49
|
*/
|
|
50
50
|
function ChartsYAxis(inProps) {
|
|
51
|
-
var _slots$axisLine, _slots$axisTick, _slots$axisTickLabel, _slots$axisLabel;
|
|
51
|
+
var _props$axisId, _slots$axisLine, _slots$axisTick, _slots$axisTickLabel, _slots$axisLabel;
|
|
52
52
|
const props = useThemeProps({
|
|
53
53
|
props: _extends({}, defaultProps, inProps),
|
|
54
54
|
name: 'MuiChartsYAxis'
|
|
55
55
|
});
|
|
56
|
+
const {
|
|
57
|
+
yAxisIds
|
|
58
|
+
} = React.useContext(CartesianContext);
|
|
56
59
|
const _React$useContext = React.useContext(CartesianContext),
|
|
57
|
-
_props$axisId = props.axisId,
|
|
60
|
+
_ref = (_props$axisId = props.axisId) != null ? _props$axisId : yAxisIds[0],
|
|
58
61
|
{
|
|
59
62
|
yAxis: {
|
|
60
|
-
[
|
|
63
|
+
[_ref]: {
|
|
61
64
|
scale: yScale,
|
|
62
65
|
tickNumber
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
} = _React$useContext,
|
|
66
|
-
settings = _objectWithoutPropertiesLoose(_React$useContext.yAxis[
|
|
69
|
+
settings = _objectWithoutPropertiesLoose(_React$useContext.yAxis[_ref], _excluded);
|
|
67
70
|
const defaultizedProps = _extends({}, defaultProps, settings, props);
|
|
68
71
|
const {
|
|
69
72
|
position,
|
|
@@ -168,9 +171,10 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
168
171
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
169
172
|
// ----------------------------------------------------------------------
|
|
170
173
|
/**
|
|
171
|
-
*
|
|
174
|
+
* The id of the axis to render.
|
|
175
|
+
* If undefined, it will be the first defined axis.
|
|
172
176
|
*/
|
|
173
|
-
axisId: PropTypes.string
|
|
177
|
+
axisId: PropTypes.string,
|
|
174
178
|
/**
|
|
175
179
|
* Override or extend the styles applied to the component.
|
|
176
180
|
*/
|
|
@@ -114,6 +114,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
114
114
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
115
115
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
116
116
|
// ----------------------------------------------------------------------
|
|
117
|
+
/**
|
|
118
|
+
* Object `{ x, y }` that defines how the charts highlight the mouse position along the x- and y-axes.
|
|
119
|
+
* The two properties accept the following values:
|
|
120
|
+
* - 'none': display nothing.
|
|
121
|
+
* - 'line': display a line at the current mouse position.
|
|
122
|
+
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
123
|
+
*/
|
|
117
124
|
axisHighlight: PropTypes.shape({
|
|
118
125
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
119
126
|
y: PropTypes.oneOf(['band', 'line', 'none'])
|
|
@@ -124,7 +131,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
124
131
|
* @default xAxisIds[0] The id of the first provided axis
|
|
125
132
|
*/
|
|
126
133
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
127
|
-
axisId: PropTypes.string
|
|
134
|
+
axisId: PropTypes.string,
|
|
128
135
|
classes: PropTypes.object,
|
|
129
136
|
disableLine: PropTypes.bool,
|
|
130
137
|
disableTicks: PropTypes.bool,
|
|
@@ -151,13 +158,25 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
151
158
|
* Color palette used to colorize multiple series.
|
|
152
159
|
*/
|
|
153
160
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
161
|
+
/**
|
|
162
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
163
|
+
*/
|
|
154
164
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
155
165
|
desc: PropTypes.string,
|
|
166
|
+
/**
|
|
167
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
168
|
+
* It might break interactive features, but will improve performance.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
156
171
|
disableAxisListener: PropTypes.bool,
|
|
157
172
|
/**
|
|
158
173
|
* If `true`, render the line highlight item.
|
|
159
174
|
*/
|
|
160
175
|
disableLineItemHighlight: PropTypes.bool,
|
|
176
|
+
/**
|
|
177
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
178
|
+
* @default undefined
|
|
179
|
+
*/
|
|
161
180
|
height: PropTypes.number,
|
|
162
181
|
/**
|
|
163
182
|
* Indicate which axis to display the left of the charts.
|
|
@@ -165,7 +184,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
165
184
|
* @default yAxisIds[0] The id of the first provided axis
|
|
166
185
|
*/
|
|
167
186
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
168
|
-
axisId: PropTypes.string
|
|
187
|
+
axisId: PropTypes.string,
|
|
169
188
|
classes: PropTypes.object,
|
|
170
189
|
disableLine: PropTypes.bool,
|
|
171
190
|
disableTicks: PropTypes.bool,
|
|
@@ -200,6 +219,12 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
200
219
|
slotProps: PropTypes.object,
|
|
201
220
|
slots: PropTypes.object
|
|
202
221
|
}),
|
|
222
|
+
/**
|
|
223
|
+
* The margin between the SVG and the drawing area.
|
|
224
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
225
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
226
|
+
* @default object Depends on the charts type.
|
|
227
|
+
*/
|
|
203
228
|
margin: PropTypes.shape({
|
|
204
229
|
bottom: PropTypes.number,
|
|
205
230
|
left: PropTypes.number,
|
|
@@ -212,7 +237,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
212
237
|
* @default null
|
|
213
238
|
*/
|
|
214
239
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
215
|
-
axisId: PropTypes.string
|
|
240
|
+
axisId: PropTypes.string,
|
|
216
241
|
classes: PropTypes.object,
|
|
217
242
|
disableLine: PropTypes.bool,
|
|
218
243
|
disableTicks: PropTypes.bool,
|
|
@@ -282,7 +307,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
282
307
|
* @default null
|
|
283
308
|
*/
|
|
284
309
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
285
|
-
axisId: PropTypes.string
|
|
310
|
+
axisId: PropTypes.string,
|
|
286
311
|
classes: PropTypes.object,
|
|
287
312
|
disableLine: PropTypes.bool,
|
|
288
313
|
disableTicks: PropTypes.bool,
|
|
@@ -309,7 +334,15 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
309
334
|
x: PropTypes.number,
|
|
310
335
|
y: PropTypes.number
|
|
311
336
|
}),
|
|
337
|
+
/**
|
|
338
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
339
|
+
* @default undefined
|
|
340
|
+
*/
|
|
312
341
|
width: PropTypes.number,
|
|
342
|
+
/**
|
|
343
|
+
* The configuration of the x-axes.
|
|
344
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
345
|
+
*/
|
|
313
346
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
314
347
|
axisId: PropTypes.string,
|
|
315
348
|
classes: PropTypes.object,
|
|
@@ -340,6 +373,10 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
340
373
|
tickSize: PropTypes.number,
|
|
341
374
|
valueFormatter: PropTypes.func
|
|
342
375
|
})),
|
|
376
|
+
/**
|
|
377
|
+
* The configuration of the y-axes.
|
|
378
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
379
|
+
*/
|
|
343
380
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
344
381
|
axisId: PropTypes.string,
|
|
345
382
|
classes: PropTypes.object,
|
|
@@ -73,7 +73,7 @@ function LineHighlightPlot(props) {
|
|
|
73
73
|
throw new Error(`Axis of id "${xAxisKey}" should have data property to be able to display a line plot.`);
|
|
74
74
|
}
|
|
75
75
|
const x = xScale(xData[highlightedIndex]);
|
|
76
|
-
const y = yScale(stackedData[highlightedIndex][1]);
|
|
76
|
+
const y = yScale(stackedData[highlightedIndex][1]); // This should not be undefined since y should not be a band scale
|
|
77
77
|
return /*#__PURE__*/_jsx(Element, _extends({
|
|
78
78
|
id: seriesId,
|
|
79
79
|
color: series[seriesId].color,
|
|
@@ -126,7 +126,8 @@ function MarkPlot(props) {
|
|
|
126
126
|
shape: "circle",
|
|
127
127
|
color: series[seriesId].color,
|
|
128
128
|
x: x,
|
|
129
|
-
y: y
|
|
129
|
+
y: y // Don't knwo why TS don't get from the filter that y can't be null
|
|
130
|
+
,
|
|
130
131
|
highlightScope: series[seriesId].highlightScope
|
|
131
132
|
}, slotProps == null ? void 0 : slotProps.mark), `${seriesId}-${index}`);
|
|
132
133
|
});
|
package/esm/PieChart/PieArc.js
CHANGED
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "onClick", "isFaded", "isHighlighted", "startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { arc as d3Arc } from 'd3-shape';
|
|
6
7
|
import { animated, to } from '@react-spring/web';
|
|
7
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
@@ -37,7 +38,7 @@ const PieArcRoot = styled(animated.path, {
|
|
|
37
38
|
strokeWidth: 1,
|
|
38
39
|
strokeLinejoin: 'round'
|
|
39
40
|
}));
|
|
40
|
-
|
|
41
|
+
function PieArc(props) {
|
|
41
42
|
const {
|
|
42
43
|
id,
|
|
43
44
|
dataIndex,
|
|
@@ -82,4 +83,19 @@ export default function PieArc(props) {
|
|
|
82
83
|
seriesId: id,
|
|
83
84
|
dataIndex
|
|
84
85
|
})));
|
|
85
|
-
}
|
|
86
|
+
}
|
|
87
|
+
process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
88
|
+
// ----------------------------- Warning --------------------------------
|
|
89
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
90
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
91
|
+
// ----------------------------------------------------------------------
|
|
92
|
+
classes: PropTypes.object,
|
|
93
|
+
dataIndex: PropTypes.number.isRequired,
|
|
94
|
+
highlightScope: PropTypes.shape({
|
|
95
|
+
faded: PropTypes.oneOf(['global', 'none', 'series']),
|
|
96
|
+
highlighted: PropTypes.oneOf(['item', 'none', 'series'])
|
|
97
|
+
}),
|
|
98
|
+
isFaded: PropTypes.bool.isRequired,
|
|
99
|
+
isHighlighted: PropTypes.bool.isRequired
|
|
100
|
+
} : void 0;
|
|
101
|
+
export { PieArc };
|
|
@@ -2,9 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "style"];
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
5
6
|
import { animated, to } from '@react-spring/web';
|
|
6
7
|
import { arc as d3Arc } from 'd3-shape';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
9
|
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
10
10
|
import { styled } from '@mui/material/styles';
|
|
@@ -57,7 +57,7 @@ const getLabelPosition = (formattedArcLabel, variable) => (startAngle, endAngle,
|
|
|
57
57
|
}
|
|
58
58
|
return y;
|
|
59
59
|
};
|
|
60
|
-
|
|
60
|
+
function PieArcLabel(props) {
|
|
61
61
|
const {
|
|
62
62
|
id,
|
|
63
63
|
classes: innerClasses,
|
|
@@ -98,12 +98,8 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
|
98
98
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
99
99
|
// ----------------------------------------------------------------------
|
|
100
100
|
classes: PropTypes.object,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}),
|
|
107
|
-
innerRadius: PropTypes.number,
|
|
108
|
-
outerRadius: PropTypes.number.isRequired
|
|
109
|
-
} : void 0;
|
|
101
|
+
formattedArcLabel: PropTypes.string,
|
|
102
|
+
isFaded: PropTypes.bool.isRequired,
|
|
103
|
+
isHighlighted: PropTypes.bool.isRequired
|
|
104
|
+
} : void 0;
|
|
105
|
+
export { PieArcLabel };
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { useTransition } from '@react-spring/web';
|
|
7
7
|
import { defaultLabelTransitionConfig } from './dataTransform/transition';
|
|
8
8
|
import { useTransformData } from './dataTransform/useTransformData';
|
|
9
|
-
import PieArcLabel from './PieArcLabel';
|
|
9
|
+
import { PieArcLabel } from './PieArcLabel';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
const RATIO = 180 / Math.PI;
|
|
12
12
|
function getItemLabel(arcLabel, arcLabelMinAngle, item) {
|
|
@@ -4,7 +4,7 @@ const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRa
|
|
|
4
4
|
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "outerRadius", "cornerRadius"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { useTransition } from '@react-spring/web';
|
|
7
|
-
import PieArc from './PieArc';
|
|
7
|
+
import { PieArc } from './PieArc';
|
|
8
8
|
import { defaultTransitionConfig } from './dataTransform/transition';
|
|
9
9
|
import { useTransformData } from './dataTransform/useTransformData';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -111,7 +111,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
111
111
|
* @default xAxisIds[0] The id of the first provided axis
|
|
112
112
|
*/
|
|
113
113
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
114
|
-
axisId: PropTypes.string
|
|
114
|
+
axisId: PropTypes.string,
|
|
115
115
|
classes: PropTypes.object,
|
|
116
116
|
disableLine: PropTypes.bool,
|
|
117
117
|
disableTicks: PropTypes.bool,
|
|
@@ -138,9 +138,21 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
138
138
|
* Color palette used to colorize multiple series.
|
|
139
139
|
*/
|
|
140
140
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
141
|
+
/**
|
|
142
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
143
|
+
*/
|
|
141
144
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
142
145
|
desc: PropTypes.string,
|
|
146
|
+
/**
|
|
147
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
148
|
+
* It might break interactive features, but will improve performance.
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
143
151
|
disableAxisListener: PropTypes.bool,
|
|
152
|
+
/**
|
|
153
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
154
|
+
* @default undefined
|
|
155
|
+
*/
|
|
144
156
|
height: PropTypes.number,
|
|
145
157
|
/**
|
|
146
158
|
* Indicate which axis to display the left of the charts.
|
|
@@ -148,7 +160,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
148
160
|
* @default yAxisIds[0] The id of the first provided axis
|
|
149
161
|
*/
|
|
150
162
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
151
|
-
axisId: PropTypes.string
|
|
163
|
+
axisId: PropTypes.string,
|
|
152
164
|
classes: PropTypes.object,
|
|
153
165
|
disableLine: PropTypes.bool,
|
|
154
166
|
disableTicks: PropTypes.bool,
|
|
@@ -183,6 +195,12 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
183
195
|
slotProps: PropTypes.object,
|
|
184
196
|
slots: PropTypes.object
|
|
185
197
|
}),
|
|
198
|
+
/**
|
|
199
|
+
* The margin between the SVG and the drawing area.
|
|
200
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
201
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
202
|
+
* @default object Depends on the charts type.
|
|
203
|
+
*/
|
|
186
204
|
margin: PropTypes.shape({
|
|
187
205
|
bottom: PropTypes.number,
|
|
188
206
|
left: PropTypes.number,
|
|
@@ -196,7 +214,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
196
214
|
* @default null
|
|
197
215
|
*/
|
|
198
216
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
199
|
-
axisId: PropTypes.string
|
|
217
|
+
axisId: PropTypes.string,
|
|
200
218
|
classes: PropTypes.object,
|
|
201
219
|
disableLine: PropTypes.bool,
|
|
202
220
|
disableTicks: PropTypes.bool,
|
|
@@ -287,7 +305,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
287
305
|
* @default null
|
|
288
306
|
*/
|
|
289
307
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
290
|
-
axisId: PropTypes.string
|
|
308
|
+
axisId: PropTypes.string,
|
|
291
309
|
classes: PropTypes.object,
|
|
292
310
|
disableLine: PropTypes.bool,
|
|
293
311
|
disableTicks: PropTypes.bool,
|
|
@@ -314,7 +332,15 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
314
332
|
x: PropTypes.number,
|
|
315
333
|
y: PropTypes.number
|
|
316
334
|
}),
|
|
335
|
+
/**
|
|
336
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
337
|
+
* @default undefined
|
|
338
|
+
*/
|
|
317
339
|
width: PropTypes.number,
|
|
340
|
+
/**
|
|
341
|
+
* The configuration of the x-axes.
|
|
342
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
343
|
+
*/
|
|
318
344
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
319
345
|
axisId: PropTypes.string,
|
|
320
346
|
classes: PropTypes.object,
|
|
@@ -345,6 +371,10 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
345
371
|
tickSize: PropTypes.number,
|
|
346
372
|
valueFormatter: PropTypes.func
|
|
347
373
|
})),
|
|
374
|
+
/**
|
|
375
|
+
* The configuration of the y-axes.
|
|
376
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
377
|
+
*/
|
|
348
378
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
349
379
|
axisId: PropTypes.string,
|
|
350
380
|
classes: PropTypes.object,
|
package/esm/PieChart/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { PiePlot } from './PiePlot';
|
|
2
2
|
export { PieChart } from './PieChart';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export { PieArcLabel, getPieArcLabelUtilityClass, pieArcLabelClasses } from './PieArcLabel';
|
|
4
|
+
export { PieArc, getPieArcUtilityClass, pieArcClasses } from './PieArc';
|
|
@@ -88,7 +88,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
88
88
|
* @default xAxisIds[0] The id of the first provided axis
|
|
89
89
|
*/
|
|
90
90
|
bottomAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
91
|
-
axisId: PropTypes.string
|
|
91
|
+
axisId: PropTypes.string,
|
|
92
92
|
classes: PropTypes.object,
|
|
93
93
|
disableLine: PropTypes.bool,
|
|
94
94
|
disableTicks: PropTypes.bool,
|
|
@@ -115,9 +115,21 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
115
115
|
* Color palette used to colorize multiple series.
|
|
116
116
|
*/
|
|
117
117
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
118
|
+
/**
|
|
119
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
120
|
+
*/
|
|
118
121
|
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
119
122
|
desc: PropTypes.string,
|
|
123
|
+
/**
|
|
124
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
125
|
+
* It might break interactive features, but will improve performance.
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
120
128
|
disableAxisListener: PropTypes.bool,
|
|
129
|
+
/**
|
|
130
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
131
|
+
* @default undefined
|
|
132
|
+
*/
|
|
121
133
|
height: PropTypes.number,
|
|
122
134
|
/**
|
|
123
135
|
* Indicate which axis to display the left of the charts.
|
|
@@ -125,7 +137,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
125
137
|
* @default yAxisIds[0] The id of the first provided axis
|
|
126
138
|
*/
|
|
127
139
|
leftAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
128
|
-
axisId: PropTypes.string
|
|
140
|
+
axisId: PropTypes.string,
|
|
129
141
|
classes: PropTypes.object,
|
|
130
142
|
disableLine: PropTypes.bool,
|
|
131
143
|
disableTicks: PropTypes.bool,
|
|
@@ -160,6 +172,12 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
160
172
|
slotProps: PropTypes.object,
|
|
161
173
|
slots: PropTypes.object
|
|
162
174
|
}),
|
|
175
|
+
/**
|
|
176
|
+
* The margin between the SVG and the drawing area.
|
|
177
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
178
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
179
|
+
* @default object Depends on the charts type.
|
|
180
|
+
*/
|
|
163
181
|
margin: PropTypes.shape({
|
|
164
182
|
bottom: PropTypes.number,
|
|
165
183
|
left: PropTypes.number,
|
|
@@ -172,7 +190,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
172
190
|
* @default null
|
|
173
191
|
*/
|
|
174
192
|
rightAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
175
|
-
axisId: PropTypes.string
|
|
193
|
+
axisId: PropTypes.string,
|
|
176
194
|
classes: PropTypes.object,
|
|
177
195
|
disableLine: PropTypes.bool,
|
|
178
196
|
disableTicks: PropTypes.bool,
|
|
@@ -238,7 +256,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
238
256
|
* @default null
|
|
239
257
|
*/
|
|
240
258
|
topAxis: PropTypes.oneOfType([PropTypes.shape({
|
|
241
|
-
axisId: PropTypes.string
|
|
259
|
+
axisId: PropTypes.string,
|
|
242
260
|
classes: PropTypes.object,
|
|
243
261
|
disableLine: PropTypes.bool,
|
|
244
262
|
disableTicks: PropTypes.bool,
|
|
@@ -265,7 +283,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
265
283
|
x: PropTypes.number,
|
|
266
284
|
y: PropTypes.number
|
|
267
285
|
}),
|
|
286
|
+
/**
|
|
287
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
288
|
+
* @default undefined
|
|
289
|
+
*/
|
|
268
290
|
width: PropTypes.number,
|
|
291
|
+
/**
|
|
292
|
+
* The configuration of the x-axes.
|
|
293
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
294
|
+
*/
|
|
269
295
|
xAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
270
296
|
axisId: PropTypes.string,
|
|
271
297
|
classes: PropTypes.object,
|
|
@@ -296,6 +322,10 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
296
322
|
tickSize: PropTypes.number,
|
|
297
323
|
valueFormatter: PropTypes.func
|
|
298
324
|
})),
|
|
325
|
+
/**
|
|
326
|
+
* The configuration of the y-axes.
|
|
327
|
+
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
328
|
+
*/
|
|
299
329
|
yAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
300
330
|
axisId: PropTypes.string,
|
|
301
331
|
classes: PropTypes.object,
|