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

时间:2013-08-27 00:38:25

标签: 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 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).

看起来回调函数只给出了索引和深度。

如果这不是正确的功能,是否有另一种更好的功能?

谢谢!

1 个答案:

答案 0 :(得分:0)

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