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

Switch to HTML mime bundle #3574

Merged
merged 5 commits into from Mar 26, 2019
Merged
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
14 changes: 7 additions & 7 deletions holoviews/ipython/display_hooks.py
Expand Up @@ -4,7 +4,7 @@
from functools import wraps
from contextlib import contextmanager

import os, sys, traceback
import sys, traceback

import IPython
from IPython import get_ipython
Expand Down Expand Up @@ -142,20 +142,20 @@ def wrapped(element):
mimebundle = fn(element, max_frames=max_frames)
if mimebundle is None:
return {}, {}

html = mimebundle_to_html(mimebundle)
if os.environ.get('HV_DOC_HTML', False):
mimebundle = {'text/html': html}, {}
mime_data, mime_metadata = mimebundle
if 'text/javascript' in mime_data:
mime_data['text/html'] = mimebundle_to_html(mime_data)
del mime_data['text/javascript']

# Only want to add to the archive for one display hook...
disabled_suffixes = ['png_display', 'svg_display']
if not any(fn.__name__.endswith(suffix) for suffix in disabled_suffixes):
if type(holoviews.archive) is not FileArchive:
holoviews.archive.add(element, html=html)
holoviews.archive.add(element, html=mime_data['text/html'])
filename = OutputSettings.options['filename']
if filename:
Store.renderers[Store.current_backend].save(element, filename)
return mimebundle
return mime_data, mime_metadata
except SkipRendering as e:
if e.warn:
sys.stderr.write(str(e))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -10,7 +10,7 @@


setup_args = {}
install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.0']
install_requires = ['param>=1.8.0,<2.0', 'numpy>=1.0', 'pyviz_comms>=0.7.2']

extras_require = {}

Expand Down