Skip to content

Commit

Permalink
Merge pull request #935 from ioam/dmap_event
Browse files Browse the repository at this point in the history
Added event method to DynamicMap
  • Loading branch information
philippjfr authored Oct 17, 2016
2 parents 324c918 + 46f4d82 commit 42dd118
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions holoviews/core/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,22 @@ def _validate_key(self, key):
raise StopIteration("Key value %s above upper bound %s"
% (val, high))

def event(self, trigger=True, **kwargs):
"""
This method allows any of the available stream parameters to be
updated in an event.
"""
stream_params = set(util.stream_parameters(self.streams))
updated_streams = []
for stream in self.streams:
overlap = set(stream.params().keys()) & stream_params & set(kwargs.keys())
if overlap:
stream.update(**dict({k:kwargs[k] for k in overlap}, trigger=False))
updated_streams.append(stream)

if updated_streams and trigger:
updated_streams[0].trigger(updated_streams)


def _style(self, retval):
"""
Expand Down

0 comments on commit 42dd118

Please sign in to comment.