Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieve current orientation information from globe #90

Open
btupper opened this issue Jan 21, 2020 · 2 comments
Open

retrieve current orientation information from globe #90

btupper opened this issue Jan 21, 2020 · 2 comments

Comments

@btupper
Copy link

btupper commented Jan 21, 2020

Hi,

We have a (beautiful!) globe rendered in a shiny page with various monthly oceanographic climatology variables we overlay. When the user selects a new month (from a slider) or a new variable (from a drop down list), the globe is redrawn with the default orientation "rotationlat" = 0 and rotationlong = 0.

Is there a way to capture the current orientation so that we can use those values to set the orientation of the redrawn globe? I can't noodle out how to retrieve those.

Thanks!
Ben

@bwlewis
Copy link
Owner

bwlewis commented Jan 21, 2020

This should be possible on the most current version 0.3.3 just submitted to CRAN thanks to Jared's new elementId option #89. If all goes well, will be on CRAN soon (fingers crossed).

But it is still a bit tricky, I think the idea will be to use a custom widget ID (elementId) and then use tricks outlined here: https://shiny.rstudio.com/articles/communicating-with-js.html to get the rotation values back in to R via a reactive value.

I'll try to come up with an example, might need advice from @jaredlander .

@jaredlander
Copy link

Happy to help where I can, though I am far from knowledgeable about JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants