AnimationViewModel - Cesium Documentation

# AnimationViewModel

#### new AnimationViewModel(clockViewModel)

  The view model for the `Animation` widget.

  Name | Type | Description
  --- | --- | ---
  `clockViewModel` | ClockViewModel | The ClockViewModel instance to use.

  ##### See:

  - Animation
  Source: Widgets/Animation/AnimationViewModel.js, line 110

### Members

#### staticAnimationViewModel.defaultDateFormatter :AnimationViewModel~DateFormatter

  Gets or sets the default date formatter used by new instances.
  Source: Widgets/Animation/AnimationViewModel.js, line 373

#### staticAnimationViewModel.defaultTicks

  Gets or sets the default array of known clock multipliers associated with new instances of the shuttle ring.
  Source: Widgets/Animation/AnimationViewModel.js, line 381

#### staticAnimationViewModel.defaultTimeFormatter :AnimationViewModel~TimeFormatter

  Gets or sets the default time formatter used by new instances.
  Source: Widgets/Animation/AnimationViewModel.js, line 392

#### clockViewModel :ClockViewModel

  Gets the clock view model.
  Source: Widgets/Animation/AnimationViewModel.js, line 484

#### dateFormatter :AnimationViewModel~DateFormatter

  Gets or sets the function which formats a date for display.
  Default Value: `AnimationViewModel.defaultDateFormatter`
  Source: Widgets/Animation/AnimationViewModel.js, line 545

#### dateLabel :String

  Gets the string representation of the current date. This property is observable.
  Source: Widgets/Animation/AnimationViewModel.js, line 158

#### faster :Command

  Gets a command that increases the speed of animation.
  Source: Widgets/Animation/AnimationViewModel.js, line 472

#### multiplierLabel :String

  Gets the string representation of the current multiplier. This property is observable.
  Source: Widgets/Animation/AnimationViewModel.js, line 167

#### pauseViewModel :ToggleButtonViewModel

  Gets the pause toggle button view model.
  Source: Widgets/Animation/AnimationViewModel.js, line 496

#### playForwardViewModel :ToggleButtonViewModel

  Gets the play toggle button view model.
  Source: Widgets/Animation/AnimationViewModel.js, line 520

#### playRealtimeViewModel :ToggleButtonViewModel

  Gets the realtime toggle button view model.
  Source: Widgets/Animation/AnimationViewModel.js, line 532

#### playReverseViewModel :ToggleButtonViewModel

  Gets the reverse toggle button view model.
  Source: Widgets/Animation/AnimationViewModel.js, line 508

#### shuttleRingAngle :Number

  Gets or sets the current shuttle ring angle. This property is observable.
  Source: Widgets/Animation/AnimationViewModel.js, line 189

#### shuttleRingDragging :Boolean

  Gets or sets whether the shuttle ring is currently being dragged. This property is observable.
  Default Value: `false`
  Source: Widgets/Animation/AnimationViewModel.js, line 128

#### slower :Command

  Gets a command that decreases the speed of animation.
  Source: Widgets/Animation/AnimationViewModel.js, line 461

#### snapToTicks :Boolean

  Gets or sets whether dragging the shuttle ring should cause the multiplier to snap to the defined tick values rather than interpolating between them. This property is observable.
  Default Value: `false`
  Source: Widgets/Animation/AnimationViewModel.js, line 137

#### timeFormatter :AnimationViewModel~TimeFormatter

  Gets or sets the function which formats a time for display.
  Default Value: `AnimationViewModel.defaultTimeFormatter`
  Source: Widgets/Animation/AnimationViewModel.js, line 568

#### timeLabel :String

  Gets the string representation of the current time. This property is observable.
  Source: Widgets/Animation/AnimationViewModel.js, line 149

### Methods

#### getShuttleRingTicks()

  Gets a copy of the array of positive known clock multipliers to associate with the shuttle ring.

  ##### Returns:

  The array of known clock multipliers associated with the shuttle ring.
  Source: Widgets/Animation/AnimationViewModel.js, line 406

#### setShuttleRingTicks(positiveTicks)

  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, and duplicate values will be removed.

  Name | Type | Description
  --- | --- | ---
  `positiveTicks` | Array.<Number> | The list of known positive clock multipliers to associate with the shuttle ring.

  Source: Widgets/Animation/AnimationViewModel.js, line 419

### Type Definitions

#### DateFormatter(date, viewModel) → String

  A function that formats a date for display.

  Name | Type | Description
  --- | --- | ---
  `date` | JulianDate | The date to be formatted
  `viewModel` | AnimationViewModel | The AnimationViewModel instance requesting formatting.

  ##### Returns:

  The string representation of the calendar date portion of the provided date.
  Source: Widgets/Animation/AnimationViewModel.js, line 589

#### TimeFormatter(date, viewModel) → String

  A function that formats a time for display.

  Name | Type | Description
  --- | --- | ---
  `date` | JulianDate | The date to be formatted
  `viewModel` | AnimationViewModel | The AnimationViewModel instance requesting formatting.

  ##### Returns:

  The string representation of the time portion of the provided date.
  Source: Widgets/Animation/AnimationViewModel.js, line 598