graphvizml 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/graphvizml.rb +13 -4
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c651777619a2a1e676faa7364eeb918fc3dba62
|
4
|
+
data.tar.gz: 0d265817fc9cb78ec24090161d52e31315a66868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9af305f197c59e3e3a4526ae30ff77f9dc621c5b87d23ee6ddb036cb866face1ab696b80ad284532153427f37f4452c0de52c1a0e3268ab75de4feaefb736b5d
|
7
|
+
data.tar.gz: 9c438d8387c6a2b0e14109e8c83dfc733dab92f7157348e8f0a254d3bc3deb437ba8573b4b0e6aa023b7d30775783ffd1632a83b1b1b90594c20bcad725d98a0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/graphvizml.rb
CHANGED
@@ -67,9 +67,8 @@ class GraphVizML
|
|
67
67
|
e_nodes = @doc.root.element 'nodes'
|
68
68
|
e_edges = @doc.root.element 'edges'
|
69
69
|
|
70
|
-
# add the nodes
|
71
70
|
|
72
|
-
|
71
|
+
# add the nodes
|
73
72
|
|
74
73
|
nodes = e_nodes.root.xpath('records/node').inject({}) do |r,node|
|
75
74
|
|
@@ -98,20 +97,30 @@ class GraphVizML
|
|
98
97
|
#puts "adding edge id1: %s id2: %s label: %s" % [id1, id2, label]
|
99
98
|
nodes[id2][-1] ||= nodes[id1].last.add_node(nodes[id2][0])
|
100
99
|
attributes = edge.style.merge({label: label})
|
100
|
+
|
101
101
|
conn = nodes[id1][-1].connections.last
|
102
102
|
conn.attributes[:label] = label
|
103
|
-
edge.style.each {|key,val| conn.attributes[key] = val }
|
103
|
+
edge.style.each {|key,val| conn.attributes[key] = m(val) }
|
104
104
|
|
105
105
|
end
|
106
106
|
|
107
107
|
nodes.each do |id, x|
|
108
108
|
|
109
109
|
_, attributes, obj = x
|
110
|
-
attributes.each {|key,
|
110
|
+
attributes.each {|key, val| obj.attributes[key] = m(val) }
|
111
111
|
|
112
112
|
end
|
113
113
|
|
114
114
|
:build
|
115
115
|
end
|
116
116
|
|
117
|
+
# modify the value if it matches the following criteria
|
118
|
+
#
|
119
|
+
def m(s)
|
120
|
+
|
121
|
+
# is it a shorthand hexcode? e.g. #fff
|
122
|
+
s.gsub(/^#([\da-f]{3})$/)\
|
123
|
+
{ '#' + ($1).chars.inject([]) {|r,x| r << x + x}.join}
|
124
|
+
end
|
125
|
+
|
117
126
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphvizml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
0fBBWVqwHyWs77T9gCuDZmQrw2NmfyhNWhBw0iljBXo7WLDNB3x0nP6mYTzk47O8
|
32
32
|
sL5FGYJNgQqFlw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-09-
|
34
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: domle
|
metadata.gz.sig
CHANGED
Binary file
|