This chapter of the Graph::Easy manual covers the basic syntax and elements of the graph description language.
A node is enclosed in square brackets, [ ]. The text between the brackets will be the unique name of the node and is also what will usually displayed:
[ ]
Note that spaces at the front and end, as well as double spaces are stripped out. Thus the following are all equivalent and the resulting graph will only have one node:
You can embed linebreaks into the node text by using \n:
\n
See also the section on Escaping.
When describing graphs, a few characters are used to start/end special features. These markers, like <[>, <]> or <#>, cannot appear in names, labels, texts etc, without being escaped. The escape character is <\> (backslash). Here is an example:
<[
<]
<#
<\
Comments in the source start with a # and always comment out anything to the end of the line:
#
Note that the color definition does not start a comment, this is a special case that should be automatically handled right by the parser.
If you want to embed a literal # into a node name, use \#.
\#
Edges connect nodes with each other.
You can also combine different styles and labels:
Attributes can appear either as global class definitions, or specifically on Nodes (and Edges):
If you want two nodes with the same text, or name a node different from what text is displayed, you need to use a node label:
To install Graph::Easy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graph::Easy
CPAN shell
perl -MCPAN -e shell install Graph::Easy
For more information on module installation, please visit the detailed CPAN module installation guide.