Sha256: 4c1742f2f0858fdfd460064970803e172f844769edac5b1985e818ecb717e092

Contents?: true

Size: 644 Bytes

Versions: 13

Compression:

Stored size: 644 Bytes

Contents

#!/usr/bin/ruby

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

GraphViz::options( :use => "dot" )

if ARGV[0]
  GraphViz::options( :path => ARGV[0] )
end

g = GraphViz::new( "structs" )

g.node["shape"] = "record"

g.add_node( "struct1", "shape" => "record", "label" => "<f0> left|<f1> middle|<f2> right" )
g.add_node( "struct2", "shape" => "record", "label" => "<f0> one|<f1> two" )
g.add_node( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c|<here> d|e}| f}| g | h' )

g.add_edge( { "struct1" => :f1}, {"struct2" => :f0} )
g.add_edge( {"struct1" => :f2}, {"struct3" => :here} )

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.2 examples/sample07.rb
ruby-graphviz-1.0.1 examples/sample07.rb
ruby-graphviz-1.0.0 examples/sample07.rb
ruby-graphviz-0.9.21 examples/sample07.rb
ruby-graphviz-0.9.20 examples/sample07.rb
ruby-graphviz-0.9.19 examples/sample07.rb
ruby-graphviz-0.9.18 examples/sample07.rb
ruby-graphviz-0.9.17 examples/sample07.rb
ruby-graphviz-0.9.16 examples/sample07.rb
ruby-graphviz-0.9.15 examples/sample07.rb
ruby-graphviz-0.9.14 examples/sample07.rb
ruby-graphviz-0.9.13 examples/sample07.rb
ruby-graphviz-0.9.12 examples/sample07.rb