GRAPH-EASY(1)
π NAME π
graph-easy β render/convert graphs in/from various formats
Okay bestie, this is GRAPH-EASY(1) from the User Contributed Perl Documentation section, and it's literally the graph tool that does everything. Sit down, hydrate, let's go. π«Ά
β¨ SYNOPSIS β¨
Convert between graph formats and layout/render graphs, no cap:
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
π ARGUMENTS π
These are the most important options, and there's more lurking in the full documentation. Here's the whole crew:
--helpβ prints the full documentation, not just this little short overview. Ask for the whole lore. π--inputβ specify the input file name. Like:
graph-easy --input=input.txt
The format gets auto-detected, and you can override it with --from.
--outputβ specify the output file name. Like:
graph-easy --output=output.txt input.txt
--asβ specify the output format. Like:
graph-easy --as=ascii input.txt
Valid formats are:
asciiβ ASCII art renderingboxartβ Unicode Boxart renderinghtmlβ HTMLsvgβ Scalable Vector Graphicsgraphvizβ the DOT languagedotβ alias for "graphviz"txtβ Graph::Easy textvcgβ VCG (Visualizing Compiler Graphs - a subset of GDL) textgdlβ GDL (Graph Description Language) textgraphmlβ GraphML
Plus, these following formats are understood and piped through the program you pick with the --renderer option (default: dot):
bmpβ Windows bitmapgifβ GIFhpglβ HP-GL/2 vector graphicjpgβ JPEGpclβ PCL printer languagepdfβ PDFpngβ PNGpsβ Postscriptps2β Postscript with PDF notations (see graphviz documentation)tgaβ Targa bitmaptifβ TIFF bitmap
The default format is determined by the output filename extension, and it's "ascii" if the output filename wasn't set. iykyk.
You can also use ONE argument of the form --as_ascii or --ascii. One. Singular. Choose wisely bestie. π
--fromβ specify the input format. Valid formats are:graphvizβ the DOT languagetxtβ Graph::Easy textvcgβ VCG textgdlβ GDL (Graph Description Language) text
If you don't specify it, the input format is auto-detected. She just knows. β¨
You can also use ONE argument of the form --from_dot, etc.
--rendererβ the external program (default:dot) used to render the output formats likepng,jpgetc. Some choices areneato,twopi,fdporcirco. Pick your fighter. π₯--parseβ input will only be parsed, without any output generation. Super useful in combination with--debug=1or--stats. Example:
graph-easy input.txt --parse --debug=1
--statsβ write various statistics about the input graph to STDERR. Best used in combination with--parse:
graph-easy input.txt --parse --stats
--timeoutβ set the timeout in seconds for the Graph::Easy layouter that generates ASCII, HTML, SVG or boxart output. If the layout doesn't finish in this time, it will be aborted. Example:
graph-easy input.txt --timeout=500
Conversion to DOT, VCG/GDL, GraphML or plain text ignores the timeout.
The default is 240 seconds (4 minutes). That's a whole skincare routine, so use it wisely.
--verboseβ write info regarding the conversion process to STDERR.
π¦ DESCRIPTION π¦
graph-easy 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.
By default, the input is read from STDIN, and the output goes to STDOUT. The input is expected to be encoded in UTF-8, and the output will also be UTF-8. Consistent. Iconic. π
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 explicitly declare your input to be in one specific format.
The output can be a dump of the graph in one of the following formats:
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/
In addition, Graph::Easy can also create layouts of graphs in one of the following output formats:
HTML SVG ASCII BOXART
Heads up bestie: for SVG output, you need to install the module Graph::Easy::As_svg first. No module, no SVG, that's the rule. π
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 --dot | dot -Tpng -o graph.png
graph-easy graph.txt --png
π OTHER ARGUMENTS π
graph-easy supports a few more arguments in addition to the ones from above:
--versionβ write version info and exit. Short, sweet, slays.--debug=Nβ set the debug level (1..3). Warning, this will generate huge amounts of hard to understand output on STDERR. Not me flooding your terminal π. Example:
graph-easy input.txt --output=test.html --debug=1
--png,--dot,--vcg,--gdl,--txt,--ascii,--boxart,--html,--svgβ given exactly one of these options, produces the desired output format. Exactly one. Don't be greedy. β
π EXAMPLES π
π¨ ASCII output
echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy
+--------+ car +-----+
| Bonn | -----> | Ulm |
+--------+ +-----+
|
| car
v
+--------+
| Berlin |
+--------+
π¨ Graphviz example output
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 ]
}
π¨ VCG example output
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" }
}
π¨ 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 --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" }
}
π¨ GraphML example output
GraphML is XML:
echo "[ Bonn ] -- car --> [ Berlin ], [ Ulm ]" | graph-easy --graphml
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns
http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<!-- Created by Graph::Easy v0.58 at Mon Aug 20 00:01:25 2007 -->
<key id="d0" for="edge" attr.name="label" attr.type="string"/>
<graph id="G" edgedefault="directed">
<node id="Berlin">
</node>
<node id="Bonn">
</node>
<node id="Ulm">
</node>
<edge source="Bonn" target="Berlin">
<data key="d0">car</data>
</edge>
<edge source="Bonn" target="Ulm">
<data key="d0">car</data>
</edge>
</graph>
<graphml>
π CAVEATS π
Okay so real talk, 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. Every format is special in its own way, and that's valid. π¦
In addition, the conversion process always converts the input first into an Graph::Easy graph, and then to the desired output format. Everything goes through the middle. It's giving airport layover. βοΈ
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. It's a journey, not a destination. π±
Attributes that are not yet supported natively by Graph::Easy are converted to custom attributes with a prefixed "x-format-", f.i. "x-dot-". Upon output to the same format, these are converted back, but conversion to a different format will lose these attributes. So like, they don't survive the trip. π
For a list of what problems still remain, please see the TODO file in the "Graph::Easy" distribution on CPAN:
<http://search.cpan.org/~tels/Graph-Easy/>
If you notice anything wrong, or miss attributes, please file a bug report on
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Easy>
so we can fix it and include the missing things into Graph::Easy! Besties help besties fix bugs. π«Ά
π 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 - 2008 by Tels <http://bloodgate.com>
β¦and that's part one, bestie β there's more coming, so don't go anywhere. π
π SEE ALSO π
okay bestie, if you wanna go deeper (and I know you do π«Ά), there's a whole online manual for Graph::Easy waiting for you:
<http://bloodgate.com/perl/graph/manual/>
and like, obviously, you should also go say hi to these two legends:
Graph::EasyπGraph::Easy::Manualπ
and that's the whole page, bestie!! π you made it to the end, which is giving main character energy fr fr π
this lil masterpiece is from perl v5.42.0 β¨ and it got its glow-up on 2025-07-25 πΈ so yeah, that's the vibe, that's the date, periodt π
now go draw some iconic graphs, you absolute queen ππ
π¦ where this page comes from
- fedora 43: perl-Graph-Easy 0.76-27.fc43 Β· GPL-2.0-or-later AND Apache-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms