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

puts GraphViz.graph( :G ) { |g|
  g[:label] = "<<b>This</b> is <i>a</i> <b>test</b>>"
  n1 = g.add_nodes( "N1", :label => '<<b>node 1</b>>')
  n2 = g.add_nodes( "N2", :label => '<<b>node 2</b>>')
  g.add_edges( n1, n2, :label => '<<u>edge</u>>')
}.output( :png => "#{$0}.png", :none => String )