From: erg Date: Tue, 15 Apr 2008 17:20:25 +0000 (+0000) Subject: Add source for info pages to CVS X-Git-Tag: LAST_LIBGRAPH~32^2~4300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4c5093ac44f8c83f05241f79c9a20a47e6f80da;p=graphviz Add source for info pages to CVS --- diff --git a/doc/infosrc/shapelist b/doc/infosrc/shapelist new file mode 100644 index 000000000..1a8526a1b --- /dev/null +++ b/doc/infosrc/shapelist @@ -0,0 +1,33 @@ +box +polygon +ellipse +circle +point +egg +triangle +plaintext +diamond +trapezium +parallelogram +house +pentagon +hexagon +septagon +octagon +doublecircle +doubleoctagon +tripleoctagon +invtriangle +invtrapezium +invhouse +Mdiamond +Msquare +Mcircle +rect +rectangle +none +note +tab +folder +box3d +component diff --git a/doc/infosrc/shapes.1 b/doc/infosrc/shapes.1 new file mode 100644 index 000000000..68ec3ec27 --- /dev/null +++ b/doc/infosrc/shapes.1 @@ -0,0 +1,25 @@ + + + + +Node Shapes + + + +

Node Shapes

+
+The geometries of all node shapes are affected by +the node attributes +fixedsize, +fontname, +fontsize, +height, +label, +style and +width. + +

Polygon-based Nodes

+The possible polygon-based shapes are displayed below. + diff --git a/doc/infosrc/shapes.2 b/doc/infosrc/shapes.2 new file mode 100644 index 000000000..1438f3ba0 --- /dev/null +++ b/doc/infosrc/shapes.2 @@ -0,0 +1,170 @@ +
+As the figures suggest, the shapes rect and rectangle are synonyms for box, and none is a synonym for plaintext. +Also, unlike the rest, we have shown these last two +without style=filled +to indicate the normal use. If fill were turned on, the label text would +appear in a filled rectangle. +

+The geometries of polygon-based shapes are also affected +by the node attributes +regular, +peripheries and +orientation. +If shape="polygon", the attributes +sides, +skew and +distortion are also used. +If unset, they default to 4, 0.0 and 0.0, respectively. +In addition, the 3 M* shapes support auxiliary labels using +the toplabel and +bottomlabel attributes. +On the other hand, the point shape is special in that it is +only affected by the peripheries, +width and +height attributes. + +

Record-based Nodes

+These are specified by shape values of "record" and "Mrecord". +The structure of a record-based node is determined by +its label, +which has the following schema: + + + + +
rlabel=field ( '|' field )*
where field=fieldId or '{' rlabel '}'
and fieldId= [ '<' string '>'] [ string ]
+Literal braces, vertical bars and angle brackets must be escaped. +Spaces are interpreted as separators between tokens, +so they must be escaped if you want spaces in the text. +

+The first string in fieldId assigns a portname to the field and can +be combined with the node name to indicate where to attach an edge +to the node. (See portPos.) +The second string is used as the text for the field; it supports the usual +escape sequences \n, \l and \r. +

+Visually, a record is a box, with fields represented by alternating +rows of horizontal or vertical subboxes. The Mrecord shape is identical +to a record shape, except that the outermost box has rounded corners. +Flipping between horizontal and vertical layouts is done by nesting +fields in braces "{...}". The top-level orientation in a record is +horizontal. Thus, a record with label "A | B | C | D" will have 4 fields +oriented left to right, while "{A | B | C | D}" will have them +from top to bottom and "A | { B | C } | D" will have "B" over "C", with +"A" to the left and "D" to the right of "B" and "C". +

+The initial orientation of a record node depends on the +rankdir attribute. If this attribute +is TB (the default) or TB, corresponding to vertical +layouts, the top-level fields in a record are displayed horizontally. +If, however, this attribute is LR or RL, +corresponding to horizontal layouts, the top-level fields are +displayed vertically. +

+As an example of a record node, the dot input +

+digraph structs { + node [shape=record]; + struct1 [label="<f0> left|<f1> mid\ dle|<f2> right"]; + struct2 [label="<f0> one|<f1> two"]; + struct3 [label="hello\nworld |{ b |{c|<here> d|e}| f}| g | h"]; + struct1:f1 -> struct2:f0; + struct1:f2 -> struct3:here; +} + + +yields the figure
+ +

+If we add the line +

+ rankdir=LR + +we get the layout
+ +

+If we change node struct1 to have shape Mrecord, +it then looks like:
+ + +

Styles for Nodes

+The style +attribute can be used to modify the appearance of a node. +At present, there are 8 style values recognized: +filled, invisible, diagonals, rounded. +dashed, dotted, solid and bold. +As usual, the value of the style +attribute can be a comma-separated list of any of these. If the +style contains conflicts (e.g, style="dotted, solid"), the last +attribute wins. +
+
filled +
This value indicates that the node's interior should be filled. +The color used is the node's fillcolor or, if that's not defined, its +color. For unfilled nodes, the interior of the node is transparent to +whatever color is the current graph or cluster background color. +Note that point shapes are always filled. +

+Thus, the code +

+digraph G { + rankdir=LR + node [shape=box, color=blue] + node1 [style=filled] + node2 [style=filled, fillcolor=red] + node0 -> node1 -> node2 +} + +yields the figure
+ + +
invisible +
Setting this style causes the node not to be displayed at all. +Note that the node is still used in laying out the graph. + +
diagonals +
The diagonals style causes small chords to be drawn near the vertices +of the node's polygon or, in case of circles and ellipses, two chords near +the top and the bottom of the shape. The special node shapes +Msquare, +Mcircle, and +Mdiamond +are simply an ordinary square, circle and +diamond with the diagonals style set. + +
rounded +
The rounded style causes the polygonal corners to be smoothed. +Note that this style also applies to record-based nodes. Indeed, +the Mrecord shape is simply shorthand for setting this style. +Also, prior to 26 April 2005, the rounded and filled styles were +mutually exclusive. +

+As an example of rounding, dot uses the graph +

+digraph R { + rankdir=LR + node [style=rounded] + node1 [shape=box] + node2 [fillcolor=yellow, style="rounded,filled", shape=diamond] + node3 [shape=record, label="{ a | b | c }"] + + node1 -> node2 -> node3 +} + +to produce the figure
+ +
dashed +
This style causes the node's border to be drawn as a dashed line. +
dotted +
This style causes the node's border to be drawn as a dotted line. +
solid +
This style causes the node's border to be drawn as a solid line, +which is the default. +
bold +
This style causes the node's border to be drawn as a bold line. +See also setlinewidth. + +
+ +

+Additional styles may be available with a specific code generator.