-
Notifications
You must be signed in to change notification settings - Fork 233
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
How to display ipyvolume figures in a bokeh server app? #182
Comments
I should add: one possibly hacky workaround would be for us to run a python callback from bokeh that generates and saves a html embedding of a single ipyvolume figure, and then opening that in a separate tab using a bokeh OpenURL callback. But I deeply dislike this idea, because:
|
I don't think ipywidgets can live in the bokeh server, since they need to communicate to the kernel over a Comm object (via websocket). |
@maartenbreddels (👋)
Can you elaborate on this? Sorry, I'm a js and server noob here, but it seems that there's ways to make Bokeh servers and Jupyter notebooks play well together (e.g. this example), which to me suggests that ipywidgets and Bokeh servers should be able to interact? ie maybe the Bokeh server needs to live in a Jupyter kernel, but that seems doable? |
Thank you very much for your reply, I've been thinking about this.
|
scipy 2018 right? :) 👋
True, I think if it lives in a jupyter kernel it should work. For standalone, I doubt it will work.
Why would voila not work? |
Yes! Great talk! =)
Ah! I'd misunderstood what it was. It just might! The downside is that I don't want our app code to live in an ipynb file LOL. But we might be able to take little bits and pieces from voila to execute our Bokeh server as if it was running in a notebook. As to bq, we already have a pretty developed app in Bokeh that I'm not quite ready to abandon, as it works great for 2D images. Let's see how far we can go. =) |
Otherwise you can also try https://github.com/pbugnion/ipywidgets_server |
thx :) I've been doing some work with bqplot for Image: and for large amounts of data: |
WOW, that megascatter lasso selection is 🔥 🔥 🔥! 😲 Well, what we are doing is to link scatter selection (not so many points ;) with (multi)image display (each point is an image). So long as your design doesn't forbid that, we will definitely be keeping an eye on this! |
@GenevieveBuckley did you end up solving it? Now it's possible to have the whole Bokeh server live inside Jupyter Kernel. Did you find a way to make Bokeh figures similar to ipywidgets (for better compatibility with Jupyter Lab integrations etc.)? |
No, but this might be due to lack of time rather than technical impossibility. We're really trying to come at things the other way around: trying to fit ipyvolume into bokeh, rather than fitting bokeh into ipyvolume/ipywidgets. Less work for us, if we can do that. I think I might need to take more of a look at how to output small html/javascript snippets with ipywidgets (right now we create a standalone html page with the one ipyvolume figure in it). |
(Sorry, didn't mean to change the open/closed status of the issue when I replied to you) |
I'd like to know how to display an ipyvolume figure in a bokeh server app.
Ideally I want to run a bokeh server app that shows users a bokeh scatterplot; and then when any of the points are clicked a new ipyvolume rendering (based on data related to the scatter point) is displayed or updated beside it.
Thanks to the ipyvolume documentation, I know how to embed linked bokeh and ipyvolume plots to a standalone html page. I'm not sure how to extend this idea to the bokeh server, though.
I've uploaded a minimal example you can run here.
Attempting to pass an ipyvolume figure, or the ipyvolume current container into a bokeh layout:
produces this error:
ValueError: Only LayoutDOM items can be inserted into a layout.
Attempting to wrap the ipyvolume current container inside an ipywidgets or bokeh widgetbox:
produces this error:
ValueError: expected an element of List(Instance(Widget)), got seq with invalid items [VBox...
How should I be doing this instead?
The text was updated successfully, but these errors were encountered: