tree-model-js icon indicating copy to clipboard operation
tree-model-js copied to clipboard

Stop walking on a specific node children

Open yehiasalam opened this issue 11 years ago • 1 comments

Hello,

Is there a way while walking/traversing to stop going further on this specific nodeand move on to the next sibling and mainly the rest of the traversal. I can see the walk method have the option to return false to stop the traversal all together, but what if i just want to keep going but stop traversing this specific node any further?

Thanks, love the library, using it extensively here http://codepen.io/yehiasalam/pen/LVPadv

yehiasalam avatar Apr 20 '15 23:04 yehiasalam

Hi,

Unfortunately no, I've been wanting to add this feature for quite some time but I'm not sure how to do it in the post-order traversal so I've postponed it. Returning false from walk was an API mistake. I should have used a control object with functions to control traversal. Will think about it further but don't expect a quick fix for now. I'm leaving this issue open to remind me I should solve this.

Nice simulation you got there btw!

joaonuno avatar Apr 21 '15 08:04 joaonuno