Skip to Content
You are viewing the v1 docs of Svelte Flow. You can find the latest version here.
ReferenceUtils

getConnectedEdges()

Source on GitHub 

Given an array of nodes that may be connected to one another and an array of all your edges, this util gives you an array of edges that connect any of the given nodes together.

import { getConnectedEdges } from '@xyflow/svelte'; let nodes = $state.raw([]); let edges = $state.raw([]); const connectedEdges = getConnectedEdges(nodes.value, edges.value);

Signature

Parameters:
NameTypeDefault
nodesNodeType[]

Nodes you want to get the connected edges for.

edgesEdgeType[]

All edges.

Returns:
EdgeType[]

Array of edges that connect any of the given nodes with each other.

Last updated on