You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use it to create a 3D time-evolution plot of a Lorenz system. My approach is to use the graphjs function with numerous layouts representing consecutive time steps (evo_layout). The first layout contains all the points (nodes) collapsed into a single point, the initial position. Then by each step the points (nodes) are moving along the precalculated path, step-by-step changing their coordinates. This approach works; however, to achieve a sufficiently smooth path I need about 1000 discretization points, which create a quite large (~20Mb) layout list variable, which slows down very much the loading of the shiny app.
Do you have any suggestions on how to make the animation more efficient, e.g. by reducing the size of the layout list somehow, or by using a different approach?
Please find the R-files in the attached zip. lorenz_animation.zip
It contains files for a minimal shiny app (ui.R, server.R). prepare_lorenz.R is to be run before launching the shiny app, it generates the variables needed for the animation. In this file line 8 controls the coarseness of the discretization: tt = seq(0, 10, by = 0.05) is too coarse, tt = seq(0, 10, by = 0.01) would be needed.
in the server.R file. That is enough to preserve most of the fidelity of your plot and really cuts down on the output size.
It's still kind of lame, but it's the best I can do for now. A better approach might be to invent a way to parameterize animations in the new, experimental render() function...but that's in the future for sure.
Thanks a lot for the suggestion! However, it does not seem to speed up the process. Maybe I'm not measuring it correctly but the size of the output produced by:
with and without the signif argument are virtually the same. I guess one issue is loading the large layout list (evo_layout; lorenz_attr = readRDS('lorenz_attr.rds')). I do not know how to cut its size down.
Hi Bryan,
First, thanks for this great package.
I'm trying to use it to create a 3D time-evolution plot of a Lorenz system. My approach is to use the
graphjs
function with numerous layouts representing consecutive time steps (evo_layout
). The first layout contains all the points (nodes) collapsed into a single point, the initial position. Then by each step the points (nodes) are moving along the precalculated path, step-by-step changing their coordinates. This approach works; however, to achieve a sufficiently smooth path I need about 1000 discretization points, which create a quite large (~20Mb) layout list variable, which slows down very much the loading of the shiny app.Do you have any suggestions on how to make the animation more efficient, e.g. by reducing the size of the layout list somehow, or by using a different approach?
Please find the R-files in the attached zip. lorenz_animation.zip
It contains files for a minimal shiny app (
ui.R
,server.R
).prepare_lorenz.R
is to be run before launching the shiny app, it generates the variables needed for the animation. In this file line 8 controls the coarseness of the discretization:tt = seq(0, 10, by = 0.05)
is too coarse,tt = seq(0, 10, by = 0.01)
would be needed.You can take a look at a low resolution (discretized to 200 points) version of it here:
http://ec2-18-197-104-223.eu-central-1.compute.amazonaws.com:3838/threejs_test2/
Thank you in advance for any suggestions!
Arpi
The text was updated successfully, but these errors were encountered: