X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=gallery%2Flink-interaction.js;h=f95a34225319e81a0ec04a4589357775cbfcd47d;hb=0a31d41e94fae75808da6caa36e96fcdd40fd23f;hp=5656e098c733f28e468d388cb750768bdb7a87a0;hpb=5a46df4c8041636edfb09702b43d62126c066911;p=dygraphs.git diff --git a/gallery/link-interaction.js b/gallery/link-interaction.js index 5656e09..f95a342 100644 --- a/gallery/link-interaction.js +++ b/gallery/link-interaction.js @@ -1,9 +1,12 @@ +/*global Gallery,Dygraph,data */ Gallery.register( 'link-interaction', { name: 'Link Interaction', setup: function(parent) { parent.innerHTML = [ + "
"].join("\n"); }, run: function() { var r = [ ]; @@ -26,7 +30,7 @@ Gallery.register( ]); } var orig_range = [ r[0][0].valueOf(), r[r.length - 1][0].valueOf() ]; - g = new Dygraph( + var g = new Dygraph( document.getElementById("div_g"), r, { rollPeriod: 7, @@ -38,7 +42,7 @@ Gallery.register( } ); - var desired_range = null; + var desired_range = null, animate; function approach_range() { if (!desired_range) return; // go halfway there @@ -55,9 +59,9 @@ Gallery.register( animate(); } } - function animate() { + animate = function() { setTimeout(approach_range, 50); - } + }; var zoom = function(res) { var w = g.xAxisRange();