svg_plot_gen 1.1.0 → 1.1.1
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/lib/svg_plot_gen.rb +8 -0
- data/svg_plot_gen.gemspec +1 -1
- metadata +8 -8
data/lib/svg_plot_gen.rb
CHANGED
@@ -5,6 +5,13 @@ require 'nokogiri'
|
|
5
5
|
require 'color'
|
6
6
|
require 'trollop'
|
7
7
|
|
8
|
+
# A little overload for float that turns whole number floats (like 5.0) into integers.
|
9
|
+
class Float
|
10
|
+
def whole_to_i
|
11
|
+
to_i == self ? to_i : self
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
8
15
|
class Svg_Plot_Gen
|
9
16
|
def self.gen
|
10
17
|
# Command line options
|
@@ -112,6 +119,7 @@ class Svg_Plot_Gen
|
|
112
119
|
.map { |y| [(yend - (y[0] - opts.y_first)*(ylen.to_f/(opts.y_last - opts.y_first))).round(1), y[1]] }]
|
113
120
|
# Build up our y-axis labels
|
114
121
|
ylabels = y_range
|
122
|
+
.map{ |i| i.whole_to_i }
|
115
123
|
.zip(ylines
|
116
124
|
.select { |k, v| v } # Select only major ticks
|
117
125
|
.map { |k, v| k })
|
data/svg_plot_gen.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "svg_plot_gen"
|
3
3
|
s.summary = "Creates the axes and gridlines for a graph in SVG. Perfect for creating a static background to which live data can be added."
|
4
|
-
s.version = "1.1.
|
4
|
+
s.version = "1.1.1"
|
5
5
|
s.date = Time.now.strftime('%Y-%m-%d')
|
6
6
|
s.author = "Richard Meadows"
|
7
7
|
s.homepage = "https://github.com/richardeoin/svg-plot-gen"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svg_plot_gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|
16
|
-
requirement: &
|
16
|
+
requirement: &7265360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *7265360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &7283680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.5'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *7283680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: color
|
38
|
-
requirement: &
|
38
|
+
requirement: &7282920 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '1.4'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *7282920
|
47
47
|
description:
|
48
48
|
email:
|
49
49
|
executables:
|