.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "GRAPH-EASY 1p" .TH GRAPH-EASY 1p "2022-11-20" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" graph\-easy \- render/convert graphs in/from various formats .SH "SYNOPSIS" .IX Header "SYNOPSIS" Convert between graph formats and layout/render graphs: .PP .Vb 1 \& graph\-easy [options] [inputfile [outputfile]] \& \& echo "[ Bonn ] \- car \-> [ Berlin ]" | graph\-easy \& graph\-easy \-\-input=graph.dot \-\-as_ascii \& graph\-easy \-\-html \-\-output=mygraph.html graph.txt \& graph\-easy graph.txt graph.svg \& graph\-easy graph.txt \-\-as_dot | dot \-Tpng \-o graph.png \& graph\-easy graph.txt \-\-png \& graph\-easy graph.vcg \-\-dot \& graph\-easy graph.dot \-\-gdl \& graph\-easy graph.dot \-\-graphml .Ve .SH "ARGUMENTS" .IX Header "ARGUMENTS" Here are the most important options, more are listed in the full documentation: .IP "\-\-help" 10 .IX Item "--help" Print the full documentation, not just this short overview. .IP "\-\-input" 10 .IX Item "--input" Specify the input file name. Example: .Sp .Vb 1 \& graph\-easy \-\-input=input.txt .Ve .Sp The format will be auto-detected, override it with \-\-from. .IP "\-\-output" 10 .IX Item "--output" Specify the output file name. Example: .Sp .Vb 1 \& graph\-easy \-\-output=output.txt input.txt .Ve .IP "\-\-as" 10 .IX Item "--as" Specify the output format. Example: .Sp .Vb 1 \& graph\-easy \-\-as=ascii input.txt .Ve .Sp Valid formats are: .Sp .Vb 10 \& ascii ASCII art rendering \& boxart Unicode Boxart rendering \& html HTML \& svg Scalable Vector Graphics \& graphviz the DOT language \& dot alias for "graphviz" \& txt Graph::Easy text \& vcg VCG (Visualizing Compiler Graphs \- a subset of GDL) text \& gdl GDL (Graph Description Language) text \& graphml GraphML .Ve .Sp In addition, the following formats are understood and piped through the program specified with the \-\-renderer option (default: dot): .Sp .Vb 11 \& bmp Windows bitmap \& gif GIF \& hpgl HP\-GL/2 vector graphic \& jpg JPEG \& pcl PCL printer language \& pdf PDF \& png PNG \& ps Postscript \& ps2 Postscript with PDF notations (see graphviz documentation) \& tga Targa bitmap \& tif TIFF bitmap .Ve .Sp The default format will be determined by the output filename extension, and is \f(CW\*(C`ascii\*(C'\fR, if the output filename was not set. .Sp You can also use \fB\s-1ONE\s0\fR argument of the form \f(CW\*(C`\-\-as_ascii\*(C'\fR or \f(CW\*(C`\-\-ascii\*(C'\fR. .IP "\-\-from" 10 .IX Item "--from" Specify the input format. Valid formats are: .Sp .Vb 4 \& graphviz the DOT language \& txt Graph::Easy text \& vcg VCG text \& gdl GDL (Graph Description Language) text .Ve .Sp If not specified, the input format is auto-detected. .Sp You can also use \fB\s-1ONE\s0\fR argument of the form \f(CW\*(C`\-\-from_dot\*(C'\fR, etc. .IP "\-\-renderer" 10 .IX Item "--renderer" The external program (default: \*(L"dot\*(R") used to render the output formats like \f(CW\*(C`png\*(C'\fR, \f(CW\*(C`jpg\*(C'\fR etc. Some choices are \*(L"neato\*(R", \*(L"twopi\*(R", \*(L"fdp\*(R" or \*(L"circo\*(R". .IP "\-\-parse" 10 .IX Item "--parse" Input will only be parsed, without any output generation. Useful in combination with \f(CW\*(C`\-\-debug=1\*(C'\fR or \f(CW\*(C`\-\-stats\*(C'\fR. Example: .Sp .Vb 1 \& graph\-easy input.txt \-\-parse \-\-debug=1 .Ve .IP "\-\-stats" 10 .IX Item "--stats" Write various statistics about the input graph to \s-1STDERR.\s0 Best used in combination with \f(CW\*(C`\-\-parse\*(C'\fR: .Sp .Vb 1 \& graph\-easy input.txt \-\-parse \-\-stats .Ve .IP "\-\-timeout" 10 .IX Item "--timeout" Set the timeout \fBin seconds\fR for the Graph::Easy layouter that generates \&\s-1ASCII, HTML, SVG\s0 or boxart output. If the layout does not finish in this time, it will be aborted. Example: .Sp .Vb 1 \& graph\-easy input.txt \-\-timeout=500 .Ve .Sp Conversion to \s-1DOT, VCG/GDL,\s0 GraphML or plain text ignores the timeout. .Sp The default is 240 seconds (4 minutes). .IP "\-\-verbose" 10 .IX Item "--verbose" Write info regarding the conversion process to \s-1STDERR.\s0 .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`graph\-easy\*(C'\fR reads a description of a graph (a connected network of nodes and edges, not a pie chart :\-) and then converts this to the desired output format. .PP By default, the input will be read from \s-1STDIN,\s0 and the output will go to \&\s-1STDOUT.\s0 The input is expected to be encoded in \s-1UTF\-8,\s0 the output will also be \s-1UTF\-8.\s0 .PP It understands the following formats as input: .PP .Vb 4 \& 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/ .Ve .PP The formats are automatically detected, regardless of the input file name, but you can also explicitly declare your input to be in one specific format. .PP The output can be a dump of the graph in one of the following formats: .PP .Vb 5 \& 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/ \& GraphML http://graphml.graphdrawing.org/ .Ve .PP In addition, \f(CW\*(C`Graph::Easy\*(C'\fR can also create layouts of graphs in one of the following output formats: .PP .Vb 1 \& HTML SVG ASCII BOXART .Ve .PP Note that for \s-1SVG\s0 output, you need to install the module Graph::Easy::As_svg first. .PP As a shortcut, you can also specify the output format as 'png', this will cause \f(CW\*(C`graph\-easy\*(C'\fR to pipe the input in graphviz format to the \f(CW\*(C`dot\*(C'\fR program to create a \s-1PNG\s0 file in one step. The following two examples are equivalent: .PP .Vb 2 \& graph\-easy graph.txt \-\-dot | dot \-Tpng \-o graph.png \& graph\-easy graph.txt \-\-png .Ve .PP .IX Xref "svg html ascii boxart png dot graphviz vcg gdl graph description language unicode" .SH "OTHER ARGUMENTS" .IX Header "OTHER ARGUMENTS" \&\f(CW\*(C`graph\-easy\*(C'\fR supports a few more arguments in addition to the ones from above: .IP "\-\-version" 10 .IX Item "--version" Write version info and exit. .IP "\-\-debug=N" 10 .IX Item "--debug=N" Set the debug level (1..3). Warning, this will generate huge amounts of hard to understand output on \s-1STDERR.\s0 Example: .Sp .Vb 1 \& graph\-easy input.txt \-\-output=test.html \-\-debug=1 .Ve .IP "\-\-png, \-\-dot, \-\-vcg, \-\-gdl, \-\-txt, \-\-ascii, \-\-boxart, \-\-html, \-\-svg" 10 .IX Item "--png, --dot, --vcg, --gdl, --txt, --ascii, --boxart, --html, --svg" Given exactly one of these options, produces the desired output format. .SH "EXAMPLES" .IX Header "EXAMPLES" .SS "\s-1ASCII\s0 output" .IX Subsection "ASCII output" .Vb 1 \& echo "[ Bonn ] \-\- car \-\-> [ Berlin ], [ Ulm ]" | graph\-easy \& \& +\-\-\-\-\-\-\-\-+ car +\-\-\-\-\-+ \& | Bonn | \-\-\-\-\-> | Ulm | \& +\-\-\-\-\-\-\-\-+ +\-\-\-\-\-+ \& | \& | car \& v \& +\-\-\-\-\-\-\-\-+ \& | Berlin | \& +\-\-\-\-\-\-\-\-+ .Ve .SS "Graphviz example output" .IX Subsection "Graphviz example output" .Vb 2 \& echo "[ Bonn ] \-\- car \-\-> [ Berlin ], [ Ulm ]" | graph\-easy \-\-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 ] \& \& } .Ve .SS "\s-1VCG\s0 example output" .IX Subsection "VCG example output" .Vb 3 \& echo "[ Bonn ] \-\- car \-\-> [ Berlin ], [ Ulm ]" | graph\-easy \-\-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" } \& \& } .Ve .SS "\s-1GDL\s0 example output" .IX Subsection "GDL example output" \&\s-1GDL\s0 (Graph Description Language) is a superset of \s-1VCG,\s0 and thus the output will look almost the same as \s-1VCG:\s0 .PP .Vb 3 \& echo "[ Bonn ] \-\- car \-\-> [ Berlin ], [ Ulm ]" | graph\-easy \-\-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" } \& \& } .Ve .SS "GraphML example output" .IX Subsection "GraphML example output" GraphML is \s-1XML:\s0 .PP .Vb 6 \& echo "[ Bonn ] \-\- car \-\-> [ Berlin ], [ Ulm ]" | graph\-easy \-\-graphml \& \& \& \& \& \& \& \& \& \& \& \& \& \& \& \& car \& \& \& car \& \& \& .Ve .SH "CAVEATS" .IX Header "CAVEATS" Please note that it is impossible to convert 100% from one format to another format since every graph language out there has features that are unique to only this language. .PP In addition, the conversion process always converts the input first into an Graph::Easy graph, and then to the desired output format. .PP This means that only features and attributes that are actually valid in Graph::Easy are supported yet. Work in making Graph::Easy an universal format supporting as much as possible is still in progress. .PP Attributes that are not yet supported natively by Graph::Easy are converted to custom attributes with a prefixed \f(CW\*(C`x\-format\-\*(C'\fR, f.i. \f(CW\*(C`x\-dot\-\*(C'\fR. Upon output to the same format, these are converted back, but conversion to a different format will lose these attributes. .PP For a list of what problems still remain, please see the \s-1TODO\s0 file in the \f(CW\*(C`Graph::Easy\*(C'\fR distribution on \s-1CPAN:\s0 .PP .PP If you notice anything wrong, or miss attributes, please file a bug report on .PP .PP so we can fix it and include the missing things into Graph::Easy! .PP .IX Xref "bugreport" .SH "LICENSE" .IX Header "LICENSE" This library is free software; you can redistribute it and/or modify it under the terms of the \s-1GPL.\s0 .PP See the \s-1LICENSE\s0 file of Graph::Easy for a copy of the \s-1GPL.\s0 .PP This product includes color specifications and designs developed by Cynthia Brewer (). See the \s-1LICENSE\s0 file for the full license text that applies to these color schemes. .IX Xref "gpl apache-style cynthia brewer colorscheme license" .SH "AUTHOR" .IX Header "AUTHOR" Copyright (C) 2004 \- 2008 by Tels .SH "SEE ALSO" .IX Header "SEE ALSO" More information can be found in the online manual of Graph::Easy: .PP .PP See also: Graph::Easy, Graph::Easy::Manual