Sha256: aa214cea1d625eb475ee9eead2adb9e625728a5b7499d16fc3ce7ace86320583

Contents?: true

Size: 990 Bytes

Versions: 16

Compression:

Stored size: 990 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_nodes( "Jennifer_Aniston", :style => "filled", :color => "red" )
bp = c0.add_nodes( "Brad_Pitt", :style => "filled", :color => "white" )
aj = c0.add_nodes( "Angelina_Jolie", :style => "filled", :color => "green" )

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

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

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

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

Version data entries

16 entries across 16 versions & 2 rubygems

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