I have a Bokeh server code that looks like this:
listOfSubLayouts = main_layout.children
plotToRemove = curdoc().get_model_by_name(self.plotid_long)
logging.warning(plotToRemove.name)
listOfSubLayouts.remove(plotToRemove)
The remove line gives the following error:
error handling message Message 'PATCH-DOC' (revision 1): ValueError('list.remove(x): x not in list',)
Could someone please shed some light on what might be going wrong here? Is this solution which I found here:
Dynamically add/remove plot using 'bokeh serve' (bokeh 0.12.0)
not working in a Bokeh server environment maybe?