ropensci / ozunconf17

Website for 2017 rOpenSci Ozunconf
http://ozunconf17.ropensci.org/
24 stars 6 forks source link

Port or wrap the Python datashader package for use in R #1

Open timchurches opened 7 years ago

timchurches commented 7 years ago

For background on datashader, see http://datashader.readthedocs.io/en/latest/

datashader addresses a similar problem to that addressed by one of the projects at the 2016 Australian RopenSci Unconf, but in a much elegant and general way that avoids all the messy overhead of breaking data into map swatches: https://github.com/ropensci/auunconf/issues/38

For discussion of datashader from the point of view of an R user, see http://www.win-vector.com/blog/2017/03/datashader-is-a-big-deal/

There would appear to be several possible approaches:

Orthogonal to these approaches might be wrapping data shader output via htmlwidgets, easy for use in Shiny apps (which is the ultimate goal - there may be short-cuts to that?).

goldingn commented 7 years ago

Have you considered a reticulate import? An R wrapper around the import would probably be needed, but it should solve the technical problems of making R & python play together nicely.

timchurches commented 7 years ago

The best thing about datashader is that it is interactive, and will recalculate pixel-level aggregates in even ginormous on-the-fly. But that requires close integration with the javascript interface to the bokeh chart object in python. I suspect that a complete port to R would be needed to obtain the performance required. That's doable, but not in two days. In the meantime, datashader is a good reason to use a bit of python and the Jupyter interface.

harryprince commented 5 years ago

@timchurches the best option might implement the same functions in RStudio-Addin with Shiny like esquisse R package.

timchurches commented 5 years ago

@harryprince The hard bit is porting the on-the-fly viewport aggregation functions from dataShader. The C++ code is portable, but what to port it to? A ggplot2 extension, but ggplot2 isn't designed for interactive graphics, seems like it would be difficult.