Sha256: 099062cea52be4cca6e7ddc83443abd6f00ef1afc06511ecb247930e2ff87b79

Contents?: true

Size: 649 Bytes

Versions: 16

Compression:

Stored size: 649 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_nodes( "struct1", "shape" => "record", "label" => "<f0> left|<f1> middle|<f2> right" )
g.add_nodes( "struct2", "shape" => "record", "label" => "<f0> one|<f1> two" )
g.add_nodes( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c|<here> d|e}| f}| g | h' )

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

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ruby-graphviz-1.2.5 examples/sample07.rb
ruby-graphviz-1.2.4 examples/sample07.rb
ruby-graphviz-1.2.3 examples/sample07.rb
ruby-graphviz-1.2.2 examples/sample07.rb
ruby-graphviz-1.2.1 examples/sample07.rb
ruby-graphviz-1.2.0 examples/sample07.rb
ruby-graphviz-1.1.0 examples/sample07.rb
ruby-graphviz_c-1.1.1 examples/sample07.rb
ruby-graphviz_c-1.1.0 examples/sample07.rb
ruby-graphviz-1.0.9 examples/sample07.rb
ruby-graphviz-1.0.8 examples/sample07.rb
ruby-graphviz-1.0.7 examples/sample07.rb
ruby-graphviz-1.0.6 examples/sample07.rb
ruby-graphviz-1.0.5 examples/sample07.rb
ruby-graphviz-1.0.4 examples/sample07.rb
ruby-graphviz-1.0.3 examples/sample07.rb