Posting in case anyone here has any advice on this:
opened 07:00PM - 30 Oct 21 UTC
**Relevant versions**
-Python 3.7.11
-Bokeh 2.4.1
-Ipyvolume 0.6a10
-bqplo… t 0.12.31
**What I'm trying to do**
Essentially replicate the example shown here: https://ipyvolume.readthedocs.io/en/latest/examples/bokeh.html
**Reproducible example/code:**
```
import numpy as np
import ipyvolume as ipv
import ipyvolume.bokeh
from bokeh.plotting import figure, save
from bokeh.models import Scatter, Slider, ColumnDataSource
np.random.seed(1)
data = np.array([np.random.random(500)*100,np.random.random(500)*100,np.random.random(500)*100])
f = ipv.figure()
s = ipv.scatter(data[0],data[1],data[2], size=5, size_selected=15,color='red',color_selected='blue',marker='sphere')
bk_f = figure(output_backend='webgl',tools=['pan','wheel_zoom','lasso_select'])
src = ColumnDataSource(data=dict(x=data[0],y=data[1]))
r = bk_f.scatter('x','y',source=src)
ipv.bokeh.link_data_source_selection_to_widget(src,s,'selected')
from bokeh.resources import CDN
from bokeh.embed import components
script, div = components((bk_f))
template_options = dict(extra_script_head=script + CDN.render_js() + CDN.render_css(),
body_pre="<h2>Do selections in 2d (bokeh)<h2>" + div + "<h2>And see the selection in ipyvolume<h2>")
ipv.embed.embed_html("test_embed.html",
[ipv.gcc(), ipv.bokeh.wmh], all_states=True,
template_options=template_options)
```
**What happens**
The html renders both the bokeh plot and the ipyvolume piece, but the selection link does not work. There are also a few errors thrown in the javascript console on initialization, and when I do a bokeh selection it seems that the 'indices' property it looks up for the link (I assume this is supposed to be for src.selected) but it returns undefined. These might be valuable clues for someone more knowledgeable than me. Gif:
![NotWorks](https://user-images.githubusercontent.com/58000181/139555448-4346af8a-73e4-4a45-adf8-0634c94c09d1.gif)
Thanks for all you do!
Would be pretty nice to get this working/understand how it works.
Bryan
October 31, 2021, 4:14pm
2
I don’t have any immediate suggestions. There is a repo for the ipywidgets_bokeh
Jupyter extension and that is probably the best place to report any issues: GitHub - bokeh/ipywidgets_bokeh: Allows embedding of Jupyter widgets in Bokeh applications.
cc @mateusz @Philipp_Rudiger
First thing I would try is using a non-dev version of ipyvolume. I don’t know if they upload packages to npm releases without which it just won’t work.
system
Closed
January 29, 2022, 8:48pm
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.