Java code to visualize trees (Binary + B Tree)
The CompactTreeViz takes a tree-description and draws the tree in a png file. The tree-description is an ArrayList and leverages the format propose by Jim Blackler.
run Main.java
from package src.tree_viz
. This is an eclipse project. After running Main.java
, png files are created in the project root directory.
- Explain how to support other trees, i.e., treeDescription
- Resize the node (width and height) dynamically based on its content.
While TreeViz is a one man job, I borrowed somethings from others and I want to make this clear.
- I use the tree format propose by Jim Blackler. This allows TreeViz to support any tree structure and not just binary trees.
- Since this tool is about visualization only, I borrowed the BST and the BTree implementations from mvyas85 and phishman3579, respectively.
I hope other people contribute to the TreeViz and improve it. Thus, pull requests are welcomed.
- First code commit on 16 April 2021
- I developed TreeViz while TAing CMSC420 with Jason Filippou. CMSC420 is an advanced data-structures class with a lot of projects about various trees (BST, AVL, BTree, QuadTree). TreeViz is not part of the course requirements; I developed TreeViz to help me debug my implementation. TreeViz helped me visualize my trees after every insertion/deletion, i.e., find bugs faster.