Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binokkio/graphtxt
Basic plain text visualization of directed graphs.
https://github.com/binokkio/graphtxt
Last synced: 5 days ago
JSON representation
Basic plain text visualization of directed graphs.
- Host: GitHub
- URL: https://github.com/binokkio/graphtxt
- Owner: binokkio
- Created: 2022-08-14T20:50:34.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-28T10:23:37.000Z (about 2 years ago)
- Last Synced: 2024-10-11T07:13:34.366Z (27 days ago)
- Language: Java
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
README
This is a pathfinder codebase written specifically to render plain text visualizations of flows in Gingester.
Example code:
new GraphTxt(List.of(
SimpleNode.of("AAAAA", "BBBB", "C", "F"),
SimpleNode.of("BBBB", "F"),
SimpleNode.of("C"),
SimpleNode.of("D", "BBBB", "E", "ZZZ", "H"),
SimpleNode.of("E"),
SimpleNode.of("F"),
SimpleNode.of("ZZZ"),
SimpleNode.of("H", "IIII"),
SimpleNode.of("IIII")
)).getText()Will produce:
┌───────┐ ┌───┐
│ AAAAA │ │ D │
└───┬───┘ └─┬─┘
┌───┬───┴───┐ │
│ │ ├──────┬──┴───┬──────┐
│ ┌─┴─┐ ┌───┴──┐ ┌─┴─┐ ┌──┴──┐ ┌─┴─┐
│ │ C │ │ BBBB │ │ E │ │ ZZZ │ │ H │
│ └───┘ └───┬──┘ └───┘ └─────┘ └─┬─┘
│ │ ┌┘
└───────────┤ │
┌─┴─┐ ┌───┴──┐
│ F │ │ IIII │
└───┘ └──────┘The layout algorithm keeps the nodes within the horizontal space used by the widest row.