X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-layout.js;h=ef1df916ff2154a17ac553c67b2dc19b935cf318;hb=d0da31d021ee7a89b378182a60bf28f0873fc87b;hp=befffd6e39701dab17d9c36d620d9d882f25d537;hpb=bacf5ce283d6871ce1c090f29bf5411341622248;p=dygraphs.git diff --git a/dygraph-layout.js b/dygraph-layout.js index befffd6..ef1df91 100644 --- a/dygraph-layout.js +++ b/dygraph-layout.js @@ -9,7 +9,8 @@ * dygraphs. */ -/*jshint globalstrict: true */ +var DygraphLayout = (function() { + /*global Dygraph:false */ "use strict"; @@ -149,13 +150,13 @@ DygraphLayout.prototype.setAnnotations = function(ann) { for (var i = 0; i < ann.length; i++) { var a = {}; if (!ann[i].xval && ann[i].x === undefined) { - Dygraph.error("Annotations must have an 'x' property"); + console.error("Annotations must have an 'x' property"); return; } if (ann[i].icon && !(ann[i].hasOwnProperty('width') && ann[i].hasOwnProperty('height'))) { - Dygraph.error("Must set width and height when setting " + + console.error("Must set width and height when setting " + "annotation.icon property"); return; } @@ -204,7 +205,7 @@ DygraphLayout.prototype._evaluateLimits = function() { axis.ylogrange = Dygraph.log10(axis.maxyval) - Dygraph.log10(axis.minyval); axis.ylogscale = (axis.ylogrange !== 0 ? 1.0 / axis.ylogrange : 1.0); if (!isFinite(axis.ylogrange) || isNaN(axis.ylogrange)) { - Dygraph.error('axis ' + i + ' of graph at ' + axis.g + + console.error('axis ' + i + ' of graph at ' + axis.g + ' can\'t be displayed in log scale for range [' + axis.minyval + ' - ' + axis.maxyval + ']'); } @@ -344,3 +345,7 @@ DygraphLayout.prototype.removeAllDatasets = function() { this.setPointsLengths = []; this.setPointsOffsets = []; }; + +return DygraphLayout; + +})();