Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ export const ChartScatter: React.FunctionComponent<ChartScatterProps> = ({

// destructure last
theme = getTheme(themeColor),
size = ({ active }) => (active ? ChartScatterStyles.activeSize : ChartScatterStyles.size),
...rest
}: ChartScatterProps) => {
// Clone so users can override container props
Expand All @@ -455,8 +454,14 @@ export const ChartScatter: React.FunctionComponent<ChartScatterProps> = ({
...containerComponent.props
});

// bubbleProperty is only considered if the size prop is undefined, therefore set
// default size function only if bubbleProperty is not set.
if (typeof rest.size === "undefined" && typeof rest.bubbleProperty === "undefined") {
rest.size = ({ active }) => (active ? ChartScatterStyles.activeSize : ChartScatterStyles.size);
}

// Note: containerComponent is required for theme
return <VictoryScatter containerComponent={container} size={size} theme={theme} {...rest} />;
return <VictoryScatter containerComponent={container} theme={theme} {...rest} />;
};
ChartScatter.displayName = 'ChartScatter';

Expand Down