X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=gallery%2Fplotter.js;h=08bdf0f873653ba17493e3e71e6b89cf96b3700c;hb=a5f3d82dc74669f378a1e7c63e10bd9804ce4ca2;hp=d0d14cc21318b2749f2b5e69bbf0988d8cc0341d;hpb=e1e80cce232a1efbebc1e3dbe236ecf957464c68;p=dygraphs.git diff --git a/gallery/plotter.js b/gallery/plotter.js index d0d14cc..08bdf0f 100644 --- a/gallery/plotter.js +++ b/gallery/plotter.js @@ -1,4 +1,6 @@ +/*global Gallery,Dygraph,data */ /*jshint evil:true */ +/*global fn */ Gallery.register( 'plotter', { @@ -27,6 +29,7 @@ Gallery.register( }, run: function() { + var plot; // defined below var select = document.getElementById("presets"); var presets = { 'id': [ -10, 10, 'function(x) {\n return x;\n}' ], @@ -46,7 +49,7 @@ Gallery.register( }; var plotButton = document.getElementById("plot"); - var plot = function() { + plot = function() { var eq = document.getElementById("eq").value; eval("fn = " + eq); @@ -71,7 +74,7 @@ Gallery.register( data.push(row); } - g = new Dygraph(graph, data); + new Dygraph(graph, data); }; plotButton.onclick = plot; plot();