When zooming out, the glyph disappears as soon as the plot range is greater than the original plot range,
in particular, if the newly loaded dataframe is larger than the initial dataframe (which is passed on the
the ColumnDataSource.
Is this a known bug?
class TimeValueElement:
def init(self, df=None, time_column, value_column):
if df is None:
df = pd.DataFrame()
df[self.time_column] =
df[self.value_column] =
self.df = df
self.source = ColumnDataSource(self.df)
self.reload_function = None
def _add_glyph(self, plot, style='point', **properties):
if style == 'point':
plot.circle(source=self.source, x=self.time_column,
y=self.value_column, **properties)
def _reload(self, document, plot_start, plot_end):
if self.reload_function:
time_start = to_datetime(plot_start)
time_end = to_datetime(plot_end)
df = self.reload_function(time_start, time_end,
*self.args, **self.kwargs)
if df is None:
df = pd.DataFrame()
df[self.time_column] = []
df[self.value_column] = []
self.df = df
self._update(document)
def _update(self, document):
document.hold()
self.source.data = ColumnDataSource(self.df).data
document.unhold()
``

