Reputation: 64854
Is there a tool that takes as input a series of vertices and edges, and outputs a graph in ASCII/Unicode format?
Thanks, Kevin
Upvotes: 13
Views: 4771
Reputation: 43
Another option: https://www.npmjs.com/package/ascii-seq
input.txt
From -- message -> To .. response -> From
-- line --
Another -- msg -> Dest
Self -- abc -> Self
npx ascii-seq input.txt
or cat input.txt | npx ascii-seq
┌──────┐ ┌────┐┌─────────┐┌──────┐┌──────┐
│ From │ │ To ││ Another ││ Dest ││ Self │
└───┬──┘ └──┬─┘└────┬────┘└───┬──┘└───┬──┘
│ │ │ │ │
├── message ──>│ │ │ │
│ │ │ │ │
│<∙ response ∙∙┤ │ │ │
│ │ │ │ │
│ │ │ │ │
────────────────────── line ───────────────────────
│ │ │ │ │
│ │ │ │ │
│ │ ├─ msg ──>│ │
│ │ │ │ │
│ │ │ │ ├──┐
│ │ │ │ │ abc
│ │ │ │ │<─┘
│ │ │ │ │
│ │ │ │ │
│ │ │ │ │
Upvotes: 0
Reputation: 155
For whoever reading this post in 2022, check out Diagon.
There are both a command line tool diagon
and a website.
you can create multiple ASCII visualization from text such as :
DAG Example :
┌─────┐┌─────────┐┌─────┐
│socks││underwear││shirt│
└┬────┘└┬─┬──────┘└┬─┬──┘
│ │┌▽─────┐ │┌▽───────┐
│ ││pants │ ││tie │
│ │└┬──┬──┘ │└┬───────┘
┌▽──────▽─▽┐┌▽─────▽┐│
│shoes ││belt ││
└──────────┘└┬──────┘│
┌────────────▽───────▽┐
│jacket │
└─────────────────────┘
Also worth looking : https://www.plantuml.com/
Upvotes: 8
Reputation: 1803
yes, Its called unix directories and the 'tree' cmd.
Output example:
db
├── colors
│ ├── green
│ └── nongreen
└── person
└── type
├── alien
│ └── colors -> db/colors
├── female
│ └── colors -> db/colors
└── male
└── colors -> db/colors
Upvotes: -6
Reputation: 10503
In addition to Graph::Easy mentioned by @nibot, there are a couple of other tools around for this:
(Disclaimer: I'm the developer of the latter).
Upvotes: 7
Reputation: 14928
Yes! Perl has Graph::Easy
, as described in this Hacker News comment.
Here's some output from the online demo:
........ +---------+ +-----+
: Bonn : --> | Berlin | ..> | Ulm |
:......: +---------+ +-----+
H
H train
v
+---------+
| Koblenz |
+---------+
Upvotes: 7