Graphviz and ascii output

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?


Solution 1:

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

Solution 2:

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