graphit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/exe/graphit +26 -6
- data/lib/graphit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ff69449367e93d41472413a5e52f5d3d0bc1cb8
|
4
|
+
data.tar.gz: 15b24c7f59686d894e1975d47a53d3b2f1afbb6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21bd6238e6087b78393a251ffba1ef7a6c2f7d789eb0638ebb31ad8f5adba95bf230df94cb29d1eddcb226202aeb6a7c1548b0b2411acd293fb6e3762ebf6c8b
|
7
|
+
data.tar.gz: 92e4194a6f7c613678568bd55c7d064b5d46d50d1fa317fa7f097c43786bab0cc4d995eb3f73611ce0c3f76c7736168eee2bdbad2a35a3ed694fb039704bce1d
|
data/README.md
CHANGED
data/exe/graphit
CHANGED
@@ -11,6 +11,22 @@ OptionParser.new do |opts|
|
|
11
11
|
options[:verbose] = v
|
12
12
|
end
|
13
13
|
|
14
|
+
opts.on("--ymin [ymin]", Float) do |ymin|
|
15
|
+
options[:ymin] = ymin
|
16
|
+
end
|
17
|
+
|
18
|
+
opts.on("--ymax [ymax]", Float) do |ymax|
|
19
|
+
options[:ymax] = ymax
|
20
|
+
end
|
21
|
+
|
22
|
+
opts.on("--height [h]", Integer) do |h|
|
23
|
+
options[:height] = h
|
24
|
+
end
|
25
|
+
|
26
|
+
opts.on("--width [w]", Integer) do |w|
|
27
|
+
options[:width] = w
|
28
|
+
end
|
29
|
+
|
14
30
|
opts.on("-o", "--output-file [file]", "Filename") do |of|
|
15
31
|
options[:outputfile] = of
|
16
32
|
end
|
@@ -123,11 +139,15 @@ options[:outputfile] = "graph.bmp" if options[:outputfile].nil?
|
|
123
139
|
[1,0,0,0,1],
|
124
140
|
[1,0,0,0,1]]
|
125
141
|
|
126
|
-
@h = 300
|
127
|
-
@w = 1050
|
142
|
+
@h = options[:height] || 300
|
143
|
+
@w = options[:width] || 1050
|
144
|
+
|
145
|
+
@ymin = options[:ymin] || 40
|
146
|
+
@ymax = options[:ymax] || 95
|
147
|
+
|
148
|
+
puts "h: #{@h}, w: #{@w}"
|
149
|
+
puts "ymin: #{@ymin}, ymax: #{@ymax}"
|
128
150
|
|
129
|
-
@ymin = 40
|
130
|
-
@ymax = 95
|
131
151
|
@xmin = 1458621300
|
132
152
|
@xmax = 1458770444
|
133
153
|
|
@@ -237,7 +257,7 @@ end
|
|
237
257
|
def graph_data( data, pixels, color )
|
238
258
|
|
239
259
|
# Horizontal Grid lines
|
240
|
-
(@ymin..@ymax).each do |y|
|
260
|
+
(@ymin.to_i..@ymax.to_i).each do |y|
|
241
261
|
if y % @y_tics_mod == 0
|
242
262
|
p1 = translate_data_point_to_graph_point( { y: y, x: @xmin } )
|
243
263
|
p2 = translate_data_point_to_graph_point( { y: y, x: @xmax } )
|
@@ -350,7 +370,7 @@ File.open( options[:outputfile], 'w') do |f|
|
|
350
370
|
@xmax = 0
|
351
371
|
|
352
372
|
ARGF.each_line do |line|
|
353
|
-
puts line
|
373
|
+
# puts line
|
354
374
|
l = line.strip.split(":")
|
355
375
|
|
356
376
|
next unless l.size == 2
|
data/lib/graphit/version.rb
CHANGED