def setUp(self): if 'bokeh' not in Store.renderers: raise SkipTest("Bokeh required to test widgets") self.image1 = Image(np.array([[0, 1], [2, 3]]), label='Image1') self.image2 = Image(np.array([[1, 0], [4, -2]]), label='Image2') self.map1 = HoloMap({1: self.image1, 2: self.image2}, label='TestMap') self.renderer = BokehRenderer.instance()
def test_render_to_png(self): if bokeh_version < str('0.12.6'): raise SkipTest('Bokeh static png rendering requires bokeh>=0.12.6') curve = Curve([]) renderer = BokehRenderer.instance(fig='png') png, info = renderer(curve) self.assertIsInstance(png, bytes) self.assertEqual(info['file-ext'], 'png')
def test_render_to_png(self): curve = Curve([]) renderer = BokehRenderer.instance(fig='png') try: png, info = renderer(curve) except RuntimeError: raise SkipTest("Test requires selenium") self.assertIsInstance(png, bytes) self.assertEqual(info['file-ext'], 'png')
def setUp(self): if 'bokeh' not in Store.renderers: raise SkipTest("Bokeh required to test widgets") self.image1 = Image(np.array([[0,1],[2,3]]), label='Image1') self.image2 = Image(np.array([[1,0],[4,-2]]), label='Image2') self.map1 = HoloMap({1:self.image1, 2:self.image2}, label='TestMap') self.renderer = BokehRenderer.instance() self.nbcontext = Renderer.notebook_context Renderer.notebook_context = False
def setUp(self): if 'bokeh' not in Store.renderers and pn is not None: raise SkipTest("Bokeh and Panel required to test 'bokeh' renderer") self.image1 = Image(np.array([[0, 1], [2, 3]]), label='Image1') self.image2 = Image(np.array([[1, 0], [4, -2]]), label='Image2') self.map1 = HoloMap({1: self.image1, 2: self.image2}, label='TestMap') self.renderer = BokehRenderer.instance() self.nbcontext = Renderer.notebook_context self.comm_manager = Renderer.comm_manager with param.logging_level('ERROR'): Renderer.notebook_context = False Renderer.comm_manager = CommManager
def test_theme_rendering(self): theme = Theme( json={'attrs': { 'Figure': { 'outline_line_color': '#444444' } }}) renderer = BokehRenderer.instance(fig='png') renderer.theme = theme plot = renderer.get_plot(Curve([])) renderer(plot) self.assertEqual(plot.state.outline_line_color, '#444444')
def test_render_to_png(self): curve = Curve([]) renderer = BokehRenderer.instance(fig='png') png, info = renderer(curve) self.assertIsInstance(png, bytes) self.assertEqual(info['file-ext'], 'png')