Packageflare.vis.operator.encoder
Classpublic class Encoder
InheritanceEncoder Inheritance Operator
SubclassesColorEncoder, ShapeEncoder, SizeEncoder

Base class for Operators that perform encoding of visual variables such as color, shape, and size. All Encoders share a similar structure: A source property (e.g., a data field) is mapped to a target property (e.g., a visual variable) using a ScaleBinding instance to map between values and a Palette instance to map scaled output into visual variables such as color, shape, and size.



Public Properties
 PropertyDefined by
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
  filter : Function
Boolean function indicating which items to process.
Encoder
  group : String
The name of the data group for which to compute the encoding.
Encoder
  palette : Palette
The palette used to map scale values to visual values.
Encoder
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  scale : ScaleBinding
A scale binding to the source data.
Encoder
  source : String
The source property.
Encoder
  target : String
The target property.
Encoder
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Protected Properties
 PropertyDefined by
  _binding : ScaleBinding
A scale binding to the source data.
Encoder
  _filter : Function
Boolean function indicating which items to process.
Encoder
  _t : Transitioner
A transitioner for collecting value updates.
Encoder
  _target : String
The target property.
Encoder
Public Methods
 MethodDefined by
  
Encoder(source:String = null, target:String = null, group:String, filter:* = null)
Creates a new Encoder.
Encoder
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
  
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
Encoder
  
setup():void
Setup method invoked whenever this operator's visualization property is set.
Encoder
Protected Methods
 MethodDefined by
  
encode(val:Object):*
Computes an encoding for the input value.
Encoder
Property detail
_bindingproperty
protected var _binding:ScaleBinding

A scale binding to the source data.

_filterproperty 
protected var _filter:Function

Boolean function indicating which items to process.

filterproperty 
filter:Function  [read-write]

Boolean function indicating which items to process. Only items for which this function return true will be considered by the labeler. If the function is null, all items will be considered.

Implementation
    public function get filter():Function
    public function set filter(value:Function):void

See also

groupproperty 
group:String  [read-write]

The name of the data group for which to compute the encoding.

Implementation
    public function get group():String
    public function set group(value:String):void
paletteproperty 
palette:Palette  [read-write]

The palette used to map scale values to visual values.

Implementation
    public function get palette():Palette
    public function set palette(value:Palette):void
scaleproperty 
scale:ScaleBinding  [read-write]

A scale binding to the source data.

Implementation
    public function get scale():ScaleBinding
    public function set scale(value:ScaleBinding):void
sourceproperty 
source:String  [read-write]

The source property.

Implementation
    public function get source():String
    public function set source(value:String):void
_tproperty 
protected var _t:Transitioner

A transitioner for collecting value updates.

_targetproperty 
protected var _target:String

The target property.

targetproperty 
target:String  [read-write]

The target property.

Implementation
    public function get target():String
    public function set target(value:String):void
Constructor detail
Encoder()constructor
public function Encoder(source:String = null, target:String = null, group:String, filter:* = null)

Creates a new Encoder.

Parameters
source:String (default = null) — the source property
 
target:String (default = null) — the target property
 
group:String — the data group to process
 
filter:* (default = null) — a filter function controlling which items are encoded
Method detail
encode()method
protected function encode(val:Object):*

Computes an encoding for the input value.

Parameters
val:Object — a data value to encode

Returns
* — the encoded visual value
operate()method 
public override function operate(t:Transitioner = null):void

Performs an operation over the contents of a visualization.

Parameters
t:Transitioner (default = null) — a Transitioner instance for collecting value updates.
setup()method 
public override function setup():void

Setup method invoked whenever this operator's visualization property is set.