# AnimationViewModel

#### new Cesium.AnimationViewModel(clockViewModel)
widgets/Source/Animation/AnimationViewModel.js 104

The view model for the `Animation` widget.

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

##### See:

- Animation

### Members

#### static Cesium.AnimationViewModel.defaultDateFormatter : AnimationViewModel.DateFormatter
widgets/Source/Animation/AnimationViewModel.js 387

Gets or sets the default date formatter used by new instances.

#### static Cesium.AnimationViewModel.defaultTicks : Array.<number>
widgets/Source/Animation/AnimationViewModel.js 398

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

#### static Cesium.AnimationViewModel.defaultTimeFormatter : AnimationViewModel.TimeFormatter
widgets/Source/Animation/AnimationViewModel.js 438

Gets or sets the default time formatter used by new instances.

#### clockViewModel : ClockViewModel
widgets/Source/Animation/AnimationViewModel.js 540

Gets the clock view model.

#### dateFormatter : AnimationViewModel.DateFormatter
widgets/Source/Animation/AnimationViewModel.js 601

Gets or sets the function which formats a date for display.

Default Value: `AnimationViewModel.defaultDateFormatter`

#### dateLabel : string
widgets/Source/Animation/AnimationViewModel.js 158

Gets the string representation of the current date. This property is observable.

#### faster : Command
widgets/Source/Animation/AnimationViewModel.js 528

Gets a command that increases the speed of animation.

#### multiplierLabel : string
widgets/Source/Animation/AnimationViewModel.js 167

Gets the string representation of the current multiplier. This property is observable.

#### pauseViewModel : ToggleButtonViewModel
widgets/Source/Animation/AnimationViewModel.js 552

Gets the pause toggle button view model.

#### playForwardViewModel : ToggleButtonViewModel
widgets/Source/Animation/AnimationViewModel.js 576

Gets the play toggle button view model.

#### playRealtimeViewModel : ToggleButtonViewModel
widgets/Source/Animation/AnimationViewModel.js 588

Gets the realtime toggle button view model.

#### playReverseViewModel : ToggleButtonViewModel
widgets/Source/Animation/AnimationViewModel.js 564

Gets the reverse toggle button view model.

#### shuttleRingAngle : number
widgets/Source/Animation/AnimationViewModel.js 189

Gets or sets the current shuttle ring angle. This property is observable.

#### shuttleRingDragging : boolean
widgets/Source/Animation/AnimationViewModel.js 122

Gets or sets whether the shuttle ring is currently being dragged. This property is observable.

Default Value: `false`

#### slower : Command
widgets/Source/Animation/AnimationViewModel.js 517

Gets a command that decreases the speed of animation.

#### snapToTicks : boolean
widgets/Source/Animation/AnimationViewModel.js 131

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`

#### timeFormatter : AnimationViewModel.TimeFormatter
widgets/Source/Animation/AnimationViewModel.js 624

Gets or sets the function which formats a time for display.

Default Value: `AnimationViewModel.defaultTimeFormatter`

#### timeLabel : string
widgets/Source/Animation/AnimationViewModel.js 149

Gets the string representation of the current time. This property is observable.

### Methods

#### getShuttleRingTicks() → Array.<number>
widgets/Source/Animation/AnimationViewModel.js 462

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.

#### setShuttleRingTicks(positiveTicks)
widgets/Source/Animation/AnimationViewModel.js 475

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.

### Type Definitions

#### Cesium.AnimationViewModel.DateFormatter(date, viewModel) → string
widgets/Source/Animation/AnimationViewModel.js 645

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.

#### Cesium.AnimationViewModel.TimeFormatter(date, viewModel) → string
widgets/Source/Animation/AnimationViewModel.js 654

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.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.