I am using plotly express to display an animated line chart in streamlit. I would like the animation to loop. Google’s AI suggested the following, but it does not work. Is there any good way to get the animation to loop? (I also tried it outside of streamlit and that didn’t work either so don’t think streamlit is the problem). Can’t imagine that I’m the first one to want to loop an animation but couldn’t find very much on how to do this.
fig = px.line( data_frame = df,
x='x', y='y',
animation_frame='phase',
markers='True',
)
play_button = fig.layout.updatemenus\[0\].buttons\[0\]
play_button.args\[1\]\["mode"\] = "immediate"
play_button.args\[1\]\["frame"\]\["redraw"\] = True
st.plotly_chart(fig)