Commit 97c5c5bc authored by Mark Hansen's avatar Mark Hansen
Browse files

Add more attribute examples

parent 6b1044ac
......@@ -4,21 +4,12 @@ description: Direction Type
---
For an edge `T -> H;`
`"forward"`
<IMG SRC="/doc/info/forward.gif">
`"back"`
<IMG SRC="/doc/info/back.gif">
`"both"`
<IMG SRC="/doc/info/both.gif">
`"none"`
<IMG SRC="/doc/info/nohead.gif">
| Direction | Image |
| ----------- | --------------------------------- |
| `"forward"` | <IMG SRC="/doc/info/forward.gif"> |
| `"back"` | <IMG SRC="/doc/info/back.gif"> |
| `"both"` | <IMG SRC="/doc/info/both.gif"> |
| `"none"` | <IMG SRC="/doc/info/nohead.gif"> |
That is, a glyph is drawn at the head end of an edge if and only
if dirType is `"forward"` or `"both"`;
......
......@@ -40,23 +40,23 @@ if active areas of two edges overlap, it is unspecified which area dominates.
{{< dot_card header="Example: Van Gogh Paintings with Links">}}
graph {
label="Vincent van Gogh Paintings"
URL="https://en.wikipedia.org/wiki/Vincent_van_Gogh"
label="Vincent van Gogh Paintings"
URL="https://en.wikipedia.org/wiki/Vincent_van_Gogh"
subgraph cluster_self_portraits {
URL="https://en.wikipedia.org/wiki/Portraits_of_Vincent_van_Gogh"
label="Self-portraits"
subgraph cluster_self_portraits {
URL="https://en.wikipedia.org/wiki/Portraits_of_Vincent_van_Gogh"
label="Self-portraits"
"Self-Portrait with Grey Felt Hat" [URL="https://www.vangoghmuseum.nl/en/collection/s0016V1962"]
"Self-Portrait as a Painter" [URL="https://www.vangoghmuseum.nl/en/collection/s0022V1962"]
}
subgraph cluster_flowers {
URL="https://en.wikipedia.org/wiki/Sunflowers_(Van_Gogh_series)"
label="Flowers"
"Self-Portrait with Grey Felt Hat" [URL="https://www.vangoghmuseum.nl/en/collection/s0016V1962"]
"Self-Portrait as a Painter" [URL="https://www.vangoghmuseum.nl/en/collection/s0022V1962"]
}
subgraph cluster_flowers {
URL="https://en.wikipedia.org/wiki/Sunflowers_(Van_Gogh_series)"
label="Flowers"
"Sunflowers" [URL="https://www.nationalgallery.org.uk/paintings/vincent-van-gogh-sunflowers"]
"Almond Blossom" [URL="https://www.vangoghmuseum.nl/en/collection/s0176V1962"]
}
"Sunflowers" [URL="https://www.nationalgallery.org.uk/paintings/vincent-van-gogh-sunflowers"]
"Almond Blossom" [URL="https://www.vangoghmuseum.nl/en/collection/s0176V1962"]
}
}
{{< /dot_card >}}
......@@ -29,7 +29,7 @@ being given roughly its specified fraction of the edge.
For example, the graph:
{{< dot_card >}}
{{< dot_card header="Edge Color Example" >}}
digraph G {
a -> b [dir=both color="red:blue"]
c -> d [dir=none color="green:red;0.25:blue"]
......@@ -39,3 +39,13 @@ digraph G {
yields:
![](/doc/info/colorlist.gif)
{{< dot_card header="Subgraph & Node Color Example" >}}
digraph G {
subgraph cluster_yellow {
color="yellow"
a [color="red"]
b [color="green"]
}
}
{{< /dot_card >}}
......@@ -16,3 +16,18 @@ If no color scheme is set, the standard [X11 naming]({{< ref "../colors.md#x11"
For example, if `colorscheme=bugn9` (from [Brewer color schemes]({{< ref "../colors.md#brewer" >}})), then `color=7` is interpreted as
`color="/bugn9/7"`, the 7th color in the `bugn9` colorscheme.
{{< dot_card header="Example">}}
graph {
node [colorscheme=bugn9] # Apply colorscheme to all nodes
1 [color=1]
2 [color=2]
3 [color=3]
4 [color=4]
5 [color=5]
6 [color=6]
7 [color=7]
8 [color=8]
9 [color=9]
}
{{< /dot_card >}}
......@@ -9,3 +9,52 @@ types:
used_by: ENG
---
Comments are inserted into output. Device-dependent
{{< dot_card header="Example">}}
digraph {
comment="I am a graph"
A [comment="I am node A"]
B [comment="I am node B"]
A->B [comment="I am an edge"]
}
{{< /dot_card >}}
Outputs SVG with comments:
```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.47.1 (20210417.1919)
-->
<!-- This is a graph -->
<!-- Pages: 1 -->
<svg width="62pt" height="116pt"
viewBox="0.00 0.00 62.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 58,-112 58,4 -4,4"/>
<!-- A -->
<!-- I am node A -->
<g id="node1" class="node">
<title>A</title>
<ellipse fill="none" stroke="black" cx="27" cy="-90" rx="27" ry="18"/>
<text text-anchor="middle" x="27" y="-86.3" font-family="Times,serif" font-size="14.00">A</text>
</g>
<!-- B -->
<!-- I am node B -->
<g id="node2" class="node">
<title>B</title>
<ellipse fill="none" stroke="black" cx="27" cy="-18" rx="27" ry="18"/>
<text text-anchor="middle" x="27" y="-14.3" font-family="Times,serif" font-size="14.00">B</text>
</g>
<!-- A&#45;&gt;B -->
<!-- I am an edge -->
<g id="edge1" class="edge">
<title>A&#45;&gt;B</title>
<path fill="none" stroke="black" d="M27,-71.7C27,-63.98 27,-54.71 27,-46.11"/>
<polygon fill="black" stroke="black" points="30.5,-46.1 27,-36.1 23.5,-46.1 30.5,-46.1"/>
</g>
</g>
</svg>
```
......@@ -11,4 +11,4 @@ used_by: G
---
If true, allow edges between clusters.
See [`lhead`]({{< ref "lhead.md" >}}) and [`ltail`]({{< ref "ltail.md" >}}) below.
See [`lhead`]({{< ref "lhead.md" >}}) and [`ltail`]({{< ref "ltail.md" >}}).
......@@ -13,3 +13,12 @@ If true, use edge concentrators.
This merges multiedges into a single edge and causes partially parallel
edges to share part of their paths. The latter feature is not yet available
outside of `dot`.
{{< dot_card header="Example">}}
digraph {
concentrate=true
a -> b [label="1"]
c -> b
d -> b
}
{{< /dot_card >}}
......@@ -10,3 +10,10 @@ used_by: E
---
If true, attach edge label to edge by a 2-segment
polyline, underlining the label, then going to the closest point of spline.
{{< dot_card header="Example">}}
digraph {
a -> a [label="AA" decorate=true]
a -> b [label="AB" decorate=true]
}
{{< /dot_card >}}
......@@ -17,3 +17,12 @@ The actual style of the arrowhead can be specified using the
[`arrowhead`]({{< ref "arrowhead.md" >}}) and [`arrowtail`]({{< ref "arrowtail.md" >}}) attributes.
See [limitation]({{< ref "_index.md#undir_note" >}}).
{{< dot_card header="Example">}}
digraph {
A->B [dir=forward]
C->D [dir=back]
E->F [dir=both]
G->H [dir=none]
}
{{< /dot_card >}}
......@@ -13,3 +13,12 @@ Distortion factor for <code>[shape]({{< ref "shape.md" >}})=polygon</code>.
Positive values cause top part to be larger than bottom; negative values do
the opposite.
See also [`skew`]({{< ref "skew.md" >}}).
{{< dot_card header="Example">}}
graph {
LargeBottom [shape=polygon sides=4 distortion=-.5]
LargeTop [shape=polygon sides=4 distortion=.5]
}
{{< /dot_card >}}
......@@ -12,3 +12,12 @@ used_by: "N"
Skew factor for <code>[shape]({{< ref "shape.md" >}})=polygon</code>.
Positive values skew top of polygon to right; negative to left.
See also [`distortion`]({{< ref "distortion.md" >}}).
{{< dot_card header="Example">}}
graph {
SkewLeft [shape=polygon sides=4 skew=-.5]
SkewRight [shape=polygon sides=4 skew=.5]
}
{{< /dot_card >}}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment