The time series widget enables you to display animated data (by aggregation) over a specified date or numeric field. Time series widgets provide a status bar of the animation, controls to play or pause, and the ability to filter on a range of values.
To see available parameters run help(time_series_widget)
.
In the example below, collisions in Seattle are animated by the date they occured. The number of incidents over time are shown in the time series widget bars.
In [1]:
from cartoframes.auth import set_default_credentials
from cartoframes.viz import Layer, animation_style, time_series_widget
set_default_credentials('cartoframes')
In [2]:
Layer(
'seattle_collisions',
animation_style('incdate', duration=20, fade_in=0.5, fade_out=0.5),
widgets=[
time_series_widget(
value='incdate',
title='Number of Collisions by Date',
description= 'Play, pause, or select a range for the animation'
)]
)
Out[2]: