interact-based widgets do not render
In the Using Interact example notebook, the horizontal slider does not render when the interact code is executed.
from __future__ import print_function
from ipywidgets import interact, interactive, fixed, interact_manual
import ipywidgets as widgets
def f(x):
return x
interact(f, x=10);
I did some investigating on this, and it is caused by the model being different than the other models we deal with. Instead of having the information we normally expect, it has a list of child models. I'll try to get a fix for this tomorrow.
If that’s the case, then it is probably also related to the issue around Boxes and Accordions not rendered correctly because they are child_views.
Let us know what you find out.
nteract/nteract#4640 for sake of tracking. I'll investigate both
I was able to dig deeper into this, and it may be a tricky one to fix. It basically follows these steps:
- Kernel sends a message for a new model, "model_1", with a state like this (notice the empty children):
state: {
box_style: ""
children: []
layout: "IPY_MODEL_38e17f2743414a148d7ea0856a910eec"
_dom_classes: ["widget-interact"]
_model_module: "@jupyter-widgets/controls"
_model_module_version: "1.5.0"
_model_name: "VBoxModel"
_view_count: null
_view_module: "@jupyter-widgets/controls"
_view_module_version: "1.5.0"
_view_name: "VBoxView"
}
- After some time, kernel sends an "update" message to "model_1"
data: {
buffer_paths: []
method: "update"
state: {
children: ["IPY_MODEL_model_2", IPY_MODEL_model_3"]
}
}
- Kernel sends the "application/vnd.jupyter.widget-view+json" message we direct to WidgetDisplay
application/vnd.jupyter.widget-view+json: {
model_id: "model_1"
version_major: 2
version_minor: 0
}
- When widget looks up the "model_1", it gets the data from step 2. The information in step 1 is lost
- Error is thrown because no view information is provided to
create_widget
I'm guessing this is the same issue with Accordion and Tabs, as the model state given to them also only has children. No view information.
Rendering issues cause by nteract/outputs#3
@captainsafia , we are also running into issues with nteract and interact ipywidgets in our most recent project. Are there any plans to support this in near future?
Same issue with an asynchronous slider response, is there a list of widgets that can be used with an asynchronous response?