caesar0301 / treelib

An efficient implementation of tree data structure in python 2/3.
http://treelib.readthedocs.io/en/latest/
Other
800 stars 185 forks source link

Render tree expanding only ancestors of given node #220

Open richtier-shell opened 8 months ago

richtier-shell commented 8 months ago

Hi,

Great library thanks so much it's really helpful :)

I have tree, and I can render the tree via tree.show(...)

But can I do something like tree.subtree(ancestors_of=some_node).show()

So it only shows the nodes that are ancestor of the given node?