AnimationViewModel

AnimationViewModel

new

The ViewModel for the Animation widget.

Parameters:
Name Type Argument Description
clockViewModel ClockViewModel <optional>
The ClockViewModel instance to use.
Throws:
DeveloperError : clockViewModel is required.
See:
Source:

Members

:ClockViewModel

The ClockViewModel instance to use.

:Observable

The string representation of the current date.

:Command

The command to increase the speed of animation.

:Observable

The string representation of the current multiplier.

:ToggleButtonViewModel

The pause toggle button.

:ToggleButtonViewModel

The play toggle button.

:ToggleButtonViewModel

The realtime toggle button.

:ToggleButtonViewModel

The reverse toggle button.

:Observable

The current shuttle ring Angle.

:Observable

Indicates if the shuttle ring is currently being dragged.

:Command

The command to decrease the speed of animation.

:Observable

A boolean observable indicating if dragging the shuttle ring should cause the multiplier to snap to the defined tick values rather than interpolating between them.
Default Value:
  • false

:Observable

The string representation of the current time.

<static>

Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.

Methods

Returns:
Function The current date format function.

Returns:
The array of known clock multipliers associated with the shuttle ring.

Returns:
Function The current time format function.

Sets the current date format function.

Parameters:
Name Type Description
dateFormatter Function A function which takes a JulianDate and an AnimationViewModel instance and returns a string representation of the calendar date portion.
Throws:
DeveloperError : timeFormatter must be a function.

Sets the array of positive known clock multipliers to associate with the shuttle ring. These values will have negative equivalents created for them and sets both the minimum and maximum range of values for the shuttle ring as well as the values that are snapped to when a single click is made. The values need not be in order, as they will be sorted automatically.

Parameters:
Name Type Description
positiveTicks The list of known positive clock multipliers to associate with the shuttle ring.
Throws:
DeveloperError : positiveTicks is required.

Sets the current time format function.

Parameters:
Name Type Description
timeFormatter Function A function which takes a JulianDate and an AnimationViewModel instance and returns a string representation of the time portion.
Throws:
DeveloperError : timeFormatter must be a function.

<static>

The default date formatter used by new instances.

Parameters:
Name Type Description
date JulianDate The date to be formatted
viewModel AnimationViewModel The AnimationViewModel instsance requesting formatting.
Returns:
String The string representation of the calendar date portion of the provided date.

<static>

The default time formatter used by new instances.

Parameters:
Name Type Description
date JulianDate The date to be formatted
viewModel AnimationViewModel The AnimationViewModel instsance requesting formatting.
Returns:
String The string representation of the time portion of the provided date.