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

Fixes for dynamic plot updates #911

Merged
merged 5 commits into from
Oct 7, 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
2 changes: 1 addition & 1 deletion holoviews/core/operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __call__(self, element, **params):
kdims=element.kdims)
elif dynamic:
from ..util import Dynamic
streams = getattr(self, 'streams', [])
streams = getattr(self.p, 'streams', [])
processed = Dynamic(element, streams=streams,
operation=self, kwargs=params)
elif isinstance(element, ViewableElement):
Expand Down
11 changes: 6 additions & 5 deletions holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -954,19 +954,20 @@ def get_dynamic_item(map_obj, dimensions, key):
and a corresponding key. The dimensions must be a subset
of the map_obj key dimensions.
"""
if key == () and not dimensions or not map_obj.kdims:
return key, map_obj[()]
dmaps = map_obj.traverse(lambda x: x, ['DynamicMap'])
dmap = dmaps[0] if dmaps else map_obj
if key == () and (not dimensions or not dmap.kdims):
return key, map_obj.map(lambda x: x[()], ['DynamicMap', 'HoloMap'])
elif isinstance(key, tuple):
dims = {d.name: k for d, k in zip(dimensions, key)
if d in map_obj.kdims}
key = tuple(dims.get(d.name) for d in map_obj.kdims)
el = map_obj.select([lambda x: type(x).__name__ == 'DynamicMap'],
**dims)
el = map_obj.select(['DynamicMap', 'HoloMap'], **dims)
elif key < map_obj.counter:
key_offset = max([key-map_obj.cache_size, 0])
key = map_obj.keys()[min([key-key_offset,
len(map_obj)-1])]
el = map_obj[key]
el = map_obj.map(lambda x: x[key], ['DynamicMap'])
elif key >= map_obj.counter:
el = next(map_obj)
key = list(map_obj.keys())[-1]
Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/bokeh/chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def get_extents(self, element, ranges):



class SideHistogramPlot(HistogramPlot, ColorbarPlot):
class SideHistogramPlot(ColorbarPlot, HistogramPlot):

style_opts = HistogramPlot.style_opts + ['cmap']

Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ def _get_frame(self, key):
if not isinstance(key, tuple): key = (key,)
nthkey_fn = lambda x: zip(tuple(x.name for x in x.kdims),
list(x.data.keys())[min([key[0], len(x)-1])])
if key == self.current_key:
if key == self.current_key and not self._force:
return self.current_frame
else:
self.current_key = key
Expand Down