示例#1
0
 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}')])
示例#2
0
 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}')])
示例#3
0
 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}')])
示例#4
0
 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}')])
示例#5
0
 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')
示例#6
0
 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}')])
示例#7
0
 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')