You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bqplot widgets when run in voici don't trigger observe when their attributes change so there can be no reaction by external functions to interactions with the bqplot widgets. This only appears to occur when run inside a Voici environment and the same code works properly in JupyterLab and Voila.
Description
I have an interactive plot (generated via bqplot) consisting of a Scatter object and a Line object where the idea is you can drag the points in the Scatter object and the Line object changes to continue connecting those points. The notebook with this plot runs flawlessly in Jupyter lab and voila. However, in voici, I can drag the points in the Scatter object, but the Line connecting the points does NOT update.
Update 7/25/2024: I have now also confirmed that a plot set up with bq.interacts.HandDraw have a similar problem, when hand drawing on the graph, the plot changes but no signal is sent via the observe function, so no other functions can react to the changes.
The expected behavior (seen in both Jupyter lab and Voila) is that dragging points on the Figure shown should result in not only the points moving, but also the line connecting the points getting updated. The line does NOT update when this same notebook is run in Voici. Again, this appears to be because bqplot widgets run inside of Voici do NOT trigger the observe method and thus can't call outside functions to respond.
Context
voila version: 0.5.7
Operating System and version: macOS 14.5
Browser and version: Safari 17.5 (but also verified to occur in Vivaldi 6.8.3381.48 which is based on Google Chrome)
I ran into a nearly identical error when using toggle buttons to control a matplotlib plot. It works perfectly in a normal ipynb as well as with voila. But, does not work after compiling(?not sure if that's technically correct) to a voici project. Weirdly - every other widget works as expected when attaching observers -- it's only these toggle boxes that seem to be not attaching.
@jtpio looking at the traceback here, could it be related to the coincident error we had?
It is indeed the same error message as originally reported in jupyterlite/jupyterlite#1424. Although not sure if it's just noise, there is another error coming from xpython.js it seems.
Executive Summary
bqplot widgets when run in voici don't trigger
observe
when their attributes change so there can be no reaction by external functions to interactions with the bqplot widgets. This only appears to occur when run inside a Voici environment and the same code works properly in JupyterLab and Voila.Description
I have an interactive plot (generated via bqplot) consisting of a
Scatter
object and aLine
object where the idea is you can drag the points in theScatter
object and theLine
object changes to continue connecting those points. The notebook with this plot runs flawlessly in Jupyter lab and voila. However, in voici, I can drag the points in theScatter
object, but theLine
connecting the points does NOT update.Update 7/25/2024: I have now also confirmed that a plot set up with
bq.interacts.HandDraw
have a similar problem, when hand drawing on the graph, the plot changes but no signal is sent via theobserve
function, so no other functions can react to the changes.NOTE: Since this could be a bqplot issue, I have also filed an issue with bqplot, it is issue #1647 in their repo.
Reproduce
I have created a short notebook index.ipynb that illustrates the problem. Since the environment might be crucial, I created a repo containing the notebook as well as the
environment.yml
file necessary to test it both in voila and voici here.Expected behavior
The expected behavior (seen in both Jupyter lab and Voila) is that dragging points on the Figure shown should result in not only the points moving, but also the line connecting the points getting updated. The line does NOT update when this same notebook is run in Voici. Again, this appears to be because bqplot widgets run inside of Voici do NOT trigger the
observe
method and thus can't call outside functions to respond.Context
Troubleshoot Output
Browser Output
The following messages appear in the Javascript Console linked to `python.js:8`:If using JupyterLab
Installed Labextensions
The text was updated successfully, but these errors were encountered: