getPolylinePath()
The function getPolylinePath
returns everything you need to render a polyline edge between two nodes.
export function CustomEdge(props: EdgeProps) {
const [edgePath] = getPolylinePath({
sourceX: props.sourceX,
sourceY: props.sourceY,
targetX: props.targetX,
targetY: props.targetY,
bends: props.data?.yData?.bends ?? []
})
return ( <BaseEdge path={edgePath} {...props} /> )
}
Parameters
Name | Description | Type |
---|---|---|
params | The coordinates of the source point, the target point, and the bends. | PolylinePathProps |
Returns
Type | Description |
---|---|
[ | Returns an array that contains the edge path, the center location of the edge, e.g. to place a label, and the relative center location of the edge. |