From 26c7d86b5d9db8b03752356962676af1ce6e0fe4 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 22 Jul 2013 19:44:47 -0400 Subject: [PATCH] 99 warnings, all in dygraph.js --- dygraph-externs.js | 4 ++-- dygraph-gviz.js | 4 ++-- dygraph-interaction-model.js | 4 ++-- dygraph-layout.js | 14 +++++++------- dygraph-options.js | 2 +- dygraph-utils.js | 4 ++-- dygraph.js | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dygraph-externs.js b/dygraph-externs.js index 48a90b0..fa0d949 100644 --- a/dygraph-externs.js +++ b/dygraph-externs.js @@ -117,7 +117,7 @@ var DygraphPlotterType; * is2DPan: boolean, * cancelNextDblclick: boolean, * initializeMouseDown: - * function(!Event, !Dygraph, !Dygraph.InteractionContext) + * function(!Event, !Dygraph, !DygraphInteractionContext) * }} */ -var DygraphsInteractionContext; +var DygraphInteractionContext; diff --git a/dygraph-gviz.js b/dygraph-gviz.js index 58e14d2..5287037 100644 --- a/dygraph-gviz.js +++ b/dygraph-gviz.js @@ -32,8 +32,8 @@ Dygraph.GVizChart = function(container) { }; /** - * @param {GVizDataTable} data - * @param {Object.<*>} options + * @param {google.visualization.DataTable} data + * @param {Object} options */ Dygraph.GVizChart.prototype.draw = function(data, options) { // Clear out any existing dygraph. diff --git a/dygraph-interaction-model.js b/dygraph-interaction-model.js index 6168743..00feccc 100644 --- a/dygraph-interaction-model.js +++ b/dygraph-interaction-model.js @@ -278,8 +278,8 @@ Dygraph.Interaction.moveZoom = function(event, g, context) { * @param {!DygraphInteractionContext} context */ Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) { - var clickCallback = g.attr_('clickCallback'); - var pointClickCallback = g.attr_('pointClickCallback'); + var clickCallback = /**@type{Function}*/(g.attr_('clickCallback')); + var pointClickCallback = /**@type{Function}*/(g.attr_('pointClickCallback')); var selectedPoint = null; diff --git a/dygraph-layout.js b/dygraph-layout.js index 628e889..de3feb3 100644 --- a/dygraph-layout.js +++ b/dygraph-layout.js @@ -47,7 +47,7 @@ var DygraphLayout = function(dygraph) { /** @type {Array.} */ this.setNames = []; - /** @type {Array.} */ + /** @type {Array.} */ this.annotations = []; /** @type {Array.} */ @@ -55,9 +55,9 @@ var DygraphLayout = function(dygraph) { // TODO(danvk): it's odd that xTicks_ and yTicks_ are inputs, but xticks and // yticks are outputs. Clean this up. - /** @type {Dygraph.TickList} */ + /** @type {DygraphTickList} */ this.xTicks_ = null; - /** @type {Dygraph.TickList} */ + /** @type {DygraphTickList} */ this.yTicks_ = null; /** @type {?DygraphRect} */ @@ -176,20 +176,20 @@ DygraphLayout.prototype.computePlotArea = function() { }; /** - * @param {Array.} ann The annotations + * @param {Array.} ann The annotations */ DygraphLayout.prototype.setAnnotations = function(ann) { // The Dygraph object's annotations aren't parsed. We parse them here and // save a copy. If there is no parser, then the user must be using raw format. - /** @type {Array.} */ + /** @type {Array.} */ this.annotations = []; var parse = /** @type {function(string):number} */(this.attr_('xValueParser')) || function(x) { return parseFloat(x); }; for (var i = 0; i < ann.length; i++) { // lame that closure compiler wants all these undefineds! - /** @type {Dygraph.AnnotationType} */ + /** @type {DygraphAnnotationType} */ var a = { x: ann[i].x, series: ann[i].series, @@ -218,7 +218,7 @@ DygraphLayout.prototype.setAnnotations = function(ann) { }; /** - * @param {!Dygraph.TickList} xTicks The x-axis ticks. + * @param {!DygraphTickList} xTicks The x-axis ticks. */ DygraphLayout.prototype.setXTicks = function(xTicks) { this.xTicks_ = xTicks; diff --git a/dygraph-options.js b/dygraph-options.js index de15512..70b5f75 100644 --- a/dygraph-options.js +++ b/dygraph-options.js @@ -197,7 +197,7 @@ DygraphOptions.prototype.reparseSeries = function() { } else { for (var idx = 0; idx < this.labels_.length; idx++) { var seriesName = this.labels_[idx]; - var optionsForSeries = this.user_.series[seriesName] || {}; + var optionsForSeries = this.user_['series'][seriesName] || {}; var yAxis = axisToIndex_(optionsForSeries["axis"]); this.series_[seriesName] = { diff --git a/dygraph-utils.js b/dygraph-utils.js index d7a4adb..63ce052 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -378,7 +378,7 @@ Dygraph.pageY = function(e) { * Converts page the x-coordinate of the event to pixel x-coordinates on the * canvas (i.e. DOM Coords). * @param {!Event} e Drag event. - * @param {!Dygraph.InteractionContext} context Interaction context object. + * @param {!DygraphInteractionContext} context Interaction context object. * @return {number} The amount by which the drag has moved to the right. */ Dygraph.dragGetX_ = function(e, context) { @@ -389,7 +389,7 @@ Dygraph.dragGetX_ = function(e, context) { * Converts page the y-coordinate of the event to pixel y-coordinates on the * canvas (i.e. DOM Coords). * @param {!Event} e Drag event. - * @param {!Dygraph.InteractionContext} context Interaction context object. + * @param {!DygraphInteractionContext} context Interaction context object. * @return {number} The amount by which the drag has moved down. */ Dygraph.dragGetY_ = function(e, context) { diff --git a/dygraph.js b/dygraph.js index 5ccda4c..38fcb15 100644 --- a/dygraph.js +++ b/dygraph.js @@ -76,8 +76,8 @@ var Dygraph = function(div, file, opt_attrs) { typeof(G_vmlCanvasManager) != 'undefined' && document.readyState != 'complete') { // TODO(danvk): fix this code given lack of __init__ method. - var self = this; - setTimeout(function() { self.__init__(div, file, attrs); }, 100); + // var self = this; + // setTimeout(function() { self.__init__(div, file, attrs); }, 100); return; } -- 2.7.4