-
Notifications
You must be signed in to change notification settings - Fork 1
/
d3.min.js
62 lines (62 loc) · 31 KB
/
d3.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
(function(){function Q(a){return Array.prototype.slice.call(a)}function x(a){return typeof a=="function"?a:function(){return a}}function D(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}}function qa(a){return a==null}function ca(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function da(a,b){b=Q(arguments);b[0]=this;a.apply(this,b);return this}function ra(){var a={},b=[];a.add=function(c){for(var g=0;g<b.length;g++)if(b[g].listener==c)return a;b.push({listener:c,
on:true});return a};a.remove=function(c){for(var g=0;g<b.length;g++){var e=b[g];if(e.listener==c){e.on=false;b=b.slice(0,g).concat(b.slice(g+1));break}}return a};a.dispatch=function(){for(var c=b,g=0,e=c.length;g<e;g++){var d=c[g];d.on&&d.listener.apply(this,arguments)}};return a}function ea(a){return function(b){return 1-a(1-b)}}function fa(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function sa(a){return a}function R(a){return function(b){return Math.pow(b,a)}}function ta(a){return 1-
Math.cos(a*Math.PI/2)}function ua(a){return a?Math.pow(2,10*(a-1))-0.0010:0}function va(a){return 1-Math.sqrt(1-a*a)}function wa(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+0.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+0.9375:7.5625*(a-=2.625/2.75)*a+0.984375}function J(a,b,c){return{r:a,g:b,b:c,toString:xa}}function xa(){return"#"+S(this.r)+S(this.g)+S(this.b)}function S(a){return a<16?"0"+a.toString(16):a.toString(16)}function T(a,b,c){var g=0,e=0,d=0,h,f;if(h=/([a-z]+)\((.*)\)/i.exec(a)){f=
h[2].split(",");switch(h[1]){case "hsl":return c(parseFloat(f[0]),parseFloat(f[1])/100,parseFloat(f[2])/100);case "rgb":return b(U(f[0]),U(f[1]),U(f[2]))}}if(c=G[a])return b(c.r,c.g,c.b);if(a!=null&&a.charAt(0)=="#"){if(a.length==4){g=a.charAt(1);g+=g;e=a.charAt(2);e+=e;d=a.charAt(3);d+=d}else if(a.length==7){g=a.substring(1,3);e=a.substring(3,5);d=a.substring(5,7)}g=parseInt(g,16);e=parseInt(e,16);d=parseInt(d,16)}return b(g,e,d)}function ya(a,b,c){var g=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,
b,c),d=e-g,h=(e+g)/2;if(d){g=h<0.5?d/(e+g):d/(2-e-g);a=a==e?(b-c)/d+(b<c?6:0):b==e?(c-a)/d+2:(a-b)/d+4;a*=60}else g=a=0;return V(a,g,h)}function U(a){var b=parseFloat(a);return a.charAt(a.length-1)=="%"?Math.round(b*2.55):b}function V(a,b,c){return{h:a,s:b,l:c,toString:za}}function za(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"}function ga(a,b,c){function g(h){if(h>360)h-=360;else if(h<0)h+=360;if(h<60)return e+(d-e)*h/60;if(h<180)return d;if(h<240)return e+(d-e)*(240-h)/60;return e}
var e,d;a%=360;if(a<0)a+=360;b=b<0?0:b>1?1:b;c=c<0?0:c>1?1:c;d=c<=0.5?c*(1+b):c+b-c*b;e=2*c-d;return J(Math.round(g(a+120)*255),Math.round(g(a)*255),Math.round(g(a-120)*255))}function y(a){function b(e){for(var d=[],h,f,i,k,j=0,o=a.length;j<o;j++){i=a[j];d.push(h=[]);h.parentNode=i.parentNode;h.parentData=i.parentData;for(var p=0,l=i.length;p<l;p++)if(k=i[p]){h.push(f=e(k));if(f&&"__data__"in k)f.__data__=k.__data__}else h.push(null)}return y(d)}function c(e){for(var d=[],h,f,i,k=0,j=a.length;k<j;k++){f=
a[k];for(var o=0,p=f.length;o<p;o++)if(i=f[o]){d.push(h=e(i));h.parentNode=i;h.parentData=i.__data__}}return y(d)}function g(e){for(var d=0,h=a.length;d<h;d++)for(var f=a[d],i=0,k=f.length;i<k;i++){var j=f[i];if(j)return e.call(j,j.__data__,i)}return null}a.select=function(e){return b(function(d){return d.querySelector(e)})};a.selectAll=function(e){return c(function(d){return Q(d.querySelectorAll(e))})};a.filter=function(e){for(var d=[],h,f,i,k=0,j=a.length;k<j;k++){f=a[k];d.push(h=[]);h.parentNode=
f.parentNode;h.parentData=f.parentData;for(var o=0,p=f.length;o<p;o++)if((i=f[o])&&e.call(i,i.__data__,o))h.push(i)}return y(d)};a.data=function(e,d){function h(l,n){function q(Aa){return{__data__:Aa,appendChild:function(H){return l.parentNode.appendChild(H)},insertBefore:function(H,Ba){return l.parentNode.insertBefore(H,Ba)},querySelector:function(H){return l.parentNode.querySelector(H)}}}var m=0,r=l.length,t=n.length,s=Math.min(r,t),u=Math.max(r,t),z=[],A=[],v=[],w,B;if(d){s={};u=[];var E;B=n.length;
for(m=0;m<r;m++){E=d.call(w=l[m],w.__data__,m);if(E in s)v[B++]=l[m];else{s[E]=w;u.push(E)}}for(m=0;m<t;m++){if(w=s[E=d.call(n,B=n[m],m)]){w.__data__=B;z[m]=w;A[m]=v[m]=null}else{A[m]=q(B);z[m]=v[m]=null}delete s[E]}for(m=0;m<r;m++)if(u[m]in s)v[m]=l[m]}else{for(;m<s;m++){w=l[m];B=n[m];if(w){w.__data__=B;z[m]=w;A[m]=v[m]=null}else{A[m]=q(B);z[m]=v[m]=null}}for(;m<t;m++){A[m]=q(n[m]);z[m]=v[m]=null}for(;m<u;m++){v[m]=l[m];A[m]=z[m]=null}}A.parentNode=z.parentNode=v.parentNode=l.parentNode;A.parentData=
z.parentData=v.parentData=l.parentData;f.push(A);i.push(z);k.push(v)}var f=[],i=[],k=[],j=-1,o=a.length,p;if(typeof e=="function")for(;++j<o;)h(p=a[j],e.call(p,p.parentData,j));else for(;++j<o;)h(p=a[j],e);j=y(i);j.enter=function(){return y(f)};j.exit=function(){return y(k)};return j};a.each=function(e){for(var d=0,h=a.length;d<h;d++)for(var f=a[d],i=0,k=f.length;i<k;i++){var j=f[i];j&&e.call(j,j.__data__,i)}return a};a.empty=function(){return!g(function(){return true})};a.node=function(){return g(function(){return this})};
a.attr=function(e,d){function h(){this.removeAttribute(e)}function f(){this.removeAttributeNS(e.space,e.local)}function i(){this.setAttribute(e,d)}function k(){this.setAttributeNS(e.space,e.local,d)}function j(){var p=d.apply(this,arguments);p==null?this.removeAttribute(e):this.setAttribute(e,p)}function o(){var p=d.apply(this,arguments);p==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,p)}e=d3.ns.qualify(e);if(arguments.length<2)return g(e.local?function(){return this.getAttributeNS(e.space,
e.local)}:function(){return this.getAttribute(e)});return a.each(d==null?e.local?f:h:typeof d=="function"?e.local?o:j:e.local?k:i)};a.classed=function(e,d){function h(){var j=this.className;k.lastIndex=0;if(!k.test(j))this.className=ca(j+" "+e)}function f(){var j=ca(this.className.replace(k," "));this.className=j.length?j:null}function i(){(d.apply(this,arguments)?h:f).call(this)}var k=RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2)return g(function(){k.lastIndex=0;return k.test(this.className)});
return a.each(typeof d=="function"?i:d?h:f)};a.style=function(e,d,h){function f(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,d,h)}function k(){var j=d.apply(this,arguments);j==null?this.style.removeProperty(e):this.style.setProperty(e,j,h)}if(arguments.length<3)h=null;if(arguments.length<2)return g(function(){return window.getComputedStyle(this,null).getPropertyValue(e)});return a.each(d==null?f:typeof d=="function"?k:i)};a.property=function(e,d){function h(){delete this[e]}
function f(){this[e]=d}function i(){var k=d.apply(this,arguments);if(k==null)delete this[e];else this[e]=k}e=d3.ns.qualify(e);if(arguments.length<2)return g(function(){return this[e]});return a.each(d==null?h:typeof d=="function"?i:f)};a.text=function(e){function d(){this.appendChild(document.createTextNode(e))}function h(){var f=e.apply(this,arguments);f!=null&&this.appendChild(document.createTextNode(f))}if(arguments.length<1)return g(function(){return this.textContent});a.each(function(){for(;this.lastChild;)this.removeChild(this.lastChild)});
return e==null?a:a.each(typeof e=="function"?h:d)};a.html=function(e){function d(){this.innerHTML=e}function h(){this.innerHTML=e.apply(this,arguments)}if(arguments.length<1)return g(function(){return this.innerHTML});return a.each(typeof e=="function"?h:d)};a.append=function(e){function d(f){return f.appendChild(document.createElement(e))}function h(f){return f.appendChild(document.createElementNS(e.space,e.local))}e=d3.ns.qualify(e);return b(e.local?h:d)};a.insert=function(e,d){function h(i){return i.insertBefore(document.createElement(e),
i.querySelector(d))}function f(i){return i.insertBefore(document.createElementNS(e.space,e.local),i.querySelector(d))}e=d3.ns.qualify(e);return b(e.local?f:h)};a.remove=function(){return b(function(e){var d=e.parentNode;d.removeChild(e);return d})};a.sort=function(e){e=Ca.apply(this,arguments);for(var d=0,h=a.length;d<h;d++){var f=a[d];f.sort(e);for(var i=1,k=f.length,j=f[0];i<k;i++){var o=f[i];if(o){j&&j.parentNode.insertBefore(o,j.nextSibling);j=o}}}return a};a.on=function(e,d){e="on"+e;return a.each(function(h,
f){this[e]=function(i){var k=d3.event;d3.event=i;try{d.call(this,h,f)}finally{d3.event=k}}})};a.transition=function(){return W(a)};a.call=da;return a}function Ca(a){if(!arguments.length)a=d3.ascending;return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function W(a){function b(l){var n=true,q=-1;a.each(function(){if(i[++q]!=2){var m=(l-k[q])/j[q],r=this.__transition__,t,s,u=d[q];if(m<1){n=false;if(m<0)return}else m=1;if(i[q]){if(!r||r.active!=g){i[q]=2;return}}else if(!r||r.active>g){i[q]=
2;return}else{i[q]=1;f.start.dispatch.apply(this,arguments);u=d[q]={};r.active=g;for(s in e)u[s]=e[s].apply(this,arguments)}t=p(m);for(s in e)u[s].call(this,t);if(m==1){i[q]=2;if(r.active==g){m=r.owner;if(m==g){delete this.__transition__;h&&this.parentNode.removeChild(this)}X=g;f.end.dispatch.apply(this,arguments);X=0;r.owner=m}}}});return n}var c={},g=X||++Da,e={},d=[],h=false,f=d3.dispatch("start","end"),i=[],k=[],j=[],o,p=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__=
{})).owner=g});c.delay=function(l){var n=Infinity,q=-1;if(typeof l=="function")a.each(function(){var m=k[++q]=+l.apply(this,arguments);if(m<n)n=m});else{n=+l;a.each(function(){k[++q]=n})}Ea(b,n);return c};c.duration=function(l){var n=-1;if(typeof l=="function"){o=0;a.each(function(){var q=j[++n]=+l.apply(this,arguments);if(q>o)o=q})}else{o=+l;a.each(function(){j[++n]=o})}return c};c.ease=function(l){p=typeof l=="string"?d3.ease(l):l;return c};c.attrTween=function(l,n){function q(r,t){var s=n.call(this,
r,t,this.getAttribute(l));return function(u){this.setAttribute(l,s(u))}}function m(r,t){var s=n.call(this,r,t,this.getAttributeNS(l.space,l.local));return function(u){this.setAttributeNS(l.space,l.local,s(u))}}e["attr."+l]=l.local?m:q;return c};c.attr=function(l,n){return c.attrTween(l,ha(n))};c.styleTween=function(l,n,q){if(arguments.length<3)q=null;e["style."+l]=function(m,r){var t=n.call(this,m,r,window.getComputedStyle(this,null).getPropertyValue(l));return function(s){this.style.setProperty(l,
t(s),q)}};return c};c.style=function(l,n,q){if(arguments.length<3)q=null;return c.styleTween(l,ha(n),q)};c.select=function(l){var n;l=W(a.select(l)).ease(p);n=-1;l.delay(function(){return k[++n]});n=-1;l.duration(function(){return j[++n]});return l};c.selectAll=function(l){var n;l=W(a.selectAll(l)).ease(p);n=-1;l.delay(function(q,m){return k[m?n:++n]});n=-1;l.duration(function(q,m){return j[m?n:++n]});return l};c.remove=function(){h=true;return c};c.each=function(l,n){f[l].add(n);return c};c.call=
da;return c.delay(0).duration(250)}function ha(a){return typeof a=="function"?function(b,c,g){return d3.interpolate(g,String(a.call(this,b,c)))}:(a=String(a),function(b,c,g){return d3.interpolate(g,a)})}function Ea(a,b){var c=Date.now(),g=false,e=c+b,d=F;if(isFinite(b)){for(;d;){if(d.callback==a){d.then=c;d.delay=b;g=true}else{var h=d.then+d.delay;if(h<e)e=h}d=d.next}g||(F={callback:a,then:c,delay:b,next:F});if(!K){clearTimeout(Y);Y=setTimeout(Fa,Math.max(24,e-c))}}}function Fa(){K=setInterval(Ga,
24);Y=0}function Ga(){for(var a,b=Date.now(),c=F;c;){a=b-c.then;if(a>c.delay)c.flush=c.callback(a);c=c.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=clearInterval(K))}function Ha(a){return a.innerRadius}function Ia(a){return a.outerRadius}function ia(a){return a.startAngle}function ja(a){return a.endAngle}function Z(a,b,c,g){var e=[],d=-1,h=b.length,f=typeof c=="function",i=typeof g=="function",k;if(f&&i)for(;++d<h;)e.push([c.call(a,k=b[d],d),g.call(a,k,d)]);else if(f)for(;++d<
h;)e.push([c.call(a,b[d],d),g]);else if(i)for(;++d<h;)e.push([c,g.call(a,b[d],d)]);else for(;++d<h;)e.push([c,g]);return e}function ka(a){return a[0]}function la(a){return a[1]}function I(a){var b=[],c=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++c<g;)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function ma(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return I(a);var c=a.length!=b.length,g="",e=a[0],d=a[1],h=b[0],f=h,i=1;if(c){g+="Q"+(d[0]-h[0]*2/3)+","+(d[1]-h[1]*2/3)+","+
d[0]+","+d[1];e=a[1];i=2}if(b.length>1){f=b[1];d=a[i];i++;g+="C"+(e[0]+h[0])+","+(e[1]+h[1])+","+(d[0]-f[0])+","+(d[1]-f[1])+","+d[0]+","+d[1];for(e=2;e<b.length;e++,i++){d=a[i];f=b[e];g+="S"+(d[0]-f[0])+","+(d[1]-f[1])+","+d[0]+","+d[1]}}if(c){c=a[i];g+="Q"+(d[0]+f[0]*2/3)+","+(d[1]+f[1]*2/3)+","+c[0]+","+c[1]}return g}function na(a,b){for(var c=[],g=(1-b)/2,e=a[0],d=a[1],h=a[2],f=2,i=a.length;++f<i;){c.push([g*(h[0]-e[0]),g*(h[1]-e[1])]);e=d;d=h;h=a[f]}c.push([g*(h[0]-e[0]),g*(h[1]-e[1])]);return c}
function C(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,b,c){a.push("C",C(oa,b),",",C(oa,c),",",C(pa,b),",",C(pa,c),",",C(M,b),",",C(M,c))}function Ja(){return 0}function Ka(a){return a.source}function La(a){return a.target}function Ma(a){return a.radius}d3={version:"0.30.3"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};d3.ascending=function(a,b){return a<b?-1:a>b?1:0};d3.descending=function(a,
b){return b<a?-1:b>a?1:0};d3.min=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e>(d=a[c]))e=d}else for(e=b(a[0]);++c<g;)if(e>(d=b(a[c])))e=d;return e};d3.max=function(a,b){var c=0,g=a.length,e=a[0],d;if(arguments.length==1)for(;++c<g;){if(e<(d=a[c]))e=d}else for(e=b(e);++c<g;)if(e<(d=b(a[c])))e=d;return e};d3.nest=function(){function a(d,h){if(d>=c.length)return e?e.call(b,h):g?h.sort(g):h;for(var f=-1,i=h.length,k=c[d],j,o=[],p,l={};++f<i;)if((j=k(p=h[f]))in l)l[j].push(p);
else{l[j]=[p];o.push(j)}d++;f=-1;for(i=o.length;++f<i;){p=l[j=o[f]];l[j]=a(d,p)}return l}var b={},c=[],g,e;b.map=function(d){return a(0,d)};b.key=function(d){c.push(d);return b};b.sortKeys=function(){return b};b.sortValues=function(d){g=d;return b};b.rollup=function(d){e=d;return b};return b};d3.keys=function(a){var b=[],c;for(c in a)b.push(c);return b};d3.values=function(a){var b=[],c;for(c in a)b.push(a[c]);return b};d3.entries=function(a){var b=[],c;for(c in a)b.push({key:c,value:a[c]});return b};
d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,b){var c=[],g=[],e,d=-1,h=a.length;if(arguments.length<2)b=qa;for(;++d<h;)if(b.call(g,e=a[d],d))g=[];else{g.length||c.push(g);g.push(e)}return c};d3.range=function(a,b,c){if(arguments.length==1){b=a;a=0}if(c==null)c=1;if((b-a)/c==Infinity)throw Error("infinite range");var g=[],e=-1,d;if(c<0)for(;(d=a+c*++e)>b;)g.push(d);else for(;(d=a+c*++e)<b;)g.push(d);return g};d3.requote=function(a){return a.replace(Na,"\\$&")};
var Na=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,c){var g=new XMLHttpRequest;if(arguments.length<3)c=b;else b&&g.overrideMimeType(b);g.open("GET",a,true);g.onreadystatechange=function(){if(g.readyState==4)c(g.status<300?g:null)};g.send(null)};d3.text=function(a,b,c){if(arguments.length<3){c=b;b=null}d3.xhr(a,b,function(g){c(g&&g.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(c){b(c?JSON.parse(c):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(c){if(c!=
null){var g=document.createRange();g.selectNode(document.body);c=g.createContextualFragment(c)}b(c)})};d3.xml=function(a,b,c){if(arguments.length<3){c=b;b=null}d3.xhr(a,b,function(g){c(g&&g.responseXML)})};d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],
local:a.substring(b+1)}}};d3.dispatch=function(){for(var a={},b,c=0,g=arguments.length;c<g;c++){b=arguments[c];a[b]=ra(b)}return a};d3.format=function(a){a=Oa.exec(a);var b=a[1]||" ",c=a[5],g=+a[6],e=a[7],d=a[8],h=a[9];if(d)d=d.substring(1);if(c)b="0";if(h=="d")d="0";return function(f){if(h=="d"&&f%1)return"";if(d)f=(+f).toFixed(d);else f+="";if(e){for(var i=f.lastIndexOf("."),k=i>=0?f.substring(i):(i=f.length,""),j=[];i>0;)j.push(f.substring(i-=3,i+3));f=j.reverse().join(",")+k}i=f.length;if(i<g)f=
Array(g-i+1).join(b)+f;return f}};var Oa=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Pa=R(2),Qa=R(3),Ra={linear:function(){return sa},poly:R,quad:function(){return Pa},cubic:function(){return Qa},sin:function(){return ta},exp:function(){return ua},circle:function(){return va},elastic:function(a,b){var c;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;c=b/4}else c=b/(2*Math.PI)*Math.asin(1/a);return function(g){return 1+a*Math.pow(2,10*-g)*Math.sin((g-c)*2*Math.PI/
b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return wa}},Sa={"in":function(a){return a},out:ea,"in-out":fa,"out-in":function(a){return fa(ea(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return Sa[b](Ra[c].apply(null,Array.prototype.slice.call(arguments,1)))};d3.event=null;d3.interpolate=function(a,b){if(typeof b=="number")return d3.interpolateNumber(+a,b);if(typeof b=="string")return b in
G||/^(#|rgb\(|hsl\()/.test(b)?d3.interpolateRgb(String(a),b):d3.interpolateString(String(a),b);if(b instanceof Array)return d3.interpolateArray(a,b);return d3.interpolateObject(a,b)};d3.interpolateNumber=function(a,b){b-=a;return function(c){return a+b*c}};d3.interpolateRound=function(a,b){b-=a;return function(c){return Math.round(a+b*c)}};d3.interpolateString=function(a,b){var c,g,e=0,d=[],h=[],f,i;for(g=0;c=$.exec(b);++g){c.index&&d.push(b.substring(e,c.index));h.push({i:d.length,x:c[0]});d.push(null);
e=$.lastIndex}e<b.length&&d.push(b.substring(e));g=0;for(f=h.length;(c=$.exec(a))&&g<f;++g){i=h[g];if(i.x==c[0]){if(i.i)if(d[i.i+1]==null){d[i.i-1]+=i.x;d.splice(i.i,1);for(c=g+1;c<f;++c)h[c].i--}else{d[i.i-1]+=i.x+d[i.i+1];d.splice(i.i,2);for(c=g+1;c<f;++c)h[c].i-=2}else if(d[i.i+1]==null)d[i.i]=i.x;else{d[i.i]=i.x+d[i.i+1];d.splice(i.i+1,1);for(c=g+1;c<f;++c)h[c].i--}h.splice(g,1);f--;g--}else i.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(i.x))}for(;g<f;){i=h.pop();if(d[i.i+1]==null)d[i.i]=
i.x;else{d[i.i]=i.x+d[i.i+1];d.splice(i.i+1,1)}f--}if(d.length==1)return d[0]==null?h[0].x:function(){return b};return function(k){for(g=0;g<f;++g)d[(i=h[g]).i]=i.x(k);return d.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var c=a.r,g=a.g,e=a.b,d=b.r-c,h=b.g-g,f=b.b-e;return function(i){return"rgb("+Math.round(c+d*i)+","+Math.round(g+h*i)+","+Math.round(e+f*i)+")"}};d3.interpolateArray=function(a,b){var c=[],g=[],e=a.length,d=b.length,h=Math.min(a.length,b.length),f;for(f=0;f<
h;++f)c.push(d3.interpolate(a[f],b[f]));for(;f<e;++f)g[f]=a[f];for(;f<d;++f)g[f]=b[f];return function(i){for(f=0;f<h;++f)g[f]=c[f](i);return g}};d3.interpolateObject=function(a,b){var c={},g={},e;for(e in a)if(e in b)c[e]=(e in Ta||/\bcolor\b/.test(e)?d3.interpolateRgb:d3.interpolate)(a[e],b[e]);else g[e]=a[e];for(e in b)e in a||(g[e]=b[e]);return function(d){for(e in c)g[e]=c[e](d);return g}};var $=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,Ta={background:1,fill:1,stroke:1};d3.rgb=function(a,
b,c){return arguments.length==1?T(""+a,J,ga):J(~~a,~~b,~~c)};var G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",
darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",
forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",
lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",
midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",
salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},aa;for(aa in G)G[aa]=T(G[aa],J,ga);d3.hsl=function(a,b,c){return arguments.length==
1?T(""+a,ya,V):V(+a,+b,+c)};var N=y([[document]]);N[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?N.select(a):y([[a]])};d3.selectAll=function(a){return typeof a=="string"?N.selectAll(a):y([Q(a)])};d3.transition=N.transition;var Da=0,X=0,F=null,Y=0,K;d3.scale={};d3.scale.linear=function(){function a(j){return k((j-c)*h)}function b(j){var o=Math.min(c,g),p=Math.max(c,g),l=p-o,n=Math.pow(10,Math.floor(Math.log(l/j)/Math.LN10));j=j/(l/n);if(j<=0.15)n*=10;else if(j<=
0.35)n*=5;else if(j<=0.75)n*=2;return{start:Math.ceil(o/n)*n,stop:Math.floor(p/n)*n+n*0.5,step:n}}var c=0,g=1,e=0,d=1,h=1/(g-c),f=(g-c)/(d-e),i=d3.interpolate,k=i(e,d);a.invert=function(j){return(j-e)*f+c};a.domain=function(j){if(!arguments.length)return[c,g];c=j[0];g=j[1];h=1/(g-c);f=(g-c)/(d-e);return a};a.range=function(j){if(!arguments.length)return[e,d];e=j[0];d=j[1];f=(g-c)/(d-e);k=i(e,d);return a};a.rangeRound=function(j){return a.range(j).interpolate(d3.interpolateRound)};a.interpolate=function(j){if(!arguments.length)return i;
k=(i=j)(e,d);return a};a.ticks=function(j){j=b(j);return d3.range(j.start,j.stop,j.step)};a.tickFormat=function(j){j=Math.max(0,-Math.floor(Math.log(b(j).step)/Math.LN10+0.01));return d3.format(",."+j+"f")};return a};d3.scale.log=function(){function a(e){return Math.log(e)/Math.LN10}function b(e){return Math.pow(10,e)}function c(e){return g(a(e))}var g=d3.scale.linear();c.invert=function(e){return b(g.invert(e))};c.domain=function(e){if(!arguments.length)return g.domain().map(b);g.domain(e.map(a));
return c};c.range=D(c,g.range);c.rangeRound=D(c,g.rangeRound);c.interpolate=D(c,g.interpolate);c.ticks=function(){var e=g.domain(),d=Math.floor(e[0]),h=Math.ceil(e[1]),f=[];if(e.every(isFinite)){for(;++d<=h;)for(e=1;e<10;e++)f.push(b(d)*e);f.push(b(d))}return f};c.tickFormat=function(){return function(e){return e.toPrecision(1)}};return c};d3.scale.pow=function(){function a(f){return Math.pow(f,d)}function b(f){return Math.pow(f,h)}function c(f){return g(a(f))}var g=d3.scale.linear(),e=d3.scale.linear(),
d=1,h=1/d;c.invert=function(f){return b(g.invert(f))};c.domain=function(f){if(!arguments.length)return g.domain().map(b);g.domain(f.map(a));e.domain(f);return c};c.range=D(c,g.range);c.rangeRound=D(c,g.rangeRound);c.inteprolate=D(c,g.interpolate);c.ticks=e.ticks;c.tickFormat=e.tickFormat;c.exponent=function(f){if(!arguments.length)return d;var i=c.domain();d=f;h=1/f;return c.domain(i)};return c};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(d){d=
d in c?c[d]:c[d]=b.push(d)-1;return g[d%g.length]}var b=[],c={},g=[],e=0;a.domain=function(d){if(!arguments.length)return b;b=d;c={};for(var h=-1,f=-1,i=b.length;++h<i;){d=b[h];d in c||(c[d]=++f)}return a};a.range=function(d){if(!arguments.length)return g;g=d;return a};a.rangePoints=function(d,h){if(arguments.length<2)h=0;var f=d[0],i=d[1],k=(i-f)/(b.length-1+h);g=b.length==1?[(f+i)/2]:d3.range(f+k*h/2,i+k/2,k);e=0;return a};a.rangeBands=function(d,h){if(arguments.length<2)h=0;var f=d[0],i=d[1],k=
(i-f)/(b.length+h);g=d3.range(f+k*h,i,k);e=k*(1-h);return a};a.rangeRoundBands=function(d,h){if(arguments.length<2)h=0;var f=d[0],i=d[1],k=i-f,j=Math.floor(k/(b.length+h));g=d3.range(f+Math.round((k-(b.length-h)*j)/2),i,j);e=Math.round(j*(1-h));return a};a.rangeBand=function(){return e};return a};d3.scale.category10=function(){return d3.scale.ordinal().range(Ua)};d3.scale.category20=function(){return d3.scale.ordinal().range(Va)};d3.scale.category20b=function(){return d3.scale.ordinal().range(Wa)};
d3.scale.category20c=function(){return d3.scale.ordinal().range(Xa)};var Ua=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Va=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Wa=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94",
"#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Xa=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){function a(){for(var h=-1,f=d.length=e.length,i=g.length/f;++h<f;)d[h]=g[~~(h*i)]}function b(h){if(isNaN(h=+h))return NaN;for(var f=0,i=d.length-1;f<=i;){var k=f+i>>1,j=d[k];if(j<h)f=k+1;
else if(j>h)i=k-1;else return k}return i<0?0:i}function c(h){return e[b(h)]}var g=[],e=[],d=[];c.domain=function(h){if(!arguments.length)return g;g=h.filter(function(f){return!isNaN(f)}).sort(d3.ascending);a();return c};c.range=function(h){if(!arguments.length)return e;e=h;a();return c};c.quantiles=function(){return d};return c};d3.scale.quantize=function(){function a(h){return d[Math.max(0,Math.min(e,Math.floor(g*(h-b))))]}var b=0,c=1,g=2,e=1,d=[0,1];a.domain=function(h){if(!arguments.length)return[b,
c];b=h[0];c=h[1];g=d.length/(c-b);return a};a.range=function(h){if(!arguments.length)return d;d=h;g=d.length/(c-b);e=d.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(d,h){var f=b.call(this,d,h),i=c.call(this,d,h),k=g.call(this,d,h)+O,j=e.call(this,d,h)+O,o=j-k,p=o<Math.PI?"0":"1",l=Math.cos(k);k=Math.sin(k);var n=Math.cos(j);j=Math.sin(j);return o>=Ya?f?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+
f+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":f?"M"+i*l+","+i*k+"A"+i+","+i+" 0 "+p+",1 "+i*n+","+i*j+"L"+f*n+","+f*j+"A"+f+","+f+" 0 "+p+",0 "+f*l+","+f*k+"Z":"M"+i*l+","+i*k+"A"+i+","+i+" 0 "+p+",1 "+i*n+","+i*j+"L0,0Z"}var b=Ha,c=Ia,g=ia,e=ja;a.innerRadius=function(d){if(!arguments.length)return b;b=x(d);return a};a.outerRadius=function(d){if(!arguments.length)return c;c=x(d);return a};a.startAngle=function(d){if(!arguments.length)return g;g=x(d);return a};a.endAngle=function(d){if(!arguments.length)return e;
e=x(d);return a};return a};var O=-Math.PI/2,Ya=2*Math.PI-1.0E-6;d3.svg.line=function(){function a(h){return h.length<1?null:"M"+e(Z(this,h,b,c),d)}var b=ka,c=la,g="linear",e=P[g],d=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y=function(h){if(!arguments.length)return c;c=h;return a};a.interpolate=function(h){if(!arguments.length)return g;e=P[g=h];return a};a.tension=function(h){if(!arguments.length)return d;d=h;return a};return a};var P={linear:I,basis:function(a){if(a.length<
3)return I(a);var b=[],c=1,g=a.length,e=a[0],d=e[0],h=e[1],f=[d,d,d,(e=a[1])[0]],i=[h,h,h,e[1]];b.push(d,",",h);for(L(b,f,i);++c<g;){e=a[c];f.shift();f.push(e[0]);i.shift();i.push(e[1]);L(b,f,i)}for(c=-1;++c<2;){f.shift();f.push(e[0]);i.shift();i.push(e[1]);L(b,f,i)}return b.join("")},"basis-closed":function(a){for(var b,c=-1,g=a.length,e=g+4,d,h=[],f=[];++c<4;){d=a[c%g];h.push(d[0]);f.push(d[1])}b=[C(M,h),",",C(M,f)];for(--c;++c<e;){d=a[c%g];h.shift();h.push(d[0]);f.shift();f.push(d[1]);L(b,h,f)}return b.join("")},
cardinal:function(a,b){if(a.length<3)return I(a);return a[0]+ma(a,na(a,b))},"cardinal-closed":function(a,b){if(a.length<3)return I(a);return a[0]+ma(a,na([a[a.length-2]].concat(a,[a[1]]),b))}},oa=[0,2/3,1/3,0],pa=[0,1/3,2/3,0],M=[0,1/6,2/3,1/6];d3.svg.area=function(){function a(f){return f.length<1?null:"M"+d(Z(this,f,b,g),h)+"L"+d(Z(this,f,b,c).reverse(),h)+"Z"}var b=ka,c=Ja,g=la,e="linear",d=P[e],h=0.7;a.x=function(f){if(!arguments.length)return b;b=f;return a};a.y0=function(f){if(!arguments.length)return c;
c=f;return a};a.y1=function(f){if(!arguments.length)return g;g=f;return a};a.interpolate=function(f){if(!arguments.length)return e;d=P[e=f];return a};a.tension=function(f){if(!arguments.length)return h;h=f;return a};return a};d3.svg.chord=function(){function a(f,i){var k=b(this,c,f,i),j=b(this,g,f,i);return"M"+k.p0+("A"+k.r+","+k.r+" 0 0,1 "+k.p1)+(k.a0==j.a0&&k.a1==j.a1?"Q 0,0 "+k.p0:"Q 0,0 "+j.p0+("A"+j.r+","+j.r+" 0 0,1 "+j.p1)+("Q 0,0 "+k.p0))+"Z"}function b(f,i,k,j){var o=i.call(f,k,j);i=e.call(f,
o,j);k=d.call(f,o,j)+O;f=h.call(f,o,j)+O;return{r:i,a0:k,a1:f,p0:[i*Math.cos(k),i*Math.sin(k)],p1:[i*Math.cos(f),i*Math.sin(f)]}}var c=Ka,g=La,e=Ma,d=ia,h=ja;a.radius=function(f){if(!arguments.length)return e;e=x(f);return a};a.source=function(f){if(!arguments.length)return c;c=x(f);return a};a.target=function(f){if(!arguments.length)return g;g=x(f);return a};a.startAngle=function(f){if(!arguments.length)return d;d=x(f);return a};a.endAngle=function(f){if(!arguments.length)return h;h=x(f);return a};
return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(ba<0&&(window.scrollX||window.scrollY)){var c=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),g=c[0][0].getScreenCTM();ba=!(g.f||g.e);c.remove()}if(ba){b.x=d3.event.pageX;b.y=d3.event.pageY}else{b.x=d3.event.clientX;b.y=d3.event.clientY}b=b.matrixTransform(a.getScreenCTM().inverse());return[b.x,b.y]};var ba=/WebKit/.test(navigator.userAgent)?-1:0})();