Class: Rubyvis::Rule

Inherits:
Mark show all
Includes:
LinePrototype
Defined in:
lib/rubyvis/mark/rule.rb

Instance Attribute Summary

Attributes inherited from Mark

#_properties, #binds, #child_index, #parent, #proto, #root, #scale, #scene, #target

Class Method Summary collapse

Instance Method Summary collapse

Methods included from LinePrototype

#line_anchor

Methods included from AreaPrototype

#area_anchor, #area_bind, #area_build_instance, #fixed

Methods inherited from Mark

#add, #area, attr_accessor_dsl, #bar, #bind, #build, #build_instance, #build_properties, #context, #context_apply, #context_clear, #cousin, #delete_index, #dot, #event, #execute, #first, #image, index, #index, index=, #index=, #index_defined?, #initialize, #instance, #instances, #label, #last, #layout_arc, #layout_cluster, #layout_grid, #layout_horizon, #layout_indent, #layout_matrix, #layout_pack, #layout_partition, #layout_partition_fill, #layout_stack, #layout_tree, #layout_treemap, #line, #margin, #mark_anchor, #mark_bind, #mark_build_implied, #mark_build_instance, #mark_build_properties, #mark_extend, mark_method, #panel, #properties, properties, property_method, #property_value, #render, #rule, scene, scene=, #sibling, stack, stack=, #wedge

Constructor Details

This class inherits a constructor from Rubyvis::Mark

Class Method Details

.defaultsObject



10
11
12
# File 'lib/rubyvis/mark/rule.rb', line 10

def self.defaults
  Rule.new.mark_extend(Mark.defaults).line_width(1).stroke_style('black').antialias(false)
end

Instance Method Details

#anchor(name) ⇒ Object



18
19
20
# File 'lib/rubyvis/mark/rule.rb', line 18

def anchor(name)
  line_anchor(name)
end

#build_implied(s) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/rubyvis/mark/rule.rb', line 21

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

#typeObject



14
15
16
# File 'lib/rubyvis/mark/rule.rb', line 14

def type
  'rule'
end