| Package | flare.scale |
| Class | public class QuantileScale |
| Inheritance | QuantileScale Scale |
flare.util.Maths.quantile method.
See also
| Property | Defined by | ||
|---|---|---|---|
| flush : Boolean
Flag indicating if the scale bounds should be flush with the data.
| QuantileScale | ||
![]() | labelFormat : String
Formatting pattern for formatting labels for scale values.
| Scale | |
| max : Object [read-only] The maximum data value backing this scale.
| QuantileScale | ||
| min : Object [read-only] The minimum data value backing this scale.
| QuantileScale | ||
| scaleType : String [read-only] A string indicating the type of scale this is.
| QuantileScale | ||
| Method | Defined by | ||
|---|---|---|---|
|
QuantileScale(n:int, values:Array, sorted:Boolean = false, labelFormat:String)
Creates a new QuantileScale.
| QuantileScale | ||
|
Returns a cloned copy of the scale.
| QuantileScale | ||
|
interpolate(value:Object):Number
Returns an interpolation fraction indicating the position of the input
value within the scale range.
| QuantileScale | ||
![]() |
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.
| QuantileScale | ||
|
values(num:int = -1):Array
Returns a set of label values for this scale.
| QuantileScale | ||
| flush | property |
flush:Boolean [read-write]Flag indicating if the scale bounds should be flush with the data. If true, the scale should be flush with the data range, such that the min and max values should sit directly on the extremes of the scale. If false, the scale should be padded as needed to make the scale more readable and human-friendly.
Implementation public function get flush():Boolean
public function set flush(value:Boolean):void
| 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
| scaleType | property |
scaleType:String [read-only]A string indicating the type of scale this is.
Implementation public function get scaleType():String
| QuantileScale | () | constructor |
public function QuantileScale(n:int, values:Array, sorted:Boolean = false, labelFormat:String)Creates a new QuantileScale.
Parametersn:int — the number of quantiles desired
|
|
values:Array — the data values to organized into quantiles
|
|
sorted:Boolean (default = false) — flag indicating if the input values array is
already pre-sorted
|
|
labelFormat:String — the formatting pattern for value labels
|
| clone | () | method |
public override function clone():ScaleReturns a cloned copy of the scale.
ReturnsScale —
a cloned scale.
|
| 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
|