Commit 339aab91 authored by Nick Schonning's avatar Nick Schonning

JSCS: Don't stick operators to values

Fix jQuery preset as per https://github.com/mdevils/node-jscs/issues/117
parent fcc7c16b
......@@ -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": ["++", "--", "+", "-"],
......
......@@ -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) {
......
......@@ -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;
}
......
......@@ -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: {}
},
......@@ -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 {
......
......@@ -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
......
......@@ -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) {
......
......@@ -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);
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment