pxgraphviz 0.3.1 → 0.3.2
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 +2 -1
- data/lib/pxgraphviz.rb +29 -33
- metadata +1 -1
- 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: 27c3f2f1504c7444b8596d9bd40583f1fb93de37
|
4
|
+
data.tar.gz: 56ba3b46055481b052d4f4bd615c973ce00f58a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be2189e968e851619cfd212fb708b1272eac96a0384fcbb52dd363990b16baa34d8da94a01301268ce402346199d0136b9bea09434fbcc268e83a27b635c2314
|
7
|
+
data.tar.gz: 8fb6c154726548318339ae7196b67942eea25277f799a01680a0c20e347bfa5f1fd9a803f1abbfb7c11c01343a67e0346c60472ba950b96c801189809bfed6bf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
3��%�æa���a^m��I��-����*�҆#�F���0S������7]m�oZxc`?��Ķ�d���g�m��v[>���Z�/�2����7̈́��Ydc���kO]Z�<;�j�%Dz���ڔ���w�]����L4�1*��%�5�3̢��5!�����O
|
2
|
+
0L���E�Pvz�J�(8��C'��S�D�j�^=Q�����ԍ���A�Ѐ̫�k��2j _�'�n���ዘ���;g��i�}��9��y�
|
data/lib/pxgraphviz.rb
CHANGED
@@ -10,19 +10,10 @@ require 'graphvizml'
|
|
10
10
|
class PxGraphViz
|
11
11
|
|
12
12
|
|
13
|
-
def initialize(s)
|
13
|
+
def initialize(s, style: default_stylesheet())
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
px = Polyrex.new
|
18
|
-
px.import s
|
19
|
-
|
20
|
-
else
|
21
|
-
px = Polyrex.new s
|
22
|
-
|
23
|
-
end
|
24
|
-
|
25
|
-
@doc = build(px)
|
15
|
+
px = s =~ /^<\?/ ? Polyrex.new.import(s) : Polyrex.new(s)
|
16
|
+
@doc = build(px, style)
|
26
17
|
|
27
18
|
end
|
28
19
|
|
@@ -51,7 +42,7 @@ class PxGraphViz
|
|
51
42
|
|
52
43
|
private
|
53
44
|
|
54
|
-
def build(px)
|
45
|
+
def build(px, style)
|
55
46
|
|
56
47
|
# The issue with 2 nodes having the same name has yet to be rectified
|
57
48
|
#jr020917 labels = @px.xpath('//records/item/summary/label/text()').uniq
|
@@ -117,13 +108,35 @@ class PxGraphViz
|
|
117
108
|
end
|
118
109
|
end
|
119
110
|
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
h = {
|
115
|
+
style: style,
|
116
|
+
nodes: {summary: '', records: node_records[3..-1]},
|
117
|
+
edges: {summary: '', records: edge_records[3..-1]}
|
118
|
+
}
|
119
|
+
|
120
|
+
a = RexleBuilder.new(h).to_a
|
121
|
+
a[0] = 'gvml'
|
122
|
+
|
123
|
+
summary = px.summary.to_h
|
124
|
+
%i(recordx_type format_mask schema).each do |x|
|
125
|
+
summary.delete x; summary.delete x.to_s
|
120
126
|
end
|
121
127
|
|
122
|
-
|
123
|
-
|
128
|
+
a[1] = summary
|
129
|
+
|
130
|
+
Rexle.new(a)
|
131
|
+
|
132
|
+
end
|
133
|
+
|
134
|
+
def default_stylesheet()
|
135
|
+
|
136
|
+
<<STYLE
|
124
137
|
node {
|
125
138
|
color: #ddaa66;
|
126
|
-
fillcolor: #
|
139
|
+
fillcolor: #775533;
|
127
140
|
fontcolor: #ffeecc;
|
128
141
|
fontname: Trebuchet MS;
|
129
142
|
fontsize: 8;
|
@@ -142,23 +155,6 @@ style =<<STYLE
|
|
142
155
|
weight: 1;
|
143
156
|
}
|
144
157
|
STYLE
|
145
|
-
h = {
|
146
|
-
style: style,
|
147
|
-
nodes: {summary: '', records: node_records[3..-1]},
|
148
|
-
edges: {summary: '', records: edge_records[3..-1]}
|
149
|
-
}
|
150
|
-
|
151
|
-
a = RexleBuilder.new(h).to_a
|
152
|
-
a[0] = 'gvml'
|
153
|
-
|
154
|
-
summary = px.summary.to_h
|
155
|
-
%i(recordx_type format_mask schema).each do |x|
|
156
|
-
summary.delete x; summary.delete x.to_s
|
157
|
-
end
|
158
|
-
|
159
|
-
a[1] = summary
|
160
|
-
|
161
|
-
Rexle.new(a)
|
162
158
|
|
163
159
|
end
|
164
160
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|