diff --git a/Gruntfile.js b/Gruntfile.js index a18a6f6..0654d4f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -55,7 +55,7 @@ module.exports = function(grunt) { "requireMultipleVarDecl": true, "requireSpacesInsideObjectBrackets": "all", // Different from jQuery preset "disallowSpacesInsideArrayBrackets": true, // Different from jQuery preset - "disallowLeftStickedOperators": [ "?", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ], + "disallowLeftStickedOperators": [ "?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ], "disallowRightStickedOperators": [ "?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-"], diff --git a/jquery.flot.errorbars.js b/jquery.flot.errorbars.js index a4d0032..f6eef97 100644 --- a/jquery.flot.errorbars.js +++ b/jquery.flot.errorbars.js @@ -278,13 +278,13 @@ shadowSize and lineWidth are derived as well from the points series. var w = sw / 2; ctx.lineWidth = w; ctx.strokeStyle = "rgba(0,0,0,0.1)"; - drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w/2, minmax); + drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w + w / 2, minmax); ctx.strokeStyle = "rgba(0,0,0,0.2)"; - drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w/2, minmax); + drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, w / 2, minmax); } - ctx.strokeStyle = err[e].color? err[e].color: s.color; + ctx.strokeStyle = err[e].color ? err[e].color : s.color; ctx.lineWidth = lw; //draw it drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax); @@ -327,7 +327,7 @@ shadowSize and lineWidth are derived as well from the points series. //internal radius value in errorbar, allows to plot radius 0 points and still keep proper sized caps //this is a way to get errorbars on lines without visible connecting dots - radius = err.radius != null? err.radius: radius; + radius = err.radius != null ? err.radius : radius; // upper cap if (drawUpper) { diff --git a/jquery.flot.image.js b/jquery.flot.image.js index 185be84..3f46deb 100644 --- a/jquery.flot.image.js +++ b/jquery.flot.image.js @@ -158,10 +158,10 @@ Google Maps). // if the anchor is at the center of the pixel, expand the // image by 1/2 pixel in each direction if (series.images.anchor === "center") { - tmp = 0.5 * (x2-x1) / (img.width - 1); + tmp = 0.5 * (x2 - x1) / (img.width - 1); x1 -= tmp; x2 += tmp; - tmp = 0.5 * (y2-y1) / (img.height - 1); + tmp = 0.5 * (y2 - y1) / (img.height - 1); y1 -= tmp; y2 += tmp; } diff --git a/jquery.flot.js b/jquery.flot.js index d8f9a0b..09b8061 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -710,7 +710,7 @@ Licensed under the MIT license. mouseActiveRadius: 10 // how far the mouse can be away to activate an item }, interaction: { - redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow + redrawOverlayInterval: 1000 / 60 // time between updates, -1 means in same flow }, hooks: {} }, @@ -1337,7 +1337,7 @@ Licensed under the MIT license. ps = s.datapoints.pointsize; points = s.datapoints.points; - + s.xaxis.used = s.yaxis.used = true; for (j = k = 0; j < data.length; ++j, k += ps) { @@ -2187,7 +2187,7 @@ Licensed under the MIT license. // process markings var markingsUnderGrid = []; var markingsAboveGrid = []; - + var markings = options.grid.markings; if (markings) { if ($.isFunction(markings)) { @@ -2204,7 +2204,7 @@ Licensed under the MIT license. for (i = 0; i < markings.length; ++i) { var m = markings[i]; - + if (m.aboveGrid) { markingsAboveGrid.push(m); } else { @@ -2212,7 +2212,7 @@ Licensed under the MIT license. } } } - + drawMarkings(markingsUnderGrid, markingLayer); // draw the ticks @@ -2365,7 +2365,7 @@ Licensed under the MIT license. ctx.lineWidth = bw.left; ctx.beginPath(); ctx.moveTo(0 - bw.left / 2, plotHeight + bw.bottom); - ctx.lineTo(0- bw.left / 2, 0); + ctx.lineTo(0 - bw.left / 2, 0); ctx.stroke(); } } else { @@ -2377,7 +2377,7 @@ Licensed under the MIT license. ctx.restore(); } - + function drawMarkings(markings, markingLayer) { if (!markings) { return; @@ -2387,7 +2387,7 @@ Licensed under the MIT license. drawMarking(markings[i], markingLayer); } } - + function drawMarking(m, markingLayer) { var xrange = extractRange(m, "x"), yrange = extractRange(m, "y"); @@ -3589,9 +3589,9 @@ Licensed under the MIT license. // Draw a rectangle with rounded corner on the canvas. // // @param {CanvasRenderingContext2D} ctx The canvas 2D context. - // @param {number} x The x-axis coordinate of the upper left corner of + // @param {number} x The x-axis coordinate of the upper left corner of // the rectangle to be drawn. - // @param {number} y The y-axis coordinate of the upper left corner of + // @param {number} y The y-axis coordinate of the upper left corner of // the rectangle to be drawn. // @param {number} width The width of the rectangle to be drawn. // @param {number} height The height of the rectangle to be drawn. diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index a46c365..27ba038 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -101,7 +101,7 @@ More detail and specific examples can be found in the included HTML file. if (options.series.pie.radius === "auto") { if (options.series.pie.label.show) { - options.series.pie.radius = 3/4; + options.series.pie.radius = 3 / 4; } else { options.series.pie.radius = 1; } @@ -567,7 +567,7 @@ More detail and specific examples can be found in the included HTML file. function isPointInPoly(poly, pt) { for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) { ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || - (poly[j][1] <= pt[1] && pt[1]< poly[i][1])) && + (poly[j][1] <= pt[1] && pt[1] < poly[i][1])) && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) && (c = !c); } @@ -774,7 +774,7 @@ More detail and specific examples can be found in the included HTML file. show: false, radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value) innerRadius: 0, /* for donut */ - startAngle: 3/2, + startAngle: 3 / 2, tilt: 1, shadow: { left: 5, // shadow left offset diff --git a/jquery.flot.symbol.js b/jquery.flot.symbol.js index 1e5b878..19d84cc 100644 --- a/jquery.flot.symbol.js +++ b/jquery.flot.symbol.js @@ -37,11 +37,11 @@ The symbols are accessed as strings through the standard symbol options: // pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3)) var size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3)); var height = size * Math.sin(Math.PI / 3); - ctx.moveTo(x - size/2, y + height/2); - ctx.lineTo(x + size/2, y + height/2); + ctx.moveTo(x - size / 2, y + height / 2); + ctx.lineTo(x + size / 2, y + height / 2); if (!shadow) { - ctx.lineTo(x, y - height/2); - ctx.lineTo(x - size/2, y + height/2); + ctx.lineTo(x, y - height / 2); + ctx.lineTo(x - size / 2, y + height / 2); } }, cross: function(ctx, x, y, radius) { diff --git a/jquery.flot.threshold.js b/jquery.flot.threshold.js index e270c34..30b00f6 100644 --- a/jquery.flot.threshold.js +++ b/jquery.flot.threshold.js @@ -135,7 +135,7 @@ You may need to check for this in hover events. } plot.hooks.processDatapoints.push(processThresholds); - + function processThresholdsLegend(ctx, canvas, s) { if (!s.threshold) { @@ -148,8 +148,8 @@ You may need to check for this in hover events. if($(this).text() === s.label) { var legend = $(this).prev().find("div > div"); - legend.css("border-right-color" , color); - legend.css("border-bottom-color" , color); + legend.css("border-right-color", color); + legend.css("border-bottom-color", color); } }); }