graphvizml 0.2.2 → 0.3.0

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: 39ea97ac12a4a601926f83b5337f0325b749f1ba
4
- data.tar.gz: b67e291b4bcb8ee2db0223f9b506ebd943bce346
3
+ metadata.gz: 7c6dd2ff2f4171929681dfe7161e078dde3c4247
4
+ data.tar.gz: 128d1565a6ffc2fa91b86f5ae7e1d7e68d474435
5
5
  SHA512:
6
- metadata.gz: 91e66ab9af6fface7d8122ae888e7a01d6f540967b24ef0055b85c3192e9c1bb158735bfe6ecc237b3f2a57c58609f76c6602064249b46cda1c30b4943d90288
7
- data.tar.gz: 2f04f948869723991efb05e001282611bcffc11499bf7326e3ed68b371a8fb36c67e73b1742dd8cf50a869919602fd214b94aa5b85439a17c7c078a223fec2c3
6
+ metadata.gz: 7befe85a030d760212e2c8a5880481165b0d04098b25fe9620fe39038f1d137a04991ab4e21fb7811451f439393c676a8b355b9ec9aadb5170ec3ea37461f24d
7
+ data.tar.gz: 837900c1655eacb3676cd069a85684134d88e093fd5b134e7384d5b7d0852c15001c546e0dad46c5b489b06bca1e2d3048cb32dc62da1170f8963646e5ffb7d2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -52,7 +52,10 @@ class GraphVizML
52
52
 
53
53
  def build
54
54
 
55
- stylesheet = @doc.root.element('style').text
55
+ style = @doc.root.element('style')
56
+
57
+ stylesheet = style ? style.text : default_stylesheet()
58
+
56
59
  e_nodes = @doc.root.element 'nodes'
57
60
  e_edges = @doc.root.element 'edges'
58
61
 
@@ -81,10 +84,14 @@ class GraphVizML
81
84
 
82
85
  e_nodes.root.xpath('records/node').each do |node|
83
86
 
84
- id = node.attribute('id').to_s
87
+ h =node.attributes
88
+ id = h[:id]
85
89
  label = node.text('label')
90
+
91
+ # shape options: box, ellipse, record, diamond, circle, polygon, point
92
+ shape = h.has_key?(:shape) ? h[:shape] : :box
86
93
  #puts "adding node id: %s label: %s" % [id, label]
87
- @g.add_node(id).label = label
94
+ @g.add_node(id, shape: shape).label = label
88
95
  end
89
96
 
90
97
  # add the edges
@@ -100,5 +107,35 @@ class GraphVizML
100
107
 
101
108
  :build
102
109
  end
110
+
111
+ private
112
+
113
+ def default_stylesheet()
114
+
115
+ <<STYLE
116
+ node {
117
+ color: #ddaa66;
118
+ fillcolor: #ffeeee;
119
+ fontcolor: #113377;
120
+ fontname: Trebuchet MS;
121
+ fontsize: 9;
122
+ margin: 0.1;
123
+ penwidth: 1.3;
124
+ shape: box;
125
+ style: filled;
126
+ }
127
+
128
+ edge {
129
+ arrowsize: 0.9;
130
+ color: #999999;
131
+ fontcolor: #444444;
132
+ fontname: Verdana;
133
+ fontsize: 9;
134
+ dir: forward;
135
+ weight: 1;
136
+ }
137
+
138
+ STYLE
139
+ end
103
140
 
104
141
  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.2.2
4
+ version: 0.3.0
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-08-31 00:00:00.000000000 Z
34
+ date: 2017-09-02 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '1.4'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.4.3
45
+ version: 1.4.7
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  version: '1.4'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.4.3
55
+ version: 1.4.7
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: ruby-graphviz
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: '1.2'
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 1.2.2
65
+ version: 1.2.3
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
@@ -72,7 +72,7 @@ dependencies:
72
72
  version: '1.2'
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.2.2
75
+ version: 1.2.3
76
76
  description:
77
77
  email: james@jamesrobertson.eu
78
78
  executables: []
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- ciX/�"u_)���X��L�@�XD�i�.TH���*��?&�1F0Fq1aT�/�E��M� ����"6`h�@���1f{ ��&fg���JEq3����A���ҫ��>��
2
- -k�x/���B��4��9X��I ���:���h
1
+ y[��"��ӧ�j:��hĠ[����gF���cHX4u�*GB�ϊ��(lw�����sPSf7�ϕm�cO����x�+B����c_���z ��Ʉ���F
2
+ ��}�mڰ����k�[���G�J��} ;�ڡ6�,���i��a{ �� ���k�;�>q�f�z'��A��WJ���F��b�}{�=����~��*��.�a����K�f%�V�3�x��E\�}����!�J�1�JZ+�5