From bcddab8f684e5bda135a6644768c8833580e9e06 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Tue, 16 Aug 2016 13:16:20 +0100
Subject: [PATCH 1/2] Ensure that NdOverlay is propagated correctly in dynamic
batched mode
---
holoviews/plotting/bokeh/element.py | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py
index 9335b22d80..97c10bc1d9 100644
--- a/holoviews/plotting/bokeh/element.py
+++ b/holoviews/plotting/bokeh/element.py
@@ -852,11 +852,18 @@ def update_frame(self, key, ranges=None, element=None, empty=False):
ranges = self.compute_ranges(range_obj, key, ranges)
for k, subplot in self.subplots.items():
empty, el = False, None
+ # If in Dynamic mode propagate elements to subplots
if isinstance(self.hmap, DynamicMap) and element:
- idx = dynamic_update(self, subplot, k, element, items)
- empty = idx is None
- if not empty:
- _, el = items.pop(idx)
+ # In batched mode NdOverlay is passed to subplot directly
+ if self.batched:
+ el = element
+ empty = False
+ # If not batched get the Element matching the subplot
+ else:
+ idx = dynamic_update(self, subplot, k, element, items)
+ empty = idx is None
+ if not empty:
+ _, el = items.pop(idx)
subplot.update_frame(key, ranges, element=el, empty=(empty or all_empty))
if isinstance(self.hmap, DynamicMap) and items:
From fbf801df35ea75c185692a58e863211a34b4ace6 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Tue, 16 Aug 2016 17:35:50 +0100
Subject: [PATCH 2/2] Fix dynamic zorder behavior
---
holoviews/plotting/plot.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/holoviews/plotting/plot.py b/holoviews/plotting/plot.py
index d59c3cb028..076224e800 100644
--- a/holoviews/plotting/plot.py
+++ b/holoviews/plotting/plot.py
@@ -547,9 +547,8 @@ def get_zorder(self, overlay, key, el):
spec = util.get_overlay_spec(overlay, key, el)
try:
return self.ordering.index(spec)
- except IndexError:
- if spec not in self.ordering:
- self.ordering = util.layer_sort(self.hmap)
+ except ValueError:
+ self.ordering = sorted(self.ordering+[spec])
return self.ordering.index(spec)