I'm using Sigma.Js library and want to make the graph rotate around its axis for the first 10 seconds after the page loads. I wrote the following code for it, but it doesn't work. Any idea why?
for (i = 0; i < 101; i++) {
var angle = i / 100;
s.cameras[0].angle = angle;
setTimeout(function() {
s.refresh();
},100);
}
FYI s
refers to the graph initialized, s.cameras[0].angle sets the angle of the view (referring to it through console works, so that's correct), s.refresh reloads the graph.
I guess it has something to do with async (the cycle gets executed bypassing timeout?), but can't figure it out myself...
Thank you for your help!