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

Bokeh plots show in the Viewer pane for notebooks #4234

Closed
seeM opened this issue Aug 5, 2024 · 2 comments
Closed

Bokeh plots show in the Viewer pane for notebooks #4234

seeM opened this issue Aug 5, 2024 · 2 comments
Labels
area: notebooks Issues related to Notebooks category. area: plots Issues related to Plots category. bug Something isn't working lang: python theme: app builder

Comments

@seeM
Copy link
Contributor

seeM commented Aug 5, 2024

Steps to reproduce the issue:

  1. Create a Python Jupyter notebook.

  2. Create a Bokeh plot e.g. by executing a cell with:

    from bokeh.plotting import figure, show
    p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
    p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
    show(p)
  3. It will display in the Viewer pane.

Expected or desired behavior:

The plot should display as a cell output.

Were there any error messages in the UI, Output panel, or Developer Tools console?

Nope.

@seeM seeM added bug Something isn't working area: plots Issues related to Plots category. lang: python theme: app builder labels Aug 5, 2024
@seeM seeM added the area: notebooks Issues related to Notebooks category. label Aug 6, 2024
@nstrayer
Copy link
Contributor

nstrayer commented Aug 7, 2024

I actually can't get this to show up in the viewer pane even. It just gets swallowed into the void. I bet I introduced some logic in #4178 that is responsible.

@seeM
Copy link
Contributor Author

seeM commented Nov 28, 2024

This actually seems to be working as expected! Looking at the docs, it is supposed to open in a browser by default. To show inline in the notebook you have to first execute bokeh.io.output_notebook(), which is working as expected in our notebooks.

Confirmed on:

Positron Dev Version: 2025.01.0 build 0
Code - OSS Version: 1.93.0
Commit: Unknown
Date: Unknown
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0

That plotting in notebook mode shows inline:

from bokeh.io import output_notebook, reset_output
from bokeh.plotting import figure, show

output_notebook()
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
show(p)

And plotting in the default mode shows in the viewer pane:

from bokeh.io import output_notebook, reset_output
from bokeh.plotting import figure, show

reset_output()
p = figure(title="Simple line example", x_axis_label='x', y_axis_label='y')
p.line([1, 2, 3, 4, 5], [6, 7, 2, 4, 5], legend_label="Temp.", line_width=2)
show(p)

@seeM seeM closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: notebooks Issues related to Notebooks category. area: plots Issues related to Plots category. bug Something isn't working lang: python theme: app builder
Projects
None yet
Development

No branches or pull requests

2 participants