Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get a nodeID from level data #182

Open
Veek opened this issue Jun 12, 2021 · 0 comments
Open

Unable to get a nodeID from level data #182

Veek opened this issue Jun 12, 2021 · 0 comments

Comments

@Veek
Copy link

Veek commented Jun 12, 2021

[t.add_node(T.Node(identifier=r(), data=1), parent=t.all_nodes()[-1]) for i in range(1,10)]

>  t.show()
> 0
> └── 100
>     ├── 4
>     └── 20
>         ├── 28
>         ├── 77
>         ├── 80
>         ├── 83
>         ├── 84
>         ├── 87
>         │   └── 17
>         └── 98
> 
> max([(t.size(i), i) for i in range(0, t.depth())])
> (7, 3)

So 7 siblings at level 3 BUT how do I now get the nodeID '20' (I need to move 20 and siblings to a new subtree)

(The problem is I have a huge class hierarchy in Libreoffice-API and creating a classic DOT code file will result in endless scrolling in Graphviz. Therefore I need to extract the subtrees with large elements and treat them differently to save space)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant