deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

[Bug] Two-way Jupyter binding support (i.e., ipywidgets)

Open cpsievert opened this issue 1 year ago • 10 comments

Description

I was surprised to find that v0.9 dropped support for two-way Jupyter bindings (i.e., ipywidgets) entirely (see https://github.com/visgl/deck.gl/pull/8854). There was also no mention of this at all in the release notes.

Flavors

  • [ ] Script tag
  • [ ] React
  • [X] Python/Jupyter notebook
  • [ ] MapboxOverlay
  • [ ] GoogleMapsOverlay
  • [ ] CartoLayer
  • [ ] ArcGIS

Expected Behavior

No response

Steps to Reproduce

N/A

Environment

N/A

Logs

No response

cpsievert avatar Jul 31 '24 19:07 cpsievert

Due to a change in Jupyter we had to remove the binding support (CHANGELOG entry). We are currently low on resource with the Python bindings, would you be able to contribute here?

felixpalmer avatar Aug 01 '24 09:08 felixpalmer

It is a good point that our changelog wording, "Jupyter-specific features not currently supported", may not be meaningful to Jupyter users, who might not know which features were never available in other environments. We could include a bit more detail and link to an issue perhaps.

More information about the blocking issues:

  • https://github.com/visgl/deck.gl/issues/8469
  • https://github.com/visgl/deck.gl/pull/7030

I think we're flexible on what the solution could look like (could be a major upgrade to the newer JupyterLab architecture, or a smaller focused fix). But as @felixpalmer mentions, additional support in that area may be needed.

donmccurdy avatar Aug 01 '24 13:08 donmccurdy

Ran into this and switched over to lonboard for the time being to work on custom widgets (that possibly could be reused for pydeck if this issue gets fixed)

Regarding https://gist.github.com/donmccurdy/4cb069e73cbb82b6e5f75a0b3a6bb74f, do we know what are the packages that were changed since pydeck 0.8, leading to the breakage? I'm able to use lonboard with notebook=6.4.13, so this is a pretty old setup I can use to compare with pydeck.

prusswan avatar Oct 10 '24 18:10 prusswan

Based on info from #8577, I managed to track down the last version of pydeck and matching environment that could run the event handlers example. Below is what worked for me on Windows:

conda create -n py39 python=3.9 ipywidgets=7 notebook=6.4 pydeck=0.8.0
pip install notebook==6.4.13 # conda only has 6.4.12 which does not work with traitlets>5.9.0

prusswan avatar Oct 24 '24 20:10 prusswan

Prior related discussion captured here.

bijanvakili avatar Feb 11 '25 16:02 bijanvakili

If the binding is just using ipywidgets, and worked in JupyterLab 3, it may be very easy to get JupyterLab 4 support just by updating some dependencies. I elaborated more at https://github.com/visgl/deck.gl/issues/7731#issuecomment-2899862571 on what might be an easy way to support JupyterLab 4 and ipywidgets 7 and 8. I'd be happy to pair for a bit with a deck.gl contributor to work through this change (I'm an ipywidgets maintainer).

jasongrout avatar May 22 '25 16:05 jasongrout

@bijanvakili do you think you could pair up with @jasongrout on this?

felixpalmer avatar May 23 '25 08:05 felixpalmer

The minimal goal here would be to just get the existing bindings working as-is in jlab 4 / ipywidgets 8, not to rewrite the bindings to be a prebuilt extension, use anywidget, or something more ambitious.

FYI, my interest here is partially driven by https://github.com/ContinuumIO/anaconda-issues/issues/13453, where we realized that pydeck dependencies were preventing Anaconda from updating to ipywidgets 8 in its official distribution.

jasongrout avatar May 23 '25 17:05 jasongrout

@jasongrout

I'd be happy to leverage your knowledge and experience on this. We were definitely on board with trying anywidget first.

I am busy for the next couple of months but I can make time to asynchronously review any docs, snippets or PRs that you post.

I'm hoping to have more time available to more actively contribute starting in Q3 this year.

bijanvakili avatar May 24 '25 19:05 bijanvakili