Esempio n. 1
0
 def _render(self, doc, comm, root):
     from holoviews import Store, renderer
     if not Store.renderers:
         loaded_backend = (self.backend or 'bokeh')
         renderer(loaded_backend)
         Store.current_backend = loaded_backend
     backend = self.backend or Store.current_backend
     renderer = Store.renderers[backend]
     if backend == 'bokeh':
         renderer = renderer.instance(mode='server' if comm is None else 'default')
     kwargs = {'doc': doc, 'root': root} if backend == 'bokeh' else {}
     if comm:
         kwargs['comm'] = comm
     return renderer.get_plot(self.object, **kwargs)
Esempio n. 2
0
 def _render(self, doc, comm, root):
     from holoviews import Store, renderer
     if not Store.renderers:
         loaded_backend = (self.backend or 'bokeh')
         renderer(loaded_backend)
         Store.current_backend = loaded_backend
     backend = self.backend or Store.current_backend
     renderer = Store.renderers[backend]
     if backend == 'bokeh':
         renderer = renderer.instance(mode='server' if comm is None else 'default')
     kwargs = {'doc': doc, 'root': root} if backend == 'bokeh' else {}
     if comm:
         kwargs['comm'] = comm
     plot = renderer.get_plot(self.object, **kwargs)
     ref = root.ref['id']
     if ref in self._plots:
         old_plot = self._plots[ref]
         old_plot.comm = None
         old_plot.cleanup()
     self._plots[root.ref['id']] = plot
     return plot