Packageflare.vis.operator.encoder
Classpublic class ColorEncoder
InheritanceColorEncoder Inheritance Encoder Inheritance Operator

Encodes a data field into color values, using a scale transform and color palette.



Public Properties
 PropertyDefined by
  colors : ColorPalette
[read-only] The palette as a ColorPalette instance.
ColorEncoder
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
 Inheritedfilter : Function
Boolean function indicating which items to process.
Encoder
 Inheritedgroup : 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.
ColorEncoder
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
 Inheritedscale : ScaleBinding
A scale binding to the source data.
Encoder
 Inheritedsource : String
The source property.
Encoder
 Inheritedtarget : String
The target property.
Encoder
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Protected Properties
 PropertyDefined by
 Inherited_binding : ScaleBinding
A scale binding to the source data.
Encoder
 Inherited_filter : Function
Boolean function indicating which items to process.
Encoder
 Inherited_t : Transitioner
A transitioner for collecting value updates.
Encoder
 Inherited_target : String
The target property.
Encoder
Public Methods
 MethodDefined by
  
ColorEncoder(source:String = null, group:String, target:String = "lineColor", scaleType:String = null, palette:ColorPalette = null)
Creates a new ColorEncoder.
ColorEncoder
 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.
ColorEncoder
  
setup():void
Setup method invoked whenever this operator's visualization property is set.
ColorEncoder
Protected Methods
 MethodDefined by
  
encode(val:Object):*
Computes an encoding for the input value.
ColorEncoder
  
Returns a default color palette based on the input scale.
ColorEncoder
Property detail
colorsproperty
colors:ColorPalette  [read-only]

The palette as a ColorPalette instance.

Implementation
    public function get colors():ColorPalette
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
Constructor detail
ColorEncoder()constructor
public function ColorEncoder(source:String = null, group:String, target:String = "lineColor", scaleType:String = null, palette:ColorPalette = null)

Creates a new ColorEncoder.

Parameters
source:String (default = null) — the source property
 
group:String — the data group to encode ("nodes" by default)
 
target:String (default = "lineColor") — the target property ("lineColor" by default)
 
scaleType:String (default = null) — the type of scale to use. If null, the scale type will be determined by the underlying ScaleBinding instance, based on the type of data.
 
palette:ColorPalette (default = null) — the color palette to use. If null, a default color palette will be determined based on the scale type.
Method detail
encode()method
protected override function encode(val:Object):*

Computes an encoding for the input value.

Parameters
val:Object — a data value to encode

Returns
* — the encoded visual value
getDefaultPalette()method 
protected function getDefaultPalette():ColorPalette

Returns a default color palette based on the input scale.

Returns
ColorPalette — a default color palette for the input scale
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.