+/*global Gallery,Dygraph,data */
/*jshint evil:true */
+/*global fn */
Gallery.register(
'plotter',
{
},
run: function() {
+ var plot; // defined below
var select = document.getElementById("presets");
var presets = {
'id': [ -10, 10, 'function(x) {\n return x;\n}' ],
};
var plotButton = document.getElementById("plot");
- var plot = function() {
+ plot = function() {
var eq = document.getElementById("eq").value;
eval("fn = " + eq);
data.push(row);
}
- g = new Dygraph(graph, data);
+ new Dygraph(graph, data);
};
plotButton.onclick = plot;
plot();