File: sample63.rb

package info (click to toggle)
ruby-graphviz 1.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,216 kB
  • sloc: ruby: 7,685; xml: 26; makefile: 17
file content (32 lines) | stat: -rw-r--r-- 596 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$:.unshift( "../lib" )
require 'graphviz/dsl'

digraph :G do
   cluster_0 do
      graph[:style => :filled, :color => :lightgrey]
      node[:style => :filled, :color => :white]
      a0 << a1 << a2 << a3
      graph[:label => "process #1"]
   end

   cluster_1 do
      node[:style => :filled]
      b0 << b1 << b2 << b3
      graph[:label => "process #2", :color => :blue]
   end

   start << a0
   start << b0
   a1 << b3
   b2 << a3
   a3 << a0
   a3 << _end
   b3 << _end

   start[:shape] = :Mdiamond
   _end[:label] = "end"
   _end[:shape] = :Mdiamond

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