Skip to content

Commit

Permalink
Ensured svg exporter gets registered appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed May 11, 2016
1 parent 121edda commit 388842c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions holoviews/ipython/__init__.py
Expand Up @@ -155,6 +155,11 @@ def __call__(self, *args, **params):
self.warning("HoloViews %s backend could not be imported, "
"ensure %s is installed." % (backend, backend))
finally:
if backend == 'matplotlib' and not notebook_extension._loaded:
svg_exporter = Store.renderers['matplotlib'].instance(holomap=None,
fig='svg')
holoviews.archive.exporters = [svg_exporter] +\
holoviews.archive.exporters
OutputMagic.allowed['backend'] = list_backends()
OutputMagic.allowed['fig'] = list_formats('fig', backend)
OutputMagic.allowed['holomap'] = list_formats('holomap', backend)
Expand Down
7 changes: 1 addition & 6 deletions holoviews/ipython/archive.py
Expand Up @@ -50,19 +50,14 @@ def v3_strip_output(nb):
from ..core.options import Store
from ..plotting.renderer import HTML_TAGS, MIME_TYPES

try:
# Only matplotlib outputs to graphical file formats at this time
renderers = [Store.renderers['matplotlib'].instance(holomap=None, fig='svg')]
except:
renderers = []

class NotebookArchive(FileArchive):
"""
FileArchive that can automatically capture notebook data via the
display hooks and automatically adds a notebook HTML snapshot to
the archive upon export.
"""
exporters = param.List(default=renderers + [Pickler])
exporters = param.List(default=[Pickler])

skip_notebook_export = param.Boolean(default=False, doc="""
Whether to skip JavaScript capture of notebook data which may
Expand Down

0 comments on commit 388842c

Please sign in to comment.