Skip to content

Commit

Permalink
add current_key property to DynamicMap
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Oct 31, 2021
1 parent 51abdcb commit 802cdd5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions holoviews/core/spaces.py
Expand Up @@ -853,6 +853,11 @@ def unbounded(self):
unbounded_dims.append(str(kdim))
return unbounded_dims

@property
def current_key(self):
"""Returns the current key value."""
return getattr(self, '_current_key', None)

def _stream_parameters(self):
return util.stream_parameters(
self.streams, no_duplicates=not self.positional_stream_args
Expand Down Expand Up @@ -1170,6 +1175,8 @@ def __getitem__(self, key):
otherwise returns cloned DynamicMap containing the cross-
product of evaluated items.
"""
self._current_key = key

# Split key dimensions and data slices
sample = False
if key is Ellipsis:
Expand Down

0 comments on commit 802cdd5

Please sign in to comment.