niivue / ipyniivue

A WebGL-powered Jupyter Widget for Niivue based on anywidget
BSD 2-Clause "Simplified" License
25 stars 8 forks source link

Model not displayed when loading an .ipynb file #10

Closed AnthonyAndroulakis closed 1 year ago

AnthonyAndroulakis commented 1 year ago

Describe the bug When opening an .ipynb file that has already been run, the results section shows the error message:
Error displaying widget: model not found

To Reproduce Steps to reproduce the behavior:

  1. Install ipyniivue using the installation steps. If needed, install yarn using npm install -g yarn
  2. Open jupyter lab using jupyter lab
  3. Open the examples -> introduction.ipynb file
  4. Under the 2nd code block, there is the message Error displaying widget: model not found

Expected behavior A black background canvas with the red text "Waiting for images..." should display. This should be cached somehow.

Screenshots

current output
AnthonyAndroulakis commented 1 year ago

Turns out this is not a bug. The jupyter notebook must be run first. Then, if the notebook is saved and reloaded, the model state will be saved (widget will show from previous run).