@mui/x-charts 8.23.0 → 8.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +39 -0
- package/BarChart/BarChart.plugins.d.ts +2 -1
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/BarChart/BarLabel/BarLabel.js +8 -3
- package/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/BarChart/BarPlot.d.ts +12 -2
- package/BarChart/BarPlot.js +29 -86
- package/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/BarChart/BatchBarPlot/BarGroup.js +142 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.js +140 -0
- package/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/BarChart/BatchBarPlot/index.js +12 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.js +53 -0
- package/BarChart/FocusedBar.js +5 -1
- package/BarChart/IndividualBarPlot.d.ts +21 -0
- package/BarChart/IndividualBarPlot.js +106 -0
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -1
- package/BarChart/seriesConfig/bar/legend.js +1 -0
- package/BarChart/seriesConfig/index.js +3 -1
- package/BarChart/types.d.ts +2 -0
- package/BarChart/useBarChartProps.d.ts +6 -2
- package/BarChart/useBarChartProps.js +4 -2
- package/BarChart/useBarPlotData.d.ts +1 -1
- package/BarChart/useBarPlotData.js +23 -4
- package/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/BarChart/useRegisterItemClickHandlers.js +72 -0
- package/CHANGELOG.md +111 -1
- package/ChartContainer/ChartContainer.js +34 -0
- package/ChartContainer/useChartContainerProps.js +6 -2
- package/ChartsLegend/ChartsLegend.js +2 -2
- package/ChartsLegend/legendContext.types.d.ts +12 -0
- package/ChartsLegend/onClickContextBuilder.js +2 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsReferenceLine/common.js +4 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +25 -21
- package/Gauge/GaugeContainer.js +4 -1
- package/LineChart/AnimatedLine.js +7 -3
- package/LineChart/AppearingMask.js +4 -1
- package/LineChart/CircleMarkElement.d.ts +5 -0
- package/LineChart/CircleMarkElement.js +13 -5
- package/LineChart/FocusedLineMark.js +5 -1
- package/LineChart/LineChart.js +30 -0
- package/LineChart/LineChart.plugins.d.ts +2 -1
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/LineElement.d.ts +4 -0
- package/LineChart/LineElement.js +7 -3
- package/LineChart/MarkElement.d.ts +5 -0
- package/LineChart/MarkElement.js +17 -10
- package/LineChart/markElementClasses.d.ts +0 -1
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/seriesConfig/legend.js +1 -0
- package/PieChart/FocusedPieArc.js +5 -2
- package/PieChart/PieArcLabel.d.ts +2 -0
- package/PieChart/PieArcLabel.js +5 -2
- package/PieChart/PieChart.js +35 -5
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/seriesConfig/index.js +3 -1
- package/PieChart/seriesConfig/legend.js +6 -3
- package/RadarChart/RadarChart.js +30 -0
- package/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/RadarChart/RadarChart.plugins.js +2 -1
- package/RadarChart/seriesConfig/index.js +3 -1
- package/RadarChart/seriesConfig/legend.js +1 -0
- package/ScatterChart/BatchScatter.js +8 -14
- package/ScatterChart/ScatterChart.js +30 -0
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/seriesConfig/index.js +3 -1
- package/ScatterChart/seriesConfig/legend.js +1 -0
- package/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/BarChart/BarChart.js +39 -0
- package/esm/BarChart/BarChart.plugins.d.ts +2 -1
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabel.js +8 -3
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/esm/BarChart/BarPlot.d.ts +12 -2
- package/esm/BarChart/BarPlot.js +29 -86
- package/esm/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/esm/BarChart/BatchBarPlot/BarGroup.js +134 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.js +133 -0
- package/esm/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/esm/BarChart/BatchBarPlot/index.js +1 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.js +46 -0
- package/esm/BarChart/FocusedBar.js +5 -1
- package/esm/BarChart/IndividualBarPlot.d.ts +21 -0
- package/esm/BarChart/IndividualBarPlot.js +98 -0
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -1
- package/esm/BarChart/seriesConfig/bar/legend.js +1 -0
- package/esm/BarChart/seriesConfig/index.js +3 -1
- package/esm/BarChart/types.d.ts +2 -0
- package/esm/BarChart/useBarChartProps.d.ts +6 -2
- package/esm/BarChart/useBarChartProps.js +4 -3
- package/esm/BarChart/useBarPlotData.d.ts +1 -1
- package/esm/BarChart/useBarPlotData.js +20 -1
- package/esm/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/esm/BarChart/useRegisterItemClickHandlers.js +67 -0
- package/esm/ChartContainer/ChartContainer.js +34 -0
- package/esm/ChartContainer/useChartContainerProps.js +6 -2
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/legendContext.types.d.ts +12 -0
- package/esm/ChartsLegend/onClickContextBuilder.js +2 -1
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/esm/ChartsReferenceLine/common.d.ts +1 -1
- package/esm/ChartsReferenceLine/common.js +4 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +26 -22
- package/esm/Gauge/GaugeContainer.js +4 -1
- package/esm/LineChart/AnimatedLine.js +7 -3
- package/esm/LineChart/AppearingMask.js +4 -1
- package/esm/LineChart/CircleMarkElement.d.ts +5 -0
- package/esm/LineChart/CircleMarkElement.js +13 -5
- package/esm/LineChart/FocusedLineMark.js +5 -1
- package/esm/LineChart/LineChart.js +30 -0
- package/esm/LineChart/LineChart.plugins.d.ts +2 -1
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/LineElement.d.ts +4 -0
- package/esm/LineChart/LineElement.js +7 -3
- package/esm/LineChart/MarkElement.d.ts +5 -0
- package/esm/LineChart/MarkElement.js +17 -10
- package/esm/LineChart/markElementClasses.d.ts +0 -1
- package/esm/LineChart/seriesConfig/index.js +3 -1
- package/esm/LineChart/seriesConfig/legend.js +1 -0
- package/esm/PieChart/FocusedPieArc.js +4 -1
- package/esm/PieChart/PieArcLabel.d.ts +2 -0
- package/esm/PieChart/PieArcLabel.js +5 -2
- package/esm/PieChart/PieChart.js +35 -5
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/seriesConfig/index.js +3 -1
- package/esm/PieChart/seriesConfig/legend.js +6 -3
- package/esm/RadarChart/RadarChart.js +30 -0
- package/esm/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/esm/RadarChart/RadarChart.plugins.js +2 -1
- package/esm/RadarChart/seriesConfig/index.js +3 -1
- package/esm/RadarChart/seriesConfig/legend.js +1 -0
- package/esm/ScatterChart/BatchScatter.js +5 -11
- package/esm/ScatterChart/ScatterChart.js +30 -0
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/esm/ScatterChart/ScatterChart.plugins.js +2 -1
- package/esm/ScatterChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChart/seriesConfig/legend.js +1 -0
- package/esm/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/index.js +1 -1
- package/esm/internals/appendAtKey.d.ts +8 -0
- package/esm/internals/appendAtKey.js +17 -0
- package/esm/internals/commonNextFocusItem.js +12 -8
- package/esm/internals/getBarDimensions.d.ts +1 -2
- package/esm/internals/identifierSerializer.d.ts +9 -0
- package/esm/internals/identifierSerializer.js +6 -0
- package/esm/internals/index.d.ts +6 -2
- package/esm/internals/index.js +6 -2
- package/esm/internals/invertScale.d.ts +6 -2
- package/esm/internals/invertScale.js +9 -1
- package/esm/internals/plugins/allPlugins.d.ts +4 -3
- package/esm/internals/plugins/allPlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +18 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +74 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +83 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +7 -34
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +9 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +10 -32
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +78 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +19 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +11 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/index.js +2 -1
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +7 -0
- package/esm/models/axis.d.ts +5 -4
- package/esm/models/featureFlags.d.ts +1 -0
- package/esm/models/featureFlags.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.js +1 -0
- package/index.js +1 -1
- package/internals/appendAtKey.d.ts +8 -0
- package/internals/appendAtKey.js +23 -0
- package/internals/commonNextFocusItem.js +12 -8
- package/internals/getBarDimensions.d.ts +1 -2
- package/internals/identifierSerializer.d.ts +9 -0
- package/internals/identifierSerializer.js +16 -0
- package/internals/index.d.ts +6 -2
- package/internals/index.js +51 -7
- package/internals/invertScale.d.ts +6 -2
- package/internals/invertScale.js +10 -1
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +25 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +89 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +12 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +6 -34
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +15 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +9 -32
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +39 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +12 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +85 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +25 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +18 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.js +5 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/index.js +11 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +7 -0
- package/models/axis.d.ts +5 -4
- package/models/featureFlags.d.ts +1 -0
- package/models/featureFlags.js +5 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.js +5 -0
- package/package.json +13 -3
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type MarkElementOwnerState } from "./markElementClasses.js";
|
|
3
3
|
export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & {
|
|
4
|
+
/**
|
|
5
|
+
* If `true`, the marker is hidden.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
hidden?: boolean;
|
|
4
9
|
/**
|
|
5
10
|
* If `true`, animations are skipped.
|
|
6
11
|
* @default false
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -18,17 +18,14 @@ var _getSymbol = require("../internals/getSymbol");
|
|
|
18
18
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
19
19
|
var _markElementClasses = require("./markElementClasses");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
|
|
21
|
+
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted", "hidden", "style"];
|
|
22
22
|
const MarkElementPath = (0, _styles.styled)('path', {
|
|
23
23
|
name: 'MuiMarkElement',
|
|
24
24
|
slot: 'Root'
|
|
25
25
|
})(({
|
|
26
|
-
ownerState,
|
|
27
26
|
theme
|
|
28
27
|
}) => ({
|
|
29
28
|
fill: (theme.vars || theme).palette.background.paper,
|
|
30
|
-
stroke: ownerState.color,
|
|
31
|
-
strokeWidth: 2,
|
|
32
29
|
[`&.${_markElementClasses.markElementClasses.animate}`]: {
|
|
33
30
|
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
34
31
|
transitionProperty: 'transform, transform-origin, opacity',
|
|
@@ -57,7 +54,9 @@ function MarkElement(props) {
|
|
|
57
54
|
onClick,
|
|
58
55
|
skipAnimation,
|
|
59
56
|
isFaded = false,
|
|
60
|
-
isHighlighted = false
|
|
57
|
+
isHighlighted = false,
|
|
58
|
+
hidden,
|
|
59
|
+
style
|
|
61
60
|
} = props,
|
|
62
61
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
63
62
|
const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)({
|
|
@@ -70,23 +69,26 @@ function MarkElement(props) {
|
|
|
70
69
|
classes: innerClasses,
|
|
71
70
|
isHighlighted,
|
|
72
71
|
isFaded,
|
|
73
|
-
color,
|
|
74
72
|
skipAnimation
|
|
75
73
|
};
|
|
76
74
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
77
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MarkElementPath, (0, _extends2.default)({}, other, {
|
|
78
|
-
style: {
|
|
76
|
+
style: (0, _extends2.default)({}, style, {
|
|
79
77
|
transform: `translate(${x}px, ${y}px)`,
|
|
80
78
|
transformOrigin: `${x}px ${y}px`
|
|
81
|
-
},
|
|
79
|
+
}),
|
|
82
80
|
ownerState: ownerState,
|
|
83
81
|
className: classes.root,
|
|
84
82
|
d: (0, _d3Shape.symbol)(_d3Shape.symbolsFill[(0, _getSymbol.getSymbol)(shape)])(),
|
|
85
83
|
onClick: onClick,
|
|
86
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
84
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
85
|
+
pointerEvents: hidden ? 'none' : undefined
|
|
87
86
|
}, interactionProps, {
|
|
88
87
|
"data-highlighted": isHighlighted || undefined,
|
|
89
|
-
"data-faded": isFaded || undefined
|
|
88
|
+
"data-faded": isFaded || undefined,
|
|
89
|
+
opacity: hidden ? 0 : 1,
|
|
90
|
+
strokeWidth: 2,
|
|
91
|
+
stroke: color
|
|
90
92
|
}));
|
|
91
93
|
}
|
|
92
94
|
process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
@@ -99,6 +101,11 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
99
101
|
* The index to the element in the series' data array.
|
|
100
102
|
*/
|
|
101
103
|
dataIndex: _propTypes.default.number.isRequired,
|
|
104
|
+
/**
|
|
105
|
+
* If `true`, the marker is hidden.
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
hidden: _propTypes.default.bool,
|
|
102
109
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
103
110
|
/**
|
|
104
111
|
* If `true`, the marker is faded.
|
|
@@ -17,7 +17,6 @@ export interface MarkElementClasses {
|
|
|
17
17
|
export type MarkElementClassKey = keyof MarkElementClasses;
|
|
18
18
|
export interface MarkElementOwnerState {
|
|
19
19
|
id: SeriesId;
|
|
20
|
-
color: string;
|
|
21
20
|
isFaded: boolean;
|
|
22
21
|
isHighlighted: boolean;
|
|
23
22
|
classes?: Partial<MarkElementClasses>;
|
|
@@ -14,6 +14,7 @@ var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
|
14
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
15
15
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
16
16
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
17
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
17
18
|
const lineSeriesConfig = exports.lineSeriesConfig = {
|
|
18
19
|
colorProcessor: _getColor.default,
|
|
19
20
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -24,5 +25,6 @@ const lineSeriesConfig = exports.lineSeriesConfig = {
|
|
|
24
25
|
xExtremumGetter: _extremums.getExtremumX,
|
|
25
26
|
yExtremumGetter: _extremums.getExtremumY,
|
|
26
27
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
27
|
-
keyboardFocusHandler: _keyboardFocusHandler.default
|
|
28
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
29
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
28
30
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.FocusedPieArc = FocusedPieArc;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _styles = require("@mui/material/styles");
|
|
13
14
|
var _useFocusedItem = require("../hooks/useFocusedItem");
|
|
@@ -16,6 +17,7 @@ var _PieArc = require("./PieArc");
|
|
|
16
17
|
var _useItemHighlighted = require("../hooks/useItemHighlighted");
|
|
17
18
|
var _getModifiedArcProperties = require("./dataTransform/getModifiedArcProperties");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const _excluded = ["arcLabelRadius"];
|
|
19
21
|
function FocusedPieArc(props) {
|
|
20
22
|
const theme = (0, _styles.useTheme)();
|
|
21
23
|
const focusedItem = (0, _useFocusedItem.useFocusedItem)();
|
|
@@ -37,7 +39,8 @@ function FocusedPieArc(props) {
|
|
|
37
39
|
return null;
|
|
38
40
|
}
|
|
39
41
|
const item = series.data[focusedItem.dataIndex];
|
|
40
|
-
const
|
|
42
|
+
const _getModifiedArcProper = (0, _getModifiedArcProperties.getModifiedArcProperties)(series, pieSeriesLayout[focusedItem.seriesId], isHighlighted, isFaded),
|
|
43
|
+
arcSizes = (0, _objectWithoutPropertiesLoose2.default)(_getModifiedArcProper, _excluded);
|
|
41
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArc.PieArc, (0, _extends2.default)({
|
|
42
45
|
transform: `translate(${pieSeriesLayout[series.id].center.x}, ${pieSeriesLayout[series.id].center.y})`,
|
|
43
46
|
startAngle: item.startAngle,
|
|
@@ -36,6 +36,7 @@ export type PieArcLabelProps = PieArcLabelOwnerState & Omit<React.SVGProps<SVGTe
|
|
|
36
36
|
paddingAngle: number;
|
|
37
37
|
skipAnimation: boolean;
|
|
38
38
|
formattedArcLabel?: string | null;
|
|
39
|
+
hidden?: boolean;
|
|
39
40
|
};
|
|
40
41
|
declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, "ref" | "color" | "id"> & {
|
|
41
42
|
startAngle: number;
|
|
@@ -47,5 +48,6 @@ declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState
|
|
|
47
48
|
paddingAngle: number;
|
|
48
49
|
skipAnimation: boolean;
|
|
49
50
|
formattedArcLabel?: string | null;
|
|
51
|
+
hidden?: boolean;
|
|
50
52
|
} & React.RefAttributes<SVGTextElement>>;
|
|
51
53
|
export { PieArcLabel };
|
package/PieChart/PieArcLabel.js
CHANGED
|
@@ -20,7 +20,7 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
20
20
|
var _animation = require("../internals/animation/animation");
|
|
21
21
|
var _useAnimatePieArcLabel = require("../hooks/animation/useAnimatePieArcLabel");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation"];
|
|
23
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation", "hidden"];
|
|
24
24
|
function getPieArcLabelUtilityClass(slot) {
|
|
25
25
|
return (0, _generateUtilityClass.default)('MuiPieArcLabel', slot);
|
|
26
26
|
}
|
|
@@ -76,7 +76,8 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
|
|
|
76
76
|
formattedArcLabel,
|
|
77
77
|
isHighlighted,
|
|
78
78
|
isFaded,
|
|
79
|
-
skipAnimation
|
|
79
|
+
skipAnimation,
|
|
80
|
+
hidden
|
|
80
81
|
} = props,
|
|
81
82
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
82
83
|
const ownerState = {
|
|
@@ -101,6 +102,7 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
|
|
|
101
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PieArcLabelRoot, (0, _extends2.default)({
|
|
102
103
|
className: classes.root
|
|
103
104
|
}, other, animatedProps, {
|
|
105
|
+
opacity: hidden ? 0 : 1,
|
|
104
106
|
children: formattedArcLabel
|
|
105
107
|
}));
|
|
106
108
|
});
|
|
@@ -116,6 +118,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
|
116
118
|
cornerRadius: _propTypes.default.number.isRequired,
|
|
117
119
|
endAngle: _propTypes.default.number.isRequired,
|
|
118
120
|
formattedArcLabel: _propTypes.default.string,
|
|
121
|
+
hidden: _propTypes.default.bool,
|
|
119
122
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
120
123
|
innerRadius: _propTypes.default.number.isRequired,
|
|
121
124
|
isFaded: _propTypes.default.bool.isRequired,
|
package/PieChart/PieChart.js
CHANGED
|
@@ -80,15 +80,15 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
80
80
|
plugins: _PieChart2.PIE_CHART_PLUGINS
|
|
81
81
|
}), ref);
|
|
82
82
|
const Tooltip = slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
83
|
-
const Toolbar =
|
|
83
|
+
const Toolbar = slots?.toolbar;
|
|
84
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
85
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, {
|
|
86
|
-
legendPosition:
|
|
87
|
-
legendDirection:
|
|
86
|
+
legendPosition: slotProps?.legend?.position,
|
|
87
|
+
legendDirection: slotProps?.legend?.direction ?? 'vertical',
|
|
88
88
|
sx: sx,
|
|
89
89
|
hideLegend: hideLegend ?? false,
|
|
90
|
-
children: [showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({},
|
|
91
|
-
direction:
|
|
90
|
+
children: [showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
91
|
+
direction: slotProps?.legend?.direction ?? 'vertical',
|
|
92
92
|
slots: slots,
|
|
93
93
|
slotProps: slotProps
|
|
94
94
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
@@ -133,6 +133,31 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
133
133
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
134
134
|
*/
|
|
135
135
|
height: _propTypes.default.number,
|
|
136
|
+
/**
|
|
137
|
+
* List of hidden series and/or items.
|
|
138
|
+
*
|
|
139
|
+
* Different chart types use different keys.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* [
|
|
144
|
+
* {
|
|
145
|
+
* type: 'pie',
|
|
146
|
+
* seriesId: 'series-1',
|
|
147
|
+
* dataIndex: 3,
|
|
148
|
+
* },
|
|
149
|
+
* {
|
|
150
|
+
* type: 'line',
|
|
151
|
+
* seriesId: 'series-2',
|
|
152
|
+
* }
|
|
153
|
+
* ]
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
157
|
+
dataIndex: _propTypes.default.number,
|
|
158
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
159
|
+
type: _propTypes.default.oneOf(['pie']).isRequired
|
|
160
|
+
})),
|
|
136
161
|
/**
|
|
137
162
|
* If `true`, the legend is not rendered.
|
|
138
163
|
*/
|
|
@@ -171,6 +196,11 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
171
196
|
right: _propTypes.default.number,
|
|
172
197
|
top: _propTypes.default.number
|
|
173
198
|
})]),
|
|
199
|
+
/**
|
|
200
|
+
* Callback fired when any hidden identifiers change.
|
|
201
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
202
|
+
*/
|
|
203
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
174
204
|
/**
|
|
175
205
|
* The callback fired when the highlighted item changes.
|
|
176
206
|
*
|
|
@@ -3,5 +3,6 @@ import { type UseChartTooltipSignature } from "../internals/plugins/featurePlugi
|
|
|
3
3
|
import { type UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
4
|
import { type UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
5
|
import { type ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
|
|
6
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
7
|
+
export type PieChartPluginSignatures = [UseChartTooltipSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'pie'>, UseChartKeyboardNavigationSignature];
|
|
7
8
|
export declare const PIE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<PieChartPluginSignatures>;
|
|
@@ -8,4 +8,5 @@ var _useChartInteraction = require("../internals/plugins/featurePlugins/useChart
|
|
|
8
8
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
9
9
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
10
10
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
11
|
-
|
|
11
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
12
|
+
const PIE_CHART_PLUGINS = exports.PIE_CHART_PLUGINS = [_useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -13,6 +13,7 @@ var _seriesLayout = _interopRequireDefault(require("./seriesLayout"));
|
|
|
13
13
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
14
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
15
15
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
16
17
|
const pieSeriesConfig = exports.pieSeriesConfig = {
|
|
17
18
|
colorProcessor: _getColor.default,
|
|
18
19
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -21,5 +22,6 @@ const pieSeriesConfig = exports.pieSeriesConfig = {
|
|
|
21
22
|
tooltipGetter: _tooltip.default,
|
|
22
23
|
tooltipItemPositionGetter: _tooltipPosition.default,
|
|
23
24
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
24
|
-
keyboardFocusHandler: _keyboardFocusHandler.default
|
|
25
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
26
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
25
27
|
};
|
|
@@ -16,13 +16,16 @@ const legendGetter = params => {
|
|
|
16
16
|
if (formattedLabel === undefined) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
+
const id = item.id ?? dataIndex;
|
|
19
20
|
acc.push({
|
|
21
|
+
type: 'pie',
|
|
20
22
|
markType: item.labelMarkType ?? series[seriesId].labelMarkType,
|
|
21
|
-
id: item.id ?? dataIndex,
|
|
22
23
|
seriesId,
|
|
24
|
+
id,
|
|
25
|
+
itemId: id,
|
|
26
|
+
dataIndex,
|
|
23
27
|
color: item.color,
|
|
24
|
-
label: formattedLabel
|
|
25
|
-
itemId: item.id ?? dataIndex
|
|
28
|
+
label: formattedLabel
|
|
26
29
|
});
|
|
27
30
|
});
|
|
28
31
|
return acc;
|
package/RadarChart/RadarChart.js
CHANGED
|
@@ -91,6 +91,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
91
91
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
92
92
|
*/
|
|
93
93
|
height: _propTypes.default.number,
|
|
94
|
+
/**
|
|
95
|
+
* List of hidden series and/or items.
|
|
96
|
+
*
|
|
97
|
+
* Different chart types use different keys.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* [
|
|
102
|
+
* {
|
|
103
|
+
* type: 'pie',
|
|
104
|
+
* seriesId: 'series-1',
|
|
105
|
+
* dataIndex: 3,
|
|
106
|
+
* },
|
|
107
|
+
* {
|
|
108
|
+
* type: 'line',
|
|
109
|
+
* seriesId: 'series-2',
|
|
110
|
+
* }
|
|
111
|
+
* ]
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
115
|
+
dataIndex: _propTypes.default.number,
|
|
116
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
117
|
+
type: _propTypes.default.oneOf(['radar']).isRequired
|
|
118
|
+
})),
|
|
94
119
|
/**
|
|
95
120
|
* If `true`, the legend is not rendered.
|
|
96
121
|
*/
|
|
@@ -147,6 +172,11 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
147
172
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
148
173
|
*/
|
|
149
174
|
onAxisClick: _propTypes.default.func,
|
|
175
|
+
/**
|
|
176
|
+
* Callback fired when any hidden identifiers change.
|
|
177
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
178
|
+
*/
|
|
179
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
150
180
|
/**
|
|
151
181
|
* The callback fired when the highlighted item changes.
|
|
152
182
|
*
|
|
@@ -2,5 +2,6 @@ import { type UseChartPolarAxisSignature } from "../internals/plugins/featurePlu
|
|
|
2
2
|
import { type UseChartTooltipSignature } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
|
|
3
3
|
import { type UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { type UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
6
|
+
export declare const RADAR_PLUGINS: readonly [import("../internals/index.js").ChartPlugin<UseChartTooltipSignature>, import("../internals/index.js").ChartPlugin<UseChartInteractionSignature>, import("../internals/index.js").ChartPlugin<UseChartPolarAxisSignature<any>>, import("../internals/index.js").ChartPlugin<UseChartHighlightSignature>, import("../internals/index.js").ChartPlugin<UseChartVisibilityManagerSignature<any>>];
|
|
7
|
+
export type RadarChartPluginSignatures = [UseChartTooltipSignature, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'radar'>];
|
|
@@ -8,4 +8,5 @@ var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPo
|
|
|
8
8
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
9
9
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
10
10
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
11
|
-
|
|
11
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
12
|
+
const RADAR_PLUGINS = exports.RADAR_PLUGINS = [_useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartPolarAxis.useChartPolarAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager];
|
|
@@ -13,6 +13,7 @@ var _legend = _interopRequireDefault(require("./legend"));
|
|
|
13
13
|
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
14
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
15
15
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
16
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
16
17
|
const radarSeriesConfig = exports.radarSeriesConfig = {
|
|
17
18
|
colorProcessor: _getColor.default,
|
|
18
19
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -22,5 +23,6 @@ const radarSeriesConfig = exports.radarSeriesConfig = {
|
|
|
22
23
|
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
23
24
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
24
25
|
radiusExtremumGetter: _extremums.radiusExtremumGetter,
|
|
25
|
-
rotationExtremumGetter: _extremums.rotationExtremumGetter
|
|
26
|
+
rotationExtremumGetter: _extremums.rotationExtremumGetter,
|
|
27
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
26
28
|
};
|
|
@@ -12,21 +12,12 @@ var _scatterClasses = require("./scatterClasses");
|
|
|
12
12
|
var _ChartProvider = require("../context/ChartProvider");
|
|
13
13
|
var _useScale = require("../hooks/useScale");
|
|
14
14
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
15
|
+
var _appendAtKey = require("../internals/appendAtKey");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
const MAX_POINTS_PER_PATH = 1000;
|
|
17
18
|
/* In an SVG arc, if the arc starts and ends at the same point, it is not rendered, so we add a tiny
|
|
18
19
|
* value to one of the coordinates to ensure that the arc is rendered. */
|
|
19
20
|
const ALMOST_ZERO = 0.01;
|
|
20
|
-
function appendAtKey(map, key, value) {
|
|
21
|
-
let bucket = map.get(key);
|
|
22
|
-
if (!bucket) {
|
|
23
|
-
bucket = [value];
|
|
24
|
-
map.set(key, bucket);
|
|
25
|
-
} else {
|
|
26
|
-
bucket.push(value);
|
|
27
|
-
}
|
|
28
|
-
return bucket;
|
|
29
|
-
}
|
|
30
21
|
function createPath(x, y, markerSize) {
|
|
31
22
|
return `M${x - markerSize} ${y} a${markerSize} ${markerSize} 0 1 1 0 ${ALMOST_ZERO}`;
|
|
32
23
|
}
|
|
@@ -47,15 +38,15 @@ function useCreatePaths(seriesData, markerSize, xScale, yScale, color, colorGett
|
|
|
47
38
|
}
|
|
48
39
|
const path = createPath(x, y, markerSize);
|
|
49
40
|
const fill = colorGetter ? colorGetter(i) : color;
|
|
50
|
-
const tempPath = appendAtKey(temporaryPaths, fill, path);
|
|
41
|
+
const tempPath = (0, _appendAtKey.appendAtKey)(temporaryPaths, fill, path);
|
|
51
42
|
if (tempPath.length >= MAX_POINTS_PER_PATH) {
|
|
52
|
-
appendAtKey(paths, fill, tempPath.join(''));
|
|
43
|
+
(0, _appendAtKey.appendAtKey)(paths, fill, tempPath.join(''));
|
|
53
44
|
temporaryPaths.delete(fill);
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
47
|
for (const [fill, tempPath] of temporaryPaths.entries()) {
|
|
57
48
|
if (tempPath.length > 0) {
|
|
58
|
-
appendAtKey(paths, fill, tempPath.join(''));
|
|
49
|
+
(0, _appendAtKey.appendAtKey)(paths, fill, tempPath.join(''));
|
|
59
50
|
}
|
|
60
51
|
}
|
|
61
52
|
return paths;
|
|
@@ -87,7 +78,10 @@ function BatchScatterPaths(props) {
|
|
|
87
78
|
}
|
|
88
79
|
const MemoBatchScatterPaths = /*#__PURE__*/React.memo(BatchScatterPaths);
|
|
89
80
|
if (process.env.NODE_ENV !== "production") MemoBatchScatterPaths.displayName = "MemoBatchScatterPaths";
|
|
90
|
-
const Group = (0, _styles.styled)('g'
|
|
81
|
+
const Group = (0, _styles.styled)('g', {
|
|
82
|
+
slot: 'internal',
|
|
83
|
+
shouldForwardProp: undefined
|
|
84
|
+
})({
|
|
91
85
|
'&[data-faded="true"]': {
|
|
92
86
|
opacity: 0.3
|
|
93
87
|
},
|
|
@@ -131,6 +131,31 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
131
131
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
132
132
|
*/
|
|
133
133
|
height: _propTypes.default.number,
|
|
134
|
+
/**
|
|
135
|
+
* List of hidden series and/or items.
|
|
136
|
+
*
|
|
137
|
+
* Different chart types use different keys.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* [
|
|
142
|
+
* {
|
|
143
|
+
* type: 'pie',
|
|
144
|
+
* seriesId: 'series-1',
|
|
145
|
+
* dataIndex: 3,
|
|
146
|
+
* },
|
|
147
|
+
* {
|
|
148
|
+
* type: 'line',
|
|
149
|
+
* seriesId: 'series-2',
|
|
150
|
+
* }
|
|
151
|
+
* ]
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
155
|
+
dataIndex: _propTypes.default.number,
|
|
156
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
157
|
+
type: _propTypes.default.oneOf(['scatter']).isRequired
|
|
158
|
+
})),
|
|
134
159
|
/**
|
|
135
160
|
* If `true`, the legend is not rendered.
|
|
136
161
|
*/
|
|
@@ -176,6 +201,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
176
201
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
177
202
|
*/
|
|
178
203
|
onAxisClick: _propTypes.default.func,
|
|
204
|
+
/**
|
|
205
|
+
* Callback fired when any hidden identifiers change.
|
|
206
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
207
|
+
*/
|
|
208
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
179
209
|
/**
|
|
180
210
|
* The callback fired when the highlighted item changes.
|
|
181
211
|
*
|
|
@@ -7,5 +7,6 @@ import { type ConvertSignaturesIntoPlugins } from "../internals/plugins/models/h
|
|
|
7
7
|
import { type UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
8
8
|
import { type UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
9
9
|
import { type UseChartBrushSignature } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
|
|
10
|
-
|
|
10
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
11
|
+
export type ScatterChartPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'scatter'>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
11
12
|
export declare const SCATTER_CHART_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartPluginSignatures>;
|
|
@@ -12,4 +12,5 @@ var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHi
|
|
|
12
12
|
var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
|
|
13
13
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
14
14
|
var _useChartBrush = require("../internals/plugins/featurePlugins/useChartBrush");
|
|
15
|
-
|
|
15
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
16
|
+
const SCATTER_CHART_PLUGINS = exports.SCATTER_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -13,6 +13,7 @@ var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
|
13
13
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
14
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
15
15
|
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
16
17
|
const scatterSeriesConfig = exports.scatterSeriesConfig = {
|
|
17
18
|
seriesProcessor: _seriesProcessor.default,
|
|
18
19
|
colorProcessor: _getColor.default,
|
|
@@ -22,5 +23,6 @@ const scatterSeriesConfig = exports.scatterSeriesConfig = {
|
|
|
22
23
|
xExtremumGetter: _extremums.getExtremumX,
|
|
23
24
|
yExtremumGetter: _extremums.getExtremumY,
|
|
24
25
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
25
|
-
keyboardFocusHandler: _keyboardFocusHandler.default
|
|
26
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
27
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
26
28
|
};
|
|
@@ -248,6 +248,47 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
248
248
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
249
249
|
*/
|
|
250
250
|
height: _propTypes.default.number,
|
|
251
|
+
/**
|
|
252
|
+
* List of hidden series and/or items.
|
|
253
|
+
*
|
|
254
|
+
* Different chart types use different keys.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* [
|
|
259
|
+
* {
|
|
260
|
+
* type: 'pie',
|
|
261
|
+
* seriesId: 'series-1',
|
|
262
|
+
* dataIndex: 3,
|
|
263
|
+
* },
|
|
264
|
+
* {
|
|
265
|
+
* type: 'line',
|
|
266
|
+
* seriesId: 'series-2',
|
|
267
|
+
* }
|
|
268
|
+
* ]
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
272
|
+
dataIndex: _propTypes.default.number,
|
|
273
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
274
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
275
|
+
}), _propTypes.default.shape({
|
|
276
|
+
dataIndex: _propTypes.default.number,
|
|
277
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
278
|
+
type: _propTypes.default.oneOf(['line']).isRequired
|
|
279
|
+
}), _propTypes.default.shape({
|
|
280
|
+
dataIndex: _propTypes.default.number,
|
|
281
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
282
|
+
type: _propTypes.default.oneOf(['scatter']).isRequired
|
|
283
|
+
}), _propTypes.default.shape({
|
|
284
|
+
dataIndex: _propTypes.default.number,
|
|
285
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
286
|
+
type: _propTypes.default.oneOf(['pie']).isRequired
|
|
287
|
+
}), _propTypes.default.shape({
|
|
288
|
+
dataIndex: _propTypes.default.number,
|
|
289
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
290
|
+
type: _propTypes.default.oneOf(['radar']).isRequired
|
|
291
|
+
})]).isRequired),
|
|
251
292
|
/**
|
|
252
293
|
* The controlled axis highlight.
|
|
253
294
|
* Identified by the axis id, and data index.
|
|
@@ -293,6 +334,11 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
293
334
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
294
335
|
*/
|
|
295
336
|
onAxisClick: _propTypes.default.func,
|
|
337
|
+
/**
|
|
338
|
+
* Callback fired when any hidden identifiers change.
|
|
339
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
340
|
+
*/
|
|
341
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
296
342
|
/**
|
|
297
343
|
* The callback fired when the highlighted item changes.
|
|
298
344
|
*
|