Set static source id on initialization
@@ -727,11 +727,14 @@ class ElementPlot(BokehPlot, GenericElementPlot):
# Get data and initialize data source
empty = False
if self.batched:
+ current_id = tuple(element.traverse(lambda x: x._plot_id, [Element]))
data, mapping = self.get_batched_data(element, ranges, empty)
else:
data, mapping = self.get_data(element, ranges, empty)
+ current_id = element._plot_id
if source is None:
source = self._init_datasource(data)
+ self.handles['previous_id'] = current_id
self.handles['source'] = source
properties = self._glyph_properties(plot, style_element, source, ranges)
