Skip to content

Commit

Permalink
Remove test formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Nov 12, 2024
1 parent 7421bde commit de4435a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
9 changes: 6 additions & 3 deletions packages/victory-core/src/victory-util/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ export function getEvents(
const selectedEvents = getSelectedEvents();
return (
Array.isArray(selectedEvents) &&
selectedEvents.reduce((memo, event) => {
return event ? Object.assign(memo, event.eventHandlers) : memo;
}, {} as ComponentEvent["eventHandlers"])
selectedEvents.reduce(
(memo, event) => {
return event ? Object.assign(memo, event.eventHandlers) : memo;
},
{} as ComponentEvent["eventHandlers"],
)
);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/victory-pie/src/helper-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const getSlices = (props, data) => {
const getCategoriesFromProps = (props: VictoryPieProps) =>
Array.isArray(props.categories)
? props.categories
: (props?.categories as { x: string[] })?.x ?? [];
: ((props?.categories as { x: string[] })?.x ?? []);

/**
* Sorts data by props.categories or props.categories.x. If all of the data keys aren't
Expand Down
12 changes: 6 additions & 6 deletions packages/victory-stack/src/helper-methods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,20 @@ function addLayoutData(props, datasets, index) {
_y0: !(datum._y instanceof Date)
? yOffset
: yOffset
? new Date(yOffset)
: datum._y,
? new Date(yOffset)
: datum._y,
_y1:
datum._y === null
? null
: datum._y instanceof Date
? new Date(Number(datum._y) + Number(yOffset))
: datum._y + yOffset,
? new Date(Number(datum._y) + Number(yOffset))
: datum._y + yOffset,
_x1:
datum._x === null
? null
: datum._x instanceof Date
? new Date(Number(datum._x) + Number(xOffset))
: datum._x + xOffset,
? new Date(Number(datum._x) + Number(xOffset))
: datum._x + xOffset,
});
});
}
Expand Down
8 changes: 4 additions & 4 deletions packages/victory-tooltip/src/flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const getVerticalPath = (props: FlyoutPathProps) => {
const arc = `${cornerRadius} ${cornerRadius} ${direction}`;
return `M ${centerX - pointerWidth / 2}, ${pointerEdge}
L ${pointerLength ? x : centerX + pointerWidth / 2}, ${
pointerLength ? y : pointerEdge
}
pointerLength ? y : pointerEdge
}
L ${centerX + pointerWidth / 2}, ${pointerEdge}
L ${rightEdge - cornerRadius}, ${pointerEdge}
A ${arc} ${rightEdge}, ${pointerEdge - sign * cornerRadius}
Expand Down Expand Up @@ -104,8 +104,8 @@ const getHorizontalPath = (props: FlyoutPathProps) => {
const arc = `${cornerRadius} ${cornerRadius} ${direction}`;
return `M ${pointerEdge}, ${centerY - pointerWidth / 2}
L ${pointerLength ? x : pointerEdge}, ${
pointerLength ? y : centerY + pointerWidth / 2
}
pointerLength ? y : centerY + pointerWidth / 2
}
L ${pointerEdge}, ${centerY + pointerWidth / 2}
L ${pointerEdge}, ${bottomEdge - cornerRadius}
A ${arc} ${pointerEdge + sign * cornerRadius}, ${bottomEdge}
Expand Down

0 comments on commit de4435a

Please sign in to comment.