From de4435af7f80784512741473b3c3582917096ba0 Mon Sep 17 00:00:00 2001 From: Charlie Brown Date: Mon, 11 Nov 2024 19:53:20 -0600 Subject: [PATCH] Remove test formatting code --- packages/victory-core/src/victory-util/events.ts | 9 ++++++--- packages/victory-pie/src/helper-methods.ts | 2 +- packages/victory-stack/src/helper-methods.tsx | 12 ++++++------ packages/victory-tooltip/src/flyout.tsx | 8 ++++---- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/victory-core/src/victory-util/events.ts b/packages/victory-core/src/victory-util/events.ts index 0923547e6..4c0ab4717 100644 --- a/packages/victory-core/src/victory-util/events.ts +++ b/packages/victory-core/src/victory-util/events.ts @@ -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"], + ) ); }; diff --git a/packages/victory-pie/src/helper-methods.ts b/packages/victory-pie/src/helper-methods.ts index 09c12f49c..4cc2beac6 100644 --- a/packages/victory-pie/src/helper-methods.ts +++ b/packages/victory-pie/src/helper-methods.ts @@ -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 diff --git a/packages/victory-stack/src/helper-methods.tsx b/packages/victory-stack/src/helper-methods.tsx index d72990a0e..2e4f19c29 100644 --- a/packages/victory-stack/src/helper-methods.tsx +++ b/packages/victory-stack/src/helper-methods.tsx @@ -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, }); }); } diff --git a/packages/victory-tooltip/src/flyout.tsx b/packages/victory-tooltip/src/flyout.tsx index 51daff5fb..cd0c1f046 100644 --- a/packages/victory-tooltip/src/flyout.tsx +++ b/packages/victory-tooltip/src/flyout.tsx @@ -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} @@ -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}