I’m trying to run the example from https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/notebook_embed.ipynb and have problem running it on a custom domain / self-hosted jupyterhub server.
Running that example using localhost jupyterlab works fine.
On the self-hosted jupyterhub server if I run show(notebook_url=“https://mydomain.dev”) I get error 404 in my network log for URL similar to the following:
If I run show(notebook_url=“https://mydomain.dev:443”) then URL similar to the following does not loads because browser is unable to connect (apparently because it tries to connect using port 36520):
The corresponding script URL for the localhost juptyer instance which loads fine is:
Here’s the copy of the code from the example:
import yaml
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Slider
from bokeh.plotting import figure
from bokeh.themes import Theme
from bokeh.io import show, output_notebook
from bokeh.sampledata.sea_surface_temperature import sea_surface_temperature
output_notebook()
def modify_doc(doc):
df = sea_surface_temperature.copy()
source = ColumnDataSource(data=df)
plot = figure(x_axis_type='datetime', y_range=(0, 25),
y_axis_label='Temperature (Celsius)',
title="Sea Surface Temperature at 43.18, -70.43")
plot.line('time', 'temperature', source=source)
def callback(attr, old, new):
if new == 0:
data = df
else:
data = df.rolling('{0}D'.format(new)).mean()
source.data = ColumnDataSource(data=data).data
slider = Slider(start=0, end=30, value=0, step=1, title="Smoothing by N Days")
slider.on_change('value', callback)
doc.add_root(column(slider, plot))
doc.theme = Theme(json=yaml.load("""
attrs:
Figure:
background_fill_color: "#DDDDDD"
outline_line_color: white
toolbar_location: above
height: 500
width: 800
Grid:
grid_line_dash: [6, 4]
grid_line_color: white
"""))
#show(modify_doc, notebook_url="https://mydomain.dev") # not working
#show(modify_doc, notebook_url="https://mydomain.dev:443") # not working either
show(modify_doc) # this one is working properly
``
What might be wrong here? Maybe something else should be used for the notebook_url argument?
``