Class: Scruffy::Renderers::Standard

Inherits:
Empty
  • Object
show all
Defined in:
lib/scruffy/renderers/standard.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Attributes included from Helpers::Canvas

#components

Instance Method Summary collapse

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_layoutObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/scruffy/renderers/standard.rb', line 4

def define_layout
  super do |components|
    components << Scruffy::Components::Title.new(:title, :position => [5, 2], :size => [90, 7])
    components << Scruffy::Components::Viewport.new(:view, :position => [2, 26], :size => [90, 66]) do |graph|
      graph << Scruffy::Components::ValueMarkers.new(:values, :position => [0, 2], :size => [8, 89])
      graph << Scruffy::Components::Grid.new(:grid, :position => [10, 0], :size => [90, 89], :stroke_width => 1)
      graph << Scruffy::Components::VGrid.new(:vgrid, :position => [10, 0], :size => [90, 89], :stroke_width => 1)
      graph << Scruffy::Components::DataMarkers.new(:labels, :position => [10, 92], :size => [90, 8])
      graph << Scruffy::Components::Graphs.new(:graphs, :position => [10, 0], :size => [90, 89])
    end
    components << Scruffy::Components::Legend.new(:legend, :position => [5, 13], :size => [90, 6])
  end
end