X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fextras%2Fsmooth-plotter.js;fp=src%2Fextras%2Fsmooth-plotter.js;h=69685ec89f3fb6ff11c57338670d0b2917c3cd5d;hb=2b66af4f76dcd72d22f5844cb7684f3cb79fde42;hp=d0182f49756087e0c0da1701928eaf8604c43f56;hpb=178b1e0a5023bd55b8636242623e7eb82ac12d5d;p=dygraphs.git diff --git a/src/extras/smooth-plotter.js b/src/extras/smooth-plotter.js index d0182f4..69685ec 100644 --- a/src/extras/smooth-plotter.js +++ b/src/extras/smooth-plotter.js @@ -75,6 +75,10 @@ function getControlPoints(p0, p1, p2, opt_alpha, opt_allowFalseExtrema) { return [l1x, l1y, r1x, r1y]; } +// i.e. is none of (null, undefined, NaN) +function isOK(x) { + return !!x && !isNaN(x); +}; // A plotter which uses splines to create a smooth curve. // See tests/plotters.html for a demo. @@ -88,7 +92,6 @@ function smoothPlotter(e) { // right control point for previous point var lastRightX = points[0].canvasx, lastRightY = points[0].canvasy; - var isOK = Dygraph.isOK; // i.e. is none of (null, undefined, NaN) for (var i = 1; i < points.length; i++) { var p0 = points[i - 1],