Skip to content

Commit

Permalink
Merge f471bb3 into 0389fbf
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 26, 2018
2 parents 0389fbf + f471bb3 commit 60295ac
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions holoviews/plotting/bokeh/raster.py
Expand Up @@ -3,9 +3,9 @@

from bokeh.models import HoverTool
from ...core.util import cartesian_product, dimension_sanitizer
from ...element import Raster
from ...element import Raster, RGB, HSV
from .element import ElementPlot, ColorbarPlot, line_properties, fill_properties
from .util import mpl_to_bokeh, colormesh
from .util import mpl_to_bokeh, colormesh, bokeh_version


class RasterPlot(ColorbarPlot):
Expand All @@ -17,6 +17,14 @@ class RasterPlot(ColorbarPlot):

style_opts = ['cmap']
_plot_methods = dict(single='image')

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)):
vdim = element.vdims[0]
tooltips.append((vdim.pprint_label, '@image'))
return tooltips, {}

def __init__(self, *args, **kwargs):
super(RasterPlot, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit 60295ac

Please sign in to comment.