ui.js.vendor.d3.d3-shape.min.js Maven / Gradle / Ivy
// https://d3js.org/d3-shape/ Version 1.0.3. Copyright 2016 Mike Bostock.
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],i):i(t.d3=t.d3||{},t.d3)}(this,function(t,i){"use strict";function n(t){return function(){return t}}function e(t){return t.innerRadius}function s(t){return t.outerRadius}function h(t){return t.startAngle}function o(t){return t.endAngle}function _(t){return t&&t.padAngle}function a(t){return t>=1?bt:t<=-1?-bt:Math.asin(t)}function r(t,i,n,e,s,h,o,_){var a=n-t,r=e-i,c=o-s,l=_-h,u=(c*(i-h)-l*(t-s))/(l*a-c*r);return[t+u*a,i+u*r]}function c(t,i,n,e,s,h,o){var _=t-n,a=i-e,r=(o?h:-h)/Math.sqrt(_*_+a*a),c=r*a,l=-r*_,u=t+c,f=i+l,x=n+c,y=e+l,p=(u+x)/2,v=(f+y)/2,d=x-u,T=y-f,M=d*d+T*T,g=s-h,b=u*y-x*f,w=(T<0?-1:1)*Math.sqrt(Math.max(0,g*g*M-b*b)),m=(b*T-d*w)/M,k=(-b*d-T*w)/M,N=(b*T+d*w)/M,S=(-b*d+T*w)/M,E=m-p,A=k-v,P=N-p,q=S-v;return E*E+A*A>P*P+q*q&&(m=N,k=S),{cx:m,cy:k,x01:-c,y01:-l,x11:m*(s/g-1),y11:k*(s/g-1)}}function l(){function t(){var t,n,e=+l.apply(this,arguments),s=+u.apply(this,arguments),h=y.apply(this,arguments)-bt,o=p.apply(this,arguments)-bt,_=Math.abs(o-h),T=o>h;if(d||(d=t=i.path()),sMt)if(_>wt-Mt)d.moveTo(s*Math.cos(h),s*Math.sin(h)),d.arc(0,0,s,h,o,!T),e>Mt&&(d.moveTo(e*Math.cos(o),e*Math.sin(o)),d.arc(0,0,e,o,h,T));else{var M,g,b=h,w=o,m=h,k=o,N=_,S=_,E=v.apply(this,arguments)/2,A=E>Mt&&(x?+x.apply(this,arguments):Math.sqrt(e*e+s*s)),P=Math.min(Math.abs(s-e)/2,+f.apply(this,arguments)),q=P,C=P;if(A>Mt){var O=a(A/e*Math.sin(E)),R=a(A/s*Math.sin(E));(N-=2*O)>Mt?(O*=T?1:-1,m+=O,k-=O):(N=0,m=k=(h+o)/2),(S-=2*R)>Mt?(R*=T?1:-1,b+=R,w-=R):(S=0,b=w=(h+o)/2)}var z=s*Math.cos(b),X=s*Math.sin(b),Y=e*Math.cos(k),B=e*Math.sin(k);if(P>Mt){var j=s*Math.cos(w),I=s*Math.sin(w),L=e*Math.cos(m),D=e*Math.sin(m);if(_Mt?r(z,X,L,D,j,I,Y,B):[Y,B],V=z-W[0],F=X-W[1],G=j-W[0],H=I-W[1],J=1/Math.sin(Math.acos((V*G+F*H)/(Math.sqrt(V*V+F*F)*Math.sqrt(G*G+H*H)))/2),K=Math.sqrt(W[0]*W[0]+W[1]*W[1]);q=Math.min(P,(e-K)/(J-1)),C=Math.min(P,(s-K)/(J+1))}}S>Mt?C>Mt?(M=c(L,D,z,X,s,C,T),g=c(j,I,Y,B,s,C,T),d.moveTo(M.cx+M.x01,M.cy+M.y01),CMt&&N>Mt?q>Mt?(M=c(Y,B,j,I,e,-q,T),g=c(z,X,L,D,e,-q,T),d.lineTo(M.cx+M.x01,M.cy+M.y01),q
=e;--u)l.point(v[u],d[u]);l.lineEnd(),l.areaEnd()}p&&(v[n]=+s(f,n,t),d[n]=+o(f,n,t),l.point(h?+h(f,n,t):v[n],_?+_(f,n,t):d[n]))}if(x)return l=null,x+""||null}function e(){return p().defined(a).curve(c).context(r)}var s=x,h=null,o=n(0),_=y,a=n(!0),r=null,c=f,l=null;return t.x=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),h=null,t):s},t.x0=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),t):s},t.x1=function(i){return arguments.length?(h=null==i?null:"function"==typeof i?i:n(+i),t):h},t.y=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),_=null,t):o},t.y0=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),t):o},t.y1=function(i){return arguments.length?(_=null==i?null:"function"==typeof i?i:n(+i),t):_},t.lineX0=t.lineY0=function(){return e().x(s).y(o)},t.lineY1=function(){return e().x(s).y(_)},t.lineX1=function(){return e().x(h).y(o)},t.defined=function(i){return arguments.length?(a="function"==typeof i?i:n(!!i),t):a},t.curve=function(i){return arguments.length?(c=i,null!=r&&(l=c(r)),t):c},t.context=function(i){return arguments.length?(null==i?r=l=null:l=c(r=i),t):r},t}function d(t,i){return it?1:i>=t?0:NaN}function T(t){return t}function M(){function t(t){var n,a,r,c,l,u=t.length,f=0,x=new Array(u),y=new Array(u),p=+h.apply(this,arguments),v=Math.min(wt,Math.max(-wt,o.apply(this,arguments)-p)),d=Math.min(Math.abs(v)/u,_.apply(this,arguments)),T=d*(v<0?-1:1);for(n=0;n0&&(f+=l);for(null!=e?x.sort(function(t,i){return e(y[t],y[i])}):null!=s&&x.sort(function(i,n){return s(t[i],t[n])}),n=0,r=f?(v-u*T)/f:0;n0?l*r:0)+T,y[a]={data:t[a],index:n,value:l,startAngle:p,endAngle:c,padAngle:d};return y}var i=T,e=d,s=null,h=n(0),o=n(wt),_=n(0);return t.value=function(e){return arguments.length?(i="function"==typeof e?e:n(+e),t):i},t.sortValues=function(i){return arguments.length?(e=i,s=null,t):e},t.sort=function(i){return arguments.length?(s=i,e=null,t):s},t.startAngle=function(i){return arguments.length?(h="function"==typeof i?i:n(+i),t):h},t.endAngle=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),t):o},t.padAngle=function(i){return arguments.length?(_="function"==typeof i?i:n(+i),t):_},t}function g(t){this._curve=t}function b(t){function i(i){return new g(t(i))}return i._curve=t,i}function w(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?i(b(t)):i()._curve},t}function m(){return w(p().curve(mt))}function k(){var t=v().curve(mt),i=t.curve,n=t.lineX0,e=t.lineX1,s=t.lineY0,h=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return w(n())},delete t.lineX0,t.lineEndAngle=function(){return w(e())},delete t.lineX1,t.lineInnerRadius=function(){return w(s())},delete t.lineY0,t.lineOuterRadius=function(){return w(h())},delete t.lineY1,t.curve=function(t){return arguments.length?i(b(t)):i()._curve},t}function N(){function t(){var t;if(h||(h=t=i.path()),e.apply(this,arguments).draw(h,+s.apply(this,arguments)),t)return h=null,t+""||null}var e=n(kt),s=n(64),h=null;return t.type=function(i){return arguments.length?(e="function"==typeof i?i:n(i),t):e},t.size=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),t):s},t.context=function(i){return arguments.length?(h=null==i?null:i,t):h},t}function S(){}function E(t,i,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+i)/6,(t._y0+4*t._y1+n)/6)}function A(t){this._context=t}function P(t){return new A(t)}function q(t){this._context=t}function C(t){return new q(t)}function O(t){this._context=t}function R(t){return new O(t)}function z(t,i){this._basis=new A(t),this._beta=i}function X(t,i,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Y(t,i){this._context=t,this._k=(1-i)/6}function B(t,i){this._context=t,this._k=(1-i)/6}function j(t,i){this._context=t,this._k=(1-i)/6}function I(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>Mt){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Mt){var r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*r+t._x1*t._l23_2a-i*t._l12_2a)/c,o=(o*r+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function L(t,i){this._context=t,this._alpha=i}function D(t,i){this._context=t,this._alpha=i}function W(t,i){this._context=t,this._alpha=i}function V(t){this._context=t}function F(t){return new V(t)}function G(t){return t<0?-1:1}function H(t,i,n){var e=t._x1-t._x0,s=i-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(n-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(G(h)+G(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function J(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function K(t,i,n){var e=t._x0,s=t._y0,h=t._x1,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*i,h-_,o-_*n,h,o)}function Q(t){this._context=t}function U(t){this._context=new Z(t)}function Z(t){this._context=t}function $(t){return new Q(t)}function tt(t){return new U(t)}function it(t){this._context=t}function nt(t){var i,n,e=t.length-1,s=new Array(e),h=new Array(e),o=new Array(e);for(s[0]=0,h[0]=2,o[0]=t[0]+2*t[1],i=1;i=0;--i)s[i]=(o[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;i1)for(var n,e,s=1,h=t[i[0]],o=h.length;s=0;)n[i]=i;return n}function ct(t,i){return t[i]}function lt(){function t(t){var n,o,_=i.apply(this,arguments),a=t.length,r=_.length,c=new Array(r);for(n=0;n0){for(var n,e,s,h=0,o=t[0].length;h0){for(var n,e=0,s=t[i[0]],h=s.length;e0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;o0)for(var e,s=t[0],h=i[0],o=t[n]-s,_=i[n]-h,a=-1;++a<=n;)e=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(s+e*o),this._beta*i[a]+(1-this._beta)*(h+e*_));this._x=this._y=null,this._basis.lineEnd()},point:function(t,i){this._x.push(+t),this._y.push(+i)}};var Vt=function t(i){function n(t){return 1===i?new A(t):new z(t,i)}return n.beta=function(i){return t(+i)},n}(.85);Y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:X(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Ft=function t(i){function n(t){return new Y(t,i)}return n.tension=function(i){return t(+i)},n}(0);B.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Gt=function t(i){function n(t){return new B(t,i)}return n.tension=function(i){return t(+i)},n}(0);j.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Ht=function t(i){function n(t){return new j(t,i)}return n.tension=function(i){return t(+i)},n}(0);L.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Jt=function t(i){function n(t){return i?new L(t,i):new Y(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);D.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Kt=function t(i){function n(t){return i?new D(t,i):new B(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);W.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Qt=function t(i){function n(t){return i?new W(t,i):new j(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);V.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}},Q.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:K(this,this._t0,J(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var n=NaN;if(t=+t,i=+i,t!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,K(this,J(this,n=H(this,t,i)),n);break;default:K(this,this._t0,n=H(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(U.prototype=Object.create(Q.prototype)).point=function(t,i){Q.prototype.point.call(this,i,t)},Z.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,n,e,s,h){this._context.bezierCurveTo(i,t,e,n,h,s)}},it.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),2===n)this._context.lineTo(t[1],i[1]);else for(var e=nt(t),s=nt(i),h=0,o=1;o=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}}this._x=t,this._y=i}};var Ut=Array.prototype.slice;t.arc=l,t.area=v,t.line=p,t.pie=M,t.radialArea=k,t.radialLine=m,t.symbol=N,t.symbols=Wt,t.symbolCircle=kt,t.symbolCross=Nt,t.symbolDiamond=At,t.symbolSquare=zt,t.symbolStar=Rt,t.symbolTriangle=Yt,t.symbolWye=Dt,t.curveBasisClosed=C,t.curveBasisOpen=R,t.curveBasis=P,t.curveBundle=Vt,t.curveCardinalClosed=Gt,t.curveCardinalOpen=Ht,t.curveCardinal=Ft,t.curveCatmullRomClosed=Kt,t.curveCatmullRomOpen=Qt,t.curveCatmullRom=Jt,t.curveLinearClosed=F,t.curveLinear=f,t.curveMonotoneX=$,t.curveMonotoneY=tt,t.curveNatural=et,t.curveStep=ht,t.curveStepAfter=_t,t.curveStepBefore=ot,t.stack=lt,t.stackOffsetExpand=ut,t.stackOffsetNone=at,t.stackOffsetSilhouette=ft,t.stackOffsetWiggle=xt,t.stackOrderAscending=yt,t.stackOrderDescending=vt,t.stackOrderInsideOut=dt,t.stackOrderNone=rt,t.stackOrderReverse=Tt,Object.defineProperty(t,"__esModule",{value:!0})});