Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Range

Range object keeps track of a Group of n-dimensional Pts to provide its minimum, maximum, and magnitude in each dimension. It also provides convenient functions such as mapping the Group to another range.

Hierarchy

  • Range

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Construct a Range instance for a Group of Pts,

    Parameters

    Returns Range

Properties

Protected _dims

_dims: number = 0

Protected _mag

_mag: Pt

Protected _max

_max: Pt

Protected _min

_min: Pt

Protected _source

_source: Group

Accessors

magnitude

  • get magnitude(): Pt
  • Get this Range's magnitude in each dimension

    Returns Pt

max

  • get max(): Pt
  • Get this Range's maximum values per dimension

    Returns Pt

min

  • get min(): Pt
  • Get this Range's minimum values per dimension

    Returns Pt

Methods

append

  • append(g: GroupLike, update?: boolean): this
  • Add more Pts to this Range and recalculate its min and max values

    Parameters

    • g: GroupLike

      a Group or an array of Pts to append to this Range

    • Default value update: boolean = true

      Optional. Set the parameter to false if you want to append without immediately updating this Range's min and max values. Default is true.

    Returns this

calc

  • calc(): this
  • Go through the group and find its min and max values. Usually you don't need to call this function directly.

    Returns this

mapTo

  • mapTo(min: number, max: number, exclude?: boolean[]): Group
  • Map this Range to another range of values

    Parameters

    • min: number

      target range's minimum value

    • max: number

      target range's maximum value

    • Optional exclude: boolean[]

      Optional boolean array where true means excluding the conversion in that specific dimension.

    Returns Group

ticks

  • ticks(count: number): Group
  • Create a number of evenly spaced "ticks" that span this Range's min and max value.

    Parameters

    • count: number

      number of subdivision. For example, 10 subdivision will return 11 tick values, which include first(min) and last(max) values.

    Returns Group

Generated using TypeDoc