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

Ensure that NdOverlay is propagated correctly in dynamic batched mode #814

Merged
merged 2 commits into from
Aug 16, 2016
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions holoviews/plotting/bokeh/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions holoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down