ruby-graphviz 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -0
- data/examples/sample01.rb +17 -17
- data/examples/sample02.rb +18 -18
- data/examples/sample03.rb +8 -8
- data/examples/sample04.rb +5 -5
- data/examples/sample05.rb +17 -17
- data/examples/sample07.rb +5 -5
- data/examples/sample08.rb +15 -15
- data/examples/sample09.rb +25 -25
- data/examples/sample10.rb +25 -25
- data/examples/sample11.rb +21 -21
- data/examples/sample16.rb +2 -2
- data/examples/sample17.rb +5 -5
- data/examples/sample20.rb +18 -18
- data/examples/sample29.rb +2 -2
- data/examples/sample30.rb +4 -4
- data/examples/sample31.rb +3 -3
- data/examples/sample36.rb +5 -5
- data/examples/sample37.rb +8 -8
- data/examples/sample38.rb +2 -2
- data/examples/sample39.rb +6 -6
- data/examples/sample40.rb +4 -4
- data/examples/sample42.rb +14 -14
- data/examples/sample43.rb +7 -7
- data/examples/sample44.rb +3 -3
- data/examples/sample45.rb +1 -1
- data/examples/sample46.rb +18 -18
- data/examples/sample54.rb +2 -2
- data/examples/sample55.rb +4 -4
- data/examples/sample58.rb +7 -7
- data/examples/sample60.rb +3 -3
- data/examples/sample61.rb +3 -3
- data/examples/sample62.rb +3 -3
- data/examples/sample66.rb +4 -0
- data/examples/sample67.rb +10 -0
- data/examples/sample68.rb +27 -0
- data/lib/ext/gvpr/dot2ruby.g +2 -2
- data/lib/graphviz.rb +91 -27
- data/lib/graphviz/constants.rb +1 -1
- data/lib/graphviz/core_ext.rb +0 -9
- data/lib/graphviz/dsl.rb +3 -3
- data/lib/graphviz/edge.rb +6 -6
- data/lib/graphviz/family_tree/couple.rb +8 -8
- data/lib/graphviz/family_tree/person.rb +10 -10
- data/lib/graphviz/graphml.rb +3 -3
- data/lib/graphviz/node.rb +2 -2
- data/lib/graphviz/theory.rb +37 -2
- data/lib/graphviz/xml.rb +4 -4
- data/ruby-graphviz.gemspec +2 -13
- data/test/test_graph.rb +25 -25
- data/test/test_search.rb +32 -0
- data/test/test_theory.rb +1 -1
- metadata +11 -13
data/README.rdoc
CHANGED
@@ -16,6 +16,15 @@ Interface to the GraphViz graphing tool
|
|
16
16
|
|
17
17
|
== CHANGELOG
|
18
18
|
|
19
|
+
=== 1.0.3 :
|
20
|
+
* The GraphViz::Theory#moore_dijkstra return a path which contains GraphViz::Node instead of GraphViz::Node#id
|
21
|
+
* Add Breadth First Search algorithm (GraphViz::Theory#bfs)
|
22
|
+
* Add Depth First Search algorithm (GraphViz::Theory#dfs)
|
23
|
+
* Add GraphViz#add_edges (GraphViz#add_edge is deprecated)
|
24
|
+
* Add GraphViz#add_nodes (GraphViz#add_node is deprecated)
|
25
|
+
* Add GraphViz::generate
|
26
|
+
* Remove definition of Array#all?
|
27
|
+
|
19
28
|
=== 1.0.2 :
|
20
29
|
* Add PageRank algorithm
|
21
30
|
* Major bug corrections
|
data/examples/sample01.rb
CHANGED
@@ -10,23 +10,23 @@ else
|
|
10
10
|
g = GraphViz::new( "G" )
|
11
11
|
end
|
12
12
|
|
13
|
-
main = g.
|
14
|
-
parse = g.
|
15
|
-
execute = g.
|
16
|
-
init = g.
|
17
|
-
cleanup = g.
|
18
|
-
make_string = g.
|
19
|
-
printf = g.
|
20
|
-
compare = g.
|
13
|
+
main = g.add_nodes( "main" )
|
14
|
+
parse = g.add_nodes( "parse" )
|
15
|
+
execute = g.add_nodes( "execute" )
|
16
|
+
init = g.add_nodes( "init" )
|
17
|
+
cleanup = g.add_nodes( "cleanup" )
|
18
|
+
make_string = g.add_nodes( "make_string" )
|
19
|
+
printf = g.add_nodes( "printf" )
|
20
|
+
compare = g.add_nodes( "compare" )
|
21
21
|
|
22
|
-
g.
|
23
|
-
g.
|
24
|
-
g.
|
25
|
-
g.
|
26
|
-
g.
|
27
|
-
g.
|
28
|
-
g.
|
29
|
-
g.
|
30
|
-
g.
|
22
|
+
g.add_edges( main, parse )
|
23
|
+
g.add_edges( parse, execute )
|
24
|
+
g.add_edges( main, init )
|
25
|
+
g.add_edges( main, cleanup )
|
26
|
+
g.add_edges( execute, make_string )
|
27
|
+
g.add_edges( execute, printf )
|
28
|
+
g.add_edges( init, make_string )
|
29
|
+
g.add_edges( main, printf )
|
30
|
+
g.add_edges( execute, compare )
|
31
31
|
|
32
32
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample02.rb
CHANGED
@@ -20,23 +20,23 @@ g.edge[:label] = ""
|
|
20
20
|
|
21
21
|
g[:size] = "4,4"
|
22
22
|
|
23
|
-
main = g.
|
24
|
-
parse = g.
|
25
|
-
execute = g.
|
26
|
-
init = g.
|
27
|
-
cleanup = g.
|
28
|
-
make_string = g.
|
29
|
-
printf = g.
|
30
|
-
compare = g.
|
31
|
-
|
32
|
-
g.
|
33
|
-
g.
|
34
|
-
g.
|
35
|
-
g.
|
36
|
-
g.
|
37
|
-
g.
|
38
|
-
g.
|
39
|
-
g.
|
40
|
-
g.
|
23
|
+
main = g.add_nodes( "main", :shape => "box" )
|
24
|
+
parse = g.add_nodes( "parse" )
|
25
|
+
execute = g.add_nodes( "execute" )
|
26
|
+
init = g.add_nodes( "init" )
|
27
|
+
cleanup = g.add_nodes( "cleanup" )
|
28
|
+
make_string = g.add_nodes( "make_string", :label => 'make a\nstring' )
|
29
|
+
printf = g.add_nodes( "printf" )
|
30
|
+
compare = g.add_nodes( "compare", :shape => "box", :style => "filled", :color => ".7 .3 1.0" )
|
31
|
+
|
32
|
+
g.add_edges( main, parse, :weight => "8" )
|
33
|
+
g.add_edges( parse, execute )
|
34
|
+
g.add_edges( main, init, :style => "dotted" )
|
35
|
+
g.add_edges( main, cleanup )
|
36
|
+
g.add_edges( execute, make_string )
|
37
|
+
g.add_edges( execute, printf )
|
38
|
+
g.add_edges( init, make_string )
|
39
|
+
g.add_edges( main, printf, :color => "red", :style => "bold", :label => "100 times" )
|
40
|
+
g.add_edges( execute, compare, :color => "red" )
|
41
41
|
|
42
42
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample03.rb
CHANGED
@@ -18,14 +18,14 @@ g.node["style"] = ""
|
|
18
18
|
g.node["skew"] = "0.0"
|
19
19
|
g.node["distortion"] = "0.0"
|
20
20
|
|
21
|
-
a = g.
|
22
|
-
b = g.
|
23
|
-
c = g.
|
24
|
-
d = g.
|
25
|
-
e = g.
|
21
|
+
a = g.add_nodes( "a", "shape" => "polygon", "sides" => "5", "peripheries" => "3", "color" => "lightblue", "style" => "filled" )
|
22
|
+
b = g.add_nodes( "b" )
|
23
|
+
c = g.add_nodes( "c", "shape" => "polygon", "sides" => "4", "skew" => ".4", "label" => "hello world" )
|
24
|
+
d = g.add_nodes( "d", "shape" => "invtriangle" )
|
25
|
+
e = g.add_nodes( "e", "shape" => "polygon", "sides" => "4", "distortion" => ".7" )
|
26
26
|
|
27
|
-
g.
|
28
|
-
g.
|
29
|
-
g.
|
27
|
+
g.add_edges( a, b )
|
28
|
+
g.add_edges( b, c )
|
29
|
+
g.add_edges( b, d )
|
30
30
|
|
31
31
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample04.rb
CHANGED
@@ -12,11 +12,11 @@ end
|
|
12
12
|
|
13
13
|
g.node["shape"] = "record"
|
14
14
|
|
15
|
-
struct1 = g.
|
16
|
-
struct2 = g.
|
17
|
-
struct3 = g.
|
15
|
+
struct1 = g.add_nodes( "struct1", "shape" => "record", "label" => "<f0> left|<f1> mid\ dle|<f2> right" )
|
16
|
+
struct2 = g.add_nodes( "struct2", "shape" => "record", "label" => "<f0> one|<f1> two" )
|
17
|
+
struct3 = g.add_nodes( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c|<here> d|e}| f}| g | h' )
|
18
18
|
|
19
|
-
g.
|
20
|
-
g.
|
19
|
+
g.add_edges( struct1, struct2 )
|
20
|
+
g.add_edges( struct1, struct3 )
|
21
21
|
|
22
22
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample05.rb
CHANGED
@@ -10,23 +10,23 @@ else
|
|
10
10
|
g = GraphViz::new( "structs", "type" => "graph" )
|
11
11
|
end
|
12
12
|
|
13
|
-
main = g.
|
14
|
-
parse = g.
|
15
|
-
execute = g.
|
16
|
-
init = g.
|
17
|
-
cleanup = g.
|
18
|
-
make_string = g.
|
19
|
-
printf = g.
|
20
|
-
compare = g.
|
13
|
+
main = g.add_nodes( "main" )
|
14
|
+
parse = g.add_nodes( "parse" )
|
15
|
+
execute = g.add_nodes( "execute" )
|
16
|
+
init = g.add_nodes( "init" )
|
17
|
+
cleanup = g.add_nodes( "cleanup" )
|
18
|
+
make_string = g.add_nodes( "make_string" )
|
19
|
+
printf = g.add_nodes( "printf" )
|
20
|
+
compare = g.add_nodes( "compare" )
|
21
21
|
|
22
|
-
g.
|
23
|
-
g.
|
24
|
-
g.
|
25
|
-
g.
|
26
|
-
g.
|
27
|
-
g.
|
28
|
-
g.
|
29
|
-
g.
|
30
|
-
g.
|
22
|
+
g.add_edges( main, parse )
|
23
|
+
g.add_edges( parse, execute )
|
24
|
+
g.add_edges( main, init )
|
25
|
+
g.add_edges( main, cleanup )
|
26
|
+
g.add_edges( execute, make_string )
|
27
|
+
g.add_edges( execute, printf )
|
28
|
+
g.add_edges( init, make_string )
|
29
|
+
g.add_edges( main, printf )
|
30
|
+
g.add_edges( execute, compare )
|
31
31
|
|
32
32
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample07.rb
CHANGED
@@ -13,11 +13,11 @@ g = GraphViz::new( "structs" )
|
|
13
13
|
|
14
14
|
g.node["shape"] = "record"
|
15
15
|
|
16
|
-
g.
|
17
|
-
g.
|
18
|
-
g.
|
16
|
+
g.add_nodes( "struct1", "shape" => "record", "label" => "<f0> left|<f1> middle|<f2> right" )
|
17
|
+
g.add_nodes( "struct2", "shape" => "record", "label" => "<f0> one|<f1> two" )
|
18
|
+
g.add_nodes( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c|<here> d|e}| f}| g | h' )
|
19
19
|
|
20
|
-
g.
|
21
|
-
g.
|
20
|
+
g.add_edges( { "struct1" => :f1}, {"struct2" => :f0} )
|
21
|
+
g.add_edges( {"struct1" => :f2}, {"struct3" => :here} )
|
22
22
|
|
23
23
|
g.output( :png => "#{$0}.png", :canon => nil )
|
data/examples/sample08.rb
CHANGED
@@ -14,21 +14,21 @@ g.node["shape"] = "record"
|
|
14
14
|
g.node["width"] = ".1"
|
15
15
|
g.node["height"] = ".1"
|
16
16
|
|
17
|
-
g.
|
18
|
-
g.
|
19
|
-
g.
|
20
|
-
g.
|
21
|
-
g.
|
22
|
-
g.
|
23
|
-
g.
|
24
|
-
g.
|
17
|
+
g.add_nodes( "node0", "label" => "<f0> |<f1> |<f2> |<f3> |<f4> |<f5> |<f6> |<f7> | ", "height" => "2.5" )
|
18
|
+
g.add_nodes( "node1", "label" => "{<n> n14 | 719 |<p> }", "width" => "1.5" )
|
19
|
+
g.add_nodes( "node2", "label" => "{<n> a1 | 805 |<p> }", "width" => "1.5" )
|
20
|
+
g.add_nodes( "node3", "label" => "{<n> i9 | 718 |<p> }", "width" => "1.5" )
|
21
|
+
g.add_nodes( "node4", "label" => "{<n> e5 | 989 |<p> }", "width" => "1.5" )
|
22
|
+
g.add_nodes( "node5", "label" => "{<n> t20 | 959 |<p> }", "width" => "1.5" )
|
23
|
+
g.add_nodes( "node6", "label" => "{<n> o15 | 794 |<p> }", "width" => "1.5" )
|
24
|
+
g.add_nodes( "node7", "label" => "{<n> s19 | 659 |<p> }", "width" => "1.5" )
|
25
25
|
|
26
|
-
g.
|
27
|
-
g.
|
28
|
-
g.
|
29
|
-
g.
|
30
|
-
g.
|
31
|
-
g.
|
32
|
-
g.
|
26
|
+
g.add_edges( {"node0" => :f0}, {"node1" => :n} )
|
27
|
+
g.add_edges( {"node0" => :f1}, {"node2" => :n} )
|
28
|
+
g.add_edges( {"node0" => :f2}, {"node3" => :n} )
|
29
|
+
g.add_edges( {"node0" => :f5}, {"node4" => :n} )
|
30
|
+
g.add_edges( {"node0" => :f6}, {"node5" => :n} )
|
31
|
+
g.add_edges( {"node2" => :p}, {"node6" => :n} )
|
32
|
+
g.add_edges( {"node4" => :p}, {"node7" => :n} )
|
33
33
|
|
34
34
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample09.rb
CHANGED
@@ -19,32 +19,32 @@ c0 = g.add_graph( "cluster0" )
|
|
19
19
|
c0["label"] = "process #1"
|
20
20
|
c0["style"] = "filled"
|
21
21
|
c0["color"] = "lightgrey"
|
22
|
-
a0 = c0.
|
23
|
-
a1 = c0.
|
24
|
-
a2 = c0.
|
25
|
-
a3 = c0.
|
26
|
-
c0.
|
27
|
-
c0.
|
28
|
-
c0.
|
22
|
+
a0 = c0.add_nodes( "a0", "style" => "filled", "color" => "white" )
|
23
|
+
a1 = c0.add_nodes( "a1", "style" => "filled", "color" => "white" )
|
24
|
+
a2 = c0.add_nodes( "a2", "style" => "filled", "color" => "white" )
|
25
|
+
a3 = c0.add_nodes( "a3", "style" => "filled", "color" => "white" )
|
26
|
+
c0.add_edges( a0, a1 )
|
27
|
+
c0.add_edges( a1, a2 )
|
28
|
+
c0.add_edges( a2, a3 )
|
29
29
|
|
30
30
|
c1 = g.add_graph( "cluster1", "label" => "process #2" )
|
31
|
-
b0 = c1.
|
32
|
-
b1 = c1.
|
33
|
-
b2 = c1.
|
34
|
-
b3 = c1.
|
35
|
-
c1.
|
36
|
-
c1.
|
37
|
-
c1.
|
38
|
-
|
39
|
-
start = g.
|
40
|
-
endn = g.
|
41
|
-
|
42
|
-
g.
|
43
|
-
g.
|
44
|
-
g.
|
45
|
-
g.
|
46
|
-
g.
|
47
|
-
g.
|
48
|
-
g.
|
31
|
+
b0 = c1.add_nodes( "b0", "style" => "filled", "color" => "blue" )
|
32
|
+
b1 = c1.add_nodes( "b1", "style" => "filled", "color" => "blue" )
|
33
|
+
b2 = c1.add_nodes( "b2", "style" => "filled", "color" => "blue" )
|
34
|
+
b3 = c1.add_nodes( "b3", "style" => "filled", "color" => "blue" )
|
35
|
+
c1.add_edges( b0, b1 )
|
36
|
+
c1.add_edges( b1, b2 )
|
37
|
+
c1.add_edges( b2, b3 )
|
38
|
+
|
39
|
+
start = g.add_nodes( "start", "shape" => "Mdiamond" )
|
40
|
+
endn = g.add_nodes( "end", "shape" => "Msquare" )
|
41
|
+
|
42
|
+
g.add_edges( start, a0 )
|
43
|
+
g.add_edges( start, b0 )
|
44
|
+
g.add_edges( a1, b3 )
|
45
|
+
g.add_edges( b2, a3 )
|
46
|
+
g.add_edges( a3, a0 )
|
47
|
+
g.add_edges( a3, endn )
|
48
|
+
g.add_edges( b3, endn )
|
49
49
|
|
50
50
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample10.rb
CHANGED
@@ -19,32 +19,32 @@ c0 = g.add_graph( "cluster0" )
|
|
19
19
|
c0["label"] = "process #1"
|
20
20
|
c0["style"] = "filled"
|
21
21
|
c0["color"] = "lightgrey"
|
22
|
-
a0 = c0.
|
23
|
-
a1 = c0.
|
24
|
-
a2 = c0.
|
25
|
-
a3 = c0.
|
26
|
-
c0.
|
27
|
-
c0.
|
28
|
-
c0.
|
22
|
+
a0 = c0.add_nodes( "a0", "style" => "filled", "color" => "white" )
|
23
|
+
a1 = c0.add_nodes( "a1", "style" => "filled", "color" => "white" )
|
24
|
+
a2 = c0.add_nodes( "a2", "style" => "filled", "color" => "white" )
|
25
|
+
a3 = c0.add_nodes( "a3", "style" => "filled", "color" => "white" )
|
26
|
+
c0.add_edges( a0, a1 )
|
27
|
+
c0.add_edges( a1, a2 )
|
28
|
+
c0.add_edges( a2, a3 )
|
29
29
|
|
30
30
|
c1 = g.add_graph( "cluster1", "label" => "process #2" )
|
31
|
-
b0 = c1.
|
32
|
-
b1 = c1.
|
33
|
-
b2 = c1.
|
34
|
-
b3 = c1.
|
35
|
-
c1.
|
36
|
-
c1.
|
37
|
-
c1.
|
38
|
-
|
39
|
-
start = g.
|
40
|
-
endn = g.
|
41
|
-
|
42
|
-
g.
|
43
|
-
g.
|
44
|
-
g.
|
45
|
-
g.
|
46
|
-
g.
|
47
|
-
g.
|
48
|
-
g.
|
31
|
+
b0 = c1.add_nodes( "b0", "style" => "filled", "color" => "blue" )
|
32
|
+
b1 = c1.add_nodes( "b1", "style" => "filled", "color" => "blue" )
|
33
|
+
b2 = c1.add_nodes( "b2", "style" => "filled", "color" => "blue" )
|
34
|
+
b3 = c1.add_nodes( "b3", "style" => "filled", "color" => "blue" )
|
35
|
+
c1.add_edges( b0, b1 )
|
36
|
+
c1.add_edges( b1, b2 )
|
37
|
+
c1.add_edges( b2, b3 )
|
38
|
+
|
39
|
+
start = g.add_nodes( "start", "shape" => "Mdiamond" )
|
40
|
+
endn = g.add_nodes( "end", "shape" => "Msquare" )
|
41
|
+
|
42
|
+
g.add_edges( start, a0 )
|
43
|
+
g.add_edges( start, b0 )
|
44
|
+
g.add_edges( a1, b3 )
|
45
|
+
g.add_edges( b2, a3 )
|
46
|
+
g.add_edges( a3, a0 )
|
47
|
+
g.add_edges( a3, endn )
|
48
|
+
g.add_edges( b3, endn )
|
49
49
|
|
50
50
|
g.output( :png => "#{$0}.png" )
|
data/examples/sample11.rb
CHANGED
@@ -15,28 +15,28 @@ graph.edge["lhead"] = ""
|
|
15
15
|
graph.edge["ltail"] = ""
|
16
16
|
|
17
17
|
c0 = graph.add_graph( "cluster0" )
|
18
|
-
a = c0.
|
19
|
-
b = c0.
|
20
|
-
c = c0.
|
21
|
-
d = c0.
|
22
|
-
c0.
|
23
|
-
c0.
|
24
|
-
c0.
|
25
|
-
c0.
|
18
|
+
a = c0.add_nodes( "a" )
|
19
|
+
b = c0.add_nodes( "b" )
|
20
|
+
c = c0.add_nodes( "c" )
|
21
|
+
d = c0.add_nodes( "d" )
|
22
|
+
c0.add_edges( a, b )
|
23
|
+
c0.add_edges( a, c )
|
24
|
+
c0.add_edges( b, d )
|
25
|
+
c0.add_edges( c, d )
|
26
26
|
|
27
27
|
c1 = graph.add_graph( "cluster1" )
|
28
|
-
e = c1.
|
29
|
-
f = c1.
|
30
|
-
g = c1.
|
31
|
-
c1.
|
32
|
-
c1.
|
33
|
-
|
34
|
-
h = graph.
|
35
|
-
|
36
|
-
graph.
|
37
|
-
graph.
|
38
|
-
graph.
|
39
|
-
graph.
|
40
|
-
graph.
|
28
|
+
e = c1.add_nodes( "e" )
|
29
|
+
f = c1.add_nodes( "f" )
|
30
|
+
g = c1.add_nodes( "g" )
|
31
|
+
c1.add_edges( e, g )
|
32
|
+
c1.add_edges( e, f )
|
33
|
+
|
34
|
+
h = graph.add_nodes( "h" )
|
35
|
+
|
36
|
+
graph.add_edges( b, f, "lhead" => "cluster1" )
|
37
|
+
graph.add_edges( d, e )
|
38
|
+
graph.add_edges( c, g, "ltail" => "cluster0", "lhead" => "cluster1" )
|
39
|
+
graph.add_edges( c, e, "ltail" => "cluster0" )
|
40
|
+
graph.add_edges( d, h )
|
41
41
|
|
42
42
|
graph.output( :png => "#{$0}.png" )
|
data/examples/sample16.rb
CHANGED
@@ -4,5 +4,5 @@ $:.unshift( "../lib" );
|
|
4
4
|
require "graphviz"
|
5
5
|
|
6
6
|
GraphViz::new( "G", :type => "graph", :rankdir => "LR" ) { |graph|
|
7
|
-
graph.
|
8
|
-
}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
|
7
|
+
graph.add_edges( [graph.a, graph.b, graph.c], [ graph.d, graph.e, graph.f ] )
|
8
|
+
}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
|
data/examples/sample17.rb
CHANGED
@@ -13,18 +13,18 @@ GraphViz::new( "G", :type => "graph", :rankdir => "LR", :bgcolor => "#808080" )
|
|
13
13
|
_ = {}
|
14
14
|
|
15
15
|
("1".."8").each do |v|
|
16
|
-
_[v] = graph.
|
16
|
+
_[v] = graph.add_nodes( v, :shape => "circle", :style => "invis")
|
17
17
|
end
|
18
18
|
["10","20","30","40","50","60","70","80"].each do |v|
|
19
|
-
_[v] = graph.
|
19
|
+
_[v] = graph.add_nodes( v, :shape => "circle", :style => "invis")
|
20
20
|
end
|
21
21
|
|
22
22
|
("a".."x").each do |v|
|
23
|
-
_[v] = graph.
|
23
|
+
_[v] = graph.add_nodes( v, :shape => "circle")
|
24
24
|
end
|
25
25
|
|
26
26
|
("A".."X").each do |v|
|
27
|
-
_[v] = graph.
|
27
|
+
_[v] = graph.add_nodes( v, :shape => "diamond")
|
28
28
|
end
|
29
29
|
|
30
30
|
(_["1"] << _["a"])[:color]="#0000ff"
|
@@ -89,4 +89,4 @@ GraphViz::new( "G", :type => "graph", :rankdir => "LR", :bgcolor => "#808080" )
|
|
89
89
|
_["V"] << _["60"]
|
90
90
|
_["W"] << _["70"]
|
91
91
|
_["X"] << _["80"]
|
92
|
-
}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
|
92
|
+
}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
|