Issue
When using the Interactive Widgets in IPython Notebook, in particular FloatSliderWidget, is there a way to delay the rendering of the final result?
I'm using the widgets and basemap to display map data and the attempts to render at each step (when sliding the slider - controlling image overlay alpha) is very slow.
Can I set some flag etc. that delays final rendering? Or add a button to display the image when I've set all my sliders?
Many thanks for any help.
Cheers, J.
Solution
There is an interact_manual
function which works like interact
but with a 'Run' button instead of automatic updating. Docs. I think this is new in IPython 3.
For throttling widgets more generally, all widgets should have a .msg_throttle
attribute. This is how many updates can be 'in the pipe' at once. The default is 3, so when you're dragging your slider, it queues three values to get results. Setting it down to 1 should make it more responsive for slow functions - it won't send another value until the previous execution finishes. For quicker functions, a lower value would make the output change less smoothly.
Answered By - Thomas K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.