vizabi-interpolators
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -8,24 +8,18 @@ /* | ||
// | ||
var VizabiInterpolators = (function() { | ||
return { | ||
linear: function(x1, x2, y1, y2, x) { | ||
return +y1 + (y2 - y1) * (x - x1) / (x2 - x1); | ||
}, | ||
exp: function(x1, x2, y1, y2, x) { | ||
return Math.exp((Math.log(y1) * (x2 - x) - Math.log(y2) * (x1 - x)) / (x2 - x1)); | ||
}, | ||
stepBefore: function(x1, x2, y1, y2, x) { | ||
return y2; | ||
}, | ||
stepAfter: function(x1, x2, y1, y2, x) { | ||
return y1; | ||
}, | ||
stepMiddle: function(x1, x2, y1, y2, x) { | ||
return (x < (x1 + x2)/2) ? y1 : y2; | ||
} | ||
export default { | ||
linear: function(x1, x2, y1, y2, x) { | ||
return +y1 + (y2 - y1) * (x - x1) / (x2 - x1); | ||
}, | ||
exp: function(x1, x2, y1, y2, x) { | ||
return Math.exp((Math.log(y1) * (x2 - x) - Math.log(y2) * (x1 - x)) / (x2 - x1)); | ||
}, | ||
stepBefore: function(x1, x2, y1, y2, x) { | ||
return y2; | ||
}, | ||
stepAfter: function(x1, x2, y1, y2, x) { | ||
return y1; | ||
}, | ||
stepMiddle: function(x1, x2, y1, y2, x) { | ||
return (x < (x1 + x2)/2) ? y1 : y2; | ||
} | ||
}()); | ||
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { | ||
module.exports = VizabiInterpolators; | ||
} | ||
}; |
{ | ||
"name": "vizabi-interpolators", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Interpolator functions shared between vizabi and waffle server", | ||
@@ -5,0 +5,0 @@ "main": "interpolators.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1801
24