From: Mark Hansen Date: Tue, 2 Jun 2020 10:50:29 +0000 (+1000) Subject: Inline shapes.1 and shapes.2 into shapes.html.j2 X-Git-Tag: 2.44.1~29^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2f32eb6b798ef4af0090da9d92cd295d8a301dc;p=graphviz Inline shapes.1 and shapes.2 into shapes.html.j2 --- diff --git a/doc/infosrc/Makefile b/doc/infosrc/Makefile index dba36f612..f95af5b1b 100644 --- a/doc/infosrc/Makefile +++ b/doc/infosrc/Makefile @@ -156,10 +156,8 @@ shapes : shapelist mkshapes.sh ./mkshapes.sh touch shapes -shapes.html : shapes shapes.1 mkshhtml.py shapes.2 html.html shapes.3 record.gif record2.gif sdlshapes.png templates/shapes.html.j2 - cat shapes.1 > shapes.html - ./mkshhtml.py < shapelist >> shapes.html - cat shapes.2 >> shapes.html +shapes.html : shapes mkshhtml.py html.html shapes.3 record.gif record2.gif sdlshapes.png templates/shapes.html.j2 + ./mkshhtml.py < shapelist > shapes.html cat html.html >> shapes.html cat shapes.3 >> shapes.html diff --git a/doc/infosrc/shapes.1 b/doc/infosrc/shapes.1 deleted file mode 100644 index 90397b1a1..000000000 --- a/doc/infosrc/shapes.1 +++ /dev/null @@ -1,34 +0,0 @@ - - - - -Node Shapes - - - -

Node Shapes

-
-There are three main types of shapes : -polygon-based, -record-based and -user-defined. -The record-based shape has largely been superseded and greatly generalized -by HTML-like labels. -That is, instead of using shape=record, one might -consider using shape=none, margin=0 and an HTML-like label. -

-The geometry and style 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 deleted file mode 100644 index 6f3762a3e..000000000 --- a/doc/infosrc/shapes.2 +++ /dev/null @@ -1,233 +0,0 @@ -
-As the figures suggest, the shapes rect and rectangle are synonyms for box, and none is a synonym for plaintext. -The shape plain is similar to these two, except that it also enforces -width=0 height=0 margin=0, which guarantees that the actual size of the node is entirely determined by the label. -This is useful, for example, when using HTML-like labels. -Also, unlike the rest, we have shown these three, as well as underline, -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. -The point shape is special in that it is -only affected by the peripheries, -width and -height attributes. -

-Normally, the size of a node is determined by smallest width and height -needed to contain its label and image, if any, with a margin specified by -the margin attribute. The width -and height must also be at least as large as the sizes specified by the -width and -height attributes, which specify -the minimum values for these parameters. -See the fixedsize attribute -for ways of restricting the node size. -In particular, if fixedsize=shape, the node's shape will be fixed -by the width and -height attributes, and the shape -is used for edge termination, but both the shape and label sizes are used -preventing node overlap. For example, the following graph -

-digraph G { - { - node [margin=0 fontcolor=blue fontsize=32 width=0.5 shape=circle style=filled] - b [fillcolor=yellow fixedsize=true label="a very long label"] - d [fixedsize=shape label="an even longer label"] - } - a -> {c d} - b -> {c d} -} - -yields the figure
- -

-Note that the label of the yellow node, with fixedsize=true, overlaps -the other node, where there is sufficient space for the gray node with -fixedsize=shape. -

-The shapes: note, tab, folder, -box3d and component were provided by Pander. -The synthetic biology shapes: -promoter, -cds, -terminator, -utr, -primersite, -restrictionsite, -fivepoverhang, -threepoverhang, -noverhang, -assembly, -signature, -insulator, -ribosite, -rnastab, -proteasesite, -proteinstab, -rpromoter, -rarrow, -larrow and -lpromoter -were contributed by Jenny Cheng. - -

Record-based Nodes

-NOTE: Please see the note about record-based nodes at the -top of this page. Also note that there are problems using -non-trivial edges (edges with ports or labels) between adjacent -nodes on the same rank if one or both nodes has a record shape. -

-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 ]
-Braces, vertical bars and angle brackets must be escaped with -a backslash character if you wish them to appear as a literal character. -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 BT, 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&#92; dle|<f2> right"]; - struct2 [label="<f0> one|<f1> two"]; - struct3 [label="hello&#92;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 penwidth. - -
- -

-Additional styles may be available with a specific code generator. diff --git a/doc/infosrc/templates/shapes.html.j2 b/doc/infosrc/templates/shapes.html.j2 index 17c5e66ef..fbdd1016a 100644 --- a/doc/infosrc/templates/shapes.html.j2 +++ b/doc/infosrc/templates/shapes.html.j2 @@ -1,3 +1,37 @@ + + + + +Node Shapes + + + +

Node Shapes

+
+There are three main types of shapes : +polygon-based, +record-based and +user-defined. +The record-based shape has largely been superseded and greatly generalized +by HTML-like labels. +That is, instead of using shape=record, one might +consider using shape=none, margin=0 and an HTML-like label. +

+The geometry and style 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. + {% for row in rows %} {% for shape in row %} @@ -10,3 +44,237 @@ {% endfor %} {% endfor %} + +
+As the figures suggest, the shapes rect and rectangle are synonyms for box, and none is a synonym for plaintext. +The shape plain is similar to these two, except that it also enforces +width=0 height=0 margin=0, which guarantees that the actual size of the node is entirely determined by the label. +This is useful, for example, when using HTML-like labels. +Also, unlike the rest, we have shown these three, as well as underline, +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. +The point shape is special in that it is +only affected by the peripheries, +width and +height attributes. +

+Normally, the size of a node is determined by smallest width and height +needed to contain its label and image, if any, with a margin specified by +the margin attribute. The width +and height must also be at least as large as the sizes specified by the +width and +height attributes, which specify +the minimum values for these parameters. +See the fixedsize attribute +for ways of restricting the node size. +In particular, if fixedsize=shape, the node's shape will be fixed +by the width and +height attributes, and the shape +is used for edge termination, but both the shape and label sizes are used +preventing node overlap. For example, the following graph +

+digraph G { + { + node [margin=0 fontcolor=blue fontsize=32 width=0.5 shape=circle style=filled] + b [fillcolor=yellow fixedsize=true label="a very long label"] + d [fixedsize=shape label="an even longer label"] + } + a -> {c d} + b -> {c d} +} + +yields the figure
+ +

+Note that the label of the yellow node, with fixedsize=true, overlaps +the other node, where there is sufficient space for the gray node with +fixedsize=shape. +

+The shapes: note, tab, folder, +box3d and component were provided by Pander. +The synthetic biology shapes: +promoter, +cds, +terminator, +utr, +primersite, +restrictionsite, +fivepoverhang, +threepoverhang, +noverhang, +assembly, +signature, +insulator, +ribosite, +rnastab, +proteasesite, +proteinstab, +rpromoter, +rarrow, +larrow and +lpromoter +were contributed by Jenny Cheng. + +

Record-based Nodes

+NOTE: Please see the note about record-based nodes at the +top of this page. Also note that there are problems using +non-trivial edges (edges with ports or labels) between adjacent +nodes on the same rank if one or both nodes has a record shape. +

+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 ]
+Braces, vertical bars and angle brackets must be escaped with +a backslash character if you wish them to appear as a literal character. +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 BT, 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&#92; dle|<f2> right"]; + struct2 [label="<f0> one|<f1> two"]; + struct3 [label="hello&#92;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 penwidth. + +
+ +

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