David-Desmaisons / Vue.D3.tree

Vue component to display tree based on D3.js layout.
https://david-desmaisons.github.io/Vue.D3.tree/tree
MIT License
874 stars 136 forks source link

Collapse tree after the second level #35

Closed jpettina closed 5 years ago

jpettina commented 5 years ago

Hello! I need to show the collapsed tree from the second level onwards. I found this function of d3 in an example that does what I need:

root.children.forEach (collapse);

(Link: https://bl.ocks.org/d3noob/43a860bc0024792f8803bba8ca0d5ecd) Is there a particular function in vued3tree to be able to show the tree the way I need it? Thank you!

David-Desmaisons commented 5 years ago

Use collapseAll method as documented in the readme.