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

When loading .ipynb, charts flash for a second, then disappear #2782

Closed
2 of 17 tasks
pkese opened this issue Mar 1, 2023 · 4 comments · Fixed by #2838
Closed
2 of 17 tasks

When loading .ipynb, charts flash for a second, then disappear #2782

pkese opened this issue Mar 1, 2023 · 4 comments · Fixed by #2838

Comments

@pkese
Copy link
Contributor

pkese commented Mar 1, 2023

Describe the bug

Please provide as much information as you can.

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

  • OS
    • Windows 11
    • Windows 10
    • macOS
    • Linux (Please specify distro: Ubuntu 22.04)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Firefox
    • Safari
  • Frontend
    • Jupyter Notebook
    • Jupyter Lab
    • nteract
    • Visual Studio Code 1.75.1, Polyglot Notebooks v1.0.4102020, .NET runtimes 6.0.14 and 7.0.3
    • Visual Studio Code Insiders
    • Visual Studio
    • Other (please specify)

Screenshots

When I open existing notebook, containing Plotly charts, charts appear for a second and then disappear a second later.
image
image

@pkese
Copy link
Contributor Author

pkese commented Mar 1, 2023

I can't upload .ipynb file directly to this issue, so I've uploaded it to a gist: https://gist.github.com/pkese/ff5b127396fbc6eec029dbe7ffed43ae

@pkese
Copy link
Contributor Author

pkese commented Mar 1, 2023

More analysis:

Charts flash only the first time after I load the file.
Each next time, the same file opens without all outputs empty.

It seems as if contents of cells are being cached someplace
(otherwise why would vscode render the same notebook (same exact file, no diffs) differently depending on whether it was loaded the first time after saving it, or second, third, fourth time).

Chart data is actually always present in the file. If I rename the file to something else and open that renamed file, charts will again appear (or more precisely, flash for a second then disappear).

When file initially loads (with charts showing), it is marked as unchanged.
After cell contents disappears, file is marked as changed (vscode will mark it as modified).

Vscode won't ask me to save the modified file when I try to close vscode.
Apparently it automatically saves modified files itself someplace locally.
It will then load the same file (marked as modified from the very beginning) upon restart of vscode.
This may explain my previous 'caching' comment: if it loads a file that was in modified state before closing vscode, it loads file content from some local cache.

@pkese
Copy link
Contributor Author

pkese commented Mar 1, 2023

A more precise timeline with images:

  1. I render all cells and save the file, my window looks as follows (input fields are marked with fsharp Code in the bottom right):
    image

  2. I reload vscode window with Crtl-Shift-P + Reload window.
    Initially the window looks as this for a second (input fields are marked with F#, status line is showing Detecting Kernels):
    image

  3. Then a second latter charts (and all outputs) appear (input fields are marked with F#, status line is showing Detecting Kernels, source code highlighting is applied):
    image

  4. Then a second later everything disappears and file is marked as modified (input fields are marked with fsharp Code again, status line is now showing .NET interactive, cell sequence numbers [1], [2] are gone):
    image

@pkese pkese changed the title After loading .ipynb, charts pop up, then disappear When loading .ipynb, charts flash for a second, then disappear Mar 1, 2023
@pkese
Copy link
Contributor Author

pkese commented Mar 1, 2023

This is not a new bug. I've been noticing this behavior for the last several (e.g. six) months.
I remember that it used to work correctly long time in the past.

@jonsequitur jonsequitur added the bug Something isn't working label Mar 14, 2023
@jonsequitur jonsequitur self-assigned this Mar 15, 2023
jonsequitur added a commit to jonsequitur/interactive that referenced this issue Mar 15, 2023
@jonsequitur jonsequitur mentioned this issue Mar 15, 2023
jonsequitur added a commit to jonsequitur/interactive that referenced this issue Mar 15, 2023
jonsequitur added a commit that referenced this issue Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants