How do I create and use a custom Bokeh Model in Panel?

Problem solved. It turned out the example in the Bokeh documentation does not work.

I got it working. See See https://github.com/bokeh/bokeh/issues/9587

I’ve added it as an example to the gallery at awesome-panel.org