Commit c6ddfa56 authored by David Schnur's avatar David Schnur

Merge pull request #896 from dnschnur/license-headers

Updated license headers for #805.
parents 8df11479 9e21074d
/* /* Flot plugin for plotting textual data or categories.
Flot plugin for plotting textual data or categories. Consider a
dataset like [["February", 34], ["March", 20], ...]. This plugin Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin
allows you to plot such a dataset directly. allows you to plot such a dataset directly.
To enable it, you must specify mode: "categories" on the axis with the To enable it, you must specify mode: "categories" on the axis with the textual
textual labels, e.g. labels, e.g.
$.plot("#placeholder", data, { xaxis: { mode: "categories" } }); $.plot("#placeholder", data, { xaxis: { mode: "categories" } });
By default, the labels are ordered as they are met in the data series. By default, the labels are ordered as they are met in the data series. If you
If you need a different ordering, you can specify "categories" on the need a different ordering, you can specify "categories" on the axis options
axis options and list the categories there: and list the categories there:
xaxis: { xaxis: {
mode: "categories", mode: "categories",
categories: ["February", "March", "April"] categories: ["February", "March", "April"]
} }
If you need to customize the distances between the categories, you can If you need to customize the distances between the categories, you can specify
specify "categories" as an object mapping labels to values "categories" as an object mapping labels to values
xaxis: { xaxis: {
mode: "categories", mode: "categories",
categories: { "February": 1, "March": 3, "April": 4 } categories: { "February": 1, "March": 3, "April": 4 }
} }
If you don't specify all categories, the remaining encountered If you don't specify all categories, the remaining categories will be numbered
categories will be numbered from the max value plus 1 (with a spacing from the max value plus 1 (with a spacing of 1 between each).
of 1 between each).
Internally, the plugin works by transforming the input data through an auto-
generated mapping where the first category becomes 0, the second 1, etc.
Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this
is visible in hover and click events that return numbers rather than the
category labels). The plugin also overrides the tick generator to spit out the
categories as ticks instead of the values.
Internally, the plugin works by transforming the input data through an If you need to map a value back to its label, the mapping is always accessible
auto-generated mapping where the first category becomes 0, the second as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories.
1, etc. Hence, a point like ["February", 34] becomes [0, 34]
internally in Flot (this is visible in hover and click events that
return numbers rather than the category labels). The plugin also
overrides the tick generator to spit out the categories as ticks
instead of the values.
If you need to map a value back to its label, the mapping is always
accessible as "categories" on the axis object, e.g.
plot.getAxes().xaxis.categories.
*/ */
(function ($) { (function ($) {
......
/* /* Flot plugin for showing crosshairs when the mouse hovers over the plot.
Flot plugin for showing crosshairs, thin lines, when the mouse hovers
over the plot. Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
crosshair: {
mode: null or "x" or "y" or "xy" The plugin supports these options:
color: color
lineWidth: number crosshair: {
} mode: null or "x" or "y" or "xy"
color: color
Set the mode to one of "x", "y" or "xy". The "x" mode enables a lineWidth: number
vertical crosshair that lets you trace the values on the x axis, "y" }
enables a horizontal crosshair and "xy" enables them both. "color" is
the color of the crosshair (default is "rgba(170, 0, 0, 0.80)"), Set the mode to one of "x", "y" or "xy". The "x" mode enables a vertical
"lineWidth" is the width of the drawn lines (default is 1). crosshair that lets you trace the values on the x axis, "y" enables a
horizontal crosshair and "xy" enables them both. "color" is the color of the
crosshair (default is "rgba(170, 0, 0, 0.80)"), "lineWidth" is the width of
the drawn lines (default is 1).
The plugin also adds four public methods: The plugin also adds four public methods:
- setCrosshair(pos) - setCrosshair( pos )
Set the position of the crosshair. Note that this is cleared if Set the position of the crosshair. Note that this is cleared if the user
the user moves the mouse. "pos" is in coordinates of the plot and moves the mouse. "pos" is in coordinates of the plot and should be on the
should be on the form { x: xpos, y: ypos } (you can use x2/x3/... form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple
if you're using multiple axes), which is coincidentally the same axes), which is coincidentally the same format as what you get from a
format as what you get from a "plothover" event. If "pos" is null, "plothover" event. If "pos" is null, the crosshair is cleared.
the crosshair is cleared.
- clearCrosshair() - clearCrosshair()
...@@ -31,22 +33,25 @@ The plugin also adds four public methods: ...@@ -31,22 +33,25 @@ The plugin also adds four public methods:
- lockCrosshair(pos) - lockCrosshair(pos)
Cause the crosshair to lock to the current location, no longer Cause the crosshair to lock to the current location, no longer updating if
updating if the user moves the mouse. Optionally supply a position the user moves the mouse. Optionally supply a position (passed on to
(passed on to setCrosshair()) to move it to. setCrosshair()) to move it to.
Example usage: Example usage:
var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
$("#graph").bind("plothover", function (evt, position, item) { var myFlot = $.plot( $("#graph"), ..., { crosshair: { mode: "x" } } };
if (item) { $("#graph").bind( "plothover", function ( evt, position, item ) {
// Lock the crosshair to the data point being hovered if ( item ) {
myFlot.lockCrosshair({ x: item.datapoint[0], y: item.datapoint[1] }); // Lock the crosshair to the data point being hovered
} myFlot.lockCrosshair({
else { x: item.datapoint[ 0 ],
// Return normal crosshair operation y: item.datapoint[ 1 ]
myFlot.unlockCrosshair(); });
} } else {
}); // Return normal crosshair operation
myFlot.unlockCrosshair();
}
});
- unlockCrosshair() - unlockCrosshair()
......
/* /* Flot plugin for plotting error bars.
Flot plugin for plotting error bars, i.e. to show standard deviation
and other statistical properties in a plot.
* Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
This plugin allows you to plot error-bars over points. Set "errorbars"
inside the points series to the axis name over which there will be
error values in your data array (*even* if you do not intend to plot
them later, by setting "show: null" on xerr/yerr).
Options for the plugin are
series: {
points: {
errorbars: "x" or "y" or "xy",
xerr: { show: null/false or true,
asymmetric: null/false or true,
upperCap: null or "-" or function,
lowerCap: null or "-" or function,
color: null or color,
radius: null or number},
yerr: { same options as xerr }
}
}
Each data point array is expected to be of the type
"x" [x,y,xerr]
"y" [x,y,yerr]
"xy" [x,y,xerr,yerr]
where xerr becomes xerr_lower,xerr_upper for the asymmetric error Error bars are used to show standard deviation and other statistical
case, and equivalently for yerr. Eg., a datapoint for the "xy" case properties in a plot.
with symmetric error-bars on X and asymmetric on Y would be:
[x,y,xerr,yerr_lower,yerr_upper] * Created by Rui Pereira - rui (dot) pereira (at) gmail (dot) com
By default no end caps are drawn. Setting upperCap and/or lowerCap to
"-" will draw a small cap perpendicular to the error bar. They can
also be set to a user-defined drawing function, with (ctx, x, y,
radius) as parameters, as eg.
function drawSemiCircle(ctx, x, y, radius){
ctx.beginPath();
ctx.arc(x, y, radius, 0, Math.PI, false);
ctx.moveTo(x - radius, y);
ctx.lineTo(x + radius, y);
ctx.stroke();
}
Color and radius both default to the same ones of the points series if This plugin allows you to plot error-bars over points. Set "errorbars" inside
not set. The independent radius parameter on xerr/yerr is useful for the points series to the axis name over which there will be error values in
the case when we may want to add error-bars to a line, without showing your data array (*even* if you do not intend to plot them later, by setting
the interconnecting points (with radius: 0), and still showing end "show: null" on xerr/yerr).
caps on the error-bars. shadowSize and lineWidth are derived as well
from the points series. The plugin supports these options:
series: {
points: {
errorbars: "x" or "y" or "xy",
xerr: {
show: null/false or true,
asymmetric: null/false or true,
upperCap: null or "-" or function,
lowerCap: null or "-" or function,
color: null or color,
radius: null or number
},
yerr: { same options as xerr }
}
}
Each data point array is expected to be of the type:
"x" [ x, y, xerr ]
"y" [ x, y, yerr ]
"xy" [ x, y, xerr, yerr ]
Where xerr becomes xerr_lower,xerr_upper for the asymmetric error case, and
equivalently for yerr. Eg., a datapoint for the "xy" case with symmetric
error-bars on X and asymmetric on Y would be:
[ x, y, xerr, yerr_lower, yerr_upper ]
By default no end caps are drawn. Setting upperCap and/or lowerCap to "-" will
draw a small cap perpendicular to the error bar. They can also be set to a
user-defined drawing function, with (ctx, x, y, radius) as parameters, as eg.
function drawSemiCircle( ctx, x, y, radius ) {
ctx.beginPath();
ctx.arc( x, y, radius, 0, Math.PI, false );
ctx.moveTo( x - radius, y );
ctx.lineTo( x + radius, y );
ctx.stroke();
}
Color and radius both default to the same ones of the points series if not
set. The independent radius parameter on xerr/yerr is useful for the case when
we may want to add error-bars to a line, without showing the interconnecting
points (with radius: 0), and still showing end caps on the error-bars.
shadowSize and lineWidth are derived as well from the points series.
*/ */
......
/* /* Flot plugin for plotting images.
Flot plugin for plotting images, e.g. useful for putting ticks on a
prerendered complex visualization. Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The data syntax is [[image, x1, y1, x2, y2], ...] where (x1, y1) and
(x2, y2) are where you intend the two opposite corners of the image to The data syntax is [ [ image, x1, y1, x2, y2 ], ... ] where (x1, y1) and
end up in the plot. Image must be a fully loaded Javascript image (you (x2, y2) are where you intend the two opposite corners of the image to end up
can make one with new Image()). If the image is not complete, it's in the plot. Image must be a fully loaded Javascript image (you can make one
skipped when plotting. with new Image()). If the image is not complete, it's skipped when plotting.
There are two helpers included for retrieving images. The easiest work There are two helpers included for retrieving images. The easiest work the way
the way that you put in URLs instead of images in the data (like that you put in URLs instead of images in the data, like this:
["myimage.png", 0, 0, 10, 10]), then call $.plot.image.loadData(data,
options, callback) where data and options are the same as you pass in [ "myimage.png", 0, 0, 10, 10 ]
to $.plot. This loads the images, replaces the URLs in the data with
the corresponding images and calls "callback" when all images are Then call $.plot.image.loadData( data, options, callback ) where data and
loaded (or failed loading). In the callback, you can then call $.plot options are the same as you pass in to $.plot. This loads the images, replaces
with the data set. See the included example. the URLs in the data with the corresponding images and calls "callback" when
all images are loaded (or failed loading). In the callback, you can then call
A more low-level helper, $.plot.image.load(urls, callback) is also $.plot with the data set. See the included example.
included. Given a list of URLs, it calls callback with an object
mapping from URL to Image object when all images are loaded or have A more low-level helper, $.plot.image.load(urls, callback) is also included.
failed loading. Given a list of URLs, it calls callback with an object mapping from URL to
Image object when all images are loaded or have failed loading.
Options for the plugin are
The plugin supports these options:
series: {
images: { series: {
show: boolean images: {
anchor: "corner" or "center" show: boolean
alpha: [0,1] anchor: "corner" or "center"
} alpha: [ 0, 1 ]
} }
}
which can be specified for a specific series
They can be specified for a specific series:
$.plot($("#placeholder"), [{ data: [ ... ], images: { ... } ])
$.plot( $("#placeholder"), [{
Note that because the data format is different from usual data points, data: [ ... ],
you can't use images with anything else in a specific data series. images: { ... }
])
Setting "anchor" to "center" causes the pixels in the image to be
anchored at the corner pixel centers inside of at the pixel corners, Note that because the data format is different from usual data points, you
effectively letting half a pixel stick out to each side in the plot. can't use images with anything else in a specific data series.
Setting "anchor" to "center" causes the pixels in the image to be anchored at
A possible future direction could be support for tiling for large the corner pixel centers inside of at the pixel corners, effectively letting
images (like Google Maps). half a pixel stick out to each side in the plot.
A possible future direction could be support for tiling for large images (like
Google Maps).
*/ */
......
/*! Javascript plotting library for jQuery, version 0.8 alpha. /* Javascript plotting library for jQuery, version 0.8 alpha.
*
* Released under the MIT license by IOLA, December 2007. Copyright (c) 2007-2012 IOLA and Ole Laursen.
* Licensed under the MIT license.
*/
*/
// first an inline dependency, jquery.colorhelpers.js, we inline it here // first an inline dependency, jquery.colorhelpers.js, we inline it here
// for convenience // for convenience
......
/* /* Flot plugin for adding the ability to pan and zoom the plot.
Flot plugin for adding panning and zooming capabilities to a plot.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
The default behaviour is double click and scrollwheel up/down to zoom Licensed under the MIT license.
in, drag to pan. The plugin defines plot.zoom({ center }),
plot.zoomOut() and plot.pan(offset) so you easily can add custom The default behaviour is double click and scrollwheel up/down to zoom in, drag
controls. It also fires a "plotpan" and "plotzoom" event when to pan. The plugin defines plot.zoom({ center }), plot.zoomOut() and
something happens, useful for synchronizing plots. plot.pan( offset ) so you easily can add custom controls. It also fires
"plotpan" and "plotzoom" events, useful for synchronizing plots.
Options:
The plugin supports these options:
zoom: {
interactive: false zoom: {
trigger: "dblclick" // or "click" for single click interactive: false
amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out) trigger: "dblclick" // or "click" for single click
} amount: 1.5 // 2 = 200% (zoom in), 0.5 = 50% (zoom out)
}
pan: {
interactive: false pan: {
cursor: "move" // CSS mouse cursor value used when dragging, e.g. "pointer" interactive: false
frameRate: 20 cursor: "move" // CSS mouse cursor value used when dragging, e.g. "pointer"
} frameRate: 20
}
xaxis, yaxis, x2axis, y2axis: {
zoomRange: null // or [number, number] (min range, max range) or false xaxis, yaxis, x2axis, y2axis: {
panRange: null // or [number, number] (min, max) or false zoomRange: null // or [ number, number ] (min range, max range) or false
} panRange: null // or [ number, number ] (min, max) or false
}
"interactive" enables the built-in drag/click behaviour. If you enable "interactive" enables the built-in drag/click behaviour. If you enable
interactive for pan, then you'll have a basic plot that supports interactive for pan, then you'll have a basic plot that supports moving
moving around; the same for zoom. around; the same for zoom.
"amount" specifies the default amount to zoom in (so 1.5 = 150%) "amount" specifies the default amount to zoom in (so 1.5 = 150%) relative to
relative to the current viewport. the current viewport.
"cursor" is a standard CSS mouse cursor string used for visual "cursor" is a standard CSS mouse cursor string used for visual feedback to the
feedback to the user when dragging. user when dragging.
"frameRate" specifies the maximum number of times per second the plot "frameRate" specifies the maximum number of times per second the plot will
will update itself while the user is panning around on it (set to null update itself while the user is panning around on it (set to null to disable
to disable intermediate pans, the plot will then not update until the intermediate pans, the plot will then not update until the mouse button is
mouse button is released). released).
"zoomRange" is the interval in which zooming can happen, e.g. with "zoomRange" is the interval in which zooming can happen, e.g. with zoomRange:
zoomRange: [1, 100] the zoom will never scale the axis so that the [1, 100] the zoom will never scale the axis so that the difference between min
difference between min and max is smaller than 1 or larger than 100. and max is smaller than 1 or larger than 100. You can set either end to null
You can set either end to null to ignore, e.g. [1, null]. If you set to ignore, e.g. [1, null]. If you set zoomRange to false, zooming on that axis
zoomRange to false, zooming on that axis will be disabled. will be disabled.
"panRange" confines the panning to stay within a range, e.g. with "panRange" confines the panning to stay within a range, e.g. with panRange:
panRange: [-10, 20] panning stops at -10 in one end and at 20 in the [-10, 20] panning stops at -10 in one end and at 20 in the other. Either can
other. Either can be null, e.g. [-10, null]. If you set be null, e.g. [-10, null]. If you set panRange to false, panning on that axis
panRange to false, panning on that axis will be disabled. will be disabled.
Example API usage: Example API usage:
plot = $.plot(...); plot = $.plot(...);
// zoom default amount in on the pixel (10, 20)
plot.zoom({ center: { left: 10, top: 20 } });
// zoom out again
plot.zoomOut({ center: { left: 10, top: 20 } });
// zoom 200% in on the pixel (10, 20)
plot.zoom({ amount: 2, center: { left: 10, top: 20 } });
// pan 100 pixels to the left and 20 down
plot.pan({ left: -100, top: 20 })
Here, "center" specifies where the center of the zooming should
happen. Note that this is defined in pixel space, not the space of the
data points (you can use the p2c helpers on the axes in Flot to help
you convert between these).
"amount" is the amount to zoom the viewport relative to the current
range, so 1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is
70% (zoom out). You can set the default in the options.
*/
// zoom default amount in on the pixel ( 10, 20 )
plot.zoom({ center: { left: 10, top: 20 } });
// zoom out again
plot.zoomOut({ center: { left: 10, top: 20 } });
// zoom 200% in on the pixel (10, 20)
plot.zoom({ amount: 2, center: { left: 10, top: 20 } });
// pan 100 pixels to the left and 20 down
plot.pan({ left: -100, top: 20 })
Here, "center" specifies where the center of the zooming should happen. Note
that this is defined in pixel space, not the space of the data points (you can
use the p2c helpers on the axes in Flot to help you convert between these).
"amount" is the amount to zoom the viewport relative to the current range, so
1 is 100% (i.e. no change), 1.5 is 150% (zoom in), 0.7 is 70% (zoom out). You
can set the default in the options.
*/
// First two dependencies, jquery.event.drag.js and // First two dependencies, jquery.event.drag.js and
// jquery.mousewheel.js, we put them inline here to save people the // jquery.mousewheel.js, we put them inline here to save people the
// effort of downloading them. // effort of downloading them.
/* /*
jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) jquery.event.drag.js ~ v1.5 ~ Copyright (c) 2008, Three Dub Media (http://threedubmedia.com)
Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-LICENSE.txt
*/ */
(function(E){E.fn.drag=function(L,K,J){if(K){this.bind("dragstart",L)}if(J){this.bind("dragend",J)}return !L?this.trigger("drag"):this.bind("drag",K?K:L)};var A=E.event,B=A.special,F=B.drag={not:":input",distance:0,which:1,dragging:false,setup:function(J){J=E.extend({distance:F.distance,which:F.which,not:F.not},J||{});J.distance=I(J.distance);A.add(this,"mousedown",H,J);if(this.attachEvent){this.attachEvent("ondragstart",D)}},teardown:function(){A.remove(this,"mousedown",H);if(this===F.dragging){F.dragging=F.proxy=false}G(this,true);if(this.detachEvent){this.detachEvent("ondragstart",D)}}};B.dragstart=B.dragend={setup:function(){},teardown:function(){}};function H(L){var K=this,J,M=L.data||{};if(M.elem){K=L.dragTarget=M.elem;L.dragProxy=F.proxy||K;L.cursorOffsetX=M.pageX-M.left;L.cursorOffsetY=M.pageY-M.top;L.offsetX=L.pageX-L.cursorOffsetX;L.offsetY=L.pageY-L.cursorOffsetY}else{if(F.dragging||(M.which>0&&L.which!=M.which)||E(L.target).is(M.not)){return }}switch(L.type){case"mousedown":E.extend(M,E(K).offset(),{elem:K,target:L.target,pageX:L.pageX,pageY:L.pageY});A.add(document,"mousemove mouseup",H,M);G(K,false);F.dragging=null;return false;case !F.dragging&&"mousemove":if(I(L.pageX-M.pageX)+I(L.pageY-M.pageY)<M.distance){break}L.target=M.target;J=C(L,"dragstart",K);if(J!==false){F.dragging=K;F.proxy=L.dragProxy=E(J||K)[0]}case"mousemove":if(F.dragging){J=C(L,"drag",K);if(B.drop){B.drop.allowed=(J!==false);B.drop.handler(L)}if(J!==false){break}L.type="mouseup"}case"mouseup":A.remove(document,"mousemove mouseup",H);if(F.dragging){if(B.drop){B.drop.handler(L)}C(L,"dragend",K)}G(K,true);F.dragging=F.proxy=M.elem=false;break}return true}function C(M,K,L){M.type=K;var J=E.event.handle.call(L,M);return J===false?false:J||M.result}function I(J){return Math.pow(J,2)}function D(){return(F.dragging===false)}function G(K,J){if(!K){return }K.unselectable=J?"off":"on";K.onselectstart=function(){return J};if(K.style){K.style.MozUserSelect=J?"":"none"}}})(jQuery); (function(E){E.fn.drag=function(L,K,J){if(K){this.bind("dragstart",L)}if(J){this.bind("dragend",J)}return !L?this.trigger("drag"):this.bind("drag",K?K:L)};var A=E.event,B=A.special,F=B.drag={not:":input",distance:0,which:1,dragging:false,setup:function(J){J=E.extend({distance:F.distance,which:F.which,not:F.not},J||{});J.distance=I(J.distance);A.add(this,"mousedown",H,J);if(this.attachEvent){this.attachEvent("ondragstart",D)}},teardown:function(){A.remove(this,"mousedown",H);if(this===F.dragging){F.dragging=F.proxy=false}G(this,true);if(this.detachEvent){this.detachEvent("ondragstart",D)}}};B.dragstart=B.dragend={setup:function(){},teardown:function(){}};function H(L){var K=this,J,M=L.data||{};if(M.elem){K=L.dragTarget=M.elem;L.dragProxy=F.proxy||K;L.cursorOffsetX=M.pageX-M.left;L.cursorOffsetY=M.pageY-M.top;L.offsetX=L.pageX-L.cursorOffsetX;L.offsetY=L.pageY-L.cursorOffsetY}else{if(F.dragging||(M.which>0&&L.which!=M.which)||E(L.target).is(M.not)){return }}switch(L.type){case"mousedown":E.extend(M,E(K).offset(),{elem:K,target:L.target,pageX:L.pageX,pageY:L.pageY});A.add(document,"mousemove mouseup",H,M);G(K,false);F.dragging=null;return false;case !F.dragging&&"mousemove":if(I(L.pageX-M.pageX)+I(L.pageY-M.pageY)<M.distance){break}L.target=M.target;J=C(L,"dragstart",K);if(J!==false){F.dragging=K;F.proxy=L.dragProxy=E(J||K)[0]}case"mousemove":if(F.dragging){J=C(L,"drag",K);if(B.drop){B.drop.allowed=(J!==false);B.drop.handler(L)}if(J!==false){break}L.type="mouseup"}case"mouseup":A.remove(document,"mousemove mouseup",H);if(F.dragging){if(B.drop){B.drop.handler(L)}C(L,"dragend",K)}G(K,true);F.dragging=F.proxy=M.elem=false;break}return true}function C(M,K,L){M.type=K;var J=E.event.handle.call(L,M);return J===false?false:J||M.result}function I(J){return Math.pow(J,2)}function D(){return(F.dragging===false)}function G(K,J){if(!K){return }K.unselectable=J?"off":"on";K.onselectstart=function(){return J};if(K.style){K.style.MozUserSelect=J?"":"none"}}})(jQuery);
/* jquery.mousewheel.min.js /* jquery.mousewheel.min.js
* Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) * Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt). * Licensed under the MIT License (LICENSE.txt).
...@@ -99,7 +97,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L ...@@ -99,7 +97,7 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L
* Thanks to: Seamus Leahy for adding deltaX and deltaY * Thanks to: Seamus Leahy for adding deltaX and deltaY
* *
* Version: 3.0.6 * Version: 3.0.6
* *
* Requires: 1.2.2+ * Requires: 1.2.2+
*/ */
(function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); (function(d){function e(a){var b=a||window.event,c=[].slice.call(arguments,1),f=0,e=0,g=0,a=d.event.fix(b);a.type="mousewheel";b.wheelDelta&&(f=b.wheelDelta/120);b.detail&&(f=-b.detail/3);g=f;void 0!==b.axis&&b.axis===b.HORIZONTAL_AXIS&&(g=0,e=-1*f);void 0!==b.wheelDeltaY&&(g=b.wheelDeltaY/120);void 0!==b.wheelDeltaX&&(e=-1*b.wheelDeltaX/120);c.unshift(a,f,e,g);return(d.event.dispatch||d.event.handle).apply(this,c)}var c=["DOMMouseScroll","mousewheel"];if(d.event.fixHooks)for(var h=c.length;h;)d.event.fixHooks[c[--h]]=d.event.mouseHooks;d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],e,!1);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
......
/* /* Flot plugin for rendering pie charts.
Flot plugin for rendering pie charts.
Copyright (c) 2007-2012 IOLA and Ole Laursen. Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license. Licensed under the MIT license.
The plugin assumes that each series has a single data value, and that The plugin assumes that each series has a single data value, and that each
each value is a positive integer or zero. Negative numbers don't make value is a positive integer or zero. Negative numbers don't make sense for a
sense for a pie chart, and have unpredictable results. The values do pie chart, and have unpredictable results. The values do NOT need to be
NOT need to be passed in as percentages; the plugin will calculate the passed in as percentages; the plugin will calculate the total and per-slice
total and per-slice percentages internally. percentages internally.
* Created by Brian Medendorp, June 2009 * Created by Brian Medendorp
* Updated November 2009 with contributions from: btburnett3, Anthony Aragues and Xavi Ivars
* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
* Changes:
2009-10-22: lineJoin set to round The plugin supports these options:
2009-10-23: IE full circle fix, donut
2009-11-11: Added basic hover from btburnett3 - does not work in IE, and center is off in Chrome and Opera series: {
2009-11-17: Added IE hover capability submitted by Anthony Aragues pie: {
2009-11-18: Added bug fix submitted by Xavi Ivars (issues with arrays when other JS libraries are included as well) show: true/false
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
Available options are: innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
series: { startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
pie: { tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
show: true/false offset: {
radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto' top: integer value to move the pie up or down
innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect left: integer value to move the pie left or right, or 'auto'
startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
offset: {
top: integer value to move the pie up or down
left: integer value to move the pie left or right, or 'auto'
},
stroke: {
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
width: integer pixel width of the stroke
},
label: {
show: true/false, or 'auto'
formatter: a user-defined function that modifies the text/style of the label text
radius: 0-1 for percentage of fullsize, or a specified pixel length
background: {
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
opacity: 0-1
}, },
threshold: 0-1 for the percentage value at which to hide labels (if they're too small) stroke: {
}, color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
combine: { width: integer pixel width of the stroke
threshold: 0-1 for the percentage value at which to combine slices (if they're too small) },
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined label: {
label: any text value of what the combined slice should be labeled show: true/false, or 'auto'
} formatter: a user-defined function that modifies the text/style of the label text
highlight: { radius: 0-1 for percentage of fullsize, or a specified pixel length
opacity: 0-1 background: {
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
opacity: 0-1
},
threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
},
combine: {
threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
label: any text value of what the combined slice should be labeled
}
highlight: {
opacity: 0-1
}
} }
} }
}
More detail and specific examples can be found in the included HTML file. More detail and specific examples can be found in the included HTML file.
......
/* /* Flot plugin for automatically redrawing plots as the placeholder resizes.
Flot plugin for automatically redrawing plots when the placeholder
size changes, e.g. on window resizes.
It works by listening for changes on the placeholder div (through the Copyright (c) 2007-2012 IOLA and Ole Laursen.
jQuery resize event plugin) - if the size changes, it will redraw the Licensed under the MIT license.
plot.
There are no options. If you need to disable the plugin for some It works by listening for changes on the placeholder div (through the jQuery
plots, you can just fix the size of their placeholders. resize event plugin) - if the size changes, it will redraw the plot.
*/
There are no options. If you need to disable the plugin for some plots, you
can just fix the size of their placeholders.
*/
/* Inline dependency: /* Inline dependency:
* jQuery resize event - v1.1 - 3/14/2010 * jQuery resize event - v1.1 - 3/14/2010
* http://benalman.com/projects/jquery-resize-plugin/ * http://benalman.com/projects/jquery-resize-plugin/
* *
* Copyright (c) 2010 "Cowboy" Ben Alman * Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses. * Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/ * http://benalman.com/about/license/
*/ */
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
(function ($) { (function ($) {
var options = { }; // no options var options = { }; // no options
......
/* /* Flot plugin for selecting regions of a plot.
Flot plugin for selecting regions.
Copyright (c) 2007-2012 IOLA and Ole Laursen.
The plugin defines the following options: Licensed under the MIT license.
selection: { The plugin supports these options:
mode: null or "x" or "y" or "xy",
color: color selection: {
} mode: null or "x" or "y" or "xy",
color: color
Selection support is enabled by setting the mode to one of "x", "y" or }
"xy". In "x" mode, the user will only be able to specify the x range,
similarly for "y" mode. For "xy", the selection becomes a rectangle Selection support is enabled by setting the mode to one of "x", "y" or "xy".
where both ranges can be specified. "color" is color of the selection In "x" mode, the user will only be able to specify the x range, similarly for
(if you need to change the color later on, you can get to it with "y" mode. For "xy", the selection becomes a rectangle where both ranges can be
plot.getOptions().selection.color). specified. "color" is color of the selection (if you need to change the color
later on, you can get to it with plot.getOptions().selection.color).
When selection support is enabled, a "plotselected" event will be
emitted on the DOM element you passed into the plot function. The When selection support is enabled, a "plotselected" event will be emitted on
event handler gets a parameter with the ranges selected on the axes, the DOM element you passed into the plot function. The event handler gets a
like this: parameter with the ranges selected on the axes, like this:
placeholder.bind("plotselected", function(event, ranges) { placeholder.bind( "plotselected", function( event, ranges ) {
alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to) alert("You selected " + ranges.xaxis.from + " to " + ranges.xaxis.to)
// similar for yaxis - with multiple axes, the extra ones are in // similar for yaxis - with multiple axes, the extra ones are in
// x2axis, x3axis, ... // x2axis, x3axis, ...
}); });
The "plotselected" event is only fired when the user has finished The "plotselected" event is only fired when the user has finished making the
making the selection. A "plotselecting" event is fired during the selection. A "plotselecting" event is fired during the process with the same
process with the same parameters as the "plotselected" event, in case parameters as the "plotselected" event, in case you want to know what's
you want to know what's happening while it's happening, happening while it's happening,
A "plotunselected" event with no arguments is emitted when the user A "plotunselected" event with no arguments is emitted when the user clicks the
clicks the mouse to remove the selection. mouse to remove the selection.
The plugin allso adds the following methods to the plot object: The plugin allso adds the following methods to the plot object:
- setSelection(ranges, preventEvent) - setSelection( ranges, preventEvent )
Set the selection rectangle. The passed in ranges is on the same form as
returned in the "plotselected" event. If the selection mode is "x", you
should put in either an xaxis range, if the mode is "y" you need to put in
an yaxis range and both xaxis and yaxis if the selection mode is "xy", like
this:
Set the selection rectangle. The passed in ranges is on the same setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });
form as returned in the "plotselected" event. If the selection mode
is "x", you should put in either an xaxis range, if the mode is "y"
you need to put in an yaxis range and both xaxis and yaxis if the
selection mode is "xy", like this:
setSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } }); setSelection will trigger the "plotselected" event when called. If you don't
want that to happen, e.g. if you're inside a "plotselected" handler, pass
true as the second parameter. If you are using multiple axes, you can
specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of
xaxis, the plugin picks the first one it sees.
setSelection will trigger the "plotselected" event when called. If - clearSelection( preventEvent )
you don't want that to happen, e.g. if you're inside a
"plotselected" handler, pass true as the second parameter. If you
are using multiple axes, you can specify the ranges on any of those,
e.g. as x2axis/x3axis/... instead of xaxis, the plugin picks the
first one it sees.
- clearSelection(preventEvent)
Clear the selection rectangle. Pass in true to avoid getting a Clear the selection rectangle. Pass in true to avoid getting a
"plotunselected" event. "plotunselected" event.
- getSelection() - getSelection()
Returns the current selection in the same format as the Returns the current selection in the same format as the "plotselected"
"plotselected" event. If there's currently no selection, the event. If there's currently no selection, the function returns null.
function returns null.
*/ */
......
/* /* Flot plugin for stacking data sets rather than overlyaing them.
Flot plugin for stacking data sets, i.e. putting them on top of each
other, for accumulative graphs. Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
The plugin assumes the data is sorted on x (or y if stacking
horizontally). For line charts, it is assumed that if a line has an The plugin assumes the data is sorted on x (or y if stacking horizontally).
undefined gap (from a null point), then the line above it should have For line charts, it is assumed that if a line has an undefined gap (from a
the same gap - insert zeros instead of "null" if you want another null point), then the line above it should have the same gap - insert zeros
behaviour. This also holds for the start and end of the chart. Note instead of "null" if you want another behaviour. This also holds for the start
that stacking a mix of positive and negative values in most instances and end of the chart. Note that stacking a mix of positive and negative values
doesn't make sense (so it looks weird). in most instances doesn't make sense (so it looks weird).
Two or more series are stacked when their "stack" attribute is set to Two or more series are stacked when their "stack" attribute is set to the same
the same key (which can be any number or string or just "true"). To key (which can be any number or string or just "true"). To specify the default
specify the default stack, you can set stack, you can set the stack option like this:
series: { series: {
stack: null or true or key (number/string) stack: null or true or key (number/string)
} }
or specify it for a specific series You can also specify it for a single series, like this:
$.plot($("#placeholder"), [{ data: [ ... ], stack: true }]) $.plot( $("#placeholder"), [{
data: [ ... ],
The stacking order is determined by the order of the data series in stack: true
the array (later series end up on top of the previous). }])
Internally, the plugin modifies the datapoints in each series, adding The stacking order is determined by the order of the data series in the array
an offset to the y value. For line series, extra data points are (later series end up on top of the previous).
inserted through interpolation. If there's a second y value, it's also
adjusted (e.g for bar charts or filled areas). Internally, the plugin modifies the datapoints in each series, adding an
offset to the y value. For line series, extra data points are inserted through
interpolation. If there's a second y value, it's also adjusted (e.g for bar
charts or filled areas).
*/ */
(function ($) { (function ($) {
......
/* /* Flot plugin that adds some extra symbols for plotting points.
Flot plugin that adds some extra symbols for plotting points.
The symbols are accessed as strings through the standard symbol Copyright (c) 2007-2012 IOLA and Ole Laursen.
choice: Licensed under the MIT license.
series: { The symbols are accessed as strings through the standard symbol options:
points: {
symbol: "square" // or "diamond", "triangle", "cross" series: {
} points: {
} symbol: "square" // or "diamond", "triangle", "cross"
}
}
*/ */
......
/* /* Flot plugin for thresholding data.
Flot plugin for thresholding data. Controlled through the option
"threshold" in either the global series options Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license.
series: {
threshold: { The plugin supports these options:
below: number
color: colorspec series: {
} threshold: {
} below: number
color: colorspec
}
}
It can also be applied to a single series, like this:
$.plot( $("#placeholder"), [{
data: [ ... ],
threshold: { ... }
}])
or in a specific series An array can be passed for multiple thresholding, like this:
$.plot($("#placeholder"), [{ data: [ ... ], threshold: { ... }}]) threshold: [{
below: number1
An array can be passed for multiple thresholding color: color1
},{
below: number2
color: color2
}]
threshold: [{ These multiple threshold objects can be passed in any order since they are
below: number1 sorted by the processing function.
color: color1
},{
below: number2
color: color2
}]
These multiple threshold objects can be passed in any order since they The data points below "below" are drawn with the specified color. This makes
are sorted by the processing function. it easy to mark points below 0, e.g. for budget data.
The data points below "below" are drawn with the specified color. This Internally, the plugin works by splitting the data into two series, above and
makes it easy to mark points below 0, e.g. for budget data. below the threshold. The extra series below the threshold will have its label
cleared and the special "originSeries" attribute set to the original series.
You may need to check for this in hover events.
Internally, the plugin works by splitting the data into two series,
above and below the threshold. The extra series below the threshold
will have its label cleared and the special "originSeries" attribute
set to the original series. You may need to check for this in hover
events.
*/ */
(function ($) { (function ($) {
......
/* /* Pretty handling of time axes.
Pretty handling of time axes.
Copyright (c) 2007-2012 IOLA and Ole Laursen. Copyright (c) 2007-2012 IOLA and Ole Laursen.
Licensed under the MIT license. Licensed under the MIT license.
Set axis.mode to "time" to enable. See the section "Time series data" in API.txt Set axis.mode to "time" to enable. See the section "Time series data" in
for details. API.txt for details.
*/ */
(function($) { (function($) {
......
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