Up: Graph Language Reference [Contents]

### 10.1 Graph Attributes

Msc-generator allows you to specify node, edge and subgraph labels via a colon syntax similar to signalling charts (see Labels). However, since colons are already used in the DOT language to express node ports, two colons shall be used to start labels, like `node::label;`. Such colon labels are terminated by semicolons and opening square brackets or braces - even if in DOT, nodes can be separated via commas or even spaces. When a label is specified via the colon notation all text formatting escapes used by signalling charts can be used (see Text Formatting). Note that in this case it is not possible to use the escape sequences of graphviz (such as `\N` to insert the name of the node).

The format of labels (sepecified either via the `label` attribute or the colon notation above) can be influenced via the `label_format` attribute. Assigning a series of text formatting escapes to this attribute (see Text Formatting) will apply their effect to the label. Note that the formatting is only applied to the label of the node, edge or cluster subgraph, not to any of headlabel, taillabel or xlabel. Labels can contain links via the `\L()` escape, the formatting of which can be set with the `link_format` attribute. On the other hand, the `URL`, `href`, `target`, `tooltip`, `labelURL`, `labeltarget`, `labeltooltip`, `edgeURL`, `edgehref`, `edgetarget`, `edgetooltip`, `headURL`, `headtarget`, `headtooltip`, `tailURL`, `tailhref`, `tailtarget`, `tailtooltip` attributes are ignored.

Msc-generator supports shadows for nodes and cluster subgraphs, via the `shadow_offset`, `shadow_blur` and `shadow_color` attributes. Read more on these in Common Attributes.

Since the style attribute of graphviz can take multiple values separated by commas, like `style="dotted,filled"` it is hard to work with it using the Msc-generator style system. For example, if in an Msc-generator style you define `defstyle node [style=filled];`, and later you create a node as `a [style=dotted];`, the attribute would normally completely overwrite the style of the node removing the fill. So in Msc-generator, the ‘`style`’ attribute is applied specially. Any assignment to this attibute will add a new value in a comma separated way, so `a [style=dotted, style=filled];` is equivalent to `a [code="dotted,filled"];`. If you want to remove a previously added component, use the minus sign, such as `style="-filled"`. If you want to drop previous values to style and have the current value be the only one, use an exclamation mark like `style="!bold"`.

Finally, there are a few rules on how attributes can be specified, which are somewhat against the logic of other Msc-generator languages.

- You can use a comma separated list of node names to define nodes, but be aware that any attribute you specify will apply to all nodes in the list. So in `a, b, c::Label;` all three nodes will have the same label. (This is from the original DOT language.)
- Attributes after an edge will apply to the edge and not to the last node. So in `a->b [color=red];` the edge will be red and not node `b`. (This is from the original DOT language.)
- You can assign attributes to subgraphs in the subgraph heading via square brackets. For example: `subgraph cluster_one [style=rounded] {...};`. (This is an Msc-generator extension, in the original language you can only specify subgraph attributes inside the subgraph.)

Up: Graph Language Reference [Contents]