-
Notifications
You must be signed in to change notification settings - Fork 384
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
fix: basic support for bokeh.plotting.show #3796
base: main
Are you sure you want to change the base?
Conversation
Patches bokeh.plotting.show() to display its first argument in the output area. Other arguments are ignored. Not an elegant fix, but should work for most use cases.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@akshayka I'll say I don't have an opinion on changes that you make on your end, if something works for you, that's great. I will state that all of the Bokeh documentation for use in notebooks starts by instructing users to execute |
For reference the default built-in Jupyter hooks are registered like this: install_notebook_hook('jupyter', load_notebook, show_doc, show_app) If you used this API you could make your Edit: I guess you'd also want to set |
Thanks @bryevdv for the feedback. That mostly works, except it appears So it seems like we'd at least need to monkey-patch |
If that's true it sounds like a bug or oversight on our end. Do you have a link to the code that you saw doing that handy? Edit: well, here I guess So I think there probably out to be a way to override the function parameter default, and it was just an oversight that there is not one. |
This reverts commit bbf143b. Using the notebook hook API requires us to call output_notebook(), which in turn adds a dependency on IPython. Monkey patching show and output_notebook to be a NOOP is fine for now.
Thanks, that appears to be it. For now I think patching It's certainly possible I did something wrong, but happy with this simple patch for now. |
Patches bokeh.plotting.show() to display its first argument in the output area. Other arguments are ignored. This is similar to our patch of
IPython.display.display
.Not an elegant fix, but should work for many use cases. The proper fix would be to support
bokeh
'soutput_notebook()
— I believe this usesIPython.display.publish_display_data
under the hood, which we don't yet support.cc @bryevdv