/**
- * @constructor
+ * @typedef {{
+ * clearChart: (function(Object)|undefined),
+ * deselect: (function(Object)|undefined),
+ * didDrawChart: (function(Object)|undefined),
+ * layout: (function(Object)|undefined),
+ * predraw: (function(Object)|undefined),
+ * select: (function(Object)|undefined),
+ * willDrawChart: (function(Object)|undefined)
+ * }}
+ */
+var DygraphPluginHandlers;
+
+
+/**
+ * @interface
*/
var DygraphPluginType;
/**
* @param {!Dygraph} dygraph
- * TODO(danvk): be more specific than Object
- * @return {Object.<function(Object)>} Mapping from event -> callback.
+ * @return {DygraphPluginHandlers} Mapping from event -> callback.
*/
DygraphPluginType.prototype.activate = function(dygraph) {};
* Draws the axes. This includes the labels on the x- and y-axes, as well
* as the tick marks on the axes.
* It does _not_ draw the grid lines which span the entire chart.
+ * @constructor
+ * @implements {DygraphPluginType}
*/
var axes = function() {
this.xlabels_ = [];
this.ylabels_ = [];
};
+/** @override */
axes.prototype.toString = function() {
return "Axes Plugin";
};
+/** @override */
axes.prototype.activate = function(g) {
return {
'layout': this.layout,
context.restore();
};
+/** @override */
+axes.prototype.destroy = function() {
+};
+
return axes;
})();
* Draws the gridlines, i.e. the gray horizontal & vertical lines running the
* length of the chart.
*
+ * @implements {DygraphPluginType}
* @constructor
*/
var grid = function() {
};
+/** @override */
grid.prototype.toString = function() {
return "Gridline Plugin";
};
+/** @override */
grid.prototype.activate = function(g) {
return {
'willDrawChart': this.willDrawChart
}
};
+/** @override */
grid.prototype.destroy = function() {
};