bio-incanter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +14 -0
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +26 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/bio-incanter.gemspec +136 -0
- data/doc/AreaChart.html +473 -0
- data/doc/BarChart.html +519 -0
- data/doc/BlandAltman.html +453 -0
- data/doc/BoxPlot.html +474 -0
- data/doc/FunctionPlot.html +496 -0
- data/doc/HeatMap.html +554 -0
- data/doc/Histogram.html +444 -0
- data/doc/LICENSE_txt.html +130 -0
- data/doc/LineChart.html +479 -0
- data/doc/Object.html +278 -0
- data/doc/PieChart.html +455 -0
- data/doc/README_rdoc.html +152 -0
- data/doc/ScatterPlot.html +489 -0
- data/doc/TimeChart.html +473 -0
- data/doc/TracePlot.html +416 -0
- data/doc/XyPlot.html +477 -0
- data/doc/created.rid +18 -0
- data/doc/images/add.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 +106 -0
- data/doc/js/darkfish.js +153 -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 +543 -0
- data/doc/table_of_contents.html +295 -0
- data/lib/area_chart/area_chart.rb +106 -0
- data/lib/bar_chart/bar_chart.rb +142 -0
- data/lib/bio-incanter.rb +108 -0
- data/lib/bland_altman/bland_altman.rb +120 -0
- data/lib/box_plot/box_plot.rb +136 -0
- data/lib/function_plot/function_plot.rb +137 -0
- data/lib/histogram/histogram.rb +139 -0
- data/lib/java/clocomics-1.0.0-standalone.jar +0 -0
- data/lib/line_chart/line_chart.rb +148 -0
- data/lib/pie_chart/pie_chart.rb +121 -0
- data/lib/qq_plot/qq_plot.rb +105 -0
- data/lib/scatter_plot/scatter_plot.rb +162 -0
- data/lib/time_chart/time_chart.rb +142 -0
- data/lib/trace_plot/trace_plot.rb +108 -0
- data/lib/xy_plot/xy_plot.rb +149 -0
- data/spec/bar_chart_spec.rb +25 -0
- data/spec/bland_altman_spec.rb +26 -0
- data/spec/box_plot_spec.rb +25 -0
- data/spec/function_plot_spec.rb +27 -0
- data/spec/histogram_spec.rb +24 -0
- data/spec/line_chart_spec.rb +25 -0
- data/spec/pie_chart_spec.rb +25 -0
- data/spec/qq_plot_spec.rb +24 -0
- data/spec/scatter_plot_spec.rb +26 -0
- data/spec/spec_helper.rb +13 -0
- data/spec/time_chart_spec.rb +26 -0
- data/spec/trace_plot_spec.rb +24 -0
- data/spec/xy_plot_spec.rb +25 -0
- metadata +196 -0
@@ -0,0 +1,295 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Table of Contents - 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 class="indexpage">
|
24
|
+
<h1>Table of Contents - RDoc Documentation</h1>
|
25
|
+
|
26
|
+
<h2>Pages</h2>
|
27
|
+
<ul>
|
28
|
+
<li class="file">
|
29
|
+
<a href="LICENSE_txt.html">LICENSE</a>
|
30
|
+
</li>
|
31
|
+
<li class="file">
|
32
|
+
<a href="README_rdoc.html">README</a>
|
33
|
+
|
34
|
+
<img class="toc-toggle" src="images/transparent.png" alt="" title="toggle headings">
|
35
|
+
<ul class="initially-hidden">
|
36
|
+
<li><a href="README_rdoc.html#label-bio-incanter">bio-incanter</a>
|
37
|
+
<li><a href="README_rdoc.html#label-Use+">Use </a>
|
38
|
+
<li><a href="README_rdoc.html#label-Contributing+to+bio-incanter">Contributing to bio-incanter</a>
|
39
|
+
<li><a href="README_rdoc.html#label-Copyright">Copyright</a>
|
40
|
+
</ul>
|
41
|
+
</li>
|
42
|
+
|
43
|
+
</ul>
|
44
|
+
|
45
|
+
<h2 id="classes">Classes/Modules</h2>
|
46
|
+
<ul>
|
47
|
+
<li class="class">
|
48
|
+
<a href="AreaChart.html">AreaChart</a>
|
49
|
+
</li>
|
50
|
+
<li class="class">
|
51
|
+
<a href="BarChart.html">BarChart</a>
|
52
|
+
</li>
|
53
|
+
<li class="class">
|
54
|
+
<a href="BlandAltman.html">BlandAltman</a>
|
55
|
+
</li>
|
56
|
+
<li class="class">
|
57
|
+
<a href="BoxPlot.html">BoxPlot</a>
|
58
|
+
</li>
|
59
|
+
<li class="class">
|
60
|
+
<a href="FunctionPlot.html">FunctionPlot</a>
|
61
|
+
</li>
|
62
|
+
<li class="class">
|
63
|
+
<a href="HeatMap.html">HeatMap</a>
|
64
|
+
</li>
|
65
|
+
<li class="class">
|
66
|
+
<a href="Histogram.html">Histogram</a>
|
67
|
+
</li>
|
68
|
+
<li class="class">
|
69
|
+
<a href="LineChart.html">LineChart</a>
|
70
|
+
</li>
|
71
|
+
<li class="class">
|
72
|
+
<a href="Object.html">Object</a>
|
73
|
+
</li>
|
74
|
+
<li class="class">
|
75
|
+
<a href="PieChart.html">PieChart</a>
|
76
|
+
</li>
|
77
|
+
<li class="class">
|
78
|
+
<a href="ScatterPlot.html">ScatterPlot</a>
|
79
|
+
</li>
|
80
|
+
<li class="class">
|
81
|
+
<a href="TimeChart.html">TimeChart</a>
|
82
|
+
</li>
|
83
|
+
<li class="class">
|
84
|
+
<a href="TracePlot.html">TracePlot</a>
|
85
|
+
</li>
|
86
|
+
<li class="class">
|
87
|
+
<a href="XyPlot.html">XyPlot</a>
|
88
|
+
</li>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
|
92
|
+
<h2 id="methods">Methods</h2>
|
93
|
+
<ul>
|
94
|
+
|
95
|
+
<li class="method"><a href="BoxPlot.html#method-c-new">::new — BoxPlot</a>
|
96
|
+
|
97
|
+
<li class="method"><a href="TimeChart.html#method-c-new">::new — TimeChart</a>
|
98
|
+
|
99
|
+
<li class="method"><a href="ScatterPlot.html#method-c-new">::new — ScatterPlot</a>
|
100
|
+
|
101
|
+
<li class="method"><a href="AreaChart.html#method-c-new">::new — AreaChart</a>
|
102
|
+
|
103
|
+
<li class="method"><a href="PieChart.html#method-c-new">::new — PieChart</a>
|
104
|
+
|
105
|
+
<li class="method"><a href="FunctionPlot.html#method-c-new">::new — FunctionPlot</a>
|
106
|
+
|
107
|
+
<li class="method"><a href="BarChart.html#method-c-new">::new — BarChart</a>
|
108
|
+
|
109
|
+
<li class="method"><a href="BlandAltman.html#method-c-new">::new — BlandAltman</a>
|
110
|
+
|
111
|
+
<li class="method"><a href="TracePlot.html#method-c-new">::new — TracePlot</a>
|
112
|
+
|
113
|
+
<li class="method"><a href="HeatMap.html#method-c-new">::new — HeatMap</a>
|
114
|
+
|
115
|
+
<li class="method"><a href="Histogram.html#method-c-new">::new — Histogram</a>
|
116
|
+
|
117
|
+
<li class="method"><a href="XyPlot.html#method-c-new">::new — XyPlot</a>
|
118
|
+
|
119
|
+
<li class="method"><a href="LineChart.html#method-c-new">::new — LineChart</a>
|
120
|
+
|
121
|
+
<li class="method"><a href="Object.html#method-i-check_grp">#check_grp — Object</a>
|
122
|
+
|
123
|
+
<li class="method"><a href="BarChart.html#method-i-check_par">#check_par — BarChart</a>
|
124
|
+
|
125
|
+
<li class="method"><a href="BoxPlot.html#method-i-check_par">#check_par — BoxPlot</a>
|
126
|
+
|
127
|
+
<li class="method"><a href="TimeChart.html#method-i-check_par">#check_par — TimeChart</a>
|
128
|
+
|
129
|
+
<li class="method"><a href="Histogram.html#method-i-check_par">#check_par — Histogram</a>
|
130
|
+
|
131
|
+
<li class="method"><a href="HeatMap.html#method-i-check_par">#check_par — HeatMap</a>
|
132
|
+
|
133
|
+
<li class="method"><a href="ScatterPlot.html#method-i-check_par">#check_par — ScatterPlot</a>
|
134
|
+
|
135
|
+
<li class="method"><a href="PieChart.html#method-i-check_par">#check_par — PieChart</a>
|
136
|
+
|
137
|
+
<li class="method"><a href="BlandAltman.html#method-i-check_par">#check_par — BlandAltman</a>
|
138
|
+
|
139
|
+
<li class="method"><a href="FunctionPlot.html#method-i-check_par">#check_par — FunctionPlot</a>
|
140
|
+
|
141
|
+
<li class="method"><a href="TracePlot.html#method-i-check_par">#check_par — TracePlot</a>
|
142
|
+
|
143
|
+
<li class="method"><a href="XyPlot.html#method-i-check_par">#check_par — XyPlot</a>
|
144
|
+
|
145
|
+
<li class="method"><a href="AreaChart.html#method-i-check_par">#check_par — AreaChart</a>
|
146
|
+
|
147
|
+
<li class="method"><a href="LineChart.html#method-i-check_par">#check_par — LineChart</a>
|
148
|
+
|
149
|
+
<li class="method"><a href="Object.html#method-i-check_val">#check_val — Object</a>
|
150
|
+
|
151
|
+
<li class="method"><a href="Object.html#method-i-check_val_int">#check_val_int — Object</a>
|
152
|
+
|
153
|
+
<li class="method"><a href="HeatMap.html#method-i-getFunction">#getFunction — HeatMap</a>
|
154
|
+
|
155
|
+
<li class="method"><a href="FunctionPlot.html#method-i-getFunction">#getFunction — FunctionPlot</a>
|
156
|
+
|
157
|
+
<li class="method"><a href="BoxPlot.html#method-i-getGroup">#getGroup — BoxPlot</a>
|
158
|
+
|
159
|
+
<li class="method"><a href="AreaChart.html#method-i-getGroup">#getGroup — AreaChart</a>
|
160
|
+
|
161
|
+
<li class="method"><a href="LineChart.html#method-i-getGroup">#getGroup — LineChart</a>
|
162
|
+
|
163
|
+
<li class="method"><a href="BlandAltman.html#method-i-getGroup">#getGroup — BlandAltman</a>
|
164
|
+
|
165
|
+
<li class="method"><a href="PieChart.html#method-i-getGroup">#getGroup — PieChart</a>
|
166
|
+
|
167
|
+
<li class="method"><a href="BarChart.html#method-i-getGroup">#getGroup — BarChart</a>
|
168
|
+
|
169
|
+
<li class="method"><a href="FunctionPlot.html#method-i-getMax">#getMax — FunctionPlot</a>
|
170
|
+
|
171
|
+
<li class="method"><a href="HeatMap.html#method-i-getMaxX">#getMaxX — HeatMap</a>
|
172
|
+
|
173
|
+
<li class="method"><a href="HeatMap.html#method-i-getMaxY">#getMaxY — HeatMap</a>
|
174
|
+
|
175
|
+
<li class="method"><a href="FunctionPlot.html#method-i-getMin">#getMin — FunctionPlot</a>
|
176
|
+
|
177
|
+
<li class="method"><a href="HeatMap.html#method-i-getMinX">#getMinX — HeatMap</a>
|
178
|
+
|
179
|
+
<li class="method"><a href="HeatMap.html#method-i-getMinY">#getMinY — HeatMap</a>
|
180
|
+
|
181
|
+
<li class="method"><a href="BarChart.html#method-i-getParams">#getParams — BarChart</a>
|
182
|
+
|
183
|
+
<li class="method"><a href="Histogram.html#method-i-getParams">#getParams — Histogram</a>
|
184
|
+
|
185
|
+
<li class="method"><a href="LineChart.html#method-i-getParams">#getParams — LineChart</a>
|
186
|
+
|
187
|
+
<li class="method"><a href="BlandAltman.html#method-i-getParams">#getParams — BlandAltman</a>
|
188
|
+
|
189
|
+
<li class="method"><a href="TimeChart.html#method-i-getParams">#getParams — TimeChart</a>
|
190
|
+
|
191
|
+
<li class="method"><a href="TracePlot.html#method-i-getParams">#getParams — TracePlot</a>
|
192
|
+
|
193
|
+
<li class="method"><a href="BoxPlot.html#method-i-getParams">#getParams — BoxPlot</a>
|
194
|
+
|
195
|
+
<li class="method"><a href="ScatterPlot.html#method-i-getParams">#getParams — ScatterPlot</a>
|
196
|
+
|
197
|
+
<li class="method"><a href="HeatMap.html#method-i-getParams">#getParams — HeatMap</a>
|
198
|
+
|
199
|
+
<li class="method"><a href="AreaChart.html#method-i-getParams">#getParams — AreaChart</a>
|
200
|
+
|
201
|
+
<li class="method"><a href="PieChart.html#method-i-getParams">#getParams — PieChart</a>
|
202
|
+
|
203
|
+
<li class="method"><a href="XyPlot.html#method-i-getParams">#getParams — XyPlot</a>
|
204
|
+
|
205
|
+
<li class="method"><a href="FunctionPlot.html#method-i-getParams">#getParams — FunctionPlot</a>
|
206
|
+
|
207
|
+
<li class="method"><a href="PieChart.html#method-i-getValue">#getValue — PieChart</a>
|
208
|
+
|
209
|
+
<li class="method"><a href="AreaChart.html#method-i-getValue">#getValue — AreaChart</a>
|
210
|
+
|
211
|
+
<li class="method"><a href="BarChart.html#method-i-getValue">#getValue — BarChart</a>
|
212
|
+
|
213
|
+
<li class="method"><a href="BoxPlot.html#method-i-getValue">#getValue — BoxPlot</a>
|
214
|
+
|
215
|
+
<li class="method"><a href="BlandAltman.html#method-i-getValue">#getValue — BlandAltman</a>
|
216
|
+
|
217
|
+
<li class="method"><a href="LineChart.html#method-i-getValue">#getValue — LineChart</a>
|
218
|
+
|
219
|
+
<li class="method"><a href="Histogram.html#method-i-getValue">#getValue — Histogram</a>
|
220
|
+
|
221
|
+
<li class="method"><a href="TracePlot.html#method-i-getValue">#getValue — TracePlot</a>
|
222
|
+
|
223
|
+
<li class="method"><a href="ScatterPlot.html#method-i-getValuex">#getValuex — ScatterPlot</a>
|
224
|
+
|
225
|
+
<li class="method"><a href="XyPlot.html#method-i-getValuex">#getValuex — XyPlot</a>
|
226
|
+
|
227
|
+
<li class="method"><a href="ScatterPlot.html#method-i-getValuey">#getValuey — ScatterPlot</a>
|
228
|
+
|
229
|
+
<li class="method"><a href="XyPlot.html#method-i-getValuey">#getValuey — XyPlot</a>
|
230
|
+
|
231
|
+
<li class="method"><a href="TimeChart.html#method-i-getX">#getX — TimeChart</a>
|
232
|
+
|
233
|
+
<li class="method"><a href="TimeChart.html#method-i-getY">#getY — TimeChart</a>
|
234
|
+
|
235
|
+
<li class="method"><a href="HeatMap.html#method-i-save">#save — HeatMap</a>
|
236
|
+
|
237
|
+
<li class="method"><a href="ScatterPlot.html#method-i-save">#save — ScatterPlot</a>
|
238
|
+
|
239
|
+
<li class="method"><a href="BoxPlot.html#method-i-save">#save — BoxPlot</a>
|
240
|
+
|
241
|
+
<li class="method"><a href="PieChart.html#method-i-save">#save — PieChart</a>
|
242
|
+
|
243
|
+
<li class="method"><a href="AreaChart.html#method-i-save">#save — AreaChart</a>
|
244
|
+
|
245
|
+
<li class="method"><a href="TracePlot.html#method-i-save">#save — TracePlot</a>
|
246
|
+
|
247
|
+
<li class="method"><a href="TimeChart.html#method-i-save">#save — TimeChart</a>
|
248
|
+
|
249
|
+
<li class="method"><a href="BlandAltman.html#method-i-save">#save — BlandAltman</a>
|
250
|
+
|
251
|
+
<li class="method"><a href="LineChart.html#method-i-save">#save — LineChart</a>
|
252
|
+
|
253
|
+
<li class="method"><a href="FunctionPlot.html#method-i-save">#save — FunctionPlot</a>
|
254
|
+
|
255
|
+
<li class="method"><a href="Histogram.html#method-i-save">#save — Histogram</a>
|
256
|
+
|
257
|
+
<li class="method"><a href="BarChart.html#method-i-save">#save — BarChart</a>
|
258
|
+
|
259
|
+
<li class="method"><a href="XyPlot.html#method-i-save">#save — XyPlot</a>
|
260
|
+
|
261
|
+
<li class="method"><a href="HeatMap.html#method-i-view">#view — HeatMap</a>
|
262
|
+
|
263
|
+
<li class="method"><a href="PieChart.html#method-i-view">#view — PieChart</a>
|
264
|
+
|
265
|
+
<li class="method"><a href="ScatterPlot.html#method-i-view">#view — ScatterPlot</a>
|
266
|
+
|
267
|
+
<li class="method"><a href="BoxPlot.html#method-i-view">#view — BoxPlot</a>
|
268
|
+
|
269
|
+
<li class="method"><a href="TracePlot.html#method-i-view">#view — TracePlot</a>
|
270
|
+
|
271
|
+
<li class="method"><a href="AreaChart.html#method-i-view">#view — AreaChart</a>
|
272
|
+
|
273
|
+
<li class="method"><a href="BlandAltman.html#method-i-view">#view — BlandAltman</a>
|
274
|
+
|
275
|
+
<li class="method"><a href="FunctionPlot.html#method-i-view">#view — FunctionPlot</a>
|
276
|
+
|
277
|
+
<li class="method"><a href="TimeChart.html#method-i-view">#view — TimeChart</a>
|
278
|
+
|
279
|
+
<li class="method"><a href="LineChart.html#method-i-view">#view — LineChart</a>
|
280
|
+
|
281
|
+
<li class="method"><a href="Histogram.html#method-i-view">#view — Histogram</a>
|
282
|
+
|
283
|
+
<li class="method"><a href="BarChart.html#method-i-view">#view — BarChart</a>
|
284
|
+
|
285
|
+
<li class="method"><a href="XyPlot.html#method-i-view">#view — XyPlot</a>
|
286
|
+
|
287
|
+
</ul>
|
288
|
+
|
289
|
+
|
290
|
+
<footer id="validator-badges">
|
291
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
292
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
293
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
294
|
+
</footer>
|
295
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
class AreaChart
|
2
|
+
def initialize(group,value,params)
|
3
|
+
@group=check_grp(group)
|
4
|
+
@value=check_val(value)
|
5
|
+
@params=self.check_par(params)
|
6
|
+
end
|
7
|
+
|
8
|
+
def check_par(params)
|
9
|
+
hash = Hash.new
|
10
|
+
permitted = ["title","x_label","y_label","vertical","group_by","legend","width","height","file_name"]
|
11
|
+
keys = params.keys
|
12
|
+
keys.each{ |key|
|
13
|
+
if permitted.include?(key)==false
|
14
|
+
raise "Error : Permitted key are title,x_label,y_label,vertical,group_by,legend,width,height"
|
15
|
+
end
|
16
|
+
}
|
17
|
+
|
18
|
+
if params["title"]==nil
|
19
|
+
hash["title"]="A sample Graph"
|
20
|
+
else
|
21
|
+
hash["title"]=params["title"]
|
22
|
+
end
|
23
|
+
|
24
|
+
if params["x_label"]==nil
|
25
|
+
hash["x_label"]="Categories"
|
26
|
+
else
|
27
|
+
hash["x_label"]=params["x_label"]
|
28
|
+
end
|
29
|
+
|
30
|
+
if params["y_label"]==nil
|
31
|
+
hash["y_label"]="Values"
|
32
|
+
else
|
33
|
+
hash["y_label"]=params["y_label"]
|
34
|
+
end
|
35
|
+
|
36
|
+
if params["vertical"]==nil
|
37
|
+
hash["vertical"]=true
|
38
|
+
else
|
39
|
+
hash["vertical"]=params["vertical"]
|
40
|
+
end
|
41
|
+
|
42
|
+
if params["legend"]==nil
|
43
|
+
hash["legend"]=false
|
44
|
+
else
|
45
|
+
hash["legend"]=params["legend"]
|
46
|
+
end
|
47
|
+
|
48
|
+
if params["gruop_by"]==nil
|
49
|
+
hash["group_by"]=nil
|
50
|
+
else
|
51
|
+
hash["group_by"]=params["group_by"]
|
52
|
+
end
|
53
|
+
|
54
|
+
if params["width"]==nil
|
55
|
+
hash["width"]=1500
|
56
|
+
else
|
57
|
+
hash["width"]=params["width"]
|
58
|
+
end
|
59
|
+
|
60
|
+
if params["height"]==nil
|
61
|
+
hash["height"]=800
|
62
|
+
else
|
63
|
+
hash["height"]=params["height"]
|
64
|
+
end
|
65
|
+
|
66
|
+
if params["file_name"]==nil
|
67
|
+
hash["file_name"]="sample.jpg"
|
68
|
+
else
|
69
|
+
hash["file_name"]=params["file_name"]
|
70
|
+
end
|
71
|
+
|
72
|
+
params_map = HashMap.new(hash)
|
73
|
+
return params_map
|
74
|
+
end
|
75
|
+
|
76
|
+
def getGroup
|
77
|
+
@group
|
78
|
+
end
|
79
|
+
|
80
|
+
def getValue
|
81
|
+
@value
|
82
|
+
end
|
83
|
+
|
84
|
+
def getParams
|
85
|
+
@params
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
def save
|
90
|
+
begin
|
91
|
+
a = Java::ComDomain::clocomics
|
92
|
+
a.save_area(self.getGroup,self.getValue,self.getParams)
|
93
|
+
rescue Exception => ex
|
94
|
+
end
|
95
|
+
end
|
96
|
+
def view
|
97
|
+
begin
|
98
|
+
a = Java::ComDomain::clocomics
|
99
|
+
a.view_area(self.getGroup,self.getValue,self.getParams)
|
100
|
+
rescue Exception => ex
|
101
|
+
end
|
102
|
+
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
class BarChart
|
2
|
+
# ==== Attributes
|
3
|
+
#
|
4
|
+
# * +group+ - a vector of String categories
|
5
|
+
# * +value+ - a vector of Float numeric value
|
6
|
+
# * +parms+ - an Hash whit parametrs value
|
7
|
+
#
|
8
|
+
# ==== Parms
|
9
|
+
#
|
10
|
+
# This Hash contain parmas .
|
11
|
+
# List of key permitted .
|
12
|
+
#
|
13
|
+
#
|
14
|
+
#
|
15
|
+
# * +:title+ - (default "A sample Graph") Graph main title
|
16
|
+
# * +:x_label+ - (default 'Categories') Label of x ass
|
17
|
+
# * +:y_label+ - (default 'Value') Label of y ass
|
18
|
+
# * +:legend+ - (default false) Prints legend
|
19
|
+
# * +:vertical+ - (default true) The orientation of the plot
|
20
|
+
# * +:group_by+ - (default nil) A vector of values used to group the values into series within each category.
|
21
|
+
# * +:height+ - (default 1500) Graph height
|
22
|
+
# * +:width+ - (default 800) Graph width
|
23
|
+
# * +:file_name+ - (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
|
24
|
+
#
|
25
|
+
# ==== Examples
|
26
|
+
#
|
27
|
+
# Class Usage:
|
28
|
+
#
|
29
|
+
# categories = ["uman","elf","dwarfs"]
|
30
|
+
# values = [1.0,2.0,3.0]
|
31
|
+
# params = {"title" => "Popolation of middle heart","x_label"=>"Popolation","y_label"=>"greed"}
|
32
|
+
# plot = BarChart.new(categories,values,params)
|
33
|
+
# #To view
|
34
|
+
# plot.view
|
35
|
+
# #to save
|
36
|
+
# plot.save
|
37
|
+
|
38
|
+
def initialize(group,value,params)
|
39
|
+
@group=check_grp(group)
|
40
|
+
@value=check_val(value)
|
41
|
+
@params=self.check_par(params)
|
42
|
+
end
|
43
|
+
|
44
|
+
def check_par(params)
|
45
|
+
hash = Hash.new
|
46
|
+
permitted = ["title","x_label","y_label","vertical","group_by","legend","width","height","file_name"]
|
47
|
+
keys = params.keys
|
48
|
+
keys.each{ |key|
|
49
|
+
if permitted.include?(key)==false
|
50
|
+
raise "Error : Permitted key are title,x_label,y_label,vertical,group_by,legend,width,height"
|
51
|
+
end
|
52
|
+
}
|
53
|
+
|
54
|
+
if params["title"]==nil
|
55
|
+
hash["title"]="A sample Graph"
|
56
|
+
else
|
57
|
+
hash["title"]=params["title"]
|
58
|
+
end
|
59
|
+
|
60
|
+
if params["x_label"]==nil
|
61
|
+
hash["x_label"]="Categories"
|
62
|
+
else
|
63
|
+
hash["x_label"]=params["x_label"]
|
64
|
+
end
|
65
|
+
|
66
|
+
if params["y_label"]==nil
|
67
|
+
hash["y_label"]="Values"
|
68
|
+
else
|
69
|
+
hash["y_label"]=params["y_label"]
|
70
|
+
end
|
71
|
+
|
72
|
+
if params["vertical"]==nil
|
73
|
+
hash["vertical"]=true
|
74
|
+
else
|
75
|
+
hash["vertical"]=params["vertical"]
|
76
|
+
end
|
77
|
+
|
78
|
+
if params["legend"]==nil
|
79
|
+
hash["legend"]=false
|
80
|
+
else
|
81
|
+
hash["legend"]=params["legend"]
|
82
|
+
end
|
83
|
+
|
84
|
+
if params["gruop_by"]==nil
|
85
|
+
hash["group_by"]=nil
|
86
|
+
else
|
87
|
+
hash["group_by"]=params["group_by"]
|
88
|
+
end
|
89
|
+
|
90
|
+
if params["width"]==nil
|
91
|
+
hash["width"]=1500
|
92
|
+
else
|
93
|
+
hash["width"]=params["width"]
|
94
|
+
end
|
95
|
+
|
96
|
+
if params["height"]==nil
|
97
|
+
hash["height"]=800
|
98
|
+
else
|
99
|
+
hash["height"]=params["height"]
|
100
|
+
end
|
101
|
+
|
102
|
+
if params["file_name"]==nil
|
103
|
+
hash["file_name"]="sample.jpg"
|
104
|
+
else
|
105
|
+
hash["file_name"]=params["file_name"]
|
106
|
+
end
|
107
|
+
|
108
|
+
params_map = HashMap.new(hash)
|
109
|
+
return params_map
|
110
|
+
end
|
111
|
+
|
112
|
+
def getGroup
|
113
|
+
@group
|
114
|
+
end
|
115
|
+
|
116
|
+
def getValue
|
117
|
+
@value
|
118
|
+
end
|
119
|
+
|
120
|
+
def getParams
|
121
|
+
@params
|
122
|
+
end
|
123
|
+
|
124
|
+
|
125
|
+
def save
|
126
|
+
begin
|
127
|
+
a = Java::ComDomain::clocomics
|
128
|
+
a.save_bar(self.getGroup,self.getValue,self.getParams)
|
129
|
+
rescue Exception => ex
|
130
|
+
end
|
131
|
+
end
|
132
|
+
def view
|
133
|
+
begin
|
134
|
+
a = Java::ComDomain::clocomics
|
135
|
+
a.view_bar(self.getGroup,self.getValue,self.getParams)
|
136
|
+
rescue Exception => ex
|
137
|
+
end
|
138
|
+
|
139
|
+
|
140
|
+
end
|
141
|
+
|
142
|
+
end
|