From 21dbba397304d58b4f6e736f05b1526fa9384976 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 23 Mar 2019 21:29:12 +0000 Subject: [PATCH 1/5] Always render HTML bundle --- holoviews/ipython/display_hooks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index 3c3c817d52..d4be5adc4a 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -142,10 +142,8 @@ 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}, {} + mimebundle = {'text/html': html}, {} # Only want to add to the archive for one display hook... disabled_suffixes = ['png_display', 'svg_display'] From 510f998a96ef083bea97c262ba42773668e9e34d Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 23 Mar 2019 21:29:37 +0000 Subject: [PATCH 2/5] Pin latest pyviz_comms --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d0af252a6b..d010a91d8e 100644 --- a/setup.py +++ b/setup.py @@ -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 = {} From aad7bdf68d4f1ee68f80f4419f7221627710f686 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 23 Mar 2019 21:32:58 +0000 Subject: [PATCH 3/5] Fixed MIME bundle --- holoviews/ipython/display_hooks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index d4be5adc4a..a546d685d8 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -142,18 +142,20 @@ def wrapped(element): mimebundle = fn(element, max_frames=max_frames) if mimebundle is None: return {}, {} - html = mimebundle_to_html(mimebundle) - mimebundle = {'text/html': html}, {} + mime_data, mime_metadata = mimebundle + mime_data['text/html'] = mimebundle_to_html(mime_data) + if 'text/javascript' in 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)) From 2b83621a5df472a5575cd519b5b9ab5bc9a6ddf4 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 23 Mar 2019 21:56:33 +0000 Subject: [PATCH 4/5] Fixed flake --- holoviews/ipython/display_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index a546d685d8..2bab67aa5f 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -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 From 59acc13d824ae38d5b532bff5a77cf09e54d8b76 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 23 Mar 2019 22:11:19 +0000 Subject: [PATCH 5/5] Handle PNG and SVG mime data correctly --- holoviews/ipython/display_hooks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index 2bab67aa5f..d78a6b3078 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -143,8 +143,8 @@ def wrapped(element): if mimebundle is None: return {}, {} mime_data, mime_metadata = mimebundle - mime_data['text/html'] = mimebundle_to_html(mime_data) 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...