-
Notifications
You must be signed in to change notification settings - Fork 2
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
interact() from ipywidgets not working with Thebe #239
Comments
Interestingly, using interact_manual() communicates properly with Perhaps we could explore the differences in code between |
A big difference between the two that I've found appears to be here. Interact() appears to rely on the widget's ability to observe changes in 'value' while interact_manual() does not. I also think this might have something to do with traitlets but I'm not sure yet. |
I see the same behavior with
As for traitlets, they are definitely using the observe function in the cases that |
That's very nice to see working! The extensions do have to be installed for general use in JupyterLab, so maybe that's the issue here. Could be worth making your extension installable. |
I've began writing an interact-esque function, and at the moment it just displays the function (our widget) along with an IntSlider, with no interactivity between the two widgets; However, this same code in Thebe will give no output or console errors; In the actual interact() function, sliders and whatnot are able to properly display, but the interactivity just doesn't work. This is an additional problem that Thebe is having, just from using the ipywidgets Output() widget. |
I'm able to replicate the basic behavior of our custom "interact" function in Thebe by doing the following; If I try to display the output widget after I have used the I believe this is why the Furthermore, if you do not display anything specific through It seems that Thebe is simply mishandling the Output widget, and this screws with interact later down the line. |
The few threads in the thebe repo discussing this state that thebe needs to implement and "OutputManager" (as far as I can remember). That seems to possible relate? Maybe try to learn what the output manager is and does would help. |
Yes, I think Thebe's implementation of the Output widget is incomplete. At the moment, I am trying to figure out on a conceptual level why Thebe shows |
I found a PR in javascript which fixed interact and the output widget in Viola. The main idea is to use @jupyter-widgets/jupyterlab-manager. The related issue is here. |
I went through some of the older thebe stuff and tried using nbinteract after seeing someone say they were successful with it. Trying it with the latest thebe and latest version of the nbinteract image resulted in similar behavior to using interact() normally (i.e. the slider updates once and stops working thereafter). This makes me question nbinteract's relevance. Is it something that used to work before? Am I just not using the right code? Here's what I used for context:
|
I'm not sure. nbinteract's development was abandoned and I think it may have only worked for special cases. Understanding how voila works is probably a more fruitful path. |
I take that back, looks like there have been some commits lately: https://github.com/SamLau95/nbinteract/graphs/contributors?from=2020-10-11&to=2021-07-12&type=c You can ask on their issue tracker questions about the software. |
Okay yeah, it definitely seems nbinteract isn't too useful to us at the moment. Regarding voila, it looks like before that pr Noah mentioned, there were |
If you open a PR on thebe with what you are trying, we and others can comment on it and help you. |
I believe jupyter-book/thebe#111 already addresses this, but hasn't seen much attention recently. |
I just realized you said PR and not issue, I suppose we could try that. |
Yes, please open a PR. |
This is fixed with the 0.8.0 thebe release! |
While we have #136 which is related, I'm opening up this issue to explore interact() specifically, and seeing if we can get that to work with Thebe.
Known behavior: using interact with thebe currently allows for only a single slider movement before no longer working. Within the Thebe code, this is reflected by the
send()
function inservices-shim.js
running only once. This applies to other types of interact(), whether they be true/false boxes or dropdown menus.The text was updated successfully, but these errors were encountered: