Comparing version 1.2.2 to 1.2.3
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ v1.2.2 Copyright 2018 Mike Bostock | ||
// https://d3js.org/d3-shape/ v1.2.3 Copyright 2019 Mike Bostock | ||
(function (global, factory) { | ||
@@ -58,3 +58,5 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) : | ||
x32 = x3 - x2, y32 = y3 - y2, | ||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10); | ||
t = y32 * x10 - x32 * y10; | ||
if (t * t < epsilon) return; | ||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; | ||
return [x0 + t * x10, y0 + t * y10]; | ||
@@ -180,8 +182,8 @@ } | ||
x00 = r0 * cos(a00), | ||
y00 = r0 * sin(a00); | ||
y00 = r0 * sin(a00), | ||
oc; | ||
// Restrict the corner radius according to the sector angle. | ||
if (da < pi) { | ||
var oc = da0 > epsilon ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10], | ||
ax = x01 - oc[0], | ||
if (da <= tau - epsilon && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { | ||
var ax = x01 - oc[0], | ||
ay = y01 - oc[1], | ||
@@ -188,0 +190,0 @@ bx = x11 - oc[0], |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ v1.2.2 Copyright 2018 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}}var e=Math.abs,s=Math.atan2,h=Math.cos,o=Math.max,_=Math.min,r=Math.sin,a=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,f=2*l;function x(t){return t>=1?u:t<=-1?-u:Math.asin(t)}function y(t){return t.innerRadius}function p(t){return t.outerRadius}function v(t){return t.startAngle}function d(t){return t.endAngle}function T(t){return t&&t.padAngle}function g(t,i,n,e,s,h,_){var r=t-n,c=i-e,l=(_?h:-h)/a(r*r+c*c),u=l*c,f=-l*r,x=t+u,y=i+f,p=n+u,v=e+f,d=(x+p)/2,T=(y+v)/2,g=p-x,b=v-y,w=g*g+b*b,k=s-h,m=x*v-p*y,N=(b<0?-1:1)*a(o(0,k*k*w-m*m)),M=(m*b-g*N)/w,S=(-m*g-b*N)/w,E=(m*b+g*N)/w,A=(-m*g+b*N)/w,P=M-d,C=S-T,R=E-d,q=A-T;return P*P+C*C>R*R+q*q&&(M=E,S=A),{cx:M,cy:S,x01:-u,y01:-f,x11:M*(s/k-1),y11:S*(s/k-1)}}function b(t){this._context=t}function w(t){return new b(t)}function k(t){return t[0]}function m(t){return t[1]}function N(){var t=k,e=m,s=n(!0),h=null,o=w,_=null;function r(n){var r,a,c,l=n.length,u=!1;for(null==h&&(_=o(c=i.path())),r=0;r<=l;++r)!(r<l&&s(a=n[r],r,n))===u&&((u=!u)?_.lineStart():_.lineEnd()),u&&_.point(+t(a,r,n),+e(a,r,n));if(c)return _=null,c+""||null}return r.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),r):e},r.defined=function(t){return arguments.length?(s="function"==typeof t?t:n(!!t),r):s},r.curve=function(t){return arguments.length?(o=t,null!=h&&(_=o(h)),r):o},r.context=function(t){return arguments.length?(null==t?h=_=null:_=o(h=t),r):h},r}function M(){var t=k,e=null,s=n(0),h=m,o=n(!0),_=null,r=w,a=null;function c(n){var c,l,u,f,x,y=n.length,p=!1,v=new Array(y),d=new Array(y);for(null==_&&(a=r(x=i.path())),c=0;c<=y;++c){if(!(c<y&&o(f=n[c],c,n))===p)if(p=!p)l=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),u=c-1;u>=l;--u)a.point(v[u],d[u]);a.lineEnd(),a.areaEnd()}p&&(v[c]=+t(f,c,n),d[c]=+s(f,c,n),a.point(e?+e(f,c,n):v[c],h?+h(f,c,n):d[c]))}if(x)return a=null,x+""||null}function l(){return N().defined(o).curve(r).context(_)}return c.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),e=null,c):t},c.x0=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:n(+t),c):e},c.y=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h=null,c):s},c.y0=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),c):s},c.y1=function(t){return arguments.length?(h=null==t?null:"function"==typeof t?t:n(+t),c):h},c.lineX0=c.lineY0=function(){return l().x(t).y(s)},c.lineY1=function(){return l().x(t).y(h)},c.lineX1=function(){return l().x(e).y(s)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:n(!!t),c):o},c.curve=function(t){return arguments.length?(r=t,null!=_&&(a=r(_)),c):r},c.context=function(t){return arguments.length?(null==t?_=a=null:a=r(_=t),c):_},c}function S(t,i){return i<t?-1:i>t?1:i>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(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;default:this._context.lineTo(t,i)}}};var A=C(w);function P(t){this._curve=t}function C(t){function i(i){return new P(t(i))}return i._curve=t,i}function R(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(C(t)):i()._curve},t}function q(){return R(N().curve(A))}function O(){var t=M().curve(A),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 R(n())},delete t.lineX0,t.lineEndAngle=function(){return R(e())},delete t.lineX1,t.lineInnerRadius=function(){return R(s())},delete t.lineY0,t.lineOuterRadius=function(){return R(h())},delete t.lineY1,t.curve=function(t){return arguments.length?i(C(t)):i()._curve},t}function z(t,i){return[(i=+i)*Math.cos(t-=Math.PI/2),i*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};var X=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function I(t){var e=Y,s=B,h=k,o=m,_=null;function r(){var n,r=X.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=n=i.path()),t(_,+h.apply(this,(r[0]=a,r)),+o.apply(this,r),+h.apply(this,(r[0]=c,r)),+o.apply(this,r)),n)return _=null,n+""||null}return r.source=function(t){return arguments.length?(e=t,r):e},r.target=function(t){return arguments.length?(s=t,r):s},r.x=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),r):h},r.y=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),r):o},r.context=function(t){return arguments.length?(_=null==t?null:t,r):_},r}function j(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i=(i+e)/2,n,i,s,e,s)}function D(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i,n=(n+s)/2,e,n,e,s)}function L(t,i,n,e,s){var h=z(i,n),o=z(i,n=(n+s)/2),_=z(e,n),r=z(e,s);t.moveTo(h[0],h[1]),t.bezierCurveTo(o[0],o[1],_[0],_[1],r[0],r[1])}var V={draw:function(t,i){var n=Math.sqrt(i/l);t.moveTo(n,0),t.arc(0,0,n,0,f)}},W={draw:function(t,i){var n=Math.sqrt(i/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},H=Math.sqrt(1/3),F=2*H,G={draw:function(t,i){var n=Math.sqrt(i/F),e=n*H;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},J=Math.sin(l/10)/Math.sin(7*l/10),K=Math.sin(f/10)*J,Q=-Math.cos(f/10)*J,U={draw:function(t,i){var n=Math.sqrt(.8908130915292852*i),e=K*n,s=Q*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;h<5;++h){var o=f*h/5,_=Math.cos(o),r=Math.sin(o);t.lineTo(r*n,-_*n),t.lineTo(_*e-r*s,r*e+_*s)}t.closePath()}},Z={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},$=Math.sqrt(3),tt={draw:function(t,i){var n=-Math.sqrt(i/(3*$));t.moveTo(0,2*n),t.lineTo(-$*n,-n),t.lineTo($*n,-n),t.closePath()}},it=-.5,nt=Math.sqrt(3)/2,et=1/Math.sqrt(12),st=3*(et/2+1),ht={draw:function(t,i){var n=Math.sqrt(i/st),e=n/2,s=n*et,h=e,o=n*et+n,_=-h,r=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,r),t.lineTo(it*e-nt*s,nt*e+it*s),t.lineTo(it*h-nt*o,nt*h+it*o),t.lineTo(it*_-nt*r,nt*_+it*r),t.lineTo(it*e+nt*s,it*s-nt*e),t.lineTo(it*h+nt*o,it*o-nt*h),t.lineTo(it*_+nt*r,it*r-nt*_),t.closePath()}},ot=[V,W,G,Z,U,tt,ht];function _t(){}function rt(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 at(t){this._context=t}function ct(t){this._context=t}function lt(t){this._context=t}function ut(t,i){this._basis=new at(t),this._beta=i}at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rt(this,this._x1,this._y1);case 2:this._context.lineTo(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;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},ct.prototype={areaStart:_t,areaEnd:_t,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x2=t,this._y2=i;break;case 1:this._point=2,this._x3=t,this._y3=i;break;case 2:this._point=3,this._x4=t,this._y4=i,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+i)/6);break;default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=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;var n=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+i)/6;this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 3:this._point=4;default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},ut.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,i=this._y,n=t.length-1;if(n>0)for(var e,s=t[0],h=i[0],o=t[n]-s,_=i[n]-h,r=-1;++r<=n;)e=r/n,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*o),this._beta*i[r]+(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 ft=function t(i){function n(t){return 1===i?new at(t):new ut(t,i)}return n.beta=function(i){return t(+i)},n}(.85);function xt(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 yt(t,i){this._context=t,this._k=(1-i)/6}yt.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:xt(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:xt(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 pt=function t(i){function n(t){return new yt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function vt(t,i){this._context=t,this._k=(1-i)/6}vt.prototype={areaStart:_t,areaEnd:_t,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:xt(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 dt=function t(i){function n(t){return new vt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function Tt(t,i){this._context=t,this._k=(1-i)/6}Tt.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:xt(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 Tt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function bt(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>c){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>c){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*a+t._x1*t._l23_2a-i*t._l12_2a)/l,o=(o*a+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function wt(t,i){this._context=t,this._alpha=i}wt.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:bt(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 wt(t,i):new yt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function mt(t,i){this._context=t,this._alpha=i}mt.prototype={areaStart:_t,areaEnd:_t,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:bt(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 Nt=function t(i){function n(t){return i?new mt(t,i):new vt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Mt(t,i){this._context=t,this._alpha=i}Mt.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:bt(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 St=function t(i){function n(t){return i?new Mt(t,i):new Tt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Et(t){this._context=t}function At(t){return t<0?-1:1}function Pt(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(At(h)+At(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function Ct(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function Rt(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 qt(t){this._context=t}function Ot(t){this._context=new zt(t)}function zt(t){this._context=t}function Xt(t){this._context=t}function Yt(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<e-1;++i)s[i]=1,h[i]=4,o[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,h[e-1]=7,o[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/h[i-1],h[i]-=n,o[i]-=n*o[i-1];for(s[e-1]=o[e-1]/h[e-1],i=e-2;i>=0;--i)s[i]=(o[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function Bt(t,i){this._context=t,this._t=i}function It(t,i){if((s=t.length)>1)for(var n,e,s,h=1,o=t[i[0]],_=o.length;h<s;++h)for(e=o,o=t[i[h]],n=0;n<_;++n)o[n][1]+=o[n][0]=isNaN(e[n][1])?e[n][0]:e[n][1]}function jt(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function Dt(t,i){return t[i]}function Lt(t){var i=t.map(Vt);return jt(t).sort(function(t,n){return i[t]-i[n]})}function Vt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}Et.prototype={areaStart:_t,areaEnd:_t,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))}},qt.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:Rt(this,this._t0,Ct(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(i=+i,(t=+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,Rt(this,Ct(this,n=Pt(this,t,i)),n);break;default:Rt(this,this._t0,n=Pt(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(Ot.prototype=Object.create(qt.prototype)).point=function(t,i){qt.prototype.point.call(this,i,t)},zt.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)}},Xt.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=Yt(t),s=Yt(i),h=0,o=1;o<n;++h,++o)this._context.bezierCurveTo(e[0][h],s[0][h],e[1][h],s[1][h],t[o],i[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}},Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=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}},t.arc=function(){var t=y,o=p,b=n(0),w=null,k=v,m=d,N=T,M=null;function S(){var n,y,p,v=+t.apply(this,arguments),d=+o.apply(this,arguments),T=k.apply(this,arguments)-u,S=m.apply(this,arguments)-u,E=e(S-T),A=S>T;if(M||(M=n=i.path()),d<v&&(y=d,d=v,v=y),d>c)if(E>f-c)M.moveTo(d*h(T),d*r(T)),M.arc(0,0,d,T,S,!A),v>c&&(M.moveTo(v*h(S),v*r(S)),M.arc(0,0,v,S,T,A));else{var P,C,R=T,q=S,O=T,z=S,X=E,Y=E,B=N.apply(this,arguments)/2,I=B>c&&(w?+w.apply(this,arguments):a(v*v+d*d)),j=_(e(d-v)/2,+b.apply(this,arguments)),D=j,L=j;if(I>c){var V=x(I/v*r(B)),W=x(I/d*r(B));(X-=2*V)>c?(O+=V*=A?1:-1,z-=V):(X=0,O=z=(T+S)/2),(Y-=2*W)>c?(R+=W*=A?1:-1,q-=W):(Y=0,R=q=(T+S)/2)}var H=d*h(R),F=d*r(R),G=v*h(z),J=v*r(z);if(j>c){var K=d*h(q),Q=d*r(q),U=v*h(O),Z=v*r(O);if(E<l){var $=X>c?function(t,i,n,e,s,h,o,_){var r=n-t,a=e-i,c=o-s,l=_-h,u=(c*(i-h)-l*(t-s))/(l*r-c*a);return[t+u*r,i+u*a]}(H,F,U,Z,K,Q,G,J):[G,J],tt=H-$[0],it=F-$[1],nt=K-$[0],et=Q-$[1],st=1/r(((p=(tt*nt+it*et)/(a(tt*tt+it*it)*a(nt*nt+et*et)))>1?0:p<-1?l:Math.acos(p))/2),ht=a($[0]*$[0]+$[1]*$[1]);D=_(j,(v-ht)/(st-1)),L=_(j,(d-ht)/(st+1))}}Y>c?L>c?(P=g(U,Z,H,F,d,L,A),C=g(K,Q,G,J,d,L,A),M.moveTo(P.cx+P.x01,P.cy+P.y01),L<j?M.arc(P.cx,P.cy,L,s(P.y01,P.x01),s(C.y01,C.x01),!A):(M.arc(P.cx,P.cy,L,s(P.y01,P.x01),s(P.y11,P.x11),!A),M.arc(0,0,d,s(P.cy+P.y11,P.cx+P.x11),s(C.cy+C.y11,C.cx+C.x11),!A),M.arc(C.cx,C.cy,L,s(C.y11,C.x11),s(C.y01,C.x01),!A))):(M.moveTo(H,F),M.arc(0,0,d,R,q,!A)):M.moveTo(H,F),v>c&&X>c?D>c?(P=g(G,J,K,Q,v,-D,A),C=g(H,F,U,Z,v,-D,A),M.lineTo(P.cx+P.x01,P.cy+P.y01),D<j?M.arc(P.cx,P.cy,D,s(P.y01,P.x01),s(C.y01,C.x01),!A):(M.arc(P.cx,P.cy,D,s(P.y01,P.x01),s(P.y11,P.x11),!A),M.arc(0,0,v,s(P.cy+P.y11,P.cx+P.x11),s(C.cy+C.y11,C.cx+C.x11),A),M.arc(C.cx,C.cy,D,s(C.y11,C.x11),s(C.y01,C.x01),!A))):M.arc(0,0,v,z,O,A):M.lineTo(G,J)}else M.moveTo(0,0);if(M.closePath(),n)return M=null,n+""||null}return S.centroid=function(){var i=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,n=(+k.apply(this,arguments)+ +m.apply(this,arguments))/2-l/2;return[h(n)*i,r(n)*i]},S.innerRadius=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),S):t},S.outerRadius=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),S):o},S.cornerRadius=function(t){return arguments.length?(b="function"==typeof t?t:n(+t),S):b},S.padRadius=function(t){return arguments.length?(w=null==t?null:"function"==typeof t?t:n(+t),S):w},S.startAngle=function(t){return arguments.length?(k="function"==typeof t?t:n(+t),S):k},S.endAngle=function(t){return arguments.length?(m="function"==typeof t?t:n(+t),S):m},S.padAngle=function(t){return arguments.length?(N="function"==typeof t?t:n(+t),S):N},S.context=function(t){return arguments.length?(M=null==t?null:t,S):M},S},t.area=M,t.line=N,t.pie=function(){var t=E,i=S,e=null,s=n(0),h=n(f),o=n(0);function _(n){var _,r,a,c,l,u=n.length,x=0,y=new Array(u),p=new Array(u),v=+s.apply(this,arguments),d=Math.min(f,Math.max(-f,h.apply(this,arguments)-v)),T=Math.min(Math.abs(d)/u,o.apply(this,arguments)),g=T*(d<0?-1:1);for(_=0;_<u;++_)(l=p[y[_]=_]=+t(n[_],_,n))>0&&(x+=l);for(null!=i?y.sort(function(t,n){return i(p[t],p[n])}):null!=e&&y.sort(function(t,i){return e(n[t],n[i])}),_=0,a=x?(d-u*g)/x:0;_<u;++_,v=c)r=y[_],c=v+((l=p[r])>0?l*a:0)+g,p[r]={data:n[r],index:_,value:l,startAngle:v,endAngle:c,padAngle:T};return p}return _.value=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),_):t},_.sortValues=function(t){return arguments.length?(i=t,e=null,_):i},_.sort=function(t){return arguments.length?(e=t,i=null,_):e},_.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),_):s},_.endAngle=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),_):h},_.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),_):o},_},t.areaRadial=O,t.radialArea=O,t.lineRadial=q,t.radialLine=q,t.pointRadial=z,t.linkHorizontal=function(){return I(j)},t.linkVertical=function(){return I(D)},t.linkRadial=function(){var t=I(L);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=n(V),e=n(64),s=null;function h(){var n;if(s||(s=n=i.path()),t.apply(this,arguments).draw(s,+e.apply(this,arguments)),n)return s=null,n+""||null}return h.type=function(i){return arguments.length?(t="function"==typeof i?i:n(i),h):t},h.size=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),h):e},h.context=function(t){return arguments.length?(s=null==t?null:t,h):s},h},t.symbols=ot,t.symbolCircle=V,t.symbolCross=W,t.symbolDiamond=G,t.symbolSquare=Z,t.symbolStar=U,t.symbolTriangle=tt,t.symbolWye=ht,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new lt(t)},t.curveBasis=function(t){return new at(t)},t.curveBundle=ft,t.curveCardinalClosed=dt,t.curveCardinalOpen=gt,t.curveCardinal=pt,t.curveCatmullRomClosed=Nt,t.curveCatmullRomOpen=St,t.curveCatmullRom=kt,t.curveLinearClosed=function(t){return new Et(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new qt(t)},t.curveMonotoneY=function(t){return new Ot(t)},t.curveNatural=function(t){return new Xt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.stack=function(){var t=n([]),i=jt,e=It,s=Dt;function h(n){var h,o,_=t.apply(this,arguments),r=n.length,a=_.length,c=new Array(a);for(h=0;h<a;++h){for(var l,u=_[h],f=c[h]=new Array(r),x=0;x<r;++x)f[x]=l=[0,+s(n[x],u,x,n)],l.data=n[x];f.key=u}for(h=0,o=i(c);h<a;++h)c[o[h]].index=h;return e(c,o),c}return h.keys=function(i){return arguments.length?(t="function"==typeof i?i:n(X.call(i)),h):t},h.value=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h):s},h.order=function(t){return arguments.length?(i=null==t?jt:"function"==typeof t?t:n(X.call(t)),h):i},h.offset=function(t){return arguments.length?(e=null==t?It:t,h):e},h},t.stackOffsetExpand=function(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;h<o;++h){for(s=n=0;n<e;++n)s+=t[n][h][1]||0;if(s)for(n=0;n<e;++n)t[n][h][1]/=s}It(t,i)}},t.stackOffsetDiverging=function(t,i){if((_=t.length)>1)for(var n,e,s,h,o,_,r=0,a=t[i[0]].length;r<a;++r)for(h=o=0,n=0;n<_;++n)(s=(e=t[i[n]][r])[1]-e[0])>=0?(e[0]=h,e[1]=h+=s):s<0?(e[1]=o,e[0]=o+=s):e[0]=h},t.stackOffsetNone=It,t.stackOffsetSilhouette=function(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;e<h;++e){for(var o=0,_=0;o<n;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}It(t,i)}},t.stackOffsetWiggle=function(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;o<e;++o){for(var _=0,r=0,a=0;_<s;++_){for(var c=t[i[_]],l=c[o][1]||0,u=(l-(c[o-1][1]||0))/2,f=0;f<_;++f){var x=t[i[f]];u+=(x[o][1]||0)-(x[o-1][1]||0)}r+=l,a+=u*l}n[o-1][1]+=n[o-1][0]=h,r&&(h-=a/r)}n[o-1][1]+=n[o-1][0]=h,It(t,i)}},t.stackOrderAscending=Lt,t.stackOrderDescending=function(t){return Lt(t).reverse()},t.stackOrderInsideOut=function(t){var i,n,e=t.length,s=t.map(Vt),h=jt(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,r=[],a=[];for(i=0;i<e;++i)n=h[i],o<_?(o+=s[n],r.push(n)):(_+=s[n],a.push(n));return a.reverse().concat(r)},t.stackOrderNone=jt,t.stackOrderReverse=function(t){return jt(t).reverse()},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-shape/ v1.2.3 Copyright 2019 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}}var e=Math.abs,s=Math.atan2,h=Math.cos,o=Math.max,_=Math.min,r=Math.sin,a=Math.sqrt,c=1e-12,l=Math.PI,u=l/2,f=2*l;function x(t){return t>=1?u:t<=-1?-u:Math.asin(t)}function y(t){return t.innerRadius}function p(t){return t.outerRadius}function v(t){return t.startAngle}function d(t){return t.endAngle}function T(t){return t&&t.padAngle}function g(t,i,n,e,s,h,_){var r=t-n,c=i-e,l=(_?h:-h)/a(r*r+c*c),u=l*c,f=-l*r,x=t+u,y=i+f,p=n+u,v=e+f,d=(x+p)/2,T=(y+v)/2,g=p-x,b=v-y,w=g*g+b*b,k=s-h,m=x*v-p*y,N=(b<0?-1:1)*a(o(0,k*k*w-m*m)),M=(m*b-g*N)/w,S=(-m*g-b*N)/w,E=(m*b+g*N)/w,A=(-m*g+b*N)/w,P=M-d,C=S-T,R=E-d,q=A-T;return P*P+C*C>R*R+q*q&&(M=E,S=A),{cx:M,cy:S,x01:-u,y01:-f,x11:M*(s/k-1),y11:S*(s/k-1)}}function b(t){this._context=t}function w(t){return new b(t)}function k(t){return t[0]}function m(t){return t[1]}function N(){var t=k,e=m,s=n(!0),h=null,o=w,_=null;function r(n){var r,a,c,l=n.length,u=!1;for(null==h&&(_=o(c=i.path())),r=0;r<=l;++r)!(r<l&&s(a=n[r],r,n))===u&&((u=!u)?_.lineStart():_.lineEnd()),u&&_.point(+t(a,r,n),+e(a,r,n));if(c)return _=null,c+""||null}return r.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),r):t},r.y=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),r):e},r.defined=function(t){return arguments.length?(s="function"==typeof t?t:n(!!t),r):s},r.curve=function(t){return arguments.length?(o=t,null!=h&&(_=o(h)),r):o},r.context=function(t){return arguments.length?(null==t?h=_=null:_=o(h=t),r):h},r}function M(){var t=k,e=null,s=n(0),h=m,o=n(!0),_=null,r=w,a=null;function c(n){var c,l,u,f,x,y=n.length,p=!1,v=new Array(y),d=new Array(y);for(null==_&&(a=r(x=i.path())),c=0;c<=y;++c){if(!(c<y&&o(f=n[c],c,n))===p)if(p=!p)l=c,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),u=c-1;u>=l;--u)a.point(v[u],d[u]);a.lineEnd(),a.areaEnd()}p&&(v[c]=+t(f,c,n),d[c]=+s(f,c,n),a.point(e?+e(f,c,n):v[c],h?+h(f,c,n):d[c]))}if(x)return a=null,x+""||null}function l(){return N().defined(o).curve(r).context(_)}return c.x=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),e=null,c):t},c.x0=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),c):t},c.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:n(+t),c):e},c.y=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h=null,c):s},c.y0=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),c):s},c.y1=function(t){return arguments.length?(h=null==t?null:"function"==typeof t?t:n(+t),c):h},c.lineX0=c.lineY0=function(){return l().x(t).y(s)},c.lineY1=function(){return l().x(t).y(h)},c.lineX1=function(){return l().x(e).y(s)},c.defined=function(t){return arguments.length?(o="function"==typeof t?t:n(!!t),c):o},c.curve=function(t){return arguments.length?(r=t,null!=_&&(a=r(_)),c):r},c.context=function(t){return arguments.length?(null==t?_=a=null:a=r(_=t),c):_},c}function S(t,i){return i<t?-1:i>t?1:i>=t?0:NaN}function E(t){return t}b.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(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;default:this._context.lineTo(t,i)}}};var A=C(w);function P(t){this._curve=t}function C(t){function i(i){return new P(t(i))}return i._curve=t,i}function R(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(C(t)):i()._curve},t}function q(){return R(N().curve(A))}function O(){var t=M().curve(A),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 R(n())},delete t.lineX0,t.lineEndAngle=function(){return R(e())},delete t.lineX1,t.lineInnerRadius=function(){return R(s())},delete t.lineY0,t.lineOuterRadius=function(){return R(h())},delete t.lineY1,t.curve=function(t){return arguments.length?i(C(t)):i()._curve},t}function z(t,i){return[(i=+i)*Math.cos(t-=Math.PI/2),i*Math.sin(t)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,i){this._curve.point(i*Math.sin(t),i*-Math.cos(t))}};var X=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function I(t){var e=Y,s=B,h=k,o=m,_=null;function r(){var n,r=X.call(arguments),a=e.apply(this,r),c=s.apply(this,r);if(_||(_=n=i.path()),t(_,+h.apply(this,(r[0]=a,r)),+o.apply(this,r),+h.apply(this,(r[0]=c,r)),+o.apply(this,r)),n)return _=null,n+""||null}return r.source=function(t){return arguments.length?(e=t,r):e},r.target=function(t){return arguments.length?(s=t,r):s},r.x=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),r):h},r.y=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),r):o},r.context=function(t){return arguments.length?(_=null==t?null:t,r):_},r}function j(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i=(i+e)/2,n,i,s,e,s)}function D(t,i,n,e,s){t.moveTo(i,n),t.bezierCurveTo(i,n=(n+s)/2,e,n,e,s)}function L(t,i,n,e,s){var h=z(i,n),o=z(i,n=(n+s)/2),_=z(e,n),r=z(e,s);t.moveTo(h[0],h[1]),t.bezierCurveTo(o[0],o[1],_[0],_[1],r[0],r[1])}var V={draw:function(t,i){var n=Math.sqrt(i/l);t.moveTo(n,0),t.arc(0,0,n,0,f)}},W={draw:function(t,i){var n=Math.sqrt(i/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},H=Math.sqrt(1/3),F=2*H,G={draw:function(t,i){var n=Math.sqrt(i/F),e=n*H;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},J=Math.sin(l/10)/Math.sin(7*l/10),K=Math.sin(f/10)*J,Q=-Math.cos(f/10)*J,U={draw:function(t,i){var n=Math.sqrt(.8908130915292852*i),e=K*n,s=Q*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;h<5;++h){var o=f*h/5,_=Math.cos(o),r=Math.sin(o);t.lineTo(r*n,-_*n),t.lineTo(_*e-r*s,r*e+_*s)}t.closePath()}},Z={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},$=Math.sqrt(3),tt={draw:function(t,i){var n=-Math.sqrt(i/(3*$));t.moveTo(0,2*n),t.lineTo(-$*n,-n),t.lineTo($*n,-n),t.closePath()}},it=-.5,nt=Math.sqrt(3)/2,et=1/Math.sqrt(12),st=3*(et/2+1),ht={draw:function(t,i){var n=Math.sqrt(i/st),e=n/2,s=n*et,h=e,o=n*et+n,_=-h,r=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,r),t.lineTo(it*e-nt*s,nt*e+it*s),t.lineTo(it*h-nt*o,nt*h+it*o),t.lineTo(it*_-nt*r,nt*_+it*r),t.lineTo(it*e+nt*s,it*s-nt*e),t.lineTo(it*h+nt*o,it*o-nt*h),t.lineTo(it*_+nt*r,it*r-nt*_),t.closePath()}},ot=[V,W,G,Z,U,tt,ht];function _t(){}function rt(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 at(t){this._context=t}function ct(t){this._context=t}function lt(t){this._context=t}function ut(t,i){this._basis=new at(t),this._beta=i}at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rt(this,this._x1,this._y1);case 2:this._context.lineTo(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;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},ct.prototype={areaStart:_t,areaEnd:_t,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x2=t,this._y2=i;break;case 1:this._point=2,this._x3=t,this._y3=i;break;case 2:this._point=3,this._x4=t,this._y4=i,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+i)/6);break;default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=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;var n=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+i)/6;this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 3:this._point=4;default:rt(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},ut.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,i=this._y,n=t.length-1;if(n>0)for(var e,s=t[0],h=i[0],o=t[n]-s,_=i[n]-h,r=-1;++r<=n;)e=r/n,this._basis.point(this._beta*t[r]+(1-this._beta)*(s+e*o),this._beta*i[r]+(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 ft=function t(i){function n(t){return 1===i?new at(t):new ut(t,i)}return n.beta=function(i){return t(+i)},n}(.85);function xt(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 yt(t,i){this._context=t,this._k=(1-i)/6}yt.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:xt(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:xt(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 pt=function t(i){function n(t){return new yt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function vt(t,i){this._context=t,this._k=(1-i)/6}vt.prototype={areaStart:_t,areaEnd:_t,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:xt(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 dt=function t(i){function n(t){return new vt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function Tt(t,i){this._context=t,this._k=(1-i)/6}Tt.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:xt(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 Tt(t,i)}return n.tension=function(i){return t(+i)},n}(0);function bt(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>c){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,r=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/r,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/r}if(t._l23_a>c){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*a+t._x1*t._l23_2a-i*t._l12_2a)/l,o=(o*a+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function wt(t,i){this._context=t,this._alpha=i}wt.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:bt(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 wt(t,i):new yt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function mt(t,i){this._context=t,this._alpha=i}mt.prototype={areaStart:_t,areaEnd:_t,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:bt(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 Nt=function t(i){function n(t){return i?new mt(t,i):new vt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Mt(t,i){this._context=t,this._alpha=i}Mt.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:bt(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 St=function t(i){function n(t){return i?new Mt(t,i):new Tt(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);function Et(t){this._context=t}function At(t){return t<0?-1:1}function Pt(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(At(h)+At(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function Ct(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function Rt(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 qt(t){this._context=t}function Ot(t){this._context=new zt(t)}function zt(t){this._context=t}function Xt(t){this._context=t}function Yt(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<e-1;++i)s[i]=1,h[i]=4,o[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,h[e-1]=7,o[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/h[i-1],h[i]-=n,o[i]-=n*o[i-1];for(s[e-1]=o[e-1]/h[e-1],i=e-2;i>=0;--i)s[i]=(o[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function Bt(t,i){this._context=t,this._t=i}function It(t,i){if((s=t.length)>1)for(var n,e,s,h=1,o=t[i[0]],_=o.length;h<s;++h)for(e=o,o=t[i[h]],n=0;n<_;++n)o[n][1]+=o[n][0]=isNaN(e[n][1])?e[n][0]:e[n][1]}function jt(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function Dt(t,i){return t[i]}function Lt(t){var i=t.map(Vt);return jt(t).sort(function(t,n){return i[t]-i[n]})}function Vt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}Et.prototype={areaStart:_t,areaEnd:_t,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))}},qt.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:Rt(this,this._t0,Ct(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(i=+i,(t=+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,Rt(this,Ct(this,n=Pt(this,t,i)),n);break;default:Rt(this,this._t0,n=Pt(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(Ot.prototype=Object.create(qt.prototype)).point=function(t,i){qt.prototype.point.call(this,i,t)},zt.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)}},Xt.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=Yt(t),s=Yt(i),h=0,o=1;o<n;++h,++o)this._context.bezierCurveTo(e[0][h],s[0][h],e[1][h],s[1][h],t[o],i[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}},Bt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=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}},t.arc=function(){var t=y,o=p,b=n(0),w=null,k=v,m=d,N=T,M=null;function S(){var n,y,p,v=+t.apply(this,arguments),d=+o.apply(this,arguments),T=k.apply(this,arguments)-u,S=m.apply(this,arguments)-u,E=e(S-T),A=S>T;if(M||(M=n=i.path()),d<v&&(y=d,d=v,v=y),d>c)if(E>f-c)M.moveTo(d*h(T),d*r(T)),M.arc(0,0,d,T,S,!A),v>c&&(M.moveTo(v*h(S),v*r(S)),M.arc(0,0,v,S,T,A));else{var P,C,R=T,q=S,O=T,z=S,X=E,Y=E,B=N.apply(this,arguments)/2,I=B>c&&(w?+w.apply(this,arguments):a(v*v+d*d)),j=_(e(d-v)/2,+b.apply(this,arguments)),D=j,L=j;if(I>c){var V=x(I/v*r(B)),W=x(I/d*r(B));(X-=2*V)>c?(O+=V*=A?1:-1,z-=V):(X=0,O=z=(T+S)/2),(Y-=2*W)>c?(R+=W*=A?1:-1,q-=W):(Y=0,R=q=(T+S)/2)}var H=d*h(R),F=d*r(R),G=v*h(z),J=v*r(z);if(j>c){var K,Q=d*h(q),U=d*r(q),Z=v*h(O),$=v*r(O);if(E<=f-c&&(K=function(t,i,n,e,s,h,o,_){var r=n-t,a=e-i,l=o-s,u=_-h,f=u*r-l*a;if(!(f*f<c))return[t+(f=(l*(i-h)-u*(t-s))/f)*r,i+f*a]}(H,F,Z,$,Q,U,G,J))){var tt=H-K[0],it=F-K[1],nt=Q-K[0],et=U-K[1],st=1/r(((p=(tt*nt+it*et)/(a(tt*tt+it*it)*a(nt*nt+et*et)))>1?0:p<-1?l:Math.acos(p))/2),ht=a(K[0]*K[0]+K[1]*K[1]);D=_(j,(v-ht)/(st-1)),L=_(j,(d-ht)/(st+1))}}Y>c?L>c?(P=g(Z,$,H,F,d,L,A),C=g(Q,U,G,J,d,L,A),M.moveTo(P.cx+P.x01,P.cy+P.y01),L<j?M.arc(P.cx,P.cy,L,s(P.y01,P.x01),s(C.y01,C.x01),!A):(M.arc(P.cx,P.cy,L,s(P.y01,P.x01),s(P.y11,P.x11),!A),M.arc(0,0,d,s(P.cy+P.y11,P.cx+P.x11),s(C.cy+C.y11,C.cx+C.x11),!A),M.arc(C.cx,C.cy,L,s(C.y11,C.x11),s(C.y01,C.x01),!A))):(M.moveTo(H,F),M.arc(0,0,d,R,q,!A)):M.moveTo(H,F),v>c&&X>c?D>c?(P=g(G,J,Q,U,v,-D,A),C=g(H,F,Z,$,v,-D,A),M.lineTo(P.cx+P.x01,P.cy+P.y01),D<j?M.arc(P.cx,P.cy,D,s(P.y01,P.x01),s(C.y01,C.x01),!A):(M.arc(P.cx,P.cy,D,s(P.y01,P.x01),s(P.y11,P.x11),!A),M.arc(0,0,v,s(P.cy+P.y11,P.cx+P.x11),s(C.cy+C.y11,C.cx+C.x11),A),M.arc(C.cx,C.cy,D,s(C.y11,C.x11),s(C.y01,C.x01),!A))):M.arc(0,0,v,z,O,A):M.lineTo(G,J)}else M.moveTo(0,0);if(M.closePath(),n)return M=null,n+""||null}return S.centroid=function(){var i=(+t.apply(this,arguments)+ +o.apply(this,arguments))/2,n=(+k.apply(this,arguments)+ +m.apply(this,arguments))/2-l/2;return[h(n)*i,r(n)*i]},S.innerRadius=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),S):t},S.outerRadius=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),S):o},S.cornerRadius=function(t){return arguments.length?(b="function"==typeof t?t:n(+t),S):b},S.padRadius=function(t){return arguments.length?(w=null==t?null:"function"==typeof t?t:n(+t),S):w},S.startAngle=function(t){return arguments.length?(k="function"==typeof t?t:n(+t),S):k},S.endAngle=function(t){return arguments.length?(m="function"==typeof t?t:n(+t),S):m},S.padAngle=function(t){return arguments.length?(N="function"==typeof t?t:n(+t),S):N},S.context=function(t){return arguments.length?(M=null==t?null:t,S):M},S},t.area=M,t.line=N,t.pie=function(){var t=E,i=S,e=null,s=n(0),h=n(f),o=n(0);function _(n){var _,r,a,c,l,u=n.length,x=0,y=new Array(u),p=new Array(u),v=+s.apply(this,arguments),d=Math.min(f,Math.max(-f,h.apply(this,arguments)-v)),T=Math.min(Math.abs(d)/u,o.apply(this,arguments)),g=T*(d<0?-1:1);for(_=0;_<u;++_)(l=p[y[_]=_]=+t(n[_],_,n))>0&&(x+=l);for(null!=i?y.sort(function(t,n){return i(p[t],p[n])}):null!=e&&y.sort(function(t,i){return e(n[t],n[i])}),_=0,a=x?(d-u*g)/x:0;_<u;++_,v=c)r=y[_],c=v+((l=p[r])>0?l*a:0)+g,p[r]={data:n[r],index:_,value:l,startAngle:v,endAngle:c,padAngle:T};return p}return _.value=function(i){return arguments.length?(t="function"==typeof i?i:n(+i),_):t},_.sortValues=function(t){return arguments.length?(i=t,e=null,_):i},_.sort=function(t){return arguments.length?(e=t,i=null,_):e},_.startAngle=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),_):s},_.endAngle=function(t){return arguments.length?(h="function"==typeof t?t:n(+t),_):h},_.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:n(+t),_):o},_},t.areaRadial=O,t.radialArea=O,t.lineRadial=q,t.radialLine=q,t.pointRadial=z,t.linkHorizontal=function(){return I(j)},t.linkVertical=function(){return I(D)},t.linkRadial=function(){var t=I(L);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.symbol=function(){var t=n(V),e=n(64),s=null;function h(){var n;if(s||(s=n=i.path()),t.apply(this,arguments).draw(s,+e.apply(this,arguments)),n)return s=null,n+""||null}return h.type=function(i){return arguments.length?(t="function"==typeof i?i:n(i),h):t},h.size=function(t){return arguments.length?(e="function"==typeof t?t:n(+t),h):e},h.context=function(t){return arguments.length?(s=null==t?null:t,h):s},h},t.symbols=ot,t.symbolCircle=V,t.symbolCross=W,t.symbolDiamond=G,t.symbolSquare=Z,t.symbolStar=U,t.symbolTriangle=tt,t.symbolWye=ht,t.curveBasisClosed=function(t){return new ct(t)},t.curveBasisOpen=function(t){return new lt(t)},t.curveBasis=function(t){return new at(t)},t.curveBundle=ft,t.curveCardinalClosed=dt,t.curveCardinalOpen=gt,t.curveCardinal=pt,t.curveCatmullRomClosed=Nt,t.curveCatmullRomOpen=St,t.curveCatmullRom=kt,t.curveLinearClosed=function(t){return new Et(t)},t.curveLinear=w,t.curveMonotoneX=function(t){return new qt(t)},t.curveMonotoneY=function(t){return new Ot(t)},t.curveNatural=function(t){return new Xt(t)},t.curveStep=function(t){return new Bt(t,.5)},t.curveStepAfter=function(t){return new Bt(t,1)},t.curveStepBefore=function(t){return new Bt(t,0)},t.stack=function(){var t=n([]),i=jt,e=It,s=Dt;function h(n){var h,o,_=t.apply(this,arguments),r=n.length,a=_.length,c=new Array(a);for(h=0;h<a;++h){for(var l,u=_[h],f=c[h]=new Array(r),x=0;x<r;++x)f[x]=l=[0,+s(n[x],u,x,n)],l.data=n[x];f.key=u}for(h=0,o=i(c);h<a;++h)c[o[h]].index=h;return e(c,o),c}return h.keys=function(i){return arguments.length?(t="function"==typeof i?i:n(X.call(i)),h):t},h.value=function(t){return arguments.length?(s="function"==typeof t?t:n(+t),h):s},h.order=function(t){return arguments.length?(i=null==t?jt:"function"==typeof t?t:n(X.call(t)),h):i},h.offset=function(t){return arguments.length?(e=null==t?It:t,h):e},h},t.stackOffsetExpand=function(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;h<o;++h){for(s=n=0;n<e;++n)s+=t[n][h][1]||0;if(s)for(n=0;n<e;++n)t[n][h][1]/=s}It(t,i)}},t.stackOffsetDiverging=function(t,i){if((_=t.length)>1)for(var n,e,s,h,o,_,r=0,a=t[i[0]].length;r<a;++r)for(h=o=0,n=0;n<_;++n)(s=(e=t[i[n]][r])[1]-e[0])>=0?(e[0]=h,e[1]=h+=s):s<0?(e[1]=o,e[0]=o+=s):e[0]=h},t.stackOffsetNone=It,t.stackOffsetSilhouette=function(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;e<h;++e){for(var o=0,_=0;o<n;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}It(t,i)}},t.stackOffsetWiggle=function(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;o<e;++o){for(var _=0,r=0,a=0;_<s;++_){for(var c=t[i[_]],l=c[o][1]||0,u=(l-(c[o-1][1]||0))/2,f=0;f<_;++f){var x=t[i[f]];u+=(x[o][1]||0)-(x[o-1][1]||0)}r+=l,a+=u*l}n[o-1][1]+=n[o-1][0]=h,r&&(h-=a/r)}n[o-1][1]+=n[o-1][0]=h,It(t,i)}},t.stackOrderAscending=Lt,t.stackOrderDescending=function(t){return Lt(t).reverse()},t.stackOrderInsideOut=function(t){var i,n,e=t.length,s=t.map(Vt),h=jt(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,r=[],a=[];for(i=0;i<e;++i)n=h[i],o<_?(o+=s[n],r.push(n)):(_+=s[n],a.push(n));return a.reverse().concat(r)},t.stackOrderNone=jt,t.stackOrderReverse=function(t){return jt(t).reverse()},Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-shape", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Graphical primitives for visualization, such as lines and areas.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -28,3 +28,5 @@ import {path} from "d3-path"; | ||
x32 = x3 - x2, y32 = y3 - y2, | ||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / (y32 * x10 - x32 * y10); | ||
t = y32 * x10 - x32 * y10; | ||
if (t * t < epsilon) return; | ||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t; | ||
return [x0 + t * x10, y0 + t * y10]; | ||
@@ -150,8 +152,8 @@ } | ||
x00 = r0 * cos(a00), | ||
y00 = r0 * sin(a00); | ||
y00 = r0 * sin(a00), | ||
oc; | ||
// Restrict the corner radius according to the sector angle. | ||
if (da < pi) { | ||
var oc = da0 > epsilon ? intersect(x01, y01, x00, y00, x11, y11, x10, y10) : [x10, y10], | ||
ax = x01 - oc[0], | ||
if (da <= tau - epsilon && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) { | ||
var ax = x01 - oc[0], | ||
ay = y01 - oc[1], | ||
@@ -158,0 +160,0 @@ bx = x11 - oc[0], |
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
262764
3532