-
Notifications
You must be signed in to change notification settings - Fork 293
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 output generated with 'notebook' renderer not shown after re-opening notebook #6404
Plotly output generated with 'notebook' renderer not shown after re-opening notebook #6404
Comments
I believe the root cause of this is that until the kernel is run, the preloads won't load and therefore |
Adding to this, I can copy such a cell with blank output to another opened notebook and the contents will show up again. Pasting into the same notebook is a bit strange but also reveals the cell output. |
@rchiodo I might have been wrong about not needing require.js in the notebook renderers. Having it there might do the trick for when the preloads have not run yet. |
Please reopen if this is not resolved in the latest official release. |
Still the same behavior with latest official version 1.60 as well as insiders version1.61 (Jupyter extension v2021.8.2031190714). The log is a bit different now:
Edit: not sure how to re-open |
This is a problem with |
Internal notes: |
Repros with VSCode insiders 1.61-insiders, Jupyter v2021.9.1001261101 and Jupyter Renderers v1.0.1. |
To be validated tomorrow by Me |
I've found that the exact same code does not work in Jupyter Lab no Jupyter Notebooks. |
@DonJayamanne, it does work for me using Jupyter Notebook but one needs to be careful about the notebook being trusted otherwise it would not show any plots. For Jupyter Lab, I believe it does not support the 'notebook' renderer at all. The main reason I still need the 'notebook' renderer at times is a) it supports export to HTML with the plots included, b) plots will dynamically scale to the available cell size and in the past we also had c) 'vscode' renderer would not support Plotly animations - but c) is fixed now. For a) one could use 'vscode+notebook' as renderer setting. So the primary reasons to use the 'notebook' renderer are already dimmishing. Another thing to note is that opening the notebook after VS Code startup is just fine, it's just a start-up issue for already opened notebooks. |
thanks for getting back, I'll try this once again. |
I'm not sure if something like this already exists but I could imagine some refresh functionality similar to a browser refresh for the Jupyter notebook cells that maybe is handled by the Jupyter Notebooks Renderers extension for only specific cases, like Plotly. It could be triggered after VS Code startup such that the cell contents are re-rendered when all the required functionality is eventually available. Something like this could potentially also be used for other events like a re-render of a cell after re-size, e.g. for the Plotly 'vscode' case. Of course that should make sense for a broader use and not just be an isolated, single case solution. |
@jackthepanisher This will be fixed in the next version (I've tested this and it now works in the latest dev bits). Closing with instructions for testing in the next pre-release of the Jupyter exesnion and latest version of Jupyter Notebook Renderers Instructions for testing - see the instructions at the top of the issue. |
@DonJayamanne I tried to run the original code snippet in the issue description but the output is not rendered and here are the logs in devtools
|
I also get error messages in devtools with a blank cell being output.
|
Hmm never mind, looks like version 1.0.11 has not been published, something wrong the the vsce package |
LGTM now, thanks! |
Environment data
Expected behaviour
Plotly graphs are shown after re-opening a saved Jupyter notebook with these graphs
Actual behaviour
The ouput is blank after re-opening a notebook that contains cell output using the Plotly 'notebook' renderer. The graphs are shown correctly after re-executing the affected cells. Related to the fix for #6334 and merge #6318 with which support for the 'notebook' renderer was added.
Log output:
The logs indicate that require.js is available only after the initial try to display the cell content which fails with 404.
Steps to reproduce:
Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)The text was updated successfully, but these errors were encountered: