Sha256: 15f762770b8bdd963e94eca0fdc0497ca1b8be171e3fa98ffa3445e21e34f920

Contents?: true

Size: 1.24 KB

Versions: 11

Compression:

Stored size: 1.24 KB

Contents

# http://www.graphviz.org/Gallery/directed/cluster.html
#
# digraph G {
#
# 	subgraph cluster_0 {
# 		style=filled;
# 		color=lightgrey;
# 		node [style=filled,color=white];
# 		a0 -> a1 -> a2 -> a3;
# 		label = "process #1";
# 	}
#
# 	subgraph cluster_1 {
# 		node [style=filled];
# 		b0 -> b1 -> b2 -> b3;
# 		label = "process #2";
# 		color=blue
# 	}
# 	start -> a0;
# 	start -> b0;
# 	a1 -> b3;
# 	b2 -> a3;
# 	a3 -> a0;
# 	a3 -> end;
# 	b3 -> end;
#
# 	start [shape=Mdiamond];
# 	end [shape=Msquare];
# }

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

GraphViz.new( :G, :type => :digraph ) { |g|
  g.cluster_0 { |c|
    c[:style] = :filled
    c[:color] = :lightgrey
    c.node[:style] = :filled
    c.node[:color] = :white
    c.a0 << c.a1 << c.a2 << c.a3
    c[:label] = "process #1"
  }

  g.cluster_1 { |c|
     c.node[:style] = :filled
     c.b0 << c.b1 << c.b2 << c.b3
     c[:label] = "process #1"
     c[:color] = :blue
  }

  g.start << g.cluster_0.a0
  g.start << g.cluster_1.b0
  g.cluster_0.a1 << g.cluster_1.b3
  g.cluster_1.b2 << g.cluster_0.a3
  g.cluster_0.a3 << g.cluster_0.a0
  g.cluster_0.a3 << g._end
  g.cluster_1.b3 << g._end

  g.start[:shape] = :Mdiamond
  g._end[:label] = "end"
  g._end[:shape] = :Mdiamond
}.output( :png => "#{$0}.png" )

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ruby-graphviz-1.2.5 examples/sample48.rb
ruby-graphviz-1.2.4 examples/sample48.rb
ruby-graphviz-1.2.3 examples/sample48.rb
ruby-graphviz-1.2.2 examples/sample48.rb
ruby-graphviz-1.2.1 examples/sample48.rb
ruby-graphviz-1.2.0 examples/sample48.rb
ruby-graphviz-1.1.0 examples/sample48.rb
ruby-graphviz_c-1.1.1 examples/sample48.rb
ruby-graphviz_c-1.1.0 examples/sample48.rb
ruby-graphviz-1.0.9 examples/sample48.rb
ruby-graphviz-1.0.8 examples/sample48.rb