I would like to change the 'default' frame of my animated chart and force it to use the last date as default when the Dash application is rendered. How can I do this?
import plotly.express as px
df = px.data.gapminder()
fig = px.scatter(df, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
size="pop", color="continent", hover_name="country",
log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])
I'm trying some different approaches, like something like it:
fig.layout['sliders'][0]['active'] = 11
and
frame = -1
fig = go.Figure(fig.frames[frame].data, fig.frames[frame].layout)
fig
but it's not being reflected correctly on the chart.
Could someone give me a direction on how I can I found references about it?
I want to force the graph to start on the last year.
