getBezierPath()
The getBezierPath util returns the SVG path string for a bezier edge, along with
the label coordinates and the edge’s center. Use it inside a
custom edge to draw the path.
import { BaseEdge, getBezierPath } from '@xyflow/vue';
const [path, labelX, labelY] = getBezierPath({
sourceX, sourceY, sourcePosition,
targetX, targetY, targetPosition,
});Signature
Parameters:| Name | Type | Default |
|---|---|---|
sourceX | numberThe | |
sourceY | numberThe | |
sourcePosition | PositionThe position of the source handle. | Position.Bottom |
targetX | numberThe | |
targetY | numberThe | |
targetPosition | PositionThe position of the target handle. | Position.Top |
curvature | numberThe curvature of the bezier edge. | 0.25 |
[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.