Skip to content

Instantly share code, notes, and snippets.

@glejeune
Created May 18, 2010 19:50
Show Gist options
  • Select an option

  • Save glejeune/405444 to your computer and use it in GitHub Desktop.

Select an option

Save glejeune/405444 to your computer and use it in GitHub Desktop.
require "rubygems"
require "graphviz"
g = GraphViz::new( "G", :type => "graph" )
n1 = g.add_node( "A" )
n2 = g.add_node( "B" )
n3 = g.add_node( "C" )
e1 = g.add_edge( n1, n2 )
e1[:dir] = 'forward'
e2 = g.add_edge( n1, n3 )
puts g.output( :png => "#{$0}.png" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment