Comparing version 1.0.3 to 1.0.4
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ Version 1.0.3. Copyright 2016 Mike Bostock. | ||
// https://d3js.org/d3-shape/ Version 1.0.4. Copyright 2016 Mike Bostock. | ||
(function (global, factory) { | ||
@@ -8,7 +8,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-path')) : | ||
function constant(x) { | ||
var constant$1 = function(x) { | ||
return function constant() { | ||
return x; | ||
}; | ||
} | ||
}; | ||
@@ -94,6 +94,6 @@ var epsilon = 1e-12; | ||
function arc() { | ||
var arc = function() { | ||
var innerRadius = arcInnerRadius, | ||
outerRadius = arcOuterRadius, | ||
cornerRadius = constant(0), | ||
cornerRadius = constant$1(0), | ||
padRadius = null, | ||
@@ -247,27 +247,27 @@ startAngle = arcStartAngle, | ||
arc.innerRadius = function(_) { | ||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius; | ||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant$1(+_), arc) : innerRadius; | ||
}; | ||
arc.outerRadius = function(_) { | ||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius; | ||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant$1(+_), arc) : outerRadius; | ||
}; | ||
arc.cornerRadius = function(_) { | ||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius; | ||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant$1(+_), arc) : cornerRadius; | ||
}; | ||
arc.padRadius = function(_) { | ||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius; | ||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant$1(+_), arc) : padRadius; | ||
}; | ||
arc.startAngle = function(_) { | ||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle; | ||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$1(+_), arc) : startAngle; | ||
}; | ||
arc.endAngle = function(_) { | ||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle; | ||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$1(+_), arc) : endAngle; | ||
}; | ||
arc.padAngle = function(_) { | ||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle; | ||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$1(+_), arc) : padAngle; | ||
}; | ||
@@ -280,3 +280,3 @@ | ||
return arc; | ||
} | ||
}; | ||
@@ -311,5 +311,5 @@ function Linear(context) { | ||
function curveLinear(context) { | ||
var curveLinear = function(context) { | ||
return new Linear(context); | ||
} | ||
}; | ||
@@ -324,6 +324,6 @@ function x(p) { | ||
function line() { | ||
var x$$ = x, | ||
y$$ = y, | ||
defined = constant(true), | ||
var line = function() { | ||
var x$$1 = x, | ||
y$$1 = y, | ||
defined = constant$1(true), | ||
context = null, | ||
@@ -347,3 +347,3 @@ curve = curveLinear, | ||
} | ||
if (defined0) output.point(+x$$(d, i, data), +y$$(d, i, data)); | ||
if (defined0) output.point(+x$$1(d, i, data), +y$$1(d, i, data)); | ||
} | ||
@@ -355,11 +355,11 @@ | ||
line.x = function(_) { | ||
return arguments.length ? (x$$ = typeof _ === "function" ? _ : constant(+_), line) : x$$; | ||
return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$1(+_), line) : x$$1; | ||
}; | ||
line.y = function(_) { | ||
return arguments.length ? (y$$ = typeof _ === "function" ? _ : constant(+_), line) : y$$; | ||
return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$1(+_), line) : y$$1; | ||
}; | ||
line.defined = function(_) { | ||
return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined; | ||
return arguments.length ? (defined = typeof _ === "function" ? _ : constant$1(!!_), line) : defined; | ||
}; | ||
@@ -376,10 +376,10 @@ | ||
return line; | ||
} | ||
}; | ||
function area() { | ||
var area = function() { | ||
var x0 = x, | ||
x1 = null, | ||
y0 = constant(0), | ||
y0 = constant$1(0), | ||
y1 = y, | ||
defined = constant(true), | ||
defined = constant$1(true), | ||
context = null, | ||
@@ -432,23 +432,23 @@ curve = curveLinear, | ||
area.x = function(_) { | ||
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), x1 = null, area) : x0; | ||
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$1(+_), x1 = null, area) : x0; | ||
}; | ||
area.x0 = function(_) { | ||
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant(+_), area) : x0; | ||
return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$1(+_), area) : x0; | ||
}; | ||
area.x1 = function(_) { | ||
return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : x1; | ||
return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant$1(+_), area) : x1; | ||
}; | ||
area.y = function(_) { | ||
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), y1 = null, area) : y0; | ||
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$1(+_), y1 = null, area) : y0; | ||
}; | ||
area.y0 = function(_) { | ||
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant(+_), area) : y0; | ||
return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$1(+_), area) : y0; | ||
}; | ||
area.y1 = function(_) { | ||
return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant(+_), area) : y1; | ||
return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant$1(+_), area) : y1; | ||
}; | ||
@@ -470,3 +470,3 @@ | ||
area.defined = function(_) { | ||
return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), area) : defined; | ||
return arguments.length ? (defined = typeof _ === "function" ? _ : constant$1(!!_), area) : defined; | ||
}; | ||
@@ -483,19 +483,19 @@ | ||
return area; | ||
} | ||
}; | ||
function descending(a, b) { | ||
var descending = function(a, b) { | ||
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN; | ||
} | ||
}; | ||
function identity(d) { | ||
var identity = function(d) { | ||
return d; | ||
} | ||
}; | ||
function pie() { | ||
var pie = function() { | ||
var value = identity, | ||
sortValues = descending, | ||
sort = null, | ||
startAngle = constant(0), | ||
endAngle = constant(tau), | ||
padAngle = constant(0); | ||
startAngle = constant$1(0), | ||
endAngle = constant$1(tau), | ||
padAngle = constant$1(0); | ||
@@ -543,3 +543,3 @@ function pie(data) { | ||
pie.value = function(_) { | ||
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value; | ||
return arguments.length ? (value = typeof _ === "function" ? _ : constant$1(+_), pie) : value; | ||
}; | ||
@@ -556,15 +556,15 @@ | ||
pie.startAngle = function(_) { | ||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle; | ||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$1(+_), pie) : startAngle; | ||
}; | ||
pie.endAngle = function(_) { | ||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle; | ||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$1(+_), pie) : endAngle; | ||
}; | ||
pie.padAngle = function(_) { | ||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle; | ||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$1(+_), pie) : padAngle; | ||
}; | ||
return pie; | ||
} | ||
}; | ||
@@ -619,7 +619,7 @@ var curveRadialLinear = curveRadial(curveLinear); | ||
function radialLine$1() { | ||
var radialLine$1 = function() { | ||
return radialLine(line().curve(curveRadialLinear)); | ||
} | ||
}; | ||
function radialArea() { | ||
var radialArea = function() { | ||
var a = area().curve(curveRadialLinear), | ||
@@ -648,3 +648,3 @@ c = a.curve, | ||
return a; | ||
} | ||
}; | ||
@@ -680,2 +680,3 @@ var circle = { | ||
var tan30_2 = tan30 * 2; | ||
var diamond = { | ||
@@ -697,2 +698,3 @@ draw: function(context, size) { | ||
var ky = -Math.cos(tau / 10) * kr; | ||
var star = { | ||
@@ -740,2 +742,3 @@ draw: function(context, size) { | ||
var a = (k / 2 + 1) * 3; | ||
var wye = { | ||
@@ -773,5 +776,5 @@ draw: function(context, size) { | ||
function symbol() { | ||
var type = constant(circle), | ||
size = constant(64), | ||
var symbol = function() { | ||
var type = constant$1(circle), | ||
size = constant$1(64), | ||
context = null; | ||
@@ -787,7 +790,7 @@ | ||
symbol.type = function(_) { | ||
return arguments.length ? (type = typeof _ === "function" ? _ : constant(_), symbol) : type; | ||
return arguments.length ? (type = typeof _ === "function" ? _ : constant$1(_), symbol) : type; | ||
}; | ||
symbol.size = function(_) { | ||
return arguments.length ? (size = typeof _ === "function" ? _ : constant(+_), symbol) : size; | ||
return arguments.length ? (size = typeof _ === "function" ? _ : constant$1(+_), symbol) : size; | ||
}; | ||
@@ -800,5 +803,5 @@ | ||
return symbol; | ||
} | ||
}; | ||
function noop() {} | ||
var noop = function() {}; | ||
@@ -853,5 +856,5 @@ function point(that, x, y) { | ||
function basis(context) { | ||
var basis = function(context) { | ||
return new Basis(context); | ||
} | ||
}; | ||
@@ -904,5 +907,5 @@ function BasisClosed(context) { | ||
function basisClosed(context) { | ||
var basisClosed = function(context) { | ||
return new BasisClosed(context); | ||
} | ||
}; | ||
@@ -943,5 +946,5 @@ function BasisOpen(context) { | ||
function basisOpen(context) { | ||
var basisOpen = function(context) { | ||
return new BasisOpen(context); | ||
} | ||
}; | ||
@@ -1409,5 +1412,5 @@ function Bundle(context, beta) { | ||
function linearClosed(context) { | ||
var linearClosed = function(context) { | ||
return new LinearClosed(context); | ||
} | ||
}; | ||
@@ -1490,3 +1493,3 @@ function sign(x) { | ||
} | ||
} | ||
}; | ||
@@ -1582,5 +1585,5 @@ function MonotoneY(context) { | ||
function natural(context) { | ||
var natural = function(context) { | ||
return new Natural(context); | ||
} | ||
}; | ||
@@ -1629,5 +1632,5 @@ function Step(context, t) { | ||
function step(context) { | ||
var step = function(context) { | ||
return new Step(context, 0.5); | ||
} | ||
}; | ||
@@ -1644,3 +1647,3 @@ function stepBefore(context) { | ||
function none(series, order) { | ||
var none = function(series, order) { | ||
if (!((n = series.length) > 1)) return; | ||
@@ -1653,9 +1656,9 @@ for (var i = 1, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) { | ||
} | ||
} | ||
}; | ||
function none$1(series) { | ||
var none$1 = function(series) { | ||
var n = series.length, o = new Array(n); | ||
while (--n >= 0) o[n] = n; | ||
return o; | ||
} | ||
}; | ||
@@ -1666,4 +1669,4 @@ function stackValue(d, key) { | ||
function stack() { | ||
var keys = constant([]), | ||
var stack = function() { | ||
var keys = constant$1([]), | ||
order = none$1, | ||
@@ -1698,11 +1701,11 @@ offset = none, | ||
stack.keys = function(_) { | ||
return arguments.length ? (keys = typeof _ === "function" ? _ : constant(slice.call(_)), stack) : keys; | ||
return arguments.length ? (keys = typeof _ === "function" ? _ : constant$1(slice.call(_)), stack) : keys; | ||
}; | ||
stack.value = function(_) { | ||
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value; | ||
return arguments.length ? (value = typeof _ === "function" ? _ : constant$1(+_), stack) : value; | ||
}; | ||
stack.order = function(_) { | ||
return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant(slice.call(_)), stack) : order; | ||
return arguments.length ? (order = _ == null ? none$1 : typeof _ === "function" ? _ : constant$1(slice.call(_)), stack) : order; | ||
}; | ||
@@ -1715,5 +1718,5 @@ | ||
return stack; | ||
} | ||
}; | ||
function expand(series, order) { | ||
var expand = function(series, order) { | ||
if (!((n = series.length) > 0)) return; | ||
@@ -1725,5 +1728,5 @@ for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) { | ||
none(series, order); | ||
} | ||
}; | ||
function silhouette(series, order) { | ||
var silhouette = function(series, order) { | ||
if (!((n = series.length) > 0)) return; | ||
@@ -1735,5 +1738,5 @@ for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) { | ||
none(series, order); | ||
} | ||
}; | ||
function wiggle(series, order) { | ||
var wiggle = function(series, order) { | ||
if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return; | ||
@@ -1759,8 +1762,8 @@ for (var y = 0, j = 1, s0, m, n; j < m; ++j) { | ||
none(series, order); | ||
} | ||
}; | ||
function ascending(series) { | ||
var ascending = function(series) { | ||
var sums = series.map(sum); | ||
return none$1(series).sort(function(a, b) { return sums[a] - sums[b]; }); | ||
} | ||
}; | ||
@@ -1773,7 +1776,7 @@ function sum(series) { | ||
function descending$1(series) { | ||
var descending$1 = function(series) { | ||
return ascending(series).reverse(); | ||
} | ||
}; | ||
function insideOut(series) { | ||
var insideOut = function(series) { | ||
var n = series.length, | ||
@@ -1801,7 +1804,7 @@ i, | ||
return bottoms.reverse().concat(tops); | ||
} | ||
}; | ||
function reverse(series) { | ||
var reverse = function(series) { | ||
return none$1(series).reverse(); | ||
} | ||
}; | ||
@@ -1854,2 +1857,2 @@ exports.arc = arc; | ||
}))); | ||
}))); |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-shape/ Version 1.0.3. Copyright 2016 Mike Bostock. | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],i):i(t.d3=t.d3||{},t.d3)}(this,function(t,i){"use strict";function n(t){return function(){return t}}function e(t){return t.innerRadius}function s(t){return t.outerRadius}function h(t){return t.startAngle}function o(t){return t.endAngle}function _(t){return t&&t.padAngle}function a(t){return t>=1?bt:t<=-1?-bt:Math.asin(t)}function r(t,i,n,e,s,h,o,_){var a=n-t,r=e-i,c=o-s,l=_-h,u=(c*(i-h)-l*(t-s))/(l*a-c*r);return[t+u*a,i+u*r]}function c(t,i,n,e,s,h,o){var _=t-n,a=i-e,r=(o?h:-h)/Math.sqrt(_*_+a*a),c=r*a,l=-r*_,u=t+c,f=i+l,x=n+c,y=e+l,p=(u+x)/2,v=(f+y)/2,d=x-u,T=y-f,M=d*d+T*T,g=s-h,b=u*y-x*f,w=(T<0?-1:1)*Math.sqrt(Math.max(0,g*g*M-b*b)),m=(b*T-d*w)/M,k=(-b*d-T*w)/M,N=(b*T+d*w)/M,S=(-b*d+T*w)/M,E=m-p,A=k-v,P=N-p,q=S-v;return E*E+A*A>P*P+q*q&&(m=N,k=S),{cx:m,cy:k,x01:-c,y01:-l,x11:m*(s/g-1),y11:k*(s/g-1)}}function l(){function t(){var t,n,e=+l.apply(this,arguments),s=+u.apply(this,arguments),h=y.apply(this,arguments)-bt,o=p.apply(this,arguments)-bt,_=Math.abs(o-h),T=o>h;if(d||(d=t=i.path()),s<e&&(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),X=s*Math.sin(b),Y=e*Math.cos(k),B=e*Math.sin(k);if(P>Mt){var j=s*Math.cos(w),I=s*Math.sin(w),L=e*Math.cos(m),D=e*Math.sin(m);if(_<gt){var W=N>Mt?r(z,X,L,D,j,I,Y,B):[Y,B],V=z-W[0],F=X-W[1],G=j-W[0],H=I-W[1],J=1/Math.sin(Math.acos((V*G+F*H)/(Math.sqrt(V*V+F*F)*Math.sqrt(G*G+H*H)))/2),K=Math.sqrt(W[0]*W[0]+W[1]*W[1]);q=Math.min(P,(e-K)/(J-1)),C=Math.min(P,(s-K)/(J+1))}}S>Mt?C>Mt?(M=c(L,D,z,X,s,C,T),g=c(j,I,Y,B,s,C,T),d.moveTo(M.cx+M.x01,M.cy+M.y01),C<P?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,X),d.arc(0,0,s,b,w,!T)):d.moveTo(z,X),e>Mt&&N>Mt?q>Mt?(M=c(Y,B,j,I,e,-q,T),g=c(z,X,L,D,e,-q,T),d.lineTo(M.cx+M.x01,M.cy+M.y01),q<P?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(Y,B)}else d.moveTo(0,0);if(d.closePath(),t)return d=null,t+""||null}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,r,c,l=t.length,u=!1;for(null==o&&(a=_(c=i.path())),n=0;n<=l;++n)!(n<l&&h(r=t[n],n,t))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(r,n,t),+s(r,n,t));if(c)return a=null,c+""||null}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 v(){function t(t){var n,e,u,f,x,y=t.length,p=!1,v=new Array(y),d=new Array(y);for(null==r&&(l=c(x=i.path())),n=0;n<=y;++n){if(!(n<y&&a(f=t[n],n,t))===p)if(p=!p)e=n,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),u=n-1;u>=e;--u)l.point(v[u],d[u]);l.lineEnd(),l.areaEnd()}p&&(v[n]=+s(f,n,t),d[n]=+o(f,n,t),l.point(h?+h(f,n,t):v[n],_?+_(f,n,t):d[n]))}if(x)return l=null,x+""||null}function e(){return p().defined(a).curve(c).context(r)}var s=x,h=null,o=n(0),_=y,a=n(!0),r=null,c=f,l=null;return t.x=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),h=null,t):s},t.x0=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),t):s},t.x1=function(i){return arguments.length?(h=null==i?null:"function"==typeof i?i:n(+i),t):h},t.y=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),_=null,t):o},t.y0=function(i){return arguments.length?(o="function"==typeof i?i:n(+i),t):o},t.y1=function(i){return arguments.length?(_=null==i?null:"function"==typeof i?i:n(+i),t):_},t.lineX0=t.lineY0=function(){return e().x(s).y(o)},t.lineY1=function(){return e().x(s).y(_)},t.lineX1=function(){return e().x(h).y(o)},t.defined=function(i){return arguments.length?(a="function"==typeof i?i:n(!!i),t):a},t.curve=function(i){return arguments.length?(c=i,null!=r&&(l=c(r)),t):c},t.context=function(i){return arguments.length?(null==i?r=l=null:l=c(r=i),t):r},t}function d(t,i){return i<t?-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*(v<0?-1:1);for(n=0;n<u;++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;n<u;++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(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?i(b(t)):i()._curve},t}function m(){return w(p().curve(mt))}function k(){var t=v().curve(mt),i=t.curve,n=t.lineX0,e=t.lineX1,s=t.lineY0,h=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return w(n())},delete t.lineX0,t.lineEndAngle=function(){return w(e())},delete t.lineX1,t.lineInnerRadius=function(){return w(s())},delete t.lineY0,t.lineOuterRadius=function(){return w(h())},delete t.lineY1,t.curve=function(t){return arguments.length?i(b(t)):i()._curve},t}function N(){function t(){var t;if(h||(h=t=i.path()),e.apply(this,arguments).draw(h,+s.apply(this,arguments)),t)return h=null,t+""||null}var e=n(kt),s=n(64),h=null;return t.type=function(i){return arguments.length?(e="function"==typeof i?i:n(i),t):e},t.size=function(i){return arguments.length?(s="function"==typeof i?i:n(+i),t):s},t.context=function(i){return arguments.length?(h=null==i?null:i,t):h},t}function S(){}function E(t,i,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+i)/6,(t._y0+4*t._y1+n)/6)}function A(t){this._context=t}function P(t){return new A(t)}function q(t){this._context=t}function C(t){return new q(t)}function O(t){this._context=t}function R(t){return new O(t)}function z(t,i){this._basis=new A(t),this._beta=i}function X(t,i,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Y(t,i){this._context=t,this._k=(1-i)/6}function B(t,i){this._context=t,this._k=(1-i)/6}function j(t,i){this._context=t,this._k=(1-i)/6}function I(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>Mt){var _=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*_-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,s=(s*_-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Mt){var r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);h=(h*r+t._x1*t._l23_2a-i*t._l12_2a)/c,o=(o*r+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(e,s,h,o,t._x2,t._y2)}function L(t,i){this._context=t,this._alpha=i}function D(t,i){this._context=t,this._alpha=i}function W(t,i){this._context=t,this._alpha=i}function V(t){this._context=t}function F(t){return new V(t)}function G(t){return t<0?-1:1}function H(t,i,n){var e=t._x1-t._x0,s=i-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(n-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(G(h)+G(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function J(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function K(t,i,n){var e=t._x0,s=t._y0,h=t._x1,o=t._y1,_=(h-e)/3;t._context.bezierCurveTo(e+_,s+_*i,h-_,o-_*n,h,o)}function Q(t){this._context=t}function U(t){this._context=new Z(t)}function Z(t){this._context=t}function $(t){return new Q(t)}function tt(t){return new U(t)}function it(t){this._context=t}function nt(t){var i,n,e=t.length-1,s=new Array(e),h=new Array(e),o=new Array(e);for(s[0]=0,h[0]=2,o[0]=t[0]+2*t[1],i=1;i<e-1;++i)s[i]=1,h[i]=4,o[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,h[e-1]=7,o[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/h[i-1],h[i]-=n,o[i]-=n*o[i-1];for(s[e-1]=o[e-1]/h[e-1],i=e-2;i>=0;--i)s[i]=(o[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function et(t){return new it(t)}function st(t,i){this._context=t,this._t=i}function ht(t){return new st(t,.5)}function ot(t){return new st(t,0)}function _t(t){return new st(t,1)}function at(t,i){if((e=t.length)>1)for(var n,e,s=1,h=t[i[0]],o=h.length;s<e;++s){n=h,h=t[i[s]];for(var _=0;_<o;++_)h[_][1]+=h[_][0]=isNaN(n[_][1])?n[_][0]:n[_][1]}}function rt(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n}function ct(t,i){return t[i]}function lt(){function t(t){var n,o,_=i.apply(this,arguments),a=t.length,r=_.length,c=new Array(r);for(n=0;n<r;++n){for(var l,u=_[n],f=c[n]=new Array(a),x=0;x<a;++x)f[x]=l=[0,+h(t[x],u,x,t)],l.data=t[x];f.key=u}for(n=0,o=e(c);n<r;++n)c[o[n]].index=n;return s(c,o),c}var i=n([]),e=rt,s=at,h=ct;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?rt:"function"==typeof i?i:n(Ut.call(i)),t):e},t.offset=function(i){return arguments.length?(s=null==i?at:i,t):s},t}function ut(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;h<o;++h){for(s=n=0;n<e;++n)s+=t[n][h][1]||0;if(s)for(n=0;n<e;++n)t[n][h][1]/=s}at(t,i)}}function ft(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;e<h;++e){for(var o=0,_=0;o<n;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}at(t,i)}}function xt(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;o<e;++o){for(var _=0,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,at(t,i)}}function yt(t){var i=t.map(pt);return rt(t).sort(function(t,n){return i[t]-i[n]})}function pt(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}function vt(t){return yt(t).reverse()}function dt(t){var i,n,e=t.length,s=t.map(pt),h=rt(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,a=[],r=[];for(i=0;i<e;++i)n=h[i],o<_?(o+=s[n],a.push(n)):(_+=s[n],r.push(n));return r.reverse().concat(a)}function Tt(t){return rt(t).reverse()}var 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)}}};var mt=b(f);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 kt={draw:function(t,i){var n=Math.sqrt(i/gt);t.moveTo(n,0),t.arc(0,0,n,0,wt)}},Nt={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()}},St=Math.sqrt(1/3),Et=2*St,At={draw:function(t,i){var n=Math.sqrt(i/Et),e=n*St;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},Pt=.8908130915292852,qt=Math.sin(gt/10)/Math.sin(7*gt/10),Ct=Math.sin(wt/10)*qt,Ot=-Math.cos(wt/10)*qt,Rt={draw:function(t,i){var n=Math.sqrt(i*Pt),e=Ct*n,s=Ot*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;h<5;++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()}},zt={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()}},Bt=-.5,jt=Math.sqrt(3)/2,It=1/Math.sqrt(12),Lt=3*(It/2+1),Dt={draw:function(t,i){var n=Math.sqrt(i/Lt),e=n/2,s=n*It,h=e,o=n*It+n,_=-h,a=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,a),t.lineTo(Bt*e-jt*s,jt*e+Bt*s),t.lineTo(Bt*h-jt*o,jt*h+Bt*o),t.lineTo(Bt*_-jt*a,jt*_+Bt*a),t.lineTo(Bt*e+jt*s,Bt*s-jt*e),t.lineTo(Bt*h+jt*o,Bt*o-jt*h),t.lineTo(Bt*_+jt*a,Bt*a-jt*_),t.closePath()}},Wt=[kt,Nt,At,zt,Rt,Yt,Dt];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)}};var Vt=function t(i){function n(t){return 1===i?new A(t):new z(t,i)}return n.beta=function(i){return t(+i)},n}(.85);Y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:X(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Ft=function t(i){function n(t){return new Y(t,i)}return n.tension=function(i){return t(+i)},n}(0);B.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Gt=function t(i){function n(t){return new B(t,i)}return n.tension=function(i){return t(+i)},n}(0);j.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:X(this,t,i)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Ht=function t(i){function n(t){return new j(t,i)}return n.tension=function(i){return t(+i)},n}(0);L.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Jt=function t(i){function n(t){return i?new L(t,i):new Y(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);D.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=i;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=i);break;case 2:this._point=3,this._x5=t,this._y5=i;break;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Kt=function t(i){function n(t){return i?new D(t,i):new B(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);W.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I(this,t,i)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};var Qt=function t(i){function n(t){return i?new W(t,i):new j(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);V.prototype={areaStart:S,areaEnd:S,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,i){t=+t,i=+i,this._point?this._context.lineTo(t,i):(this._point=1,this._context.moveTo(t,i))}},Q.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:K(this,this._t0,J(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var n=NaN;if(t=+t,i=+i,t!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,K(this,J(this,n=H(this,t,i)),n);break;default:K(this,this._t0,n=H(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(U.prototype=Object.create(Q.prototype)).point=function(t,i){Q.prototype.point.call(this,i,t)},Z.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,n,e,s,h){this._context.bezierCurveTo(i,t,e,n,h,s)}},it.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),2===n)this._context.lineTo(t[1],i[1]);else for(var e=nt(t),s=nt(i),h=0,o=1;o<n;++h,++o)this._context.bezierCurveTo(e[0][h],s[0][h],e[1][h],s[1][h],t[o],i[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}},st.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}}this._x=t,this._y=i}};var Ut=Array.prototype.slice;t.arc=l,t.area=v,t.line=p,t.pie=M,t.radialArea=k,t.radialLine=m,t.symbol=N,t.symbols=Wt,t.symbolCircle=kt,t.symbolCross=Nt,t.symbolDiamond=At,t.symbolSquare=zt,t.symbolStar=Rt,t.symbolTriangle=Yt,t.symbolWye=Dt,t.curveBasisClosed=C,t.curveBasisOpen=R,t.curveBasis=P,t.curveBundle=Vt,t.curveCardinalClosed=Gt,t.curveCardinalOpen=Ht,t.curveCardinal=Ft,t.curveCatmullRomClosed=Kt,t.curveCatmullRomOpen=Qt,t.curveCatmullRom=Jt,t.curveLinearClosed=F,t.curveLinear=f,t.curveMonotoneX=$,t.curveMonotoneY=tt,t.curveNatural=et,t.curveStep=ht,t.curveStepAfter=_t,t.curveStepBefore=ot,t.stack=lt,t.stackOffsetExpand=ut,t.stackOffsetNone=at,t.stackOffsetSilhouette=ft,t.stackOffsetWiggle=xt,t.stackOrderAscending=yt,t.stackOrderDescending=vt,t.stackOrderInsideOut=dt,t.stackOrderNone=rt,t.stackOrderReverse=Tt,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-shape/ Version 1.0.4. Copyright 2016 Mike Bostock. | ||
!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("d3-path")):"function"==typeof define&&define.amd?define(["exports","d3-path"],i):i(t.d3=t.d3||{},t.d3)}(this,function(t,i){"use strict";function n(t){return t.innerRadius}function e(t){return t.outerRadius}function s(t){return t.startAngle}function h(t){return t.endAngle}function o(t){return t&&t.padAngle}function _(t){return t>=1?K:t<=-1?-K:Math.asin(t)}function a(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 r(t,i,n,e,s,h,o){var _=t-n,a=i-e,r=(o?h:-h)/Math.sqrt(_*_+a*a),c=r*a,l=-r*_,u=t+c,f=i+l,x=n+c,y=e+l,p=(u+x)/2,v=(f+y)/2,d=x-u,T=y-f,M=d*d+T*T,g=s-h,b=u*y-x*f,w=(T<0?-1:1)*Math.sqrt(Math.max(0,g*g*M-b*b)),m=(b*T-d*w)/M,k=(-b*d-T*w)/M,N=(b*T+d*w)/M,S=(-b*d+T*w)/M,E=m-p,A=k-v,P=N-p,q=S-v;return E*E+A*A>P*P+q*q&&(m=N,k=S),{cx:m,cy:k,x01:-c,y01:-l,x11:m*(s/g-1),y11:k*(s/g-1)}}function c(t){this._context=t}function l(t){return t[0]}function u(t){return t[1]}function f(t){this._curve=t}function x(t){function i(i){return new f(t(i))}return i._curve=t,i}function y(t){var i=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?i(x(t)):i()._curve},t}function p(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 v(t){this._context=t}function d(t){this._context=t}function T(t){this._context=t}function M(t,i){this._basis=new v(t),this._beta=i}function g(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 w(t,i){this._context=t,this._k=(1-i)/6}function m(t,i){this._context=t,this._k=(1-i)/6}function k(t,i,n){var e=t._x1,s=t._y1,h=t._x2,o=t._y2;if(t._l01_a>H){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>H){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 N(t,i){this._context=t,this._alpha=i}function S(t,i){this._context=t,this._alpha=i}function E(t,i){this._context=t,this._alpha=i}function A(t){this._context=t}function P(t){return t<0?-1:1}function q(t,i,n){var e=t._x1-t._x0,s=i-t._x1,h=(t._y1-t._y0)/(e||s<0&&-0),o=(n-t._y1)/(s||e<0&&-0),_=(h*s+o*e)/(e+s);return(P(h)+P(o))*Math.min(Math.abs(h),Math.abs(o),.5*Math.abs(_))||0}function C(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function O(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 R(t){this._context=t}function z(t){this._context=new X(t)}function X(t){this._context=t}function Y(t){return new R(t)}function B(t){return new z(t)}function j(t){this._context=t}function I(t){var i,n,e=t.length-1,s=new Array(e),h=new Array(e),o=new Array(e);for(s[0]=0,h[0]=2,o[0]=t[0]+2*t[1],i=1;i<e-1;++i)s[i]=1,h[i]=4,o[i]=4*t[i]+2*t[i+1];for(s[e-1]=2,h[e-1]=7,o[e-1]=8*t[e-1]+t[e],i=1;i<e;++i)n=s[i]/h[i-1],h[i]-=n,o[i]-=n*o[i-1];for(s[e-1]=o[e-1]/h[e-1],i=e-2;i>=0;--i)s[i]=(o[i]-s[i+1])/h[i];for(h[e-1]=(t[e]+s[e-1])/2,i=0;i<e-1;++i)h[i]=2*t[i+1]-s[i+1];return[s,h]}function L(t,i){this._context=t,this._t=i}function D(t){return new L(t,0)}function W(t){return new L(t,1)}function V(t,i){return t[i]}function F(t){for(var i,n=0,e=-1,s=t.length;++e<s;)(i=+t[e][1])&&(n+=i);return n}var G=function(t){return function(){return t}},H=1e-12,J=Math.PI,K=J/2,Q=2*J,U=function(){function t(){var t,n,e=+c.apply(this,arguments),s=+l.apply(this,arguments),h=x.apply(this,arguments)-K,o=y.apply(this,arguments)-K,d=Math.abs(o-h),T=o>h;if(v||(v=t=i.path()),s<e&&(n=s,s=e,e=n),s>H)if(d>Q-H)v.moveTo(s*Math.cos(h),s*Math.sin(h)),v.arc(0,0,s,h,o,!T),e>H&&(v.moveTo(e*Math.cos(o),e*Math.sin(o)),v.arc(0,0,e,o,h,T));else{var M,g,b=h,w=o,m=h,k=o,N=d,S=d,E=p.apply(this,arguments)/2,A=E>H&&(f?+f.apply(this,arguments):Math.sqrt(e*e+s*s)),P=Math.min(Math.abs(s-e)/2,+u.apply(this,arguments)),q=P,C=P;if(A>H){var O=_(A/e*Math.sin(E)),R=_(A/s*Math.sin(E));(N-=2*O)>H?(O*=T?1:-1,m+=O,k-=O):(N=0,m=k=(h+o)/2),(S-=2*R)>H?(R*=T?1:-1,b+=R,w-=R):(S=0,b=w=(h+o)/2)}var z=s*Math.cos(b),X=s*Math.sin(b),Y=e*Math.cos(k),B=e*Math.sin(k);if(P>H){var j=s*Math.cos(w),I=s*Math.sin(w),L=e*Math.cos(m),D=e*Math.sin(m);if(d<J){var W=N>H?a(z,X,L,D,j,I,Y,B):[Y,B],V=z-W[0],F=X-W[1],G=j-W[0],U=I-W[1],Z=1/Math.sin(Math.acos((V*G+F*U)/(Math.sqrt(V*V+F*F)*Math.sqrt(G*G+U*U)))/2),$=Math.sqrt(W[0]*W[0]+W[1]*W[1]);q=Math.min(P,(e-$)/(Z-1)),C=Math.min(P,(s-$)/(Z+1))}}S>H?C>H?(M=r(L,D,z,X,s,C,T),g=r(j,I,Y,B,s,C,T),v.moveTo(M.cx+M.x01,M.cy+M.y01),C<P?v.arc(M.cx,M.cy,C,Math.atan2(M.y01,M.x01),Math.atan2(g.y01,g.x01),!T):(v.arc(M.cx,M.cy,C,Math.atan2(M.y01,M.x01),Math.atan2(M.y11,M.x11),!T),v.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),v.arc(g.cx,g.cy,C,Math.atan2(g.y11,g.x11),Math.atan2(g.y01,g.x01),!T))):(v.moveTo(z,X),v.arc(0,0,s,b,w,!T)):v.moveTo(z,X),e>H&&N>H?q>H?(M=r(Y,B,j,I,e,-q,T),g=r(z,X,L,D,e,-q,T),v.lineTo(M.cx+M.x01,M.cy+M.y01),q<P?v.arc(M.cx,M.cy,q,Math.atan2(M.y01,M.x01),Math.atan2(g.y01,g.x01),!T):(v.arc(M.cx,M.cy,q,Math.atan2(M.y01,M.x01),Math.atan2(M.y11,M.x11),!T),v.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),v.arc(g.cx,g.cy,q,Math.atan2(g.y11,g.x11),Math.atan2(g.y01,g.x01),!T))):v.arc(0,0,e,k,m,T):v.lineTo(Y,B)}else v.moveTo(0,0);if(v.closePath(),t)return v=null,t+""||null}var c=n,l=e,u=G(0),f=null,x=s,y=h,p=o,v=null;return t.centroid=function(){var t=(+c.apply(this,arguments)+ +l.apply(this,arguments))/2,i=(+x.apply(this,arguments)+ +y.apply(this,arguments))/2-J/2;return[Math.cos(i)*t,Math.sin(i)*t]},t.innerRadius=function(i){return arguments.length?(c="function"==typeof i?i:G(+i),t):c},t.outerRadius=function(i){return arguments.length?(l="function"==typeof i?i:G(+i),t):l},t.cornerRadius=function(i){return arguments.length?(u="function"==typeof i?i:G(+i),t):u},t.padRadius=function(i){return arguments.length?(f=null==i?null:"function"==typeof i?i:G(+i),t):f},t.startAngle=function(i){return arguments.length?(x="function"==typeof i?i:G(+i),t):x},t.endAngle=function(i){return arguments.length?(y="function"==typeof i?i:G(+i),t):y},t.padAngle=function(i){return arguments.length?(p="function"==typeof i?i:G(+i),t):p},t.context=function(i){return arguments.length?(v=null==i?null:i,t):v},t};c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i)}}};var Z=function(t){return new c(t)},$=function(){function t(t){var a,r,c,l=t.length,u=!1;for(null==h&&(_=o(c=i.path())),a=0;a<=l;++a)!(a<l&&s(r=t[a],a,t))===u&&((u=!u)?_.lineStart():_.lineEnd()),u&&_.point(+n(r,a,t),+e(r,a,t));if(c)return _=null,c+""||null}var n=l,e=u,s=G(!0),h=null,o=Z,_=null;return t.x=function(i){return arguments.length?(n="function"==typeof i?i:G(+i),t):n},t.y=function(i){return arguments.length?(e="function"==typeof i?i:G(+i),t):e},t.defined=function(i){return arguments.length?(s="function"==typeof i?i:G(!!i),t):s},t.curve=function(i){return arguments.length?(o=i,null!=h&&(_=o(h)),t):o},t.context=function(i){return arguments.length?(null==i?h=_=null:_=o(h=i),t):h},t},tt=function(){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;n<=y;++n){if(!(n<y&&_(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]))}if(x)return c=null,x+""||null}function n(){return $().defined(_).curve(r).context(a)}var e=l,s=null,h=G(0),o=u,_=G(!0),a=null,r=Z,c=null;return t.x=function(i){return arguments.length?(e="function"==typeof i?i:G(+i),s=null,t):e},t.x0=function(i){return arguments.length?(e="function"==typeof i?i:G(+i),t):e},t.x1=function(i){return arguments.length?(s=null==i?null:"function"==typeof i?i:G(+i),t):s},t.y=function(i){return arguments.length?(h="function"==typeof i?i:G(+i),o=null,t):h},t.y0=function(i){return arguments.length?(h="function"==typeof i?i:G(+i),t):h},t.y1=function(i){return arguments.length?(o=null==i?null:"function"==typeof i?i:G(+i),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(h)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(s).y(h)},t.defined=function(i){return arguments.length?(_="function"==typeof i?i:G(!!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},it=function(t,i){return i<t?-1:i>t?1:i>=t?0:NaN},nt=function(t){return t},et=function(){function t(t){var _,a,r,c,l,u=t.length,f=0,x=new Array(u),y=new Array(u),p=+s.apply(this,arguments),v=Math.min(Q,Math.max(-Q,h.apply(this,arguments)-p)),d=Math.min(Math.abs(v)/u,o.apply(this,arguments)),T=d*(v<0?-1:1);for(_=0;_<u;++_)(l=y[x[_]=_]=+i(t[_],_,t))>0&&(f+=l);for(null!=n?x.sort(function(t,i){return n(y[t],y[i])}):null!=e&&x.sort(function(i,n){return e(t[i],t[n])}),_=0,r=f?(v-u*T)/f:0;_<u;++_,p=c)a=x[_],l=y[a],c=p+(l>0?l*r:0)+T,y[a]={data:t[a],index:_,value:l,startAngle:p,endAngle:c,padAngle:d};return y}var i=nt,n=it,e=null,s=G(0),h=G(Q),o=G(0);return t.value=function(n){return arguments.length?(i="function"==typeof n?n:G(+n),t):i},t.sortValues=function(i){return arguments.length?(n=i,e=null,t):n},t.sort=function(i){return arguments.length?(e=i,n=null,t):e},t.startAngle=function(i){return arguments.length?(s="function"==typeof i?i:G(+i),t):s},t.endAngle=function(i){return arguments.length?(h="function"==typeof i?i:G(+i),t):h},t.padAngle=function(i){return arguments.length?(o="function"==typeof i?i:G(+i),t):o},t},st=x(Z);f.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 ht=function(){return y($().curve(st))},ot=function(){var t=tt().curve(st),i=t.curve,n=t.lineX0,e=t.lineX1,s=t.lineY0,h=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return y(n())},delete t.lineX0,t.lineEndAngle=function(){return y(e())},delete t.lineX1,t.lineInnerRadius=function(){return y(s())},delete t.lineY0,t.lineOuterRadius=function(){return y(h())},delete t.lineY1,t.curve=function(t){return arguments.length?i(x(t)):i()._curve},t},_t={draw:function(t,i){var n=Math.sqrt(i/J);t.moveTo(n,0),t.arc(0,0,n,0,Q)}},at={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),ct=2*rt,lt={draw:function(t,i){var n=Math.sqrt(i/ct),e=n*rt;t.moveTo(0,-n),t.lineTo(e,0),t.lineTo(0,n),t.lineTo(-e,0),t.closePath()}},ut=.8908130915292852,ft=Math.sin(J/10)/Math.sin(7*J/10),xt=Math.sin(Q/10)*ft,yt=-Math.cos(Q/10)*ft,pt={draw:function(t,i){var n=Math.sqrt(i*ut),e=xt*n,s=yt*n;t.moveTo(0,-n),t.lineTo(e,s);for(var h=1;h<5;++h){var o=Q*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)}},dt=Math.sqrt(3),Tt={draw:function(t,i){var n=-Math.sqrt(i/(3*dt));t.moveTo(0,2*n),t.lineTo(-dt*n,-n),t.lineTo(dt*n,-n),t.closePath()}},Mt=-.5,gt=Math.sqrt(3)/2,bt=1/Math.sqrt(12),wt=3*(bt/2+1),mt={draw:function(t,i){var n=Math.sqrt(i/wt),e=n/2,s=n*bt,h=e,o=n*bt+n,_=-h,a=o;t.moveTo(e,s),t.lineTo(h,o),t.lineTo(_,a),t.lineTo(Mt*e-gt*s,gt*e+Mt*s),t.lineTo(Mt*h-gt*o,gt*h+Mt*o),t.lineTo(Mt*_-gt*a,gt*_+Mt*a),t.lineTo(Mt*e+gt*s,Mt*s-gt*e),t.lineTo(Mt*h+gt*o,Mt*o-gt*h),t.lineTo(Mt*_+gt*a,Mt*a-gt*_),t.closePath()}},kt=[_t,at,lt,vt,pt,Tt,mt],Nt=function(){function t(){var t;if(s||(s=t=i.path()),n.apply(this,arguments).draw(s,+e.apply(this,arguments)),t)return s=null,t+""||null}var n=G(_t),e=G(64),s=null;return t.type=function(i){return arguments.length?(n="function"==typeof i?i:G(i),t):n},t.size=function(i){return arguments.length?(e="function"==typeof i?i:G(+i),t):e},t.context=function(i){return arguments.length?(s=null==i?null:i,t):s},t},St=function(){};v.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:p(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:p(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};var Et=function(t){return new v(t)};d.prototype={areaStart:St,areaEnd:St,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:p(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};var At=function(t){return new d(t)};T.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:p(this,t,i)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i}};var Pt=function(t){return new T(t)};M.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 qt=function t(i){function n(t){return 1===i?new v(t):new M(t,i)}return n.beta=function(i){return t(+i)},n}(.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:g(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:g(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 Ct=function t(i){function n(t){return new b(t,i)}return n.tension=function(i){return t(+i)},n}(0);w.prototype={areaStart:St,areaEnd:St,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:g(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 Ot=function t(i){function n(t){return new w(t,i)}return n.tension=function(i){return t(+i)},n}(0);m.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:g(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 Rt=function t(i){function n(t){return new m(t,i)}return n.tension=function(i){return t(+i)},n}(0);N.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:k(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 zt=function t(i){function n(t){return i?new N(t,i):new b(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);S.prototype={areaStart:St,areaEnd:St,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:k(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 Xt=function t(i){function n(t){return i?new S(t,i):new w(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);E.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:k(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 Yt=function t(i){function n(t){return i?new E(t,i):new m(t,0)}return n.alpha=function(i){return t(+i)},n}(.5);A.prototype={areaStart:St,areaEnd:St,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))}};var Bt=function(t){return new A(t)};R.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:O(this,this._t0,C(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,O(this,C(this,n=q(this,t,i)),n);break;default:O(this,this._t0,n=q(this,t,i))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}},(z.prototype=Object.create(R.prototype)).point=function(t,i){R.prototype.point.call(this,i,t)},X.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)}},j.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=I(t),s=I(i),h=0,o=1;o<n;++h,++o)this._context.bezierCurveTo(e[0][h],s[0][h],e[1][h],s[1][h],t[o],i[o]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,i){this._x.push(+t),this._y.push(+i)}};var jt=function(t){return new j(t)};L.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}}this._x=t,this._y=i}};var It=function(t){return new L(t,.5)},Lt=Array.prototype.slice,Dt=function(t,i){if((e=t.length)>1)for(var n,e,s=1,h=t[i[0]],o=h.length;s<e;++s){n=h,h=t[i[s]];for(var _=0;_<o;++_)h[_][1]+=h[_][0]=isNaN(n[_][1])?n[_][0]:n[_][1]}},Wt=function(t){for(var i=t.length,n=new Array(i);--i>=0;)n[i]=i;return n},Vt=function(){function t(t){var h,o,_=i.apply(this,arguments),a=t.length,r=_.length,c=new Array(r);for(h=0;h<r;++h){for(var l,u=_[h],f=c[h]=new Array(a),x=0;x<a;++x)f[x]=l=[0,+s(t[x],u,x,t)],l.data=t[x];f.key=u}for(h=0,o=n(c);h<r;++h)c[o[h]].index=h;return e(c,o),c}var i=G([]),n=Wt,e=Dt,s=V;return t.keys=function(n){return arguments.length?(i="function"==typeof n?n:G(Lt.call(n)),t):i},t.value=function(i){return arguments.length?(s="function"==typeof i?i:G(+i),t):s},t.order=function(i){return arguments.length?(n=null==i?Wt:"function"==typeof i?i:G(Lt.call(i)),t):n},t.offset=function(i){return arguments.length?(e=null==i?Dt:i,t):e},t},Ft=function(t,i){if((e=t.length)>0){for(var n,e,s,h=0,o=t[0].length;h<o;++h){for(s=n=0;n<e;++n)s+=t[n][h][1]||0;if(s)for(n=0;n<e;++n)t[n][h][1]/=s}Dt(t,i)}},Gt=function(t,i){if((n=t.length)>0){for(var n,e=0,s=t[i[0]],h=s.length;e<h;++e){for(var o=0,_=0;o<n;++o)_+=t[o][e][1]||0;s[e][1]+=s[e][0]=-_/2}Dt(t,i)}},Ht=function(t,i){if((s=t.length)>0&&(e=(n=t[i[0]]).length)>0){for(var n,e,s,h=0,o=1;o<e;++o){for(var _=0,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,Dt(t,i)}},Jt=function(t){var i=t.map(F);return Wt(t).sort(function(t,n){return i[t]-i[n]})},Kt=function(t){return Jt(t).reverse()},Qt=function(t){var i,n,e=t.length,s=t.map(F),h=Wt(t).sort(function(t,i){return s[i]-s[t]}),o=0,_=0,a=[],r=[];for(i=0;i<e;++i)n=h[i],o<_?(o+=s[n],a.push(n)):(_+=s[n],r.push(n));return r.reverse().concat(a)},Ut=function(t){return Wt(t).reverse()};t.arc=U,t.area=tt,t.line=$,t.pie=et,t.radialArea=ot,t.radialLine=ht,t.symbol=Nt,t.symbols=kt,t.symbolCircle=_t,t.symbolCross=at,t.symbolDiamond=lt,t.symbolSquare=vt,t.symbolStar=pt,t.symbolTriangle=Tt,t.symbolWye=mt,t.curveBasisClosed=At,t.curveBasisOpen=Pt,t.curveBasis=Et,t.curveBundle=qt,t.curveCardinalClosed=Ot,t.curveCardinalOpen=Rt,t.curveCardinal=Ct,t.curveCatmullRomClosed=Xt,t.curveCatmullRomOpen=Yt,t.curveCatmullRom=zt,t.curveLinearClosed=Bt,t.curveLinear=Z,t.curveMonotoneX=Y,t.curveMonotoneY=B,t.curveNatural=jt,t.curveStep=It,t.curveStepAfter=W,t.curveStepBefore=D,t.stack=Vt,t.stackOffsetExpand=Ft,t.stackOffsetNone=Dt,t.stackOffsetSilhouette=Gt,t.stackOffsetWiggle=Ht,t.stackOrderAscending=Jt,t.stackOrderDescending=Kt,t.stackOrderInsideOut=Qt,t.stackOrderNone=Wt,t.stackOrderReverse=Ut,Object.defineProperty(t,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-shape", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Graphical primitives for visualization, such as lines and areas.", | ||
@@ -37,5 +37,5 @@ "keywords": [ | ||
"d3-polygon": "1", | ||
"eslint": "2", | ||
"eslint": "3", | ||
"package-preamble": "0.0", | ||
"rollup": "0.34", | ||
"rollup": "0.36", | ||
"tape": "4", | ||
@@ -42,0 +42,0 @@ "uglify-js": "2" |
Sorry, the diff of this file is not supported yet
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
932109
3173