pxgraphviz 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/pxgraphviz.rb +55 -54
- data.tar.gz.sig +0 -0
- metadata +34 -34
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ec769baa44cc90b7da7bb62a0856f87da40246ffaa5096051e58eed34d783b1
|
4
|
+
data.tar.gz: d471f35e76cc4993a38405c5dba1e162401402811661a8b71148c41f746e2760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 807f06da5f13d2194f8a0c75444c62ac59bc06990956282a71d075e1c70df86cc8c83a2daf21531757a1e137ed2f2edfea269a61f43fd1823f1d526d4b33321e
|
7
|
+
data.tar.gz: dea35e397915adc20147b7884b649b01563d616884e9a8f06856f93074071cb646ff42357bf8f391237c58f1f2c3e57acffe5acc34b8ab9bc32629778f63d6b5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/pxgraphviz.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
|
6
6
|
require 'polyrex'
|
7
7
|
require 'graphvizml'
|
8
|
+
require 'rxfreader'
|
8
9
|
|
9
10
|
|
10
11
|
module RegGem
|
@@ -17,7 +18,7 @@ hkey_gems
|
|
17
18
|
require pxgraphviz
|
18
19
|
class PxGraphViz
|
19
20
|
media_type svg
|
20
|
-
'
|
21
|
+
'
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
@@ -27,65 +28,65 @@ class PxGraphViz < GraphVizML
|
|
27
28
|
|
28
29
|
attr_reader :doc, :px
|
29
30
|
|
30
|
-
def initialize(obj=nil, style: nil, debug: false, fill: '#778833',
|
31
|
+
def initialize(obj=nil, style: nil, debug: false, fill: '#778833',
|
31
32
|
stroke: '#999999', text_color: '#ffeecc')
|
32
33
|
|
33
34
|
if obj then
|
34
35
|
|
35
|
-
s =
|
36
|
+
s = RXFReader.read(obj).first
|
36
37
|
@doc = import_string(s)
|
37
38
|
|
38
39
|
puts 'pxgraphviz: before super'.info if debug
|
39
40
|
|
40
|
-
super(@doc, debug: debug, fill: fill,
|
41
|
+
super(@doc, debug: debug, fill: fill,
|
41
42
|
stroke: stroke, text_color: text_color)
|
42
|
-
|
43
|
+
|
43
44
|
end
|
44
|
-
|
45
|
+
|
45
46
|
@css = "
|
46
47
|
.node polygon {stroke: #{stroke}; fill: #{fill}}
|
47
48
|
.node text {fill: #{text_color}}
|
48
49
|
.edge path {stroke: #{stroke}}
|
49
50
|
.edge polygon {stroke: #{stroke}; fill: #{stroke}}
|
50
51
|
"
|
51
|
-
|
52
|
+
|
52
53
|
end
|
53
54
|
|
54
55
|
def import(s)
|
55
|
-
s2 =
|
56
|
+
s2 = RXFReader.read(s).first
|
56
57
|
@doc = import_string s2
|
57
58
|
@g = build_from_nodes Domle.new(@doc.root.xml)
|
58
59
|
self
|
59
|
-
end
|
60
|
-
|
61
|
-
|
60
|
+
end
|
61
|
+
|
62
|
+
|
62
63
|
protected
|
63
|
-
|
64
|
+
|
64
65
|
def default_stylesheet()
|
65
66
|
|
66
67
|
<<STYLE
|
67
|
-
node {
|
68
|
-
color: #ddaa66;
|
68
|
+
node {
|
69
|
+
color: #ddaa66;
|
69
70
|
fillcolor: #{@fill};
|
70
|
-
fontcolor: #{@text_color};
|
71
|
+
fontcolor: #{@text_color};
|
71
72
|
fontname: 'Trebuchet MS';
|
72
|
-
fontsize: 8;
|
73
|
+
fontsize: 8;
|
73
74
|
margin: 0.0;
|
74
|
-
penwidth: 1;
|
75
|
+
penwidth: 1;
|
75
76
|
style: filled;
|
76
|
-
shape: #{@shape};
|
77
|
+
shape: #{@shape};
|
77
78
|
}
|
78
|
-
|
79
|
+
|
79
80
|
a node {
|
80
|
-
color: #0011ee;
|
81
|
+
color: #0011ee;
|
81
82
|
}
|
82
83
|
|
83
84
|
edge {
|
84
85
|
arrowsize: 0.5;
|
85
|
-
color: #{@stroke};
|
86
|
-
fontcolor: #444444;
|
87
|
-
fontname: Verdana;
|
88
|
-
fontsize: 8;
|
86
|
+
color: #{@stroke};
|
87
|
+
fontcolor: #444444;
|
88
|
+
fontname: Verdana;
|
89
|
+
fontsize: 8;
|
89
90
|
#{@type}
|
90
91
|
weight: 1;
|
91
92
|
}
|
@@ -93,65 +94,65 @@ STYLE
|
|
93
94
|
|
94
95
|
end
|
95
96
|
|
96
|
-
|
97
|
+
|
97
98
|
private
|
98
|
-
|
99
|
+
|
99
100
|
def import_string(s)
|
100
101
|
|
101
102
|
@px = if s =~ /<\?pxgraphviz\b/ then
|
102
|
-
|
103
|
+
|
103
104
|
header = "<?polyrex schema='items[type, shape]/item[label, connection]' delimiter =' # '?>
|
104
105
|
type: digraph
|
105
|
-
shape: box
|
106
|
+
shape: box
|
106
107
|
"
|
107
108
|
s2 = s.slice!(/<\?pxgraphviz\b[^>]*\?>/)
|
108
109
|
|
109
110
|
if s2 then
|
110
|
-
|
111
|
+
|
111
112
|
attributes = %w(id fill stroke text_color).inject({}) do |r, keyword|
|
112
113
|
found = s2[/(?<=#{keyword}=['"])[^'"]+/]
|
113
114
|
found ? r.merge(keyword.to_sym => found) : r
|
114
115
|
end
|
115
|
-
|
116
|
+
|
116
117
|
fill, stroke, text_color = %i(fill stroke text_color).map do |x|
|
117
118
|
attributes[x] ? attributes[x] : method(x).call
|
118
119
|
end
|
119
|
-
|
120
|
+
|
120
121
|
@css = "
|
121
122
|
.node ellipse {stroke: #{stroke}; fill: #{fill}}
|
122
123
|
.node text {fill: #{text_color}}
|
123
124
|
.edge path {stroke: #{stroke}}
|
124
125
|
.edge polygon {stroke: #{stroke}; fill: #{stroke}}
|
125
|
-
"
|
126
|
-
|
127
|
-
end
|
126
|
+
"
|
127
|
+
|
128
|
+
end
|
128
129
|
s3 = header + s
|
129
130
|
puts 's3: ' + s3.inspect if @debug
|
130
131
|
Polyrex.new.import(s3)
|
131
|
-
|
132
|
+
|
132
133
|
else
|
133
|
-
|
134
|
+
|
134
135
|
Polyrex.new(s)
|
135
|
-
|
136
|
-
end
|
136
|
+
|
137
|
+
end
|
137
138
|
|
138
139
|
@type = @px.summary[:type] == 'digraph' ? 'dir: forward;' : 'dir: none;'
|
139
140
|
@shape = @px.summary[:shape] || 'ellipse;'
|
140
|
-
|
141
|
+
|
141
142
|
@style ||= default_stylesheet()
|
142
143
|
doc = Rexslt.new(xslt_stylesheet(), @px.to_xml)\
|
143
144
|
.to_doc.root.element('nodes')
|
144
|
-
|
145
|
+
|
145
146
|
doc.root.elements.first.insert_before Rexle::Element.new('style')\
|
146
147
|
.add_text @style
|
147
|
-
|
148
|
+
|
148
149
|
doc
|
149
|
-
|
150
|
+
|
150
151
|
end
|
151
|
-
|
152
|
+
|
152
153
|
def xslt_stylesheet()
|
153
|
-
|
154
|
-
<<XSLT
|
154
|
+
|
155
|
+
<<XSLT
|
155
156
|
<?xml version="1.0" encoding="UTF-8"?>
|
156
157
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
157
158
|
<xsl:output method="xml" indent="yes" />
|
@@ -185,12 +186,12 @@ shape: box
|
|
185
186
|
<xsl:element name="a">
|
186
187
|
<xsl:attribute name="href">
|
187
188
|
<xsl:value-of select="summary/url"/>
|
188
|
-
</xsl:attribute>
|
189
|
+
</xsl:attribute>
|
189
190
|
<xsl:call-template name='node'/>
|
190
191
|
</xsl:element>
|
191
192
|
|
192
193
|
</xsl:when>
|
193
|
-
<xsl:otherwise>
|
194
|
+
<xsl:otherwise>
|
194
195
|
|
195
196
|
<xsl:call-template name='node'/>
|
196
197
|
|
@@ -207,33 +208,33 @@ shape: box
|
|
207
208
|
|
208
209
|
<xsl:template name='node'>
|
209
210
|
<xsl:element name="node">
|
210
|
-
|
211
|
+
|
211
212
|
<xsl:attribute name="shape">
|
212
213
|
<xsl:value-of select="summary/shape"/>
|
213
214
|
</xsl:attribute>
|
214
|
-
|
215
|
+
|
215
216
|
<xsl:if test="summary/id">
|
216
217
|
<xsl:attribute name="id">
|
217
218
|
<xsl:value-of select="summary/id"/>
|
218
219
|
</xsl:attribute>
|
219
220
|
</xsl:if>
|
220
|
-
|
221
|
+
|
221
222
|
<xsl:if test="summary/class">
|
222
223
|
<xsl:attribute name="class">
|
223
224
|
<xsl:value-of select="summary/class"/>
|
224
225
|
</xsl:attribute>
|
225
226
|
</xsl:if>
|
226
|
-
|
227
|
+
|
227
228
|
<xsl:if test="summary/connection">
|
228
229
|
<xsl:attribute name="connection">
|
229
230
|
<xsl:value-of select="summary/connection"/>
|
230
231
|
</xsl:attribute>
|
231
|
-
</xsl:if>
|
232
|
-
|
232
|
+
</xsl:if>
|
233
|
+
|
233
234
|
<xsl:apply-templates select='summary'/>
|
234
235
|
<xsl:apply-templates select='records'/>
|
235
236
|
|
236
|
-
</xsl:element>
|
237
|
+
</xsl:element>
|
237
238
|
</xsl:template>
|
238
239
|
|
239
240
|
</xsl:stylesheet>
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pxgraphviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -11,31 +11,31 @@ cert_chain:
|
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
28
|
+
BgkqhkiG9w0BAQsFAAOCAYEAg9lEWHF3avcbK4ktmHyDJl71m7SvG6QqPGbC5aYT
|
29
|
+
pI3+A9AIIUI9BlF0P4V/mSt9c9YccOjs1oT5qLIvhCpMJtDDy2w+tbzVG9ia1S0t
|
30
|
+
/1EZqbiAKGuMwaLI9P94ku3SjqecHQlMsA+dSqiJpHOBjhPB3fePATtCHIgzwhjT
|
31
|
+
a1SV51/pDyiNhwsUBLhqEMqUBOKBcDnZDXFQ612khj8GLW0TlLd1DnhYjS5HBi57
|
32
|
+
A3HlI1ftQU4ywVtJVyY5++npvwg7N9CxRN02Q3It/OE9UcHVELYsjH8T1IO23U5g
|
33
|
+
LcE3a44K374xnOB2a5Rjvr3n9dmbPIJSUWXAGKtVAxJQaQkXJ/JgORkG3UyOwyxx
|
34
|
+
4+Iryd9KLXqoOlZie53pHP3baUn+NFWsOQTVWyhLDSvj4aG2fFZ4sYMOD8zJHrxl
|
35
|
+
Kw5MEmLLND9M4uj/YjCJaxgvkZ9u4iTBMNldKFS8X5Go7qOpzee47emfjxes++nS
|
36
|
+
6hgbEtPQ0Tr9VNd2zW1qmLkG
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2022-02-23 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: polyrex
|
@@ -43,42 +43,42 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.4'
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.
|
49
|
+
version: 1.4.0
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
54
|
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '1.
|
56
|
+
version: '1.4'
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 1.
|
59
|
+
version: 1.4.0
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: graphvizml
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '0.
|
66
|
+
version: '0.7'
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.7.1
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '0.
|
76
|
+
version: '0.7'
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: 0.
|
79
|
+
version: 0.7.1
|
80
80
|
description:
|
81
|
-
email:
|
81
|
+
email: digital.robertson@gmail.com
|
82
82
|
executables: []
|
83
83
|
extensions: []
|
84
84
|
extra_rdoc_files: []
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
106
|
+
rubygems_version: 3.2.22
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Generates a GraphViz Markup Language file from a Polyrex document
|
metadata.gz.sig
CHANGED
Binary file
|