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

Open Dynamic and Scrubber fixes #549

Merged
merged 5 commits into from
Mar 14, 2016
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion holoviews/core/spaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def _execute_callback(self, *args):

if isinstance(retval, tuple):
self._validate_key(retval[0]) # Validated output key
return self._style(retval)
return (retval[0], self._style(retval[1]))
else:
self._validate_key((self.counter,))
return (self.counter, self._style(retval))
Expand Down
2 changes: 1 addition & 1 deletion holoviews/plotting/mpl/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def _anim_data(self, anim, fmt):
if extra_args != []:
anim_kwargs = dict(anim_kwargs, extra_args=extra_args)

if self.fps is not None: anim_kwargs['fps'] = self.fps
if self.fps is not None: anim_kwargs['fps'] = max([int(self.fps), 1])
if self.dpi is not None: anim_kwargs['dpi'] = self.dpi
if not hasattr(anim, '_encoded_video'):
with NamedTemporaryFile(suffix='.%s' % fmt) as f:
Expand Down
5 changes: 4 additions & 1 deletion holoviews/plotting/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,14 @@ def _get_frame(self, key):
if d in self.hmap.kdims}
frame = self.hmap.select([DynamicMap], **dims)
elif key < self.hmap.counter:
key = self.hmap.keys()[key]
key_offset = max([key-self.hmap.cache_size, 0])
key = self.hmap.keys()[min([key-key_offset, len(self.hmap)-1])]
frame = self.hmap[key]
elif key >= self.hmap.counter:
frame = next(self.hmap)
key = self.hmap.keys()[-1]
else:
frame = None
if not isinstance(key, tuple): key = (key,)
if not key in self.keys:
self.keys.append(key)
Expand Down
4 changes: 2 additions & 2 deletions holoviews/plotting/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Renderer(Exporter):
Output render format for static figures. If None, no figure
rendering will occur. """)

fps=param.Integer(20, doc="""
fps=param.Number(20, doc="""
Rendered fps (frames per second) for animated formats.""")

holomap = param.ObjectSelector(default='auto',
Expand Down Expand Up @@ -199,7 +199,7 @@ def _validate(self, obj, fmt):
fmt = holomap_formats[0] if self.holomap=='auto' else self.holomap

if fmt in self.widgets:
plot = self.get_widget(plot, fmt)
plot = self.get_widget(plot, fmt, display_options={'fps': self.fps})
fmt = 'html'

all_formats = set(fig_formats + holomap_formats)
Expand Down
7 changes: 6 additions & 1 deletion holoviews/plotting/widgets/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ ScrubberWidget.prototype = new HoloViewsWidget;

ScrubberWidget.prototype.set_frame = function(frame){
this.current_frame = frame;
document.getElementById(this.slider_id).value = this.current_frame;
widget = document.getElementById(this.slider_id);
if (widget === null) {
this.pause_animation();
return
}
widget.value = this.current_frame;
if(this.cached) {
this.update(frame)
} else {
Expand Down