How to update the original CDS in Jupyter Notebook Bokeh?


I’m creating a toy app in jupyter notebook where I’d like to add some points in a scatter plot and then keep working with an updated version of the data. I tried to access to the source but is not updated. Is this possible in Jupyter Notebook or is required a bokeh app? Thanks in advance!

    from bokeh.sampledata.iris import flowers
    from bokeh.plotting import figure, output_file, show
    from import output_notebook
    from bokeh.models.widgets import Button

    from bokeh.plotting import ColumnDataSource, figure, output_file, show, Column
    from bokeh.models import Plot, Range1d, MultiLine, Circle, HoverTool, BoxZoomTool, ResetTool, PointDrawTool, TableColumn, DataTable, CustomJS

    import pandas as pd
    d = dict(
        x=[1, 2, 3, 4, 5],
        y=[2, 5, 8, 2, 7],
        desc=['A', 'b', 'C', 'd', 'E'],
        imgs = [my_base64_jpgData,my_base64_jpgData,my_base64_jpgData,my_base64_jpgData,my_base64_jpgData],
    data = pd.DataFrame(d)

    source = ColumnDataSource(data=data)

    p = figure(plot_width=400, plot_height=400,
               title="Mouse over the dots")

    a ='x', 'y', size=20, source=source)

    columns = [TableColumn(field="x", title="x"),
               TableColumn(field="y", title="y"),
               TableColumn(field='desc', title='desc')]

    table = DataTable(source=source, columns=columns, editable=True, height=200)
    p.add_tools( BoxZoomTool(), ResetTool(), PointDrawTool(renderers=[a]))

    show(Column(p,table), notebook_handle=False)

push_notebook only functions in one direction: you can push updates from Python, to JavaScript. If you need to do the converse, e.g. update a Python CDS based on some JS event, then that needs a Bokeh server app, which can also be embedded in notebooks: