File: sample39.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 (11 lines) | stat: -rw-r--r-- 266 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
$:.unshift( "../lib" );
require "graphviz"

g = GraphViz::new( "G", :type => "graph" )
n1 = g.add_nodes( "A" )
n2 = g.add_nodes( "B" )
n3 = g.add_nodes( "C" )
e1 = g.add_edges( n1, n2 )
e1[:dir] = 'forward'
e2 = g.add_edges( n1, n3 )
g.output( :png => "#{$0}.png" )