bokeh / jupyter_bokeh

An extension for rendering Bokeh content in JupyterLab notebooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Displaying same figure with show and BokehModel

axil opened this issue · comments

The following sequence of commands leads to a strangely looking error message:

from bokeh.io import output_notebook
from bokeh.resources import Resources, INLINE
from jupyter_bokeh import BokehModel
from bokeh.plotting import figure, output_file, show
output_notebook()

p = figure(plot_height=100)
p.scatter([1,2,3], [4,5,7])
show(p)
<displays p>

BokehModel(p)
<displays p>

p1 = figure(plot_height=100)
p1.scatter([1,2,3], [4,5,7])
<displays p1 then breaks the plot in the previous cell>

image

I understand that the real reason for this behavior is displaying the same figure with both show and BokehModel, but I would expect the error message to be in cell [4], not in cell [5].

Originally I thought it is because of my patch fixing the copy-pasting in jupyter, but no, it is just the same in the original bokeh==2.4.3 + jupyter_bokeh==3.0.4.