import {WidgetPreview} from '@site/src/doc-demos/widgets'; import {_TimelineWidget} from '@deck.gl/widgets';
This widget provides a time slider with play/pause controls. Configure a time range, step interval, and play speed to animate data over time.
import {_TimelineWidget as TimelineWidget} from '@deck.gl/widgets';
import {Deck} from '@deck.gl/core';
const deck = new Deck({
widgets: [
new TimelineWidget({
timeRange: [0, 24],
step: 1,
playInterval: 500
})
]
});The TimelineWidget accepts the generic WidgetProps:
id(default'timeline') - Unique id for this widgetplacement(default'top-left') - Widget position within the view relative to the map containerviewId(defaultnull) - TheviewIdprop controls how a widget interacts with views.style(default{}) - Additional inline styles on the top HTML element.className(default'') - Additional classnames on the top HTML element.
Default: 'timeline'
Unique identifier for the widget.
Default: 'bottom-left'
Widget position within the view. Valid options: top-left, top-right, bottom-left, bottom-right, fill.
Default: [0, 100]
Minimum and maximum values for the time slider.
Default: 1
Increment step for the slider and play animation.
Default: timeRange[0]
Starting value of the slider.
(value: number) => void
Callback invoked when the time value changes (drag or play).
Default: 1000
Interval in milliseconds between automatic time increments when playing.