ruby-graphviz 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gemrc +0 -0
- data/.gitignore +6 -0
- data/AUTHORS +3 -0
- data/Gemfile +4 -0
- data/README.rdoc +25 -45
- data/Rakefile +59 -0
- data/bin/dot2ruby +0 -0
- data/bin/gem2gv +0 -0
- data/bin/git2gv +0 -0
- data/bin/ruby2gv +0 -0
- data/bin/xml2gv +0 -0
- data/examples/sample48.rb +2 -2
- data/examples/sample62.rb +24 -0
- data/examples/sample63.rb +32 -0
- data/examples/sample64.rb +31 -0
- data/examples/sample65.rb +9 -0
- data/lib/graphviz.rb +55 -25
- data/lib/graphviz/constants.rb +103 -100
- data/lib/graphviz/core_ext.rb +57 -34
- data/lib/graphviz/dot2ruby.rb +9 -0
- data/lib/graphviz/dsl.rb +59 -0
- data/lib/graphviz/node.rb +2 -1
- data/lib/graphviz/types.rb +0 -4
- data/lib/graphviz/types/arrow_type.rb +32 -0
- data/lib/graphviz/types/color.rb +56 -0
- data/lib/graphviz/types/color_list.rb +22 -0
- data/lib/graphviz/types/esc_string.rb +5 -14
- data/lib/graphviz/types/gv_bool.rb +49 -0
- data/lib/graphviz/types/gv_double.rb +12 -2
- data/lib/graphviz/types/html_string.rb +3 -1
- data/lib/graphviz/types/lbl_string.rb +2 -1
- data/lib/graphviz/types/rect.rb +34 -0
- data/lib/graphviz/types/spline_type.rb +75 -0
- data/lib/graphviz/utils.rb +2 -2
- data/lib/graphviz/utils/colors.rb +1019 -0
- data/ruby-graphviz.gemspec +57 -0
- data/test/test_examples.rb +4 -0
- data/test/{test_init.rb → test_graph.rb} +1 -1
- data/test/test_types.rb +65 -0
- data/test/test_utils_colors.rb +57 -0
- metadata +100 -112
- data/examples/rgv/rgv.ps +0 -125
- data/examples/rgv/test_rgv.rb +0 -12
- data/examples/rgv/test_rgv.rb.ps +0 -393
- data/examples/simpsons.gv +0 -69
- data/test/output/sample01.rb.png +0 -0
- data/test/output/sample02.rb.png +0 -0
- data/test/output/sample03.rb.png +0 -0
- data/test/output/sample04.rb.png +0 -0
- data/test/output/sample05.rb.png +0 -0
- data/test/output/sample06.rb.png +0 -0
- data/test/output/sample07.rb.png +0 -0
- data/test/output/sample08.rb.png +0 -0
- data/test/output/sample09.rb.png +0 -0
- data/test/output/sample10.rb.png +0 -0
- data/test/output/sample11.rb.png +0 -0
- data/test/output/sample12.rb.png +0 -0
- data/test/output/sample13.rb.png +0 -0
- data/test/output/sample14.rb.png +0 -0
- data/test/output/sample15.rb.png +0 -0
- data/test/output/sample16.rb.png +0 -0
- data/test/output/sample17.rb.png +0 -0
- data/test/output/sample18.rb.png +0 -0
- data/test/output/sample19.rb.png +0 -0
- data/test/output/sample20.rb.png +0 -0
- data/test/output/sample21.rb.html +0 -3
- data/test/output/sample21.rb.png +0 -0
- data/test/output/sample22.rb.html +0 -5
- data/test/output/sample22.rb.png +0 -0
- data/test/output/sample23.rb.png +0 -0
- data/test/output/sample24.rb.png +0 -0
- data/test/output/sample25.rb.png +0 -0
- data/test/output/sample26.rb.png +0 -0
- data/test/output/sample28.rb.png +0 -0
- data/test/output/sample29.rb.svg +0 -21
- data/test/output/sample30.rb.ps +0 -923
- data/test/output/sample31.rb.png +0 -0
- data/test/output/sample32.rb.png +0 -0
- data/test/output/sample35.rb.gv +0 -24
- data/test/output/sample35.rb.png +0 -0
- data/test/output/sample37.rb.dot +0 -50
- data/test/output/sample37.rb.png +0 -0
- data/test/output/sample38.rb.png +0 -0
- data/test/output/sample39.rb.png +0 -0
- data/test/output/sample40.rb.png +0 -0
- data/test/output/sample41.rb.svg +0 -8
- data/test/output/sample42.rb.png +0 -0
- data/test/output/sample43.rb.png +0 -0
- data/test/output/sample44.rb.png +0 -0
- data/test/output/sample45.rb.png +0 -0
- data/test/output/sample46.rb.png +0 -0
- data/test/output/sample47.rb.png +0 -0
- data/test/output/sample48.rb.png +0 -0
- data/test/output/sample49.rb.png +0 -0
- data/test/output/sample50.rb.png +0 -0
- data/test/output/sample51.rb.png +0 -0
- data/test/output/sample52.rb.png +0 -0
- data/test/output/sample53.rb.png +0 -0
- data/test/output/sample54.rb.png +0 -0
- data/test/output/sample55.rb.png +0 -0
- data/test/output/sample56.rb.svg +0 -28
- data/test/output/sample58.rb.png +0 -0
- data/test/output/sample59.rb.png +0 -0
- data/test/output/sample60.rb.png +0 -0
- data/test/output/sample61.rb.png +0 -0
- data/test/output/sample99.rb.png +0 -0
data/.gemrc
ADDED
File without changes
|
data/.gitignore
ADDED
data/AUTHORS
CHANGED
@@ -12,6 +12,9 @@ Nigel Thorne <http://github.com/NigelThorne>
|
|
12
12
|
Rolf Timmermans <http://github.com/rolftimmermans>
|
13
13
|
Jonas Elfström <http://github.com/jonelf>
|
14
14
|
oupo <http://github.com/oupo>
|
15
|
+
Daniel Zollinger <https://github.com/dznz>
|
16
|
+
Ronen Barzel <https://github.com/ronen>
|
17
|
+
Jamison Dance <https://github.com/jergason>
|
15
18
|
|
16
19
|
Thanks to :
|
17
20
|
|
data/Gemfile
ADDED
data/README.rdoc
CHANGED
@@ -14,21 +14,19 @@ Interface to the GraphViz graphing tool
|
|
14
14
|
|
15
15
|
* New FamilyTree
|
16
16
|
|
17
|
-
== WARNING
|
18
|
-
|
19
|
-
<b>We are close to the 1.0 version... So if you use one of the following method or attribut, please update your code because they will be remove.</b>
|
20
|
-
|
21
|
-
* GraphViz::Node#name must be replaced by GraphViz::Node#id
|
22
|
-
* The html attribut must be replaced by a label attribut (<tt>:label => '<<html/>>'</tt>)
|
23
|
-
* :output option must be replaced by :<format> => :<file>
|
24
|
-
* :file option must be replaced by :<format> => :<file>
|
25
|
-
|
26
17
|
== CHANGELOG
|
27
18
|
|
19
|
+
=== 1.0.1 :
|
20
|
+
* Add GraphViz::DSL
|
21
|
+
* Change project to use Bundler gem tools
|
22
|
+
* Fix a few typos in the README
|
23
|
+
* Change Config to RbConfig
|
24
|
+
* Add possibility to get the x,y coordinates of each of the nodes
|
25
|
+
|
28
26
|
=== 1.0.0 :
|
29
27
|
* \o/
|
30
28
|
* GraphViz::Node#name has been removed - use GraphViz::Node#id
|
31
|
-
* The html
|
29
|
+
* The html attribute has been removed - use a label attribut (<tt>:label => '<<html/>>'</tt>)
|
32
30
|
* :output option has been removed - use :<format> => :<file>
|
33
31
|
* :file option has been removed - use :<format> => :<file>
|
34
32
|
* Add GraphViz#to_s
|
@@ -37,7 +35,7 @@ Interface to the GraphViz graphing tool
|
|
37
35
|
* Issue #22 : Error when generating a graph with an ID containing a space.
|
38
36
|
|
39
37
|
=== 0.9.21 :
|
40
|
-
* Add
|
38
|
+
* Add attributes "label_scheme" and "rotation"
|
41
39
|
* Add missing options :
|
42
40
|
* <tt>:scale => v</tt> : Scale input by 'v' (=72)
|
43
41
|
* <tt>:inverty => [true|false]</tt> : Invert y coordinate in output
|
@@ -263,6 +261,15 @@ The same but with a block
|
|
263
261
|
g.world( :label => "World" ) << g.hello( :label => "Hello" )
|
264
262
|
}.output( :png => "hello_world.png" )
|
265
263
|
|
264
|
+
Or with the DSL
|
265
|
+
|
266
|
+
require 'graphviz/dsl'
|
267
|
+
digraph :G do
|
268
|
+
world[:label => "World"] << hello[:label => "Hello"]
|
269
|
+
|
270
|
+
output :png => "hello_world.png"
|
271
|
+
end
|
272
|
+
|
266
273
|
Create a graph from a file
|
267
274
|
|
268
275
|
require 'graphviz'
|
@@ -286,47 +293,20 @@ GraphML[http://graphml.graphdrawing.org/] support
|
|
286
293
|
g = GraphViz::GraphML.new( "graphml/cluster.graphml" )
|
287
294
|
g.graph.output( :path => "/usr/local/bin", :png => "#{$0}.png" )
|
288
295
|
|
289
|
-
At last, you can create familly tree with GraphViz::FamilyTree (<b>beta</b>) :
|
290
|
-
|
291
|
-
require 'graphviz/family_tree'
|
292
|
-
|
293
|
-
tree = GraphViz::FamilyTree.new do
|
294
|
-
generation do
|
295
|
-
benoist.is_a_man( "Benoist" )
|
296
|
-
nathalie.is_a_woman( "Nathalie" )
|
297
|
-
|
298
|
-
benoist.is_maried_with nathalie
|
299
|
-
end
|
300
|
-
|
301
|
-
generation do
|
302
|
-
charlotte.is_a_woman( "Charlotte" )
|
303
|
-
amelie.is_a_woman( "Amelie" )
|
304
|
-
clement.is_a_man( "Clement" )
|
305
|
-
gregoire.is_a_man( "Gregoire" )
|
306
|
-
|
307
|
-
muriel.is_a_woman( "Muriel" )
|
308
|
-
|
309
|
-
gregoire.is_maried_with muriel
|
310
|
-
end
|
311
|
-
|
312
|
-
couple( benoist, nathalie ).kids( charlotte, amelie, clement, gregoire )
|
313
|
-
end
|
314
|
-
|
315
|
-
tree.graph.save( :png => "#{$0}.png" )
|
316
296
|
|
317
297
|
== TOOLS
|
318
298
|
|
319
|
-
Ruby/GraphViz also
|
299
|
+
Ruby/GraphViz also includes :
|
320
300
|
|
321
|
-
* <tt>ruby2gv</tt>, a simple tool that
|
301
|
+
* <tt>ruby2gv</tt>, a simple tool that allows you to create a dependency graph from a ruby script. Example : http://drp.ly/dShaZ
|
322
302
|
|
323
303
|
ruby2gv -Tpng -oruby2gv.png ruby2gv
|
324
304
|
|
325
|
-
* <tt>gem2gv</tt>, a
|
305
|
+
* <tt>gem2gv</tt>, a tool that allows you to create a dependency graph between gems. Example : http://drp.ly/dSj9Y
|
326
306
|
|
327
307
|
gem2gv -Tpng -oruby-graphviz.png ruby-graphviz
|
328
308
|
|
329
|
-
* <tt>dot2ruby</tt>, a
|
309
|
+
* <tt>dot2ruby</tt>, a tool that allows you to create a ruby script from a graphviz script
|
330
310
|
|
331
311
|
$ cat hello.dot
|
332
312
|
digraph G {Hello->World;}
|
@@ -344,9 +324,9 @@ Ruby/GraphViz also include :
|
|
344
324
|
}
|
345
325
|
puts graph_g.output( :canon => String )
|
346
326
|
|
347
|
-
* <tt>git2gv</tt>, a
|
327
|
+
* <tt>git2gv</tt>, a tool that allows you to show your git commits : http://dl.dropbox.com/u/72629/ruby-graphviz-git.svg
|
348
328
|
|
349
|
-
* <tt>xml2gv</tt>, a
|
329
|
+
* <tt>xml2gv</tt>, a tool that allows you to show a xml file as graph.
|
350
330
|
|
351
331
|
== GRAPH THEORY
|
352
332
|
|
@@ -395,7 +375,7 @@ Ruby/GraphViz also include :
|
|
395
375
|
|
396
376
|
sudo gem install ruby-graphviz
|
397
377
|
|
398
|
-
You also need to install GraphViz[http://www.graphviz.org]
|
378
|
+
You also need to install GraphViz[http://www.graphviz.org]
|
399
379
|
|
400
380
|
On *Windows* you also need to install win32-open3. This is not an absolute requirement.
|
401
381
|
|
data/Rakefile
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
$:.unshift( "lib" )
|
2
|
+
require "graphviz/constants"
|
3
|
+
|
4
|
+
require 'rake/clean'
|
5
|
+
require 'bundler'
|
6
|
+
require 'rubygems/package_task'
|
7
|
+
require 'rdoc/task'
|
8
|
+
require 'rake/testtask'
|
9
|
+
require 'fileutils'
|
10
|
+
require 'open-uri'
|
11
|
+
include FileUtils
|
12
|
+
|
13
|
+
CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log']
|
14
|
+
RDOC_OPTS = ['--quiet', '--title', "Ruby/GraphViz, the Documentation",
|
15
|
+
"--opname", "index.html",
|
16
|
+
"--line-numbers",
|
17
|
+
"--main", "README.rdoc"]
|
18
|
+
|
19
|
+
desc "Packages up Ruby/GraphViz."
|
20
|
+
task :default => [:test, :package]
|
21
|
+
task :package => [:clean]
|
22
|
+
|
23
|
+
task :doc => :rdoc
|
24
|
+
|
25
|
+
RDoc::Task.new do |rdoc|
|
26
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
27
|
+
rdoc.options += RDOC_OPTS
|
28
|
+
rdoc.main = "README.rdoc"
|
29
|
+
rdoc.title = "Ruby/GraphViz, the Documentation"
|
30
|
+
rdoc.rdoc_files.add ['README.rdoc', 'AUTHORS', 'COPYING',
|
31
|
+
'lib/graphviz.rb',
|
32
|
+
'lib/graphviz/node.rb',
|
33
|
+
'lib/graphviz/edge.rb',
|
34
|
+
'lib/graphviz/constants.rb',
|
35
|
+
'lib/graphviz/xml.rb',
|
36
|
+
'lib/graphviz/graphml.rb',
|
37
|
+
'lib/graphviz/family_tree.rb',
|
38
|
+
'lib/graphviz/family_tree/couple.rb',
|
39
|
+
'lib/graphviz/family_tree/generation.rb',
|
40
|
+
'lib/graphviz/family_tree/person.rb',
|
41
|
+
'lib/graphviz/family_tree/sibling.rb']
|
42
|
+
end
|
43
|
+
|
44
|
+
Rake::TestTask.new(:test) do |t|
|
45
|
+
t.test_files = FileList['test/test_*.rb']
|
46
|
+
end
|
47
|
+
|
48
|
+
Bundler::GemHelper.install_tasks
|
49
|
+
|
50
|
+
namespace :gemcutter do
|
51
|
+
desc "check gemcutter status"
|
52
|
+
task :status do
|
53
|
+
if Rubygems.status
|
54
|
+
puts "This gem already existe in version #{PKG_VERS}!"
|
55
|
+
else
|
56
|
+
puts "This gem (#{Constants::RGV_VERSION}) has not been published! Last version at gemcutter is #{Rubygems.version}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/bin/dot2ruby
CHANGED
File without changes
|
data/bin/gem2gv
CHANGED
File without changes
|
data/bin/git2gv
CHANGED
File without changes
|
data/bin/ruby2gv
CHANGED
File without changes
|
data/bin/xml2gv
CHANGED
File without changes
|
data/examples/sample48.rb
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
# end [shape=Msquare];
|
29
29
|
# }
|
30
30
|
|
31
|
-
$:.unshift( "
|
31
|
+
$:.unshift( "../lib" );
|
32
32
|
require "graphviz"
|
33
33
|
|
34
34
|
GraphViz.new( :G, :type => :digraph ) { |g|
|
@@ -59,4 +59,4 @@ GraphViz.new( :G, :type => :digraph ) { |g|
|
|
59
59
|
g.start[:shape] = :Mdiamond
|
60
60
|
g._end[:label] = "end"
|
61
61
|
g._end[:shape] = :Mdiamond
|
62
|
-
}.output( :png => "#{$0}.png" )
|
62
|
+
}.output( :png => "#{$0}.png" )
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$:.unshift( "../lib" );
|
4
|
+
require "graphviz"
|
5
|
+
|
6
|
+
hello_world = GraphViz::new( "" )
|
7
|
+
|
8
|
+
hello = hello_world.add_node("Hello")
|
9
|
+
world = hello_world.add_node("World")
|
10
|
+
hello_world.add_edge(hello, world)
|
11
|
+
|
12
|
+
# final_graph = GraphViz.parse_string( hello_world.output( :dot => String ) )
|
13
|
+
# final_graph.each_node do |_, node|
|
14
|
+
# puts "Node #{node.id} : position = #{node[:pos]}"
|
15
|
+
# end
|
16
|
+
|
17
|
+
hello_world = hello_world.complete
|
18
|
+
hello_world.each_node do |_, node|
|
19
|
+
puts "Node #{node.id} : position = " ; p node[:pos].point
|
20
|
+
end
|
21
|
+
|
22
|
+
puts "---------"
|
23
|
+
|
24
|
+
puts hello_world.output( :dot => String )
|
@@ -0,0 +1,32 @@
|
|
1
|
+
$:.unshift( "../lib" )
|
2
|
+
require 'graphviz/dsl'
|
3
|
+
|
4
|
+
digraph :G do
|
5
|
+
cluster_0 do
|
6
|
+
graph[:style => :filled, :color => :lightgrey]
|
7
|
+
node[:style => :filled, :color => :white]
|
8
|
+
a0 << a1 << a2 << a3
|
9
|
+
graph[:label => "process #1"]
|
10
|
+
end
|
11
|
+
|
12
|
+
cluster_1 do
|
13
|
+
node[:style => :filled]
|
14
|
+
b0 << b1 << b2 << b3
|
15
|
+
graph[:label => "process #2", :color => :blue]
|
16
|
+
end
|
17
|
+
|
18
|
+
start << a0
|
19
|
+
start << b0
|
20
|
+
a1 << b3
|
21
|
+
b2 << a3
|
22
|
+
a3 << a0
|
23
|
+
a3 << _end
|
24
|
+
b3 << _end
|
25
|
+
|
26
|
+
start[:shape] = :Mdiamond
|
27
|
+
_end[:label] = "end"
|
28
|
+
_end[:shape] = :Mdiamond
|
29
|
+
|
30
|
+
output(:png => "#{$0}.png")
|
31
|
+
end
|
32
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
$:.unshift( "../lib" )
|
2
|
+
require 'graphviz/dsl'
|
3
|
+
|
4
|
+
digraph :G do
|
5
|
+
|
6
|
+
node[:color => :lightblue, :style => :filled, :shape => :egg]
|
7
|
+
edge[:color => :gray, :arrowhead => :vee]
|
8
|
+
|
9
|
+
e "C/C++", "Java"
|
10
|
+
|
11
|
+
java do
|
12
|
+
n("Java") << n("Groovy")
|
13
|
+
n("Java") << n("Clojure")
|
14
|
+
n("Java") << n("JRuby")
|
15
|
+
graph[:label => "Java", :color => :blue]
|
16
|
+
end
|
17
|
+
|
18
|
+
e "C/C++", "Perl"
|
19
|
+
e "Perl", "PHP"
|
20
|
+
e "Perl", "Ruby"
|
21
|
+
e "Ruby", "Rubinius"
|
22
|
+
e "Ruby", "MacRuby"
|
23
|
+
e "Ruby", "JRuby"
|
24
|
+
|
25
|
+
%w{ Ruby JRuby MacRuby Rubinius }.each do |ruby|
|
26
|
+
n(ruby)[:color => :tomato]
|
27
|
+
end
|
28
|
+
|
29
|
+
output :png => "#{$0}.png"
|
30
|
+
end
|
31
|
+
|
data/lib/graphviz.rb
CHANGED
@@ -228,31 +228,37 @@ class GraphViz
|
|
228
228
|
# * hOpts : Graph attributs
|
229
229
|
#
|
230
230
|
def add_graph( xGraphName = nil, hOpts = {}, &block )
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
231
|
+
if xGraphName.kind_of?(GraphViz)
|
232
|
+
xGraphID = xGraphName.id
|
233
|
+
@hoGraphs[xGraphID] = xGraphName.clone
|
234
|
+
xGraphName = xGraphID
|
235
|
+
else
|
236
|
+
if xGraphName.kind_of?(Hash)
|
237
|
+
hOpts = xGraphName
|
238
|
+
xGraphName = nil
|
239
|
+
end
|
235
240
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
241
|
+
if xGraphName.nil?
|
242
|
+
xGraphID = String.random(11)
|
243
|
+
xGraphName = ""
|
244
|
+
else
|
245
|
+
xGraphID = xGraphName
|
246
|
+
end
|
247
|
+
|
248
|
+
@hoGraphs[xGraphID] = GraphViz::new( xGraphName, {:parent => self, :type => @oGraphType}, &block )
|
249
|
+
|
250
|
+
hOpts.each do |xKey, xValue|
|
251
|
+
@hoGraphs[xGraphID][xKey.to_s] = xValue
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
@elements_order.push( {
|
256
|
+
"type" => "graph",
|
257
|
+
"name" => xGraphName,
|
258
|
+
"value" => @hoGraphs[xGraphID]
|
259
|
+
} )
|
260
|
+
|
261
|
+
return( @hoGraphs[xGraphID] )
|
256
262
|
end
|
257
263
|
alias :subgraph :add_graph
|
258
264
|
#
|
@@ -719,7 +725,6 @@ class GraphViz
|
|
719
725
|
|
720
726
|
## ----------------------------------------------------------------------------
|
721
727
|
|
722
|
-
#
|
723
728
|
# Create a new graph from a GraphViz File
|
724
729
|
#
|
725
730
|
# Options :
|
@@ -734,6 +739,31 @@ class GraphViz
|
|
734
739
|
return graph
|
735
740
|
end
|
736
741
|
|
742
|
+
# Create a new graph from a GraphViz File
|
743
|
+
#
|
744
|
+
# Options :
|
745
|
+
# * :output : Output format (Constants::FORMATS) (default : dot)
|
746
|
+
# * :file : Output file name (default : none)
|
747
|
+
# * :use : Program to use (Constants::PROGRAMS) (default : dot)
|
748
|
+
# * :path : Program PATH
|
749
|
+
#
|
750
|
+
def self.parse_string( str, hOpts = {}, &block )
|
751
|
+
graph = Dot2Ruby::new( hOpts[:path], nil, nil ).eval_string( str )
|
752
|
+
yield( graph ) if( block and graph.nil? == false )
|
753
|
+
return graph
|
754
|
+
end
|
755
|
+
|
756
|
+
# Return a new completed graph
|
757
|
+
def complete
|
758
|
+
GraphViz.parse_string( root_graph.output( :dot => String ) )
|
759
|
+
end
|
760
|
+
|
761
|
+
# Complete the current graph
|
762
|
+
def complete!
|
763
|
+
# TODO: Keep options
|
764
|
+
complete
|
765
|
+
end
|
766
|
+
|
737
767
|
## ----------------------------------------------------------------------------
|
738
768
|
|
739
769
|
private
|
data/lib/graphviz/constants.rb
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
# C => cluster
|
41
41
|
#
|
42
42
|
module Constants
|
43
|
-
RGV_VERSION = "1.0.
|
43
|
+
RGV_VERSION = "1.0.1"
|
44
44
|
|
45
45
|
## Const: Output formats
|
46
46
|
FORMATS = [
|
@@ -120,156 +120,159 @@ module Constants
|
|
120
120
|
"Damping" => { :usedBy => "G", :type => :GvDouble },
|
121
121
|
"K" => { :usedBy => "GC", :type => :GvDouble },
|
122
122
|
"URL" => { :usedBy => "ENGC", :type => :EscString },
|
123
|
-
"
|
123
|
+
"area" => { :usedBy => "NC", :type => :GvDouble },
|
124
|
+
"arrowhead" => { :usedBy => "E", :type => :ArrowType }, # arrowType
|
124
125
|
"arrowsize" => { :usedBy => "E", :type => :GvDouble },
|
125
|
-
"arrowtail" => { :usedBy => "E", :type => :
|
126
|
-
"aspect" => { :usedBy => "G", :type => :EscString },
|
127
|
-
"bb" => { :usedBy => "G", :type => :
|
128
|
-
"bgcolor" => { :usedBy => "GC", :type => :
|
129
|
-
"center" => { :usedBy => "G", :type => :
|
130
|
-
"charset" => { :usedBy => "G", :type => :EscString },
|
131
|
-
"clusterrank" => { :usedBy => "G", :type => :EscString },
|
132
|
-
"color" => { :usedBy => "ENC", :type => :
|
133
|
-
"colorscheme" => { :usedBy => "ENCG", :type => :EscString },
|
134
|
-
"comment" => { :usedBy => "ENG", :type => :EscString },
|
135
|
-
"compound" => { :usedBy => "G", :type => :
|
136
|
-
"concentrate" => { :usedBy => "G", :type => :
|
137
|
-
"constraint" => { :usedBy => "E", :type => :
|
138
|
-
"decorate" => { :usedBy => "E", :type => :
|
126
|
+
"arrowtail" => { :usedBy => "E", :type => :ArrowType }, # arrowType
|
127
|
+
"aspect" => { :usedBy => "G", :type => :EscString }, # aspectType
|
128
|
+
"bb" => { :usedBy => "G", :type => :Rect }, # rect
|
129
|
+
"bgcolor" => { :usedBy => "GC", :type => :Color }, # color
|
130
|
+
"center" => { :usedBy => "G", :type => :GvBool }, # bool
|
131
|
+
"charset" => { :usedBy => "G", :type => :EscString }, # string
|
132
|
+
"clusterrank" => { :usedBy => "G", :type => :EscString }, # clusterMode
|
133
|
+
"color" => { :usedBy => "ENC", :type => :ColorList }, # color, colorList
|
134
|
+
"colorscheme" => { :usedBy => "ENCG", :type => :EscString }, # string
|
135
|
+
"comment" => { :usedBy => "ENG", :type => :EscString }, # string
|
136
|
+
"compound" => { :usedBy => "G", :type => :GvBool }, # bool
|
137
|
+
"concentrate" => { :usedBy => "G", :type => :GvBool }, # bool
|
138
|
+
"constraint" => { :usedBy => "E", :type => :GvBool }, # bool
|
139
|
+
"decorate" => { :usedBy => "E", :type => :GvBool }, # bool
|
139
140
|
"defaultdist" => { :usedBy => "G", :type => :GvDouble },
|
140
|
-
"dim" => { :usedBy => "G", :type => :EscString },
|
141
|
-
"dimen" => { :usedBy => "G", :type => :EscString },
|
142
|
-
"dir" => { :usedBy => "E", :type => :EscString },
|
143
|
-
"diredgeconstraints" => { :usedBy => "G", :type => :EscString },
|
144
|
-
"distortion" => { :usedBy => "N", :type => :GvDouble },
|
145
|
-
"dpi" => { :usedBy => "G", :type => :GvDouble },
|
141
|
+
"dim" => { :usedBy => "G", :type => :EscString }, # int
|
142
|
+
"dimen" => { :usedBy => "G", :type => :EscString }, # int
|
143
|
+
"dir" => { :usedBy => "E", :type => :EscString }, # dirType
|
144
|
+
"diredgeconstraints" => { :usedBy => "G", :type => :EscString }, # string, bool
|
145
|
+
"distortion" => { :usedBy => "N", :type => :GvDouble },
|
146
|
+
"dpi" => { :usedBy => "G", :type => :GvDouble },
|
146
147
|
"edgeURL" => { :usedBy => "E", :type => :EscString },
|
147
148
|
"edgehref" => { :usedBy => "E", :type => :EscString },
|
148
149
|
"edgetarget" => { :usedBy => "E", :type => :EscString },
|
149
150
|
"edgetooltip" => { :usedBy => "E", :type => :EscString },
|
150
151
|
"epsilon" => { :usedBy => "G", :type => :GvDouble },
|
151
152
|
"esep" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf
|
152
|
-
"fillcolor" => { :usedBy => "NC", :type => :
|
153
|
-
"fixedsize" => { :usedBy => "N", :type => :
|
154
|
-
"fontcolor" => { :usedBy => "ENGC", :type => :
|
155
|
-
"fontname" => { :usedBy => "ENGC", :type => :EscString },
|
156
|
-
"fontnames" => { :usedBy => "G", :type => :EscString },
|
157
|
-
"fontpath" => { :usedBy => "G", :type => :EscString },
|
153
|
+
"fillcolor" => { :usedBy => "NC", :type => :Color }, # color
|
154
|
+
"fixedsize" => { :usedBy => "N", :type => :GvBool }, # bool
|
155
|
+
"fontcolor" => { :usedBy => "ENGC", :type => :Color }, # color
|
156
|
+
"fontname" => { :usedBy => "ENGC", :type => :EscString }, # string
|
157
|
+
"fontnames" => { :usedBy => "G", :type => :EscString }, # string
|
158
|
+
"fontpath" => { :usedBy => "G", :type => :EscString }, # string
|
158
159
|
"fontsize" => { :usedBy => "ENGC", :type => :GvDouble },
|
159
|
-
"group" => { :usedBy => "N", :type => :EscString },
|
160
|
+
"group" => { :usedBy => "N", :type => :EscString }, # string
|
160
161
|
"headURL" => { :usedBy => "E", :type => :EscString },
|
161
|
-
"headclip" => { :usedBy => "E", :type => :
|
162
|
+
"headclip" => { :usedBy => "E", :type => :GvBool }, # bool
|
162
163
|
"headhref" => { :usedBy => "E", :type => :EscString },
|
163
|
-
"headlabel" => { :usedBy => "E", :type => :EscString },
|
164
|
-
"headport" => { :usedBy => "E", :type => :EscString },
|
164
|
+
"headlabel" => { :usedBy => "E", :type => :EscString }, # LblString
|
165
|
+
"headport" => { :usedBy => "E", :type => :EscString }, # portPos
|
165
166
|
"headtarget" => { :usedBy => "E", :type => :EscString },
|
166
167
|
"headtooltip" => { :usedBy => "E", :type => :EscString },
|
167
168
|
"height" => { :usedBy => "N", :type => :GvDouble },
|
168
169
|
"href" => { :usedBy => "NE", :type => :EscString },
|
169
170
|
"id" => { :usedBy => "ENG", :type => :EscString },
|
170
|
-
"image" => { :usedBy => "N", :type => :EscString },
|
171
|
-
"imagescale" => { :usedBy => "N", :type => :EscString },
|
171
|
+
"image" => { :usedBy => "N", :type => :EscString }, # string
|
172
|
+
"imagescale" => { :usedBy => "N", :type => :EscString }, # bool, string
|
172
173
|
"label" => { :usedBy => "ENGC", :type => :LblString },
|
173
174
|
"labelURL" => { :usedBy => "E", :type => :EscString },
|
174
|
-
"label_scheme" => { :usedBy => "G", :type => :EscString },
|
175
|
+
"label_scheme" => { :usedBy => "G", :type => :EscString }, # int
|
175
176
|
"labelangle" => { :usedBy => "E", :type => :GvDouble },
|
176
177
|
"labeldistance" => { :usedBy => "E", :type => :GvDouble },
|
177
|
-
"labelfloat" => { :usedBy => "E", :type => :
|
178
|
-
"labelfontcolor" => { :usedBy => "E", :type => :
|
179
|
-
"labelfontname" => { :usedBy => "E", :type => :EscString },
|
178
|
+
"labelfloat" => { :usedBy => "E", :type => :GvBool }, # bool
|
179
|
+
"labelfontcolor" => { :usedBy => "E", :type => :Color }, # color
|
180
|
+
"labelfontname" => { :usedBy => "E", :type => :EscString }, # string
|
180
181
|
"labelfontsize" => { :usedBy => "E", :type => :GvDouble },
|
181
182
|
"labelhref" => { :usedBy => "E", :type => :EscString },
|
182
|
-
"labeljust" => { :usedBy => "GC", :type => :EscString },
|
183
|
-
"labelloc" => { :usedBy => "GCN", :type => :EscString },
|
183
|
+
"labeljust" => { :usedBy => "GC", :type => :EscString }, # string
|
184
|
+
"labelloc" => { :usedBy => "GCN", :type => :EscString }, # string
|
184
185
|
"labeltarget" => { :usedBy => "E", :type => :EscString },
|
185
186
|
"labeltooltip" => { :usedBy => "E", :type => :EscString },
|
186
|
-
"landscape" => { :usedBy => "G", :type => :
|
187
|
-
"layer" => { :usedBy => "EN", :type => :EscString },
|
188
|
-
"layers" => { :usedBy => "G", :type => :EscString },
|
189
|
-
"layersep" => { :usedBy => "G", :type => :EscString },
|
190
|
-
"layout" => { :usedBy => "G", :type => :EscString },
|
191
|
-
"len" => { :usedBy => "E", :type => :GvDouble },
|
192
|
-
"levels" => { :usedBy => "G", :type => :EscString },
|
187
|
+
"landscape" => { :usedBy => "G", :type => :GvBool }, # bool
|
188
|
+
"layer" => { :usedBy => "EN", :type => :EscString }, # layerRange
|
189
|
+
"layers" => { :usedBy => "G", :type => :EscString }, # layerList
|
190
|
+
"layersep" => { :usedBy => "G", :type => :EscString }, # string
|
191
|
+
"layout" => { :usedBy => "G", :type => :EscString }, # string
|
192
|
+
"len" => { :usedBy => "E", :type => :GvDouble },
|
193
|
+
"levels" => { :usedBy => "G", :type => :EscString }, # int
|
193
194
|
"levelsgap" => { :usedBy => "G", :type => :GvDouble },
|
194
|
-
"lhead" => { :usedBy => "E", :type => :EscString },
|
195
|
+
"lhead" => { :usedBy => "E", :type => :EscString }, # string
|
195
196
|
"lheight" => { :usedBy => "GC", :type => :GvDouble },
|
196
|
-
"lp" => { :usedBy => "EGC", :type => :EscString },
|
197
|
-
"ltail" => { :usedBy => "E", :type => :EscString },
|
198
|
-
"
|
197
|
+
"lp" => { :usedBy => "EGC", :type => :EscString }, # point
|
198
|
+
"ltail" => { :usedBy => "E", :type => :EscString }, # string
|
199
|
+
"lwidth" => { :usedBy => "GC", :type => :GvDouble },
|
199
200
|
"margin" => { :usedBy => "NG", :type => :EscString }, # GvDouble , pointf
|
200
|
-
"maxiter" => { :usedBy => "G", :type => :EscString },
|
201
|
+
"maxiter" => { :usedBy => "G", :type => :EscString }, # int
|
201
202
|
"mclimit" => { :usedBy => "G", :type => :GvDouble },
|
202
203
|
"mindist" => { :usedBy => "G", :type => :GvDouble },
|
203
|
-
"minlen" => { :usedBy => "E", :type => :EscString },
|
204
|
-
"mode" => { :usedBy => "G", :type => :EscString },
|
205
|
-
"model" => { :usedBy => "G", :type => :EscString },
|
206
|
-
"mosek" => { :usedBy => "G", :type => :
|
204
|
+
"minlen" => { :usedBy => "E", :type => :EscString }, # int
|
205
|
+
"mode" => { :usedBy => "G", :type => :EscString }, # string
|
206
|
+
"model" => { :usedBy => "G", :type => :EscString }, # string
|
207
|
+
"mosek" => { :usedBy => "G", :type => :GvBool }, # bool
|
207
208
|
"nodesep" => { :usedBy => "G", :type => :GvDouble },
|
208
|
-
"nojustify" => { :usedBy => "GCNE", :type => :
|
209
|
-
"normalize" => { :usedBy => "G", :type => :
|
209
|
+
"nojustify" => { :usedBy => "GCNE", :type => :GvBool }, # bool
|
210
|
+
"normalize" => { :usedBy => "G", :type => :GvBool }, # bool
|
210
211
|
"nslimit" => { :usedBy => "G", :type => :GvDouble },
|
211
212
|
"nslimit1" => { :usedBy => "G", :type => :GvDouble },
|
212
|
-
"ordering" => { :usedBy => "G", :type => :EscString },
|
213
|
-
"orientation" => { :usedBy => "NG", :type => :GvDouble },
|
214
|
-
"outputorder" => { :usedBy => "G", :type => :EscString },
|
215
|
-
"overlap" => { :usedBy => "G", :type => :EscString },
|
213
|
+
"ordering" => { :usedBy => "G", :type => :EscString }, # string
|
214
|
+
"orientation" => { :usedBy => "NG", :type => :GvDouble }, # N: double, G: string
|
215
|
+
"outputorder" => { :usedBy => "G", :type => :EscString }, # outputMode
|
216
|
+
"overlap" => { :usedBy => "G", :type => :EscString }, # string, bool
|
216
217
|
"overlap_scaling" => { :usedBy => "G", :type => :GvDouble },
|
217
|
-
"pack" => { :usedBy => "G", :type => :EscString },
|
218
|
-
"packmode" => { :usedBy => "G", :type => :EscString },
|
218
|
+
"pack" => { :usedBy => "G", :type => :EscString }, # bool, int
|
219
|
+
"packmode" => { :usedBy => "G", :type => :EscString }, # packMode
|
219
220
|
"pad" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf
|
220
221
|
"page" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf
|
221
|
-
"pagedir" => { :usedBy => "G", :type => :EscString },
|
222
|
-
"pencolor" => { :usedBy => "C", :type => :
|
222
|
+
"pagedir" => { :usedBy => "G", :type => :EscString }, # pageDir
|
223
|
+
"pencolor" => { :usedBy => "C", :type => :Color }, # color
|
223
224
|
"penwidth" => { :usedBy => "CNE", :type => :GvDouble },
|
224
|
-
"peripheries" => { :usedBy => "NC", :type => :EscString },
|
225
|
-
"pin" => { :usedBy => "N", :type => :
|
226
|
-
"pos" => { :usedBy => "EN", :type => :
|
227
|
-
"quadtree" => { :usedBy => "G", :type => :
|
225
|
+
"peripheries" => { :usedBy => "NC", :type => :EscString }, # int
|
226
|
+
"pin" => { :usedBy => "N", :type => :GvBool }, # bool
|
227
|
+
"pos" => { :usedBy => "EN", :type => :SplineType }, # point, splineTypes
|
228
|
+
"quadtree" => { :usedBy => "G", :type => :GvBool }, # bool
|
228
229
|
"quantum" => { :usedBy => "G", :type => :GvDouble },
|
229
|
-
"rank" => { :usedBy => "S", :type => :EscString },
|
230
|
-
"rankdir" => { :usedBy => "G", :type => :EscString },
|
230
|
+
"rank" => { :usedBy => "S", :type => :EscString }, # rankType
|
231
|
+
"rankdir" => { :usedBy => "G", :type => :EscString }, # rankDir
|
231
232
|
"ranksep" => { :usedBy => "G", :type => :EscString }, # GvDouble, doubleList
|
232
233
|
"ratio" => { :usedBy => "G", :type => :EscString }, # GvDouble, String
|
233
|
-
"rects" => { :usedBy => "N", :type => :
|
234
|
-
"regular" => { :usedBy => "N", :type => :
|
235
|
-
"remincross" => { :usedBy => "G", :type => :
|
234
|
+
"rects" => { :usedBy => "N", :type => :Rect }, # rect
|
235
|
+
"regular" => { :usedBy => "N", :type => :GvBool }, # bool
|
236
|
+
"remincross" => { :usedBy => "G", :type => :GvBool }, # bool
|
236
237
|
"repulsiveforce" => { :usedBy => "G", :type => :GvDouble },
|
237
238
|
"resolution" => { :usedBy => "G", :type => :GvDouble },
|
238
|
-
"root" => { :usedBy => "GN", :type => :EscString },
|
239
|
-
"rotate" => { :usedBy => "G", :type => :EscString },
|
239
|
+
"root" => { :usedBy => "GN", :type => :EscString }, # bool, string
|
240
|
+
"rotate" => { :usedBy => "G", :type => :EscString }, # int
|
240
241
|
"rotation" => { :usedBy => "G", :type => :GvDouble },
|
241
|
-
"samehead" => { :usedBy => "E", :type => :EscString },
|
242
|
-
"sametail" => { :usedBy => "E", :type => :EscString },
|
243
|
-
"samplepoints" => { :usedBy => "G", :type => :EscString },
|
244
|
-
"
|
245
|
-
"
|
246
|
-
"
|
247
|
-
"
|
248
|
-
"
|
249
|
-
"
|
250
|
-
"
|
242
|
+
"samehead" => { :usedBy => "E", :type => :EscString }, # string
|
243
|
+
"sametail" => { :usedBy => "E", :type => :EscString }, # string
|
244
|
+
"samplepoints" => { :usedBy => "G", :type => :EscString }, # int
|
245
|
+
"scale" => { :usedBy => "G", :type => :EscString }, # double, pointf
|
246
|
+
"searchsize" => { :usedBy => "G", :type => :EscString }, # int
|
247
|
+
"sep" => { :usedBy => "G", :type => :EscString }, # double , pointf
|
248
|
+
"shape" => { :usedBy => "N", :type => :EscString }, # shape
|
249
|
+
"shapefile" => { :usedBy => "N", :type => :EscString }, # string
|
250
|
+
"showboxes" => { :usedBy => "ENG", :type => :EscString }, # int
|
251
|
+
"sides" => { :usedBy => "N", :type => :EscString }, # int
|
252
|
+
"size" => { :usedBy => "NG", :type => :EscString }, # double , pointf
|
251
253
|
"skew" => { :usedBy => "N", :type => :GvDouble },
|
252
|
-
"smoothing" => { :usedBy => "G", :type => :EscString },
|
253
|
-
"sortv" => { :usedBy => "GCN", :type => :EscString },
|
254
|
-
"splines" => { :usedBy => "G", :type => :EscString },
|
255
|
-
"start" => { :usedBy => "G", :type => :EscString },
|
256
|
-
"style" => { :usedBy => "ENC", :type => :EscString },
|
257
|
-
"stylesheet" => { :usedBy => "G", :type => :EscString },
|
254
|
+
"smoothing" => { :usedBy => "G", :type => :EscString }, # smoothType
|
255
|
+
"sortv" => { :usedBy => "GCN", :type => :EscString }, # int
|
256
|
+
"splines" => { :usedBy => "G", :type => :EscString }, # bool, string
|
257
|
+
"start" => { :usedBy => "G", :type => :EscString }, # startType
|
258
|
+
"style" => { :usedBy => "ENC", :type => :EscString }, # style
|
259
|
+
"stylesheet" => { :usedBy => "G", :type => :EscString }, # string
|
258
260
|
"tailURL" => { :usedBy => "E", :type => :EscString },
|
259
|
-
"tailclip" => { :usedBy => "E", :type => :
|
261
|
+
"tailclip" => { :usedBy => "E", :type => :GvBool }, # bool
|
260
262
|
"tailhref" => { :usedBy => "E", :type => :EscString },
|
261
|
-
"taillabel" => { :usedBy => "E", :type => :EscString },
|
262
|
-
"tailport" => { :usedBy => "E", :type => :EscString },
|
263
|
+
"taillabel" => { :usedBy => "E", :type => :EscString }, # lblString
|
264
|
+
"tailport" => { :usedBy => "E", :type => :EscString }, # portPos
|
263
265
|
"tailtarget" => { :usedBy => "E", :type => :EscString },
|
264
266
|
"tailtooltip" => { :usedBy => "E", :type => :EscString },
|
265
|
-
"target" => { :usedBy => "ENGC", :type => :EscString },
|
267
|
+
"target" => { :usedBy => "ENGC", :type => :EscString }, # escString, string
|
266
268
|
"tooltip" => { :usedBy => "NEC", :type => :EscString },
|
267
|
-
"truecolor" => { :usedBy => "G", :type => :
|
268
|
-
"vertices" => { :usedBy => "N", :type => :EscString },
|
269
|
-
"viewport" => { :usedBy => "G", :type => :EscString },
|
269
|
+
"truecolor" => { :usedBy => "G", :type => :GvBool }, # bool
|
270
|
+
"vertices" => { :usedBy => "N", :type => :EscString }, # pointfList
|
271
|
+
"viewport" => { :usedBy => "G", :type => :EscString }, # viewPort
|
270
272
|
"voro_margin" => { :usedBy => "G", :type => :GvDouble },
|
271
273
|
"weight" => { :usedBy => "E", :type => :GvDouble },
|
272
274
|
"width" => { :usedBy => "N", :type => :GvDouble },
|
275
|
+
"xlabel" => { :usedBy => "EN", :type => :LblString },
|
273
276
|
"z" => { :usedBy => "N", :type => :GvDouble }
|
274
277
|
}
|
275
278
|
|