Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotly graphs stop loading if many are loaded in the same notebook #15549

Open
amunger opened this issue Apr 16, 2024 · 6 comments
Open

Plotly graphs stop loading if many are loaded in the same notebook #15549

amunger opened this issue Apr 16, 2024 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-output perf Performance issues

Comments

@amunger
Copy link
Contributor

amunger commented Apr 16, 2024

From linked issue:

Keeping up with the Plotly graphs within VSCode Insiders and all the pre-releases, I did a Kaggle notebook with a lot of them (you can find it here When downloading the code, its size is only 52MB, and the same code in VSCode (with more or less the same imports) has a size of 94.1 MB. At the end of the post I attach both notebooks.

Additionally to the above, when running the entire notebook (meaning clicking "Run All") with the Plotly graphs in interactive mode (where you can hover over the data and so), the graphs do not render, although the code runs amazingly fast. It is necessary to execute cell by cell to have the graphs rendered properly (although some of them throw an error). This didn't happen on Kaggle, where I executed all the cells and the graphs rendered normally.

Also something very strange is that if I try to open the Kaggle's notebook in VSCode, I get this error:

Screenshot 2024-04-14 at 17 04 26

My apologies in advance for flooding the comments over the weekend 😅

Best

kaggle_code.ipynb.zip

vscode_code.ipynb.zip

Originally posted by @ale-dg in #14459 (comment)

@amunger amunger self-assigned this Apr 16, 2024
@amunger amunger added the perf Performance issues label Apr 16, 2024
@amunger
Copy link
Contributor Author

amunger commented Apr 16, 2024

other relevant comment from the same thread:

regarding the Plotly graphs, when working with a notebook and executing several times the cells (i.e. when changing colours or adjusting elements or so), the graphs begin to render REALLY slow and, sometimes, they do not render at all. Also the notebooks keep being really large. See attached, both for seeing them not rendering and the size of the file once decompressed (around 94MB).

@ale-dg
Copy link

ale-dg commented Apr 24, 2024

HI @amunger

Quick question, has anything moved regarding this? I have made a notebook with only 11 graphs and the size of it goes up to 110 MB, and without the graphs the size of the file is just 80 kb (even though I am loading a csv of 2.5 GB).

Thanks

Best

@amunger
Copy link
Contributor Author

amunger commented Apr 29, 2024

@ale-dg We haven't made any adjustments that would affect the file size - I believe it would be similar sizes if you were to use jupyter lab.
Are you still seeing graphs failing to load correctly after the other performance changes that we made? Could you post a screenshot of what it actually looks like so I can see if I can hit the same thing.

@ale-dg
Copy link

ale-dg commented Apr 29, 2024

@amunger I have notices a better performance on the Plotly graphs. They now render better and faster. I don't know if setting this code affected, but definitely there has been an improvement even though I am working with large files (i.e. 417413 rows and 26 columns):

import plotly.io as pio
pio.renders.default = 'vscode'

I was asking that because it blew my mind that I read a csv of 2.5 GB and the notebook without graphs is very light and when plotting blows up all the way to 100 MB.

Best

@ale-dg
Copy link

ale-dg commented May 3, 2024

HI @amunger

I was checking the new stable version and was able to repro the issue with the Plotly graphs not rendering. See the screenshots below. It is strange that only a few load and the next DO load, but if I hover over the bad graphs, they show info.

Hope this helps.

Best

Screenshot 2024-05-02 at 22 03 29

Screenshot 2024-05-02 at 22 04 03

@ale-dg
Copy link

ale-dg commented May 3, 2024

Btw, I just ran the same cell again, and now got this:

Screenshot 2024-05-02 at 22 13 01

Best

@amunger amunger added bug Issue identified by VS Code Team member as probable bug notebook-output labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug notebook-output perf Performance issues
Projects
None yet
Development

No branches or pull requests

2 participants