Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'release'

  • Loading branch information...
commit 68424aeff4fd0436033d66b6cff17c913ff56e41 2 parents e2119b8 + 27158fd
Mike Bostock mbostock authored
8 Makefile
@@ -37,6 +37,7 @@ d3.core.js: \
37 37 src/core/descending.js \
38 38 src/core/min.js \
39 39 src/core/max.js \
  40 + src/core/sum.js \
40 41 src/core/zip.js \
41 42 src/core/bisect.js \
42 43 src/core/nest.js \
@@ -146,6 +147,8 @@ d3.time.js: \
146 147 src/start.js \
147 148 src/time/time.js \
148 149 src/time/format.js \
  150 + src/time/format-utc.js \
  151 + src/time/format-iso.js \
149 152 src/end.js
150 153
151 154 d3.geom.js: \
@@ -171,6 +174,7 @@ tests: \
171 174 tests/test-keys.test \
172 175 tests/test-max.test \
173 176 tests/test-min.test \
  177 + tests/test-sum.test \
174 178 tests/test-nest.test \
175 179 tests/test-permute.test \
176 180 tests/test-zip.test \
@@ -179,7 +183,11 @@ tests: \
179 183 tests/test-round.test \
180 184 tests/test-hsl.test \
181 185 tests/test-time-format.test \
  186 + tests/test-time-format-iso.test \
  187 + tests/test-time-format-utc.test \
182 188 tests/test-time-parse.test \
  189 + tests/test-time-parse-iso.test \
  190 + tests/test-time-parse-utc.test \
183 191 tests/test-transition.test \
184 192 tests/test-scale-linear.test \
185 193 tests/test-scale-polylinear.test \
16 d3.js
... ... @@ -1,4 +1,4 @@
1   -(function(){d3 = {version: "1.20.3"}; // semver
  1 +(function(){d3 = {version: "1.21.0"}; // semver
2 2 if (!Date.now) Date.now = function() {
3 3 return +new Date;
4 4 };
@@ -68,6 +68,20 @@ d3.max = function(array, f) {
68 68 }
69 69 return a;
70 70 };
  71 +d3.sum = function(array, f) {
  72 + var s = 0,
  73 + n = array.length,
  74 + a,
  75 + i = -1;
  76 +
  77 + if (arguments.length === 1) {
  78 + while (++i < n) if (!isNaN(a = +array[i])) s += a;
  79 + } else {
  80 + while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
  81 + }
  82 +
  83 + return s;
  84 +};
71 85 d3.zip = function() {
72 86 if (!(n = arguments.length)) return [];
73 87 for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m;) {
4 d3.min.js
... ... @@ -1,2 +1,2 @@
1   -(function(){function ch(){return"circle"}function cg(){return 64}function cf(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(ce<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();ce=!e.f&&!e.e,d.remove()}ce?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cd(a){return[a.x,a.y]}function cc(a){return a.endAngle}function cb(a){return a.startAngle}function ca(a){return a.radius}function b_(a){return a.target}function b$(a){return a.source}function bZ(){return 0}function bY(a){return a.length<3?bF(a):a[0]+bL(a,bX(a))}function bX(a){var b=[],c,d,e,f,g=bW(a),h=-1,i=a.length-1;while(++h<i)c=bV(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function bW(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=bV(e,f);while(++b<c)d[b]=g+(g=bV(e=f,f=a[b+1]));d[b]=g;return d}function bV(a,b){return(b[1]-a[1])/(b[0]-a[0])}function bU(a,b,c){a.push("C",bQ(bR,b),",",bQ(bR,c),",",bQ(bS,b),",",bQ(bS,c),",",bQ(bT,b),",",bQ(bT,c))}function bQ(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bP(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bQ(bT,g),",",bQ(bT,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bU(b,g,h);return b.join("")}function bO(a){if(a.length<4)return bF(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(bQ(bT,f)+","+bQ(bT,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),bU(b,f,g);return b.join("")}function bN(a){if(a.length<3)return bF(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bU(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bU(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bU(b,h,i);return b.join("")}function bM(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bL(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bF(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bK(a,b,c){return a.length<3?bF(a):a[0]+bL(a,bM(a,b))}function bJ(a,b){return a.length<3?bF(a):a[0]+bL((a.push(a[0]),a),bM([a[a.length-2]].concat(a,[a[1]]),b))}function bI(a,b){return a.length<4?bF(a):a[1]+bL(a.slice(1,a.length-1),bM(a,b))}function bH(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bG(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bF(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bD(a){return a[1]}function bC(a){return a[0]}function bB(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bA(a){return a.endAngle}function bz(a){return a.startAngle}function by(a){return a.outerRadius}function bx(a){return a.innerRadius}function bq(a){return function(b){return-Math.pow(-b,a)}}function bp(a){return function(b){return Math.pow(b,a)}}function bo(a){return-Math.log(-a)/Math.LN10}function bn(a){return Math.log(a)/Math.LN10}function bm(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bl(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bk(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bj(){return Math}function bi(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bg(){var a=null,b=bb,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bb=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bf(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,a>c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bg()-b;d>24?(isFinite(d)&&(clearTimeout(bd),bd=setTimeout(bf,d)),bc=0):(bc=1,bh(bf))}function be(a,b){var c=Date.now(),d=!1,e,f=bb;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bb={callback:a,then:c,delay:b,next:bb}),bc||(bd=clearTimeout(bd),bc=1,bh(bf))}}function ba(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function _(a){function n(b){var h=!0,l=-1;a.each(function(){if(i[++l]!==2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){h=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!==c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,g.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a===1){i[l]=2;if(n.active===c){var r=n.owner;r===c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),$=c,g.end.dispatch.apply(this,arguments),$=0,n.owner=r}}}});return h}var b={},c=$||++Z,d={},e=[],f=!1,g=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),be(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,ba(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,ba(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=_(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=_(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){g[a].add(c);return b},b.call=h;return b.delay(0).duration(250)}function Y(a){return{__data__:a}}function X(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function W(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return V(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function V(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return V(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return V(c)}a.select=function(a){return b(function(b){return S(a,b)})},a.selectAll=function(a){return c(function(b){return T(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return V(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=Y(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=V(e);k.enter=function(){return W(d)},k.exit=function(){return V(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?f:h).call(this)}function h(){if(a=this.classList)return a.remove(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;d=g(d.replace(e," ")),c?a.baseVal=d:this.className=d}function f(){if(a=this.classList)return a.add(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;e.lastIndex=0,e.test(d)||(d=g(d+" "+b),c?a.baseVal=d:this.className=d)}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){if(a=this.classList)return a.contains(b);var a=this.className;e.lastIndex=0;return e.test(a.baseVal!=null?a.baseVal:a)});return a.each(typeof c=="function"?i:c?f:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=X.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e===-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function h(a){var d=d3.event;d3.event=a;try{c.call(this,e.__data__,b)}finally{d3.event=d}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=h,d);var e=this})},a.transition=function(){return _(a)},a.call=h;return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return a?Math.pow(2,10*(a-1))-.001:0}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){a.apply(this,(arguments[0]=this,arguments));return this}function g(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(a){return a==null}function e(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.20.3"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},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=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.zip=function(){if(!(f=arguments.length))return[];for(var a=-1,b=d3.min(arguments,e),c=Array(b);++a<b;)for(var d=-1,f,g=c[a]=Array(f);++d<f;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,g=-1,h=a.length;arguments.length<2&&(b=f);while(++g<h)b.call(d,e=a[g],g)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length===1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},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(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,b-c))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},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,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length===1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(b in N||/^(#|rgb\(|hsl\()/.test(b))&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={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"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var S=function(a,b){return b.querySelector(a)},T=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(S=function(a,b){return Sizzle(a,b)[0]},T=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var U=V([[document]]);U[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?U.select(a):V([[a]])},d3.selectAll=function(b){return typeof b=="string"?U.selectAll(b):V([a(b)])},d3.transition=U.transition;var Z=0,$=0,bb=null,bc,bd;d3.timer=function(a){be(a,0)},d3.timer.flush=function(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bg()};var bh=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function i(b){var c=d3.min(a),d=d3.max(a),e=d-c,f=Math.pow(10,Math.floor(Math.log(e/b)/Math.LN10)),g=b/(e/f);g<=.15?f*=10:g<=.35?f*=5:g<=.75&&(f*=2);return{start:Math.ceil(c/f)*f,stop:Math.floor(d/f)*f+f*.5,step:f}}function h(a){return e(a)}function g(){var g=a.length==2?bl:bm,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var a=[0,1],b=[0,1],c=d3.interpolate,d=!1,e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(a){var b=i(a);return d3.range(b.start,b.stop,b.step)},h.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(i(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")},h.nice=function(){bi(a,bk);return g()};return g()},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bn,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bo:bn,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.nice=function(){a.domain(bi(a.domain(),bj));return d},d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bo){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bn.pow=function(a){return Math.pow(10,a)},bo.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length
2   -)return a.domain().map(e);var h=(g[0]||g[1])<0?bq:bp;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.nice=function(){return f.domain(bi(f.domain(),bk))},f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(br)},d3.scale.category20=function(){return d3.scale.ordinal().range(bs)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bt)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bu)};var br=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bs=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bt=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bu=["#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 e(a){if(isNaN(a=+a))return NaN;return b[d3.bisect(c,a)]}function d(){var d=0,e=a.length,f=b.length,g;c.length=Math.max(0,f-1);while(++d<f)c[d-1]=(g=e*d/f)%1?a[~~g]:(a[g=~~g]+a[g-1])/2}var a=[],b=[],c=[];e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return e},e.range=function(a){if(!arguments.length)return b;b=a,d();return e},e.quantiles=function(){return c};return e},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bv,h=d.apply(this,arguments)+bv,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bw?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bx,b=by,c=bz,d=bA;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bv;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bv=-Math.PI/2,bw=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(bB(this,c,a,b),e)}var a=bC,b=bD,c="linear",d=bE[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bE[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bE={linear:bF,"step-before":bG,"step-after":bH,basis:bN,"basis-open":bO,"basis-closed":bP,cardinal:bK,"cardinal-open":bI,"cardinal-closed":bJ,monotone:bY},bR=[0,2/3,1/3,0],bS=[0,1/3,2/3,0],bT=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bB(this,d,a,c),f)+"L"+e(bB(this,d,a,b).reverse(),f)+"Z"}var a=bC,b=bZ,c=bD,d="linear",e=bE[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bE[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bv,k=e.call(a,h,g)+bv;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=b$,b=b_,c=ca,d=bz,e=bA;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=b$,b=b_,c=cd;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){return cf(a,d3.event)};var ce=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=cf(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(ci[a.call(this,c,d)]||ci.circle)(b.call(this,c,d))}var a=ch,b=cg;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var ci={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*ck)),c=b*ck;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cj),c=b*cj/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cj),c=b*cj/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(ci);var cj=Math.sqrt(3),ck=Math.tan(30*Math.PI/180)})()
  1 +(function(){function ch(){return"circle"}function cg(){return 64}function cf(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(ce<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();ce=!e.f&&!e.e,d.remove()}ce?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse());return[c.x,c.y]}function cd(a){return[a.x,a.y]}function cc(a){return a.endAngle}function cb(a){return a.startAngle}function ca(a){return a.radius}function b_(a){return a.target}function b$(a){return a.source}function bZ(){return 0}function bY(a){return a.length<3?bF(a):a[0]+bL(a,bX(a))}function bX(a){var b=[],c,d,e,f,g=bW(a),h=-1,i=a.length-1;while(++h<i)c=bV(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function bW(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=bV(e,f);while(++b<c)d[b]=g+(g=bV(e=f,f=a[b+1]));d[b]=g;return d}function bV(a,b){return(b[1]-a[1])/(b[0]-a[0])}function bU(a,b,c){a.push("C",bQ(bR,b),",",bQ(bR,c),",",bQ(bS,b),",",bQ(bS,c),",",bQ(bT,b),",",bQ(bT,c))}function bQ(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function bP(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[bQ(bT,g),",",bQ(bT,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),bU(b,g,h);return b.join("")}function bO(a){if(a.length<4)return bF(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(bQ(bT,f)+","+bQ(bT,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),bU(b,f,g);return b.join("")}function bN(a){if(a.length<3)return bF(a);var b=[],c=1,d=a.length,e=a[0],f=e[0],g=e[1],h=[f,f,f,(e=a[1])[0]],i=[g,g,g,e[1]];b.push(f,",",g),bU(b,h,i);while(++c<d)e=a[c],h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bU(b,h,i);c=-1;while(++c<2)h.shift(),h.push(e[0]),i.shift(),i.push(e[1]),bU(b,h,i);return b.join("")}function bM(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function bL(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return bF(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function bK(a,b,c){return a.length<3?bF(a):a[0]+bL(a,bM(a,b))}function bJ(a,b){return a.length<3?bF(a):a[0]+bL((a.push(a[0]),a),bM([a[a.length-2]].concat(a,[a[1]]),b))}function bI(a,b){return a.length<4?bF(a):a[1]+bL(a.slice(1,a.length-1),bM(a,b))}function bH(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("H",(e=a[c])[0],"V",e[1]);return b.join("")}function bG(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("V",(e=a[c])[1],"H",e[0]);return b.join("")}function bF(a){var b=[],c=0,d=a.length,e=a[0];b.push(e[0],",",e[1]);while(++c<d)b.push("L",(e=a[c])[0],",",e[1]);return b.join("")}function bD(a){return a[1]}function bC(a){return a[0]}function bB(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function bA(a){return a.endAngle}function bz(a){return a.startAngle}function by(a){return a.outerRadius}function bx(a){return a.innerRadius}function bq(a){return function(b){return-Math.pow(-b,a)}}function bp(a){return function(b){return Math.pow(b,a)}}function bo(a){return-Math.log(-a)/Math.LN10}function bn(a){return Math.log(a)/Math.LN10}function bm(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bl(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bk(a){a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1);return{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bj(){return Math}function bi(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g),b=b(f-e),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bg(){var a=null,b=bb,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bb=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bf(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,a>c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bg()-b;d>24?(isFinite(d)&&(clearTimeout(bd),bd=setTimeout(bf,d)),bc=0):(bc=1,bh(bf))}function be(a,b){var c=Date.now(),d=!1,e,f=bb;if(!!isFinite(b)){while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bb={callback:a,then:c,delay:b,next:bb}),bc||(bd=clearTimeout(bd),bc=1,bh(bf))}}function ba(a){return typeof a=="function"?function(b,c,d){var e=a.call(this,b,c)+"";return d!=e&&d3.interpolate(d,e)}:(a=a+"",function(b,c,d){return d!=a&&d3.interpolate(d,a)})}function _(a){function n(b){var h=!0,l=-1;a.each(function(){if(i[++l]!==2){var a=(b-j[l])/k[l],n=this.__transition__,o,p,q=e[l];if(a<1){h=!1;if(a<0)return}else a=1;if(i[l]){if(!n||n.active!==c){i[l]=2;return}}else{if(!n||n.active>c){i[l]=2;return}i[l]=1,g.start.dispatch.apply(this,arguments),q=e[l]={},n.active=c;for(p in d)if(o=d[p].apply(this,arguments))q[p]=o}o=m(a);for(p in q)q[p].call(this,o);if(a===1){i[l]=2;if(n.active===c){var r=n.owner;r===c&&(delete this.__transition__,f&&this.parentNode.removeChild(this)),$=c,g.end.dispatch.apply(this,arguments),$=0,n.owner=r}}}});return h}var b={},c=$||++Z,d={},e=[],f=!1,g=d3.dispatch("start","end"),i=[],j=[],k=[],l,m=d3.ease("cubic-in-out");a.each(function(){(this.__transition__||(this.__transition__={})).owner=c}),b.delay=function(c){var d=Infinity,e=-1;typeof c=="function"?a.each(function(a,b){var f=j[++e]=+c.apply(this,arguments);f<d&&(d=f)}):(d=+c,a.each(function(a,b){j[++e]=d})),be(n,d);return b},b.duration=function(c){var d=-1;typeof c=="function"?(l=0,a.each(function(a,b){var e=k[++d]=+c.apply(this,arguments);e>l&&(l=e)})):(l=+c,a.each(function(a,b){k[++d]=l}));return b},b.ease=function(a){m=typeof a=="function"?a:d3.ease.apply(d3,arguments);return b},b.attrTween=function(a,c){function f(b,d){var e=c.call(this,b,d,this.getAttributeNS(a.space,a.local));return e&&function(b){this.setAttributeNS(a.space,a.local,e(b))}}function e(b,d){var e=c.call(this,b,d,this.getAttribute(a));return e&&function(b){this.setAttribute(a,e(b))}}d["attr."+a]=a.local?f:e;return b},b.attr=function(a,c){return b.attrTween(a,ba(c))},b.styleTween=function(a,c,e){function f(b,d){var f=c.call(this,b,d,window.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),e)}}arguments.length<3&&(e=null),d["style."+a]=f;return b},b.style=function(a,c,d){arguments.length<3&&(d=null);return b.styleTween(a,ba(c),d)},b.text=function(a){d.text=function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a};return b},b.select=function(b){var c,d=_(a.select(b)).ease(m);c=-1,d.delay(function(a,b){return j[++c]}),c=-1,d.duration(function(a,b){return k[++c]});return d},b.selectAll=function(b){var c,d=_(a.selectAll(b)).ease(m);c=-1,d.delay(function(a,b){return j[b?c:++c]}),c=-1,d.duration(function(a,b){return k[b?c:++c]});return d},b.remove=function(){f=!0;return b},b.each=function(a,c){g[a].add(c);return b},b.call=h;return b.delay(0).duration(250)}function Y(a){return{__data__:a}}function X(a){arguments.length||(a=d3.ascending);return function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function W(a){function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(f.parentNode)),e.__data__=g.__data__):d.push(null)}return V(c)}a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)};return a}function V(a){function d(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h)return b.call(h,h.__data__,f)}}return null}function c(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g];for(var i=0,j=e.length;i<j;i++)if(f=e[i])c.push(d=b(f)),d.parentNode=f}return V(c)}function b(b){var c=[],d,e,f,g;for(var h=0,i=a.length;h<i;h++){f=a[h],c.push(d=[]),d.parentNode=f.parentNode;for(var j=0,k=f.length;j<k;j++)(g=f[j])?(d.push(e=b(g)),e&&"__data__"in g&&(e.__data__=g.__data__)):d.push(null)}return V(c)}a.select=function(a){return b(function(b){return S(a,b)})},a.selectAll=function(a){return c(function(b){return T(a,b)})},a.filter=function(b){var c=[],d,e,f;for(var g=0,h=a.length;g<h;g++){e=a[g],c.push(d=[]),d.parentNode=e.parentNode;for(var i=0,j=e.length;i<j;i++)(f=e[i])&&b.call(f,f.__data__,i)&&d.push(f)}return V(c)},a.map=function(b){var c,d;for(var e=0,f=a.length;e<f;e++){c=a[e];for(var g=0,h=c.length;g<h;g++)if(d=c[g])d.__data__=b.call(d,d.__data__,g)}return a},a.data=function(b,c){function g(a,b){var g=0,h=a.length,i=b.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(c){var q={},r=[],s,t=b.length;for(g=0;g<h;g++)s=c.call(o=a[g],o.__data__,g),s in q?n[t++]=a[g]:q[s]=o,r.push(s);for(g=0;g<i;g++)o=q[s=c.call(b,p=b[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null),delete q[s];for(g=0;g<h;g++)r[g]in q&&(n[g]=a[g])}else{for(;g<j;g++)o=a[g],p=b[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=Y(p),l[g]=n[g]=null);for(;g<i;g++)m[g]=Y(b[g]),l[g]=n[g]=null;for(;g<k;g++)n[g]=a[g],m[g]=l[g]=null}m.parentNode=l.parentNode=n.parentNode=a.parentNode,d.push(m),e.push(l),f.push(n)}var d=[],e=[],f=[],h=-1,i=a.length,j;if(typeof b=="function")while(++h<i)g(j=a[h],b.call(j,j.parentNode.__data__,h));else while(++h<i)g(j=a[h],b);var k=V(e);k.enter=function(){return W(d)},k.exit=function(){return V(f)};return k},a.each=function(b){for(var c=0,d=a.length;c<d;c++){var e=a[c];for(var f=0,g=e.length;f<g;f++){var h=e[f];h&&b.call(h,h.__data__,f)}}return a},a.empty=function(){return!d(function(){return!0})},a.node=function(){return d(function(){return this})},a.attr=function(b,c){function j(){var a=c.apply(this,arguments);a==null?this.removeAttributeNS(b.space,b.local):this.setAttributeNS(b.space,b.local,a)}function i(){var a=c.apply(this,arguments);a==null?this.removeAttribute(b):this.setAttribute(b,a)}function h(){this.setAttributeNS(b.space,b.local,c)}function g(){this.setAttribute(b,c)}function f(){this.removeAttributeNS(b.space,b.local)}function e(){this.removeAttribute(b)}b=d3.ns.qualify(b);if(arguments.length<2)return d(b.local?function(){return this.getAttributeNS(b.space,b.local)}:function(){return this.getAttribute(b)});return a.each(c==null?b.local?f:e:typeof c=="function"?b.local?j:i:b.local?h:g)},a.classed=function(b,c){function i(){(c.apply(this,arguments)?f:h).call(this)}function h(){if(a=this.classList)return a.remove(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;d=g(d.replace(e," ")),c?a.baseVal=d:this.className=d}function f(){if(a=this.classList)return a.add(b);var a=this.className,c=a.baseVal!=null,d=c?a.baseVal:a;e.lastIndex=0,e.test(d)||(d=g(d+" "+b),c?a.baseVal=d:this.className=d)}var e=new RegExp("(^|\\s+)"+d3.requote(b)+"(\\s+|$)","g");if(arguments.length<2)return d(function(){if(a=this.classList)return a.contains(b);var a=this.className;e.lastIndex=0;return e.test(a.baseVal!=null?a.baseVal:a)});return a.each(typeof c=="function"?i:c?f:h)},a.style=function(b,c,e){function h(){var a=c.apply(this,arguments);a==null?this.style.removeProperty(b):this.style.setProperty(b,a,e)}function g(){this.style.setProperty(b,c,e)}function f(){this.style.removeProperty(b)}arguments.length<3&&(e="");if(arguments.length<2)return d(function(){return window.getComputedStyle(this,null).getPropertyValue(b)});return a.each(c==null?f:typeof c=="function"?h:g)},a.property=function(b,c){function g(){var a=c.apply(this,arguments);a==null?delete this[b]:this[b]=a}function f(){this[b]=c}function e(){delete this[b]}b=d3.ns.qualify(b);if(arguments.length<2)return d(function(){return this[b]});return a.each(c==null?e:typeof c=="function"?g:f)},a.text=function(b){function e(){this.textContent=b.apply(this,arguments)}function c(){this.textContent=b}if(arguments.length<1)return d(function(){return this.textContent});return a.each(typeof b=="function"?e:c)},a.html=function(b){function e(){this.innerHTML=b.apply(this,arguments)}function c(){this.innerHTML=b}if(arguments.length<1)return d(function(){return this.innerHTML});return a.each(typeof b=="function"?e:c)},a.append=function(a){function d(b){return b.appendChild(document.createElementNS(a.space,a.local))}function c(b){return b.appendChild(document.createElement(a))}a=d3.ns.qualify(a);return b(a.local?d:c)},a.insert=function(a,c){function e(b){return b.insertBefore(document.createElementNS(a.space,a.local),S(c,b))}function d(b){return b.insertBefore(document.createElement(a),S(c,b))}a=d3.ns.qualify(a);return b(a.local?e:d)},a.remove=function(){return a.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},a.sort=function(b){b=X.apply(this,arguments);for(var c=0,d=a.length;c<d;c++){var e=a[c];e.sort(b);for(var f=1,g=e.length,h=e[0];f<g;f++){var i=e[f];i&&(h&&h.parentNode.insertBefore(i,h.nextSibling),h=i)}}return a},a.on=function(b,c,d){arguments.length<3&&(d=!1);var e=b.indexOf("."),f=e===-1?b:b.substring(0,e),g="__on"+b;return a.each(function(a,b){function h(a){var d=d3.event;d3.event=a;try{c.call(this,e.__data__,b)}finally{d3.event=d}}this[g]&&this.removeEventListener(f,this[g],d),c&&this.addEventListener(f,this[g]=h,d);var e=this})},a.transition=function(){return _(a)},a.call=h;return a}function R(a,b,c){function g(a){return Math.round(f(a)*255)}function f(a){a>360?a-=360:a<0&&(a+=360);if(a<60)return d+(e-d)*a/60;if(a<180)return e;if(a<240)return d+(e-d)*(240-a)/60;return d}var d,e;a=a%360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e;return H(g(a+120),g(a),g(a-120))}function Q(a,b,c){this.h=a,this.s=b,this.l=c}function P(a,b,c){return new Q(a,b,c)}function M(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function L(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0;return P(g,h,i)}function K(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(M(h[0]),M(h[1]),M(h[2]))}}if(i=N[a])return b(i.r,i.g,i.b);a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16));return b(d,e,f)}function J(a){return a<16?"0"+a.toString(16):a.toString(16)}function I(a,b,c){this.r=a,this.g=b,this.b=c}function H(a,b,c){return new I(a,b,c)}function G(a,b){b=1/(b-(a=+a));return function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function F(a,b){b=1/(b-(a=+a));return function(c){return(c-a)*b}}function E(a){return a in D||/\bcolor\b/.test(a)?d3.interpolateRgb:d3.interpolate}function B(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function A(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}}function z(a,b){var c;arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a);return function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function y(a){return 1-Math.sqrt(1-a*a)}function x(a){return a?Math.pow(2,10*(a-1))-.001:0}function w(a){return 1-Math.cos(a*Math.PI/2)}function v(a){return function(b){return Math.pow(b,a)}}function u(a){return a}function t(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function s(a){return function(b){return 1-a(1-b)}}function n(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function m(a){return a+""}function j(a){var b={},c=[];b.add=function(a){for(var d=0;d<c.length;d++)if(c[d].listener==a)return b;c.push({listener:a,on:!0});return b},b.remove=function(a){for(var d=0;d<c.length;d++){var e=c[d];if(e.listener==a){e.on=!1,c=c.slice(0,d).concat(c.slice(d+1));break}}return b},b.dispatch=function(){var a=c;for(var b=0,d=a.length;b<d;b++){var e=a[b];e.on&&e.listener.apply(this,arguments)}};return b}function h(a){a.apply(this,(arguments[0]=this,arguments));return this}function g(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function f(a){return a==null}function e(a){return a.length}function c(a){return Array.prototype.slice.call(a)}function b(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}d3={version:"1.21.0"},Date.now||(Date.now=function(){return+(new Date)}),Object.create||(Object.create=function(a){function b(){}b.prototype=a;return new b});var a=c;try{a(document.documentElement.childNodes)[0].nodeType}catch(d){a=b}d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},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=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.zip=function(){if(!(f=arguments.length))return[];for(var a=-1,b=d3.min(arguments,e),c=Array(b);++a<b;)for(var d=-1,f,g=c[a]=Array(f);++d<f;)g[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.nest=function(){function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});f&&e.sort(function(a,b){return f(a.key,b.key)});return e}function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}var a={},b=[],c=[],d,e;a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){b.push(c);return a},a.sortKeys=function(d){c[b.length-1]=d;return a},a.sortValues=function(b){d=b;return a},a.rollup=function(b){e=b;return a};return a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,g=-1,h=a.length;arguments.length<2&&(b=f);while(++g<h)b.call(d,e=a[g],g)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length===1&&(b=a,a=0),c==null&&(c=1);if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(i,"\\$&")};var i=/[\\\^\$\*\+\?\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},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(a){var b={},c;for(var d=0,e=arguments.length;d<e;d++)c=arguments[d],b[c]=j(c);return b},d3.format=function(a){var b=k.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=!1,o=!1;h&&(h=h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=!0,i="f";break;case"p":j=!0,i="r";break;case"d":o=!0,h="0"}i=l[i]||m;return function(a){var b=j?a*100:+a,k=b<0&&(b=-b)?"−":d;if(o&&b%1)return"";a=i(b,h);if(e){var l=a.length+k.length;l<f&&(a=Array(f-l+1).join(c)+a),g&&(a=n(a)),a=k+a}else{g&&(a=n(a)),a=k+a;var l=a.length;l<f&&(a=Array(f-l+1).join(c)+a)}j&&(a+="%");return a}};var k=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,l={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){var c=1+Math.floor(1e-15+Math.log(a)/Math.LN10);return d3.round(a,b-c).toFixed(Math.max(0,b-c))}},o=v(2),p=v(3),q={linear:function(){return u},poly:v,quad:function(){return o},cubic:function(){return p},sin:function(){return w},exp:function(){return x},circle:function(){return y},elastic:z,back:A,bounce:function(){return B}},r={"in":function(a){return a},out:s,"in-out":t,"out-in":function(a){return t(s(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return r[d](q[c].apply(null,Array.prototype.slice.call(arguments,1)))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},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,d,e,f=0,g=0,h=[],i=[],j,k;C.lastIndex=0;for(d=0;c=C.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=C.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=C.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;if(h.length===1)return h[0]==null?i[0].x:function(){return b};return function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"rgb("+Math.round(c+f*a)+","+Math.round(d+g*a)+","+Math.round(e+h*a)+")"}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return R(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=E(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var C=/[-+]?(?:\d+\.\d+|\d+\.|\.\d+|\d+)(?:[eE][-]?\d+)?/g,D={background:1,fill:1,stroke:1};d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(String(a),b)},function(a,b){return(b in N||/^(#|rgb\(|hsl\()/.test(b))&&d3.interpolateRgb(String(a),b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?K(""+a,H,R):H(~~a,~~b,~~c)},I.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;if(!b&&!c&&!d)return H(e,e,e);b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e);return H(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))},I.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return H(Math.max(0,Math.floor(a*this.r)),Math.max(0,Math.floor(a*this.g)),Math.max(0,Math.floor(a*this.b)))},I.prototype.hsl=function(){return L(this.r,this.g,this.b)},I.prototype.toString=function(){return"#"+J(this.r)+J(this.g)+J(this.b)};var N={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"};for(var O in N)N[O]=K(N[O],H,R);d3.hsl=function(a,b,c){return arguments.length===1?K(""+a,L,P):P(+a,+b,+c)},Q.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,this.l/a)},Q.prototype.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return P(this.h,this.s,a*this.l)},Q.prototype.rgb=function(){return R(this.h,this.s,this.l)},Q.prototype.toString=function(){return"hsl("+this.h+","+this.s*100+"%,"+this.l*100+"%)"};var S=function(a,b){return b.querySelector(a)},T=function(b,c){return a(c.querySelectorAll(b))};typeof Sizzle=="function"&&(S=function(a,b){return Sizzle(a,b)[0]},T=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var U=V([[document]]);U[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?U.select(a):V([[a]])},d3.selectAll=function(b){return typeof b=="string"?U.selectAll(b):V([a(b)])},d3.transition=U.transition;var Z=0,$=0,bb=null,bc,bd;d3.timer=function(a){be(a,0)},d3.timer.flush=function(){var a,b=Date.now(),c=bb;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bg()};var bh=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.scale={},d3.scale.linear=function(){function i(b){var c=d3.min(a),d=d3.max(a),e=d-c,f=Math.pow(10,Math.floor(Math.log(e/b)/Math.LN10)),g=b/(e/f);g<=.15?f*=10:g<=.35?f*=5:g<=.75&&(f*=2);return{start:Math.ceil(c/f)*f,stop:Math.floor(d/f)*f+f*.5,step:f}}function h(a){return e(a)}function g(){var g=a.length==2?bl:bm,i=d?G:F;e=g(a,b,i,c),f=g(b,a,i,d3.interpolate);return h}var a=[0,1],b=[0,1],c=d3.interpolate,d=!1,e,f;h.invert=function(a){return f(a)},h.domain=function(b){if(!arguments.length)return a;a=b.map(Number);return g()},h.range=function(a){if(!arguments.length)return b;b=a;return g()},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){if(!arguments.length)return d;d=a;return g()},h.interpolate=function(a){if(!arguments.length)return c;c=a;return g()},h.ticks=function(a){var b=i(a);return d3.range(b.start,b.stop,b.step)},h.tickFormat=function(a){var b=Math.max(0,-Math.floor(Math.log(i(a).step)/Math.LN10+.01));return d3.format(",."+b+"f")},h.nice=function(){bi(a,bk);return g()};return g()},d3.scale.log=function(){function d(c){return a(b(c))}var a=d3.scale.linear(),b=bn,c=b.pow;d.invert=function(b){return c(a.invert(b))},d.domain=function(e){if(!arguments.length)return a.domain().map(c);b=(e[0]||e[1])<0?bo:bn,c=b.pow,a.domain(e.map(b));return d},d.range=d3.rebind(d,a.range),d.rangeRound=d3.rebind(d,a.rangeRound),d.interpolate=d3.rebind(d,a.interpolate),d.clamp=d3.rebind(d,a.clamp),d.nice=function(){a.domain(bi(a.domain(),bj));return d},d.ticks=function(){var d=a.domain(),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===bo){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(){return function(a){return a.toPrecision(1)}};return d},bn.pow=function(a){return Math.pow(10,a)},bo.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){function f
  2 +(b){return a(d(b))}var a=d3.scale.linear(),b=d3.scale.linear(),c=1,d=Number,e=d;f.invert=function(b){return e(a.invert(b))},f.domain=function(g){if(!arguments.length)return a.domain().map(e);var h=(g[0]||g[1])<0?bq:bp;d=h(c),e=h(1/c),a.domain(g.map(d)),b.domain(g);return f},f.range=d3.rebind(f,a.range),f.rangeRound=d3.rebind(f,a.rangeRound),f.interpolate=d3.rebind(f,a.interpolate),f.clamp=d3.rebind(f,a.clamp),f.ticks=b.ticks,f.tickFormat=b.tickFormat,f.nice=function(){return f.domain(bi(f.domain(),bk))},f.exponent=function(a){if(!arguments.length)return c;var b=f.domain();c=a;return f.domain(b)};return f},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){function e(d){var e=d in b?b[d]:b[d]=a.push(d)-1;return c[e%c.length]}var a=[],b={},c=[],d=0;e.domain=function(c){if(!arguments.length)return a;a=c,b={};var d=-1,f=-1,g=a.length;while(++d<g)c=a[d],c in b||(b[c]=++f);return e},e.range=function(a){if(!arguments.length)return c;c=a;return e},e.rangePoints=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length-1+f);c=a.length==1?[(g+h)/2]:d3.range(g+i*f/2,h+i/2,i),d=0;return e},e.rangeBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=(h-g)/(a.length+f);c=d3.range(g+i*f,h,i),d=i*(1-f);return e},e.rangeRoundBands=function(b,f){arguments.length<2&&(f=0);var g=b[0],h=b[1],i=h-g,j=Math.floor(i/(a.length+f)),k=i-(a.length-f)*j;c=d3.range(g+Math.round(k/2),h,j),d=Math.round(j*(1-f));return e},e.rangeBand=function(){return d};return e},d3.scale.category10=function(){return d3.scale.ordinal().range(br)},d3.scale.category20=function(){return d3.scale.ordinal().range(bs)},d3.scale.category20b=function(){return d3.scale.ordinal().range(bt)},d3.scale.category20c=function(){return d3.scale.ordinal().range(bu)};var br=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],bs=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],bt=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],bu=["#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 e(a){if(isNaN(a=+a))return NaN;return b[d3.bisect(c,a)]}function d(){var d=0,e=a.length,f=b.length,g;c.length=Math.max(0,f-1);while(++d<f)c[d-1]=(g=e*d/f)%1?a[~~g]:(a[g=~~g]+a[g-1])/2}var a=[],b=[],c=[];e.domain=function(b){if(!arguments.length)return a;a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d();return e},e.range=function(a){if(!arguments.length)return b;b=a,d();return e},e.quantiles=function(){return c};return e},d3.scale.quantize=function(){function f(b){return e[Math.max(0,Math.min(d,Math.floor(c*(b-a))))]}var a=0,b=1,c=2,d=1,e=[0,1];f.domain=function(d){if(!arguments.length)return[a,b];a=d[0],b=d[1],c=e.length/(b-a);return f},f.range=function(g){if(!arguments.length)return e;e=g,c=e.length/(b-a),d=e.length-1;return f};return f},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+bv,h=d.apply(this,arguments)+bv,i=h-g,j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=bw?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+ -e+"A"+e+","+e+" 0 1,1 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=bx,b=by,c=bz,d=bA;e.innerRadius=function(b){if(!arguments.length)return a;a=d3.functor(b);return e},e.outerRadius=function(a){if(!arguments.length)return b;b=d3.functor(a);return e},e.startAngle=function(a){if(!arguments.length)return c;c=d3.functor(a);return e},e.endAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return e},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+bv;return[Math.cos(f)*e,Math.sin(f)*e]};return e};var bv=-Math.PI/2,bw=2*Math.PI-1e-6;d3.svg.line=function(){function f(c){return c.length<1?null:"M"+d(bB(this,c,a,b),e)}var a=bC,b=bD,c="linear",d=bE[c],e=.7;f.x=function(b){if(!arguments.length)return a;a=b;return f},f.y=function(a){if(!arguments.length)return b;b=a;return f},f.interpolate=function(a){if(!arguments.length)return c;d=bE[c=a];return f},f.tension=function(a){if(!arguments.length)return e;e=a;return f};return f};var bE={linear:bF,"step-before":bG,"step-after":bH,basis:bN,"basis-open":bO,"basis-closed":bP,cardinal:bK,"cardinal-open":bI,"cardinal-closed":bJ,monotone:bY},bR=[0,2/3,1/3,0],bS=[0,1/3,2/3,0],bT=[0,1/6,2/3,1/6];d3.svg.area=function(){function g(d){return d.length<1?null:"M"+e(bB(this,d,a,c),f)+"L"+e(bB(this,d,a,b).reverse(),f)+"Z"}var a=bC,b=bZ,c=bD,d="linear",e=bE[d],f=.7;g.x=function(b){if(!arguments.length)return a;a=b;return g},g.y0=function(a){if(!arguments.length)return b;b=a;return g},g.y1=function(a){if(!arguments.length)return c;c=a;return g},g.interpolate=function(a){if(!arguments.length)return d;e=bE[d=a];return g},g.tension=function(a){if(!arguments.length)return f;f=a;return g};return g},d3.svg.chord=function(){function j(a,b,c,d){return"Q 0,0 "+d}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+bv,k=e.call(a,h,g)+bv;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}var a=b$,b=b_,c=ca,d=bz,e=bA;f.radius=function(a){if(!arguments.length)return c;c=d3.functor(a);return f},f.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return f},f.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return f},f.startAngle=function(a){if(!arguments.length)return d;d=d3.functor(a);return f},f.endAngle=function(a){if(!arguments.length)return e;e=d3.functor(a);return f};return f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];i=i.map(c);return"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=b$,b=b_,c=cd;d.source=function(b){if(!arguments.length)return a;a=d3.functor(b);return d},d.target=function(a){if(!arguments.length)return b;b=d3.functor(a);return d},d.projection=function(a){if(!arguments.length)return c;c=a;return d};return d},d3.svg.mouse=function(a){return cf(a,d3.event)};var ce=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(b){var c=d3.event.touches;return c?a(c).map(function(a){var c=cf(b,a);c.identifier=a.identifier;return c}):[]},d3.svg.symbol=function(){function c(c,d){return(ci[a.call(this,c,d)]||ci.circle)(b.call(this,c,d))}var a=ch,b=cg;c.type=function(b){if(!arguments.length)return a;a=d3.functor(b);return c},c.size=function(a){if(!arguments.length)return b;b=d3.functor(a);return c};return c};var ci={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*ck)),c=b*ck;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/cj),c=b*cj/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/cj),c=b*cj/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(ci);var cj=Math.sqrt(3),ck=Math.tan(30*Math.PI/180)})()
65 d3.time.js
... ... @@ -1,4 +1,6 @@
1 1 (function(){d3.time = {};
  2 +
  3 +var d3_time = Date;
2 4 d3.time.format = function(template) {
3 5 var n = template.length;
4 6
@@ -22,7 +24,7 @@ d3.time.format = function(template) {
22 24 }
23 25
24 26 format.parse = function(string) {
25   - var date = new Date(1900, 0, 1),
  27 + var date = new d3_time(1900, 0, 1),
26 28 i = d3_time_parse(date, template, string, 0);
27 29 if (i != string.length) return null;
28 30 if (date.hour12) {
@@ -85,7 +87,7 @@ var d3_time_formats = {
85 87 W: d3_time_weekNumberMonday,
86 88 x: d3.time.format("%m/%d/%y"),
87 89 X: d3.time.format("%H:%M:%S"),
88   - y: function(d) { return d3_time_zfill2(d.getYear() % 100); },
  90 + y: function(d) { return d3_time_zfill2(d.getFullYear() % 100); },
89 91 Y: function(d) { return d3_time_zfill4(d.getFullYear() % 10000); },
90 92 Z: d3_time_zone,
91 93 "%": function(d) { return "%"; }
@@ -288,17 +290,21 @@ var d3_time_amPmLookup = {
288 290 pm: 1
289 291 };
290 292
  293 +function d3_time_year(d) {
  294 + return new d3_time(d.getFullYear(), 0, 1);
  295 +}
  296 +
291 297 function d3_time_dayOfYear(d) {
292   - return d3_time_zfill3(1 + ~~((d - new Date(d.getFullYear(), 0, 1)) / 864e5));
  298 + return d3_time_zfill3(1 + ~~((d - d3_time_year(d)) / 864e5));
293 299 }
294 300
295 301 function d3_time_weekNumberSunday(d) {
296   - var d0 = new Date(d.getFullYear(), 0, 1);
  302 + var d0 = d3_time_year(d);
297 303 return d3_time_zfill2(~~(((d - d0) / 864e5 + d0.getDay()) / 7));
298 304 }
299 305
300 306 function d3_time_weekNumberMonday(d) {
301   - var d0 = new Date(d.getFullYear(), 0, 1);
  307 + var d0 = d3_time_year(d);
302 308 return d3_time_zfill2(~~(((d - d0) / 864e5 + (d0.getDay() + 6) % 7) / 7));
303 309 }
304 310
@@ -310,4 +316,53 @@ function d3_time_zone(d) {
310 316 zm = Math.abs(z) % 60;
311 317 return zs + d3_time_zfill2(zh) + d3_time_zfill2(zm);
312 318 }
  319 +d3.time.format.utc = function(template) {
  320 + var local = d3.time.format(template);
  321 +
  322 + function format(date) {
  323 + var utc = new d3_time_format_utc();
  324 + utc._ = date;
  325 + return local(utc);
  326 + }
  327 +
  328 + format.parse = function(string) {
  329 + try {
  330 + d3_time = d3_time_format_utc;
  331 + var date = local.parse(string);
  332 + return date && date._;
  333 + } finally {
  334 + d3_time = Date;
  335 + }
  336 + };
  337 +
  338 + format.toString = local.toString;
  339 +
  340 + return format;
  341 +};
  342 +
  343 +function d3_time_format_utc() {
  344 + this._ = new Date(Date.UTC.apply(this, arguments));
  345 +}
  346 +
  347 +d3_time_format_utc.prototype = {
  348 + getDate: function() { return this._.getUTCDate(); },
  349 + getDay: function() { return this._.getUTCDay(); },
  350 + getFullYear: function() { return this._.getUTCFullYear(); },
  351 + getHours: function() { return this._.getUTCHours(); },
  352 + getMilliseconds: function() { return this._.getUTCMilliseconds(); },
  353 + getMinutes: function() { return this._.getUTCMinutes(); },
  354 + getMonth: function() { return this._.getUTCMonth(); },
  355 + getSeconds: function() { return this._.getUTCSeconds(); },
  356 + getTimezoneOffset: function() { return 0; },
  357 + valueOf: function() { return this._.getTime(); },
  358 + setDate: function(x) { this._.setUTCDate(x); },
  359 + setDay: function(x) { this._.setUTCDay(x); },
  360 + setFullYear: function(x) { this._.setUTCFullYear(x); },
  361 + setHours: function(x) { this._.setUTCHours(x); },
  362 + setMilliseconds: function(x) { this._.setUTCMilliseconds(x); },
  363 + setMinutes: function(x) { this._.setUTCMinutes(x); },
  364 + setMonth: function(x) { this._.setUTCMonth(x); },
  365 + setSeconds: function(x) { this._.setUTCSeconds(x); }
  366 +};
  367 +d3.time.format.iso = d3.time.format.utc("%Y-%m-%dT%H:%M:%SZ");
313 368 })();
2  d3.time.min.js
... ... @@ -1 +1 @@
1   -(function(){function K(a){var c=a.getTimezoneOffset(),d=c>0?"-":"+",e=~~(Math.abs(c)/60),f=Math.abs(c)%60;return d+b(e)+b(f)}function J(a){var c=new Date(a.getFullYear(),0,1);return b(~~(((a-c)/864e5+(c.getDay()+6)%7)/7))}function I(a){var c=new Date(a.getFullYear(),0,1);return b(~~(((a-c)/864e5+c.getDay())/7))}function H(a){return c(1+~~((a-new Date(a.getFullYear(),0,1))/864e5))}function F(a,b,c){var d=G[b.substring(c,c+=2).toLowerCase()];return d==null?-1:(a.hour12pm=d,c)}function D(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setSeconds(+d[0]),c+=d[0].length):-1}function C(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setMinutes(+d[0]),c+=d[0].length):-1}function B(a,b,c){a.hour12=!0;return A(a,b,c)}function A(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setHours(+d[0]),c+=d[0].length):-1}function z(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setDate(+d[0]),c+=d[0].length):-1}function y(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setMonth(d[0]-1),c+=d[0].length):-1}function x(){return~~((new Date).getFullYear()/1e3)*1e3}function w(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+2));return d?(a.setFullYear(x()+ +d[0]),c+=d[0].length):-1}function v(a,b,c){E.lastIndex=0;var d=E.exec(b.substring(c,c+4));return d?(a.setFullYear(d[0]),c+=d[0].length):-1}function u(b,c,d){return a(b,f.X.toString(),c,d)}function t(b,c,d){return a(b,f.x.toString(),c,d)}function s(b,c,d){return a(b,f.c.toString(),c,d)}function o(a,b,c){p.lastIndex=0;var d=p.exec(b.substring(c,c+12));return d?(a.setMonth(q[d[0].toLowerCase()]),c+=d[0].length):-1}function m(a,b,c){var d=n[b.substring(c,c+=3).toLowerCase()];return d==null?-1:(a.setMonth(d),c)}function j(a,b,c){k.lastIndex=0;var d=k.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function h(a,b,c){return b.substring(c,c+=3).toLowerCase()in i?c:-1}function a(a,b,c,d){var e,f,h=0,i=b.length,j=c.length;while(h<i){if(d>=j)return-1;e=b.charCodeAt(h++);if(e==37){f=g[b.charAt(h++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}d3.time={},d3.time.format=function(b){function d(a){var d=[],e=-1,g=0,h,i;while(++e<c)b.charCodeAt(e)==37&&(d.push(b.substring(g,e),(i=f[h=b.charAt(++e)])?i(a):h),g=e+1);d.push(b.substring(g,e));return d.join("")}var c=b.length;d.parse=function(c){var d=new Date(1900,0,1),e=a(d,b,c,0);if(e!=c.length)return null;if(d.hour12){var f=d.getHours()%12;d.setHours(d.hour12pm?f+12:f)}delete d.hour12,delete d.hour12pm;return d},d.toString=function(){return b};return d};var b=d3.format("02d"),c=d3.format("03d"),d=d3.format("04d"),e=d3.format("2d"),f={a:function(a){return l[a.getDay()].substring(0,3)},A:function(a){return l[a.getDay()]},b:function(a){return r[a.getMonth()].substring(0,3)},B:function(a){return r[a.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(a){return b(a.getDate())},e:function(a){return e(a.getDate())},H:function(a){return b(a.getHours())},I:function(a){return b(a.getHours()%12||12)},j:H,m:function(a){return b(a.getMonth()+1)},M:function(a){return b(a.getMinutes())},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a){return b(a.getSeconds())},U:I,w:function(a){return a.getDay()},W:J,x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(a){return b(a.getYear()%100)},Y:function(a){return d(a.getFullYear()%1e4)},Z:K,"%":function(a){return"%"}},g={a:h,A:j,b:m,B:o,c:s,d:z,e:z,H:A,I:B,m:y,M:C,p:F,S:D,x:t,X:u,y:w,Y:v},i={sun:3,mon:3,tue:3,wed:3,thu:3,fri:3,sat:3},k=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/ig,l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},p=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,q={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},r=["January","February","March","April","May","June","July","August","September","October","November","December"],E=/\s*\d+/,G={am:0,pm:1}})()
  1 +(function(){function N(){this._=new Date(Date.UTC.apply(this,arguments))}function M(a){var b=a.getTimezoneOffset(),d=b>0?"-":"+",e=~~(Math.abs(b)/60),f=Math.abs(b)%60;return d+c(e)+c(f)}function L(a){var b=I(a);return c(~~(((a-b)/864e5+(b.getDay()+6)%7)/7))}function K(a){var b=I(a);return c(~~(((a-b)/864e5+b.getDay())/7))}function J(a){return d(1+~~((a-I(a))/864e5))}function I(b){return new a(b.getFullYear(),0,1)}function G(a,b,c){var d=H[b.substring(c,c+=2).toLowerCase()];return d==null?-1:(a.hour12pm=d,c)}function E(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setSeconds(+d[0]),c+=d[0].length):-1}function D(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setMinutes(+d[0]),c+=d[0].length):-1}function C(a,b,c){a.hour12=!0;return B(a,b,c)}function B(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setHours(+d[0]),c+=d[0].length):-1}function A(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setDate(+d[0]),c+=d[0].length):-1}function z(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setMonth(d[0]-1),c+=d[0].length):-1}function y(){return~~((new Date).getFullYear()/1e3)*1e3}function x(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+2));return d?(a.setFullYear(y()+ +d[0]),c+=d[0].length):-1}function w(a,b,c){F.lastIndex=0;var d=F.exec(b.substring(c,c+4));return d?(a.setFullYear(d[0]),c+=d[0].length):-1}function v(a,c,d){return b(a,g.X.toString(),c,d)}function u(a,c,d){return b(a,g.x.toString(),c,d)}function t(a,c,d){return b(a,g.c.toString(),c,d)}function p(a,b,c){q.lastIndex=0;var d=q.exec(b.substring(c,c+12));return d?(a.setMonth(r[d[0].toLowerCase()]),c+=d[0].length):-1}function n(a,b,c){var d=o[b.substring(c,c+=3).toLowerCase()];return d==null?-1:(a.setMonth(d),c)}function k(a,b,c){l.lastIndex=0;var d=l.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function i(a,b,c){return b.substring(c,c+=3).toLowerCase()in j?c:-1}function b(a,b,c,d){var e,f,g=0,i=b.length,j=c.length;while(g<i){if(d>=j)return-1;e=b.charCodeAt(g++);if(e==37){f=h[b.charAt(g++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}d3.time={};var a=Date;d3.time.format=function(c){function e(a){var b=[],e=-1,f=0,h,i;while(++e<d)c.charCodeAt(e)==37&&(b.push(c.substring(f,e),(i=g[h=c.charAt(++e)])?i(a):h),f=e+1);b.push(c.substring(f,e));return b.join("")}var d=c.length;e.parse=function(d){var e=new a(1900,0,1),f=b(e,c,d,0);if(f!=d.length)return null;if(e.hour12){var g=e.getHours()%12;e.setHours(e.hour12pm?g+12:g)}delete e.hour12,delete e.hour12pm;return e},e.toString=function(){return c};return e};var c=d3.format("02d"),d=d3.format("03d"),e=d3.format("04d"),f=d3.format("2d"),g={a:function(a){return m[a.getDay()].substring(0,3)},A:function(a){return m[a.getDay()]},b:function(a){return s[a.getMonth()].substring(0,3)},B:function(a){return s[a.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(a){return c(a.getDate())},e:function(a){return f(a.getDate())},H:function(a){return c(a.getHours())},I:function(a){return c(a.getHours()%12||12)},j:J,m:function(a){return c(a.getMonth()+1)},M:function(a){return c(a.getMinutes())},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a){return c(a.getSeconds())},U:K,w:function(a){return a.getDay()},W:L,x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(a){return c(a.getFullYear()%100)},Y:function(a){return e(a.getFullYear()%1e4)},Z:M,"%":function(a){return"%"}},h={a:i,A:k,b:n,B:p,c:t,d:A,e:A,H:B,I:C,m:z,M:D,p:G,S:E,x:u,X:v,y:x,Y:w},j={sun:3,mon:3,tue:3,wed:3,thu:3,fri:3,sat:3},l=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/ig,m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11},q=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,r={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11},s=["January","February","March","April","May","June","July","August","September","October","November","December"],F=/\s*\d+/,H={am:0,pm:1};d3.time.format.utc=function(b){function d(a){var b=new N;b._=a;return c(b)}var c=d3.time.format(b);d.parse=function(b){try{a=N;var d=c.parse(b);return d&&d._}finally{a=Date}},d.toString=c.toString;return d},N.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.getTime()},setDate:function(a){this._.setUTCDate(a)},setDay:function(a){this._.setUTCDay(a)},setFullYear:function(a){this._.setUTCFullYear(a)},setHours:function(a){this._.setUTCHours(a)},setMilliseconds:function(a){this._.setUTCMilliseconds(a)},setMinutes:function(a){this._.setUTCMinutes(a)},setMonth:function(a){this._.setUTCMonth(a)},setSeconds:function(a){this._.setUTCSeconds(a)}},d3.time.format.iso=d3.time.format.utc("%Y-%m-%dT%H:%M:%SZ")})()
11 examples/voroboids/voroboids.js
... ... @@ -1,6 +1,6 @@
1 1 var w = 960,
2 2 h = 500,
3   - mouse = [0, 0],
  3 + mouse = [null, null],
4 4 fill = d3.scale.linear().domain([0, 1e4]).range(["brown", "steelblue"]);
5 5
6 6 // Initialise boids.
@@ -16,6 +16,8 @@ var vertices = boids.map(function(boid) {
16 16 return boid(boids);
17 17 });
18 18
  19 +d3.select(window).on("blur", nullGravity);
  20 +
19 21 var svg = d3.select("#vis")
20 22 .append("svg:svg")
21 23 .attr("width", w)
@@ -25,7 +27,8 @@ var svg = d3.select("#vis")
25 27 var m = d3.svg.mouse(this);
26 28 mouse[0] = m[0];
27 29 mouse[1] = m[1];
28   - });
  30 + })
  31 + .on("mouseout", nullGravity);
29 32
30 33 svg.selectAll("path")
31 34 .data(d3.geom.voronoi(vertices))
@@ -56,3 +59,7 @@ d3.timer(function() {
56 59 .attr("d", function(d) { return "M" + d.join("L") + "Z"; })
57 60 .style("fill", function(d) { return fill((d3.geom.polygon(d).area())); });
58 61 });
  62 +
  63 +function nullGravity() {
  64 + mouse[0] = mouse[1] = null;
  65 +}
2  src/core/core.js
... ... @@ -1 +1 @@
1   -d3 = {version: "1.20.3"}; // semver
  1 +d3 = {version: "1.21.0"}; // semver
14 src/core/sum.js
... ... @@ -0,0 +1,14 @@
  1 +d3.sum = function(array, f) {
  2 + var s = 0,
  3 + n = array.length,
  4 + a,
  5 + i = -1;
  6 +
  7 + if (arguments.length === 1) {
  8 + while (++i < n) if (!isNaN(a = +array[i])) s += a;
  9 + } else {
  10 + while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
  11 + }
  12 +
  13 + return s;
  14 +};
1  src/time/format-iso.js
... ... @@ -0,0 +1 @@
  1 +d3.time.format.iso = d3.time.format.utc("%Y-%m-%dT%H:%M:%SZ");
48 src/time/format-utc.js
... ... @@ -0,0 +1,48 @@
  1 +d3.time.format.utc = function(template) {
  2 + var local = d3.time.format(template);
  3 +
  4 + function format(date) {
  5 + var utc = new d3_time_format_utc();
  6 + utc._ = date;
  7 + return local(utc);
  8 + }
  9 +
  10 + format.parse = function(string) {
  11 + try {
  12 + d3_time = d3_time_format_utc;
  13 + var date = local.parse(string);
  14 + return date && date._;
  15 + } finally {
  16 + d3_time = Date;
  17 + }
  18 + };
  19 +
  20 + format.toString = local.toString;
  21 +
  22 + return format;
  23 +};
  24 +
  25 +function d3_time_format_utc() {
  26 + this._ = new Date(Date.UTC.apply(this, arguments));
  27 +}
  28 +
  29 +d3_time_format_utc.prototype = {
  30 + getDate: function() { return this._.getUTCDate(); },
  31 + getDay: function() { return this._.getUTCDay(); },
  32 + getFullYear: function() { return this._.getUTCFullYear(); },
  33 + getHours: function() { return this._.getUTCHours(); },
  34 + getMilliseconds: function() { return this._.getUTCMilliseconds(); },
  35 + getMinutes: function() { return this._.getUTCMinutes(); },
  36 + getMonth: function() { return this._.getUTCMonth(); },
  37 + getSeconds: function() { return this._.getUTCSeconds(); },
  38 + getTimezoneOffset: function() { return 0; },
  39 + valueOf: function() { return this._.getTime(); },
  40 + setDate: function(x) { this._.setUTCDate(x); },
  41 + setDay: function(x) { this._.setUTCDay(x); },
  42 + setFullYear: function(x) { this._.setUTCFullYear(x); },
  43 + setHours: function(x) { this._.setUTCHours(x); },
  44 + setMilliseconds: function(x) { this._.setUTCMilliseconds(x); },
  45 + setMinutes: function(x) { this._.setUTCMinutes(x); },
  46 + setMonth: function(x) { this._.setUTCMonth(x); },
  47 + setSeconds: function(x) { this._.setUTCSeconds(x); }
  48 +};
14 src/time/format.js
@@ -21,7 +21,7 @@ d3.time.format = function(template) {
21 21 }
22 22
23 23 format.parse = function(string) {
24   - var date = new Date(1900, 0, 1),
  24 + var date = new d3_time(1900, 0, 1),
25 25 i = d3_time_parse(date, template, string, 0);
26 26 if (i != string.length) return null;
27 27 if (date.hour12) {
@@ -84,7 +84,7 @@ var d3_time_formats = {
84 84 W: d3_time_weekNumberMonday,
85 85 x: d3.time.format("%m/%d/%y"),
86 86 X: d3.time.format("%H:%M:%S"),
87   - y: function(d) { return d3_time_zfill2(d.getYear() % 100); },
  87 + y: function(d) { return d3_time_zfill2(d.getFullYear() % 100); },
88 88 Y: function(d) { return d3_time_zfill4(d.getFullYear() % 10000); },
89 89 Z: d3_time_zone,
90 90 "%": function(d) { return "%"; }
@@ -287,17 +287,21 @@ var d3_time_amPmLookup = {
287 287 pm: 1
288 288 };
289 289
  290 +function d3_time_year(d) {
  291 + return new d3_time(d.getFullYear(), 0, 1);
  292 +}
  293 +
290 294 function d3_time_dayOfYear(d) {
291   - return d3_time_zfill3(1 + ~~((d - new Date(d.getFullYear(), 0, 1)) / 864e5));
  295 + return d3_time_zfill3(1 + ~~((d - d3_time_year(d)) / 864e5));
292 296 }
293 297
294 298 function d3_time_weekNumberSunday(d) {
295   - var d0 = new Date(d.getFullYear(), 0, 1);
  299 + var d0 = d3_time_year(d);
296 300 return d3_time_zfill2(~~(((d - d0) / 864e5 + d0.getDay()) / 7));
297 301 }
298 302
299 303 function d3_time_weekNumberMonday(d) {
300   - var d0 = new Date(d.getFullYear(), 0, 1);
  304 + var d0 = d3_time_year(d);
301 305 return d3_time_zfill2(~~(((d - d0) / 864e5 + (d0.getDay() + 6) % 7) / 7));
302 306 }
303 307
2  src/time/time.js
... ... @@ -1 +1,3 @@
1 1 d3.time = {};
  2 +
  3 +var d3_time = Date;
32 tests/test-max.js
@@ -7,34 +7,34 @@ function max(array) {
7 7 }
8 8
9 9 console.log("max:");
10   -console.log(" [1] -> " + max([1]))
  10 +console.log(" [1] -> " + max([1]));
11 11 console.log(" [5, 1, 2, 3, 4] -> " + max([5, 1, 2, 3, 4]));
12   -console.log(" [\"a\", \"b\", \"c\"] -> " + max(["c", "a", "b"]))
13   -console.log(" [\"20\", \"3\"] -> " + max(["20", "3"]))
14   -console.log(" [\"3\", \"20\"] -> " + max(["3", "20"]))
15   -console.log(" [20, 3] -> " + max([20, 3]))
16   -console.log(" [3, 20] -> " + max([3, 20]))
  12 +console.log(" [\"a\", \"b\", \"c\"] -> " + max(["c", "a", "b"]));
  13 +console.log(" [\"20\", \"3\"] -> " + max(["20", "3"]));
  14 +console.log(" [\"3\", \"20\"] -> " + max(["3", "20"]));
  15 +console.log(" [20, 3] -> " + max([20, 3]));
  16 +console.log(" [3, 20] -> " + max([3, 20]));
17 17 console.log("");
18 18
19 19 console.log("max of empty array is undefined:");
20   -console.log(" [] -> " + max([]))
21   -console.log(" [null] -> " + max([null]))
22   -console.log(" [undefined] -> " + max([undefined]))
23   -console.log(" [NaN] -> " + max([NaN]))
24   -console.log(" [NaN, NaN] -> " + max([NaN, NaN]))
  20 +console.log(" [] -> " + max([]));
  21 +console.log(" [null] -> " + max([null]));
  22 +console.log(" [undefined] -> " + max([undefined]));
  23 +console.log(" [NaN] -> " + max([NaN]));
  24 +console.log(" [NaN, NaN] -> " + max([NaN, NaN]));
25 25 console.log("");
26 26
27 27 console.log("max ignores null, undefined, and NaN:");
28 28 console.log(" [NaN, 1, 2, 3, 4, 5] -> " + max([NaN, 1, 2, 3, 4, 5]));
29 29 console.log(" [1, 2, 3, 4, 5, NaN] -> " + max([1, 2, 3, 4, 5, NaN]));
30   -console.log(" [10, null, 3, undefined, 3, NaN] -> " + max([10, null, 3, undefined, 5, NaN]));
  30 +console.log(" [10, null, 3, undefined, 5, NaN] -> " + max([10, null, 3, undefined, 5, NaN]));
31 31 console.log("");
32 32
33 33 console.log("max compares heterogenous types as numbers:");
34   -console.log(" [20, \"3\"] -> " + max([20, "3"]))
35   -console.log(" [\"20\", 3] -> " + max(["20", 3]))
36   -console.log(" [3, \"20\"] -> " + max([3, "20"]))
37   -console.log(" [\"3\", 20] -> " + max(["3", 20]))
  34 +console.log(" [20, \"3\"] -> " + max([20, "3"]));
  35 +console.log(" [\"20\", 3] -> " + max(["20", 3]));
  36 +console.log(" [3, \"20\"] -> " + max([3, "20"]));
  37 +console.log(" [\"3\", 20] -> " + max(["3", 20]));
38 38 console.log("");
39 39
40 40 console.log("max applies accessor function:");
2  tests/test-max.out
@@ -17,7 +17,7 @@ max of empty array is undefined:
17 17 max ignores null, undefined, and NaN:
18 18 [NaN, 1, 2, 3, 4, 5] -> 5
19 19 [1, 2, 3, 4, 5, NaN] -> 5
20   - [10, null, 3, undefined, 3, NaN] -> 10
  20 + [10, null, 3, undefined, 5, NaN] -> 10
21 21
22 22 max compares heterogenous types as numbers:
23 23 [20, "3"] -> 20
32 tests/test-min.js
@@ -7,34 +7,34 @@ function min(array) {
7 7 }
8 8
9 9 console.log("min:");
10   -console.log(" [1] -> " + min([1]))
  10 +console.log(" [1] -> " + min([1]));
11 11 console.log(" [5, 1, 2, 3, 4] -> " + min([5, 1, 2, 3, 4]));
12   -console.log(" [\"a\", \"b\", \"c\"] -> " + min(["c", "a", "b"]))
13   -console.log(" [\"20\", \"3\"] -> " + min(["20", "3"]))
14   -console.log(" [\"3\", \"20\"] -> " + min(["3", "20"]))
15   -console.log(" [20, 3] -> " + min([20, 3]))
16   -console.log(" [3, 20] -> " + min([3, 20]))
  12 +console.log(" [\"a\", \"b\", \"c\"] -> " + min(["c", "a", "b"]));
  13 +console.log(" [\"20\", \"3\"] -> " + min(["20", "3"]));
  14 +console.log(" [\"3\", \"20\"] -> " + min(["3", "20"]));
  15 +console.log(" [20, 3] -> " + min([20, 3]));
  16 +console.log(" [3, 20] -> " + min([3, 20]));
17 17 console.log("");
18 18
19 19 console.log("min of empty array is undefined:");
20   -console.log(" [] -> " + min([]))
21   -console.log(" [null] -> " + min([null]))
22   -console.log(" [undefined] -> " + min([undefined]))
23   -console.log(" [NaN] -> " + min([NaN]))
24   -console.log(" [NaN, NaN] -> " + min([NaN, NaN]))
  20 +console.log(" [] -> " + min([]));
  21 +console.log(" [null] -> " + min([null]));
  22 +console.log(" [undefined] -> " + min([undefined]));
  23 +console.log(" [NaN] -> " + min([NaN]));
  24 +console.log(" [NaN, NaN] -> " + min([NaN, NaN]));
25 25 console.log("");
26 26
27 27 console.log("min ignores null, undefined, and NaN:");
28 28 console.log(" [NaN, 1, 2, 3, 4, 5] -> " + min([NaN, 1, 2, 3, 4, 5]));
29 29 console.log(" [1, 2, 3, 4, 5, NaN] -> " + min([1, 2, 3, 4, 5, NaN]));
30   -console.log(" [10, null, 3, undefined, 3, NaN] -> " + min([10, null, 3, undefined, 5, NaN]));
  30 +console.log(" [10, null, 3, undefined, 5, NaN] -> " + min([10, null, 3, undefined, 5, NaN]));
31 31 console.log("");
32 32
33 33 console.log("min compares heterogenous types as numbers:");
34   -console.log(" [20, \"3\"] -> " + min([20, "3"]))
35   -console.log(" [\"20\", 3] -> " + min(["20", 3]))
36   -console.log(" [3, \"20\"] -> " + min([3, "20"]))
37   -console.log(" [\"3\", 20] -> " + min(["3", 20]))
  34 +console.log(" [20, \"3\"] -> " + min([20, "3"]));
  35 +console.log(" [\"20\", 3] -> " + min(["20", 3]));
  36 +console.log(" [3, \"20\"] -> " + min([3, "20"]));
  37 +console.log(" [\"3\", 20] -> " + min(["3", 20]));
38 38 console.log("");
39 39
40 40 console.log("min applies accessor function:");
2  tests/test-min.out
@@ -17,7 +17,7 @@ min of empty array is undefined:
17 17 min ignores null, undefined, and NaN:
18 18 [NaN, 1, 2, 3, 4, 5] -> 1
19 19 [1, 2, 3, 4, 5, NaN] -> 1
20   - [10, null, 3, undefined, 3, NaN] -> 3
  20 + [10, null, 3, undefined, 5, NaN] -> 3
21 21
22 22 min compares heterogenous types as numbers:
23 23 [20, "3"] -> "3"
31 tests/test-sum.js
... ... @@ -0,0 +1,31 @@
  1 +require("./../lib/env-js/envjs/node");
  2 +require("./../d3");
  3 +
  4 +console.log("sum:");
  5 +console.log(" [] -> " + d3.sum([]));
  6 +console.log(" [1] -> " + d3.sum([1]));
  7 +console.log(" [5, 1, 2, 3, 4] -> " + d3.sum([5, 1, 2, 3, 4]));
  8 +console.log(" [\"a\", \"b\", \"c\"] -> " + d3.sum(["c", "a", "b"]));
  9 +console.log(" [\"20\", \"3\"] -> " + d3.sum(["20", "3"]));
  10 +console.log(" [\"3\", \"20\"] -> " + d3.sum(["3", "20"]));
  11 +console.log(" [20, 3] -> " + d3.sum([20, 3]));
  12 +console.log(" [3, 20] -> " + d3.sum([3, 20]));
  13 +console.log("");
  14 +
  15 +console.log("sum ignores null, undefined, and NaN:");
  16 +console.log(" [NaN, 1, 2, 3, 4, 5] -> " + d3.sum([NaN, 1, 2, 3, 4, 5]));
  17 +console.log(" [1, 2, 3, 4, 5, NaN] -> " + d3.sum([1, 2, 3, 4, 5, NaN]));
  18 +console.log(" [10, null, 3, undefined, 5, NaN] -> " + d3.sum([10, null, 3, undefined, 5, NaN]));
  19 +console.log("");
  20 +
  21 +console.log("sum treats heterogenous types as numbers:");
  22 +console.log(" [20, \"3\"] -> " + d3.sum([20, "3"]));
  23 +console.log(" [\"20\", 3] -> " + d3.sum(["20", 3]));
  24 +console.log(" [3, \"20\"] -> " + d3.sum([3, "20"]));
  25 +console.log(" [\"3\", 20] -> " + d3.sum(["3", 20]));
  26 +console.log("");
  27 +
  28 +console.log("sum applies accessor function:");
  29 +console.log(" [1, 2, 3, 4, 5], [2, 4, 6, 8, 10] -> " + d3.sum([[1, 2, 3, 4, 5], [2, 4, 6, 8, 10]], function(d) { return d3.sum(d); }));
  30 +console.log(" [1, 2, 3, 4, 5] -> " + d3.sum([1, 2, 3, 4, 5], function(d, i) { return i; }));
  31 +console.log("");
25 tests/test-sum.out
... ... @@ -0,0 +1,25 @@
  1 +sum:
  2 + [] -> 0
  3 + [1] -> 1
  4 + [5, 1, 2, 3, 4] -> 15
  5 + ["a", "b", "c"] -> 0
  6 + ["20", "3"] -> 23
  7 + ["3", "20"] -> 23
  8 + [20, 3] -> 23
  9 + [3, 20] -> 23
  10 +
  11 +sum ignores null, undefined, and NaN:
  12 + [NaN, 1, 2, 3, 4, 5] -> 15
  13 + [1, 2, 3, 4, 5, NaN] -> 15
  14 + [10, null, 3, undefined, 5, NaN] -> 18
  15 +
  16 +sum treats heterogenous types as numbers:
  17 + [20, "3"] -> 23
  18 + ["20", 3] -> 23
  19 + [3, "20"] -> 23
  20 + ["3", 20] -> 23
  21 +
  22 +sum applies accessor function:
  23 + [1, 2, 3, 4, 5], [2, 4, 6, 8, 10] -> 45
  24 + [1, 2, 3, 4, 5] -> 10
  25 +
8 tests/test-time-format-iso.js
... ... @@ -0,0 +1,8 @@
  1 +require("./../lib/env-js/envjs/node");
  2 +require("./../d3");
  3 +require("./../d3.time");
  4 +
  5 +console.log("format:");
  6 +console.log(" 01/01/1990 00:00:00 ->", d3.time.format.iso(new Date(Date.UTC(1990, 0, 1))));
  7 +console.log(" 12/31/2011 23:59:59 ->", d3.time.format.iso(new Date(Date.UTC(2011, 11, 31, 23, 59, 59))));
  8 +console.log("");
4 tests/test-time-format-iso.out
... ... @@ -0,0 +1,4 @@
  1 +format:
  2 + 01/01/1990 00:00:00 -> 1990-01-01T00:00:00Z
  3 + 12/31/2011 23:59:59 -> 2011-12-31T23:59:59Z
  4 +
22 tests/test-time-format-utc.js
... ... @@ -0,0 +1,22 @@
  1 +require("./../lib/env-js/envjs/node");
  2 +require("./../d3");
  3 +require("./../d3.time");
  4 +
  5 +var formats = [
  6 + "a", "A", "b", "B", "c", "d", "e", "H", "I", "j", "m", "M",
  7 + "p", "S", "U", "w", "W", "x", "X", "y", "Y", "Z", "%"
  8 +];
  9 +
  10 +var now = new Date(Date.UTC(1990, 0, 1));
  11 +console.log("format 01/01/1990 00:00:00:");
  12 +formats.forEach(function(f) {
  13 + console.log(" " + f + ":", d3.time.format.utc("%" + f)(now));
  14 +});
  15 +console.log("");
  16 +
  17 +var now = new Date(Date.UTC(2011, 11, 31, 23, 59, 59));
  18 +console.log("format 12/31/2011 23:59:59:");
  19 +formats.forEach(function(f) {
  20 + console.log(" " + f + ":", d3.time.format.utc("%" + f)(now));
  21 +});
  22 +console.log("");
50 tests/test-time-format-utc.out
... ... @@ -0,0 +1,50 @@
  1 +format 01/01/1990 00:00:00:
  2 + a: Mon
  3 + A: Monday
  4 + b: Jan
  5 + B: January
  6 + c: Mon Jan 1 00:00:00 1990
  7 + d: 01
  8 + e: 1
  9 + H: 00
  10 + I: 12
  11 + j: 001
  12 + m: 01
  13 + M: 00
  14 + p: AM
  15 + S: 00
  16 + U: 00
  17 + w: 1
  18 + W: 00
  19 + x: 01/01/90
  20 + X: 00:00:00
  21 + y: 90
  22 + Y: 1990
  23 + Z: +0000
  24 + %: %
  25 +
  26 +format 12/31/2011 23:59:59:
  27 + a: Sat
  28 + A: Saturday
  29 + b: Dec
  30 + B: December
  31 + c: Sat Dec 31 23:59:59 2011
  32 + d: 31
  33 + e: 31
  34 + H: 23
  35 + I: 11
  36 + j: 365
  37 + m: 12
  38 + M: 59
  39 + p: PM
  40 + S: 59
  41 + U: 52
  42 + w: 6
  43 + W: 52
  44 + x: 12/31/11
  45 + X: 23:59:59
  46 + y: 11
  47 + Y: 2011
  48 + Z: +0000
  49 + %: %
  50 +
10 tests/test-time-parse-iso.js
... ... @@ -0,0 +1,10 @@
  1 +require("./../lib/env-js/envjs/node");
  2 +require("./../d3");
  3 +require("./../d3.time");
  4 +
  5 +var f = d3.time.format.utc("%c");
  6 +
  7 +console.log("parse:");
  8 +console.log(" 1990-01-01T00:00:00Z ->", f(d3.time.format.iso.parse("1990-01-01T00:00:00Z")));
  9 +console.log(" 2011-12-31T23:59:59Z ->", f(d3.time.format.iso.parse("2011-12-31T23:59:59Z")));
  10 +console.log("");
4 tests/test-time-parse-iso.out
... ... @@ -0,0 +1,4 @@
  1 +parse:
  2 + 1990-01-01T00:00:00Z -> Mon Jan 1 00:00:00 1990
  3 + 2011-12-31T23:59:59Z -> Sat Dec 31 23:59:59 2011
  4 +
80 tests/test-time-parse-utc.js
... ... @@ -0,0 +1,80 @@
  1 +require("./../lib/env-js/envjs/node");
  2 +require("./../d3");
  3 +require("./../d3.time");
  4 +
  5 +var F = d3.time.format.utc,
  6 + f = d3.time.format("%c");
  7 +
  8 +console.log("parse a m/d/Y:");
  9 +console.log(" Sun 01/01/1990:", f(F("%a %m/%d/%Y").parse("Sun 01/01/1990")));
  10 +console.log(" Wed 01/01/1990:", f(F("%a %m/%d/%Y").parse("Wed 01/01/1990")));
  11 +console.log(" XXX 01/01/1990:", F("%a %m/%d/%Y").parse("XXX 01/01/1990"));
  12 +console.log("");
  13 +
  14 +console.log("parse A m/d/Y:");
  15 +console.log(" Sunday 01/01/1990:", f(F("%A %m/%d/%Y").parse("Sunday 01/01/1990")));
  16 +console.log(" Wednesday 01/01/1990:", f(F("%A %m/%d/%Y").parse("Wednesday 01/01/1990")));
  17 +console.log(" Caturday 01/01/1990:", F("%A %m/%d/%Y").parse("Caturday 01/01/1990"));
  18 +console.log("");
  19 +
  20 +console.log("parse m/d/y:");
  21 +console.log(" 1/1/90:", f(F("%m/%d/%y").parse("1/1/90")));
  22 +console.log(" 1/1/10:", f(F("%m/%d/%y").parse("1/1/10")));
  23 +console.log("");
  24 +
  25 +console.log("parse x:");
  26 +console.log(" 1/1/90:", f(F("%x").parse("1/1/90")));
  27 +console.log(" 1/1/10:", f(F("%x").parse("1/1/10")));
  28 +console.log("");
  29 +
  30 +console.log("parse b d Y:");
  31 +console.log(" jan 01, 1990:", f(F("%b %d, %Y").parse("jan 01, 1990")));
  32 +console.log(" jan 1, 1990:", f(F("%b %d, %Y").parse("jan 1, 1990")));
  33 +console.log(" 1 Feb., 1990:", f(F("%d %b., %Y").parse("1 Feb., 1990")));
  34 +console.log(" 01 Feb., 1990:", f(F("%d %b., %Y").parse("01 Feb., 1990")));
  35 +console.log(" 1 Feb., 1990:", f(F("%d %b., %Y").parse(" 1 Feb., 1990")));
  36 +console.log(" 1 Feb., 1990:", f(F(" %d %b., %Y").parse(" 1 Feb., 1990")));
  37 +console.log(" Moy 1 1990:", F("%b %d %Y").parse("Moy 1 1990"));
  38 +console.log("");
  39 +
  40 +console.log("parse B d Y:");
  41 +console.log(" January 01, 1990:", f(F("%B %d, %Y").parse("January 01, 1990")));
  42 +console.log(" january 1, 1990:", f(F("%B %d, %Y").parse("january 1, 1990")));
  43 +console.log(" 1 February, 1990:", f(F("%d %B, %Y").parse("1 February, 1990")));
  44 +console.log(" 01 February, 1990:", f(F("%d %B, %Y").parse("01 February, 1990")));
  45 +console.log(" 1 February, 1990:", f(F("%d %B, %Y").parse(" 1 February, 1990")));
  46 +console.log(" 1 February, 1990:", f(F(" %d %B, %Y").parse(" 1 February, 1990")));
  47 +console.log(" Juin 1 1990:", F("%B %d %Y").parse("Join 1 1990"));
  48 +console.log("");
  49 +
  50 +console.log("parse c:");
  51 +console.log(" Mon Jan 1 00:00:00 1990:", f(F("%c").parse("Mon Jan 1 00:00:00 1990")));
  52 +console.log(" Sun Jan 1 00:00:00 1990:", f(F("%c").parse("Sun Jan 1 00:00:00 1990")));
  53 +console.log(" Mon Jan 01 00:00:00 1990:", f(F("%c").parse("Mon Jan 01 00:00:00 1990")));
  54 +console.log(" Mon Jan 1 00:00:00 1990:", f(F("%c").parse("Mon Jan 1 00:00:00 1990")));
  55 +console.log(" Mon Jan 1 0:0:0 1990:", f(F("%c").parse("Mon Jan 1 0:0:0 1990")));
  56 +console.log("");
  57 +
  58 +console.log("parse H M S:");
  59 +console.log(" 00:00:00:", f(F("%H:%M:%S").parse("00:00:00")));
  60 +console.log(" 11:59:59:", f(F("%H:%M:%S").parse("11:59:59")));
  61 +console.log(" 12:00:00:", f(F("%H:%M:%S").parse("12:00:00")));
  62 +console.log(" 12:00:01:", f(F("%H:%M:%S").parse("12:00:01")));
  63 +console.log(" 23:59:59:", f(F("%H:%M:%S").parse("23:59:59")));
  64 +console.log("");
  65 +
  66 +console.log("parse X:");
  67 +console.log(" 00:00:00:", f(F("%X").parse("00:00:00")));
  68 +console.log(" 11:59:59:", f(F("%X").parse("11:59:59")));
  69 +console.log(" 12:00:00:", f(F("%X").parse("12:00:00")));
  70 +console.log(" 12:00:01:", f(F("%X").parse("12:00:01")));
  71 +console.log(" 23:59:59:", f(F("%X").parse("23:59:59")));
  72 +console.log("");
  73 +
  74 +console.log("parse I M S p:");
  75 +console.log(" 12:00:00 am:", f(F("%I:%M:%S %p").parse("12:00:00 am")));
  76 +console.log(" 11:59:59 AM:", f(F("%I:%M:%S %p").parse("11:59:59 AM")));
  77 +console.log(" 12:00:00 pm:", f(F("%I:%M:%S %p").parse("12:00:00 pm")));
  78 +console.log(" 12:00:01 pm:", f(F("%I:%M:%S %p").parse("12:00:01 pm")));
  79 +console.log(" 11:59:59 PM:", f(F("%I:%M:%S %p").parse("11:59:59 PM")));
  80 +console.log("");
64 tests/test-time-parse-utc.out
... ... @@ -0,0 +1,64 @@
  1 +parse a m/d/Y:
  2 + Sun 01/01/1990: Sun Dec 31 16:00:00 1989
  3 + Wed 01/01/1990: Sun Dec 31 16:00:00 1989
  4 + XXX 01/01/1990: null
  5 +
  6 +parse A m/d/Y:
  7 + Sunday 01/01/1990: Sun Dec 31 16:00:00 1989
  8 + Wednesday 01/01/1990: Sun Dec 31 16:00:00 1989
  9 + Caturday 01/01/1990: null
  10 +
  11 +parse m/d/y:
  12 + 1/1/90: Sat Dec 31 16:00:00 2089
  13 + 1/1/10: Thu Dec 31 16:00:00 2009
  14 +
  15 +parse x:
  16 + 1/1/90: Sat Dec 31 16:00:00 2089
  17 + 1/1/10: Thu Dec 31 16:00:00 2009
  18 +
  19 +parse b d Y:
  20 + jan 01, 1990: Sun Dec 31 16:00:00 1989
  21 + jan 1, 1990: Sun Dec 31 16:00:00 1989
  22 + 1 Feb., 1990: Wed Jan 31 16:00:00 1990
  23 + 01 Feb., 1990: Wed Jan 31 16:00:00 1990
  24 + 1 Feb., 1990: Wed Jan 31 16:00:00 1990
  25 + 1 Feb., 1990: Wed Jan 31 16:00:00 1990
  26 + Moy 1 1990: null
  27 +
  28 +parse B d Y:
  29 + January 01, 1990: Sun Dec 31 16:00:00 1989
  30 + january 1, 1990: Sun Dec 31 16:00:00 1989
  31 + 1 February, 1990: Wed Jan 31 16:00:00 1990
  32 + 01 February, 1990: Wed Jan 31 16:00:00 1990
  33 + 1 February, 1990: Wed Jan 31 16:00:00 1990
  34 + 1 February, 1990: Wed Jan 31 16:00:00 1990
  35 + Juin 1 1990: null
  36 +
  37 +parse c:
  38 + Mon Jan 1 00:00:00 1990: Sun Dec 31 16:00:00 1989
  39 + Sun Jan 1 00:00:00 1990: Sun Dec 31 16:00:00 1989
  40 + Mon Jan 01 00:00:00 1990: Sun Dec 31 16:00:00 1989
  41 + Mon Jan 1 00:00:00 1990: Sun Dec 31 16:00:00 1989
  42 + Mon Jan 1 0:0:0 1990: Sun Dec 31 16:00:00 1989
  43 +
  44 +parse H M S:
  45 + 00:00:00: Sun Dec 31 16:00:00 1899
  46 + 11:59:59: Mon Jan 1 03:59:59 1900
  47 + 12:00:00: Mon Jan 1 04:00:00 1900
  48 + 12:00:01: Mon Jan 1 04:00:01 1900
  49 + 23:59:59: Mon Jan 1 15:59:59 1900
  50 +
  51 +parse X:
  52 + 00:00:00: Sun Dec 31 16:00:00 1899
  53 + 11:59:59: Mon Jan 1 03:59:59 1900
  54 + 12:00:00: Mon Jan 1 04:00:00 1900
  55 + 12:00:01: Mon Jan 1 04:00:01 1900
  56 + 23:59:59: Mon Jan 1 15:59:59 1900
  57 +
  58 +parse I M S p:
  59 + 12:00:00 am: Sun Dec 31 16:00:00 1899
  60 + 11:59:59 AM: Mon Jan 1 03:59:59 1900
  61 + 12:00:00 pm: Mon Jan 1 04:00:00 1900
  62 + 12:00:01 pm: Mon Jan 1 04:00:01 1900
  63 + 11:59:59 PM: Mon Jan 1 15:59:59 1900
  64 +

0 comments on commit 68424ae

Please sign in to comment.
Something went wrong with that request. Please try again.