The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

graph-easy - render/convert graphs in/from various formats

SYNOPSIS

Convert between graph formats and layout/render graphs:

        graph-easy [options] [inputfile [outputfile]]

        echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy
        graph-easy --input=graph.dot --as_ascii
        graph-easy --html --output=graph.html graph.txt
        graph-easy graph.txt graph.svg
        graph-easy graph.txt --as_dot | dot -Tpng -o graph.png
        graph-easy graph.txt --as_png
        graph-easy graph.vcg --as_dot
        graph-easy graph.dot --gdl

ARGUMENTS

--help

Print the full documentation, not just a short overview.

--input

Specify the input file name. Example:

        graph-easy --input=input.txt

The format of the input will be detected automatically, but you can override this detection with --from.

--output

Specify the output file name. Example:

        graph-easy --output=output.txt input.txt
--as

Specify the output format. Example:

        graph-easy --as=ascii input.txt

Valid formats are:

        ascii
        boxart
        html
        svg
        graphviz        the DOT language
        dot             an alias for "graphviz"
        txt             Graph::Easy text
        vcg             VCG (a subset of GDL) text
        gdl             GDL (Graph Description Language) text
        png             a PNG file rendered via "dot"

If unspecified, the default format will be determined by the output filename extension, and is ascii, if the output filename was not set.

Note that you can also use ONE argument of the form --as_ascii, --as_svg and so on.

--from

Specify the input format. Valid formats are:

        graphviz        the DOT language
        txt             Graph::Easy text
        vcg             VCG text
        gdl             GDL (Graph Description Language) text

If not specified, the input format is auto-detected.

Note that you can also use ONE argument of the form --from_graphviz or --from_txt instead of --from.

--verbose

Write info regarding the conversion process to STDERR.

--debug=N

Write debugging info to STDERR. Warning, this can create huge amounts of hard-to-understand output!

Example:

        graph-easy input.txt --output=test.html --debug=1
--parse

Input will only be parsed, without any output generation. This is usefull in combination with --debug=1.

Example:

        graph-easy input.txt --parse --debug=1
--timeout

Set the timeout in seconds for the layouter. If the layout does not finish in this time, it will be aborted.

Example:

        graph-easy input.txt --timeout=500

This option is mainly intended for things that are routed through the layouter of Graph::Easy, because this layouter can sometimes get stuck and use a lot of time. Simple conversions between the different graph text formats are still subject to the set timeout, but this conversion usually finishes in way under one second.

DESCRIPTION

graph-easy reads a description of a graph (a connected network of nodes and edges, not a pie chart :-) and then convert this to the desired output format.

By default, the input will be read from STDIN, and the output will go to STDOUT. The input is expected to be encoded in UTF-8, the output will also be UTF-8.

It understands the following formats as input:

        Graph::Easy     http://bloodgate.com/perl/graph/manual/
        DOT             http://www.graphviz.org/
        VCG             http://rw4.cs.uni-sb.de/~sander/html/gsvcg1.html
        GDL             http://www.aisee.com/

The formats are automatically detected, regardless of the input file name, but you can also explicitely declare your input to be in one specific format.

The output can either be a dump of the graph in one of the input formats (Graph::Easy, Graphviz, VCG/GDL), or a layout (rendering) of the graph in one of the following output formats implemented by Graph::Easy:

        HTML    SVG     ASCII   BOXART

As a shortcut, you can also specify the output format as 'png', this will cause graph-easy to pipe the input in graphviz format to the dot program to create a PNG file in one step. The following two examples are equivalent:

        graph-easy graph.txt --as_dot | dot -Tpng -o graph.png
        graph-easy graph.txt --as_png

EXAMPLES

ASCII output

        echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --as=ascii

        +--------+  car   +-----+
        |  Bonn  | -----> | Ulm |
        +--------+        +-----+
          |
          | car
          v
        +--------+
        | Berlin |
        +--------+

Graphviz example output

        echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --as=dot
        digraph GRAPH_0 {
        
          edge [ arrowhead=open ];
          graph [ rankdir=LR ];
          node [
            fontsize=11,
            fillcolor=white,
            style=filled,
            shape=box ];
        
          Bonn -> Ulm [ label=car ]
          Bonn -> Berlin [ label=car ]
        
        }

VCG example output:

        echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --as=vcg
        graph: {
          title: "Untitled graph"
        
          node: { title: "Berlin" }
          node: { title: "Bonn" }
          node: { title: "Ulm" }
        
          edge:  { label: "car" sourcename: "Bonn" targetname: "Ulm" }
          edge:  { label: "car" sourcename: "Bonn" targetname: "Berlin" }
        
        }

GDL example output:

GDL (Graph Description Language) is a superset of VCG, and thus the output will look almost the same as VCG:

        echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --as=gdl
        graph: {
          title: "Untitled graph"
        
          node: { title: "Berlin" }
          node: { title: "Bonn" }
          node: { title: "Ulm" }
        
          edge:  { label: "car" source: "Bonn" target: "Ulm" }
          edge:  { label: "car" source: "Bonn" target: "Berlin" }

        }       

LICENSE

This library is free software; you can redistribute it and/or modify it under the terms of the GPL.

See the LICENSE file of Graph::Easy for a copy of the GPL.

This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). See the LICENSE file for the full license text that applies to these color schemes.

AUTHOR

Copyright (C) 2004 - 2007 by Tels http://bloodgate.com

SEE ALSO

More information can be found in the online manual of Graph::Easy:

http://bloodgate.com/perl/graph/manual/

See also: Graph::Easy, Graph::Easy::Manual