Sha256: e13423634acb94c39a7aa02c288b3eea07da890e4e52cea52ec780ba67dd11cd

Contents?: true

Size: 1.38 KB

Versions: 28

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/ruby

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

GraphViz::new( "G" ) { |graph|
  graph.node[:shape] = "ellipse"
  graph.node[:color] = "black"
  
  graph[:color] = "black"
  
  graph.cluster0( ) do |cluster|
    cluster[:label] = "process #1"
    cluster[:style] = "filled"
    cluster[:color] = "lightgrey"
    
    cluster.a0 :style => "filled", :color => "white"
    cluster.a1 :style => "filled", :color => "white"
    cluster.a2 :style => "filled", :color => "white"
    cluster.a3 :style => "filled", :color => "white"
    
    cluster.a0 << cluster.a1
    cluster.a1 << cluster.a2
    cluster.a2 << cluster.a3
  end
  
  graph.cluster1( :label => "process #2" ) do |cluster|
    cluster.b0 :style => "filled", :color => "blue"
    cluster.b1 :style => "filled", :color => "blue"
    cluster.b2 :style => "filled", :color => "blue"
    cluster.b3 :style => "filled", :color => "blue"
    
    cluster.b0 << cluster.b1
    cluster.b1 << cluster.b2
    cluster.b2 << cluster.b3
  end
  
  graph.start :shape => "Mdiamond"
  graph.endn :shape => "Msquare", :label => "end"
  
  graph.start << graph.cluster0.a0
  graph.start << graph.cluster1.b0
  graph.cluster0.a1 << graph.cluster1.b3
  graph.cluster1.b2 << graph.cluster0.a3
  graph.cluster0.a3 << graph.cluster0.a0
  graph.cluster0.a3 << graph.endn
  graph.cluster1.b3 << graph.endn
}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.7 examples/sample13.rb
ruby-graphviz-1.0.6 examples/sample13.rb
ruby-graphviz-1.0.5 examples/sample13.rb
ruby-graphviz-1.0.4 examples/sample13.rb
ruby-graphviz-1.0.3 examples/sample13.rb
ruby-graphviz-1.0.2 examples/sample13.rb
ruby-graphviz-1.0.1 examples/sample13.rb
ruby-graphviz-1.0.0 examples/sample13.rb
ruby-graphviz-0.9.21 examples/sample13.rb
ruby-graphviz-0.9.20 examples/sample13.rb
ruby-graphviz-0.9.19 examples/sample13.rb
ruby-graphviz-0.9.18 examples/sample13.rb
ruby-graphviz-0.9.17 examples/sample13.rb
ruby-graphviz-0.9.16 examples/sample13.rb
ruby-graphviz-0.9.15 examples/sample13.rb
ruby-graphviz-0.9.14 examples/sample13.rb
ruby-graphviz-0.9.13 examples/sample13.rb
ruby-graphviz-0.9.12 examples/sample13.rb
ruby-graphviz-0.9.11 examples/sample13.rb
ruby-graphviz-0.9.10 examples/sample13.rb