Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.