-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
33 lines (28 loc) · 1.33 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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.