Skip to content

Commit

Permalink
Allow optional center
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Jan 19, 2024
1 parent 291fed4 commit 8538a5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 0 additions & 1 deletion packages/victory-tooltip/src/flyout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe("victory-primitives/flyout", () => {
cornerRadius: 5,
pointerLength: 10,
pointerWidth: 10,
// center: { x: 100, y: 100 },
};
describe("rendering", () => {
it("renders a flyout path", () => {
Expand Down
12 changes: 3 additions & 9 deletions packages/victory-tooltip/src/flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
export interface FlyoutProps extends VictoryCommonProps {
active?: boolean;
center?: {
x?: number;
y?: number;
x: number;
y: number;
};
className?: string;
clipPath?: string;
Expand Down Expand Up @@ -147,19 +147,13 @@ export const Flyout: React.FC<FlyoutProps> = (initialProps) => {

// check for required props for this subcomponent
// they should be passed in from the wrapper
// UserProps.assert(props.center, "Flyout props[center] is undefined");
UserProps.assert(props.height, "Flyout props[height] is undefined");
UserProps.assert(props.width, "Flyout props[width] is undefined");
UserProps.assert(props.x, "Flyout props[x] is undefined");
UserProps.assert(props.y, "Flyout props[y] is undefined");

// const { x: centerX, y: centerY } = props.center;

// UserProps.assert(centerX, "Flyout props[center.x] is undefined");
// UserProps.assert(centerY, "Flyout props[center.y] is undefined");

const flyoutPathProps: FlyoutPathProps = {
center: props.center,
center: props.center || { x: 0, y: 0 },
cornerRadius: props.cornerRadius || 0,
dx: props.dx,
dy: props.dy,
Expand Down

0 comments on commit 8538a5d

Please sign in to comment.