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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5c584ee0d6942f0e076280c64c955bb7597788c
4
- data.tar.gz: 7d54dd6e3cb3627d949ce1713ddd8d159bd34936
3
+ metadata.gz: 7ff69449367e93d41472413a5e52f5d3d0bc1cb8
4
+ data.tar.gz: 15b24c7f59686d894e1975d47a53d3b2f1afbb6c
5
5
  SHA512:
6
- metadata.gz: 0abe0159731e42234cd8cf0aa26b12f0a150a6e405b71bcc1a32dad76feb7a6740a0563b41388ea2df6a9676213e5e99d26485a84cc63571d59ad46be461455a
7
- data.tar.gz: 21ce985ca72ed248ebcf7723cfda8e3edb2245b00b39065c2028566e60031f98d0e9071148cd30eb603558ce033ad71e56d2e9916d112fe8c1acbd636b2ab9f7
6
+ metadata.gz: 21bd6238e6087b78393a251ffba1ef7a6c2f7d789eb0638ebb31ad8f5adba95bf230df94cb29d1eddcb226202aeb6a7c1548b0b2411acd293fb6e3762ebf6c8b
7
+ data.tar.gz: 92e4194a6f7c613678568bd55c7d064b5d46d50d1fa317fa7f097c43786bab0cc4d995eb3f73611ce0c3f76c7736168eee2bdbad2a35a3ed694fb039704bce1d
data/README.md CHANGED
@@ -15,3 +15,7 @@ Install it yourself:
15
15
  ## Usage
16
16
 
17
17
  $ cat mydata | graphit -o graph.bmp
18
+
19
+ ## Example Output
20
+
21
+ <img src="https://raw.githubusercontent.com/jeffmcfadden/graphit/master/test-01.png" />
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Graphit
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeffmcfadden