Skip to content

Commit

Permalink
Apply hover postprocessor on updates (#5039)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Aug 23, 2021
1 parent 413147e commit ca128e5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,15 +1334,15 @@ def _postprocess_hover(self, renderer, source):
if not isinstance(hover.tooltips, util.basestring) and 'hv_created' in hover.tags:
for k, values in source.data.items():
key = '@{%s}' % k
if key in hover.formatters:
continue
if ((isinstance(value, np.ndarray) and value.dtype.kind == 'M') or
(len(values) and isinstance(values[0], util.datetime_types))):
hover.tooltips = [(l, f+'{%F %T}' if f == key else f) for l, f in hover.tooltips]
hover.formatters[key] = "datetime"

if hover.renderers == 'auto':
hover.renderers = []
hover.renderers.append(renderer)
if renderer not in hover.renderers:
hover.renderers.append(renderer)

def _init_glyphs(self, plot, element, ranges, source):
style_element = element.last if self.batched else element
Expand Down Expand Up @@ -1541,6 +1541,9 @@ def update_frame(self, key, ranges=None, plot=None, element=None):

if 'hover' in self.handles:
self._update_hover(element)
if 'cds' in self.handles:
cds = self.handles['cds']
self._postprocess_hover(renderer, cds)

self._update_glyphs(element, ranges, self.style[self.cyclic_index])
self._execute_hooks(element)
Expand Down

0 comments on commit ca128e5

Please sign in to comment.