Sha256: cd4b15a14875fbc13e5258d2a70d150b01be8bd82e373b5fdd66c44e29ef8766

Contents?: true

Size: 757 Bytes

Versions: 7

Compression:

Stored size: 757 Bytes

Contents

module Rubyvis
  # Alias for Rubyvis::Rule
  def self.Rule
    Rubyvis::Rule
  end
  class Rule < Mark
    include LinePrototype
    @properties=Mark.properties.dup
    attr_accessor_dsl :width, :height, :line_width, [:stroke_style, lambda {|d| Rubyvis.color(d)}]
    def self.defaults
      Rule.new.mark_extend(Mark.defaults).line_width(1).stroke_style('black').antialias(false)
    end
    def type
      'rule'
    end

    def anchor(name)
      line_anchor(name)
    end
    def build_implied(s)
      l=s.left
      r=s.right
      t=s.top
      b=s.bottom
      
      if((!s.width.nil?) or ((l.nil?) and (r.nil?)) or ((!r.nil?) and (!l.nil?)))
        s.height=0
      else
        s.width=0
      end
      mark_build_implied(s)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubyvis-0.3.6 lib/rubyvis/mark/rule.rb
rubyvis-0.3.5 lib/rubyvis/mark/rule.rb
rubyvis-0.3.4 lib/rubyvis/mark/rule.rb
rubyvis-0.3.3 lib/rubyvis/mark/rule.rb
rubyvis-0.3.2 lib/rubyvis/mark/rule.rb
rubyvis-0.3.1 lib/rubyvis/mark/rule.rb
rubyvis-0.3.0 lib/rubyvis/mark/rule.rb