You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I access the depth of the currently traversed (e.g. during the depth-first walk) element in constant time? Right now, the only way of getting the depth that I see (besides storing it with the node) is by calling getPath:
You're right, that's the only way as of now and it's not constant time as you noted. I'll leave this open because it seems a nice improvement for a future version.
Wow, if it weren't for this issue I wouldn't have even know that getting depth was possible using this library, or that you even get something with a "getPath" method on it. The documentation here is painfully inadequate.
Can I access the depth of the currently traversed (e.g. during the depth-first walk) element in constant time? Right now, the only way of getting the depth that I see (besides storing it with the node) is by calling
getPath
:root.walk(el => {console.log(el.model.id, el.getPath().length);})
The text was updated successfully, but these errors were encountered: