Class: Scruffy::Renderers::Cubed
- Defined in:
- lib/scruffy/renderers/cubed.rb
Overview
Scruffy::Renderers::Cubed
- Author
-
Brasten Sager
- Date
-
August 14th, 2006
Graph layout consisting of four separate graphs arranged in a 2x2 grid.
Constant Summary collapse
- VIEWPORT_SIZE =
[35, 30]
- VIEWPORTS =
{ :top_left => [10, 25], :top_right => [55, 25], :bottom_left => [10, 65], :bottom_right => [55, 65] }
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Helpers::Canvas
Instance Method Summary collapse
-
#define_layout ⇒ Object
Returns a Cubed instance.
Methods inherited from Base
#before_render, #initialize, #method_missing, #render
Methods included from Helpers::Canvas
#component, #remove, #reset_settings!
Constructor Details
This class inherits a constructor from Scruffy::Renderers::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Scruffy::Renderers::Base
Instance Method Details
#define_layout ⇒ Object
Returns a Cubed instance.
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/scruffy/renderers/cubed.rb', line 16 def define_layout super do |components| components << Scruffy::Components::Title.new(:title, :position => [5, 2], :size => [90, 7]) VIEWPORTS.each_pair do |category, position| components << Scruffy::Components::Viewport.new(category, :position => position, :size => VIEWPORT_SIZE, &graph_block(category)) end components << Scruffy::Components::Legend.new(:legend, :position => [5, 13], :size => [90, 5]) end end |