graphvizml 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32126671e7c65cea2740afcdeb9d7202480435e2
4
- data.tar.gz: 2120481175898598e5f29b5de6881dcd2690bd7b
3
+ metadata.gz: c518866f1ae8f45f7e48fb850ecae83c3ca7df99
4
+ data.tar.gz: 9ffb3522c4aee7d887dfe1734797a751056ca9ef
5
5
  SHA512:
6
- metadata.gz: 79a10faa54b39c0cd848ad292a8c3852580d89403545f804e6958276de04a0b0da0ee183da31a71b08aa52c6d6855bffb706f3ebaff5a6b7149f78ae4a0a2a6b
7
- data.tar.gz: ed3024826a29be27d5e05735624ee19bebb5722f17a023df3679865bf6600eb7fd628a49915c29acb1033c0fa1e7b9cb889dc4ac251585228b89842d1ca81af4
6
+ metadata.gz: '039b03b9fb2d33c7bdd4f0e7664f73dde30b1f60ff77771669df918c9f95fbe27de0301b80dd483400cebac95b913a3f3612d59ed0ca00836821610cc4765821'
7
+ data.tar.gz: a43c19e842e379f69641fea9969fe3b0fa399f4435a7b0d32c02b9ac2460e376caa4569e2e1f28f1c17d59ed524df97dafa55b0a6a7d4fd2d7da6cda6fa030d1
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/graphvizml.rb CHANGED
@@ -22,17 +22,10 @@ class GraphVizML
22
22
 
23
23
  obj.xml
24
24
 
25
- end
26
-
27
- doc = Domle.new(xml)
28
-
29
- # check if the root node is gvml or nodes
30
- @g = if doc.root.name == 'gvml' then
31
- build_from_gvml doc
32
- elsif doc.root.name == 'nodes'
33
- build_from_nodes doc
34
25
  end
35
26
 
27
+ @g = build_from_nodes Domle.new(xml)
28
+
36
29
  end
37
30
 
38
31
  def to_dot()
@@ -61,47 +54,6 @@ class GraphVizML
61
54
 
62
55
  private
63
56
 
64
- def build_from_gvml(doc)
65
-
66
- g = Graphviz::Graph.new format_summary_attributes(doc.root.attributes)
67
-
68
- e_nodes = doc.root.element 'nodes'
69
- e_edges = doc.root.element 'edges'
70
-
71
-
72
- # add the nodes
73
-
74
- nodes = e_nodes.root.xpath('records/a | records/node').inject({}) do |r,e|
75
-
76
- r.merge fetch_node(e)
77
-
78
- end
79
-
80
-
81
- # add the edges
82
-
83
- id_1 = e_edges.root.element('records/edge/records/node/attribute::gid').to_s
84
- nodes[id_1][-1] = g.add_node(nodes[id_1][0])
85
-
86
- e_edges.root.xpath('records/edge').each do |edge|
87
-
88
- id1, id2 = edge.xpath('records//node/attribute::gid').map(&:to_s)
89
-
90
- label = edge.text('summary/label').to_s
91
- #puts "adding edge id1: %s id2: %s label: %s" % [id1, id2, label]
92
- nodes[id2][-1] ||= nodes[id1].last.add_node(nodes[id2][0])
93
- attributes = edge.style.merge({label: label})
94
-
95
- conn = nodes[id1][-1].connections.last
96
- conn.attributes[:label] = label
97
- edge.style.each {|key,val| conn.attributes[key] = m(val) }
98
-
99
- end
100
-
101
- format_attributes nodes
102
-
103
- return g
104
- end
105
57
 
106
58
  def build_from_nodes(doc)
107
59
 
@@ -128,7 +80,6 @@ class GraphVizML
128
80
  end
129
81
 
130
82
  edge_style = a.find {|x| x[0].grep(/edge/).any?}.last
131
-
132
83
 
133
84
 
134
85
  # add the edges
data.tar.gz.sig CHANGED
Binary file
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.7
4
+ version: 0.5.8
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-16 00:00:00.000000000 Z
34
+ date: 2017-09-17 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: domle
metadata.gz.sig CHANGED
Binary file