first commit

This commit is contained in:
douboer
2025-09-17 16:08:16 +08:00
parent 9395faa6b2
commit 3ff47c11d5
1318 changed files with 117477 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
strict/*comment*/digraph/*comment*/{
// test comments
}

View File

@@ -0,0 +1,14 @@
digraph G {
// test parsing of numbers as node names
0.99 -> 12.88
-100 -> 123.1230
00019.1001 -> 1000.
.99 -> 0.
.1 -> -1.
}

View File

@@ -0,0 +1,12 @@
digraph SPLIT {
0 [ shape=record, label="<f1>nil| | | <f2> 0" ]
1 [ shape=record, label="<f1>nil| | | <f2> 1" ]
2 [ shape=record, label="<f1>nil| | | <f2> 2" ]
3 [ shape=record, label="<f1>nil| | | <f2> 3" ]
"0":f1 -> "1":f2;
"0":"f2" -> "1":"f1";
2:"f1" -> 3:"f2";
2:f2 -> 3:f1;
}

View File

@@ -0,0 +1,27 @@
digraph G {
node [ center
compound
concentrate
constraint
decorate
diredgeconstraints
fixedsize
headclip
labelfloat
landscape
mosek
nojustify
normalize
overlap
pack
pin
regular
remincross
root
splines
tailclip
truecolor
]
"Bonn" -> "Berlin"
}

View File

@@ -0,0 +1,5 @@
digraph G {
a [ label = "a" /* color=red */ ]
a -> b;
} /* digraph */

View File

@@ -0,0 +1,4 @@
digraph GRAPH_0 {
graph [ labelloc=b, label="Deutsche Städte" ]
"Köln" -> "Stralsund"
}

View File

@@ -0,0 +1,11 @@
digraph GRAPH_0 {
subgraph "cluster0" {
label="Bergtour:";
style="filled,dashed";
labelloc=bottom;
labeljust=l;
Zugspitze -> Wasserkuppe
}
}

View File

@@ -0,0 +1,8 @@
strict digraph G {
node [ pname=123, foo=9, bar=baz ]
node1 [ fname=o ]
node2 [ bar=zup ]
node1 -> node2 [ brabble=bramble ]
}

View File

@@ -0,0 +1,3 @@
digraph G {size="11,8.5"; ratio=fill; overlap=false; node[fontsize=10,shape=plaintext];edge[dir=none,style="setlinewidth(0.1)"];
"123"->"foo"[];
}

View File

@@ -0,0 +1 @@
strict graph{bonn--berlin}

View File

@@ -0,0 +1,3 @@
digraph mike{
mike -> michael
}

View File

@@ -0,0 +1,3 @@
digraph ports {
north -> south [ headport=west tailport=east ]
}

View File

@@ -0,0 +1,7 @@
digraph {
"Bonn" [ style="setlinewidth(4)" ]
"Berlin" [ style="filled, setlinewidth(5)" ]
"Bonn" -> "Berlin"
}

View File

@@ -0,0 +1,5 @@
digraph G {
a [ label = < ] > ]
a -> b;
}

View File

@@ -0,0 +1,3 @@
strict digraph G {
Wolfsbüttel -> Köln
}

View File

@@ -0,0 +1,15 @@
# Differen ways to write colors, all of them should result in "red",
# except "/accent4/4":
digraph G {
subgraph cluster_1 {
pencolor="#ff 00 00";
# "//" means empty color scheme and is equivalen to ""
node [ color=red fontcolor="//red" ]
A -> B [ color="#ff0000ff" ]
}
C [ color="0 1.0 1.0" fontcolor="/x11/red" ]
B -> C [ color="1.0,1.0,1.0" ]
// results in "#ffff99"
B [ color="/accent4/4" ]
}

View File

@@ -0,0 +1,3 @@
digraph G {
"Compositor" [shape="record", label="{Compositor||Compose()}"]
}

View File

@@ -0,0 +1,4 @@
digraph G {
rankdir=LR;
"Compositor" [shape="record", label="{Compositor||Compose()}"]
}

View File

@@ -0,0 +1,4 @@
digraph GRAPH_0 {
graph [ labelloc=b, label="Deutsche Städte am Rhein" ]
"Köln" -> "Bonn" -> "Koblenz"
}

View File

@@ -0,0 +1,3 @@
digraph G {
123abc -> test
}

View File

@@ -0,0 +1,7 @@
digraph G {
node [ style=invis ]
{ node [ style=filled ] a; c; }
a -> b -> c;
}

View File

@@ -0,0 +1,7 @@
digraph Graphname {
graph [ label="\G" ]
node [ label="\G \N" ]
0 -> 1 [ label="\E \G \T \H" ]
2 [ label="Name: \N \G" ]
}

View File

@@ -0,0 +1,5 @@
digraph G {
output = html;
c:w; /* a node named "c" with port "w" */
a -> b;
}

View File

@@ -0,0 +1,14 @@
digraph G {
subgraph cluster_0 {
aaaaaaaaaaaaaaaaaaa -> b;
labeljust=r;
label="Right aligned";
}
subgraph cluster_1 {
c -> ddddddddddddddd;
labeljust=l;
label="Left aligned";
}
}

View File

@@ -0,0 +1,11 @@
// Test compass directions and port names
// Note: This graph does not have a name, as the ID is optional
digraph {
bonn [ label="<N> bonn N | <S> S" shape=record]
berlin [ label="<N> berlin N | <w> w" shape=record]
bonn:S -> berlin:w
bonn:s -> berlin:N:w
}

View File

@@ -0,0 +1,9 @@
# these are all invalid HTML-like labels. The should not result
# in errors and the "<>" should be stripped, leaving only the inner
# text as the label text:
digraph G {
first [ label = <> ]
second [ label =<> ]
third [ label =< > ]
fourth [ label = <a> ]
}

View File

@@ -0,0 +1,7 @@
digraph G {
node1 [ label = "<a1> test | <a2> split", shape=record ]
node2 [ label = "<b1> record | <b2> test", shape=record ]
node1:a1 -> node2:b2
}

View File

@@ -0,0 +1,22 @@
strict digraph graph0 {
// test continuation lines (ending in \)
berlin [ label="Berlin\
Ost" ]
bonn [ label="Bonn\
am\
Rhein" ]
// test double quoted string continuation "foo" + "bar" in attributes
bonn -> berlin [ label="train" + " (ICE)" ]
// and nodes
"bonn" + "test" [ label="Bonn" + " (Rhei \
n)" ]
// test more than one concat, more than one space plus empty parts
"Cottbus" [ label= "Cot" + "" + "tb" +"" +"" + "us" ]
"bonntest" -> "Cottbus"
}

View File

@@ -0,0 +1,8 @@
STRICT DIGRAPH "graph" {
EDGE [ label=foo ]
NODE [ style=dotted ]
SUBGRAPH cluster_me {
a -> b
}
c -> d
}

View File

@@ -0,0 +1,7 @@
digraph GRAPH_0 {
b [ style=rounded ]
a -> { node [ shape=plaintext ] b c d }
{ b c d } -> u
}

View File

@@ -0,0 +1,5 @@
digraph GRAPH_0 {
a -> { b c d }
{ b c d } -> u
}

View File

@@ -0,0 +1,3 @@
digraph GRAPH_0 {
a -> { b c d } -> o
}

View File

@@ -0,0 +1,3 @@
digraph GRAPH_0 {
a -- { b c d } -- o
}

View File

@@ -0,0 +1,16 @@
digraph G {
subgraph cluster_first {
a -> b;
label=first;
}
subgraph cluster_second {
p -> q -> r -> s
label=second;
s -> p;
}
r -> a [ style=bold ];
b -> q;
}

View File

@@ -0,0 +1,10 @@
/* this is a
* multi line
* comment
*/
/* comment */ digraph /* one comment */ GRAPH_0 /* another */ /* comment */ { // comment
// comment
a -> /* comment */ { b c /* comment */ d }
{ b /* comment */ c d } /* comment */ -> u
" my node /* not a comment */ " -> b
}

View File

@@ -0,0 +1,3 @@
( Left: [ A ] -> [ B ]) { align: left; }
( Right: [ C ] -> [ D ]) { align: right; }
( Center: [ E ] -> [ F ]) { align: center; }

View File

@@ -0,0 +1,10 @@
digraph gaph {
graph [ labeljust=l, label="Left aligned label" ]
"<f1> Aa | <f2> Bb | Cc" [ shape=rect ];
node [ shape=record ]
a [ label = "<f1> AA | <f2> BB | CC" ]
"<f1> A | <f2> B | C";
}

View File

@@ -0,0 +1,12 @@
digraph G {
graph [rankdir=LR];
"11" -> "1"
"1" -> "2"
"2" -> "3"
"1" -> "10"
"3" -> "8"
"8" -> "5" [ dir=back; ]
"5" -> "6"
"10" -> "6"
"0" -> "11"
}

View File

@@ -0,0 +1,24 @@
# dot -Tpng 9_edge_styles.dot -o 9_edge_styles.png
// various edge styles and misc. attributes
digraph G {
node [style=filled, color=lightsalmon, fontsize=14, fontname="Helvetica"];
edge [style="setlinewidth(3)"];
margin="0";
ratio=auto;
nodesep=0.2;
ranksep=0.2;
clusterrank=local;
A -> B [ style=solid ]
B -> C [ style=invis ]
C -> D [ style=dotted ]
D -> E [ style=dashed ]
// bold-dash
A -> F [ style="setlinewidth(3), dashed" ]
// setlinewidth(3) => bold
F -> G [ style="setlinewidth(3)" ]
// setlinewidth(5) => broad
G -> H [ style="setlinewidth(5)" ]
// setlinewidth(11) => wide
H -> I [ style="setlinewidth(11)" ]
}

View File

@@ -0,0 +1,12 @@
digraph G {
graph [rankdir=LR];
"11" -> "1"
"1" -> "2"
"2" -> "3"
"1" -> "10"
"3" -> "8"
"8" -> "5"
"5" -> "6"
"10" -> "6"
"0" -> "11"
}

View File

@@ -0,0 +1,9 @@
digraph G {
node [ shape=record ];
node0 [label = "<f0> |<f1> A|<f2> "];
node1 [label = "<f0> |<f1> B|<f2> "];
node2 [label = "<f0> |<f1> C|<f2> "];
"node0":f0 -> "node1":f1;
"node1":f0 -> "node2":f1;
"node0":f2 -> "node2":f2;
}