Removed bokeh 0.12.14 streaming fix
@@ -18,12 +18,10 @@ from ..plot import (DimensionedPlot, GenericCompositePlot, GenericLayoutPlot,
from ..util import attach_streams, displayable, collate
from .callbacks import Callback
from .util import (layout_padding, pad_plots, filter_toolboxes, make_axis,
- update_shared_sources, empty_plot, decode_bytes,
- bokeh_version)
+ update_shared_sources, empty_plot, decode_bytes)
from bokeh.layouts import gridplot
from bokeh.plotting.helpers import _known_tools as known_tools
-from bokeh.util.serialization import convert_datetime_array
TOOLS = {name: tool if isinstance(tool, basestring) else type(tool())
for name, tool in known_tools.items()}
@@ -200,31 +198,6 @@ class BokehPlot(DimensionedPlot):
stream = self.streaming[0]
if stream._triggering:
data = {k: v[-stream._chunk_length:] for k, v in data.items()}
-
- # NOTE: Workaround for bug in bokeh 0.12.14, data conversion
- # should be removed once fixed in bokeh (https://github.com/bokeh/bokeh/issues/7587)
- converted_data = {}
- for k, vals in data.items():
- cdata = source.data[k]
- odata = data[k]
- if (bokeh_version in ['0.12.14', '0.12.15dev1'] and
- isinstance(cdata, np.ndarray) and cdata.dtype.kind == 'M'
- and isinstance(vals, np.ndarray) and vals.dtype.kind == 'M'):
- cdata = convert_datetime_array(cdata)
- odata = convert_datetime_array(odata)
- if len(odata):
- cdata = np.concatenate([odata, cdata])
- converted_data[k] = cdata
- if converted_data:
- for k, vals in data.items():
- cdata = source.data[k]
- odata = data[k]
- if k not in converted_data:
- if len(odata):
- cdata = np.concatenate([odata, cdata])
- converted_data[k] = cdata
- source.data.update(converted_data)
- else:
source.stream(data, stream.length)
return
@@ -350,6 +323,8 @@ class BokehPlot(DimensionedPlot):
source_cols[id(new_source)] = [c for c in new_source.data]
plot_id = self.id if self.top_level else None
for plot in plots:
+ for hook in plot.finalize_hooks:
+ hook(plot, plot.current_frame)
for callback in plot.callbacks:
callback.initialize(plot_id=plot_id)
self.handles['shared_sources'] = shared_sources
