I have large Plotly figures and tables in my Jupyter Notebook and Sphinx-based documentation. Because the documentation page is already crowded, I would like to give the user an option to
or
An example of a broken layout:
Does Plotly.py offer ways to achieve this easily? If it doesn't, can I somehow include external JavaScript on the generated Sphinx documentation page for the same effect?
I would suggest two solutions and I wish one of these solution at least works for you:
Horizontal Scrollbar: deactivate the autosizing option and choose a larger value for the width:
fig.update_layout(autosize=False, width=2000)
Full-screen mode: activate the autosizing along with pop the plot up in a browser mode:
fig.update_layout(autosize=True) # remove height=800
fig.show(renderer="browser") # remove display(fig)