2013-08-27 21 views
0

可以使用eles.breadthFirstSearch()对其遍历的节点执行操作吗?
从文档:使用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). 

它看起来像回调函数只给出了指数和深度。

如果这不是正确的功能,有没有更好的工作?

谢谢!

回答

0

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

+0

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