Graph::Easy manual - Chapter 1 - Basics
This chapter of the Graph::Easy manual covers the basic syntax and elements of the graph description language.
Nodes
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
:
See also the section on Escaping.
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:
Definitions and Comments
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
Edges connect nodes with each other.
Styles and labels
You can also combine different styles and labels:
Attributes
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: