Hi all,
I wanted to share PHART (Python Hierarchical ASCII Rendering Tool), a new visualization tool built on NetworkX that renders graphs in ASCII/Unicode text. It was initially created for my own need, but the current structure and development process was guided by discussions in the NetworkX community about text-based graph visualization needs, and the perhaps "separate, necessary evil" space that visualization code in general may reside wrt NX.
Key features:
- Pure Python implementation (NetworkX is the only dependency)
- Multiple node decorator styles (square, round, diamond)
- Support for directed and undirected graphs
- Handles cycles and complex layouts
- CLI tool included
Quick example of output for the simple graph:
G = nx.DiGraph()
G.add_edges_from([("A", "B"), ("A", "C"), ("B", "D")])
...
[A]
│
v │ v
[B]────[C]
│
│
v
──[D]
More complex examples, including visualization of the World Chess Championship graph from NetworkX's gallery, can be found in the documentation (the README on github has a large example section.)