/** * Flot plugin that provides spline interpolation for line graphs * author: Alex Bardas < alex.bardas@gmail.com > * modified by: Avi Kohn https://github.com/AMKohn * based on the spline interpolation described at: * http://scaledinnovation.com/analytics/splines/aboutSplines.html * * Example usage: (add in plot options series object) * for linespline: * series: { * ... * lines: { * show: false * }, * splines: { * show: true, * tension: x, (float between 0 and 1, defaults to 0.5), * lineWidth: y (number, defaults to 2), * fill: z (float between 0 .. 1 or false, as in flot documentation) * }, * ... * } * areaspline: * series: { * ... * lines: { * show: true, * lineWidth: 0, (line drawing will not execute) * fill: x, (float between 0 .. 1, as in flot documentation) * ... * }, * splines: { * show: true, * tension: 0.5 (float between 0 and 1) * }, * ... * } * */(function(e){"use strict";function t(e,t,n,r,i,s,o){var u=Math.pow,a=Math.sqrt,f,l,c,h,p,d,v,m;f=a(u(n-e,2)+u(r-t,2));l=a(u(i-n,2)+u(s-r,2));c=o*f/(f+l);h=o-c;p=n+c*(e-i);d=r+c*(t-s);v=n-h*(e-i);m=r-h*(t-s);return[p,d,v,m]}function r(t,n,r,i,s){var o=e.color.parse(s);o.a=typeof i=="number"?i:.3;o.normalize();o=o.toString();n.beginPath();n.moveTo(t[0][0],t[0][1]);var u=t.length;for(var a=0;au.xaxis.max||hu.yaxis.max)continue;g.push(u.xaxis.p2c(c)+v.left,u.yaxis.p2c(h)+v.top)}m=g.length;for(l=0;l