From 6894c9c761e055512bd3b8ed31915a830d8ab447 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 6 Oct 2016 23:17:32 +0100 Subject: [PATCH 1/5] Fixed lookup of DynamicMap items in containers --- holoviews/core/util.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index a4a1ca8698..e5c487966b 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -954,19 +954,19 @@ 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[()] + dmap = map_obj.traverse(lambda x: x, ['DynamicMap'])[0] + if key == () and (not dimensions or not dmap.kdims): + return key, map_obj.map(lambda x: x[()], ['DynamicMap']) 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'], **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] From 9a0422f17d614dd400d4c26b985c62fb96216420 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 6 Oct 2016 23:18:46 +0100 Subject: [PATCH 2/5] Fixed streams on Dynamic function --- holoviews/core/operation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/core/operation.py b/holoviews/core/operation.py index 6262264d11..99f20e596d 100644 --- a/holoviews/core/operation.py +++ b/holoviews/core/operation.py @@ -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): From ece8d5b94c6a72bc2cebdcf794efd9243ac9ea58 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 6 Oct 2016 23:19:17 +0100 Subject: [PATCH 3/5] Fixed updating of Histogram handles --- holoviews/plotting/bokeh/chart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/plotting/bokeh/chart.py b/holoviews/plotting/bokeh/chart.py index 13b5e113a0..2c9c8e06d8 100644 --- a/holoviews/plotting/bokeh/chart.py +++ b/holoviews/plotting/bokeh/chart.py @@ -239,7 +239,7 @@ def get_extents(self, element, ranges): -class SideHistogramPlot(HistogramPlot, ColorbarPlot): +class SideHistogramPlot(ColorbarPlot, HistogramPlot): style_opts = HistogramPlot.style_opts + ['cmap'] From 704a92709b9ab5ea21fed146e89b726c10c566a6 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 6 Oct 2016 23:19:46 +0100 Subject: [PATCH 4/5] Fixed GenericCompositePlot.get_frame for DynamicMaps with streams --- holoviews/plotting/plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/holoviews/plotting/plot.py b/holoviews/plotting/plot.py index 618e241f00..d52691a18f 100644 --- a/holoviews/plotting/plot.py +++ b/holoviews/plotting/plot.py @@ -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 From 9ec9f4b22b5f5ef38e68da5b2bffedac209263f7 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Thu, 6 Oct 2016 23:39:00 +0100 Subject: [PATCH 5/5] Allowed handling HoloMaps when looking up DynamicMaps --- holoviews/core/util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/holoviews/core/util.py b/holoviews/core/util.py index e5c487966b..59d99dfd35 100644 --- a/holoviews/core/util.py +++ b/holoviews/core/util.py @@ -954,14 +954,15 @@ def get_dynamic_item(map_obj, dimensions, key): and a corresponding key. The dimensions must be a subset of the map_obj key dimensions. """ - dmap = map_obj.traverse(lambda x: x, ['DynamicMap'])[0] + 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']) + 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(['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,