Sha256: 88ca258739f7e564c1272baa16b3fcf593bff119fe66419e71c19efda39e6897

Contents?: true

Size: 619 Bytes

Versions: 10

Compression:

Stored size: 619 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

10 entries across 10 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.11 examples/sample07.rb
ruby-graphviz-0.9.10 examples/sample07.rb
ruby-graphviz-0.9.9 examples/sample07.rb
ruby-graphviz-0.9.8 examples/sample07.rb
ruby-graphviz-0.9.7 examples/sample07.rb
ruby-graphviz-0.9.6 examples/sample07.rb
ruby-graphviz-0.9.5 examples/sample07.rb
ruby-graphviz-0.9.4 examples/sample07.rb
ruby-graphviz-0.9.3 examples/sample07.rb
ruby-graphviz-0.9.2 examples/sample07.rb