1GRAPH-EASY(1)         User Contributed Perl Documentation        GRAPH-EASY(1)
2
3
4

NAME

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

SYNOPSIS

9       Convert between graph formats and layout/render graphs:
10
11               graph-easy [options] [inputfile [outputfile]]
12
13               echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy
14               graph-easy --input=graph.dot --as_ascii
15               graph-easy --html --output=mygraph.html graph.txt
16               graph-easy graph.txt graph.svg
17               graph-easy graph.txt --as_dot | dot -Tpng -o graph.png
18               graph-easy graph.txt --png
19               graph-easy graph.vcg --dot
20               graph-easy graph.dot --gdl
21               graph-easy graph.dot --graphml
22

ARGUMENTS

24       Here are the most important options, more are listed in the full
25       documentation:
26
27       --help    Print the full documentation, not just this short overview.
28
29       --input   Specify the input file name. Example:
30
31                     graph-easy --input=input.txt
32
33                 The format will be auto-detected, override it with --from.
34
35       --output  Specify the output file name. Example:
36
37                     graph-easy --output=output.txt input.txt
38
39       --as      Specify the output format. Example:
40
41                     graph-easy --as=ascii input.txt
42
43                 Valid formats are:
44
45                     ascii       ASCII art rendering
46                     boxart      Unicode Boxart rendering
47                     html        HTML
48                     svg         Scalable Vector Graphics
49                     graphviz    the DOT language
50                     dot         alias for "graphviz"
51                     txt         Graph::Easy text
52                     vcg         VCG (Visualizing Compiler Graphs - a subset of GDL) text
53                     gdl         GDL (Graph Description Language) text
54                     graphml     GraphML
55
56                 In addition, the following formats are understood and piped
57                 through the program specified with the --renderer option
58                 (default: dot):
59
60                     bmp         Windows bitmap
61                     gif         GIF
62                     hpgl        HP-GL/2 vector graphic
63                     jpg         JPEG
64                     pcl         PCL printer language
65                     pdf         PDF
66                     png         PNG
67                     ps          Postscript
68                     ps2         Postscript with PDF notations (see graphviz documentation)
69                     tga         Targa bitmap
70                     tif         TIFF bitmap
71
72                 The default format will be determined by the output filename
73                 extension, and is "ascii", if the output filename was not
74                 set.
75
76                 You can also use ONE argument of the form "--as_ascii" or
77                 "--ascii".
78
79       --from    Specify the input format. Valid formats are:
80
81                     graphviz    the DOT language
82                     txt         Graph::Easy text
83                     vcg         VCG text
84                     gdl         GDL (Graph Description Language) text
85
86                 If not specified, the input format is auto-detected.
87
88                 You can also use ONE argument of the form "--from_dot", etc.
89
90       --renderer
91                 The external program (default: "dot") used to render the
92                 output formats like "png", "jpg" etc. Some choices are
93                 "neato", "twopi", "fdp" or "circo".
94
95       --parse   Input will only be parsed, without any output generation.
96                 Useful in combination with "--debug=1" or "--stats". Example:
97
98                     graph-easy input.txt --parse --debug=1
99
100       --stats   Write various statistics about the input graph to STDERR.
101                 Best used in combination with "--parse":
102
103                     graph-easy input.txt --parse --stats
104
105       --timeout Set the timeout in seconds for the Graph::Easy layouter that
106                 generates ASCII, HTML, SVG or boxart output. If the layout
107                 does not finish in this time, it will be aborted. Example:
108
109                     graph-easy input.txt --timeout=500
110
111                 Conversion to DOT, VCG/GDL, GraphML or plain text ignores the
112                 timeout.
113
114                 The default is 240 seconds (4 minutes).
115
116       --verbose Write info regarding the conversion process to STDERR.
117

DESCRIPTION

119       "graph-easy" reads a description of a graph (a connected network of
120       nodes and edges, not a pie chart :-) and then converts this to the
121       desired output format.
122
123       By default, the input will be read from STDIN, and the output will go
124       to STDOUT. The input is expected to be encoded in UTF-8, the output
125       will also be UTF-8.
126
127       It understands the following formats as input:
128
129           Graph::Easy  http://bloodgate.com/perl/graph/manual/
130           DOT          http://www.graphviz.org/
131           VCG          http://rw4.cs.uni-sb.de/~sander/html/gsvcg1.html
132           GDL          http://www.aisee.com/
133
134       The formats are automatically detected, regardless of the input file
135       name, but you can also explicitly declare your input to be in one
136       specific format.
137
138       The output can be a dump of the graph in one of the following formats:
139
140           Graph::Easy  http://bloodgate.com/perl/graph/manual/
141           DOT          http://www.graphviz.org/
142           VCG          http://rw4.cs.uni-sb.de/~sander/html/gsvcg1.html
143           GDL          http://www.aisee.com/
144           GraphML      http://graphml.graphdrawing.org/
145
146       In addition, "Graph::Easy" can also create layouts of graphs in one of
147       the following output formats:
148
149           HTML   SVG   ASCII   BOXART
150
151       Note that for SVG output, you need to install the module
152       Graph::Easy::As_svg first.
153
154       As a shortcut, you can also specify the output format as 'png', this
155       will cause "graph-easy" to pipe the input in graphviz format to the
156       "dot" program to create a PNG file in one step. The following two
157       examples are equivalent:
158
159           graph-easy graph.txt --dot | dot -Tpng -o graph.png
160           graph-easy graph.txt --png
161

OTHER ARGUMENTS

163       "graph-easy" supports a few more arguments in addition to the ones from
164       above:
165
166       --version Write version info and exit.
167
168       --debug=N Set the debug level (1..3). Warning, this will generate huge
169                 amounts of hard to understand output on STDERR. Example:
170
171                         graph-easy input.txt --output=test.html --debug=1
172
173       --png, --dot, --vcg, --gdl, --txt, --ascii, --boxart, --html, --svg
174                 Given exactly one of these options, produces the desired
175                 output format.
176

EXAMPLES

178   ASCII output
179               echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy
180
181               +--------+  car   +-----+
182               |  Bonn  | -----> | Ulm |
183               +--------+        +-----+
184                 |
185                 | car
186                 v
187               +--------+
188               | Berlin |
189               +--------+
190
191   Graphviz example output
192               echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --dot
193               digraph GRAPH_0 {
194
195                 edge [ arrowhead=open ];
196                 graph [ rankdir=LR ];
197                 node [
198                   fontsize=11,
199                   fillcolor=white,
200                   style=filled,
201                   shape=box ];
202
203                 Bonn -> Ulm [ label=car ]
204                 Bonn -> Berlin [ label=car ]
205
206               }
207
208   VCG example output
209               echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --vcg
210               graph: {
211                 title: "Untitled graph"
212
213                 node: { title: "Berlin" }
214                 node: { title: "Bonn" }
215                 node: { title: "Ulm" }
216
217                 edge:  { label: "car" sourcename: "Bonn" targetname: "Ulm" }
218                 edge:  { label: "car" sourcename: "Bonn" targetname: "Berlin" }
219
220               }
221
222   GDL example output
223       GDL (Graph Description Language) is a superset of VCG, and thus the
224       output will look almost the same as VCG:
225
226               echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --gdl
227               graph: {
228                 title: "Untitled graph"
229
230                 node: { title: "Berlin" }
231                 node: { title: "Bonn" }
232                 node: { title: "Ulm" }
233
234                 edge:  { label: "car" source: "Bonn" target: "Ulm" }
235                 edge:  { label: "car" source: "Bonn" target: "Berlin" }
236
237               }
238
239   GraphML example output
240       GraphML is XML:
241
242               echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --graphml
243               <?xml version="1.0" encoding="UTF-8"?>
244               <graphml xmlns="http://graphml.graphdrawing.org/xmlns"
245                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
246                   xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
247                    http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
248
249                 <!-- Created by Graph::Easy v0.58 at Mon Aug 20 00:01:25 2007 -->
250
251                 <key id="d0" for="edge" attr.name="label" attr.type="string"/>
252
253                 <graph id="G" edgedefault="directed">
254                   <node id="Berlin">
255               </node>
256                   <node id="Bonn">
257               </node>
258                   <node id="Ulm">
259               </node>
260                   <edge source="Bonn" target="Berlin">
261                     <data key="d0">car</data>
262               </edge>
263                   <edge source="Bonn" target="Ulm">
264                     <data key="d0">car</data>
265               </edge>
266                 </graph>
267               <graphml>
268

CAVEATS

270       Please note that it is impossible to convert 100% from one format to
271       another format since every graph language out there has features that
272       are unique to only this language.
273
274       In addition, the conversion process always converts the input first
275       into an Graph::Easy graph, and then to the desired output format.
276
277       This means that only features and attributes that are actually valid in
278       Graph::Easy are supported yet. Work in making Graph::Easy an universal
279       format supporting as much as possible is still in progress.
280
281       Attributes that are not yet supported natively by Graph::Easy are
282       converted to custom attributes with a prefixed "x-format-", f.i.
283       "x-dot-". Upon output to the same format, these are converted back, but
284       conversion to a different format will lose these attributes.
285
286       For a list of what problems still remain, please see the TODO file in
287       the "Graph::Easy" distribution on CPAN:
288
289       <http://search.cpan.org/~tels/Graph-Easy/>
290
291       If you notice anything wrong, or miss attributes, please file a bug
292       report on
293
294       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Easy>
295
296       so we can fix it and include the missing things into Graph::Easy!
297

LICENSE

299       This library is free software; you can redistribute it and/or modify it
300       under the terms of the GPL.
301
302       See the LICENSE file of Graph::Easy for a copy of the GPL.
303
304       This product includes color specifications and designs developed by
305       Cynthia Brewer (<http://colorbrewer.org/>). See the LICENSE file for
306       the full license text that applies to these color schemes.
307

AUTHOR

309       Copyright (C) 2004 - 2008 by Tels <http://bloodgate.com>
310

SEE ALSO

312       More information can be found in the online manual of Graph::Easy:
313
314       <http://bloodgate.com/perl/graph/manual/>
315
316       See also: Graph::Easy, Graph::Easy::Manual
317
318
319
320perl v5.38.0                      2023-07-20                     GRAPH-EASY(1)
Impressum