<jupyter_start><jupyter_text>Animation widgetThe animation widget includes an animation status bar and controls to play or pause animated data. The `filter` property of your map's style, applied to either a date or numeric field, drives both the animation and the widget. Only **one** animation can be controlled per layer. To learn more about creating animations visit: [Animated visualizations](https://carto.com/developers/carto-vl/guides/animated-visualizations/). To see available parameters run `help(animation_widget)`.In the example below, collisions in Seattle are animated by the date they occured.<jupyter_code>from cartoframes.auth import set_default_credentials

set_default_credentials('cartoframes')
from cartoframes.viz import Layer, animation_widget, animation_style

Layer(
    'seattle_collisions',
    style=animation_style('incdate', color='blue', duration=20),
    widgets=[
        animation_widget(
            title='Collision Date',
            description= 'Play, pause, or select the range of the animation'
        )]
)<jupyter_output><empty_output><jupyter_text>Using dates in a DataFrameWhen animating data from a DataFrame, the columns that need to be treated as **Dates** should be `datetime` format<jupyter_code>import pandas as pd
import geopandas

data = {
    'date_column': ['2019-11-10', '2019-11-11', '2019-11-12', '2019-11-13', '2019-11-14', '2019-11-15'],
    'lon': [50, 40, 30, 50, 30, 40],
    'lat': [0, 1, 2, 3, 2, 1]
}

df = pd.DataFrame(data)
df['date_column']= pd.to_datetime(df['date_column'])
gdf = geopandas.GeoDataFrame(df, geometry=geopandas.points_from_xy(df.lon, df.lat))

Layer(
    gdf,
    style=animation_style('date_column', color='blue', size=20, duration=20),
    widgets=animation_widget(title='November')
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11653718091009989, 'fraction_numerical': 0.03995560488346282, 'mean_word_length': 5.15358361774744, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '568628', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 615, 'n_tokens_neox': 552, 'n_words': 170, 'path': 'docs/examples/data_visualization/widgets/animation_widget.ipynb', 'repo_name': 'CartoDB/cartoframes', 'size': '1802'}