holoviz / datashader

Quickly and accurately render even the largest data.
http://datashader.org
BSD 3-Clause "New" or "Revised" License
3.3k stars 365 forks source link

Spatiotemporal data animation #242

Open jbednar opened 7 years ago

jbednar commented 7 years ago

[From @pzwang, 11/2015]

Could basically look like this, with some graphical controls to change aspects of the animation. Really, parameters of the animation are just additional variables for the transfer function.

http://earth.nullschool.net/#current/wind/surface/level/orthographic=-94.43,29.75,1806

Would be awesome to just be able to use their front-end code (not sure about license, feasibility, or desirability from a code quality perspective). Otherwise we'd have to do some webGL-fu on our end...

I don't think this animated form should be the only view of spatiotemporal data, but it should be one of the main ones available (possibly even the default view). Mating this to the backend engine in a generic way for many datasets will be the bulk of the work.

Another potential UI paradigm that we should think about is based on the Mac OS/iTunes "coverflow" approach, where we offer a time slider and the user can move back and forth between different time points: http://vanderlee.github.io/coverflow/ Each image itself would be an interactive view of the map at that point in time.

The UI should also include a time track that shows histogram of all points/tracks regardless of position (could be called "motion histogram"). The user can draw selection regions to drill down and filter what is shown in the main map view (whether that main view is doing the animated nullschool thing, or is represented as coverflow, or something else). This should use datashader, so the user can script filters that only tracks of a certain length or with a certain average velocity, get shown.

davidbrochart commented 7 years ago

The first animation you mention (the one from Earth) is somewhat specific to data that has a value and a direction (like wind), so the representation is dynamic but the data is static. The second one (with the slider) is much more general and could apply to the majority of time series datasets.

jbednar commented 7 years ago

That's a good point; the earth/wind example is indeed a special case of a dynamic visualization of static data (about dynamic phenomena :-). On the other hand, a similar approach will work well for genuinely dynamic data if the data happens to be periodic. E.g. here's one I did in 2002 with some periodic data as a GIF. Each of the frames shows a bunch of actual bitmaps of data, not just a symbolic representation of static data, but it works well as an animation because the data is on a cyclic/phasic timebase.

In the more general case of not having periodic data, playing it in a short loop like that will have distracting jumps as the animation repeats. One approach is then to do a ping-pong animation (forward, then reverse, then forward again), or just slow down the playback and linger on the last frame and first frame for a while. Some examples of the latter approach from various projects I've done over the years:

For a given dataset, it takes some trial and error to get the speed and duration of each segment of the animation to work well, so I don't think of this approach as a good general default, but it is definitely useful for conveying information about spatiotemporal data efficiently.

The second approach, with a slider, is actually already now supported using the github master version of HoloViews. You can see a simple example in the "HoloMap" section of:

https://anaconda.org/philippjfr/holoviews_datashader

Basically, if there is an additional dimension not mapped out spatially, a slider will be provided allowing you to select between different interactive visualizations. (Note that the plots won't actually be interactive in the static copy of that notebook at anaconda.org; you'd need a live Python server.) Extending it to have a coverflow interface would be possible, but not likely to happen soon.

Adding a histogram as @pzwang describes sounds useful and not terribly difficult using HoloViews, but I have not yet tried it out.