getIncomers()
This util is used to tell you what nodes, if any, are connected to the given node as the source of an edge.
import { getIncomers } from '@xyflow/svelte';
 
let nodes = $state.raw([]);
let edges = $state.raw([]);
 
const incomers = getIncomers(
  { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } },
  nodes.value,
  edges.value,
);Signature
Parameters:| Name | Type | Default | 
|---|---|---|
node | NodeType | { id: string; }The node to get the connected nodes from.  | |
nodes | NodeType[]The array of all nodes.  | |
edges | EdgeType[]The array of all edges.  | 
Last updated on