bokeh / ipywidgets_bokeh

Allows embedding of Jupyter widgets in Bokeh applications.
BSD 3-Clause "New" or "Revised" License
23 stars 11 forks source link

Attempt to fix communication issues #93

Closed mattpap closed 1 year ago

mattpap commented 1 year ago

Early WIP. There's a lot I don't understand and a lot that doesn't work. Moreover ipywidgets 8.0.5 breaks things even more.

philippjfr commented 1 year ago

@mattpap Can you rebase and merge this and then tag a dev release? In combination with changes I made in Panel this works fine for me, even with 8.0.6. Happy to help fix this for pure-bokeh users once the Panel 1.0 rush is over.

mattpap commented 1 year ago

Can you rebase and merge this and then tag a dev release? In combination with changes I made in Panel this works fine for me, even with 8.0.6. Happy to help fix this for pure-bokeh users once the Panel 1.0 rush is over.

This still doesn't work for me in Bokeh (with ipywidgets 8.0.6 at all and with 8.0.4 the same as with original changes in this PR, i.e. only one way). I rebased and will publish a release soon.

mattpap commented 1 year ago

@philippjfr, what specifically were you testing in panel?

philippjfr commented 1 year ago
import panel as pn

import ipywidgets as ipw

pn.extension('ipywidgets')

slider = ipw.IntSlider(min=0, end=14)

md = pn.pane.Markdown()

button = pn.widgets.Button(name='Reset')

def reset(event):
    slider.value = 0

button.on_click(reset)

def update_zoom(event):
    if isinstance(event['new'], int):
        md.object = str(event['new'])
    elif 'value' in event['new']:
        md.object = str(event['new']['value'])

slider.observe(update_zoom)

pn.Column(ipw.__version__, button, slider, md).servable()

ipywidgets_8 0 6

Depends on https://github.com/holoviz/panel/pull/4716

ndmlny-qs commented 1 year ago

I can confirm that this is working for me as well. I also removed the src/ipywidgets_bokeh/webpack.ts module and it works as expected.

no-webpack-module.webm

env

name: panel-upgrade-releases
channels:
  - conda-forge
  - pyviz/label/dev
dependencies:
  - python<3.11
  - nodejs # for ipywidgets_bokeh build
  - pip
  - ipywidgets
  - pyviz/label/dev::panel==1.0.0rc1
  - ipython_genutils
  - ipyvolume