This does work in that if you run this in an ipython notebook then you will see a chart. If you zoom in on that chart then the zoom function above is triggered.
If you instead use fig.show() or streamlit.plotly_figure(fig) however the zoom function is never triggered.
There is an example case for my issue here on stack overflow. The solution of ericlavault is reproduced below:
This does work in that if you run this in an ipython notebook then you will see a chart. If you zoom in on that chart then the zoom function above is triggered.
If you instead use
fig.show()
orstreamlit.plotly_figure(fig)
however the zoom function is never triggered.