Skip to content

Commit

Permalink
Merge c8a7a32 into 3f015c0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlstevens committed Mar 23, 2018
2 parents 3f015c0 + c8a7a32 commit 295d3d1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions holoviews/ipython/__init__.py
Expand Up @@ -123,8 +123,12 @@ def __call__(self, *args, **params):

# Not quite right, should be set when switching backends
if 'matplotlib' in Store.renderers and not notebook_extension._loaded:
svg_exporter = Store.renderers['matplotlib'].instance(holomap=None,fig='svg')
holoviews.archive.exporters = [svg_exporter] + holoviews.archive.exporters
mpl_exporter = Store.renderers['matplotlib'].instance(holomap='widgets',fig='svg')
holoviews.archive.exporters = [mpl_exporter] + holoviews.archive.exporters

if 'bokeh' in Store.renderers and not notebook_extension._loaded:
bk_exporter = Store.renderers['bokeh'].instance(holomap='widgets')
holoviews.archive.exporters = [bk_exporter] + holoviews.archive.exporters

p = param.ParamOverrides(self, {k:v for k,v in params.items() if k!='config'})
if p.case_sensitive_completion:
Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/renderer.py
Expand Up @@ -113,7 +113,7 @@ def __call__(self, obj, fmt=None, doc=None):
if self.mode == 'server':
return self.server_doc(plot, doc), info
elif isinstance(plot, tuple(self.widgets.values())):
return plot(), info
return self.static_html(obj), info
elif fmt == 'png':
png = self._figure_data(plot, fmt=fmt, doc=doc)
return png, info
Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/mpl/renderer.py
Expand Up @@ -102,7 +102,7 @@ def __call__(self, obj, fmt='auto'):
if plot is None: return

if isinstance(plot, tuple(self.widgets.values())):
data = plot()
data = self.static_html(obj)
else:
with mpl.rc_context(rc=plot.fig_rcparams):
data = self._figure_data(plot, fmt, **({'dpi':self.dpi} if self.dpi else {}))
Expand Down
4 changes: 4 additions & 0 deletions holoviews/plotting/renderer.py
Expand Up @@ -266,6 +266,10 @@ def html(self, obj, fmt=None, css=None, **kwargs):
code to initialize a Comm, if the plot supplies one.
"""
plot, fmt = self._validate(obj, fmt)

if any(isinstance(plot, w) for w in self.widgets.values()):
return plot()

figdata, _ = self(plot, fmt, **kwargs)
if css is None: css = self.css

Expand Down

0 comments on commit 295d3d1

Please sign in to comment.