Sha256: 891a33a7b26f27b01398b2e9fcdbf1b3f7fd94f9792151e212e7d925d27316fd

Contents?: true

Size: 764 Bytes

Versions: 4

Compression:

Stored size: 764 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

4 entries across 4 versions & 1 rubygems

Version Path
rubyvis-0.5.2 lib/rubyvis/mark/rule.rb
rubyvis-0.5.1 lib/rubyvis/mark/rule.rb
rubyvis-0.5.0 lib/rubyvis/mark/rule.rb
rubyvis-0.4.1 lib/rubyvis/mark/rule.rb