Sha256: d16ab78c0abbbbe3138b4652a1fd0e68573e46558aefa153e10fe877a1375abc

Contents?: true

Size: 1.14 KB

Versions: 23

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/ruby

$:.unshift( "../lib" );
require "graphviz"

g = nil
if ARGV[0]
  g = GraphViz::new( "G", "path" => ARGV[0] )
else
  g = GraphViz::new( "G" )
end

g.node["color"] = "black"

g.edge["color"] = "black"
g.edge["weight"] = "1"
g.edge["style"] = "filled"
g.edge["label"] = ""

g["size"] = "4,4"

g.node["shape"] = "box"
main        = g.add_node( "main" )
g.node["shape"] = "ellipse"
parse       = g.add_node( "parse" )
execute     = g.add_node( "execute" )
init        = g.add_node( "init" )
cleanup     = g.add_node( "cleanup" )
make_string = g.add_node( "make_string", "label" => 'make a\nstring' )
printf      = g.add_node( "printf" )
compare     = g.add_node( "compare", "shape" => "box", "style" => "filled", "color" => ".7 .3 1.0" )

g.add_edge( main, parse, "weight" => "8" )
g.add_edge( parse, execute )
g.add_edge( main, init, "style" => "dotted" )
g.add_edge( main, cleanup )
g.add_edge( execute, make_string )
g.add_edge( execute, printf )
g.add_edge( init, make_string )
g.add_edge( main, printf, "color" => "red", "style" => "bold", "label" => "100 times" )
g.add_edge( execute, compare, "color" => "red" )

g.output( :png => "#{$0}.png" )

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.2 examples/sample46.rb
ruby-graphviz-1.0.1 examples/sample46.rb
ruby-graphviz-1.0.0 examples/sample46.rb
ruby-graphviz-0.9.21 examples/sample46.rb
ruby-graphviz-0.9.20 examples/sample46.rb
ruby-graphviz-0.9.19 examples/sample46.rb
ruby-graphviz-0.9.18 examples/sample46.rb
ruby-graphviz-0.9.17 examples/sample46.rb
ruby-graphviz-0.9.16 examples/sample46.rb
ruby-graphviz-0.9.15 examples/sample46.rb
ruby-graphviz-0.9.14 examples/sample46.rb
ruby-graphviz-0.9.13 examples/sample46.rb
ruby-graphviz-0.9.12 examples/sample46.rb
ruby-graphviz-0.9.11 examples/testorder.rb
ruby-graphviz-0.9.10 examples/testorder.rb
ruby-graphviz-0.9.9 examples/testorder.rb
ruby-graphviz-0.9.8 examples/testorder.rb
ruby-graphviz-0.9.7 examples/testorder.rb
ruby-graphviz-0.9.6 examples/testorder.rb
ruby-graphviz-0.9.5 examples/testorder.rb