Class: Rubyvis::SceneElement
- Includes:
- Enumerable
- Defined in:
- lib/rubyvis/sceneelement.rb
Instance Attribute Summary collapse
-
#_g ⇒ Object
Returns the value of attribute _g.
-
#angle ⇒ Object
Returns the value of attribute angle.
-
#antialias ⇒ Object
Returns the value of attribute antialias.
-
#bottom ⇒ Object
Returns the value of attribute bottom.
-
#canvas ⇒ Object
Returns the value of attribute canvas.
-
#child_index ⇒ Object
Returns the value of attribute child_index.
-
#children ⇒ Object
Returns the value of attribute children.
-
#cursor ⇒ Object
Returns the value of attribute cursor.
-
#data ⇒ Object
Returns the value of attribute data.
-
#defs ⇒ Object
Returns the value of attribute defs.
-
#eccentricity ⇒ Object
Returns the value of attribute eccentricity.
-
#end_angle ⇒ Object
Returns the value of attribute end_angle.
-
#events ⇒ Object
Returns the value of attribute events.
-
#fill_style ⇒ Object
Returns the value of attribute fill_style.
-
#font ⇒ Object
Returns the value of attribute font.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image ⇒ Object
Returns the value of attribute image.
-
#image_height ⇒ Object
Returns the value of attribute image_height.
-
#image_width ⇒ Object
Returns the value of attribute image_width.
-
#inner_radius ⇒ Object
Returns the value of attribute inner_radius.
-
#interpolate ⇒ Object
Returns the value of attribute interpolate.
-
#layers ⇒ Object
Returns the value of attribute layers.
-
#left ⇒ Object
Returns the value of attribute left.
-
#line_join ⇒ Object
Returns the value of attribute line_join.
-
#line_width ⇒ Object
Returns the value of attribute line_width.
-
#mark ⇒ Object
Returns the value of attribute mark.
-
#name ⇒ Object
Returns the value of attribute name.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#order ⇒ Object
Returns the value of attribute order.
-
#orient ⇒ Object
Returns the value of attribute orient.
-
#outer_radius ⇒ Object
Returns the value of attribute outer_radius.
-
#overflow ⇒ Object
Returns the value of attribute overflow.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#parent_index ⇒ Object
Returns the value of attribute parent_index.
-
#reverse ⇒ Object
Returns the value of attribute reverse.
-
#right ⇒ Object
Returns the value of attribute right.
-
#segmented ⇒ Object
Returns the value of attribute segmented.
-
#shape ⇒ Object
Returns the value of attribute shape.
-
#shape_angle ⇒ Object
Returns the value of attribute shape_angle.
-
#shape_radius ⇒ Object
Returns the value of attribute shape_radius.
-
#shape_size ⇒ Object
Returns the value of attribute shape_size.
-
#start_angle ⇒ Object
Returns the value of attribute start_angle.
-
#stroke_style ⇒ Object
Returns the value of attribute stroke_style.
-
#target ⇒ Object
Returns the value of attribute target.
-
#tension ⇒ Object
Returns the value of attribute tension.
-
#text ⇒ Object
Returns the value of attribute text.
-
#text_align ⇒ Object
Returns the value of attribute text_align.
-
#text_angle ⇒ Object
Returns the value of attribute text_angle.
-
#text_baseline ⇒ Object
Returns the value of attribute text_baseline.
-
#text_decoration ⇒ Object
Returns the value of attribute text_decoration.
-
#text_margin ⇒ Object
Returns the value of attribute text_margin.
-
#text_shadow ⇒ Object
Returns the value of attribute text_shadow.
-
#text_style ⇒ Object
Returns the value of attribute text_style.
-
#title ⇒ Object
Returns the value of attribute title.
-
#top ⇒ Object
Returns the value of attribute top.
-
#transform ⇒ Object
Returns the value of attribute transform.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#visible ⇒ Object
Returns the value of attribute visible.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #[](v) ⇒ Object
- #[]=(v, i) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ SceneElement
constructor
A new instance of SceneElement.
- #inspect ⇒ Object
- #push(v) ⇒ Object
- #size ⇒ Object
- #size=(v) ⇒ Object
Constructor Details
#initialize ⇒ SceneElement
Returns a new instance of SceneElement.
3 4 5 |
# File 'lib/rubyvis/sceneelement.rb', line 3 def initialize @scenes=Array.new end |
Instance Attribute Details
#_g ⇒ Object
Returns the value of attribute _g.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def _g @_g end |
#angle ⇒ Object
Returns the value of attribute angle.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def angle @angle end |
#antialias ⇒ Object
Returns the value of attribute antialias.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def antialias @antialias end |
#bottom ⇒ Object
Returns the value of attribute bottom.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def bottom @bottom end |
#canvas ⇒ Object
Returns the value of attribute canvas.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def canvas @canvas end |
#child_index ⇒ Object
Returns the value of attribute child_index.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def child_index @child_index end |
#children ⇒ Object
Returns the value of attribute children.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def children @children end |
#cursor ⇒ Object
Returns the value of attribute cursor.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def cursor @cursor end |
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def data @data end |
#defs ⇒ Object
Returns the value of attribute defs.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def defs @defs end |
#eccentricity ⇒ Object
Returns the value of attribute eccentricity.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def eccentricity @eccentricity end |
#end_angle ⇒ Object
Returns the value of attribute end_angle.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def end_angle @end_angle end |
#events ⇒ Object
Returns the value of attribute events.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def events @events end |
#fill_style ⇒ Object
Returns the value of attribute fill_style.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def fill_style @fill_style end |
#font ⇒ Object
Returns the value of attribute font.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def font @font end |
#height ⇒ Object
Returns the value of attribute height.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def id @id end |
#image ⇒ Object
Returns the value of attribute image.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def image @image end |
#image_height ⇒ Object
Returns the value of attribute image_height.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def image_height @image_height end |
#image_width ⇒ Object
Returns the value of attribute image_width.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def image_width @image_width end |
#inner_radius ⇒ Object
Returns the value of attribute inner_radius.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def inner_radius @inner_radius end |
#interpolate ⇒ Object
Returns the value of attribute interpolate.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def interpolate @interpolate end |
#layers ⇒ Object
Returns the value of attribute layers.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def layers @layers end |
#left ⇒ Object
Returns the value of attribute left.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def left @left end |
#line_join ⇒ Object
Returns the value of attribute line_join.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def line_join @line_join end |
#line_width ⇒ Object
Returns the value of attribute line_width.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def line_width @line_width end |
#mark ⇒ Object
Returns the value of attribute mark.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def mark @mark end |
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def name @name end |
#offset ⇒ Object
Returns the value of attribute offset.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def offset @offset end |
#order ⇒ Object
Returns the value of attribute order.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def order @order end |
#orient ⇒ Object
Returns the value of attribute orient.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def orient @orient end |
#outer_radius ⇒ Object
Returns the value of attribute outer_radius.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def outer_radius @outer_radius end |
#overflow ⇒ Object
Returns the value of attribute overflow.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def overflow @overflow end |
#parent ⇒ Object
Returns the value of attribute parent.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def parent @parent end |
#parent_index ⇒ Object
Returns the value of attribute parent_index.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def parent_index @parent_index end |
#reverse ⇒ Object
Returns the value of attribute reverse.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def reverse @reverse end |
#right ⇒ Object
Returns the value of attribute right.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def right @right end |
#segmented ⇒ Object
Returns the value of attribute segmented.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def segmented @segmented end |
#shape ⇒ Object
Returns the value of attribute shape.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def shape @shape end |
#shape_angle ⇒ Object
Returns the value of attribute shape_angle.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def shape_angle @shape_angle end |
#shape_radius ⇒ Object
Returns the value of attribute shape_radius.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def shape_radius @shape_radius end |
#shape_size ⇒ Object
Returns the value of attribute shape_size.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def shape_size @shape_size end |
#start_angle ⇒ Object
Returns the value of attribute start_angle.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def start_angle @start_angle end |
#stroke_style ⇒ Object
Returns the value of attribute stroke_style.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def stroke_style @stroke_style end |
#target ⇒ Object
Returns the value of attribute target.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def target @target end |
#tension ⇒ Object
Returns the value of attribute tension.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def tension @tension end |
#text ⇒ Object
Returns the value of attribute text.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text @text end |
#text_align ⇒ Object
Returns the value of attribute text_align.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_align @text_align end |
#text_angle ⇒ Object
Returns the value of attribute text_angle.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_angle @text_angle end |
#text_baseline ⇒ Object
Returns the value of attribute text_baseline.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_baseline @text_baseline end |
#text_decoration ⇒ Object
Returns the value of attribute text_decoration.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_decoration @text_decoration end |
#text_margin ⇒ Object
Returns the value of attribute text_margin.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_margin @text_margin end |
#text_shadow ⇒ Object
Returns the value of attribute text_shadow.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_shadow @text_shadow end |
#text_style ⇒ Object
Returns the value of attribute text_style.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def text_style @text_style end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def title @title end |
#top ⇒ Object
Returns the value of attribute top.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def top @top end |
#transform ⇒ Object
Returns the value of attribute transform.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def transform @transform end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def type @type end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def url @url end |
#visible ⇒ Object
Returns the value of attribute visible.
7 8 9 |
# File 'lib/rubyvis/sceneelement.rb', line 7 def visible @visible end |
#width ⇒ Object
Returns the value of attribute width.
8 9 10 |
# File 'lib/rubyvis/sceneelement.rb', line 8 def width @width end |
Instance Method Details
#[](v) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/rubyvis/sceneelement.rb', line 17 def [](v) if v.is_a? Numeric @scenes[v] elsif v.nil? nil elsif self.respond_to? v self.send(v) end end |
#[]=(v, i) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rubyvis/sceneelement.rb', line 10 def []=(v,i) if v.is_a? Numeric @scenes[v]=i elsif self.respond_to?(v.to_s+"=") self.send(v.to_s+"=",i) end end |
#each ⇒ Object
26 27 28 29 30 |
# File 'lib/rubyvis/sceneelement.rb', line 26 def each @scenes.each do |v| yield v end end |
#inspect ⇒ Object
37 38 39 40 |
# File 'lib/rubyvis/sceneelement.rb', line 37 def inspect elements_id=@scenes.map{|e| '<'+ e.object_id.to_s(16)+'>'}.join(", ") "<SE #{object_id.to_s(16)} (#{type}), elements: #{self.size} (#{elements_id}), children: #{children ? children.size : '0'}, data: #{data ? data.to_s: ''}>" end |
#push(v) ⇒ Object
31 32 33 |
# File 'lib/rubyvis/sceneelement.rb', line 31 def push(v) @scenes.push(v) end |
#size ⇒ Object
34 35 36 |
# File 'lib/rubyvis/sceneelement.rb', line 34 def size @scenes.size end |
#size=(v) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/rubyvis/sceneelement.rb', line 41 def size=(v) if self.size==v return true elsif self.size<v (v-self.size).times {push(nil)} else self.slice!(0,v) end end |