Dot Layout Node Tree Without Graphviz


Question: How can I generate a dot layout node tree from a list that looks like this: [Node, Node, Node]

Each one of those nodes has an attribute called children which are lists that have more nodes in them. It keep going until you reach a node with no children (a leaf node).

Using matplotlib and networkx, without using any already made layouts (make the coordinates yourself with a function) I need a dot layout node tree.

class Node:
    def init(self):
        self.children = []

It should look something like this:

1 Like