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-0.9.4 examples/arrowhead.rb
ruby-graphviz-0.9.3 examples/arrowhead.rb
ruby-graphviz-0.9.2 examples/arrowhead.rb