Browse files

Merge branch 'mbostock-master'

  • Loading branch information...
2 parents 4223750 + a6d5b6f commit 26662dec2a4475d320c7efff426210a29ae5e954 @mbostock mbostock committed Mar 12, 2011
View
5 Makefile
@@ -136,9 +136,12 @@ d3.geom.js: \
tests: \
tests/test-append.test \
tests/test-attr.test \
+ tests/test-call.test \
tests/test-format.test \
tests/test-transition.test \
- tests/test-scale-linear.test
+ tests/test-scale-linear.test \
+ tests/test-scale-sqrt.test \
+ tests/test-scale-pow.test
%.min.js: %.js Makefile
@rm -f $@
View
4 d3.geo.min.js
@@ -1,5 +1,5 @@
-(function(){function v(b){return"m0,"+b+"a"+b+","+b+" 0 1,1 0,"+-2*b+"a"+b+","+b+" 0 1,1 0,"+ +2*b+"z"}function u(){return 0}function q(b,d){return d&&d.type in b?b[d.type](d):""}function w(b,d){b.type in y&&y[b.type](b,d)}function z(b,d){for(var g=b.coordinates,e=0,k=g.length;e<k;e++)d.apply(null,g[e])}d3.geo={};d3.geo.albers=function(){function b(a){var c=l*(r*a[0]-i);a=Math.sqrt(p-2*l*Math.sin(r*a[1]))/l;return[k*a*Math.sin(c)+h[0],k*(a*Math.cos(c)-s)+h[1]]}function d(){var a=r*e[0],c=r*e[1],f=
-r*g[1],j=Math.sin(a);a=Math.cos(a);i=r*g[0];l=0.5*(j+Math.sin(c));p=a*a+2*l*j;s=Math.sqrt(p-2*l*Math.sin(f))/l;return b}var g=[-98,38],e=[29.5,45.5],k=1E3,h=[480,250],i,l,p,s;b.origin=function(a){if(!arguments.length)return g;g=[+a[0],+a[1]];return d()};b.parallels=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return d()};b.scale=function(a){if(!arguments.length)return k;k=+a;return b};b.translate=function(a){if(!arguments.length)return h;h=[+a[0],+a[1]];return b};return d()};d3.geo.albersUsa=
+(function(){function v(b){return"m0,"+b+"a"+b+","+b+" 0 1,1 0,"+-2*b+"a"+b+","+b+" 0 1,1 0,"+ +2*b+"z"}function u(){return 0}function q(b,d){return d&&d.type in b?b[d.type](d):""}function w(b,d){if(b.type in y)y[b.type](b,d)}function z(b,d){for(var g=b.coordinates,e=0,k=g.length;e<k;e++)d.apply(null,g[e])}d3.geo={};d3.geo.albers=function(){function b(a){var c=l*(r*a[0]-i);a=Math.sqrt(p-2*l*Math.sin(r*a[1]))/l;return[k*a*Math.sin(c)+h[0],k*(a*Math.cos(c)-s)+h[1]]}function d(){var a=r*e[0],c=r*e[1],
+f=r*g[1],j=Math.sin(a);a=Math.cos(a);i=r*g[0];l=0.5*(j+Math.sin(c));p=a*a+2*l*j;s=Math.sqrt(p-2*l*Math.sin(f))/l;return b}var g=[-98,38],e=[29.5,45.5],k=1E3,h=[480,250],i,l,p,s;b.origin=function(a){if(!arguments.length)return g;g=[+a[0],+a[1]];return d()};b.parallels=function(a){if(!arguments.length)return e;e=[+a[0],+a[1]];return d()};b.scale=function(a){if(!arguments.length)return k;k=+a;return b};b.translate=function(a){if(!arguments.length)return h;h=[+a[0],+a[1]];return b};return d()};d3.geo.albersUsa=
function(){function b(h){var i=h[0],l=h[1];return(l<25?i<-100?e:k:l>50?g:d)(h)}var d=d3.geo.albers(),g=d3.geo.albers().origin([-160,60]).parallels([55,65]),e=d3.geo.albers().origin([-160,20]).parallels([8,18]),k=d3.geo.albers().origin([-60,10]).parallels([8,18]);b.scale=function(h){if(!arguments.length)return d.scale();d.scale(h);g.scale(h*0.6);e.scale(h);k.scale(h*1.5);return b.translate(d.translate())};b.translate=function(h){if(!arguments.length)return d.translate();var i=d.scale()/1E3,l=h[0],
p=h[1];d.translate(h);g.translate([l-400*i,p+170*i]);e.translate([l-190*i,p+200*i]);k.translate([l+580*i,p+430*i]);return b};return b.scale(d.scale())};var r=Math.PI/180;d3.geo.mercator=function(){function b(e){return[d*(e[0]/360)+g[0],d*Math.max(-0.5,Math.min(0.5,-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360))/360))+g[1]]}var d=500,g=[480,250];b.scale=function(e){if(!arguments.length)return d;d=+e;return b};b.translate=function(e){if(!arguments.length)return g;g=[+e[0],+e[1]];return b};
return b};d3.geo.path=function(){function b(a){if(typeof k=="function")h=v(k.apply(this,arguments));return q(l,a)}function d(a){return i(a).join(",")}function g(a){for(var c=Math.abs(d3.geom.polygon(a[0].map(i)).area()),f=0,j=a.length;++f<j;)c-=Math.abs(d3.geom.polygon(a[f].map(i)).area());return c}function e(a){for(var c=d3.geom.polygon(a[0].map(i)),f=c.centroid(1),j=f[0],m=f[1],n=Math.abs(c.area()),o=0,t=a.length;++o<t;){c=d3.geom.polygon(a[o].map(i));f=c.centroid(1);j-=f[0];m-=f[1];n-=Math.abs(c.area())}return[j,
View
30 d3.geom.min.js
@@ -1,15 +1,15 @@
-(function(){function E(c,g,d,a){var f,b,e;c=a[c];f=c[0];b=c[1];c=a[g];g=c[0];e=c[1];c=a[d];return(c[1]-b)*(g-f)-(e-b)*(c[0]-f)>0}function A(c,g,d){return(d[0]-g[0])*(c[1]-g[1])<(d[1]-g[1])*(c[0]-g[0])}function C(c,g,d,a){var f=c[0],b=d[0];c=c[1];var e=d[1];d=g[0]-f;var l=a[0]-b;g=g[1]-c;a=a[1]-e;b=(l*(c-e)-a*(f-b))/(a*d-l*g);return[f+b*d,c+b*g]}function D(c,g){var d={list:c.map(function(h,j){return{index:j,x:h[0],y:h[1]}}).sort(function(h,j){return h.y<j.y?-1:h.y>j.y?1:h.x<j.x?-1:h.x>j.x?1:0}),bottomSite:null},
-a={list:[],leftEnd:null,rightEnd:null,init:function(){a.leftEnd=a.createHalfEdge(null,"l");a.rightEnd=a.createHalfEdge(null,"l");a.leftEnd.r=a.rightEnd;a.rightEnd.l=a.leftEnd;a.list.unshift(a.leftEnd,a.rightEnd)},createHalfEdge:function(h,j){return{edge:h,side:j,vertex:null,l:null,r:null}},insert:function(h,j){j.l=h;j.r=h.r;h.r.l=j;h.r=j},leftBound:function(h){var j=a.leftEnd;do j=j.r;while(j!=a.rightEnd&&f.rightOf(j,h));return j=j.l},del:function(h){h.l.r=h.r;h.r.l=h.l;h.edge=null},right:function(h){return h.r},
-left:function(h){return h.l},leftRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[h.side]},rightRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[B[h.side]]}},f={bisect:function(h,j){var i={region:{l:h,r:j},ep:{l:null,r:null}},m=j.x-h.x,r=j.y-h.y,u=m>0?m:-m,v=r>0?r:-r;i.c=h.x*m+h.y*r+(m*m+r*r)*0.5;if(u>v){i.a=1;i.b=r/m;i.c/=m}else{i.b=1;i.a=m/r;i.c/=r}return i},intersect:function(h,j){var i=h.edge,m=j.edge;if(!i||!m||i.region.r==m.region.r)return null;var r=i.a*m.b-
-i.b*m.a;if(Math.abs(r)<1.0E-10)return null;var u=(i.c*m.b-m.c*i.b)/r;r=(m.c*i.a-i.c*m.a)/r;var v=i.region.r,y=m.region.r;if(v.y<y.y||v.y==y.y&&v.x<y.x){v=h;i=i}else{v=j;i=m}if((i=u>=i.region.r.x)&&v.side=="l"||!i&&v.side=="r")return null;return{x:u,y:r}},rightOf:function(h,j){var i=h.edge,m=i.region.r,r=j.x>m.x;if(r&&h.side=="l")return 1;if(!r&&h.side=="r")return 0;if(i.a==1){var u=j.y-m.y,v=j.x-m.x,y=0,x=0;if(!r&&i.b<0||r&&i.b>=0)x=y=u>=i.b*v;else{x=j.x+j.y*i.b>i.c;if(i.b<0)x=!x;x||(y=1)}if(!y){m=
-m.x-i.region.l.x;x=i.b*(v*v-u*u)<m*u*(1+2*v/m+i.b*i.b);if(i.b<0)x=!x}}else{v=i.c-i.a*j.x;i=j.y-v;u=j.x-m.x;m=v-m.y;x=i*i>u*u+m*m}return h.side=="l"?x:!x},endPoint:function(h,j,i){h.ep[j]=i;h.ep[B[j]]&&g(h)},distance:function(h,j){var i=h.x-j.x,m=h.y-j.y;return Math.sqrt(i*i+m*m)}},b={list:[],insert:function(h,j,i){h.vertex=j;h.ystar=j.y+i;i=0;for(var m=b.list,r=m.length;i<r;i++){var u=m[i];if(!(h.ystar>u.ystar||h.ystar==u.ystar&&j.x>u.vertex.x))break}m.splice(i,0,h)},del:function(h){for(var j=0,i=
-b.list,m=i.length;j<m&&i[j]!=h;++j);i.splice(j,1)},empty:function(){return b.list.length==0},nextEvent:function(h){for(var j=0,i=b.list,m=i.length;j<m;++j)if(i[j]==h)return i[j+1];return null},min:function(){var h=b.list[0];return{x:h.vertex.x,y:h.ystar}},extractMin:function(){return b.list.shift()}};a.init();d.bottomSite=d.list.shift();for(var e=d.list.shift(),l,k,o,p,s,n,t,q,w;;){b.empty()||(l=b.min());if(e&&(b.empty()||e.y<l.y||e.y==l.y&&e.x<l.x)){k=a.leftBound(e);o=a.right(k);t=a.rightRegion(k);
-w=f.bisect(t,e);n=a.createHalfEdge(w,"l");a.insert(k,n);if(q=f.intersect(k,n)){b.del(k);b.insert(k,q,f.distance(q,e))}k=n;n=a.createHalfEdge(w,"r");a.insert(k,n);(q=f.intersect(n,o))&&b.insert(n,q,f.distance(q,e));e=d.list.shift()}else if(b.empty())break;else{k=b.extractMin();p=a.left(k);o=a.right(k);s=a.right(o);t=a.leftRegion(k);n=a.rightRegion(o);q=k.vertex;f.endPoint(k.edge,k.side,q);f.endPoint(o.edge,o.side,q);a.del(k);b.del(o);a.del(o);k="l";if(t.y>n.y){k=t;t=n;n=k;k="r"}w=f.bisect(t,n);n=a.createHalfEdge(w,
-k);a.insert(p,n);f.endPoint(w,B[k],q);if(q=f.intersect(p,n)){b.del(p);b.insert(p,q,f.distance(q,t))}(q=f.intersect(n,s))&&b.insert(n,q,f.distance(q,t))}}for(k=a.right(a.leftEnd);k!=a.rightEnd;k=a.right(k))g(k.edge)}function z(c,g,d,a,f,b){if(!c(g,d,a,f,b)){var e=(d+f)*0.5,l=(a+b)*0.5;g=g.nodes;g[0]&&z(c,g[0],d,a,e,l);g[1]&&z(c,g[1],e,a,f,l);g[2]&&z(c,g[2],d,l,e,b);g[3]&&z(c,g[3],e,l,f,b)}}d3.geom={};d3.geom.contour=function(c,g){var d;if(!(d=g))a:{for(var a=d=0;;){if(c(d,a)){d=[d,a];break a}if(d==
-0){d=a+1;a=0}else{d-=1;a+=1}}d=void 0}d=d;a=[];var f=d[0],b=d[1],e=0,l=0,k=NaN,o=NaN;l=0;do{l=0;if(c(f-1,b-1))l+=1;if(c(f,b-1))l+=2;if(c(f-1,b))l+=4;if(c(f,b))l+=8;if(l==6){e=o==-1?-1:1;l=0}else if(l==9){e=0;l=k==1?-1:1}else{e=F[l];l=G[l]}if(e!=k&&l!=o){a.push([f,b]);k=e;o=l}f+=e;b+=l}while(d[0]!=f||d[1]!=b);return a};var F=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],G=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(c){if(c.length<3)return[];var g=c.length,d=g-1,a=[],f=[],b,e=0,l,k,o,p,
-s,n,t;for(b=1;b<g;++b)if(c[b][1]<c[e][1])e=b;else if(c[b][1]==c[e][1])e=c[b][0]<c[e][0]?b:e;for(b=0;b<g;++b)if(b!=e){k=c[b][1]-c[e][1];l=c[b][0]-c[e][0];a.push({angle:Math.atan2(k,l),index:b})}a.sort(function(q,w){return q.angle-w.angle});t=a[0].angle;n=a[0].index;s=0;for(b=1;b<d;++b){g=a[b].index;if(t==a[b].angle){l=c[n][0]-c[e][0];k=c[n][1]-c[e][1];o=c[g][0]-c[e][0];p=c[g][1]-c[e][1];if(l*l+k*k>=o*o+p*p)a[b].index=-1;else{a[s].index=-1;t=a[b].angle;s=b;n=g}}else{t=a[b].angle;s=b;n=g}}f.push(e);
-for(g=b=0;b<2;++g)if(a[g].index!=-1){f.push(a[g].index);b++}for(e=f.length;g<d;++g)if(a[g].index!=-1){for(;!E(f[e-2],f[e-1],a[g].index,c);)--e;f[e++]=a[g].index}d=[];for(b=0;b<e;++b)d.push(c[f[b]]);return d};d3.geom.polygon=function(c){c.area=function(){for(var g=0,d=c.length,a=c[d-1][0]*c[0][1],f=c[d-1][1]*c[0][0];++g<d;){a+=c[g-1][0]*c[g][1];f+=c[g-1][1]*c[g][0]}return(f-a)*0.5};c.centroid=function(g){var d=-1,a=c.length-1,f=0,b=0,e,l,k;for(arguments.length||(g=1/(6*c.area()));++d<a;){e=c[d];l=
-c[d+1];k=e[0]*l[1]-l[0]*e[1];f+=(e[0]+l[0])*k;b+=(e[1]+l[1])*k}return[f*g,b*g]};c.clip=function(g){for(var d,a=-1,f=c.length,b,e,l=c[f-1],k,o,p;++a<f;){d=g.slice();g.length=0;k=c[a];o=d[(e=d.length)-1];for(b=-1;++b<e;){p=d[b];if(A(p,l,k)){A(o,l,k)||g.push(C(o,p,l,k));g.push(p)}else A(o,l,k)&&g.push(C(o,p,l,k));o=p}l=k}return g};return c};d3.geom.voronoi=function(c){var g=c.map(function(){return[]});D(c,function(d){var a,f,b,e;if(d.a==1&&d.b>=0){a=d.ep.r;f=d.ep.l}else{a=d.ep.l;f=d.ep.r}if(d.a==1){b=
-a?a.y:-1E6;a=d.c-d.b*b;e=f?f.y:1E6;f=d.c-d.b*e}else{a=a?a.x:-1E6;b=d.c-d.a*a;f=f?f.x:1E6;e=d.c-d.a*f}a=[a,b];f=[f,e];g[d.region.l.index].push(a,f);g[d.region.r.index].push(a,f)});return g.map(function(d,a){var f=c[a][0],b=c[a][1];d.forEach(function(e){e.angle=Math.atan2(e[0]-f,e[1]-b)});return d.sort(function(e,l){return e.angle-l.angle}).filter(function(e,l){return!l||e.angle-d[l-1].angle>1.0E-10})})};var B={l:"r",r:"l"};d3.geom.delaunay=function(c){var g=c.map(function(){return[]}),d=[];D(c,function(a){g[a.region.l.index].push(c[a.region.r.index])});
-g.forEach(function(a,f){var b=c[f],e=b[0],l=b[1];a.forEach(function(p){p.angle=Math.atan2(p[0]-e,p[1]-l)});a.sort(function(p,s){return p.angle-s.angle});for(var k=0,o=a.length-1;k<o;k++)d.push([b,a[k],a[k+1]])});return d};d3.geom.quadtree=function(c){function g(s,n,t,q,w,h){if(!(isNaN(n[0])||isNaN(n[1])))if(s.leaf){var j=s.point;if(j){if(!(Math.abs(j[0]-n[0])+Math.abs(j[1]-n[1])<0.01)){s.point=null;d(s,j,t,q,w,h)}d(s,n,t,q,w,h)}else s.point=n}else d(s,n,t,q,w,h)}function d(s,n,t,q,w,h){var j=(t+w)*
-0.5,i=(q+h)*0.5,m=n[0]>=j,r=n[1]>=i,u=(r<<1)+m;s.leaf=false;s=s.nodes[u]||(s.nodes[u]={leaf:true,nodes:[],point:null});if(m)t=j;else w=j;if(r)q=i;else h=i;g(s,n,t,q,w,h)}for(var a,f=-1,b=c.length,e=Number.POSITIVE_INFINITY,l=e,k=Number.NEGATIVE_INFINITY,o=k;++f<b;){a=c[f];if(a[0]<e)e=a[0];if(a[1]<l)l=a[1];if(a[0]>k)k=a[0];if(a[1]>o)o=a[1]}a=k-e;f=o-l;if(a>f)o=l+a;else k=e+f;var p={leaf:true,nodes:[],point:null};for(f=-1;++f<b;)g(p,c[f],e,l,k,o);p.visit=function(s){z(s,p,e,l,k,o)};return p}})();
+(function(){function E(c,g,d,a){var f,b,e;c=a[c];f=c[0];b=c[1];c=a[g];g=c[0];e=c[1];c=a[d];return(c[1]-b)*(g-f)-(e-b)*(c[0]-f)>0}function A(c,g,d){return(d[0]-g[0])*(c[1]-g[1])<(d[1]-g[1])*(c[0]-g[0])}function C(c,g,d,a){var f=c[0],b=d[0];c=c[1];var e=d[1];d=g[0]-f;var l=a[0]-b;g=g[1]-c;a=a[1]-e;b=(l*(c-e)-a*(f-b))/(a*d-l*g);return[f+b*d,c+b*g]}function D(c,g){var d={list:c.map(function(h,i){return{index:i,x:h[0],y:h[1]}}).sort(function(h,i){return h.y<i.y?-1:h.y>i.y?1:h.x<i.x?-1:h.x>i.x?1:0}),bottomSite:null},
+a={list:[],leftEnd:null,rightEnd:null,init:function(){a.leftEnd=a.createHalfEdge(null,"l");a.rightEnd=a.createHalfEdge(null,"l");a.leftEnd.r=a.rightEnd;a.rightEnd.l=a.leftEnd;a.list.unshift(a.leftEnd,a.rightEnd)},createHalfEdge:function(h,i){return{edge:h,side:i,vertex:null,l:null,r:null}},insert:function(h,i){i.l=h;i.r=h.r;h.r.l=i;h.r=i},leftBound:function(h){var i=a.leftEnd;do i=i.r;while(i!=a.rightEnd&&f.rightOf(i,h));return i=i.l},del:function(h){h.l.r=h.r;h.r.l=h.l;h.edge=null},right:function(h){return h.r},
+left:function(h){return h.l},leftRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[h.side]},rightRegion:function(h){return h.edge==null?d.bottomSite:h.edge.region[B[h.side]]}},f={bisect:function(h,i){var j={region:{l:h,r:i},ep:{l:null,r:null}},m=i.x-h.x,r=i.y-h.y;j.c=h.x*m+h.y*r+(m*m+r*r)*0.5;if((m>0?m:-m)>(r>0?r:-r)){j.a=1;j.b=r/m;j.c/=m}else{j.b=1;j.a=m/r;j.c/=r}return j},intersect:function(h,i){var j=h.edge,m=i.edge;if(!j||!m||j.region.r==m.region.r)return null;var r=j.a*m.b-j.b*
+m.a;if(Math.abs(r)<1.0E-10)return null;var u=(j.c*m.b-m.c*j.b)/r;r=(m.c*j.a-j.c*m.a)/r;var w=j.region.r,y=m.region.r;if(w.y<y.y||w.y==y.y&&w.x<y.x)w=h;else{w=i;j=m}if((j=u>=j.region.r.x)&&w.side=="l"||!j&&w.side=="r")return null;return{x:u,y:r}},rightOf:function(h,i){var j=h.edge,m=j.region.r,r=i.x>m.x;if(r&&h.side=="l")return 1;if(!r&&h.side=="r")return 0;if(j.a==1){var u=i.y-m.y,w=i.x-m.x,y=0,x=0;if(!r&&j.b<0||r&&j.b>=0)x=y=u>=j.b*w;else{x=i.x+i.y*j.b>j.c;if(j.b<0)x=!x;x||(y=1)}if(!y){m=m.x-j.region.l.x;
+x=j.b*(w*w-u*u)<m*u*(1+2*w/m+j.b*j.b);if(j.b<0)x=!x}}else{w=j.c-j.a*i.x;j=i.y-w;u=i.x-m.x;m=w-m.y;x=j*j>u*u+m*m}return h.side=="l"?x:!x},endPoint:function(h,i,j){h.ep[i]=j;h.ep[B[i]]&&g(h)},distance:function(h,i){var j=h.x-i.x,m=h.y-i.y;return Math.sqrt(j*j+m*m)}},b={list:[],insert:function(h,i,j){h.vertex=i;h.ystar=i.y+j;j=0;for(var m=b.list,r=m.length;j<r;j++){var u=m[j];if(!(h.ystar>u.ystar||h.ystar==u.ystar&&i.x>u.vertex.x))break}m.splice(j,0,h)},del:function(h){for(var i=0,j=b.list,m=j.length;i<
+m&&j[i]!=h;++i);j.splice(i,1)},empty:function(){return b.list.length==0},nextEvent:function(h){for(var i=0,j=b.list,m=j.length;i<m;++i)if(j[i]==h)return j[i+1];return null},min:function(){var h=b.list[0];return{x:h.vertex.x,y:h.ystar}},extractMin:function(){return b.list.shift()}};a.init();d.bottomSite=d.list.shift();for(var e=d.list.shift(),l,k,o,p,s,n,t,q,v;;){b.empty()||(l=b.min());if(e&&(b.empty()||e.y<l.y||e.y==l.y&&e.x<l.x)){k=a.leftBound(e);o=a.right(k);t=a.rightRegion(k);v=f.bisect(t,e);n=
+a.createHalfEdge(v,"l");a.insert(k,n);if(q=f.intersect(k,n)){b.del(k);b.insert(k,q,f.distance(q,e))}k=n;n=a.createHalfEdge(v,"r");a.insert(k,n);(q=f.intersect(n,o))&&b.insert(n,q,f.distance(q,e));e=d.list.shift()}else if(b.empty())break;else{k=b.extractMin();p=a.left(k);o=a.right(k);s=a.right(o);t=a.leftRegion(k);n=a.rightRegion(o);q=k.vertex;f.endPoint(k.edge,k.side,q);f.endPoint(o.edge,o.side,q);a.del(k);b.del(o);a.del(o);k="l";if(t.y>n.y){k=t;t=n;n=k;k="r"}v=f.bisect(t,n);n=a.createHalfEdge(v,
+k);a.insert(p,n);f.endPoint(v,B[k],q);if(q=f.intersect(p,n)){b.del(p);b.insert(p,q,f.distance(q,t))}(q=f.intersect(n,s))&&b.insert(n,q,f.distance(q,t))}}for(k=a.right(a.leftEnd);k!=a.rightEnd;k=a.right(k))g(k.edge)}function z(c,g,d,a,f,b){if(!c(g,d,a,f,b)){var e=(d+f)*0.5,l=(a+b)*0.5;g=g.nodes;g[0]&&z(c,g[0],d,a,e,l);g[1]&&z(c,g[1],e,a,f,l);g[2]&&z(c,g[2],d,l,e,b);g[3]&&z(c,g[3],e,l,f,b)}}d3.geom={};d3.geom.contour=function(c,g){var d;if(!(d=g))a:{for(var a=d=0;;){if(c(d,a)){d=[d,a];break a}if(d==
+0){d=a+1;a=0}else{d-=1;a+=1}}d=void 0}a=[];var f=d[0],b=d[1],e=0,l=0,k=NaN,o=NaN;l=0;do{l=0;if(c(f-1,b-1))l+=1;if(c(f,b-1))l+=2;if(c(f-1,b))l+=4;if(c(f,b))l+=8;if(l==6){e=o==-1?-1:1;l=0}else if(l==9){e=0;l=k==1?-1:1}else{e=F[l];l=G[l]}if(e!=k&&l!=o){a.push([f,b]);k=e;o=l}f+=e;b+=l}while(d[0]!=f||d[1]!=b);return a};var F=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],G=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(c){if(c.length<3)return[];var g=c.length,d=g-1,a=[],f=[],b,e=0,l,k,o,p,s,n,
+t;for(b=1;b<g;++b)if(c[b][1]<c[e][1])e=b;else if(c[b][1]==c[e][1])e=c[b][0]<c[e][0]?b:e;for(b=0;b<g;++b)if(b!=e){k=c[b][1]-c[e][1];l=c[b][0]-c[e][0];a.push({angle:Math.atan2(k,l),index:b})}a.sort(function(q,v){return q.angle-v.angle});t=a[0].angle;n=a[0].index;s=0;for(b=1;b<d;++b){g=a[b].index;if(t==a[b].angle){l=c[n][0]-c[e][0];k=c[n][1]-c[e][1];o=c[g][0]-c[e][0];p=c[g][1]-c[e][1];if(l*l+k*k>=o*o+p*p)a[b].index=-1;else{a[s].index=-1;t=a[b].angle;s=b;n=g}}else{t=a[b].angle;s=b;n=g}}f.push(e);for(g=
+b=0;b<2;++g)if(a[g].index!=-1){f.push(a[g].index);b++}for(e=f.length;g<d;++g)if(a[g].index!=-1){for(;!E(f[e-2],f[e-1],a[g].index,c);)--e;f[e++]=a[g].index}d=[];for(b=0;b<e;++b)d.push(c[f[b]]);return d};d3.geom.polygon=function(c){c.area=function(){for(var g=0,d=c.length,a=c[d-1][0]*c[0][1],f=c[d-1][1]*c[0][0];++g<d;){a+=c[g-1][0]*c[g][1];f+=c[g-1][1]*c[g][0]}return(f-a)*0.5};c.centroid=function(g){var d=-1,a=c.length-1,f=0,b=0,e,l,k;for(arguments.length||(g=1/(6*c.area()));++d<a;){e=c[d];l=c[d+1];
+k=e[0]*l[1]-l[0]*e[1];f+=(e[0]+l[0])*k;b+=(e[1]+l[1])*k}return[f*g,b*g]};c.clip=function(g){for(var d,a=-1,f=c.length,b,e,l=c[f-1],k,o,p;++a<f;){d=g.slice();g.length=0;k=c[a];o=d[(e=d.length)-1];for(b=-1;++b<e;){p=d[b];if(A(p,l,k)){A(o,l,k)||g.push(C(o,p,l,k));g.push(p)}else A(o,l,k)&&g.push(C(o,p,l,k));o=p}l=k}return g};return c};d3.geom.voronoi=function(c){var g=c.map(function(){return[]});D(c,function(d){var a,f,b,e;if(d.a==1&&d.b>=0){a=d.ep.r;f=d.ep.l}else{a=d.ep.l;f=d.ep.r}if(d.a==1){b=a?a.y:
+-1E6;a=d.c-d.b*b;e=f?f.y:1E6;f=d.c-d.b*e}else{a=a?a.x:-1E6;b=d.c-d.a*a;f=f?f.x:1E6;e=d.c-d.a*f}a=[a,b];f=[f,e];g[d.region.l.index].push(a,f);g[d.region.r.index].push(a,f)});return g.map(function(d,a){var f=c[a][0],b=c[a][1];d.forEach(function(e){e.angle=Math.atan2(e[0]-f,e[1]-b)});return d.sort(function(e,l){return e.angle-l.angle}).filter(function(e,l){return!l||e.angle-d[l-1].angle>1.0E-10})})};var B={l:"r",r:"l"};d3.geom.delaunay=function(c){var g=c.map(function(){return[]}),d=[];D(c,function(a){g[a.region.l.index].push(c[a.region.r.index])});
+g.forEach(function(a,f){var b=c[f],e=b[0],l=b[1];a.forEach(function(p){p.angle=Math.atan2(p[0]-e,p[1]-l)});a.sort(function(p,s){return p.angle-s.angle});for(var k=0,o=a.length-1;k<o;k++)d.push([b,a[k],a[k+1]])});return d};d3.geom.quadtree=function(c){function g(s,n,t,q,v,h){if(!(isNaN(n[0])||isNaN(n[1])))if(s.leaf){var i=s.point;if(i){if(!(Math.abs(i[0]-n[0])+Math.abs(i[1]-n[1])<0.01)){s.point=null;d(s,i,t,q,v,h)}d(s,n,t,q,v,h)}else s.point=n}else d(s,n,t,q,v,h)}function d(s,n,t,q,v,h){var i=(t+v)*
+0.5,j=(q+h)*0.5,m=n[0]>=i,r=n[1]>=j,u=(r<<1)+m;s.leaf=false;s=s.nodes[u]||(s.nodes[u]={leaf:true,nodes:[],point:null});if(m)t=i;else v=i;if(r)q=j;else h=j;g(s,n,t,q,v,h)}for(var a,f=-1,b=c.length,e=Number.POSITIVE_INFINITY,l=e,k=Number.NEGATIVE_INFINITY,o=k;++f<b;){a=c[f];if(a[0]<e)e=a[0];if(a[1]<l)l=a[1];if(a[0]>k)k=a[0];if(a[1]>o)o=a[1]}a=k-e;f=o-l;if(a>f)o=l+a;else k=e+f;var p={leaf:true,nodes:[],point:null};for(f=-1;++f<b;)g(p,c[f],e,l,k,o);p.visit=function(s){z(s,p,e,l,k,o)};return p}})();
View
54 d3.js
@@ -1,4 +1,4 @@
-(function(){d3 = {version: "1.6.0"}; // semver
+(function(){d3 = {version: "1.6.1"}; // semver
if (!Date.now) Date.now = function() {
return +new Date();
};
@@ -195,10 +195,19 @@ function d3_splitter(d) {
function d3_collapse(s) {
return s.replace(/(^\s+)|(\s+$)/g, "").replace(/\s+/g, " ");
}
+//
+// Note: assigning to the arguments array simultaneously changes the value of
+// the corresponding argument! However, the Google Closure compiler doesn't
+// realize this, and so can optimize-away our attempt to avoid side-effects.
+// This fix by Jason Davies has been tested to survive minimization.
+//
+// TODO The `this` argument probably shouldn't be the first argument to the
+// callback, anyway, since it's redundant. However, that will require a major
+// version bump due to backwards compatibility, so I'm not changing it right
+// away.
+//
function d3_call(callback) {
- var f = callback;
- arguments[0] = this;
- f.apply(this, arguments);
+ callback.apply(this, (arguments[0] = this, arguments));
return this;
}
/**
@@ -2086,17 +2095,9 @@ d3.scale.log = function() {
d3.scale.pow = function() {
var linear = d3.scale.linear(),
tick = d3.scale.linear(), // TODO better tick formatting...
- p = 1,
- b = 1 / p,
- n = false;
-
- function powp(x) {
- return n ? -Math.pow(-x, p) : Math.pow(x, p);
- }
-
- function powb(x) {
- return n ? -Math.pow(-x, b) : Math.pow(x, b);
- }
+ exponent = 1,
+ powp = Number,
+ powb = powp;
function scale(x) {
return linear(powp(x));
@@ -2108,28 +2109,41 @@ d3.scale.pow = function() {
scale.domain = function(x) {
if (!arguments.length) return linear.domain().map(powb);
- n = (x[0] || x[1]) < 0;
+ var pow = (x[0] || x[1]) < 0 ? d3_scale_pown : d3_scale_pow;
+ powp = pow(exponent);
+ powb = pow(1 / exponent);
linear.domain(x.map(powp));
tick.domain(x);
return scale;
};
scale.range = d3_rebind(scale, linear.range);
scale.rangeRound = d3_rebind(scale, linear.rangeRound);
- scale.inteprolate = d3_rebind(scale, linear.interpolate);
+ scale.interpolate = d3_rebind(scale, linear.interpolate);
scale.ticks = tick.ticks;
scale.tickFormat = tick.tickFormat;
scale.exponent = function(x) {
- if (!arguments.length) return p;
+ if (!arguments.length) return exponent;
var domain = scale.domain();
- p = x;
- b = 1 / x;
+ exponent = x;
return scale.domain(domain);
};
return scale;
};
+
+function d3_scale_pow(e) {
+ return function(x) {
+ return Math.pow(x, e);
+ };
+}
+
+function d3_scale_pown(e) {
+ return function(x) {
+ return -Math.pow(-x, e);
+ };
+}
d3.scale.sqrt = function() {
return d3.scale.pow().exponent(.5);
};
View
92 d3.min.js
@@ -1,4 +1,4 @@
-(function(){function xa(a){for(var b=-1,d=a.length,g=[];++b<d;)g.push(a[b]);return g}function v(a){return typeof a=="function"?a:function(){return a}}function C(a,b){return function(){var d=b.apply(a,arguments);return arguments.length?a:d}}function ya(a){return a==null}function da(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function ea(a){arguments[0]=this;a.apply(this,arguments);return this}function za(){var a={},b=[];a.add=function(d){for(var g=0;g<b.length;g++)if(b[g].listener==
+(function(){function xa(a){for(var b=-1,d=a.length,g=[];++b<d;)g.push(a[b]);return g}function v(a){return typeof a=="function"?a:function(){return a}}function C(a,b){return function(){var d=b.apply(a,arguments);return arguments.length?a:d}}function ya(a){return a==null}function da(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function ea(a){a.apply(this,(arguments[0]=this,arguments));return this}function za(){var a={},b=[];a.add=function(d){for(var g=0;g<b.length;g++)if(b[g].listener==
d)return a;b.push({listener:d,on:true});return a};a.remove=function(d){for(var g=0;g<b.length;g++){var e=b[g];if(e.listener==d){e.on=false;b=b.slice(0,g).concat(b.slice(g+1));break}}return a};a.dispatch=function(){for(var d=b,g=0,e=d.length;g<e;g++){var c=d[g];c.on&&c.listener.apply(this,arguments)}};return a}function fa(a){for(var b=a.lastIndexOf("."),d=b>=0?a.substring(b):(b=a.length,""),g=[];b>0;)g.push(a.substring(b-=3,b+3));return g.reverse().join(",")+d}function ga(a){return function(b){return 1-
a(1-b)}}function ha(a){return function(b){return 0.5*(b<0.5?a(2*b):2-a(2-2*b))}}function Aa(a){return a}function R(a){return function(b){return Math.pow(b,a)}}function Ba(a){return 1-Math.cos(a*Math.PI/2)}function Ca(a){return a?Math.pow(2,10*(a-1))-0.0010:0}function Da(a){return 1-Math.sqrt(1-a*a)}function Ea(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,d){return{r:a,g:b,b:d,toString:Fa}}
function Fa(){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,d){var g=0,e=0,c=0,f,h;if(f=/([a-z]+)\((.*)\)/i.exec(a)){h=f[2].split(",");switch(f[1]){case "hsl":return d(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case "rgb":return b(U(h[0]),U(h[1]),U(h[2]))}}if(d=G[a])return b(d.r,d.g,d.b);if(a!=null&&a.charAt(0)=="#"){if(a.length==4){g=a.charAt(1);g+=g;e=a.charAt(2);e+=e;c=a.charAt(3);c+=c}else if(a.length==7){g=
@@ -22,48 +22,48 @@ for(u in e)s[u]=e[u].apply(this,arguments)}t=p(q);for(u in e)s[u].call(this,t);i
u(s))}}function q(r,t){var u=n.call(this,r,t,this.getAttributeNS(m.space,m.local));return function(s){this.setAttributeNS(m.space,m.local,u(s))}}e["attr."+m]=m.local?q:l;return d};d.attr=function(m,n){return d.attrTween(m,ka(n))};d.styleTween=function(m,n,l){if(arguments.length<3)l=null;e["style."+m]=function(q,r){var t=n.call(this,q,r,window.getComputedStyle(this,null).getPropertyValue(m));return function(u){this.style.setProperty(m,t(u),l)}};return d};d.style=function(m,n,l){if(arguments.length<
3)l=null;return d.styleTween(m,ka(n),l)};d.select=function(m){var n;m=X(a.select(m)).ease(p);n=-1;m.delay(function(){return k[++n]});n=-1;m.duration(function(){return j[++n]});return m};d.selectAll=function(m){var n;m=X(a.selectAll(m)).ease(p);n=-1;m.delay(function(l,q){return k[q?n:++n]});n=-1;m.duration(function(l,q){return j[q?n:++n]});return m};d.remove=function(){f=true;return d};d.each=function(m,n){h[m].add(n);return d};d.call=ea;return d.delay(0).duration(250)}function ka(a){return typeof a==
"function"?function(b,d,g){return d3.interpolate(g,String(a.call(this,b,d)))}:(a=String(a),function(b,d,g){return d3.interpolate(g,a)})}function ja(a,b){var d=Date.now(),g=false,e=d+b,c=F;if(isFinite(b)){for(;c;){if(c.callback==a){c.then=d;c.delay=b;g=true}else{var f=c.then+c.delay;if(f<e)e=f}c=c.next}g||(F={callback:a,then:d,delay:b,next:F});if(!K){clearTimeout(Z);Z=setTimeout(La,Math.max(24,e-d))}}}function La(){K=1;Z=0;la(ma)}function ma(){for(var a,b=Date.now(),d=F;d;){a=b-d.then;if(a>d.delay)d.flush=
-d.callback(a);d=d.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=0);K&&la(ma)}function Ma(a){return a.innerRadius}function Na(a){return a.outerRadius}function na(a){return a.startAngle}function oa(a){return a.endAngle}function $(a,b,d,g){var e=[],c=-1,f=b.length,h=typeof d=="function",i=typeof g=="function",k;if(h&&i)for(;++c<f;)e.push([d.call(a,k=b[c],c),g.call(a,k,c)]);else if(h)for(;++c<f;)e.push([d.call(a,b[c],c),g]);else if(i)for(;++c<f;)e.push([d,g.call(a,b[c],c)]);
-else for(;++c<f;)e.push([d,g]);return e}function pa(a){return a[0]}function qa(a){return a[1]}function H(a){var b=[],d=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++d<g;)b.push("L",(e=a[d])[0],",",e[1]);return b.join("")}function ra(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return H(a);var d=a.length!=b.length,g="",e=a[0],c=a[1],f=b[0],h=f,i=1;if(d){g+="Q"+(c[0]-f[0]*2/3)+","+(c[1]-f[1]*2/3)+","+c[0]+","+c[1];e=a[1];i=2}if(b.length>1){h=b[1];c=a[i];i++;g+="C"+(e[0]+f[0])+","+
-(e[1]+f[1])+","+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1];for(e=2;e<b.length;e++,i++){c=a[i];h=b[e];g+="S"+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1]}}if(d){d=a[i];g+="Q"+(c[0]+h[0]*2/3)+","+(c[1]+h[1]*2/3)+","+d[0]+","+d[1]}return g}function sa(a,b){for(var d=[],g=(1-b)/2,e=a[0],c=a[1],f=a[2],h=2,i=a.length;++h<i;){d.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);e=c;c=f;f=a[h]}d.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);return d}function B(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,
-b,d){a.push("C",B(ta,b),",",B(ta,d),",",B(ua,b),",",B(ua,d),",",B(M,b),",",B(M,d))}function Oa(){return 0}function Pa(a){return a.source}function Qa(a){return a.target}function Ra(a){return a.radius}function Sa(){return 64}function Ta(){return"circle"}d3={version:"1.6.0"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;return new b};var N=function(a){return Array.prototype.slice.call(a)};try{N(document.documentElement.childNodes)}catch(fb){N=
-xa}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 d=0,g=a.length,e=a[0],c;if(arguments.length==1)for(;++d<g;){if(e>(c=a[d]))e=c}else for(e=b(a[0]);++d<g;)if(e>(c=b(a[d])))e=c;return e};d3.max=function(a,b){var d=0,g=a.length,e=a[0],c;if(arguments.length==1)for(;++d<g;){if(e<(c=a[d]))e=c}else for(e=b(e);++d<g;)if(e<(c=b(a[d])))e=c;return e};d3.nest=function(){function a(h,i){if(i>=g.length)return f?f.call(d,h):c?h.sort(c):
-h;for(var k=-1,j=h.length,o=g[i++],p,m,n={};++k<j;)if((p=o(m=h[k]))in n)n[p].push(m);else n[p]=[m];for(p in n)n[p]=a(n[p],i);return n}function b(h,i){if(i>=g.length)return h;var k=[],j=e[i++],o;for(o in h)k.push({key:o,values:b(h[o],i)});j&&k.sort(function(p,m){return j(p.key,m.key)});return k}var d={},g=[],e=[],c,f;d.map=function(h){return a(h,0)};d.entries=function(h){return b(a(h,0),0)};d.key=function(h){g.push(h);return d};d.sortKeys=function(h){e[g.length-1]=h;return d};d.sortValues=function(h){c=
-h;return d};d.rollup=function(h){f=h;return d};return d};d3.keys=function(a){var b=[],d;for(d in a)b.push(d);return b};d3.values=function(a){var b=[],d;for(d in a)b.push(a[d]);return b};d3.entries=function(a){var b=[],d;for(d in a)b.push({key:d,value:a[d]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,b){var d=[],g=[],e,c=-1,f=a.length;if(arguments.length<2)b=ya;for(;++c<f;)if(b.call(g,e=a[c],c))g=[];else{g.length||d.push(g);g.push(e)}return d};d3.range=
-function(a,b,d){if(arguments.length==1){b=a;a=0}if(d==null)d=1;if((b-a)/d==Infinity)throw Error("infinite range");var g=[],e=-1,c;if(d<0)for(;(c=a+d*++e)>b;)g.push(c);else for(;(c=a+d*++e)<b;)g.push(c);return g};d3.requote=function(a){return a.replace(Ua,"\\$&")};var Ua=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,d){var g=new XMLHttpRequest;if(arguments.length<3)d=b;else b&&g.overrideMimeType(b);g.open("GET",a,true);g.onreadystatechange=function(){if(g.readyState==4)d(g.status<300?g:null)};
-g.send(null)};d3.text=function(a,b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(g){d(g&&g.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(d){b(d?JSON.parse(d):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(d){if(d!=null){var g=document.createRange();g.selectNode(document.body);d=g.createContextualFragment(d)}b(d)})};d3.xml=function(a,b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(g){d(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,d=0,g=arguments.length;d<g;d++){b=arguments[d];a[b]=za(b)}return a};d3.format=function(a){a=Va.exec(a);var b=a[1]||" ",d=a[3]||"",g=a[5],e=+a[6],c=a[7],f=a[8],h=a[9];if(f)f=f.substring(1);if(g){b=
-"0";if(c)e-=Math.floor((e-1)/4)}if(h=="d")f="0";return function(i){i=+i;var k=i<0&&(i=-i)?"":d;if(h=="d"&&i%1)return"";i=f?i.toFixed(f):""+i;if(g){var j=i.length+k.length;if(j<e)i=Array(e-j+1).join(b)+i;if(c)i=fa(i);i=k+i}else{if(c)i=fa(i);i=k+i;j=i.length;if(j<e)i=Array(e-j+1).join(b)+i}return i}};var Va=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Wa=R(2),Xa=R(3),Ya={linear:function(){return Aa},poly:R,quad:function(){return Wa},cubic:function(){return Xa},sin:function(){return Ba},
-exp:function(){return Ca},circle:function(){return Da},elastic:function(a,b){var d;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;d=b/4}else d=b/(2*Math.PI)*Math.asin(1/a);return function(g){return 1+a*Math.pow(2,10*-g)*Math.sin((g-d)*2*Math.PI/b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return Ea}},Za={"in":function(a){return a},out:ga,"in-out":ha,"out-in":function(a){return ha(ga(a))}};d3.ease=function(a){var b=a.indexOf("-"),d=b>=
-0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return Za[b](Ya[d].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(d){return a+
-b*d}};d3.interpolateRound=function(a,b){b-=a;return function(d){return Math.round(a+b*d)}};d3.interpolateString=function(a,b){var d,g,e=0,c=[],f=[],h,i;for(g=0;d=aa.exec(b);++g){d.index&&c.push(b.substring(e,d.index));f.push({i:c.length,x:d[0]});c.push(null);e=aa.lastIndex}e<b.length&&c.push(b.substring(e));g=0;for(h=f.length;(d=aa.exec(a))&&g<h;++g){i=f[g];if(i.x==d[0]){if(i.i)if(c[i.i+1]==null){c[i.i-1]+=i.x;c.splice(i.i,1);for(d=g+1;d<h;++d)f[d].i--}else{c[i.i-1]+=i.x+c[i.i+1];c.splice(i.i,2);
-for(d=g+1;d<h;++d)f[d].i-=2}else if(c[i.i+1]==null)c[i.i]=i.x;else{c[i.i]=i.x+c[i.i+1];c.splice(i.i+1,1);for(d=g+1;d<h;++d)f[d].i--}f.splice(g,1);h--;g--}else i.x=d3.interpolateNumber(parseFloat(d[0]),parseFloat(i.x))}for(;g<h;){i=f.pop();if(c[i.i+1]==null)c[i.i]=i.x;else{c[i.i]=i.x+c[i.i+1];c.splice(i.i+1,1)}h--}if(c.length==1)return c[0]==null?f[0].x:function(){return b};return function(k){for(g=0;g<h;++g)c[(i=f[g]).i]=i.x(k);return c.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);
-var d=a.r,g=a.g,e=a.b,c=b.r-d,f=b.g-g,h=b.b-e;return function(i){return"rgb("+Math.round(d+c*i)+","+Math.round(g+f*i)+","+Math.round(e+h*i)+")"}};d3.interpolateHsl=function(a,b){a=d3.hsl(a);b=d3.hsl(b);var d=a.h,g=a.s,e=a.l,c=b.h-d,f=b.s-g,h=b.l-e;return function(i){return W(d+c*i,g+f*i,e+h*i).toString()}};d3.interpolateArray=function(a,b){var d=[],g=[],e=a.length,c=b.length,f=Math.min(a.length,b.length),h;for(h=0;h<f;++h)d.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)g[h]=a[h];for(;h<c;++h)g[h]=
-b[h];return function(i){for(h=0;h<f;++h)g[h]=d[h](i);return g}};d3.interpolateObject=function(a,b){var d={},g={},e;for(e in a)if(e in b)d[e]=(e in $a||/\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(c){for(e in d)g[e]=d[e](c);return g}};var aa=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,$a={background:1,fill:1,stroke:1};d3.rgb=function(a,b,d){return arguments.length==1?T(""+a,J,W):J(~~a,~~b,~~d)};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"},ba;for(ba in G)G[ba]=T(G[ba],J,W);d3.hsl=function(a,b,d){return arguments.length==1?T(""+a,Ga,V):V(+a,+b,+d)};var D=function(a,b){return b.querySelector(a)},
-ia=function(a,b){return N(b.querySelectorAll(a))};if(typeof Sizzle=="function"){D=function(a,b){return Sizzle(a,b)[0]};ia=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))}}var O=y([[document]]);O[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?O.select(a):y([[a]])};d3.selectAll=function(a){return typeof a=="string"?O.selectAll(a):y([N(a)])};d3.transition=O.transition;var Ka=0,Y=0,F=null,Z=0,K;d3.timer=function(a){ja(a,0)};var la=window.requestAnimationFrame||
-window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={};d3.scale.linear=function(){function a(j){return k((j-d)*f)}function b(j){var o=Math.min(d,g),p=Math.max(d,g),m=p-o,n=Math.pow(10,Math.floor(Math.log(m/j)/Math.LN10));j=j/(m/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 d=0,g=1,e=0,c=1,f=1/(g-
-d),h=(g-d)/(c-e),i=d3.interpolate,k=i(e,c);a.invert=function(j){return(j-e)*h+d};a.domain=function(j){if(!arguments.length)return[d,g];d=j[0];g=j[1];f=1/(g-d);h=(g-d)/(c-e);return a};a.range=function(j){if(!arguments.length)return[e,c];e=j[0];c=j[1];h=(g-d)/(c-e);k=i(e,c);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,c);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(c){return(e?-Math.log(-c):Math.log(c))/Math.LN10}function b(c){return e?-Math.pow(10,-c):Math.pow(10,c)}function d(c){return g(a(c))}var g=d3.scale.linear(),e=false;d.invert=function(c){return b(g.invert(c))};d.domain=function(c){if(!arguments.length)return g.domain().map(b);e=(c[0]||c[1])<0;g.domain(c.map(a));return d};d.range=C(d,g.range);
-d.rangeRound=C(d,g.rangeRound);d.interpolate=C(d,g.interpolate);d.ticks=function(){var c=g.domain(),f=[];if(c.every(isFinite)){var h=Math.floor(c[0]),i=Math.ceil(c[1]),k=b(c[0]);c=b(c[1]);if(e)for(f.push(b(h));h++<i;)for(var j=9;j>0;j--)f.push(b(h)*j);else{for(;h<i;h++)for(j=1;j<10;j++)f.push(b(h)*j);f.push(b(h))}for(h=0;f[h]<k;h++);for(i=f.length;f[i-1]>c;i--);f=f.slice(h,i)}return f};d.tickFormat=function(){return function(c){return c.toPrecision(1)}};return d};d3.scale.pow=function(){function a(i){return h?
--Math.pow(-i,c):Math.pow(i,c)}function b(i){return h?-Math.pow(-i,f):Math.pow(i,f)}function d(i){return g(a(i))}var g=d3.scale.linear(),e=d3.scale.linear(),c=1,f=1/c,h=false;d.invert=function(i){return b(g.invert(i))};d.domain=function(i){if(!arguments.length)return g.domain().map(b);h=(i[0]||i[1])<0;g.domain(i.map(a));e.domain(i);return d};d.range=C(d,g.range);d.rangeRound=C(d,g.rangeRound);d.inteprolate=C(d,g.interpolate);d.ticks=e.ticks;d.tickFormat=e.tickFormat;d.exponent=function(i){if(!arguments.length)return c;
-var k=d.domain();c=i;f=1/i;return d.domain(k)};return d};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(c){c=c in d?d[c]:d[c]=b.push(c)-1;return g[c%g.length]}var b=[],d={},g=[],e=0;a.domain=function(c){if(!arguments.length)return b;b=c;d={};for(var f=-1,h=-1,i=b.length;++f<i;){c=b[f];c in d||(d[c]=++h)}return a};a.range=function(c){if(!arguments.length)return g;g=c;return a};a.rangePoints=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],
-k=(i-h)/(b.length-1+f);g=b.length==1?[(h+i)/2]:d3.range(h+k*f/2,i+k/2,k);e=0;return a};a.rangeBands=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],k=(i-h)/(b.length+f);g=d3.range(h+k*f,i,k);e=k*(1-f);return a};a.rangeRoundBands=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],k=i-h,j=Math.floor(k/(b.length+f));g=d3.range(h+Math.round((k-(b.length-f)*j)/2),i,j);e=Math.round(j*(1-f));return a};a.rangeBand=function(){return e};return a};d3.scale.category10=function(){return d3.scale.ordinal().range(ab)};
-d3.scale.category20=function(){return d3.scale.ordinal().range(bb)};d3.scale.category20b=function(){return d3.scale.ordinal().range(cb)};d3.scale.category20c=function(){return d3.scale.ordinal().range(db)};var ab=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bb=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf",
-"#9edae5"],cb=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],db=["#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 f=-1,h=c.length=e.length,i=g.length/
-h;++f<h;)c[f]=g[~~(f*i)]}function b(f){if(isNaN(f=+f))return NaN;for(var h=0,i=c.length-1;h<=i;){var k=h+i>>1,j=c[k];if(j<f)h=k+1;else if(j>f)i=k-1;else return k}return i<0?0:i}function d(f){return e[b(f)]}var g=[],e=[],c=[];d.domain=function(f){if(!arguments.length)return g;g=f.filter(function(h){return!isNaN(h)}).sort(d3.ascending);a();return d};d.range=function(f){if(!arguments.length)return e;e=f;a();return d};d.quantiles=function(){return c};return d};d3.scale.quantize=function(){function a(f){return c[Math.max(0,
-Math.min(e,Math.floor(g*(f-b))))]}var b=0,d=1,g=2,e=1,c=[0,1];a.domain=function(f){if(!arguments.length)return[b,d];b=f[0];d=f[1];g=c.length/(d-b);return a};a.range=function(f){if(!arguments.length)return c;c=f;g=c.length/(d-b);e=c.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(){var c=b.apply(this,arguments),f=d.apply(this,arguments),h=g.apply(this,arguments)+I,i=e.apply(this,arguments)+I,k=i-h,j=k<Math.PI?"0":"1",o=Math.cos(h);h=Math.sin(h);var p=Math.cos(i);i=Math.sin(i);
-return k>=eb?c?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+c+"A"+c+","+c+" 0 1,1 0,"+-c+"A"+c+","+c+" 0 1,1 0,"+c+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":c?"M"+f*o+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*p+","+f*i+"L"+c*p+","+c*i+"A"+c+","+c+" 0 "+j+",0 "+c*o+","+c*h+"Z":"M"+f*o+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*p+","+f*i+"L0,0Z"}var b=Ma,d=Na,g=na,e=oa;a.innerRadius=function(c){if(!arguments.length)return b;b=v(c);return a};a.outerRadius=function(c){if(!arguments.length)return d;
-d=v(c);return a};a.startAngle=function(c){if(!arguments.length)return g;g=v(c);return a};a.endAngle=function(c){if(!arguments.length)return e;e=v(c);return a};a.centroid=function(){var c=(b.apply(this,arguments)+d.apply(this,arguments))/2,f=(g.apply(this,arguments)+e.apply(this,arguments))/2+I;return[Math.cos(f)*c,Math.sin(f)*c]};return a};var I=-Math.PI/2,eb=2*Math.PI-1.0E-6;d3.svg.line=function(){function a(f){return f.length<1?null:"M"+e($(this,f,b,d),c)}var b=pa,d=qa,g="linear",e=P[g],c=0.7;a.x=
-function(f){if(!arguments.length)return b;b=f;return a};a.y=function(f){if(!arguments.length)return d;d=f;return a};a.interpolate=function(f){if(!arguments.length)return g;e=P[g=f];return a};a.tension=function(f){if(!arguments.length)return c;c=f;return a};return a};var P={linear:H,basis:function(a){if(a.length<3)return H(a);var b=[],d=1,g=a.length,e=a[0],c=e[0],f=e[1],h=[c,c,c,(e=a[1])[0]],i=[f,f,f,e[1]];b.push(c,",",f);for(L(b,h,i);++d<g;){e=a[d];h.shift();h.push(e[0]);i.shift();i.push(e[1]);L(b,
-h,i)}for(d=-1;++d<2;){h.shift();h.push(e[0]);i.shift();i.push(e[1]);L(b,h,i)}return b.join("")},"basis-closed":function(a){for(var b,d=-1,g=a.length,e=g+4,c,f=[],h=[];++d<4;){c=a[d%g];f.push(c[0]);h.push(c[1])}b=[B(M,f),",",B(M,h)];for(--d;++d<e;){c=a[d%g];f.shift();f.push(c[0]);h.shift();h.push(c[1]);L(b,f,h)}return b.join("")},cardinal:function(a,b){if(a.length<3)return H(a);return a[0]+ra(a,sa(a,b))},"cardinal-closed":function(a,b){if(a.length<3)return H(a);return a[0]+ra(a,sa([a[a.length-2]].concat(a,
-[a[1]]),b))}},ta=[0,2/3,1/3,0],ua=[0,1/3,2/3,0],M=[0,1/6,2/3,1/6];d3.svg.area=function(){function a(h){return h.length<1?null:"M"+c($(this,h,b,g),f)+"L"+c($(this,h,b,d).reverse(),f)+"Z"}var b=pa,d=Oa,g=qa,e="linear",c=P[e],f=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y0=function(h){if(!arguments.length)return d;d=h;return a};a.y1=function(h){if(!arguments.length)return g;g=h;return a};a.interpolate=function(h){if(!arguments.length)return e;c=P[e=h];return a};a.tension=function(h){if(!arguments.length)return f;
-f=h;return a};return a};d3.svg.chord=function(){function a(h,i){var k=b(this,d,h,i),j=b(this,g,h,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(h,i,k,j){var o=i.call(h,k,j);i=e.call(h,o,j);k=c.call(h,o,j)+I;h=f.call(h,o,j)+I;return{r:i,a0:k,a1:h,p0:[i*Math.cos(k),i*Math.sin(k)],p1:[i*Math.cos(h),i*Math.sin(h)]}}var d=Pa,g=Qa,e=Ra,c=na,f=oa;a.radius=function(h){if(!arguments.length)return e;
-e=v(h);return a};a.source=function(h){if(!arguments.length)return d;d=v(h);return a};a.target=function(h){if(!arguments.length)return g;g=v(h);return a};a.startAngle=function(h){if(!arguments.length)return c;c=v(h);return a};a.endAngle=function(h){if(!arguments.length)return f;f=v(h);return a};return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||a).createSVGPoint();if(ca<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",
-0).style("left",0),g=d[0][0].getScreenCTM();ca=!(g.f||g.e);d.remove()}if(ca){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 ca=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function a(g,e){return(va[b.call(this,g,e)]||va.circle)(d.call(this,g,e))}var b=Ta,d=Sa;a.type=function(g){if(!arguments.length)return b;b=v(g);return a};a.size=function(g){if(!arguments.length)return d;
-d=v(g);return a};return a};d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var va={circle:function(a){a=Math.sqrt(a/Math.PI);return"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z"},cross:function(a){a=Math.sqrt(a/5)/2;return"M"+-3*a+","+-a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+-3*a+"Z"},diamond:function(a){a=Math.sqrt(a/(2*wa));var b=a*wa;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/
-2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}},Q=Math.sqrt(3),wa=Math.tan(30*Math.PI/180)})();
+d.callback(a);d=d.next}a=null;for(b=F;b;)b=b.flush?a?a.next=b.next:F=b.next:(a=b).next;a||(K=0);K&&la(ma)}function Ma(a){return function(b){return Math.pow(b,a)}}function Na(a){return function(b){return-Math.pow(-b,a)}}function Oa(a){return a.innerRadius}function Pa(a){return a.outerRadius}function na(a){return a.startAngle}function oa(a){return a.endAngle}function $(a,b,d,g){var e=[],c=-1,f=b.length,h=typeof d=="function",i=typeof g=="function",k;if(h&&i)for(;++c<f;)e.push([d.call(a,k=b[c],c),g.call(a,
+k,c)]);else if(h)for(;++c<f;)e.push([d.call(a,b[c],c),g]);else if(i)for(;++c<f;)e.push([d,g.call(a,b[c],c)]);else for(;++c<f;)e.push([d,g]);return e}function pa(a){return a[0]}function qa(a){return a[1]}function H(a){var b=[],d=0,g=a.length,e=a[0];for(b.push(e[0],",",e[1]);++d<g;)b.push("L",(e=a[d])[0],",",e[1]);return b.join("")}function ra(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return H(a);var d=a.length!=b.length,g="",e=a[0],c=a[1],f=b[0],h=f,i=1;if(d){g+="Q"+(c[0]-f[0]*2/
+3)+","+(c[1]-f[1]*2/3)+","+c[0]+","+c[1];e=a[1];i=2}if(b.length>1){h=b[1];c=a[i];i++;g+="C"+(e[0]+f[0])+","+(e[1]+f[1])+","+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1];for(e=2;e<b.length;e++,i++){c=a[i];h=b[e];g+="S"+(c[0]-h[0])+","+(c[1]-h[1])+","+c[0]+","+c[1]}}if(d){d=a[i];g+="Q"+(c[0]+h[0]*2/3)+","+(c[1]+h[1]*2/3)+","+d[0]+","+d[1]}return g}function sa(a,b){for(var d=[],g=(1-b)/2,e=a[0],c=a[1],f=a[2],h=2,i=a.length;++h<i;){d.push([g*(f[0]-e[0]),g*(f[1]-e[1])]);e=c;c=f;f=a[h]}d.push([g*(f[0]-
+e[0]),g*(f[1]-e[1])]);return d}function B(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function L(a,b,d){a.push("C",B(ta,b),",",B(ta,d),",",B(ua,b),",",B(ua,d),",",B(M,b),",",B(M,d))}function Qa(){return 0}function Ra(a){return a.source}function Sa(a){return a.target}function Ta(a){return a.radius}function Ua(){return 64}function Va(){return"circle"}d3={version:"1.6.1"};if(!Date.now)Date.now=function(){return+new Date};if(!Object.create)Object.create=function(a){function b(){}b.prototype=a;
+return new b};var N=function(a){return Array.prototype.slice.call(a)};try{N(document.documentElement.childNodes)}catch(hb){N=xa}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 d=0,g=a.length,e=a[0],c;if(arguments.length==1)for(;++d<g;){if(e>(c=a[d]))e=c}else for(e=b(a[0]);++d<g;)if(e>(c=b(a[d])))e=c;return e};d3.max=function(a,b){var d=0,g=a.length,e=a[0],c;if(arguments.length==1)for(;++d<g;){if(e<(c=a[d]))e=c}else for(e=
+b(e);++d<g;)if(e<(c=b(a[d])))e=c;return e};d3.nest=function(){function a(h,i){if(i>=g.length)return f?f.call(d,h):c?h.sort(c):h;for(var k=-1,j=h.length,o=g[i++],p,m,n={};++k<j;)if((p=o(m=h[k]))in n)n[p].push(m);else n[p]=[m];for(p in n)n[p]=a(n[p],i);return n}function b(h,i){if(i>=g.length)return h;var k=[],j=e[i++],o;for(o in h)k.push({key:o,values:b(h[o],i)});j&&k.sort(function(p,m){return j(p.key,m.key)});return k}var d={},g=[],e=[],c,f;d.map=function(h){return a(h,0)};d.entries=function(h){return b(a(h,
+0),0)};d.key=function(h){g.push(h);return d};d.sortKeys=function(h){e[g.length-1]=h;return d};d.sortValues=function(h){c=h;return d};d.rollup=function(h){f=h;return d};return d};d3.keys=function(a){var b=[],d;for(d in a)b.push(d);return b};d3.values=function(a){var b=[],d;for(d in a)b.push(a[d]);return b};d3.entries=function(a){var b=[],d;for(d in a)b.push({key:d,value:a[d]});return b};d3.merge=function(a){return Array.prototype.concat.apply([],a)};d3.split=function(a,b){var d=[],g=[],e,c=-1,f=a.length;
+if(arguments.length<2)b=ya;for(;++c<f;)if(b.call(g,e=a[c],c))g=[];else{g.length||d.push(g);g.push(e)}return d};d3.range=function(a,b,d){if(arguments.length==1){b=a;a=0}if(d==null)d=1;if((b-a)/d==Infinity)throw Error("infinite range");var g=[],e=-1,c;if(d<0)for(;(c=a+d*++e)>b;)g.push(c);else for(;(c=a+d*++e)<b;)g.push(c);return g};d3.requote=function(a){return a.replace(Wa,"\\$&")};var Wa=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.xhr=function(a,b,d){var g=new XMLHttpRequest;if(arguments.length<3)d=b;else b&&
+g.overrideMimeType(b);g.open("GET",a,true);g.onreadystatechange=function(){if(g.readyState==4)d(g.status<300?g:null)};g.send(null)};d3.text=function(a,b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(g){d(g&&g.responseText)})};d3.json=function(a,b){d3.text(a,"application/json",function(d){b(d?JSON.parse(d):null)})};d3.html=function(a,b){d3.text(a,"text/html",function(d){if(d!=null){var g=document.createRange();g.selectNode(document.body);d=g.createContextualFragment(d)}b(d)})};d3.xml=function(a,
+b,d){if(arguments.length<3){d=b;b=null}d3.xhr(a,b,function(g){d(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,d=0,g=arguments.length;d<g;d++){b=arguments[d];a[b]=za(b)}return a};
+d3.format=function(a){a=Xa.exec(a);var b=a[1]||" ",d=a[3]||"",g=a[5],e=+a[6],c=a[7],f=a[8],h=a[9];if(f)f=f.substring(1);if(g){b="0";if(c)e-=Math.floor((e-1)/4)}if(h=="d")f="0";return function(i){i=+i;var k=i<0&&(i=-i)?"":d;if(h=="d"&&i%1)return"";i=f?i.toFixed(f):""+i;if(g){var j=i.length+k.length;if(j<e)i=Array(e-j+1).join(b)+i;if(c)i=fa(i);i=k+i}else{if(c)i=fa(i);i=k+i;j=i.length;if(j<e)i=Array(e-j+1).join(b)+i}return i}};var Xa=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,
+Ya=R(2),Za=R(3),$a={linear:function(){return Aa},poly:R,quad:function(){return Ya},cubic:function(){return Za},sin:function(){return Ba},exp:function(){return Ca},circle:function(){return Da},elastic:function(a,b){var d;if(arguments.length<2)b=0.45;if(arguments.length<1){a=1;d=b/4}else d=b/(2*Math.PI)*Math.asin(1/a);return function(g){return 1+a*Math.pow(2,10*-g)*Math.sin((g-d)*2*Math.PI/b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return Ea}},
+ab={"in":function(a){return a},out:ga,"in-out":ha,"out-in":function(a){return ha(ga(a))}};d3.ease=function(a){var b=a.indexOf("-"),d=b>=0?a.substring(0,b):a;b=b>=0?a.substring(b+1):"in";return ab[b]($a[d].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(d){return a+b*d}};d3.interpolateRound=function(a,b){b-=a;return function(d){return Math.round(a+b*d)}};d3.interpolateString=function(a,b){var d,g,e=0,c=[],f=[],h,i;for(g=0;d=aa.exec(b);++g){d.index&&c.push(b.substring(e,d.index));f.push({i:c.length,x:d[0]});c.push(null);e=aa.lastIndex}e<b.length&&c.push(b.substring(e));g=0;for(h=f.length;(d=aa.exec(a))&&g<h;++g){i=f[g];if(i.x==
+d[0]){if(i.i)if(c[i.i+1]==null){c[i.i-1]+=i.x;c.splice(i.i,1);for(d=g+1;d<h;++d)f[d].i--}else{c[i.i-1]+=i.x+c[i.i+1];c.splice(i.i,2);for(d=g+1;d<h;++d)f[d].i-=2}else if(c[i.i+1]==null)c[i.i]=i.x;else{c[i.i]=i.x+c[i.i+1];c.splice(i.i+1,1);for(d=g+1;d<h;++d)f[d].i--}f.splice(g,1);h--;g--}else i.x=d3.interpolateNumber(parseFloat(d[0]),parseFloat(i.x))}for(;g<h;){i=f.pop();if(c[i.i+1]==null)c[i.i]=i.x;else{c[i.i]=i.x+c[i.i+1];c.splice(i.i+1,1)}h--}if(c.length==1)return c[0]==null?f[0].x:function(){return b};
+return function(k){for(g=0;g<h;++g)c[(i=f[g]).i]=i.x(k);return c.join("")}};d3.interpolateRgb=function(a,b){a=d3.rgb(a);b=d3.rgb(b);var d=a.r,g=a.g,e=a.b,c=b.r-d,f=b.g-g,h=b.b-e;return function(i){return"rgb("+Math.round(d+c*i)+","+Math.round(g+f*i)+","+Math.round(e+h*i)+")"}};d3.interpolateHsl=function(a,b){a=d3.hsl(a);b=d3.hsl(b);var d=a.h,g=a.s,e=a.l,c=b.h-d,f=b.s-g,h=b.l-e;return function(i){return W(d+c*i,g+f*i,e+h*i).toString()}};d3.interpolateArray=function(a,b){var d=[],g=[],e=a.length,c=
+b.length,f=Math.min(a.length,b.length),h;for(h=0;h<f;++h)d.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)g[h]=a[h];for(;h<c;++h)g[h]=b[h];return function(i){for(h=0;h<f;++h)g[h]=d[h](i);return g}};d3.interpolateObject=function(a,b){var d={},g={},e;for(e in a)if(e in b)d[e]=(e in bb||/\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(c){for(e in d)g[e]=d[e](c);return g}};var aa=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,
+bb={background:1,fill:1,stroke:1};d3.rgb=function(a,b,d){return arguments.length==1?T(""+a,J,W):J(~~a,~~b,~~d)};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"},
+ba;for(ba in G)G[ba]=T(G[ba],J,W);d3.hsl=function(a,b,d){return arguments.length==1?T(""+a,Ga,V):V(+a,+b,+d)};var D=function(a,b){return b.querySelector(a)},ia=function(a,b){return N(b.querySelectorAll(a))};if(typeof Sizzle=="function"){D=function(a,b){return Sizzle(a,b)[0]};ia=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))}}var O=y([[document]]);O[0].parentNode=document.documentElement;d3.select=function(a){return typeof a=="string"?O.select(a):y([[a]])};d3.selectAll=function(a){return typeof a==
+"string"?O.selectAll(a):y([N(a)])};d3.transition=O.transition;var Ka=0,Y=0,F=null,Z=0,K;d3.timer=function(a){ja(a,0)};var la=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={};d3.scale.linear=function(){function a(j){return k((j-d)*f)}function b(j){var o=Math.min(d,g),p=Math.max(d,g),m=p-o,n=Math.pow(10,Math.floor(Math.log(m/j)/Math.LN10));j/=m/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 d=0,g=1,e=0,c=1,f=1/(g-d),h=(g-d)/(c-e),i=d3.interpolate,k=i(e,c);a.invert=function(j){return(j-e)*h+d};a.domain=function(j){if(!arguments.length)return[d,g];d=j[0];g=j[1];f=1/(g-d);h=(g-d)/(c-e);return a};a.range=function(j){if(!arguments.length)return[e,c];e=j[0];c=j[1];h=(g-d)/(c-e);k=i(e,c);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,c);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(c){return(e?-Math.log(-c):Math.log(c))/Math.LN10}function b(c){return e?-Math.pow(10,-c):Math.pow(10,c)}function d(c){return g(a(c))}var g=d3.scale.linear(),e=false;d.invert=function(c){return b(g.invert(c))};
+d.domain=function(c){if(!arguments.length)return g.domain().map(b);e=(c[0]||c[1])<0;g.domain(c.map(a));return d};d.range=C(d,g.range);d.rangeRound=C(d,g.rangeRound);d.interpolate=C(d,g.interpolate);d.ticks=function(){var c=g.domain(),f=[];if(c.every(isFinite)){var h=Math.floor(c[0]),i=Math.ceil(c[1]),k=b(c[0]);c=b(c[1]);if(e)for(f.push(b(h));h++<i;)for(var j=9;j>0;j--)f.push(b(h)*j);else{for(;h<i;h++)for(j=1;j<10;j++)f.push(b(h)*j);f.push(b(h))}for(h=0;f[h]<k;h++);for(i=f.length;f[i-1]>c;i--);f=f.slice(h,
+i)}return f};d.tickFormat=function(){return function(c){return c.toPrecision(1)}};return d};d3.scale.pow=function(){function a(f){return b(e(f))}var b=d3.scale.linear(),d=d3.scale.linear(),g=1,e=Number,c=e;a.invert=function(f){return c(b.invert(f))};a.domain=function(f){if(!arguments.length)return b.domain().map(c);var h=(f[0]||f[1])<0?Na:Ma;e=h(g);c=h(1/g);b.domain(f.map(e));d.domain(f);return a};a.range=C(a,b.range);a.rangeRound=C(a,b.rangeRound);a.interpolate=C(a,b.interpolate);a.ticks=d.ticks;
+a.tickFormat=d.tickFormat;a.exponent=function(f){if(!arguments.length)return g;var h=a.domain();g=f;return a.domain(h)};return a};d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){function a(c){c=c in d?d[c]:d[c]=b.push(c)-1;return g[c%g.length]}var b=[],d={},g=[],e=0;a.domain=function(c){if(!arguments.length)return b;b=c;d={};for(var f=-1,h=-1,i=b.length;++f<i;){c=b[f];c in d||(d[c]=++h)}return a};a.range=function(c){if(!arguments.length)return g;g=c;return a};
+a.rangePoints=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],k=(i-h)/(b.length-1+f);g=b.length==1?[(h+i)/2]:d3.range(h+k*f/2,i+k/2,k);e=0;return a};a.rangeBands=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],k=(i-h)/(b.length+f);g=d3.range(h+k*f,i,k);e=k*(1-f);return a};a.rangeRoundBands=function(c,f){if(arguments.length<2)f=0;var h=c[0],i=c[1],k=i-h,j=Math.floor(k/(b.length+f));g=d3.range(h+Math.round((k-(b.length-f)*j)/2),i,j);e=Math.round(j*(1-f));return a};a.rangeBand=function(){return e};
+return a};d3.scale.category10=function(){return d3.scale.ordinal().range(cb)};d3.scale.category20=function(){return d3.scale.ordinal().range(db)};d3.scale.category20b=function(){return d3.scale.ordinal().range(eb)};d3.scale.category20c=function(){return d3.scale.ordinal().range(fb)};var cb=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],db=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b",
+"#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],eb=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],fb=["#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 f=-1,h=c.length=e.length,i=g.length/h;++f<h;)c[f]=g[~~(f*i)]}function b(f){if(isNaN(f=+f))return NaN;for(var h=0,i=c.length-1;h<=i;){var k=h+i>>1,j=c[k];if(j<f)h=k+1;else if(j>f)i=k-1;else return k}return i<0?0:i}function d(f){return e[b(f)]}var g=[],e=[],c=[];d.domain=function(f){if(!arguments.length)return g;g=f.filter(function(h){return!isNaN(h)}).sort(d3.ascending);a();return d};d.range=function(f){if(!arguments.length)return e;e=f;a();return d};
+d.quantiles=function(){return c};return d};d3.scale.quantize=function(){function a(f){return c[Math.max(0,Math.min(e,Math.floor(g*(f-b))))]}var b=0,d=1,g=2,e=1,c=[0,1];a.domain=function(f){if(!arguments.length)return[b,d];b=f[0];d=f[1];g=c.length/(d-b);return a};a.range=function(f){if(!arguments.length)return c;c=f;g=c.length/(d-b);e=c.length-1;return a};return a};d3.svg={};d3.svg.arc=function(){function a(){var c=b.apply(this,arguments),f=d.apply(this,arguments),h=g.apply(this,arguments)+I,i=e.apply(this,
+arguments)+I,k=i-h,j=k<Math.PI?"0":"1",o=Math.cos(h);h=Math.sin(h);var p=Math.cos(i);i=Math.sin(i);return k>=gb?c?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+c+"A"+c+","+c+" 0 1,1 0,"+-c+"A"+c+","+c+" 0 1,1 0,"+c+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+-f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":c?"M"+f*o+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*p+","+f*i+"L"+c*p+","+c*i+"A"+c+","+c+" 0 "+j+",0 "+c*o+","+c*h+"Z":"M"+f*o+","+f*h+"A"+f+","+f+" 0 "+j+",1 "+f*p+","+f*i+"L0,0Z"}var b=Oa,d=Pa,g=na,e=
+oa;a.innerRadius=function(c){if(!arguments.length)return b;b=v(c);return a};a.outerRadius=function(c){if(!arguments.length)return d;d=v(c);return a};a.startAngle=function(c){if(!arguments.length)return g;g=v(c);return a};a.endAngle=function(c){if(!arguments.length)return e;e=v(c);return a};a.centroid=function(){var c=(b.apply(this,arguments)+d.apply(this,arguments))/2,f=(g.apply(this,arguments)+e.apply(this,arguments))/2+I;return[Math.cos(f)*c,Math.sin(f)*c]};return a};var I=-Math.PI/2,gb=2*Math.PI-
+1.0E-6;d3.svg.line=function(){function a(f){return f.length<1?null:"M"+e($(this,f,b,d),c)}var b=pa,d=qa,g="linear",e=P[g],c=0.7;a.x=function(f){if(!arguments.length)return b;b=f;return a};a.y=function(f){if(!arguments.length)return d;d=f;return a};a.interpolate=function(f){if(!arguments.length)return g;e=P[g=f];return a};a.tension=function(f){if(!arguments.length)return c;c=f;return a};return a};var P={linear:H,basis:function(a){if(a.length<3)return H(a);var b=[],d=1,g=a.length,e=a[0],c=e[0],f=e[1],
+h=[c,c,c,(e=a[1])[0]],i=[f,f,f,e[1]];b.push(c,",",f);for(L(b,h,i);++d<g;){e=a[d];h.shift();h.push(e[0]);i.shift();i.push(e[1]);L(b,h,i)}for(d=-1;++d<2;){h.shift();h.push(e[0]);i.shift();i.push(e[1]);L(b,h,i)}return b.join("")},"basis-closed":function(a){for(var b,d=-1,g=a.length,e=g+4,c,f=[],h=[];++d<4;){c=a[d%g];f.push(c[0]);h.push(c[1])}b=[B(M,f),",",B(M,h)];for(--d;++d<e;){c=a[d%g];f.shift();f.push(c[0]);h.shift();h.push(c[1]);L(b,f,h)}return b.join("")},cardinal:function(a,b){if(a.length<3)return H(a);
+return a[0]+ra(a,sa(a,b))},"cardinal-closed":function(a,b){if(a.length<3)return H(a);return a[0]+ra(a,sa([a[a.length-2]].concat(a,[a[1]]),b))}},ta=[0,2/3,1/3,0],ua=[0,1/3,2/3,0],M=[0,1/6,2/3,1/6];d3.svg.area=function(){function a(h){return h.length<1?null:"M"+c($(this,h,b,g),f)+"L"+c($(this,h,b,d).reverse(),f)+"Z"}var b=pa,d=Qa,g=qa,e="linear",c=P[e],f=0.7;a.x=function(h){if(!arguments.length)return b;b=h;return a};a.y0=function(h){if(!arguments.length)return d;d=h;return a};a.y1=function(h){if(!arguments.length)return g;
+g=h;return a};a.interpolate=function(h){if(!arguments.length)return e;c=P[e=h];return a};a.tension=function(h){if(!arguments.length)return f;f=h;return a};return a};d3.svg.chord=function(){function a(h,i){var k=b(this,d,h,i),j=b(this,g,h,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(h,i,k,j){var o=i.call(h,k,j);i=e.call(h,o,j);k=c.call(h,o,j)+I;h=f.call(h,o,j)+I;return{r:i,a0:k,
+a1:h,p0:[i*Math.cos(k),i*Math.sin(k)],p1:[i*Math.cos(h),i*Math.sin(h)]}}var d=Ra,g=Sa,e=Ta,c=na,f=oa;a.radius=function(h){if(!arguments.length)return e;e=v(h);return a};a.source=function(h){if(!arguments.length)return d;d=v(h);return a};a.target=function(h){if(!arguments.length)return g;g=v(h);return a};a.startAngle=function(h){if(!arguments.length)return c;c=v(h);return a};a.endAngle=function(h){if(!arguments.length)return f;f=v(h);return a};return a};d3.svg.mouse=function(a){var b=(a.ownerSVGElement||
+a).createSVGPoint();if(ca<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),g=d[0][0].getScreenCTM();ca=!(g.f||g.e);d.remove()}if(ca){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 ca=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.symbol=function(){function a(g,e){return(va[b.call(this,g,e)]||va.circle)(d.call(this,
+g,e))}var b=Va,d=Ua;a.type=function(g){if(!arguments.length)return b;b=v(g);return a};a.size=function(g){if(!arguments.length)return d;d=v(g);return a};return a};d3.svg.symbolTypes=["circle","cross","diamond","square","triangle-down","triangle-up"];var va={circle:function(a){a=Math.sqrt(a/Math.PI);return"M0,"+a+"A"+a+","+a+" 0 1,1 0,"+-a+"A"+a+","+a+" 0 1,1 0,"+a+"Z"},cross:function(a){a=Math.sqrt(a/5)/2;return"M"+-3*a+","+-a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+
+-3*a+"Z"},diamond:function(a){a=Math.sqrt(a/(2*wa));var b=a*wa;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=Math.sqrt(a/Q);var b=a*Q/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}},Q=Math.sqrt(3),wa=Math.tan(30*Math.PI/180)})();
View
57 lib/google-compiler/README
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Google Inc.
+ * Copyright 2009 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -168,11 +168,11 @@ http://code.google.com/p/jarjar/
-----
Code in:
-lib/args4j_deploy.jar
+lib/args4j.jar
Args4j
URL: https://args4j.dev.java.net/
-Version: 2.0.9
+Version: 2.0.12
License: MIT
Description:
@@ -184,11 +184,11 @@ Local Modifications: None.
-----
Code in:
-lib/guava-r06.jar
+lib/guava.jar
Guava Libraries
URL: http://code.google.com/p/guava-libraries/
-Version: R6
+Version: R7
License: Apache License 2.0
Description: Google's core Java libraries.
@@ -198,28 +198,6 @@ Local Modifications: None.
-----
Code in:
-lib/hamcrest-core-1.1.jar
-
-Hamcrest
-URL: http://code.google.com/p/hamcrest
-License: BSD
-License File: LICENSE
-
-Description:
-Provides a library of matcher objects (also known as constraints or
-predicates) allowing 'match' rules to be defined declaratively, to be used in
-other frameworks. Typical scenarios include testing frameworks, mocking
-libraries and UI validation rules.
-
-Local modifications:
-The original jars contained both source code and compiled classes.
-
-hamcrest-core-1.1.jar just contains the compiled classes.
-
-
-
------
-Code in:
lib/jsr305.jar
Annotations for software defect detection
@@ -238,7 +216,7 @@ lib/junit.jar
JUnit
URL: http://sourceforge.net/projects/junit/
-Version: 4.5
+Version: 4.8.2
License: Common Public License 1.0
Description: A framework for writing and running automated tests in Java.
@@ -248,7 +226,7 @@ Local Modifications: None.
---
Code in:
-lib/protobuf-java-2.3.0.jar
+lib/protobuf-java.jar
Protocol Buffers
URL: http://code.google.com/p/protobuf/
@@ -263,27 +241,38 @@ Local Modifications: None
---
Code in:
-lib/ant_deploy.jar
+lib/ant.jar
+lib/ant-launcher.jar
URL: http://ant.apache.org/bindownload.cgi
-Version: 1.6.5
+Version: 1.8.1
License: Apache License 2.0
Description:
Ant is a Java based build tool. In theory it is kind of like "make"
without make's wrinkles and with the full portability of pure java code.
-Local Modifications:
- Modified apache-ant-1.6.5/bin/ant to look in the ant.runfiles directory
+Local Modifications: None
---
Code in:
lib/json.jar
URL: http://json.org/java/index.html
-Version: JSON version 2
+Version: JSON version 20090211
License: MIT license
Description:
JSON is a set of java files for use in transmitting data in JSON format.
Local Modifications: None
+---
+Code in:
+tools/maven-ant-tasks-2.1.1.jar
+URL: http://maven.apache.org
+Version 2.1.1
+License: Apache License 2.0
+Description:
+ Maven Ant tasks are used to manage dependencies and to install/deploy to
+ maven repositories.
+
+Local Modifications: None
View
BIN lib/google-compiler/compiler.jar
Binary file not shown.
View
15 src/core/call.js
@@ -1,6 +1,15 @@
+//
+// Note: assigning to the arguments array simultaneously changes the value of
+// the corresponding argument! However, the Google Closure compiler doesn't
+// realize this, and so can optimize-away our attempt to avoid side-effects.
+// This fix by Jason Davies has been tested to survive minimization.
+//
+// TODO The `this` argument probably shouldn't be the first argument to the
+// callback, anyway, since it's redundant. However, that will require a major
+// version bump due to backwards compatibility, so I'm not changing it right
+// away.
+//
function d3_call(callback) {
- var f = callback;
- arguments[0] = this;
- f.apply(this, arguments);
+ callback.apply(this, (arguments[0] = this, arguments));
return this;
}
View
2 src/core/core.js
@@ -1 +1 @@
-d3 = {version: "1.6.0"}; // semver
+d3 = {version: "1.6.1"}; // semver
View
37 src/scale/pow.js
@@ -1,17 +1,9 @@
d3.scale.pow = function() {
var linear = d3.scale.linear(),
tick = d3.scale.linear(), // TODO better tick formatting...
- p = 1,
- b = 1 / p,
- n = false;
-
- function powp(x) {
- return n ? -Math.pow(-x, p) : Math.pow(x, p);
- }
-
- function powb(x) {
- return n ? -Math.pow(-x, b) : Math.pow(x, b);
- }
+ exponent = 1,
+ powp = Number,
+ powb = powp;
function scale(x) {
return linear(powp(x));
@@ -23,25 +15,38 @@ d3.scale.pow = function() {
scale.domain = function(x) {
if (!arguments.length) return linear.domain().map(powb);
- n = (x[0] || x[1]) < 0;
+ var pow = (x[0] || x[1]) < 0 ? d3_scale_pown : d3_scale_pow;
+ powp = pow(exponent);
+ powb = pow(1 / exponent);
linear.domain(x.map(powp));
tick.domain(x);
return scale;
};
scale.range = d3_rebind(scale, linear.range);
scale.rangeRound = d3_rebind(scale, linear.rangeRound);
- scale.inteprolate = d3_rebind(scale, linear.interpolate);
+ scale.interpolate = d3_rebind(scale, linear.interpolate);
scale.ticks = tick.ticks;
scale.tickFormat = tick.tickFormat;
scale.exponent = function(x) {
- if (!arguments.length) return p;
+ if (!arguments.length) return exponent;
var domain = scale.domain();
- p = x;
- b = 1 / x;
+ exponent = x;
return scale.domain(domain);
};
return scale;
};
+
+function d3_scale_pow(e) {
+ return function(x) {
+ return Math.pow(x, e);
+ };
+}
+
+function d3_scale_pown(e) {
+ return function(x) {
+ return -Math.pow(-x, e);
+ };
+}
View
21 tests/test-call.js
@@ -0,0 +1,21 @@
+require("./../lib/env-js/envjs/node");
+require("./../lib/sizzle/sizzle");
+require("./../d3.min");
+
+var vis = d3.select("body");
+
+console.log("zero arguments:");
+vis.call(function(a, b) {
+ console.log(" this:", vis === this ? "vis" : this);
+ console.log(" a:", vis === a ? "vis" : a);
+ console.log(" b:", b);
+});
+console.log("");
+
+console.log("one argument:");
+vis.call(function(a, b) {
+ console.log(" this:", vis === this ? "vis" : this);
+ console.log(" a:", vis === a ? "vis" : a);
+ console.log(" b:", b);
+}, "test");
+console.log("");
View
10 tests/test-call.out
@@ -0,0 +1,10 @@
+zero arguments:
+ this: vis
+ a: vis
+ b: undefined
+
+one argument:
+ this: vis
+ a: vis
+ b: test
+
View
53 tests/test-scale-pow.js
@@ -0,0 +1,53 @@
+require("./../lib/env-js/envjs/node");
+require("./../lib/sizzle/sizzle");
+require("./../d3");
+require("./../d3.time");
+
+var f = d3.format(" .3f");
+
+var x = d3.scale.pow().exponent(2);
+console.log("domain([0, 1]).range([0, 1]):");
+console.log(" -0.5 -> ", f(x(-0.5)));
+console.log(" 0.0 -> ", f(x(0.0)));
+console.log(" 0.5 -> ", f(x(0.5)));
+console.log(" 1.0 -> ", f(x(1.0)));
+console.log(" 1.5 -> ", f(x(1.5)));
+console.log("");
+
+var x = d3.scale.pow().exponent(2).domain([1, 2]);
+console.log("domain([1, 2]).range([0, 1]):");
+console.log(" 0.5 -> ", f(x(0.5)));
+console.log(" 1.0 -> ", f(x(1.0)));
+console.log(" 1.5 -> ", f(x(1.5)));
+console.log(" 2.0 -> ", f(x(2.0)));
+console.log(" 2.5 -> ", f(x(2.5)));
+console.log("");
+
+var x = d3.scale.pow().exponent(2).domain([new Date(1990, 0, 1), new Date(1991, 0, 1)]);
+console.log("domain([01/01/1990, 01/01/1991]).range([0, 1]):");
+console.log(" 10/20/1989 -> ", f(x(new Date(1989, 09, 20))));
+console.log(" 01/01/1990 -> ", f(x(new Date(1990, 00, 01))));
+console.log(" 03/15/1990 -> ", f(x(new Date(1990, 02, 15))));
+console.log(" 05/27/1990 -> ", f(x(new Date(1990, 04, 27))));
+console.log(" 01/01/1991 -> ", f(x(new Date(1991, 00, 01))));
+console.log(" 03/15/1991 -> ", f(x(new Date(1991, 02, 15))));
+console.log("");
+
+var x = d3.scale.pow().exponent(2).range(["red", "blue"]);
+console.log("domain([0, 1]).range([\"red\", \"blue\"]):");
+console.log(" -0.5 -> ", x(-0.5));
+console.log(" 0.0 -> ", x(0.0));
+console.log(" 0.5 -> ", x(0.5));
+console.log(" 1.0 -> ", x(1.0));
+console.log(" 1.5 -> ", x(1.5));
+console.log("");
+
+var x = d3.scale.pow().exponent(2).range(["red", "blue"]).interpolate(d3.interpolateHsl);
+console.log("domain([0, 1]).range([\"red\", \"blue\"]).interpolate(hsl):");
+console.log(" -0.50 -> ", x(-0.50));
+console.log(" 0.00 -> ", x(0.00));
+console.log(" 0.50 -> ", x(0.50));
+console.log(" √0.50 -> ", x(Math.SQRT1_2));
+console.log(" 1.00 -> ", x(1.00));
+console.log(" 2.00 -> ", x(2.00));
+console.log("");
View
37 tests/test-scale-pow.out
@@ -0,0 +1,37 @@
+domain([0, 1]).range([0, 1]):
+ -0.5 -> 0.250
+ 0.0 -> 0.000
+ 0.5 -> 0.250
+ 1.0 -> 1.000
+ 1.5 -> 2.250
+
+domain([1, 2]).range([0, 1]):
+ 0.5 -> −0.250
+ 1.0 -> 0.000
+ 1.5 -> 0.417
+ 2.0 -> 1.000
+ 2.5 -> 1.750
+
+domain([01/01/1990, 01/01/1991]).range([0, 1]):
+ 10/20/1989 -> −0.194
+ 01/01/1990 -> 0.000
+ 03/15/1990 -> 0.196
+ 05/27/1990 -> 0.394
+ 01/01/1991 -> 1.000
+ 03/15/1991 -> 1.206
+
+domain([0, 1]).range(["red", "blue"]):
+ -0.5 -> rgb(191,0,64)
+ 0.0 -> rgb(255,0,0)
+ 0.5 -> rgb(191,0,64)
+ 1.0 -> rgb(0,0,255)
+ 1.5 -> rgb(-319,0,574)
+
+domain([0, 1]).range(["red", "blue"]).interpolate(hsl):
+ -0.50 -> #ffff00
+ 0.00 -> #ff0000
+ 0.50 -> #ffff00
+ √0.50 -> #00ff00
+ 1.00 -> #0000ff
+ 2.00 -> #0000ff
+
View
52 tests/test-scale-sqrt.js
@@ -0,0 +1,52 @@
+require("./../lib/env-js/envjs/node");
+require("./../lib/sizzle/sizzle");
+require("./../d3");
+require("./../d3.time");
+
+var f = d3.format(" .3f");
+
+var x = d3.scale.sqrt();
+console.log("domain([0, 1]).range([0, 1]):");
+console.log(" -0.50 -> ", f(x(-0.50)));
+console.log(" 0.00 -> ", f(x(0.00)));
+console.log(" 0.25 -> ", f(x(0.25)));
+console.log(" 0.50 -> ", f(x(0.50)));
+console.log(" 1.00 -> ", f(x(1.00)));
+console.log(" 4.00 -> ", f(x(4.00)));
+console.log("");
+
+var x = d3.scale.sqrt().domain([0, -1]);
+console.log("domain([0, -1]).range([0, 1]):");
+console.log(" 0.50 -> ", f(x(0.50)));
+console.log(" 0.00 -> ", f(x(0.00)));
+console.log(" -0.25 -> ", f(x(-0.25)));
+console.log(" -0.50 -> ", f(x(-0.50)));
+console.log(" -1.00 -> ", f(x(-1.00)));
+console.log(" -4.00 -> ", f(x(-4.00)));
+console.log("");
+
+var x = d3.scale.sqrt().domain([1, 2]);
+console.log("domain([1, 2]).range([0, 1]):");
+console.log(" 0.5 -> ", f(x(0.5)));
+console.log(" 1.0 -> ", f(x(1.0)));
+console.log(" 1.5 -> ", f(x(1.5)));
+console.log(" 2.0 -> ", f(x(2.0)));
+console.log(" 2.5 -> ", f(x(2.5)));
+console.log("");
+
+var x = d3.scale.sqrt().range(["red", "blue"]);
+console.log("domain([0, 1]).range([\"red\", \"blue\"]):");
+console.log(" 0.00 -> ", x(0.00));
+console.log(" 0.25 -> ", x(0.25));
+console.log(" 1.00 -> ", x(1.00));
+console.log(" 4.00 -> ", x(4.00));
+console.log("");
+
+var x = d3.scale.sqrt().domain([1, 0]).range(["red", "blue"]).interpolate(d3.interpolateHsl);
+console.log("domain([1, 0]).range([\"red\", \"blue\"]).interpolate(hsl):");
+console.log(" 0.00 -> ", x(0.00));
+console.log(" 0.25 -> ", x(0.25));
+console.log(" 0.50 -> ", x(0.50));
+console.log(" 1.00 -> ", x(1.00));
+console.log(" 4.00 -> ", x(4.00));
+console.log("");
View
36 tests/test-scale-sqrt.out
@@ -0,0 +1,36 @@
+domain([0, 1]).range([0, 1]):
+ -0.50 -> NaN
+ 0.00 -> 0.000
+ 0.25 -> 0.500
+ 0.50 -> 0.707
+ 1.00 -> 1.000
+ 4.00 -> 2.000
+
+domain([0, -1]).range([0, 1]):
+ 0.50 -> NaN
+ 0.00 -> 0.000
+ -0.25 -> 0.500
+ -0.50 -> 0.707
+ -1.00 -> 1.000
+ -4.00 -> 2.000
+
+domain([1, 2]).range([0, 1]):
+ 0.5 -> −0.707
+ 1.0 -> 0.000
+ 1.5 -> 0.543
+ 2.0 -> 1.000
+ 2.5 -> 1.403
+
+domain([0, 1]).range(["red", "blue"]):
+ 0.00 -> rgb(255,0,0)
+ 0.25 -> rgb(128,0,128)
+ 1.00 -> rgb(0,0,255)
+ 4.00 -> rgb(-255,0,510)
+
+domain([1, 0]).range(["red", "blue"]).interpolate(hsl):
+ 0.00 -> #0000ff
+ 0.25 -> #00ff00
+ 0.50 -> #d3ff00
+ 1.00 -> #ff0000
+ 4.00 -> #00ff00
+

0 comments on commit 26662de

Please sign in to comment.