How to create plots using bokeh-server inside an IPython notebook?

I’m trying to create simple streaming plots like shown here: Running a Bokeh server — Bokeh 2.4.2 Documentation (Streaming Data with the Server) That works, but I’d like the result plots to be shown in the notebook generating it, not inside another browser window or tab. I understand that bokeh-server is a flask process opening an URL like this: http://localhost:5006/bokeh/doc/ac9c24c8-4820-4a18-9225-66e7e7119ae7/5a6adc27-956f-4915-bb19-f0683a7449b8, but in a notebook it would be a nicer user experience if it would be together with the generating code, following the IPython notebook paradigms.

I’ve tried running this in an IPython IFrame cell, but that won’t work, because the previous, generating code cell is not “finished”, of course, while it continues to create data to be shown. Is there a nicer solution for this?

Also, using name keyword arguments for plot components like lines seems to work, but what if want to use a TimeSeries chart with a pandas dataframe object? Then I don’t see how to pass that information anywhere. I’m attaching some sample for illustration purposes.

Thanks in advance!

test_bokeh_server_streaming_plots.py (797 Bytes)