Skip to Content
Svelte Flow 2 is out! Read the announcement →
ReferenceUtils

getOutgoers()

Source on GitHub 

This util is used to tell you what nodes, if any, are connected to the given node as the target of an edge.

import { getOutgoers } from '@xyflow/svelte'; let nodes = $state.raw([]); let edges = $state.raw([]); const incomers = getOutgoers( { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, nodes.value, edges.value, );

Signature

Parameters:
NameTypeDefault
nodeNodeType | { id: string; }

The node to get the connected nodes from.

nodesNodeType[]

The array of all nodes.

edgesEdgeType[]

The array of all edges.

Returns:
NodeType[]

An array of nodes that are connected over edges where the source is the given node.