projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #478 from danvk/jshint
[dygraphs.git]
/
gallery
/
plotter.js
diff --git
a/gallery/plotter.js
b/gallery/plotter.js
index
d0d14cc
..
08bdf0f
100644
(file)
--- a/
gallery/plotter.js
+++ b/
gallery/plotter.js
@@
-1,4
+1,6
@@
+/*global Gallery,Dygraph,data */
/*jshint evil:true */
/*jshint evil:true */
+/*global fn */
Gallery.register(
'plotter',
{
Gallery.register(
'plotter',
{
@@
-27,6
+29,7
@@
Gallery.register(
},
run: function() {
},
run: function() {
+ var plot; // defined below
var select = document.getElementById("presets");
var presets = {
'id': [ -10, 10, 'function(x) {\n return x;\n}' ],
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 plotButton = document.getElementById("plot");
-
var
plot = function() {
+ plot = function() {
var eq = document.getElementById("eq").value;
eval("fn = " + eq);
var eq = document.getElementById("eq").value;
eval("fn = " + eq);
@@
-71,7
+74,7
@@
Gallery.register(
data.push(row);
}
data.push(row);
}
-
g =
new Dygraph(graph, data);
+ new Dygraph(graph, data);
};
plotButton.onclick = plot;
plot();
};
plotButton.onclick = plot;
plot();