This repository has been archived by the owner on Jun 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 148
/
d3-shape.v0.3.min.js
1 lines (1 loc) · 25.4 KB
/
d3-shape.v0.3.min.js
1
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("d3-path")):"function"==typeof define&&define.amd?define("d3-shape",["exports","d3-path"],i):i(t.d3_shape={},t.d3_path)}(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 _(t){return t.endAngle}function o(t){return t&&t.padAngle}function a(t){return t>=1?Et:-1>=t?-Et:Math.asin(t)}function r(t,i,n,e,s,h,_,o){var a=n-t,r=e-i,l=_-s,u=o-h,c=(l*(i-h)-u*(t-s))/(u*a-l*r);return[t+c*a,i+c*r]}function l(t,i,n,e,s,h,_){var o=t-n,a=i-e,r=(_?h:-h)/Math.sqrt(o*o+a*a),l=r*a,u=-r*o,c=t+l,f=i+u,x=n+l,y=e+u,p=(c+x)/2,d=(f+y)/2,g=x-c,v=y-f,m=g*g+v*v,T=s-h,M=c*y-x*f,b=(0>v?-1:1)*Math.sqrt(Math.max(0,T*T*m-M*M)),w=(M*v-g*b)/m,k=(-M*g-v*b)/m,N=(M*v+g*b)/m,E=(-M*g+v*b)/m,S=w-p,A=k-d,P=N-p,q=E-d;return S*S+A*A>P*P+q*q&&(w=N,k=E),{cx:w,cy:k,x01:-l,y01:-u,x11:w*(s/T-1),y11:k*(s/T-1)}}function u(){function t(){var t,n,e=+u.apply(this,arguments),s=+c.apply(this,arguments),h=y.apply(this,arguments)-Et,_=p.apply(this,arguments)-Et,o=Math.abs(_-h),v=_>h;if(g||(g=t=i.path()),e>s&&(n=s,s=e,e=n),s>kt)if(o>St-kt)g.moveTo(s*Math.cos(h),s*Math.sin(h)),g.arc(0,0,s,h,_,!v),e>kt&&(g.moveTo(e*Math.cos(_),e*Math.sin(_)),g.arc(0,0,e,_,h,v));else{var m=h,T=_,M=h,b=_,w=o,k=o,N=d.apply(this,arguments)/2,E=N>kt&&(x?+x.apply(this,arguments):Math.sqrt(e*e+s*s)),S=Math.min(Math.abs(s-e)/2,+f.apply(this,arguments)),A=S,P=S;if(E>kt){var q=a(E/e*Math.sin(N)),R=a(E/s*Math.sin(N));(w-=2*q)>kt?(q*=v?1:-1,M+=q,b-=q):(w=0,M=b=(h+_)/2),(k-=2*R)>kt?(R*=v?1:-1,m+=R,T-=R):(k=0,m=T=(h+_)/2)}var C=s*Math.cos(m),z=s*Math.sin(m),O=e*Math.cos(b),D=e*Math.sin(b);if(S>kt){var I=s*Math.cos(T),j=s*Math.sin(T),B=e*Math.cos(M),L=e*Math.sin(M);if(Nt>o){var V=w>kt?r(C,z,B,L,I,j,O,D):[O,D],W=C-V[0],Z=z-V[1],F=I-V[0],G=j-V[1],H=1/Math.sin(Math.acos((W*F+Z*G)/(Math.sqrt(W*W+Z*Z)*Math.sqrt(F*F+G*G)))/2),J=Math.sqrt(V[0]*V[0]+V[1]*V[1]);A=Math.min(S,(e-J)/(H-1)),P=Math.min(S,(s-J)/(H+1))}}if(k>kt)if(P>kt){var K=l(B,L,C,z,s,P,v),Q=l(I,j,O,D,s,P,v);g.moveTo(K.cx+K.x01,K.cy+K.y01),S>P?g.arc(K.cx,K.cy,P,Math.atan2(K.y01,K.x01),Math.atan2(Q.y01,Q.x01),!v):(g.arc(K.cx,K.cy,P,Math.atan2(K.y01,K.x01),Math.atan2(K.y11,K.x11),!v),g.arc(0,0,s,Math.atan2(K.cy+K.y11,K.cx+K.x11),Math.atan2(Q.cy+Q.y11,Q.cx+Q.x11),!v),g.arc(Q.cx,Q.cy,P,Math.atan2(Q.y11,Q.x11),Math.atan2(Q.y01,Q.x01),!v))}else g.moveTo(C,z),g.arc(0,0,s,m,T,!v);else g.moveTo(C,z);if(e>kt&&w>kt)if(A>kt){var K=l(O,D,I,j,e,-A,v),Q=l(C,z,B,L,e,-A,v);g.lineTo(K.cx+K.x01,K.cy+K.y01),S>A?g.arc(K.cx,K.cy,A,Math.atan2(K.y01,K.x01),Math.atan2(Q.y01,Q.x01),!v):(g.arc(K.cx,K.cy,A,Math.atan2(K.y01,K.x01),Math.atan2(K.y11,K.x11),!v),g.arc(0,0,e,Math.atan2(K.cy+K.y11,K.cx+K.x11),Math.atan2(Q.cy+Q.y11,Q.cx+Q.x11),v),g.arc(Q.cx,Q.cy,A,Math.atan2(Q.y11,Q.x11),Math.atan2(Q.y01,Q.x01),!v))}else g.arc(0,0,e,b,M,v);else g.lineTo(O,D)}else g.moveTo(0,0);return g.closePath(),t?(g=null,t+""||null):void 0}var u=e,c=s,f=n(0),x=null,y=h,p=_,d=o,g=null,v=null;return t.centroid=function(){var t=(+u.apply(this,arguments)+ +c.apply(this,arguments))/2,i=(+y.apply(this,arguments)+ +p.apply(this,arguments))/2-Nt/2;return[Math.cos(i)*t,Math.sin(i)*t]},t.innerRadius=function(i){return arguments.length?(u="function"==typeof i?i:n(+i),t):u},t.outerRadius=function(i){return arguments.length?(c="function"==typeof i?i:n(+i),t):c},t.cornerRadius=function(i){return arguments.length?(f="function"==typeof i?i:n(+i),t):f},t.padRadius=function(i){return arguments.length?(x=null==i?null:"function"==typeof i?i:n(+i),t):x},t.startAngle=function(i){return arguments.length?(y="function"==typeof i?i:n(+i),t):y},t.endAngle=function(i){return arguments.length?(p="function"==typeof i?i:n(+i),t):p},t.padAngle=function(i){return arguments.length?(d="function"==typeof i?i:n(+i),t):d},t.context=function(i){return arguments.length?(g=v=null==i?null:i,t):g},t}function c(t,i){return i.length<2?t:(i=At.call(i),i[0]=null,function(n){return i[0]=n,t.apply(null,i)})}function f(t){this._context=t}function x(t){return new f(t)}function y(t){return t[0]}function p(t){return t[1]}function d(){function t(t){var n,u,c,f,x,y=t.length,p=!1,d=new Array(y),g=new Array(y);for(a||(l=r(x=i.path())),n=0;y>=n;++n){if(!(y>n&&o(f=t[n],n,t))===p)if(p=!p)u=n,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),c=n-1;c>=u;--c)l.point(d[c],g[c]);l.lineEnd(),l.areaEnd()}p&&(d[n]=+e(f,n,t),g[n]=+h(f,n,t),l.point(s?+s(f,n,t):d[n],_?+_(f,n,t):g[n]))}return x?(l=null,x+""||null):void 0}var e=y,s=null,h=n(0),_=p,o=n(!0),a=null,r=x,l=null;return t.x=function(i){return arguments.length?(e="function"==typeof i?i:n(+i),s=null,t):e},t.x0=function(i){return arguments.length?(e="function"==typeof i?i:n(+i),t):e},t.x1=function(i){return arguments.length?(s=null==i?null:"function"==typeof i?i:n(+i),t):s},t.y=function(i){return arguments.length?(h="function"==typeof i?i:n(+i),_=null,t):h},t.y0=function(i){return arguments.length?(h="function"==typeof i?i:n(+i),t):h},t.y1=function(i){return arguments.length?(_=null==i?null:"function"==typeof i?i:n(+i),t):_},t.defined=function(i){return arguments.length?(o="function"==typeof i?i:n(!!i),t):o},t.curve=function(i){return arguments.length?(r=c(i,arguments),null!=a&&(l=r(a)),t):r},t.context=function(i){return arguments.length?(null==i?a=l=null:l=r(a=i),t):a},t}function g(){function t(t){var n,r,l,u=t.length,c=!1;for(_||(a=o(l=i.path())),n=0;u>=n;++n)!(u>n&&h(r=t[n],n,t))===c&&((c=!c)?a.lineStart():a.lineEnd()),c&&a.point(+e(r,n,t),+s(r,n,t));return l?(a=null,l+""||null):void 0}var e=y,s=p,h=n(!0),_=null,o=x,a=null;return t.x=function(i){return arguments.length?(e="function"==typeof i?i:n(+i),t):e},t.y=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),t):s},t.defined=function(i){return arguments.length?(h="function"==typeof i?i:n(!!i),t):h},t.curve=function(i){return arguments.length?(o=c(i,arguments),null!=_&&(a=o(_)),t):o},t.context=function(i){return arguments.length?(null==i?_=a=null:a=o(_=i),t):_},t}function v(t,i){return t>i?-1:i>t?1:i>=t?0:NaN}function m(t){return t}function T(){function t(t){for(var n,a,r=t.length,l=0,u=new Array(r),c=new Array(r),f=+h.apply(this,arguments),x=Math.min(St,Math.max(-St,_.apply(this,arguments)-f)),y=Math.min(Math.abs(x)/r,o.apply(this,arguments)),p=y*(0>x?-1:1),d=0;r>d;++d)(a=c[u[d]=d]=+i(t[d],d,t))>0&&(l+=a);null!=e?u.sort(function(t,i){return e(c[t],c[i])}):null!==s&&u.sort(function(i,n){return s(t[i],t[n])});for(var g,d=0,v=l?(x-r*p)/l:0;r>d;++d,f=n)g=u[d],a=c[g],n=f+(a>0?a*v:0)+p,c[g]={data:t[g],index:d,value:a,startAngle:f,endAngle:n,padAngle:y};return c}var i=m,e=v,s=null,h=n(0),_=n(St),o=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?(_="function"==typeof i?i:n(+i),t):_},t.padAngle=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),t):o},t}function M(t){this._curve=t}function b(t,i){function n(i){return new M(t(i))}return t=c(t,i),n._curve=t,n}function w(){var t=d(),i=t.curve;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.curve=function(t){return arguments.length?i(b(t,arguments)):i()._curve},t.curve(x)}function k(){var t=g(),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,arguments)):i()._curve},t.curve(x)}function N(){function t(){var t;return h||(h=t=i.path()),e.apply(this,arguments).draw(h,+s.apply(this,arguments)),t?(h=null,t+""||null):void 0}var e=n(Jt),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 E(){}function S(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 R(t){return new q(t)}function C(t){this._context=t}function z(t){return new C(t)}function O(t,i){this._basis=P(t),this._beta=i}function D(t,i){return null==i?new O(t,.85):1===(i=+i)?P(t):new O(t,i)}function I(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 j(t,i){this._context=t,this._k=i}function B(t,i){return new j(t,(null==i?1:1-i)/6)}function L(t,i){this._context=t,this._k=i}function V(t,i){return new L(t,(null==i?1:1-i)/6)}function W(t,i){this._context=t,this._k=i}function Z(t,i){return new W(t,(null==i?1:1-i)/6)}function F(t,i,n){var e=t._x1,s=t._y1,h=t._x2,_=t._y2;if(t._l01_a>kt){var o=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*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,s=(s*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>kt){var r=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*r+t._x1*t._l23_2a-i*t._l12_2a)/l,_=(_*r+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,s,h,_,t._x2,t._y2)}function G(t,i){this._context=t,this._alpha=i}function H(t,i){return(i=null==i?.5:+i)?new G(t,i):B(t,0)}function J(t,i){this._context=t,this._alpha=i}function K(t,i){return(i=null==i?.5:+i)?new J(t,i):V(t,0)}function Q(t,i){this._context=t,this._alpha=i}function U(t,i){return(i=null==i?.5:+i)?new Q(t,i):Z(t,0)}function X(t){this._context=t}function Y(t){return new X(t)}function $(t){return 0>t?-1:1}function tt(t,i,n){var e=t._x1-t._x0,s=i-t._x1,h=(t._y1-t._y0)/e,_=(n-t._y1)/s,o=(h*s+_*e)/(e+s);return($(h)+$(_))*Math.min(Math.abs(h),Math.abs(_),.5*Math.abs(o))||0}function it(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function nt(t,i,n){var e=t._x0,s=t._y0,h=t._x1,_=t._y1,o=(h-e)/3;t._context.bezierCurveTo(e+o,s+o*i,h-o,_-o*n,h,_)}function et(t){this._context=t}function st(t){return new et(t)}function ht(t){this._context=t}function _t(t){var i,n,e=t.length-1,s=new Array(e),h=new Array(e),_=new Array(e);for(s[0]=0,h[0]=2,_[0]=t[0]+2*t[1],i=1;e-1>i;++i)s[i]=1,h[i]=4,_[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,h[e-1]=7,_[e-1]=8*t[e-1]+t[e],i=1;e>i;++i)n=s[i]/h[i-1],h[i]-=n,_[i]-=n*_[i-1];for(s[e-1]=_[e-1]/h[e-1],i=e-2;i>=0;--i)s[i]=(_[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;e-1>i;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function ot(t){return new ht(t)}function at(t,i){this._context=t,this._t=i}function rt(t){return new at(t,.5)}function lt(t){return new at(t,0)}function ut(t){return new at(t,1)}function ct(t,i){if((e=t.length)>1)for(var n,e,s=1,h=t[i[0]],_=h.length;e>s;++s){n=h,h=t[i[s]];for(var o=0;_>o;++o)h[o][1]+=h[o][0]=n[o][1]}}function ft(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function xt(t,i){return t[i]}function yt(){function t(t){for(var n=i.apply(this,arguments),_=t.length,o=n.length,a=new Array(o),r=0;o>r;++r){for(var l,u=n[r],c=a[r]=new Array(_),f=0;_>f;++f)c[f]=l=[0,+h(t[f],u,f,t)],l.data=t[f];c.key=u}for(var r=0,x=e(a);o>r;++r)a[x[r]].index=r;return s(a,x),a}var i=n([]),e=ft,s=ct,h=xt;return t.keys=function(e){return arguments.length?(i="function"==typeof e?e:n(Qt.call(e)),t):i},t.value=function(i){return arguments.length?(h="function"==typeof i?i:n(+i),t):h},t.order=function(i){return arguments.length?(e=null==i?orderDefault:"function"==typeof i?i:n(Qt.call(i)),t):e},t.offset=function(i){return arguments.length?(s=null==i?offsetZero:i,t):s},t}function pt(t,i){if((n=t.length)>0){for(var n,e=0,s=t[0].length;s>e;++e){for(var h=0,_=0;n>h;++h)_+=t[h][e][1];for(var h=0;n>h;++h)t[h][e][1]/=_}ct(t,i)}}function dt(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;h>e;++e){for(var _=0,o=0;n>_;++_)o+=t[_][e][1];s[e][1]+=s[e][0]=-o/2}ct(t,i)}}function gt(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,_=1;e>_;++_){for(var o=0,a=0,r=0;s>o;++o){for(var l,u=t[i[o]],c=(u[_][1]-u[_-1][1])/2,f=0;o>f;++f)l=t[i[f]],c+=l[_][1]-l[_-1][1];a+=u[_][1],r+=c*u[_][1]}n[_-1][1]+=n[_-1][0]=h,a&&(h-=r/a)}n[_-1][1]+=n[_-1][0]=h,ct(t,i)}}function vt(t){var i=t.map(mt);return ft(t).sort(function(t,n){return i[t]-i[n]})}function mt(t){return t.reduce(Tt,0)}function Tt(t,i){return t+i[1]}function Mt(t){return vt(t).reverse()}function bt(t){var i,n,e=t.length,s=t.map(mt),h=ft(t).sort(function(t,i){return s[i]-s[t]}),_=0,o=0,a=[],r=[];for(i=0;e>i;++i)n=h[i],o>_?(_+=s[n],a.push(n)):(o+=s[n],r.push(n));return r.reverse().concat(a)}function wt(t){return ft(t).reverse()}var kt=1e-12,Nt=Math.PI,Et=Nt/2,St=2*Nt,At=Array.prototype.slice;f.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)}}},M.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){t-=Et,this._curve.point(i*Math.cos(t),i*Math.sin(t))}};var Pt=-.5,qt=Math.sqrt(3)/2,Rt=1/Math.sqrt(12),Ct=3*(Rt/2+1),zt={draw:function(t,i){var n=Math.sqrt(i/Ct),e=n/2,s=n*Rt,h=e,_=n*Rt+n,o=-h,a=_;t.moveTo(e,s),t.lineTo(h,_),t.lineTo(o,a),t.lineTo(Pt*e-qt*s,qt*e+Pt*s),t.lineTo(Pt*h-qt*_,qt*h+Pt*_),t.lineTo(Pt*o-qt*a,qt*o+Pt*a),t.lineTo(Pt*e+qt*s,Pt*s-qt*e),t.lineTo(Pt*h+qt*_,Pt*_-qt*h),t.lineTo(Pt*o+qt*a,Pt*a-qt*o),t.closePath()}},Ot=Math.sqrt(3),Dt={draw:function(t,i){var n=-Math.sqrt(i/(3*Ot));t.moveTo(0,2*n),t.lineTo(-Ot*n,-n),t.lineTo(Ot*n,-n),t.closePath()}},It=.8908130915292852,jt=Math.sin(Nt/10)/Math.sin(7*Nt/10),Bt=Math.sin(St/10)*jt,Lt=-Math.cos(St/10)*jt,Vt={draw:function(t,i){var n=Math.sqrt(i*It),e=Bt*n,s=Lt*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;5>h;++h){var _=St*h/5,o=Math.cos(_),a=Math.sin(_);t.lineTo(a*n,-o*n),t.lineTo(o*e-a*s,a*e+o*s)}t.closePath()}},Wt={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},Zt=Math.sqrt(1/3),Ft=2*Zt,Gt={draw:function(t,i){var n=Math.sqrt(i/Ft),e=n*Zt;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},Ht={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()}},Jt={draw:function(t,i){var n=Math.sqrt(i/Nt);t.moveTo(n,0),t.arc(0,0,n,0,St)}},Kt=[Jt,Ht,Gt,Wt,Vt,Dt,zt];A.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:S(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:S(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},q.prototype={areaStart:E,areaEnd:E,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:S(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},C.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:S(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},O.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],_=t[n]-s,o=i[n]-h,a=-1;++a<=n;)e=a/n,this._basis.point(this._beta*t[a]+(1-this._beta)*(s+e*_),this._beta*i[a]+(1-this._beta)*(h+e*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,i){this._x.push(+t),this._y.push(+i)}},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(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:I(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:I(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}},L.prototype={areaStart:E,areaEnd:E,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:I(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}},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._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:I(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}},G.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,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:F(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}},J.prototype={areaStart:E,areaEnd:E,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:F(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}},Q.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:F(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}},X.prototype={areaStart:E,areaEnd:E,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))}},et.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:nt(this,this._t0,it(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,nt(this,it(this,n=tt(this,t,i)),n);break;default:nt(this,this._t0,n=tt(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},ht.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=_t(t),s=_t(i),h=0,_=1;n>_;++h,++_)this._context.bezierCurveTo(e[0][h],s[0][h],e[1][h],s[1][h],t[_],i[_]);(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)}},at.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=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:var n=t>this._x?this._t:1-this._t;if(0>=n)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else if(n>=1)this._context.lineTo(t,this._y),this._context.lineTo(t,i);else{var e=(this._x+t)*n;this._context.lineTo(e,this._y),this._context.lineTo(e,i)}}this._x=t,this._y=i}};var Qt=Array.prototype.slice,Ut="0.3.0";t.version=Ut,t.arc=u,t.area=d,t.line=g,t.pie=T,t.radialArea=w,t.radialLine=k,t.symbol=N,t.symbols=Kt,t.circle=Jt,t.cross=Ht,t.diamond=Gt,t.square=Wt,t.star=Vt,t.triangle=Dt,t.wye=zt,t.basisClosed=R,t.basisOpen=z,t.basis=P,t.bundle=D,t.cardinalClosed=V,t.cardinalOpen=Z,t.cardinal=B,t.catmullRomClosed=K,t.catmullRomOpen=U,t.catmullRom=H,t.linearClosed=Y,t.linear=x,t.monotone=st,t.natural=ot,t.step=rt,t.stepAfter=ut,t.stepBefore=lt,t.stack=yt,t.offsetExpand=pt,t.offsetNone=ct,t.offsetSilhouette=dt,t.offsetWiggle=gt,t.orderAscending=vt,t.orderDescending=Mt,t.orderInsideOut=bt,t.orderNone=ft,t.orderReverse=wt});