|
|
|
|
|
|
|
|
import type { ConnectionLineComponentProps } from 'reactflow' |
|
|
import type { ConnectionLineComponentProps } from 'reactflow' |
|
|
import { |
|
|
import { |
|
|
Position, |
|
|
Position, |
|
|
getSimpleBezierPath, |
|
|
|
|
|
|
|
|
getBezierPath, |
|
|
} from 'reactflow' |
|
|
} from 'reactflow' |
|
|
|
|
|
|
|
|
const CustomConnectionLine = ({ fromX, fromY, toX, toY }: ConnectionLineComponentProps) => { |
|
|
const CustomConnectionLine = ({ fromX, fromY, toX, toY }: ConnectionLineComponentProps) => { |
|
|
const [ |
|
|
const [ |
|
|
edgePath, |
|
|
edgePath, |
|
|
] = getSimpleBezierPath({ |
|
|
|
|
|
|
|
|
] = getBezierPath({ |
|
|
sourceX: fromX, |
|
|
sourceX: fromX, |
|
|
sourceY: fromY, |
|
|
sourceY: fromY, |
|
|
sourcePosition: Position.Right, |
|
|
sourcePosition: Position.Right, |
|
|
targetX: toX, |
|
|
targetX: toX, |
|
|
targetY: toY, |
|
|
targetY: toY, |
|
|
targetPosition: Position.Left, |
|
|
targetPosition: Position.Left, |
|
|
|
|
|
curvature: 0.16, |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |