Class: Rubyvis::Area

Inherits:
Mark show all
Includes:
AreaPrototype
Defined in:
lib/rubyvis/mark/area.rb

Overview

Represents an area mark: the solid area between two series of connected line segments. Unsurprisingly, areas are used most frequently for area charts.

<p>Just as a line represents a polyline, the Area mark type represents a polygon. However, an area is not an arbitrary polygon; vertices are paired either horizontally or vertically into parallel spans, and each span corresponds to an associated datum. Either the width or the height must be specified, but not both; this determines whether the area is horizontally-oriented or vertically-oriented. Like lines, areas can be stroked and filled with arbitrary colors.

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 AreaPrototype

#area_anchor, #area_bind, #area_build_instance, #fixed

Methods inherited from Mark

#add, #area, attr_accessor_dsl, #bar, #build, #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



214
215
216
217
# File 'lib/rubyvis/mark/area.rb', line 214

def self.defaults
  a= Rubyvis::Colors.category20
  Area.new.mark_extend(Mark.defaults).line_width(1.5).fill_style(lambda {a.scale(self.parent.index)}).interpolate('linear').tension(0.7)
end

Instance Method Details

#anchor(name) ⇒ Object



218
219
220
# File 'lib/rubyvis/mark/area.rb', line 218

def anchor(name)
  area_anchor(name)
end

#bindObject



208
209
210
# File 'lib/rubyvis/mark/area.rb', line 208

def bind
  area_bind
end

#build_implied(s) ⇒ Object



221
222
223
224
225
# File 'lib/rubyvis/mark/area.rb', line 221

def build_implied(s)
  s.height=0 if s.height.nil?
  s.width=0 if s.width.nil?
  mark_build_implied(s)
end

#build_instance(s) ⇒ Object



211
212
213
# File 'lib/rubyvis/mark/area.rb', line 211

def build_instance(s)
  area_build_instance(s)
end

#typeObject



205
206
207
# File 'lib/rubyvis/mark/area.rb', line 205

def type
  'area'
end