Naive Rooted Tree Drawing Algorithm
Of course, the tree data above is just an example. Input tree can be a "pointer" to database, spreadsheet, etc.
This is written in Python and parts of the algorithm are recursive. Hence, expect the performance to be slower and memory-intensive for larger trees.
Note that intersecting branches in a manner like in image below may occur, wherein a sub-rooted tree is sandwiched between two children of another sub-rooted tree.
https://github.com/poypoyan/matematex/blob/main/files/treedrawing.pdf
- Just download the ZIP for this repository, extract to a folder.
- Just run
python example.py
(Windows) orpython3 example.py
(Lunix) in your terminal. - The
example.py
contains information on how to usetdcore.py
.
Found a bug? Suggest a feature? Please post on issues.