Class: Scruffy::Components::VGrid
- Includes:
- Helpers::Marker
- Defined in:
- lib/scruffy/components/grid.rb
Instance Attribute Summary collapse
-
#markers ⇒ Object
Returns the value of attribute markers.
Attributes inherited from Base
#id, #options, #position, #size, #visible
Instance Method Summary collapse
Methods included from Helpers::Marker
Methods inherited from Base
#initialize, #process, #render
Constructor Details
This class inherits a constructor from Scruffy::Components::Base
Instance Attribute Details
#markers ⇒ Object
Returns the value of attribute markers.
20 21 22 |
# File 'lib/scruffy/components/grid.rb', line 20 def markers @markers end |
Instance Method Details
#draw(svg, bounds, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/scruffy/components/grid.rb', line 24 def draw(svg, bounds, ={}) markers = ([:key_markers] || self.markers) || 5 stroke_width = [:stroke_width] each_marker(markers, [:min_key], [:max_key], bounds[:width], , :key_formatter) do |label, x| svg.line(:x1 => x, :y1 => 0, :x2 => x, :y2 => bounds[:height], :style => "stroke: #{[:theme].marker.to_s}; stroke-width: #{stroke_width};") end end |