UNPKG

vislite

Version:

灵活、快速、简单的数据可视化交互式跨端前端库

5 lines 679 B
/*! * Hermite of VISLite JavaScript Library v1.3.0 * git+https://github.com/oi-contrib/VISLite.git */ var t=function(){function t(t){void 0===t&&(t=.5),this.name="Hermite",this.__u=t}return t.prototype.setP=function(t,i,_,s,h,r){if(!(t<_))throw new Error("The point x-position should be increamented!");this.__a=t,this.__b=_;var o=this.__u*h,e=this.__u*r;return i/=_-t,s/=_-t,this.__MR=[2*i-2*s+o+e,3*s-3*i-2*o-e,o,i],this},t.prototype.use=function(t){if(this.__MR){var i=(t-this.__a)/(this.__b-this.__a),_=i*i;return(i*_*this.__MR[0]+_*this.__MR[1]+i*this.__MR[2]+this.__MR[3])*(this.__b-this.__a)}throw new Error("You shoud first set the position!")},t}();export{t as default};