Skip to Content
参考实用程序

getIncomers()

GitHub上的源代码 

此工具用于告诉你哪些节点(如果有的话)作为边的 source 与给定节点相连。

🌐 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/react'; const nodes = []; const edges = []; const incomers = getIncomers( { id: '1', position: { x: 0, y: 0 }, data: { label: 'node' } }, nodes, edges, );

签名

🌐 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 target is the given node.

Last updated on