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

Added event method to DynamicMap #935

Merged
merged 1 commit into from
Oct 17, 2016
Merged
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
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