Skip to content

Commit

Permalink
Improved handling of plot range on stream events
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 21, 2017
1 parent 3b90d87 commit 47ee18c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions holoviews/plotting/bokeh/element.py
Expand Up @@ -802,18 +802,16 @@ def current_handles(self):
elif self.framewise:
rangex, rangey = True, True
elif isinstance(self.hmap, DynamicMap):
rangex, rangey = True, True
callbacks = [cb for cbs in self.traverse(lambda x: x.callbacks)
for cb in cbs]
streams = [s for cb in callbacks for s in cb.streams]
for stream in streams:
if isinstance(stream, RangeXY):
rangex, rangey = False, False
break
elif isinstance(stream, RangeX):
rangex = False
elif isinstance(stream, RangeY):
rangey = False
stream_metadata = [stream._metadata for cb in callbacks
for stream in cb.streams if stream._metadata]
ranges = ['%s_range' % ax for ax in 'xy']
event_ids = [md[ax]['id'] for md in stream_metadata
for ax in ranges if ax in md]
stream_active = any(self.handles[r].ref['id'] in event_ids
for r in ranges)
rangex, rangey = (not stream_active,)*2
else:
rangex, rangey = False, False
if rangex:
Expand Down

0 comments on commit 47ee18c

Please sign in to comment.