Commit 1513877c authored by David Schnur's avatar David Schnur

Merge pull request #1229 from nschonni/add-grunt-jscs-checker

Add grunt jscs checker
parents 2d2efc54 f335b499
...@@ -41,6 +41,45 @@ module.exports = function(grunt) { ...@@ -41,6 +41,45 @@ module.exports = function(grunt) {
files: "<%= jshint.flot.src %>", files: "<%= jshint.flot.src %>",
tasks: ["jshint:flot"] tasks: ["jshint:flot"]
} }
},
jscs: {
options: {
"requireCurlyBraces": [ "if", "else", "for", "while", "do" ],
"requireSpaceAfterKeywords": [ "if", "else", "for", "while", "do", "switch", "return" ],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireMultipleVarDecl": true,
"requireSpacesInsideObjectBrackets": "all", // Different from jQuery preset
"disallowSpacesInsideArrayBrackets": true, // Different from jQuery preset
"disallowLeftStickedOperators": [ "?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ],
"disallowRightStickedOperators": [ "?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireRightStickedOperators": [ "!" ],
"requireLeftStickedOperators": [ "," ],
"disallowKeywords": [ "with" ],
"disallowMultipleLineBreaks": true,
"disallowKeywordsOnNewLine": [ "else" ],
"requireLineFeedAtFileEnd": true,
"disallowSpaceAfterObjectKeys": true,
"validateJSDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true
},
"validateQuoteMarks": "\"",
reporter: "checkstyle",
reporterOutput: "jscs.xml"
},
flot: {
src: "<%= jshint.flot.src %>"
}
} }
}); });
...@@ -48,6 +87,7 @@ module.exports = function(grunt) { ...@@ -48,6 +87,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-jshint"); grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-watch"); grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-jscs-checker");
// Default task. // Default task.
grunt.registerTask("default", ["jshint", "uglify"]); grunt.registerTask("default", ["jshint", "uglify"]);
......
...@@ -31,9 +31,8 @@ browser, but needs to redraw with canvas text when exporting as an image. ...@@ -31,9 +31,8 @@ browser, but needs to redraw with canvas text when exporting as an image.
var options = { var options = {
canvas: true canvas: true
}; },
render, getTextInfo, addText;
var render, getTextInfo, addText;
function init(plot, classes) { function init(plot, classes) {
......
...@@ -43,7 +43,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. ...@@ -43,7 +43,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
*/ */
(function ($) { (function($) {
var options = { var options = {
xaxis: { xaxis: {
categories: null categories: null
...@@ -121,7 +121,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. ...@@ -121,7 +121,7 @@ as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
} }
} }
res.sort(function (a, b) { return a[0] - b[0]; }); res.sort(function(a, b) { return a[0] - b[0]; });
return res; return res;
} }
......
...@@ -40,7 +40,7 @@ The plugin also adds four public methods: ...@@ -40,7 +40,7 @@ The plugin also adds four public methods:
Example usage: Example usage:
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } }; var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
$("#graph").bind( "plothover", function ( evt, position, item ) { $("#graph").bind( "plothover", function( evt, position, item ) {
if ( item ) { if ( item ) {
// Lock the crosshair to the data point being hovered // Lock the crosshair to the data point being hovered
myFlot.lockCrosshair({ myFlot.lockCrosshair({
...@@ -58,7 +58,7 @@ The plugin also adds four public methods: ...@@ -58,7 +58,7 @@ The plugin also adds four public methods:
Free the crosshair to move again after locking it. Free the crosshair to move again after locking it.
*/ */
(function ($) { (function($) {
var options = { var options = {
crosshair: { crosshair: {
...@@ -124,7 +124,7 @@ The plugin also adds four public methods: ...@@ -124,7 +124,7 @@ The plugin also adds four public methods:
plot.triggerRedrawOverlay(); plot.triggerRedrawOverlay();
} }
plot.hooks.bindEvents.push(function (plot, eventHolder) { plot.hooks.bindEvents.push(function(plot, eventHolder) {
if (!plot.getOptions().crosshair.mode) { if (!plot.getOptions().crosshair.mode) {
return; return;
} }
...@@ -133,7 +133,7 @@ The plugin also adds four public methods: ...@@ -133,7 +133,7 @@ The plugin also adds four public methods:
eventHolder.mousemove(onMouseMove); eventHolder.mousemove(onMouseMove);
}); });
plot.hooks.drawOverlay.push(function (plot, ctx) { plot.hooks.drawOverlay.push(function(plot, ctx) {
var c = plot.getOptions().crosshair; var c = plot.getOptions().crosshair;
if (!c.mode) { if (!c.mode) {
return; return;
...@@ -167,7 +167,7 @@ The plugin also adds four public methods: ...@@ -167,7 +167,7 @@ The plugin also adds four public methods:
ctx.restore(); ctx.restore();
}); });
plot.hooks.shutdown.push(function (plot, eventHolder) { plot.hooks.shutdown.push(function(plot, eventHolder) {
eventHolder.unbind("mouseout", onMouseOut); eventHolder.unbind("mouseout", onMouseOut);
eventHolder.unbind("mousemove", onMouseMove); eventHolder.unbind("mousemove", onMouseMove);
}); });
......
...@@ -62,18 +62,18 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -62,18 +62,18 @@ shadowSize and lineWidth are derived as well from the points series.
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { series: {
points: { points: {
errorbars: null, //should be 'x', 'y' or 'xy' errorbars: null, //should be 'x', 'y' or 'xy'
xerr: { err: "x", show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null}, xerr: { err: "x", show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null },
yerr: { err: "y", show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null} yerr: { err: "y", show: null, asymmetric: null, upperCap: null, lowerCap: null, color: null, radius: null }
} }
} }
}; };
function processRawData(plot, series, data, datapoints){ function processRawData(plot, series, data, datapoints) {
if (!series.points.errorbars) { if (!series.points.errorbars) {
return; return;
} }
...@@ -82,9 +82,8 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -82,9 +82,8 @@ shadowSize and lineWidth are derived as well from the points series.
var format = [ var format = [
{ x: true, number: true, required: true }, { x: true, number: true, required: true },
{ y: true, number: true, required: true } { y: true, number: true, required: true }
]; ],
errors = series.points.errorbars;
var errors = series.points.errorbars;
// error bars - first X then Y // error bars - first X then Y
if (errors === "x" || errors === "xy") { if (errors === "x" || errors === "xy") {
// lower / upper error // lower / upper error
...@@ -95,6 +94,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -95,6 +94,7 @@ shadowSize and lineWidth are derived as well from the points series.
format.push({ x: true, number: true, required: true }); format.push({ x: true, number: true, required: true });
} }
} }
if (errors === "y" || errors === "xy") { if (errors === "y" || errors === "xy") {
// lower / upper error // lower / upper error
if (series.points.yerr.asymmetric) { if (series.points.yerr.asymmetric) {
...@@ -107,12 +107,12 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -107,12 +107,12 @@ shadowSize and lineWidth are derived as well from the points series.
datapoints.format = format; datapoints.format = format;
} }
function parseErrors(series, i){ function parseErrors(series, i) {
var points = series.datapoints.points; var points = series.datapoints.points,
// read errors from points array // read errors from points array
var exl = null, exl = null,
exu = null, exu = null,
eyl = null, eyl = null,
eyu = null, eyu = null,
...@@ -175,7 +175,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -175,7 +175,7 @@ shadowSize and lineWidth are derived as well from the points series.
return errRanges; return errRanges;
} }
function drawSeriesErrors(plot, ctx, s){ function drawSeriesErrors(plot, ctx, s) {
var points = s.datapoints.points, var points = s.datapoints.points,
ps = s.datapoints.pointsize, ps = s.datapoints.pointsize,
...@@ -184,7 +184,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -184,7 +184,7 @@ shadowSize and lineWidth are derived as well from the points series.
err = [s.points.xerr, s.points.yerr], err = [s.points.xerr, s.points.yerr],
invertX = false, invertX = false,
invertY = false, invertY = false,
tmp; tmp, errRanges, minmax, e, x, y, upper, lower, drawLower, drawUpper;
//sanity check, in case some inverted axis hack is applied to flot //sanity check, in case some inverted axis hack is applied to flot
...@@ -204,22 +204,22 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -204,22 +204,22 @@ shadowSize and lineWidth are derived as well from the points series.
for (var i = 0; i < s.datapoints.points.length; i += ps) { for (var i = 0; i < s.datapoints.points.length; i += ps) {
var errRanges = parseErrors(s, i); errRanges = parseErrors(s, i);
//cycle xerr & yerr //cycle xerr & yerr
for (var e = 0; e < err.length; e++){ for (e = 0; e < err.length; e++){
var minmax = [ax[e].min, ax[e].max]; minmax = [ax[e].min, ax[e].max];
//draw this error? //draw this error?
if (errRanges[e * err.length]){ if (errRanges[e * err.length]){
//data coordinates //data coordinates
var x = points[i], x = points[i];
y = points[i + 1]; y = points[i + 1];
//errorbar ranges //errorbar ranges
var upper = [x, y][e] + errRanges[e * err.length + 1], upper = [x, y][e] + errRanges[e * err.length + 1];
lower = [x, y][e] - errRanges[e * err.length]; lower = [x, y][e] - errRanges[e * err.length];
//points outside of the canvas //points outside of the canvas
...@@ -235,7 +235,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -235,7 +235,7 @@ shadowSize and lineWidth are derived as well from the points series.
} }
// prevent errorbars getting out of the canvas // prevent errorbars getting out of the canvas
var drawUpper = true, drawUpper = true,
drawLower = true; drawLower = true;
if (upper > minmax[1]) { if (upper > minmax[1]) {
...@@ -278,13 +278,13 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -278,13 +278,13 @@ shadowSize and lineWidth are derived as well from the points series.
var w = sw / 2; var w = sw / 2;
ctx.lineWidth = w; ctx.lineWidth = w;
ctx.strokeStyle = "rgba(0,0,0,0.1)"; 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)"; 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; ctx.lineWidth = lw;
//draw it //draw it
drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax); drawError(ctx, err[e], x, y, upper, lower, drawUpper, drawLower, radius, 0, minmax);
...@@ -293,7 +293,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -293,7 +293,7 @@ shadowSize and lineWidth are derived as well from the points series.
} }
} }
function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax){ function drawError(ctx,err,x,y,upper,lower,drawUpper,drawLower,radius,offset,minmax) {
//shadow offset //shadow offset
y += offset; y += offset;
...@@ -327,7 +327,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -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 //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 //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 // upper cap
if (drawUpper) { if (drawUpper) {
...@@ -363,7 +363,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -363,7 +363,7 @@ shadowSize and lineWidth are derived as well from the points series.
} }
} }
function drawPath(ctx, pts){ function drawPath(ctx, pts) {
ctx.beginPath(); ctx.beginPath();
ctx.moveTo(pts[0][0], pts[0][1]); ctx.moveTo(pts[0][0], pts[0][1]);
for (var p = 1; p < pts.length; p++) { for (var p = 1; p < pts.length; p++) {
...@@ -372,12 +372,12 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -372,12 +372,12 @@ shadowSize and lineWidth are derived as well from the points series.
ctx.stroke(); ctx.stroke();
} }
function draw(plot, ctx){ function draw(plot, ctx) {
var plotOffset = plot.getPlotOffset(); var plotOffset = plot.getPlotOffset();
ctx.save(); ctx.save();
ctx.translate(plotOffset.left, plotOffset.top); ctx.translate(plotOffset.left, plotOffset.top);
$.each(plot.getData(), function (i, s) { $.each(plot.getData(), function(i, s) {
if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show)) { if (s.points.errorbars && (s.points.xerr.show || s.points.yerr.show)) {
drawSeriesErrors(plot, ctx, s); drawSeriesErrors(plot, ctx, s);
} }
......
...@@ -29,7 +29,7 @@ jquery.flot.stack.js plugin, possibly some code could be shared. ...@@ -29,7 +29,7 @@ jquery.flot.stack.js plugin, possibly some code could be shared.
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { series: {
......
...@@ -52,7 +52,7 @@ Google Maps). ...@@ -52,7 +52,7 @@ Google Maps).
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { series: {
images: { images: {
...@@ -65,12 +65,12 @@ Google Maps). ...@@ -65,12 +65,12 @@ Google Maps).
$.plot.image = {}; $.plot.image = {};
$.plot.image.loadDataImages = function (series, options, callback) { $.plot.image.loadDataImages = function(series, options, callback) {
var urls = [], points = []; var urls = [],
points = [],
defaultShow = options.series.images.show;
var defaultShow = options.series.images.show; $.each(series, function(i, s) {
$.each(series, function (i, s) {
if (!(defaultShow || s.images.show)) { if (!(defaultShow || s.images.show)) {
return; return;
} }
...@@ -79,7 +79,7 @@ Google Maps). ...@@ -79,7 +79,7 @@ Google Maps).
s = s.data; s = s.data;
} }
$.each(s, function (i, p) { $.each(s, function(i, p) {
if (typeof p[0] === "string") { if (typeof p[0] === "string") {
urls.push(p[0]); urls.push(p[0]);
points.push(p); points.push(p);
...@@ -87,8 +87,8 @@ Google Maps). ...@@ -87,8 +87,8 @@ Google Maps).
}); });
}); });
$.plot.image.load(urls, function (loadedImages) { $.plot.image.load(urls, function(loadedImages) {
$.each(points, function (i, p) { $.each(points, function(i, p) {
var url = p[0]; var url = p[0];
if (loadedImages[url]) { if (loadedImages[url]) {
p[0] = loadedImages[url]; p[0] = loadedImages[url];
...@@ -99,14 +99,14 @@ Google Maps). ...@@ -99,14 +99,14 @@ Google Maps).
}); });
}; };
$.plot.image.load = function (urls, callback) { $.plot.image.load = function(urls, callback) {
var missing = urls.length, loaded = {}; var missing = urls.length, loaded = {};
if (missing === 0) { if (missing === 0) {
callback({}); callback({});
} }
$.each(urls, function (i, url) { $.each(urls, function(i, url) {
var handler = function () { var handler = function() {
--missing; --missing;
loaded[url] = this; loaded[url] = this;
...@@ -158,10 +158,10 @@ Google Maps). ...@@ -158,10 +158,10 @@ Google Maps).
// if the anchor is at the center of the pixel, expand the // if the anchor is at the center of the pixel, expand the
// image by 1/2 pixel in each direction // image by 1/2 pixel in each direction
if (series.images.anchor === "center") { if (series.images.anchor === "center") {
tmp = 0.5 * (x2-x1) / (img.width - 1); tmp = 0.5 * (x2 - x1) / (img.width - 1);
x1 -= tmp; x1 -= tmp;
x2 += tmp; x2 += tmp;
tmp = 0.5 * (y2-y1) / (img.height - 1); tmp = 0.5 * (y2 - y1) / (img.height - 1);
y1 -= tmp; y1 -= tmp;
y2 += tmp; y2 += tmp;
} }
......
This diff is collapsed.
...@@ -79,7 +79,7 @@ can set the default in the options. ...@@ -79,7 +79,7 @@ can set the default in the options.
*/ */
(function ($) { (function($) {
var options = { var options = {
xaxis: { xaxis: {
zoomRange: null, // or [number, number] (min range, max range) zoomRange: null, // or [number, number] (min range, max range)
...@@ -137,7 +137,7 @@ can set the default in the options. ...@@ -137,7 +137,7 @@ can set the default in the options.
return; return;
} }
panTimeout = setTimeout(function () { panTimeout = setTimeout(function() {
plot.pan({ left: prevPageX - e.pageX, plot.pan({ left: prevPageX - e.pageX,
top: prevPageY - e.pageY }); top: prevPageY - e.pageY });
prevPageX = e.pageX; prevPageX = e.pageX;
...@@ -172,7 +172,7 @@ can set the default in the options. ...@@ -172,7 +172,7 @@ can set the default in the options.
} }
} }
plot.zoomOut = function (args) { plot.zoomOut = function(args) {
if (!args) { if (!args) {
args = {}; args = {};
} }
...@@ -185,7 +185,7 @@ can set the default in the options. ...@@ -185,7 +185,7 @@ can set the default in the options.
plot.zoom(args); plot.zoom(args);
}; };
plot.zoom = function (args) { plot.zoom = function(args) {
if (!args) { if (!args) {
args = {}; args = {};
} }
...@@ -256,11 +256,11 @@ can set the default in the options. ...@@ -256,11 +256,11 @@ can set the default in the options.
plot.draw(); plot.draw();
if (!args.preventEvent) { if (!args.preventEvent) {
plot.getPlaceholder().trigger("plotzoom", [ plot, args ]); plot.getPlaceholder().trigger("plotzoom", [plot, args]);
} }
}; };
plot.pan = function (args) { plot.pan = function(args) {
var delta = { var delta = {
x: +args.left, x: +args.left,
y: +args.top y: +args.top
...@@ -273,7 +273,7 @@ can set the default in the options. ...@@ -273,7 +273,7 @@ can set the default in the options.
delta.y = 0; delta.y = 0;
} }
$.each(plot.getAxes(), function (_, axis) { $.each(plot.getAxes(), function(_, axis) {
var opts = axis.options, var opts = axis.options,
min = axis.c2p(axis.p2c(axis.min) + d), min = axis.c2p(axis.p2c(axis.min) + d),
...@@ -308,7 +308,7 @@ can set the default in the options. ...@@ -308,7 +308,7 @@ can set the default in the options.
plot.draw(); plot.draw();
if (!args.preventEvent) { if (!args.preventEvent) {
plot.getPlaceholder().trigger("plotpan", [ plot, args ]); plot.getPlaceholder().trigger("plotpan", [plot, args]);
} }
}; };
......
...@@ -59,11 +59,11 @@ More detail and specific examples can be found in the included HTML file. ...@@ -59,11 +59,11 @@ More detail and specific examples can be found in the included HTML file.
// Maximum redraw attempts when fitting labels within the plot // Maximum redraw attempts when fitting labels within the plot
var REDRAW_ATTEMPTS = 10; var REDRAW_ATTEMPTS = 10,
// Factor by which to shrink the pie when fitting labels within the plot // Factor by which to shrink the pie when fitting labels within the plot
var REDRAW_SHRINK = 0.95; REDRAW_SHRINK = 0.95;
function init(plot) { function init(plot) {
...@@ -74,11 +74,11 @@ More detail and specific examples can be found in the included HTML file. ...@@ -74,11 +74,11 @@ More detail and specific examples can be found in the included HTML file.
centerLeft = null, centerLeft = null,
centerTop = null, centerTop = null,
processed = false, processed = false,
ctx = null; ctx = null,
// interactive variables // interactive variables
var highlights = []; highlights = [];
// add hook to determine if pie plugin in enabled, and then perform necessary operations // add hook to determine if pie plugin in enabled, and then perform necessary operations
...@@ -101,7 +101,7 @@ More detail and specific examples can be found in the included HTML file. ...@@ -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.radius === "auto") {
if (options.series.pie.label.show) { if (options.series.pie.label.show) {
options.series.pie.radius = 3/4; options.series.pie.radius = 3 / 4;
} else { } else {
options.series.pie.radius = 1; options.series.pie.radius = 1;
} }
...@@ -340,11 +340,11 @@ More detail and specific examples can be found in the included HTML file. ...@@ -340,11 +340,11 @@ More detail and specific examples can be found in the included HTML file.
function drawShadow() { function drawShadow() {
var shadowLeft = options.series.pie.shadow.left; var shadowLeft = options.series.pie.shadow.left,
var shadowTop = options.series.pie.shadow.top; shadowTop = options.series.pie.shadow.top,
var edge = 10; edge = 10,
var alpha = options.series.pie.shadow.alpha; alpha = options.series.pie.shadow.alpha,
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) { if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
return; // shadow would be outside canvas, so don't draw it return; // shadow would be outside canvas, so don't draw it
...@@ -455,8 +455,8 @@ More detail and specific examples can be found in the included HTML file. ...@@ -455,8 +455,8 @@ More detail and specific examples can be found in the included HTML file.
function drawLabels() { function drawLabels() {
var currentAngle = startAngle; var currentAngle = startAngle,
var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius; radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
for (var i = 0; i < slices.length; ++i) { for (var i = 0; i < slices.length; ++i) {
if (slices[i].percent >= options.series.pie.label.threshold * 100) { if (slices[i].percent >= options.series.pie.label.threshold * 100) {
...@@ -489,16 +489,16 @@ More detail and specific examples can be found in the included HTML file. ...@@ -489,16 +489,16 @@ More detail and specific examples can be found in the included HTML file.
text = plf(text, slice); text = plf(text, slice);
} }
var halfAngle = ((startAngle + slice.angle) + startAngle) / 2; var halfAngle = ((startAngle + slice.angle) + startAngle) / 2,
var x = centerLeft + Math.round(Math.cos(halfAngle) * radius); x = centerLeft + Math.round(Math.cos(halfAngle) * radius),
var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt; y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt,
html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
target.append(html); target.append(html);
var label = target.children("#pieLabel" + index); var label = target.children("#pieLabel" + index),
var labelTop = (y - label.height() / 2); labelTop = (y - label.height() / 2),
var labelLeft = (x - label.width() / 2); labelLeft = (x - label.width() / 2);
label.css("top", labelTop); label.css("top", labelTop);
label.css("left", labelLeft); label.css("left", labelLeft);
...@@ -565,9 +565,9 @@ More detail and specific examples can be found in the included HTML file. ...@@ -565,9 +565,9 @@ More detail and specific examples can be found in the included HTML file.
//-- Additional Interactive related functions -- //-- Additional Interactive related functions --
function isPointInPoly(poly, pt) { function isPointInPoly(poly, pt) {
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) { 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[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]) && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) &&
(c = !c); (c = !c);
} }
...@@ -656,10 +656,10 @@ More detail and specific examples can be found in the included HTML file. ...@@ -656,10 +656,10 @@ More detail and specific examples can be found in the included HTML file.
function triggerClickHoverEvent(eventname, e) { function triggerClickHoverEvent(eventname, e) {
var offset = plot.offset(); var offset = plot.offset(),
var canvasX = parseInt(e.pageX - offset.left, 10); canvasX = parseInt(e.pageX - offset.left, 10),
var canvasY = parseInt(e.pageY - offset.top, 10); canvasY = parseInt(e.pageY - offset.top, 10),
var item = findNearbySlice(canvasX, canvasY); item = findNearbySlice(canvasX, canvasY);
if (options.grid.autoHighlight) { if (options.grid.autoHighlight) {
...@@ -730,9 +730,8 @@ More detail and specific examples can be found in the included HTML file. ...@@ -730,9 +730,8 @@ More detail and specific examples can be found in the included HTML file.
function drawOverlay(plot, octx) { function drawOverlay(plot, octx) {
var options = plot.getOptions(); var options = plot.getOptions(),
radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
octx.save(); octx.save();
octx.translate(centerLeft, centerTop); octx.translate(centerLeft, centerTop);
...@@ -774,7 +773,7 @@ More detail and specific examples can be found in the included HTML file. ...@@ -774,7 +773,7 @@ More detail and specific examples can be found in the included HTML file.
show: false, show: false,
radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value) radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
innerRadius: 0, /* for donut */ innerRadius: 0, /* for donut */
startAngle: 3/2, startAngle: 3 / 2,
tilt: 1, tilt: 1,
shadow: { shadow: {
left: 5, // shadow left offset left: 5, // shadow left offset
......
...@@ -11,7 +11,7 @@ can just fix the size of their placeholders. ...@@ -11,7 +11,7 @@ can just fix the size of their placeholders.
*/ */
(function ($) { (function($) {
var options = { }; // no options var options = { }; // no options
function init(plot) { function init(plot) {
......
...@@ -78,16 +78,16 @@ The plugin allso adds the following methods to the plot object: ...@@ -78,16 +78,16 @@ The plugin allso adds the following methods to the plot object:
*/ */
(function ($) { (function($) {
function init(plot) { function init(plot) {
var selection = { var selection = {
first: { x: -1, y: -1}, first: { x: -1, y: -1 },
second: { x: -1, y: -1}, second: { x: -1, y: -1 },
show: false, show: false,
active: false, active: false,
touch: false touch: false
}; },
// FIXME: The drag handling implemented here should be // FIXME: The drag handling implemented here should be
// abstracted out, there's some similar code from a library in // abstracted out, there's some similar code from a library in
...@@ -95,13 +95,13 @@ The plugin allso adds the following methods to the plot object: ...@@ -95,13 +95,13 @@ The plugin allso adds the following methods to the plot object:
// the Flot cases here better and reused. Doing this would // the Flot cases here better and reused. Doing this would
// make this plugin much slimmer. // make this plugin much slimmer.
var savedhandlers = {}, savedhandlers = {},
mouseUpHandler = null; mouseUpHandler = null;
function onMouseMove(e) { function onMouseMove(e) {
if (selection.active) { if (selection.active) {
updateSelection(e); updateSelection(e);
plot.getPlaceholder().trigger("plotselecting", [ getSelection() ]); plot.getPlaceholder().trigger("plotselecting", [getSelection()]);
// prevent the default action if it is a 'touch' action // prevent the default action if it is a 'touch' action
if (selection.touch === true) { if (selection.touch === true) {
...@@ -117,18 +117,17 @@ The plugin allso adds the following methods to the plot object: ...@@ -117,18 +117,17 @@ The plugin allso adds the following methods to the plot object:
return; return;
} }
// cancel out any text selections // cancel out any text selections
document.body.focus(); document.body.focus();
// prevent text selection and drag in old-school browsers // prevent text selection and drag in old-school browsers
if (document.onselectstart !== undefined && savedhandlers.onselectstart === null) { if (document.onselectstart !== undefined && savedhandlers.onselectstart === null) {
savedhandlers.onselectstart = document.onselectstart; savedhandlers.onselectstart = document.onselectstart;
document.onselectstart = function () { return false; }; document.onselectstart = function() { return false; };
} }
if (document.ondrag !== undefined && savedhandlers.ondrag === null) { if (document.ondrag !== undefined && savedhandlers.ondrag === null) {
savedhandlers.ondrag = document.ondrag; savedhandlers.ondrag = document.ondrag;
document.ondrag = function () { return false; }; document.ondrag = function() { return false; };
} }
setSelectionPos(selection.first, e); setSelectionPos(selection.first, e);
...@@ -137,7 +136,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -137,7 +136,7 @@ The plugin allso adds the following methods to the plot object:
// this is a bit silly, but we have to use a closure to be // this is a bit silly, but we have to use a closure to be
// able to whack the same handler again // able to whack the same handler again
mouseUpHandler = function (e) { onMouseUp(e); }; mouseUpHandler = function(e) { onMouseUp(e); };
$(document).one(selection.touch ? "touchend" : "mouseup", mouseUpHandler); $(document).one(selection.touch ? "touchend" : "mouseup", mouseUpHandler);
} }
...@@ -161,8 +160,8 @@ The plugin allso adds the following methods to the plot object: ...@@ -161,8 +160,8 @@ The plugin allso adds the following methods to the plot object:
triggerSelectedEvent(); triggerSelectedEvent();
} else { } else {
// this counts as a clear // this counts as a clear
plot.getPlaceholder().trigger("plotunselected", [ ]); plot.getPlaceholder().trigger("plotunselected", []);
plot.getPlaceholder().trigger("plotselecting", [ null ]); plot.getPlaceholder().trigger("plotselecting", [null]);
} }
selection.touch = false; selection.touch = false;
...@@ -179,7 +178,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -179,7 +178,7 @@ The plugin allso adds the following methods to the plot object:
c1 = selection.first, c1 = selection.first,
c2 = selection.second; c2 = selection.second;
$.each(plot.getAxes(), function (name, axis) { $.each(plot.getAxes(), function(name, axis) {
if (axis.used) { if (axis.used) {
var p1 = axis.c2p(c1[axis.direction]), var p1 = axis.c2p(c1[axis.direction]),
p2 = axis.c2p(c2[axis.direction]); p2 = axis.c2p(c2[axis.direction]);
...@@ -192,11 +191,11 @@ The plugin allso adds the following methods to the plot object: ...@@ -192,11 +191,11 @@ The plugin allso adds the following methods to the plot object:
function triggerSelectedEvent() { function triggerSelectedEvent() {
var r = getSelection(); var r = getSelection();
plot.getPlaceholder().trigger("plotselected", [ r ]); plot.getPlaceholder().trigger("plotselected", [r]);
// backwards-compat stuff, to be removed in future // backwards-compat stuff, to be removed in future
if (r.xaxis && r.yaxis) { if (r.xaxis && r.yaxis) {
plot.getPlaceholder().trigger("selected", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]); plot.getPlaceholder().trigger("selected", [{ x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to }]);
} }
} }
...@@ -207,9 +206,9 @@ The plugin allso adds the following methods to the plot object: ...@@ -207,9 +206,9 @@ The plugin allso adds the following methods to the plot object:
function setSelectionPos(pos, e) { function setSelectionPos(pos, e) {
var o = plot.getOptions(), var o = plot.getOptions(),
offset = plot.getPlaceholder().offset(), offset = plot.getPlaceholder().offset(),
plotOffset = plot.getPlotOffset(); plotOffset = plot.getPlotOffset(),
coordHolder = selection.touch ? e.originalEvent.changedTouches[0] : e;
var coordHolder = selection.touch ? e.originalEvent.changedTouches[0] : e;
pos.x = clamp(0, coordHolder.pageX - offset.left - plotOffset.left, plot.width()); pos.x = clamp(0, coordHolder.pageX - offset.left - plotOffset.left, plot.width());
pos.y = clamp(0, coordHolder.pageY - offset.top - plotOffset.top, plot.height()); pos.y = clamp(0, coordHolder.pageY - offset.top - plotOffset.top, plot.height());
...@@ -338,26 +337,26 @@ The plugin allso adds the following methods to the plot object: ...@@ -338,26 +337,26 @@ The plugin allso adds the following methods to the plot object:
} }
}); });
plot.hooks.drawOverlay.push(function(plot, ctx) {
plot.hooks.drawOverlay.push(function (plot, ctx) {
// draw selection // draw selection
if (selection.show && selectionIsSane()) { if (selection.show && selectionIsSane()) {
var plotOffset = plot.getPlotOffset(); var plotOffset = plot.getPlotOffset(),
var o = plot.getOptions(); o = plot.getOptions(),
c, x, y, w, h;
ctx.save(); ctx.save();
ctx.translate(plotOffset.left, plotOffset.top); ctx.translate(plotOffset.left, plotOffset.top);
var c = $.color.parse(o.selection.color); c = $.color.parse(o.selection.color);
ctx.strokeStyle = c.scale("a", 0.8).toString(); ctx.strokeStyle = c.scale("a", 0.8).toString();
ctx.lineWidth = 1; ctx.lineWidth = 1;
ctx.lineJoin = o.selection.shape; ctx.lineJoin = o.selection.shape;
ctx.fillStyle = c.scale("a", 0.4).toString(); ctx.fillStyle = c.scale("a", 0.4).toString();
var x = Math.min(selection.first.x, selection.second.x) + 0.5, x = Math.min(selection.first.x, selection.second.x) + 0.5;
y = Math.min(selection.first.y, selection.second.y) + 0.5, y = Math.min(selection.first.y, selection.second.y) + 0.5;
w = Math.abs(selection.second.x - selection.first.x) - 1, w = Math.abs(selection.second.x - selection.first.x) - 1;
h = Math.abs(selection.second.y - selection.first.y) - 1; h = Math.abs(selection.second.y - selection.first.y) - 1;
ctx.fillRect(x, y, w, h); ctx.fillRect(x, y, w, h);
...@@ -367,7 +366,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -367,7 +366,7 @@ The plugin allso adds the following methods to the plot object:
} }
}); });
plot.hooks.shutdown.push(function (plot, eventHolder) { plot.hooks.shutdown.push(function(plot, eventHolder) {
eventHolder.unbind("mousemove", onMouseMove); eventHolder.unbind("mousemove", onMouseMove);
eventHolder.unbind("mousedown", onMouseDown); eventHolder.unbind("mousedown", onMouseDown);
if (mouseUpHandler) { if (mouseUpHandler) {
......
...@@ -35,7 +35,7 @@ charts or filled areas). ...@@ -35,7 +35,7 @@ charts or filled areas).
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { stack: null } // or number/string series: { stack: null } // or number/string
}; };
......
...@@ -13,18 +13,18 @@ The symbols are accessed as strings through the standard symbol options: ...@@ -13,18 +13,18 @@ The symbols are accessed as strings through the standard symbol options:
*/ */
(function ($) { (function($) {
function processRawData(plot, series) { function processRawData(plot, series) {
// we normalize the area of each symbol so it is approximately the // we normalize the area of each symbol so it is approximately the
// same as a circle of the given radius // same as a circle of the given radius
var handlers = { var handlers = {
square: function (ctx, x, y, radius) { square: function(ctx, x, y, radius) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2 // pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2; var size = radius * Math.sqrt(Math.PI) / 2;
ctx.rect(x - size, y - size, size + size, size + size); ctx.rect(x - size, y - size, size + size, size + size);
}, },
diamond: function (ctx, x, y, radius) { diamond: function(ctx, x, y, radius) {
// pi * r^2 = 2s^2 => s = r * sqrt(pi/2) // pi * r^2 = 2s^2 => s = r * sqrt(pi/2)
var size = radius * Math.sqrt(Math.PI / 2); var size = radius * Math.sqrt(Math.PI / 2);
ctx.moveTo(x - size, y); ctx.moveTo(x - size, y);
...@@ -33,18 +33,18 @@ The symbols are accessed as strings through the standard symbol options: ...@@ -33,18 +33,18 @@ The symbols are accessed as strings through the standard symbol options:
ctx.lineTo(x, y + size); ctx.lineTo(x, y + size);
ctx.lineTo(x - size, y); ctx.lineTo(x - size, y);
}, },
triangle: function (ctx, x, y, radius, shadow) { triangle: function(ctx, x, y, radius, shadow) {
// pi * r^2 = 1/2 * s^2 * sin (pi / 3) => s = r * sqrt(2 * pi / sin(pi / 3)) // 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 size = radius * Math.sqrt(2 * Math.PI / Math.sin(Math.PI / 3)),
var height = size * Math.sin(Math.PI / 3); height = size * Math.sin(Math.PI / 3);
ctx.moveTo(x - size/2, y + height/2); ctx.moveTo(x - size / 2, y + height / 2);
ctx.lineTo(x + size/2, y + height/2); ctx.lineTo(x + size / 2, y + height / 2);
if (!shadow) { if (!shadow) {
ctx.lineTo(x, y - height/2); ctx.lineTo(x, y - height / 2);
ctx.lineTo(x - size/2, y + height/2); ctx.lineTo(x - size / 2, y + height / 2);
} }
}, },
cross: function (ctx, x, y, radius) { cross: function(ctx, x, y, radius) {
// pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2 // pi * r^2 = (2s)^2 => s = r * sqrt(pi)/2
var size = radius * Math.sqrt(Math.PI) / 2; var size = radius * Math.sqrt(Math.PI) / 2;
ctx.moveTo(x - size, y - size); ctx.moveTo(x - size, y - size);
...@@ -52,9 +52,9 @@ The symbols are accessed as strings through the standard symbol options: ...@@ -52,9 +52,9 @@ The symbols are accessed as strings through the standard symbol options:
ctx.moveTo(x - size, y + size); ctx.moveTo(x - size, y + size);
ctx.lineTo(x + size, y - size); ctx.lineTo(x + size, y - size);
} }
}; },
s = series.points.symbol;
var s = series.points.symbol;
if (handlers[s]) { if (handlers[s]) {
series.points.symbol = handlers[s]; series.points.symbol = handlers[s];
} }
......
...@@ -43,7 +43,7 @@ You may need to check for this in hover events. ...@@ -43,7 +43,7 @@ You may need to check for this in hover events.
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { threshold: null } // or { below: number, color: color spec} series: { threshold: null } // or { below: number, color: color spec}
}; };
...@@ -136,7 +136,6 @@ You may need to check for this in hover events. ...@@ -136,7 +136,6 @@ You may need to check for this in hover events.
plot.hooks.processDatapoints.push(processThresholds); plot.hooks.processDatapoints.push(processThresholds);
function processThresholdsLegend(ctx, canvas, s) { function processThresholdsLegend(ctx, canvas, s) {
if (!s.threshold) { if (!s.threshold) {
return; return;
...@@ -145,11 +144,11 @@ You may need to check for this in hover events. ...@@ -145,11 +144,11 @@ You may need to check for this in hover events.
var color = s.threshold.color ? s.threshold.color : "black"; var color = s.threshold.color ? s.threshold.color : "black";
$(".legendLabel").each(function() { $(".legendLabel").each(function() {
if($(this).text() === s.label) if ($(this).text() === s.label)
{ {
var legend = $(this).prev().find("div > div"); var legend = $(this).prev().find("div > div");
legend.css("border-right-color" , color); legend.css("border-right-color", color);
legend.css("border-bottom-color" , color); legend.css("border-bottom-color", color);
} }
}); });
} }
......
...@@ -38,12 +38,12 @@ API.txt for details. ...@@ -38,12 +38,12 @@ API.txt for details.
n = "" + n; n = "" + n;
pad = "" + (pad == null ? "0" : pad); pad = "" + (pad == null ? "0" : pad);
return n.length === 1 ? pad + n : n; return n.length === 1 ? pad + n : n;
}; },
r = [],
var r = [],
escape = false, escape = false,
hours = d.getHours(), hours = d.getHours(),
isAM = hours < 12; isAM = hours < 12,
c, hours12;
if (monthNames == null) { if (monthNames == null) {
monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
...@@ -53,8 +53,6 @@ API.txt for details. ...@@ -53,8 +53,6 @@ API.txt for details.
dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
} }
var hours12;
if (hours > 12) { if (hours > 12) {
hours12 = hours - 12; hours12 = hours - 12;
} else if (hours === 0) { } else if (hours === 0) {
...@@ -65,7 +63,7 @@ API.txt for details. ...@@ -65,7 +63,7 @@ API.txt for details.
for (var i = 0; i < fmt.length; ++i) { for (var i = 0; i < fmt.length; ++i) {
var c = fmt.charAt(i); c = fmt.charAt(i);
if (escape) { if (escape) {
switch (c) { switch (c) {
...@@ -200,12 +198,12 @@ API.txt for details. ...@@ -200,12 +198,12 @@ API.txt for details.
"month": 30 * 24 * 60 * 60 * 1000, "month": 30 * 24 * 60 * 60 * 1000,
"quarter": 3 * 30 * 24 * 60 * 60 * 1000, "quarter": 3 * 30 * 24 * 60 * 60 * 1000,
"year": 365.2425 * 24 * 60 * 60 * 1000 "year": 365.2425 * 24 * 60 * 60 * 1000
}; },
// the allowed tick sizes, after 1 year we use // the allowed tick sizes, after 1 year we use
// an integer algorithm // an integer algorithm
var baseSpec = [ baseSpec = [
[1, "second"], [2, "second"], [5, "second"], [10, "second"], [1, "second"], [2, "second"], [5, "second"], [10, "second"],
[30, "second"], [30, "second"],
[1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"], [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
...@@ -215,18 +213,24 @@ API.txt for details. ...@@ -215,18 +213,24 @@ API.txt for details.
[1, "day"], [2, "day"], [3, "day"], [1, "day"], [2, "day"], [3, "day"],
[0.25, "month"], [0.5, "month"], [1, "month"], [0.25, "month"], [0.5, "month"], [1, "month"],
[2, "month"] [2, "month"]
]; ],
// we don't know which variant(s) we'll need yet, but generating both is // we don't know which variant(s) we'll need yet, but generating both is
// cheap // cheap
var specMonths = baseSpec.concat([[3, "month"], [6, "month"], specMonths = baseSpec.concat([
[1, "year"]]); [3, "month"],
var specQuarters = baseSpec.concat([[1, "quarter"], [2, "quarter"], [6, "month"],
[1, "year"]]); [1, "year"]
]),
specQuarters = baseSpec.concat([
[1, "quarter"],
[2, "quarter"],
[1, "year"]
]);
function init(plot) { function init(plot) {
plot.hooks.processOptions.push(function (plot) { plot.hooks.processOptions.push(function(plot) {
$.each(plot.getAxes(), function(axisName, axis) { $.each(plot.getAxes(), function(axisName, axis) {
var opts = axis.options; var opts = axis.options;
...@@ -236,12 +240,12 @@ API.txt for details. ...@@ -236,12 +240,12 @@ API.txt for details.
var ticks = [], var ticks = [],
d = dateGenerator(axis.min, opts), d = dateGenerator(axis.min, opts),
minSize = 0; minSize = 0,
// make quarter use a possibility if quarters are // make quarter use a possibility if quarters are
// mentioned in either of these options // mentioned in either of these options
var spec = (opts.tickSize && opts.tickSize[1] === spec = (opts.tickSize && opts.tickSize[1] ===
"quarter") || "quarter") ||
(opts.minTickSize && opts.minTickSize[1] === (opts.minTickSize && opts.minTickSize[1] ===
"quarter") ? specQuarters : specMonths; "quarter") ? specQuarters : specMonths;
...@@ -385,7 +389,7 @@ API.txt for details. ...@@ -385,7 +389,7 @@ API.txt for details.
return ticks; return ticks;
}; };
axis.tickFormatter = function (v, axis) { axis.tickFormatter = function(v, axis) {
var d = dateGenerator(v, axis.options); var d = dateGenerator(v, axis.options);
......
...@@ -36,10 +36,11 @@ ...@@ -36,10 +36,11 @@
"url": "https://github.com/flot/flot/issues" "url": "https://github.com/flot/flot/issues"
}, },
"devDependencies": { "devDependencies": {
"grunt": "~0.4.1", "grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.6.4", "grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-uglify": "~0.2.4", "grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-watch": "~0.5.3" "grunt-contrib-watch": "~0.5.3",
"grunt-jscs-checker": "~0.3.2"
}, },
"maintainers": [ "maintainers": [
{ {
......
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