diff --git a/holoviews/plotting/bokeh/raster.py b/holoviews/plotting/bokeh/raster.py index 5c25eae7a1..5b361210bf 100644 --- a/holoviews/plotting/bokeh/raster.py +++ b/holoviews/plotting/bokeh/raster.py @@ -6,10 +6,10 @@ from bokeh.models import DatetimeAxis, CustomJSHover from ...core.util import cartesian_product, dimension_sanitizer, isfinite -from ...element import Raster, RGB, HSV +from ...element import Raster from .element import ElementPlot, ColorbarPlot from .styles import line_properties, fill_properties, mpl_to_bokeh -from .util import bokeh_version, colormesh +from .util import colormesh class RasterPlot(ColorbarPlot): @@ -28,12 +28,11 @@ class RasterPlot(ColorbarPlot): def _hover_opts(self, element): xdim, ydim = element.kdims tooltips = [(xdim.pprint_label, '$x'), (ydim.pprint_label, '$y')] - if bokeh_version >= '0.12.16' and not isinstance(element, (RGB, HSV)): - vdims = element.vdims - tooltips.append((vdims[0].pprint_label, '@image')) - for vdim in vdims[1:]: - vname = dimension_sanitizer(vdim.name) - tooltips.append((vdim.pprint_label, '@{0}'.format(vname))) + vdims = element.vdims + tooltips.append((vdims[0].pprint_label, '@image')) + for vdim in vdims[1:]: + vname = dimension_sanitizer(vdim.name) + tooltips.append((vdim.pprint_label, '@{0}'.format(vname))) return tooltips, {} def _postprocess_hover(self, renderer, source): @@ -127,6 +126,11 @@ class RGBPlot(ElementPlot): _plot_methods = dict(single='image_rgba') + def _hover_opts(self, element): + xdim, ydim = element.kdims + return [(xdim.pprint_label, '$x'), (ydim.pprint_label, '$y'), + ('RGBA', '@image')], {} + def get_data(self, element, ranges, style): mapping = dict(image='image', x='x', y='y', dw='dw', dh='dh') if 'alpha' in style: