import type { TimeSliderState, TimeSliderMode, StopsByDates, StopsByInterval, StopsByCount } from "@arcgis/core/widgets/TimeSlider/types.js";A module for importing types used in the TimeSlider widget and TimeSliderViewModel.
Type definitions
TimeSliderState
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The TimeSliderViewModel's state.
- Type
- "disabled" | "ready" | "playing"
TimeSliderMode
- Type
- "instant" | "time-window" | "cumulative-from-start" | "cumulative-from-end"
StopsByDates
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Specifies an array of dates for the time slider widget. Can be used to create irregularly spaced stops.
- Example
- // Explicitly define 5 stops.const timeSlider = new TimeSlider({container: "timeSliderDiv",fullTimeExtent: {start: new Date(2000, 0, 1),end: new Date(2004, 2, 19)},timeExtent: {start: new Date(2000, 0, 1),end: new Date(2001, 3, 8)},stops: {dates: [new Date(2000, 0, 1),new Date(2001, 3, 8),new Date(2002, 0, 10),new Date(2003, 12, 8),new Date(2004, 2, 19)]}});
StopsByInterval
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Defines regularly spaced stops on the time slider from a TimeInterval. The optional TimeExtent can confine the subdivision to a specific time frame. StopByInterval is useful when the spacing is in terms of months and years, which cannot be reliably expressed in milliseconds.
interval
- Type
- TimeInterval
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Specifies a granularity of temporal data and allows you to visualize the data at specified intervals. It can be set at regular interval such as every hour or every day.
timeExtent
- Type
- TimeExtent | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
A period of time with definitive start and end dates. The time slider widget's TimeSlider.fullTimeExtent will be used if this property is not specified.
- Example
- // Add yearly intervals starting from the beginning of the TimeSlider.const timeSlider = new TimeSlider({container: "timeSliderDiv",fullTimeExtent: {start: new Date(2000, 0, 1),end: new Date(2015, 2, 19)},timeExtent: {start: new Date(2000, 0, 1),end: new Date(2001, 0, 1)},stops: {interval: {value: 1,unit: "years"}}});
StopsByCount
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Divides the time slider's TimeSlider.fullTimeExtent into equal parts. A stop will be placed at the start and end of each division resulting in count + 1 TimeSlider.effectiveStops.
count
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Number of evenly spaced divisions.
timeExtent
- Type
- TimeExtent | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The time period to divide. If unspecified, the time slider's TimeSlider.fullTimeExtent will be used.
- Example
- // Add ten evenly spaced stops.const timeSlider = new TimeSlider({container: "timeSliderDiv",fullTimeExtent: {start: new Date(2000, 0, 1),end: new Date(2004, 2, 19)},timeExtent: {start: new Date(2000, 0, 1),end: new Date(2000, 3, 8)},stops: {count: 10}});
Stops
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Defines specific locations on the time slider where thumbs will snap to when manipulated. If unspecified, ten evenly spaced stops will be added.
For continuous sliding set stops to null.
- See also
- Type
- StopsByDates | StopsByInterval | StopsByCount
Action
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Definition of an action that can be assigned to the TimeSliderViewModel.actions property on the
TimeSlider.actions or the TimeSliderViewModel.actions. It is displayed in a menu when
the user clicks the ellipsis button
on the TimeSlider widget.
icon
- Type
- Icon["icon"]
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The name of the icon to display. The value of this property must match the icon name from Calcite UI Icons.
title
- Type
- string
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The title of the action that will be displayed in the menu.
TimeSliderSettings
- Since
- ArcGIS Maps SDK for JavaScript 5.0
Settings derived from a time slider widget in a web map.
fullTimeExtent
- Type
- TimeExtent | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The temporal extent of the entire slider.
- See also
loop
- Type
- boolean
- Since
- ArcGIS Maps SDK for JavaScript 5.0
When true, the time slider will play its animation in a loop.
- See also
mode
- Type
- TimeSliderMode
playRate
- Type
- number
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The time (in milliseconds) between animation steps.
- See also
timeExtent
- Type
- TimeExtent | null | undefined
- Since
- ArcGIS Maps SDK for JavaScript 5.0
The current time extent of the time slider.
- See also