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

graphsjs() animation #74

Open
JoGall opened this issue Jan 29, 2018 · 3 comments
Open

graphsjs() animation #74

JoGall opened this issue Jan 29, 2018 · 3 comments

Comments

@JoGall
Copy link

JoGall commented Jan 29, 2018

Is there any way to animate globejs() without requiring interaction from the user? Perhaps by transitioning between frames with different latitude-longitude, similar to your animation example for graphjs? I'd love to be able to produce a visualisation of an auto-spinning globe.

Thanks for a great package by the way -- you've saved me 100s of hours learning D3.js from scratch!

@bwlewis
Copy link
Owner

bwlewis commented Jan 31, 2018

Sure, it seems like that would be do-able. I am much more focused on the development of graphjs these days, however and have not put in too much work on the globes (as you can see from the many outstanding bugs). A P.R. for this would certainly be appreciated and merged!

Other globejs() users might want this too, and be willing to collaborate...

@JoGall
Copy link
Author

JoGall commented Feb 20, 2018

Just came back to this work and realised I forgot to reply -- thanks for your response.

I'd like to be able to contribute but know absolutely zero javascript and have no idea what's going on under the hood here. Could you perhaps point me in the right direction? Cheers!

@bwlewis
Copy link
Owner

bwlewis commented Feb 23, 2018

It's unfortunately a lot of JavaScript...the globejs JavaScript code is not very complicated (compared to scatterplot3js/graphjs). But part of that is because of the lack of fancy things like animation. Also the code is pretty old now and more of a prototype than the others.

But thinking about this, I'm not sure that the approach I used for graph animation is the right one for this. Instead, it might be easier to build a 3-d scene and load it, similar to what's done in this example:

https://threejs.org/examples/#webgl_animation_scene

The scene that is loaded is a complex json file describing the scene here:
https://threejs.org/examples/#webgl_animation_scene

Then the task of the globejs function would be both simpler and more complex. First build the scene json specification (complex), then display it complete with whatever animation is in the scene (easy).

Note that, less the animation part, this is similar to the approach taken by the rgl package (https://cran.r-project.org/package=rgl).

This might also be a good way to support the objective in issue #77 -- it's a very different way of working than the current functions (which hard-code the various threejs objects like cameras, scenes, etc.) but could be very cool.

I will think about this some more...

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

No branches or pull requests

2 participants