ipywidgets
ipywidgets copied to clipboard
voila doesn't display widgets with ipywidgets-8
When using ipwidgets-8 (tested with b1 and rc0), voila does not display the widgets, where it works flawlessly with ipywidgets-7 (7.6.5).
Minimal example cell :
import ipywidgets as widgets w = widgets.Label(value = 'Test') display(w)
environment :
- python 3.10.2
- voila 0.3.3
I use poetry but I uploaded minimal examples to my github repo :
- https://github.com/ruomad/test-ipywidgets-7
- https://github.com/ruomad/test-ipywidgets-8
I use poetry but the examples run on heroku (voila):
- https://test-ipywidgets-7.herokuapp.com
- https://test-ipywidgets-8.herokuapp.com
No error as far as I can tell in the logs. I'm attaching an extract of a diff between voila debug logs
Thanks for opening an issue. This is an expected behavior, we'll need to update voila when ipywidgets 8 is released.
Related https://github.com/voila-dashboards/voila/pull/1046
To further document the issue, I see the same problem with ipywidgets 7.7.0, where it works with ipywidgets-7.6.5 (probably related to the backports in 7.7.0)
Oh, I believe this might be related indeed, but we probably don't want Voila to break when ipywidgets 7.7 is out. I will test it out, thanks!
OK I have a minimal example of what 7.7.0 breaks in my app. I use grid.
import ipywidgets as widgets
grid = widgets.GridspecLayout(2, 2)
w0 = widgets.Label('Test')
w1 = widgets.Dropdown(options = [100, 200], value = 100)
#grid = widgets.GridspecLayout(2, 2)
grid[0, 0] = w0
grid[0, 1] = w1
display(grid)
The above doesn't show up in voila (both standalone and as a jupyterlab extension). If I uncomment the second 'grid =...' line it works (ie displacing the grid initialization AFTER widgets definition). Hope this gives you a clue.
From the console errors (Uncaught (in promise) Error: widget model not found), it seems that there is some problem with voila fetching the widget state. That was changed in 7.7 (and 8.0) with utility functions in the base widget manager, now available in the jlab widget manager.
I faced with the same issue with 8.0.7 ipywidgets version. Could you tell me what solution is here?
Which Voila version are you using? Voila 0.4.x works with ipywidgets 8