getStraightPath()
The getStraightPath util returns the SVG path string for a straight edge, along
with the label coordinates.
import { BaseEdge, getStraightPath } from '@xyflow/vue';
const [path, labelX, labelY] = getStraightPath({ sourceX, sourceY, targetX, targetY });Signature
Parameters:[path: string, labelX: number, labelY: number, offsetX: number, offsetY: number]A path string you can use in an SVG, the labelX and labelY position (center of path)
and offsetX, offsetY between source handle and label.
path: the path to use in an SVG<path>element.labelX: thexposition you can use to render a label for this edge.labelY: theyposition you can use to render a label for this edge.offsetX: the absolute difference between the sourcexposition and thexposition of the middle of this path.offsetY: the absolute difference between the sourceyposition and theyposition of the middle of this path.