PositionHelper

Position helper.

Constructor

new PositionHelper(view)

Parameters:
NameTypeDescription
viewView

The associated view.

Classes

PositionHelper

Methods

decrementPosition(dim) → {boolean}

Decrement the current position along the provided dim.

Parameters:
NameTypeDescription
dimnumber

The direction in which to decrement.

Returns:

True if possible and in bounds.

Type: 
boolean

decrementPositionAlongScroll() → {boolean}

Decrement the current position along the scroll dimension.

Returns:

True if possible and in bounds.

Type: 
boolean

getCurrentIndex() → {Index}

Get the current index.

Returns:

The current index.

Type: 
Index

getCurrentPosition() → {Point}

Get the current position.

Returns:

The current position.

Type: 
Point

getCurrentPositionAtDimValue(dim, value) → {Point}

Get the current position updated at the provided dimension index with the input value.

Parameters:
NameTypeDescription
dimnumber

The dimension.

valuenumber

The value to used at dimension index.

Returns:

The position.

Type: 
Point

getCurrentPositionAtScrollValue(value) → {Point}

Get the current position updated at scroll index with the input value.

Parameters:
NameTypeDescription
valuenumber

The value to use at scroll index.

Returns:

The position.

Type: 
Point

getCurrentPositionDimValue(dim) → {number}

Get the value at dimension index for the current position.

Parameters:
NameTypeDescription
dimnumber

The dimension.

Returns:

The value.

Type: 
number

getCurrentPositionScrollValue() → {number}

Get the value at scroll index for the current position.

Returns:

The value.

Type: 
number

getDecrementPosition(dim) → {Point}

Get the current position decremented in the input direction.

Parameters:
NameTypeDescription
dimnumber

The direction in which to decrement.

Returns:

The resulting point.

Type: 
Point

getGeometry() → {Geometry}

Get the geometry.

Returns:

The geometry.

Type: 
Geometry

getIncrementPosition(dim) → {Point}

Get the current position incremented in the input direction.

Parameters:
NameTypeDescription
dimnumber

The direction in which to increment.

Returns:

The resulting point.

Type: 
Point

getMaximumDimValue(dim) → {number}

Get the maximum dimension value.

Parameters:
NameTypeDescription
dimnumber

The dimension.

Returns:

The maximum value.

Type: 
number

getMaximumScrollValue() → {number}

Get the maximum scroll value.

Returns:

The maximum value.

Type: 
number

getScrollDimIndex() → {number}

Get the scroll index.

Returns:

The scroll index.

Type: 
number

incrementPosition(dim) → {boolean}

Increment the current position along the provided dim.

Parameters:
NameTypeDescription
dimnumber

The direction in which to increment.

Returns:

True if possible and in bounds.

Type: 
boolean

incrementPositionAlongScroll() → {boolean}

Increment the current position along the scroll dimension.

Returns:

True if possible and in bounds.

Type: 
boolean

isPositionInBounds(position) → {boolean}

Check if the current position (default) or the provided position is in bounds.

Parameters:
NameTypeDescription
positionPoint

Optional position.

Returns:

True is the position is in bounds.

Type: 
boolean

merge(rhs)

Merge with another helper.

Parameters:
NameTypeDescription
rhsPositionHelper

The helper to merge with this one.

setCurrentPosition(position, silentopt) → {boolean}

Set the current position.

Parameters:
NameTypeAttributesDescription
positionPoint

The position.

silentboolean<optional>

Flag to fire event or not.

Returns:

True if possible and in bounds.

Type: 
boolean

setCurrentPositionSafe(position, silentopt) → {boolean}

Set the current position only if it is in the geometry bounds.

Parameters:
NameTypeAttributesDescription
positionPoint

The position.

silentboolean<optional>

Flag to fire event or not.

Returns:

True if possible and in bounds.

Type: 
boolean