Synchronizing ColumnDataSource with bokeh server with when editing data in JS callbacks

You should actually be getting a huge, multi-line console warning about trying to use .on_click with show. Did it now appear for you?

When you use show, you are generating standalone HTML output, i.e. Bokeh creates a pile of HTML and Javascript that can be displayed in a browser, or a notebook output cell, but it is a one-way trip. There is no further connection or communication to any Python process (so as a corollary, your on_click callback function has no place to execute). If you want to use real Python callbacks, that always means you are looking at creating at Bokeh server application to run on a Bokeh server.

You can find an example of embedding a Bokeh server app in a notebook here:

https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/notebook_embed.ipynb

You an also see a discussion of the possibility of using kernel.execute in a CustomJS callback in the notebook, in order to update Python variables in the notebook, here: