Graph::Easy - Manual - Attributes

# Graph::Easy - Manual

## Attributes

If you haven't done so, please read the Overview first.

This chapter describes all the possible attributes for graphs, groups, nodes and edges. It is generated automatically from the definitions in `Graph::Easy::Attributes`.

### Graphs

- align, autolabel, autolink, autotitle,
- background, border, border-color, border-style, border-width,
- class, color,
- fill, flow, font-size,
- gid,
- label, label-pos, link, linkbase,
- output,
- text-style, title,

### Nodes

- align, autolabel, autolink, autotitle,
- background, basename, border, border-color, border-style, border-width,
- class, color, columns,
- fill, flow, font-size,
- label, link, linkbase,
- offset, origin,
- point-style,
- rotate, rows,
- shape, size,
- text-style, title,

### Edges

- align, arrow-style, autolabel, autolink, autotitle,
- background, border, border-color, border-style, border-width,
- class, color,
- end,
- fill, flow, font-size,
- label, label-color, link, linkbase,
- minlen,
- start, style,
- text-style, title,

### Groups

- align, autolabel, autolink, autotitle,
- background, border, border-color, border-style, border-width,
- class, color,
- edgeclass,
- fill, font-size,
- label, link, linkbase,
- nodeclass,
- text-style, title,

### Class names

Each of the primary classes `node`, `edge` and `group` can have an arbitrary number of sub-classes.

Subclass names are restricted to `[a-z]` (lower ASCII letters A to Z) and the `_` (underscore). Each subclass can have its own set of attributes.
Objects with their `class`-attributea set will use the attributes from the appropriate subclass. If an attribute was not defined there, they will inherit the attribute from their primary class. In the following example the left node will have green text, the right one will have red text. Both nodes will have a beige interieur:

    node { color: green; fill: beige; }
    node.cities { color: red; }

    [ Green ] --> [ Red ] { class: cities; }

### Flow Control

Please see the section about Flow Control for details about controlling the flow (placement direction of edges and nodes) in a graph.

### Labels, Titles and Names

The `label` is the text displayed for the node, edge etc. It can be different from the name of the object.

`Edges` do not have a name, but they can have a label. If you try to access the name of an edge, for instance via the `autotitle: name;` attribute, than the optional edge label will be used instead.

Apart from setting a label manually via the `label: Foo;` attribute, you can also set labels for entire classes, or use the `autolabel:` attribute. The latter has the advantage that it can shorten the label automaticall to sane values. See this graph for an example.

### Links and URLs

Links are constructed from two parts, by concatenating the `linkbase` attribute and the `link` attribute:

    node { linkbase: http://www.bloodgate.com/perl/; }

    [ Graph ] { link: graph/; }
     --> [ Manual ] { link: graph/manual/; }

`linkbase` is ignored unless you also have `link` or `autolink`. You can use `autolink` to automatically set the link attribute to the name, label, or titel of the object:

    node { linkbase: http://www.bloodgate.com/perl/; autolink: name; }

    [ graph ] --> [ graph/manual ]

Note that `link` has precedence over `autolink`, the latter will not override a `link` attribute on the object itself.
Also, `linnkbase` is only prepended for relativ links, e.g. ones that do not start with `/[a-z]{3,4}://`. In the following example the first node will not have the name autolinked, and the second node will ignore the linkbase:

    node { linkbase: http://www.bloodgate.com/perl/; autolink: name; }

    [ graph ] { link: index.html; }
      --> [ graph/manual ] { link: http://bloodgate.com; }

Of course you can also attach a link to an edge, group or graph label.

### Color Names and Values

Here is a list of the color names recognized by Graph::Easy and their corrosponding color values. Note that this list is exactly the same as the one published by W3C. So do not blame me for silly things like darkseagreen being lighter than seagreen...

black: |  | navy: |  | darkblue: |
mediumblue: |  | blue: |  | darkgreen: |
green: |  | teal: |  | darkcyan: |
deepskyblue: |  | darkturquoise: |  | mediumspringgreen: |
lime: |  | springgreen: |  | aqua: |
midnightblue: |  | dodgerblue: |  | lightseagreen: |
forestgreen: |  | seagreen: |  | darkslategrey: |
limegreen: |  | mediumseagreen: |  | turquoise: |
royalblue: |  | steelblue: |  | darkslateblue: |
mediumturquoise: |  | indigo: |  | darkolivegreen: |
cadetblue: |  | cornflowerblue: |  | mediumaquamarine: |
dimgray: |  | slateblue: |  | olivedrab: |
slategray: |  | lightslategrey: |  | mediumslateblue: |
lawngreen: |  | chartreuse: |  | aquamarine: |
maroon: |  | purple: |  | olive: |
grey: |  | skyblue: |  | lightskyblue: |
blueviolet: |  | darkred: |  | darkmagenta: |
saddlebrown: |  | darkseagreen: |  | lightgreen: |
mediumpurple: |  | darkviolet: |  | palegreen: |
darkorchid: |  | yellowgreen: |  | sienna: |
brown: |  | darkgrey: |  | lightblue: |
greenyellow: |  | paleturquoise: |  | lightsteelblue: |
powderblue: |  | firebrick: |  | darkgoldenrod: |
mediumorchid: |  | rosybrown: |  | darkkhaki: |
silver: |  | mediumvioletred: |  | indianred: |
peru: |  | chocolate: |  | tan: |
lightgray: |  | thistle: |  | orchid: |
goldenrod: |  | palevioletred: |  | crimson: |
gainsboro: |  | plum: |  | burlywood: |
lightcyan: |  | lavender: |  | darksalmon: |
violet: |  | palegoldenrod: |  | lightcoral: |
khaki: |  | aliceblue: |  | honeydew: |
azure: |  | sandybrown: |  | wheat: |
beige: |  | whitesmoke: |  | mintcream: |
ghostwhite: |  | salmon: |  | antiquewhite: |
linen: |  | lightgoldenrodyellow: |  | oldlace: |
red: |  | magenta: |  | deeppink: |
orangered: |  | tomato: |  | hotpink: |
coral: |  | darkorange: |  | lightsalmon: |
orange: |  | lightpink: |  | pink: |
gold: |  | peachpuff: |  | navajowhite: |
moccasin: |  | bisque: |  | mistyrose: |
blanchedalmond: |  | papayawhip: |  | lavenderblush: |
seashell: |  | cornsilk: |  | lemonchiffon: |
floralwhite: |  | snow: |  | yellow: |
lightyellow: |  | ivory: |  | inherit: |
white: |

For all other colors you can use one of the following notations:

- Hex: `#ff0080`
- RGB: `rgb(255,0,128)`