gerbilcharts 0.10.0 → 0.10.1

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: 463652e497be145b0f44cef398008ed555b7f0da
4
- data.tar.gz: 05a9cdaa19116dbf6c56d8c85c8bab62cf55948d
3
+ metadata.gz: 8cfbb968e895a1b19ac3ee0bbb5fbea7c3efab67
4
+ data.tar.gz: c98f2a149352ece738bbf9c3cfe822b174a74da7
5
5
  SHA512:
6
- metadata.gz: af622b8b57abb84ee854306abdaf11e30b5a9fc265f71ff1bbd4d49b790f67b70350f7fb2caff1daed2dcbae30384116752e045eed996bcc62193f28112cb7e3
7
- data.tar.gz: 78236e46462ae49bfd94bbac1a7853072e8f0ec485d07a2386c9fcb41c90c4f07cfd0bcae8b4ddd98f5078faeb5f17e51167f5d54fb112f73bc08fc85c2583a4
6
+ metadata.gz: 76d03d90f2810c6065e04fb134714472fe8d4507a75a6436b90ba392c15406fd5a138c391e8647e44ae43285357be40882efb6529c2d0848f68581249aaa63c6
7
+ data.tar.gz: 792deb97e26e7b9ca61e19eba9fe4d36eb1101c80e0d3e362a7e612c325394a8618c9b36e09d889a3e2c2407f21cb1a971c2b016b5272c1510e83dc16bad7ddb
@@ -97,7 +97,14 @@ class Rect
97
97
  def to_s
98
98
  "#{@left},#{@top} [w=#{width} h=#{height}]"
99
99
  end
100
+
101
+ def rand_h(margin=30)
102
+ rand( (@top-margin)..(@bottom-margin))
103
+ end
100
104
 
105
+ def rand_w(margin=30)
106
+ rand( (@left-margin)..(@right-margin))
107
+ end
101
108
  end
102
109
 
103
110
  end
@@ -95,11 +95,14 @@ class Surface < GraphElement
95
95
  xpos = scale_x anno[:x],rx
96
96
  ypos = scale_y anno[:y],ry
97
97
 
98
- g.line xpos,ypos, xpos, ypos-20
99
-
100
- g.textout(xpos, ypos-20,
101
- anno[:label],
102
- {:class => "reflinelabel"})
98
+ if ypos - 20 > @bounds.top + 10
99
+ g.line xpos,ypos, xpos, ypos-20
100
+ g.textout(xpos, ypos-20, anno[:label], {:class => "reflinelabel"})
101
+ else
102
+ rh = @bounds.rand_h
103
+ g.line xpos,ypos, xpos, rh
104
+ g.textout(xpos, rh, anno[:label], {:class => "reflinelabel"})
105
+ end
103
106
 
104
107
  g.circle(xpos,ypos,5)
105
108
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gerbilcharts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-16 00:00:00.000000000 Z
11
+ date: 2015-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda