ruby-graphviz 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/README +5 -38
- data/bin/{ruby2gv.rb → ruby2gv} +3 -3
- data/examples/s10.png +0 -0
- data/examples/s12.png +0 -0
- data/examples/s13.png +0 -0
- data/examples/s14.png +0 -0
- data/examples/sample-dsl-10.rb +33 -0
- data/examples/sample10.rb +2 -2
- data/examples/sample12.rb +9 -18
- data/examples/sample13.rb +48 -0
- data/examples/sample14.rb +44 -0
- data/lib/graphviz.rb +26 -8
- data/lib/graphviz/constants.rb +156 -320
- data/lib/graphviz/node.rb +5 -1
- metadata +13 -6
data/ChangeLog
CHANGED
data/README
CHANGED
@@ -1,46 +1,13 @@
|
|
1
|
-
Ruby/GraphViz
|
1
|
+
Ruby/GraphViz
|
2
2
|
|
3
|
-
Copyright (C) 2004 Gregoire Lejeune
|
3
|
+
Copyright (C) 2004, 2005, 2006, 2007, 2008 Gregoire Lejeune
|
4
4
|
|
5
|
-
Ruby/
|
5
|
+
Ruby/GraphViz is freely distributable according to the terms of the
|
6
6
|
GNU General Public License (see the file 'COPYING').
|
7
7
|
|
8
8
|
This program is distributed without any warranty. See the file
|
9
9
|
'COPYING' for details.
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
Ruby-GraphViz - Interface to the GraphViz graphing tool
|
14
|
-
|
15
|
-
This modules provides an interface to layout and generate images of
|
16
|
-
directed graphs in a variety of formats (PostScript, PNG, etc.) using
|
17
|
-
GraphViz.
|
18
|
-
|
19
|
-
This module require GraphViz version 1.10 (or higher)
|
20
|
-
|
21
|
-
+-----------------------------------------------------+
|
22
|
-
| CAUTION: You must uninstall Ruby/Graphviz 0.1.0 !!! |
|
23
|
-
+-----------------------------------------------------+
|
24
|
-
|
25
|
-
---
|
26
|
-
|
27
|
-
ChangeLog :
|
28
|
-
|
29
|
-
0.6.0 :
|
30
|
-
* Add undirected graph support
|
31
|
-
|
32
|
-
0.5.0 :
|
33
|
-
* Preserve the original order of creation of nodes and edges
|
34
|
-
|
35
|
-
0.4.0 :
|
36
|
-
* Add HTML-Labels
|
37
|
-
|
38
|
-
0.3.0 :
|
39
|
-
* Bugs corrections
|
40
|
-
|
41
|
-
0.2.0 :
|
42
|
-
* Pure ruby
|
43
|
-
|
44
|
-
0.1.0 :
|
45
|
-
* Initial version
|
11
|
+
= Examples
|
46
12
|
|
13
|
+
see http://ruby-asp.rubyforge.org/svn/trunk/ruby-graphviz/examples/
|
data/bin/{ruby2gv.rb → ruby2gv}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
# Copyright (C) 2005, 2006, 2007 Gregoire Lejeune <gregoire.lejeune@free.fr>
|
3
3
|
#
|
4
4
|
# This program is free software; you can redistribute it and/or modify
|
@@ -17,10 +17,10 @@
|
|
17
17
|
|
18
18
|
require 'getoptlong'
|
19
19
|
require 'graphviz'
|
20
|
+
require "graphviz/constants"
|
20
21
|
require 'rbconfig'
|
21
22
|
|
22
23
|
DEBUG = false
|
23
|
-
RGV_VERSION = "0.7.0"
|
24
24
|
|
25
25
|
class Rb2Gv
|
26
26
|
REQUIRE = /^\s*require\s*("|')([^\1]*)(\1)/
|
@@ -131,7 +131,7 @@ def usage
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def version
|
134
|
-
puts "Ruby2GraphViz v#{RGV_VERSION}, (c)2005 Gregoire Lejeune <gregoire.lejeune@free.fr>"
|
134
|
+
puts "Ruby2GraphViz v#{Constants::RGV_VERSION}, (c)2005 Gregoire Lejeune <gregoire.lejeune@free.fr>"
|
135
135
|
puts ""
|
136
136
|
puts "This program is free software; you can redistribute it and/or modify"
|
137
137
|
puts "it under the terms of the GNU General Public License as published by"
|
data/examples/s10.png
ADDED
Binary file
|
data/examples/s12.png
ADDED
Binary file
|
data/examples/s13.png
ADDED
Binary file
|
data/examples/s14.png
ADDED
Binary file
|
@@ -0,0 +1,33 @@
|
|
1
|
+
$:.unshift( "../lib" );
|
2
|
+
require "graphviz"
|
3
|
+
|
4
|
+
g = GraphViz::new( :path => ARGV[0] )
|
5
|
+
|
6
|
+
g.digraph :G {
|
7
|
+
|
8
|
+
subgraph :cluster_0 {
|
9
|
+
style :filled
|
10
|
+
color :lightgrey
|
11
|
+
node :style => :filled, :color => :white
|
12
|
+
a0 << a1 << a2 << a3
|
13
|
+
label "process #1"
|
14
|
+
}
|
15
|
+
|
16
|
+
subgraph :cluster_1 {
|
17
|
+
node :style => :filled
|
18
|
+
b0 << b1 << b2 << b3
|
19
|
+
label "process #2"
|
20
|
+
color :blue
|
21
|
+
}
|
22
|
+
|
23
|
+
start << a0;
|
24
|
+
start << b0;
|
25
|
+
a1 << b3;
|
26
|
+
b2 << a3;
|
27
|
+
a3 << a0;
|
28
|
+
a3 << _end;
|
29
|
+
b3 << _end;
|
30
|
+
|
31
|
+
start :shape => :Mdiamond
|
32
|
+
_end :shape=> :Msquare
|
33
|
+
}
|
data/examples/sample10.rb
CHANGED
@@ -5,9 +5,9 @@ require "graphviz"
|
|
5
5
|
|
6
6
|
g = nil
|
7
7
|
if ARGV[0]
|
8
|
-
g = GraphViz::new( "G", "output" => "png", "
|
8
|
+
g = GraphViz::new( "G", "output" => "png", "path" => ARGV[0] )
|
9
9
|
else
|
10
|
-
g = GraphViz::new( "G", "output" => "png"
|
10
|
+
g = GraphViz::new( "G", "output" => "png" )
|
11
11
|
end
|
12
12
|
|
13
13
|
g.node["shape"] = "ellipse"
|
data/examples/sample12.rb
CHANGED
@@ -42,23 +42,14 @@ g.cluster1( :label => "process #2" ) do |cluster|
|
|
42
42
|
end
|
43
43
|
|
44
44
|
g.start :shape => "Mdiamond"
|
45
|
-
g.endn :shape => "Msquare"
|
45
|
+
g.endn :shape => "Msquare", :label => "end"
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
#g.cluster1.b3 << g.endn
|
47
|
+
g.start << g.cluster0.a0
|
48
|
+
g.start << g.cluster1.b0
|
49
|
+
g.cluster0.a1 << g.cluster1.b3
|
50
|
+
g.cluster1.b2 << g.cluster0.a3
|
51
|
+
g.cluster0.a3 << g.cluster0.a0
|
52
|
+
g.cluster0.a3 << g.endn
|
53
|
+
g.cluster1.b3 << g.endn
|
55
54
|
|
56
|
-
g.
|
57
|
-
g.add_edge( g.start, g.cluster1.b0 )
|
58
|
-
g.add_edge( g.cluster0.a1, g.cluster1.b3 )
|
59
|
-
g.add_edge( g.cluster1.b2, g.cluster0.a3 )
|
60
|
-
g.add_edge( g.cluster0.a3, g.cluster0.a0 )
|
61
|
-
g.add_edge( g.cluster0.a3, g.endn )
|
62
|
-
g.add_edge( g.cluster1.b3, g.endn )
|
63
|
-
|
64
|
-
g.output
|
55
|
+
g.output( :path => '/usr/local/graphviz-2.14/bin/' )
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift( "../lib" );
|
4
|
+
require "graphviz"
|
5
|
+
|
6
|
+
GraphViz::new( "G", "output" => "png" ) { |graph|
|
7
|
+
graph.node[:shape] = "ellipse"
|
8
|
+
graph.node[:color] = "black"
|
9
|
+
|
10
|
+
graph[:color] = "black"
|
11
|
+
|
12
|
+
graph.cluster0( ) do |cluster|
|
13
|
+
cluster[:label] = "process #1"
|
14
|
+
cluster[:style] = "filled"
|
15
|
+
cluster[:color] = "lightgrey"
|
16
|
+
|
17
|
+
cluster.a0 :style => "filled", :color => "white"
|
18
|
+
cluster.a1 :style => "filled", :color => "white"
|
19
|
+
cluster.a2 :style => "filled", :color => "white"
|
20
|
+
cluster.a3 :style => "filled", :color => "white"
|
21
|
+
|
22
|
+
cluster.a0 << cluster.a1
|
23
|
+
cluster.a1 << cluster.a2
|
24
|
+
cluster.a2 << cluster.a3
|
25
|
+
end
|
26
|
+
|
27
|
+
graph.cluster1( :label => "process #2" ) do |cluster|
|
28
|
+
cluster.b0 :style => "filled", :color => "blue"
|
29
|
+
cluster.b1 :style => "filled", :color => "blue"
|
30
|
+
cluster.b2 :style => "filled", :color => "blue"
|
31
|
+
cluster.b3 :style => "filled", :color => "blue"
|
32
|
+
|
33
|
+
cluster.b0 << cluster.b1
|
34
|
+
cluster.b1 << cluster.b2
|
35
|
+
cluster.b2 << cluster.b3
|
36
|
+
end
|
37
|
+
|
38
|
+
graph.start :shape => "Mdiamond"
|
39
|
+
graph.endn :shape => "Msquare", :label => "end"
|
40
|
+
|
41
|
+
graph.start << graph.cluster0.a0
|
42
|
+
graph.start << graph.cluster1.b0
|
43
|
+
graph.cluster0.a1 << graph.cluster1.b3
|
44
|
+
graph.cluster1.b2 << graph.cluster0.a3
|
45
|
+
graph.cluster0.a3 << graph.cluster0.a0
|
46
|
+
graph.cluster0.a3 << graph.endn
|
47
|
+
graph.cluster1.b3 << graph.endn
|
48
|
+
}.output( :path => '/usr/local/graphviz-2.14/bin/' )
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift( "../lib" );
|
4
|
+
require "graphviz"
|
5
|
+
|
6
|
+
GraphViz::new( "G", "output" => "png" ) { |graph|
|
7
|
+
graph.node[:shape] = "ellipse"
|
8
|
+
graph.node[:color] = "black"
|
9
|
+
|
10
|
+
graph[:color] = "black"
|
11
|
+
|
12
|
+
graph.cluster0( ) do |cluster|
|
13
|
+
cluster[:label] = "process #1"
|
14
|
+
cluster[:style] = "filled"
|
15
|
+
cluster[:color] = "lightgrey"
|
16
|
+
|
17
|
+
cluster.node[:style] = "filled"
|
18
|
+
cluster.node[:color] = "white"
|
19
|
+
|
20
|
+
cluster.a0 << cluster.a1
|
21
|
+
cluster.a1 << cluster.a2
|
22
|
+
cluster.a2 << cluster.a3
|
23
|
+
end
|
24
|
+
|
25
|
+
graph.cluster1( :label => "process #2", :color => "blue" ) do |cluster|
|
26
|
+
cluster.node[:style] = "filled"
|
27
|
+
cluster.node[:color] = "lightgrey"
|
28
|
+
|
29
|
+
cluster.b0 << cluster.b1
|
30
|
+
cluster.b1 << cluster.b2
|
31
|
+
cluster.b2 << cluster.b3
|
32
|
+
end
|
33
|
+
|
34
|
+
graph.start :shape => "Mdiamond"
|
35
|
+
graph.endn :shape => "Msquare", :label => "end"
|
36
|
+
|
37
|
+
graph.start << graph.cluster0.a0
|
38
|
+
graph.start << graph.cluster1.b0
|
39
|
+
graph.cluster0.a1 << graph.cluster1.b3
|
40
|
+
graph.cluster1.b2 << graph.cluster0.a3
|
41
|
+
graph.cluster0.a3 << graph.cluster0.a0
|
42
|
+
graph.cluster0.a3 << graph.endn
|
43
|
+
graph.cluster1.b3 << graph.endn
|
44
|
+
}.output( :path => '/usr/local/graphviz-2.14/bin/' )
|
data/lib/graphviz.rb
CHANGED
@@ -125,7 +125,7 @@ class GraphViz
|
|
125
125
|
return( @hoGraphs[xGraphName] )
|
126
126
|
end
|
127
127
|
|
128
|
-
def method_missing( idName, *args, &block )
|
128
|
+
def method_missing( idName, *args, &block ) #:nodoc:
|
129
129
|
xName = idName.id2name
|
130
130
|
|
131
131
|
rCod = nil
|
@@ -288,6 +288,22 @@ class GraphViz
|
|
288
288
|
end
|
289
289
|
end
|
290
290
|
|
291
|
+
def pg #:nodoc:
|
292
|
+
@oParentGraph
|
293
|
+
end
|
294
|
+
|
295
|
+
def self.commonGraph( o1, o2 ) #:nodoc:
|
296
|
+
g1 = o1.pg
|
297
|
+
g2 = o2.pg
|
298
|
+
|
299
|
+
return o1 if g1.nil?
|
300
|
+
return o2 if g2.nil?
|
301
|
+
|
302
|
+
return g1 if g1.object_id == g2.object_id
|
303
|
+
|
304
|
+
return GraphViz::commonGraph( g1, g2 )
|
305
|
+
end
|
306
|
+
|
291
307
|
def set_position( xType, xKey, xValue ) #:nodoc:
|
292
308
|
@elements_order.push( {
|
293
309
|
"type" => "#{xType}_attr",
|
@@ -312,17 +328,17 @@ class GraphViz
|
|
312
328
|
@oGraphType
|
313
329
|
|
314
330
|
#
|
315
|
-
# Create a new
|
331
|
+
# Create a new graph object
|
316
332
|
#
|
317
333
|
# Options :
|
318
|
-
# :output : Output format (Constants::FORMATS)
|
319
|
-
# :file : Output file name
|
320
|
-
# :use : Program to use (Constants::PROGRAMS)
|
334
|
+
# :output : Output format (Constants::FORMATS) (default : dot)
|
335
|
+
# :file : Output file name (default : none)
|
336
|
+
# :use : Program to use (Constants::PROGRAMS) (default : dot)
|
321
337
|
# :path : Program PATH
|
322
|
-
# :parent : Parent graph
|
323
|
-
# :type : Graph type (Constants::GRAPHTYPE)
|
338
|
+
# :parent : Parent graph (default : none)
|
339
|
+
# :type : Graph type (Constants::GRAPHTYPE) (default : digraph)
|
324
340
|
#
|
325
|
-
def initialize( xGraphName, *hOpt )
|
341
|
+
def initialize( xGraphName, *hOpt, &block )
|
326
342
|
@format = "dot"
|
327
343
|
@filename = nil
|
328
344
|
@prog = "dot"
|
@@ -371,6 +387,8 @@ class GraphViz
|
|
371
387
|
end
|
372
388
|
end
|
373
389
|
end
|
390
|
+
|
391
|
+
yield( self ) if( block )
|
374
392
|
end
|
375
393
|
|
376
394
|
def find_executable( ) #:nodoc:
|
data/lib/graphviz/constants.rb
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
16
16
|
|
17
17
|
module Constants
|
18
|
-
RGV_VERSION = "0.8.
|
18
|
+
RGV_VERSION = "0.8.3"
|
19
19
|
|
20
20
|
## Const: Output formats
|
21
21
|
FORMATS = [
|
@@ -55,337 +55,173 @@ module Constants
|
|
55
55
|
"circo"
|
56
56
|
]
|
57
57
|
|
58
|
-
## Const: type
|
58
|
+
## Const: graphs type
|
59
59
|
GRAPHTYPE = [
|
60
60
|
"digraph",
|
61
61
|
"graph"
|
62
62
|
]
|
63
63
|
|
64
|
+
def self.getAttrsFor( x )
|
65
|
+
r = []
|
66
|
+
GENCS_ATTRS.each { |k,v|
|
67
|
+
r << k if /#{x}/.match( x.to_s ) and not r.include?( k )
|
68
|
+
}
|
69
|
+
r
|
70
|
+
end
|
71
|
+
|
64
72
|
# E, N, G, S and C represent edges, nodes, the root graph, subgraphs and cluster subgraphs, respectively
|
65
73
|
GENCS_ATTRS = {
|
66
|
-
"Damping"
|
67
|
-
"K"
|
68
|
-
"URL"
|
69
|
-
"arrowhead"
|
70
|
-
"arrowsize"
|
71
|
-
"arrowtail"
|
72
|
-
"bb"
|
73
|
-
"bgcolor"
|
74
|
-
"bottomlabel"
|
75
|
-
"center"
|
76
|
-
"charset"
|
77
|
-
"clusterrank"
|
78
|
-
"color"
|
79
|
-
"colorscheme"
|
80
|
-
"comment"
|
81
|
-
"compound"
|
82
|
-
"concentrate"
|
83
|
-
"constraint"
|
84
|
-
"decorate"
|
85
|
-
"defaultdist"
|
86
|
-
"dim"
|
87
|
-
"dir"
|
88
|
-
|
89
|
-
"distortion"
|
90
|
-
"dpi"
|
91
|
-
"edgeURL"
|
92
|
-
"edgehref"
|
93
|
-
"edgetarget"
|
94
|
-
"edgetooltip"
|
95
|
-
"epsilon"
|
96
|
-
"esep"
|
97
|
-
"fillcolor"
|
98
|
-
"fixedsize"
|
99
|
-
"fontcolor"
|
100
|
-
"fontname"
|
101
|
-
"
|
102
|
-
"
|
103
|
-
"
|
104
|
-
"
|
105
|
-
"
|
106
|
-
"
|
107
|
-
"
|
108
|
-
"
|
109
|
-
"
|
110
|
-
"
|
111
|
-
"
|
112
|
-
"
|
113
|
-
"
|
114
|
-
"
|
115
|
-
"
|
116
|
-
"
|
117
|
-
"
|
118
|
-
"
|
119
|
-
"
|
120
|
-
"
|
121
|
-
"
|
122
|
-
"
|
123
|
-
"
|
124
|
-
"
|
125
|
-
"
|
126
|
-
"
|
127
|
-
"
|
128
|
-
"
|
129
|
-
"
|
130
|
-
"
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"
|
134
|
-
"
|
135
|
-
"
|
136
|
-
"
|
137
|
-
"
|
138
|
-
"
|
139
|
-
"
|
140
|
-
"
|
141
|
-
"
|
142
|
-
"
|
143
|
-
"
|
144
|
-
"
|
145
|
-
"
|
146
|
-
"
|
147
|
-
"
|
148
|
-
"
|
149
|
-
"
|
150
|
-
"
|
151
|
-
"
|
152
|
-
"
|
153
|
-
"
|
154
|
-
"
|
155
|
-
"
|
156
|
-
"
|
157
|
-
"
|
158
|
-
"
|
159
|
-
"
|
160
|
-
"
|
161
|
-
"
|
162
|
-
"
|
163
|
-
"
|
164
|
-
"
|
165
|
-
"
|
166
|
-
"
|
167
|
-
"
|
168
|
-
"
|
169
|
-
"
|
170
|
-
"
|
171
|
-
"
|
172
|
-
"
|
173
|
-
"
|
174
|
-
"
|
175
|
-
"
|
176
|
-
"
|
177
|
-
"
|
178
|
-
"
|
179
|
-
"
|
180
|
-
"
|
181
|
-
"
|
182
|
-
"
|
183
|
-
"
|
184
|
-
"
|
185
|
-
"
|
186
|
-
"
|
187
|
-
"
|
188
|
-
"
|
189
|
-
"
|
190
|
-
"
|
191
|
-
"
|
192
|
-
"
|
193
|
-
"
|
194
|
-
"
|
195
|
-
"
|
196
|
-
"
|
197
|
-
"
|
198
|
-
"
|
199
|
-
"
|
200
|
-
"
|
201
|
-
"
|
202
|
-
"
|
203
|
-
"
|
204
|
-
"
|
74
|
+
"Damping" => "G",
|
75
|
+
"K" => "GC",
|
76
|
+
"URL" => "ENGC",
|
77
|
+
"arrowhead" => "E",
|
78
|
+
"arrowsize" => "E",
|
79
|
+
"arrowtail" => "E",
|
80
|
+
"bb" => "G",
|
81
|
+
"bgcolor" => "GC",
|
82
|
+
# "bottomlabel" => "N",
|
83
|
+
"center" => "G",
|
84
|
+
"charset" => "G",
|
85
|
+
"clusterrank" => "G",
|
86
|
+
"color" => "ENC",
|
87
|
+
"colorscheme" => "ENCG",
|
88
|
+
"comment" => "ENG",
|
89
|
+
"compound" => "G",
|
90
|
+
"concentrate" => "G",
|
91
|
+
"constraint" => "E",
|
92
|
+
"decorate" => "E",
|
93
|
+
"defaultdist" => "G",
|
94
|
+
"dim" => "G",
|
95
|
+
"dir" => "E",
|
96
|
+
"diredgeconstraints" => "G",
|
97
|
+
"distortion" => "N",
|
98
|
+
"dpi" => "G",
|
99
|
+
"edgeURL" => "E",
|
100
|
+
"edgehref" => "E",
|
101
|
+
"edgetarget" => "E",
|
102
|
+
"edgetooltip" => "E",
|
103
|
+
"epsilon" => "G",
|
104
|
+
"esep" => "G",
|
105
|
+
"fillcolor" => "NC",
|
106
|
+
"fixedsize" => "N",
|
107
|
+
"fontcolor" => "ENGC",
|
108
|
+
"fontname" => "ENGC",
|
109
|
+
"fontnames" => "G",
|
110
|
+
"fontpath" => "G",
|
111
|
+
"fontsize" => "ENGC",
|
112
|
+
"group" => "N",
|
113
|
+
"headURL" => "E",
|
114
|
+
"headclip" => "E",
|
115
|
+
"headhref" => "E",
|
116
|
+
"headlabel" => "E",
|
117
|
+
"headport" => "E",
|
118
|
+
"headtarget" => "E",
|
119
|
+
"headtooltip" => "E",
|
120
|
+
"height" => "N",
|
121
|
+
"href" => "E",
|
122
|
+
"html" => "N", # API extension
|
123
|
+
"image" => "N",
|
124
|
+
"imagescale" => "N",
|
125
|
+
"label" => "ENGC",
|
126
|
+
"labelURL" => "E",
|
127
|
+
"labelangle" => "E",
|
128
|
+
"labeldistance" => "E",
|
129
|
+
"labelfloat" => "E",
|
130
|
+
"labelfontcolor" => "E",
|
131
|
+
"labelfontname" => "E",
|
132
|
+
"labelfontsize" => "E",
|
133
|
+
"labelhref" => "E",
|
134
|
+
"labeljust" => "GC",
|
135
|
+
"labelloc" => "GCN",
|
136
|
+
"labeltarget" => "E",
|
137
|
+
"labeltooltip" => "E",
|
138
|
+
"landscape" => "G",
|
139
|
+
"layer" => "EN",
|
140
|
+
"layers" => "G",
|
141
|
+
"layersep" => "G",
|
142
|
+
"len" => "E",
|
143
|
+
"levelsgap" => "G",
|
144
|
+
"lhead" => "E",
|
145
|
+
"lp" => "EGC",
|
146
|
+
"ltail" => "E",
|
147
|
+
"margin" => "NG",
|
148
|
+
"maxiter" => "G",
|
149
|
+
"mclimit" => "G",
|
150
|
+
"mindist" => "G",
|
151
|
+
"minlen" => "E",
|
152
|
+
"mode" => "G",
|
153
|
+
"model" => "G",
|
154
|
+
"mosek" => "G",
|
155
|
+
"nodesep" => "G",
|
156
|
+
"nojustify" => "GCNE",
|
157
|
+
"normalize" => "G",
|
158
|
+
"nslimit" => "G",
|
159
|
+
"nslimit1" => "G",
|
160
|
+
"ordering" => "G",
|
161
|
+
"orientation" => "NG",
|
162
|
+
"outputorder" => "G",
|
163
|
+
"overlap" => "G",
|
164
|
+
"pack" => "G",
|
165
|
+
"packmode" => "G",
|
166
|
+
"pad" => "G",
|
167
|
+
"page" => "G",
|
168
|
+
"pagedir" => "G",
|
169
|
+
"pencolor" => "C",
|
170
|
+
"penwidth" => "CNE",
|
171
|
+
"peripheries" => "NC",
|
172
|
+
"pin" => "N",
|
173
|
+
"pos" => "EN",
|
174
|
+
"quantum" => "G",
|
175
|
+
"rank" => "S",
|
176
|
+
"rankdir" => "G",
|
177
|
+
"ranksep" => "G",
|
178
|
+
"ratio" => "G",
|
179
|
+
"rects" => "N",
|
180
|
+
"regular" => "N",
|
181
|
+
"remincross" => "G",
|
182
|
+
"resolution" => "G",
|
183
|
+
"root" => "GN",
|
184
|
+
"rotate" => "G",
|
185
|
+
"samehead" => "E",
|
186
|
+
"sametail" => "E",
|
187
|
+
"samplepoints" => "G",
|
188
|
+
"searchsize" => "G",
|
189
|
+
"sep" => "G",
|
190
|
+
"shape" => "N",
|
191
|
+
"shapefile" => "N",
|
192
|
+
"showboxes" => "ENG",
|
193
|
+
"sides" => "N",
|
194
|
+
"size" => "G",
|
195
|
+
"skew" => "N",
|
196
|
+
"splines" => "G",
|
197
|
+
"start" => "G",
|
198
|
+
"style" => "ENC",
|
199
|
+
"stylesheet" => "G",
|
200
|
+
"tailURL" => "E",
|
201
|
+
"tailclip" => "E",
|
202
|
+
"tailhref" => "E",
|
203
|
+
"taillabel" => "E",
|
204
|
+
"tailport" => "E",
|
205
|
+
"tailtarget" => "E",
|
206
|
+
"tailtooltip" => "E",
|
207
|
+
"target" => "ENGC",
|
208
|
+
"tooltip" => "NEC",
|
209
|
+
# "toplabel" => "N",
|
210
|
+
"truecolor" => "G",
|
211
|
+
"vertices" => "N",
|
212
|
+
"viewport" => "G",
|
213
|
+
"voro_margin" => "G",
|
214
|
+
"weight" => "E",
|
215
|
+
"width" => "N",
|
216
|
+
"z" => "N"
|
205
217
|
}
|
206
218
|
|
207
219
|
## Const: Graph attributs
|
208
|
-
GRAPHSATTRS =
|
209
|
-
"Damping",
|
210
|
-
"K",
|
211
|
-
"URL",
|
212
|
-
"bb",
|
213
|
-
"bgcolor",
|
214
|
-
"center",
|
215
|
-
"charset",
|
216
|
-
"clusterrank",
|
217
|
-
"color",
|
218
|
-
"colorscheme",
|
219
|
-
"comment",
|
220
|
-
"compound",
|
221
|
-
"concentrate",
|
222
|
-
"defaultdist",
|
223
|
-
"dim",
|
224
|
-
"diredgeconstraints",
|
225
|
-
"dpi",
|
226
|
-
"epsilon",
|
227
|
-
"esep",
|
228
|
-
"fillcolor",
|
229
|
-
"fontcolor",
|
230
|
-
"fontname",
|
231
|
-
"fontnames",
|
232
|
-
"fontpath",
|
233
|
-
"fontsize",
|
234
|
-
"label",
|
235
|
-
"labeljust",
|
236
|
-
"labelloc",
|
237
|
-
"landscape",
|
238
|
-
"layer",
|
239
|
-
"layers",
|
240
|
-
"layersep",
|
241
|
-
"lp",
|
242
|
-
"margin",
|
243
|
-
"maxiter",
|
244
|
-
"mclimit",
|
245
|
-
"mindist",
|
246
|
-
"mode",
|
247
|
-
"model",
|
248
|
-
"mosek",
|
249
|
-
"nodesep",
|
250
|
-
"nojustify",
|
251
|
-
"normalize",
|
252
|
-
"nslimit",
|
253
|
-
"nslimit1",
|
254
|
-
"ordering",
|
255
|
-
"orientation",
|
256
|
-
"outputorder",
|
257
|
-
"overlap",
|
258
|
-
"pack",
|
259
|
-
"packmode",
|
260
|
-
"pad",
|
261
|
-
"page",
|
262
|
-
"pagedir",
|
263
|
-
"pencolor",
|
264
|
-
"peripheries",
|
265
|
-
"quantum",
|
266
|
-
"rank",
|
267
|
-
"rankdir",
|
268
|
-
"ranksep",
|
269
|
-
"ratio",
|
270
|
-
"remincross",
|
271
|
-
"resolution",
|
272
|
-
"root",
|
273
|
-
"rotate",
|
274
|
-
"samplepoints",
|
275
|
-
"searchsize",
|
276
|
-
"sep",
|
277
|
-
"showboxes",
|
278
|
-
"size",
|
279
|
-
"splines",
|
280
|
-
"start",
|
281
|
-
"style",
|
282
|
-
"stylesheet",
|
283
|
-
"target",
|
284
|
-
"tooltip",
|
285
|
-
"truecolor",
|
286
|
-
"viewport",
|
287
|
-
"voro_margin"
|
288
|
-
]
|
220
|
+
GRAPHSATTRS = Constants::getAttrsFor( :G ) + Constants::getAttrsFor( :S ) + Constants::getAttrsFor( :C )
|
289
221
|
|
290
222
|
## Const: Node attributs
|
291
|
-
NODESATTRS =
|
292
|
-
"URL",
|
293
|
-
"bottomlabel",
|
294
|
-
"color",
|
295
|
-
"colorscheme",
|
296
|
-
"comment",
|
297
|
-
"distortion",
|
298
|
-
"fillcolor",
|
299
|
-
"fixedsize",
|
300
|
-
"fontcolor",
|
301
|
-
"fontname",
|
302
|
-
"fontsize",
|
303
|
-
"group",
|
304
|
-
"height",
|
305
|
-
"label", "html",
|
306
|
-
"layer",
|
307
|
-
"margin",
|
308
|
-
"nojustify",
|
309
|
-
"orientation",
|
310
|
-
"peripheries",
|
311
|
-
"pin",
|
312
|
-
"pos",
|
313
|
-
"rects",
|
314
|
-
"regular",
|
315
|
-
"root",
|
316
|
-
"samplepoints",
|
317
|
-
"shape",
|
318
|
-
"shapefile",
|
319
|
-
"sides",
|
320
|
-
"skew",
|
321
|
-
"style",
|
322
|
-
"target",
|
323
|
-
"tooltip",
|
324
|
-
#"toplabel",
|
325
|
-
#does not appear to be an option according to attributes info
|
326
|
-
"vertices",
|
327
|
-
"width",
|
328
|
-
"z"
|
329
|
-
]
|
223
|
+
NODESATTRS = Constants::getAttrsFor( :N )
|
330
224
|
|
331
225
|
## Const: Edge attributs
|
332
|
-
EDGESATTRS =
|
333
|
-
"arrowhead",
|
334
|
-
"arrowsize",
|
335
|
-
"arrowtail",
|
336
|
-
"color",
|
337
|
-
"colorscheme",
|
338
|
-
"comment",
|
339
|
-
"constraint",
|
340
|
-
"decorate",
|
341
|
-
"dir",
|
342
|
-
"edgeURL",
|
343
|
-
"edgehref",
|
344
|
-
"edgetarget",
|
345
|
-
"edgetooltip",
|
346
|
-
"fontcolor",
|
347
|
-
"fontname",
|
348
|
-
"fontsize",
|
349
|
-
"headURL",
|
350
|
-
"headclip",
|
351
|
-
"headhref",
|
352
|
-
"headlabel",
|
353
|
-
"headport",
|
354
|
-
"headtarget",
|
355
|
-
"headtooltip",
|
356
|
-
"href",
|
357
|
-
"label",
|
358
|
-
"labelURL",
|
359
|
-
"labelangle",
|
360
|
-
"labeldistance",
|
361
|
-
"labelfloat",
|
362
|
-
"labelfontcolor",
|
363
|
-
"labelfontname",
|
364
|
-
"labelfontsize",
|
365
|
-
"labelhref",
|
366
|
-
"labeltarget",
|
367
|
-
"labeltooltip",
|
368
|
-
"layer",
|
369
|
-
"len",
|
370
|
-
"lhead",
|
371
|
-
"lp",
|
372
|
-
"ltail",
|
373
|
-
"minlen",
|
374
|
-
"nojustify",
|
375
|
-
"pos",
|
376
|
-
"samehead",
|
377
|
-
"sametail",
|
378
|
-
"showboxes",
|
379
|
-
"style",
|
380
|
-
"tailURL",
|
381
|
-
"tailclip",
|
382
|
-
"tailhref",
|
383
|
-
"taillabel",
|
384
|
-
"tailport",
|
385
|
-
"tailtarget",
|
386
|
-
"tailtooltip",
|
387
|
-
"target",
|
388
|
-
"tooltip",
|
389
|
-
"weight"
|
390
|
-
]
|
226
|
+
EDGESATTRS = Constants::getAttrsFor( :E )
|
391
227
|
end
|
data/lib/graphviz/node.rb
CHANGED
@@ -62,7 +62,11 @@ class GraphViz
|
|
62
62
|
# Create an edge between the current node and the node +oNode+
|
63
63
|
#
|
64
64
|
def <<( oNode )
|
65
|
-
return
|
65
|
+
return GraphViz::commonGraph( oNode, self ).add_edge( self, oNode )
|
66
|
+
end
|
67
|
+
|
68
|
+
def pg #:nodoc:
|
69
|
+
@oGParrent
|
66
70
|
end
|
67
71
|
|
68
72
|
def output #:nodoc:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-graphviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregoire Lejeune
|
@@ -9,14 +9,14 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-05-16 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: Ruby/Graphviz provides an interface to layout and generate images of directed graphs in a variety of formats (PostScript, PNG, etc.) using GraphViz.
|
17
17
|
email: gregoire.lejeune@free.fr
|
18
|
-
executables:
|
19
|
-
|
18
|
+
executables:
|
19
|
+
- ruby2gv
|
20
20
|
extensions: []
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
@@ -30,11 +30,16 @@ files:
|
|
30
30
|
- README
|
31
31
|
- AUTHORS
|
32
32
|
- setup.rb
|
33
|
-
- bin/ruby2gv
|
33
|
+
- bin/ruby2gv
|
34
34
|
- examples/arrowhead.rb
|
35
35
|
- examples/HTML-Labels.rb
|
36
36
|
- examples/maketest.sh
|
37
37
|
- examples/p2p.rb
|
38
|
+
- examples/s10.png
|
39
|
+
- examples/s12.png
|
40
|
+
- examples/s13.png
|
41
|
+
- examples/s14.png
|
42
|
+
- examples/sample-dsl-10.rb
|
38
43
|
- examples/sample01.rb
|
39
44
|
- examples/sample02.rb
|
40
45
|
- examples/sample03.rb
|
@@ -46,6 +51,8 @@ files:
|
|
46
51
|
- examples/sample10.rb
|
47
52
|
- examples/sample11.rb
|
48
53
|
- examples/sample12.rb
|
54
|
+
- examples/sample13.rb
|
55
|
+
- examples/sample14.rb
|
49
56
|
- examples/shapes.rb
|
50
57
|
- examples/test.xml
|
51
58
|
- examples/testorder.rb
|
@@ -83,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
90
|
requirements: []
|
84
91
|
|
85
92
|
rubyforge_project: ruby-asp
|
86
|
-
rubygems_version: 1.1.
|
93
|
+
rubygems_version: 1.1.1
|
87
94
|
signing_key:
|
88
95
|
specification_version: 2
|
89
96
|
summary: Interface to the GraphViz graphing tool
|