Cytoscape.js 使用eles.breadthFirstSearch()在其遍历的节点上执行操作

Cytoscape.js 使用eles.breadthFirstSearch()在其遍历的节点上执行操作,cytoscape.js,Cytoscape.js,eles.breadthFirstSearch()是否可以用于在它所经过的节点上执行操作? 从文件中: eles.breadthFirstSearch( [function(i, depth)] [, directed] ) function(i, depth) A handler function that is called when a node is visited in the search. – i The index indicating this node is the ith

eles.breadthFirstSearch()是否可以用于在它所经过的节点上执行操作?
从文件中:

eles.breadthFirstSearch( [function(i, depth)] [, directed] )
function(i, depth) A handler function that is called when a node is visited in the search.
– i The index indicating this node is the ith visited node.
– depth How many edge hops away this node is from the root nodes.
directed A boolean indicating whether the search should only go along edges from source to target (default true).
看起来回调函数只提供了索引和深度

如果这不是正确的功能,是否还有其他更好的功能


谢谢

环境变量“this”包含当前节点

对于所有遍历函数都是一样的,就像jQuery一样