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);})
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);})