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.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}')])
def test_points_overlay_hover_batched(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.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x}'), ('y', '@{y}')])
def test_polygons_overlay_hover(self): obj = NdOverlay({i: Polygons([{('x', 'y'): np.random.rand(10,2), 'z': 0}], vdims=['z']) for i in range(5)}, kdims=['Test']) opts = {'Polygons': {'tools': ['hover']}, 'NdOverlay': {'legend_limit': 0}} obj = obj.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}'), ('z', '@{z}')])
def test_points_overlay_datetime_hover(self): if pd is None: raise SkipTest("Test requires pandas") obj = NdOverlay({i: Points((list(pd.date_range('2016-01-01', '2016-01-31')), range(31))) for i in range(5)}, kdims=['Test']) opts = {'Points': {'tools': ['hover']}} obj = obj.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x_dt_strings}'), ('y', '@{y}')])
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.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x}'), ('y', '@{y}')], 'nearest')
def test_curve_overlay_datetime_hover(self): obj = NdOverlay( { i: Curve([(dt.datetime(2016, 1, j + 1), j) for j in range(31)]) for i in range(5) }, kdims=['Test']) opts = {'Curve': {'tools': ['hover']}} obj = obj.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}'), ('x', '@{x_dt_strings}'), ('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.opts(plot=opts) self._test_hover_info(obj, [('Test', '@{Test}')], 'prev')