Refactor: Better routing for smoothstep and step edge (#2407)

* refactor(step/smoothstep-edge): better default routing
* chore(edges): pass options
* chore(exports): add BaseEdge
This commit is contained in:
Moritz Klack
2022-09-07 17:40:18 +02:00
committed by GitHub
parent 5c16415e19
commit 7a96817114
15 changed files with 344 additions and 123 deletions
@@ -1,5 +1,5 @@
import { memo } from 'react';
import { EdgeProps, Position } from '../../types';
import { BezierEdgeProps, Position } from '../../types';
import BaseEdge from './BaseEdge';
export interface GetBezierPathParams {
@@ -143,8 +143,8 @@ const BezierEdge = memo(
style,
markerEnd,
markerStart,
curvature,
}: EdgeProps) => {
options,
}: BezierEdgeProps) => {
const params = {
sourceX,
sourceY,
@@ -152,7 +152,7 @@ const BezierEdge = memo(
targetX,
targetY,
targetPosition,
curvature,
curvature: options?.curvature,
};
const path = getBezierPath(params);
const [centerX, centerY] = getBezierCenter(params);