ivy.autocollapse module

For drawing big trees. Calculate which clades can be ‘collapsed’ and displayed with a placeholder.

TODO: test and develop this module further

ivy.autocollapse.autocollapse(root, collapsed=None, keep_visible=None, max_visible=1000)[source]

traverse a tree and find nodes that should be collapsed in order to satify max_visible

collapsed is a set object for storing collapsed nodes

keep_visible is a set object of nodes that should not be placed in collapsed

ivy.autocollapse.autocollapse_info(node, collapsed, visible=True, info={})[source]

gather information to determine if a node should be collapsed

collapsed is a set containing nodes that are already collapsed