@mui/x-charts 8.0.0-alpha.6 → 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 +127 -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
package/PieChart/PieChart.js
CHANGED
|
@@ -5,24 +5,20 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "sx", "skipAnimation", "hideLegend", "children", "slots", "slotProps", "onItemClick", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useRtl } from '@mui/system/RtlProvider';
|
|
9
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
|
-
import { ChartContainer } from "../ChartContainer/index.js";
|
|
11
9
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
12
10
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
13
11
|
import { PiePlot } from "./PiePlot.js";
|
|
14
12
|
import { ChartsOverlay } from "../ChartsOverlay/index.js";
|
|
13
|
+
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
14
|
+
import { ChartDataProvider } from "../context/index.js";
|
|
15
|
+
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
16
|
+
import { ChartsWrapper } from "../internals/components/ChartsWrapper/index.js";
|
|
15
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
const defaultMargin = {
|
|
17
19
|
top: 5,
|
|
18
20
|
bottom: 5,
|
|
19
21
|
left: 5,
|
|
20
|
-
right: 100
|
|
21
|
-
};
|
|
22
|
-
const defaultRTLMargin = {
|
|
23
|
-
top: 5,
|
|
24
|
-
bottom: 5,
|
|
25
|
-
left: 100,
|
|
26
22
|
right: 5
|
|
27
23
|
};
|
|
28
24
|
|
|
@@ -60,43 +56,48 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
60
56
|
className
|
|
61
57
|
} = props,
|
|
62
58
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
const margin = _extends({}, defaultMargin, marginProps);
|
|
60
|
+
const {
|
|
61
|
+
chartDataProviderProps,
|
|
62
|
+
chartsSurfaceProps
|
|
63
|
+
} = useChartContainerProps(_extends({}, other, {
|
|
68
64
|
series: series.map(s => _extends({
|
|
69
65
|
type: 'pie'
|
|
70
66
|
}, s)),
|
|
71
|
-
width
|
|
72
|
-
height
|
|
73
|
-
margin
|
|
74
|
-
colors
|
|
75
|
-
sx: sx,
|
|
67
|
+
width,
|
|
68
|
+
height,
|
|
69
|
+
margin,
|
|
70
|
+
colors,
|
|
76
71
|
disableAxisListener: true,
|
|
77
|
-
highlightedItem
|
|
78
|
-
onHighlightChange
|
|
79
|
-
className
|
|
80
|
-
skipAnimation
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
highlightedItem,
|
|
73
|
+
onHighlightChange,
|
|
74
|
+
className,
|
|
75
|
+
skipAnimation
|
|
76
|
+
}), ref);
|
|
77
|
+
const Tooltip = slots?.tooltip ?? ChartsTooltip;
|
|
78
|
+
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
|
|
79
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, {
|
|
80
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
81
|
+
legendDirection: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
82
|
+
sx: sx,
|
|
83
|
+
children: [!hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
84
|
+
direction: props?.slotProps?.legend?.direction ?? 'vertical',
|
|
85
|
+
slots: slots,
|
|
86
|
+
slotProps: slotProps
|
|
87
|
+
}), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
88
|
+
children: [/*#__PURE__*/_jsx(PiePlot, {
|
|
89
|
+
slots: slots,
|
|
90
|
+
slotProps: slotProps,
|
|
91
|
+
onItemClick: onItemClick
|
|
92
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, {
|
|
93
|
+
loading: loading,
|
|
94
|
+
slots: slots,
|
|
95
|
+
slotProps: slotProps
|
|
96
|
+
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
97
|
+
trigger: "item"
|
|
98
|
+
}, slotProps?.tooltip)), children]
|
|
99
|
+
}))]
|
|
100
|
+
})
|
|
100
101
|
}));
|
|
101
102
|
});
|
|
102
103
|
process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
package/PieChart/legend.js
CHANGED
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useThemeProps } from '@mui/material/styles';
|
|
7
7
|
import { ScatterPlot } from "./ScatterPlot.js";
|
|
8
|
-
import { ChartContainer } from "../ChartContainer/index.js";
|
|
9
8
|
import { ChartsAxis } from "../ChartsAxis/index.js";
|
|
10
9
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
11
10
|
import { ChartsLegend } from "../ChartsLegend/index.js";
|
|
@@ -15,6 +14,10 @@ import { ChartsVoronoiHandler } from "../ChartsVoronoiHandler/ChartsVoronoiHandl
|
|
|
15
14
|
import { ChartsGrid } from "../ChartsGrid/index.js";
|
|
16
15
|
import { ZAxisContextProvider } from "../context/ZAxisContextProvider.js";
|
|
17
16
|
import { useScatterChartProps } from "./useScatterChartProps.js";
|
|
17
|
+
import { useChartContainerProps } from "../ChartContainer/useChartContainerProps.js";
|
|
18
|
+
import { ChartDataProvider } from "../context/index.js";
|
|
19
|
+
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
20
|
+
import { ChartsWrapper } from "../internals/components/ChartsWrapper/index.js";
|
|
18
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
22
|
/**
|
|
20
23
|
* Demos:
|
|
@@ -32,6 +35,7 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(inProps
|
|
|
32
35
|
name: 'MuiScatterChart'
|
|
33
36
|
});
|
|
34
37
|
const {
|
|
38
|
+
chartsWrapperProps,
|
|
35
39
|
chartContainerProps,
|
|
36
40
|
zAxisProps,
|
|
37
41
|
voronoiHandlerProps,
|
|
@@ -43,17 +47,23 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(inProps
|
|
|
43
47
|
axisHighlightProps,
|
|
44
48
|
children
|
|
45
49
|
} = useScatterChartProps(props);
|
|
50
|
+
const {
|
|
51
|
+
chartDataProviderProps,
|
|
52
|
+
chartsSurfaceProps
|
|
53
|
+
} = useChartContainerProps(chartContainerProps, ref);
|
|
46
54
|
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
47
|
-
return /*#__PURE__*/_jsx(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
|
|
56
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
57
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
58
|
+
children: /*#__PURE__*/_jsxs(ZAxisContextProvider, _extends({}, zAxisProps, {
|
|
59
|
+
children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
60
|
+
"data-drawing-container": true,
|
|
61
|
+
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
62
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
63
|
+
trigger: "item"
|
|
64
|
+
}, props.slotProps?.tooltip)), children]
|
|
65
|
+
}))
|
|
66
|
+
}))]
|
|
57
67
|
}))
|
|
58
68
|
}));
|
|
59
69
|
});
|
package/ScatterChart/legend.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
2
2
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
3
3
|
import { ChartsGridProps } from '../ChartsGrid';
|
|
4
|
-
import {
|
|
4
|
+
import { ChartsLegendSlotExtension } from '../ChartsLegend';
|
|
5
5
|
import { ChartsOverlayProps } from '../ChartsOverlay';
|
|
6
6
|
import type { ChartsVoronoiHandlerProps } from '../ChartsVoronoiHandler';
|
|
7
7
|
import { ChartContainerProps } from '../ChartContainer';
|
|
8
8
|
import { ZAxisContextProviderProps } from '../context';
|
|
9
9
|
import type { ScatterChartProps } from './ScatterChart';
|
|
10
10
|
import type { ScatterPlotProps } from './ScatterPlot';
|
|
11
|
+
import type { ChartsWrapperProps } from '../internals/components/ChartsWrapper';
|
|
11
12
|
/**
|
|
12
13
|
* A helper function that extracts ScatterChartProps from the input props
|
|
13
14
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -16,6 +17,7 @@ import type { ScatterPlotProps } from './ScatterPlot';
|
|
|
16
17
|
* @returns An object with props for the children components of ScatterChart
|
|
17
18
|
*/
|
|
18
19
|
export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
20
|
+
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
19
21
|
chartContainerProps: ChartContainerProps;
|
|
20
22
|
zAxisProps: Omit<ZAxisContextProviderProps, "children">;
|
|
21
23
|
voronoiHandlerProps: ChartsVoronoiHandlerProps;
|
|
@@ -23,7 +25,7 @@ export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
|
23
25
|
gridProps: ChartsGridProps;
|
|
24
26
|
scatterPlotProps: ScatterPlotProps;
|
|
25
27
|
overlayProps: ChartsOverlayProps;
|
|
26
|
-
legendProps:
|
|
28
|
+
legendProps: ChartsLegendSlotExtension;
|
|
27
29
|
axisHighlightProps: ChartsAxisHighlightProps;
|
|
28
30
|
children: import("react").ReactNode;
|
|
29
31
|
};
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
|
|
6
|
+
import { calculateMargins } from "../internals/calculateMargins.js";
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* A helper function that extracts ScatterChartProps from the input props
|
|
8
10
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -19,6 +21,7 @@ export const useScatterChartProps = props => {
|
|
|
19
21
|
axisHighlight,
|
|
20
22
|
voronoiMaxRadius,
|
|
21
23
|
disableVoronoi,
|
|
24
|
+
hideLegend,
|
|
22
25
|
width,
|
|
23
26
|
height,
|
|
24
27
|
margin,
|
|
@@ -45,11 +48,15 @@ export const useScatterChartProps = props => {
|
|
|
45
48
|
}, s)),
|
|
46
49
|
width,
|
|
47
50
|
height,
|
|
48
|
-
margin
|
|
51
|
+
margin: calculateMargins({
|
|
52
|
+
margin,
|
|
53
|
+
hideLegend,
|
|
54
|
+
slotProps,
|
|
55
|
+
series
|
|
56
|
+
}),
|
|
49
57
|
colors,
|
|
50
58
|
xAxis,
|
|
51
59
|
yAxis,
|
|
52
|
-
sx,
|
|
53
60
|
highlightedItem,
|
|
54
61
|
onHighlightChange,
|
|
55
62
|
className
|
|
@@ -91,7 +98,13 @@ export const useScatterChartProps = props => {
|
|
|
91
98
|
y: 'none',
|
|
92
99
|
x: 'none'
|
|
93
100
|
}, axisHighlight);
|
|
101
|
+
const chartsWrapperProps = {
|
|
102
|
+
sx,
|
|
103
|
+
legendPosition: props.slotProps?.legend?.position,
|
|
104
|
+
legendDirection: props.slotProps?.legend?.direction
|
|
105
|
+
};
|
|
94
106
|
return {
|
|
107
|
+
chartsWrapperProps,
|
|
95
108
|
chartContainerProps,
|
|
96
109
|
zAxisProps,
|
|
97
110
|
voronoiHandlerProps,
|
|
@@ -90,10 +90,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
90
90
|
children: [plotType === 'bar' && /*#__PURE__*/_jsx(BarPlot, {
|
|
91
91
|
skipAnimation: true,
|
|
92
92
|
slots: slots,
|
|
93
|
-
slotProps: slotProps
|
|
94
|
-
sx: {
|
|
95
|
-
shapeRendering: 'auto'
|
|
96
|
-
}
|
|
93
|
+
slotProps: slotProps
|
|
97
94
|
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
98
95
|
children: [/*#__PURE__*/_jsx(AreaPlot, {
|
|
99
96
|
skipAnimation: true,
|
package/constants/index.d.ts
CHANGED
package/constants/index.js
CHANGED
|
@@ -2,16 +2,19 @@ import { MakeOptional } from '@mui/x-internals/types';
|
|
|
2
2
|
import { AxisConfig, ScaleName } from '../../models';
|
|
3
3
|
import { ChartsAxisProps } from '../../models/axis';
|
|
4
4
|
export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, axisName: "x" | "y") => {
|
|
5
|
-
reverse?: boolean | undefined;
|
|
6
5
|
fill?: string | undefined;
|
|
7
|
-
stroke?: string | undefined;
|
|
8
6
|
data?: any[] | undefined;
|
|
9
7
|
label?: string | undefined;
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
9
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
10
|
+
reverse?: boolean | undefined;
|
|
11
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
12
|
+
stroke?: string | undefined;
|
|
13
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
12
14
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
13
15
|
dataKey?: string | undefined;
|
|
14
|
-
|
|
16
|
+
min?: (number | Date) | undefined;
|
|
17
|
+
max?: (number | Date) | undefined;
|
|
15
18
|
tickMaxStep?: number | undefined;
|
|
16
19
|
tickMinStep?: number | undefined;
|
|
17
20
|
tickNumber?: number | undefined;
|
|
@@ -21,13 +24,10 @@ export declare const defaultizeAxis: (inAxis: MakeOptional<AxisConfig<ScaleName,
|
|
|
21
24
|
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
22
25
|
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
23
26
|
tickSize?: number | undefined;
|
|
24
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
25
|
-
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
26
|
-
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
27
27
|
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
28
28
|
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
29
29
|
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
30
|
-
scaleType?: "
|
|
30
|
+
scaleType?: "time" | "linear" | "band" | "point" | "log" | "pow" | "sqrt" | "utc" | undefined;
|
|
31
31
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
32
32
|
hideTooltip?: boolean | undefined;
|
|
33
33
|
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
@@ -17,16 +17,19 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
17
17
|
pluginProviderProps: Omit<PluginProviderProps, "children">;
|
|
18
18
|
animationProviderProps: Omit<AnimationProviderProps, "children">;
|
|
19
19
|
xAxis: {
|
|
20
|
-
reverse?: boolean | undefined;
|
|
21
20
|
fill?: string | undefined;
|
|
22
|
-
stroke?: string | undefined;
|
|
23
21
|
data?: any[] | undefined;
|
|
24
22
|
label?: string | undefined;
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
24
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
25
|
+
reverse?: boolean | undefined;
|
|
26
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
27
|
+
stroke?: string | undefined;
|
|
28
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
27
29
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
28
30
|
dataKey?: string | undefined;
|
|
29
|
-
|
|
31
|
+
min?: (number | Date) | undefined;
|
|
32
|
+
max?: (number | Date) | undefined;
|
|
30
33
|
tickMaxStep?: number | undefined;
|
|
31
34
|
tickMinStep?: number | undefined;
|
|
32
35
|
tickNumber?: number | undefined;
|
|
@@ -36,13 +39,10 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
36
39
|
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
37
40
|
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
38
41
|
tickSize?: number | undefined;
|
|
39
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
40
|
-
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
41
|
-
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
42
42
|
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
43
43
|
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
44
44
|
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
45
|
-
scaleType?: "
|
|
45
|
+
scaleType?: "time" | "linear" | "band" | "point" | "log" | "pow" | "sqrt" | "utc" | undefined;
|
|
46
46
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
47
47
|
hideTooltip?: boolean | undefined;
|
|
48
48
|
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
@@ -52,16 +52,19 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
52
52
|
id: import("../../internals").AxisId;
|
|
53
53
|
}[];
|
|
54
54
|
yAxis: {
|
|
55
|
-
reverse?: boolean | undefined;
|
|
56
55
|
fill?: string | undefined;
|
|
57
|
-
stroke?: string | undefined;
|
|
58
56
|
data?: any[] | undefined;
|
|
59
57
|
label?: string | undefined;
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
59
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
60
|
+
reverse?: boolean | undefined;
|
|
61
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
62
|
+
stroke?: string | undefined;
|
|
63
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
62
64
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
63
65
|
dataKey?: string | undefined;
|
|
64
|
-
|
|
66
|
+
min?: (number | Date) | undefined;
|
|
67
|
+
max?: (number | Date) | undefined;
|
|
65
68
|
tickMaxStep?: number | undefined;
|
|
66
69
|
tickMinStep?: number | undefined;
|
|
67
70
|
tickNumber?: number | undefined;
|
|
@@ -71,13 +74,10 @@ export declare const useChartDataProviderProps: (props: ChartDataProviderProps)
|
|
|
71
74
|
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
72
75
|
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
73
76
|
tickSize?: number | undefined;
|
|
74
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
75
|
-
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
76
|
-
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
77
77
|
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
78
78
|
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
79
79
|
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
80
|
-
scaleType?: "
|
|
80
|
+
scaleType?: "time" | "linear" | "band" | "point" | "log" | "pow" | "sqrt" | "utc" | undefined;
|
|
81
81
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
82
82
|
hideTooltip?: boolean | undefined;
|
|
83
83
|
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
@@ -3,16 +3,19 @@ import { AxisConfig, ScaleName } from '../../models';
|
|
|
3
3
|
import { ChartsAxisProps } from '../../models/axis';
|
|
4
4
|
import { DatasetType } from '../../models/seriesType/config';
|
|
5
5
|
export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, inYAxis: MakeOptional<AxisConfig<ScaleName, any, ChartsAxisProps>, "id">[] | undefined, dataset: DatasetType | undefined) => {
|
|
6
|
-
reverse?: boolean | undefined;
|
|
7
6
|
fill?: string | undefined;
|
|
8
|
-
stroke?: string | undefined;
|
|
9
7
|
data?: any[] | undefined;
|
|
10
8
|
label?: string | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
10
|
+
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
11
|
+
reverse?: boolean | undefined;
|
|
12
|
+
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
13
|
+
stroke?: string | undefined;
|
|
14
|
+
sx?: import("@mui/system").SxProps | undefined;
|
|
13
15
|
valueFormatter?: ((value: any, context: import("../../internals").AxisValueFormatterContext) => string) | undefined;
|
|
14
16
|
dataKey?: string | undefined;
|
|
15
|
-
|
|
17
|
+
min?: (number | Date) | undefined;
|
|
18
|
+
max?: (number | Date) | undefined;
|
|
16
19
|
tickMaxStep?: number | undefined;
|
|
17
20
|
tickMinStep?: number | undefined;
|
|
18
21
|
tickNumber?: number | undefined;
|
|
@@ -22,13 +25,10 @@ export declare const useDefaultizeAxis: (inXAxis: MakeOptional<AxisConfig<ScaleN
|
|
|
22
25
|
labelStyle?: import("../..").ChartsTextStyle | undefined;
|
|
23
26
|
tickLabelInterval?: "auto" | ((value: any, index: number) => boolean) | undefined;
|
|
24
27
|
tickSize?: number | undefined;
|
|
25
|
-
classes?: Partial<import("../..").ChartsAxisClasses> | undefined;
|
|
26
|
-
slots?: Partial<import("../../internals").ChartsAxisSlots> | undefined;
|
|
27
|
-
slotProps?: Partial<import("../../internals").ChartsAxisSlotProps> | undefined;
|
|
28
28
|
tickInterval?: "auto" | ((value: any, index: number) => boolean) | any[] | undefined;
|
|
29
29
|
tickPlacement?: "start" | "end" | "middle" | "extremities" | undefined;
|
|
30
30
|
tickLabelPlacement?: "middle" | "tick" | undefined;
|
|
31
|
-
scaleType?: "
|
|
31
|
+
scaleType?: "time" | "linear" | "band" | "point" | "log" | "pow" | "sqrt" | "utc" | undefined;
|
|
32
32
|
colorMap?: import("../../models/colorMapping").ContinuousColorConfig<number | Date> | import("../../models/colorMapping").PiecewiseColorConfig<number | Date> | import("../../models/colorMapping").OrdinalColorConfig<string | number | Date> | undefined;
|
|
33
33
|
hideTooltip?: boolean | undefined;
|
|
34
34
|
domainLimit?: "nice" | "strict" | ((min: number, max: number) => {
|
|
@@ -17,7 +17,7 @@ export type ChartContextValue<TSignatures extends readonly ChartAnyPluginSignatu
|
|
|
17
17
|
/**
|
|
18
18
|
* The ref to the <svg />.
|
|
19
19
|
*/
|
|
20
|
-
svgRef: React.RefObject<SVGSVGElement>;
|
|
20
|
+
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
21
21
|
};
|
|
22
22
|
export interface ChartProviderProps {
|
|
23
23
|
children: React.ReactNode;
|
|
@@ -33,8 +33,8 @@ export declare const selectorChartsInteractionItem: ((state: import("../internal
|
|
|
33
33
|
dependencyRecomputations: () => number;
|
|
34
34
|
resetDependencyRecomputations: () => void;
|
|
35
35
|
} & {
|
|
36
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
37
36
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
37
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
38
38
|
};
|
|
39
39
|
export declare const selectorChartsInteractionAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
40
40
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -64,8 +64,8 @@ export declare const selectorChartsInteractionAxis: ((state: import("../internal
|
|
|
64
64
|
dependencyRecomputations: () => number;
|
|
65
65
|
resetDependencyRecomputations: () => void;
|
|
66
66
|
} & {
|
|
67
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
68
67
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
68
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
69
69
|
};
|
|
70
70
|
export declare const selectorChartsInteractionXAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
71
71
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -107,8 +107,8 @@ export declare const selectorChartsInteractionXAxis: ((state: import("../interna
|
|
|
107
107
|
dependencyRecomputations: () => number;
|
|
108
108
|
resetDependencyRecomputations: () => void;
|
|
109
109
|
} & {
|
|
110
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
111
110
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
111
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
112
112
|
};
|
|
113
113
|
export declare const selectorChartsInteractionYAxis: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
114
114
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -150,8 +150,8 @@ export declare const selectorChartsInteractionYAxis: ((state: import("../interna
|
|
|
150
150
|
dependencyRecomputations: () => number;
|
|
151
151
|
resetDependencyRecomputations: () => void;
|
|
152
152
|
} & {
|
|
153
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
154
153
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
154
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
155
155
|
};
|
|
156
156
|
export declare const selectorChartsInteractionItemIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
157
157
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -195,16 +195,16 @@ export declare const selectorChartsInteractionItemIsDefined: ((state: import("..
|
|
|
195
195
|
dependencyRecomputations: () => number;
|
|
196
196
|
resetDependencyRecomputations: () => void;
|
|
197
197
|
} & {
|
|
198
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
199
198
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
199
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
200
200
|
}];
|
|
201
201
|
recomputations: () => number;
|
|
202
202
|
resetRecomputations: () => void;
|
|
203
203
|
dependencyRecomputations: () => number;
|
|
204
204
|
resetDependencyRecomputations: () => void;
|
|
205
205
|
} & {
|
|
206
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
207
206
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
207
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
208
208
|
};
|
|
209
209
|
export declare const selectorChartsInteractionXAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
210
210
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -266,16 +266,16 @@ export declare const selectorChartsInteractionXAxisIsDefined: ((state: import(".
|
|
|
266
266
|
dependencyRecomputations: () => number;
|
|
267
267
|
resetDependencyRecomputations: () => void;
|
|
268
268
|
} & {
|
|
269
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
270
269
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
270
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
271
271
|
}];
|
|
272
272
|
recomputations: () => number;
|
|
273
273
|
resetRecomputations: () => void;
|
|
274
274
|
dependencyRecomputations: () => number;
|
|
275
275
|
resetDependencyRecomputations: () => void;
|
|
276
276
|
} & {
|
|
277
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
278
277
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
278
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
279
279
|
};
|
|
280
280
|
export declare const selectorChartsInteractionYAxisIsDefined: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
281
281
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -337,16 +337,16 @@ export declare const selectorChartsInteractionYAxisIsDefined: ((state: import(".
|
|
|
337
337
|
dependencyRecomputations: () => number;
|
|
338
338
|
resetDependencyRecomputations: () => void;
|
|
339
339
|
} & {
|
|
340
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
341
340
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
341
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
342
342
|
}];
|
|
343
343
|
recomputations: () => number;
|
|
344
344
|
resetRecomputations: () => void;
|
|
345
345
|
dependencyRecomputations: () => number;
|
|
346
346
|
resetDependencyRecomputations: () => void;
|
|
347
347
|
} & {
|
|
348
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
349
348
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
349
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
350
350
|
};
|
|
351
351
|
export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: import("../internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("../internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types").UseChartInteractionState & Partial<{}> & {
|
|
352
352
|
cacheKey: import("../internals/plugins/models").ChartStateCacheKey;
|
|
@@ -376,7 +376,7 @@ export declare const selectorChartsInteractionIsVoronoiEnabled: ((state: import(
|
|
|
376
376
|
dependencyRecomputations: () => number;
|
|
377
377
|
resetDependencyRecomputations: () => void;
|
|
378
378
|
} & {
|
|
379
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
380
379
|
memoize: typeof import("reselect").weakMapMemoize;
|
|
380
|
+
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
381
381
|
};
|
|
382
382
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ChartSeriesDefaultized, ChartSeriesType, ChartsSeriesConfig, DatasetType } from '../../models/seriesType/config';
|
|
2
2
|
import type { SeriesId } from '../../models/seriesType/common';
|
|
3
3
|
import type { StackingGroupsType } from '../../internals/stackSeries';
|
|
4
|
-
import type { LegendItemParams } from '../../ChartsLegend
|
|
4
|
+
import type { LegendItemParams } from '../../ChartsLegend';
|
|
5
5
|
export type SeriesFormatterParams<T extends ChartSeriesType> = {
|
|
6
6
|
series: Record<SeriesId, ChartsSeriesConfig[T]['seriesInput']>;
|
|
7
7
|
seriesOrder: SeriesId[];
|
|
@@ -4,14 +4,6 @@ import { SeriesFormatter, SeriesFormatterConfig } from './SeriesFormatter.types'
|
|
|
4
4
|
import { ColorProcessor, ColorProcessorsConfig } from './ColorProcessor.types';
|
|
5
5
|
import { ExtremumGetter, ExtremumGettersConfig } from './ExtremumGetter.types';
|
|
6
6
|
export declare const defaultPlugins: ({
|
|
7
|
-
seriesType: "bar";
|
|
8
|
-
seriesFormatter: SeriesFormatter<"bar">;
|
|
9
|
-
colorProcessor: ColorProcessor<"bar">;
|
|
10
|
-
xExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
11
|
-
yExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
12
|
-
rotationExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
13
|
-
radiusExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
14
|
-
} | {
|
|
15
7
|
seriesType: "line";
|
|
16
8
|
seriesFormatter: SeriesFormatter<"line">;
|
|
17
9
|
colorProcessor: ColorProcessor<"line">;
|
|
@@ -19,6 +11,14 @@ export declare const defaultPlugins: ({
|
|
|
19
11
|
yExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
20
12
|
rotationExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
21
13
|
radiusExtremumGetter?: ExtremumGetter<"line"> | undefined;
|
|
14
|
+
} | {
|
|
15
|
+
seriesType: "bar";
|
|
16
|
+
seriesFormatter: SeriesFormatter<"bar">;
|
|
17
|
+
colorProcessor: ColorProcessor<"bar">;
|
|
18
|
+
xExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
19
|
+
yExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
20
|
+
rotationExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
21
|
+
radiusExtremumGetter?: ExtremumGetter<"bar"> | undefined;
|
|
22
22
|
} | {
|
|
23
23
|
seriesType: "scatter";
|
|
24
24
|
seriesFormatter: SeriesFormatter<"scatter">;
|
|
@@ -14,7 +14,7 @@ export interface SizeContextState extends Required<Pick<SizeProviderProps, 'heig
|
|
|
14
14
|
/**
|
|
15
15
|
* The ref of the svg element that the chart is rendered in.
|
|
16
16
|
*/
|
|
17
|
-
svgRef: React.RefObject<SVGSVGElement>;
|
|
17
|
+
svgRef: React.RefObject<SVGSVGElement | null>;
|
|
18
18
|
/**
|
|
19
19
|
* If the chart has a defined size.
|
|
20
20
|
*/
|