Sha256: 61d8f5836741b570e18d114b90e1373947b56bed30b249635ba57e528cdefe01

Contents?: true

Size: 611 Bytes

Versions: 2

Compression:

Stored size: 611 Bytes

Contents

#!/usr/bin/ruby

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

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

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()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-graphviz-0.8.1 examples/sample07.rb
ruby-graphviz-0.8.3 examples/sample07.rb