Sha256: c00c3f1282e18d2f2599f3e32326c9d7db08ca0f559234ec4c267fe35bc0038d

Contents?: true

Size: 976 Bytes

Versions: 13

Compression:

Stored size: 976 Bytes

Contents

#!/usr/bin/ruby

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

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

c0 = g.add_graph( "cluster0" )
c0["label"] = "Environnement de Brad !"
c0["style"] = "filled"
c0["color"] = "blue"

ja = c0.add_node( "Jennifer_Aniston", :style => "filled", :color => "red" )
bp = c0.add_node( "Brad_Pitt", :style => "filled", :color => "white" )
aj = c0.add_node( "Angelina_Jolie", :style => "filled", :color => "green" )

c0.add_edge( ja, bp ) # On ete mariƩs
c0.add_edge( bp, aj ) # Sont ensemble

jv = g.add_node( "John_Voight", :label => "John Voight", :shape => "rectangle" )
md = g.add_node( "Madonna" )
gr = g.add_node( "Guy_Ritchie" )

g.add_edge( aj, jv ) # est la fille de
g.add_edge( jv, aj ) # est le pere de
g.add_edge( bp, jv, :color => "red", :label => "Est le beau fils de" ) # Beau fils
g.add_edge( bp, gr )
g.add_edge( gr, md )

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.2 examples/sample42.rb
ruby-graphviz-1.0.1 examples/sample42.rb
ruby-graphviz-1.0.0 examples/sample42.rb
ruby-graphviz-0.9.21 examples/sample42.rb
ruby-graphviz-0.9.20 examples/sample42.rb
ruby-graphviz-0.9.19 examples/sample42.rb
ruby-graphviz-0.9.18 examples/sample42.rb
ruby-graphviz-0.9.17 examples/sample42.rb
ruby-graphviz-0.9.16 examples/sample42.rb
ruby-graphviz-0.9.15 examples/sample42.rb
ruby-graphviz-0.9.14 examples/sample42.rb
ruby-graphviz-0.9.13 examples/sample42.rb
ruby-graphviz-0.9.12 examples/sample42.rb