X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Fannotations.js;h=d47f8c76efbcdf922741bdb7df25077096f113eb;hb=a12a78ae06c196aa0d3211ab57b584367504b9a0;hp=a3a13c345ef0e969d8dc40c9a900853ead759fe9;hpb=ee53deb9db465f5eea54e102ca755decef005496;p=dygraphs.git diff --git a/plugins/annotations.js b/plugins/annotations.js index a3a13c3..d47f8c7 100644 --- a/plugins/annotations.js +++ b/plugins/annotations.js @@ -10,6 +10,13 @@ Dygraph.Plugins.Annotations = (function() { Current bits of jankiness: - Uses dygraph.layout_ to get the parsed annotations. - Uses dygraph.plotter_.area + +It would be nice if the plugin didn't require so much special support inside +the core dygraphs classes, but annotations involve quite a bit of parsing and +layout. + +TODO(danvk): cache DOM elements. + */ var annotations = function() { @@ -23,7 +30,7 @@ annotations.prototype.toString = function() { annotations.prototype.activate = function(g) { return { clearChart: this.clearChart, - drawChart: this.drawChart + didDrawChart: this.didDrawChart }; }; @@ -40,7 +47,7 @@ annotations.prototype.clearChart = function(e) { this.detachLabels(); }; -annotations.prototype.drawChart = function(e) { +annotations.prototype.didDrawChart = function(e) { var g = e.dygraph; // Early out in the (common) case of zero annotations.