Skip to content

Commit

Permalink
Merge cdc097d into 6970733
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 7, 2017
2 parents 6970733 + cdc097d commit e953ade
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/element.py
Expand Up @@ -221,7 +221,7 @@ def _init_tools(self, element, callbacks=[]):
Processes the list of tools to be supplied to the plot.
"""
tooltips, hover_opts = self._hover_opts(element)
tooltips = [(ttp.pprint_label, '@'+util.dimension_sanitizer(ttp.name))
tooltips = [(ttp.pprint_label, '@{%s}' % util.dimension_sanitizer(ttp.name))
if isinstance(ttp, Dimension) else ttp for ttp in tooltips]

callbacks = callbacks+self.callbacks
Expand Down
14 changes: 7 additions & 7 deletions tests/testplotinstantiation.py
Expand Up @@ -471,47 +471,47 @@ def test_points_overlay_hover_batched(self):
opts = {'Points': {'tools': ['hover']},
'NdOverlay': {'legend_limit': 0}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test'), ('x', '@x'), ('y', '@y')])
self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x}'), ('y', '@{y}')])

def test_curve_overlay_hover_batched(self):
obj = NdOverlay({i: Curve(np.random.rand(10,2)) for i in range(5)},
kdims=['Test'])
opts = {'Curve': {'tools': ['hover']},
'NdOverlay': {'legend_limit': 0}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test')], 'prev')
self._test_hover_info(obj, [('Test', '@{Test}')], 'prev')

def test_curve_overlay_hover(self):
obj = NdOverlay({i: Curve(np.random.rand(10,2)) for i in range(5)},
kdims=['Test'])
opts = {'Curve': {'tools': ['hover']}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test'), ('x', '@x'), ('y', '@y')], 'nearest')
self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x}'), ('y', '@{y}')], 'nearest')

def test_points_overlay_hover(self):
obj = NdOverlay({i: Points(np.random.rand(10,2)) for i in range(5)},
kdims=['Test'])
opts = {'Points': {'tools': ['hover']},
'NdOverlay': {'legend_limit': 0}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test'), ('x', '@x'),
('y', '@y')])
self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x}'),
('y', '@{y}')])

def test_path_overlay_hover(self):
obj = NdOverlay({i: Path([np.random.rand(10,2)]) for i in range(5)},
kdims=['Test'])
opts = {'Path': {'tools': ['hover']},
'NdOverlay': {'legend_limit': 0}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test')])
self._test_hover_info(obj, [('Test', '@{Test}')])

def test_polygons_overlay_hover(self):
obj = NdOverlay({i: Polygons([np.random.rand(10,2)], vdims=['z'], level=0)
for i in range(5)}, kdims=['Test'])
opts = {'Polygons': {'tools': ['hover']},
'NdOverlay': {'legend_limit': 0}}
obj = obj(plot=opts)
self._test_hover_info(obj, [('Test', '@Test'), ('z', '@z')])
self._test_hover_info(obj, [('Test', '@{Test}'), ('z', '@{z}')])

def _test_colormapping(self, element, dim, log=False):
plot = bokeh_renderer.get_plot(element)
Expand Down

0 comments on commit e953ade

Please sign in to comment.