Skip to content
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

Using nglview ipywidget #8

Open
Tracked by #91
Jhsmit opened this issue Apr 29, 2020 · 1 comment
Open
Tracked by #91

Using nglview ipywidget #8

Jhsmit opened this issue Apr 29, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Jhsmit
Copy link

Jhsmit commented Apr 29, 2020

I'd like to use the nglview widget in a bokeh application.

I'm using bokeh 2.0.2 (bokeh channel) and ipywidgets 1.0.0 (bokeh channel)

from bokeh.plotting import curdoc
from bokeh.layouts import column

from ipywidgets_bokeh import IPyWidget
import nglview

view = nglview.show_pdbid("3pqr")
wrapper = IPyWidget(widget=view, width=800, height=800)

layout = column(wrapper)

doc = curdoc()
doc.add_root(layout)

If i run this with bokeh serve I get the following error in the browser console:

TypeError: "buffers is undefined"
    widgets 2.7.5/dist/index.js:116602
    _handleCommMsg http://localhost:5006/static/extensions/ipywidgets_bokeh/ipywidgets_bokeh.js:69
    _handleMessage http://localhost:5006/static/extensions/ipywidgets_bokeh/ipywidgets_bokeh.js:69

See also holoviz/panel#1307

@philippjfr
Copy link
Contributor

Seems like an issue with nglview I don't think the msg spec requires there to be a buffers attribute so it should not assume there is one here:

https://github.com/nglviewer/nglview/blob/master/js/src/widget_ngl.ts#L156

@ndmlny-qs ndmlny-qs mentioned this issue Apr 6, 2023
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants