bio-svgenes 0.2.3 → 0.3.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.
- data/.DS_Store +0 -0
- data/VERSION +1 -1
- data/bio-svgenes.gemspec +59 -4
- data/doc/.DS_Store +0 -0
- data/doc/Bio.html +141 -0
- data/doc/Bio/.DS_Store +0 -0
- data/doc/Bio/Graphics.html +147 -0
- data/doc/Bio/Graphics/Glyph.html +1061 -0
- data/doc/Bio/Graphics/MiniFeature.html +342 -0
- data/doc/Bio/Graphics/Page.html +1200 -0
- data/doc/Bio/Graphics/Primitive.html +278 -0
- data/doc/Bio/Graphics/SVGEE.html +471 -0
- data/doc/Bio/Graphics/Track.html +506 -0
- data/doc/LICENSE_txt.html +118 -0
- data/doc/created.rid +9 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +94 -0
- data/doc/js/darkfish.js +155 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +595 -0
- data/doc/table_of_contents.html +162 -0
- data/test/gene.gff +4 -0
- data/test/json_config.json +17 -0
- data/test/test_glyph.rb +33 -0
- data/test/test_mini_feature.rb +37 -0
- data/test/test_page.rb +127 -0
- data/test/test_primitive.rb +45 -0
- data/test/test_svgee.rb +73 -0
- data/test/test_track.rb +53 -0
- data/test/test_transcripts.gff +4 -0
- metadata +94 -14
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>class Bio::Graphics::Primitive - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "../../";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="class">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="../../index.html">Home</a>
|
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<div id="file-metadata">
|
|
49
|
+
<nav id="file-list-section" class="section">
|
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>lib/bio/graphics/primitive.rb
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div id="class-metadata">
|
|
60
|
+
|
|
61
|
+
<nav id="parent-class-section" class="section">
|
|
62
|
+
<h3 class="section-header">Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">Object
|
|
65
|
+
|
|
66
|
+
</nav>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<!-- Method Quickref -->
|
|
71
|
+
<nav id="method-list-section" class="section">
|
|
72
|
+
<h3 class="section-header">Methods</h3>
|
|
73
|
+
|
|
74
|
+
<ul class="link-list">
|
|
75
|
+
|
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-i-update">#update</a>
|
|
79
|
+
|
|
80
|
+
</ul>
|
|
81
|
+
</nav>
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div id="project-metadata">
|
|
86
|
+
<nav id="fileindex-section" class="section project-section">
|
|
87
|
+
<h3 class="section-header">Pages</h3>
|
|
88
|
+
|
|
89
|
+
<ul>
|
|
90
|
+
|
|
91
|
+
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
|
92
|
+
|
|
93
|
+
</ul>
|
|
94
|
+
</nav>
|
|
95
|
+
|
|
96
|
+
<nav id="classindex-section" class="section project-section">
|
|
97
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
98
|
+
|
|
99
|
+
<ul class="link-list">
|
|
100
|
+
|
|
101
|
+
<li><a href="../../Bio.html">Bio</a>
|
|
102
|
+
|
|
103
|
+
<li><a href="../../Bio/Graphics.html">Bio::Graphics</a>
|
|
104
|
+
|
|
105
|
+
<li><a href="../../Bio/Graphics/Glyph.html">Bio::Graphics::Glyph</a>
|
|
106
|
+
|
|
107
|
+
<li><a href="../../Bio/Graphics/MiniFeature.html">Bio::Graphics::MiniFeature</a>
|
|
108
|
+
|
|
109
|
+
<li><a href="../../Bio/Graphics/Page.html">Bio::Graphics::Page</a>
|
|
110
|
+
|
|
111
|
+
<li><a href="../../Bio/Graphics/Primitive.html">Bio::Graphics::Primitive</a>
|
|
112
|
+
|
|
113
|
+
<li><a href="../../Bio/Graphics/SVGEE.html">Bio::Graphics::SVGEE</a>
|
|
114
|
+
|
|
115
|
+
<li><a href="../../Bio/Graphics/Track.html">Bio::Graphics::Track</a>
|
|
116
|
+
|
|
117
|
+
</ul>
|
|
118
|
+
</nav>
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
</nav>
|
|
122
|
+
|
|
123
|
+
<div id="documentation">
|
|
124
|
+
<h1 class="class">class Bio::Graphics::Primitive</h1>
|
|
125
|
+
|
|
126
|
+
<div id="description" class="description">
|
|
127
|
+
|
|
128
|
+
<p>The <a href="Primitive.html">Primitive</a> class is used to hold
|
|
129
|
+
information about Glyphs. They contain a <a href="Glyph.html">Glyph</a>
|
|
130
|
+
type and then a Hash of parameters pertinent for that <a
|
|
131
|
+
href="Glyph.html">Glyph</a></p>
|
|
132
|
+
|
|
133
|
+
</div><!-- description -->
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<!-- Attributes -->
|
|
147
|
+
<section id="attribute-method-details" class="method-section section">
|
|
148
|
+
<h3 class="section-header">Attributes</h3>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<div id="attribute-i-primitive" class="method-detail">
|
|
152
|
+
<div class="method-heading attribute-method-heading">
|
|
153
|
+
<span class="method-name">primitive</span><span
|
|
154
|
+
class="attribute-access-type">[R]</span>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="method-description">
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
</section><!-- attribute-method-details -->
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
<!-- Methods -->
|
|
168
|
+
|
|
169
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
170
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<div id="method-i-update" class="method-detail ">
|
|
174
|
+
|
|
175
|
+
<div class="method-heading">
|
|
176
|
+
<span class="method-name">update</span><span
|
|
177
|
+
class="method-args">(args)</span>
|
|
178
|
+
|
|
179
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
180
|
+
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
<div class="method-description">
|
|
185
|
+
|
|
186
|
+
<p>Updates a <a href="Primitive.html">Primitive</a> and initialises any new
|
|
187
|
+
parameters into instance variables</p>
|
|
188
|
+
|
|
189
|
+
<p><code>args</code></p>
|
|
190
|
+
<ul><li>
|
|
191
|
+
<p>args = a hash of new parameters for the given <a
|
|
192
|
+
href="Glyph.html">Glyph</a> type</p>
|
|
193
|
+
</li></ul>
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<div class="method-source-code" id="update-source">
|
|
199
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/primitive.rb, line 23</span>
|
|
200
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update</span>(<span class="ruby-identifier">args</span>)
|
|
201
|
+
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
|
202
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{k}"</span>, <span class="ruby-identifier">args</span>[<span class="ruby-identifier">k</span>])
|
|
203
|
+
<span class="ruby-keyword">end</span>
|
|
204
|
+
<span class="ruby-keyword">end</span></pre>
|
|
205
|
+
</div><!-- update-source -->
|
|
206
|
+
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</div><!-- update-method -->
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
</section><!-- public-instance-method-details -->
|
|
216
|
+
|
|
217
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
218
|
+
<h3 class="section-header">Public Class Methods</h3>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<div id="method-c-new" class="method-detail ">
|
|
222
|
+
|
|
223
|
+
<div class="method-heading">
|
|
224
|
+
<span class="method-name">new</span><span
|
|
225
|
+
class="method-args">(primitive,args)</span>
|
|
226
|
+
|
|
227
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
228
|
+
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<div class="method-description">
|
|
233
|
+
|
|
234
|
+
<p>Creates a new <a href="Primitive.html">Primitive</a> and initialises the
|
|
235
|
+
Hash keys into instance variables</p>
|
|
236
|
+
|
|
237
|
+
<p><code>args</code></p>
|
|
238
|
+
<ul><li>
|
|
239
|
+
<p>primitive = the <a href="Primitive.html">Primitive</a> type</p>
|
|
240
|
+
</li><li>
|
|
241
|
+
<p>args = a hash of parameters needed to initialise the given <a
|
|
242
|
+
href="Glyph.html">Glyph</a> type</p>
|
|
243
|
+
</li></ul>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
<div class="method-source-code" id="new-source">
|
|
249
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/primitive.rb, line 12</span>
|
|
250
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">primitive</span>,<span class="ruby-identifier">args</span>)
|
|
251
|
+
<span class="ruby-ivar">@primitive</span> = <span class="ruby-identifier">primitive</span>
|
|
252
|
+
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each_key</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
|
|
253
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-node">"@#{k}"</span>, <span class="ruby-identifier">args</span>[<span class="ruby-identifier">k</span>])
|
|
254
|
+
<span class="ruby-keyword">end</span>
|
|
255
|
+
<span class="ruby-keyword">end</span></pre>
|
|
256
|
+
</div><!-- new-source -->
|
|
257
|
+
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
</div><!-- new-method -->
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
</section><!-- public-class-method-details -->
|
|
267
|
+
|
|
268
|
+
</section><!-- 5Buntitled-5D -->
|
|
269
|
+
|
|
270
|
+
</div><!-- documentation -->
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
<footer id="validator-badges">
|
|
274
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
275
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.rc.2.1.
|
|
276
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
277
|
+
</footer>
|
|
278
|
+
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
|
6
|
+
|
|
7
|
+
<title>class Bio::Graphics::SVGEE - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript">
|
|
12
|
+
var rdoc_rel_prefix = "../../";
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
16
|
+
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
|
|
17
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
|
|
18
|
+
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
|
|
19
|
+
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
|
|
20
|
+
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<body id="top" class="class">
|
|
24
|
+
<nav id="metadata">
|
|
25
|
+
<nav id="home-section" class="section">
|
|
26
|
+
<h3 class="section-header">
|
|
27
|
+
<a href="../../index.html">Home</a>
|
|
28
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
|
29
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
|
30
|
+
</h3>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
36
|
+
<h3 class="section-header">
|
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
39
|
+
</h3>
|
|
40
|
+
</form>
|
|
41
|
+
|
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
|
43
|
+
</nav>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<div id="file-metadata">
|
|
49
|
+
<nav id="file-list-section" class="section">
|
|
50
|
+
<h3 class="section-header">Defined In</h3>
|
|
51
|
+
<ul>
|
|
52
|
+
<li>lib/bio/graphics/svgee.rb
|
|
53
|
+
</ul>
|
|
54
|
+
</nav>
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div id="class-metadata">
|
|
60
|
+
|
|
61
|
+
<nav id="parent-class-section" class="section">
|
|
62
|
+
<h3 class="section-header">Parent</h3>
|
|
63
|
+
|
|
64
|
+
<p class="link">Object
|
|
65
|
+
|
|
66
|
+
</nav>
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<!-- Method Quickref -->
|
|
71
|
+
<nav id="method-list-section" class="section">
|
|
72
|
+
<h3 class="section-header">Methods</h3>
|
|
73
|
+
|
|
74
|
+
<ul class="link-list">
|
|
75
|
+
|
|
76
|
+
<li ><a href="#method-c-new">::new</a>
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-i-add_primitive">#add_primitive</a>
|
|
79
|
+
|
|
80
|
+
<li ><a href="#method-i-close_tag">#close_tag</a>
|
|
81
|
+
|
|
82
|
+
<li ><a href="#method-i-draw">#draw</a>
|
|
83
|
+
|
|
84
|
+
<li ><a href="#method-i-gradient">#gradient</a>
|
|
85
|
+
|
|
86
|
+
<li ><a href="#method-i-open_tag">#open_tag</a>
|
|
87
|
+
|
|
88
|
+
</ul>
|
|
89
|
+
</nav>
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div id="project-metadata">
|
|
94
|
+
<nav id="fileindex-section" class="section project-section">
|
|
95
|
+
<h3 class="section-header">Pages</h3>
|
|
96
|
+
|
|
97
|
+
<ul>
|
|
98
|
+
|
|
99
|
+
<li class="file"><a href="../../LICENSE_txt.html">LICENSE</a>
|
|
100
|
+
|
|
101
|
+
</ul>
|
|
102
|
+
</nav>
|
|
103
|
+
|
|
104
|
+
<nav id="classindex-section" class="section project-section">
|
|
105
|
+
<h3 class="section-header">Class and Module Index</h3>
|
|
106
|
+
|
|
107
|
+
<ul class="link-list">
|
|
108
|
+
|
|
109
|
+
<li><a href="../../Bio.html">Bio</a>
|
|
110
|
+
|
|
111
|
+
<li><a href="../../Bio/Graphics.html">Bio::Graphics</a>
|
|
112
|
+
|
|
113
|
+
<li><a href="../../Bio/Graphics/Glyph.html">Bio::Graphics::Glyph</a>
|
|
114
|
+
|
|
115
|
+
<li><a href="../../Bio/Graphics/MiniFeature.html">Bio::Graphics::MiniFeature</a>
|
|
116
|
+
|
|
117
|
+
<li><a href="../../Bio/Graphics/Page.html">Bio::Graphics::Page</a>
|
|
118
|
+
|
|
119
|
+
<li><a href="../../Bio/Graphics/Primitive.html">Bio::Graphics::Primitive</a>
|
|
120
|
+
|
|
121
|
+
<li><a href="../../Bio/Graphics/SVGEE.html">Bio::Graphics::SVGEE</a>
|
|
122
|
+
|
|
123
|
+
<li><a href="../../Bio/Graphics/Track.html">Bio::Graphics::Track</a>
|
|
124
|
+
|
|
125
|
+
</ul>
|
|
126
|
+
</nav>
|
|
127
|
+
|
|
128
|
+
</div>
|
|
129
|
+
</nav>
|
|
130
|
+
|
|
131
|
+
<div id="documentation">
|
|
132
|
+
<h1 class="class">class Bio::Graphics::SVGEE</h1>
|
|
133
|
+
|
|
134
|
+
<div id="description" class="description">
|
|
135
|
+
|
|
136
|
+
<p>The <a href="SVGEE.html">SVGEE</a> class is used to create the text that
|
|
137
|
+
will go into the final SVG file. It takes information from the supplied <a
|
|
138
|
+
href="Glyph.html">Glyph</a> objects, parses them and creates the SVG text
|
|
139
|
+
necessary to display the given glyphs.</p>
|
|
140
|
+
|
|
141
|
+
</div><!-- description -->
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<!-- Attributes -->
|
|
155
|
+
<section id="attribute-method-details" class="method-section section">
|
|
156
|
+
<h3 class="section-header">Attributes</h3>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<div id="attribute-i-defs" class="method-detail">
|
|
160
|
+
<div class="method-heading attribute-method-heading">
|
|
161
|
+
<span class="method-name">defs</span><span
|
|
162
|
+
class="attribute-access-type">[R]</span>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div class="method-description">
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div id="attribute-i-primitives" class="method-detail">
|
|
173
|
+
<div class="method-heading attribute-method-heading">
|
|
174
|
+
<span class="method-name">primitives</span><span
|
|
175
|
+
class="attribute-access-type">[R]</span>
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<div class="method-description">
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div id="attribute-i-supported_primitives" class="method-detail">
|
|
186
|
+
<div class="method-heading attribute-method-heading">
|
|
187
|
+
<span class="method-name">supported_primitives</span><span
|
|
188
|
+
class="attribute-access-type">[R]</span>
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
<div class="method-description">
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
</section><!-- attribute-method-details -->
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<!-- Methods -->
|
|
202
|
+
|
|
203
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
|
204
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
<div id="method-i-add_primitive" class="method-detail ">
|
|
208
|
+
|
|
209
|
+
<div class="method-heading">
|
|
210
|
+
<span class="method-name">add_primitive</span><span
|
|
211
|
+
class="method-args">(primitive_object)</span>
|
|
212
|
+
|
|
213
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
214
|
+
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
<div class="method-description">
|
|
219
|
+
|
|
220
|
+
<p>Adds a <a href="Primitive.html">Primitive</a> object to the <a
|
|
221
|
+
href="SVGEE.html">SVGEE</a> object and makes the svg text for that <a
|
|
222
|
+
href="Primitive.html">Primitive</a></p>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
<div class="method-source-code" id="add_primitive-source">
|
|
228
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 96</span>
|
|
229
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_primitive</span>(<span class="ruby-identifier">primitive_object</span>)
|
|
230
|
+
<span class="ruby-identifier">args</span> = {}
|
|
231
|
+
<span class="ruby-identifier">primitive_object</span>.<span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">args</span>[<span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/@/</span>,<span class="ruby-string">""</span>).<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">primitive_object</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">v</span>) }
|
|
232
|
+
<span class="ruby-identifier">primitive_string</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value">:primitive</span>)
|
|
233
|
+
<span class="ruby-identifier">make_tag</span>(<span class="ruby-identifier">primitive_string</span>, <span class="ruby-identifier">args</span>)
|
|
234
|
+
<span class="ruby-keyword">end</span></pre>
|
|
235
|
+
</div><!-- add_primitive-source -->
|
|
236
|
+
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
</div><!-- add_primitive-method -->
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
<div id="method-i-close_tag" class="method-detail ">
|
|
246
|
+
|
|
247
|
+
<div class="method-heading">
|
|
248
|
+
<span class="method-name">close_tag</span><span
|
|
249
|
+
class="method-args">()</span>
|
|
250
|
+
|
|
251
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
252
|
+
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
<div class="method-description">
|
|
257
|
+
|
|
258
|
+
<p>Produces the closing text for an svg file</p>
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<div class="method-source-code" id="close_tag-source">
|
|
264
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 31</span>
|
|
265
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">close_tag</span>
|
|
266
|
+
<span class="ruby-string">%Q{</svg>}</span>
|
|
267
|
+
<span class="ruby-keyword">end</span></pre>
|
|
268
|
+
</div><!-- close_tag-source -->
|
|
269
|
+
|
|
270
|
+
</div>
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
</div><!-- close_tag-method -->
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
<div id="method-i-draw" class="method-detail ">
|
|
279
|
+
|
|
280
|
+
<div class="method-heading">
|
|
281
|
+
<span class="method-name">draw</span><span
|
|
282
|
+
class="method-args">()</span>
|
|
283
|
+
|
|
284
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
285
|
+
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
<div class="method-description">
|
|
290
|
+
|
|
291
|
+
<p>Produces the svg text to display all the features on a <a
|
|
292
|
+
href="Page.html">Page</a></p>
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
<div class="method-source-code" id="draw-source">
|
|
298
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 117</span>
|
|
299
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">draw</span>
|
|
300
|
+
<span class="ruby-identifier">head</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">open_tag</span>
|
|
301
|
+
<span class="ruby-identifier">defstring</span> = <span class="ruby-string">""</span>
|
|
302
|
+
<span class="ruby-identifier">defstring</span> = <span class="ruby-string">"<defs>\n"</span> <span class="ruby-operator">+</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">defs</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"\n"</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"\n </defs>\n"</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">not</span> <span class="ruby-identifier">defs</span>.<span class="ruby-identifier">empty?</span>
|
|
303
|
+
<span class="ruby-identifier">shapes</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">primitives</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">"\n"</span>)
|
|
304
|
+
<span class="ruby-identifier">close</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">close_tag</span>
|
|
305
|
+
<span class="ruby-identifier">head</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">defstring</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">shapes</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">close</span>
|
|
306
|
+
<span class="ruby-keyword">end</span></pre>
|
|
307
|
+
</div><!-- draw-source -->
|
|
308
|
+
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
</div><!-- draw-method -->
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
<div id="method-i-gradient" class="method-detail ">
|
|
318
|
+
|
|
319
|
+
<div class="method-heading">
|
|
320
|
+
<span class="method-name">gradient</span><span
|
|
321
|
+
class="method-args">(a)</span>
|
|
322
|
+
|
|
323
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
324
|
+
|
|
325
|
+
</div>
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
<div class="method-description">
|
|
329
|
+
|
|
330
|
+
<p>Takes the gradient information from a <a href="Glyph.html">Glyph</a>, which
|
|
331
|
+
must be of type ‘radial’ or ‘linear’ and creates the svg text for
|
|
332
|
+
that gradient</p>
|
|
333
|
+
<ul><li>
|
|
334
|
+
<p><code>a</code> = a gradient (a gradient type, a colour and the parameters
|
|
335
|
+
for a given type)</p>
|
|
336
|
+
</li></ul>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
<div class="method-source-code" id="gradient-source">
|
|
342
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 104</span>
|
|
343
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">gradient</span>(<span class="ruby-identifier">a</span>)
|
|
344
|
+
<span class="ruby-identifier">definition_string</span> = <span class="ruby-keyword">case</span> <span class="ruby-identifier">a</span>[<span class="ruby-value">:type</span>]
|
|
345
|
+
<span class="ruby-keyword">when</span> <span class="ruby-value">:radial</span>
|
|
346
|
+
<span class="ruby-node">%Q{<radialGradient id="#{a[:id]}" cx="#{a[:cx]}%" cy="#{a[:cy]}%" r="#{a[:r]}%" fx="#{a[:fx]}%" fy="#{a[:fy]}%">}</span>
|
|
347
|
+
<span class="ruby-keyword">else</span>
|
|
348
|
+
<span class="ruby-node">%Q{<linearGradient id="#{a[:id]}" x1="#{a[:x1]}%" x2="#{a[:x2]}%" y1="#{a[:y1]}%" y2="#{a[:y2]}%">}</span>
|
|
349
|
+
<span class="ruby-keyword">end</span>
|
|
350
|
+
<span class="ruby-identifier">a</span>[<span class="ruby-value">:stops</span>].<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
|
351
|
+
<span class="ruby-identifier">definition_string</span> = <span class="ruby-identifier">definition_string</span> <span class="ruby-operator">+</span> <span class="ruby-string">"\n"</span> <span class="ruby-operator">+</span> <span class="ruby-node">%Q{<stop offset="#{s[:offset]}%" style="stop-color:#{s[:color]};stop-opacity:#{s[:opacity]}" />}</span>
|
|
352
|
+
<span class="ruby-keyword">end</span>
|
|
353
|
+
<span class="ruby-identifier">add_def</span> <span class="ruby-identifier">definition_string</span> <span class="ruby-operator">+</span> (<span class="ruby-identifier">a</span>[<span class="ruby-value">:type</span>] <span class="ruby-operator">==</span> <span class="ruby-value">:linear</span> <span class="ruby-operator">?</span> <span class="ruby-string">'</linearGradient>'</span> <span class="ruby-operator">:</span> <span class="ruby-string">'</radialGradient>'</span>)
|
|
354
|
+
<span class="ruby-keyword">end</span></pre>
|
|
355
|
+
</div><!-- gradient-source -->
|
|
356
|
+
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
</div><!-- gradient-method -->
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
<div id="method-i-open_tag" class="method-detail ">
|
|
366
|
+
|
|
367
|
+
<div class="method-heading">
|
|
368
|
+
<span class="method-name">open_tag</span><span
|
|
369
|
+
class="method-args">()</span>
|
|
370
|
+
|
|
371
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
372
|
+
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<div class="method-description">
|
|
377
|
+
|
|
378
|
+
<p>Produces the opening text for an svg file</p>
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
<div class="method-source-code" id="open_tag-source">
|
|
384
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 27</span>
|
|
385
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">open_tag</span>
|
|
386
|
+
<span class="ruby-node">%Q{<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="#{@width}" height="#{@height}" style="#{@style}" xmlns:xlink="http://www.w3.org/1999/xlink">}</span>
|
|
387
|
+
<span class="ruby-keyword">end</span></pre>
|
|
388
|
+
</div><!-- open_tag-source -->
|
|
389
|
+
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
</div><!-- open_tag-method -->
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
</section><!-- public-instance-method-details -->
|
|
399
|
+
|
|
400
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section section">
|
|
401
|
+
<h3 class="section-header">Public Class Methods</h3>
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
<div id="method-c-new" class="method-detail ">
|
|
405
|
+
|
|
406
|
+
<div class="method-heading">
|
|
407
|
+
<span class="method-name">new</span><span
|
|
408
|
+
class="method-args">(args)</span>
|
|
409
|
+
|
|
410
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
411
|
+
|
|
412
|
+
</div>
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
<div class="method-description">
|
|
416
|
+
|
|
417
|
+
<p>Creates a new <a href="SVGEE.html">SVGEE</a> object which will contain all
|
|
418
|
+
the necessary objects to display all the features on a page</p>
|
|
419
|
+
|
|
420
|
+
<p><code>args</code></p>
|
|
421
|
+
<ul><li>
|
|
422
|
+
<p>width = the amount of the page width the svg should take up (100%)</p>
|
|
423
|
+
</li><li>
|
|
424
|
+
<p>height = the amount of the page height the svg should take up (100%)</p>
|
|
425
|
+
</li><li>
|
|
426
|
+
<p>style = the svg style information</p>
|
|
427
|
+
</li><li>
|
|
428
|
+
<p>primitives = an array of glyphs</p>
|
|
429
|
+
</li><li>
|
|
430
|
+
<p>defs = the gradients that will be used in the SVG</p>
|
|
431
|
+
</li><li>
|
|
432
|
+
<p>supported_primitives = a list of permitted Glyphs</p>
|
|
433
|
+
</li></ul>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
<div class="method-source-code" id="new-source">
|
|
439
|
+
<pre><span class="ruby-comment"># File lib/bio/graphics/svgee.rb, line 17</span>
|
|
440
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
|
|
441
|
+
<span class="ruby-identifier">opts</span> = {<span class="ruby-value">:width</span> =<span class="ruby-operator">></span> <span class="ruby-string">'100%'</span>, <span class="ruby-value">:height</span> =<span class="ruby-operator">></span> <span class="ruby-string">'100%'</span>}.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">args</span>)
|
|
442
|
+
<span class="ruby-ivar">@width</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:width</span>]
|
|
443
|
+
<span class="ruby-ivar">@height</span> = <span class="ruby-identifier">opts</span>[<span class="ruby-value">:height</span>]
|
|
444
|
+
<span class="ruby-ivar">@style</span>= <span class="ruby-identifier">opts</span>[<span class="ruby-value">:style</span>]
|
|
445
|
+
<span class="ruby-ivar">@primitives</span> = []
|
|
446
|
+
<span class="ruby-ivar">@defs</span> = []
|
|
447
|
+
<span class="ruby-ivar">@supported_primitives</span> = [<span class="ruby-value">:circle</span>, <span class="ruby-value">:rectangle</span>, <span class="ruby-value">:ellipse</span>, <span class="ruby-value">:line</span>, <span class="ruby-value">:polyline</span>, <span class="ruby-value">:text</span>]
|
|
448
|
+
<span class="ruby-keyword">end</span></pre>
|
|
449
|
+
</div><!-- new-source -->
|
|
450
|
+
|
|
451
|
+
</div>
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
</div><!-- new-method -->
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
</section><!-- public-class-method-details -->
|
|
460
|
+
|
|
461
|
+
</section><!-- 5Buntitled-5D -->
|
|
462
|
+
|
|
463
|
+
</div><!-- documentation -->
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
<footer id="validator-badges">
|
|
467
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
|
468
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.rc.2.1.
|
|
469
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
|
470
|
+
</footer>
|
|
471
|
+
|