Sha256: fa78cc0d0fa6565da1bb404ad11d43809b85aceddb3ec76e560bb8186dc70724

Contents?: true

Size: 1.3 KB

Versions: 23

Compression:

Stored size: 1.3 KB

Contents

#!/usr/bin/ruby

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

g = nil
if ARGV[0]
  g = GraphViz::new( "G", "path" => ARGV[0] )
else
  g = GraphViz::new( "G" )
end

g["rankdir"] = "LR"
g.node["shape"] = "ellipse"
g.edge["arrowhead"] = "normal"

[
"box", 
"boxbox", 
"lbox", 
"lboxlbox", 
"rbox", 
"rboxrbox", 
"olbox", 
"olboxolbox", 
"orbox", 
"orboxorbox", 
"obox", 
"oboxobox", 
"crow", 
"crowcrow", 
"lcrow", 
"lcrowlcrow", 
"rcrow", 
"rcrowrcrow", 
"diamond", 
"diamonddiamond", 
"ldiamond", 
"ldiamondldiamond", 
"rdiamond", 
"rdiamondrdiamond", 
"oldiamond", 
"oldiamondoldiamond", 
"ordiamond", 
"ordiamondordiamond", 
"odiamond", 
"odiamondodiamond", 
"dot", 
"dotdot", 
"odot", 
"odotodot", 
"inv", 
"invinv", 
"linv", 
"linvlinv", 
"rinv", 
"rinvrinv", 
"olinv", 
"olinvolinv", 
"orinv", 
"orinvorinv", 
"oinv", 
"oinvoinv", 
"none", 
"nonenone", 
"normal", 
"normalnormal", 
"lnormal", 
"lnormallnormal", 
"rnormal", 
"rnormalrnormal", 
"olnormal", 
"olnormalolnormal", 
"ornormal", 
"ornormalornormal", 
"onormal", 
"onormalonormal", 
"tee", 
"teetee", 
"ltee", 
"lteeltee", 
"rtee", 
"rteertee", 
"vee", 
"veevee", 
"lvee", 
"lveelvee", 
"rvee", 
"rveervee" 
].each { |s|
  p = "p_" << s
  g.add_node( p, "shape" => "point" )
  g.add_node( s )
  g.add_edge( p, s, "arrowhead" => s )
}

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.2 examples/sample44.rb
ruby-graphviz-1.0.1 examples/sample44.rb
ruby-graphviz-1.0.0 examples/sample44.rb
ruby-graphviz-0.9.21 examples/sample44.rb
ruby-graphviz-0.9.20 examples/sample44.rb
ruby-graphviz-0.9.19 examples/sample44.rb
ruby-graphviz-0.9.18 examples/sample44.rb
ruby-graphviz-0.9.17 examples/sample44.rb
ruby-graphviz-0.9.16 examples/sample44.rb
ruby-graphviz-0.9.15 examples/sample44.rb
ruby-graphviz-0.9.14 examples/sample44.rb
ruby-graphviz-0.9.13 examples/sample44.rb
ruby-graphviz-0.9.12 examples/sample44.rb
ruby-graphviz-0.9.11 examples/arrowhead.rb
ruby-graphviz-0.9.10 examples/arrowhead.rb
ruby-graphviz-0.9.9 examples/arrowhead.rb
ruby-graphviz-0.9.8 examples/arrowhead.rb
ruby-graphviz-0.9.7 examples/arrowhead.rb
ruby-graphviz-0.9.6 examples/arrowhead.rb
ruby-graphviz-0.9.5 examples/arrowhead.rb