Sha256: 36f86134f51e1418b98275054ac96177138bac6e5913f1a28ebc4d2f69cb739f

Contents?: true

Size: 821 Bytes

Versions: 16

Compression:

Stored size: 821 Bytes

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.node["shape"] = "ellipse"
g.node["sides"] = "4"
g.node["peripheries"] = ""
g.node["color"] = "black"
g.node["style"] = ""
g.node["skew"] = "0.0"
g.node["distortion"] = "0.0"

a = g.add_nodes( "a", "shape" => "polygon", "sides" => "5", "peripheries" => "3", "color" => "lightblue", "style" => "filled"  )
b = g.add_nodes( "b" )
c = g.add_nodes( "c", "shape" => "polygon", "sides" => "4", "skew" => ".4", "label" => "hello world" )
d = g.add_nodes( "d", "shape" => "invtriangle" )
e = g.add_nodes( "e", "shape" => "polygon", "sides" => "4", "distortion" => ".7" )

g.add_edges( a, b )
g.add_edges( b, c )
g.add_edges( b, d )

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
ruby-graphviz-1.2.5 examples/sample03.rb
ruby-graphviz-1.2.4 examples/sample03.rb
ruby-graphviz-1.2.3 examples/sample03.rb
ruby-graphviz-1.2.2 examples/sample03.rb
ruby-graphviz-1.2.1 examples/sample03.rb
ruby-graphviz-1.2.0 examples/sample03.rb
ruby-graphviz-1.1.0 examples/sample03.rb
ruby-graphviz_c-1.1.1 examples/sample03.rb
ruby-graphviz_c-1.1.0 examples/sample03.rb
ruby-graphviz-1.0.9 examples/sample03.rb
ruby-graphviz-1.0.8 examples/sample03.rb
ruby-graphviz-1.0.7 examples/sample03.rb
ruby-graphviz-1.0.6 examples/sample03.rb
ruby-graphviz-1.0.5 examples/sample03.rb
ruby-graphviz-1.0.4 examples/sample03.rb
ruby-graphviz-1.0.3 examples/sample03.rb