Sha256: 975bf9b0500266716c12eb2d03f688f9fd30d6b9ed339a69911b4e49fb9b3f7d

Contents?: true

Size: 974 Bytes

Versions: 10

Compression:

Stored size: 974 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 => "p2p.png" )

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.11 examples/p2p.rb
ruby-graphviz-0.9.10 examples/p2p.rb
ruby-graphviz-0.9.9 examples/p2p.rb
ruby-graphviz-0.9.8 examples/p2p.rb
ruby-graphviz-0.9.7 examples/p2p.rb
ruby-graphviz-0.9.6 examples/p2p.rb
ruby-graphviz-0.9.5 examples/p2p.rb
ruby-graphviz-0.9.4 examples/p2p.rb
ruby-graphviz-0.9.3 examples/p2p.rb
ruby-graphviz-0.9.2 examples/p2p.rb