gerbilcharts 0.10.1 → 0.10.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cfbb968e895a1b19ac3ee0bbb5fbea7c3efab67
4
- data.tar.gz: c98f2a149352ece738bbf9c3cfe822b174a74da7
3
+ metadata.gz: ae218d88a23763effecb15e0346be1bf3eccd45d
4
+ data.tar.gz: c3eeeb771b06434aebf930fb4f1fea46c1a6c706
5
5
  SHA512:
6
- metadata.gz: 76d03d90f2810c6065e04fb134714472fe8d4507a75a6436b90ba392c15406fd5a138c391e8647e44ae43285357be40882efb6529c2d0848f68581249aaa63c6
7
- data.tar.gz: 792deb97e26e7b9ca61e19eba9fe4d36eb1101c80e0d3e362a7e612c325394a8618c9b36e09d889a3e2c2407f21cb1a971c2b016b5272c1510e83dc16bad7ddb
6
+ metadata.gz: 365f4a57e66319c8a216c08d98e765b8be019976a71d4f6212c2bdbd1d139568ff9be9263471a6e3c2b9cfcf0c92f139d284ba3a624c19a61a24a1f321cca959
7
+ data.tar.gz: c03e0890545ad1681c4980fdd37161a81d13cad70d124b843b8074914bddd55e8775a278a3bb305e3d4a9a1ea7027e67adc04b5bde60827c77266c19b02c4193
@@ -26,6 +26,11 @@ class LineSurface < Surface
26
26
  ry.update(-ry.rmax) if butterfly
27
27
  set_ajaxSurfaceContext(rx.rmax,ry.rmax,"LINE") if parent.usesAjax?
28
28
 
29
+
30
+ draw_ref_model_lines(g,rx,ry)
31
+ draw_range_bands(g,rx,ry)
32
+ draw_annotations(g,rx,ry)
33
+
29
34
  parent.modelgroup.each_model_with_index do |mod,i|
30
35
  mod.each_tuple do |x,y|
31
36
  y = -y if butterfly and i.odd?
@@ -55,11 +60,6 @@ class LineSurface < Surface
55
60
  g.endline(:id => "lineitem#{i}")
56
61
  end
57
62
 
58
- draw_ref_model_lines(g,rx,ry)
59
-
60
- draw_range_bands(g,rx,ry)
61
-
62
- draw_annotations(g,rx,ry)
63
63
 
64
64
  end
65
65
 
@@ -82,6 +82,15 @@ class Rect
82
82
  @bottom-@top
83
83
  end
84
84
 
85
+ def intersect_point(x,y)
86
+ x = [ x, @left].max
87
+ x = [ x, @right].min
88
+ y = [ y, @top].max
89
+ y = [ y, @bottom].min
90
+
91
+ return x,y
92
+ end
93
+
85
94
  def translate_x(newx)
86
95
  w=width
87
96
  @left=newx
@@ -95,16 +95,13 @@ class Surface < GraphElement
95
95
  xpos = scale_x anno[:x],rx
96
96
  ypos = scale_y anno[:y],ry
97
97
 
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
106
-
107
- g.circle(xpos,ypos,5)
98
+ xlab,ylab = @bounds.intersect_point( xpos + rand(-100..-30), ypos+rand(-5..+80))
99
+
100
+ g.line xpos,ypos, xlab, ylab, {:style => "stroke: #bbb"}
101
+ g.textout(xlab, ylab, anno[:label], {:class => "legendtext", :style => "text-anchor:middle"})
102
+
103
+
104
+ g.circle(xpos,ypos,2)
108
105
 
109
106
  end
110
107
 
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.1
4
+ version: 0.10.2
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-19 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shoulda