From 7997094926599fb710efc0122ad355be46cacdbf Mon Sep 17 00:00:00 2001 From: jlstevens Date: Thu, 13 Apr 2017 19:20:20 +0100 Subject: [PATCH] Displaying object repr if process_object returns an error --- holoviews/ipython/display_hooks.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/holoviews/ipython/display_hooks.py b/holoviews/ipython/display_hooks.py index 8ce2dcc4c5..abaf86c158 100644 --- a/holoviews/ipython/display_hooks.py +++ b/holoviews/ipython/display_hooks.py @@ -45,7 +45,10 @@ def process_object(obj): def render(obj, **kwargs): info = process_object(obj) - if info: return info + if info: + IPython.display.display(IPython.display.HTML(info)) + return + if render_anim is not None: return render_anim(obj) @@ -161,7 +164,10 @@ def wrapped(element): @display_hook def element_display(element, max_frames, max_branches): info = process_object(element) - if info: return info + if info: + IPython.display.display(IPython.display.HTML(info)) + return + backend = Store.current_backend if type(element) not in Store.registry[backend]: @@ -258,7 +264,10 @@ def element_png_display(element, max_frames, max_branches): if 'png' not in Store.display_formats: return None info = process_object(element) - if info: return info + if info: + IPython.display.display(IPython.display.HTML(info)) + return + backend = Store.current_backend if type(element) not in Store.registry[backend]: @@ -280,7 +289,10 @@ def element_svg_display(element, max_frames, max_branches): if 'svg' not in Store.display_formats: return None info = process_object(element) - if info: return info + if info: + IPython.display.display(IPython.display.HTML(info)) + return + backend = Store.current_backend if type(element) not in Store.registry[backend]: