first commit
This commit is contained in:
483
public/assets/lib/flot.curvedlines/curvedLines.js
Executable file
483
public/assets/lib/flot.curvedlines/curvedLines.js
Executable file
@@ -0,0 +1,483 @@
|
||||
/* The MIT License
|
||||
|
||||
Copyright (c) 2011 by Michael Zinsmaier and nergal.dev
|
||||
Copyright (c) 2012 by Thomas Ritou
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
____________________________________________________
|
||||
|
||||
what it is:
|
||||
____________________________________________________
|
||||
|
||||
curvedLines is a plugin for flot, that tries to display lines in a smoother way.
|
||||
This is achieved through adding of more data points. The plugin is a data processor and can thus be used
|
||||
in combination with standard line / point rendering options.
|
||||
|
||||
=> 1) with large data sets you may get trouble
|
||||
=> 2) if you want to display the points too, you have to plot them as 2nd data series over the lines
|
||||
=> 3) consecutive x data points are not allowed to have the same value
|
||||
|
||||
Feel free to further improve the code
|
||||
|
||||
____________________________________________________
|
||||
|
||||
how to use it:
|
||||
____________________________________________________
|
||||
|
||||
var d1 = [[5,5],[7,3],[9,12]];
|
||||
|
||||
var options = { series: { curvedLines: { active: true }}};
|
||||
|
||||
$.plot($("#placeholder"), [{data: d1, lines: { show: true}, curvedLines: {apply: true}}], options);
|
||||
|
||||
_____________________________________________________
|
||||
|
||||
options:
|
||||
_____________________________________________________
|
||||
|
||||
active: bool true => plugin can be used
|
||||
apply: bool true => series will be drawn as curved line
|
||||
monotonicFit: bool true => uses monotone cubic interpolation (preserve monotonicity)
|
||||
tension: int defines the tension parameter of the hermite spline interpolation (no effect if monotonicFit is set)
|
||||
nrSplinePoints: int defines the number of sample points (of the spline) in between two consecutive points
|
||||
|
||||
deprecated options from flot prior to 1.0.0:
|
||||
------------------------------------------------
|
||||
legacyOverride bool true => use old default
|
||||
OR
|
||||
legacyOverride optionArray
|
||||
{
|
||||
fit: bool true => forces the max,mins of the curve to be on the datapoints
|
||||
curvePointFactor int defines how many "virtual" points are used per "real" data point to
|
||||
emulate the curvedLines (points total = real points * curvePointFactor)
|
||||
fitPointDist: int defines the x axis distance of the additional two points that are used
|
||||
} to enforce the min max condition.
|
||||
*/
|
||||
|
||||
/*
|
||||
* v0.1 initial commit
|
||||
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
|
||||
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
|
||||
* v0.3 improved saddle handling and added basic handling of Dates
|
||||
* v0.4 rewritten fill option (thomas ritou) mostly from original flot code (now fill between points rather than to graph bottom), corrected fill Opacity bug
|
||||
* v0.5 rewritten instead of implementing a own draw function CurvedLines is now based on the processDatapoints flot hook (credits go to thomas ritou).
|
||||
* This change breakes existing code however CurvedLines are now just many tiny straight lines to flot and therefore all flot lines options (like gradient fill,
|
||||
* shadow) are now supported out of the box
|
||||
* v0.6 flot 0.8 compatibility and some bug fixes
|
||||
* v0.6.x changed versioning schema
|
||||
*
|
||||
* v1.0.0 API Break marked existing implementation/options as deprecated
|
||||
* v1.1.0 added the new curved line calculations based on hermite splines
|
||||
* v1.1.1 added a rough parameter check to make sure the new options are used
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var options = {
|
||||
series : {
|
||||
curvedLines : {
|
||||
active : false,
|
||||
apply : false,
|
||||
monotonicFit : false,
|
||||
tension : 0.5,
|
||||
nrSplinePoints : 20,
|
||||
legacyOverride : undefined
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function init(plot) {
|
||||
|
||||
plot.hooks.processOptions.push(processOptions);
|
||||
|
||||
//if the plugin is active register processDatapoints method
|
||||
function processOptions(plot, options) {
|
||||
if (options.series.curvedLines.active) {
|
||||
plot.hooks.processDatapoints.unshift(processDatapoints);
|
||||
}
|
||||
}
|
||||
|
||||
//only if the plugin is active
|
||||
function processDatapoints(plot, series, datapoints) {
|
||||
var nrPoints = datapoints.points.length / datapoints.pointsize;
|
||||
var EPSILON = 0.005;
|
||||
|
||||
//detects missplaced legacy parameters (prior v1.x.x) in the options object
|
||||
//this can happen if somebody upgrades to v1.x.x without adjusting the parameters or uses old examples
|
||||
var invalidLegacyOptions = hasInvalidParameters(series.curvedLines);
|
||||
|
||||
if (!invalidLegacyOptions && series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) {
|
||||
if (series.lines.fill) {
|
||||
|
||||
var pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1);
|
||||
var pointsBottom = calculateCurvePoints(datapoints, series.curvedLines, 2);
|
||||
//flot makes sure for us that we've got a second y point if fill is true !
|
||||
|
||||
//Merge top and bottom curve
|
||||
datapoints.pointsize = 3;
|
||||
datapoints.points = [];
|
||||
var j = 0;
|
||||
var k = 0;
|
||||
var i = 0;
|
||||
var ps = 2;
|
||||
while (i < pointsTop.length || j < pointsBottom.length) {
|
||||
if (pointsTop[i] == pointsBottom[j]) {
|
||||
datapoints.points[k] = pointsTop[i];
|
||||
datapoints.points[k + 1] = pointsTop[i + 1];
|
||||
datapoints.points[k + 2] = pointsBottom[j + 1];
|
||||
j += ps;
|
||||
i += ps;
|
||||
|
||||
} else if (pointsTop[i] < pointsBottom[j]) {
|
||||
datapoints.points[k] = pointsTop[i];
|
||||
datapoints.points[k + 1] = pointsTop[i + 1];
|
||||
datapoints.points[k + 2] = k > 0 ? datapoints.points[k - 1] : null;
|
||||
i += ps;
|
||||
} else {
|
||||
datapoints.points[k] = pointsBottom[j];
|
||||
datapoints.points[k + 1] = k > 1 ? datapoints.points[k - 2] : null;
|
||||
datapoints.points[k + 2] = pointsBottom[j + 1];
|
||||
j += ps;
|
||||
}
|
||||
k += 3;
|
||||
}
|
||||
} else if (series.lines.lineWidth > 0) {
|
||||
datapoints.points = calculateCurvePoints(datapoints, series.curvedLines, 1);
|
||||
datapoints.pointsize = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calculateCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
if ( typeof curvedLinesOptions.legacyOverride != 'undefined' && curvedLinesOptions.legacyOverride != false) {
|
||||
var defaultOptions = {
|
||||
fit : false,
|
||||
curvePointFactor : 20,
|
||||
fitPointDist : undefined
|
||||
};
|
||||
var legacyOptions = jQuery.extend(defaultOptions, curvedLinesOptions.legacyOverride);
|
||||
return calculateLegacyCurvePoints(datapoints, legacyOptions, yPos);
|
||||
}
|
||||
|
||||
return calculateSplineCurvePoints(datapoints, curvedLinesOptions, yPos);
|
||||
}
|
||||
|
||||
function calculateSplineCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
|
||||
//create interpolant fuction
|
||||
var splines = createHermiteSplines(datapoints, curvedLinesOptions, yPos);
|
||||
var result = [];
|
||||
|
||||
//sample the function
|
||||
// (the result is intependent from the input data =>
|
||||
// it is ok to alter the input after this method)
|
||||
var j = 0;
|
||||
for (var i = 0; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
|
||||
var xStart = points[curX];
|
||||
var xEnd = points[curX + ps];
|
||||
var xStep = (xEnd - xStart) / Number(curvedLinesOptions.nrSplinePoints);
|
||||
|
||||
//add point
|
||||
result.push(points[curX]);
|
||||
result.push(points[curY]);
|
||||
|
||||
//add curve point
|
||||
for (var x = (xStart += xStep); x < xEnd; x += xStep) {
|
||||
result.push(x);
|
||||
result.push(splines[j](x));
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
//add last point
|
||||
result.push(points[points.length - ps]);
|
||||
result.push(points[points.length - ps + yPos]);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Creates an array of splines, one for each segment of the original curve. Algorithm based on the wikipedia articles:
|
||||
//
|
||||
// http://de.wikipedia.org/w/index.php?title=Kubisch_Hermitescher_Spline&oldid=130168003 and
|
||||
// http://en.wikipedia.org/w/index.php?title=Monotone_cubic_interpolation&oldid=622341725 and the description of Fritsch-Carlson from
|
||||
// http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation
|
||||
// for a detailed description see https://github.com/MichaelZinsmaier/CurvedLines/docu
|
||||
function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
|
||||
// preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments
|
||||
var segmentLengths = [];
|
||||
var segmentSlopes = [];
|
||||
|
||||
for (var i = 0; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
var dx = points[curX + ps] - points[curX];
|
||||
var dy = points[curY + ps] - points[curY];
|
||||
|
||||
segmentLengths.push(dx);
|
||||
segmentSlopes.push(dy / dx);
|
||||
}
|
||||
|
||||
//get the values for the desired gradients m_k for all points k
|
||||
//depending on the used method the formula is different
|
||||
var gradients = [segmentSlopes[0]];
|
||||
if (curvedLinesOptions.monotonicFit) {
|
||||
// Fritsch Carlson
|
||||
for (var i = 1; i < segmentLengths.length; i++) {
|
||||
var slope = segmentSlopes[i];
|
||||
var prev_slope = segmentSlopes[i - 1];
|
||||
if (slope * prev_slope <= 0) { // sign(prev_slope) != sign(slpe)
|
||||
gradients.push(0);
|
||||
} else {
|
||||
var length = segmentLengths[i];
|
||||
var prev_length = segmentLengths[i - 1];
|
||||
var common = length + prev_length;
|
||||
//m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)
|
||||
gradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Cardinal spline with t € [0,1]
|
||||
// Catmull-Rom for t = 0
|
||||
for (var i = ps; i < points.length - ps; i += ps) {
|
||||
var curX = i;
|
||||
var curY = i + yPos;
|
||||
gradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));
|
||||
}
|
||||
}
|
||||
gradients.push(segmentSlopes[segmentSlopes.length - 1]);
|
||||
|
||||
//get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline
|
||||
var coefs1 = [];
|
||||
var coefs2 = [];
|
||||
for (i = 0; i < segmentLengths.length; i++) {
|
||||
var m_k = gradients[i];
|
||||
var m_k_plus = gradients[i + 1];
|
||||
var slope = segmentSlopes[i];
|
||||
var invLength = 1 / segmentLengths[i];
|
||||
var common = m_k + m_k_plus - slope - slope;
|
||||
|
||||
coefs1.push(common * invLength * invLength);
|
||||
coefs2.push((slope - common - m_k) * invLength);
|
||||
}
|
||||
|
||||
//create functions with from the coefficients and capture the parameters
|
||||
var ret = [];
|
||||
for (var i = 0; i < segmentLengths.length; i ++) {
|
||||
var spline = function (x_k, coef1, coef2, coef3, coef4) {
|
||||
// spline for a segment
|
||||
return function (x) {
|
||||
var diff = x - x_k;
|
||||
var diffSq = diff * diff;
|
||||
return coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;
|
||||
};
|
||||
};
|
||||
|
||||
ret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
//no real idea whats going on here code mainly from https://code.google.com/p/flot/issues/detail?id=226
|
||||
//if fit option is selected additional datapoints get inserted before the curve calculations in nergal.dev s code.
|
||||
function calculateLegacyCurvePoints(datapoints, curvedLinesOptions, yPos) {
|
||||
|
||||
var points = datapoints.points;
|
||||
var ps = datapoints.pointsize;
|
||||
var num = Number(curvedLinesOptions.curvePointFactor) * (points.length / ps);
|
||||
|
||||
var xdata = new Array;
|
||||
var ydata = new Array;
|
||||
|
||||
var curX = -1;
|
||||
var curY = -1;
|
||||
var j = 0;
|
||||
|
||||
if (curvedLinesOptions.fit) {
|
||||
//insert a point before and after the "real" data point to force the line
|
||||
//to have a max,min at the data point.
|
||||
|
||||
var fpDist;
|
||||
if ( typeof curvedLinesOptions.fitPointDist == 'undefined') {
|
||||
//estimate it
|
||||
var minX = points[0];
|
||||
var maxX = points[points.length - ps];
|
||||
fpDist = (maxX - minX) / (500 * 100);
|
||||
//x range / (estimated pixel length of placeholder * factor)
|
||||
} else {
|
||||
//use user defined value
|
||||
fpDist = Number(curvedLinesOptions.fitPointDist);
|
||||
}
|
||||
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
|
||||
var frontX;
|
||||
var backX;
|
||||
curX = i;
|
||||
curY = i + yPos;
|
||||
|
||||
//add point X s
|
||||
frontX = points[curX] - fpDist;
|
||||
backX = points[curX] + fpDist;
|
||||
|
||||
var factor = 2;
|
||||
while (frontX == points[curX] || backX == points[curX]) {
|
||||
//inside the ulp
|
||||
frontX = points[curX] - (fpDist * factor);
|
||||
backX = points[curX] + (fpDist * factor);
|
||||
factor++;
|
||||
}
|
||||
|
||||
//add curve points
|
||||
xdata[j] = frontX;
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
|
||||
xdata[j] = points[curX];
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
|
||||
xdata[j] = backX;
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
}
|
||||
} else {
|
||||
//just use the datapoints
|
||||
for (var i = 0; i < points.length; i += ps) {
|
||||
curX = i;
|
||||
curY = i + yPos;
|
||||
|
||||
xdata[j] = points[curX];
|
||||
ydata[j] = points[curY];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
var n = xdata.length;
|
||||
|
||||
var y2 = new Array();
|
||||
var delta = new Array();
|
||||
y2[0] = 0;
|
||||
y2[n - 1] = 0;
|
||||
delta[0] = 0;
|
||||
|
||||
for (var i = 1; i < n - 1; ++i) {
|
||||
var d = (xdata[i + 1] - xdata[i - 1]);
|
||||
if (d == 0) {
|
||||
//point before current point and after current point need some space in between
|
||||
return [];
|
||||
}
|
||||
|
||||
var s = (xdata[i] - xdata[i - 1]) / d;
|
||||
var p = s * y2[i - 1] + 2;
|
||||
y2[i] = (s - 1) / p;
|
||||
delta[i] = (ydata[i + 1] - ydata[i]) / (xdata[i + 1] - xdata[i]) - (ydata[i] - ydata[i - 1]) / (xdata[i] - xdata[i - 1]);
|
||||
delta[i] = (6 * delta[i] / (xdata[i + 1] - xdata[i - 1]) - s * delta[i - 1]) / p;
|
||||
}
|
||||
|
||||
for (var j = n - 2; j >= 0; --j) {
|
||||
y2[j] = y2[j] * y2[j + 1] + delta[j];
|
||||
}
|
||||
|
||||
// xmax - xmin / #points
|
||||
var step = (xdata[n - 1] - xdata[0]) / (num - 1);
|
||||
|
||||
var xnew = new Array;
|
||||
var ynew = new Array;
|
||||
var result = new Array;
|
||||
|
||||
xnew[0] = xdata[0];
|
||||
ynew[0] = ydata[0];
|
||||
|
||||
result.push(xnew[0]);
|
||||
result.push(ynew[0]);
|
||||
|
||||
for ( j = 1; j < num; ++j) {
|
||||
//new x point (sampling point for the created curve)
|
||||
xnew[j] = xnew[0] + j * step;
|
||||
|
||||
var max = n - 1;
|
||||
var min = 0;
|
||||
|
||||
while (max - min > 1) {
|
||||
var k = Math.round((max + min) / 2);
|
||||
if (xdata[k] > xnew[j]) {
|
||||
max = k;
|
||||
} else {
|
||||
min = k;
|
||||
}
|
||||
}
|
||||
|
||||
//found point one to the left and one to the right of generated new point
|
||||
var h = (xdata[max] - xdata[min]);
|
||||
|
||||
if (h == 0) {
|
||||
//similar to above two points from original x data need some space between them
|
||||
return [];
|
||||
}
|
||||
|
||||
var a = (xdata[max] - xnew[j]) / h;
|
||||
var b = (xnew[j] - xdata[min]) / h;
|
||||
|
||||
ynew[j] = a * ydata[min] + b * ydata[max] + ((a * a * a - a) * y2[min] + (b * b * b - b) * y2[max]) * (h * h) / 6;
|
||||
|
||||
result.push(xnew[j]);
|
||||
result.push(ynew[j]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function hasInvalidParameters(curvedLinesOptions) {
|
||||
if (typeof curvedLinesOptions.fit != 'undefined' ||
|
||||
typeof curvedLinesOptions.curvePointFactor != 'undefined' ||
|
||||
typeof curvedLinesOptions.fitPointDist != 'undefined') {
|
||||
throw new Error("CurvedLines detected illegal parameters. The CurvedLines API changed with version 1.0.0 please check the options object.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}//end init
|
||||
|
||||
|
||||
$.plot.plugins.push({
|
||||
init : init,
|
||||
options : options,
|
||||
name : 'curvedLines',
|
||||
version : '1.1.1'
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
BIN
public/assets/lib/flot.curvedlines/docu/MathStuff.pdf
Executable file
BIN
public/assets/lib/flot.curvedlines/docu/MathStuff.pdf
Executable file
Binary file not shown.
105
public/assets/lib/flot.curvedlines/docu/MathStuff.tex
Executable file
105
public/assets/lib/flot.curvedlines/docu/MathStuff.tex
Executable file
@@ -0,0 +1,105 @@
|
||||
\documentclass[a4paper]{article}
|
||||
\usepackage[english]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[fleqn]{amsmath}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\section{Math stuff}
|
||||
|
||||
Cubic interpolation for one segment $[x_k, x_{k+1}]$ can be described as:
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
f(t) &= c_{oef1}t^3 + c_{oef2}t^2 + c_{oef3}t + c_{oef4} \hspace{1cm} with \\
|
||||
t(x) &= \frac{x - x_k}{x_{k+1} - x_k}
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
\hspace{1cm} and
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
c_{oef1} &= 2p_0 - 2p_1 - m_0 - m_1 \\
|
||||
c_{oef2} &= -3p_0 + 3p_1 - 2m_0 - m_1 \\
|
||||
c_{oef3} &= m_0 \\
|
||||
c_{oef4} &= p_0
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
|
||||
(see Wikipedia-Links below)\\
|
||||
\\
|
||||
If we rewrite this as function of $d = x - x_k$ we get
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
f'(d) &= c_{oef1}' d^3 + c_{oef2}' d^2 + c_{oef3}' d + c_{oef4}' \hspace{1cm} with \\
|
||||
c_{oef1}' &= \frac{c_{oef1}}{(x_{k+1} - x_k)^3} \\
|
||||
c_{oef2}' &= \frac{c_{oef2}}{(x_{k+1} - x_k)^2} \\
|
||||
c_{oef3}' &= \frac{c_{oef3}}{x_{k+1} - x_k} \\
|
||||
c_{oef4}' &= c_{oef4}
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
\\
|
||||
The implemented algorithm uses two helper variables to calculate the coefficients of $f'$ efficiently:
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
common = m_k + m_{k+1} - 2 \frac{p_{k+1} - p_k}{x_{k+1} - x_k} \\
|
||||
invLength = \frac{1}{x_{k+1} - x_k}
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
\\
|
||||
We use $p_0 = p_k$, $p_1 = p_{k+1}$, $m_0 = m_k (x_{k+1} - x_k)$, $m_1 = m_{k+1} (x_{k+1} - x_k)$ and $s = \frac{p_{k+1}-p_k}{x_{k+1}-x_k}$. The tangents are scaled with the length of the segment. \\
|
||||
\\
|
||||
If we insert this into the equations for the coefficients we get the formulas that are used in the algorithm:
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
c_{oef1}' &= \frac{c_{oef1}}{(x_{k+1} - x_k)^3} \\
|
||||
&= \frac{2p_0 - 2p_1 + m_0 + m_1}{(x_{k+1} - x_k)^3}\\
|
||||
&= (2p_k - 2p_{k+1} + m_k (x_{k+1} - x_k) + m_{k+1} (x_{k+1} - x_k) / (x_{k+1} - x_k)^3 \\
|
||||
&= \frac {(2p_k - 2p_{k+1} + m_k (x_{k+1} - x_k) + m_{k+1} (x_{k+1} - x_k)}{x_{k+1} - x_k} / (x_{k+1} - x_k)^2 \\
|
||||
&= (\frac {2p_k - 2p_{k+1}}{x_{k+1} - x_k} + m_k + m_{k+1} ) * invLength^2 \\
|
||||
&= (-2\frac {p_{k+1}- p_k}{x_{k+1} - x_k} + m_k + m_{k+1} ) * invLength^2 \\
|
||||
&= common * invLenght^2
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
c_{oef2}' &= \frac{c_{oef2}}{(x_{k+1} - x_k)^2} \\
|
||||
&= (-3p_0 + 3p_1 - 2m_0 - m_1) / (x_{k+1} - x_k)^2 \\
|
||||
&= (-3p_k + 3p_{k+1} - 2* m_k (x_{k+1} - x_k) - m_{k+1} (x_{k+1} - x_k)) / (x_{k+1} - x_k)^2 \\
|
||||
&= (\frac{-3p_k + 3p_{k+1}}{x_{k+1} - x_k} - 2m_k - m_{k+1}) * invLenght \\
|
||||
&= (3\frac{p_{k+1} - p_k}{x_{k+1} - x_k} - 2m_k - m_{k+1}) * invLenght \\
|
||||
&=(\frac{p_{k+1} - p_k}{x_{k+1} - x_k} + 2\frac{p_{k+1} - p_k}{x_{k+1} - x_k} - m_k - m_{k+1} - m_k) * invLenght \\
|
||||
&= (s - common - m_k) * invLenght
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
c_{oef3}' &= \frac{c_{oef3}}{x_{k+1} - x_k} \\
|
||||
&= \frac{m_0}{x_{k+1} - x_k} \\
|
||||
&= \frac{m_k (x_{k+1} - x_k)}{x_{k+1} - x_k} \\
|
||||
&= m_k
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
\begin{equation*}
|
||||
\begin{aligned}
|
||||
c_{oef4}' &= c_{oef4} = p_0 = p_k
|
||||
\end{aligned}
|
||||
\end{equation*}
|
||||
|
||||
\section{Useful Links}
|
||||
|
||||
\url{http://de.wikipedia.org/w/index.php?title=Kubisch_Hermitescher_Spline&oldid=130168003)}\\
|
||||
\url{http://en.wikipedia.org/w/index.php?title=Monotone_cubic_interpolation&oldid=622341725}\\
|
||||
\url{http://math.stackexchange.com/questions/45218/implementation-of-monotone-cubic-interpolation}\\
|
||||
\url{http://math.stackexchange.com/questions/4082/equation-of-a-curve-given-3-points-and-additional-constant-requirements#4104}
|
||||
|
||||
\end{document}
|
||||
70
public/assets/lib/flot.curvedlines/exampleCustomizing.txt
Executable file
70
public/assets/lib/flot.curvedlines/exampleCustomizing.txt
Executable file
@@ -0,0 +1,70 @@
|
||||
### html ###
|
||||
|
||||
<h4>CurvedLines: customizing and mixing</h4>
|
||||
|
||||
<div class="text-block"> <span id="hoverText">point at: - / -</span>
|
||||
|
||||
</div>
|
||||
<div id="flotContainer" class="chart-style"></div>
|
||||
<div class="text-block">The example shows two datasets (d1, d2) plotted using different styles (curved line, points, bigger points). The points are hoverable, the curved line is not.</div>
|
||||
<div class="text-block">To achieve such mixed plots you have to define some settings on a per series level. In the example the curved line plugin is generally set to active (as default in the options object) but will be applied only to the first series. Similarly hovering is deactivated for the first series. The combination of "replotting" (series 1 and 2 both origin form dataset d1) and per series settings allows you to mix different plotting styles and settings in one canvas.</div>
|
||||
|
||||
### css ###
|
||||
|
||||
.chart-style {
|
||||
width: 600px;
|
||||
height: 340px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.text-block {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
### javascript ###
|
||||
|
||||
//some random data
|
||||
var d1 = []; var last = 0;
|
||||
for (var i = 0; i <= 40; i += (2 + parseInt(Math.random() * 5))) {
|
||||
last = last + ((Math.random() * 3) - 1.5)
|
||||
d1.push([i, parseInt(last)]);
|
||||
}
|
||||
|
||||
var d2 = [];
|
||||
for (var i = 2; i <= $(d1).get(-1)[0]; i += (2 + parseInt(Math.random() * 5))) {
|
||||
d2.push([i, parseInt(Math.random() * 8)]);
|
||||
}
|
||||
|
||||
|
||||
//default flot options
|
||||
var options = {
|
||||
series: { curvedLines: { active: true } },
|
||||
grid: { hoverable: true } // <- generally activate hover
|
||||
};
|
||||
|
||||
|
||||
//plotting with per series adjustments
|
||||
$.plot($("#flotContainer"), [
|
||||
{ //series 1
|
||||
data: d1,
|
||||
lines: { show: true, lineWidth: 3 },
|
||||
hoverable: false, // <- overwrite hoverable with false
|
||||
curvedLines: {
|
||||
apply: true // <- set apply <- curve only this data series
|
||||
}
|
||||
}, { //series 2
|
||||
data: d1,
|
||||
points: { show: true }
|
||||
}, { //series 3
|
||||
data: d2,
|
||||
points: { show: true, radius: 5 }
|
||||
}], options);
|
||||
|
||||
|
||||
//adding hover text
|
||||
$("#flotContainer").bind("plothover", function (event, pos, item) {
|
||||
if (item) {
|
||||
$("#hoverText").text("point at: " + pos.x.toFixed(2) + " / " + pos.y.toFixed(2))
|
||||
} else {
|
||||
$("#hoverText").text("point at: - / -")
|
||||
}
|
||||
});
|
||||
49
public/assets/lib/flot.curvedlines/exampleFillMultiAxis.txt
Executable file
49
public/assets/lib/flot.curvedlines/exampleFillMultiAxis.txt
Executable file
@@ -0,0 +1,49 @@
|
||||
### html ###
|
||||
|
||||
<h4>CurvedLines with multi axis and fill</h4>
|
||||
<div id="flotContainer" class="chart-style"></div>
|
||||
|
||||
### css ###
|
||||
|
||||
.chart-style {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
### javascript ###
|
||||
|
||||
//data
|
||||
var d1 = [[20,20], [42,60], [54, 20], [80,80]];
|
||||
var d2 = [[20,700], [80,300]];
|
||||
|
||||
//flot options
|
||||
var options = {
|
||||
series: {
|
||||
curvedLines: {active: true}
|
||||
},
|
||||
yaxes: [{ min:10, max: 90}, {position: 'right'}]
|
||||
};
|
||||
|
||||
//plotting
|
||||
$.plot($("#flotContainer"),[
|
||||
{
|
||||
data: d1,
|
||||
lines: { show: true, fill: true, fillColor: "#C3C3C3", lineWidth: 3},
|
||||
//curve the line (old pre 1.0.0 plotting function)
|
||||
curvedLines: {
|
||||
apply: true,
|
||||
legacyOverride: true // <- use legacy plotting function
|
||||
}
|
||||
}, {
|
||||
data: d1,
|
||||
points: { show: true }
|
||||
}, {
|
||||
data: d2,
|
||||
yaxis: 2,
|
||||
lines: { show: true, lineWidth: 3},
|
||||
}, {
|
||||
data: d2,
|
||||
yaxis: 2,
|
||||
points: { show: true }
|
||||
}
|
||||
], options);
|
||||
50
public/assets/lib/flot.curvedlines/exampleFit.txt
Executable file
50
public/assets/lib/flot.curvedlines/exampleFit.txt
Executable file
@@ -0,0 +1,50 @@
|
||||
### html ###
|
||||
|
||||
<h4>CurvedLines: with standard settings (shows effects of tension parameter)</h4>
|
||||
<div id="flotContainer" class="chart-style"></div>
|
||||
|
||||
<h4>CurvedLines: with monotonicFit (no overshooting/wiggles) </h4>
|
||||
<div id="flotContainer2" class="chart-style"></div>
|
||||
|
||||
### css ###
|
||||
|
||||
.chart-style {
|
||||
width: 400px;
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
### javascript ###
|
||||
//data
|
||||
var d1 = [[20, 20], [25, 50], [27.5, 35], [30, 20], [35, 20]];
|
||||
|
||||
//flot options
|
||||
var options = {
|
||||
series: {
|
||||
curvedLines: {active: true}
|
||||
}
|
||||
};
|
||||
|
||||
//plotting
|
||||
$.plot($("#flotContainer"),[
|
||||
{
|
||||
data: d1, color: '#2b8cbe',
|
||||
lines: {show: true, lineWidth: 3},
|
||||
//choose tension from [0,1] to see overshooting effects (0.5 is default)
|
||||
curvedLines: {apply: true, tension: 1}
|
||||
}, {
|
||||
data: d1, color: '#f03b20',
|
||||
points: {show: true}
|
||||
}
|
||||
], options);
|
||||
|
||||
$.plot($("#flotContainer2"),[
|
||||
{
|
||||
data: d1, color: '#2b8cbe',
|
||||
lines: {show: true, lineWidth: 3},
|
||||
//monotonicFit enforces monotonicity
|
||||
curvedLines: {apply: true, monotonicFit: true}
|
||||
}, {
|
||||
data: d1, color: '#f03b20',
|
||||
points: {show: true}
|
||||
}
|
||||
], options);
|
||||
53
public/assets/lib/flot.curvedlines/exampleHelperPoints.txt
Executable file
53
public/assets/lib/flot.curvedlines/exampleHelperPoints.txt
Executable file
@@ -0,0 +1,53 @@
|
||||
### html ###
|
||||
|
||||
<h4>CurvedLines: random data points </h4>
|
||||
<div id="flotContainer" class="chart-style"></div>
|
||||
|
||||
<h4>CurvedLines: internally created helper points</h4>
|
||||
<div id="flotContainer2" class="chart-style"></div>
|
||||
|
||||
### css ###
|
||||
|
||||
.chart-style {
|
||||
width: 600px;
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
### javascript ###
|
||||
|
||||
//random data
|
||||
var d1 = []; var last = 0;
|
||||
for (var i = 0; i <= 40; i += (2 + parseInt(Math.random() * 5))) {
|
||||
last = last + ((Math.random() * 3) - 1.5)
|
||||
d1.push([i, parseInt(last)]);
|
||||
}
|
||||
|
||||
//flot options
|
||||
var options = {
|
||||
series: {
|
||||
curvedLines: {
|
||||
active: true,
|
||||
nrSplinePoints: 20 // <- control nr of helper points
|
||||
} // between two poins
|
||||
}
|
||||
};
|
||||
//plotting
|
||||
$.plot($("#flotContainer"),[
|
||||
{ //curved line
|
||||
data: d1,
|
||||
lines: {show: true, lineWidth: 3},
|
||||
curvedLines: {apply: true } // <- curve line
|
||||
}, { //original data points
|
||||
data: d1,
|
||||
points: {show: true}
|
||||
}
|
||||
], options);
|
||||
|
||||
$.plot($("#flotContainer2"),[
|
||||
{ // <- helper points that are used to curve the lines
|
||||
data: d1,
|
||||
color: '#CC0000',
|
||||
points: {show: true},
|
||||
curvedLines: {apply: true} //<- "curve" points
|
||||
}
|
||||
], options);
|
||||
53
public/assets/lib/flot.curvedlines/exampleStackedData.txt
Executable file
53
public/assets/lib/flot.curvedlines/exampleStackedData.txt
Executable file
@@ -0,0 +1,53 @@
|
||||
### html ###
|
||||
|
||||
<h4>CurvedLines: random stacked data</h4>
|
||||
<div id="flotContainer" class="chart-style"></div>
|
||||
|
||||
<h4>CurvedLines: same data connected with curved lines</h4>
|
||||
<div id="flotContainer2" class="chart-style"></div>
|
||||
|
||||
### css ###
|
||||
|
||||
.chart-style {
|
||||
width: 600px;
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
### javascript ###
|
||||
|
||||
//random data
|
||||
var d1 = [];
|
||||
for (var i = 0; i <= 10; i += 1) {
|
||||
d1.push([i, parseInt(Math.random() * 30)]);
|
||||
}
|
||||
var d2 = [];
|
||||
for (var i = 0; i <= 10; i += 1) {
|
||||
d2.push([i, parseInt(Math.random() * 30)]);
|
||||
}
|
||||
var d3 = [];
|
||||
for (var i = 0; i <= 10; i += 1) {
|
||||
d3.push([i, parseInt(Math.random() * 30)]);
|
||||
}
|
||||
|
||||
//flot options
|
||||
var options = {
|
||||
series: {
|
||||
curvedLines: {
|
||||
apply: true,
|
||||
active: true,
|
||||
monotonicFit: true
|
||||
}
|
||||
}
|
||||
};
|
||||
//plotting
|
||||
$.plot($("#flotContainer"), [
|
||||
{data: d1, lines: { show: true, fill: true }, stack: true },
|
||||
{data: d2, lines: { show: true, fill: true }, stack: true },
|
||||
{data: d3, lines: { show: true, fill: true }, stack: true }
|
||||
], {});
|
||||
|
||||
$.plot($("#flotContainer2"), [
|
||||
{data: d1, lines: { show: true, fill: true }, stack: true },
|
||||
{data: d2, lines: { show: true, fill: true }, stack: true },
|
||||
{data: d3, lines: { show: true, fill: true }, stack: true }
|
||||
], options);
|
||||
1
public/assets/lib/flot.curvedlines/flot/excanvas.min.js
vendored
Executable file
1
public/assets/lib/flot.curvedlines/flot/excanvas.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
1
public/assets/lib/flot.curvedlines/flot/jquery.colorhelpers.min.js
vendored
Executable file
1
public/assets/lib/flot.curvedlines/flot/jquery.colorhelpers.min.js
vendored
Executable file
@@ -0,0 +1 @@
|
||||
(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i<c.length;++i)o[c.charAt(i)]+=d;return o.normalize()};o.scale=function(c,f){for(var i=0;i<c.length;++i)o[c.charAt(i)]*=f;return o.normalize()};o.toString=function(){if(o.a>=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return value<min?min:value>max?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.canvas.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.canvas.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={canvas:true};var render,getTextInfo,addText;var hasOwnProperty=Object.prototype.hasOwnProperty;function init(plot,classes){var Canvas=classes.Canvas;if(render==null){getTextInfo=Canvas.prototype.getTextInfo,addText=Canvas.prototype.addText,render=Canvas.prototype.render}Canvas.prototype.render=function(){if(!plot.getOptions().canvas){return render.call(this)}var context=this.context,cache=this._textCache;context.save();context.textBaseline="middle";for(var layerKey in cache){if(hasOwnProperty.call(cache,layerKey)){var layerCache=cache[layerKey];for(var styleKey in layerCache){if(hasOwnProperty.call(layerCache,styleKey)){var styleCache=layerCache[styleKey],updateStyles=true;for(var key in styleCache){if(hasOwnProperty.call(styleCache,key)){var info=styleCache[key],positions=info.positions,lines=info.lines;if(updateStyles){context.fillStyle=info.font.color;context.font=info.font.definition;updateStyles=false}for(var i=0,position;position=positions[i];i++){if(position.active){for(var j=0,line;line=position.lines[j];j++){context.fillText(lines[j].text,line[0],line[1])}}else{positions.splice(i--,1)}}if(positions.length==0){delete styleCache[key]}}}}}}}context.restore()};Canvas.prototype.getTextInfo=function(layer,text,font,angle,width){if(!plot.getOptions().canvas){return getTextInfo.call(this,layer,text,font,angle,width)}var textStyle,layerCache,styleCache,info;text=""+text;if(typeof font==="object"){textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px "+font.family}else{textStyle=font}layerCache=this._textCache[layer];if(layerCache==null){layerCache=this._textCache[layer]={}}styleCache=layerCache[textStyle];if(styleCache==null){styleCache=layerCache[textStyle]={}}info=styleCache[text];if(info==null){var context=this.context;if(typeof font!=="object"){var element=$("<div> </div>").css("position","absolute").addClass(typeof font==="string"?font:null).appendTo(this.getTextLayer(layer));font={lineHeight:element.height(),style:element.css("font-style"),variant:element.css("font-variant"),weight:element.css("font-weight"),family:element.css("font-family"),color:element.css("color")};font.size=element.css("line-height",1).height();element.remove()}textStyle=font.style+" "+font.variant+" "+font.weight+" "+font.size+"px "+font.family;info=styleCache[text]={width:0,height:0,positions:[],lines:[],font:{definition:textStyle,color:font.color}};context.save();context.font=textStyle;var lines=(text+"").replace(/<br ?\/?>|\r\n|\r/g,"\n").split("\n");for(var i=0;i<lines.length;++i){var lineText=lines[i],measured=context.measureText(lineText);info.width=Math.max(measured.width,info.width);info.height+=font.lineHeight;info.lines.push({text:lineText,width:measured.width,height:font.lineHeight})}context.restore()}return info};Canvas.prototype.addText=function(layer,x,y,text,font,angle,width,halign,valign){if(!plot.getOptions().canvas){return addText.call(this,layer,x,y,text,font,angle,width,halign,valign)}var info=this.getTextInfo(layer,text,font,angle,width),positions=info.positions,lines=info.lines;y+=info.height/lines.length/2;if(valign=="middle"){y=Math.round(y-info.height/2)}else if(valign=="bottom"){y=Math.round(y-info.height)}else{y=Math.round(y)}if(!!(window.opera&&window.opera.version().split(".")[0]<12)){y-=2}for(var i=0,position;position=positions[i];i++){if(position.x==x&&position.y==y){position.active=true;return}}position={active:true,lines:[],x:x,y:y};positions.push(position);for(var i=0,line;line=lines[i];i++){if(halign=="center"){position.lines.push([Math.round(x-line.width/2),y])}else if(halign=="right"){position.lines.push([Math.round(x-line.width),y])}else{position.lines.push([Math.round(x),y])}y+=line.height}}}$.plot.plugins.push({init:init,options:options,name:"canvas",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.categories.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.categories.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={xaxis:{categories:null},yaxis:{categories:null}};function processRawData(plot,series,data,datapoints){var xCategories=series.xaxis.options.mode=="categories",yCategories=series.yaxis.options.mode=="categories";if(!(xCategories||yCategories))return;var format=datapoints.format;if(!format){var s=series;format=[];format.push({x:true,number:true,required:true});format.push({y:true,number:true,required:true});if(s.bars.show||s.lines.show&&s.lines.fill){var autoscale=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);format.push({y:true,number:true,required:false,defaultValue:0,autoscale:autoscale});if(s.bars.horizontal){delete format[format.length-1].y;format[format.length-1].x=true}}datapoints.format=format}for(var m=0;m<format.length;++m){if(format[m].x&&xCategories)format[m].number=false;if(format[m].y&&yCategories)format[m].number=false}}function getNextIndex(categories){var index=-1;for(var v in categories)if(categories[v]>index)index=categories[v];return index+1}function categoriesTickGenerator(axis){var res=[];for(var label in axis.categories){var v=axis.categories[label];if(v>=axis.min&&v<=axis.max)res.push([v,label])}res.sort(function(a,b){return a[0]-b[0]});return res}function setupCategoriesForAxis(series,axis,datapoints){if(series[axis].options.mode!="categories")return;if(!series[axis].categories){var c={},o=series[axis].options.categories||{};if($.isArray(o)){for(var i=0;i<o.length;++i)c[o[i]]=i}else{for(var v in o)c[v]=o[v]}series[axis].categories=c}if(!series[axis].options.ticks)series[axis].options.ticks=categoriesTickGenerator;transformPointsOnAxis(datapoints,axis,series[axis].categories)}function transformPointsOnAxis(datapoints,axis,categories){var points=datapoints.points,ps=datapoints.pointsize,format=datapoints.format,formatColumn=axis.charAt(0),index=getNextIndex(categories);for(var i=0;i<points.length;i+=ps){if(points[i]==null)continue;for(var m=0;m<ps;++m){var val=points[i+m];if(val==null||!format[m][formatColumn])continue;if(!(val in categories)){categories[val]=index;++index}points[i+m]=categories[val]}}}function processDatapoints(plot,series,datapoints){setupCategoriesForAxis(series,"xaxis",datapoints);setupCategoriesForAxis(series,"yaxis",datapoints)}function init(plot){plot.hooks.processRawData.push(processRawData);plot.hooks.processDatapoints.push(processDatapoints)}$.plot.plugins.push({init:init,options:options,name:"categories",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.crosshair.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.crosshair.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={crosshair:{mode:null,color:"rgba(170, 0, 0, 0.80)",lineWidth:1}};function init(plot){var crosshair={x:-1,y:-1,locked:false};plot.setCrosshair=function setCrosshair(pos){if(!pos)crosshair.x=-1;else{var o=plot.p2c(pos);crosshair.x=Math.max(0,Math.min(o.left,plot.width()));crosshair.y=Math.max(0,Math.min(o.top,plot.height()))}plot.triggerRedrawOverlay()};plot.clearCrosshair=plot.setCrosshair;plot.lockCrosshair=function lockCrosshair(pos){if(pos)plot.setCrosshair(pos);crosshair.locked=true};plot.unlockCrosshair=function unlockCrosshair(){crosshair.locked=false};function onMouseOut(e){if(crosshair.locked)return;if(crosshair.x!=-1){crosshair.x=-1;plot.triggerRedrawOverlay()}}function onMouseMove(e){if(crosshair.locked)return;if(plot.getSelection&&plot.getSelection()){crosshair.x=-1;return}var offset=plot.offset();crosshair.x=Math.max(0,Math.min(e.pageX-offset.left,plot.width()));crosshair.y=Math.max(0,Math.min(e.pageY-offset.top,plot.height()));plot.triggerRedrawOverlay()}plot.hooks.bindEvents.push(function(plot,eventHolder){if(!plot.getOptions().crosshair.mode)return;eventHolder.mouseout(onMouseOut);eventHolder.mousemove(onMouseMove)});plot.hooks.drawOverlay.push(function(plot,ctx){var c=plot.getOptions().crosshair;if(!c.mode)return;var plotOffset=plot.getPlotOffset();ctx.save();ctx.translate(plotOffset.left,plotOffset.top);if(crosshair.x!=-1){var adj=plot.getOptions().crosshair.lineWidth%2?.5:0;ctx.strokeStyle=c.color;ctx.lineWidth=c.lineWidth;ctx.lineJoin="round";ctx.beginPath();if(c.mode.indexOf("x")!=-1){var drawX=Math.floor(crosshair.x)+adj;ctx.moveTo(drawX,0);ctx.lineTo(drawX,plot.height())}if(c.mode.indexOf("y")!=-1){var drawY=Math.floor(crosshair.y)+adj;ctx.moveTo(0,drawY);ctx.lineTo(plot.width(),drawY)}ctx.stroke()}ctx.restore()});plot.hooks.shutdown.push(function(plot,eventHolder){eventHolder.unbind("mouseout",onMouseOut);eventHolder.unbind("mousemove",onMouseMove)})}$.plot.plugins.push({init:init,options:options,name:"crosshair",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.errorbars.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.errorbars.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.fillbetween.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.fillbetween.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={series:{fillBetween:null}};function init(plot){function findBottomSeries(s,allseries){var i;for(i=0;i<allseries.length;++i){if(allseries[i].id===s.fillBetween){return allseries[i]}}if(typeof s.fillBetween==="number"){if(s.fillBetween<0||s.fillBetween>=allseries.length){return null}return allseries[s.fillBetween]}return null}function computeFillBottoms(plot,s,datapoints){if(s.fillBetween==null){return}var other=findBottomSeries(s,plot.getData());if(!other){return}var ps=datapoints.pointsize,points=datapoints.points,otherps=other.datapoints.pointsize,otherpoints=other.datapoints.points,newpoints=[],px,py,intery,qx,qy,bottom,withlines=s.lines.show,withbottom=ps>2&&datapoints.format[2].y,withsteps=withlines&&s.lines.steps,fromgap=true,i=0,j=0,l,m;while(true){if(i>=points.length){break}l=newpoints.length;if(points[i]==null){for(m=0;m<ps;++m){newpoints.push(points[i+m])}i+=ps}else if(j>=otherpoints.length){if(!withlines){for(m=0;m<ps;++m){newpoints.push(points[i+m])}}i+=ps}else if(otherpoints[j]==null){for(m=0;m<ps;++m){newpoints.push(null)}fromgap=true;j+=otherps}else{px=points[i];py=points[i+1];qx=otherpoints[j];qy=otherpoints[j+1];bottom=0;if(px===qx){for(m=0;m<ps;++m){newpoints.push(points[i+m])}bottom=qy;i+=ps;j+=otherps}else if(px>qx){if(withlines&&i>0&&points[i-ps]!=null){intery=py+(points[i-ps+1]-py)*(qx-px)/(points[i-ps]-px);newpoints.push(qx);newpoints.push(intery);for(m=2;m<ps;++m){newpoints.push(points[i+m])}bottom=qy}j+=otherps}else{if(fromgap&&withlines){i+=ps;continue}for(m=0;m<ps;++m){newpoints.push(points[i+m])}if(withlines&&j>0&&otherpoints[j-otherps]!=null){bottom=qy+(otherpoints[j-otherps+1]-qy)*(px-qx)/(otherpoints[j-otherps]-qx)}i+=ps}fromgap=false;if(l!==newpoints.length&&withbottom){newpoints[l+2]=bottom}}if(withsteps&&l!==newpoints.length&&l>0&&newpoints[l]!==null&&newpoints[l]!==newpoints[l-ps]&&newpoints[l+1]!==newpoints[l-ps+1]){for(m=0;m<ps;++m){newpoints[l+ps+m]=newpoints[l+m]}newpoints[l+1]=newpoints[l-ps+1]}}datapoints.points=newpoints}plot.hooks.processDatapoints.push(computeFillBottoms)}$.plot.plugins.push({init:init,options:options,name:"fillbetween",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.image.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.image.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={series:{images:{show:false,alpha:1,anchor:"corner"}}};$.plot.image={};$.plot.image.loadDataImages=function(series,options,callback){var urls=[],points=[];var defaultShow=options.series.images.show;$.each(series,function(i,s){if(!(defaultShow||s.images.show))return;if(s.data)s=s.data;$.each(s,function(i,p){if(typeof p[0]=="string"){urls.push(p[0]);points.push(p)}})});$.plot.image.load(urls,function(loadedImages){$.each(points,function(i,p){var url=p[0];if(loadedImages[url])p[0]=loadedImages[url]});callback()})};$.plot.image.load=function(urls,callback){var missing=urls.length,loaded={};if(missing==0)callback({});$.each(urls,function(i,url){var handler=function(){--missing;loaded[url]=this;if(missing==0)callback(loaded)};$("<img />").load(handler).error(handler).attr("src",url)})};function drawSeries(plot,ctx,series){var plotOffset=plot.getPlotOffset();if(!series.images||!series.images.show)return;var points=series.datapoints.points,ps=series.datapoints.pointsize;for(var i=0;i<points.length;i+=ps){var img=points[i],x1=points[i+1],y1=points[i+2],x2=points[i+3],y2=points[i+4],xaxis=series.xaxis,yaxis=series.yaxis,tmp;if(!img||img.width<=0||img.height<=0)continue;if(x1>x2){tmp=x2;x2=x1;x1=tmp}if(y1>y2){tmp=y2;y2=y1;y1=tmp}if(series.images.anchor=="center"){tmp=.5*(x2-x1)/(img.width-1);x1-=tmp;x2+=tmp;tmp=.5*(y2-y1)/(img.height-1);y1-=tmp;y2+=tmp}if(x1==x2||y1==y2||x1>=xaxis.max||x2<=xaxis.min||y1>=yaxis.max||y2<=yaxis.min)continue;var sx1=0,sy1=0,sx2=img.width,sy2=img.height;if(x1<xaxis.min){sx1+=(sx2-sx1)*(xaxis.min-x1)/(x2-x1);x1=xaxis.min}if(x2>xaxis.max){sx2+=(sx2-sx1)*(xaxis.max-x2)/(x2-x1);x2=xaxis.max}if(y1<yaxis.min){sy2+=(sy1-sy2)*(yaxis.min-y1)/(y2-y1);y1=yaxis.min}if(y2>yaxis.max){sy1+=(sy1-sy2)*(yaxis.max-y2)/(y2-y1);y2=yaxis.max}x1=xaxis.p2c(x1);x2=xaxis.p2c(x2);y1=yaxis.p2c(y1);y2=yaxis.p2c(y2);if(x1>x2){tmp=x2;x2=x1;x1=tmp}if(y1>y2){tmp=y2;y2=y1;y1=tmp}tmp=ctx.globalAlpha;ctx.globalAlpha*=series.images.alpha;ctx.drawImage(img,sx1,sy1,sx2-sx1,sy2-sy1,x1+plotOffset.left,y1+plotOffset.top,x2-x1,y2-y1);ctx.globalAlpha=tmp}}function processRawData(plot,series,data,datapoints){if(!series.images.show)return;datapoints.format=[{required:true},{x:true,number:true,required:true},{y:true,number:true,required:true},{x:true,number:true,required:true},{y:true,number:true,required:true}]}function init(plot){plot.hooks.processRawData.push(processRawData);plot.hooks.drawSeries.push(drawSeries)}$.plot.plugins.push({init:init,options:options,name:"image",version:"1.1"})})(jQuery);
|
||||
8
public/assets/lib/flot.curvedlines/flot/jquery.flot.min.js
vendored
Executable file
8
public/assets/lib/flot.curvedlines/flot/jquery.flot.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.navigate.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.navigate.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.pie.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.pie.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.resize.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.resize.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($,e,t){"$:nomunge";var i=[],n=$.resize=$.extend($.resize,{}),a,r=false,s="setTimeout",u="resize",m=u+"-special-event",o="pendingDelay",l="activeDelay",f="throttleWindow";n[o]=200;n[l]=20;n[f]=true;$.event.special[u]={setup:function(){if(!n[f]&&this[s]){return false}var e=$(this);i.push(this);e.data(m,{w:e.width(),h:e.height()});if(i.length===1){a=t;h()}},teardown:function(){if(!n[f]&&this[s]){return false}var e=$(this);for(var t=i.length-1;t>=0;t--){if(i[t]==this){i.splice(t,1);break}}e.removeData(m);if(!i.length){if(r){cancelAnimationFrame(a)}else{clearTimeout(a)}a=null}},add:function(e){if(!n[f]&&this[s]){return false}var i;function a(e,n,a){var r=$(this),s=r.data(m)||{};s.w=n!==t?n:r.width();s.h=a!==t?a:r.height();i.apply(this,arguments)}if($.isFunction(e)){i=e;return a}else{i=e.handler;e.handler=a}}};function h(t){if(r===true){r=t||1}for(var s=i.length-1;s>=0;s--){var l=$(i[s]);if(l[0]==e||l.is(":visible")){var f=l.width(),c=l.height(),d=l.data(m);if(d&&(f!==d.w||c!==d.h)){l.trigger(u,[d.w=f,d.h=c]);r=t||true}}else{d=l.data(m);d.w=0;d.h=0}}if(a!==null){if(r&&(t==null||t-r<1e3)){a=e.requestAnimationFrame(h)}else{a=setTimeout(h,n[o]);r=false}}}if(!e.requestAnimationFrame){e.requestAnimationFrame=function(){return e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},n[l])}}()}if(!e.cancelAnimationFrame){e.cancelAnimationFrame=function(){return e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout}()}})(jQuery,this);(function($){var options={};function init(plot){function onResize(){var placeholder=plot.getPlaceholder();if(placeholder.width()==0||placeholder.height()==0)return;plot.resize();plot.setupGrid();plot.draw()}function bindEvents(plot,eventHolder){plot.getPlaceholder().resize(onResize)}function shutdown(plot,eventHolder){plot.getPlaceholder().unbind("resize",onResize)}plot.hooks.bindEvents.push(bindEvents);plot.hooks.shutdown.push(shutdown)}$.plot.plugins.push({init:init,options:options,name:"resize",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.selection.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.selection.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.stack.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.stack.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={series:{stack:null}};function init(plot){function findMatchingSeries(s,allseries){var res=null;for(var i=0;i<allseries.length;++i){if(s==allseries[i])break;if(allseries[i].stack==s.stack)res=allseries[i]}return res}function stackData(plot,s,datapoints){if(s.stack==null||s.stack===false)return;var other=findMatchingSeries(s,plot.getData());if(!other)return;var ps=datapoints.pointsize,points=datapoints.points,otherps=other.datapoints.pointsize,otherpoints=other.datapoints.points,newpoints=[],px,py,intery,qx,qy,bottom,withlines=s.lines.show,horizontal=s.bars.horizontal,withbottom=ps>2&&(horizontal?datapoints.format[2].x:datapoints.format[2].y),withsteps=withlines&&s.lines.steps,fromgap=true,keyOffset=horizontal?1:0,accumulateOffset=horizontal?0:1,i=0,j=0,l,m;while(true){if(i>=points.length)break;l=newpoints.length;if(points[i]==null){for(m=0;m<ps;++m)newpoints.push(points[i+m]);i+=ps}else if(j>=otherpoints.length){if(!withlines){for(m=0;m<ps;++m)newpoints.push(points[i+m])}i+=ps}else if(otherpoints[j]==null){for(m=0;m<ps;++m)newpoints.push(null);fromgap=true;j+=otherps}else{px=points[i+keyOffset];py=points[i+accumulateOffset];qx=otherpoints[j+keyOffset];qy=otherpoints[j+accumulateOffset];bottom=0;if(px==qx){for(m=0;m<ps;++m)newpoints.push(points[i+m]);newpoints[l+accumulateOffset]+=qy;bottom=qy;i+=ps;j+=otherps}else if(px>qx){if(withlines&&i>0&&points[i-ps]!=null){intery=py+(points[i-ps+accumulateOffset]-py)*(qx-px)/(points[i-ps+keyOffset]-px);newpoints.push(qx);newpoints.push(intery+qy);for(m=2;m<ps;++m)newpoints.push(points[i+m]);bottom=qy}j+=otherps}else{if(fromgap&&withlines){i+=ps;continue}for(m=0;m<ps;++m)newpoints.push(points[i+m]);if(withlines&&j>0&&otherpoints[j-otherps]!=null)bottom=qy+(otherpoints[j-otherps+accumulateOffset]-qy)*(px-qx)/(otherpoints[j-otherps+keyOffset]-qx);newpoints[l+accumulateOffset]+=bottom;i+=ps}fromgap=false;if(l!=newpoints.length&&withbottom)newpoints[l+2]+=bottom}if(withsteps&&l!=newpoints.length&&l>0&&newpoints[l]!=null&&newpoints[l]!=newpoints[l-ps]&&newpoints[l+1]!=newpoints[l-ps+1]){for(m=0;m<ps;++m)newpoints[l+ps+m]=newpoints[l+m];newpoints[l+1]=newpoints[l-ps+1]}}datapoints.points=newpoints}plot.hooks.processDatapoints.push(stackData)}$.plot.plugins.push({init:init,options:options,name:"stack",version:"1.2"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.symbol.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.symbol.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){function processRawData(plot,series,datapoints){var handlers={square:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI)/2;ctx.rect(x-size,y-size,size+size,size+size)},diamond:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI/2);ctx.moveTo(x-size,y);ctx.lineTo(x,y-size);ctx.lineTo(x+size,y);ctx.lineTo(x,y+size);ctx.lineTo(x-size,y)},triangle:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3));var height=size*Math.sin(Math.PI/3);ctx.moveTo(x-size/2,y+height/2);ctx.lineTo(x+size/2,y+height/2);if(!shadow){ctx.lineTo(x,y-height/2);ctx.lineTo(x-size/2,y+height/2)}},cross:function(ctx,x,y,radius,shadow){var size=radius*Math.sqrt(Math.PI)/2;ctx.moveTo(x-size,y-size);ctx.lineTo(x+size,y+size);ctx.moveTo(x-size,y+size);ctx.lineTo(x+size,y-size)}};var s=series.points.symbol;if(handlers[s])series.points.symbol=handlers[s]}function init(plot){plot.hooks.processDatapoints.push(processRawData)}$.plot.plugins.push({init:init,name:"symbols",version:"1.0"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.threshold.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.threshold.min.js
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
/* Javascript plotting library for jQuery, version 0.8.3.
|
||||
|
||||
Copyright (c) 2007-2014 IOLA and Ole Laursen.
|
||||
Licensed under the MIT license.
|
||||
|
||||
*/
|
||||
(function($){var options={series:{threshold:null}};function init(plot){function thresholdData(plot,s,datapoints,below,color){var ps=datapoints.pointsize,i,x,y,p,prevp,thresholded=$.extend({},s);thresholded.datapoints={points:[],pointsize:ps,format:datapoints.format};thresholded.label=null;thresholded.color=color;thresholded.threshold=null;thresholded.originSeries=s;thresholded.data=[];var origpoints=datapoints.points,addCrossingPoints=s.lines.show;var threspoints=[];var newpoints=[];var m;for(i=0;i<origpoints.length;i+=ps){x=origpoints[i];y=origpoints[i+1];prevp=p;if(y<below)p=threspoints;else p=newpoints;if(addCrossingPoints&&prevp!=p&&x!=null&&i>0&&origpoints[i-ps]!=null){var interx=x+(below-y)*(x-origpoints[i-ps])/(y-origpoints[i-ps+1]);prevp.push(interx);prevp.push(below);for(m=2;m<ps;++m)prevp.push(origpoints[i+m]);p.push(null);p.push(null);for(m=2;m<ps;++m)p.push(origpoints[i+m]);p.push(interx);p.push(below);for(m=2;m<ps;++m)p.push(origpoints[i+m])}p.push(x);p.push(y);for(m=2;m<ps;++m)p.push(origpoints[i+m])}datapoints.points=newpoints;thresholded.datapoints.points=threspoints;if(thresholded.datapoints.points.length>0){var origIndex=$.inArray(s,plot.getData());plot.getData().splice(origIndex+1,0,thresholded)}}function processThresholds(plot,s,datapoints){if(!s.threshold)return;if(s.threshold instanceof Array){s.threshold.sort(function(a,b){return a.below-b.below});$(s.threshold).each(function(i,th){thresholdData(plot,s,datapoints,th.below,th.color)})}else{thresholdData(plot,s,datapoints,s.threshold.below,s.threshold.color)}}plot.hooks.processDatapoints.push(processThresholds)}$.plot.plugins.push({init:init,options:options,name:"threshold",version:"1.2"})})(jQuery);
|
||||
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.time.min.js
vendored
Executable file
7
public/assets/lib/flot.curvedlines/flot/jquery.flot.time.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
5
public/assets/lib/flot.curvedlines/flot/jquery.min.js
vendored
Executable file
5
public/assets/lib/flot.curvedlines/flot/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user