jagthedrummer-scruffy 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/scruffy/renderers/axis_legend.rb +41 -0
- data/lib/scruffy/version.rb +1 -1
- metadata +2 -1
@@ -0,0 +1,41 @@
|
|
1
|
+
module Scruffy::Renderers
|
2
|
+
class AxisLegend < Empty
|
3
|
+
|
4
|
+
def define_layout
|
5
|
+
super do |components|
|
6
|
+
components << Scruffy::Components::Title.new(:title, :position => [5, 2], :size => [90, 7])
|
7
|
+
|
8
|
+
|
9
|
+
components << Scruffy::Components::Viewport.new(:view, :position => [6, 22], :size => [90, 66]) do |graph|
|
10
|
+
graph << Scruffy::Components::ValueMarkers.new(:values, :position => [0, 2], :size => [8, 89])
|
11
|
+
graph << Scruffy::Components::Grid.new(:grid, :position => [10, 0], :size => [90, 89], :stroke_width => 1)
|
12
|
+
graph << Scruffy::Components::VGrid.new(:vgrid, :position => [10, 0], :size => [90, 89], :stroke_width => 1)
|
13
|
+
graph << Scruffy::Components::DataMarkers.new(:labels, :position => [10, 92], :size => [90, 8])
|
14
|
+
graph << Scruffy::Components::Graphs.new(:graphs, :position => [10, 0], :size => [90, 89])
|
15
|
+
end
|
16
|
+
components << Scruffy::Components::YLegend.new(:y_legend, :position => [1, 26], :size => [5, 66])
|
17
|
+
components << Scruffy::Components::XLegend.new(:x_legend, :position => [5, 92], :size => [90, 6])
|
18
|
+
components << Scruffy::Components::Legend.new(:legend, :position => [5, 13], :size => [90, 6])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
23
|
+
def hide_values
|
24
|
+
super
|
25
|
+
component(:view).position[0] = -10
|
26
|
+
component(:view).size[0] = 100
|
27
|
+
end
|
28
|
+
|
29
|
+
def labels
|
30
|
+
[component(:view).component(:labels)]
|
31
|
+
end
|
32
|
+
|
33
|
+
def values
|
34
|
+
[component(:view).component(:values)]
|
35
|
+
end
|
36
|
+
|
37
|
+
def grids
|
38
|
+
[component(:view).component(:grid),component(:view).component(:vgrid)]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/scruffy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jagthedrummer-scruffy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brasten Sager
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- lib/scruffy/renderers/pie.rb
|
85
85
|
- lib/scruffy/renderers/empty.rb
|
86
86
|
- lib/scruffy/renderers/cubed.rb
|
87
|
+
- lib/scruffy/renderers/axis_legend.rb
|
87
88
|
- lib/scruffy/formatters.rb
|
88
89
|
- lib/scruffy/helpers.rb
|
89
90
|
- lib/scruffy/layers.rb
|