Edge Operations

addEdges

$flow.addEdges(edges: FlowEdge | FlowEdge[], options?: { source?: ChangeOrigin }): void

Add one or more edges to the canvas. Merges defaultEdgeOptions from config onto new edges (edge-specific properties override defaults). options.source sets the origin on the emitted edges-change event (ChangeOrigin, default 'api').

removeEdges

$flow.removeEdges(ids: string | string[], options?: { source?: ChangeOrigin }): void

Remove one or more edges by ID. options.source stamps the edges-change origin (default 'api').

getEdge

$flow.getEdge(id: string): FlowEdge | undefined

Look up an edge by ID. Returns the reactive edge object or undefined.

getEdgePathElement

$flow.getEdgePathElement(id: string): SVGPathElement | null

Get the visible SVG <path> element for an edge. The visible path is the second <path> child (the first is the invisible interaction hit area).

getEdgeElement

$flow.getEdgeElement(id: string): SVGElement | HTMLElement | null

Get the container element (SVG group) for an edge.

getEdgeSvgElement

$flow.getEdgeSvgElement(): SVGSVGElement | null

Get the root SVG element that contains all edges. Useful for whiteboard tools and custom annotation layers.