Dear all,
I am trying to add and remove curves from flask.
I was able to access the ColumDataSource, add a plot or remove lines by calling a flask server after the plot has been created, with
p = session.document.get_model_by_name("figure")
cds = session.document.get_model_by_name("cds")
cds.data["y4"] = [1.5,1.5,1.5,1.5,1.5]
p.line(x='x', y="y4", source=cds)
session.document.get_model_by_name("line0").visible = False
# session.push()
however the changes are visible only when I call again the plot, i.e. when I refresh the page
@app.route('/bokeh_v2', methods=['GET'])
def bokeh_app_page_v2():
return render_template("embed.html", script=script)
I tried to add a session.push() (see first code snippet) after the modifications of the plots, but this is generating a wrong behavior, indeed what happens is that the plot updates by deleting some curves (those associated to the ColumDataSource), while other remain (those produced with other plot in the bokeh script). If I refresh the page (see above) everything looks as expected.
How can I generate the update automatically, without the need to “refresh”?
Thanks,
Luigi
