Commit fcc7c16b authored by Nick Schonning's avatar Nick Schonning

JSCS: Remove space between function and bracket

parent 67dce054
...@@ -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,7 +62,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -62,7 +62,7 @@ shadowSize and lineWidth are derived as well from the points series.
*/ */
(function ($) { (function($) {
var options = { var options = {
series: { series: {
points: { points: {
...@@ -377,7 +377,7 @@ shadowSize and lineWidth are derived as well from the points series. ...@@ -377,7 +377,7 @@ shadowSize and lineWidth are derived as well from the points series.
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 = [];
var 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;
......
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 = {};
} }
...@@ -260,7 +260,7 @@ can set the default in the options. ...@@ -260,7 +260,7 @@ can set the default in the options.
} }
}; };
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),
......
...@@ -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,7 +78,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -78,7 +78,7 @@ The plugin allso adds the following methods to the plot object:
*/ */
(function ($) { (function($) {
function init(plot) { function init(plot) {
var selection = { var selection = {
...@@ -124,11 +124,11 @@ The plugin allso adds the following methods to the plot object: ...@@ -124,11 +124,11 @@ The plugin allso adds the following methods to the plot object:
// 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 +137,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -137,7 +137,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);
} }
...@@ -179,7 +179,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -179,7 +179,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]);
...@@ -339,7 +339,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -339,7 +339,7 @@ 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();
...@@ -367,7 +367,7 @@ The plugin allso adds the following methods to the plot object: ...@@ -367,7 +367,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,7 +33,7 @@ The symbols are accessed as strings through the standard symbol options: ...@@ -33,7 +33,7 @@ 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); var height = size * Math.sin(Math.PI / 3);
...@@ -44,7 +44,7 @@ The symbols are accessed as strings through the standard symbol options: ...@@ -44,7 +44,7 @@ The symbols are accessed as strings through the standard symbol options:
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);
......
...@@ -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}
}; };
......
...@@ -226,7 +226,7 @@ API.txt for details. ...@@ -226,7 +226,7 @@ API.txt for details.
[1, "year"]]); [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;
...@@ -385,7 +385,7 @@ API.txt for details. ...@@ -385,7 +385,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);
......
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