Permalink
Browse files

0.9.2

  • Loading branch information...
1 parent 19ce6a4 commit 89ad5191a175615337f86d4c2655179b5d70db42 greg committed Oct 15, 2009
@@ -1,7 +1,7 @@
$:.unshift( "../lib" );
require "graphviz"
-g = GraphViz::new( "structs", :output => "png" )
+g = GraphViz::new( "structs" )
g.node["shape"] = "plaintext"
@@ -17,4 +17,4 @@
g.add_edge( "HTML", "struct1" )
-g.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+g.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -10,5 +10,5 @@
g.get_node("World") { |n|
n.label = "Le Monde"
}
-}.output(:output => "png", :file => "sample.png")
+}.output(:png => "sample.png")
@@ -59,4 +59,4 @@
g[:overlap] = :false
g[:label] = 'PetriNet Model TrafficLights\nExtracted from ConceptBase and layed out by Graphviz'
g[:fontsize] = 12;
-}.output( :output => :png, :file => "TrafficLights.png" )
+}.output( :png => "TrafficLights.png" )
@@ -59,4 +59,4 @@
g.start[:shape] = :Mdiamond
g._end[:label] = "end"
g._end[:shape] = :Mdiamond
-}.output( :output => :png, :file => "cluster.png" )
+}.output( :png => "cluster.png" )
@@ -7,4 +7,4 @@
GraphViz::new( :G, :type => :digraph ) { |g|
g.world( :label => "World" ) << g.hello( :label => "Hello" )
-}.output( :output => :png, :file => "hello.png" )
+}.output( :png => "hello.png" )
@@ -212,4 +212,4 @@
(g._026 << g.marr0017).set { |e| e[:dir] = :none; e[:weight] = 1 }
(g._027 << g.marr0017).set { |e| e[:dir] = :none; e[:weight] = 1 }
(g.marr0017 << g._028).set { |e| e[:dir] = :none; e[:weight] = 2 }
-}.output( :output => :png, :file => "lion_share.png" )
+}.output( :png => "lion_share.png" )
@@ -34,4 +34,4 @@
g.runswap << g.runmem
g._new << g.runmem
g.sleep << g.runmem
-}.output( :output => :png, :file => "process.png", :use => :fdp )
+}.output( :png => "process.png", :use => :fdp )
View
@@ -5,9 +5,9 @@
g = nil
if ARGV[0]
- g = GraphViz::new( "G", "output" => "png", "path" => ARGV[0], :use => "circo" )
+ g = GraphViz::new( "G", "path" => ARGV[0], :use => "circo" )
else
- g = GraphViz::new( "G", "output" => "png" )
+ g = GraphViz::new( "G" )
end
c0 = g.add_graph( "cluster0" )
@@ -32,4 +32,4 @@
g.add_edge( bp, gr )
g.add_edge( gr, md )
-g.output
+g.output( :png => "p2p.png" )
@@ -9,7 +9,7 @@
GraphViz::options( :path => ARGV[0] )
end
-g = GraphViz::new( "structs", "output" => "png" )
+g = GraphViz::new( "structs" )
g.node["shape"] = "record"
@@ -20,4 +20,4 @@
g.add_edge( "struct1:f1", "struct2:f0" )
g.add_edge( "struct1:f2", "struct3:here" )
-g.output( :png => "#{$0}.png" )
+g.output( :png => "#{$0}.png", :canon => nil )
@@ -5,9 +5,9 @@
graph = nil
if ARGV[0]
- graph = GraphViz::new( "G", "output" => "png", "path" => ARGV[0] )
+ graph = GraphViz::new( "G", "path" => ARGV[0] )
else
- graph = GraphViz::new( "G", "output" => "png" )
+ graph = GraphViz::new( "G" )
end
graph["compound"] = "true"
@@ -39,4 +39,4 @@
graph.add_edge( c, e, "ltail" => "cluster0" )
graph.add_edge( d, h )
-graph.output( :file => "#{$0}.png" )
+graph.output( :png => "#{$0}.png" )
@@ -5,9 +5,9 @@
g = nil
if ARGV[0]
- g = GraphViz::new( "G", "output" => "png", "path" => ARGV[0] )
+ g = GraphViz::new( "G", "path" => ARGV[0] )
else
- g = GraphViz::new( "G", "output" => "png" )
+ g = GraphViz::new( "G" )
end
g.node[:shape] = "ellipse"
@@ -52,4 +52,4 @@
g.cluster0.a3 << g.endn
g.cluster1.b3 << g.endn
-g.output( :file => "#{$0}.png" )
+g.output( :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", "output" => "png" ) { |graph|
+GraphViz::new( "G" ) { |graph|
graph.node[:shape] = "ellipse"
graph.node[:color] = "black"
@@ -45,4 +45,4 @@
graph.cluster0.a3 << graph.cluster0.a0
graph.cluster0.a3 << graph.endn
graph.cluster1.b3 << graph.endn
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", "output" => "png" ) { |graph|
+GraphViz::new( "G" ) { |graph|
graph.node[:shape] = "ellipse"
graph.node[:color] = "black"
@@ -41,4 +41,4 @@
graph.cluster0.a3 << graph.cluster0.a0
graph.cluster0.a3 << graph.endn
graph.cluster1.b3 << graph.endn
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -6,7 +6,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", :type => "graph", :output => "png", :use => "fdp" ) { |graph|
+GraphViz::new( "G", :type => "graph", :use => "fdp" ) { |graph|
graph.e
graph.clusterA { |cA|
cA.a << cA.b
@@ -20,4 +20,4 @@
graph.clusterB.d << graph.clusterA.clusterC._d
graph.e << graph.clusterB
graph.clusterA.clusterC << graph.clusterB
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,6 +3,6 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", :type => "graph", :output => "png", :rankdir => "LR" ) { |graph|
+GraphViz::new( "G", :type => "graph", :rankdir => "LR" ) { |graph|
graph.add_edge( [graph.a, graph.b, graph.c], [ graph.d, graph.e, graph.f ] )
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", :type => "graph", :output => "png", :rankdir => "LR", :bgcolor => "#808080" ) { |graph|
+GraphViz::new( "G", :type => "graph", :rankdir => "LR", :bgcolor => "#808080" ) { |graph|
graph.edge[:dir] = "none"
graph.node[:width] = "0.3"
@@ -89,4 +89,4 @@
_["V"] << _["60"]
_["W"] << _["70"]
_["X"] << _["80"]
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "G", :output => "png", :rankdir => "LR", :size => "8,5" ) { |graph|
+GraphViz::new( "G", :rankdir => "LR", :size => "8,5" ) { |graph|
graph.node[:shape] = "doublecircle"
graph._LR_0; graph._LR_3; graph._LR_4; graph._LR_8
graph.node[:shape] = "circle"
@@ -21,4 +21,4 @@
(graph._LR_7 << graph._LR_5)[:label] = "S(a)"
(graph._LR_8 << graph._LR_6)[:label] = "S(b)"
(graph._LR_8 << graph._LR_5)[:label] = "S(a)"
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::new( "ER", :type => "graph", :output => "png", :use => "neato" ) { |graph|
+GraphViz::new( "ER", :type => "graph", :use => "neato" ) { |graph|
graph.node[:shape] = "box"
graph.course; graph.institute; graph.student
@@ -56,4 +56,4 @@
graph[:label] = "\\n\\nEntity Relation Diagram\\ndrawn by NEATO";
graph[:fontsize] = "20";
-}.output( :path => '/usr/local/bin/', :file => "#{$0}.png" )
+}.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )
@@ -3,7 +3,7 @@
$:.unshift( "../lib" );
require "graphviz"
-GraphViz::options( :output => "png", :use => "dot" )
+GraphViz::options( :use => "dot" )
if ARGV[0]
GraphViz::options( :path => ARGV[0] )
@@ -44,4 +44,4 @@
g.add_edge( g.node10(:f1), g.node11(:f0) )
g.add_edge( g.node10(:f2), g.node12(:f0) )
g.add_edge( g.node11(:f2), g.node1(:f0) )
-}.output( :file => "#{$0}.png" )
+}.output( :png => "#{$0}.png" )
@@ -4,9 +4,9 @@
require "graphviz"
{"png" => "#{$0}.png", "imap" => "#{$0}.html"}.each do |format, file|
- GraphViz::new( "G", :output => format ) { |g|
- g.command #(:URL => "http://www.research.att.com/base.html")
- g._output(:label => "output") #(:URL => "colors.html")
+ GraphViz::new( "G" ) { |g|
+ g.command(:URL => "http://www.research.att.com/base.html")
+ g._output(:label => "output", :URL => "colors.html")
g.command << g._output
- }.output( :file => file )
+ }.output( format => file )
end
View
@@ -5,9 +5,9 @@
g = nil
if ARGV[0]
- g = GraphViz::new( "G", "output" => "png", "path" => ARGV[0] )
+ g = GraphViz::new( "G", "path" => ARGV[0] )
else
- g = GraphViz::new( "G", "output" => "png" )
+ g = GraphViz::new( "G" )
end
g.node["shape"] = "ellipse"
@@ -21,4 +21,4 @@
g.add_node( s, "shape" => s )
}
-g.output( :file => "shapes.png")
+g.output( :png => "shapes.png")
@@ -5,9 +5,9 @@
g = nil
if ARGV[0]
- g = GraphViz::new( "G", "output" => "png", "path" => ARGV[0] )
+ g = GraphViz::new( "G", "path" => ARGV[0] )
else
- g = GraphViz::new( "G", "output" => "png" )
+ g = GraphViz::new( "G" )
end
g.node["color"] = "black"
@@ -40,4 +40,4 @@
g.add_edge( main, printf, "color" => "red", "style" => "bold", "label" => "100 times" )
g.add_edge( execute, compare, "color" => "red" )
-g.output( :file => "#{$0}.png" )
+g.output( :png => "#{$0}.png" )
View
@@ -4,4 +4,4 @@
require 'graphviz/xml'
gvxml = GraphViz::XML::new( "test.xml", :text => true, :attrs => true )
-gvxml.output( :output => "png", :file => "#{$0}.png", :use => "dot", :path => ARGV[0] )
+gvxml.output( :png => "#{$0}.png", :use => "dot", :path => ARGV[0] )
View
@@ -593,7 +593,11 @@ def initialize( xGraphName, *hOpt, &block )
# Escape a string to be acceptable as a node name in a graphviz input file
#
def self.escape(str) #:nodoc:
- '"' + str.gsub('"', '\\"').gsub("\n", '\\\\n') + '"'
+ if str.match( /^[a-zA-Z_]+[a-zA-Z0-9_:\.]*$/ ).nil?
+ '"' + str.gsub('"', '\\"').gsub("\n", '\\\\n') + '"'
+ else
+ str
+ end
end
def find_executable( ) #:nodoc:

0 comments on commit 89ad519

Please sign in to comment.