class GerbilCharts::SVGDC::SVGWin

SVGWin

a conceptual window, maps to a ā€˜g’ element in the SVG spec allows you to layer or nest easily

Attributes

ops[R]
transforms[R]

Public Class Methods

new(name, opts={}) click to toggle source
Calls superclass method GerbilCharts::SVGDC::SVGElement::new
# File lib/gerbilcharts/svgdc/svg_win.rb, line 11
def initialize(name, opts={})

      # add default options first
  # by default windows will define fill = none and stroke = black
      
  add_options("id"=> name, "fill" => "none" )

  add_options opts

  @ops=[]
      super()
end

Public Instance Methods

<<(p) click to toggle source
# File lib/gerbilcharts/svgdc/svg_win.rb, line 24
def << (p)
  @ops << p
end
add_transformation(t) click to toggle source
# File lib/gerbilcharts/svgdc/svg_win.rb, line 28
def add_transformation(t)
  @transforms=Array.new unless @transforms
  @transforms << t
end
render(xfrag) click to toggle source
# File lib/gerbilcharts/svgdc/svg_win.rb, line 33
def render(xfrag)
  h= {}
  
  if @transforms
      strt=""
      @transforms.each do |t|
        strt << t.render
      end
      h.store(:transform, strt)
  end
  
  xfrag.g(h.merge(render_attributes)) {
    @ops.each do |op|
       op.render(xfrag)
    end    
  }
end