Sha256: 5e1c77549701eeb8e06d4a28f79a2953fabff166386c253b5e7248d96888cff8

Contents?: true

Size: 877 Bytes

Versions: 23

Compression:

Stored size: 877 Bytes

Contents

#!/usr/bin/ruby

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

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

graph["compound"] = "true"
graph.edge["lhead"] = ""
graph.edge["ltail"] = ""

c0 = graph.add_graph( "cluster0" )
a = c0.add_node( "a" )
b = c0.add_node( "b" )
c = c0.add_node( "c" )
d = c0.add_node( "d" )
c0.add_edge( a, b )
c0.add_edge( a, c )
c0.add_edge( b, d )
c0.add_edge( c, d )

c1 = graph.add_graph( "cluster1" )
e = c1.add_node( "e" )
f = c1.add_node( "f" )
g = c1.add_node( "g" )
c1.add_edge( e, g )
c1.add_edge( e, f )

h = graph.add_node( "h" )

graph.add_edge( b, f, "lhead" => "cluster1" )
graph.add_edge( d, e )
graph.add_edge( c, g, "ltail" => "cluster0", "lhead" => "cluster1" )
graph.add_edge( c, e, "ltail" => "cluster0" )
graph.add_edge( d, h )

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.2 examples/sample11.rb
ruby-graphviz-1.0.1 examples/sample11.rb
ruby-graphviz-1.0.0 examples/sample11.rb
ruby-graphviz-0.9.21 examples/sample11.rb
ruby-graphviz-0.9.20 examples/sample11.rb
ruby-graphviz-0.9.19 examples/sample11.rb
ruby-graphviz-0.9.18 examples/sample11.rb
ruby-graphviz-0.9.17 examples/sample11.rb
ruby-graphviz-0.9.16 examples/sample11.rb
ruby-graphviz-0.9.15 examples/sample11.rb
ruby-graphviz-0.9.14 examples/sample11.rb
ruby-graphviz-0.9.13 examples/sample11.rb
ruby-graphviz-0.9.12 examples/sample11.rb
ruby-graphviz-0.9.11 examples/sample11.rb
ruby-graphviz-0.9.10 examples/sample11.rb
ruby-graphviz-0.9.9 examples/sample11.rb
ruby-graphviz-0.9.8 examples/sample11.rb
ruby-graphviz-0.9.7 examples/sample11.rb
ruby-graphviz-0.9.6 examples/sample11.rb
ruby-graphviz-0.9.5 examples/sample11.rb