Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphviz and ascii output

Tags:

ascii

graphviz

Is it possible to draw ASCII diagram using Graphviz?

Something like that:

digraph {   this -> is   this -> a   a -> test } 

Gives undesired result.

Instead, I would like to get similar ASCII representation:

   this   /    \ is      a         |        test 

How to draw ascii diagrams from dot-files format?

like image 237
user360872 Avatar asked Jul 09 '10 10:07

user360872


2 Answers

If you are not perl averse, graph-easy (and the associated Graph::Easy package) can do exactly that:

http://search.cpan.org/~tels/Graph-Easy/

http://search.cpan.org/~tels/Graph-Easy/bin/graph-easy

On Mac you can install this with Homebrew and cpan:

brew install cpanminus cpan Graph::Easy 

It's easy to invoke after installation:

cat dotfile.dot   | /opt/local/libexec/perl5.12/sitebin/graph-easy 
like image 121
spenthil Avatar answered Sep 22 '22 21:09

spenthil


Here is equivalent commands for linux:

First install cpanminus

sudo apt install cpanminus 

After you can install GraphEasy

sudo cpanm Graph::Easy 

Here is a sample usage

cat input.dot | graph-easy --from=dot --as_ascii 
like image 21
Cpp Forever Avatar answered Sep 22 '22 21:09

Cpp Forever