},
run: function() {
var lastClickedGraph;
- // TODO(konigsberg): Add cleanup to remove callbacks.
- Dygraph.addEvent(document, "mousewheel", function() { lastClickedGraph = null; });
- Dygraph.addEvent(document, "click", function() { lastClickedGraph = null; });
+ document.addEventListener("mousewheel", function() { lastClickedGraph = null; });
+ document.addEventListener("click", function() { lastClickedGraph = null; });
new Dygraph(document.getElementById("div_g"),
NoisyData, { errorBars : true });
new Dygraph(document.getElementById("div_g2"),
},
underlayCallback : captureCanvas
});
+ },
+ clean: function() {
+ document.removeEventListener('mousewheel');
+ document.removeEventListener('click');
}
});