| Package | flare.scale |
| Class | public class OrdinalScale |
| Inheritance | OrdinalScale Scale |
| Property | Defined by | ||
|---|---|---|---|
![]() | flush : Boolean
Flag indicating if the scale bounds should be flush with the data.
| Scale | |
![]() | labelFormat : String
Formatting pattern for formatting labels for scale values.
| Scale | |
| length : int [read-only] The number of distinct values in this scale.
| OrdinalScale | ||
| max : Object [read-only] The maximum data value backing this scale.
| OrdinalScale | ||
| min : Object [read-only] The minimum data value backing this scale.
| OrdinalScale | ||
| ordinals : Array The ordered data array defining this scale.
| OrdinalScale | ||
| scaleType : String [read-only] A string indicating the type of scale this is.
| OrdinalScale | ||
| Method | Defined by | ||
|---|---|---|---|
|
OrdinalScale(ordinals:Array = null, flush:Boolean = false, copy:Boolean = true, labelFormat:String = null)
Creates a new OrdinalScale.
| OrdinalScale | ||
|
Returns a cloned copy of the scale.
| OrdinalScale | ||
|
index(value:Object):int
Returns the index of the input value in the ordinal array
| OrdinalScale | ||
|
interpolate(value:Object):Number
Returns an interpolation fraction indicating the position of the input
value within the scale range.
| OrdinalScale | ||
![]() |
label(value:Object):String
Returns a string label representing a value in this scale.
| Scale | |
|
lookup(f:Number):Object
Performs a reverse lookup, returning an object value corresponding
to a interpolation fraction along the scale range.
| OrdinalScale | ||
|
values(num:int = -1):Array
Returns a set of label values for this scale.
| OrdinalScale | ||
| Method | Defined by | ||
|---|---|---|---|
|
buildLookup():void
Builds a lookup table for mapping values to their indices.
| OrdinalScale | ||
| length | property |
length:int [read-only]The number of distinct values in this scale.
Implementation public function get length():int
| max | property |
max:Object [read-only]The maximum data value backing this scale. Note that the actual maximum scale value may be higher if the scale is not flush.
Implementation public function get max():Object
| min | property |
min:Object [read-only]The minimum data value backing this scale. Note that the actual minimum scale value may be lower if the scale is not flush.
Implementation public function get min():Object
| ordinals | property |
ordinals:Array [read-write]The ordered data array defining this scale.
Implementation public function get ordinals():Array
public function set ordinals(value:Array):void
| scaleType | property |
scaleType:String [read-only]A string indicating the type of scale this is.
Implementation public function get scaleType():String
| OrdinalScale | () | constructor |
public function OrdinalScale(ordinals:Array = null, flush:Boolean = false, copy:Boolean = true, labelFormat:String = null)Creates a new OrdinalScale.
Parametersordinals:Array (default = null) — an ordered array of data values to include in the
scale
|
|
flush:Boolean (default = false) — the flush flag for scale padding
|
|
copy:Boolean (default = true) — flag indicating if a copy of the input data array should
be made. True by default.
|
|
labelFormat:String (default = null) — the formatting pattern for value labels
|
| buildLookup | () | method |
protected function buildLookup():voidBuilds a lookup table for mapping values to their indices.
| clone | () | method |
public override function clone():ScaleReturns a cloned copy of the scale.
ReturnsScale —
a cloned scale.
|
| index | () | method |
public function index(value:Object):intReturns the index of the input value in the ordinal array
Parametersvalue:Object — the value to lookup
|
int — the index of the input value. If the value is not contained
in the ordinal array, this method returns -1.
|
| interpolate | () | method |
public override function interpolate(value:Object):NumberReturns an interpolation fraction indicating the position of the input value within the scale range.
Parametersvalue:Object — a data value for which to return an interpolation
fraction along the data scale
|
Number — the interpolation fraction of the value in the data scale
|
| lookup | () | method |
public override function lookup(f:Number):ObjectPerforms a reverse lookup, returning an object value corresponding to a interpolation fraction along the scale range.
Parametersf:Number — the interpolation fraction
|
Object — the scale value at the interpolation fraction. May return
null if no value corresponds to the input fraction.
|
| values | () | method |
public override function values(num:int = -1):ArrayReturns a set of label values for this scale.
Parametersnum:int (default = -1) — a desired target number of labels. This parameter is
handled idiosyncratically by different scale sub-classes.
|
Array — an array of label values for the scale
|