I’m wondering if anyone else is seeing this behaviour as well as:
Is this a plotly thing or a jupyter notebook thing or a mix of both?
I am iteratively creating graphs with relatively modest sized datasets (At most 150 rows). It’s all summary data, 3-5 columns * up to 150 rows.
After about 3-4 graphs created in a given page the rendering takes a huge hit in terms of speed. The page seems to freeze up and with 15+ graphs on a given notebook it can take up to 20 minutes to fully render, once it is fully rendered it’s reasonably performant (other than being very slow to switch tabs).
And plotly version: @jupyterlab/plotly-extension v0.18.1
root@47712b0e71c0:~# jupyter --version
4.4.0
root@47712b0e71c0:~# jupyter labextension list
JupyterLab v0.35.4
Known labextensions:
app dir: /opt/conda/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v0.38.1 enabled OK
@jupyterlab/hub-extension v0.12.0 enabled OK
@jupyterlab/plotly-extension v0.18.1 enabled OK
jupyterlab_bokeh v0.6.3 enabled OK
I’m mostly wondering if my use case (multiple distinctly drawn graphs in one notebook is a common or extreme edge case. And really, is anyone else seeing this or just me?
Just out of curiosity, could you try out your notebook in the classic Jupyter notebook (rather than JupyterLab), and see if the same performance issues are present? You’ll need to run plotly.offline.init_notebook_mode() once before displaying plots with plotly.offline.iplot.
This is not an isolated problem, I’m also facing it in Jupyter Lab but not in Jupyter Notebook. I will try to take a look, but I’m not familiar with the extension code.
This is happening for me too. Is there any known resolution? I really like the Jupyter Lab interface, but it’s unusable once I start creating notebooks with multiple plotly graph objects.
I’m working on a big refactor of the plotly.py rendering subsystem in https://github.com/plotly/plotly.py/pull/1474, and one of the new renderers is going to be an iframe renderer that stores each figure as a separate HTML file in a directory next to the notebook and then inserts an iframe in the notebook that references the HTML file.
I would appreciate it if some folks who have notebooks that are bogging down JupyterLab could give this branch a try (installation instructions https://github.com/plotly/plotly.py/pull/1474#issuecomment-476663406) and report back on whether the iframe renderer improves responsiveness. To use the iframe renderer on this branch, don’t call init_notebook_mode(), but do call…
import plotly.io as pio
pio.renderers.default = 'iframe'
once at the top of the notebook before displaying figure with iplot.
One limitation of the iframe renderer to be aware of is that doesn’t support responsive resizing. As of 3.8.1 the iframe renderer supports resizing.
Hi all, I’m wondering if there is a solution to a similar problem I’m having with hosting my app on a webpage (not through Jupyter notebooks). Creating the plots behind the scene happens very quickly (under 10 seconds), but it takes my browser at least 1-2 minutes just to render the plots, which takes away from UX of course. I’ve been trying to scroll through the forum and while some suggestions point to Scattergl, that didn’t help much while generating multiple plots. My plots are currently all standard Figure objects, specifically Scatter plots.
Does anybody have any ideas on how to lower the amount of time it takes for the browser to render the plots? Maybe showing them as they generate instead of all at once?