You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lazy approach we are using to loading data results in plots that appear instantly and that only load and render data as the widgets are manipulated. This works very well in general but there are some responsiveness issues when using numeric sliders.
When moving sliders around, events are generated and are currently being queued. As it takes a while to load the data from a cube and render it, moving around numeric slider quickly creates a large queue of events that need to be processed before the plot reflects the final slider position.
There are number of different approaches I can think of that might help improve responsiveness:
Throttling JavaScript events with some heuristic based on how quickly frames are being returned from Python.
Throttling JavaScript events based on a parameter that is explicitly specified by the user.
Maintaining a queue of render events in Python and skipping queued events if the length of the queue gets too long (or when Python notices that the queue is taking too long to process).
Adding an 'Update' button which lets you move the sliders about quickly and only updates the plot when the button is pressed.
Each suggestion has pros and cons:
No input from the user but needs to sample the behaviour before a suitable throttling value can be found. Maybe you base the throttling speed based on the time taken to return the last frame only?
Explicit but requires user input and judgement.
Can choose to respond to or ignore events generated even while the first frame is being computed. The main issue is that this is technically challenging and probably rather complicated.
Solves the problem by removing the live update when dragging sliders. It hides lag at the cost of removing a compelling feature of working with widgets.
At this time, I have no opinion right about which approach is best. Whatever approach we pick, we need to make sure to test it with the nbagg backend to get a sense of what a user would experience when working with a real set of cubes.
The text was updated successfully, but these errors were encountered:
Thanks for outlining these different proposals. First of all I just remembered that you can already adjust throttling behavior by adjusting the fps output magic option (corresponding to proposal 1.). That said I think a dynamic approach that bases the throttling on how long a plot actually takes to render is probably going to provide a better user experience. I've actually implemented something like when prototyping the datashaderDynamicImage callback but we settled on a simple throttling parameter, because it turned out to be responsive enough. I can prototype something like it in HoloViews pretty quickly.
I can't currently envision how suggestion 3 would be implemented because you'd have to manage an event loop somewhere. Adding a button to validate a selection should also be straightforward but I think that degrades the user experience so much that it should only be used if the execution is very slow.
I have now introduced a PR in HoloViews to throttle events by measuring the speed of execution and queuing events which arrive faster than that (holoviz/holoviews#596). This works pretty robustly and improves the user experience. It doesn't deal with the slow speed of plotting in cartopy however and based on my profiling we can only generate about one frame per second for high resolution (800x600) Image cubes.
The lazy approach we are using to loading data results in plots that appear instantly and that only load and render data as the widgets are manipulated. This works very well in general but there are some responsiveness issues when using numeric sliders.
When moving sliders around, events are generated and are currently being queued. As it takes a while to load the data from a cube and render it, moving around numeric slider quickly creates a large queue of events that need to be processed before the plot reflects the final slider position.
There are number of different approaches I can think of that might help improve responsiveness:
Each suggestion has pros and cons:
At this time, I have no opinion right about which approach is best. Whatever approach we pick, we need to make sure to test it with the nbagg backend to get a sense of what a user would experience when working with a real set of cubes.
The text was updated successfully, but these errors were encountered: