All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ui.js.vendor.d3.d3-path.min.js Maven / Gradle / Ivy

The newest version!
// https://d3js.org/d3-path/ Version 1.0.2. Copyright 2016 Mike Bostock.
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s(t.d3=t.d3||{})}(this,function(t){"use strict";function s(){this._x0=this._y0=this._x1=this._y1=null,this._=[]}function i(){return new s}var h=Math.PI,_=2*h,n=1e-6,e=_-n;s.prototype=i.prototype={constructor:s,moveTo:function(t,s){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+s)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._.push("Z"))},lineTo:function(t,s){this._.push("L",this._x1=+t,",",this._y1=+s)},quadraticCurveTo:function(t,s,i,h){this._.push("Q",+t,",",+s,",",this._x1=+i,",",this._y1=+h)},bezierCurveTo:function(t,s,i,h,_,n){this._.push("C",+t,",",+s,",",+i,",",+h,",",this._x1=+_,",",this._y1=+n)},arcTo:function(t,s,i,_,e){t=+t,s=+s,i=+i,_=+_,e=+e;var o=this._x1,u=this._y1,r=i-t,a=_-s,c=o-t,f=u-s,p=c*c+f*f;if(e<0)throw new Error("negative radius: "+e);if(null===this._x1)this._.push("M",this._x1=t,",",this._y1=s);else if(p>n)if(Math.abs(f*r-a*c)>n&&e){var x=i-o,y=_-u,M=r*r+a*a,l=x*x+y*y,d=Math.sqrt(M),v=Math.sqrt(p),b=e*Math.tan((h-Math.acos((M+p-l)/(2*d*v)))/2),w=b/v,T=b/d;Math.abs(w-1)>n&&this._.push("L",t+w*c,",",s+w*f),this._.push("A",e,",",e,",0,0,",+(f*x>c*y),",",this._x1=t+T*r,",",this._y1=s+T*a)}else this._.push("L",this._x1=t,",",this._y1=s);else;},arc:function(t,s,i,o,u,r){t=+t,s=+s,i=+i;var a=i*Math.cos(o),c=i*Math.sin(o),f=t+a,p=s+c,x=1^r,y=r?o-u:u-o;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._.push("M",f,",",p):(Math.abs(this._x1-f)>n||Math.abs(this._y1-p)>n)&&this._.push("L",f,",",p),i&&(y>e?this._.push("A",i,",",i,",0,1,",x,",",t-a,",",s-c,"A",i,",",i,",0,1,",x,",",this._x1=f,",",this._y1=p):(y<0&&(y=y%_+_),this._.push("A",i,",",i,",0,",+(y>=h),",",x,",",this._x1=t+i*Math.cos(u),",",this._y1=s+i*Math.sin(u))))},rect:function(t,s,i,h){this._.push("M",this._x0=this._x1=+t,",",this._y0=this._y1=+s,"h",+i,"v",+h,"h",-i,"Z")},toString:function(){return this._.join("")}},t.path=i,Object.defineProperty(t,"__esModule",{value:!0})});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy