gruffy 0.0.7 → 0.1.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.
- checksums.yaml +4 -4
- data/lib/gruffy/base.rb +8 -5
- data/lib/gruffy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a2e0aba18f99a0d0ad130505bf71d8024eadc91
|
4
|
+
data.tar.gz: 004531b5e248e45eeaa3a445d7c21a13a3b3e179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa05615c1af2e5e7eaac57e93ef02d7685bf0d84fd148bb6fe373e959a031cd4a01ce60d0e6d3187d0bf43415e011669f8579b3621d48bf68e2d6f6bbdc5699
|
7
|
+
data.tar.gz: 2511f546e04460ffdbc8bf9aa1e654b4eab8d3ce7861f78eca26c027e50d51561d44d1791d1e17f502403771a7358426c5b2d7313524711fc4d9858c0ad0141e
|
data/lib/gruffy/base.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rmagick'
|
3
3
|
require 'bigdecimal'
|
4
|
+
require 'pp'
|
4
5
|
|
5
6
|
require File.dirname(__FILE__) + '/deprecated'
|
6
7
|
|
@@ -451,7 +452,6 @@ module Gruffy
|
|
451
452
|
end
|
452
453
|
end
|
453
454
|
|
454
|
-
|
455
455
|
protected
|
456
456
|
|
457
457
|
# Overridden by subclasses to do the actual plotting of the graph.
|
@@ -863,9 +863,9 @@ module Gruffy
|
|
863
863
|
end
|
864
864
|
end
|
865
865
|
|
866
|
-
y_offset += ((label_text.size - different_size) * 4) + 10
|
866
|
+
y_offset += ((label_text.size - different_size) * 4) + 10 unless @label_rotation.nil?
|
867
867
|
if x_offset >= @graph_left && x_offset <= @graph_right
|
868
|
-
@d.rotation = (@label_rotation.to_i * (-1))
|
868
|
+
@d.rotation = (@label_rotation.to_i * (-1)) unless @label_rotation.nil?
|
869
869
|
@d.fill = @font_color
|
870
870
|
@d.font = @font if @font
|
871
871
|
@d.stroke('transparent')
|
@@ -876,7 +876,7 @@ module Gruffy
|
|
876
876
|
1.0, 1.0,
|
877
877
|
x_offset, y_offset,
|
878
878
|
label_text, @scale)
|
879
|
-
@d.rotation = @label_rotation.to_i
|
879
|
+
@d.rotation = @label_rotation.to_i unless @label_rotation.nil?
|
880
880
|
end
|
881
881
|
@labels_seen[index] = 1
|
882
882
|
debug { @d.line 0.0, y_offset, @raw_columns, y_offset }
|
@@ -933,6 +933,7 @@ module Gruffy
|
|
933
933
|
|
934
934
|
# Make a new image at the current size with a solid +color+.
|
935
935
|
def render_solid_background(color)
|
936
|
+
@rows += ((@rows * 20) / 100) unless @label_rotation.nil?
|
936
937
|
Image.new(@columns, @rows) {
|
937
938
|
self.background_color = color
|
938
939
|
}
|
@@ -954,7 +955,8 @@ module Gruffy
|
|
954
955
|
else
|
955
956
|
gradient_fill = GradientFill.new(0, 0, 100, 0, top_color, bottom_color)
|
956
957
|
end
|
957
|
-
|
958
|
+
|
959
|
+
@rows += ((@rows * 20) / 100) unless @label_rotation.nil?
|
958
960
|
Image.new(@columns, @rows, gradient_fill)
|
959
961
|
end
|
960
962
|
|
@@ -969,6 +971,7 @@ module Gruffy
|
|
969
971
|
|
970
972
|
# Use with a theme to make a transparent background
|
971
973
|
def render_transparent_background
|
974
|
+
@rows += ((@rows * 20) / 100) unless @label_rotation.nil?
|
972
975
|
Image.new(@columns, @rows) do
|
973
976
|
self.background_color = 'transparent'
|
974
977
|
end
|
data/lib/gruffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gruffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wuttikrai Limsakul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rmagick
|