ruby-graphviz 0.9.21 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +13 -2
- data/bin/xml2gv +1 -1
- data/examples/dot/JSP.dot +52 -0
- data/examples/sample47.rb +1 -1
- data/examples/sample59.rb +14 -0
- data/examples/sample60.rb +12 -0
- data/examples/sample61.rb +12 -0
- data/lib/graphviz.rb +50 -49
- data/lib/graphviz/constants.rb +1 -2
- data/lib/graphviz/graphml.rb +17 -12
- data/lib/graphviz/node.rb +1 -15
- data/lib/graphviz/xml.rb +13 -25
- data/test/output/sample35.rb.gv +1 -1
- data/test/output/sample37.rb.dot +11 -11
- data/test/output/sample59.rb.png +0 -0
- data/test/output/sample60.rb.png +0 -0
- data/test/output/sample61.rb.png +0 -0
- metadata +15 -8
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Ruby/GraphViz
|
2
2
|
|
3
|
-
Copyright (C) 2004
|
3
|
+
Copyright (C) 2004-2011 Gregoire Lejeune
|
4
4
|
|
5
5
|
* Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz
|
6
6
|
* Sources : http://github.com/glejeune/Ruby-Graphviz
|
@@ -19,12 +19,23 @@ Interface to the GraphViz graphing tool
|
|
19
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
20
|
|
21
21
|
* GraphViz::Node#name must be replaced by GraphViz::Node#id
|
22
|
-
*
|
22
|
+
* The html attribut must be replaced by a label attribut (<tt>:label => '<<html/>>'</tt>)
|
23
23
|
* :output option must be replaced by :<format> => :<file>
|
24
24
|
* :file option must be replaced by :<format> => :<file>
|
25
25
|
|
26
26
|
== CHANGELOG
|
27
27
|
|
28
|
+
=== 1.0.0 :
|
29
|
+
* \o/
|
30
|
+
* GraphViz::Node#name has been removed - use GraphViz::Node#id
|
31
|
+
* The html attribut has been removed - use a label attribut (<tt>:label => '<<html/>>'</tt>)
|
32
|
+
* :output option has been removed - use :<format> => :<file>
|
33
|
+
* :file option has been removed - use :<format> => :<file>
|
34
|
+
* Add GraphViz#to_s
|
35
|
+
* Add GraphViz#add (see sample59.rb)
|
36
|
+
* GraphViz::XML.output is deprecated, use GraphViz::XML.graph.output
|
37
|
+
* Issue #22 : Error when generating a graph with an ID containing a space.
|
38
|
+
|
28
39
|
=== 0.9.21 :
|
29
40
|
* Add attributs "label_scheme" and "rotation"
|
30
41
|
* Add missing options :
|
data/bin/xml2gv
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
digraph fig7 {
|
2
|
+
node [shape=rect]
|
3
|
+
edge [dir=none]
|
4
|
+
|
5
|
+
subgraph compound1 {
|
6
|
+
a [label="LFILE"]
|
7
|
+
b [label="*\rLREC"]
|
8
|
+
c [label="o\rMATCHED LREC"]
|
9
|
+
d [label="o\rUNMATCHED LREC"]
|
10
|
+
|
11
|
+
a -> {b}
|
12
|
+
b -> {c d}
|
13
|
+
}
|
14
|
+
|
15
|
+
subgraph compound2 {
|
16
|
+
e [label="RFILE"]
|
17
|
+
f [label="*\rRREC"]
|
18
|
+
g [label="o\rMATCHED RREC"]
|
19
|
+
h [label="o\rUNMATCHED RREC"]
|
20
|
+
|
21
|
+
e -> {f}
|
22
|
+
f -> {g h}
|
23
|
+
}
|
24
|
+
|
25
|
+
subgraph compound3 {
|
26
|
+
i [label="REPORT"]
|
27
|
+
j [label="*\rLINE"]
|
28
|
+
k [label="o\rTYPE 1"]
|
29
|
+
l [label="o\rTYPE 2"]
|
30
|
+
m [label="o\rTYPE 3"]
|
31
|
+
n [label="o\rTYPE 4"]
|
32
|
+
|
33
|
+
i -> {j}
|
34
|
+
j -> {k l m n}
|
35
|
+
}
|
36
|
+
|
37
|
+
{rank=same a e i}
|
38
|
+
{rank=same b f j}
|
39
|
+
{rank=same c d g h k l m n}
|
40
|
+
|
41
|
+
subgraph correspondences {
|
42
|
+
edge [dir=both]
|
43
|
+
|
44
|
+
a -> e
|
45
|
+
e -> i
|
46
|
+
|
47
|
+
c -> g:s
|
48
|
+
d -> l:s
|
49
|
+
g -> k:s
|
50
|
+
h -> m:s
|
51
|
+
}
|
52
|
+
}
|
data/examples/sample47.rb
CHANGED
data/lib/graphviz.rb
CHANGED
@@ -93,24 +93,26 @@ class GraphViz
|
|
93
93
|
# Return the GraphViz::Node object created
|
94
94
|
#
|
95
95
|
def add_node( xNodeName, hOpts = {} )
|
96
|
-
@hoNodes[xNodeName]
|
97
|
-
|
96
|
+
return @hoNodes[xNodeName] || Proc.new {
|
97
|
+
@hoNodes[xNodeName] = GraphViz::Node::new( xNodeName, self )
|
98
|
+
@hoNodes[xNodeName].index = @elements_order.size_of( "node" )
|
98
99
|
|
99
|
-
|
100
|
-
|
101
|
-
|
100
|
+
unless hOpts.keys.include?(:label) or hOpts.keys.include?("label")
|
101
|
+
hOpts[:label] = xNodeName
|
102
|
+
end
|
102
103
|
|
103
|
-
|
104
|
-
|
105
|
-
|
104
|
+
hOpts.each do |xKey, xValue|
|
105
|
+
@hoNodes[xNodeName][xKey.to_s] = xValue
|
106
|
+
end
|
106
107
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
108
|
+
@elements_order.push( {
|
109
|
+
"type" => "node",
|
110
|
+
"name" => xNodeName,
|
111
|
+
"value" => @hoNodes[xNodeName]
|
112
|
+
} )
|
112
113
|
|
113
|
-
|
114
|
+
return( @hoNodes[xNodeName] )
|
115
|
+
}.call
|
114
116
|
end
|
115
117
|
|
116
118
|
#
|
@@ -277,8 +279,20 @@ class GraphViz
|
|
277
279
|
end
|
278
280
|
end
|
279
281
|
|
282
|
+
#
|
283
|
+
# Add nodes and edges defined by a Hash
|
284
|
+
#
|
285
|
+
def add(h)
|
286
|
+
if h.kind_of? Hash
|
287
|
+
h.each do |node, data|
|
288
|
+
add_hash_edge(node, data)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
280
293
|
#
|
281
294
|
# Return the graph type (graph digraph)
|
295
|
+
#
|
282
296
|
def type
|
283
297
|
@oGraphType
|
284
298
|
end
|
@@ -451,15 +465,6 @@ class GraphViz
|
|
451
465
|
hOpts.each do |xKey, xValue|
|
452
466
|
xValue = xValue.to_s unless xValue.nil? or [Class, TrueClass, FalseClass].include?(xValue.class)
|
453
467
|
case xKey.to_s
|
454
|
-
when "output"
|
455
|
-
warn ":output option is deprecated, please use :<format> => :<file> -- BE CAREFUL, it will be removed in the 1.0 version!"
|
456
|
-
if FORMATS.index( xValue ).nil? == true
|
457
|
-
raise ArgumentError, "output format '#{xValue}' invalid"
|
458
|
-
end
|
459
|
-
@format = xValue
|
460
|
-
when "file"
|
461
|
-
warn ":file option is deprecated, please use :<format> => :<file> -- BE CAREFUL, it will be removed in the 1.0 version!"
|
462
|
-
@filename = xValue
|
463
468
|
when "use"
|
464
469
|
if PROGRAMS.index( xValue ).nil? == true
|
465
470
|
raise ArgumentError, "can't use '#{xValue}'"
|
@@ -625,6 +630,10 @@ class GraphViz
|
|
625
630
|
|
626
631
|
alias :save :output
|
627
632
|
|
633
|
+
def to_s
|
634
|
+
self.output(:none => String)
|
635
|
+
end
|
636
|
+
|
628
637
|
#
|
629
638
|
# Get the graph name
|
630
639
|
#
|
@@ -698,9 +707,6 @@ class GraphViz
|
|
698
707
|
@@errors = v
|
699
708
|
when "extlibs"
|
700
709
|
@@extlibs = v.split( "," ).map{ |x| x.strip }
|
701
|
-
when "output"
|
702
|
-
warn ":output option is deprecated!"
|
703
|
-
@@format = v
|
704
710
|
else
|
705
711
|
warn "Invalide option #{k}!"
|
706
712
|
end
|
@@ -796,20 +802,11 @@ class GraphViz
|
|
796
802
|
|
797
803
|
hOpts.each do |xKey, xValue|
|
798
804
|
case xKey.to_s
|
799
|
-
when "output"
|
800
|
-
warn ":output option is deprecated, please use :<format> => :<file>"
|
801
|
-
if FORMATS.index( xValue.to_s ).nil? == true
|
802
|
-
raise ArgumentError, "output format '#{xValue}' invalid"
|
803
|
-
end
|
804
|
-
@format = xValue.to_s
|
805
805
|
when "use"
|
806
806
|
if PROGRAMS.index( xValue.to_s ).nil? == true
|
807
807
|
raise ArgumentError, "can't use '#{xValue}'"
|
808
808
|
end
|
809
809
|
@prog = xValue.to_s
|
810
|
-
when "file"
|
811
|
-
warn ":file option is deprecated, please use :<format> => :<file>"
|
812
|
-
@filename = xValue.to_s
|
813
810
|
when "parent"
|
814
811
|
@oParentGraph = xValue
|
815
812
|
when "type"
|
@@ -833,6 +830,19 @@ class GraphViz
|
|
833
830
|
yield( self ) if( block )
|
834
831
|
end
|
835
832
|
|
833
|
+
# Edge between a node and a Hash
|
834
|
+
# Used by GraphViz#add
|
835
|
+
def add_hash_edge(node, hash)
|
836
|
+
if hash.kind_of? Hash
|
837
|
+
hash.each do |nt, data|
|
838
|
+
add_edge(node, nt)
|
839
|
+
add_hash_edge(nt, data)
|
840
|
+
end
|
841
|
+
else
|
842
|
+
add_edge(node, hash)
|
843
|
+
end
|
844
|
+
end
|
845
|
+
|
836
846
|
#
|
837
847
|
# Create a new undirected graph
|
838
848
|
#
|
@@ -869,21 +879,12 @@ class GraphViz
|
|
869
879
|
:unquote_empty => false,
|
870
880
|
}.merge(opts)
|
871
881
|
|
872
|
-
if (options[:force] or str.match( /\A[a-zA-Z_]+[a-zA-Z0-9_]*\Z/ ).nil?)
|
873
|
-
|
874
|
-
|
882
|
+
if (options[:force] or str.match( /\A[a-zA-Z_]+[a-zA-Z0-9_]*\Z/ ).nil?)
|
883
|
+
unless options[:unquote_empty] == true and str.size == 0
|
884
|
+
'"' + str.gsub('"', '\\"').gsub("\n", '\\\\n').gsub(".","\\.") + '"'
|
885
|
+
end
|
875
886
|
else
|
876
887
|
str
|
877
888
|
end
|
878
|
-
end
|
879
|
-
|
880
|
-
#def self.escape(str, force = false ) #:nodoc:
|
881
|
-
# if force or str.match( /\A[a-zA-Z_]+[a-zA-Z0-9_]*\Z/ ).nil?
|
882
|
-
# '"' + str.gsub('"', '\\"').gsub("\n", '\\\\n').gsub(".","\\.") + '"'
|
883
|
-
# ## MAYBE WE NEED TO USE THIS ONE ## str.inspect.gsub(".","\\.").gsub( "\\\\", "\\" )
|
884
|
-
# else
|
885
|
-
# str
|
886
|
-
# end
|
887
|
-
#end
|
888
|
-
|
889
|
+
end
|
889
890
|
end
|
data/lib/graphviz/constants.rb
CHANGED
@@ -40,7 +40,7 @@
|
|
40
40
|
# C => cluster
|
41
41
|
#
|
42
42
|
module Constants
|
43
|
-
RGV_VERSION = "0.
|
43
|
+
RGV_VERSION = "1.0.0"
|
44
44
|
|
45
45
|
## Const: Output formats
|
46
46
|
FORMATS = [
|
@@ -166,7 +166,6 @@ module Constants
|
|
166
166
|
"headtooltip" => { :usedBy => "E", :type => :EscString },
|
167
167
|
"height" => { :usedBy => "N", :type => :GvDouble },
|
168
168
|
"href" => { :usedBy => "NE", :type => :EscString },
|
169
|
-
"html" => { :usedBy => "N", :type => :HtmlString }, # API extension -- Deprecated
|
170
169
|
"id" => { :usedBy => "ENG", :type => :EscString },
|
171
170
|
"image" => { :usedBy => "N", :type => :EscString },
|
172
171
|
"imagescale" => { :usedBy => "N", :type => :EscString },
|
data/lib/graphviz/graphml.rb
CHANGED
@@ -21,6 +21,8 @@ require 'rexml/document'
|
|
21
21
|
class GraphViz
|
22
22
|
class GraphML
|
23
23
|
attr_reader :attributs
|
24
|
+
|
25
|
+
# The GraphViz object
|
24
26
|
attr_accessor :graph
|
25
27
|
|
26
28
|
DEST = {
|
@@ -35,6 +37,9 @@ class GraphViz
|
|
35
37
|
'undirected' => :graph
|
36
38
|
}
|
37
39
|
|
40
|
+
#
|
41
|
+
# Create a new GraphViz object from a GraphML file of string
|
42
|
+
#
|
38
43
|
def initialize( file_or_str )
|
39
44
|
data = ((File.file?( file_or_str )) ? File::new(file_or_str) : file_or_str)
|
40
45
|
@xmlDoc = REXML::Document::new( data )
|
@@ -52,7 +57,7 @@ class GraphViz
|
|
52
57
|
parse( @xmlDoc.root )
|
53
58
|
end
|
54
59
|
|
55
|
-
def parse( node )
|
60
|
+
def parse( node ) #:nodoc:
|
56
61
|
#begin
|
57
62
|
send( node.name.to_sym, node )
|
58
63
|
#rescue NoMethodError => e
|
@@ -60,7 +65,7 @@ class GraphViz
|
|
60
65
|
#end
|
61
66
|
end
|
62
67
|
|
63
|
-
def graphml( node )
|
68
|
+
def graphml( node ) #:nodoc:
|
64
69
|
node.each_element( ) do |child|
|
65
70
|
#begin
|
66
71
|
send( "graphml_#{child.name}".to_sym, child )
|
@@ -70,7 +75,7 @@ class GraphViz
|
|
70
75
|
end
|
71
76
|
end
|
72
77
|
|
73
|
-
def graphml_key( node )
|
78
|
+
def graphml_key( node ) #:nodoc:
|
74
79
|
id = node.attributes['id']
|
75
80
|
@current_attr = {
|
76
81
|
:name => node.attributes['attr.name'],
|
@@ -91,11 +96,11 @@ class GraphViz
|
|
91
96
|
@current_attr = nil
|
92
97
|
end
|
93
98
|
|
94
|
-
def graphml_key_default( node )
|
99
|
+
def graphml_key_default( node ) #:nodoc:
|
95
100
|
@current_attr[:default] = node.texts().to_s
|
96
101
|
end
|
97
102
|
|
98
|
-
def graphml_graph( node )
|
103
|
+
def graphml_graph( node ) #:nodoc:
|
99
104
|
@current_node = nil
|
100
105
|
|
101
106
|
if @current_graph.nil?
|
@@ -128,11 +133,11 @@ class GraphViz
|
|
128
133
|
@current_graph = previous_graph
|
129
134
|
end
|
130
135
|
|
131
|
-
def graphml_graph_data( node )
|
136
|
+
def graphml_graph_data( node ) #:nodoc:
|
132
137
|
@current_graph[@attributs[:graphs][node.attributes['key']][:name]] = node.texts().to_s
|
133
138
|
end
|
134
139
|
|
135
|
-
def graphml_graph_node( node )
|
140
|
+
def graphml_graph_node( node ) #:nodoc:
|
136
141
|
@current_node = {}
|
137
142
|
|
138
143
|
node.each_element( ) do |child|
|
@@ -158,11 +163,11 @@ class GraphViz
|
|
158
163
|
@current_node = nil
|
159
164
|
end
|
160
165
|
|
161
|
-
def graphml_graph_node_data( node )
|
166
|
+
def graphml_graph_node_data( node ) #:nodoc:
|
162
167
|
@current_node[@attributs[:nodes][node.attributes['key']][:name]] = node.texts().to_s
|
163
168
|
end
|
164
169
|
|
165
|
-
def graphml_graph_node_port( node )
|
170
|
+
def graphml_graph_node_port( node ) #:nodoc:
|
166
171
|
@current_node[:shape] = :record
|
167
172
|
port = node.attributes['name']
|
168
173
|
if @current_node[:label]
|
@@ -173,7 +178,7 @@ class GraphViz
|
|
173
178
|
end
|
174
179
|
end
|
175
180
|
|
176
|
-
def graphml_graph_edge( node )
|
181
|
+
def graphml_graph_edge( node ) #:nodoc:
|
177
182
|
source = node.attributes['source']
|
178
183
|
source = {source => node.attributes['sourceport']} if node.attributes['sourceport']
|
179
184
|
target = node.attributes['target']
|
@@ -192,11 +197,11 @@ class GraphViz
|
|
192
197
|
@current_edge = nil
|
193
198
|
end
|
194
199
|
|
195
|
-
def graphml_graph_edge_data( node )
|
200
|
+
def graphml_graph_edge_data( node ) #:nodoc:
|
196
201
|
@current_edge[@attributs[:edges][node.attributes['key']][:name]] = node.texts().to_s
|
197
202
|
end
|
198
203
|
|
199
|
-
def graphml_graph_hyperedge( node )
|
204
|
+
def graphml_graph_hyperedge( node ) #:nodoc:
|
200
205
|
list = []
|
201
206
|
|
202
207
|
node.each_element( ) do |child|
|
data/lib/graphviz/node.rb
CHANGED
@@ -38,15 +38,6 @@ class GraphViz
|
|
38
38
|
@index = nil
|
39
39
|
end
|
40
40
|
|
41
|
-
#
|
42
|
-
# Get the node ID
|
43
|
-
#
|
44
|
-
def name
|
45
|
-
# TODO : Remove in v1.0
|
46
|
-
warn "GraphViz::Node#name is deprecated, please use GraphViz::Node#id! -- BE CAREFUL, it will be removed in the 1.0 version!"
|
47
|
-
return self.id
|
48
|
-
end
|
49
|
-
|
50
41
|
#
|
51
42
|
# Get the node ID
|
52
43
|
#
|
@@ -164,12 +155,7 @@ class GraphViz
|
|
164
155
|
@oAttrNode.data.delete("label")
|
165
156
|
end
|
166
157
|
@oAttrNode.data.each do |k, v|
|
167
|
-
|
168
|
-
warn "html attribut is deprecated, please use label : :label => '<<html />>' -- BE CAREFUL, it will be removed in the 1.0 version!"
|
169
|
-
xAttr << xSeparator + "label = " + v.to_gv
|
170
|
-
else
|
171
|
-
xAttr << xSeparator + k + " = " + v.to_gv
|
172
|
-
end
|
158
|
+
xAttr << xSeparator + k + " = " + v.to_gv
|
173
159
|
xSeparator = ", "
|
174
160
|
end
|
175
161
|
if xAttr.length > 0
|
data/lib/graphviz/xml.rb
CHANGED
@@ -20,31 +20,17 @@ require 'rexml/document'
|
|
20
20
|
class GraphViz
|
21
21
|
class XML
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
@xNodeName
|
26
|
-
@bShowText
|
27
|
-
@bShowAttrs
|
23
|
+
# The GraphViz object
|
24
|
+
attr_accessor :graph
|
28
25
|
|
29
26
|
#
|
30
27
|
# Generate the graph
|
31
28
|
#
|
32
|
-
#
|
33
|
-
# * :output : Output format (Constants::FORMATS)
|
34
|
-
# * :file : Output file name
|
35
|
-
# * :use : Program to use (Constants::PROGRAMS)
|
36
|
-
# * :path : Program PATH
|
37
|
-
# * :<format> => <file> : <file> can be
|
38
|
-
# * a file name
|
39
|
-
# * nil, then the output will be printed to STDOUT
|
40
|
-
# * String, then the output will be returned as a String
|
41
|
-
# * :errors : DOT error level (default 1)
|
42
|
-
# * 0 = Error + Warning
|
43
|
-
# * 1 = Error
|
44
|
-
# * 2 = none
|
29
|
+
# THIS METHOD IS DEPRECATED, PLEASE USE GraphViz::XML.graph.output
|
45
30
|
#
|
46
31
|
def output( *hOpt )
|
47
|
-
|
32
|
+
warn "GraphViz::XML.output is deprecated, use GraphViz::XML.graph.output"
|
33
|
+
@graph.output( *hOpt )
|
48
34
|
end
|
49
35
|
|
50
36
|
private
|
@@ -54,7 +40,9 @@ class GraphViz
|
|
54
40
|
#
|
55
41
|
# In:
|
56
42
|
# * xFile : XML File
|
57
|
-
# * *hOpt : Graph options
|
43
|
+
# * *hOpt : Graph options:
|
44
|
+
# * :text : show text nodes (default true)
|
45
|
+
# * :attrs : show XML attributs (default true)
|
58
46
|
#
|
59
47
|
def initialize( xFile, *hOpt )
|
60
48
|
@xNodeName = "00000"
|
@@ -75,7 +63,7 @@ class GraphViz
|
|
75
63
|
end
|
76
64
|
|
77
65
|
@oReXML = REXML::Document::new( File::new( xFile ) )
|
78
|
-
@
|
66
|
+
@graph = GraphViz::new( "XML", *hOpt )
|
79
67
|
_init( @oReXML.root() )
|
80
68
|
end
|
81
69
|
|
@@ -93,7 +81,7 @@ class GraphViz
|
|
93
81
|
|
94
82
|
label << "}"
|
95
83
|
end
|
96
|
-
@
|
84
|
+
@graph.add_node( xLocalNodeName, "label" => label, "color" => "blue", "shape" => "record" )
|
97
85
|
|
98
86
|
## Act: Search and add Text nodes
|
99
87
|
if oXMLNode.has_text? == true and @bShowText == true
|
@@ -111,8 +99,8 @@ class GraphViz
|
|
111
99
|
end
|
112
100
|
|
113
101
|
if xText.length > 0
|
114
|
-
@
|
115
|
-
@
|
102
|
+
@graph.add_node( xTextNodeName, "label" => xText, "color" => "black", "shape" => "ellipse" )
|
103
|
+
@graph.add_edge( xLocalNodeName, xTextNodeName )
|
116
104
|
end
|
117
105
|
end
|
118
106
|
|
@@ -121,7 +109,7 @@ class GraphViz
|
|
121
109
|
|
122
110
|
oXMLNode.each_element( ) do |oXMLChild|
|
123
111
|
xChildNodeName = _init( oXMLChild )
|
124
|
-
@
|
112
|
+
@graph.add_edge( xLocalNodeName, xChildNodeName )
|
125
113
|
end
|
126
114
|
|
127
115
|
return( xLocalNodeName )
|
data/test/output/sample35.rb.gv
CHANGED
@@ -14,7 +14,7 @@ subgraph {
|
|
14
14
|
mysite -> dotgraph [color = "blue"]
|
15
15
|
}
|
16
16
|
subgraph cluster_0 {
|
17
|
-
|
17
|
+
label = "my_page.html"; fontname = "Courier"; fontsize = "10"; color = "black";
|
18
18
|
zeimage [label = "", shape = "note", image = "./hello.png"];
|
19
19
|
}
|
20
20
|
mygraph -> mysite [color = "blue"]
|
data/test/output/sample37.rb.dot
CHANGED
@@ -1,50 +1,50 @@
|
|
1
1
|
digraph Solarsys {
|
2
|
-
Sun [label = "Sun\n",
|
2
|
+
Sun [label = "Sun\n", penwidth = "2", fillcolor = "orange", shape = "circle", fontsize = "12", style = "filled"];
|
3
3
|
subgraph {
|
4
4
|
rank = "same";
|
5
|
-
Moon [label = "Moon\n",
|
6
|
-
Earth [label = "Earth\n",
|
5
|
+
Moon [label = "Moon\n", penwidth = "2", fillcolor = "red", shape = "circle", fontsize = "12", style = "filled"];
|
6
|
+
Earth [label = "Earth\n", penwidth = "2", fillcolor = "blue", shape = "circle", fontsize = "12", style = "filled"];
|
7
7
|
Moon -> Earth [penwidth = "2", color = "black", labeltooltip = "distance"]
|
8
8
|
}
|
9
9
|
Sun -> Earth [penwidth = "2", color = "black", labeltooltip = "distance"]
|
10
10
|
subgraph {
|
11
11
|
rank = "same";
|
12
|
-
Mercury [label = "Mercury\n",
|
12
|
+
Mercury [label = "Mercury\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
13
13
|
Sun -> Mercury [label = "distance", penwidth = "2", color = "black"]
|
14
14
|
}
|
15
15
|
subgraph {
|
16
16
|
rank = "same";
|
17
|
-
Venus [label = "Venus\n",
|
17
|
+
Venus [label = "Venus\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
18
18
|
Sun -> Venus [label = "distance", penwidth = "2", color = "black"]
|
19
19
|
}
|
20
20
|
subgraph {
|
21
21
|
rank = "same";
|
22
|
-
Mars [label = "Mars\n",
|
22
|
+
Mars [label = "Mars\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
23
23
|
Sun -> Mars [label = "distance", penwidth = "2", color = "black"]
|
24
24
|
}
|
25
25
|
subgraph {
|
26
26
|
rank = "same";
|
27
|
-
Jupiter [label = "Jupiter\n",
|
27
|
+
Jupiter [label = "Jupiter\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
28
28
|
Sun -> Jupiter [label = "distance", penwidth = "2", color = "black"]
|
29
29
|
}
|
30
30
|
subgraph {
|
31
31
|
rank = "same";
|
32
|
-
Saturn [label = "Saturn\n",
|
32
|
+
Saturn [label = "Saturn\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
33
33
|
Sun -> Saturn [label = "distance", penwidth = "2", color = "black"]
|
34
34
|
}
|
35
35
|
subgraph {
|
36
36
|
rank = "same";
|
37
|
-
Uranus [label = "Uranus\n",
|
37
|
+
Uranus [label = "Uranus\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
38
38
|
Sun -> Uranus [label = "distance", penwidth = "2", color = "black"]
|
39
39
|
}
|
40
40
|
subgraph {
|
41
41
|
rank = "same";
|
42
|
-
Neptune [label = "Neptune\n",
|
42
|
+
Neptune [label = "Neptune\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
43
43
|
Sun -> Neptune [label = "distance", penwidth = "2", color = "black"]
|
44
44
|
}
|
45
45
|
subgraph {
|
46
46
|
rank = "same";
|
47
|
-
Pluto [label = "Pluto\n",
|
47
|
+
Pluto [label = "Pluto\n", penwidth = "2", fillcolor = "green", shape = "circle", fontsize = "12", style = "filled"];
|
48
48
|
Sun -> Pluto [label = "distance", penwidth = "2", color = "black"]
|
49
49
|
}
|
50
50
|
}
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-graphviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.9.21
|
9
|
+
- 0
|
10
|
+
version: 1.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gregoire Lejeune
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-02 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- examples/dot/genetic.dot
|
51
51
|
- examples/dot/hello.dot
|
52
52
|
- examples/dot/hello_test.rb
|
53
|
+
- examples/dot/JSP.dot
|
53
54
|
- examples/dot/lion_share.dot
|
54
55
|
- examples/dot/prof.dot
|
55
56
|
- examples/dot/psg.dot
|
@@ -132,6 +133,9 @@ files:
|
|
132
133
|
- examples/sample56.rb
|
133
134
|
- examples/sample57.rb
|
134
135
|
- examples/sample58.rb
|
136
|
+
- examples/sample59.rb
|
137
|
+
- examples/sample60.rb
|
138
|
+
- examples/sample61.rb
|
135
139
|
- examples/sample99.rb
|
136
140
|
- examples/sdlshapes/README
|
137
141
|
- examples/sdlshapes/sdl.ps
|
@@ -224,6 +228,9 @@ files:
|
|
224
228
|
- test/output/sample55.rb.png
|
225
229
|
- test/output/sample56.rb.svg
|
226
230
|
- test/output/sample58.rb.png
|
231
|
+
- test/output/sample59.rb.png
|
232
|
+
- test/output/sample60.rb.png
|
233
|
+
- test/output/sample61.rb.png
|
227
234
|
- test/output/sample99.rb.png
|
228
235
|
- test/support.rb
|
229
236
|
- test/test_examples.rb
|
@@ -248,11 +255,11 @@ post_install_message: |
|
|
248
255
|
For more information, see http://github.com/glejeune/Ruby-Graphviz/issues/#issue/13
|
249
256
|
So if you use node ports, maybe you need to change your code.
|
250
257
|
|
251
|
-
/!\ GraphViz::Node#name
|
258
|
+
/!\ GraphViz::Node#name has been removed!
|
252
259
|
|
253
|
-
/!\ :output and :file options
|
260
|
+
/!\ :output and :file options have been removed!
|
254
261
|
|
255
|
-
/!\ The html attribut
|
262
|
+
/!\ The html attribut has been removed!
|
256
263
|
You can use the label attribut, as dot do it : :label => '<<html/>>'
|
257
264
|
|
258
265
|
/!\ Version 0.9.17 introduce GraphML (http://graphml.graphdrawing.org/) support and
|