Skip to content
Permalink
Browse files

Fix for matching overlay keys correctly

  • Loading branch information...
philippjfr committed Dec 18, 2015
1 parent 4c06fe3 commit 53d9f58cf1c51a2cd67cffdc5be1288e5828000a
Showing with 10 additions and 8 deletions.
  1. +1 −1 holoviews/core/util.py
  2. +9 −7 holoviews/plotting/plot.py
@@ -615,7 +615,7 @@ def get_overlay_spec(o, k, v):
"""
Gets the type.group.label + key spec from an Element in an Overlay.
"""
k = (wrap_tuple(k),)
k = wrap_tuple(k)
return ((type(v).__name__, v.group, v.label) + k if len(o.kdims) else
(type(v).__name__,) + k)

@@ -660,10 +660,10 @@ def _create_subplots(self, ranges):
continue

if self.hmap.type == Overlay:
style_key = (vmap.type.__name__,) + (key,)
style_key = (vmap.type.__name__,) + key
else:
if not isinstance(key, tuple): key = (key,)
style_key = group_fn(vmap) + (key,)
style_key = group_fn(vmap) + key
group_key = style_key[:length]
zorder = ordering.index(style_key) + zoffset
cyclic_index = group_counter[group_key]
@@ -757,11 +757,13 @@ def closest_match(self, match, specs, depth=0):
if spec[0] == match[0]:
new_specs.append((i, spec[1:]))
else:
match_length = max(i for i in range(len(match[0]))
if (isinstance(match[0], tuple)
and match[0][:i] == spec[0][:i])
or (isinstance(match[0], util.basestring)
and match[0].startswith(spec[0][:i])))
if util.isnumber(match[0]) and util.isnumber(spec[0]):
match_length = -abs(match[0]-spec[0])
elif all(isinstance(s[0], basestring) for s in [spec, match]):
match_length = max(i for i in range(len(match[0]))
if match[0].startswith(spec[0][:i]))
else:
match_length = 0
match_lengths.append((i, match_length, spec[0]))
if not new_specs:
if depth == 0:

0 comments on commit 53d9f58

Please sign in to comment.
You can’t perform that action at this time.