mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-21 05:41:54 +02:00
2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
// https://d3js.org/d3-path/ v3.0.1 Copyright 2015-2021 Mike Bostock
|
|
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";const i=Math.PI,s=2*i,h=1e-6,_=s-h;function e(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function n(){return new e}e.prototype=n.prototype={constructor:e,moveTo:function(t,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,i){this._+="L"+(this._x1=+t)+","+(this._y1=+i)},quadraticCurveTo:function(t,i,s,h){this._+="Q"+ +t+","+ +i+","+(this._x1=+s)+","+(this._y1=+h)},bezierCurveTo:function(t,i,s,h,_,e){this._+="C"+ +t+","+ +i+","+ +s+","+ +h+","+(this._x1=+_)+","+(this._y1=+e)},arcTo:function(t,s,_,e,n){t=+t,s=+s,_=+_,e=+e,n=+n;var o=this._x1,r=this._y1,a=_-t,u=e-s,f=o-t,c=r-s,y=f*f+c*c;if(n<0)throw new Error("negative radius: "+n);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=s);else if(y>h)if(Math.abs(c*a-u*f)>h&&n){var x=_-o,l=e-r,M=a*a+u*u,d=x*x+l*l,p=Math.sqrt(M),v=Math.sqrt(y),b=n*Math.tan((i-Math.acos((M+y-d)/(2*p*v)))/2),T=b/v,g=b/p;Math.abs(T-1)>h&&(this._+="L"+(t+T*f)+","+(s+T*c)),this._+="A"+n+","+n+",0,0,"+ +(c*x>f*l)+","+(this._x1=t+g*a)+","+(this._y1=s+g*u)}else this._+="L"+(this._x1=t)+","+(this._y1=s);else;},arc:function(t,e,n,o,r,a){t=+t,e=+e,a=!!a;var u=(n=+n)*Math.cos(o),f=n*Math.sin(o),c=t+u,y=e+f,x=1^a,l=a?o-r:r-o;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+c+","+y:(Math.abs(this._x1-c)>h||Math.abs(this._y1-y)>h)&&(this._+="L"+c+","+y),n&&(l<0&&(l=l%s+s),l>_?this._+="A"+n+","+n+",0,1,"+x+","+(t-u)+","+(e-f)+"A"+n+","+n+",0,1,"+x+","+(this._x1=c)+","+(this._y1=y):l>h&&(this._+="A"+n+","+n+",0,"+ +(l>=i)+","+x+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,i,s,h){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+i)+"h"+ +s+"v"+ +h+"h"+-s+"Z"},toString:function(){return this._}},t.path=n,Object.defineProperty(t,"__esModule",{value:!0})}));
|