Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HTML holomap export to notebook archive #2480

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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