tylermorganwall / rayshader

R Package for 2D and 3D mapping and data visualization
https://www.rayshader.com/
2.06k stars 214 forks source link

Facilitate use from RStudio #27

Open bhogan-mitre opened 5 years ago

bhogan-mitre commented 5 years ago

Thank you for this great package! I am excited about the potential use cases here.

One suggestion would be to set options to facilitate use from within RStudio by using WebGL instead of X11. This is essential and not just a nicety on RStudio Server since X11 is not available in that environment. It took me longer than I care to admit to figure that out. I think I would prefer this even on RStudio (desktop).

Thanks for considering.

bhogan-mitre commented 5 years ago

This seems tricky since .onLoad doesn't appear to happen early enough to set options that are used by dependencies. It could be handled upstream in rgl's .onLoad.

In the meantime, perhaps advise RStudio users to set the following prior to library(rayshader):

# send output to Viewer rather than external X11 window
options(rgl.useNULL = TRUE,
        rgl.printRglwidget = TRUE)
fomightez commented 5 years ago

I wonder if your "meantime" approach @bhogan-mitre will help in regards to this comment I made a few days ago. It concerns using it on remote servers with no X11. Actually RStudio server and more. I had tried the first part already but did not include rgl.printRglwidget = TRUE.

tylermorganwall commented 5 years ago

writeWebGL currently is fairly limited in its utility--It only supports 65536 vertices per object, so it's not ideal given map dimensions will be limited to a maximum of 256x256. I've got a glTF 2.0 output function written that will eventually be included that has no such limitations, so that's going to form the basis of a rglwidget() replacement that could be used on RStudio server.

seabbs commented 5 years ago

I'd be keen to see an implementation that works with Rstudio server. Usually, everything I do is dockerised so having to install locally just for rayshader is a shame.

Great work on this though 👍

joachim-gassen commented 3 years ago

writeWebGL currently is fairly limited in its utility--It only supports 65536 vertices per object, so it's not ideal given map dimensions will be limited to a maximum of 256x256. I've got a glTF 2.0 output function written that will eventually be included that has no such limitations, so that's going to form the basis of a rglwidget() replacement that could be used on RStudio server.

Sorry for hijacking this old issue but I was wondering whether you are still working on that glTF 2.0 output function and/or would be willing to share your progress. I am currently looking into something very loosely related and that would need a writeGLTF function for rgl. Thanks!