This project is a Python-based tool for generating tree diagrams from structured JSON data. It uses NetworkX and Matplotlib for creating and visualising the tree structures, making it suitable for analysing and presenting hierarchical data.
- Generate tree diagrams from JSON data.
- Customisable layout and presentation.
- Support for visualising complex hierarchical structures.
- Python 3.x
- pip (Python package installer)
Install the required Python packages:
The requirements.txt
file includes the following packages:
- networkx
- matplotlib
For advanced graph layouts with pygraphviz
, install Graphviz:
- Windows: Download and install from Graphviz's website.
- Installation via
conda
is highly recommended on Windows!
- Installation via
- MacOS: Use Homebrew with
brew install graphviz
. - Linux (Ubuntu/Debian): Use
sudo apt install graphviz
.
To generate a tree diagram:
- Prepare your JSON data representing the hierarchical structure.
- Run the script with the JSON data.
- The script will generate and display the tree diagram.
{
"key": "NodeKey",
"children": {
"Child1Key": {
"key": "Child1Key",
"children": { ... },
"otherProperty": "value"
},
"Child2Key": {
"key": "Child2Key",
"children": { ... },
"otherProperty": "value"
}
},
"otherProperty": "value"
}
Single Branch (properties off)
Multiple Branch (properties on)
You can customise the tree diagram by modifying the script. The script allows for adjustments in the layout, node properties, and more.
Contributions to this project are welcome! Feel free to fork the repository and submit pull requests.
This project is open source and available under the MIT License.