Tour API Demos Download Tests
Aperture version 1.0
Generated by: JsDoc Toolkit 2.4.0

Class aperture.Range

Represents an abstract model property range. Range is implemented for both scalar and ordinal properties by Scalar and Ordinal.

Class Summary
Constructor Attributes Constructor Name and Description
 
This constructor is abstract and may not be called.

Method Summary

Class Detail

aperture.Range(name)
This constructor is abstract and may not be called.
Parameters:
{String} name
the label of the property described.
Returns:
{this} a new Range

Method Detail

  • {aperture.Range} banded()
    Returns a new banded scalar view of this range. Banded views are used for axis articulation, and for scalars can also be used for quantizing values to labeled ordinal bands of values. Banded views are live, meaning subsequent range changes are allowed through either the view or its source. This method is abstract and implemented by specific types of ranges.
    Returns:
    {aperture.Range} a new scalar view of this Range.
  • end()
    Returns the end of the range. For scalars this will be the maximum of the extents, and for ordinals it will be the last case. To reset the start and end extents use the reset function.
  • {this} expand(value)
    Expands the property range to encompass the value, if necessary. This method is abstract and implemented by specific types of ranges.
    Parameters:
    {Array|Number|String} value
    a case or set of cases to include in the property range.
    Returns:
    {this} a reference to this property.
  • {String} format(value)
    Formats a value as a String using the current formatter.
    Parameters:
    value
    the value to format into a string
    Returns:
    {String} the formatted value.
  • {aperture.Format|this} formatter(formatter)
    Gets or sets the current formatter as a function. The default formatter simply uses the JavaScript String function.
    Parameters:
    {aperture.Format} formatter Optional
    if setting the formatter, a Format object which will format values.
    Returns:
    {aperture.Format|this} if getting the formatter, it will be returned, otherwise a reference to this, convenient for chained method calls.
  • {Array} get()
    Retrieves the contents of this range as an array. The content of the array depends on the type of range (e.g. Scalar, Ordinal, etc). Ordinals return the sum set of cases in the order added, whereas Scalars return a two element array of min, max or undefined if the range is yet unset. This method is abstract and implemented by specific types of ranges.
    Returns:
    {Array} array with the contents of the range
  • map(value)
    Returns the value's position within the Range object. Ranges implement this function to map data values into the range. This method is abstract and implemented by specific types of ranges.
    Parameters:
    value
    the value to map within the Range
    Returns:
    the mapped value.
  • mapKey(to)
    See the mappedTo function.
    Parameters:
    to
  • {aperture.MapKey} mappedTo(to)
    Creates a key for mapping from this model range to a visual property range. This method is abstract and implemented by specific types of ranges.
    Parameters:
    {Array} to
    the ordered set of colors or numbers to map to, from this property's range.
    Returns:
    {aperture.MapKey} a new map key.
  • {String|this} name(text)
    Gets or sets the value of the name for this property. If this is a view, the base range will be left untouched. To delete a view's name and once again fallback to the base label set the view's name value to null.
    Parameters:
    {String} text Optional
    the value, if setting it rather than getting it
    Returns:
    {String|this} the label of this property if a get, or this if a set.
  • {this} reset(values)
    Clears the property range, then optionally expands it with new values. This method is abstract and implemented by specific types of ranges.
    Parameters:
    {Array|Number} values Optional
    Returns:
    {this} a reference to this property.
  • start()
    Returns the start of the range. For scalars this will be the minimum of the extents, and for ordinals it will be the first case. To reset the start and end extents use the reset function.
  • {String} toString()
    Returns a displayable string which includes the property label and extent of the property.
    Returns:
    {String} a string.