graphviz: node[ -> [node etc. it can go back with the new parser.

db4
Doug Coleman 2015-08-06 17:18:38 -05:00
parent 43fb73fae6
commit fa9643dd60
6 changed files with 171 additions and 171 deletions

View File

@ -48,8 +48,8 @@ IN: compiler.cfg.graphviz
: cfgviz ( cfg -- graph )
<digraph>
graph[ "t" =labelloc ];
node[ "box" =shape "Courier" =fontname 10 =fontsize ];
[graph "t" =labelloc ];
[node "box" =shape "Courier" =fontname 10 =fontsize ];
swap [
[ add-cfg-vertex ] [ add-cfg-edges ] bi
] each-basic-block ;

View File

@ -48,12 +48,12 @@ M: object expr>str unparse ;
basic-block get number>> ;
: add-gvns ( graph -- graph' )
"gvns" add-node[
"gvns" [add-node
congruence-classes =label
"plaintext" =shape
];
"gvns" 0 add-edge[ "invis" =style ];
basic-block# add-node[ "bold" =style ];
"gvns" 0 [add-edge "invis" =style ];
basic-block# [add-node "bold" =style ];
;
SYMBOL: iteration

View File

@ -607,8 +607,8 @@ $nl
""
": K_n ( n -- )"
" <graph>"
" node[ \"point\" =shape ]; "
" graph[ \"t\" =labelloc \"circo\" =layout ];"
" [node \"point\" =shape ]; "
" [graph \"t\" =labelloc \"circo\" =layout ];"
""
" over number>string \"K \" prepend =label"
""
@ -636,15 +636,15 @@ $nl
":: partite-set ( n color -- cluster )"
" color <cluster>"
" color =color"
" node[ color =color ];"
" [node color =color ];"
" n iota ["
" number>string color prepend add-node"
" ] each ;"
""
":: K_n,m ( n m -- )"
" <graph>"
" node[ \"point\" =shape ];"
" graph[ \"t\" =labelloc \"dot\" =layout \"LR\" =rankdir ];"
" [node \"point\" =shape ];"
" [graph \"t\" =labelloc \"dot\" =layout \"LR\" =rankdir ];"
""
" n \"#FF0000\" partite-set"
" m \"#0000FF\" partite-set"
@ -678,8 +678,8 @@ $nl
""
": C_n ( n -- )"
" <graph>"
" graph[ \"t\" =labelloc \"circo\" =layout ];"
" node[ \"point\" =shape ];"
" [graph \"t\" =labelloc \"circo\" =layout ];"
" [node \"point\" =shape ];"
" over number>string \"C \" prepend =label"
" swap add-cycle"
" preview ;"
@ -707,8 +707,8 @@ $nl
""
": W_n ( n -- )"
" <graph>"
" graph[ \"t\" =labelloc \"twopi\" =layout ];"
" node[ \"point\" =shape ];"
" [graph \"t\" =labelloc \"twopi\" =layout ];"
" [node \"point\" =shape ];"
" over number>string \"W \" prepend =label"
" over add-node"
" over 1 - add-cycle"
@ -736,13 +736,13 @@ $nl
" 0 <cluster>"
" \"filled\" =style"
" \"lightgrey\" =color"
" node[ \"filled\" =style \"white\" =color ];"
" [node \"filled\" =style \"white\" =color ];"
" { \"a0\" \"a1\" \"a2\" \"a3\" } ~->"
" \"process #1\" =label"
" add"
""
" 1 <cluster>"
" node[ \"filled\" =style ];"
" [node \"filled\" =style ];"
" { \"b0\" \"b1\" \"b2\" \"b3\" } ~->"
" \"process #2\" =label"
" \"blue\" =color"
@ -756,8 +756,8 @@ $nl
" \"a3\" \"end\" ->"
" \"b3\" \"end\" ->"
""
" \"start\" add-node[ \"Mdiamond\" =shape ];"
" \"end\" add-node[ \"Msquare\" =shape ];"
" \"start\" [add-node \"Mdiamond\" =shape ];"
" \"end\" [add-node \"Msquare\" =shape ];"
"preview"
}
{ $image "resource:extra/graphviz/gallery/cluster.png" }
@ -777,16 +777,16 @@ $nl
" [ 16 * \"#%2x0000\" sprintf =fillcolor ] tri ;"
""
"<graph>"
" graph[ \"3,3\" =size \"circo\" =layout ];"
" [graph \"3,3\" =size \"circo\" =layout ];"
""
" node[ \"filled\" =style"
" [node \"filled\" =style"
" \"circle\" =shape"
" \"true\" =fixedsize"
" \"\" =label ];"
""
" edge[ \"invis\" =style ];"
" [edge \"invis\" =style ];"
""
" 0 add-node[ \"invis\" =style \"none\" =shape ];"
" 0 [add-node \"invis\" =style \"none\" =shape ];"
""
" 16 iota ["
" [ 0 -- ] [ colored-circle add ] bi"
@ -805,23 +805,23 @@ $nl
"<digraph>"
" \"LR\" =rankdir"
" \"8,5\" =size"
" node[ \"doublecircle\" =shape ];"
" [node \"doublecircle\" =shape ];"
" { \"LR_0\" \"LR_3\" \"LR_4\" \"LR_8\" } add-nodes"
" node[ \"circle\" =shape ];"
" \"LR_0\" \"LR_2\" ->[ \"SS(B)\" =label ];"
" \"LR_0\" \"LR_1\" ->[ \"SS(S)\" =label ];"
" \"LR_1\" \"LR_3\" ->[ \"S($end)\" =label ];"
" \"LR_2\" \"LR_6\" ->[ \"SS(b)\" =label ];"
" \"LR_2\" \"LR_5\" ->[ \"SS(a)\" =label ];"
" \"LR_2\" \"LR_4\" ->[ \"S(A)\" =label ];"
" \"LR_5\" \"LR_7\" ->[ \"S(b)\" =label ];"
" \"LR_5\" \"LR_5\" ->[ \"S(a)\" =label ];"
" \"LR_6\" \"LR_6\" ->[ \"S(b)\" =label ];"
" \"LR_6\" \"LR_5\" ->[ \"S(a)\" =label ];"
" \"LR_7\" \"LR_8\" ->[ \"S(b)\" =label ];"
" \"LR_7\" \"LR_5\" ->[ \"S(a)\" =label ];"
" \"LR_8\" \"LR_6\" ->[ \"S(b)\" =label ];"
" \"LR_8\" \"LR_5\" ->[ \"S(a)\" =label ];"
" [node \"circle\" =shape ];"
" \"LR_0\" \"LR_2\" [-> \"SS(B)\" =label ];"
" \"LR_0\" \"LR_1\" [-> \"SS(S)\" =label ];"
" \"LR_1\" \"LR_3\" [-> \"S($end)\" =label ];"
" \"LR_2\" \"LR_6\" [-> \"SS(b)\" =label ];"
" \"LR_2\" \"LR_5\" [-> \"SS(a)\" =label ];"
" \"LR_2\" \"LR_4\" [-> \"S(A)\" =label ];"
" \"LR_5\" \"LR_7\" [-> \"S(b)\" =label ];"
" \"LR_5\" \"LR_5\" [-> \"S(a)\" =label ];"
" \"LR_6\" \"LR_6\" [-> \"S(b)\" =label ];"
" \"LR_6\" \"LR_5\" [-> \"S(a)\" =label ];"
" \"LR_7\" \"LR_8\" [-> \"S(b)\" =label ];"
" \"LR_7\" \"LR_5\" [-> \"S(a)\" =label ];"
" \"LR_8\" \"LR_6\" [-> \"S(b)\" =label ];"
" \"LR_8\" \"LR_5\" [-> \"S(a)\" =label ];"
"preview"
}
{ $image "resource:extra/graphviz/gallery/fsm.png" }
@ -836,66 +836,66 @@ $nl
"USING: graphviz graphviz.notation graphviz.render ;"
""
"<digraph>"
" graph[ \"LR\" =rankdir \"8,8\" =size ];"
" node[ 8 =fontsize \"record\" =shape ];"
" [graph \"LR\" =rankdir \"8,8\" =size ];"
" [node 8 =fontsize \"record\" =shape ];"
""
" \"node0\" add-node["
" \"node0\" [add-node"
" \"<f0> 0x10ba8| <f1>\" =label"
" ];"
" \"node1\" add-node["
" \"node1\" [add-node"
" \"<f0> 0xf7fc4380| <f1> | <f2> |-1\" =label"
" ];"
" \"node2\" add-node["
" \"node2\" [add-node"
" \"<f0> 0xf7fc44b8| | |2\" =label"
" ];"
" \"node3\" add-node["
" \"node3\" [add-node"
" \"<f0> 3.43322790286038071e-06|44.79998779296875|0\" =label"
" ];"
" \"node4\" add-node["
" \"node4\" [add-node"
" \"<f0> 0xf7fc4380| <f1> | <f2> |2\" =label"
" ];"
" \"node5\" add-node["
" \"node5\" [add-node"
" \"<f0> (nil)| | |-1\" =label"
" ];"
" \"node6\" add-node["
" \"node6\" [add-node"
" \"<f0> 0xf7fc4380| <f1> | <f2> |1\" =label"
" ];"
" \"node7\" add-node["
" \"node7\" [add-node"
" \"<f0> 0xf7fc4380| <f1> | <f2> |2\" =label"
" ];"
" \"node8\" add-node["
" \"node8\" [add-node"
" \"<f0> (nil)| | |-1\" =label"
" ];"
" \"node9\" add-node["
" \"node9\" [add-node"
" \"<f0> (nil)| | |-1\" =label"
" ];"
" \"node10\" add-node["
" \"node10\" [add-node"
" \"<f0> (nil)| <f1> | <f2> |-1\" =label"
" ];"
" \"node11\" add-node["
" \"node11\" [add-node"
" \"<f0> (nil)| <f1> | <f2> |-1\" =label"
" ];"
" \"node12\" add-node["
" \"node12\" [add-node"
" \"<f0> 0xf7fc43e0| | |1\" =label"
" ];"
""
" \"node0\" \"node1\" ->[ \"f0\" =tailport \"f0\" =headport ];"
" \"node0\" \"node2\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node1\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];"
" \"node1\" \"node4\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node1\" \"node5\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node4\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];"
" \"node4\" \"node6\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node4\" \"node10\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node6\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];"
" \"node6\" \"node7\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node6\" \"node9\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node7\" \"node3\" ->[ \"f0\" =tailport \"f0\" =headport ];"
" \"node7\" \"node1\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node7\" \"node8\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node10\" \"node11\" ->[ \"f1\" =tailport \"f0\" =headport ];"
" \"node10\" \"node12\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node11\" \"node1\" ->[ \"f2\" =tailport \"f0\" =headport ];"
" \"node0\" \"node1\" [-> \"f0\" =tailport \"f0\" =headport ];"
" \"node0\" \"node2\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node1\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];"
" \"node1\" \"node4\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node1\" \"node5\" [-> \"f2\" =tailport \"f0\" =headport ];"
" \"node4\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];"
" \"node4\" \"node6\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node4\" \"node10\" [-> \"f2\" =tailport \"f0\" =headport ];"
" \"node6\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];"
" \"node6\" \"node7\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node6\" \"node9\" [-> \"f2\" =tailport \"f0\" =headport ];"
" \"node7\" \"node3\" [-> \"f0\" =tailport \"f0\" =headport ];"
" \"node7\" \"node1\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node7\" \"node8\" [-> \"f2\" =tailport \"f0\" =headport ];"
" \"node10\" \"node11\" [-> \"f1\" =tailport \"f0\" =headport ];"
" \"node10\" \"node12\" [-> \"f2\" =tailport \"f0\" =headport ];"
" \"node11\" \"node1\" [-> \"f2\" =tailport \"f0\" =headport ];"
"preview"
}
{ $image "resource:extra/graphviz/gallery/record.png" }

View File

@ -69,23 +69,23 @@ SYMBOLS: supported-layouts supported-formats ;
: K_n ( n -- graph )
<graph>
node[ "point" =shape ];
graph[ "t" =labelloc "circo" =layout ];
[node "point" =shape ];
[graph "t" =labelloc "circo" =layout ];
over number>string "K " prepend =label
swap iota 2 [ first2 add-edge ] each-combination ;
:: partite-set ( n color -- cluster )
color <cluster>
color =color
node[ color =color ];
[node color =color ];
n iota [
number>string color prepend add-node
] each ;
:: K_n,m ( n m -- graph )
<graph>
node[ "point" =shape ];
graph[ "t" =labelloc "dot" =layout "LR" =rankdir ];
[node "point" =shape ];
[graph "t" =labelloc "dot" =layout "LR" =rankdir ];
n "#FF0000" partite-set
m "#0000FF" partite-set
add-edge
@ -96,15 +96,15 @@ SYMBOLS: supported-layouts supported-formats ;
: C_n ( n -- graph )
<graph>
graph[ "t" =labelloc "circo" =layout ];
node[ "point" =shape ];
[graph "t" =labelloc "circo" =layout ];
[node "point" =shape ];
over number>string "C " prepend =label
swap add-cycle ;
: W_n ( n -- graph )
<graph>
graph[ "t" =labelloc "twopi" =layout ];
node[ "point" =shape ];
[graph "t" =labelloc "twopi" =layout ];
[node "point" =shape ];
over number>string "W " prepend =label
over add-node
over 1 - add-cycle
@ -116,12 +116,12 @@ SYMBOLS: supported-layouts supported-formats ;
0 <cluster>
"filled" =style
"lightgrey" =color
node[ "filled" =style "white" =color ];
[node "filled" =style "white" =color ];
{ "a0" "a1" "a2" "a3" } ~->
"process #1" =label
add
1 <cluster>
node[ "filled" =style ];
[node "filled" =style ];
{ "b0" "b1" "b2" "b3" } ~->
"process #2" =label
"blue" =color
@ -133,8 +133,8 @@ SYMBOLS: supported-layouts supported-formats ;
"a3" "a0" ->
"a3" "end" ->
"b3" "end" ->
"start" add-node[ "Mdiamond" =shape ];
"end" add-node[ "Msquare" =shape ];
"start" [add-node "Mdiamond" =shape ];
"end" [add-node "Msquare" =shape ];
;
: colored-circle ( i -- node )
@ -145,13 +145,13 @@ SYMBOLS: supported-layouts supported-formats ;
: colored-circles-example ( -- graph )
<graph>
graph[ "3,3" =size "circo" =layout ];
node[ "filled" =style
[graph "3,3" =size "circo" =layout ];
[node "filled" =style
"circle" =shape
"true" =fixedsize
"" =label ];
edge[ "invis" =style ];
0 add-node[ "invis" =style "none" =shape ];
[edge "invis" =style ];
0 [add-node "invis" =style "none" =shape ];
16 iota [
[ 0 -- ] [ colored-circle add ] bi
] each ;
@ -160,87 +160,87 @@ SYMBOLS: supported-layouts supported-formats ;
<digraph>
"LR" =rankdir
"8,5" =size
node[ "doublecircle" =shape ];
[node "doublecircle" =shape ];
{ "LR_0" "LR_3" "LR_4" "LR_8" } add-nodes
node[ "circle" =shape ];
"LR_0" "LR_2" ->[ "SS(B)" =label ];
"LR_0" "LR_1" ->[ "SS(S)" =label ];
"LR_1" "LR_3" ->[ "S($end)" =label ];
"LR_2" "LR_6" ->[ "SS(b)" =label ];
"LR_2" "LR_5" ->[ "SS(a)" =label ];
"LR_2" "LR_4" ->[ "S(A)" =label ];
"LR_5" "LR_7" ->[ "S(b)" =label ];
"LR_5" "LR_5" ->[ "S(a)" =label ];
"LR_6" "LR_6" ->[ "S(b)" =label ];
"LR_6" "LR_5" ->[ "S(a)" =label ];
"LR_7" "LR_8" ->[ "S(b)" =label ];
"LR_7" "LR_5" ->[ "S(a)" =label ];
"LR_8" "LR_6" ->[ "S(b)" =label ];
"LR_8" "LR_5" ->[ "S(a)" =label ];
[node "circle" =shape ];
"LR_0" "LR_2" [-> "SS(B)" =label ];
"LR_0" "LR_1" [-> "SS(S)" =label ];
"LR_1" "LR_3" [-> "S($end)" =label ];
"LR_2" "LR_6" [-> "SS(b)" =label ];
"LR_2" "LR_5" [-> "SS(a)" =label ];
"LR_2" "LR_4" [-> "S(A)" =label ];
"LR_5" "LR_7" [-> "S(b)" =label ];
"LR_5" "LR_5" [-> "S(a)" =label ];
"LR_6" "LR_6" [-> "S(b)" =label ];
"LR_6" "LR_5" [-> "S(a)" =label ];
"LR_7" "LR_8" [-> "S(b)" =label ];
"LR_7" "LR_5" [-> "S(a)" =label ];
"LR_8" "LR_6" [-> "S(b)" =label ];
"LR_8" "LR_5" [-> "S(a)" =label ];
;
: record-example ( -- graph )
<digraph>
graph[ "LR" =rankdir "8,8" =size ];
node[ 8 =fontsize "record" =shape ];
[graph "LR" =rankdir "8,8" =size ];
[node 8 =fontsize "record" =shape ];
"node0" add-node[
"node0" [add-node
"<f0> 0x10ba8| <f1>" =label
];
"node1" add-node[
"node1" [add-node
"<f0> 0xf7fc4380| <f1> | <f2> |-1" =label
];
"node2" add-node[
"node2" [add-node
"<f0> 0xf7fc44b8| | |2" =label
];
"node3" add-node[
"node3" [add-node
"<f0> 3.43322790286038071e-06|44.79998779296875|0" =label
];
"node4" add-node[
"node4" [add-node
"<f0> 0xf7fc4380| <f1> | <f2> |2" =label
];
"node5" add-node[
"node5" [add-node
"<f0> (nil)| | |-1" =label
];
"node6" add-node[
"node6" [add-node
"<f0> 0xf7fc4380| <f1> | <f2> |1" =label
];
"node7" add-node[
"node7" [add-node
"<f0> 0xf7fc4380| <f1> | <f2> |2" =label
];
"node8" add-node[
"node8" [add-node
"<f0> (nil)| | |-1" =label
];
"node9" add-node[
"node9" [add-node
"<f0> (nil)| | |-1" =label
];
"node10" add-node[
"node10" [add-node
"<f0> (nil)| <f1> | <f2> |-1" =label
];
"node11" add-node[
"node11" [add-node
"<f0> (nil)| <f1> | <f2> |-1" =label
];
"node12" add-node[
"node12" [add-node
"<f0> 0xf7fc43e0| | |1" =label
];
"node0" "node1" ->[ "f0" =tailport "f0" =headport ];
"node0" "node2" ->[ "f1" =tailport "f0" =headport ];
"node1" "node3" ->[ "f0" =tailport "f0" =headport ];
"node1" "node4" ->[ "f1" =tailport "f0" =headport ];
"node1" "node5" ->[ "f2" =tailport "f0" =headport ];
"node4" "node3" ->[ "f0" =tailport "f0" =headport ];
"node4" "node6" ->[ "f1" =tailport "f0" =headport ];
"node4" "node10" ->[ "f2" =tailport "f0" =headport ];
"node6" "node3" ->[ "f0" =tailport "f0" =headport ];
"node6" "node7" ->[ "f1" =tailport "f0" =headport ];
"node6" "node9" ->[ "f2" =tailport "f0" =headport ];
"node7" "node3" ->[ "f0" =tailport "f0" =headport ];
"node7" "node1" ->[ "f1" =tailport "f0" =headport ];
"node7" "node8" ->[ "f2" =tailport "f0" =headport ];
"node10" "node11" ->[ "f1" =tailport "f0" =headport ];
"node10" "node12" ->[ "f2" =tailport "f0" =headport ];
"node11" "node1" ->[ "f2" =tailport "f0" =headport ];
"node0" "node1" [-> "f0" =tailport "f0" =headport ];
"node0" "node2" [-> "f1" =tailport "f0" =headport ];
"node1" "node3" [-> "f0" =tailport "f0" =headport ];
"node1" "node4" [-> "f1" =tailport "f0" =headport ];
"node1" "node5" [-> "f2" =tailport "f0" =headport ];
"node4" "node3" [-> "f0" =tailport "f0" =headport ];
"node4" "node6" [-> "f1" =tailport "f0" =headport ];
"node4" "node10" [-> "f2" =tailport "f0" =headport ];
"node6" "node3" [-> "f0" =tailport "f0" =headport ];
"node6" "node7" [-> "f1" =tailport "f0" =headport ];
"node6" "node9" [-> "f2" =tailport "f0" =headport ];
"node7" "node3" [-> "f0" =tailport "f0" =headport ];
"node7" "node1" [-> "f1" =tailport "f0" =headport ];
"node7" "node8" [-> "f2" =tailport "f0" =headport ];
"node10" "node11" [-> "f1" =tailport "f0" =headport ];
"node10" "node12" [-> "f2" =tailport "f0" =headport ];
"node11" "node1" [-> "f2" =tailport "f0" =headport ];
;
:: with-global-value ( value variable quot -- )

View File

@ -4,10 +4,10 @@ USING: graphviz graphviz.attributes help.markup help.syntax
kernel present sequences ;
IN: graphviz.notation
{ add-edge add-edge[ -- ~-- --[ } related-words
{ add-edge add-edge[ -> ~-> ->[ } related-words
{ add-edge [add-edge -- ~-- [-- } related-words
{ add-edge [add-edge -> ~-> [-> } related-words
{
add-node[ add-edge[ --[ ->[ node[ edge[ graph[ ];
[add-node [add-edge [-- [-> [node [edge [graph ];
} related-words
HELP: --
@ -78,7 +78,7 @@ HELP: ->
}
;
HELP: --[
HELP: [--
{ $values
{ "tail" object }
{ "head" object }
@ -94,7 +94,7 @@ HELP: --[
"it looks better to write"
{ $code
"<graph>"
" 1 2 --[ \"red\" =color ];"
" 1 2 [-- \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
@ -105,7 +105,7 @@ HELP: --[
}
;
HELP: ->[
HELP: [->
{ $values
{ "tail" object }
{ "head" object }
@ -121,7 +121,7 @@ HELP: ->[
"it looks better to write"
{ $code
"<digraph>"
" 1 2 ->[ \"red\" =color ];"
" 1 2 [-> \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
@ -138,11 +138,11 @@ HELP: ];
{ "statement" object }
{ "graph'" { $or graph subgraph } }
}
{ $description "Synonym for " { $link add } " meant to be the \"other half\" of various " { $vocab-link "graphviz.notation" } " words like " { $links add-edge[ add-node[ graph[ } ", etc." }
{ $description "Synonym for " { $link add } " meant to be the \"other half\" of various " { $vocab-link "graphviz.notation" } " words like " { $links [add-edge [add-node [graph } ", etc." }
{ $examples "Refer to the documentation for the complementary words listed below." }
;
HELP: add-edge[
HELP: [add-edge
{ $values
{ "tail" object }
{ "head" object }
@ -158,7 +158,7 @@ HELP: add-edge[
"it looks better to write"
{ $code
"<graph>"
" 1 2 add-edge[ \"red\" =color ];"
" 1 2 [add-edge \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
@ -167,11 +167,11 @@ HELP: add-edge[
"}"
}
$nl
"This has the advantage over " { $link --[ } " and " { $link ->[ } " of reading nicely for both directed " { $emphasis "and" } " undirected " { $link graph } "s."
"This has the advantage over " { $link [-- } " and " { $link [-> } " of reading nicely for both directed " { $emphasis "and" } " undirected " { $link graph } "s."
}
;
HELP: add-node[
HELP: [add-node
{ $values
{ "id" object }
{ "node" node }
@ -186,7 +186,7 @@ HELP: add-node[
"it looks better to write"
{ $code
"<graph>"
" \"foo\" add-node[ \"red\" =color ];"
" \"foo\" [add-node \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
@ -197,7 +197,7 @@ HELP: add-node[
}
;
HELP: edge[
HELP: [edge
{ $values
{ "attrs" edge-attributes }
}
@ -211,18 +211,18 @@ HELP: edge[
"it looks better to write"
{ $code
"<graph>"
" edge[ \"red\" =color ];"
" [edge \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
"graph {"
" edge[ color=\"red\" ];"
" [edge color=\"red\" ];"
"}"
}
}
;
HELP: graph[
HELP: [graph
{ $values
{ "attrs" graph-attributes }
}
@ -237,12 +237,12 @@ HELP: graph[
"it looks better to write"
{ $code
"<graph>"
" graph[ \"LR\" =rankdir \"blah\" =label ];"
" [graph \"LR\" =rankdir \"blah\" =label ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
"graph {"
" graph[ rankdir=\"LR\" label=\"blah\" ];"
" [graph rankdir=\"LR\" label=\"blah\" ];"
"}"
}
$nl
@ -262,7 +262,7 @@ HELP: graph[
}
;
HELP: node[
HELP: [node
{ $values
{ "attrs" node-attributes }
}
@ -276,12 +276,12 @@ HELP: node[
"it looks better to write"
{ $code
"<graph>"
" node[ \"red\" =color ];"
" [node \"red\" =color ];"
}
"Compare this with the DOT language, where you'd write"
{ $code
"graph {"
" node[ color=\"red\" ];"
" [node color=\"red\" ];"
"}"
}
}
@ -425,16 +425,16 @@ $nl
}
"Notation for nodes/edges with local attributes:"
{ $subsections
add-node[
add-edge[
--[
->[
[add-node
[add-edge
[--
[->
}
"Notation for global attributes:"
{ $subsections
node[
edge[
graph[
[node
[edge
[graph
}
"Word to \"close off\" notation for attributes:"
{ $subsections

View File

@ -74,14 +74,14 @@ ALIAS: -- add-edge
ALIAS: ~-> add-path
ALIAS: ~-- add-path
ALIAS: graph[ <graph-attributes>
ALIAS: node[ <node-attributes>
ALIAS: edge[ <edge-attributes>
ALIAS: [graph <graph-attributes>
ALIAS: [node <node-attributes>
ALIAS: [edge <edge-attributes>
ALIAS: add-node[ <node>
ALIAS: add-edge[ <edge>
ALIAS: ->[ <edge>
ALIAS: --[ <edge>
ALIAS: [add-node <node>
ALIAS: [add-edge <edge>
ALIAS: [-> <edge>
ALIAS: [-- <edge>
ALIAS: ]; add