Comparing version 0.5.1 to 0.6.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-path'], factory) : | ||
(factory((global.d3_shape = {}),global.d3_path)); | ||
(factory((global.d3_shape = global.d3_shape || {}),global.d3_path)); | ||
}(this, function (exports,d3Path) { 'use strict'; | ||
var version = "0.6.0"; | ||
function constant(x) { | ||
@@ -278,14 +280,2 @@ return function constant() { | ||
var slice = Array.prototype.slice; | ||
function bind(curve, args) { | ||
if (args.length < 2) return curve; | ||
args = slice.call(args); | ||
args[0] = null; | ||
return function(context) { | ||
args[0] = context; | ||
return curve.apply(null, args); | ||
}; | ||
} | ||
function Linear(context) { | ||
@@ -323,7 +313,7 @@ this._context = context; | ||
function x(p) { | ||
function pointX(p) { | ||
return p[0]; | ||
} | ||
function y(p) { | ||
function pointY(p) { | ||
return p[1]; | ||
@@ -333,6 +323,6 @@ } | ||
function area() { | ||
var x0 = x, | ||
var x0 = pointX, | ||
x1 = null, | ||
y0 = constant(0), | ||
y1 = y, | ||
y1 = pointY, | ||
defined = constant(true), | ||
@@ -354,3 +344,3 @@ context = null, | ||
if (!context) output = curve(buffer = d3Path.path()); | ||
if (context == null) output = curve(buffer = d3Path.path()); | ||
@@ -411,3 +401,3 @@ for (i = 0; i <= n; ++i) { | ||
area.curve = function(_) { | ||
return arguments.length ? (curve = bind(_, arguments), context != null && (output = curve(context)), area) : curve; | ||
return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; | ||
}; | ||
@@ -423,4 +413,4 @@ | ||
function line() { | ||
var x$$ = x, | ||
y$$ = y, | ||
var x = pointX, | ||
y = pointY, | ||
defined = constant(true), | ||
@@ -438,3 +428,3 @@ context = null, | ||
if (!context) output = curve(buffer = d3Path.path()); | ||
if (context == null) output = curve(buffer = d3Path.path()); | ||
@@ -446,3 +436,3 @@ for (i = 0; i <= n; ++i) { | ||
} | ||
if (defined0) output.point(+x$$(d, i, data), +y$$(d, i, data)); | ||
if (defined0) output.point(+x(d, i, data), +y(d, i, data)); | ||
} | ||
@@ -454,7 +444,7 @@ | ||
line.x = function(_) { | ||
return arguments.length ? (x$$ = typeof _ === "function" ? _ : constant(+_), line) : x$$; | ||
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), line) : x; | ||
}; | ||
line.y = function(_) { | ||
return arguments.length ? (y$$ = typeof _ === "function" ? _ : constant(+_), line) : y$$; | ||
return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), line) : y; | ||
}; | ||
@@ -467,3 +457,3 @@ | ||
line.curve = function(_) { | ||
return arguments.length ? (curve = bind(_, arguments), context != null && (output = curve(context)), line) : curve; | ||
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; | ||
}; | ||
@@ -478,3 +468,3 @@ | ||
function descending$1(a, b) { | ||
function descending(a, b) { | ||
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; | ||
@@ -489,3 +479,3 @@ } | ||
var value = identity, | ||
sortValues = descending$1, | ||
sortValues = descending, | ||
sort = null, | ||
@@ -581,8 +571,7 @@ startAngle = constant(0), | ||
point: function(a, r) { | ||
a -= halfPi, this._curve.point(r * Math.cos(a), r * Math.sin(a)); | ||
this._curve.point(r * Math.sin(a), r * -Math.cos(a)); | ||
} | ||
}; | ||
function curveRadial(curve, args) { | ||
curve = bind(curve, args); | ||
function curveRadial(curve) { | ||
@@ -610,3 +599,3 @@ function radial(context) { | ||
a.curve = function(_) { | ||
return arguments.length ? c(curveRadial(_, arguments)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -625,3 +614,3 @@ | ||
l.curve = function(_) { | ||
return arguments.length ? c(curveRadial(_, arguments)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -921,3 +910,3 @@ | ||
function Bundle(context, beta) { | ||
this._basis = basis(context); | ||
this._basis = new Basis(context); | ||
this._beta = beta; | ||
@@ -963,8 +952,15 @@ } | ||
function bundle(context, beta) { | ||
return beta == null ? new Bundle(context, 0.85) | ||
: (beta = +beta) === 1 ? basis(context) | ||
: new Bundle(context, beta); | ||
} | ||
var bundle = (function custom(beta) { | ||
function bundle(context) { | ||
return beta === 1 ? new Basis(context) : new Bundle(context, beta); | ||
} | ||
bundle.beta = function(beta) { | ||
return custom(+beta); | ||
}; | ||
return bundle; | ||
})(0.85); | ||
function point$1(that, x, y) { | ||
@@ -981,5 +977,5 @@ that._context.bezierCurveTo( | ||
function Cardinal(context, k) { | ||
function Cardinal(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -1020,9 +1016,18 @@ | ||
function cardinal(context, tension) { | ||
return new Cardinal(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
var cardinal = (function custom(tension) { | ||
function CardinalClosed(context, k) { | ||
function cardinal(context) { | ||
return new Cardinal(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); | ||
function CardinalClosed(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -1071,9 +1076,18 @@ | ||
function cardinalClosed(context, tension) { | ||
return new CardinalClosed(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
var cardinalClosed = (function custom(tension) { | ||
function CardinalOpen(context, k) { | ||
function cardinal(context) { | ||
return new CardinalClosed(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); | ||
function CardinalOpen(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -1111,6 +1125,15 @@ | ||
function cardinalOpen(context, tension) { | ||
return new CardinalOpen(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
var cardinalOpen = (function custom(tension) { | ||
function cardinal(context) { | ||
return new CardinalOpen(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); | ||
function point$2(that, x, y) { | ||
@@ -1189,8 +1212,15 @@ var x1 = that._x1, | ||
function catmullRom(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRom(context, alpha) | ||
: cardinal(context, 0); | ||
} | ||
var catmullRom = (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); | ||
function CatmullRomClosed(context, alpha) { | ||
@@ -1254,8 +1284,15 @@ this._context = context; | ||
function catmullRomClosed(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRomClosed(context, alpha) | ||
: cardinalClosed(context, 0); | ||
} | ||
var catmullRomClosed = (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); | ||
function CatmullRomOpen(context, alpha) { | ||
@@ -1308,8 +1345,15 @@ this._context = context; | ||
function catmullRomOpen(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRomOpen(context, alpha) | ||
: cardinalOpen(context, 0); | ||
} | ||
var catmullRomOpen = (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); | ||
function LinearClosed(context) { | ||
@@ -1568,3 +1612,3 @@ this._context = context; | ||
var slice$1 = Array.prototype.slice; | ||
var slice = Array.prototype.slice; | ||
@@ -1622,3 +1666,3 @@ function none(series, order) { | ||
stack.keys = function(_) { | ||
return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice$1.call(_)), stack) : keys; | ||
return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys; | ||
}; | ||
@@ -1631,3 +1675,3 @@ | ||
stack.order = function(_) { | ||
return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice$1.call(_)), stack) : order; | ||
return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order; | ||
}; | ||
@@ -1694,3 +1738,3 @@ | ||
function descending(series) { | ||
function descending$1(series) { | ||
return ascending(series).reverse(); | ||
@@ -1728,4 +1772,2 @@ } | ||
var version = "0.5.1"; | ||
exports.version = version; | ||
@@ -1771,3 +1813,3 @@ exports.arc = arc; | ||
exports.stackOrderAscending = ascending; | ||
exports.stackOrderDescending = descending; | ||
exports.stackOrderDescending = descending$1; | ||
exports.stackOrderInsideOut = insideOut; | ||
@@ -1774,0 +1816,0 @@ exports.stackOrderNone = none$1; |
@@ -1,1 +0,1 @@ | ||
!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_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 o(t){return t.endAngle}function _(t){return t&&t.padAngle}function a(t){return t>=1?At:-1>=t?-At:Math.asin(t)}function r(t,i,n,e,s,h,o,_){var a=n-t,r=e-i,c=o-s,u=_-h,l=(c*(i-h)-u*(t-s))/(u*a-c*r);return[t+l*a,i+l*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,u=-r*_,l=t+c,f=i+u,x=n+c,y=e+u,p=(l+x)/2,v=(f+y)/2,g=x-l,d=y-f,m=g*g+d*d,T=s-h,M=l*y-x*f,b=(0>d?-1:1)*Math.sqrt(Math.max(0,T*T*m-M*M)),w=(M*d-g*b)/m,k=(-M*g-d*b)/m,N=(M*d+g*b)/m,S=(-M*g+d*b)/m,E=w-p,A=k-v,P=N-p,q=S-v;return E*E+A*A>P*P+q*q&&(w=N,k=S),{cx:w,cy:k,x01:-c,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=+l.apply(this,arguments),h=y.apply(this,arguments)-At,o=p.apply(this,arguments)-At,_=Math.abs(o-h),d=o>h;if(g||(g=t=i.path()),e>s&&(n=s,s=e,e=n),s>St)if(_>Pt-St)g.moveTo(s*Math.cos(h),s*Math.sin(h)),g.arc(0,0,s,h,o,!d),e>St&&(g.moveTo(e*Math.cos(o),e*Math.sin(o)),g.arc(0,0,e,o,h,d));else{var m,T,M=h,b=o,w=h,k=o,N=_,S=_,E=v.apply(this,arguments)/2,A=E>St&&(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>St){var O=a(A/e*Math.sin(E)),R=a(A/s*Math.sin(E));(N-=2*O)>St?(O*=d?1:-1,w+=O,k-=O):(N=0,w=k=(h+o)/2),(S-=2*R)>St?(R*=d?1:-1,M+=R,b-=R):(S=0,M=b=(h+o)/2)}var z=s*Math.cos(M),B=s*Math.sin(M),L=e*Math.cos(k),j=e*Math.sin(k);if(P>St){var D=s*Math.cos(b),I=s*Math.sin(b),W=e*Math.cos(w),V=e*Math.sin(w);if(Et>_){var X=N>St?r(z,B,W,V,D,I,L,j):[L,j],Y=z-X[0],F=B-X[1],G=D-X[0],H=I-X[1],J=1/Math.sin(Math.acos((Y*G+F*H)/(Math.sqrt(Y*Y+F*F)*Math.sqrt(G*G+H*H)))/2),K=Math.sqrt(X[0]*X[0]+X[1]*X[1]);q=Math.min(P,(e-K)/(J-1)),C=Math.min(P,(s-K)/(J+1))}}S>St?C>St?(m=c(W,V,z,B,s,C,d),T=c(D,I,L,j,s,C,d),g.moveTo(m.cx+m.x01,m.cy+m.y01),P>C?g.arc(m.cx,m.cy,C,Math.atan2(m.y01,m.x01),Math.atan2(T.y01,T.x01),!d):(g.arc(m.cx,m.cy,C,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!d),g.arc(0,0,s,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(T.cy+T.y11,T.cx+T.x11),!d),g.arc(T.cx,T.cy,C,Math.atan2(T.y11,T.x11),Math.atan2(T.y01,T.x01),!d))):(g.moveTo(z,B),g.arc(0,0,s,M,b,!d)):g.moveTo(z,B),e>St&&N>St?q>St?(m=c(L,j,D,I,e,-q,d),T=c(z,B,W,V,e,-q,d),g.lineTo(m.cx+m.x01,m.cy+m.y01),P>q?g.arc(m.cx,m.cy,q,Math.atan2(m.y01,m.x01),Math.atan2(T.y01,T.x01),!d):(g.arc(m.cx,m.cy,q,Math.atan2(m.y01,m.x01),Math.atan2(m.y11,m.x11),!d),g.arc(0,0,e,Math.atan2(m.cy+m.y11,m.cx+m.x11),Math.atan2(T.cy+T.y11,T.cx+T.x11),d),g.arc(T.cx,T.cy,q,Math.atan2(T.y11,T.x11),Math.atan2(T.y01,T.x01),!d))):g.arc(0,0,e,k,w,d):g.lineTo(L,j)}else g.moveTo(0,0);return g.closePath(),t?(g=null,t+""||null):void 0}var u=e,l=s,f=n(0),x=null,y=h,p=o,v=_,g=null;return t.centroid=function(){var t=(+u.apply(this,arguments)+ +l.apply(this,arguments))/2,i=(+y.apply(this,arguments)+ +p.apply(this,arguments))/2-Et/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?(l="function"==typeof i?i:n(+i),t):l},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?(v="function"==typeof i?i:n(+i),t):v},t.context=function(i){return arguments.length?(g=null==i?null:i,t):g},t}function l(t,i){return i.length<2?t:(i=qt.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 v(){function t(t){var n,u,l,f,x,y=t.length,p=!1,v=new Array(y),g=new Array(y);for(a||(c=r(x=i.path())),n=0;y>=n;++n){if(!(y>n&&_(f=t[n],n,t))===p)if(p=!p)u=n,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),l=n-1;l>=u;--l)c.point(v[l],g[l]);c.lineEnd(),c.areaEnd()}p&&(v[n]=+e(f,n,t),g[n]=+h(f,n,t),c.point(s?+s(f,n,t):v[n],o?+o(f,n,t):g[n]))}return x?(c=null,x+""||null):void 0}var e=y,s=null,h=n(0),o=p,_=n(!0),a=null,r=x,c=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),o=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?(o=null==i?null:"function"==typeof i?i:n(+i),t):o},t.defined=function(i){return arguments.length?(_="function"==typeof i?i:n(!!i),t):_},t.curve=function(i){return arguments.length?(r=l(i,arguments),null!=a&&(c=r(a)),t):r},t.context=function(i){return arguments.length?(null==i?a=c=null:c=r(a=i),t):a},t}function g(){function t(t){var n,r,c,u=t.length,l=!1;for(o||(a=_(c=i.path())),n=0;u>=n;++n)!(u>n&&h(r=t[n],n,t))===l&&((l=!l)?a.lineStart():a.lineEnd()),l&&a.point(+e(r,n,t),+s(r,n,t));return c?(a=null,c+""||null):void 0}var e=y,s=p,h=n(!0),o=null,_=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?(_=l(i,arguments),null!=o&&(a=_(o)),t):_},t.context=function(i){return arguments.length?(null==i?o=a=null:a=_(o=i),t):o},t}function d(t,i){return t>i?-1:i>t?1:i>=t?0:NaN}function m(t){return t}function T(){function t(t){var n,a,r,c,u,l=t.length,f=0,x=new Array(l),y=new Array(l),p=+h.apply(this,arguments),v=Math.min(Pt,Math.max(-Pt,o.apply(this,arguments)-p)),g=Math.min(Math.abs(v)/l,_.apply(this,arguments)),d=g*(0>v?-1:1);for(n=0;l>n;++n)(u=y[x[n]=n]=+i(t[n],n,t))>0&&(f+=u);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-l*d)/f:0;l>n;++n,p=c)a=x[n],u=y[a],c=p+(u>0?u*r:0)+d,y[a]={data:t[a],index:n,value:u,startAngle:p,endAngle:c,padAngle:g};return y}var i=m,e=d,s=null,h=n(0),o=n(Pt),_=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 M(t){this._curve=t}function b(t,i){function n(i){return new M(t(i))}return t=l(t,i),n._curve=t,n}function w(){var t=v(),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(Ct),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=P(t),this._beta=i}function B(t,i){return null==i?new z(t,.85):1===(i=+i)?P(t):new z(t,i)}function L(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 D(t,i){return new j(t,(null==i?1:1-i)/6)}function I(t,i){this._context=t,this._k=i}function W(t,i){return new I(t,(null==i?1:1-i)/6)}function V(t,i){this._context=t,this._k=i}function X(t,i){return new V(t,(null==i?1:1-i)/6)}function Y(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>St){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>St){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 F(t,i){this._context=t,this._alpha=i}function G(t,i){return(i=null==i?.5:+i)?new F(t,i):D(t,0)}function H(t,i){this._context=t,this._alpha=i}function J(t,i){return(i=null==i?.5:+i)?new H(t,i):W(t,0)}function K(t,i){this._context=t,this._alpha=i}function Q(t,i){return(i=null==i?.5:+i)?new K(t,i):X(t,0)}function U(t){this._context=t}function Z(t){return new U(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||0>s&&-0),o=(n-t._y1)/(s||0>e&&-0),_=(h*s+o*e)/(e+s);return($(h)+$(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||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,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*i,h-_,o-_*n,h,o)}function et(t){this._context=t}function st(t){this._context=new ht(t)}function ht(t){this._context=t}function ot(t){return new et(t)}function _t(t){return new st(t)}function at(t){this._context=t}function rt(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;e-1>i;++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;e>i;++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;e-1>i;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function ct(t){return new at(t)}function ut(t,i){this._context=t,this._t=i}function lt(t){return new ut(t,.5)}function ft(t){return new ut(t,0)}function xt(t){return new ut(t,1)}function yt(t,i){if((e=t.length)>1)for(var n,e,s=1,h=t[i[0]],o=h.length;e>s;++s){n=h,h=t[i[s]];for(var _=0;o>_;++_)h[_][1]+=h[_][0]=isNaN(n[_][1])?n[_][0]:n[_][1]}}function pt(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function vt(t,i){return t[i]}function gt(){function t(t){var n,o,_=i.apply(this,arguments),a=t.length,r=_.length,c=new Array(r);for(n=0;r>n;++n){for(var u,l=_[n],f=c[n]=new Array(a),x=0;a>x;++x)f[x]=u=[0,+h(t[x],l,x,t)],u.data=t[x];f.key=l}for(n=0,o=e(c);r>n;++n)c[o[n]].index=n;return s(c,o),c}var i=n([]),e=pt,s=yt,h=vt;return t.keys=function(e){return arguments.length?(i="function"==typeof e?e:n(Ut.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?pt:"function"==typeof i?i:n(Ut.call(i)),t):e},t.offset=function(i){return arguments.length?(s=null==i?yt:i,t):s},t}function dt(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;o>h;++h){for(s=n=0;e>n;++n)s+=t[n][h][1]||0;if(s)for(n=0;e>n;++n)t[n][h][1]/=s}yt(t,i)}}function mt(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;h>e;++e){for(var o=0,_=0;n>o;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}yt(t,i)}}function Tt(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;e>o;++o){for(var _=0,a=0,r=0;s>_;++_){for(var c=t[i[_]],u=c[o][1]||0,l=c[o-1][1]||0,f=(u-l)/2,x=0;_>x;++x){var y=t[i[x]],p=y[o][1]||0,v=y[o-1][1]||0;f+=p-v}a+=u,r+=f*u}n[o-1][1]+=n[o-1][0]=h,a&&(h-=r/a)}n[o-1][1]+=n[o-1][0]=h,yt(t,i)}}function Mt(t){var i=t.map(bt);return pt(t).sort(function(t,n){return i[t]-i[n]})}function bt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}function wt(t){return Mt(t).reverse()}function kt(t){var i,n,e=t.length,s=t.map(bt),h=pt(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,a=[],r=[];for(i=0;e>i;++i)n=h[i],_>o?(o+=s[n],a.push(n)):(_+=s[n],r.push(n));return r.reverse().concat(a)}function Nt(t){return pt(t).reverse()}var St=1e-12,Et=Math.PI,At=Et/2,Pt=2*Et,qt=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-=At,this._curve.point(i*Math.cos(t),i*Math.sin(t))}};var Ct={draw:function(t,i){var n=Math.sqrt(i/Et);t.moveTo(n,0),t.arc(0,0,n,0,Pt)}},Ot={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()}},Rt=Math.sqrt(1/3),zt=2*Rt,Bt={draw:function(t,i){var n=Math.sqrt(i/zt),e=n*Rt;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},Lt=.8908130915292852,jt=Math.sin(Et/10)/Math.sin(7*Et/10),Dt=Math.sin(Pt/10)*jt,It=-Math.cos(Pt/10)*jt,Wt={draw:function(t,i){var n=Math.sqrt(i*Lt),e=Dt*n,s=It*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;5>h;++h){var o=Pt*h/5,_=Math.cos(o),a=Math.sin(o);t.lineTo(a*n,-_*n),t.lineTo(_*e-a*s,a*e+_*s)}t.closePath()}},Vt={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},Xt=Math.sqrt(3),Yt={draw:function(t,i){var n=-Math.sqrt(i/(3*Xt));t.moveTo(0,2*n),t.lineTo(-Xt*n,-n),t.lineTo(Xt*n,-n),t.closePath()}},Ft=-.5,Gt=Math.sqrt(3)/2,Ht=1/Math.sqrt(12),Jt=3*(Ht/2+1),Kt={draw:function(t,i){var n=Math.sqrt(i/Jt),e=n/2,s=n*Ht,h=e,o=n*Ht+n,_=-h,a=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,a),t.lineTo(Ft*e-Gt*s,Gt*e+Ft*s),t.lineTo(Ft*h-Gt*o,Gt*h+Ft*o),t.lineTo(Ft*_-Gt*a,Gt*_+Ft*a),t.lineTo(Ft*e+Gt*s,Ft*s-Gt*e),t.lineTo(Ft*h+Gt*o,Ft*o-Gt*h),t.lineTo(Ft*_+Gt*a,Ft*a-Gt*_),t.closePath()}},Qt=[Ct,Ot,Bt,Vt,Wt,Yt,Kt];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:E(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:E(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},q.prototype={areaStart:S,areaEnd:S,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:E(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},O.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:E(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}},z.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,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)}},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:L(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:L(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}},I.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:L(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}},V.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:L(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}},F.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:Y(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}},H.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:Y(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}},K.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:Y(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}},U.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))}},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}}},(st.prototype=Object.create(et.prototype)).point=function(t,i){et.prototype.point.call(this,i,t)},ht.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)}},at.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=rt(t),s=rt(i),h=0,o=1;n>o;++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)}},ut.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 Ut=Array.prototype.slice,Zt="0.5.1";t.version=Zt,t.arc=u,t.area=v,t.line=g,t.pie=T,t.radialArea=w,t.radialLine=k,t.symbol=N,t.symbols=Qt,t.symbolCircle=Ct,t.symbolCross=Ot,t.symbolDiamond=Bt,t.symbolSquare=Vt,t.symbolStar=Wt,t.symbolTriangle=Yt,t.symbolWye=Kt,t.curveBasisClosed=C,t.curveBasisOpen=R,t.curveBasis=P,t.curveBundle=B,t.curveCardinalClosed=W,t.curveCardinalOpen=X,t.curveCardinal=D,t.curveCatmullRomClosed=J,t.curveCatmullRomOpen=Q,t.curveCatmullRom=G,t.curveLinearClosed=Z,t.curveLinear=x,t.curveMonotoneX=ot,t.curveMonotoneY=_t,t.curveNatural=ct,t.curveStep=lt,t.curveStepAfter=xt,t.curveStepBefore=ft,t.stack=gt,t.stackOffsetExpand=dt,t.stackOffsetNone=yt,t.stackOffsetSilhouette=mt,t.stackOffsetWiggle=Tt,t.stackOrderAscending=Mt,t.stackOrderDescending=wt,t.stackOrderInsideOut=kt,t.stackOrderNone=pt,t.stackOrderReverse=Nt}); | ||
!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_shape=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 o(t){return t.endAngle}function _(t){return t&&t.padAngle}function a(t){return t>=1?bt:-1>=t?-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=(0>T?-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()),e>s&&(n=s,s=e,e=n),s>Mt)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),B=s*Math.sin(b),L=e*Math.cos(k),j=e*Math.sin(k);if(P>Mt){var D=s*Math.cos(w),I=s*Math.sin(w),W=e*Math.cos(m),V=e*Math.sin(m);if(gt>_){var X=N>Mt?r(z,B,W,V,D,I,L,j):[L,j],Y=z-X[0],F=B-X[1],G=D-X[0],H=I-X[1],J=1/Math.sin(Math.acos((Y*G+F*H)/(Math.sqrt(Y*Y+F*F)*Math.sqrt(G*G+H*H)))/2),K=Math.sqrt(X[0]*X[0]+X[1]*X[1]);q=Math.min(P,(e-K)/(J-1)),C=Math.min(P,(s-K)/(J+1))}}S>Mt?C>Mt?(M=c(W,V,z,B,s,C,T),g=c(D,I,L,j,s,C,T),d.moveTo(M.cx+M.x01,M.cy+M.y01),P>C?d.arc(M.cx,M.cy,C,Math.atan2(M.y01,M.x01),Math.atan2(g.y01,g.x01),!T):(d.arc(M.cx,M.cy,C,Math.atan2(M.y01,M.x01),Math.atan2(M.y11,M.x11),!T),d.arc(0,0,s,Math.atan2(M.cy+M.y11,M.cx+M.x11),Math.atan2(g.cy+g.y11,g.cx+g.x11),!T),d.arc(g.cx,g.cy,C,Math.atan2(g.y11,g.x11),Math.atan2(g.y01,g.x01),!T))):(d.moveTo(z,B),d.arc(0,0,s,b,w,!T)):d.moveTo(z,B),e>Mt&&N>Mt?q>Mt?(M=c(L,j,D,I,e,-q,T),g=c(z,B,W,V,e,-q,T),d.lineTo(M.cx+M.x01,M.cy+M.y01),P>q?d.arc(M.cx,M.cy,q,Math.atan2(M.y01,M.x01),Math.atan2(g.y01,g.x01),!T):(d.arc(M.cx,M.cy,q,Math.atan2(M.y01,M.x01),Math.atan2(M.y11,M.x11),!T),d.arc(0,0,e,Math.atan2(M.cy+M.y11,M.cx+M.x11),Math.atan2(g.cy+g.y11,g.cx+g.x11),T),d.arc(g.cx,g.cy,q,Math.atan2(g.y11,g.x11),Math.atan2(g.y01,g.x01),!T))):d.arc(0,0,e,k,m,T):d.lineTo(L,j)}else d.moveTo(0,0);return d.closePath(),t?(d=null,t+""||null):void 0}var l=e,u=s,f=n(0),x=null,y=h,p=o,v=_,d=null;return t.centroid=function(){var t=(+l.apply(this,arguments)+ +u.apply(this,arguments))/2,i=(+y.apply(this,arguments)+ +p.apply(this,arguments))/2-gt/2;return[Math.cos(i)*t,Math.sin(i)*t]},t.innerRadius=function(i){return arguments.length?(l="function"==typeof i?i:n(+i),t):l},t.outerRadius=function(i){return arguments.length?(u="function"==typeof i?i:n(+i),t):u},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?(v="function"==typeof i?i:n(+i),t):v},t.context=function(i){return arguments.length?(d=null==i?null:i,t):d},t}function u(t){this._context=t}function f(t){return new u(t)}function x(t){return t[0]}function y(t){return t[1]}function p(){function t(t){var n,l,u,f,x,y=t.length,p=!1,v=new Array(y),d=new Array(y);for(null==a&&(c=r(x=i.path())),n=0;y>=n;++n){if(!(y>n&&_(f=t[n],n,t))===p)if(p=!p)l=n,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),u=n-1;u>=l;--u)c.point(v[u],d[u]);c.lineEnd(),c.areaEnd()}p&&(v[n]=+e(f,n,t),d[n]=+h(f,n,t),c.point(s?+s(f,n,t):v[n],o?+o(f,n,t):d[n]))}return x?(c=null,x+""||null):void 0}var e=x,s=null,h=n(0),o=y,_=n(!0),a=null,r=f,c=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),o=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?(o=null==i?null:"function"==typeof i?i:n(+i),t):o},t.defined=function(i){return arguments.length?(_="function"==typeof i?i:n(!!i),t):_},t.curve=function(i){return arguments.length?(r=i,null!=a&&(c=r(a)),t):r},t.context=function(i){return arguments.length?(null==i?a=c=null:c=r(a=i),t):a},t}function v(){function t(t){var n,r,c,l=t.length,u=!1;for(null==o&&(a=_(c=i.path())),n=0;l>=n;++n)!(l>n&&h(r=t[n],n,t))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(r,n,t),+s(r,n,t));return c?(a=null,c+""||null):void 0}var e=x,s=y,h=n(!0),o=null,_=f,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?(_=i,null!=o&&(a=_(o)),t):_},t.context=function(i){return arguments.length?(null==i?o=a=null:a=_(o=i),t):o},t}function d(t,i){return t>i?-1:i>t?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*(0>v?-1:1);for(n=0;u>n;++n)(l=y[x[n]=n]=+i(t[n],n,t))>0&&(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;u>n;++n,p=c)a=x[n],l=y[a],c=p+(l>0?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(){var t=p(),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)):i()._curve},t.curve(f)}function m(){var t=v(),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.curve(f)}function k(){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(mt),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 N(){}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 E(t){this._context=t}function A(t){return new E(t)}function P(t){this._context=t}function q(t){return new P(t)}function C(t){this._context=t}function O(t){return new C(t)}function R(t,i){this._basis=new E(t),this._beta=i}function z(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 B(t,i){this._context=t,this._k=(1-i)/6}function L(t,i){this._context=t,this._k=(1-i)/6}function j(t,i){this._context=t,this._k=(1-i)/6}function D(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 I(t,i){this._context=t,this._alpha=i}function W(t,i){this._context=t,this._alpha=i}function V(t,i){this._context=t,this._alpha=i}function X(t){this._context=t}function Y(t){return new X(t)}function F(t){return 0>t?-1:1}function G(t,i,n){var e=t._x1-t._x0,s=i-t._x1,h=(t._y1-t._y0)/(e||0>s&&-0),o=(n-t._y1)/(s||0>e&&-0),_=(h*s+o*e)/(e+s);return(F(h)+F(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function H(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function J(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 K(t){this._context=t}function Q(t){this._context=new U(t)}function U(t){this._context=t}function Z(t){return new K(t)}function $(t){return new Q(t)}function tt(t){this._context=t}function it(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;e-1>i;++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;e>i;++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;e-1>i;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function nt(t){return new tt(t)}function et(t,i){this._context=t,this._t=i}function st(t){return new et(t,.5)}function ht(t){return new et(t,0)}function ot(t){return new et(t,1)}function _t(t,i){if((e=t.length)>1)for(var n,e,s=1,h=t[i[0]],o=h.length;e>s;++s){n=h,h=t[i[s]];for(var _=0;o>_;++_)h[_][1]+=h[_][0]=isNaN(n[_][1])?n[_][0]:n[_][1]}}function at(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function rt(t,i){return t[i]}function ct(){function t(t){var n,o,_=i.apply(this,arguments),a=t.length,r=_.length,c=new Array(r);for(n=0;r>n;++n){for(var l,u=_[n],f=c[n]=new Array(a),x=0;a>x;++x)f[x]=l=[0,+h(t[x],u,x,t)],l.data=t[x];f.key=u}for(n=0,o=e(c);r>n;++n)c[o[n]].index=n;return s(c,o),c}var i=n([]),e=at,s=_t,h=rt;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?at:"function"==typeof i?i:n(Qt.call(i)),t):e},t.offset=function(i){return arguments.length?(s=null==i?_t:i,t):s},t}function lt(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;o>h;++h){for(s=n=0;e>n;++n)s+=t[n][h][1]||0;if(s)for(n=0;e>n;++n)t[n][h][1]/=s}_t(t,i)}}function ut(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;h>e;++e){for(var o=0,_=0;n>o;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}_t(t,i)}}function ft(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;e>o;++o){for(var _=0,a=0,r=0;s>_;++_){for(var c=t[i[_]],l=c[o][1]||0,u=c[o-1][1]||0,f=(l-u)/2,x=0;_>x;++x){var y=t[i[x]],p=y[o][1]||0,v=y[o-1][1]||0;f+=p-v}a+=l,r+=f*l}n[o-1][1]+=n[o-1][0]=h,a&&(h-=r/a)}n[o-1][1]+=n[o-1][0]=h,_t(t,i)}}function xt(t){var i=t.map(yt);return at(t).sort(function(t,n){return i[t]-i[n]})}function yt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}function pt(t){return xt(t).reverse()}function vt(t){var i,n,e=t.length,s=t.map(yt),h=at(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,a=[],r=[];for(i=0;e>i;++i)n=h[i],_>o?(o+=s[n],a.push(n)):(_+=s[n],r.push(n));return r.reverse().concat(a)}function dt(t){return at(t).reverse()}var Tt="0.6.0",Mt=1e-12,gt=Math.PI,bt=gt/2,wt=2*gt;u.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)}}},g.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 mt={draw:function(t,i){var n=Math.sqrt(i/gt);t.moveTo(n,0),t.arc(0,0,n,0,wt)}},kt={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()}},Nt=Math.sqrt(1/3),St=2*Nt,Et={draw:function(t,i){var n=Math.sqrt(i/St),e=n*Nt;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},At=.8908130915292852,Pt=Math.sin(gt/10)/Math.sin(7*gt/10),qt=Math.sin(wt/10)*Pt,Ct=-Math.cos(wt/10)*Pt,Ot={draw:function(t,i){var n=Math.sqrt(i*At),e=qt*n,s=Ct*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;5>h;++h){var o=wt*h/5,_=Math.cos(o),a=Math.sin(o);t.lineTo(a*n,-_*n),t.lineTo(_*e-a*s,a*e+_*s)}t.closePath()}},Rt={draw:function(t,i){var n=Math.sqrt(i),e=-n/2;t.rect(e,e,n,n)}},zt=Math.sqrt(3),Bt={draw:function(t,i){var n=-Math.sqrt(i/(3*zt));t.moveTo(0,2*n),t.lineTo(-zt*n,-n),t.lineTo(zt*n,-n),t.closePath()}},Lt=-.5,jt=Math.sqrt(3)/2,Dt=1/Math.sqrt(12),It=3*(Dt/2+1),Wt={draw:function(t,i){var n=Math.sqrt(i/It),e=n/2,s=n*Dt,h=e,o=n*Dt+n,_=-h,a=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,a),t.lineTo(Lt*e-jt*s,jt*e+Lt*s),t.lineTo(Lt*h-jt*o,jt*h+Lt*o),t.lineTo(Lt*_-jt*a,jt*_+Lt*a),t.lineTo(Lt*e+jt*s,Lt*s-jt*e),t.lineTo(Lt*h+jt*o,Lt*o-jt*h),t.lineTo(Lt*_+jt*a,Lt*a-jt*_),t.closePath()}},Vt=[mt,kt,Et,Rt,Ot,Bt,Wt];E.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}},P.prototype={areaStart:N,areaEnd:N,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}},R.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,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 Xt=function Ut(t){function i(i){return 1===t?new E(i):new R(i,t)}return i.beta=function(t){return Ut(+t)},i}(.85);B.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:z(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:z(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 Yt=function Zt(t){function i(i){return new B(i,t)}return i.tension=function(t){return Zt(+t)},i}(0);L.prototype={areaStart:N,areaEnd:N,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:z(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(t){function i(i){return new L(i,t)}return i.tension=function(t){return $t(+t)},i}(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:z(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 ti(t){function i(i){return new j(i,t)}return i.tension=function(t){return ti(+t)},i}(0);I.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:D(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 Ht=function ii(t){function i(i){return t?new I(i,t):new B(i,0)}return i.alpha=function(t){return ii(+t)},i}(.5);W.prototype={areaStart:N,areaEnd:N,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:D(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 ni(t){function i(i){return t?new W(i,t):new L(i,0)}return i.alpha=function(t){return ni(+t)},i}(.5);V.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:D(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 ei(t){function i(i){return t?new V(i,t):new j(i,0)}return i.alpha=function(t){return ei(+t)},i}(.5);X.prototype={areaStart:N,areaEnd:N,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))}},K.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:J(this,this._t0,H(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,J(this,H(this,n=G(this,t,i)),n);break;default:J(this,this._t0,n=G(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(Q.prototype=Object.create(K.prototype)).point=function(t,i){K.prototype.point.call(this,i,t)},U.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)}},tt.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=it(t),s=it(i),h=0,o=1;n>o;++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)}},et.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;t.version=Tt,t.arc=l,t.area=p,t.line=v,t.pie=M,t.radialArea=w,t.radialLine=m,t.symbol=k,t.symbols=Vt,t.symbolCircle=mt,t.symbolCross=kt,t.symbolDiamond=Et,t.symbolSquare=Rt,t.symbolStar=Ot,t.symbolTriangle=Bt,t.symbolWye=Wt,t.curveBasisClosed=q,t.curveBasisOpen=O,t.curveBasis=A,t.curveBundle=Xt,t.curveCardinalClosed=Ft,t.curveCardinalOpen=Gt,t.curveCardinal=Yt,t.curveCatmullRomClosed=Jt,t.curveCatmullRomOpen=Kt,t.curveCatmullRom=Ht,t.curveLinearClosed=Y,t.curveLinear=f,t.curveMonotoneX=Z,t.curveMonotoneY=$,t.curveNatural=nt,t.curveStep=st,t.curveStepAfter=ot,t.curveStepBefore=ht,t.stack=ct,t.stackOffsetExpand=lt,t.stackOffsetNone=_t,t.stackOffsetSilhouette=ut,t.stackOffsetWiggle=ft,t.stackOrderAscending=xt,t.stackOrderDescending=pt,t.stackOrderInsideOut=vt,t.stackOrderNone=at,t.stackOrderReverse=dt}); |
@@ -0,1 +1,3 @@ | ||
export {version} from "./build/version"; | ||
export {default as arc} from "./src/arc"; | ||
@@ -2,0 +4,0 @@ export {default as area} from "./src/area"; |
{ | ||
"name": "d3-shape", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Graphical primitives for visualization, such as lines and areas.", | ||
@@ -25,6 +25,6 @@ "keywords": [ | ||
"scripts": { | ||
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -g d3-path:d3_path -n d3_shape -o build/d3-shape.js -- build/bundle.js", | ||
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"export var version = \\\"\" + require(\"./package.json\").version + \"\\\";\\n\");' > build/version.js && rollup -f umd -g d3-path:d3_path -n d3_shape -o build/d3-shape.js -- index.js", | ||
"test": "faucet `find test -name '*-test.js'` && eslint index.js src", | ||
"prepublish": "npm run test && uglifyjs build/d3-shape.js -c -m -o build/d3-shape.min.js && rm -f build/d3-shape.zip && zip -j build/d3-shape.zip -- LICENSE README.md build/d3-shape.js build/d3-shape.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git tag -am \"Release $VERSION.\" v${VERSION} && git push --tags && cp build/d3-shape.js ../d3.github.com/d3-shape.v0.5.js && cp build/d3-shape.min.js ../d3.github.com/d3-shape.v0.5.min.js && cd ../d3.github.com && git add d3-shape.v0.5.js d3-shape.v0.5.min.js && git commit -m \"d3-shape ${VERSION}\" && git push" | ||
"prepublish": "npm run test && uglifyjs build/d3-shape.js -c -m -o build/d3-shape.min.js && rm -f build/d3-shape.zip", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-shape.js ../d3.github.com/d3-shape.v0.6.js && cp build/d3-shape.min.js ../d3.github.com/d3-shape.v0.6.min.js && cd ../d3.github.com && git add d3-shape.v0.6.js d3-shape.v0.6.min.js && git commit -m \"d3-shape ${VERSION}\" && git push && cd - && zip -j build/d3-shape.zip -- LICENSE README.md build/d3-shape.js build/d3-shape.min.js" | ||
}, | ||
@@ -35,3 +35,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"d3-polygon": "~0.1.0", | ||
"d3-polygon": "~0.2.0", | ||
"faucet": "0.0", | ||
@@ -38,0 +38,0 @@ "rollup": "0.25", |
import {path} from "d3-path"; | ||
import constant from "./constant"; | ||
import curveBind from "./curve/bind"; | ||
import curveLinear from "./curve/linear"; | ||
@@ -28,3 +27,3 @@ import {x as pointX, y as pointY} from "./point"; | ||
if (!context) output = curve(buffer = path()); | ||
if (context == null) output = curve(buffer = path()); | ||
@@ -85,3 +84,3 @@ for (i = 0; i <= n; ++i) { | ||
area.curve = function(_) { | ||
return arguments.length ? (curve = curveBind(_, arguments), context != null && (output = curve(context)), area) : curve; | ||
return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve; | ||
}; | ||
@@ -88,0 +87,0 @@ |
@@ -12,3 +12,3 @@ export function point(that, x, y) { | ||
function Basis(context) { | ||
export function Basis(context) { | ||
this._context = context; | ||
@@ -15,0 +15,0 @@ } |
@@ -1,5 +0,5 @@ | ||
import basis from "./basis"; | ||
import {Basis} from "./basis"; | ||
function Bundle(context, beta) { | ||
this._basis = basis(context); | ||
this._basis = new Basis(context); | ||
this._beta = beta; | ||
@@ -45,6 +45,13 @@ } | ||
export default function(context, beta) { | ||
return beta == null ? new Bundle(context, 0.85) | ||
: (beta = +beta) === 1 ? basis(context) | ||
: new Bundle(context, beta); | ||
} | ||
export default (function custom(beta) { | ||
function bundle(context) { | ||
return beta === 1 ? new Basis(context) : new Bundle(context, beta); | ||
} | ||
bundle.beta = function(beta) { | ||
return custom(+beta); | ||
}; | ||
return bundle; | ||
})(0.85); |
@@ -12,5 +12,5 @@ export function point(that, x, y) { | ||
function Cardinal(context, k) { | ||
export function Cardinal(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -51,4 +51,13 @@ | ||
export default function(context, tension) { | ||
return new Cardinal(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
export default (function custom(tension) { | ||
function cardinal(context) { | ||
return new Cardinal(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); |
import noop from "../noop"; | ||
import {point} from "./cardinal"; | ||
function CardinalClosed(context, k) { | ||
export function CardinalClosed(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -50,4 +50,13 @@ | ||
export default function(context, tension) { | ||
return new CardinalClosed(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
export default (function custom(tension) { | ||
function cardinal(context) { | ||
return new CardinalClosed(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); |
import {point} from "./cardinal"; | ||
function CardinalOpen(context, k) { | ||
export function CardinalOpen(context, tension) { | ||
this._context = context; | ||
this._k = k; | ||
this._k = (1 - tension) / 6; | ||
} | ||
@@ -38,4 +38,13 @@ | ||
export default function(context, tension) { | ||
return new CardinalOpen(context, (tension == null ? 1 : 1 - tension) / 6); | ||
} | ||
export default (function custom(tension) { | ||
function cardinal(context) { | ||
return new CardinalOpen(context, tension); | ||
} | ||
cardinal.tension = function(tension) { | ||
return custom(+tension); | ||
}; | ||
return cardinal; | ||
})(0); |
import {epsilon} from "../math"; | ||
import cardinal from "./cardinal"; | ||
import {Cardinal} from "./cardinal"; | ||
@@ -77,6 +77,13 @@ export function point(that, x, y) { | ||
export default function(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRom(context, alpha) | ||
: cardinal(context, 0); | ||
} | ||
export default (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); |
@@ -1,2 +0,2 @@ | ||
import cardinalClosed from "./cardinalClosed"; | ||
import {CardinalClosed} from "./cardinalClosed"; | ||
import noop from "../noop"; | ||
@@ -63,6 +63,13 @@ import {point} from "./catmullRom"; | ||
export default function(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRomClosed(context, alpha) | ||
: cardinalClosed(context, 0); | ||
} | ||
export default (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); |
@@ -1,2 +0,2 @@ | ||
import cardinalOpen from "./cardinalOpen"; | ||
import {CardinalOpen} from "./cardinalOpen"; | ||
import {point} from "./catmullRom"; | ||
@@ -51,6 +51,13 @@ | ||
export default function(context, alpha) { | ||
return (alpha = alpha == null ? 0.5 : +alpha) | ||
? new CatmullRomOpen(context, alpha) | ||
: cardinalOpen(context, 0); | ||
} | ||
export default (function custom(alpha) { | ||
function catmullRom(context) { | ||
return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0); | ||
} | ||
catmullRom.alpha = function(alpha) { | ||
return custom(+alpha); | ||
}; | ||
return catmullRom; | ||
})(0.5); |
@@ -1,4 +0,1 @@ | ||
import bind from "./bind"; | ||
import {halfPi} from "../math"; | ||
function Radial(curve) { | ||
@@ -22,8 +19,7 @@ this._curve = curve; | ||
point: function(a, r) { | ||
a -= halfPi, this._curve.point(r * Math.cos(a), r * Math.sin(a)); | ||
this._curve.point(r * Math.sin(a), r * -Math.cos(a)); | ||
} | ||
}; | ||
export default function(curve, args) { | ||
curve = bind(curve, args); | ||
export default function(curve) { | ||
@@ -30,0 +26,0 @@ function radial(context) { |
import {path} from "d3-path"; | ||
import constant from "./constant"; | ||
import curveBind from "./curve/bind"; | ||
import curveLinear from "./curve/linear"; | ||
@@ -22,3 +21,3 @@ import {x as pointX, y as pointY} from "./point"; | ||
if (!context) output = curve(buffer = path()); | ||
if (context == null) output = curve(buffer = path()); | ||
@@ -49,3 +48,3 @@ for (i = 0; i <= n; ++i) { | ||
line.curve = function(_) { | ||
return arguments.length ? (curve = curveBind(_, arguments), context != null && (output = curve(context)), line) : curve; | ||
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve; | ||
}; | ||
@@ -52,0 +51,0 @@ |
@@ -17,3 +17,3 @@ import curveLinear from "./curve/linear"; | ||
a.curve = function(_) { | ||
return arguments.length ? c(curveRadial(_, arguments)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -20,0 +20,0 @@ |
@@ -13,3 +13,3 @@ import curveLinear from "./curve/linear"; | ||
l.curve = function(_) { | ||
return arguments.length ? c(curveRadial(_, arguments)) : c()._curve; | ||
return arguments.length ? c(curveRadial(_)) : c()._curve; | ||
}; | ||
@@ -16,0 +16,0 @@ |
Sorry, the diff of this file is too big to display
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
921265
3132
1013
99