Sha256: 77ca5fb01358e1815382208f3e631d89efd9d2bd772615bdee4c815e0dde3c74

Contents?: true

Size: 609 Bytes

Versions: 16

Compression:

Stored size: 609 Bytes

Contents

#!/usr/bin/ruby

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

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

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

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

g.add_edges( struct1, struct2 )
g.add_edges( struct1, struct3 )

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

Version data entries

16 entries across 16 versions & 2 rubygems

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