Skip to content

Commit 0165ff9

Browse files
committed
added solution for disappearing bars inside zoom container
1 parent 3f41ff5 commit 0165ff9

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

packages/victory-bar/src/helper-methods.ts

+8
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ const getCalculatedValues = (props) => {
6161
let data = Data.getData(props);
6262
data = Data.formatDataFromDomain(data, domain, 0);
6363

64+
if (props.groupComponent.type.displayName === 'VictoryClipContainer') {
65+
data = data.map((datum) => {
66+
datum._x = datum.x;
67+
datum._y = datum.y;
68+
return datum;
69+
});
70+
}
71+
6472
return { style, data, scale, domain, origin };
6573
};
6674

packages/victory-bar/src/victory-bar.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export type VictoryBarAlignmentType = "start" | "middle" | "end";
3838

3939
export interface VictoryBarProps
4040
extends VictoryCommonProps,
41-
VictoryDatableProps,
42-
VictoryMultiLabelableProps {
41+
VictoryDatableProps,
42+
VictoryMultiLabelableProps {
4343
alignment?: VictoryBarAlignmentType;
4444
barRatio?: number;
4545
barWidth?: NumberOrCallback;
@@ -141,7 +141,12 @@ class VictoryBarBase extends React.Component<VictoryBarProps> {
141141
return this.animateComponent(props, animationWhitelist);
142142
}
143143

144-
const children = this.renderData(props);
144+
let children;
145+
if (props.groupComponent.type.displayName === 'VictoryClipContainer') {
146+
children = this.renderData(props, () => true);
147+
} else {
148+
children = this.renderData(props);
149+
}
145150

146151
const component = props.standalone
147152
? this.renderContainer(props.containerComponent, children)

0 commit comments

Comments
 (0)