on previous feedback I managed to get my app to dynamically at runtime add plots to a webpage and update them realtime.
I also want to remove plots from the page, which is working with mixed success. The plot effectively goes away, but everything else stops working as well.
If I comment line 76 in https://gist.github.com/Kruptein/13e3a782283ab4e73c7a893ed3cc0d48, the plot goes away and everything keeps running but I have no useful plot as no data ever gets put on it.
So the datasource.stream() function somehow breaks everything if I remove a plot but it throws no exception or whatsoever so I have no idea how to solve it.
My main python process has an active event loop in which it sometimes initializes a Plot of the previously mentioned file and calls update on it.
When the plot is no longer relevant it calls the plot.remove_plot() method.
Any ideas would be great,
thanks in advance.