Created
December 4, 2017 01:07
-
-
Save pstuffa/bc14012b64c12112867e4daaa7af4f6b to your computer and use it in GitHub Desktop.
Reusable Line Chart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://d3js.org Version 4.9.1. Copyright 2017 Mike Bostock. | |
(function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})})(this,function(t){"use strict";function n(t){return function(n,e){return js(t(n),e)}}function e(t,n){return[t,n]}function r(t,n,e){var r=(n-t)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=sf?10:o>=ff?5:o>=lf?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=sf?10:o>=ff?5:o>=lf?2:1)}function i(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=sf?i*=10:o>=ff?i*=5:o>=lf&&(i*=2),n<t?-i:i}function o(t){return t.length}function u(t){return"translate("+(t+.5)+",0)"}function a(t){return"translate(0,"+(t+.5)+")"}function c(t){var n=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(n=Math.round(n)),function(e){return t(e)+n}}function s(){return!this.__axis}function f(t,n){function e(e){var u=null==i?n.ticks?n.ticks.apply(n,r):n.domain():i,a=null==o?n.tickFormat?n.tickFormat.apply(n,r):Cf:o,_=Math.max(f,0)+h,y=n.range(),g=y[0]+.5,m=y[y.length-1]+.5,x=(n.bandwidth?c:Cf)(n.copy()),b=e.selection?e.selection():e,w=b.selectAll(".domain").data([null]),M=b.selectAll(".tick").data(u,n).order(),T=M.exit(),k=M.enter().append("g").attr("class","tick"),N=M.select("line"),S=M.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","#000")),M=M.merge(k),N=N.merge(k.append("line").attr("stroke","#000").attr(d+"2",p*f)),S=S.merge(k.append("text").attr("fill","#000").attr(d,p*_).attr("dy",t===zf?"0em":t===Lf?"0.71em":"0.32em")),e!==b&&(w=w.transition(e),M=M.transition(e),N=N.transition(e),S=S.transition(e),T=T.transition(e).attr("opacity",qf).attr("transform",function(t){return isFinite(t=x(t))?v(t):this.getAttribute("transform")}),k.attr("opacity",qf).attr("transform",function(t){var n=this.parentNode.__axis;return v(n&&isFinite(n=n(t))?n:x(t))})),T.remove(),w.attr("d",t===Rf||t==Pf?"M"+p*l+","+g+"H0.5V"+m+"H"+p*l:"M"+g+","+p*l+"V0.5H"+m+"V"+p*l),M.attr("opacity",1).attr("transform",function(t){return v(x(t))}),N.attr(d+"2",p*f),S.attr(d,p*_).text(a),b.filter(s).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Pf?"start":t===Rf?"end":"middle"),b.each(function(){this.__axis=x})}var r=[],i=null,o=null,f=6,l=6,h=3,p=t===zf||t===Rf?-1:1,d=t===Rf||t===Pf?"x":"y",v=t===zf||t===Lf?u:a;return e.scale=function(t){return arguments.length?(n=t,e):n},e.ticks=function(){return r=Af.call(arguments),e},e.tickArguments=function(t){return arguments.length?(r=null==t?[]:Af.call(t),e):r.slice()},e.tickValues=function(t){return arguments.length?(i=null==t?null:Af.call(t),e):i&&i.slice()},e.tickFormat=function(t){return arguments.length?(o=t,e):o},e.tickSize=function(t){return arguments.length?(f=l=+t,e):f},e.tickSizeInner=function(t){return arguments.length?(f=+t,e):f},e.tickSizeOuter=function(t){return arguments.length?(l=+t,e):l},e.tickPadding=function(t){return arguments.length?(h=+t,e):h},e}function l(t){return f(zf,t)}function h(t){return f(Pf,t)}function p(t){return f(Lf,t)}function d(t){return f(Rf,t)}function v(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r)throw new Error("illegal type: "+t);r[t]=[]}return new _(r)}function _(t){this._=t}function y(t,n){return t.trim().split(/^|\s+/).map(function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function g(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function m(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=Uf,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}function x(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Df&&n.documentElement.namespaceURI===Df?n.createElement(t):n.createElementNS(e,t)}}function b(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function w(){return new M}function M(){this._="@"+(++Yf).toString(36)}function T(t,n,e){return t=k(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function k(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function N(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function S(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function E(t,n,e){var r=$f.hasOwnProperty(t.type)?T:k;return function(i,o,u){var a,c=this.__on,s=r(n,o,u);if(c)for(var f=0,l=c.length;f<l;++f)if((a=c[f]).type===t.type&&a.name===t.name)return this.removeEventListener(a.type,a.listener,a.capture),this.addEventListener(a.type,a.listener=s,a.capture=e),void(a.value=n);this.addEventListener(t.type,s,e),a={type:t.type,name:t.name,value:n,listener:s,capture:e},c?c.push(a):this.__on=[a]}}function A(n,e,r,i){var o=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=o}}function C(){}function z(){return[]}function P(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function L(t,n,e,r,i,o){for(var u,a=0,c=n.length,s=o.length;a<s;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new P(t,o[a]);for(;a<c;++a)(u=n[a])&&(i[a]=u)}function R(t,n,e,r,i,o,u){var a,c,s,f={},l=n.length,h=o.length,p=new Array(l);for(a=0;a<l;++a)(c=n[a])&&(p[a]=s=ol+u.call(c,c.__data__,a,n),s in f?i[a]=c:f[s]=c);for(a=0;a<h;++a)s=ol+u.call(t,o[a],a,o),(c=f[s])?(r[a]=c,c.__data__=o[a],f[s]=null):e[a]=new P(t,o[a]);for(a=0;a<l;++a)(c=n[a])&&f[p[a]]===c&&(i[a]=c)}function q(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function U(t){return function(){this.removeAttribute(t)}}function D(t){return function(){this.removeAttributeNS(t.space,t.local)}}function O(t,n){return function(){this.setAttribute(t,n)}}function F(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function I(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function B(t){return function(){this.style.removeProperty(t)}}function H(t,n,e){return function(){this.style.setProperty(t,n,e)}}function j(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function X(t,n){return t.style.getPropertyValue(n)||gl(t).getComputedStyle(t,null).getPropertyValue(n)}function $(t){return function(){delete this[t]}}function V(t,n){return function(){this[t]=n}}function W(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Z(t){return t.trim().split(/^|\s+/)}function G(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=Z(t.getAttribute("class")||"")}function Q(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function K(t,n){for(var e=G(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function tt(t){return function(){Q(this,t)}}function nt(t){return function(){K(this,t)}}function et(t,n){return function(){(n.apply(this,arguments)?Q:K)(this,t)}}function rt(){this.textContent=""}function it(t){return function(){this.textContent=t}}function ot(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ut(){this.innerHTML=""}function at(t){return function(){this.innerHTML=t}}function ct(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function st(){this.nextSibling&&this.parentNode.appendChild(this)}function ft(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function lt(){return null}function ht(){var t=this.parentNode;t&&t.removeChild(this)}function pt(t,n,e){var r=gl(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function dt(t,n){return function(){return pt(this,t,n)}}function vt(t,n){return function(){return pt(this,t,n.apply(this,arguments))}}function _t(t,n){this._groups=t,this._parents=n}function yt(){return new _t([[document.documentElement]],zl)}function gt(){t.event.stopImmediatePropagation()}function mt(t,n){var e=t.document.documentElement,r=Pl(t).on("dragstart.drag",null);n&&(r.on("click.drag",Ul,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function xt(t,n,e,r,i,o,u,a,c,s){this.target=t,this.type=n,this.subject=e,this.identifier=r,this.active=i,this.x=o,this.y=u,this.dx=a,this.dy=c,this._=s}function bt(){return!t.event.button}function wt(){return this.parentNode}function Mt(n){return null==n?{x:t.event.x,y:t.event.y}:n}function Tt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function kt(){}function Nt(t){var n;return t=(t+"").trim().toLowerCase(),(n=jl.exec(t))?(n=parseInt(n[1],16),new zt(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=Xl.exec(t))?St(parseInt(n[1],16)):(n=$l.exec(t))?new zt(n[1],n[2],n[3],1):(n=Vl.exec(t))?new zt(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Wl.exec(t))?Et(n[1],n[2],n[3],n[4]):(n=Zl.exec(t))?Et(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Gl.exec(t))?Pt(n[1],n[2]/100,n[3]/100,1):(n=Jl.exec(t))?Pt(n[1],n[2]/100,n[3]/100,n[4]):Ql.hasOwnProperty(t)?St(Ql[t]):"transparent"===t?new zt(NaN,NaN,NaN,0):null}function St(t){return new zt(t>>16&255,t>>8&255,255&t,1)}function Et(t,n,e,r){return r<=0&&(t=n=e=NaN),new zt(t,n,e,r)}function At(t){return t instanceof kt||(t=Nt(t)),t?(t=t.rgb(),new zt(t.r,t.g,t.b,t.opacity)):new zt}function Ct(t,n,e,r){return 1===arguments.length?At(t):new zt(t,n,e,null==r?1:r)}function zt(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Pt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new qt(t,n,e,r)}function Lt(t){if(t instanceof qt)return new qt(t.h,t.s,t.l,t.opacity);if(t instanceof kt||(t=Nt(t)),!t)return new qt;if(t instanceof qt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,c=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=c<.5?o+i:2-o-i,u*=60):a=c>0&&c<1?0:u,new qt(u,a,c,t.opacity)}function Rt(t,n,e,r){return 1===arguments.length?Lt(t):new qt(t,n,e,null==r?1:r)}function qt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Ut(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Dt(t){if(t instanceof Ft)return new Ft(t.l,t.a,t.b,t.opacity);if(t instanceof $t){var n=t.h*Kl;return new Ft(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof zt||(t=At(t));var e=Ht(t.r),r=Ht(t.g),i=Ht(t.b),o=It((.4124564*e+.3575761*r+.1804375*i)/nh),u=It((.2126729*e+.7151522*r+.072175*i)/eh);return new Ft(116*u-16,500*(o-u),200*(u-It((.0193339*e+.119192*r+.9503041*i)/rh)),t.opacity)}function Ot(t,n,e,r){return 1===arguments.length?Dt(t):new Ft(t,n,e,null==r?1:r)}function Ft(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function It(t){return t>ah?Math.pow(t,1/3):t/uh+ih}function Yt(t){return t>oh?t*t*t:uh*(t-ih)}function Bt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ht(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function jt(t){if(t instanceof $t)return new $t(t.h,t.c,t.l,t.opacity);t instanceof Ft||(t=Dt(t));var n=Math.atan2(t.b,t.a)*th;return new $t(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Xt(t,n,e,r){return 1===arguments.length?jt(t):new $t(t,n,e,null==r?1:r)}function $t(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Vt(t){if(t instanceof Zt)return new Zt(t.h,t.s,t.l,t.opacity);t instanceof zt||(t=At(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(vh*r+ph*n-dh*e)/(vh+ph-dh),o=r-i,u=(hh*(e-i)-fh*o)/lh,a=Math.sqrt(u*u+o*o)/(hh*i*(1-i)),c=a?Math.atan2(u,o)*th-120:NaN;return new Zt(c<0?c+360:c,a,i,t.opacity)}function Wt(t,n,e,r){return 1===arguments.length?Vt(t):new Zt(t,n,e,null==r?1:r)}function Zt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Gt(t,n,e,r,i){var o=t*t,u=o*t;return((1-3*t+3*o-u)*n+(4-6*o+3*u)*e+(1+3*t+3*o-3*u)*r+u*i)/6}function Jt(t,n){return function(e){return t+e*n}}function Qt(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function Kt(t,n){var e=n-t;return e?Jt(t,e>180||e<-180?e-360*Math.round(e/360):e):Th(isNaN(t)?n:t)}function tn(t){return 1==(t=+t)?nn:function(n,e){return e-n?Qt(n,e,t):Th(isNaN(n)?e:n)}}function nn(t,n){var e=n-t;return e?Jt(t,e):Th(isNaN(t)?n:t)}function en(t){return function(n){var e,r,i=n.length,o=new Array(i),u=new Array(i),a=new Array(i);for(e=0;e<i;++e)r=Ct(n[e]),o[e]=r.r||0,u[e]=r.g||0,a[e]=r.b||0;return o=t(o),u=t(u),a=t(a),r.opacity=1,function(t){return r.r=o(t),r.g=u(t),r.b=a(t),r+""}}}function rn(t){return function(){return t}}function on(t){return function(n){return t(n)+""}}function un(t){return"none"===t?Oh:(_h||(_h=document.createElement("DIV"),yh=document.documentElement,gh=document.defaultView),_h.style.transform=t,t=gh.getComputedStyle(yh.appendChild(_h),null).getPropertyValue("transform"),yh.removeChild(_h),t=t.slice(7,-1).split(","),Fh(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function an(t){return null==t?Oh:(mh||(mh=document.createElementNS("http://www.w3.org/2000/svg","g")),mh.setAttribute("transform",t),(t=mh.transform.baseVal.consolidate())?(t=t.matrix,Fh(t.a,t.b,t.c,t.d,t.e,t.f)):Oh)}function cn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,u,a){if(t!==i||r!==o){var c=u.push("translate(",null,n,null,e);a.push({i:c-4,x:Ch(t,i)},{i:c-2,x:Ch(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}function u(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Ch(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function a(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Ch(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function c(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:Ch(t,e)},{i:a-2,x:Ch(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),u(n.rotate,e.rotate,r,i),a(n.skewX,e.skewX,r,i),c(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e<o;)r[(n=i[e]).i]=n.x(t);return r.join("")}}}function sn(t){return((t=Math.exp(t))+1/t)/2}function fn(t){return((t=Math.exp(t))-1/t)/2}function ln(t){return((t=Math.exp(2*t))-1)/(t+1)}function hn(t){return function(n,e){var r=t((n=Rt(n)).h,(e=Rt(e)).h),i=nn(n.s,e.s),o=nn(n.l,e.l),u=nn(n.opacity,e.opacity);return function(t){return n.h=r(t),n.s=i(t),n.l=o(t),n.opacity=u(t),n+""}}}function pn(t,n){var e=nn((t=Ot(t)).l,(n=Ot(n)).l),r=nn(t.a,n.a),i=nn(t.b,n.b),o=nn(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}}function dn(t){return function(n,e){var r=t((n=Xt(n)).h,(e=Xt(e)).h),i=nn(n.c,e.c),o=nn(n.l,e.l),u=nn(n.opacity,e.opacity);return function(t){return n.h=r(t),n.c=i(t),n.l=o(t),n.opacity=u(t),n+""}}}function vn(t){return function n(e){function r(n,r){var i=t((n=Wt(n)).h,(r=Wt(r)).h),o=nn(n.s,r.s),u=nn(n.l,r.l),a=nn(n.opacity,r.opacity);return function(t){return n.h=i(t),n.s=o(t),n.l=u(Math.pow(t,e)),n.opacity=a(t),n+""}}return e=+e,r.gamma=n,r}(1)}function _n(){return ep||(op(yn),ep=ip.now()+rp)}function yn(){ep=0}function gn(){this._call=this._time=this._next=null}function mn(t,n,e){var r=new gn;return r.restart(t,n,e),r}function xn(){_n(),++Jh;for(var t,n=xh;n;)(t=ep-n._time)>=0&&n._call.call(null,t),n=n._next;--Jh}function bn(){ep=(np=ip.now())+rp,Jh=Qh=0;try{xn()}finally{Jh=0,Mn(),ep=0}}function wn(){var t=ip.now(),n=t-np;n>tp&&(rp-=n,np=t)}function Mn(){for(var t,n,e=xh,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:xh=n);bh=t,Tn(r)}function Tn(t){if(!Jh){Qh&&(Qh=clearTimeout(Qh));var n=t-ep;n>24?(t<1/0&&(Qh=setTimeout(bn,n)),Kh&&(Kh=clearInterval(Kh))):(Kh||(np=ep,Kh=setInterval(wn,tp)),Jh=1,op(bn))}}function kn(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>fp)throw new Error("too late");return e}function Nn(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>hp)throw new Error("too late");return e}function Sn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function En(t,n,e){function r(t){e.state=lp,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var s,f,l,h;if(e.state!==lp)return u();for(s in c)if(h=c[s],h.name===e.name){if(h.state===pp)return up(i);h.state===dp?(h.state=_p,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete c[s]):+s<n&&(h.state=_p,h.timer.stop(),delete c[s])}if(up(function(){e.state===pp&&(e.state=dp,e.timer.restart(o,e.delay,e.time),o(r))}),e.state=hp,e.on.call("start",t,t.__data__,e.index,e.group),e.state===hp){for(e.state=pp,a=new Array(l=e.tween.length),s=0,f=-1;s<l;++s)(h=e.tween[s].value.call(t,t.__data__,e.index,e.group))&&(a[++f]=h);a.length=f+1}}function o(n){for(var r=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(u),e.state=vp,1),i=-1,o=a.length;++i<o;)a[i].call(null,r);e.state===vp&&(e.on.call("end",t,t.__data__,e.index,e.group),u())}function u(){e.state=_p,e.timer.stop(),delete c[n];for(var r in c)return;delete t.__transition}var a,c=t.__transition;c[n]=e,e.timer=mn(r,0,e.time)}function An(t,n){var e,r;return function(){var i=Nn(this,t),o=i.tween;if(o!==e){r=e=o;for(var u=0,a=r.length;u<a;++u)if(r[u].name===n){r=r.slice(),r.splice(u,1);break}}i.tween=r}}function Cn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Nn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},c=0,s=i.length;c<s;++c)if(i[c].name===n){i[c]=a;break}c===s&&i.push(a)}o.tween=i}}function zn(t,n,e){var r=t._id;return t.each(function(){var t=Nn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Sn(t,r).value[n]}}function Pn(t){return function(){this.removeAttribute(t)}}function Ln(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Rn(t,n,e){var r,i;return function(){var o=this.getAttribute(t);return o===e?null:o===r?i:i=n(r=o,e)}}function qn(t,n,e){var r,i;return function(){var o=this.getAttributeNS(t.space,t.local);return o===e?null:o===r?i:i=n(r=o,e)}}function Un(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttribute(t):(u=this.getAttribute(t),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function Dn(t,n,e){var r,i,o;return function(){var u,a=e(this);return null==a?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),u===a?null:u===r&&a===i?o:o=n(r=u,i=a))}}function On(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttributeNS(t.space,t.local,r(n))}}return e._value=n,e}function Fn(t,n){function e(){var e=this,r=n.apply(e,arguments);return r&&function(n){e.setAttribute(t,r(n))}}return e._value=n,e}function In(t,n){return function(){kn(this,t).delay=+n.apply(this,arguments)}}function Yn(t,n){return n=+n,function(){kn(this,t).delay=n}}function Bn(t,n){return function(){Nn(this,t).duration=+n.apply(this,arguments)}}function Hn(t,n){return n=+n,function(){Nn(this,t).duration=n}}function jn(t,n){if("function"!=typeof n)throw new Error;return function(){Nn(this,t).ease=n}}function Xn(t){return(t+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t})}function $n(t,n,e){var r,i,o=Xn(n)?kn:Nn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}function Vn(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function Wn(t,n){var e,r,i;return function(){var o=X(this,t),u=(this.style.removeProperty(t),X(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}function Zn(t){return function(){this.style.removeProperty(t)}}function Gn(t,n,e){var r,i;return function(){var o=X(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}function Jn(t,n,e){var r,i,o;return function(){var u=X(this,t),a=e(this);return null==a&&(this.style.removeProperty(t),a=X(this,t)),u===a?null:u===r&&a===i?o:o=n(r=u,i=a)}}function Qn(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function Kn(t){return function(){this.textContent=t}}function te(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function ne(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ee(t){return yt().transition(t)}function re(){return++Fp}function ie(t){return+t}function oe(t){return t*t}function ue(t){return t*(2-t)}function ae(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function ce(t){return t*t*t}function se(t){return--t*t*t+1}function fe(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function le(t){return 1-Math.cos(t*Xp)}function he(t){return Math.sin(t*Xp)}function pe(t){return(1-Math.cos(jp*t))/2}function de(t){return Math.pow(2,10*t-10)}function ve(t){return 1-Math.pow(2,-10*t)}function _e(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function ye(t){return 1-Math.sqrt(1-t*t)}function ge(t){return Math.sqrt(1- --t*t)}function me(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function xe(t){return 1-be(1-t)}function be(t){return(t=+t)<$p?nd*t*t:t<Wp?nd*(t-=Vp)*t+Zp:t<Jp?nd*(t-=Gp)*t+Qp:nd*(t-=Kp)*t+td}function we(t){return((t*=2)<=1?1-be(1-t):be(t-1)+1)/2}function Me(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))return sd.time=_n(),sd;return e}function Te(){t.event.stopImmediatePropagation()}function ke(t){return{type:t}}function Ne(){return!t.event.button}function Se(){var t=this.ownerSVGElement||this;return[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ee(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Ae(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Ce(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function ze(){return Le(xd)}function Pe(){return Le(bd)}function Le(n){function e(t){var e=t.property("__brush",a).selectAll(".overlay").data([ke("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Md.overlay).merge(e).each(function(){var t=Ee(this).extent;Pl(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])}),t.selectAll(".selection").data([ke("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Md.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var i=t.selectAll(".handle").data(n.handles,function(t){return t.type});i.exit().remove(),i.enter().append("rect").attr("class",function(t){return"handle handle--"+t.type}).attr("cursor",function(t){return Md[t.type]}),t.each(r).attr("fill","none").attr("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush touchstart.brush",u)}function r(){var t=Pl(this),n=Ee(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",function(t){return"e"===t.type[t.type.length-1]?n[1][0]-h/2:n[0][0]-h/2}).attr("y",function(t){return"s"===t.type[0]?n[1][1]-h/2:n[0][1]-h/2}).attr("width",function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+h:h}).attr("height",function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+h:h})):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function i(t,n){return t.__brush.emitter||new o(t,n)}function o(t,n){this.that=t,this.args=n,this.state=t.__brush,this.active=0}function u(){function e(){var t=Gf(T);!U||w||M||(Math.abs(t[0]-O[0])>Math.abs(t[1]-O[1])?M=!0:w=!0),O=t,b=!0,vd(),o()}function o(){var t;switch(m=O[0]-D[0],x=O[1]-D[1],N){case yd:case _d:S&&(m=Math.max(P-l,Math.min(R-v,m)),h=l+m,_=v+m),E&&(x=Math.max(L-p,Math.min(q-y,x)),d=p+x,g=y+x);break;case gd:S<0?(m=Math.max(P-l,Math.min(R-l,m)),h=l+m,_=v):S>0&&(m=Math.max(P-v,Math.min(R-v,m)),h=l,_=v+m),E<0?(x=Math.max(L-p,Math.min(q-p,x)),d=p+x,g=y):E>0&&(x=Math.max(L-y,Math.min(q-y,x)),d=p,g=y+x);break;case md:S&&(h=Math.max(P,Math.min(R,l-m*S)),_=Math.max(P,Math.min(R,v+m*S))),E&&(d=Math.max(L,Math.min(q,p-x*E)),g=Math.max(L,Math.min(q,y+x*E)))}_<h&&(S*=-1,t=l,l=v,v=t,t=h,h=_,_=t,k in Td&&Y.attr("cursor",Md[k=Td[k]])),g<d&&(E*=-1,t=p,p=y,y=t,t=d,d=g,g=t,k in kd&&Y.attr("cursor",Md[k=kd[k]])),A.selection&&(z=A.selection),w&&(h=z[0][0],_=z[1][0]),M&&(d=z[0][1],g=z[1][1]),z[0][0]===h&&z[0][1]===d&&z[1][0]===_&&z[1][1]===g||(A.selection=[[h,d],[_,g]],r.call(T),F.brush())}function u(){if(Te(),t.event.touches){if(t.event.touches.length)return;c&&clearTimeout(c),c=setTimeout(function(){c=null},500),I.on("touchmove.brush touchend.brush touchcancel.brush",null)}else mt(t.event.view,b),B.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);I.attr("pointer-events","all"),Y.attr("cursor",Md.overlay),A.selection&&(z=A.selection),Ae(z)&&(A.selection=null,r.call(T)),F.end()}function a(){switch(t.event.keyCode){case 16:U=S&&E;break;case 18:N===gd&&(S&&(v=_-m*S,l=h+m*S),E&&(y=g-x*E,p=d+x*E),N=md,o());break;case 32:N!==gd&&N!==md||(S<0?v=_-m:S>0&&(l=h-m),E<0?y=g-x:E>0&&(p=d-x),N=yd,Y.attr("cursor",Md.selection),o());break;default:return}vd()}function s(){switch(t.event.keyCode){case 16:U&&(w=M=U=!1,o());break;case 18:N===md&&(S<0?v=_:S>0&&(l=h),E<0?y=g:E>0&&(p=d),N=gd,o());break;case 32:N===yd&&(t.event.altKey?(S&&(v=_-m*S,l=h+m*S),E&&(y=g-x*E,p=d+x*E),N=md):(S<0?v=_:S>0&&(l=h),E<0?y=g:E>0&&(p=d),N=gd),Y.attr("cursor",Md[k]),o());break;default:return}vd()}if(t.event.touches){if(t.event.changedTouches.length<t.event.touches.length)return vd()}else if(c)return;if(f.apply(this,arguments)){var l,h,p,d,v,_,y,g,m,x,b,w,M,T=this,k=t.event.target.__data__.type,N="selection"===(t.event.metaKey?k="overlay":k)?_d:t.event.altKey?md:gd,S=n===bd?null:Nd[k],E=n===xd?null:Sd[k],A=Ee(T),C=A.extent,z=A.selection,P=C[0][0],L=C[0][1],R=C[1][0],q=C[1][1],U=S&&E&&t.event.shiftKey,D=Gf(T),O=D,F=i(T,arguments).beforestart();"overlay"===k?A.selection=z=[[l=n===bd?P:D[0],p=n===xd?L:D[1]],[v=n===bd?R:l,y=n===xd?q:p]]:(l=z[0][0],p=z[0][1],v=z[1][0],y=z[1][1]),h=l,d=p,_=v,g=y;var I=Pl(T).attr("pointer-events","none"),Y=I.selectAll(".overlay").attr("cursor",Md[k]);if(t.event.touches)I.on("touchmove.brush",e,!0).on("touchend.brush touchcancel.brush",u,!0);else{var B=Pl(t.event.view).on("keydown.brush",a,!0).on("keyup.brush",s,!0).on("mousemove.brush",e,!0).on("mouseup.brush",u,!0);Dl(t.event.view)}Te(),gp(T),r.call(T),F.start()}}function a(){var t=this.__brush||{selection:null};return t.extent=s.apply(this,arguments),t.dim=n,t}var c,s=Se,f=Ne,l=v(e,"start","brush","end"),h=6;return e.move=function(t,e){t.selection?t.on("start.brush",function(){i(this,arguments).beforestart().start()}).on("interrupt.brush end.brush",function(){i(this,arguments).end()}).tween("brush",function(){function t(t){u.selection=1===t&&Ae(s)?null:f(t),r.call(o),a.brush()}var o=this,u=o.__brush,a=i(o,arguments),c=u.selection,s=n.input("function"==typeof e?e.apply(this,arguments):e,u.extent),f=qh(c,s);return c&&s?t:t(1)}):t.each(function(){var t=this,o=arguments,u=t.__brush,a=n.input("function"==typeof e?e.apply(t,o):e,u.extent),c=i(t,o).beforestart();gp(t),u.selection=null==a||Ae(a)?null:a,r.call(t),c.start().brush().end()})},o.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(){return this.starting&&(this.starting=!1,this.emit("start")),this},brush:function(){return this.emit("brush"),this},end:function(){return 0==--this.active&&(delete this.state.emitter,this.emit("end")),this},emit:function(t){A(new dd(e,t,n.output(this.state.selection)),l.apply,l,[t,this.that,this.args])}},e.extent=function(t){return arguments.length?(s="function"==typeof t?t:pd([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),e):s},e.filter=function(t){return arguments.length?(f="function"==typeof t?t:pd(!!t),e):f},e.handleSize=function(t){return arguments.length?(h=+t,e):h},e.on=function(){var t=l.on.apply(l,arguments);return t===l?e:t},e}function Re(t){return function(n,e){return t(n.source.value+n.target.value,e.source.value+e.target.value)}}function qe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ue(){return new qe}function De(t){return t.source}function Oe(t){return t.target}function Fe(t){return t.radius}function Ie(t){return t.startAngle}function Ye(t){return t.endAngle}function Be(){}function He(t,n){var e=new Be;if(t instanceof Be)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i<o;)e.set(i,t[i]);else for(;++i<o;)e.set(n(r=t[i],i,t),r)}else if(t)for(var u in t)e.set(u,t[u]);return e}function je(){return{}}function Xe(t,n,e){t[n]=e}function $e(){return He()}function Ve(t,n,e){t.set(n,e)}function We(){}function Ze(t,n){var e=new We;if(t instanceof We)t.each(function(t){e.add(t)});else if(t){var r=-1,i=t.length;if(null==n)for(;++r<i;)e.add(t[r]);else for(;++r<i;)e.add(n(t[r],r,t))}return e}function Ge(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function Je(t,n){var e=Ge(t);return function(r,i){return n(e(r),i,t)}}function Qe(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function Ke(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,u,a,c,s,f,l,h,p=t._root,d={data:r},v=t._x0,_=t._y0,y=t._x1,g=t._y1;if(!p)return t._root=d,t;for(;p.length;)if((s=n>=(o=(v+y)/2))?v=o:y=o,(f=e>=(u=(_+g)/2))?_=u:g=u,i=p,!(p=p[l=f<<1|s]))return i[l]=d,t;if(a=+t._x.call(null,p.data),c=+t._y.call(null,p.data),n===a&&e===c)return d.next=p,i?i[l]=d:t._root=d,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(s=n>=(o=(v+y)/2))?v=o:y=o,(f=e>=(u=(_+g)/2))?_=u:g=u}while((l=f<<1|s)==(h=(c>=u)<<1|a>=o));return i[h]=p,i[l]=d,t}function tr(t){var n,e,r,i,o=t.length,u=new Array(o),a=new Array(o),c=1/0,s=1/0,f=-1/0,l=-1/0;for(e=0;e<o;++e)isNaN(r=+this._x.call(null,n=t[e]))||isNaN(i=+this._y.call(null,n))||(u[e]=r,a[e]=i,r<c&&(c=r),r>f&&(f=r),i<s&&(s=i),i>l&&(l=i));for(f<c&&(c=this._x0,f=this._x1),l<s&&(s=this._y0,l=this._y1),this.cover(c,s).cover(f,l),e=0;e<o;++e)Ke(this,u[e],a[e],t[e]);return this}function nr(t){for(var n=0,e=t.length;n<e;++n)this.remove(t[n]);return this}function er(t){return t[0]}function rr(t){return t[1]}function ir(t,n,e){var r=new or(null==n?er:n,null==e?rr:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function or(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function ur(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}function ar(t){return t.x+t.vx}function cr(t){return t.y+t.vy}function sr(t){return t.index}function fr(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function lr(t){return t.x}function hr(t){return t.y}function pr(t){return new dr(t)}function dr(t){if(!(n=Ov.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",u=!!n[5],a=n[6]&&+n[6],c=!!n[7],s=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(c=!0,f="g"):Dv[f]||(f=""),(u||"0"===e&&"="===r)&&(u=!0,e="0",r="="),this.fill=e,this.align=r, | |
this.sign=i,this.symbol=o,this.zero=u,this.width=a,this.comma=c,this.precision=s,this.type=f}function vr(n){return Fv=Bv(n),t.format=Fv.format,t.formatPrefix=Fv.formatPrefix,Fv}function _r(){this.reset()}function yr(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}function gr(t){return t>1?0:t<-1?N_:Math.acos(t)}function mr(t){return t>1?S_:t<-1?-S_:Math.asin(t)}function xr(t){return(t=I_(t/2))*t}function br(){}function wr(t,n){t&&X_.hasOwnProperty(t.type)&&X_[t.type](t,n)}function Mr(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function Tr(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)Mr(t[e],n,1);n.polygonEnd()}function kr(){Z_.point=Sr}function Nr(){Er(Vv,Wv)}function Sr(t,n){Z_.point=Er,Vv=t,Wv=n,t*=z_,n*=z_,Zv=t,Gv=q_(n=n/2+E_),Jv=I_(n)}function Er(t,n){t*=z_,n*=z_,n=n/2+E_;var e=t-Zv,r=e>=0?1:-1,i=r*e,o=q_(n),u=I_(n),a=Jv*u,c=Gv*o+a*q_(i),s=a*r*I_(i);V_.add(R_(s,c)),Zv=t,Gv=o,Jv=u}function Ar(t){return[R_(t[1],t[0]),mr(t[2])]}function Cr(t){var n=t[0],e=t[1],r=q_(e);return[r*q_(n),r*I_(n),I_(e)]}function zr(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Pr(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Lr(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function Rr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function qr(t){var n=B_(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function Ur(t,n){u_.push(a_=[Qv=t,t_=t]),n<Kv&&(Kv=n),n>n_&&(n_=n)}function Dr(t,n){var e=Cr([t*z_,n*z_]);if(o_){var r=Pr(o_,e),i=[r[1],-r[0],0],o=Pr(i,r);qr(o),o=Ar(o);var u,a=t-e_,c=a>0?1:-1,s=o[0]*C_*c,f=P_(a)>180;f^(c*e_<s&&s<c*t)?(u=o[1]*C_)>n_&&(n_=u):(s=(s+360)%360-180,f^(c*e_<s&&s<c*t)?(u=-o[1]*C_)<Kv&&(Kv=u):(n<Kv&&(Kv=n),n>n_&&(n_=n))),f?t<e_?Hr(Qv,t)>Hr(Qv,t_)&&(t_=t):Hr(t,t_)>Hr(Qv,t_)&&(Qv=t):t_>=Qv?(t<Qv&&(Qv=t),t>t_&&(t_=t)):t>e_?Hr(Qv,t)>Hr(Qv,t_)&&(t_=t):Hr(t,t_)>Hr(Qv,t_)&&(Qv=t)}else u_.push(a_=[Qv=t,t_=t]);n<Kv&&(Kv=n),n>n_&&(n_=n),o_=e,e_=t}function Or(){Q_.point=Dr}function Fr(){a_[0]=Qv,a_[1]=t_,Q_.point=Ur,o_=null}function Ir(t,n){if(o_){var e=t-e_;J_.add(P_(e)>180?e+(e>0?360:-360):e)}else r_=t,i_=n;Z_.point(t,n),Dr(t,n)}function Yr(){Z_.lineStart()}function Br(){Ir(r_,i_),Z_.lineEnd(),P_(J_)>k_&&(Qv=-(t_=180)),a_[0]=Qv,a_[1]=t_,o_=null}function Hr(t,n){return(n-=t)<0?n+360:n}function jr(t,n){return t[0]-n[0]}function Xr(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}function $r(t,n){t*=z_,n*=z_;var e=q_(n);Vr(e*q_(t),e*I_(t),I_(n))}function Vr(t,n,e){++c_,f_+=(t-f_)/c_,l_+=(n-l_)/c_,h_+=(e-h_)/c_}function Wr(){ty.point=Zr}function Zr(t,n){t*=z_,n*=z_;var e=q_(n);b_=e*q_(t),w_=e*I_(t),M_=I_(n),ty.point=Gr,Vr(b_,w_,M_)}function Gr(t,n){t*=z_,n*=z_;var e=q_(n),r=e*q_(t),i=e*I_(t),o=I_(n),u=R_(B_((u=w_*o-M_*i)*u+(u=M_*r-b_*o)*u+(u=b_*i-w_*r)*u),b_*r+w_*i+M_*o);s_+=u,p_+=u*(b_+(b_=r)),d_+=u*(w_+(w_=i)),v_+=u*(M_+(M_=o)),Vr(b_,w_,M_)}function Jr(){ty.point=$r}function Qr(){ty.point=ti}function Kr(){ni(m_,x_),ty.point=$r}function ti(t,n){m_=t,x_=n,t*=z_,n*=z_,ty.point=ni;var e=q_(n);b_=e*q_(t),w_=e*I_(t),M_=I_(n),Vr(b_,w_,M_)}function ni(t,n){t*=z_,n*=z_;var e=q_(n),r=e*q_(t),i=e*I_(t),o=I_(n),u=w_*o-M_*i,a=M_*r-b_*o,c=b_*i-w_*r,s=B_(u*u+a*a+c*c),f=mr(s),l=s&&-f/s;__+=l*u,y_+=l*a,g_+=l*c,s_+=f,p_+=f*(b_+(b_=r)),d_+=f*(w_+(w_=i)),v_+=f*(M_+(M_=o)),Vr(b_,w_,M_)}function ei(t,n){return[t>N_?t-A_:t<-N_?t+A_:t,n]}function ri(t,n,e){return(t%=A_)?n||e?ry(oi(t),ui(n,e)):oi(t):n||e?ui(n,e):ei}function ii(t){return function(n,e){return n+=t,[n>N_?n-A_:n<-N_?n+A_:n,e]}}function oi(t){var n=ii(t);return n.invert=ii(-t),n}function ui(t,n){function e(t,n){var e=q_(n),a=q_(t)*e,c=I_(t)*e,s=I_(n),f=s*r+a*i;return[R_(c*o-f*u,a*r-s*i),mr(f*o+c*u)]}var r=q_(t),i=I_(t),o=q_(n),u=I_(n);return e.invert=function(t,n){var e=q_(n),a=q_(t)*e,c=I_(t)*e,s=I_(n),f=s*o-c*u;return[R_(c*o+s*u,a*r+f*i),mr(f*r-a*i)]},e}function ai(t,n,e,r,i,o){if(e){var u=q_(n),a=I_(n),c=r*e;null==i?(i=n+r*A_,o=n-c/2):(i=ci(u,i),o=ci(u,o),(r>0?i<o:i>o)&&(i+=r*A_));for(var s,f=i;r>0?f>o:f<o;f-=c)s=Ar([u,-a*q_(f),-a*I_(f)]),t.point(s[0],s[1])}}function ci(t,n){n=Cr(n),n[0]-=t,qr(n);var e=gr(-n[1]);return((-n[2]<0?-e:e)+A_-k_)%A_}function si(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function fi(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}function li(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,a,s){var f=0,l=0;if(null==i||(f=u(i,a))!==(l=u(o,a))||c(i,o)<0^a>0)do{s.point(0===f||3===f?t:e,f>1?r:n)}while((f=(f+a+4)%4)!==l);else s.point(o[0],o[1])}function u(r,i){return P_(r[0]-t)<k_?i>0?0:3:P_(r[0]-e)<k_?i>0?2:1:P_(r[1]-n)<k_?i>0?1:0:i>0?3:2}function a(t,n){return c(t.x,n.x)}function c(t,n){var e=u(t,1),r=u(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(u){function c(t,n){i(t,n)&&N.point(t,n)}function s(){for(var n=0,e=0,i=_.length;e<i;++e)for(var o,u,a=_[e],c=1,s=a.length,f=a[0],l=f[0],h=f[1];c<s;++c)o=l,u=h,f=a[c],l=f[0],h=f[1],u<=r?h>r&&(l-o)*(r-u)>(h-u)*(t-o)&&++n:h<=r&&(l-o)*(r-u)<(h-u)*(t-o)&&--n;return n}function f(){N=S,v=[],_=[],k=!0}function l(){var t=s(),n=k&&t,e=(v=bf(v)).length;(n||e)&&(u.polygonStart(),n&&(u.lineStart(),o(null,null,1,u),u.lineEnd()),e&&xy(v,a,t,o,u),u.polygonEnd()),N=u,v=_=y=null}function h(){E.point=d,_&&_.push(y=[]),T=!0,M=!1,b=w=NaN}function p(){v&&(d(g,m),x&&M&&S.rejoin(),v.push(S.result())),E.point=c,M&&N.lineEnd()}function d(o,u){var a=i(o,u);if(_&&y.push([o,u]),T)g=o,m=u,x=a,T=!1,a&&(N.lineStart(),N.point(o,u));else if(a&&M)N.point(o,u);else{var c=[b=Math.max(wy,Math.min(by,b)),w=Math.max(wy,Math.min(by,w))],s=[o=Math.max(wy,Math.min(by,o)),u=Math.max(wy,Math.min(by,u))];gy(c,s,t,n,e,r)?(M||(N.lineStart(),N.point(c[0],c[1])),N.point(s[0],s[1]),a||N.lineEnd(),k=!1):a&&(N.lineStart(),N.point(o,u),k=!1)}b=o,w=u,M=a}var v,_,y,g,m,x,b,w,M,T,k,N=u,S=yy(),E={point:c,lineStart:h,lineEnd:p,polygonStart:f,polygonEnd:l};return E}}function hi(){Sy.point=di,Sy.lineEnd=pi}function pi(){Sy.point=Sy.lineEnd=br}function di(t,n){t*=z_,n*=z_,iy=t,oy=I_(n),uy=q_(n),Sy.point=vi}function vi(t,n){t*=z_,n*=z_;var e=I_(n),r=q_(n),i=P_(t-iy),o=q_(i),u=I_(i),a=r*u,c=uy*e-oy*r*o,s=oy*e+uy*r*o;Ny.add(R_(B_(a*a+c*c),s)),iy=t,oy=e,uy=r}function _i(t,n){return!(!t||!Ly.hasOwnProperty(t.type))&&Ly[t.type](t,n)}function yi(t,n){return 0===zy(t,n)}function gi(t,n){var e=zy(t[0],t[1]);return zy(t[0],n)+zy(n,t[1])<=e+k_}function mi(t,n){return!!ky(t.map(xi),bi(n))}function xi(t){return t=t.map(bi),t.pop(),t}function bi(t){return[t[0]*z_,t[1]*z_]}function wi(t,n,e){var r=cf(t,n-k_,e).concat(n);return function(t){return r.map(function(n){return[t,n]})}}function Mi(t,n,e){var r=cf(t,n-k_,e).concat(n);return function(t){return r.map(function(n){return[n,t]})}}function Ti(){function t(){return{type:"MultiLineString",coordinates:n()}}function n(){return cf(U_(o/_)*_,i,_).map(h).concat(cf(U_(s/y)*y,c,y).map(p)).concat(cf(U_(r/d)*d,e,d).filter(function(t){return P_(t%_)>k_}).map(f)).concat(cf(U_(a/v)*v,u,v).filter(function(t){return P_(t%y)>k_}).map(l))}var e,r,i,o,u,a,c,s,f,l,h,p,d=10,v=d,_=90,y=360,g=2.5;return t.lines=function(){return n().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(p(c).slice(1),h(i).reverse().slice(1),p(s).reverse().slice(1))]}},t.extent=function(n){return arguments.length?t.extentMajor(n).extentMinor(n):t.extentMinor()},t.extentMajor=function(n){return arguments.length?(o=+n[0][0],i=+n[1][0],s=+n[0][1],c=+n[1][1],o>i&&(n=o,o=i,i=n),s>c&&(n=s,s=c,c=n),t.precision(g)):[[o,s],[i,c]]},t.extentMinor=function(n){return arguments.length?(r=+n[0][0],e=+n[1][0],a=+n[0][1],u=+n[1][1],r>e&&(n=r,r=e,e=n),a>u&&(n=a,a=u,u=n),t.precision(g)):[[r,a],[e,u]]},t.step=function(n){return arguments.length?t.stepMajor(n).stepMinor(n):t.stepMinor()},t.stepMajor=function(n){return arguments.length?(_=+n[0],y=+n[1],t):[_,y]},t.stepMinor=function(n){return arguments.length?(d=+n[0],v=+n[1],t):[d,v]},t.precision=function(n){return arguments.length?(g=+n,f=wi(a,u,90),l=Mi(r,e,g),h=wi(s,c,90),p=Mi(o,i,g),t):g},t.extentMajor([[-180,-90+k_],[180,90-k_]]).extentMinor([[-180,-80-k_],[180,80+k_]])}function ki(){return Ti()()}function Ni(){Fy.point=Si}function Si(t,n){Fy.point=Ei,ay=sy=t,cy=fy=n}function Ei(t,n){Oy.add(fy*t-sy*n),sy=t,fy=n}function Ai(){Ei(ay,cy)}function Ci(t,n){t<Iy&&(Iy=t),t>By&&(By=t),n<Yy&&(Yy=n),n>Hy&&(Hy=n)}function zi(t,n){Xy+=t,$y+=n,++Vy}function Pi(){tg.point=Li}function Li(t,n){tg.point=Ri,zi(py=t,dy=n)}function Ri(t,n){var e=t-py,r=n-dy,i=B_(e*e+r*r);Wy+=i*(py+t)/2,Zy+=i*(dy+n)/2,Gy+=i,zi(py=t,dy=n)}function qi(){tg.point=zi}function Ui(){tg.point=Oi}function Di(){Fi(ly,hy)}function Oi(t,n){tg.point=Fi,zi(ly=py=t,hy=dy=n)}function Fi(t,n){var e=t-py,r=n-dy,i=B_(e*e+r*r);Wy+=i*(py+t)/2,Zy+=i*(dy+n)/2,Gy+=i,i=dy*t-py*n,Jy+=i*(py+t),Qy+=i*(dy+n),Ky+=3*i,zi(py=t,dy=n)}function Ii(t){this._context=t}function Yi(t,n){ag.point=Bi,eg=ig=t,rg=og=n}function Bi(t,n){ig-=t,og-=n,ug.add(B_(ig*ig+og*og)),ig=t,og=n}function Hi(){this._string=[]}function ji(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xi(t){return t.length>1}function $i(t,n){return((t=t.x)[0]<0?t[1]-S_-k_:S_-t[1])-((n=n.x)[0]<0?n[1]-S_-k_:S_-n[1])}function Vi(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?N_:-N_,c=P_(o-e);P_(c-N_)<k_?(t.point(e,r=(r+u)/2>0?S_:-S_),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&c>=N_&&(P_(e-i)<k_&&(e-=i*k_),P_(o-a)<k_&&(o-=a*k_),r=Wi(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}function Wi(t,n,e,r){var i,o,u=I_(t-e);return P_(u)>k_?L_((I_(n)*(o=q_(r))*I_(e)-I_(r)*(i=q_(n))*I_(t))/(i*o*u)):(n+r)/2}function Zi(t,n,e,r){var i;if(null==t)i=e*S_,r.point(-N_,i),r.point(0,i),r.point(N_,i),r.point(N_,0),r.point(N_,-i),r.point(0,-i),r.point(-N_,-i),r.point(-N_,0),r.point(-N_,i);else if(P_(t[0]-n[0])>k_){var o=t[0]<n[0]?N_:-N_;i=e*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(n[0],n[1])}function Gi(t){return function(n){var e=new Ji;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Ji(){}function Qi(t,n,e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),$_(e,t.stream(jy));var u=jy.result(),a=Math.min(r/(u[1][0]-u[0][0]),i/(u[1][1]-u[0][1])),c=+n[0][0]+(r-a*(u[1][0]+u[0][0]))/2,s=+n[0][1]+(i-a*(u[1][1]+u[0][1]))/2;return null!=o&&t.clipExtent(o),t.scale(150*a).translate([c,s])}function Ki(t,n,e){return Qi(t,[[0,0],n],e)}function to(t){return Gi({point:function(n,e){n=t(n,e),this.stream.point(n[0],n[1])}})}function no(t,n){function e(r,i,o,u,a,c,s,f,l,h,p,d,v,_){var y=s-r,g=f-i,m=y*y+g*g;if(m>4*n&&v--){var x=u+h,b=a+p,w=c+d,M=B_(x*x+b*b+w*w),T=mr(w/=M),k=P_(P_(w)-1)<k_||P_(o-l)<k_?(o+l)/2:R_(b,x),N=t(k,T),S=N[0],E=N[1],A=S-r,C=E-i,z=g*A-y*C;(z*z/m>n||P_((y*A+g*C)/m-.5)>.3||u*h+a*p+c*d<dg)&&(e(r,i,o,u,a,c,S,E,k,x/=M,b/=M,w,v,_),_.point(S,E),e(S,E,k,x,b,w,s,f,l,h,p,d,v,_))}}return function(n){function r(e,r){e=t(e,r),n.point(e[0],e[1])}function i(){y=NaN,w.point=o,n.lineStart()}function o(r,i){var o=Cr([r,i]),u=t(r,i);e(y,g,_,m,x,b,y=u[0],g=u[1],_=r,m=o[0],x=o[1],b=o[2],pg,n),n.point(y,g)}function u(){w.point=r,n.lineEnd()}function a(){i(),w.point=c,w.lineEnd=s}function c(t,n){o(f=t,n),l=y,h=g,p=m,d=x,v=b,w.point=o}function s(){e(y,g,_,m,x,b,l,h,f,p,d,v,pg,n),w.lineEnd=u,u()}var f,l,h,p,d,v,_,y,g,m,x,b,w={point:r,lineStart:i,lineEnd:u,polygonStart:function(){n.polygonStart(),w.lineStart=a},polygonEnd:function(){n.polygonEnd(),w.lineStart=i}};return w}}function eo(t){return ro(function(){return t})()}function ro(t){function n(t){return t=f(t[0]*z_,t[1]*z_),[t[0]*_+a,c-t[1]*_]}function e(t){return(t=f.invert((t[0]-a)/_,(c-t[1])/_))&&[t[0]*C_,t[1]*C_]}function r(t,n){return t=u(t,n),[t[0]*_+a,c-t[1]*_]}function i(){f=ry(s=ri(b,w,M),u);var t=u(m,x);return a=y-t[0]*_,c=g+t[1]*_,o()}function o(){return d=v=null,n}var u,a,c,s,f,l,h,p,d,v,_=150,y=480,g=250,m=0,x=0,b=0,w=0,M=0,T=null,k=fg,N=null,S=Uy,E=.5,A=vg(r,E);return n.stream=function(t){return d&&v===t?d:d=_g(k(s,A(S(v=t))))},n.clipAngle=function(t){return arguments.length?(k=+t?lg(T=t*z_,6*z_):(T=null,fg),o()):T*C_},n.clipExtent=function(t){return arguments.length?(S=null==t?(N=l=h=p=null,Uy):li(N=+t[0][0],l=+t[0][1],h=+t[1][0],p=+t[1][1]),o()):null==N?null:[[N,l],[h,p]]},n.scale=function(t){return arguments.length?(_=+t,i()):_},n.translate=function(t){return arguments.length?(y=+t[0],g=+t[1],i()):[y,g]},n.center=function(t){return arguments.length?(m=t[0]%360*z_,x=t[1]%360*z_,i()):[m*C_,x*C_]},n.rotate=function(t){return arguments.length?(b=t[0]%360*z_,w=t[1]%360*z_,M=t.length>2?t[2]%360*z_:0,i()):[b*C_,w*C_,M*C_]},n.precision=function(t){return arguments.length?(A=vg(r,E=t*t),o()):B_(E)},n.fitExtent=function(t,e){return Qi(n,t,e)},n.fitSize=function(t,e){return Ki(n,t,e)},function(){return u=t.apply(this,arguments),n.invert=u.invert&&e,i()}}function io(t){var n=0,e=N_/3,r=ro(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*z_,e=t[1]*z_):[n*C_,e*C_]},i}function oo(t){function n(t,n){return[t*e,I_(n)/e]}var e=q_(t);return n.invert=function(t,n){return[t/e,mr(n*e)]},n}function uo(t,n){function e(t,n){var e=B_(o-2*i*I_(n))/i;return[e*I_(t*=i),u-e*q_(t)]}var r=I_(t),i=(r+I_(n))/2;if(P_(i)<k_)return oo(t);var o=1+r*(2*i-r),u=B_(o)/i;return e.invert=function(t,n){var e=u-n;return[R_(t,P_(e))/i*Y_(e),mr((o-(t*t+e*e)*i*i)/(2*i))]},e}function ao(t){var n=t.length;return{point:function(e,r){for(var i=-1;++i<n;)t[i].point(e,r)},sphere:function(){for(var e=-1;++e<n;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<n;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<n;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<n;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<n;)t[e].polygonEnd()}}}function co(t){return function(n,e){var r=q_(n),i=q_(e),o=t(r*i);return[o*i*I_(n),o*I_(e)]}}function so(t){return function(n,e){var r=B_(n*n+e*e),i=t(r),o=I_(i),u=q_(i);return[R_(n*o,r*u),mr(r&&e*o/r)]}}function fo(t,n){return[t,O_(H_((S_+n)/2))]}function lo(t){function n(){var n=N_*a(),u=o(vy(o.rotate()).invert([0,0]));return s(null==f?[[u[0]-n,u[1]-n],[u[0]+n,u[1]+n]]:t===fo?[[Math.max(u[0]-n,f),e],[Math.min(u[0]+n,r),i]]:[[f,Math.max(u[1]-n,e)],[r,Math.min(u[1]+n,i)]])}var e,r,i,o=eo(t),u=o.center,a=o.scale,c=o.translate,s=o.clipExtent,f=null;return o.scale=function(t){return arguments.length?(a(t),n()):a()},o.translate=function(t){return arguments.length?(c(t),n()):c()},o.center=function(t){return arguments.length?(u(t),n()):u()},o.clipExtent=function(t){return arguments.length?(null==t?f=e=r=i=null:(f=+t[0][0],e=+t[0][1],r=+t[1][0],i=+t[1][1]),n()):null==f?null:[[f,e],[r,i]]},n()}function ho(t){return H_((S_+t)/2)}function po(t,n){function e(t,n){o>0?n<-S_+k_&&(n=-S_+k_):n>S_-k_&&(n=S_-k_);var e=o/F_(ho(n),i);return[e*I_(i*t),o-e*q_(i*t)]}var r=q_(t),i=t===n?I_(t):O_(r/q_(n))/O_(ho(n)/ho(t)),o=r*F_(ho(t),i)/i;return i?(e.invert=function(t,n){var e=o-n,r=Y_(i)*B_(t*t+e*e);return[R_(t,P_(e))/i*Y_(e),2*L_(F_(o/r,1/i))-S_]},e):fo}function vo(t,n){return[t,n]}function _o(t,n){function e(t,n){var e=o-n,r=i*t;return[e*I_(r),o-e*q_(r)]}var r=q_(t),i=t===n?I_(t):(r-q_(n))/(n-t),o=r/i+t;return P_(i)<k_?vo:(e.invert=function(t,n){var e=o-n;return[R_(t,P_(e))/i*Y_(e),o-Y_(i)*B_(t*t+e*e)]},e)}function yo(t,n){var e=q_(n),r=q_(t)*e;return[e*I_(t)/r,I_(n)/r]}function go(t,n,e,r){return 1===t&&1===n&&0===e&&0===r?Uy:Gi({point:function(i,o){this.stream.point(i*t+e,o*n+r)}})}function mo(t,n){return[q_(n)*I_(t),I_(n)]}function xo(t,n){var e=q_(n),r=1+q_(t)*e;return[e*I_(t)/r,I_(n)/r]}function bo(t,n){return[O_(H_((S_+n)/2)),-t]}function wo(t,n){return t.parent===n.parent?1:2}function Mo(t){return t.reduce(To,0)/t.length}function To(t,n){return t+n.x}function ko(t){return 1+t.reduce(No,0)}function No(t,n){return Math.max(t,n.y)}function So(t){for(var n;n=t.children;)t=n[0];return t}function Eo(t){for(var n;n=t.children;)t=n[n.length-1];return t}function Ao(t){var n=0,e=t.children,r=e&&e.length;if(r)for(;--r>=0;)n+=e[r].value;else n=1;t.value=n}function Co(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}function zo(t,n){var e,r,i,o,u,a=new Uo(t),c=+t.value&&(a.value=t.value),s=[a];for(null==n&&(n=Lo);e=s.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(u=i.length))for(e.children=new Array(u),o=u-1;o>=0;--o)s.push(r=e.children[o]=new Uo(i[o])),r.parent=e,r.depth=e.depth+1;return a.eachBefore(qo)}function Po(){return zo(this).eachBefore(Ro)}function Lo(t){return t.children}function Ro(t){t.data=t.data.data}function qo(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Uo(t){this.data=t,this.depth=this.height=0,this.parent=null}function Do(t){this._=t,this.next=null}function Oo(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r-n.r;return i*i+1e-6>e*e+r*r}function Fo(t,n){var e,r,i,o=null,u=t.head;switch(n.length){case 1:e=Io(n[0]);break;case 2:e=Yo(n[0],n[1]);break;case 3:e=Bo(n[0],n[1],n[2])}for(;u;)i=u._,r=u.next,e&&Oo(e,i)?o=u:(o?(t.tail=o,o.next=null):t.head=t.tail=null,n.push(i),e=Fo(t,n),n.pop(),t.head?(u.next=t.head,t.head=u):(u.next=null,t.head=t.tail=u),o=t.tail,o.next=r),u=r;return t.tail=o,e}function Io(t){return{x:t.x,y:t.y,r:t.r}}function Yo(t,n){var e=t.x,r=t.y,i=t.r,o=n.x,u=n.y,a=n.r,c=o-e,s=u-r,f=a-i,l=Math.sqrt(c*c+s*s);return{x:(e+o+c/l*f)/2,y:(r+u+s/l*f)/2,r:(l+i+a)/2}}function Bo(t,n,e){var r=t.x,i=t.y,o=t.r,u=n.x,a=n.y,c=n.r,s=e.x,f=e.y,l=e.r,h=2*(r-u),p=2*(i-a),d=2*(c-o),v=r*r+i*i-o*o-u*u-a*a+c*c,_=2*(r-s),y=2*(i-f),g=2*(l-o),m=r*r+i*i-o*o-s*s-f*f+l*l,x=_*p-h*y,b=(p*m-y*v)/x-r,w=(y*d-p*g)/x,M=(_*v-h*m)/x-i,T=(h*g-_*d)/x,k=w*w+T*T-1,N=2*(b*w+M*T+o),S=b*b+M*M-o*o,E=(-N-Math.sqrt(N*N-4*k*S))/(2*k);return{x:b+w*E+r,y:M+T*E+i,r:E}}function Ho(t,n,e){var r=t.x,i=t.y,o=n.r+e.r,u=t.r+e.r,a=n.x-r,c=n.y-i,s=a*a+c*c;if(s){var f=.5+((u*=u)-(o*=o))/(2*s),l=Math.sqrt(Math.max(0,2*o*(u+s)-(u-=s)*u-o*o))/(2*s);e.x=r+f*a+l*c,e.y=i+f*c-l*a}else e.x=r+u,e.y=i}function jo(t,n){var e=n.x-t.x,r=n.y-t.y,i=t.r+n.r;return i*i-1e-6>e*e+r*r}function Xo(t,n,e){var r=t._,i=t.next._,o=r.r+i.r,u=(r.x*i.r+i.x*r.r)/o-n,a=(r.y*i.r+i.y*r.r)/o-e;return u*u+a*a}function $o(t){this._=t,this.next=null,this.previous=null}function Vo(t){if(!(i=t.length))return 0;var n,e,r,i;if(n=t[0],n.x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Ho(e,n,r=t[2]);var o,u,a,c,s,f,l,h=n.r*n.r,p=e.r*e.r,d=r.r*r.r,v=h+p+d,_=h*n.x+p*e.x+d*r.x,y=h*n.y+p*e.y+d*r.y;n=new $o(n),e=new $o(e),r=new $o(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(a=3;a<i;++a){Ho(n._,e._,r=t[a]),r=new $o(r),c=e.next,s=n.previous,f=e._.r,l=n._.r;do{if(f<=l){if(jo(c._,r._)){e=c,n.next=e,e.previous=n,--a;continue t}f+=c._.r,c=c.next}else{if(jo(s._,r._)){n=s,n.next=e,e.previous=n,--a;continue t}l+=s._.r,s=s.previous}}while(c!==s.next);for(r.previous=n,r.next=e,n.next=e.previous=e=r,v+=d=r._.r*r._.r,_+=d*r._.x,y+=d*r._.y,h=Xo(n,o=_/v,u=y/v);(r=r.next)!==e;)(d=Xo(r,o,u))<h&&(n=r,h=d);e=n.next}for(n=[e._],r=e;(r=r.next)!==e;)n.push(r._);for(r=$g(n),a=0;a<i;++a)n=t[a],n.x-=r.x,n.y-=r.y;return r.r}function Wo(t){return null==t?null:Zo(t)}function Zo(t){if("function"!=typeof t)throw new Error;return t}function Go(){return 0}function Jo(t){return Math.sqrt(t.value)}function Qo(t){return function(n){n.children||(n.r=Math.max(0,+t(n)||0))}}function Ko(t,n){return function(e){if(r=e.children){var r,i,o,u=r.length,a=t(e)*n||0;if(a)for(i=0;i<u;++i)r[i].r+=a;if(o=Vo(r),a)for(i=0;i<u;++i)r[i].r-=a;e.r=o+a}}}function tu(t){return function(n){var e=n.parent;n.r*=t,e&&(n.x=e.x+t*n.x,n.y=e.y+t*n.y)}}function nu(t){return t.id}function eu(t){return t.parentId}function ru(t,n){return t.parent===n.parent?1:2}function iu(t){var n=t.children;return n?n[0]:t.t}function ou(t){var n=t.children;return n?n[n.length-1]:t.t}function uu(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function au(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)n=i[o],n.z+=e,n.m+=e,e+=n.s+(r+=n.c)}function cu(t,n,e){return t.a.parent===n.parent?t.a:e}function su(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function fu(t){for(var n,e,r,i,o,u=new su(t,0),a=[u];n=a.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)a.push(e=n.children[i]=new su(r[i],i)),e.parent=n;return(u.parent=new su(null,0)).children=[u],u}function lu(t,n,e,r,i,o){for(var u,a,c,s,f,l,h,p,d,v,_,y=[],g=n.children,m=0,x=0,b=g.length,w=n.value;m<b;){c=i-e,s=o-r;do{f=g[x++].value}while(!f&&x<b);for(l=h=f,v=Math.max(s/c,c/s)/(w*t),_=f*f*v,d=Math.max(h/_,_/l);x<b;++x){if(f+=a=g[x].value,a<l&&(l=a),a>h&&(h=a),_=f*f*v,(p=Math.max(h/_,_/l))>d){f-=a;break}d=p}y.push(u={value:f,dice:c<s,children:g.slice(m,x)}),u.dice?Jg(u,e,r,i,w?r+=s*f/w:o):im(u,e,r,w?e+=c*f/w:i,o),w-=f,m=x}return y}function hu(t,n){return t[0]-n[0]||t[1]-n[1]}function pu(t){for(var n=t.length,e=[0,1],r=2,i=2;i<n;++i){for(;r>1&&pm(t[e[r-2]],t[e[r-1]],t[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function du(t){this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function vu(t){if(!t._start)try{_u(t)}catch(n){if(t._tasks[t._ended+t._active-1])gu(t,n);else if(!t._data)throw n}}function _u(t){for(;t._start=t._waiting&&t._active<t._size;){var n=t._ended+t._active,e=t._tasks[n],r=e.length-1,i=e[r];e[r]=yu(t,n),--t._waiting,++t._active,e=i.apply(null,e),t._tasks[n]&&(t._tasks[n]=e||gm)}}function yu(t,n){return function(e,r){t._tasks[n]&&(--t._active,++t._ended,t._tasks[n]=null,null==t._error&&(null!=e?gu(t,e):(t._data[n]=r,t._waiting?vu(t):mu(t))))}}function gu(t,n){var e,r=t._tasks.length;for(t._error=n,t._data=void 0,t._waiting=NaN;--r>=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,mu(t)}function mu(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function xu(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new du(t)}function bu(t){return function(n,e){t(null==n?e:null)}}function wu(t){var n=t.responseType;return n&&"text"!==n?t.response:t.responseText}function Mu(t,n){return function(e){return t(e.responseText,n)}}function Tu(t){function n(n){var o=n+"",u=e.get(o);if(!u){if(i!==Om)return i;e.set(o,u=r.push(n))}return t[(u-1)%t.length]}var e=He(),r=[],i=Om;return t=null==t?[]:Dm.call(t),n.domain=function(t){if(!arguments.length)return r.slice();r=[],e=He();for(var i,o,u=-1,a=t.length;++u<a;)e.has(o=(i=t[u])+"")||e.set(o,r.push(i));return n},n.range=function(e){return arguments.length?(t=Dm.call(e),n):t.slice()},n.unknown=function(t){return arguments.length?(i=t,n):i},n.copy=function(){return Tu().domain(r).range(t).unknown(i)},n}function ku(){function t(){var t=i().length,r=u[1]<u[0],l=u[r-0],h=u[1-r];n=(h-l)/Math.max(1,t-c+2*s),a&&(n=Math.floor(n)),l+=(h-l-n*(t-c))*f,e=n*(1-c),a&&(l=Math.round(l),e=Math.round(e));var p=cf(t).map(function(t){return l+n*t});return o(r?p.reverse():p)}var n,e,r=Tu().unknown(void 0),i=r.domain,o=r.range,u=[0,1],a=!1,c=0,s=0,f=.5;return delete r.unknown,r.domain=function(n){return arguments.length?(i(n),t()):i()},r.range=function(n){return arguments.length?(u=[+n[0],+n[1]],t()):u.slice()},r.rangeRound=function(n){return u=[+n[0],+n[1]],a=!0,t()},r.bandwidth=function(){return e},r.step=function(){return n},r.round=function(n){return arguments.length?(a=!!n,t()):a},r.padding=function(n){return arguments.length?(c=s=Math.max(0,Math.min(1,n)),t()):c},r.paddingInner=function(n){return arguments.length?(c=Math.max(0,Math.min(1,n)),t()):c},r.paddingOuter=function(n){return arguments.length?(s=Math.max(0,Math.min(1,n)),t()):s},r.align=function(n){return arguments.length?(f=Math.max(0,Math.min(1,n)),t()):f},r.copy=function(){return ku().domain(i()).range(u).round(a).paddingInner(c).paddingOuter(s).align(f)},t()}function Nu(t){var n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Nu(n())},t}function Su(){return Nu(ku().paddingInner(1))}function Eu(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:Fm(n)}function Au(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=n?0:t>=e?1:r(t)}}}function Cu(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function zu(t,n,e,r){var i=t[0],o=t[1],u=n[0],a=n[1];return o<i?(i=e(o,i),u=r(a,u)):(i=e(i,o),u=r(u,a)),function(t){return u(i(t))}}function Pu(t,n,e,r){var i=Math.min(t.length,n.length)-1,o=new Array(i),u=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<i;)o[a]=e(t[a],t[a+1]),u[a]=r(n[a],n[a+1]);return function(n){var e=Vs(t,n,1,i)-1;return u[e](o[e](n))}}function Lu(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp())}function Ru(t,n){function e(){return i=Math.min(a.length,c.length)>2?Pu:zu,o=u=null,r}function r(n){return(o||(o=i(a,c,f?Au(t):t,s)))(+n)}var i,o,u,a=Ym,c=Ym,s=qh,f=!1;return r.invert=function(t){return(u||(u=i(c,a,Eu,f?Cu(n):n)))(+t)},r.domain=function(t){return arguments.length?(a=Um.call(t,Im),e()):a.slice()},r.range=function(t){return arguments.length?(c=Dm.call(t),e()):c.slice()},r.rangeRound=function(t){return c=Dm.call(t),s=Uh,e()},r.clamp=function(t){return arguments.length?(f=!!t,e()):f},r.interpolate=function(t){return arguments.length?(s=t,e()):s},e()}function qu(t){var n=t.domain;return t.ticks=function(t){var e=n();return hf(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Bm(n(),t,e)},t.nice=function(e){null==e&&(e=10);var i,o=n(),u=0,a=o.length-1,c=o[u],s=o[a];return s<c&&(i=c,c=s,s=i,i=u,u=a,a=i),i=r(c,s,e),i>0?(c=Math.floor(c/i)*i,s=Math.ceil(s/i)*i,i=r(c,s,e)):i<0&&(c=Math.ceil(c*i)/i,s=Math.floor(s*i)/i,i=r(c,s,e)),i>0?(o[u]=Math.floor(c/i)*i,o[a]=Math.ceil(s/i)*i,n(o)):i<0&&(o[u]=Math.ceil(c*i)/i,o[a]=Math.floor(s*i)/i,n(o)),t},t}function Uu(){var t=Ru(Eu,Ch);return t.copy=function(){return Lu(t,Uu())},qu(t)}function Du(){function t(t){return+t}var n=[0,1];return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=Um.call(e,Im),t):n.slice()},t.copy=function(){return Du().domain(n)},qu(t)}function Ou(t,n){return(n=Math.log(n/t))?function(e){return Math.log(e/t)/n}:Fm(n)}function Fu(t,n){return t<0?function(e){return-Math.pow(-n,e)*Math.pow(-t,1-e)}:function(e){return Math.pow(n,e)*Math.pow(t,1-e)}}function Iu(t){return isFinite(t)?+("1e"+t):t<0?0:t}function Yu(t){return 10===t?Iu:t===Math.E?Math.exp:function(n){return Math.pow(t,n)}}function Bu(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),function(n){return Math.log(n)/t})}function Hu(t){return function(n){return-t(-n)}}function ju(){function n(){return o=Bu(i),u=Yu(i),r()[0]<0&&(o=Hu(o),u=Hu(u)),e}var e=Ru(Ou,Fu).domain([1,10]),r=e.domain,i=10,o=Bu(10),u=Yu(10);return e.base=function(t){return arguments.length?(i=+t,n()):i},e.domain=function(t){return arguments.length?(r(t),n()):r()},e.ticks=function(t){var n,e=r(),a=e[0],c=e[e.length-1];(n=c<a)&&(h=a,a=c,c=h);var s,f,l,h=o(a),p=o(c),d=null==t?10:+t,v=[];if(!(i%1)&&p-h<d){if(h=Math.round(h)-1,p=Math.round(p)+1,a>0){for(;h<p;++h)for(f=1,s=u(h);f<i;++f)if(!((l=s*f)<a)){if(l>c)break;v.push(l)}}else for(;h<p;++h)for(f=i-1,s=u(h);f>=1;--f)if(!((l=s*f)<a)){if(l>c)break;v.push(l)}}else v=hf(h,p,Math.min(p-h,d)).map(u);return n?v.reverse():v},e.tickFormat=function(n,r){if(null==r&&(r=10===i?".0e":","),"function"!=typeof r&&(r=t.format(r)),n===1/0)return r;null==n&&(n=10);var a=Math.max(1,i*n/e.ticks().length);return function(t){var n=t/u(Math.round(o(t)));return n*i<i-.5&&(n*=i),n<=a?r(t):""}},e.nice=function(){return r(Hm(r(),{floor:function(t){return u(Math.floor(o(t)))},ceil:function(t){return u(Math.ceil(o(t)))}}))},e.copy=function(){return Lu(e,ju().base(i))},e}function Xu(t,n){return t<0?-Math.pow(-t,n):Math.pow(t,n)}function $u(){function t(t,n){return(n=Xu(n,e)-(t=Xu(t,e)))?function(r){return(Xu(r,e)-t)/n}:Fm(n)}function n(t,n){return n=Xu(n,e)-(t=Xu(t,e)),function(r){return Xu(t+n*r,1/e)}}var e=1,r=Ru(t,n),i=r.domain;return r.exponent=function(t){return arguments.length?(e=+t,i(i())):e},r.copy=function(){return Lu(r,$u().exponent(e))},qu(r)}function Vu(){return $u().exponent(.5)}function Wu(){function t(){var t=0,o=Math.max(1,r.length);for(i=new Array(o-1);++t<o;)i[t-1]=vf(e,t/o);return n}function n(t){if(!isNaN(t=+t))return r[Vs(i,t)]}var e=[],r=[],i=[];return n.invertExtent=function(t){var n=r.indexOf(t);return n<0?[NaN,NaN]:[n>0?i[n-1]:e[0],n<i.length?i[n]:e[e.length-1]]},n.domain=function(n){if(!arguments.length)return e.slice();e=[];for(var r,i=0,o=n.length;i<o;++i)null==(r=n[i])||isNaN(r=+r)||e.push(r);return e.sort(js),t()},n.range=function(n){return arguments.length?(r=Dm.call(n),t()):r.slice()},n.quantiles=function(){return i.slice()},n.copy=function(){return Wu().domain(e).range(r)},n}function Zu(){function t(t){if(t<=t)return u[Vs(o,t,0,i)]}function n(){var n=-1;for(o=new Array(i);++n<i;)o[n]=((n+1)*r-(n-i)*e)/(i+1);return t}var e=0,r=1,i=1,o=[.5],u=[0,1];return t.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n()):[e,r]},t.range=function(t){return arguments.length?(i=(u=Dm.call(t)).length-1,n()):u.slice()},t.invertExtent=function(t){var n=u.indexOf(t);return n<0?[NaN,NaN]:n<1?[e,o[0]]:n>=i?[o[i-1],r]:[o[n-1],o[n]]},t.copy=function(){return Zu().domain([e,r]).range(u)},qu(t)}function Gu(){function t(t){if(t<=t)return e[Vs(n,t,0,r)]}var n=[.5],e=[0,1],r=1;return t.domain=function(i){return arguments.length?(n=Dm.call(i),r=Math.min(n.length,e.length-1),t):n.slice()},t.range=function(i){return arguments.length?(e=Dm.call(i),r=Math.min(n.length,e.length-1),t):e.slice()},t.invertExtent=function(t){var r=e.indexOf(t);return[n[r-1],n[r]]},t.copy=function(){return Gu().domain(n).range(e)},t}function Ju(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n<e-t?n:e},i.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},i.range=function(e,r,o){var u=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e<r&&o>0))return u;do{u.push(new Date(+e))}while(n(e,o),t(e),e<r);return u},i.filter=function(e){return Ju(function(n){if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return jm.setTime(+n),Xm.setTime(+r),t(jm),t(Xm),Math.floor(e(jm,Xm))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}function Qu(t){return Ju(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wm)/Zm})}function Ku(t){return Ju(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Zm})}function ta(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function na(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ea(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function ra(t){function n(t,n){return function(e){var r,i,o,u=[],a=-1,c=0,s=t.length;for(e instanceof Date||(e=new Date(+e));++a<s;)37===t.charCodeAt(a)&&(u.push(t.slice(c,a)),null!=(i=Vx[r=t.charAt(++a)])?r=t.charAt(++a):i="e"===r?" ":"0",(o=n[r])&&(r=o(e,i)), | |
u.push(r),c=a+1);return u.push(t.slice(c,a)),u.join("")}}function e(t,n){return function(e){var i=ea(1900);if(r(i,t,e+="",0)!=e.length)return null;if("p"in i&&(i.H=i.H%12+12*i.p),"W"in i||"U"in i){"w"in i||(i.w="W"in i?1:0);var o="Z"in i?na(ea(i.y)).getUTCDay():n(ea(i.y)).getDay();i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7}return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,na(i)):n(i)}}function r(t,n,e,r){for(var i,o,u=0,a=n.length,c=e.length;u<a;){if(r>=c)return-1;if(37===(i=n.charCodeAt(u++))){if(i=n.charAt(u++),!(o=B[i in Vx?n.charAt(u++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=C.exec(n.slice(e));return r?(t.p=z[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=R.exec(n.slice(e));return r?(t.w=q[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=L[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=O.exec(n.slice(e));return r?(t.m=F[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){var r=U.exec(n.slice(e));return r?(t.m=D[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){return r(t,w,n,e)}function f(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,T,n,e)}function h(t){return S[t.getDay()]}function p(t){return N[t.getDay()]}function d(t){return A[t.getMonth()]}function v(t){return E[t.getMonth()]}function _(t){return k[+(t.getHours()>=12)]}function y(t){return S[t.getUTCDay()]}function g(t){return N[t.getUTCDay()]}function m(t){return A[t.getUTCMonth()]}function x(t){return E[t.getUTCMonth()]}function b(t){return k[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,T=t.time,k=t.periods,N=t.days,S=t.shortDays,E=t.months,A=t.shortMonths,C=ua(k),z=aa(k),P=ua(N),L=aa(N),R=ua(S),q=aa(S),U=ua(E),D=aa(E),O=ua(A),F=aa(A),I={a:h,A:p,b:d,B:v,c:null,d:wa,e:wa,H:Ma,I:Ta,j:ka,L:Na,m:Sa,M:Ea,p:_,S:Aa,U:Ca,w:za,W:Pa,x:null,X:null,y:La,Y:Ra,Z:qa,"%":Ga},Y={a:y,A:g,b:m,B:x,c:null,d:Ua,e:Ua,H:Da,I:Oa,j:Fa,L:Ia,m:Ya,M:Ba,p:b,S:Ha,U:ja,w:Xa,W:$a,x:null,X:null,y:Va,Y:Wa,Z:Za,"%":Ga},B={a:o,A:u,b:a,B:c,c:s,d:va,e:va,H:ya,I:ya,j:_a,L:xa,m:da,M:ga,p:i,S:ma,U:sa,w:ca,W:fa,x:f,X:l,y:ha,Y:la,Z:pa,"%":ba};return I.x=n(M,I),I.X=n(T,I),I.c=n(w,I),Y.x=n(M,Y),Y.X=n(T,Y),Y.c=n(w,Y),{format:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",ta);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",Y);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,na);return n.toString=function(){return t},n}}}function ia(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o<e?new Array(e-o+1).join(n)+i:i)}function oa(t){return t.replace(Gx,"\\$&")}function ua(t){return new RegExp("^(?:"+t.map(oa).join("|")+")","i")}function aa(t){for(var n={},e=-1,r=t.length;++e<r;)n[t[e].toLowerCase()]=e;return n}function ca(t,n,e){var r=Wx.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function sa(t,n,e){var r=Wx.exec(n.slice(e));return r?(t.U=+r[0],e+r[0].length):-1}function fa(t,n,e){var r=Wx.exec(n.slice(e));return r?(t.W=+r[0],e+r[0].length):-1}function la(t,n,e){var r=Wx.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function ha(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function pa(t,n,e){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function da(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function va(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function _a(t,n,e){var r=Wx.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function ya(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function ga(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ma(t,n,e){var r=Wx.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function xa(t,n,e){var r=Wx.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function ba(t,n,e){var r=Zx.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function wa(t,n){return ia(t.getDate(),n,2)}function Ma(t,n){return ia(t.getHours(),n,2)}function Ta(t,n){return ia(t.getHours()%12||12,n,2)}function ka(t,n){return ia(1+ex.count(xx(t),t),n,3)}function Na(t,n){return ia(t.getMilliseconds(),n,3)}function Sa(t,n){return ia(t.getMonth()+1,n,2)}function Ea(t,n){return ia(t.getMinutes(),n,2)}function Aa(t,n){return ia(t.getSeconds(),n,2)}function Ca(t,n){return ia(ix.count(xx(t),t),n,2)}function za(t){return t.getDay()}function Pa(t,n){return ia(ox.count(xx(t),t),n,2)}function La(t,n){return ia(t.getFullYear()%100,n,2)}function Ra(t,n){return ia(t.getFullYear()%1e4,n,4)}function qa(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+ia(n/60|0,"0",2)+ia(n%60,"0",2)}function Ua(t,n){return ia(t.getUTCDate(),n,2)}function Da(t,n){return ia(t.getUTCHours(),n,2)}function Oa(t,n){return ia(t.getUTCHours()%12||12,n,2)}function Fa(t,n){return ia(1+Nx.count(jx(t),t),n,3)}function Ia(t,n){return ia(t.getUTCMilliseconds(),n,3)}function Ya(t,n){return ia(t.getUTCMonth()+1,n,2)}function Ba(t,n){return ia(t.getUTCMinutes(),n,2)}function Ha(t,n){return ia(t.getUTCSeconds(),n,2)}function ja(t,n){return ia(Ex.count(jx(t),t),n,2)}function Xa(t){return t.getUTCDay()}function $a(t,n){return ia(Ax.count(jx(t),t),n,2)}function Va(t,n){return ia(t.getUTCFullYear()%100,n,2)}function Wa(t,n){return ia(t.getUTCFullYear()%1e4,n,4)}function Za(){return"+0000"}function Ga(){return"%"}function Ja(n){return Xx=ra(n),t.timeFormat=Xx.format,t.timeParse=Xx.parse,t.utcFormat=Xx.utcFormat,t.utcParse=Xx.utcParse,Xx}function Qa(t){return t.toISOString()}function Ka(t){var n=new Date(t);return isNaN(n)?null:n}function tc(t){return new Date(t)}function nc(t){return t instanceof Date?+t:+new Date(+t)}function ec(t,n,e,r,o,u,a,c,s){function f(i){return(a(i)<i?v:u(i)<i?_:o(i)<i?y:r(i)<i?g:n(i)<i?e(i)<i?m:x:t(i)<i?b:w)(i)}function l(n,e,r,o){if(null==n&&(n=10),"number"==typeof n){var u=Math.abs(r-e)/n,a=Xs(function(t){return t[2]}).right(M,u);a===M.length?(o=i(e/ob,r/ob,n),n=t):a?(a=M[u/M[a-1][2]<M[a][2]/u?a-1:a],o=a[1],n=a[0]):(o=i(e,r,n),n=c)}return null==o?n:n.every(o)}var h=Ru(Eu,Ch),p=h.invert,d=h.domain,v=s(".%L"),_=s(":%S"),y=s("%I:%M"),g=s("%I %p"),m=s("%a %d"),x=s("%b %d"),b=s("%B"),w=s("%Y"),M=[[a,1,Kx],[a,5,5*Kx],[a,15,15*Kx],[a,30,30*Kx],[u,1,tb],[u,5,5*tb],[u,15,15*tb],[u,30,30*tb],[o,1,nb],[o,3,3*nb],[o,6,6*nb],[o,12,12*nb],[r,1,eb],[r,2,2*eb],[e,1,rb],[n,1,ib],[n,3,3*ib],[t,1,ob]];return h.invert=function(t){return new Date(p(t))},h.domain=function(t){return arguments.length?d(Um.call(t,nc)):d().map(tc)},h.ticks=function(t,n){var e,r=d(),i=r[0],o=r[r.length-1],u=o<i;return u&&(e=i,i=o,o=e),e=l(t,i,o,n),e=e?e.range(i,o+1):[],u?e.reverse():e},h.tickFormat=function(t,n){return null==n?f:s(n)},h.nice=function(t,n){var e=d();return(t=l(t,e[0],e[e.length-1],n))?d(Hm(e,t)):h},h.copy=function(){return Lu(h,ec(t,n,e,r,o,u,a,c,s))},h}function rc(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}function ic(t){function n(n){var o=(n-e)/(r-e);return t(i?Math.max(0,Math.min(1,o)):o)}var e=0,r=1,i=!1;return n.domain=function(t){return arguments.length?(e=+t[0],r=+t[1],n):[e,r]},n.clamp=function(t){return arguments.length?(i=!!t,n):i},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return ic(t).domain([e,r]).clamp(i)},qu(n)}function oc(t){return t>1?0:t<-1?zb:Math.acos(t)}function uc(t){return t>=1?Pb:t<=-1?-Pb:Math.asin(t)}function ac(t){return t.innerRadius}function cc(t){return t.outerRadius}function sc(t){return t.startAngle}function fc(t){return t.endAngle}function lc(t){return t&&t.padAngle}function hc(t,n,e,r,i,o,u,a){var c=e-t,s=r-n,f=u-i,l=a-o,h=(f*(n-o)-l*(t-i))/(l*c-f*s);return[t+h*c,n+h*s]}function pc(t,n,e,r,i,o,u){var a=t-e,c=n-r,s=(u?o:-o)/Ab(a*a+c*c),f=s*c,l=-s*a,h=t+f,p=n+l,d=e+f,v=r+l,_=(h+d)/2,y=(p+v)/2,g=d-h,m=v-p,x=g*g+m*m,b=i-o,w=h*v-d*p,M=(m<0?-1:1)*Ab(Nb(0,b*b*x-w*w)),T=(w*m-g*M)/x,k=(-w*g-m*M)/x,N=(w*m+g*M)/x,S=(-w*g+m*M)/x,E=T-_,A=k-y,C=N-_,z=S-y;return E*E+A*A>C*C+z*z&&(T=N,k=S),{cx:T,cy:k,x01:-f,y01:-l,x11:T*(i/b-1),y11:k*(i/b-1)}}function dc(t){this._context=t}function vc(t){return t[0]}function _c(t){return t[1]}function yc(t){this._curve=t}function gc(t){function n(n){return new yc(t(n))}return n._curve=t,n}function mc(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(gc(t)):n()._curve},t}function xc(t){return t.source}function bc(t){return t.target}function wc(t){function n(){var n,a=jb.call(arguments),c=e.apply(this,a),s=r.apply(this,a);if(u||(u=n=Ue()),t(u,+i.apply(this,(a[0]=c,a)),+o.apply(this,a),+i.apply(this,(a[0]=s,a)),+o.apply(this,a)),n)return u=null,n+""||null}var e=xc,r=bc,i=vc,o=_c,u=null;return n.source=function(t){return arguments.length?(e=t,n):e},n.target=function(t){return arguments.length?(r=t,n):r},n.x=function(t){return arguments.length?(i="function"==typeof t?t:wb(+t),n):i},n.y=function(t){return arguments.length?(o="function"==typeof t?t:wb(+t),n):o},n.context=function(t){return arguments.length?(u=null==t?null:t,n):u},n}function Mc(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Tc(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function kc(t,n,e,r,i){var o=Xb(n,e),u=Xb(n,e=(e+i)/2),a=Xb(r,e),c=Xb(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(u[0],u[1],a[0],a[1],c[0],c[1])}function Nc(){return wc(Mc)}function Sc(){return wc(Tc)}function Ec(){var t=wc(kc);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}function Ac(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Cc(t){this._context=t}function zc(t){this._context=t}function Pc(t){this._context=t}function Lc(t,n){this._basis=new Cc(t),this._beta=n}function Rc(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function qc(t,n){this._context=t,this._k=(1-n)/6}function Uc(t,n){this._context=t,this._k=(1-n)/6}function Dc(t,n){this._context=t,this._k=(1-n)/6}function Oc(t,n,e){var r=t._x1,i=t._y1,o=t._x2,u=t._y2;if(t._l01_a>Cb){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Cb){var s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-n*t._l12_2a)/f,u=(u*s+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,i,o,u,t._x2,t._y2)}function Fc(t,n){this._context=t,this._alpha=n}function Ic(t,n){this._context=t,this._alpha=n}function Yc(t,n){this._context=t,this._alpha=n}function Bc(t){this._context=t}function Hc(t){return t<0?-1:1}function jc(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),u=(e-t._y1)/(i||r<0&&-0),a=(o*i+u*r)/(r+i);return(Hc(o)+Hc(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(a))||0}function Xc(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function $c(t,n,e){var r=t._x0,i=t._y0,o=t._x1,u=t._y1,a=(o-r)/3;t._context.bezierCurveTo(r+a,i+a*n,o-a,u-a*e,o,u)}function Vc(t){this._context=t}function Wc(t){this._context=new Zc(t)}function Zc(t){this._context=t}function Gc(t){return new Vc(t)}function Jc(t){return new Wc(t)}function Qc(t){this._context=t}function Kc(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),u=new Array(r);for(i[0]=0,o[0]=2,u[0]=t[0]+2*t[1],n=1;n<r-1;++n)i[n]=1,o[n]=4,u[n]=4*t[n]+2*t[n+1];for(i[r-1]=2,o[r-1]=7,u[r-1]=8*t[r-1]+t[r],n=1;n<r;++n)e=i[n]/o[n-1],o[n]-=e,u[n]-=e*u[n-1];for(i[r-1]=u[r-1]/o[r-1],n=r-2;n>=0;--n)i[n]=(u[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n<r-1;++n)o[n]=2*t[n+1]-i[n+1];return[i,o]}function ts(t,n){this._context=t,this._t=n}function ns(t){return new ts(t,0)}function es(t){return new ts(t,1)}function rs(t,n){return t[n]}function is(t){for(var n,e=0,r=-1,i=t.length;++r<i;)(n=+t[r][1])&&(e+=n);return e}function os(t){return t[0]}function us(t){return t[1]}function as(){this._=null}function cs(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ss(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function fs(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function ls(t){for(;t.L;)t=t.L;return t}function hs(t,n,e,r){var i=[null,null],o=Yw.push(i)-1;return i.left=t,i.right=n,e&&ds(i,t,n,e),r&&ds(i,n,t,r),Fw[t.index].halfedges.push(o),Fw[n.index].halfedges.push(o),i}function ps(t,n,e){var r=[n,e];return r.left=t,r}function ds(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function vs(t,n,e,r,i){var o,u=t[0],a=t[1],c=u[0],s=u[1],f=a[0],l=a[1],h=0,p=1,d=f-c,v=l-s;if(o=n-c,d||!(o>0)){if(o/=d,d<0){if(o<h)return;o<p&&(p=o)}else if(d>0){if(o>p)return;o>h&&(h=o)}if(o=r-c,d||!(o<0)){if(o/=d,d<0){if(o>p)return;o>h&&(h=o)}else if(d>0){if(o<h)return;o<p&&(p=o)}if(o=e-s,v||!(o>0)){if(o/=v,v<0){if(o<h)return;o<p&&(p=o)}else if(v>0){if(o>p)return;o>h&&(h=o)}if(o=i-s,v||!(o<0)){if(o/=v,v<0){if(o>p)return;o>h&&(h=o)}else if(v>0){if(o<h)return;o<p&&(p=o)}return!(h>0||p<1)||(h>0&&(t[0]=[c+h*d,s+h*v]),p<1&&(t[1]=[c+p*d,s+p*v]),!0)}}}}}function _s(t,n,e,r,i){var o=t[1];if(o)return!0;var u,a,c=t[0],s=t.left,f=t.right,l=s[0],h=s[1],p=f[0],d=f[1],v=(l+p)/2,_=(h+d)/2;if(d===h){if(v<n||v>=r)return;if(l>p){if(c){if(c[1]>=i)return}else c=[v,e];o=[v,i]}else{if(c){if(c[1]<e)return}else c=[v,i];o=[v,e]}}else if(u=(l-p)/(d-h),a=_-u*v,u<-1||u>1)if(l>p){if(c){if(c[1]>=i)return}else c=[(e-a)/u,e];o=[(i-a)/u,i]}else{if(c){if(c[1]<e)return}else c=[(i-a)/u,i];o=[(e-a)/u,e]}else if(h<d){if(c){if(c[0]>=r)return}else c=[n,u*n+a];o=[r,u*r+a]}else{if(c){if(c[0]<n)return}else c=[r,u*r+a];o=[n,u*n+a]}return t[0]=c,t[1]=o,!0}function ys(t,n,e,r){for(var i,o=Yw.length;o--;)_s(i=Yw[o],t,n,e,r)&&vs(i,t,n,e,r)&&(Math.abs(i[0][0]-i[1][0])>jw||Math.abs(i[0][1]-i[1][1])>jw)||delete Yw[o]}function gs(t){return Fw[t.index]={site:t,halfedges:[]}}function ms(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function xs(t,n){return n[+(n.left!==t.site)]}function bs(t,n){return n[+(n.left===t.site)]}function ws(){for(var t,n,e,r,i=0,o=Fw.length;i<o;++i)if((t=Fw[i])&&(r=(n=t.halfedges).length)){var u=new Array(r),a=new Array(r);for(e=0;e<r;++e)u[e]=e,a[e]=ms(t,Yw[n[e]]);for(u.sort(function(t,n){return a[n]-a[t]}),e=0;e<r;++e)a[e]=n[u[e]];for(e=0;e<r;++e)n[e]=a[e]}}function Ms(t,n,e,r){var i,o,u,a,c,s,f,l,h,p,d,v,_=Fw.length,y=!0;for(i=0;i<_;++i)if(o=Fw[i]){for(u=o.site,c=o.halfedges,a=c.length;a--;)Yw[c[a]]||c.splice(a,1);for(a=0,s=c.length;a<s;)p=bs(o,Yw[c[a]]),d=p[0],v=p[1],f=xs(o,Yw[c[++a%s]]),l=f[0],h=f[1],(Math.abs(d-l)>jw||Math.abs(v-h)>jw)&&(c.splice(a,0,Yw.push(ps(u,p,Math.abs(d-t)<jw&&r-v>jw?[t,Math.abs(l-t)<jw?h:r]:Math.abs(v-r)<jw&&e-d>jw?[Math.abs(h-r)<jw?l:e,r]:Math.abs(d-e)<jw&&v-n>jw?[e,Math.abs(l-e)<jw?h:n]:Math.abs(v-n)<jw&&d-t>jw?[Math.abs(h-n)<jw?l:t,n]:null))-1),++s);s&&(y=!1)}if(y){var g,m,x,b=1/0;for(i=0,y=null;i<_;++i)(o=Fw[i])&&(u=o.site,g=u[0]-t,m=u[1]-n,(x=g*g+m*m)<b&&(b=x,y=o));if(y){var w=[t,n],M=[t,r],T=[e,r],k=[e,n];y.halfedges.push(Yw.push(ps(u=y.site,w,M))-1,Yw.push(ps(u,M,T))-1,Yw.push(ps(u,T,k))-1,Yw.push(ps(u,k,w))-1)}}for(i=0;i<_;++i)(o=Fw[i])&&(o.halfedges.length||delete Fw[i])}function Ts(){cs(this),this.x=this.y=this.arc=this.site=this.cy=null}function ks(t){var n=t.P,e=t.N;if(n&&e){var r=n.site,i=t.site,o=e.site;if(r!==o){var u=i[0],a=i[1],c=r[0]-u,s=r[1]-a,f=o[0]-u,l=o[1]-a,h=2*(c*l-s*f);if(!(h>=-Xw)){var p=c*c+s*s,d=f*f+l*l,v=(l*p-s*d)/h,_=(c*d-f*p)/h,y=Bw.pop()||new Ts;y.arc=t,y.site=i,y.x=v+u,y.y=(y.cy=_+a)+Math.sqrt(v*v+_*_),t.circle=y;for(var g=null,m=Iw._;m;)if(y.y<m.y||y.y===m.y&&y.x<=m.x){if(!m.L){g=m.P;break}m=m.L}else{if(!m.R){g=m;break}m=m.R}Iw.insert(g,y),g||(Dw=y)}}}}function Ns(t){var n=t.circle;n&&(n.P||(Dw=n.N),Iw.remove(n),Bw.push(n),cs(n),t.circle=null)}function Ss(){cs(this),this.edge=this.site=this.circle=null}function Es(t){var n=Hw.pop()||new Ss;return n.site=t,n}function As(t){Ns(t),Ow.remove(t),Hw.push(t),cs(t)}function Cs(t){var n=t.circle,e=n.x,r=n.cy,i=[e,r],o=t.P,u=t.N,a=[t];As(t);for(var c=o;c.circle&&Math.abs(e-c.circle.x)<jw&&Math.abs(r-c.circle.cy)<jw;)o=c.P,a.unshift(c),As(c),c=o;a.unshift(c),Ns(c);for(var s=u;s.circle&&Math.abs(e-s.circle.x)<jw&&Math.abs(r-s.circle.cy)<jw;)u=s.N,a.push(s),As(s),s=u;a.push(s),Ns(s);var f,l=a.length;for(f=1;f<l;++f)s=a[f],c=a[f-1],ds(s.edge,c.site,s.site,i);c=a[0],s=a[l-1],s.edge=hs(c.site,s.site,null,i),ks(c),ks(s)}function zs(t){for(var n,e,r,i,o=t[0],u=t[1],a=Ow._;a;)if((r=Ps(a,u)-o)>jw)a=a.L;else{if(!((i=o-Ls(a,u))>jw)){r>-jw?(n=a.P,e=a):i>-jw?(n=a,e=a.N):n=e=a;break}if(!a.R){n=a;break}a=a.R}gs(t);var c=Es(t);if(Ow.insert(n,c),n||e){if(n===e)return Ns(n),e=Es(n.site),Ow.insert(c,e),c.edge=e.edge=hs(n.site,c.site),ks(n),void ks(e);if(!e)return void(c.edge=hs(n.site,c.site));Ns(n),Ns(e);var s=n.site,f=s[0],l=s[1],h=t[0]-f,p=t[1]-l,d=e.site,v=d[0]-f,_=d[1]-l,y=2*(h*_-p*v),g=h*h+p*p,m=v*v+_*_,x=[(_*g-p*m)/y+f,(h*m-v*g)/y+l];ds(e.edge,s,d,x),c.edge=hs(s,t,null,x),e.edge=hs(t,d,null,x),ks(n),ks(e)}}function Ps(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var u=t.P;if(!u)return-1/0;e=u.site;var a=e[0],c=e[1],s=c-n;if(!s)return a;var f=a-r,l=1/o-1/s,h=f/s;return l?(-h+Math.sqrt(h*h-2*l*(f*f/(-2*s)-c+s/2+i-o/2)))/l+r:(r+a)/2}function Ls(t,n){var e=t.N;if(e)return Ps(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function Rs(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function qs(t,n){return n[1]-t[1]||n[0]-t[0]}function Us(t,n){var e,r,i,o=t.sort(qs).pop();for(Yw=[],Fw=new Array(t.length),Ow=new as,Iw=new as;;)if(i=Dw,o&&(!i||o[1]<i.y||o[1]===i.y&&o[0]<i.x))o[0]===e&&o[1]===r||(zs(o),e=o[0],r=o[1]),o=t.pop();else{if(!i)break;Cs(i.arc)}if(ws(),n){var u=+n[0][0],a=+n[0][1],c=+n[1][0],s=+n[1][1];ys(u,a,c,s),Ms(u,a,c,s)}this.edges=Yw,this.cells=Fw,Ow=Iw=Yw=Fw=null}function Ds(t,n,e){this.target=t,this.type=n,this.transform=e}function Os(t,n,e){this.k=t,this.x=n,this.y=e}function Fs(t){return t.__zoom||Ww}function Is(){t.event.stopImmediatePropagation()}function Ys(){return!t.event.button}function Bs(){var t,n,e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,t=e.width.baseVal.value,n=e.height.baseVal.value):(t=e.clientWidth,n=e.clientHeight),[[0,0],[t,n]]}function Hs(){return this.__zoom||Ww}var js=function(t,n){return t<n?-1:t>n?1:t>=n?0:NaN},Xs=function(t){return 1===t.length&&(t=n(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r<i;){var o=r+i>>>1;t(n[o],e)>0?i=o:r=o+1}return r}}},$s=Xs(js),Vs=$s.right,Ws=$s.left,Zs=function(t,n){null==n&&(n=e);for(var r=0,i=t.length-1,o=t[0],u=new Array(i<0?0:i);r<i;)u[r]=n(o,o=t[++r]);return u},Gs=function(t,n,r){var i,o,u,a,c=t.length,s=n.length,f=new Array(c*s);for(null==r&&(r=e),i=u=0;i<c;++i)for(a=t[i],o=0;o<s;++o,++u)f[u]=r(a,n[o]);return f},Js=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},Qs=function(t){return null===t?NaN:+t},Ks=function(t,n){var e,r,i=t.length,o=0,u=-1,a=0,c=0;if(null==n)for(;++u<i;)isNaN(e=Qs(t[u]))||(r=e-a,a+=r/++o,c+=r*(e-a));else for(;++u<i;)isNaN(e=Qs(n(t[u],u,t)))||(r=e-a,a+=r/++o,c+=r*(e-a));if(o>1)return c/(o-1)},tf=function(t,n){var e=Ks(t,n);return e?Math.sqrt(e):e},nf=function(t,n){var e,r,i,o=t.length,u=-1;if(null==n){for(;++u<o;)if(null!=(e=t[u])&&e>=e)for(r=i=e;++u<o;)null!=(e=t[u])&&(r>e&&(r=e),i<e&&(i=e))}else for(;++u<o;)if(null!=(e=n(t[u],u,t))&&e>=e)for(r=i=e;++u<o;)null!=(e=n(t[u],u,t))&&(r>e&&(r=e),i<e&&(i=e));return[r,i]},ef=Array.prototype,rf=ef.slice,of=ef.map,uf=function(t){return function(){return t}},af=function(t){return t},cf=function(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r<i;)o[r]=t+r*e;return o},sf=Math.sqrt(50),ff=Math.sqrt(10),lf=Math.sqrt(2),hf=function(t,n,e){var i,o,u,a=n<t,c=-1;if(a&&(i=t,t=n,n=i),0===(u=r(t,n,e))||!isFinite(u))return[];if(u>0)for(t=Math.ceil(t/u),n=Math.floor(n/u),o=new Array(i=Math.ceil(n-t+1));++c<i;)o[c]=(t+c)*u;else for(t=Math.floor(t*u),n=Math.ceil(n*u),o=new Array(i=Math.ceil(t-n+1));++c<i;)o[c]=(t-c)/u;return a&&o.reverse(),o},pf=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1},df=function(){function t(t){var o,u,a=t.length,c=new Array(a);for(o=0;o<a;++o)c[o]=n(t[o],o,t);var s=e(c),f=s[0],l=s[1],h=r(c,f,l);Array.isArray(h)||(h=i(f,l,h),h=cf(Math.ceil(f/h)*h,Math.floor(l/h)*h,h));for(var p=h.length;h[0]<=f;)h.shift(),--p;for(;h[p-1]>l;)h.pop(),--p;var d,v=new Array(p+1);for(o=0;o<=p;++o)d=v[o]=[],d.x0=o>0?h[o-1]:f,d.x1=o<p?h[o]:l;for(o=0;o<a;++o)u=c[o],f<=u&&u<=l&&v[Vs(h,u,0,p)].push(t[o]);return v}var n=af,e=nf,r=pf;return t.value=function(e){return arguments.length?(n="function"==typeof e?e:uf(e),t):n},t.domain=function(n){return arguments.length?(e="function"==typeof n?n:uf([n[0],n[1]]),t):e},t.thresholds=function(n){return arguments.length?(r="function"==typeof n?n:uf(Array.isArray(n)?rf.call(n):n),t):r},t},vf=function(t,n,e){if(null==e&&(e=Qs),r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),u=+e(t[o],o,t);return u+(+e(t[o+1],o+1,t)-u)*(i-o)}},_f=function(t,n,e){return t=of.call(t,Qs).sort(js),Math.ceil((e-n)/(2*(vf(t,.75)-vf(t,.25))*Math.pow(t.length,-1/3)))},yf=function(t,n,e){return Math.ceil((e-n)/(3.5*tf(t)*Math.pow(t.length,-1/3)))},gf=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&e>r&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&e>r&&(r=e);return r},mf=function(t,n){var e,r=t.length,i=r,o=-1,u=0;if(null==n)for(;++o<r;)isNaN(e=Qs(t[o]))?--i:u+=e;else for(;++o<r;)isNaN(e=Qs(n(t[o],o,t)))?--i:u+=e;if(i)return u/i},xf=function(t,n){var e,r=t.length,i=-1,o=[];if(null==n)for(;++i<r;)isNaN(e=Qs(t[i]))||o.push(e);else for(;++i<r;)isNaN(e=Qs(n(t[i],i,t)))||o.push(e);return vf(o.sort(js),.5)},bf=function(t){for(var n,e,r,i=t.length,o=-1,u=0;++o<i;)u+=t[o].length;for(e=new Array(u);--i>=0;)for(r=t[i],n=r.length;--n>=0;)e[--u]=r[n];return e},wf=function(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o<i;)if(null!=(e=t[o])&&e>=e)for(r=e;++o<i;)null!=(e=t[o])&&r>e&&(r=e)}else for(;++o<i;)if(null!=(e=n(t[o],o,t))&&e>=e)for(r=e;++o<i;)null!=(e=n(t[o],o,t))&&r>e&&(r=e);return r},Mf=function(t,n){for(var e=n.length,r=new Array(e);e--;)r[e]=t[n[e]];return r},Tf=function(t,n){if(e=t.length){var e,r,i=0,o=0,u=t[o];for(null==n&&(n=js);++i<e;)(n(r=t[i],u)<0||0!==n(u,u))&&(u=r,o=i);return 0===n(u,u)?o:void 0}},kf=function(t,n,e){for(var r,i,o=(null==e?t.length:e)-(n=null==n?0:+n);o;)i=Math.random()*o--|0,r=t[o+n],t[o+n]=t[i+n],t[i+n]=r;return t},Nf=function(t,n){var e,r=t.length,i=-1,o=0;if(null==n)for(;++i<r;)(e=+t[i])&&(o+=e);else for(;++i<r;)(e=+n(t[i],i,t))&&(o+=e);return o},Sf=function(t){if(!(i=t.length))return[];for(var n=-1,e=wf(t,o),r=new Array(e);++n<e;)for(var i,u=-1,a=r[n]=new Array(i);++u<i;)a[u]=t[u][n];return r},Ef=function(){return Sf(arguments)},Af=Array.prototype.slice,Cf=function(t){return t},zf=1,Pf=2,Lf=3,Rf=4,qf=1e-6,Uf={value:function(){}};_.prototype=v.prototype={constructor:_,on:function(t,n){var e,r=this._,i=y(t+"",r),o=-1,u=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o<u;)if(e=(t=i[o]).type)r[e]=m(r[e],t.name,n);else if(null==n)for(e in r)r[e]=m(r[e],t.name,null);return this}for(;++o<u;)if((e=(t=i[o]).type)&&(e=g(r[e],t.name)))return e}},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new _(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(r=this._[t],o=0,e=r.length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var Df="http://www.w3.org/1999/xhtml",Of={svg:"http://www.w3.org/2000/svg",xhtml:Df,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Ff=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Of.hasOwnProperty(n)?{space:Of[n],local:t}:t},If=function(t){var n=Ff(t);return(n.local?b:x)(n)},Yf=0;M.prototype=w.prototype={constructor:M,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Bf=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Hf=document.documentElement;if(!Hf.matches){var jf=Hf.webkitMatchesSelector||Hf.msMatchesSelector||Hf.mozMatchesSelector||Hf.oMatchesSelector;Bf=function(t){return function(){return jf.call(this,t)}}}}var Xf=Bf,$f={};if(t.event=null,"undefined"!=typeof document){"onmouseenter"in document.documentElement||($f={mouseenter:"mouseover",mouseleave:"mouseout"})}var Vf=function(t,n,e){var r,i,o=N(t+""),u=o.length;{if(!(arguments.length<2)){for(a=n?E:S,null==e&&(e=!1),r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var c,s=0,f=a.length;s<f;++s)for(r=0,c=a[s];r<u;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value}},Wf=function(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e},Zf=function(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]},Gf=function(t){var n=Wf();return n.changedTouches&&(n=n.changedTouches[0]),Zf(t,n)},Jf=function(t){return null==t?C:function(){return this.querySelector(t)}},Qf=function(t){"function"!=typeof t&&(t=Jf(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],c=a.length,s=r[i]=new Array(c),f=0;f<c;++f)(o=a[f])&&(u=t.call(o,o.__data__,f,a))&&("__data__"in o&&(u.__data__=o.__data__),s[f]=u);return new _t(r,this._parents)},Kf=function(t){return null==t?z:function(){return this.querySelectorAll(t)}},tl=function(t){"function"!=typeof t&&(t=Kf(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],c=a.length,s=0;s<c;++s)(u=a[s])&&(r.push(t.call(u,u.__data__,s,a)),i.push(u));return new _t(r,i)},nl=function(t){"function"!=typeof t&&(t=Xf(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,c=r[i]=[],s=0;s<a;++s)(o=u[s])&&t.call(o,o.__data__,s,u)&&c.push(o);return new _t(r,this._parents)},el=function(t){return new Array(t.length)},rl=function(){return new _t(this._enter||this._groups.map(el),this._parents)};P.prototype={constructor:P,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var il=function(t){return function(){return t}},ol="$",ul=function(t,n){if(!t)return p=new Array(this.size()),s=-1,this.each(function(t){p[++s]=t}),p;var e=n?R:L,r=this._parents,i=this._groups;"function"!=typeof t&&(t=il(t));for(var o=i.length,u=new Array(o),a=new Array(o),c=new Array(o),s=0;s<o;++s){var f=r[s],l=i[s],h=l.length,p=t.call(f,f&&f.__data__,s,r),d=p.length,v=a[s]=new Array(d),_=u[s]=new Array(d);e(f,l,v,_,c[s]=new Array(h),p,n);for(var y,g,m=0,x=0;m<d;++m)if(y=v[m]){for(m>=x&&(x=m+1);!(g=_[x])&&++x<d;);y._next=g||null}}return u=new _t(u,r),u._enter=a,u._exit=c,u},al=function(){return new _t(this._exit||this._groups.map(el),this._parents)},cl=function(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var c,s=n[a],f=e[a],l=s.length,h=u[a]=new Array(l),p=0;p<l;++p)(c=s[p]||f[p])&&(h[p]=c);for(;a<r;++a)u[a]=n[a];return new _t(u,this._parents)},sl=function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},fl=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=q);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],c=a.length,s=i[o]=new Array(c),f=0;f<c;++f)(u=a[f])&&(s[f]=u);s.sort(n)}return new _t(i,this._parents).order()},ll=function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},hl=function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},pl=function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},dl=function(){var t=0;return this.each(function(){++t}),t},vl=function(){return!this.node()},_l=function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},yl=function(t,n){var e=Ff(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?D:U:"function"==typeof n?e.local?Y:I:e.local?F:O)(e,n))},gl=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView},ml=function(t,n,e){return arguments.length>1?this.each((null==n?B:"function"==typeof n?j:H)(t,n,null==e?"":e)):X(this.node(),t)},xl=function(t,n){return arguments.length>1?this.each((null==n?$:"function"==typeof n?W:V)(t,n)):this.node()[t]};J.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var bl=function(t,n){var e=Z(t+"");if(arguments.length<2){for(var r=G(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?et:n?tt:nt)(e,n))},wl=function(t){return arguments.length?this.each(null==t?rt:("function"==typeof t?ot:it)(t)):this.node().textContent},Ml=function(t){return arguments.length?this.each(null==t?ut:("function"==typeof t?ct:at)(t)):this.node().innerHTML},Tl=function(){return this.each(st)},kl=function(){return this.each(ft)},Nl=function(t){var n="function"==typeof t?t:If(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},Sl=function(t,n){var e="function"==typeof t?t:If(t),r=null==n?lt:"function"==typeof n?n:Jf(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},El=function(){return this.each(ht)},Al=function(t){return arguments.length?this.property("__data__",t):this.node().__data__},Cl=function(t,n){return this.each(("function"==typeof n?vt:dt)(t,n))},zl=[null];_t.prototype=yt.prototype={constructor:_t,select:Qf,selectAll:tl,filter:nl,data:ul,enter:rl,exit:al,merge:cl,order:sl,sort:fl,call:ll,nodes:hl,node:pl,size:dl,empty:vl,each:_l,attr:yl,style:ml,property:xl,classed:bl,text:wl,html:Ml,raise:Tl,lower:kl,append:Nl,insert:Sl,remove:El,datum:Al,on:Vf,dispatch:Cl};var Pl=function(t){return"string"==typeof t?new _t([[document.querySelector(t)]],[document.documentElement]):new _t([[t]],zl)},Ll=function(t){return"string"==typeof t?new _t([document.querySelectorAll(t)],[document.documentElement]):new _t([null==t?[]:t],zl) | |
},Rl=function(t,n,e){arguments.length<3&&(e=n,n=Wf().changedTouches);for(var r,i=0,o=n?n.length:0;i<o;++i)if((r=n[i]).identifier===e)return Zf(t,r);return null},ql=function(t,n){null==n&&(n=Wf().touches);for(var e=0,r=n?n.length:0,i=new Array(r);e<r;++e)i[e]=Zf(t,n[e]);return i},Ul=function(){t.event.preventDefault(),t.event.stopImmediatePropagation()},Dl=function(t){var n=t.document.documentElement,e=Pl(t).on("dragstart.drag",Ul,!0);"onselectstart"in n?e.on("selectstart.drag",Ul,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")},Ol=function(t){return function(){return t}};xt.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var Fl=function(){function n(t){t.on("mousedown.drag",e).on("touchstart.drag",o).on("touchmove.drag",u).on("touchend.drag touchcancel.drag",a).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function e(){if(!h&&p.apply(this,arguments)){var n=c("mouse",d.apply(this,arguments),Gf,this,arguments);n&&(Pl(t.event.view).on("mousemove.drag",r,!0).on("mouseup.drag",i,!0),Dl(t.event.view),gt(),l=!1,s=t.event.clientX,f=t.event.clientY,n("start"))}}function r(){if(Ul(),!l){var n=t.event.clientX-s,e=t.event.clientY-f;l=n*n+e*e>x}y.mouse("drag")}function i(){Pl(t.event.view).on("mousemove.drag mouseup.drag",null),mt(t.event.view,l),Ul(),y.mouse("end")}function o(){if(p.apply(this,arguments)){var n,e,r=t.event.changedTouches,i=d.apply(this,arguments),o=r.length;for(n=0;n<o;++n)(e=c(r[n].identifier,i,Rl,this,arguments))&&(gt(),e("start"))}}function u(){var n,e,r=t.event.changedTouches,i=r.length;for(n=0;n<i;++n)(e=y[r[n].identifier])&&(Ul(),e("drag"))}function a(){var n,e,r=t.event.changedTouches,i=r.length;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),n=0;n<i;++n)(e=y[r[n].identifier])&&(gt(),e("end"))}function c(e,r,i,o,u){var a,c,s,f=i(r,e),l=g.copy();if(A(new xt(n,"beforestart",a,e,m,f[0],f[1],0,0,l),function(){return null!=(t.event.subject=a=_.apply(o,u))&&(c=a.x-f[0]||0,s=a.y-f[1]||0,!0)}))return function t(h){var p,d=f;switch(h){case"start":y[e]=t,p=m++;break;case"end":delete y[e],--m;case"drag":f=i(r,e),p=m}A(new xt(n,h,a,e,p,f[0]+c,f[1]+s,f[0]-d[0],f[1]-d[1],l),l.apply,l,[h,o,u])}}var s,f,l,h,p=bt,d=wt,_=Mt,y={},g=v("start","drag","end"),m=0,x=0;return n.filter=function(t){return arguments.length?(p="function"==typeof t?t:Ol(!!t),n):p},n.container=function(t){return arguments.length?(d="function"==typeof t?t:Ol(t),n):d},n.subject=function(t){return arguments.length?(_="function"==typeof t?t:Ol(t),n):_},n.on=function(){var t=g.on.apply(g,arguments);return t===g?n:t},n.clickDistance=function(t){return arguments.length?(x=(t=+t)*t,n):Math.sqrt(x)},n},Il=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t},Yl="\\s*([+-]?\\d+)\\s*",Bl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jl=/^#([0-9a-f]{3})$/,Xl=/^#([0-9a-f]{6})$/,$l=new RegExp("^rgb\\("+[Yl,Yl,Yl]+"\\)$"),Vl=new RegExp("^rgb\\("+[Hl,Hl,Hl]+"\\)$"),Wl=new RegExp("^rgba\\("+[Yl,Yl,Yl,Bl]+"\\)$"),Zl=new RegExp("^rgba\\("+[Hl,Hl,Hl,Bl]+"\\)$"),Gl=new RegExp("^hsl\\("+[Bl,Hl,Hl]+"\\)$"),Jl=new RegExp("^hsla\\("+[Bl,Hl,Hl,Bl]+"\\)$"),Ql={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Il(kt,Nt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),Il(zt,Ct,Tt(kt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new zt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new zt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Il(qt,Rt,Tt(kt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new qt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new zt(Ut(t>=240?t-240:t+120,i,r),Ut(t,i,r),Ut(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Kl=Math.PI/180,th=180/Math.PI,nh=.95047,eh=1,rh=1.08883,ih=4/29,oh=6/29,uh=3*oh*oh,ah=oh*oh*oh;Il(Ft,Ot,Tt(kt,{brighter:function(t){return new Ft(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Ft(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=eh*Yt(t),n=nh*Yt(n),e=rh*Yt(e),new zt(Bt(3.2404542*n-1.5371385*t-.4985314*e),Bt(-.969266*n+1.8760108*t+.041556*e),Bt(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),Il($t,Xt,Tt(kt,{brighter:function(t){return new $t(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new $t(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Dt(this).rgb()}}));var ch=-.14861,sh=1.78277,fh=-.29227,lh=-.90649,hh=1.97294,ph=hh*lh,dh=hh*sh,vh=sh*fh-lh*ch;Il(Zt,Wt,Tt(kt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Zt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Zt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Kl,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new zt(255*(n+e*(ch*r+sh*i)),255*(n+e*(fh*r+lh*i)),255*(n+e*(hh*r)),this.opacity)}}));var _h,yh,gh,mh,xh,bh,wh=function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],u=r>0?t[r-1]:2*i-o,a=r<n-1?t[r+2]:2*o-i;return Gt((e-r/n)*n,u,i,o,a)}},Mh=function(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),i=t[(r+n-1)%n],o=t[r%n],u=t[(r+1)%n],a=t[(r+2)%n];return Gt((e-r/n)*n,i,o,u,a)}},Th=function(t){return function(){return t}},kh=function t(n){function e(t,n){var e=r((t=Ct(t)).r,(n=Ct(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),u=nn(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}var r=tn(n);return e.gamma=t,e}(1),Nh=en(wh),Sh=en(Mh),Eh=function(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),u=new Array(r);for(e=0;e<i;++e)o[e]=qh(t[e],n[e]);for(;e<r;++e)u[e]=n[e];return function(t){for(e=0;e<i;++e)u[e]=o[e](t);return u}},Ah=function(t,n){var e=new Date;return t=+t,n-=t,function(r){return e.setTime(t+n*r),e}},Ch=function(t,n){return t=+t,n-=t,function(e){return t+n*e}},zh=function(t,n){var e,r={},i={};null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={});for(e in n)e in t?r[e]=qh(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}},Ph=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lh=new RegExp(Ph.source,"g"),Rh=function(t,n){var e,r,i,o=Ph.lastIndex=Lh.lastIndex=0,u=-1,a=[],c=[];for(t+="",n+="";(e=Ph.exec(t))&&(r=Lh.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,c.push({i:u,x:Ch(e,r)})),o=Lh.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?c[0]?on(c[0].x):rn(n):(n=c.length,function(t){for(var e,r=0;r<n;++r)a[(e=c[r]).i]=e.x(t);return a.join("")})},qh=function(t,n){var e,r=typeof n;return null==n||"boolean"===r?Th(n):("number"===r?Ch:"string"===r?(e=Nt(n))?(n=e,kh):Rh:n instanceof Nt?kh:n instanceof Date?Ah:Array.isArray(n)?Eh:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?zh:Ch)(t,n)},Uh=function(t,n){return t=+t,n-=t,function(e){return Math.round(t+n*e)}},Dh=180/Math.PI,Oh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Fh=function(t,n,e,r,i,o){var u,a,c;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,c/=a),t*r<n*e&&(t=-t,n=-n,c=-c,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Dh,skewX:Math.atan(c)*Dh,scaleX:u,scaleY:a}},Ih=cn(un,"px, ","px)","deg)"),Yh=cn(an,", ",")",")"),Bh=Math.SQRT2,Hh=function(t,n){var e,r,i=t[0],o=t[1],u=t[2],a=n[0],c=n[1],s=n[2],f=a-i,l=c-o,h=f*f+l*l;if(h<1e-12)r=Math.log(s/u)/Bh,e=function(t){return[i+t*f,o+t*l,u*Math.exp(Bh*t*r)]};else{var p=Math.sqrt(h),d=(s*s-u*u+4*h)/(2*u*2*p),v=(s*s-u*u-4*h)/(2*s*2*p),_=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-_)/Bh,e=function(t){var n=t*r,e=sn(_),a=u/(2*p)*(e*ln(Bh*n+_)-fn(_));return[i+a*f,o+a*l,u*e/sn(Bh*n+_)]}}return e.duration=1e3*r,e},jh=hn(Kt),Xh=hn(nn),$h=dn(Kt),Vh=dn(nn),Wh=vn(Kt),Zh=vn(nn),Gh=function(t,n){for(var e=new Array(n),r=0;r<n;++r)e[r]=t(r/(n-1));return e},Jh=0,Qh=0,Kh=0,tp=1e3,np=0,ep=0,rp=0,ip="object"==typeof performance&&performance.now?performance:Date,op="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};gn.prototype=mn.prototype={constructor:gn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?_n():+e)+(null==n?0:+n),this._next||bh===this||(bh?bh._next=this:xh=this,bh=this),this._call=t,this._time=e,Tn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tn())}};var up=function(t,n,e){var r=new gn;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r},ap=function(t,n,e){var r=new gn,i=n;return null==n?(r.restart(t,n,e),r):(n=+n,e=null==e?_n():+e,r.restart(function o(u){u+=i,r.restart(o,i+=n,e),t(u)},n,e),r)},cp=v("start","end","interrupt"),sp=[],fp=0,lp=1,hp=2,pp=3,dp=4,vp=5,_p=6,yp=function(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};En(t,e,{name:n,index:r,group:i,on:cp,tween:sp,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:fp})},gp=function(t,n){var e,r,i,o=t.__transition,u=!0;if(o){n=null==n?null:n+"";for(i in o)(e=o[i]).name===n?(r=e.state>hp&&e.state<vp,e.state=_p,e.timer.stop(),r&&e.on.call("interrupt",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}},mp=function(t){return this.each(function(){gp(this,t)})},xp=function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Sn(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?An:Cn)(e,t,n))},bp=function(t,n){var e;return("number"==typeof n?Ch:n instanceof Nt?kh:(e=Nt(n))?(n=e,kh):Rh)(t,n)},wp=function(t,n){var e=Ff(t),r="transform"===e?Yh:bp;return this.attrTween(t,"function"==typeof n?(e.local?Dn:Un)(e,r,zn(this,"attr."+t,n)):null==n?(e.local?Ln:Pn)(e):(e.local?qn:Rn)(e,r,n+""))},Mp=function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=Ff(t);return this.tween(e,(r.local?On:Fn)(r,n))},Tp=function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?In:Yn)(n,t)):Sn(this.node(),n).delay},kp=function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Bn:Hn)(n,t)):Sn(this.node(),n).duration},Np=function(t){var n=this._id;return arguments.length?this.each(jn(n,t)):Sn(this.node(),n).ease},Sp=function(t){"function"!=typeof t&&(t=Xf(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,c=r[i]=[],s=0;s<a;++s)(o=u[s])&&t.call(o,o.__data__,s,u)&&c.push(o);return new ne(r,this._parents,this._name,this._id)},Ep=function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var c,s=n[a],f=e[a],l=s.length,h=u[a]=new Array(l),p=0;p<l;++p)(c=s[p]||f[p])&&(h[p]=c);for(;a<r;++a)u[a]=n[a];return new ne(u,this._parents,this._name,this._id)},Ap=function(t,n){var e=this._id;return arguments.length<2?Sn(this.node(),e).on.on(t):this.each($n(e,t,n))},Cp=function(){return this.on("end.remove",Vn(this._id))},zp=function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Jf(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,c,s=r[u],f=s.length,l=o[u]=new Array(f),h=0;h<f;++h)(a=s[h])&&(c=t.call(a,a.__data__,h,s))&&("__data__"in a&&(c.__data__=a.__data__),l[h]=c,yp(l[h],n,e,h,l,Sn(a,e)));return new ne(o,this._parents,n,e)},Pp=function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Kf(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var c,s=r[a],f=s.length,l=0;l<f;++l)if(c=s[l]){for(var h,p=t.call(c,c.__data__,l,s),d=Sn(c,e),v=0,_=p.length;v<_;++v)(h=p[v])&&yp(h,n,e,v,p,d);o.push(p),u.push(c)}return new ne(o,u,n,e)},Lp=yt.prototype.constructor,Rp=function(){return new Lp(this._groups,this._parents)},qp=function(t,n,e){var r="transform"==(t+="")?Ih:bp;return null==n?this.styleTween(t,Wn(t,r)).on("end.style."+t,Zn(t)):this.styleTween(t,"function"==typeof n?Jn(t,r,zn(this,"style."+t,n)):Gn(t,r,n+""),e)},Up=function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,Qn(t,n,null==e?"":e))},Dp=function(t){return this.tween("text","function"==typeof t?te(zn(this,"text",t)):Kn(null==t?"":t+""))},Op=function(){for(var t=this._name,n=this._id,e=re(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],c=a.length,s=0;s<c;++s)if(u=a[s]){var f=Sn(u,n);yp(u,t,e,s,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new ne(r,this._parents,t,e)},Fp=0,Ip=yt.prototype;ne.prototype=ee.prototype={constructor:ne,select:zp,selectAll:Pp,filter:Sp,merge:Ep,selection:Rp,transition:Op,call:Ip.call,nodes:Ip.nodes,node:Ip.node,size:Ip.size,empty:Ip.empty,each:Ip.each,on:Ap,attr:wp,attrTween:Mp,style:qp,styleTween:Up,text:Dp,remove:Cp,tween:xp,delay:Tp,duration:kp,ease:Np};var Yp=function t(n){function e(t){return Math.pow(t,n)}return n=+n,e.exponent=t,e}(3),Bp=function t(n){function e(t){return 1-Math.pow(1-t,n)}return n=+n,e.exponent=t,e}(3),Hp=function t(n){function e(t){return((t*=2)<=1?Math.pow(t,n):2-Math.pow(2-t,n))/2}return n=+n,e.exponent=t,e}(3),jp=Math.PI,Xp=jp/2,$p=4/11,Vp=6/11,Wp=8/11,Zp=.75,Gp=9/11,Jp=10/11,Qp=.9375,Kp=21/22,td=63/64,nd=1/$p/$p,ed=function t(n){function e(t){return t*t*((n+1)*t-n)}return n=+n,e.overshoot=t,e}(1.70158),rd=function t(n){function e(t){return--t*t*((n+1)*t+n)+1}return n=+n,e.overshoot=t,e}(1.70158),id=function t(n){function e(t){return((t*=2)<1?t*t*((n+1)*t-n):(t-=2)*t*((n+1)*t+n)+2)/2}return n=+n,e.overshoot=t,e}(1.70158),od=2*Math.PI,ud=function t(n,e){function r(t){return n*Math.pow(2,10*--t)*Math.sin((i-t)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=od);return r.amplitude=function(n){return t(n,e*od)},r.period=function(e){return t(n,e)},r}(1,.3),ad=function t(n,e){function r(t){return 1-n*Math.pow(2,-10*(t=+t))*Math.sin((t+i)/e)}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=od);return r.amplitude=function(n){return t(n,e*od)},r.period=function(e){return t(n,e)},r}(1,.3),cd=function t(n,e){function r(t){return((t=2*t-1)<0?n*Math.pow(2,10*t)*Math.sin((i-t)/e):2-n*Math.pow(2,-10*t)*Math.sin((i+t)/e))/2}var i=Math.asin(1/(n=Math.max(1,n)))*(e/=od);return r.amplitude=function(n){return t(n,e*od)},r.period=function(e){return t(n,e)},r}(1,.3),sd={time:null,delay:0,duration:250,ease:fe},fd=function(t){var n,e;t instanceof ne?(n=t._id,t=t._name):(n=re(),(e=sd).time=_n(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],c=a.length,s=0;s<c;++s)(u=a[s])&&yp(u,t,n,s,a,e||Me(u,n));return new ne(r,this._parents,t,n)};yt.prototype.interrupt=mp,yt.prototype.transition=fd;var ld=[null],hd=function(t,n){var e,r,i=t.__transition;if(i){n=null==n?null:n+"";for(r in i)if((e=i[r]).state>lp&&e.name===n)return new ne([[t]],ld,n,+r)}return null},pd=function(t){return function(){return t}},dd=function(t,n,e){this.target=t,this.type=n,this.selection=e},vd=function(){t.event.preventDefault(),t.event.stopImmediatePropagation()},_d={name:"drag"},yd={name:"space"},gd={name:"handle"},md={name:"center"},xd={name:"x",handles:["e","w"].map(ke),input:function(t,n){return t&&[[t[0],n[0][1]],[t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},bd={name:"y",handles:["n","s"].map(ke),input:function(t,n){return t&&[[n[0][0],t[0]],[n[1][0],t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},wd={name:"xy",handles:["n","e","s","w","nw","ne","se","sw"].map(ke),input:function(t){return t},output:function(t){return t}},Md={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Td={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},kd={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Nd={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Sd={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1},Ed=function(){return Le(wd)},Ad=Math.cos,Cd=Math.sin,zd=Math.PI,Pd=zd/2,Ld=2*zd,Rd=Math.max,qd=function(){function t(t){var o,u,a,c,s,f,l=t.length,h=[],p=cf(l),d=[],v=[],_=v.groups=new Array(l),y=new Array(l*l);for(o=0,s=-1;++s<l;){for(u=0,f=-1;++f<l;)u+=t[s][f];h.push(u),d.push(cf(l)),o+=u}for(e&&p.sort(function(t,n){return e(h[t],h[n])}),r&&d.forEach(function(n,e){n.sort(function(n,i){return r(t[e][n],t[e][i])})}),o=Rd(0,Ld-n*l)/o,c=o?n:Ld/l,u=0,s=-1;++s<l;){for(a=u,f=-1;++f<l;){var g=p[s],m=d[g][f],x=t[g][m],b=u,w=u+=x*o;y[m*l+g]={index:g,subindex:m,startAngle:b,endAngle:w,value:x}}_[g]={index:g,startAngle:a,endAngle:u,value:h[g]},u+=c}for(s=-1;++s<l;)for(f=s-1;++f<l;){var M=y[f*l+s],T=y[s*l+f];(M.value||T.value)&&v.push(M.value<T.value?{source:T,target:M}:{source:M,target:T})}return i?v.sort(i):v}var n=0,e=null,r=null,i=null;return t.padAngle=function(e){return arguments.length?(n=Rd(0,e),t):n},t.sortGroups=function(n){return arguments.length?(e=n,t):e},t.sortSubgroups=function(n){return arguments.length?(r=n,t):r},t.sortChords=function(n){return arguments.length?(null==n?i=null:(i=Re(n))._=n,t):i&&i._},t},Ud=Array.prototype.slice,Dd=function(t){return function(){return t}},Od=Math.PI,Fd=2*Od,Id=Fd-1e-6;qe.prototype=Ue.prototype={constructor:qe,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,u=this._y1,a=e-t,c=r-n,s=o-t,f=u-n,l=s*s+f*f;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(l>1e-6)if(Math.abs(f*a-c*s)>1e-6&&i){var h=e-o,p=r-u,d=a*a+c*c,v=h*h+p*p,_=Math.sqrt(d),y=Math.sqrt(l),g=i*Math.tan((Od-Math.acos((d+l-v)/(2*_*y)))/2),m=g/y,x=g/_;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*s)+","+(n+m*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>s*p)+","+(this._x1=t+x*a)+","+(this._y1=n+x*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var u=e*Math.cos(r),a=e*Math.sin(r),c=t+u,s=n+a,f=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+s:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-s)>1e-6)&&(this._+="L"+c+","+s),e&&(l<0&&(l=l%Fd+Fd),l>Id?this._+="A"+e+","+e+",0,1,"+f+","+(t-u)+","+(n-a)+"A"+e+","+e+",0,1,"+f+","+(this._x1=c)+","+(this._y1=s):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Od)+","+f+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var Yd=function(){function t(){var t,a=Ud.call(arguments),c=n.apply(this,a),s=e.apply(this,a),f=+r.apply(this,(a[0]=c,a)),l=i.apply(this,a)-Pd,h=o.apply(this,a)-Pd,p=f*Ad(l),d=f*Cd(l),v=+r.apply(this,(a[0]=s,a)),_=i.apply(this,a)-Pd,y=o.apply(this,a)-Pd;if(u||(u=t=Ue()),u.moveTo(p,d),u.arc(0,0,f,l,h),l===_&&h===y||(u.quadraticCurveTo(0,0,v*Ad(_),v*Cd(_)),u.arc(0,0,v,_,y)),u.quadraticCurveTo(0,0,p,d),u.closePath(),t)return u=null,t+""||null}var n=De,e=Oe,r=Fe,i=Ie,o=Ye,u=null;return t.radius=function(n){return arguments.length?(r="function"==typeof n?n:Dd(+n),t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:Dd(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:Dd(+n),t):o},t.source=function(e){return arguments.length?(n=e,t):n},t.target=function(n){return arguments.length?(e=n,t):e},t.context=function(n){return arguments.length?(u=null==n?null:n,t):u},t};Be.prototype=He.prototype={constructor:Be,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Bd=function(){function t(n,i,u,a){if(i>=o.length)return null!=r?r(n):null!=e?n.sort(e):n;for(var c,s,f,l=-1,h=n.length,p=o[i++],d=He(),v=u();++l<h;)(f=d.get(c=p(s=n[l])+""))?f.push(s):d.set(c,[s]);return d.each(function(n,e){a(v,e,t(n,i,u,a))}),v}function n(t,e){if(++e>o.length)return t;var i,a=u[e-1];return null!=r&&e>=o.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=a?i.sort(function(t,n){return a(t.key,n.key)}):i}var e,r,i,o=[],u=[];return i={object:function(n){return t(n,0,je,Xe)},map:function(n){return t(n,0,$e,Ve)},entries:function(e){return n(t(e,0,$e,Ve),0)},key:function(t){return o.push(t),i},sortKeys:function(t){return u[o.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}},Hd=He.prototype;We.prototype=Ze.prototype={constructor:We,has:Hd.has,add:function(t){return t+="",this["$"+t]=t,this},remove:Hd.remove,clear:Hd.clear,values:Hd.keys,size:Hd.size,empty:Hd.empty,each:Hd.each};var jd=function(t){var n=[];for(var e in t)n.push(e);return n},Xd=function(t){var n=[];for(var e in t)n.push(t[e]);return n},$d=function(t){var n=[];for(var e in t)n.push({key:e,value:t[e]});return n},Vd=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?Je(t,n):Ge(t)});return o.columns=i,o}function e(t,n){function e(){if(f>=s)return u;if(i)return i=!1,o;var n,e=f;if(34===t.charCodeAt(e)){for(var r=e;r++<s;)if(34===t.charCodeAt(r)){if(34!==t.charCodeAt(r+1))break;++r}return f=r+2,n=t.charCodeAt(r+1),13===n?(i=!0,10===t.charCodeAt(r+2)&&++f):10===n&&(i=!0),t.slice(e+1,r).replace(/""/g,'"')}for(;f<s;){var a=1;if(10===(n=t.charCodeAt(f++)))i=!0;else if(13===n)i=!0,10===t.charCodeAt(f)&&(++f,++a);else if(n!==c)continue;return t.slice(e,f-a)}return t.slice(e)}for(var r,i,o={},u={},a=[],s=t.length,f=0,l=0;(r=e())!==u;){for(var h=[];r!==o&&r!==u;)h.push(r),r=e();n&&null==(h=n(h,l++))||a.push(h)}return a}function r(n,e){return null==e&&(e=Qe(n)),[e.map(u).join(t)].concat(n.map(function(n){return e.map(function(t){return u(n[t])}).join(t)})).join("\n")}function i(t){return t.map(o).join("\n")}function o(n){return n.map(u).join(t)}function u(t){return null==t?"":a.test(t+="")?'"'+t.replace(/\"/g,'""')+'"':t}var a=new RegExp('["'+t+"\n\r]"),c=t.charCodeAt(0);return{parse:n,parseRows:e,format:r,formatRows:i}},Wd=Vd(","),Zd=Wd.parse,Gd=Wd.parseRows,Jd=Wd.format,Qd=Wd.formatRows,Kd=Vd("\t"),tv=Kd.parse,nv=Kd.parseRows,ev=Kd.format,rv=Kd.formatRows,iv=function(t,n){function e(){var e,i,o=r.length,u=0,a=0;for(e=0;e<o;++e)i=r[e],u+=i.x,a+=i.y;for(u=u/o-t,a=a/o-n,e=0;e<o;++e)i=r[e],i.x-=u,i.y-=a}var r;return null==t&&(t=0),null==n&&(n=0),e.initialize=function(t){r=t},e.x=function(n){return arguments.length?(t=+n,e):t},e.y=function(t){return arguments.length?(n=+t,e):n},e},ov=function(t){return function(){return t}},uv=function(){return 1e-6*(Math.random()-.5)},av=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return Ke(this.cover(n,e),n,e,t)},cv=function(t,n){if(isNaN(t=+t)||isNaN(n=+n))return this;var e=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(e))i=(e=Math.floor(t))+1,o=(r=Math.floor(n))+1;else{if(!(e>t||t>i||r>n||n>o))return this;var u,a,c=i-e,s=this._root;switch(a=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,o=r+c,t>i||n>o);break;case 1:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,o=r+c,e>t||n>o);break;case 2:do{u=new Array(4),u[a]=s,s=u}while(c*=2,i=e+c,r=o-c,t>i||r>n);break;case 3:do{u=new Array(4),u[a]=s,s=u}while(c*=2,e=i-c,r=o-c,e>t||r>n)}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},sv=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},fv=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},lv=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},hv=function(t,n,e){var r,i,o,u,a,c,s,f=this._x0,l=this._y0,h=this._x1,p=this._y1,d=[],v=this._root;for(v&&d.push(new lv(v,f,l,h,p)),null==e?e=1/0:(f=t-e,l=n-e,h=t+e,p=n+e,e*=e);c=d.pop();)if(!(!(v=c.node)||(i=c.x0)>h||(o=c.y0)>p||(u=c.x1)<f||(a=c.y1)<l))if(v.length){var _=(i+u)/2,y=(o+a)/2;d.push(new lv(v[3],_,y,u,a),new lv(v[2],i,y,_,a),new lv(v[1],_,o,u,y),new lv(v[0],i,o,_,y)),(s=(n>=y)<<1|t>=_)&&(c=d[d.length-1],d[d.length-1]=d[d.length-1-s],d[d.length-1-s]=c)}else{var g=t-+this._x.call(null,v.data),m=n-+this._y.call(null,v.data),x=g*g+m*m;if(x<e){var b=Math.sqrt(e=x);f=t-b,l=n-b,h=t+b,p=n+b,r=v.data}}return r},pv=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(u=+this._y.call(null,t)))return this;var n,e,r,i,o,u,a,c,s,f,l,h,p=this._root,d=this._x0,v=this._y0,_=this._x1,y=this._y1;if(!p)return this;if(p.length)for(;;){if((s=o>=(a=(d+_)/2))?d=a:_=a,(f=u>=(c=(v+y)/2))?v=c:y=c,n=p,!(p=p[l=f<<1|s]))return this;if(!p.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;p.data!==t;)if(r=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(p=n[0]||n[1]||n[2]||n[3])&&p===(n[3]||n[2]||n[1]||n[0])&&!p.length&&(e?e[h]=p:this._root=p),this):(this._root=i,this)},dv=function(){return this._root},vv=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},_v=function(t){var n,e,r,i,o,u,a=[],c=this._root;for(c&&a.push(new lv(c,this._x0,this._y0,this._x1,this._y1));n=a.pop();)if(!t(c=n.node,r=n.x0,i=n.y0,o=n.x1,u=n.y1)&&c.length){var s=(r+o)/2,f=(i+u)/2;(e=c[3])&&a.push(new lv(e,s,f,o,u)),(e=c[2])&&a.push(new lv(e,r,f,s,u)),(e=c[1])&&a.push(new lv(e,s,i,o,f)),(e=c[0])&&a.push(new lv(e,r,i,s,f))}return this},yv=function(t){var n,e=[],r=[];for(this._root&&e.push(new lv(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,u=n.x0,a=n.y0,c=n.x1,s=n.y1,f=(u+c)/2,l=(a+s)/2;(o=i[0])&&e.push(new lv(o,u,a,f,l)),(o=i[1])&&e.push(new lv(o,f,a,c,l)),(o=i[2])&&e.push(new lv(o,u,l,f,s)),(o=i[3])&&e.push(new lv(o,f,l,c,s))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},gv=function(t){return arguments.length?(this._x=t,this):this._x},mv=function(t){return arguments.length?(this._y=t,this):this._y},xv=ir.prototype=or.prototype;xv.copy=function(){var t,n,e=new or(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ur(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ur(n));return e},xv.add=av,xv.addAll=tr,xv.cover=cv,xv.data=sv,xv.extent=fv,xv.find=hv,xv.remove=pv,xv.removeAll=nr,xv.root=dv,xv.size=vv,xv.visit=_v,xv.visitAfter=yv,xv.x=gv,xv.y=mv;var bv,wv=function(t){function n(){function t(t,n,e,r,i){var o=t.data,a=t.r,p=l+a;{if(!o)return n>s+p||r<s-p||e>f+p||i<f-p;if(o.index>c.index){var d=s-o.x-o.vx,v=f-o.y-o.vy,_=d*d+v*v;_<p*p&&(0===d&&(d=uv(),_+=d*d),0===v&&(v=uv(),_+=v*v),_=(p-(_=Math.sqrt(_)))/_*u,c.vx+=(d*=_)*(p=(a*=a)/(h+a)),c.vy+=(v*=_)*p,o.vx-=d*(p=1-p),o.vy-=v*p)}}}for(var n,r,c,s,f,l,h,p=i.length,d=0;d<a;++d)for(r=ir(i,ar,cr).visitAfter(e),n=0;n<p;++n)c=i[n],l=o[c.index],h=l*l,s=c.x+c.vx,f=c.y+c.vy,r.visit(t)}function e(t){if(t.data)return t.r=o[t.data.index];for(var n=t.r=0;n<4;++n)t[n]&&t[n].r>t.r&&(t.r=t[n].r)}function r(){if(i){var n,e,r=i.length;for(o=new Array(r),n=0;n<r;++n)e=i[n],o[e.index]=+t(e,n,i)}}var i,o,u=1,a=1 | |
;return"function"!=typeof t&&(t=ov(null==t?1:+t)),n.initialize=function(t){i=t,r()},n.iterations=function(t){return arguments.length?(a=+t,n):a},n.strength=function(t){return arguments.length?(u=+t,n):u},n.radius=function(e){return arguments.length?(t="function"==typeof e?e:ov(+e),r(),n):t},n},Mv=function(t){function n(t){return 1/Math.min(s[t.source.index],s[t.target.index])}function e(n){for(var e=0,r=t.length;e<d;++e)for(var i,o,c,s,l,h,p,v=0;v<r;++v)i=t[v],o=i.source,c=i.target,s=c.x+c.vx-o.x-o.vx||uv(),l=c.y+c.vy-o.y-o.vy||uv(),h=Math.sqrt(s*s+l*l),h=(h-a[v])/h*n*u[v],s*=h,l*=h,c.vx-=s*(p=f[v]),c.vy-=l*p,o.vx+=s*(p=1-p),o.vy+=l*p}function r(){if(c){var n,e,r=c.length,h=t.length,p=He(c,l);for(n=0,s=new Array(r);n<h;++n)e=t[n],e.index=n,"object"!=typeof e.source&&(e.source=fr(p,e.source)),"object"!=typeof e.target&&(e.target=fr(p,e.target)),s[e.source.index]=(s[e.source.index]||0)+1,s[e.target.index]=(s[e.target.index]||0)+1;for(n=0,f=new Array(h);n<h;++n)e=t[n],f[n]=s[e.source.index]/(s[e.source.index]+s[e.target.index]);u=new Array(h),i(),a=new Array(h),o()}}function i(){if(c)for(var n=0,e=t.length;n<e;++n)u[n]=+h(t[n],n,t)}function o(){if(c)for(var n=0,e=t.length;n<e;++n)a[n]=+p(t[n],n,t)}var u,a,c,s,f,l=sr,h=n,p=ov(30),d=1;return null==t&&(t=[]),e.initialize=function(t){c=t,r()},e.links=function(n){return arguments.length?(t=n,r(),e):t},e.id=function(t){return arguments.length?(l=t,e):l},e.iterations=function(t){return arguments.length?(d=+t,e):d},e.strength=function(t){return arguments.length?(h="function"==typeof t?t:ov(+t),i(),e):h},e.distance=function(t){return arguments.length?(p="function"==typeof t?t:ov(+t),o(),e):p},e},Tv=10,kv=Math.PI*(3-Math.sqrt(5)),Nv=function(t){function n(){e(),p.call("tick",o),u<a&&(h.stop(),p.call("end",o))}function e(){var n,e,r=t.length;for(u+=(s-u)*c,l.each(function(t){t(u)}),n=0;n<r;++n)e=t[n],null==e.fx?e.x+=e.vx*=f:(e.x=e.fx,e.vx=0),null==e.fy?e.y+=e.vy*=f:(e.y=e.fy,e.vy=0)}function r(){for(var n,e=0,r=t.length;e<r;++e){if(n=t[e],n.index=e,isNaN(n.x)||isNaN(n.y)){var i=Tv*Math.sqrt(e),o=e*kv;n.x=i*Math.cos(o),n.y=i*Math.sin(o)}(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}}function i(n){return n.initialize&&n.initialize(t),n}var o,u=1,a=.001,c=1-Math.pow(a,1/300),s=0,f=.6,l=He(),h=mn(n),p=v("tick","end");return null==t&&(t=[]),r(),o={tick:e,restart:function(){return h.restart(n),o},stop:function(){return h.stop(),o},nodes:function(n){return arguments.length?(t=n,r(),l.each(i),o):t},alpha:function(t){return arguments.length?(u=+t,o):u},alphaMin:function(t){return arguments.length?(a=+t,o):a},alphaDecay:function(t){return arguments.length?(c=+t,o):+c},alphaTarget:function(t){return arguments.length?(s=+t,o):s},velocityDecay:function(t){return arguments.length?(f=1-t,o):1-f},force:function(t,n){return arguments.length>1?(null==n?l.remove(t):l.set(t,i(n)),o):l.get(t)},find:function(n,e,r){var i,o,u,a,c,s=0,f=t.length;for(null==r?r=1/0:r*=r,s=0;s<f;++s)a=t[s],i=n-a.x,o=e-a.y,(u=i*i+o*o)<r&&(c=a,r=u);return c},on:function(t,n){return arguments.length>1?(p.on(t,n),o):p.on(t)}}},Sv=function(){function t(t){var n,a=i.length,c=ir(i,lr,hr).visitAfter(e);for(u=t,n=0;n<a;++n)o=i[n],c.visit(r)}function n(){if(i){var t,n,e=i.length;for(a=new Array(e),t=0;t<e;++t)n=i[t],a[n.index]=+c(n,t,i)}}function e(t){var n,e,r,i,o,u=0;if(t.length){for(r=i=o=0;o<4;++o)(n=t[o])&&(e=n.value)&&(u+=e,r+=e*n.x,i+=e*n.y);t.x=r/u,t.y=i/u}else{n=t,n.x=n.data.x,n.y=n.data.y;do{u+=a[n.data.index]}while(n=n.next)}t.value=u}function r(t,n,e,r){if(!t.value)return!0;var i=t.x-o.x,c=t.y-o.y,h=r-n,p=i*i+c*c;if(h*h/l<p)return p<f&&(0===i&&(i=uv(),p+=i*i),0===c&&(c=uv(),p+=c*c),p<s&&(p=Math.sqrt(s*p)),o.vx+=i*t.value*u/p,o.vy+=c*t.value*u/p),!0;if(!(t.length||p>=f)){(t.data!==o||t.next)&&(0===i&&(i=uv(),p+=i*i),0===c&&(c=uv(),p+=c*c),p<s&&(p=Math.sqrt(s*p)));do{t.data!==o&&(h=a[t.data.index]*u/p,o.vx+=i*h,o.vy+=c*h)}while(t=t.next)}}var i,o,u,a,c=ov(-30),s=1,f=1/0,l=.81;return t.initialize=function(t){i=t,n()},t.strength=function(e){return arguments.length?(c="function"==typeof e?e:ov(+e),n(),t):c},t.distanceMin=function(n){return arguments.length?(s=n*n,t):Math.sqrt(s)},t.distanceMax=function(n){return arguments.length?(f=n*n,t):Math.sqrt(f)},t.theta=function(n){return arguments.length?(l=n*n,t):Math.sqrt(l)},t},Ev=function(t){function n(t){for(var n,e=0,u=r.length;e<u;++e)n=r[e],n.vx+=(o[e]-n.x)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),o=new Array(e),n=0;n<e;++n)i[n]=isNaN(o[n]=+t(r[n],n,r))?0:+u(r[n],n,r)}}var r,i,o,u=ov(.1);return"function"!=typeof t&&(t=ov(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(u="function"==typeof t?t:ov(+t),e(),n):u},n.x=function(r){return arguments.length?(t="function"==typeof r?r:ov(+r),e(),n):t},n},Av=function(t){function n(t){for(var n,e=0,u=r.length;e<u;++e)n=r[e],n.vy+=(o[e]-n.y)*i[e]*t}function e(){if(r){var n,e=r.length;for(i=new Array(e),o=new Array(e),n=0;n<e;++n)i[n]=isNaN(o[n]=+t(r[n],n,r))?0:+u(r[n],n,r)}}var r,i,o,u=ov(.1);return"function"!=typeof t&&(t=ov(null==t?0:+t)),n.initialize=function(t){r=t,e()},n.strength=function(t){return arguments.length?(u="function"==typeof t?t:ov(+t),e(),n):u},n.y=function(r){return arguments.length?(t="function"==typeof r?r:ov(+r),e(),n):t},n},Cv=function(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]},zv=function(t){return t=Cv(Math.abs(t)),t?t[1]:NaN},Pv=function(t,n){return function(e,r){for(var i=e.length,o=[],u=0,a=t[0],c=0;i>0&&a>0&&(c+a+1>r&&(a=Math.max(1,r-c)),o.push(e.substring(i-=a,i+a)),!((c+=a+1)>r));)a=t[u=(u+1)%t.length];return o.reverse().join(n)}},Lv=function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}},Rv=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i<r;++i)switch(t[i]){case".":o=e=i;break;case"0":0===o&&(o=i),e=i;break;case"e":break t;default:o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},qv=function(t,n){var e=Cv(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(bv=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,u=r.length;return o===u?r:o>u?r+new Array(o-u+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Cv(t,Math.max(0,n+o-1))[0]},Uv=function(t,n){var e=Cv(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Dv={"":Rv,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Uv(100*t,n)},r:Uv,s:qv,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Ov=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i;pr.prototype=dr.prototype,dr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var Fv,Iv=function(t){return t},Yv=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],Bv=function(t){function n(t){function n(t){var n,i,a,f=_,x=y;if("c"===v)x=g(t)+x,t="";else{t=+t;var b=t<0;if(t=g(Math.abs(t),d),b&&0==+t&&(b=!1),f=(b?"("===s?s:"-":"-"===s||"("===s?"":s)+f,x=x+("s"===v?Yv[8+bv/3]:"")+(b&&"("===s?")":""),m)for(n=-1,i=t.length;++n<i;)if(48>(a=t.charCodeAt(n))||a>57){x=(46===a?o+t.slice(n+1):t.slice(n))+x,t=t.slice(0,n);break}}p&&!l&&(t=r(t,1/0));var w=f.length+t.length+x.length,M=w<h?new Array(h-w+1).join(e):"";switch(p&&l&&(t=r(M+t,M.length?h-x.length:1/0),M=""),c){case"<":t=f+t+x+M;break;case"=":t=f+M+t+x;break;case"^":t=M.slice(0,w=M.length>>1)+f+t+x+M.slice(w);break;default:t=M+f+t+x}return u(t)}t=pr(t);var e=t.fill,c=t.align,s=t.sign,f=t.symbol,l=t.zero,h=t.width,p=t.comma,d=t.precision,v=t.type,_="$"===f?i[0]:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===f?i[1]:/[%p]/.test(v)?a:"",g=Dv[v],m=!v||/[defgprs%]/.test(v);return d=null==d?v?6:12:/[gprs]/.test(v)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=pr(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(zv(e)/3))),o=Math.pow(10,-i),u=Yv[8+i/3];return function(t){return r(o*t)+u}}var r=t.grouping&&t.thousands?Pv(t.grouping,t.thousands):Iv,i=t.currency,o=t.decimal,u=t.numerals?Lv(t.numerals):Iv,a=t.percent||"%";return{format:n,formatPrefix:e}};vr({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var Hv=function(t){return Math.max(0,-zv(Math.abs(t)))},jv=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zv(n)/3)))-zv(Math.abs(t)))},Xv=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,zv(n)-zv(t))+1},$v=function(){return new _r};_r.prototype={constructor:_r,reset:function(){this.s=this.t=0},add:function(t){yr(T_,t,this.t),yr(this,T_.s,this.s),this.s?this.t+=T_.t:this.s=T_.t},valueOf:function(){return this.s}};var Vv,Wv,Zv,Gv,Jv,Qv,Kv,t_,n_,e_,r_,i_,o_,u_,a_,c_,s_,f_,l_,h_,p_,d_,v_,__,y_,g_,m_,x_,b_,w_,M_,T_=new _r,k_=1e-6,N_=Math.PI,S_=N_/2,E_=N_/4,A_=2*N_,C_=180/N_,z_=N_/180,P_=Math.abs,L_=Math.atan,R_=Math.atan2,q_=Math.cos,U_=Math.ceil,D_=Math.exp,O_=Math.log,F_=Math.pow,I_=Math.sin,Y_=Math.sign||function(t){return t>0?1:t<0?-1:0},B_=Math.sqrt,H_=Math.tan,j_={Feature:function(t,n){wr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)wr(e[r].geometry,n)}},X_={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){Mr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Mr(e[r],n,0)},Polygon:function(t,n){Tr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)Tr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)wr(e[r],n)}},$_=function(t,n){t&&j_.hasOwnProperty(t.type)?j_[t.type](t,n):wr(t,n)},V_=$v(),W_=$v(),Z_={point:br,lineStart:br,lineEnd:br,polygonStart:function(){V_.reset(),Z_.lineStart=kr,Z_.lineEnd=Nr},polygonEnd:function(){var t=+V_;W_.add(t<0?A_+t:t),this.lineStart=this.lineEnd=this.point=br},sphere:function(){W_.add(A_)}},G_=function(t){return W_.reset(),$_(t,Z_),2*W_},J_=$v(),Q_={point:Ur,lineStart:Or,lineEnd:Fr,polygonStart:function(){Q_.point=Ir,Q_.lineStart=Yr,Q_.lineEnd=Br,J_.reset(),Z_.polygonStart()},polygonEnd:function(){Z_.polygonEnd(),Q_.point=Ur,Q_.lineStart=Or,Q_.lineEnd=Fr,V_<0?(Qv=-(t_=180),Kv=-(n_=90)):J_>k_?n_=90:J_<-k_&&(Kv=-90),a_[0]=Qv,a_[1]=t_}},K_=function(t){var n,e,r,i,o,u,a;if(n_=t_=-(Qv=Kv=1/0),u_=[],$_(t,Q_),e=u_.length){for(u_.sort(jr),n=1,r=u_[0],o=[r];n<e;++n)i=u_[n],Xr(r,i[0])||Xr(r,i[1])?(Hr(r[0],i[1])>Hr(r[0],r[1])&&(r[1]=i[1]),Hr(i[0],r[1])>Hr(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(u=-1/0,e=o.length-1,n=0,r=o[e];n<=e;r=i,++n)i=o[n],(a=Hr(r[1],i[0]))>u&&(u=a,Qv=i[0],t_=r[1])}return u_=a_=null,Qv===1/0||Kv===1/0?[[NaN,NaN],[NaN,NaN]]:[[Qv,Kv],[t_,n_]]},ty={sphere:br,point:$r,lineStart:Wr,lineEnd:Jr,polygonStart:function(){ty.lineStart=Qr,ty.lineEnd=Kr},polygonEnd:function(){ty.lineStart=Wr,ty.lineEnd=Jr}},ny=function(t){c_=s_=f_=l_=h_=p_=d_=v_=__=y_=g_=0,$_(t,ty);var n=__,e=y_,r=g_,i=n*n+e*e+r*r;return i<1e-12&&(n=p_,e=d_,r=v_,s_<k_&&(n=f_,e=l_,r=h_),(i=n*n+e*e+r*r)<1e-12)?[NaN,NaN]:[R_(e,n)*C_,mr(r/B_(i))*C_]},ey=function(t){return function(){return t}},ry=function(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return(e=n.invert(e,r))&&t.invert(e[0],e[1])}),e};ei.invert=ei;var iy,oy,uy,ay,cy,sy,fy,ly,hy,py,dy,vy=function(t){function n(n){return n=t(n[0]*z_,n[1]*z_),n[0]*=C_,n[1]*=C_,n}return t=ri(t[0]*z_,t[1]*z_,t.length>2?t[2]*z_:0),n.invert=function(n){return n=t.invert(n[0]*z_,n[1]*z_),n[0]*=C_,n[1]*=C_,n},n},_y=function(){function t(t,n){e.push(t=r(t,n)),t[0]*=C_,t[1]*=C_}function n(){var t=i.apply(this,arguments),n=o.apply(this,arguments)*z_,c=u.apply(this,arguments)*z_;return e=[],r=ri(-t[0]*z_,-t[1]*z_,0).invert,ai(a,n,c,1),t={type:"Polygon",coordinates:[e]},e=r=null,t}var e,r,i=ey([0,0]),o=ey(90),u=ey(6),a={point:t};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:ey([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(o="function"==typeof t?t:ey(+t),n):o},n.precision=function(t){return arguments.length?(u="function"==typeof t?t:ey(+t),n):u},n},yy=function(){var t,n=[];return{point:function(n,e){t.push([n,e])},lineStart:function(){n.push(t=[])},lineEnd:br,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}},gy=function(t,n,e,r,i,o){var u,a=t[0],c=t[1],s=n[0],f=n[1],l=0,h=1,p=s-a,d=f-c;if(u=e-a,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<h&&(h=u)}else if(p>0){if(u>h)return;u>l&&(l=u)}if(u=i-a,p||!(u<0)){if(u/=p,p<0){if(u>h)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<h&&(h=u)}if(u=r-c,d||!(u>0)){if(u/=d,d<0){if(u<l)return;u<h&&(h=u)}else if(d>0){if(u>h)return;u>l&&(l=u)}if(u=o-c,d||!(u<0)){if(u/=d,d<0){if(u>h)return;u>l&&(l=u)}else if(d>0){if(u<l)return;u<h&&(h=u)}return l>0&&(t[0]=a+l*p,t[1]=c+l*d),h<1&&(n[0]=a+h*p,n[1]=c+h*d),!0}}}}},my=function(t,n){return P_(t[0]-n[0])<k_&&P_(t[1]-n[1])<k_},xy=function(t,n,e,r,i){var o,u,a=[],c=[];if(t.forEach(function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],u=t[n];if(my(r,u)){for(i.lineStart(),o=0;o<n;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a.push(e=new si(r,t,null,!0)),c.push(e.o=new si(r,null,e,!1)),a.push(e=new si(u,t,null,!1)),c.push(e.o=new si(u,null,e,!0))}}),a.length){for(c.sort(n),fi(a),fi(c),o=0,u=c.length;o<u;++o)c[o].e=e=!e;for(var s,f,l=a[0];;){for(var h=l,p=!0;h.v;)if((h=h.n)===l)return;s=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,u=s.length;o<u;++o)i.point((f=s[o])[0],f[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(s=h.p.z,o=s.length-1;o>=0;--o)i.point((f=s[o])[0],f[1]);else r(h.x,h.p.x,-1,i);h=h.p}h=h.o,s=h.z,p=!p}while(!h.v);i.lineEnd()}}},by=1e9,wy=-by,My=function(){var t,n,e,r=0,i=0,o=960,u=500;return e={stream:function(e){return t&&n===e?t:t=li(r,i,o,u)(n=e)},extent:function(a){return arguments.length?(r=+a[0][0],i=+a[0][1],o=+a[1][0],u=+a[1][1],t=n=null,e):[[r,i],[o,u]]}}},Ty=$v(),ky=function(t,n){var e=n[0],r=n[1],i=[I_(e),-q_(e),0],o=0,u=0;Ty.reset();for(var a=0,c=t.length;a<c;++a)if(f=(s=t[a]).length)for(var s,f,l=s[f-1],h=l[0],p=l[1]/2+E_,d=I_(p),v=q_(p),_=0;_<f;++_,h=g,d=x,v=b,l=y){var y=s[_],g=y[0],m=y[1]/2+E_,x=I_(m),b=q_(m),w=g-h,M=w>=0?1:-1,T=M*w,k=T>N_,N=d*x;if(Ty.add(R_(N*M*I_(T),v*b+N*q_(T))),o+=k?w+M*A_:w,k^h>=e^g>=e){var S=Pr(Cr(l),Cr(y));qr(S);var E=Pr(i,S);qr(E);var A=(k^w>=0?-1:1)*mr(E[2]);(r>A||r===A&&(S[0]||S[1]))&&(u+=k^w>=0?1:-1)}}return(o<-k_||o<k_&&Ty<-k_)^1&u},Ny=$v(),Sy={sphere:br,point:br,lineStart:hi,lineEnd:br,polygonStart:br,polygonEnd:br},Ey=function(t){return Ny.reset(),$_(t,Sy),+Ny},Ay=[null,null],Cy={type:"LineString",coordinates:Ay},zy=function(t,n){return Ay[0]=t,Ay[1]=n,Ey(Cy)},Py={Feature:function(t,n){return _i(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)if(_i(e[r].geometry,n))return!0;return!1}},Ly={Sphere:function(){return!0},Point:function(t,n){return yi(t.coordinates,n)},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(yi(e[r],n))return!0;return!1},LineString:function(t,n){return gi(t.coordinates,n)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(gi(e[r],n))return!0;return!1},Polygon:function(t,n){return mi(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)if(mi(e[r],n))return!0;return!1},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)if(_i(e[r],n))return!0;return!1}},Ry=function(t,n){return(t&&Py.hasOwnProperty(t.type)?Py[t.type]:_i)(t,n)},qy=function(t,n){var e=t[0]*z_,r=t[1]*z_,i=n[0]*z_,o=n[1]*z_,u=q_(r),a=I_(r),c=q_(o),s=I_(o),f=u*q_(e),l=u*I_(e),h=c*q_(i),p=c*I_(i),d=2*mr(B_(xr(o-r)+u*c*xr(i-e))),v=I_(d),_=d?function(t){var n=I_(t*=d)/v,e=I_(d-t)/v,r=e*f+n*h,i=e*l+n*p,o=e*a+n*s;return[R_(i,r)*C_,R_(o,B_(r*r+i*i))*C_]}:function(){return[e*C_,r*C_]};return _.distance=d,_},Uy=function(t){return t},Dy=$v(),Oy=$v(),Fy={point:br,lineStart:br,lineEnd:br,polygonStart:function(){Fy.lineStart=Ni,Fy.lineEnd=Ai},polygonEnd:function(){Fy.lineStart=Fy.lineEnd=Fy.point=br,Dy.add(P_(Oy)),Oy.reset()},result:function(){var t=Dy/2;return Dy.reset(),t}},Iy=1/0,Yy=Iy,By=-Iy,Hy=By,jy={point:Ci,lineStart:br,lineEnd:br,polygonStart:br,polygonEnd:br,result:function(){var t=[[Iy,Yy],[By,Hy]];return By=Hy=-(Yy=Iy=1/0),t}},Xy=0,$y=0,Vy=0,Wy=0,Zy=0,Gy=0,Jy=0,Qy=0,Ky=0,tg={point:zi,lineStart:Pi,lineEnd:qi,polygonStart:function(){tg.lineStart=Ui,tg.lineEnd=Di},polygonEnd:function(){tg.point=zi,tg.lineStart=Pi,tg.lineEnd=qi},result:function(){var t=Ky?[Jy/Ky,Qy/Ky]:Gy?[Wy/Gy,Zy/Gy]:Vy?[Xy/Vy,$y/Vy]:[NaN,NaN];return Xy=$y=Vy=Wy=Zy=Gy=Jy=Qy=Ky=0,t}};Ii.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,A_)}},result:br};var ng,eg,rg,ig,og,ug=$v(),ag={point:br,lineStart:function(){ag.point=Yi},lineEnd:function(){ng&&Bi(eg,rg),ag.point=br},polygonStart:function(){ng=!0},polygonEnd:function(){ng=null},result:function(){var t=+ug;return ug.reset(),t}};Hi.prototype={_radius:4.5,_circle:ji(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ji(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var cg=function(t,n){function e(t){return t&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),$_(t,r(i))),i.result()}var r,i,o=4.5;return e.area=function(t){return $_(t,r(Fy)),Fy.result()},e.measure=function(t){return $_(t,r(ag)),ag.result()},e.bounds=function(t){return $_(t,r(jy)),jy.result()},e.centroid=function(t){return $_(t,r(tg)),tg.result()},e.projection=function(n){return arguments.length?(r=null==n?(t=null,Uy):(t=n).stream,e):t},e.context=function(t){return arguments.length?(i=null==t?(n=null,new Hi):new Ii(n=t),"function"!=typeof o&&i.pointRadius(o),e):n},e.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),e):o},e.projection(t).context(n)},sg=function(t,n,e,r){return function(i,o){function u(n,e){var r=i(n,e);t(n=r[0],e=r[1])&&o.point(n,e)}function a(t,n){var e=i(t,n);_.point(e[0],e[1])}function c(){b.point=a,_.lineStart()}function s(){b.point=u,_.lineEnd()}function f(t,n){v.push([t,n]);var e=i(t,n);m.point(e[0],e[1])}function l(){m.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),m.lineEnd();var t,n,e,r,i=m.clean(),u=g.result(),a=u.length;if(v.pop(),p.push(v),v=null,a)if(1&i){if(e=u[0],(n=e.length-1)>0){for(x||(o.polygonStart(),x=!0),o.lineStart(),t=0;t<n;++t)o.point((r=e[t])[0],r[1]);o.lineEnd()}}else a>1&&2&i&&u.push(u.pop().concat(u.shift())),d.push(u.filter(Xi))}var p,d,v,_=n(o),y=i.invert(r[0],r[1]),g=yy(),m=n(g),x=!1,b={point:u,lineStart:c,lineEnd:s,polygonStart:function(){b.point=f,b.lineStart=l,b.lineEnd=h,d=[],p=[]},polygonEnd:function(){b.point=u,b.lineStart=c,b.lineEnd=s,d=bf(d);var t=ky(p,y);d.length?(x||(o.polygonStart(),x=!0),xy(d,$i,t,e,o)):t&&(x||(o.polygonStart(),x=!0),o.lineStart(),e(null,null,1,o),o.lineEnd()),x&&(o.polygonEnd(),x=!1),d=p=null},sphere:function(){o.polygonStart(),o.lineStart(),e(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return b}},fg=sg(function(){return!0},Vi,Zi,[-N_,-S_]),lg=function(t,n){function e(e,r,i,o){ai(o,t,n,i,e,r)}function r(t,n){return q_(t)*q_(n)>a}function i(t){var n,e,i,a,f;return{lineStart:function(){a=i=!1,f=1},point:function(l,h){var p,d=[l,h],v=r(l,h),_=c?v?0:u(l,h):v?u(l+(l<0?N_:-N_),h):0;if(!n&&(a=i=v)&&t.lineStart(),v!==i&&(!(p=o(n,d))||my(n,p)||my(d,p))&&(d[0]+=k_,d[1]+=k_,v=r(d[0],d[1])),v!==i)f=0,v?(t.lineStart(),p=o(d,n),t.point(p[0],p[1])):(p=o(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(s&&n&&c^v){var y;_&e||!(y=o(d,n,!0))||(f=0,c?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&my(n,d)||t.point(d[0],d[1]),n=d,i=v,e=_},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return f|(a&&i)<<1}}}function o(t,n,e){var r=Cr(t),i=Cr(n),o=[1,0,0],u=Pr(r,i),c=zr(u,u),s=u[0],f=c-s*s;if(!f)return!e&&t;var l=a*c/f,h=-a*s/f,p=Pr(o,u),d=Rr(o,l);Lr(d,Rr(u,h));var v=p,_=zr(d,v),y=zr(v,v),g=_*_-y*(zr(d,d)-1);if(!(g<0)){var m=B_(g),x=Rr(v,(-_-m)/y);if(Lr(x,d),x=Ar(x),!e)return x;var b,w=t[0],M=n[0],T=t[1],k=n[1];M<w&&(b=w,w=M,M=b);var N=M-w,S=P_(N-N_)<k_,E=S||N<k_;if(!S&&k<T&&(b=T,T=k,k=b),E?S?T+k>0^x[1]<(P_(x[0]-w)<k_?T:k):T<=x[1]&&x[1]<=k:N>N_^(w<=x[0]&&x[0]<=M)){var A=Rr(v,(-_+m)/y);return Lr(A,d),[x,Ar(A)]}}}function u(n,e){var r=c?t:N_-t,i=0;return n<-r?i|=1:n>r&&(i|=2),e<-r?i|=4:e>r&&(i|=8),i}var a=q_(t),c=a>0,s=P_(a)>k_;return sg(r,i,e,c?[0,-t]:[-N_,t-N_])},hg=function(t){return{stream:Gi(t)}};Ji.prototype={constructor:Ji,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var pg=16,dg=q_(30*z_),vg=function(t,n){return+n?no(t,n):to(t)},_g=Gi({point:function(t,n){this.stream.point(t*z_,n*z_)}}),yg=function(){return io(uo).scale(155.424).center([0,33.6442])},gg=function(){return yg().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},mg=function(){function t(t){var n=t[0],e=t[1];return a=null,i.point(n,e),a||(o.point(n,e),a)||(u.point(n,e),a)}function n(){return e=r=null,t}var e,r,i,o,u,a,c=gg(),s=yg().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=yg().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){a=[t,n]}};return t.invert=function(t){var n=c.scale(),e=c.translate(),r=(t[0]-e[0])/n,i=(t[1]-e[1])/n;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?f:c).invert(t)},t.stream=function(t){return e&&r===t?e:e=ao([c.stream(r=t),s.stream(t),f.stream(t)])},t.precision=function(t){return arguments.length?(c.precision(t),s.precision(t),f.precision(t),n()):c.precision()},t.scale=function(n){return arguments.length?(c.scale(n),s.scale(.35*n),f.scale(n),t.translate(c.translate())):c.scale()},t.translate=function(t){if(!arguments.length)return c.translate();var e=c.scale(),r=+t[0],a=+t[1];return i=c.translate(t).clipExtent([[r-.455*e,a-.238*e],[r+.455*e,a+.238*e]]).stream(l),o=s.translate([r-.307*e,a+.201*e]).clipExtent([[r-.425*e+k_,a+.12*e+k_],[r-.214*e-k_,a+.234*e-k_]]).stream(l),u=f.translate([r-.205*e,a+.212*e]).clipExtent([[r-.214*e+k_,a+.166*e+k_],[r-.115*e-k_,a+.234*e-k_]]).stream(l),n()},t.fitExtent=function(n,e){return Qi(t,n,e)},t.fitSize=function(n,e){return Ki(t,n,e)},t.scale(1070)},xg=co(function(t){return B_(2/(1+t))});xg.invert=so(function(t){return 2*mr(t/2)});var bg=function(){return eo(xg).scale(124.75).clipAngle(179.999)},wg=co(function(t){return(t=gr(t))&&t/I_(t)});wg.invert=so(function(t){return t});var Mg=function(){return eo(wg).scale(79.4188).clipAngle(179.999)};fo.invert=function(t,n){return[t,2*L_(D_(n))-S_]};var Tg=function(){return lo(fo).scale(961/A_)},kg=function(){return io(po).scale(109.5).parallels([30,30])};vo.invert=vo;var Ng=function(){return eo(vo).scale(152.63)},Sg=function(){return io(_o).scale(131.154).center([0,13.9389])};yo.invert=so(L_);var Eg=function(){return eo(yo).scale(144.049).clipAngle(60)},Ag=function(){function t(){return i=o=null,u}var n,e,r,i,o,u,a=1,c=0,s=0,f=1,l=1,h=Uy,p=null,d=Uy;return u={stream:function(t){return i&&o===t?i:i=h(d(o=t))},clipExtent:function(i){return arguments.length?(d=null==i?(p=n=e=r=null,Uy):li(p=+i[0][0],n=+i[0][1],e=+i[1][0],r=+i[1][1]),t()):null==p?null:[[p,n],[e,r]]},scale:function(n){return arguments.length?(h=go((a=+n)*f,a*l,c,s),t()):a},translate:function(n){return arguments.length?(h=go(a*f,a*l,c=+n[0],s=+n[1]),t()):[c,s]},reflectX:function(n){return arguments.length?(h=go(a*(f=n?-1:1),a*l,c,s),t()):f<0},reflectY:function(n){return arguments.length?(h=go(a*f,a*(l=n?-1:1),c,s),t()):l<0},fitExtent:function(t,n){return Qi(u,t,n)},fitSize:function(t,n){return Ki(u,t,n)}}};mo.invert=so(mr);var Cg=function(){return eo(mo).scale(249.5).clipAngle(90+k_)};xo.invert=so(function(t){return 2*L_(t)});var zg=function(){return eo(xo).scale(250).clipAngle(142)};bo.invert=function(t,n){return[-n,2*L_(D_(t))-S_]};var Pg=function(){var t=lo(bo),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):(t=n(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):(t=e(),[t[0],t[1],t[2]-90])},e([0,0,90]).scale(159.155)},Lg=function(){function t(t){var o,u=0;t.eachAfter(function(t){var e=t.children;e?(t.x=Mo(e),t.y=ko(e)):(t.x=o?u+=n(t,o):0,t.y=0,o=t)});var a=So(t),c=Eo(t),s=a.x-n(a,c)/2,f=c.x+n(c,a)/2;return t.eachAfter(i?function(n){n.x=(n.x-t.x)*e,n.y=(t.y-n.y)*r}:function(n){n.x=(n.x-s)/(f-s)*e,n.y=(1-(t.y?n.y/t.y:1))*r})}var n=wo,e=1,r=1,i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(n){return arguments.length?(i=!1,e=+n[0],r=+n[1],t):i?null:[e,r]},t.nodeSize=function(n){return arguments.length?(i=!0,e=+n[0],r=+n[1],t):i?[e,r]:null},t},Rg=function(){return this.eachAfter(Ao)},qg=function(t){var n,e,r,i,o=this,u=[o];do{for(n=u.reverse(),u=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r<i;++r)u.push(e[r])}while(u.length);return this},Ug=function(t){for(var n,e,r=this,i=[r];r=i.pop();)if(t(r),n=r.children)for(e=n.length-1;e>=0;--e)i.push(n[e]);return this},Dg=function(t){for(var n,e,r,i=this,o=[i],u=[];i=o.pop();)if(u.push(i),n=i.children)for(e=0,r=n.length;e<r;++e)o.push(n[e]);for(;i=u.pop();)t(i);return this},Og=function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},Fg=function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},Ig=function(t){for(var n=this,e=Co(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},Yg=function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},Bg=function(){var t=[];return this.each(function(n){t.push(n)}),t},Hg=function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},jg=function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n};Uo.prototype=zo.prototype={constructor:Uo,count:Rg,each:qg,eachAfter:Dg,eachBefore:Ug,sum:Og,sort:Fg,path:Ig,ancestors:Yg,descendants:Bg,leaves:Hg,links:jg,copy:Po};var Xg=function(t){for(var n=(t=t.slice()).length,e=null,r=e;n;){var i=new Do(t[n-1]);r=r?r.next=i:e=i,t[void 0]=t[--n]}return{head:e,tail:r}},$g=function(t){return Fo(Xg(t),[])},Vg=function(t){return Vo(t),t},Wg=function(t){return function(){return t}},Zg=function(){function t(t){return t.x=e/2,t.y=r/2,n?t.eachBefore(Qo(n)).eachAfter(Ko(i,.5)).eachBefore(tu(1)):t.eachBefore(Qo(Jo)).eachAfter(Ko(Go,1)).eachAfter(Ko(i,t.r/Math.min(e,r))).eachBefore(tu(Math.min(e,r)/(2*t.r))),t}var n=null,e=1,r=1,i=Go;return t.radius=function(e){return arguments.length?(n=Wo(e),t):n},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i="function"==typeof n?n:Wg(+n),t):i},t},Gg=function(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)},Jg=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(r-n)/t.value;++a<c;)o=u[a],o.y0=e,o.y1=i,o.x0=n,o.x1=n+=o.value*s},Qg=function(){function t(t){var u=t.height+1;return t.x0=t.y0=i,t.x1=e,t.y1=r/u,t.eachBefore(n(r,u)),o&&t.eachBefore(Gg),t}function n(t,n){return function(e){e.children&&Jg(e,e.x0,t*(e.depth+1)/n,e.x1,t*(e.depth+2)/n);var r=e.x0,o=e.y0,u=e.x1-i,a=e.y1-i;u<r&&(r=u=(r+u)/2),a<o&&(o=a=(o+a)/2),e.x0=r,e.y0=o,e.x1=u,e.y1=a}}var e=1,r=1,i=0,o=!1;return t.round=function(n){return arguments.length?(o=!!n,t):o},t.size=function(n){return arguments.length?(e=+n[0],r=+n[1],t):[e,r]},t.padding=function(n){return arguments.length?(i=+n,t):i},t},Kg="$",tm={depth:-1},nm={},em=function(){function t(t){var r,i,o,u,a,c,s,f=t.length,l=new Array(f),h={};for(i=0;i<f;++i)r=t[i],a=l[i]=new Uo(r),null!=(c=n(r,i,t))&&(c+="")&&(s=Kg+(a.id=c),h[s]=s in h?nm:a);for(i=0;i<f;++i)if(a=l[i],null!=(c=e(t[i],i,t))&&(c+="")){if(!(u=h[Kg+c]))throw new Error("missing: "+c);if(u===nm)throw new Error("ambiguous: "+c);u.children?u.children.push(a):u.children=[a],a.parent=u}else{if(o)throw new Error("multiple roots");o=a}if(!o)throw new Error("no root");if(o.parent=tm,o.eachBefore(function(t){t.depth=t.parent.depth+1,--f}).eachBefore(qo),o.parent=null,f>0)throw new Error("cycle");return o}var n=nu,e=eu;return t.id=function(e){return arguments.length?(n=Zo(e),t):n},t.parentId=function(n){return arguments.length?(e=Zo(n),t):e},t};su.prototype=Object.create(Uo.prototype);var rm=function(){function t(t){var r=fu(t);if(r.eachAfter(n),r.parent.m=-r.z,r.eachBefore(e),c)t.eachBefore(i);else{var s=t,f=t,l=t;t.eachBefore(function(t){t.x<s.x&&(s=t),t.x>f.x&&(f=t),t.depth>l.depth&&(l=t)});var h=s===f?1:o(s,f)/2,p=h-s.x,d=u/(f.x+h+p),v=a/(l.depth||1);t.eachBefore(function(t){t.x=(t.x+p)*d,t.y=t.depth*v})}return t}function n(t){var n=t.children,e=t.parent.children,i=t.i?e[t.i-1]:null;if(n){au(t);var u=(n[0].z+n[n.length-1].z)/2;i?(t.z=i.z+o(t._,i._),t.m=t.z-u):t.z=u}else i&&(t.z=i.z+o(t._,i._));t.parent.A=r(t,i,t.parent.A||e[0])}function e(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,n,e){if(n){for(var r,i=t,u=t,a=n,c=i.parent.children[0],s=i.m,f=u.m,l=a.m,h=c.m;a=ou(a),i=iu(i),a&&i;)c=iu(c),u=ou(u),u.a=t,r=a.z+l-i.z-s+o(a._,i._),r>0&&(uu(cu(a,t,e),t,r),s+=r,f+=r),l+=a.m,s+=i.m,h+=c.m,f+=u.m;a&&!ou(u)&&(u.t=a,u.m+=l-f),i&&!iu(c)&&(c.t=i,c.m+=s-h,e=t)}return e}function i(t){t.x*=u,t.y=t.depth*a}var o=ru,u=1,a=1,c=null;return t.separation=function(n){return arguments.length?(o=n,t):o},t.size=function(n){return arguments.length?(c=!1,u=+n[0],a=+n[1],t):c?null:[u,a]},t.nodeSize=function(n){return arguments.length?(c=!0,u=+n[0],a=+n[1],t):c?[u,a]:null},t},im=function(t,n,e,r,i){for(var o,u=t.children,a=-1,c=u.length,s=t.value&&(i-e)/t.value;++a<c;)o=u[a],o.x0=n,o.x1=r,o.y0=e,o.y1=e+=o.value*s},om=(1+Math.sqrt(5))/2,um=function t(n){function e(t,e,r,i,o){lu(n,t,e,r,i,o)}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(om),am=function(){function t(t){return t.x0=t.y0=0,t.x1=i,t.y1=o,t.eachBefore(n),u=[0],r&&t.eachBefore(Gg),t}function n(t){var n=u[t.depth],r=t.x0+n,i=t.y0+n,o=t.x1-n,h=t.y1-n;o<r&&(r=o=(r+o)/2),h<i&&(i=h=(i+h)/2),t.x0=r,t.y0=i,t.x1=o,t.y1=h, | |
t.children&&(n=u[t.depth+1]=a(t)/2,r+=l(t)-n,i+=c(t)-n,o-=s(t)-n,h-=f(t)-n,o<r&&(r=o=(r+o)/2),h<i&&(i=h=(i+h)/2),e(t,r,i,o,h))}var e=um,r=!1,i=1,o=1,u=[0],a=Go,c=Go,s=Go,f=Go,l=Go;return t.round=function(n){return arguments.length?(r=!!n,t):r},t.size=function(n){return arguments.length?(i=+n[0],o=+n[1],t):[i,o]},t.tile=function(n){return arguments.length?(e=Zo(n),t):e},t.padding=function(n){return arguments.length?t.paddingInner(n).paddingOuter(n):t.paddingInner()},t.paddingInner=function(n){return arguments.length?(a="function"==typeof n?n:Wg(+n),t):a},t.paddingOuter=function(n){return arguments.length?t.paddingTop(n).paddingRight(n).paddingBottom(n).paddingLeft(n):t.paddingTop()},t.paddingTop=function(n){return arguments.length?(c="function"==typeof n?n:Wg(+n),t):c},t.paddingRight=function(n){return arguments.length?(s="function"==typeof n?n:Wg(+n),t):s},t.paddingBottom=function(n){return arguments.length?(f="function"==typeof n?n:Wg(+n),t):f},t.paddingLeft=function(n){return arguments.length?(l="function"==typeof n?n:Wg(+n),t):l},t},cm=function(t,n,e,r,i){function o(t,n,e,r,i,u,a){if(t>=n-1){var s=c[t];return s.x0=r,s.y0=i,s.x1=u,s.y1=a,void 0}for(var l=f[t],h=e/2+l,p=t+1,d=n-1;p<d;){var v=p+d>>>1;f[v]<h?p=v+1:d=v}h-f[p-1]<f[p]-h&&t+1<p&&--p;var _=f[p]-l,y=e-_;if(u-r>a-i){var g=(r*y+u*_)/e;o(t,p,_,r,i,g,a),o(p,n,y,g,i,u,a)}else{var m=(i*y+a*_)/e;o(t,p,_,r,i,u,m),o(p,n,y,r,m,u,a)}}var u,a,c=t.children,s=c.length,f=new Array(s+1);for(f[0]=a=u=0;u<s;++u)f[u+1]=a+=c[u].value;o(0,s,t.value,n,e,r,i)},sm=function(t,n,e,r,i){(1&t.depth?im:Jg)(t,n,e,r,i)},fm=function t(n){function e(t,e,r,i,o){if((u=t._squarify)&&u.ratio===n)for(var u,a,c,s,f,l=-1,h=u.length,p=t.value;++l<h;){for(a=u[l],c=a.children,s=a.value=0,f=c.length;s<f;++s)a.value+=c[s].value;a.dice?Jg(a,e,r,i,r+=(o-r)*a.value/p):im(a,e,r,e+=(i-e)*a.value/p,o),p-=a.value}else t._squarify=u=lu(n,t,e,r,i,o),u.ratio=n}return e.ratio=function(n){return t((n=+n)>1?n:1)},e}(om),lm=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++e<r;)n=i,i=t[e],o+=n[1]*i[0]-n[0]*i[1];return o/2},hm=function(t){for(var n,e,r=-1,i=t.length,o=0,u=0,a=t[i-1],c=0;++r<i;)n=a,a=t[r],c+=e=n[0]*a[1]-a[0]*n[1],o+=(n[0]+a[0])*e,u+=(n[1]+a[1])*e;return c*=3,[o/c,u/c]},pm=function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])},dm=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n<e;++n)r[n]=[+t[n][0],+t[n][1],n];for(r.sort(hu),n=0;n<e;++n)i[n]=[r[n][0],-r[n][1]];var o=pu(r),u=pu(i),a=u[0]===o[0],c=u[u.length-1]===o[o.length-1],s=[];for(n=o.length-1;n>=0;--n)s.push(t[r[o[n]][2]]);for(n=+a;n<u.length-c;++n)s.push(t[r[u[n]][2]]);return s},vm=function(t,n){for(var e,r,i=t.length,o=t[i-1],u=n[0],a=n[1],c=o[0],s=o[1],f=!1,l=0;l<i;++l)o=t[l],e=o[0],r=o[1],r>a!=s>a&&u<(c-e)*(a-r)/(s-r)+e&&(f=!f),c=e,s=r;return f},_m=function(t){for(var n,e,r=-1,i=t.length,o=t[i-1],u=o[0],a=o[1],c=0;++r<i;)n=u,e=a,o=t[r],u=o[0],a=o[1],n-=u,e-=a,c+=Math.sqrt(n*n+e*e);return c},ym=[].slice,gm={};du.prototype=xu.prototype={constructor:du,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=ym.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),vu(this),this},abort:function(){return null==this._error&&gu(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},mu(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,mu(this),this}};var mm=function(){return Math.random()},xm=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(mm),bm=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(mm),wm=function t(n){function e(){var t=bm.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(mm),Mm=function t(n){function e(t){return function(){for(var e=0,r=0;r<t;++r)e+=n();return e}}return e.source=t,e}(mm),Tm=function t(n){function e(t){var e=Mm.source(n)(t);return function(){return e()/t}}return e.source=t,e}(mm),km=function t(n){function e(t){return function(){return-Math.log(1-n())/t}}return e.source=t,e}(mm),Nm=function(t,n){function e(t){var n,e=s.status;if(!e&&wu(s)||e>=200&&e<300||304===e){if(o)try{n=o.call(r,s)}catch(t){return void a.call("error",r,t)}else n=s;a.call("load",r,n)}else a.call("error",r,t)}var r,i,o,u,a=v("beforesend","progress","load","error"),c=He(),s=new XMLHttpRequest,f=null,l=null,h=0;if("undefined"==typeof XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=s.ontimeout=e:s.onreadystatechange=function(t){s.readyState>3&&e(t)},s.onprogress=function(t){a.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?c.get(t):(null==n?c.remove(t):c.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(u=t,r):u},timeout:function(t){return arguments.length?(h=+t,r):h},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return s.open(n,t,!0,f,l),null==i||c.has("accept")||c.set("accept",i+",*/*"),s.setRequestHeader&&c.each(function(t,n){s.setRequestHeader(n,t)}),null!=i&&s.overrideMimeType&&s.overrideMimeType(i),null!=u&&(s.responseType=u),h>0&&(s.timeout=h),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=bu(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),a.call("beforesend",r,s),s.send(null==e?null:e),r},abort:function(){return s.abort(),r},on:function(){var t=a.on.apply(a,arguments);return t===a?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},Sm=function(t,n){return function(e,r){var i=Nm(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}},Em=Sm("text/html",function(t){return document.createRange().createContextualFragment(t.responseText)}),Am=Sm("application/json",function(t){return JSON.parse(t.responseText)}),Cm=Sm("text/plain",function(t){return t.responseText}),zm=Sm("application/xml",function(t){var n=t.responseXML;if(!n)throw new Error("parse error");return n}),Pm=function(t,n){return function(e,r,i){arguments.length<3&&(i=r,r=null);var o=Nm(e).mimeType(t);return o.row=function(t){return arguments.length?o.response(Mu(n,r=t)):r},o.row(r),i?o.get(i):o}},Lm=Pm("text/csv",Zd),Rm=Pm("text/tab-separated-values",tv),qm=Array.prototype,Um=qm.map,Dm=qm.slice,Om={name:"implicit"},Fm=function(t){return function(){return t}},Im=function(t){return+t},Ym=[0,1],Bm=function(n,e,r){var o,u=n[0],a=n[n.length-1],c=i(u,a,null==e?10:e);switch(r=pr(null==r?",f":r),r.type){case"s":var s=Math.max(Math.abs(u),Math.abs(a));return null!=r.precision||isNaN(o=jv(c,s))||(r.precision=o),t.formatPrefix(r,s);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=Xv(c,Math.max(Math.abs(u),Math.abs(a))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=Hv(c))||(r.precision=o-2*("%"===r.type))}return t.format(r)},Hm=function(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],u=t[i];return u<o&&(e=r,r=i,i=e,e=o,o=u,u=e),t[r]=n.floor(o),t[i]=n.ceil(u),t},jm=new Date,Xm=new Date,$m=Ju(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});$m.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Ju(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):$m:null};var Vm=$m.range,Wm=6e4,Zm=6048e5,Gm=Ju(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),Jm=Gm.range,Qm=Ju(function(t){t.setTime(Math.floor(t/Wm)*Wm)},function(t,n){t.setTime(+t+n*Wm)},function(t,n){return(n-t)/Wm},function(t){return t.getMinutes()}),Km=Qm.range,tx=Ju(function(t){var n=t.getTimezoneOffset()*Wm%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),nx=tx.range,ex=Ju(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wm)/864e5},function(t){return t.getDate()-1}),rx=ex.range,ix=Qu(0),ox=Qu(1),ux=Qu(2),ax=Qu(3),cx=Qu(4),sx=Qu(5),fx=Qu(6),lx=ix.range,hx=ox.range,px=ux.range,dx=ax.range,vx=cx.range,_x=sx.range,yx=fx.range,gx=Ju(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),mx=gx.range,xx=Ju(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});xx.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ju(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var bx=xx.range,wx=Ju(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Wm)},function(t,n){return(n-t)/Wm},function(t){return t.getUTCMinutes()}),Mx=wx.range,Tx=Ju(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),kx=Tx.range,Nx=Ju(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Sx=Nx.range,Ex=Ku(0),Ax=Ku(1),Cx=Ku(2),zx=Ku(3),Px=Ku(4),Lx=Ku(5),Rx=Ku(6),qx=Ex.range,Ux=Ax.range,Dx=Cx.range,Ox=zx.range,Fx=Px.range,Ix=Lx.range,Yx=Rx.range,Bx=Ju(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),Hx=Bx.range,jx=Ju(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});jx.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Ju(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Xx,$x=jx.range,Vx={"-":"",_:" ",0:"0"},Wx=/^\s*\d+/,Zx=/^%/,Gx=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Ja({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Jx=Date.prototype.toISOString?Qa:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ"),Qx=+new Date("2000-01-01T00:00:00.000Z")?Ka:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),Kx=1e3,tb=60*Kx,nb=60*tb,eb=24*nb,rb=7*eb,ib=30*eb,ob=365*eb,ub=function(){return ec(xx,gx,ix,ex,tx,Qm,Gm,$m,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},ab=function(){return ec(jx,Bx,Ex,Nx,Tx,wx,Gm,$m,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},cb=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})},sb=cb("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),fb=cb("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),lb=cb("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),hb=cb("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),pb=Zh(Wt(300,.5,0),Wt(-240,.5,1)),db=Zh(Wt(-100,.75,.35),Wt(80,1.5,.8)),vb=Zh(Wt(260,.75,.35),Wt(80,1.5,.8)),_b=Wt(),yb=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return _b.h=360*t-100,_b.s=1.5-1.5*n,_b.l=.8-.9*n,_b+""},gb=rc(cb("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),mb=rc(cb("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),xb=rc(cb("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),bb=rc(cb("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),wb=function(t){return function(){return t}},Mb=Math.abs,Tb=Math.atan2,kb=Math.cos,Nb=Math.max,Sb=Math.min,Eb=Math.sin,Ab=Math.sqrt,Cb=1e-12,zb=Math.PI,Pb=zb/2,Lb=2*zb,Rb=function(){function t(){var t,s,f=+n.apply(this,arguments),l=+e.apply(this,arguments),h=o.apply(this,arguments)-Pb,p=u.apply(this,arguments)-Pb,d=Mb(p-h),v=p>h;if(c||(c=t=Ue()),l<f&&(s=l,l=f,f=s),l>Cb)if(d>Lb-Cb)c.moveTo(l*kb(h),l*Eb(h)),c.arc(0,0,l,h,p,!v),f>Cb&&(c.moveTo(f*kb(p),f*Eb(p)),c.arc(0,0,f,p,h,v));else{var _,y,g=h,m=p,x=h,b=p,w=d,M=d,T=a.apply(this,arguments)/2,k=T>Cb&&(i?+i.apply(this,arguments):Ab(f*f+l*l)),N=Sb(Mb(l-f)/2,+r.apply(this,arguments)),S=N,E=N;if(k>Cb){var A=uc(k/f*Eb(T)),C=uc(k/l*Eb(T));(w-=2*A)>Cb?(A*=v?1:-1,x+=A,b-=A):(w=0,x=b=(h+p)/2),(M-=2*C)>Cb?(C*=v?1:-1,g+=C,m-=C):(M=0,g=m=(h+p)/2)}var z=l*kb(g),P=l*Eb(g),L=f*kb(b),R=f*Eb(b);if(N>Cb){var q=l*kb(m),U=l*Eb(m),D=f*kb(x),O=f*Eb(x);if(d<zb){var F=w>Cb?hc(z,P,D,O,q,U,L,R):[L,R],I=z-F[0],Y=P-F[1],B=q-F[0],H=U-F[1],j=1/Eb(oc((I*B+Y*H)/(Ab(I*I+Y*Y)*Ab(B*B+H*H)))/2),X=Ab(F[0]*F[0]+F[1]*F[1]);S=Sb(N,(f-X)/(j-1)),E=Sb(N,(l-X)/(j+1))}}M>Cb?E>Cb?(_=pc(D,O,z,P,l,E,v),y=pc(q,U,L,R,l,E,v),c.moveTo(_.cx+_.x01,_.cy+_.y01),E<N?c.arc(_.cx,_.cy,E,Tb(_.y01,_.x01),Tb(y.y01,y.x01),!v):(c.arc(_.cx,_.cy,E,Tb(_.y01,_.x01),Tb(_.y11,_.x11),!v),c.arc(0,0,l,Tb(_.cy+_.y11,_.cx+_.x11),Tb(y.cy+y.y11,y.cx+y.x11),!v),c.arc(y.cx,y.cy,E,Tb(y.y11,y.x11),Tb(y.y01,y.x01),!v))):(c.moveTo(z,P),c.arc(0,0,l,g,m,!v)):c.moveTo(z,P),f>Cb&&w>Cb?S>Cb?(_=pc(L,R,q,U,f,-S,v),y=pc(z,P,D,O,f,-S,v),c.lineTo(_.cx+_.x01,_.cy+_.y01),S<N?c.arc(_.cx,_.cy,S,Tb(_.y01,_.x01),Tb(y.y01,y.x01),!v):(c.arc(_.cx,_.cy,S,Tb(_.y01,_.x01),Tb(_.y11,_.x11),!v),c.arc(0,0,f,Tb(_.cy+_.y11,_.cx+_.x11),Tb(y.cy+y.y11,y.cx+y.x11),v),c.arc(y.cx,y.cy,S,Tb(y.y11,y.x11),Tb(y.y01,y.x01),!v))):c.arc(0,0,f,b,x,v):c.lineTo(L,R)}else c.moveTo(0,0);if(c.closePath(),t)return c=null,t+""||null}var n=ac,e=cc,r=wb(0),i=null,o=sc,u=fc,a=lc,c=null;return t.centroid=function(){var t=(+n.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+o.apply(this,arguments)+ +u.apply(this,arguments))/2-zb/2;return[kb(r)*t,Eb(r)*t]},t.innerRadius=function(e){return arguments.length?(n="function"==typeof e?e:wb(+e),t):n},t.outerRadius=function(n){return arguments.length?(e="function"==typeof n?n:wb(+n),t):e},t.cornerRadius=function(n){return arguments.length?(r="function"==typeof n?n:wb(+n),t):r},t.padRadius=function(n){return arguments.length?(i=null==n?null:"function"==typeof n?n:wb(+n),t):i},t.startAngle=function(n){return arguments.length?(o="function"==typeof n?n:wb(+n),t):o},t.endAngle=function(n){return arguments.length?(u="function"==typeof n?n:wb(+n),t):u},t.padAngle=function(n){return arguments.length?(a="function"==typeof n?n:wb(+n),t):a},t.context=function(n){return arguments.length?(c=null==n?null:n,t):c},t};dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var qb=function(t){return new dc(t)},Ub=function(){function t(t){var a,c,s,f=t.length,l=!1;for(null==i&&(u=o(s=Ue())),a=0;a<=f;++a)!(a<f&&r(c=t[a],a,t))===l&&((l=!l)?u.lineStart():u.lineEnd()),l&&u.point(+n(c,a,t),+e(c,a,t));if(s)return u=null,s+""||null}var n=vc,e=_c,r=wb(!0),i=null,o=qb,u=null;return t.x=function(e){return arguments.length?(n="function"==typeof e?e:wb(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:wb(+n),t):e},t.defined=function(n){return arguments.length?(r="function"==typeof n?n:wb(!!n),t):r},t.curve=function(n){return arguments.length?(o=n,null!=i&&(u=o(i)),t):o},t.context=function(n){return arguments.length?(null==n?i=u=null:u=o(i=n),t):i},t},Db=function(){function t(t){var n,f,l,h,p,d=t.length,v=!1,_=new Array(d),y=new Array(d);for(null==a&&(s=c(p=Ue())),n=0;n<=d;++n){if(!(n<d&&u(h=t[n],n,t))===v)if(v=!v)f=n,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),l=n-1;l>=f;--l)s.point(_[l],y[l]);s.lineEnd(),s.areaEnd()}v&&(_[n]=+e(h,n,t),y[n]=+i(h,n,t),s.point(r?+r(h,n,t):_[n],o?+o(h,n,t):y[n]))}if(p)return s=null,p+""||null}function n(){return Ub().defined(u).curve(c).context(a)}var e=vc,r=null,i=wb(0),o=_c,u=wb(!0),a=null,c=qb,s=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:wb(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:wb(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:wb(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:wb(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:wb(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:wb(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(u="function"==typeof n?n:wb(!!n),t):u},t.curve=function(n){return arguments.length?(c=n,null!=a&&(s=c(a)),t):c},t.context=function(n){return arguments.length?(null==n?a=s=null:s=c(a=n),t):a},t},Ob=function(t,n){return n<t?-1:n>t?1:n>=t?0:NaN},Fb=function(t){return t},Ib=function(){function t(t){var a,c,s,f,l,h=t.length,p=0,d=new Array(h),v=new Array(h),_=+i.apply(this,arguments),y=Math.min(Lb,Math.max(-Lb,o.apply(this,arguments)-_)),g=Math.min(Math.abs(y)/h,u.apply(this,arguments)),m=g*(y<0?-1:1);for(a=0;a<h;++a)(l=v[d[a]=a]=+n(t[a],a,t))>0&&(p+=l);for(null!=e?d.sort(function(t,n){return e(v[t],v[n])}):null!=r&&d.sort(function(n,e){return r(t[n],t[e])}),a=0,s=p?(y-h*m)/p:0;a<h;++a,_=f)c=d[a],l=v[c],f=_+(l>0?l*s:0)+m,v[c]={data:t[c],index:a,value:l,startAngle:_,endAngle:f,padAngle:g};return v}var n=Fb,e=Ob,r=null,i=wb(0),o=wb(Lb),u=wb(0);return t.value=function(e){return arguments.length?(n="function"==typeof e?e:wb(+e),t):n},t.sortValues=function(n){return arguments.length?(e=n,r=null,t):e},t.sort=function(n){return arguments.length?(r=n,e=null,t):r},t.startAngle=function(n){return arguments.length?(i="function"==typeof n?n:wb(+n),t):i},t.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:wb(+n),t):o},t.padAngle=function(n){return arguments.length?(u="function"==typeof n?n:wb(+n),t):u},t},Yb=gc(qb);yc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var Bb=function(){return mc(Ub().curve(Yb))},Hb=function(){var t=Db().curve(Yb),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return mc(e())},delete t.lineX0,t.lineEndAngle=function(){return mc(r())},delete t.lineX1,t.lineInnerRadius=function(){return mc(i())},delete t.lineY0,t.lineOuterRadius=function(){return mc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(gc(t)):n()._curve},t},jb=Array.prototype.slice,Xb=function(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]},$b={draw:function(t,n){var e=Math.sqrt(n/zb);t.moveTo(e,0),t.arc(0,0,e,0,Lb)}},Vb={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Wb=Math.sqrt(1/3),Zb=2*Wb,Gb={draw:function(t,n){var e=Math.sqrt(n/Zb),r=e*Wb;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Jb=Math.sin(zb/10)/Math.sin(7*zb/10),Qb=Math.sin(Lb/10)*Jb,Kb=-Math.cos(Lb/10)*Jb,tw={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=Qb*e,i=Kb*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var u=Lb*o/5,a=Math.cos(u),c=Math.sin(u);t.lineTo(c*e,-a*e),t.lineTo(a*r-c*i,c*r+a*i)}t.closePath()}},nw={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},ew=Math.sqrt(3),rw={draw:function(t,n){var e=-Math.sqrt(n/(3*ew));t.moveTo(0,2*e),t.lineTo(-ew*e,-e),t.lineTo(ew*e,-e),t.closePath()}},iw=-.5,ow=Math.sqrt(3)/2,uw=1/Math.sqrt(12),aw=3*(uw/2+1),cw={draw:function(t,n){var e=Math.sqrt(n/aw),r=e/2,i=e*uw,o=r,u=e*uw+e,a=-o,c=u;t.moveTo(r,i),t.lineTo(o,u),t.lineTo(a,c),t.lineTo(iw*r-ow*i,ow*r+iw*i),t.lineTo(iw*o-ow*u,ow*o+iw*u),t.lineTo(iw*a-ow*c,ow*a+iw*c),t.lineTo(iw*r+ow*i,iw*i-ow*r),t.lineTo(iw*o+ow*u,iw*u-ow*o),t.lineTo(iw*a+ow*c,iw*c-ow*a),t.closePath()}},sw=[$b,Vb,Gb,nw,tw,rw,cw],fw=function(){function t(){var t;if(r||(r=t=Ue()),n.apply(this,arguments).draw(r,+e.apply(this,arguments)),t)return r=null,t+""||null}var n=wb($b),e=wb(64),r=null;return t.type=function(e){return arguments.length?(n="function"==typeof e?e:wb(e),t):n},t.size=function(n){return arguments.length?(e="function"==typeof n?n:wb(+n),t):e},t.context=function(n){return arguments.length?(r=null==n?null:n,t):r},t},lw=function(){};Cc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ac(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ac(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var hw=function(t){return new Cc(t)};zc.prototype={areaStart:lw,areaEnd:lw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Ac(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var pw=function(t){return new zc(t)};Pc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Ac(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var dw=function(t){return new Pc(t)};Lc.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],u=t[e]-i,a=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*u),this._beta*n[c]+(1-this._beta)*(o+r*a));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var vw=function t(n){function e(t){return 1===n?new Cc(t):new Lc(t,n)}return e.beta=function(n){return t(+n)},e}(.85);qc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Rc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Rc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1, | |
this._y1=this._y2,this._y2=n}};var _w=function t(n){function e(t){return new qc(t,n)}return e.tension=function(n){return t(+n)},e}(0);Uc.prototype={areaStart:lw,areaEnd:lw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Rc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var yw=function t(n){function e(t){return new Uc(t,n)}return e.tension=function(n){return t(+n)},e}(0);Dc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Rc(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var gw=function t(n){function e(t){return new Dc(t,n)}return e.tension=function(n){return t(+n)},e}(0);Fc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Oc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var mw=function t(n){function e(t){return n?new Fc(t,n):new qc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Ic.prototype={areaStart:lw,areaEnd:lw,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Oc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var xw=function t(n){function e(t){return n?new Ic(t,n):new Uc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Yc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Oc(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var bw=function t(n){function e(t){return n?new Yc(t,n):new Dc(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);Bc.prototype={areaStart:lw,areaEnd:lw,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};var ww=function(t){return new Bc(t)};Vc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:$c(this,this._t0,Xc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,$c(this,Xc(this,e=jc(this,t,n)),e);break;default:$c(this,this._t0,e=jc(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(Wc.prototype=Object.create(Vc.prototype)).point=function(t,n){Vc.prototype.point.call(this,n,t)},Zc.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}},Qc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),2===e)this._context.lineTo(t[1],n[1]);else for(var r=Kc(t),i=Kc(n),o=0,u=1;u<e;++o,++u)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],t[u],n[u]);(this._line||0!==this._line&&1===e)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Mw=function(t){return new Qc(t)};ts.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Tw=function(t){return new ts(t,.5)},kw=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,u=t[n[0]],a=u.length;o<i;++o)for(r=u,u=t[n[o]],e=0;e<a;++e)u[e][1]+=u[e][0]=isNaN(r[e][1])?r[e][0]:r[e][1]},Nw=function(t){for(var n=t.length,e=new Array(n);--n>=0;)e[n]=n;return e},Sw=function(){function t(t){var o,u,a=n.apply(this,arguments),c=t.length,s=a.length,f=new Array(s);for(o=0;o<s;++o){for(var l,h=a[o],p=f[o]=new Array(c),d=0;d<c;++d)p[d]=l=[0,+i(t[d],h,d,t)],l.data=t[d];p.key=h}for(o=0,u=e(f);o<s;++o)f[u[o]].index=o;return r(f,u),f}var n=wb([]),e=Nw,r=kw,i=rs;return t.keys=function(e){return arguments.length?(n="function"==typeof e?e:wb(jb.call(e)),t):n},t.value=function(n){return arguments.length?(i="function"==typeof n?n:wb(+n),t):i},t.order=function(n){return arguments.length?(e=null==n?Nw:"function"==typeof n?n:wb(jb.call(n)),t):e},t.offset=function(n){return arguments.length?(r=null==n?kw:n,t):r},t},Ew=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,u=t[0].length;o<u;++o){for(i=e=0;e<r;++e)i+=t[e][o][1]||0;if(i)for(e=0;e<r;++e)t[e][o][1]/=i}kw(t,n)}},Aw=function(t,n){if((a=t.length)>1)for(var e,r,i,o,u,a,c=0,s=t[n[0]].length;c<s;++c)for(o=u=0,e=0;e<a;++e)(i=(r=t[n[e]][c])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=u,r[0]=u+=i):r[0]=o},Cw=function(t,n){if((e=t.length)>0){for(var e,r=0,i=t[n[0]],o=i.length;r<o;++r){for(var u=0,a=0;u<e;++u)a+=t[u][r][1]||0;i[r][1]+=i[r][0]=-a/2}kw(t,n)}},zw=function(t,n){if((i=t.length)>0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,u=1;u<r;++u){for(var a=0,c=0,s=0;a<i;++a){for(var f=t[n[a]],l=f[u][1]||0,h=f[u-1][1]||0,p=(l-h)/2,d=0;d<a;++d){var v=t[n[d]];p+=(v[u][1]||0)-(v[u-1][1]||0)}c+=l,s+=p*l}e[u-1][1]+=e[u-1][0]=o,c&&(o-=s/c)}e[u-1][1]+=e[u-1][0]=o,kw(t,n)}},Pw=function(t){var n=t.map(is);return Nw(t).sort(function(t,e){return n[t]-n[e]})},Lw=function(t){return Pw(t).reverse()},Rw=function(t){var n,e,r=t.length,i=t.map(is),o=Nw(t).sort(function(t,n){return i[n]-i[t]}),u=0,a=0,c=[],s=[];for(n=0;n<r;++n)e=o[n],u<a?(u+=i[e],c.push(e)):(a+=i[e],s.push(e));return s.reverse().concat(c)},qw=function(t){return Nw(t).reverse()},Uw=function(t){return function(){return t}};as.prototype={constructor:as,insert:function(t,n){var e,r,i;if(t){if(n.P=t,n.N=t.N,t.N&&(t.N.P=n),t.N=n,t.R){for(t=t.R;t.L;)t=t.L;t.L=n}else t.R=n;e=t}else this._?(t=ls(this._),n.P=null,n.N=t,t.P=t.L=n,e=t):(n.P=n.N=null,this._=n,e=null);for(n.L=n.R=null,n.U=e,n.C=!0,t=n;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.R&&(ss(this,e),t=e,e=t.U),e.C=!1,r.C=!0,fs(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,t=r):(t===e.L&&(fs(this,e),t=e,e=t.U),e.C=!1,r.C=!0,ss(this,r))),e=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var n,e,r,i=t.U,o=t.L,u=t.R;if(e=o?u?ls(u):o:u,i?i.L===t?i.L=e:i.R=e:this._=e,o&&u?(r=e.C,e.C=t.C,e.L=o,o.U=e,e!==u?(i=e.U,e.U=t.U,t=e.R,i.L=t,e.R=u,u.U=e):(e.U=i,i=e,t=e.R)):(r=t.C,t=e),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(n=i.R,n.C&&(n.C=!1,i.C=!0,ss(this,i),n=i.R),n.L&&n.L.C||n.R&&n.R.C){n.R&&n.R.C||(n.L.C=!1,n.C=!0,fs(this,n),n=i.R),n.C=i.C,i.C=n.R.C=!1,ss(this,i),t=this._;break}}else if(n=i.L,n.C&&(n.C=!1,i.C=!0,fs(this,i),n=i.L),n.L&&n.L.C||n.R&&n.R.C){n.L&&n.L.C||(n.R.C=!1,n.C=!0,ss(this,n),n=i.L),n.C=i.C,i.C=n.L.C=!1,fs(this,i),t=this._;break}n.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}};var Dw,Ow,Fw,Iw,Yw,Bw=[],Hw=[],jw=1e-6,Xw=1e-12;Us.prototype={constructor:Us,polygons:function(){var t=this.edges;return this.cells.map(function(n){var e=n.halfedges.map(function(e){return xs(n,t[e])});return e.data=n.site.data,e})},triangles:function(){var t=[],n=this.edges;return this.cells.forEach(function(e,r){if(o=(i=e.halfedges).length)for(var i,o,u,a=e.site,c=-1,s=n[i[o-1]],f=s.left===a?s.right:s.left;++c<o;)u=f,s=n[i[c]],f=s.left===a?s.right:s.left,u&&f&&r<u.index&&r<f.index&&Rs(a,u,f)<0&&t.push([a.data,u.data,f.data])}),t},links:function(){return this.edges.filter(function(t){return t.right}).map(function(t){return{source:t.left.data,target:t.right.data}})},find:function(t,n,e){for(var r,i,o=this,u=o._found||0,a=o.cells.length;!(i=o.cells[u]);)if(++u>=a)return null;var c=t-i.site[0],s=n-i.site[1],f=c*c+s*s;do{i=o.cells[r=u],u=null,i.halfedges.forEach(function(e){var r=o.edges[e],a=r.left;if(a!==i.site&&a||(a=r.right)){var c=t-a[0],s=n-a[1],l=c*c+s*s;l<f&&(f=l,u=a.index)}})}while(null!==u);return o._found=r,null==e||f<=e*e?i.site:null}};var $w=function(){function t(t){return new Us(t.map(function(r,i){var o=[Math.round(n(r,i,t)/jw)*jw,Math.round(e(r,i,t)/jw)*jw];return o.index=i,o.data=r,o}),r)}var n=os,e=us,r=null;return t.polygons=function(n){return t(n).polygons()},t.links=function(n){return t(n).links()},t.triangles=function(n){return t(n).triangles()},t.x=function(e){return arguments.length?(n="function"==typeof e?e:Uw(+e),t):n},t.y=function(n){return arguments.length?(e="function"==typeof n?n:Uw(+n),t):e},t.extent=function(n){return arguments.length?(r=null==n?null:[[+n[0][0],+n[0][1]],[+n[1][0],+n[1][1]]],t):r&&[[r[0][0],r[0][1]],[r[1][0],r[1][1]]]},t.size=function(n){return arguments.length?(r=null==n?null:[[0,0],[+n[0],+n[1]]],t):r&&[r[1][0]-r[0][0],r[1][1]-r[0][1]]},t},Vw=function(t){return function(){return t}};Os.prototype={constructor:Os,scale:function(t){return 1===t?this:new Os(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Os(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ww=new Os(1,0,0);Fs.prototype=Os.prototype;var Zw=function(){t.event.preventDefault(),t.event.stopImmediatePropagation()},Gw=function(){function n(t){t.on("wheel.zoom",s).on("mousedown.zoom",f).on("dblclick.zoom",l).on("touchstart.zoom",h).on("touchmove.zoom",p).on("touchend.zoom touchcancel.zoom",d).style("-webkit-tap-highlight-color","rgba(0,0,0,0)").property("__zoom",Hs)}function e(t,n){return n=Math.max(x,Math.min(b,n)),n===t.k?t:new Os(n,t.x,t.y)}function r(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Os(t.k,r,i)}function i(t,n){var e=t.invertX(n[0][0])-w,r=t.invertX(n[1][0])-M,i=t.invertY(n[0][1])-T,o=t.invertY(n[1][1])-k;return t.translate(r>e?(e+r)/2:Math.min(0,e)||Math.max(0,r),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function o(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function u(t,n,e){t.on("start.zoom",function(){a(this,arguments).start()}).on("interrupt.zoom end.zoom",function(){a(this,arguments).end()}).tween("zoom",function(){var t=this,r=arguments,i=a(t,r),u=m.apply(t,r),c=e||o(u),s=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,l="function"==typeof n?n.apply(t,r):n,h=S(f.invert(c).concat(s/f.k),l.invert(c).concat(s/l.k));return function(t){if(1===t)t=l;else{var n=h(t),e=s/n[2];t=new Os(e,c[0]-n[0]*e,c[1]-n[1]*e)}i.zoom(null,t)}})}function a(t,n){for(var e,r=0,i=E.length;r<i;++r)if((e=E[r]).that===t)return e;return new c(t,n)}function c(t,n){this.that=t,this.args=n,this.index=-1,this.active=0,this.extent=m.apply(t,n)}function s(){function n(){o.wheel=null,o.end()}if(g.apply(this,arguments)){var o=a(this,arguments),u=this.__zoom,c=Math.max(x,Math.min(b,u.k*Math.pow(2,-t.event.deltaY*(t.event.deltaMode?120:1)/500))),s=Gf(this);if(o.wheel)o.mouse[0][0]===s[0]&&o.mouse[0][1]===s[1]||(o.mouse[1]=u.invert(o.mouse[0]=s)),clearTimeout(o.wheel);else{if(u.k===c)return;o.mouse=[s,u.invert(s)],gp(this),o.start()}Zw(),o.wheel=setTimeout(n,P),o.zoom("mouse",i(r(e(u,c),o.mouse[0],o.mouse[1]),o.extent))}}function f(){function n(){if(Zw(),!o.moved){var n=t.event.clientX-s,e=t.event.clientY-f;o.moved=n*n+e*e>L}o.zoom("mouse",i(r(o.that.__zoom,o.mouse[0]=Gf(o.that),o.mouse[1]),o.extent))}function e(){u.on("mousemove.zoom mouseup.zoom",null),mt(t.event.view,o.moved),Zw(),o.end()}if(!y&&g.apply(this,arguments)){var o=a(this,arguments),u=Pl(t.event.view).on("mousemove.zoom",n,!0).on("mouseup.zoom",e,!0),c=Gf(this),s=t.event.clientX,f=t.event.clientY;Dl(t.event.view),Is(),o.mouse=[c,this.__zoom.invert(c)],gp(this),o.start()}}function l(){if(g.apply(this,arguments)){var o=this.__zoom,a=Gf(this),c=o.invert(a),s=o.k*(t.event.shiftKey?.5:2),f=i(r(e(o,s),a,c),m.apply(this,arguments));Zw(),N>0?Pl(this).transition().duration(N).call(u,f,a):Pl(this).call(n.transform,f)}}function h(){if(g.apply(this,arguments)){var n,e,r,i,o=a(this,arguments),u=t.event.changedTouches,c=u.length;for(Is(),e=0;e<c;++e)r=u[e],i=Rl(this,u,r.identifier),i=[i,this.__zoom.invert(i),r.identifier],o.touch0?o.touch1||(o.touch1=i):(o.touch0=i,n=!0);if(_&&(_=clearTimeout(_),!o.touch1))return o.end(),void((i=Pl(this).on("dblclick.zoom"))&&i.apply(this,arguments));n&&(_=setTimeout(function(){_=null},z),gp(this),o.start())}}function p(){var n,o,u,c,s=a(this,arguments),f=t.event.changedTouches,l=f.length;for(Zw(),_&&(_=clearTimeout(_)),n=0;n<l;++n)o=f[n],u=Rl(this,f,o.identifier),s.touch0&&s.touch0[2]===o.identifier?s.touch0[0]=u:s.touch1&&s.touch1[2]===o.identifier&&(s.touch1[0]=u);if(o=s.that.__zoom,s.touch1){var h=s.touch0[0],p=s.touch0[1],d=s.touch1[0],v=s.touch1[1],y=(y=d[0]-h[0])*y+(y=d[1]-h[1])*y,g=(g=v[0]-p[0])*g+(g=v[1]-p[1])*g;o=e(o,Math.sqrt(y/g)),u=[(h[0]+d[0])/2,(h[1]+d[1])/2],c=[(p[0]+v[0])/2,(p[1]+v[1])/2]}else{if(!s.touch0)return;u=s.touch0[0],c=s.touch0[1]}s.zoom("touch",i(r(o,u,c),s.extent))}function d(){var n,e,r=a(this,arguments),i=t.event.changedTouches,o=i.length;for(Is(),y&&clearTimeout(y),y=setTimeout(function(){y=null},z),n=0;n<o;++n)e=i[n],r.touch0&&r.touch0[2]===e.identifier?delete r.touch0:r.touch1&&r.touch1[2]===e.identifier&&delete r.touch1;r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0?r.touch0[1]=this.__zoom.invert(r.touch0[0]):r.end()}var _,y,g=Ys,m=Bs,x=0,b=1/0,w=-b,M=b,T=w,k=M,N=250,S=Hh,E=[],C=v("start","zoom","end"),z=500,P=150,L=0;return n.transform=function(t,n){var e=t.selection?t.selection():t;e.property("__zoom",Hs),t!==e?u(t,n):e.interrupt().each(function(){a(this,arguments).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()})},n.scaleBy=function(t,e){n.scaleTo(t,function(){return this.__zoom.k*("function"==typeof e?e.apply(this,arguments):e)})},n.scaleTo=function(t,u){n.transform(t,function(){var t=m.apply(this,arguments),n=this.__zoom,a=o(t),c=n.invert(a);return i(r(e(n,"function"==typeof u?u.apply(this,arguments):u),a,c),t)})},n.translateBy=function(t,e,r){n.transform(t,function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof r?r.apply(this,arguments):r),m.apply(this,arguments))})},c.prototype={start:function(){return 1==++this.active&&(this.index=E.push(this)-1,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(E.splice(this.index,1),this.index=-1,this.emit("end")),this},emit:function(t){A(new Ds(n,t,this.that.__zoom),C.apply,C,[t,this.that,this.args])}},n.filter=function(t){return arguments.length?(g="function"==typeof t?t:Vw(!!t),n):g},n.extent=function(t){return arguments.length?(m="function"==typeof t?t:Vw([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),n):m},n.scaleExtent=function(t){return arguments.length?(x=+t[0],b=+t[1],n):[x,b]},n.translateExtent=function(t){return arguments.length?(w=+t[0][0],M=+t[1][0],T=+t[0][1],k=+t[1][1],n):[[w,T],[M,k]]},n.duration=function(t){return arguments.length?(N=+t,n):N},n.interpolate=function(t){return arguments.length?(S=t,n):S},n.on=function(){var t=C.on.apply(C,arguments);return t===C?n:t},n.clickDistance=function(t){return arguments.length?(L=(t=+t)*t,n):Math.sqrt(L)},n};t.version="4.9.1",t.bisect=Vs,t.bisectRight=Vs,t.bisectLeft=Ws,t.ascending=js,t.bisector=Xs,t.cross=Gs,t.descending=Js,t.deviation=tf,t.extent=nf,t.histogram=df,t.thresholdFreedmanDiaconis=_f,t.thresholdScott=yf,t.thresholdSturges=pf,t.max=gf,t.mean=mf,t.median=xf,t.merge=bf,t.min=wf,t.pairs=Zs,t.permute=Mf,t.quantile=vf,t.range=cf,t.scan=Tf,t.shuffle=kf,t.sum=Nf,t.ticks=hf,t.tickIncrement=r,t.tickStep=i,t.transpose=Sf,t.variance=Ks,t.zip=Ef,t.axisTop=l,t.axisRight=h,t.axisBottom=p,t.axisLeft=d,t.brush=Ed,t.brushX=ze,t.brushY=Pe,t.brushSelection=Ce,t.chord=qd,t.ribbon=Yd,t.nest=Bd,t.set=Ze,t.map=He,t.keys=jd,t.values=Xd,t.entries=$d,t.color=Nt,t.rgb=Ct,t.hsl=Rt,t.lab=Ot,t.hcl=Xt,t.cubehelix=Wt,t.dispatch=v,t.drag=Fl,t.dragDisable=Dl,t.dragEnable=mt,t.dsvFormat=Vd,t.csvParse=Zd,t.csvParseRows=Gd,t.csvFormat=Jd,t.csvFormatRows=Qd,t.tsvParse=tv,t.tsvParseRows=nv,t.tsvFormat=ev,t.tsvFormatRows=rv,t.easeLinear=ie,t.easeQuad=ae,t.easeQuadIn=oe,t.easeQuadOut=ue,t.easeQuadInOut=ae,t.easeCubic=fe,t.easeCubicIn=ce,t.easeCubicOut=se,t.easeCubicInOut=fe,t.easePoly=Hp,t.easePolyIn=Yp,t.easePolyOut=Bp,t.easePolyInOut=Hp,t.easeSin=pe,t.easeSinIn=le,t.easeSinOut=he,t.easeSinInOut=pe,t.easeExp=_e,t.easeExpIn=de,t.easeExpOut=ve,t.easeExpInOut=_e,t.easeCircle=me,t.easeCircleIn=ye,t.easeCircleOut=ge,t.easeCircleInOut=me,t.easeBounce=be,t.easeBounceIn=xe,t.easeBounceOut=be,t.easeBounceInOut=we,t.easeBack=id,t.easeBackIn=ed,t.easeBackOut=rd,t.easeBackInOut=id,t.easeElastic=ad,t.easeElasticIn=ud,t.easeElasticOut=ad,t.easeElasticInOut=cd,t.forceCenter=iv,t.forceCollide=wv,t.forceLink=Mv,t.forceManyBody=Sv,t.forceSimulation=Nv,t.forceX=Ev,t.forceY=Av,t.formatDefaultLocale=vr,t.formatLocale=Bv,t.formatSpecifier=pr,t.precisionFixed=Hv,t.precisionPrefix=jv,t.precisionRound=Xv,t.geoArea=G_,t.geoBounds=K_,t.geoCentroid=ny,t.geoCircle=_y,t.geoClipExtent=My,t.geoContains=Ry,t.geoDistance=zy,t.geoGraticule=Ti,t.geoGraticule10=ki,t.geoInterpolate=qy,t.geoLength=Ey,t.geoPath=cg,t.geoAlbers=gg,t.geoAlbersUsa=mg,t.geoAzimuthalEqualArea=bg,t.geoAzimuthalEqualAreaRaw=xg,t.geoAzimuthalEquidistant=Mg,t.geoAzimuthalEquidistantRaw=wg,t.geoConicConformal=kg,t.geoConicConformalRaw=po,t.geoConicEqualArea=yg,t.geoConicEqualAreaRaw=uo,t.geoConicEquidistant=Sg,t.geoConicEquidistantRaw=_o,t.geoEquirectangular=Ng,t.geoEquirectangularRaw=vo,t.geoGnomonic=Eg,t.geoGnomonicRaw=yo,t.geoIdentity=Ag,t.geoProjection=eo,t.geoProjectionMutator=ro,t.geoMercator=Tg,t.geoMercatorRaw=fo,t.geoOrthographic=Cg,t.geoOrthographicRaw=mo,t.geoStereographic=zg,t.geoStereographicRaw=xo,t.geoTransverseMercator=Pg,t.geoTransverseMercatorRaw=bo,t.geoRotation=vy,t.geoStream=$_,t.geoTransform=hg,t.cluster=Lg,t.hierarchy=zo,t.pack=Zg,t.packSiblings=Vg,t.packEnclose=$g,t.partition=Qg,t.stratify=em,t.tree=rm,t.treemap=am,t.treemapBinary=cm,t.treemapDice=Jg,t.treemapSlice=im,t.treemapSliceDice=sm,t.treemapSquarify=um,t.treemapResquarify=fm,t.interpolate=qh,t.interpolateArray=Eh,t.interpolateBasis=wh,t.interpolateBasisClosed=Mh,t.interpolateDate=Ah,t.interpolateNumber=Ch,t.interpolateObject=zh,t.interpolateRound=Uh,t.interpolateString=Rh,t.interpolateTransformCss=Ih,t.interpolateTransformSvg=Yh,t.interpolateZoom=Hh,t.interpolateRgb=kh,t.interpolateRgbBasis=Nh,t.interpolateRgbBasisClosed=Sh,t.interpolateHsl=jh,t.interpolateHslLong=Xh,t.interpolateLab=pn,t.interpolateHcl=$h,t.interpolateHclLong=Vh,t.interpolateCubehelix=Wh,t.interpolateCubehelixLong=Zh,t.quantize=Gh,t.path=Ue,t.polygonArea=lm,t.polygonCentroid=hm;t.polygonHull=dm,t.polygonContains=vm,t.polygonLength=_m,t.quadtree=ir,t.queue=xu,t.randomUniform=xm,t.randomNormal=bm,t.randomLogNormal=wm,t.randomBates=Tm,t.randomIrwinHall=Mm,t.randomExponential=km,t.request=Nm,t.html=Em,t.json=Am,t.text=Cm,t.xml=zm,t.csv=Lm,t.tsv=Rm,t.scaleBand=ku,t.scalePoint=Su,t.scaleIdentity=Du,t.scaleLinear=Uu,t.scaleLog=ju,t.scaleOrdinal=Tu,t.scaleImplicit=Om,t.scalePow=$u,t.scaleSqrt=Vu,t.scaleQuantile=Wu,t.scaleQuantize=Zu,t.scaleThreshold=Gu,t.scaleTime=ub,t.scaleUtc=ab,t.schemeCategory10=sb,t.schemeCategory20b=fb,t.schemeCategory20c=lb,t.schemeCategory20=hb,t.interpolateCubehelixDefault=pb,t.interpolateRainbow=yb,t.interpolateWarm=db,t.interpolateCool=vb,t.interpolateViridis=gb,t.interpolateMagma=mb,t.interpolateInferno=xb,t.interpolatePlasma=bb,t.scaleSequential=ic,t.creator=If,t.local=w,t.matcher=Xf,t.mouse=Gf,t.namespace=Ff,t.namespaces=Of,t.select=Pl,t.selectAll=Ll,t.selection=yt,t.selector=Jf,t.selectorAll=Kf,t.style=X,t.touch=Rl,t.touches=ql,t.window=gl,t.customEvent=A,t.arc=Rb,t.area=Db,t.line=Ub,t.pie=Ib,t.radialArea=Hb,t.radialLine=Bb,t.linkHorizontal=Nc,t.linkVertical=Sc,t.linkRadial=Ec,t.symbol=fw,t.symbols=sw,t.symbolCircle=$b,t.symbolCross=Vb,t.symbolDiamond=Gb,t.symbolSquare=nw,t.symbolStar=tw,t.symbolTriangle=rw,t.symbolWye=cw,t.curveBasisClosed=pw,t.curveBasisOpen=dw,t.curveBasis=hw,t.curveBundle=vw,t.curveCardinalClosed=yw,t.curveCardinalOpen=gw,t.curveCardinal=_w,t.curveCatmullRomClosed=xw,t.curveCatmullRomOpen=bw,t.curveCatmullRom=mw,t.curveLinearClosed=ww,t.curveLinear=qb,t.curveMonotoneX=Gc,t.curveMonotoneY=Jc,t.curveNatural=Mw,t.curveStep=Tw,t.curveStepAfter=es,t.curveStepBefore=ns,t.stack=Sw,t.stackOffsetExpand=Ew,t.stackOffsetDiverging=Aw,t.stackOffsetNone=kw,t.stackOffsetSilhouette=Cw,t.stackOffsetWiggle=zw,t.stackOrderAscending=Pw,t.stackOrderDescending=Lw,t.stackOrderInsideOut=Rw,t.stackOrderNone=Nw,t.stackOrderReverse=qw,t.timeInterval=Ju,t.timeMillisecond=$m,t.timeMilliseconds=Vm,t.utcMillisecond=$m,t.utcMilliseconds=Vm,t.timeSecond=Gm,t.timeSeconds=Jm,t.utcSecond=Gm,t.utcSeconds=Jm,t.timeMinute=Qm,t.timeMinutes=Km,t.timeHour=tx,t.timeHours=nx,t.timeDay=ex,t.timeDays=rx,t.timeWeek=ix,t.timeWeeks=lx,t.timeSunday=ix,t.timeSundays=lx,t.timeMonday=ox,t.timeMondays=hx,t.timeTuesday=ux,t.timeTuesdays=px,t.timeWednesday=ax,t.timeWednesdays=dx,t.timeThursday=cx,t.timeThursdays=vx,t.timeFriday=sx,t.timeFridays=_x,t.timeSaturday=fx,t.timeSaturdays=yx,t.timeMonth=gx,t.timeMonths=mx,t.timeYear=xx,t.timeYears=bx,t.utcMinute=wx,t.utcMinutes=Mx,t.utcHour=Tx,t.utcHours=kx,t.utcDay=Nx,t.utcDays=Sx,t.utcWeek=Ex,t.utcWeeks=qx,t.utcSunday=Ex,t.utcSundays=qx,t.utcMonday=Ax,t.utcMondays=Ux,t.utcTuesday=Cx,t.utcTuesdays=Dx,t.utcWednesday=zx,t.utcWednesdays=Ox,t.utcThursday=Px,t.utcThursdays=Fx,t.utcFriday=Lx,t.utcFridays=Ix,t.utcSaturday=Rx,t.utcSaturdays=Yx,t.utcMonth=Bx,t.utcMonths=Hx,t.utcYear=jx,t.utcYears=$x,t.timeFormatDefaultLocale=Ja,t.timeFormatLocale=ra,t.isoFormat=Jx,t.isoParse=Qx,t.now=_n,t.timer=mn,t.timerFlush=xn,t.timeout=up,t.interval=ap,t.transition=ee,t.active=hd,t.interrupt=gp,t.voronoi=$w,t.zoom=Gw,t.zoomTransform=Fs,t.zoomIdentity=Ww,Object.defineProperty(t,"__esModule",{value:!0})}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/wbkd/d3-extended | |
d3.selection.prototype.moveToFront = function() { | |
return this.each(function(){ | |
this.parentNode.appendChild(this); | |
}); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<!-- Vendor Modules --> | |
<script src="./d3.js"></script> | |
<script src="./moment.js"></script> | |
<!-- PB Modules --> | |
<script src="./helpers.js"></script> | |
<script src="./line-chart.js"></script> | |
<!-- CSS Styling --> | |
<link href="./line-chart.css" rel="stylesheet" /> | |
<body> | |
<div id="chart"></div> | |
<script> | |
var datasets = ["Any_Bedrooms", "One_Bedroom", "Studios", "Two_Bedrooms", "Three_Bedrooms_Or_More"]; | |
// sales_discount_share_time_series_All_Types_ | |
// | |
var selection = d3.select("#select-data") | |
.on("input", function(d) { | |
d3.csv("./sales_inventory_time_series_counts_All_Types_" + this.value + ".csv", ready); | |
}) | |
selection.selectAll("option") | |
.data(datasets) | |
.enter().append("option") | |
.attr("value", function(d) { return d }) | |
.text(function(d) { return d }); | |
d3.csv("./sales_inventory_time_series_counts_All_Types_Any_Bedrooms.csv", ready); | |
function ready(error, data) { | |
console.log(data); | |
var columns = data.columns.filter(function(d) { return d != "Area" || d != "Boro" || d != "AreaType" }) | |
, flatData = [] | |
, excludeAreas = ["Area","NYC","Manhattan","All Downtown","All Midtown","All Upper West Side","All Upper East Side","All Upper Manhattan","Bronx","Brooklyn","North Brooklyn","Northwest Brooklyn","East Brooklyn","Prospect Park","South Brooklyn","Queens","Staten Island"]; | |
data = data.filter(function(d) { return excludeAreas.indexOf(d["Area"]) == -1 }) | |
.filter(function(d) { return d["Boro"] == "Brooklyn" }) | |
data.forEach(function(d) { | |
columns.forEach(function(col) { | |
d["date"] = moment(col, "YYYY-MM-DD"); | |
if(+d[col] > 0) { flatData.push({"date": d["date"], "val": +d[col], "area": d["Area"] }); } | |
}) | |
}); | |
var lines = lineChart() | |
.x("date") | |
.y("val") | |
.margin({top: 20, right: 20, bottom: 120, left: 60}) | |
.width(parseInt(d3.select("#chart").style("width"),10)) | |
.height(650 - 50 - 100) | |
.nest("area"); | |
d3.select("#chart") | |
.datum(flatData) | |
.call(lines); | |
} | |
</script> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Source Sans Pro', sans-serif !important; | |
font-color: #004C75; | |
font-weight: 300; | |
} | |
select { | |
border-radius: 0 0 0 0 !important; | |
background-color: #fff !important; | |
border: 1px solid #ccc !important; | |
color: #1A1F2C !important; | |
font-family: Source Sans Pro, Helvetica, Arial, Geneva, sans-serif !important; | |
font-size: 12px !important; | |
height: 32px !important; | |
margin: 0 !important; | |
outline: 0 !important; | |
padding: 7px !important; | |
text-align: left !important; | |
vertical-align: top !important; | |
-webkit-appearance: none !important; | |
} | |
select, select[size="0"], select[size="1"] { | |
background-image: url(data:image/png;base64,R0lGODlhDQAEAIAAAAAAAP8A/yH5BAEHAAEALAAAAAANAAQAAAILhA+hG5jMDpxvhgIAOw==); | |
background-repeat: no-repeat; | |
background-position: right center; | |
padding-right: 20px !important; | |
} | |
h2 { | |
margin-top: 0px !important; | |
padding-top: 0px !important; | |
} | |
#sidebar { | |
padding-left: 50px !important; | |
} | |
.input select { | |
padding-left: 0px; | |
margin-left: 0px; | |
} | |
.no-padding { | |
padding: 0px !important; | |
margin: 0px !important; | |
} | |
.HomeCampaignBanner { | |
width: 100%; | |
height: 112px; | |
clear: left; | |
display: block; | |
position: relative; | |
background: url(//cdn-assets-s3.streeteasy.com/assets/home/2017_skyline_mobileweb@2x-b34dcf6b8c1cd7f972641e0d85c0d6238364d87e1806778ba5df3c7d04c159cb.png) left bottom/auto 100% repeat; | |
} | |
.brush-text { | |
font-size: 12px; | |
font-weight: 100; | |
} | |
.navbar-logotype { | |
margin: 10px; | |
} | |
.navbar-nav { | |
padding-top:0px !important; | |
padding-bottom:0 !important; | |
height: 18px; | |
} | |
.navbar { | |
min-height:12px !important; | |
background-color: #0280C5 !important | |
} | |
.parent { | |
margin-top: 70px; | |
} | |
.zero-line { | |
stroke: darkgray; | |
stroke-width: 2px; | |
} | |
.subtext { | |
align: center; | |
} | |
.y .tick line { | |
stroke: #000; | |
stroke-width: .125px; | |
stroke-opacity: .125px; | |
} | |
.x .tick line { | |
stroke: #fff; | |
stroke-width: 20px; | |
} | |
.axis--x .domain, | |
.axis--grid .tick line { | |
stroke: #fff; | |
} | |
.axis--grid .tick--minor line { | |
stroke-opacity: .5; | |
} | |
.axis line { | |
stroke: #000; | |
} | |
.domain { | |
stroke: none; | |
} | |
.above { | |
fill: #ED422F; | |
} | |
.below { | |
fill: #8C8C8C; | |
} | |
.line { | |
stroke: #000; | |
stroke-width: 1px; | |
fill: none; | |
} | |
text { | |
font-size: 12px; | |
} | |
.zoom { | |
cursor: move; | |
fill-opacity: 0; | |
pointer-events: all; | |
} | |
button { | |
display: inline-block; | |
padding: 0 20px; | |
margin-bottom: 0; | |
border: none; | |
cursor: pointer; | |
line-height: 40px; | |
outline: 0; | |
color: white !important; | |
border: solid 1px #FFF; | |
background: none; | |
background-color: #0080C6; | |
-webkit-appearance: none; | |
border-radius: 0 0 0 0; | |
-webkit-user-select: none; | |
user-select: none; | |
text-transform: uppercase; | |
font-family: Source Sans Pro, Helvetica, Arial, Geneva, sans-serif; | |
font-size: 14px; | |
font-weight: normal; | |
text-align: center; | |
} | |
button:hover { | |
background-color: #afafaf; | |
color: white; | |
} | |
.page-num { | |
padding: 4px 4px; | |
} | |
.active { | |
color: steelblue; | |
font-weight: bolder; | |
} | |
.emphasis { | |
font-size: 24px; | |
} | |
.background-rect { | |
fill: #A6A6A6; | |
fill-opacity: .25; | |
} | |
.hover-text { | |
font-size: 16px; | |
} | |
.y-axis-text { | |
font-weight: 100; | |
} | |
.voronoi { | |
fill-opacity: 0; | |
/*stroke: #000;*/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lineChart() { | |
var margin = {top: 20, right: 20, bottom: 20, left: 20} | |
, width = 760 | |
, height = 120 | |
, xValue = "date" | |
, yValue = "val" | |
, yText = "Number of Listings" | |
, nestValue = "area" | |
, colorScale = d3.scaleSequential(d3.interpolateRainbow) | |
, xScale = d3.scaleTime() | |
, yScale = d3.scaleLinear() | |
, xAxis = d3.axisBottom(xScale).tickSize(6, 0) | |
, yAxis = d3.axisLeft(yScale) | |
, line = d3.line().curve(d3.curveMonotoneX).x(X).y(Y) | |
, voronoi = d3.voronoi().x(X).y(Y) | |
, hoverText; | |
function chart(selection) { | |
selection.each(function(data) { | |
// Set Voronoi to User Inputed Margins and Height | |
voronoi.extent([[-margin.left, -margin.top], [width + margin.right, height-margin.bottom]]); | |
// Update the x-scale. | |
xScale | |
.domain(d3.extent(data, function(d) { return d[xValue]; })) | |
.range([0, width - margin.left - margin.right]); | |
// Update the y-scale. | |
yScale | |
.domain([0, d3.max(data, function(d) { return d[yValue]; })]) | |
.range([height - margin.top - margin.bottom, 0]); | |
if(yScale.domain()[1] <= 1) { | |
yAxis.tickFormat(d3.format(".0%")) | |
} | |
// The margins are changed by accessors | |
yAxis.tickSize(-(width-margin.left-margin.right)); | |
xAxis.tickSize(-(height)); | |
// Update the color-scale | |
colorScale | |
.domain([0, d3.set(data.map(function(d) { return d[nestValue] })).values().length]) | |
// Nest data for lines | |
var nestedData = d3.nest() | |
.key(function(d) { return d[nestValue] }) | |
.entries(data); | |
// Select the svg element, if it exists. | |
var svg = d3.select(this).selectAll("svg").data([data]); | |
// Otherwise, create the skeletal chart. | |
var gEnter = svg.enter().append("svg") | |
.attr("width", width) | |
.attr("height", height) | |
.append("g") | |
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
gEnter.append("g") | |
.attr("class", "y axis") | |
.transition() | |
.call(yAxis); | |
gEnter.append("g") | |
.attr("class", "x axis") | |
.attr("transform", "translate(0," + yScale.range()[0] + ")") | |
.transition() | |
.call(xAxis); | |
gEnter.append("defs").append("clipPath") | |
.attr("id", "clip") | |
.append("rect") | |
.attr("width", width) | |
.attr("height", height); | |
gEnter.append("text") | |
.attr("class", "y-axis-text") | |
.attr("text-anchor", "middle") // this makes it easy to centre the text as the transform is applied to the anchor | |
.attr("transform", "translate("+ (-margin.left/2) +","+((height-margin.bottom)/2)+")rotate(-90)") // text is drawn off the screen top left, move down and out and rotate | |
.text(yText); | |
hoverText = gEnter.append("text") | |
.attr("class", "hover-text") | |
.attr("text-anchor", "end") | |
.attr("x", width - margin.left - margin.right); | |
// Update the outer dimensions. | |
svg.attr("width", width) | |
.attr("height", height); | |
// Update the inner dimensions. | |
var g = svg.select("g") | |
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); | |
// Create the lines | |
gEnter.append("g") | |
.attr("class", "lines") | |
.selectAll(".line") | |
.data(nestedData, function(d) { return d.key }) | |
.enter().append("path") | |
.attr("class", "line") | |
.style("clip-path", "url(#clip)") | |
.style("stroke", function(d, i) { d.color = colorScale(i); return d.color }) | |
.attr("d", function(d) { return line(d.values) }) | |
var lines = svg.select("g").select(".lines").selectAll(".line") | |
.data(nestedData, function(d) { return d.key }); | |
// Enter new lines | |
lines.enter().append("path") | |
.attr("class", "line") | |
.style("clip-path", "url(#clip)") | |
.style("stroke", function(d, i) { d.color = colorScale(i); return d.color }) | |
.attr("d", function(d) { return line(d.values) }); | |
// Remove any old lines | |
lines.exit().remove(); | |
// Update the line path. | |
lines | |
.style("stroke", function(d, i) { d.color = colorScale(i); return d.color }) | |
.transition() | |
.attr("d", function(d) { return line(d.values) }); | |
// Update the x-axis. | |
g.select(".x") | |
.attr("transform", "translate(0," + yScale.range()[0] + ")") | |
.transition() | |
.call(xAxis); | |
// Update the x-axis. | |
g.select(".y") | |
.transition() | |
.call(yAxis); | |
// Brushing section | |
var margin2 = {top: height-margin.bottom + 10, right: margin.right, bottom: 80, left: margin.left} | |
, height2 = height - margin2.top - margin2.bottom | |
, width2 = width - margin.left - margin.right | |
, x2 = d3.scaleTime().range([0, width - margin.left - margin.right]).domain(xScale.domain()) | |
, y2 = d3.scaleLinear().range([height2, 0]).domain(yScale.domain()) | |
, xAxis2 = d3.axisBottom(x2) | |
, contextLine = d3.line().curve(d3.curveMonotoneX).x(X2).y(Y2); | |
var brush = d3.brushX() | |
.extent([[0, 0], [width2, height2]]) | |
.on("brush end", brushed); | |
var context = gEnter.append("g") | |
.attr("class", "context") | |
.attr("transform", "translate(0," + margin2.top + ")"); | |
context.append("rect") | |
.attr("class","background-rect") | |
.attr("width", width2) | |
.attr("height", height2) | |
context.append("text") | |
.attr("class", "brush-text") | |
.attr("transform","translate(0," + (height2 + 35) + ")") | |
.text("Click and drag this section to select a timeframe."); | |
context.append("g") | |
.attr("class", "axis axis--grid") | |
.attr("transform", "translate(0," + height2 + ")") | |
.call(d3.axisBottom(x2) | |
.ticks(d3.timeMonth, 12) | |
.tickSize(-height2) | |
.tickFormat(function() { return null; })) | |
.selectAll(".tick") | |
.classed("tick--minor", function(d) { return d.getMonth(); }); | |
context.append("g") | |
.attr("class", "context-x axis") | |
.attr("transform", "translate(0," + height2 + ")"); | |
context.append("g") | |
.attr("class", "context-brush brush"); | |
d3.select(".context-x").call(xAxis2); | |
d3.select(".context-brush").call(brush); | |
function brushed() { | |
if (d3.event.sourceEvent && d3.event.sourceEvent.type === "zoom") return; // ignore brush-by-zoom | |
var s = d3.event.selection || x2.range(); | |
xScale.domain(s.map(x2.invert, x2)); | |
// Update Lines | |
d3.selectAll(".line") | |
.attr("d", function(d) { return line(d.values) }); | |
// Update Voronoi | |
d3.selectAll(".voronoi-path") | |
.data(voronoi.polygons(d3.merge(nestedData.map(function(d) { return d.values; })))) | |
.attr("d", function(d) { return d ? "M" + d.join("L") + "Z" : null; }); | |
// Update Axis | |
d3.select(".x").call(xAxis.ticks(6)); | |
} | |
// Ends Brushing Section | |
// Voronoi Section | |
// Create the Voronoi | |
gEnter.append("g") | |
.attr("class", "voronoi") | |
.selectAll("path") | |
.data(voronoi.polygons(d3.merge(nestedData.map(function(d) { return d.values; })))) | |
.enter().append("path") | |
.attr("class", "voronoi-path") | |
.attr("d", function(d) { return d ? "M" + d.join("L") + "Z" : null; }) | |
.on("mouseenter", mouseover) | |
.on("mouseleave", mouseout); | |
// Voronoi Selection | |
var voronoiSelection = svg.select("g").select(".voronoi").selectAll(".voronoi-path") | |
.data(voronoi.polygons(d3.merge(nestedData.map(function(d) { return d.values; })))); | |
// Enter new voroni | |
voronoiSelection.enter().append("path") | |
.attr("class", "voronoi-path") | |
.attr("d", function(d) { return d ? "M" + d.join("L") + "Z" : null; }) | |
.on("mouseenter", mouseover) | |
.on("mouseleave", mouseout); | |
// Remove any old lines | |
voronoiSelection.exit().remove(); | |
// Update the line path. | |
voronoiSelection | |
.attr("d", function(d) { return d ? "M" + d.join("L") + "Z" : null; }); | |
// Ends Voronoi Section | |
}); | |
} | |
function mouseover(d) { | |
console.log(d) | |
d3.selectAll(".line") | |
.filter(function(e) { return d.data[nestValue] == e.key }) | |
.moveToFront() | |
.transition() | |
.style("stroke-width", 4) | |
.style("stroke", "#000"); | |
hoverText.text(d.data[nestValue]); | |
} | |
function mouseout(d) { | |
d3.selectAll(".line") | |
.filter(function(e) { return d.data[nestValue] == e.key }) | |
.transition() | |
.style("stroke-width", 1) | |
.style("stroke", function(d, i) { return d.color }); | |
hoverText.text(""); | |
} | |
// The x-accessor for the path generator; xScale ∘ xValue. | |
function X(d) { | |
return xScale(d[xValue]); | |
} | |
// The y-accessor for the path generator; yScale ∘ yValue. | |
function Y(d) { | |
return yScale(d[yValue]); | |
} | |
// The x-accessor for the path generator; x2 ∘ xValue. | |
function X2(d) { | |
return x2(d[xValue]); | |
} | |
// The y-accessor for the path generator; y2 ∘ yValue. | |
function Y2(d) { | |
return y2(d[yValue]); | |
} | |
chart.margin = function(_) { | |
if (!arguments.length) return margin; | |
margin = _; | |
return chart; | |
}; | |
chart.width = function(_) { | |
if (!arguments.length) return width; | |
width = _; | |
return chart; | |
}; | |
chart.height = function(_) { | |
if (!arguments.length) return height; | |
height = _; | |
return chart; | |
}; | |
chart.x = function(_) { | |
if (!arguments.length) return xValue; | |
xValue = _; | |
return chart; | |
}; | |
chart.y = function(_) { | |
if (!arguments.length) return yValue; | |
yValue = _; | |
return chart; | |
}; | |
chart.yText = function(_) { | |
if (!arguments.length) return yText; | |
yText = _; | |
return chart; | |
}; | |
chart.nest = function(_) { | |
if (!arguments.length) return nestValue; | |
nestValue = _; | |
return chart; | |
}; | |
return chart; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! moment.js | |
//! version : 2.18.1 | |
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors | |
//! license : MIT | |
//! momentjs.com | |
;(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | |
typeof define === 'function' && define.amd ? define(factory) : | |
global.moment = factory() | |
}(this, (function () { 'use strict'; | |
var hookCallback; | |
function hooks () { | |
return hookCallback.apply(null, arguments); | |
} | |
// This is done to register the method called with moment() | |
// without creating circular dependencies. | |
function setHookCallback (callback) { | |
hookCallback = callback; | |
} | |
function isArray(input) { | |
return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; | |
} | |
function isObject(input) { | |
// IE8 will treat undefined and null as object if it wasn't for | |
// input != null | |
return input != null && Object.prototype.toString.call(input) === '[object Object]'; | |
} | |
function isObjectEmpty(obj) { | |
var k; | |
for (k in obj) { | |
// even if its not own property I'd still call it non-empty | |
return false; | |
} | |
return true; | |
} | |
function isUndefined(input) { | |
return input === void 0; | |
} | |
function isNumber(input) { | |
return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; | |
} | |
function isDate(input) { | |
return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; | |
} | |
function map(arr, fn) { | |
var res = [], i; | |
for (i = 0; i < arr.length; ++i) { | |
res.push(fn(arr[i], i)); | |
} | |
return res; | |
} | |
function hasOwnProp(a, b) { | |
return Object.prototype.hasOwnProperty.call(a, b); | |
} | |
function extend(a, b) { | |
for (var i in b) { | |
if (hasOwnProp(b, i)) { | |
a[i] = b[i]; | |
} | |
} | |
if (hasOwnProp(b, 'toString')) { | |
a.toString = b.toString; | |
} | |
if (hasOwnProp(b, 'valueOf')) { | |
a.valueOf = b.valueOf; | |
} | |
return a; | |
} | |
function createUTC (input, format, locale, strict) { | |
return createLocalOrUTC(input, format, locale, strict, true).utc(); | |
} | |
function defaultParsingFlags() { | |
// We need to deep clone this object. | |
return { | |
empty : false, | |
unusedTokens : [], | |
unusedInput : [], | |
overflow : -2, | |
charsLeftOver : 0, | |
nullInput : false, | |
invalidMonth : null, | |
invalidFormat : false, | |
userInvalidated : false, | |
iso : false, | |
parsedDateParts : [], | |
meridiem : null, | |
rfc2822 : false, | |
weekdayMismatch : false | |
}; | |
} | |
function getParsingFlags(m) { | |
if (m._pf == null) { | |
m._pf = defaultParsingFlags(); | |
} | |
return m._pf; | |
} | |
var some; | |
if (Array.prototype.some) { | |
some = Array.prototype.some; | |
} else { | |
some = function (fun) { | |
var t = Object(this); | |
var len = t.length >>> 0; | |
for (var i = 0; i < len; i++) { | |
if (i in t && fun.call(this, t[i], i, t)) { | |
return true; | |
} | |
} | |
return false; | |
}; | |
} | |
var some$1 = some; | |
function isValid(m) { | |
if (m._isValid == null) { | |
var flags = getParsingFlags(m); | |
var parsedParts = some$1.call(flags.parsedDateParts, function (i) { | |
return i != null; | |
}); | |
var isNowValid = !isNaN(m._d.getTime()) && | |
flags.overflow < 0 && | |
!flags.empty && | |
!flags.invalidMonth && | |
!flags.invalidWeekday && | |
!flags.nullInput && | |
!flags.invalidFormat && | |
!flags.userInvalidated && | |
(!flags.meridiem || (flags.meridiem && parsedParts)); | |
if (m._strict) { | |
isNowValid = isNowValid && | |
flags.charsLeftOver === 0 && | |
flags.unusedTokens.length === 0 && | |
flags.bigHour === undefined; | |
} | |
if (Object.isFrozen == null || !Object.isFrozen(m)) { | |
m._isValid = isNowValid; | |
} | |
else { | |
return isNowValid; | |
} | |
} | |
return m._isValid; | |
} | |
function createInvalid (flags) { | |
var m = createUTC(NaN); | |
if (flags != null) { | |
extend(getParsingFlags(m), flags); | |
} | |
else { | |
getParsingFlags(m).userInvalidated = true; | |
} | |
return m; | |
} | |
// Plugins that add properties should also add the key here (null value), | |
// so we can properly clone ourselves. | |
var momentProperties = hooks.momentProperties = []; | |
function copyConfig(to, from) { | |
var i, prop, val; | |
if (!isUndefined(from._isAMomentObject)) { | |
to._isAMomentObject = from._isAMomentObject; | |
} | |
if (!isUndefined(from._i)) { | |
to._i = from._i; | |
} | |
if (!isUndefined(from._f)) { | |
to._f = from._f; | |
} | |
if (!isUndefined(from._l)) { | |
to._l = from._l; | |
} | |
if (!isUndefined(from._strict)) { | |
to._strict = from._strict; | |
} | |
if (!isUndefined(from._tzm)) { | |
to._tzm = from._tzm; | |
} | |
if (!isUndefined(from._isUTC)) { | |
to._isUTC = from._isUTC; | |
} | |
if (!isUndefined(from._offset)) { | |
to._offset = from._offset; | |
} | |
if (!isUndefined(from._pf)) { | |
to._pf = getParsingFlags(from); | |
} | |
if (!isUndefined(from._locale)) { | |
to._locale = from._locale; | |
} | |
if (momentProperties.length > 0) { | |
for (i = 0; i < momentProperties.length; i++) { | |
prop = momentProperties[i]; | |
val = from[prop]; | |
if (!isUndefined(val)) { | |
to[prop] = val; | |
} | |
} | |
} | |
return to; | |
} | |
var updateInProgress = false; | |
// Moment prototype object | |
function Moment(config) { | |
copyConfig(this, config); | |
this._d = new Date(config._d != null ? config._d.getTime() : NaN); | |
if (!this.isValid()) { | |
this._d = new Date(NaN); | |
} | |
// Prevent infinite loop in case updateOffset creates new moment | |
// objects. | |
if (updateInProgress === false) { | |
updateInProgress = true; | |
hooks.updateOffset(this); | |
updateInProgress = false; | |
} | |
} | |
function isMoment (obj) { | |
return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); | |
} | |
function absFloor (number) { | |
if (number < 0) { | |
// -0 -> 0 | |
return Math.ceil(number) || 0; | |
} else { | |
return Math.floor(number); | |
} | |
} | |
function toInt(argumentForCoercion) { | |
var coercedNumber = +argumentForCoercion, | |
value = 0; | |
if (coercedNumber !== 0 && isFinite(coercedNumber)) { | |
value = absFloor(coercedNumber); | |
} | |
return value; | |
} | |
// compare two arrays, return the number of differences | |
function compareArrays(array1, array2, dontConvert) { | |
var len = Math.min(array1.length, array2.length), | |
lengthDiff = Math.abs(array1.length - array2.length), | |
diffs = 0, | |
i; | |
for (i = 0; i < len; i++) { | |
if ((dontConvert && array1[i] !== array2[i]) || | |
(!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { | |
diffs++; | |
} | |
} | |
return diffs + lengthDiff; | |
} | |
function warn(msg) { | |
if (hooks.suppressDeprecationWarnings === false && | |
(typeof console !== 'undefined') && console.warn) { | |
console.warn('Deprecation warning: ' + msg); | |
} | |
} | |
function deprecate(msg, fn) { | |
var firstTime = true; | |
return extend(function () { | |
if (hooks.deprecationHandler != null) { | |
hooks.deprecationHandler(null, msg); | |
} | |
if (firstTime) { | |
var args = []; | |
var arg; | |
for (var i = 0; i < arguments.length; i++) { | |
arg = ''; | |
if (typeof arguments[i] === 'object') { | |
arg += '\n[' + i + '] '; | |
for (var key in arguments[0]) { | |
arg += key + ': ' + arguments[0][key] + ', '; | |
} | |
arg = arg.slice(0, -2); // Remove trailing comma and space | |
} else { | |
arg = arguments[i]; | |
} | |
args.push(arg); | |
} | |
warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + (new Error()).stack); | |
firstTime = false; | |
} | |
return fn.apply(this, arguments); | |
}, fn); | |
} | |
var deprecations = {}; | |
function deprecateSimple(name, msg) { | |
if (hooks.deprecationHandler != null) { | |
hooks.deprecationHandler(name, msg); | |
} | |
if (!deprecations[name]) { | |
warn(msg); | |
deprecations[name] = true; | |
} | |
} | |
hooks.suppressDeprecationWarnings = false; | |
hooks.deprecationHandler = null; | |
function isFunction(input) { | |
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; | |
} | |
function set (config) { | |
var prop, i; | |
for (i in config) { | |
prop = config[i]; | |
if (isFunction(prop)) { | |
this[i] = prop; | |
} else { | |
this['_' + i] = prop; | |
} | |
} | |
this._config = config; | |
// Lenient ordinal parsing accepts just a number in addition to | |
// number + (possibly) stuff coming from _dayOfMonthOrdinalParse. | |
// TODO: Remove "ordinalParse" fallback in next major release. | |
this._dayOfMonthOrdinalParseLenient = new RegExp( | |
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + | |
'|' + (/\d{1,2}/).source); | |
} | |
function mergeConfigs(parentConfig, childConfig) { | |
var res = extend({}, parentConfig), prop; | |
for (prop in childConfig) { | |
if (hasOwnProp(childConfig, prop)) { | |
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { | |
res[prop] = {}; | |
extend(res[prop], parentConfig[prop]); | |
extend(res[prop], childConfig[prop]); | |
} else if (childConfig[prop] != null) { | |
res[prop] = childConfig[prop]; | |
} else { | |
delete res[prop]; | |
} | |
} | |
} | |
for (prop in parentConfig) { | |
if (hasOwnProp(parentConfig, prop) && | |
!hasOwnProp(childConfig, prop) && | |
isObject(parentConfig[prop])) { | |
// make sure changes to properties don't modify parent config | |
res[prop] = extend({}, res[prop]); | |
} | |
} | |
return res; | |
} | |
function Locale(config) { | |
if (config != null) { | |
this.set(config); | |
} | |
} | |
var keys; | |
if (Object.keys) { | |
keys = Object.keys; | |
} else { | |
keys = function (obj) { | |
var i, res = []; | |
for (i in obj) { | |
if (hasOwnProp(obj, i)) { | |
res.push(i); | |
} | |
} | |
return res; | |
}; | |
} | |
var keys$1 = keys; | |
var defaultCalendar = { | |
sameDay : '[Today at] LT', | |
nextDay : '[Tomorrow at] LT', | |
nextWeek : 'dddd [at] LT', | |
lastDay : '[Yesterday at] LT', | |
lastWeek : '[Last] dddd [at] LT', | |
sameElse : 'L' | |
}; | |
function calendar (key, mom, now) { | |
var output = this._calendar[key] || this._calendar['sameElse']; | |
return isFunction(output) ? output.call(mom, now) : output; | |
} | |
var defaultLongDateFormat = { | |
LTS : 'h:mm:ss A', | |
LT : 'h:mm A', | |
L : 'MM/DD/YYYY', | |
LL : 'MMMM D, YYYY', | |
LLL : 'MMMM D, YYYY h:mm A', | |
LLLL : 'dddd, MMMM D, YYYY h:mm A' | |
}; | |
function longDateFormat (key) { | |
var format = this._longDateFormat[key], | |
formatUpper = this._longDateFormat[key.toUpperCase()]; | |
if (format || !formatUpper) { | |
return format; | |
} | |
this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { | |
return val.slice(1); | |
}); | |
return this._longDateFormat[key]; | |
} | |
var defaultInvalidDate = 'Invalid date'; | |
function invalidDate () { | |
return this._invalidDate; | |
} | |
var defaultOrdinal = '%d'; | |
var defaultDayOfMonthOrdinalParse = /\d{1,2}/; | |
function ordinal (number) { | |
return this._ordinal.replace('%d', number); | |
} | |
var defaultRelativeTime = { | |
future : 'in %s', | |
past : '%s ago', | |
s : 'a few seconds', | |
ss : '%d seconds', | |
m : 'a minute', | |
mm : '%d minutes', | |
h : 'an hour', | |
hh : '%d hours', | |
d : 'a day', | |
dd : '%d days', | |
M : 'a month', | |
MM : '%d months', | |
y : 'a year', | |
yy : '%d years' | |
}; | |
function relativeTime (number, withoutSuffix, string, isFuture) { | |
var output = this._relativeTime[string]; | |
return (isFunction(output)) ? | |
output(number, withoutSuffix, string, isFuture) : | |
output.replace(/%d/i, number); | |
} | |
function pastFuture (diff, output) { | |
var format = this._relativeTime[diff > 0 ? 'future' : 'past']; | |
return isFunction(format) ? format(output) : format.replace(/%s/i, output); | |
} | |
var aliases = {}; | |
function addUnitAlias (unit, shorthand) { | |
var lowerCase = unit.toLowerCase(); | |
aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; | |
} | |
function normalizeUnits(units) { | |
return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; | |
} | |
function normalizeObjectUnits(inputObject) { | |
var normalizedInput = {}, | |
normalizedProp, | |
prop; | |
for (prop in inputObject) { | |
if (hasOwnProp(inputObject, prop)) { | |
normalizedProp = normalizeUnits(prop); | |
if (normalizedProp) { | |
normalizedInput[normalizedProp] = inputObject[prop]; | |
} | |
} | |
} | |
return normalizedInput; | |
} | |
var priorities = {}; | |
function addUnitPriority(unit, priority) { | |
priorities[unit] = priority; | |
} | |
function getPrioritizedUnits(unitsObj) { | |
var units = []; | |
for (var u in unitsObj) { | |
units.push({unit: u, priority: priorities[u]}); | |
} | |
units.sort(function (a, b) { | |
return a.priority - b.priority; | |
}); | |
return units; | |
} | |
function makeGetSet (unit, keepTime) { | |
return function (value) { | |
if (value != null) { | |
set$1(this, unit, value); | |
hooks.updateOffset(this, keepTime); | |
return this; | |
} else { | |
return get(this, unit); | |
} | |
}; | |
} | |
function get (mom, unit) { | |
return mom.isValid() ? | |
mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; | |
} | |
function set$1 (mom, unit, value) { | |
if (mom.isValid()) { | |
mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); | |
} | |
} | |
// MOMENTS | |
function stringGet (units) { | |
units = normalizeUnits(units); | |
if (isFunction(this[units])) { | |
return this[units](); | |
} | |
return this; | |
} | |
function stringSet (units, value) { | |
if (typeof units === 'object') { | |
units = normalizeObjectUnits(units); | |
var prioritized = getPrioritizedUnits(units); | |
for (var i = 0; i < prioritized.length; i++) { | |
this[prioritized[i].unit](units[prioritized[i].unit]); | |
} | |
} else { | |
units = normalizeUnits(units); | |
if (isFunction(this[units])) { | |
return this[units](value); | |
} | |
} | |
return this; | |
} | |
function zeroFill(number, targetLength, forceSign) { | |
var absNumber = '' + Math.abs(number), | |
zerosToFill = targetLength - absNumber.length, | |
sign = number >= 0; | |
return (sign ? (forceSign ? '+' : '') : '-') + | |
Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; | |
} | |
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; | |
var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; | |
var formatFunctions = {}; | |
var formatTokenFunctions = {}; | |
// token: 'M' | |
// padded: ['MM', 2] | |
// ordinal: 'Mo' | |
// callback: function () { this.month() + 1 } | |
function addFormatToken (token, padded, ordinal, callback) { | |
var func = callback; | |
if (typeof callback === 'string') { | |
func = function () { | |
return this[callback](); | |
}; | |
} | |
if (token) { | |
formatTokenFunctions[token] = func; | |
} | |
if (padded) { | |
formatTokenFunctions[padded[0]] = function () { | |
return zeroFill(func.apply(this, arguments), padded[1], padded[2]); | |
}; | |
} | |
if (ordinal) { | |
formatTokenFunctions[ordinal] = function () { | |
return this.localeData().ordinal(func.apply(this, arguments), token); | |
}; | |
} | |
} | |
function removeFormattingTokens(input) { | |
if (input.match(/\[[\s\S]/)) { | |
return input.replace(/^\[|\]$/g, ''); | |
} | |
return input.replace(/\\/g, ''); | |
} | |
function makeFormatFunction(format) { | |
var array = format.match(formattingTokens), i, length; | |
for (i = 0, length = array.length; i < length; i++) { | |
if (formatTokenFunctions[array[i]]) { | |
array[i] = formatTokenFunctions[array[i]]; | |
} else { | |
array[i] = removeFormattingTokens(array[i]); | |
} | |
} | |
return function (mom) { | |
var output = '', i; | |
for (i = 0; i < length; i++) { | |
output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; | |
} | |
return output; | |
}; | |
} | |
// format date using native date object | |
function formatMoment(m, format) { | |
if (!m.isValid()) { | |
return m.localeData().invalidDate(); | |
} | |
format = expandFormat(format, m.localeData()); | |
formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); | |
return formatFunctions[format](m); | |
} | |
function expandFormat(format, locale) { | |
var i = 5; | |
function replaceLongDateFormatTokens(input) { | |
return locale.longDateFormat(input) || input; | |
} | |
localFormattingTokens.lastIndex = 0; | |
while (i >= 0 && localFormattingTokens.test(format)) { | |
format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); | |
localFormattingTokens.lastIndex = 0; | |
i -= 1; | |
} | |
return format; | |
} | |
var match1 = /\d/; // 0 - 9 | |
var match2 = /\d\d/; // 00 - 99 | |
var match3 = /\d{3}/; // 000 - 999 | |
var match4 = /\d{4}/; // 0000 - 9999 | |
var match6 = /[+-]?\d{6}/; // -999999 - 999999 | |
var match1to2 = /\d\d?/; // 0 - 99 | |
var match3to4 = /\d\d\d\d?/; // 999 - 9999 | |
var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 | |
var match1to3 = /\d{1,3}/; // 0 - 999 | |
var match1to4 = /\d{1,4}/; // 0 - 9999 | |
var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 | |
var matchUnsigned = /\d+/; // 0 - inf | |
var matchSigned = /[+-]?\d+/; // -inf - inf | |
var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z | |
var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z | |
var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 | |
// any word (or two) characters or numbers including two/three word month in arabic. | |
// includes scottish gaelic two word and hyphenated months | |
var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; | |
var regexes = {}; | |
function addRegexToken (token, regex, strictRegex) { | |
regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { | |
return (isStrict && strictRegex) ? strictRegex : regex; | |
}; | |
} | |
function getParseRegexForToken (token, config) { | |
if (!hasOwnProp(regexes, token)) { | |
return new RegExp(unescapeFormat(token)); | |
} | |
return regexes[token](config._strict, config._locale); | |
} | |
// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript | |
function unescapeFormat(s) { | |
return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { | |
return p1 || p2 || p3 || p4; | |
})); | |
} | |
function regexEscape(s) { | |
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); | |
} | |
var tokens = {}; | |
function addParseToken (token, callback) { | |
var i, func = callback; | |
if (typeof token === 'string') { | |
token = [token]; | |
} | |
if (isNumber(callback)) { | |
func = function (input, array) { | |
array[callback] = toInt(input); | |
}; | |
} | |
for (i = 0; i < token.length; i++) { | |
tokens[token[i]] = func; | |
} | |
} | |
function addWeekParseToken (token, callback) { | |
addParseToken(token, function (input, array, config, token) { | |
config._w = config._w || {}; | |
callback(input, config._w, config, token); | |
}); | |
} | |
function addTimeToArrayFromToken(token, input, config) { | |
if (input != null && hasOwnProp(tokens, token)) { | |
tokens[token](input, config._a, config, token); | |
} | |
} | |
var YEAR = 0; | |
var MONTH = 1; | |
var DATE = 2; | |
var HOUR = 3; | |
var MINUTE = 4; | |
var SECOND = 5; | |
var MILLISECOND = 6; | |
var WEEK = 7; | |
var WEEKDAY = 8; | |
var indexOf; | |
if (Array.prototype.indexOf) { | |
indexOf = Array.prototype.indexOf; | |
} else { | |
indexOf = function (o) { | |
// I know | |
var i; | |
for (i = 0; i < this.length; ++i) { | |
if (this[i] === o) { | |
return i; | |
} | |
} | |
return -1; | |
}; | |
} | |
var indexOf$1 = indexOf; | |
function daysInMonth(year, month) { | |
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); | |
} | |
// FORMATTING | |
addFormatToken('M', ['MM', 2], 'Mo', function () { | |
return this.month() + 1; | |
}); | |
addFormatToken('MMM', 0, 0, function (format) { | |
return this.localeData().monthsShort(this, format); | |
}); | |
addFormatToken('MMMM', 0, 0, function (format) { | |
return this.localeData().months(this, format); | |
}); | |
// ALIASES | |
addUnitAlias('month', 'M'); | |
// PRIORITY | |
addUnitPriority('month', 8); | |
// PARSING | |
addRegexToken('M', match1to2); | |
addRegexToken('MM', match1to2, match2); | |
addRegexToken('MMM', function (isStrict, locale) { | |
return locale.monthsShortRegex(isStrict); | |
}); | |
addRegexToken('MMMM', function (isStrict, locale) { | |
return locale.monthsRegex(isStrict); | |
}); | |
addParseToken(['M', 'MM'], function (input, array) { | |
array[MONTH] = toInt(input) - 1; | |
}); | |
addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { | |
var month = config._locale.monthsParse(input, token, config._strict); | |
// if we didn't find a month name, mark the date as invalid. | |
if (month != null) { | |
array[MONTH] = month; | |
} else { | |
getParsingFlags(config).invalidMonth = input; | |
} | |
}); | |
// LOCALES | |
var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/; | |
var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); | |
function localeMonths (m, format) { | |
if (!m) { | |
return isArray(this._months) ? this._months : | |
this._months['standalone']; | |
} | |
return isArray(this._months) ? this._months[m.month()] : | |
this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; | |
} | |
var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); | |
function localeMonthsShort (m, format) { | |
if (!m) { | |
return isArray(this._monthsShort) ? this._monthsShort : | |
this._monthsShort['standalone']; | |
} | |
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : | |
this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; | |
} | |
function handleStrictParse(monthName, format, strict) { | |
var i, ii, mom, llc = monthName.toLocaleLowerCase(); | |
if (!this._monthsParse) { | |
// this is not used | |
this._monthsParse = []; | |
this._longMonthsParse = []; | |
this._shortMonthsParse = []; | |
for (i = 0; i < 12; ++i) { | |
mom = createUTC([2000, i]); | |
this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); | |
this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); | |
} | |
} | |
if (strict) { | |
if (format === 'MMM') { | |
ii = indexOf$1.call(this._shortMonthsParse, llc); | |
return ii !== -1 ? ii : null; | |
} else { | |
ii = indexOf$1.call(this._longMonthsParse, llc); | |
return ii !== -1 ? ii : null; | |
} | |
} else { | |
if (format === 'MMM') { | |
ii = indexOf$1.call(this._shortMonthsParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._longMonthsParse, llc); | |
return ii !== -1 ? ii : null; | |
} else { | |
ii = indexOf$1.call(this._longMonthsParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._shortMonthsParse, llc); | |
return ii !== -1 ? ii : null; | |
} | |
} | |
} | |
function localeMonthsParse (monthName, format, strict) { | |
var i, mom, regex; | |
if (this._monthsParseExact) { | |
return handleStrictParse.call(this, monthName, format, strict); | |
} | |
if (!this._monthsParse) { | |
this._monthsParse = []; | |
this._longMonthsParse = []; | |
this._shortMonthsParse = []; | |
} | |
// TODO: add sorting | |
// Sorting makes sure if one month (or abbr) is a prefix of another | |
// see sorting in computeMonthsParse | |
for (i = 0; i < 12; i++) { | |
// make the regex if we don't have it already | |
mom = createUTC([2000, i]); | |
if (strict && !this._longMonthsParse[i]) { | |
this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); | |
this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); | |
} | |
if (!strict && !this._monthsParse[i]) { | |
regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); | |
this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); | |
} | |
// test the regex | |
if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { | |
return i; | |
} else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { | |
return i; | |
} else if (!strict && this._monthsParse[i].test(monthName)) { | |
return i; | |
} | |
} | |
} | |
// MOMENTS | |
function setMonth (mom, value) { | |
var dayOfMonth; | |
if (!mom.isValid()) { | |
// No op | |
return mom; | |
} | |
if (typeof value === 'string') { | |
if (/^\d+$/.test(value)) { | |
value = toInt(value); | |
} else { | |
value = mom.localeData().monthsParse(value); | |
// TODO: Another silent failure? | |
if (!isNumber(value)) { | |
return mom; | |
} | |
} | |
} | |
dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); | |
mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); | |
return mom; | |
} | |
function getSetMonth (value) { | |
if (value != null) { | |
setMonth(this, value); | |
hooks.updateOffset(this, true); | |
return this; | |
} else { | |
return get(this, 'Month'); | |
} | |
} | |
function getDaysInMonth () { | |
return daysInMonth(this.year(), this.month()); | |
} | |
var defaultMonthsShortRegex = matchWord; | |
function monthsShortRegex (isStrict) { | |
if (this._monthsParseExact) { | |
if (!hasOwnProp(this, '_monthsRegex')) { | |
computeMonthsParse.call(this); | |
} | |
if (isStrict) { | |
return this._monthsShortStrictRegex; | |
} else { | |
return this._monthsShortRegex; | |
} | |
} else { | |
if (!hasOwnProp(this, '_monthsShortRegex')) { | |
this._monthsShortRegex = defaultMonthsShortRegex; | |
} | |
return this._monthsShortStrictRegex && isStrict ? | |
this._monthsShortStrictRegex : this._monthsShortRegex; | |
} | |
} | |
var defaultMonthsRegex = matchWord; | |
function monthsRegex (isStrict) { | |
if (this._monthsParseExact) { | |
if (!hasOwnProp(this, '_monthsRegex')) { | |
computeMonthsParse.call(this); | |
} | |
if (isStrict) { | |
return this._monthsStrictRegex; | |
} else { | |
return this._monthsRegex; | |
} | |
} else { | |
if (!hasOwnProp(this, '_monthsRegex')) { | |
this._monthsRegex = defaultMonthsRegex; | |
} | |
return this._monthsStrictRegex && isStrict ? | |
this._monthsStrictRegex : this._monthsRegex; | |
} | |
} | |
function computeMonthsParse () { | |
function cmpLenRev(a, b) { | |
return b.length - a.length; | |
} | |
var shortPieces = [], longPieces = [], mixedPieces = [], | |
i, mom; | |
for (i = 0; i < 12; i++) { | |
// make the regex if we don't have it already | |
mom = createUTC([2000, i]); | |
shortPieces.push(this.monthsShort(mom, '')); | |
longPieces.push(this.months(mom, '')); | |
mixedPieces.push(this.months(mom, '')); | |
mixedPieces.push(this.monthsShort(mom, '')); | |
} | |
// Sorting makes sure if one month (or abbr) is a prefix of another it | |
// will match the longer piece. | |
shortPieces.sort(cmpLenRev); | |
longPieces.sort(cmpLenRev); | |
mixedPieces.sort(cmpLenRev); | |
for (i = 0; i < 12; i++) { | |
shortPieces[i] = regexEscape(shortPieces[i]); | |
longPieces[i] = regexEscape(longPieces[i]); | |
} | |
for (i = 0; i < 24; i++) { | |
mixedPieces[i] = regexEscape(mixedPieces[i]); | |
} | |
this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); | |
this._monthsShortRegex = this._monthsRegex; | |
this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); | |
this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); | |
} | |
// FORMATTING | |
addFormatToken('Y', 0, 0, function () { | |
var y = this.year(); | |
return y <= 9999 ? '' + y : '+' + y; | |
}); | |
addFormatToken(0, ['YY', 2], 0, function () { | |
return this.year() % 100; | |
}); | |
addFormatToken(0, ['YYYY', 4], 0, 'year'); | |
addFormatToken(0, ['YYYYY', 5], 0, 'year'); | |
addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); | |
// ALIASES | |
addUnitAlias('year', 'y'); | |
// PRIORITIES | |
addUnitPriority('year', 1); | |
// PARSING | |
addRegexToken('Y', matchSigned); | |
addRegexToken('YY', match1to2, match2); | |
addRegexToken('YYYY', match1to4, match4); | |
addRegexToken('YYYYY', match1to6, match6); | |
addRegexToken('YYYYYY', match1to6, match6); | |
addParseToken(['YYYYY', 'YYYYYY'], YEAR); | |
addParseToken('YYYY', function (input, array) { | |
array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); | |
}); | |
addParseToken('YY', function (input, array) { | |
array[YEAR] = hooks.parseTwoDigitYear(input); | |
}); | |
addParseToken('Y', function (input, array) { | |
array[YEAR] = parseInt(input, 10); | |
}); | |
// HELPERS | |
function daysInYear(year) { | |
return isLeapYear(year) ? 366 : 365; | |
} | |
function isLeapYear(year) { | |
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; | |
} | |
// HOOKS | |
hooks.parseTwoDigitYear = function (input) { | |
return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); | |
}; | |
// MOMENTS | |
var getSetYear = makeGetSet('FullYear', true); | |
function getIsLeapYear () { | |
return isLeapYear(this.year()); | |
} | |
function createDate (y, m, d, h, M, s, ms) { | |
// can't just apply() to create a date: | |
// https://stackoverflow.com/q/181348 | |
var date = new Date(y, m, d, h, M, s, ms); | |
// the date constructor remaps years 0-99 to 1900-1999 | |
if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { | |
date.setFullYear(y); | |
} | |
return date; | |
} | |
function createUTCDate (y) { | |
var date = new Date(Date.UTC.apply(null, arguments)); | |
// the Date.UTC function remaps years 0-99 to 1900-1999 | |
if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { | |
date.setUTCFullYear(y); | |
} | |
return date; | |
} | |
// start-of-first-week - start-of-year | |
function firstWeekOffset(year, dow, doy) { | |
var // first-week day -- which january is always in the first week (4 for iso, 1 for other) | |
fwd = 7 + dow - doy, | |
// first-week day local weekday -- which local weekday is fwd | |
fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; | |
return -fwdlw + fwd - 1; | |
} | |
// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday | |
function dayOfYearFromWeeks(year, week, weekday, dow, doy) { | |
var localWeekday = (7 + weekday - dow) % 7, | |
weekOffset = firstWeekOffset(year, dow, doy), | |
dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, | |
resYear, resDayOfYear; | |
if (dayOfYear <= 0) { | |
resYear = year - 1; | |
resDayOfYear = daysInYear(resYear) + dayOfYear; | |
} else if (dayOfYear > daysInYear(year)) { | |
resYear = year + 1; | |
resDayOfYear = dayOfYear - daysInYear(year); | |
} else { | |
resYear = year; | |
resDayOfYear = dayOfYear; | |
} | |
return { | |
year: resYear, | |
dayOfYear: resDayOfYear | |
}; | |
} | |
function weekOfYear(mom, dow, doy) { | |
var weekOffset = firstWeekOffset(mom.year(), dow, doy), | |
week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, | |
resWeek, resYear; | |
if (week < 1) { | |
resYear = mom.year() - 1; | |
resWeek = week + weeksInYear(resYear, dow, doy); | |
} else if (week > weeksInYear(mom.year(), dow, doy)) { | |
resWeek = week - weeksInYear(mom.year(), dow, doy); | |
resYear = mom.year() + 1; | |
} else { | |
resYear = mom.year(); | |
resWeek = week; | |
} | |
return { | |
week: resWeek, | |
year: resYear | |
}; | |
} | |
function weeksInYear(year, dow, doy) { | |
var weekOffset = firstWeekOffset(year, dow, doy), | |
weekOffsetNext = firstWeekOffset(year + 1, dow, doy); | |
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; | |
} | |
// FORMATTING | |
addFormatToken('w', ['ww', 2], 'wo', 'week'); | |
addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); | |
// ALIASES | |
addUnitAlias('week', 'w'); | |
addUnitAlias('isoWeek', 'W'); | |
// PRIORITIES | |
addUnitPriority('week', 5); | |
addUnitPriority('isoWeek', 5); | |
// PARSING | |
addRegexToken('w', match1to2); | |
addRegexToken('ww', match1to2, match2); | |
addRegexToken('W', match1to2); | |
addRegexToken('WW', match1to2, match2); | |
addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { | |
week[token.substr(0, 1)] = toInt(input); | |
}); | |
// HELPERS | |
// LOCALES | |
function localeWeek (mom) { | |
return weekOfYear(mom, this._week.dow, this._week.doy).week; | |
} | |
var defaultLocaleWeek = { | |
dow : 0, // Sunday is the first day of the week. | |
doy : 6 // The week that contains Jan 1st is the first week of the year. | |
}; | |
function localeFirstDayOfWeek () { | |
return this._week.dow; | |
} | |
function localeFirstDayOfYear () { | |
return this._week.doy; | |
} | |
// MOMENTS | |
function getSetWeek (input) { | |
var week = this.localeData().week(this); | |
return input == null ? week : this.add((input - week) * 7, 'd'); | |
} | |
function getSetISOWeek (input) { | |
var week = weekOfYear(this, 1, 4).week; | |
return input == null ? week : this.add((input - week) * 7, 'd'); | |
} | |
// FORMATTING | |
addFormatToken('d', 0, 'do', 'day'); | |
addFormatToken('dd', 0, 0, function (format) { | |
return this.localeData().weekdaysMin(this, format); | |
}); | |
addFormatToken('ddd', 0, 0, function (format) { | |
return this.localeData().weekdaysShort(this, format); | |
}); | |
addFormatToken('dddd', 0, 0, function (format) { | |
return this.localeData().weekdays(this, format); | |
}); | |
addFormatToken('e', 0, 0, 'weekday'); | |
addFormatToken('E', 0, 0, 'isoWeekday'); | |
// ALIASES | |
addUnitAlias('day', 'd'); | |
addUnitAlias('weekday', 'e'); | |
addUnitAlias('isoWeekday', 'E'); | |
// PRIORITY | |
addUnitPriority('day', 11); | |
addUnitPriority('weekday', 11); | |
addUnitPriority('isoWeekday', 11); | |
// PARSING | |
addRegexToken('d', match1to2); | |
addRegexToken('e', match1to2); | |
addRegexToken('E', match1to2); | |
addRegexToken('dd', function (isStrict, locale) { | |
return locale.weekdaysMinRegex(isStrict); | |
}); | |
addRegexToken('ddd', function (isStrict, locale) { | |
return locale.weekdaysShortRegex(isStrict); | |
}); | |
addRegexToken('dddd', function (isStrict, locale) { | |
return locale.weekdaysRegex(isStrict); | |
}); | |
addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { | |
var weekday = config._locale.weekdaysParse(input, token, config._strict); | |
// if we didn't get a weekday name, mark the date as invalid | |
if (weekday != null) { | |
week.d = weekday; | |
} else { | |
getParsingFlags(config).invalidWeekday = input; | |
} | |
}); | |
addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { | |
week[token] = toInt(input); | |
}); | |
// HELPERS | |
function parseWeekday(input, locale) { | |
if (typeof input !== 'string') { | |
return input; | |
} | |
if (!isNaN(input)) { | |
return parseInt(input, 10); | |
} | |
input = locale.weekdaysParse(input); | |
if (typeof input === 'number') { | |
return input; | |
} | |
return null; | |
} | |
function parseIsoWeekday(input, locale) { | |
if (typeof input === 'string') { | |
return locale.weekdaysParse(input) % 7 || 7; | |
} | |
return isNaN(input) ? null : input; | |
} | |
// LOCALES | |
var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); | |
function localeWeekdays (m, format) { | |
if (!m) { | |
return isArray(this._weekdays) ? this._weekdays : | |
this._weekdays['standalone']; | |
} | |
return isArray(this._weekdays) ? this._weekdays[m.day()] : | |
this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; | |
} | |
var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); | |
function localeWeekdaysShort (m) { | |
return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort; | |
} | |
var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); | |
function localeWeekdaysMin (m) { | |
return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin; | |
} | |
function handleStrictParse$1(weekdayName, format, strict) { | |
var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); | |
if (!this._weekdaysParse) { | |
this._weekdaysParse = []; | |
this._shortWeekdaysParse = []; | |
this._minWeekdaysParse = []; | |
for (i = 0; i < 7; ++i) { | |
mom = createUTC([2000, 1]).day(i); | |
this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); | |
this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); | |
this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); | |
} | |
} | |
if (strict) { | |
if (format === 'dddd') { | |
ii = indexOf$1.call(this._weekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} else if (format === 'ddd') { | |
ii = indexOf$1.call(this._shortWeekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} else { | |
ii = indexOf$1.call(this._minWeekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} | |
} else { | |
if (format === 'dddd') { | |
ii = indexOf$1.call(this._weekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._shortWeekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._minWeekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} else if (format === 'ddd') { | |
ii = indexOf$1.call(this._shortWeekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._weekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._minWeekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} else { | |
ii = indexOf$1.call(this._minWeekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._weekdaysParse, llc); | |
if (ii !== -1) { | |
return ii; | |
} | |
ii = indexOf$1.call(this._shortWeekdaysParse, llc); | |
return ii !== -1 ? ii : null; | |
} | |
} | |
} | |
function localeWeekdaysParse (weekdayName, format, strict) { | |
var i, mom, regex; | |
if (this._weekdaysParseExact) { | |
return handleStrictParse$1.call(this, weekdayName, format, strict); | |
} | |
if (!this._weekdaysParse) { | |
this._weekdaysParse = []; | |
this._minWeekdaysParse = []; | |
this._shortWeekdaysParse = []; | |
this._fullWeekdaysParse = []; | |
} | |
for (i = 0; i < 7; i++) { | |
// make the regex if we don't have it already | |
mom = createUTC([2000, 1]).day(i); | |
if (strict && !this._fullWeekdaysParse[i]) { | |
this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); | |
this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); | |
this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); | |
} | |
if (!this._weekdaysParse[i]) { | |
regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); | |
this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); | |
} | |
// test the regex | |
if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { | |
return i; | |
} else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { | |
return i; | |
} else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { | |
return i; | |
} else if (!strict && this._weekdaysParse[i].test(weekdayName)) { | |
return i; | |
} | |
} | |
} | |
// MOMENTS | |
function getSetDayOfWeek (input) { | |
if (!this.isValid()) { | |
return input != null ? this : NaN; | |
} | |
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); | |
if (input != null) { | |
input = parseWeekday(input, this.localeData()); | |
return this.add(input - day, 'd'); | |
} else { | |
return day; | |
} | |
} | |
function getSetLocaleDayOfWeek (input) { | |
if (!this.isValid()) { | |
return input != null ? this : NaN; | |
} | |
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; | |
return input == null ? weekday : this.add(input - weekday, 'd'); | |
} | |
function getSetISODayOfWeek (input) { | |
if (!this.isValid()) { | |
return input != null ? this : NaN; | |
} | |
// behaves the same as moment#day except | |
// as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) | |
// as a setter, sunday should belong to the previous week. | |
if (input != null) { | |
var weekday = parseIsoWeekday(input, this.localeData()); | |
return this.day(this.day() % 7 ? weekday : weekday - 7); | |
} else { | |
return this.day() || 7; | |
} | |
} | |
var defaultWeekdaysRegex = matchWord; | |
function weekdaysRegex (isStrict) { | |
if (this._weekdaysParseExact) { | |
if (!hasOwnProp(this, '_weekdaysRegex')) { | |
computeWeekdaysParse.call(this); | |
} | |
if (isStrict) { | |
return this._weekdaysStrictRegex; | |
} else { | |
return this._weekdaysRegex; | |
} | |
} else { | |
if (!hasOwnProp(this, '_weekdaysRegex')) { | |
this._weekdaysRegex = defaultWeekdaysRegex; | |
} | |
return this._weekdaysStrictRegex && isStrict ? | |
this._weekdaysStrictRegex : this._weekdaysRegex; | |
} | |
} | |
var defaultWeekdaysShortRegex = matchWord; | |
function weekdaysShortRegex (isStrict) { | |
if (this._weekdaysParseExact) { | |
if (!hasOwnProp(this, '_weekdaysRegex')) { | |
computeWeekdaysParse.call(this); | |
} | |
if (isStrict) { | |
return this._weekdaysShortStrictRegex; | |
} else { | |
return this._weekdaysShortRegex; | |
} | |
} else { | |
if (!hasOwnProp(this, '_weekdaysShortRegex')) { | |
this._weekdaysShortRegex = defaultWeekdaysShortRegex; | |
} | |
return this._weekdaysShortStrictRegex && isStrict ? | |
this._weekdaysShortStrictRegex : this._weekdaysShortRegex; | |
} | |
} | |
var defaultWeekdaysMinRegex = matchWord; | |
function weekdaysMinRegex (isStrict) { | |
if (this._weekdaysParseExact) { | |
if (!hasOwnProp(this, '_weekdaysRegex')) { | |
computeWeekdaysParse.call(this); | |
} | |
if (isStrict) { | |
return this._weekdaysMinStrictRegex; | |
} else { | |
return this._weekdaysMinRegex; | |
} | |
} else { | |
if (!hasOwnProp(this, '_weekdaysMinRegex')) { | |
this._weekdaysMinRegex = defaultWeekdaysMinRegex; | |
} | |
return this._weekdaysMinStrictRegex && isStrict ? | |
this._weekdaysMinStrictRegex : this._weekdaysMinRegex; | |
} | |
} | |
function computeWeekdaysParse () { | |
function cmpLenRev(a, b) { | |
return b.length - a.length; | |
} | |
var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], | |
i, mom, minp, shortp, longp; | |
for (i = 0; i < 7; i++) { | |
// make the regex if we don't have it already | |
mom = createUTC([2000, 1]).day(i); | |
minp = this.weekdaysMin(mom, ''); | |
shortp = this.weekdaysShort(mom, ''); | |
longp = this.weekdays(mom, ''); | |
minPieces.push(minp); | |
shortPieces.push(shortp); | |
longPieces.push(longp); | |
mixedPieces.push(minp); | |
mixedPieces.push(shortp); | |
mixedPieces.push(longp); | |
} | |
// Sorting makes sure if one weekday (or abbr) is a prefix of another it | |
// will match the longer piece. | |
minPieces.sort(cmpLenRev); | |
shortPieces.sort(cmpLenRev); | |
longPieces.sort(cmpLenRev); | |
mixedPieces.sort(cmpLenRev); | |
for (i = 0; i < 7; i++) { | |
shortPieces[i] = regexEscape(shortPieces[i]); | |
longPieces[i] = regexEscape(longPieces[i]); | |
mixedPieces[i] = regexEscape(mixedPieces[i]); | |
} | |
this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); | |
this._weekdaysShortRegex = this._weekdaysRegex; | |
this._weekdaysMinRegex = this._weekdaysRegex; | |
this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); | |
this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); | |
this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); | |
} | |
// FORMATTING | |
function hFormat() { | |
return this.hours() % 12 || 12; | |
} | |
function kFormat() { | |
return this.hours() || 24; | |
} | |
addFormatToken('H', ['HH', 2], 0, 'hour'); | |
addFormatToken('h', ['hh', 2], 0, hFormat); | |
addFormatToken('k', ['kk', 2], 0, kFormat); | |
addFormatToken('hmm', 0, 0, function () { | |
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); | |
}); | |
addFormatToken('hmmss', 0, 0, function () { | |
return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + | |
zeroFill(this.seconds(), 2); | |
}); | |
addFormatToken('Hmm', 0, 0, function () { | |
return '' + this.hours() + zeroFill(this.minutes(), 2); | |
}); | |
addFormatToken('Hmmss', 0, 0, function () { | |
return '' + this.hours() + zeroFill(this.minutes(), 2) + | |
zeroFill(this.seconds(), 2); | |
}); | |
function meridiem (token, lowercase) { | |
addFormatToken(token, 0, 0, function () { | |
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); | |
}); | |
} | |
meridiem('a', true); | |
meridiem('A', false); | |
// ALIASES | |
addUnitAlias('hour', 'h'); | |
// PRIORITY | |
addUnitPriority('hour', 13); | |
// PARSING | |
function matchMeridiem (isStrict, locale) { | |
return locale._meridiemParse; | |
} | |
addRegexToken('a', matchMeridiem); | |
addRegexToken('A', matchMeridiem); | |
addRegexToken('H', match1to2); | |
addRegexToken('h', match1to2); | |
addRegexToken('k', match1to2); | |
addRegexToken('HH', match1to2, match2); | |
addRegexToken('hh', match1to2, match2); | |
addRegexToken('kk', match1to2, match2); | |
addRegexToken('hmm', match3to4); | |
addRegexToken('hmmss', match5to6); | |
addRegexToken('Hmm', match3to4); | |
addRegexToken('Hmmss', match5to6); | |
addParseToken(['H', 'HH'], HOUR); | |
addParseToken(['k', 'kk'], function (input, array, config) { | |
var kInput = toInt(input); | |
array[HOUR] = kInput === 24 ? 0 : kInput; | |
}); | |
addParseToken(['a', 'A'], function (input, array, config) { | |
config._isPm = config._locale.isPM(input); | |
config._meridiem = input; | |
}); | |
addParseToken(['h', 'hh'], function (input, array, config) { | |
array[HOUR] = toInt(input); | |
getParsingFlags(config).bigHour = true; | |
}); | |
addParseToken('hmm', function (input, array, config) { | |
var pos = input.length - 2; | |
array[HOUR] = toInt(input.substr(0, pos)); | |
array[MINUTE] = toInt(input.substr(pos)); | |
getParsingFlags(config).bigHour = true; | |
}); | |
addParseToken('hmmss', function (input, array, config) { | |
var pos1 = input.length - 4; | |
var pos2 = input.length - 2; | |
array[HOUR] = toInt(input.substr(0, pos1)); | |
array[MINUTE] = toInt(input.substr(pos1, 2)); | |
array[SECOND] = toInt(input.substr(pos2)); | |
getParsingFlags(config).bigHour = true; | |
}); | |
addParseToken('Hmm', function (input, array, config) { | |
var pos = input.length - 2; | |
array[HOUR] = toInt(input.substr(0, pos)); | |
array[MINUTE] = toInt(input.substr(pos)); | |
}); | |
addParseToken('Hmmss', function (input, array, config) { | |
var pos1 = input.length - 4; | |
var pos2 = input.length - 2; | |
array[HOUR] = toInt(input.substr(0, pos1)); | |
array[MINUTE] = toInt(input.substr(pos1, 2)); | |
array[SECOND] = toInt(input.substr(pos2)); | |
}); | |
// LOCALES | |
function localeIsPM (input) { | |
// IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays | |
// Using charAt should be more compatible. | |
return ((input + '').toLowerCase().charAt(0) === 'p'); | |
} | |
var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; | |
function localeMeridiem (hours, minutes, isLower) { | |
if (hours > 11) { | |
return isLower ? 'pm' : 'PM'; | |
} else { | |
return isLower ? 'am' : 'AM'; | |
} | |
} | |
// MOMENTS | |
// Setting the hour should keep the time, because the user explicitly | |
// specified which hour he wants. So trying to maintain the same hour (in | |
// a new timezone) makes sense. Adding/subtracting hours does not follow | |
// this rule. | |
var getSetHour = makeGetSet('Hours', true); | |
// months | |
// week | |
// weekdays | |
// meridiem | |
var baseConfig = { | |
calendar: defaultCalendar, | |
longDateFormat: defaultLongDateFormat, | |
invalidDate: defaultInvalidDate, | |
ordinal: defaultOrdinal, | |
dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, | |
relativeTime: defaultRelativeTime, | |
months: defaultLocaleMonths, | |
monthsShort: defaultLocaleMonthsShort, | |
week: defaultLocaleWeek, | |
weekdays: defaultLocaleWeekdays, | |
weekdaysMin: defaultLocaleWeekdaysMin, | |
weekdaysShort: defaultLocaleWeekdaysShort, | |
meridiemParse: defaultLocaleMeridiemParse | |
}; | |
// internal storage for locale config files | |
var locales = {}; | |
var localeFamilies = {}; | |
var globalLocale; | |
function normalizeLocale(key) { | |
return key ? key.toLowerCase().replace('_', '-') : key; | |
} | |
// pick the locale from the array | |
// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each | |
// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root | |
function chooseLocale(names) { | |
var i = 0, j, next, locale, split; | |
while (i < names.length) { | |
split = normalizeLocale(names[i]).split('-'); | |
j = split.length; | |
next = normalizeLocale(names[i + 1]); | |
next = next ? next.split('-') : null; | |
while (j > 0) { | |
locale = loadLocale(split.slice(0, j).join('-')); | |
if (locale) { | |
return locale; | |
} | |
if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { | |
//the next array item is better than a shallower substring of this one | |
break; | |
} | |
j--; | |
} | |
i++; | |
} | |
return null; | |
} | |
function loadLocale(name) { | |
var oldLocale = null; | |
// TODO: Find a better way to register and load all the locales in Node | |
if (!locales[name] && (typeof module !== 'undefined') && | |
module && module.exports) { | |
try { | |
oldLocale = globalLocale._abbr; | |
require('./locale/' + name); | |
// because defineLocale currently also sets the global locale, we | |
// want to undo that for lazy loaded locales | |
getSetGlobalLocale(oldLocale); | |
} catch (e) { } | |
} | |
return locales[name]; | |
} | |
// This function will load locale and then set the global locale. If | |
// no arguments are passed in, it will simply return the current global | |
// locale key. | |
function getSetGlobalLocale (key, values) { | |
var data; | |
if (key) { | |
if (isUndefined(values)) { | |
data = getLocale(key); | |
} | |
else { | |
data = defineLocale(key, values); | |
} | |
if (data) { | |
// moment.duration._locale = moment._locale = data; | |
globalLocale = data; | |
} | |
} | |
return globalLocale._abbr; | |
} | |
function defineLocale (name, config) { | |
if (config !== null) { | |
var parentConfig = baseConfig; | |
config.abbr = name; | |
if (locales[name] != null) { | |
deprecateSimple('defineLocaleOverride', | |
'use moment.updateLocale(localeName, config) to change ' + | |
'an existing locale. moment.defineLocale(localeName, ' + | |
'config) should only be used for creating a new locale ' + | |
'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'); | |
parentConfig = locales[name]._config; | |
} else if (config.parentLocale != null) { | |
if (locales[config.parentLocale] != null) { | |
parentConfig = locales[config.parentLocale]._config; | |
} else { | |
if (!localeFamilies[config.parentLocale]) { | |
localeFamilies[config.parentLocale] = []; | |
} | |
localeFamilies[config.parentLocale].push({ | |
name: name, | |
config: config | |
}); | |
return null; | |
} | |
} | |
locales[name] = new Locale(mergeConfigs(parentConfig, config)); | |
if (localeFamilies[name]) { | |
localeFamilies[name].forEach(function (x) { | |
defineLocale(x.name, x.config); | |
}); | |
} | |
// backwards compat for now: also set the locale | |
// make sure we set the locale AFTER all child locales have been | |
// created, so we won't end up with the child locale set. | |
getSetGlobalLocale(name); | |
return locales[name]; | |
} else { | |
// useful for testing | |
delete locales[name]; | |
return null; | |
} | |
} | |
function updateLocale(name, config) { | |
if (config != null) { | |
var locale, parentConfig = baseConfig; | |
// MERGE | |
if (locales[name] != null) { | |
parentConfig = locales[name]._config; | |
} | |
config = mergeConfigs(parentConfig, config); | |
locale = new Locale(config); | |
locale.parentLocale = locales[name]; | |
locales[name] = locale; | |
// backwards compat for now: also set the locale | |
getSetGlobalLocale(name); | |
} else { | |
// pass null for config to unupdate, useful for tests | |
if (locales[name] != null) { | |
if (locales[name].parentLocale != null) { | |
locales[name] = locales[name].parentLocale; | |
} else if (locales[name] != null) { | |
delete locales[name]; | |
} | |
} | |
} | |
return locales[name]; | |
} | |
// returns locale data | |
function getLocale (key) { | |
var locale; | |
if (key && key._locale && key._locale._abbr) { | |
key = key._locale._abbr; | |
} | |
if (!key) { | |
return globalLocale; | |
} | |
if (!isArray(key)) { | |
//short-circuit everything else | |
locale = loadLocale(key); | |
if (locale) { | |
return locale; | |
} | |
key = [key]; | |
} | |
return chooseLocale(key); | |
} | |
function listLocales() { | |
return keys$1(locales); | |
} | |
function checkOverflow (m) { | |
var overflow; | |
var a = m._a; | |
if (a && getParsingFlags(m).overflow === -2) { | |
overflow = | |
a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : | |
a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : | |
a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : | |
a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : | |
a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : | |
a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : | |
-1; | |
if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { | |
overflow = DATE; | |
} | |
if (getParsingFlags(m)._overflowWeeks && overflow === -1) { | |
overflow = WEEK; | |
} | |
if (getParsingFlags(m)._overflowWeekday && overflow === -1) { | |
overflow = WEEKDAY; | |
} | |
getParsingFlags(m).overflow = overflow; | |
} | |
return m; | |
} | |
// iso 8601 regex | |
// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) | |
var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; | |
var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; | |
var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; | |
var isoDates = [ | |
['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], | |
['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], | |
['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], | |
['GGGG-[W]WW', /\d{4}-W\d\d/, false], | |
['YYYY-DDD', /\d{4}-\d{3}/], | |
['YYYY-MM', /\d{4}-\d\d/, false], | |
['YYYYYYMMDD', /[+-]\d{10}/], | |
['YYYYMMDD', /\d{8}/], | |
// YYYYMM is NOT allowed by the standard | |
['GGGG[W]WWE', /\d{4}W\d{3}/], | |
['GGGG[W]WW', /\d{4}W\d{2}/, false], | |
['YYYYDDD', /\d{7}/] | |
]; | |
// iso time formats and regexes | |
var isoTimes = [ | |
['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], | |
['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], | |
['HH:mm:ss', /\d\d:\d\d:\d\d/], | |
['HH:mm', /\d\d:\d\d/], | |
['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], | |
['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], | |
['HHmmss', /\d\d\d\d\d\d/], | |
['HHmm', /\d\d\d\d/], | |
['HH', /\d\d/] | |
]; | |
var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; | |
// date from iso format | |
function configFromISO(config) { | |
var i, l, | |
string = config._i, | |
match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), | |
allowTime, dateFormat, timeFormat, tzFormat; | |
if (match) { | |
getParsingFlags(config).iso = true; | |
for (i = 0, l = isoDates.length; i < l; i++) { | |
if (isoDates[i][1].exec(match[1])) { | |
dateFormat = isoDates[i][0]; | |
allowTime = isoDates[i][2] !== false; | |
break; | |
} | |
} | |
if (dateFormat == null) { | |
config._isValid = false; | |
return; | |
} | |
if (match[3]) { | |
for (i = 0, l = isoTimes.length; i < l; i++) { | |
if (isoTimes[i][1].exec(match[3])) { | |
// match[2] should be 'T' or space | |
timeFormat = (match[2] || ' ') + isoTimes[i][0]; | |
break; | |
} | |
} | |
if (timeFormat == null) { | |
config._isValid = false; | |
return; | |
} | |
} | |
if (!allowTime && timeFormat != null) { | |
config._isValid = false; | |
return; | |
} | |
if (match[4]) { | |
if (tzRegex.exec(match[4])) { | |
tzFormat = 'Z'; | |
} else { | |
config._isValid = false; | |
return; | |
} | |
} | |
config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); | |
configFromStringAndFormat(config); | |
} else { | |
config._isValid = false; | |
} | |
} | |
// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 | |
var basicRfcRegex = /^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/; | |
// date and time from ref 2822 format | |
function configFromRFC2822(config) { | |
var string, match, dayFormat, | |
dateFormat, timeFormat, tzFormat; | |
var timezones = { | |
' GMT': ' +0000', | |
' EDT': ' -0400', | |
' EST': ' -0500', | |
' CDT': ' -0500', | |
' CST': ' -0600', | |
' MDT': ' -0600', | |
' MST': ' -0700', | |
' PDT': ' -0700', | |
' PST': ' -0800' | |
}; | |
var military = 'YXWVUTSRQPONZABCDEFGHIKLM'; | |
var timezone, timezoneIndex; | |
string = config._i | |
.replace(/\([^\)]*\)|[\n\t]/g, ' ') // Remove comments and folding whitespace | |
.replace(/(\s\s+)/g, ' ') // Replace multiple-spaces with a single space | |
.replace(/^\s|\s$/g, ''); // Remove leading and trailing spaces | |
match = basicRfcRegex.exec(string); | |
if (match) { | |
dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : ''; | |
dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY '); | |
timeFormat = 'HH:mm' + (match[4] ? ':ss' : ''); | |
// TODO: Replace the vanilla JS Date object with an indepentent day-of-week check. | |
if (match[1]) { // day of week given | |
var momentDate = new Date(match[2]); | |
var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()]; | |
if (match[1].substr(0,3) !== momentDay) { | |
getParsingFlags(config).weekdayMismatch = true; | |
config._isValid = false; | |
return; | |
} | |
} | |
switch (match[5].length) { | |
case 2: // military | |
if (timezoneIndex === 0) { | |
timezone = ' +0000'; | |
} else { | |
timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12; | |
timezone = ((timezoneIndex < 0) ? ' -' : ' +') + | |
(('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00'; | |
} | |
break; | |
case 4: // Zone | |
timezone = timezones[match[5]]; | |
break; | |
default: // UT or +/-9999 | |
timezone = timezones[' GMT']; | |
} | |
match[5] = timezone; | |
config._i = match.splice(1).join(''); | |
tzFormat = ' ZZ'; | |
config._f = dayFormat + dateFormat + timeFormat + tzFormat; | |
configFromStringAndFormat(config); | |
getParsingFlags(config).rfc2822 = true; | |
} else { | |
config._isValid = false; | |
} | |
} | |
// date from iso format or fallback | |
function configFromString(config) { | |
var matched = aspNetJsonRegex.exec(config._i); | |
if (matched !== null) { | |
config._d = new Date(+matched[1]); | |
return; | |
} | |
configFromISO(config); | |
if (config._isValid === false) { | |
delete config._isValid; | |
} else { | |
return; | |
} | |
configFromRFC2822(config); | |
if (config._isValid === false) { | |
delete config._isValid; | |
} else { | |
return; | |
} | |
// Final attempt, use Input Fallback | |
hooks.createFromInputFallback(config); | |
} | |
hooks.createFromInputFallback = deprecate( | |
'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + | |
'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + | |
'discouraged and will be removed in an upcoming major release. Please refer to ' + | |
'http://momentjs.com/guides/#/warnings/js-date/ for more info.', | |
function (config) { | |
config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); | |
} | |
); | |
// Pick the first defined of two or three arguments. | |
function defaults(a, b, c) { | |
if (a != null) { | |
return a; | |
} | |
if (b != null) { | |
return b; | |
} | |
return c; | |
} | |
function currentDateArray(config) { | |
// hooks is actually the exported moment object | |
var nowValue = new Date(hooks.now()); | |
if (config._useUTC) { | |
return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; | |
} | |
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; | |
} | |
// convert an array to a date. | |
// the array should mirror the parameters below | |
// note: all values past the year are optional and will default to the lowest possible value. | |
// [year, month, day , hour, minute, second, millisecond] | |
function configFromArray (config) { | |
var i, date, input = [], currentDate, yearToUse; | |
if (config._d) { | |
return; | |
} | |
currentDate = currentDateArray(config); | |
//compute day of the year from weeks and weekdays | |
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { | |
dayOfYearFromWeekInfo(config); | |
} | |
//if the day of the year is set, figure out what it is | |
if (config._dayOfYear != null) { | |
yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); | |
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { | |
getParsingFlags(config)._overflowDayOfYear = true; | |
} | |
date = createUTCDate(yearToUse, 0, config._dayOfYear); | |
config._a[MONTH] = date.getUTCMonth(); | |
config._a[DATE] = date.getUTCDate(); | |
} | |
// Default to current date. | |
// * if no year, month, day of month are given, default to today | |
// * if day of month is given, default month and year | |
// * if month is given, default only year | |
// * if year is given, don't default anything | |
for (i = 0; i < 3 && config._a[i] == null; ++i) { | |
config._a[i] = input[i] = currentDate[i]; | |
} | |
// Zero out whatever was not defaulted, including time | |
for (; i < 7; i++) { | |
config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; | |
} | |
// Check for 24:00:00.000 | |
if (config._a[HOUR] === 24 && | |
config._a[MINUTE] === 0 && | |
config._a[SECOND] === 0 && | |
config._a[MILLISECOND] === 0) { | |
config._nextDay = true; | |
config._a[HOUR] = 0; | |
} | |
config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); | |
// Apply timezone offset from input. The actual utcOffset can be changed | |
// with parseZone. | |
if (config._tzm != null) { | |
config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); | |
} | |
if (config._nextDay) { | |
config._a[HOUR] = 24; | |
} | |
} | |
function dayOfYearFromWeekInfo(config) { | |
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; | |
w = config._w; | |
if (w.GG != null || w.W != null || w.E != null) { | |
dow = 1; | |
doy = 4; | |
// TODO: We need to take the current isoWeekYear, but that depends on | |
// how we interpret now (local, utc, fixed offset). So create | |
// a now version of current config (take local/utc/offset flags, and | |
// create now). | |
weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); | |
week = defaults(w.W, 1); | |
weekday = defaults(w.E, 1); | |
if (weekday < 1 || weekday > 7) { | |
weekdayOverflow = true; | |
} | |
} else { | |
dow = config._locale._week.dow; | |
doy = config._locale._week.doy; | |
var curWeek = weekOfYear(createLocal(), dow, doy); | |
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); | |
// Default to current week. | |
week = defaults(w.w, curWeek.week); | |
if (w.d != null) { | |
// weekday -- low day numbers are considered next week | |
weekday = w.d; | |
if (weekday < 0 || weekday > 6) { | |
weekdayOverflow = true; | |
} | |
} else if (w.e != null) { | |
// local weekday -- counting starts from begining of week | |
weekday = w.e + dow; | |
if (w.e < 0 || w.e > 6) { | |
weekdayOverflow = true; | |
} | |
} else { | |
// default to begining of week | |
weekday = dow; | |
} | |
} | |
if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { | |
getParsingFlags(config)._overflowWeeks = true; | |
} else if (weekdayOverflow != null) { | |
getParsingFlags(config)._overflowWeekday = true; | |
} else { | |
temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); | |
config._a[YEAR] = temp.year; | |
config._dayOfYear = temp.dayOfYear; | |
} | |
} | |
// constant that refers to the ISO standard | |
hooks.ISO_8601 = function () {}; | |
// constant that refers to the RFC 2822 form | |
hooks.RFC_2822 = function () {}; | |
// date from string and format string | |
function configFromStringAndFormat(config) { | |
// TODO: Move this to another part of the creation flow to prevent circular deps | |
if (config._f === hooks.ISO_8601) { | |
configFromISO(config); | |
return; | |
} | |
if (config._f === hooks.RFC_2822) { | |
configFromRFC2822(config); | |
return; | |
} | |
config._a = []; | |
getParsingFlags(config).empty = true; | |
// This array is used to make a Date, either with `new Date` or `Date.UTC` | |
var string = '' + config._i, | |
i, parsedInput, tokens, token, skipped, | |
stringLength = string.length, | |
totalParsedInputLength = 0; | |
tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; | |
for (i = 0; i < tokens.length; i++) { | |
token = tokens[i]; | |
parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; | |
// console.log('token', token, 'parsedInput', parsedInput, | |
// 'regex', getParseRegexForToken(token, config)); | |
if (parsedInput) { | |
skipped = string.substr(0, string.indexOf(parsedInput)); | |
if (skipped.length > 0) { | |
getParsingFlags(config).unusedInput.push(skipped); | |
} | |
string = string.slice(string.indexOf(parsedInput) + parsedInput.length); | |
totalParsedInputLength += parsedInput.length; | |
} | |
// don't parse if it's not a known token | |
if (formatTokenFunctions[token]) { | |
if (parsedInput) { | |
getParsingFlags(config).empty = false; | |
} | |
else { | |
getParsingFlags(config).unusedTokens.push(token); | |
} | |
addTimeToArrayFromToken(token, parsedInput, config); | |
} | |
else if (config._strict && !parsedInput) { | |
getParsingFlags(config).unusedTokens.push(token); | |
} | |
} | |
// add remaining unparsed input length to the string | |
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; | |
if (string.length > 0) { | |
getParsingFlags(config).unusedInput.push(string); | |
} | |
// clear _12h flag if hour is <= 12 | |
if (config._a[HOUR] <= 12 && | |
getParsingFlags(config).bigHour === true && | |
config._a[HOUR] > 0) { | |
getParsingFlags(config).bigHour = undefined; | |
} | |
getParsingFlags(config).parsedDateParts = config._a.slice(0); | |
getParsingFlags(config).meridiem = config._meridiem; | |
// handle meridiem | |
config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); | |
configFromArray(config); | |
checkOverflow(config); | |
} | |
function meridiemFixWrap (locale, hour, meridiem) { | |
var isPm; | |
if (meridiem == null) { | |
// nothing to do | |
return hour; | |
} | |
if (locale.meridiemHour != null) { | |
return locale.meridiemHour(hour, meridiem); | |
} else if (locale.isPM != null) { | |
// Fallback | |
isPm = locale.isPM(meridiem); | |
if (isPm && hour < 12) { | |
hour += 12; | |
} | |
if (!isPm && hour === 12) { | |
hour = 0; | |
} | |
return hour; | |
} else { | |
// this is not supposed to happen | |
return hour; | |
} | |
} | |
// date from string and array of format strings | |
function configFromStringAndArray(config) { | |
var tempConfig, | |
bestMoment, | |
scoreToBeat, | |
i, | |
currentScore; | |
if (config._f.length === 0) { | |
getParsingFlags(config).invalidFormat = true; | |
config._d = new Date(NaN); | |
return; | |
} | |
for (i = 0; i < config._f.length; i++) { | |
currentScore = 0; | |
tempConfig = copyConfig({}, config); | |
if (config._useUTC != null) { | |
tempConfig._useUTC = config._useUTC; | |
} | |
tempConfig._f = config._f[i]; | |
configFromStringAndFormat(tempConfig); | |
if (!isValid(tempConfig)) { | |
continue; | |
} | |
// if there is any input that was not parsed add a penalty for that format | |
currentScore += getParsingFlags(tempConfig).charsLeftOver; | |
//or tokens | |
currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; | |
getParsingFlags(tempConfig).score = currentScore; | |
if (scoreToBeat == null || currentScore < scoreToBeat) { | |
scoreToBeat = currentScore; | |
bestMoment = tempConfig; | |
} | |
} | |
extend(config, bestMoment || tempConfig); | |
} | |
function configFromObject(config) { | |
if (config._d) { | |
return; | |
} | |
var i = normalizeObjectUnits(config._i); | |
config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { | |
return obj && parseInt(obj, 10); | |
}); | |
configFromArray(config); | |
} | |
function createFromConfig (config) { | |
var res = new Moment(checkOverflow(prepareConfig(config))); | |
if (res._nextDay) { | |
// Adding is smart enough around DST | |
res.add(1, 'd'); | |
res._nextDay = undefined; | |
} | |
return res; | |
} | |
function prepareConfig (config) { | |
var input = config._i, | |
format = config._f; | |
config._locale = config._locale || getLocale(config._l); | |
if (input === null || (format === undefined && input === '')) { | |
return createInvalid({nullInput: true}); | |
} | |
if (typeof input === 'string') { | |
config._i = input = config._locale.preparse(input); | |
} | |
if (isMoment(input)) { | |
return new Moment(checkOverflow(input)); | |
} else if (isDate(input)) { | |
config._d = input; | |
} else if (isArray(format)) { | |
configFromStringAndArray(config); | |
} else if (format) { | |
configFromStringAndFormat(config); | |
} else { | |
configFromInput(config); | |
} | |
if (!isValid(config)) { | |
config._d = null; | |
} | |
return config; | |
} | |
function configFromInput(config) { | |
var input = config._i; | |
if (isUndefined(input)) { | |
config._d = new Date(hooks.now()); | |
} else if (isDate(input)) { | |
config._d = new Date(input.valueOf()); | |
} else if (typeof input === 'string') { | |
configFromString(config); | |
} else if (isArray(input)) { | |
config._a = map(input.slice(0), function (obj) { | |
return parseInt(obj, 10); | |
}); | |
configFromArray(config); | |
} else if (isObject(input)) { | |
configFromObject(config); | |
} else if (isNumber(input)) { | |
// from milliseconds | |
config._d = new Date(input); | |
} else { | |
hooks.createFromInputFallback(config); | |
} | |
} | |
function createLocalOrUTC (input, format, locale, strict, isUTC) { | |
var c = {}; | |
if (locale === true || locale === false) { | |
strict = locale; | |
locale = undefined; | |
} | |
if ((isObject(input) && isObjectEmpty(input)) || | |
(isArray(input) && input.length === 0)) { | |
input = undefined; | |
} | |
// object construction must be done this way. | |
// https://github.com/moment/moment/issues/1423 | |
c._isAMomentObject = true; | |
c._useUTC = c._isUTC = isUTC; | |
c._l = locale; | |
c._i = input; | |
c._f = format; | |
c._strict = strict; | |
return createFromConfig(c); | |
} | |
function createLocal (input, format, locale, strict) { | |
return createLocalOrUTC(input, format, locale, strict, false); | |
} | |
var prototypeMin = deprecate( | |
'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', | |
function () { | |
var other = createLocal.apply(null, arguments); | |
if (this.isValid() && other.isValid()) { | |
return other < this ? this : other; | |
} else { | |
return createInvalid(); | |
} | |
} | |
); | |
var prototypeMax = deprecate( | |
'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', | |
function () { | |
var other = createLocal.apply(null, arguments); | |
if (this.isValid() && other.isValid()) { | |
return other > this ? this : other; | |
} else { | |
return createInvalid(); | |
} | |
} | |
); | |
// Pick a moment m from moments so that m[fn](other) is true for all | |
// other. This relies on the function fn to be transitive. | |
// | |
// moments should either be an array of moment objects or an array, whose | |
// first element is an array of moment objects. | |
function pickBy(fn, moments) { | |
var res, i; | |
if (moments.length === 1 && isArray(moments[0])) { | |
moments = moments[0]; | |
} | |
if (!moments.length) { | |
return createLocal(); | |
} | |
res = moments[0]; | |
for (i = 1; i < moments.length; ++i) { | |
if (!moments[i].isValid() || moments[i][fn](res)) { | |
res = moments[i]; | |
} | |
} | |
return res; | |
} | |
// TODO: Use [].sort instead? | |
function min () { | |
var args = [].slice.call(arguments, 0); | |
return pickBy('isBefore', args); | |
} | |
function max () { | |
var args = [].slice.call(arguments, 0); | |
return pickBy('isAfter', args); | |
} | |
var now = function () { | |
return Date.now ? Date.now() : +(new Date()); | |
}; | |
var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; | |
function isDurationValid(m) { | |
for (var key in m) { | |
if (!(ordering.indexOf(key) !== -1 && (m[key] == null || !isNaN(m[key])))) { | |
return false; | |
} | |
} | |
var unitHasDecimal = false; | |
for (var i = 0; i < ordering.length; ++i) { | |
if (m[ordering[i]]) { | |
if (unitHasDecimal) { | |
return false; // only allow non-integers for smallest unit | |
} | |
if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { | |
unitHasDecimal = true; | |
} | |
} | |
} | |
return true; | |
} | |
function isValid$1() { | |
return this._isValid; | |
} | |
function createInvalid$1() { | |
return createDuration(NaN); | |
} | |
function Duration (duration) { | |
var normalizedInput = normalizeObjectUnits(duration), | |
years = normalizedInput.year || 0, | |
quarters = normalizedInput.quarter || 0, | |
months = normalizedInput.month || 0, | |
weeks = normalizedInput.week || 0, | |
days = normalizedInput.day || 0, | |
hours = normalizedInput.hour || 0, | |
minutes = normalizedInput.minute || 0, | |
seconds = normalizedInput.second || 0, | |
milliseconds = normalizedInput.millisecond || 0; | |
this._isValid = isDurationValid(normalizedInput); | |
// representation for dateAddRemove | |
this._milliseconds = +milliseconds + | |
seconds * 1e3 + // 1000 | |
minutes * 6e4 + // 1000 * 60 | |
hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 | |
// Because of dateAddRemove treats 24 hours as different from a | |
// day when working around DST, we need to store them separately | |
this._days = +days + | |
weeks * 7; | |
// It is impossible translate months into days without knowing | |
// which months you are are talking about, so we have to store | |
// it separately. | |
this._months = +months + | |
quarters * 3 + | |
years * 12; | |
this._data = {}; | |
this._locale = getLocale(); | |
this._bubble(); | |
} | |
function isDuration (obj) { | |
return obj instanceof Duration; | |
} | |
function absRound (number) { | |
if (number < 0) { | |
return Math.round(-1 * number) * -1; | |
} else { | |
return Math.round(number); | |
} | |
} | |
// FORMATTING | |
function offset (token, separator) { | |
addFormatToken(token, 0, 0, function () { | |
var offset = this.utcOffset(); | |
var sign = '+'; | |
if (offset < 0) { | |
offset = -offset; | |
sign = '-'; | |
} | |
return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); | |
}); | |
} | |
offset('Z', ':'); | |
offset('ZZ', ''); | |
// PARSING | |
addRegexToken('Z', matchShortOffset); | |
addRegexToken('ZZ', matchShortOffset); | |
addParseToken(['Z', 'ZZ'], function (input, array, config) { | |
config._useUTC = true; | |
config._tzm = offsetFromString(matchShortOffset, input); | |
}); | |
// HELPERS | |
// timezone chunker | |
// '+10:00' > ['10', '00'] | |
// '-1530' > ['-15', '30'] | |
var chunkOffset = /([\+\-]|\d\d)/gi; | |
function offsetFromString(matcher, string) { | |
var matches = (string || '').match(matcher); | |
if (matches === null) { | |
return null; | |
} | |
var chunk = matches[matches.length - 1] || []; | |
var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; | |
var minutes = +(parts[1] * 60) + toInt(parts[2]); | |
return minutes === 0 ? | |
0 : | |
parts[0] === '+' ? minutes : -minutes; | |
} | |
// Return a moment from input, that is local/utc/zone equivalent to model. | |
function cloneWithOffset(input, model) { | |
var res, diff; | |
if (model._isUTC) { | |
res = model.clone(); | |
diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); | |
// Use low-level api, because this fn is low-level api. | |
res._d.setTime(res._d.valueOf() + diff); | |
hooks.updateOffset(res, false); | |
return res; | |
} else { | |
return createLocal(input).local(); | |
} | |
} | |
function getDateOffset (m) { | |
// On Firefox.24 Date#getTimezoneOffset returns a floating point. | |
// https://github.com/moment/moment/pull/1871 | |
return -Math.round(m._d.getTimezoneOffset() / 15) * 15; | |
} | |
// HOOKS | |
// This function will be called whenever a moment is mutated. | |
// It is intended to keep the offset in sync with the timezone. | |
hooks.updateOffset = function () {}; | |
// MOMENTS | |
// keepLocalTime = true means only change the timezone, without | |
// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> | |
// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset | |
// +0200, so we adjust the time as needed, to be valid. | |
// | |
// Keeping the time actually adds/subtracts (one hour) | |
// from the actual represented time. That is why we call updateOffset | |
// a second time. In case it wants us to change the offset again | |
// _changeInProgress == true case, then we have to adjust, because | |
// there is no such time in the given timezone. | |
function getSetOffset (input, keepLocalTime, keepMinutes) { | |
var offset = this._offset || 0, | |
localAdjust; | |
if (!this.isValid()) { | |
return input != null ? this : NaN; | |
} | |
if (input != null) { | |
if (typeof input === 'string') { | |
input = offsetFromString(matchShortOffset, input); | |
if (input === null) { | |
return this; | |
} | |
} else if (Math.abs(input) < 16 && !keepMinutes) { | |
input = input * 60; | |
} | |
if (!this._isUTC && keepLocalTime) { | |
localAdjust = getDateOffset(this); | |
} | |
this._offset = input; | |
this._isUTC = true; | |
if (localAdjust != null) { | |
this.add(localAdjust, 'm'); | |
} | |
if (offset !== input) { | |
if (!keepLocalTime || this._changeInProgress) { | |
addSubtract(this, createDuration(input - offset, 'm'), 1, false); | |
} else if (!this._changeInProgress) { | |
this._changeInProgress = true; | |
hooks.updateOffset(this, true); | |
this._changeInProgress = null; | |
} | |
} | |
return this; | |
} else { | |
return this._isUTC ? offset : getDateOffset(this); | |
} | |
} | |
function getSetZone (input, keepLocalTime) { | |
if (input != null) { | |
if (typeof input !== 'string') { | |
input = -input; | |
} | |
this.utcOffset(input, keepLocalTime); | |
return this; | |
} else { | |
return -this.utcOffset(); | |
} | |
} | |
function setOffsetToUTC (keepLocalTime) { | |
return this.utcOffset(0, keepLocalTime); | |
} | |
function setOffsetToLocal (keepLocalTime) { | |
if (this._isUTC) { | |
this.utcOffset(0, keepLocalTime); | |
this._isUTC = false; | |
if (keepLocalTime) { | |
this.subtract(getDateOffset(this), 'm'); | |
} | |
} | |
return this; | |
} | |
function setOffsetToParsedOffset () { | |
if (this._tzm != null) { | |
this.utcOffset(this._tzm, false, true); | |
} else if (typeof this._i === 'string') { | |
var tZone = offsetFromString(matchOffset, this._i); | |
if (tZone != null) { | |
this.utcOffset(tZone); | |
} | |
else { | |
this.utcOffset(0, true); | |
} | |
} | |
return this; | |
} | |
function hasAlignedHourOffset (input) { | |
if (!this.isValid()) { | |
return false; | |
} | |
input = input ? createLocal(input).utcOffset() : 0; | |
return (this.utcOffset() - input) % 60 === 0; | |
} | |
function isDaylightSavingTime () { | |
return ( | |
this.utcOffset() > this.clone().month(0).utcOffset() || | |
this.utcOffset() > this.clone().month(5).utcOffset() | |
); | |
} | |
function isDaylightSavingTimeShifted () { | |
if (!isUndefined(this._isDSTShifted)) { | |
return this._isDSTShifted; | |
} | |
var c = {}; | |
copyConfig(c, this); | |
c = prepareConfig(c); | |
if (c._a) { | |
var other = c._isUTC ? createUTC(c._a) : createLocal(c._a); | |
this._isDSTShifted = this.isValid() && | |
compareArrays(c._a, other.toArray()) > 0; | |
} else { | |
this._isDSTShifted = false; | |
} | |
return this._isDSTShifted; | |
} | |
function isLocal () { | |
return this.isValid() ? !this._isUTC : false; | |
} | |
function isUtcOffset () { | |
return this.isValid() ? this._isUTC : false; | |
} | |
function isUtc () { | |
return this.isValid() ? this._isUTC && this._offset === 0 : false; | |
} | |
// ASP.NET json date format regex | |
var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/; | |
// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html | |
// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere | |
// and further modified to allow for strings containing both week and day | |
var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; | |
function createDuration (input, key) { | |
var duration = input, | |
// matching against regexp is expensive, do it on demand | |
match = null, | |
sign, | |
ret, | |
diffRes; | |
if (isDuration(input)) { | |
duration = { | |
ms : input._milliseconds, | |
d : input._days, | |
M : input._months | |
}; | |
} else if (isNumber(input)) { | |
duration = {}; | |
if (key) { | |
duration[key] = input; | |
} else { | |
duration.milliseconds = input; | |
} | |
} else if (!!(match = aspNetRegex.exec(input))) { | |
sign = (match[1] === '-') ? -1 : 1; | |
duration = { | |
y : 0, | |
d : toInt(match[DATE]) * sign, | |
h : toInt(match[HOUR]) * sign, | |
m : toInt(match[MINUTE]) * sign, | |
s : toInt(match[SECOND]) * sign, | |
ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match | |
}; | |
} else if (!!(match = isoRegex.exec(input))) { | |
sign = (match[1] === '-') ? -1 : 1; | |
duration = { | |
y : parseIso(match[2], sign), | |
M : parseIso(match[3], sign), | |
w : parseIso(match[4], sign), | |
d : parseIso(match[5], sign), | |
h : parseIso(match[6], sign), | |
m : parseIso(match[7], sign), | |
s : parseIso(match[8], sign) | |
}; | |
} else if (duration == null) {// checks for null or undefined | |
duration = {}; | |
} else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { | |
diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); | |
duration = {}; | |
duration.ms = diffRes.milliseconds; | |
duration.M = diffRes.months; | |
} | |
ret = new Duration(duration); | |
if (isDuration(input) && hasOwnProp(input, '_locale')) { | |
ret._locale = input._locale; | |
} | |
return ret; | |
} | |
createDuration.fn = Duration.prototype; | |
createDuration.invalid = createInvalid$1; | |
function parseIso (inp, sign) { | |
// We'd normally use ~~inp for this, but unfortunately it also | |
// converts floats to ints. | |
// inp may be undefined, so careful calling replace on it. | |
var res = inp && parseFloat(inp.replace(',', '.')); | |
// apply sign while we're at it | |
return (isNaN(res) ? 0 : res) * sign; | |
} | |
function positiveMomentsDifference(base, other) { | |
var res = {milliseconds: 0, months: 0}; | |
res.months = other.month() - base.month() + | |
(other.year() - base.year()) * 12; | |
if (base.clone().add(res.months, 'M').isAfter(other)) { | |
--res.months; | |
} | |
res.milliseconds = +other - +(base.clone().add(res.months, 'M')); | |
return res; | |
} | |
function momentsDifference(base, other) { | |
var res; | |
if (!(base.isValid() && other.isValid())) { | |
return {milliseconds: 0, months: 0}; | |
} | |
other = cloneWithOffset(other, base); | |
if (base.isBefore(other)) { | |
res = positiveMomentsDifference(base, other); | |
} else { | |
res = positiveMomentsDifference(other, base); | |
res.milliseconds = -res.milliseconds; | |
res.months = -res.months; | |
} | |
return res; | |
} | |
// TODO: remove 'name' arg after deprecation is removed | |
function createAdder(direction, name) { | |
return function (val, period) { | |
var dur, tmp; | |
//invert the arguments, but complain about it | |
if (period !== null && !isNaN(+period)) { | |
deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + | |
'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); | |
tmp = val; val = period; period = tmp; | |
} | |
val = typeof val === 'string' ? +val : val; | |
dur = createDuration(val, period); | |
addSubtract(this, dur, direction); | |
return this; | |
}; | |
} | |
function addSubtract (mom, duration, isAdding, updateOffset) { | |
var milliseconds = duration._milliseconds, | |
days = absRound(duration._days), | |
months = absRound(duration._months); | |
if (!mom.isValid()) { | |
// No op | |
return; | |
} | |
updateOffset = updateOffset == null ? true : updateOffset; | |
if (milliseconds) { | |
mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); | |
} | |
if (days) { | |
set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); | |
} | |
if (months) { | |
setMonth(mom, get(mom, 'Month') + months * isAdding); | |
} | |
if (updateOffset) { | |
hooks.updateOffset(mom, days || months); | |
} | |
} | |
var add = createAdder(1, 'add'); | |
var subtract = createAdder(-1, 'subtract'); | |
function getCalendarFormat(myMoment, now) { | |
var diff = myMoment.diff(now, 'days', true); | |
return diff < -6 ? 'sameElse' : | |
diff < -1 ? 'lastWeek' : | |
diff < 0 ? 'lastDay' : | |
diff < 1 ? 'sameDay' : | |
diff < 2 ? 'nextDay' : | |
diff < 7 ? 'nextWeek' : 'sameElse'; | |
} | |
function calendar$1 (time, formats) { | |
// We want to compare the start of today, vs this. | |
// Getting start-of-today depends on whether we're local/utc/offset or not. | |
var now = time || createLocal(), | |
sod = cloneWithOffset(now, this).startOf('day'), | |
format = hooks.calendarFormat(this, sod) || 'sameElse'; | |
var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); | |
return this.format(output || this.localeData().calendar(format, this, createLocal(now))); | |
} | |
function clone () { | |
return new Moment(this); | |
} | |
function isAfter (input, units) { | |
var localInput = isMoment(input) ? input : createLocal(input); | |
if (!(this.isValid() && localInput.isValid())) { | |
return false; | |
} | |
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); | |
if (units === 'millisecond') { | |
return this.valueOf() > localInput.valueOf(); | |
} else { | |
return localInput.valueOf() < this.clone().startOf(units).valueOf(); | |
} | |
} | |
function isBefore (input, units) { | |
var localInput = isMoment(input) ? input : createLocal(input); | |
if (!(this.isValid() && localInput.isValid())) { | |
return false; | |
} | |
units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); | |
if (units === 'millisecond') { | |
return this.valueOf() < localInput.valueOf(); | |
} else { | |
return this.clone().endOf(units).valueOf() < localInput.valueOf(); | |
} | |
} | |
function isBetween (from, to, units, inclusivity) { | |
inclusivity = inclusivity || '()'; | |
return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && | |
(inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); | |
} | |
function isSame (input, units) { | |
var localInput = isMoment(input) ? input : createLocal(input), | |
inputMs; | |
if (!(this.isValid() && localInput.isValid())) { | |
return false; | |
} | |
units = normalizeUnits(units || 'millisecond'); | |
if (units === 'millisecond') { | |
return this.valueOf() === localInput.valueOf(); | |
} else { | |
inputMs = localInput.valueOf(); | |
return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); | |
} | |
} | |
function isSameOrAfter (input, units) { | |
return this.isSame(input, units) || this.isAfter(input,units); | |
} | |
function isSameOrBefore (input, units) { | |
return this.isSame(input, units) || this.isBefore(input,units); | |
} | |
function diff (input, units, asFloat) { | |
var that, | |
zoneDelta, | |
delta, output; | |
if (!this.isValid()) { | |
return NaN; | |
} | |
that = cloneWithOffset(input, this); | |
if (!that.isValid()) { | |
return NaN; | |
} | |
zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; | |
units = normalizeUnits(units); | |
if (units === 'year' || units === 'month' || units === 'quarter') { | |
output = monthDiff(this, that); | |
if (units === 'quarter') { | |
output = output / 3; | |
} else if (units === 'year') { | |
output = output / 12; | |
} | |
} else { | |
delta = this - that; | |
output = units === 'second' ? delta / 1e3 : // 1000 | |
units === 'minute' ? delta / 6e4 : // 1000 * 60 | |
units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 | |
units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst | |
units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst | |
delta; | |
} | |
return asFloat ? output : absFloor(output); | |
} | |
function monthDiff (a, b) { | |
// difference in months | |
var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), | |
// b is in (anchor - 1 month, anchor + 1 month) | |
anchor = a.clone().add(wholeMonthDiff, 'months'), | |
anchor2, adjust; | |
if (b - anchor < 0) { | |
anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); | |
// linear across the month | |
adjust = (b - anchor) / (anchor - anchor2); | |
} else { | |
anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); | |
// linear across the month | |
adjust = (b - anchor) / (anchor2 - anchor); | |
} | |
//check for negative zero, return zero if negative zero | |
return -(wholeMonthDiff + adjust) || 0; | |
} | |
hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; | |
hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; | |
function toString () { | |
return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); | |
} | |
function toISOString() { | |
if (!this.isValid()) { | |
return null; | |
} | |
var m = this.clone().utc(); | |
if (m.year() < 0 || m.year() > 9999) { | |
return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); | |
} | |
if (isFunction(Date.prototype.toISOString)) { | |
// native implementation is ~50x faster, use it when we can | |
return this.toDate().toISOString(); | |
} | |
return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); | |
} | |
/** | |
* Return a human readable representation of a moment that can | |
* also be evaluated to get a new moment which is the same | |
* | |
* @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects | |
*/ | |
function inspect () { | |
if (!this.isValid()) { | |
return 'moment.invalid(/* ' + this._i + ' */)'; | |
} | |
var func = 'moment'; | |
var zone = ''; | |
if (!this.isLocal()) { | |
func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; | |
zone = 'Z'; | |
} | |
var prefix = '[' + func + '("]'; | |
var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY'; | |
var datetime = '-MM-DD[T]HH:mm:ss.SSS'; | |
var suffix = zone + '[")]'; | |
return this.format(prefix + year + datetime + suffix); | |
} | |
function format (inputString) { | |
if (!inputString) { | |
inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; | |
} | |
var output = formatMoment(this, inputString); | |
return this.localeData().postformat(output); | |
} | |
function from (time, withoutSuffix) { | |
if (this.isValid() && | |
((isMoment(time) && time.isValid()) || | |
createLocal(time).isValid())) { | |
return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); | |
} else { | |
return this.localeData().invalidDate(); | |
} | |
} | |
function fromNow (withoutSuffix) { | |
return this.from(createLocal(), withoutSuffix); | |
} | |
function to (time, withoutSuffix) { | |
if (this.isValid() && | |
((isMoment(time) && time.isValid()) || | |
createLocal(time).isValid())) { | |
return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); | |
} else { | |
return this.localeData().invalidDate(); | |
} | |
} | |
function toNow (withoutSuffix) { | |
return this.to(createLocal(), withoutSuffix); | |
} | |
// If passed a locale key, it will set the locale for this | |
// instance. Otherwise, it will return the locale configuration | |
// variables for this instance. | |
function locale (key) { | |
var newLocaleData; | |
if (key === undefined) { | |
return this._locale._abbr; | |
} else { | |
newLocaleData = getLocale(key); | |
if (newLocaleData != null) { | |
this._locale = newLocaleData; | |
} | |
return this; | |
} | |
} | |
var lang = deprecate( | |
'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', | |
function (key) { | |
if (key === undefined) { | |
return this.localeData(); | |
} else { | |
return this.locale(key); | |
} | |
} | |
); | |
function localeData () { | |
return this._locale; | |
} | |
function startOf (units) { | |
units = normalizeUnits(units); | |
// the following switch intentionally omits break keywords | |
// to utilize falling through the cases. | |
switch (units) { | |
case 'year': | |
this.month(0); | |
/* falls through */ | |
case 'quarter': | |
case 'month': | |
this.date(1); | |
/* falls through */ | |
case 'week': | |
case 'isoWeek': | |
case 'day': | |
case 'date': | |
this.hours(0); | |
/* falls through */ | |
case 'hour': | |
this.minutes(0); | |
/* falls through */ | |
case 'minute': | |
this.seconds(0); | |
/* falls through */ | |
case 'second': | |
this.milliseconds(0); | |
} | |
// weeks are a special case | |
if (units === 'week') { | |
this.weekday(0); | |
} | |
if (units === 'isoWeek') { | |
this.isoWeekday(1); | |
} | |
// quarters are also special | |
if (units === 'quarter') { | |
this.month(Math.floor(this.month() / 3) * 3); | |
} | |
return this; | |
} | |
function endOf (units) { | |
units = normalizeUnits(units); | |
if (units === undefined || units === 'millisecond') { | |
return this; | |
} | |
// 'date' is an alias for 'day', so it should be considered as such. | |
if (units === 'date') { | |
units = 'day'; | |
} | |
return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); | |
} | |
function valueOf () { | |
return this._d.valueOf() - ((this._offset || 0) * 60000); | |
} | |
function unix () { | |
return Math.floor(this.valueOf() / 1000); | |
} | |
function toDate () { | |
return new Date(this.valueOf()); | |
} | |
function toArray () { | |
var m = this; | |
return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; | |
} | |
function toObject () { | |
var m = this; | |
return { | |
years: m.year(), | |
months: m.month(), | |
date: m.date(), | |
hours: m.hours(), | |
minutes: m.minutes(), | |
seconds: m.seconds(), | |
milliseconds: m.milliseconds() | |
}; | |
} | |
function toJSON () { | |
// new Date(NaN).toJSON() === null | |
return this.isValid() ? this.toISOString() : null; | |
} | |
function isValid$2 () { | |
return isValid(this); | |
} | |
function parsingFlags () { | |
return extend({}, getParsingFlags(this)); | |
} | |
function invalidAt () { | |
return getParsingFlags(this).overflow; | |
} | |
function creationData() { | |
return { | |
input: this._i, | |
format: this._f, | |
locale: this._locale, | |
isUTC: this._isUTC, | |
strict: this._strict | |
}; | |
} | |
// FORMATTING | |
addFormatToken(0, ['gg', 2], 0, function () { | |
return this.weekYear() % 100; | |
}); | |
addFormatToken(0, ['GG', 2], 0, function () { | |
return this.isoWeekYear() % 100; | |
}); | |
function addWeekYearFormatToken (token, getter) { | |
addFormatToken(0, [token, token.length], 0, getter); | |
} | |
addWeekYearFormatToken('gggg', 'weekYear'); | |
addWeekYearFormatToken('ggggg', 'weekYear'); | |
addWeekYearFormatToken('GGGG', 'isoWeekYear'); | |
addWeekYearFormatToken('GGGGG', 'isoWeekYear'); | |
// ALIASES | |
addUnitAlias('weekYear', 'gg'); | |
addUnitAlias('isoWeekYear', 'GG'); | |
// PRIORITY | |
addUnitPriority('weekYear', 1); | |
addUnitPriority('isoWeekYear', 1); | |
// PARSING | |
addRegexToken('G', matchSigned); | |
addRegexToken('g', matchSigned); | |
addRegexToken('GG', match1to2, match2); | |
addRegexToken('gg', match1to2, match2); | |
addRegexToken('GGGG', match1to4, match4); | |
addRegexToken('gggg', match1to4, match4); | |
addRegexToken('GGGGG', match1to6, match6); | |
addRegexToken('ggggg', match1to6, match6); | |
addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { | |
week[token.substr(0, 2)] = toInt(input); | |
}); | |
addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { | |
week[token] = hooks.parseTwoDigitYear(input); | |
}); | |
// MOMENTS | |
function getSetWeekYear (input) { | |
return getSetWeekYearHelper.call(this, | |
input, | |
this.week(), | |
this.weekday(), | |
this.localeData()._week.dow, | |
this.localeData()._week.doy); | |
} | |
function getSetISOWeekYear (input) { | |
return getSetWeekYearHelper.call(this, | |
input, this.isoWeek(), this.isoWeekday(), 1, 4); | |
} | |
function getISOWeeksInYear () { | |
return weeksInYear(this.year(), 1, 4); | |
} | |
function getWeeksInYear () { | |
var weekInfo = this.localeData()._week; | |
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); | |
} | |
function getSetWeekYearHelper(input, week, weekday, dow, doy) { | |
var weeksTarget; | |
if (input == null) { | |
return weekOfYear(this, dow, doy).year; | |
} else { | |
weeksTarget = weeksInYear(input, dow, doy); | |
if (week > weeksTarget) { | |
week = weeksTarget; | |
} | |
return setWeekAll.call(this, input, week, weekday, dow, doy); | |
} | |
} | |
function setWeekAll(weekYear, week, weekday, dow, doy) { | |
var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), | |
date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); | |
this.year(date.getUTCFullYear()); | |
this.month(date.getUTCMonth()); | |
this.date(date.getUTCDate()); | |
return this; | |
} | |
// FORMATTING | |
addFormatToken('Q', 0, 'Qo', 'quarter'); | |
// ALIASES | |
addUnitAlias('quarter', 'Q'); | |
// PRIORITY | |
addUnitPriority('quarter', 7); | |
// PARSING | |
addRegexToken('Q', match1); | |
addParseToken('Q', function (input, array) { | |
array[MONTH] = (toInt(input) - 1) * 3; | |
}); | |
// MOMENTS | |
function getSetQuarter (input) { | |
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); | |
} | |
// FORMATTING | |
addFormatToken('D', ['DD', 2], 'Do', 'date'); | |
// ALIASES | |
addUnitAlias('date', 'D'); | |
// PRIOROITY | |
addUnitPriority('date', 9); | |
// PARSING | |
addRegexToken('D', match1to2); | |
addRegexToken('DD', match1to2, match2); | |
addRegexToken('Do', function (isStrict, locale) { | |
// TODO: Remove "ordinalParse" fallback in next major release. | |
return isStrict ? | |
(locale._dayOfMonthOrdinalParse || locale._ordinalParse) : | |
locale._dayOfMonthOrdinalParseLenient; | |
}); | |
addParseToken(['D', 'DD'], DATE); | |
addParseToken('Do', function (input, array) { | |
array[DATE] = toInt(input.match(match1to2)[0], 10); | |
}); | |
// MOMENTS | |
var getSetDayOfMonth = makeGetSet('Date', true); | |
// FORMATTING | |
addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); | |
// ALIASES | |
addUnitAlias('dayOfYear', 'DDD'); | |
// PRIORITY | |
addUnitPriority('dayOfYear', 4); | |
// PARSING | |
addRegexToken('DDD', match1to3); | |
addRegexToken('DDDD', match3); | |
addParseToken(['DDD', 'DDDD'], function (input, array, config) { | |
config._dayOfYear = toInt(input); | |
}); | |
// HELPERS | |
// MOMENTS | |
function getSetDayOfYear (input) { | |
var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; | |
return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); | |
} | |
// FORMATTING | |
addFormatToken('m', ['mm', 2], 0, 'minute'); | |
// ALIASES | |
addUnitAlias('minute', 'm'); | |
// PRIORITY | |
addUnitPriority('minute', 14); | |
// PARSING | |
addRegexToken('m', match1to2); | |
addRegexToken('mm', match1to2, match2); | |
addParseToken(['m', 'mm'], MINUTE); | |
// MOMENTS | |
var getSetMinute = makeGetSet('Minutes', false); | |
// FORMATTING | |
addFormatToken('s', ['ss', 2], 0, 'second'); | |
// ALIASES | |
addUnitAlias('second', 's'); | |
// PRIORITY | |
addUnitPriority('second', 15); | |
// PARSING | |
addRegexToken('s', match1to2); | |
addRegexToken('ss', match1to2, match2); | |
addParseToken(['s', 'ss'], SECOND); | |
// MOMENTS | |
var getSetSecond = makeGetSet('Seconds', false); | |
// FORMATTING | |
addFormatToken('S', 0, 0, function () { | |
return ~~(this.millisecond() / 100); | |
}); | |
addFormatToken(0, ['SS', 2], 0, function () { | |
return ~~(this.millisecond() / 10); | |
}); | |
addFormatToken(0, ['SSS', 3], 0, 'millisecond'); | |
addFormatToken(0, ['SSSS', 4], 0, function () { | |
return this.millisecond() * 10; | |
}); | |
addFormatToken(0, ['SSSSS', 5], 0, function () { | |
return this.millisecond() * 100; | |
}); | |
addFormatToken(0, ['SSSSSS', 6], 0, function () { | |
return this.millisecond() * 1000; | |
}); | |
addFormatToken(0, ['SSSSSSS', 7], 0, function () { | |
return this.millisecond() * 10000; | |
}); | |
addFormatToken(0, ['SSSSSSSS', 8], 0, function () { | |
return this.millisecond() * 100000; | |
}); | |
addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { | |
return this.millisecond() * 1000000; | |
}); | |
// ALIASES | |
addUnitAlias('millisecond', 'ms'); | |
// PRIORITY | |
addUnitPriority('millisecond', 16); | |
// PARSING | |
addRegexToken('S', match1to3, match1); | |
addRegexToken('SS', match1to3, match2); | |
addRegexToken('SSS', match1to3, match3); | |
var token; | |
for (token = 'SSSS'; token.length <= 9; token += 'S') { | |
addRegexToken(token, matchUnsigned); | |
} | |
function parseMs(input, array) { | |
array[MILLISECOND] = toInt(('0.' + input) * 1000); | |
} | |
for (token = 'S'; token.length <= 9; token += 'S') { | |
addParseToken(token, parseMs); | |
} | |
// MOMENTS | |
var getSetMillisecond = makeGetSet('Milliseconds', false); | |
// FORMATTING | |
addFormatToken('z', 0, 0, 'zoneAbbr'); | |
addFormatToken('zz', 0, 0, 'zoneName'); | |
// MOMENTS | |
function getZoneAbbr () { | |
return this._isUTC ? 'UTC' : ''; | |
} | |
function getZoneName () { | |
return this._isUTC ? 'Coordinated Universal Time' : ''; | |
} | |
var proto = Moment.prototype; | |
proto.add = add; | |
proto.calendar = calendar$1; | |
proto.clone = clone; | |
proto.diff = diff; | |
proto.endOf = endOf; | |
proto.format = format; | |
proto.from = from; | |
proto.fromNow = fromNow; | |
proto.to = to; | |
proto.toNow = toNow; | |
proto.get = stringGet; | |
proto.invalidAt = invalidAt; | |
proto.isAfter = isAfter; | |
proto.isBefore = isBefore; | |
proto.isBetween = isBetween; | |
proto.isSame = isSame; | |
proto.isSameOrAfter = isSameOrAfter; | |
proto.isSameOrBefore = isSameOrBefore; | |
proto.isValid = isValid$2; | |
proto.lang = lang; | |
proto.locale = locale; | |
proto.localeData = localeData; | |
proto.max = prototypeMax; | |
proto.min = prototypeMin; | |
proto.parsingFlags = parsingFlags; | |
proto.set = stringSet; | |
proto.startOf = startOf; | |
proto.subtract = subtract; | |
proto.toArray = toArray; | |
proto.toObject = toObject; | |
proto.toDate = toDate; | |
proto.toISOString = toISOString; | |
proto.inspect = inspect; | |
proto.toJSON = toJSON; | |
proto.toString = toString; | |
proto.unix = unix; | |
proto.valueOf = valueOf; | |
proto.creationData = creationData; | |
// Year | |
proto.year = getSetYear; | |
proto.isLeapYear = getIsLeapYear; | |
// Week Year | |
proto.weekYear = getSetWeekYear; | |
proto.isoWeekYear = getSetISOWeekYear; | |
// Quarter | |
proto.quarter = proto.quarters = getSetQuarter; | |
// Month | |
proto.month = getSetMonth; | |
proto.daysInMonth = getDaysInMonth; | |
// Week | |
proto.week = proto.weeks = getSetWeek; | |
proto.isoWeek = proto.isoWeeks = getSetISOWeek; | |
proto.weeksInYear = getWeeksInYear; | |
proto.isoWeeksInYear = getISOWeeksInYear; | |
// Day | |
proto.date = getSetDayOfMonth; | |
proto.day = proto.days = getSetDayOfWeek; | |
proto.weekday = getSetLocaleDayOfWeek; | |
proto.isoWeekday = getSetISODayOfWeek; | |
proto.dayOfYear = getSetDayOfYear; | |
// Hour | |
proto.hour = proto.hours = getSetHour; | |
// Minute | |
proto.minute = proto.minutes = getSetMinute; | |
// Second | |
proto.second = proto.seconds = getSetSecond; | |
// Millisecond | |
proto.millisecond = proto.milliseconds = getSetMillisecond; | |
// Offset | |
proto.utcOffset = getSetOffset; | |
proto.utc = setOffsetToUTC; | |
proto.local = setOffsetToLocal; | |
proto.parseZone = setOffsetToParsedOffset; | |
proto.hasAlignedHourOffset = hasAlignedHourOffset; | |
proto.isDST = isDaylightSavingTime; | |
proto.isLocal = isLocal; | |
proto.isUtcOffset = isUtcOffset; | |
proto.isUtc = isUtc; | |
proto.isUTC = isUtc; | |
// Timezone | |
proto.zoneAbbr = getZoneAbbr; | |
proto.zoneName = getZoneName; | |
// Deprecations | |
proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); | |
proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); | |
proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); | |
proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); | |
proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); | |
function createUnix (input) { | |
return createLocal(input * 1000); | |
} | |
function createInZone () { | |
return createLocal.apply(null, arguments).parseZone(); | |
} | |
function preParsePostFormat (string) { | |
return string; | |
} | |
var proto$1 = Locale.prototype; | |
proto$1.calendar = calendar; | |
proto$1.longDateFormat = longDateFormat; | |
proto$1.invalidDate = invalidDate; | |
proto$1.ordinal = ordinal; | |
proto$1.preparse = preParsePostFormat; | |
proto$1.postformat = preParsePostFormat; | |
proto$1.relativeTime = relativeTime; | |
proto$1.pastFuture = pastFuture; | |
proto$1.set = set; | |
// Month | |
proto$1.months = localeMonths; | |
proto$1.monthsShort = localeMonthsShort; | |
proto$1.monthsParse = localeMonthsParse; | |
proto$1.monthsRegex = monthsRegex; | |
proto$1.monthsShortRegex = monthsShortRegex; | |
// Week | |
proto$1.week = localeWeek; | |
proto$1.firstDayOfYear = localeFirstDayOfYear; | |
proto$1.firstDayOfWeek = localeFirstDayOfWeek; | |
// Day of Week | |
proto$1.weekdays = localeWeekdays; | |
proto$1.weekdaysMin = localeWeekdaysMin; | |
proto$1.weekdaysShort = localeWeekdaysShort; | |
proto$1.weekdaysParse = localeWeekdaysParse; | |
proto$1.weekdaysRegex = weekdaysRegex; | |
proto$1.weekdaysShortRegex = weekdaysShortRegex; | |
proto$1.weekdaysMinRegex = weekdaysMinRegex; | |
// Hours | |
proto$1.isPM = localeIsPM; | |
proto$1.meridiem = localeMeridiem; | |
function get$1 (format, index, field, setter) { | |
var locale = getLocale(); | |
var utc = createUTC().set(setter, index); | |
return locale[field](utc, format); | |
} | |
function listMonthsImpl (format, index, field) { | |
if (isNumber(format)) { | |
index = format; | |
format = undefined; | |
} | |
format = format || ''; | |
if (index != null) { | |
return get$1(format, index, field, 'month'); | |
} | |
var i; | |
var out = []; | |
for (i = 0; i < 12; i++) { | |
out[i] = get$1(format, i, field, 'month'); | |
} | |
return out; | |
} | |
// () | |
// (5) | |
// (fmt, 5) | |
// (fmt) | |
// (true) | |
// (true, 5) | |
// (true, fmt, 5) | |
// (true, fmt) | |
function listWeekdaysImpl (localeSorted, format, index, field) { | |
if (typeof localeSorted === 'boolean') { | |
if (isNumber(format)) { | |
index = format; | |
format = undefined; | |
} | |
format = format || ''; | |
} else { | |
format = localeSorted; | |
index = format; | |
localeSorted = false; | |
if (isNumber(format)) { | |
index = format; | |
format = undefined; | |
} | |
format = format || ''; | |
} | |
var locale = getLocale(), | |
shift = localeSorted ? locale._week.dow : 0; | |
if (index != null) { | |
return get$1(format, (index + shift) % 7, field, 'day'); | |
} | |
var i; | |
var out = []; | |
for (i = 0; i < 7; i++) { | |
out[i] = get$1(format, (i + shift) % 7, field, 'day'); | |
} | |
return out; | |
} | |
function listMonths (format, index) { | |
return listMonthsImpl(format, index, 'months'); | |
} | |
function listMonthsShort (format, index) { | |
return listMonthsImpl(format, index, 'monthsShort'); | |
} | |
function listWeekdays (localeSorted, format, index) { | |
return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); | |
} | |
function listWeekdaysShort (localeSorted, format, index) { | |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); | |
} | |
function listWeekdaysMin (localeSorted, format, index) { | |
return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); | |
} | |
getSetGlobalLocale('en', { | |
dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, | |
ordinal : function (number) { | |
var b = number % 10, | |
output = (toInt(number % 100 / 10) === 1) ? 'th' : | |
(b === 1) ? 'st' : | |
(b === 2) ? 'nd' : | |
(b === 3) ? 'rd' : 'th'; | |
return number + output; | |
} | |
}); | |
// Side effect imports | |
hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); | |
hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); | |
var mathAbs = Math.abs; | |
function abs () { | |
var data = this._data; | |
this._milliseconds = mathAbs(this._milliseconds); | |
this._days = mathAbs(this._days); | |
this._months = mathAbs(this._months); | |
data.milliseconds = mathAbs(data.milliseconds); | |
data.seconds = mathAbs(data.seconds); | |
data.minutes = mathAbs(data.minutes); | |
data.hours = mathAbs(data.hours); | |
data.months = mathAbs(data.months); | |
data.years = mathAbs(data.years); | |
return this; | |
} | |
function addSubtract$1 (duration, input, value, direction) { | |
var other = createDuration(input, value); | |
duration._milliseconds += direction * other._milliseconds; | |
duration._days += direction * other._days; | |
duration._months += direction * other._months; | |
return duration._bubble(); | |
} | |
// supports only 2.0-style add(1, 's') or add(duration) | |
function add$1 (input, value) { | |
return addSubtract$1(this, input, value, 1); | |
} | |
// supports only 2.0-style subtract(1, 's') or subtract(duration) | |
function subtract$1 (input, value) { | |
return addSubtract$1(this, input, value, -1); | |
} | |
function absCeil (number) { | |
if (number < 0) { | |
return Math.floor(number); | |
} else { | |
return Math.ceil(number); | |
} | |
} | |
function bubble () { | |
var milliseconds = this._milliseconds; | |
var days = this._days; | |
var months = this._months; | |
var data = this._data; | |
var seconds, minutes, hours, years, monthsFromDays; | |
// if we have a mix of positive and negative values, bubble down first | |
// check: https://github.com/moment/moment/issues/2166 | |
if (!((milliseconds >= 0 && days >= 0 && months >= 0) || | |
(milliseconds <= 0 && days <= 0 && months <= 0))) { | |
milliseconds += absCeil(monthsToDays(months) + days) * 864e5; | |
days = 0; | |
months = 0; | |
} | |
// The following code bubbles up values, see the tests for | |
// examples of what that means. | |
data.milliseconds = milliseconds % 1000; | |
seconds = absFloor(milliseconds / 1000); | |
data.seconds = seconds % 60; | |
minutes = absFloor(seconds / 60); | |
data.minutes = minutes % 60; | |
hours = absFloor(minutes / 60); | |
data.hours = hours % 24; | |
days += absFloor(hours / 24); | |
// convert days to months | |
monthsFromDays = absFloor(daysToMonths(days)); | |
months += monthsFromDays; | |
days -= absCeil(monthsToDays(monthsFromDays)); | |
// 12 months -> 1 year | |
years = absFloor(months / 12); | |
months %= 12; | |
data.days = days; | |
data.months = months; | |
data.years = years; | |
return this; | |
} | |
function daysToMonths (days) { | |
// 400 years have 146097 days (taking into account leap year rules) | |
// 400 years have 12 months === 4800 | |
return days * 4800 / 146097; | |
} | |
function monthsToDays (months) { | |
// the reverse of daysToMonths | |
return months * 146097 / 4800; | |
} | |
function as (units) { | |
if (!this.isValid()) { | |
return NaN; | |
} | |
var days; | |
var months; | |
var milliseconds = this._milliseconds; | |
units = normalizeUnits(units); | |
if (units === 'month' || units === 'year') { | |
days = this._days + milliseconds / 864e5; | |
months = this._months + daysToMonths(days); | |
return units === 'month' ? months : months / 12; | |
} else { | |
// handle milliseconds separately because of floating point math errors (issue #1867) | |
days = this._days + Math.round(monthsToDays(this._months)); | |
switch (units) { | |
case 'week' : return days / 7 + milliseconds / 6048e5; | |
case 'day' : return days + milliseconds / 864e5; | |
case 'hour' : return days * 24 + milliseconds / 36e5; | |
case 'minute' : return days * 1440 + milliseconds / 6e4; | |
case 'second' : return days * 86400 + milliseconds / 1000; | |
// Math.floor prevents floating point math errors here | |
case 'millisecond': return Math.floor(days * 864e5) + milliseconds; | |
default: throw new Error('Unknown unit ' + units); | |
} | |
} | |
} | |
// TODO: Use this.as('ms')? | |
function valueOf$1 () { | |
if (!this.isValid()) { | |
return NaN; | |
} | |
return ( | |
this._milliseconds + | |
this._days * 864e5 + | |
(this._months % 12) * 2592e6 + | |
toInt(this._months / 12) * 31536e6 | |
); | |
} | |
function makeAs (alias) { | |
return function () { | |
return this.as(alias); | |
}; | |
} | |
var asMilliseconds = makeAs('ms'); | |
var asSeconds = makeAs('s'); | |
var asMinutes = makeAs('m'); | |
var asHours = makeAs('h'); | |
var asDays = makeAs('d'); | |
var asWeeks = makeAs('w'); | |
var asMonths = makeAs('M'); | |
var asYears = makeAs('y'); | |
function get$2 (units) { | |
units = normalizeUnits(units); | |
return this.isValid() ? this[units + 's']() : NaN; | |
} | |
function makeGetter(name) { | |
return function () { | |
return this.isValid() ? this._data[name] : NaN; | |
}; | |
} | |
var milliseconds = makeGetter('milliseconds'); | |
var seconds = makeGetter('seconds'); | |
var minutes = makeGetter('minutes'); | |
var hours = makeGetter('hours'); | |
var days = makeGetter('days'); | |
var months = makeGetter('months'); | |
var years = makeGetter('years'); | |
function weeks () { | |
return absFloor(this.days() / 7); | |
} | |
var round = Math.round; | |
var thresholds = { | |
ss: 44, // a few seconds to seconds | |
s : 45, // seconds to minute | |
m : 45, // minutes to hour | |
h : 22, // hours to day | |
d : 26, // days to month | |
M : 11 // months to year | |
}; | |
// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize | |
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { | |
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); | |
} | |
function relativeTime$1 (posNegDuration, withoutSuffix, locale) { | |
var duration = createDuration(posNegDuration).abs(); | |
var seconds = round(duration.as('s')); | |
var minutes = round(duration.as('m')); | |
var hours = round(duration.as('h')); | |
var days = round(duration.as('d')); | |
var months = round(duration.as('M')); | |
var years = round(duration.as('y')); | |
var a = seconds <= thresholds.ss && ['s', seconds] || | |
seconds < thresholds.s && ['ss', seconds] || | |
minutes <= 1 && ['m'] || | |
minutes < thresholds.m && ['mm', minutes] || | |
hours <= 1 && ['h'] || | |
hours < thresholds.h && ['hh', hours] || | |
days <= 1 && ['d'] || | |
days < thresholds.d && ['dd', days] || | |
months <= 1 && ['M'] || | |
months < thresholds.M && ['MM', months] || | |
years <= 1 && ['y'] || ['yy', years]; | |
a[2] = withoutSuffix; | |
a[3] = +posNegDuration > 0; | |
a[4] = locale; | |
return substituteTimeAgo.apply(null, a); | |
} | |
// This function allows you to set the rounding function for relative time strings | |
function getSetRelativeTimeRounding (roundingFunction) { | |
if (roundingFunction === undefined) { | |
return round; | |
} | |
if (typeof(roundingFunction) === 'function') { | |
round = roundingFunction; | |
return true; | |
} | |
return false; | |
} | |
// This function allows you to set a threshold for relative time strings | |
function getSetRelativeTimeThreshold (threshold, limit) { | |
if (thresholds[threshold] === undefined) { | |
return false; | |
} | |
if (limit === undefined) { | |
return thresholds[threshold]; | |
} | |
thresholds[threshold] = limit; | |
if (threshold === 's') { | |
thresholds.ss = limit - 1; | |
} | |
return true; | |
} | |
function humanize (withSuffix) { | |
if (!this.isValid()) { | |
return this.localeData().invalidDate(); | |
} | |
var locale = this.localeData(); | |
var output = relativeTime$1(this, !withSuffix, locale); | |
if (withSuffix) { | |
output = locale.pastFuture(+this, output); | |
} | |
return locale.postformat(output); | |
} | |
var abs$1 = Math.abs; | |
function toISOString$1() { | |
// for ISO strings we do not use the normal bubbling rules: | |
// * milliseconds bubble up until they become hours | |
// * days do not bubble at all | |
// * months bubble up until they become years | |
// This is because there is no context-free conversion between hours and days | |
// (think of clock changes) | |
// and also not between days and months (28-31 days per month) | |
if (!this.isValid()) { | |
return this.localeData().invalidDate(); | |
} | |
var seconds = abs$1(this._milliseconds) / 1000; | |
var days = abs$1(this._days); | |
var months = abs$1(this._months); | |
var minutes, hours, years; | |
// 3600 seconds -> 60 minutes -> 1 hour | |
minutes = absFloor(seconds / 60); | |
hours = absFloor(minutes / 60); | |
seconds %= 60; | |
minutes %= 60; | |
// 12 months -> 1 year | |
years = absFloor(months / 12); | |
months %= 12; | |
// inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js | |
var Y = years; | |
var M = months; | |
var D = days; | |
var h = hours; | |
var m = minutes; | |
var s = seconds; | |
var total = this.asSeconds(); | |
if (!total) { | |
// this is the same as C#'s (Noda) and python (isodate)... | |
// but not other JS (goog.date) | |
return 'P0D'; | |
} | |
return (total < 0 ? '-' : '') + | |
'P' + | |
(Y ? Y + 'Y' : '') + | |
(M ? M + 'M' : '') + | |
(D ? D + 'D' : '') + | |
((h || m || s) ? 'T' : '') + | |
(h ? h + 'H' : '') + | |
(m ? m + 'M' : '') + | |
(s ? s + 'S' : ''); | |
} | |
var proto$2 = Duration.prototype; | |
proto$2.isValid = isValid$1; | |
proto$2.abs = abs; | |
proto$2.add = add$1; | |
proto$2.subtract = subtract$1; | |
proto$2.as = as; | |
proto$2.asMilliseconds = asMilliseconds; | |
proto$2.asSeconds = asSeconds; | |
proto$2.asMinutes = asMinutes; | |
proto$2.asHours = asHours; | |
proto$2.asDays = asDays; | |
proto$2.asWeeks = asWeeks; | |
proto$2.asMonths = asMonths; | |
proto$2.asYears = asYears; | |
proto$2.valueOf = valueOf$1; | |
proto$2._bubble = bubble; | |
proto$2.get = get$2; | |
proto$2.milliseconds = milliseconds; | |
proto$2.seconds = seconds; | |
proto$2.minutes = minutes; | |
proto$2.hours = hours; | |
proto$2.days = days; | |
proto$2.weeks = weeks; | |
proto$2.months = months; | |
proto$2.years = years; | |
proto$2.humanize = humanize; | |
proto$2.toISOString = toISOString$1; | |
proto$2.toString = toISOString$1; | |
proto$2.toJSON = toISOString$1; | |
proto$2.locale = locale; | |
proto$2.localeData = localeData; | |
// Deprecations | |
proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); | |
proto$2.lang = lang; | |
// Side effect imports | |
// FORMATTING | |
addFormatToken('X', 0, 0, 'unix'); | |
addFormatToken('x', 0, 0, 'valueOf'); | |
// PARSING | |
addRegexToken('x', matchSigned); | |
addRegexToken('X', matchTimestamp); | |
addParseToken('X', function (input, array, config) { | |
config._d = new Date(parseFloat(input, 10) * 1000); | |
}); | |
addParseToken('x', function (input, array, config) { | |
config._d = new Date(toInt(input)); | |
}); | |
// Side effect imports | |
hooks.version = '2.18.1'; | |
setHookCallback(createLocal); | |
hooks.fn = proto; | |
hooks.min = min; | |
hooks.max = max; | |
hooks.now = now; | |
hooks.utc = createUTC; | |
hooks.unix = createUnix; | |
hooks.months = listMonths; | |
hooks.isDate = isDate; | |
hooks.locale = getSetGlobalLocale; | |
hooks.invalid = createInvalid; | |
hooks.duration = createDuration; | |
hooks.isMoment = isMoment; | |
hooks.weekdays = listWeekdays; | |
hooks.parseZone = createInZone; | |
hooks.localeData = getLocale; | |
hooks.isDuration = isDuration; | |
hooks.monthsShort = listMonthsShort; | |
hooks.weekdaysMin = listWeekdaysMin; | |
hooks.defineLocale = defineLocale; | |
hooks.updateLocale = updateLocale; | |
hooks.locales = listLocales; | |
hooks.weekdaysShort = listWeekdaysShort; | |
hooks.normalizeUnits = normalizeUnits; | |
hooks.relativeTimeRounding = getSetRelativeTimeRounding; | |
hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; | |
hooks.calendarFormat = getCalendarFormat; | |
hooks.prototype = proto; | |
return hooks; | |
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(){function n(n){function e(){for(;i=a<c.length&&n>p;){var u=a++,e=c[u],o=t.call(e,1);o.push(l(u)),++p,e[0].apply(null,o)}}function l(n){return function(u,t){--p,null==s&&(null!=u?(s=u,a=d=0/0,o()):(c[n]=t,--d?i||e():o()))}}function o(){null!=s?m(s):f?m(s,c):m.apply(null,[s].concat(c))}var r,i,f,c=[],a=0,p=0,d=0,s=null,m=u;return n||(n=1/0),r={defer:function(){return s||(c.push(arguments),++d,e()),r},await:function(n){return m=n,f=!1,d||o(),r},awaitAll:function(n){return m=n,f=!0,d||o(),r}}}function u(){}var t=[].slice;n.version="1.0.7","function"==typeof define&&define.amd?define(function(){return n}):"object"==typeof module&&module.exports?module.exports=n:this.queue=n}(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Area | Boro | AreaType | 2009-03-01 | 2009-04-01 | 2009-05-01 | 2009-06-01 | 2009-07-01 | 2009-08-01 | 2009-09-01 | 2009-10-01 | 2009-11-01 | 2009-12-01 | 2010-01-01 | 2010-02-01 | 2010-03-01 | 2010-04-01 | 2010-05-01 | 2010-06-01 | 2010-07-01 | 2010-08-01 | 2010-09-01 | 2010-10-01 | 2010-11-01 | 2010-12-01 | 2011-01-01 | 2011-02-01 | 2011-03-01 | 2011-04-01 | 2011-05-01 | 2011-06-01 | 2011-07-01 | 2011-08-01 | 2011-09-01 | 2011-10-01 | 2011-11-01 | 2011-12-01 | 2012-01-01 | 2012-02-01 | 2012-03-01 | 2012-04-01 | 2012-05-01 | 2012-06-01 | 2012-07-01 | 2012-08-01 | 2012-09-01 | 2012-10-01 | 2012-11-01 | 2012-12-01 | 2013-01-01 | 2013-02-01 | 2013-03-01 | 2013-04-01 | 2013-05-01 | 2013-06-01 | 2013-07-01 | 2013-08-01 | 2013-09-01 | 2013-10-01 | 2013-11-01 | 2013-12-01 | 2014-01-01 | 2014-02-01 | 2014-03-01 | 2014-04-01 | 2014-05-01 | 2014-06-01 | 2014-07-01 | 2014-08-01 | 2014-09-01 | 2014-10-01 | 2014-11-01 | 2014-12-01 | 2015-01-01 | 2015-02-01 | 2015-03-01 | 2015-04-01 | 2015-05-01 | 2015-06-01 | 2015-07-01 | 2015-08-01 | 2015-09-01 | 2015-10-01 | 2015-11-01 | 2015-12-01 | 2016-01-01 | 2016-02-01 | 2016-03-01 | 2016-04-01 | 2016-05-01 | 2016-06-01 | 2016-07-01 | 2016-08-01 | 2016-09-01 | 2016-10-01 | 2016-11-01 | 2016-12-01 | 2017-01-01 | 2017-02-01 | 2017-03-01 | 2017-04-01 | 2017-05-01 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NYC | All | City | 17788 | 18500 | 19849 | 20260 | 20048 | 19576 | 19903 | 20074 | 19718 | 18920 | 19174 | 19576 | 20451 | 21218 | 21120 | 21126 | 20690 | 19791 | 18055 | 18298 | 17947 | 16989 | 17198 | 17288 | 18560 | 19064 | 19405 | 19549 | 19208 | 17561 | 17395 | 17383 | 16826 | 15956 | 15988 | 16129 | 17077 | 17371 | 17844 | 17603 | 16889 | 16070 | 15694 | 15485 | 14725 | 13994 | 13928 | 13906 | 14633 | 15596 | 16290 | 16126 | 15568 | 14692 | 14165 | 14321 | 13327 | 12335 | 12373 | 12339 | 13270 | 14055 | 14928 | 15979 | 15955 | 15122 | 15679 | 15938 | 14923 | 14002 | 13754 | 13820 | 14674 | 15816 | 16153 | 16513 | 16017 | 14854 | 15328 | 15481 | 14579 | 13399 | 13093 | 13224 | 14134 | 14701 | 15355 | 15659 | 15086 | 14281 | 15579 | 15826 | 15552 | 14388 | 14354 | 14342 | 15342 | 15572 | 15685 | |
Manhattan | Manhattan | Borough | 13002 | 13584 | 13806 | 13937 | 13543 | 12939 | 12865 | 12870 | 12466 | 11813 | 11852 | 12040 | 12598 | 12799 | 12730 | 12633 | 12059 | 11326 | 11248 | 11367 | 10943 | 10374 | 10423 | 10544 | 11317 | 11606 | 11718 | 11710 | 11343 | 10291 | 10385 | 10441 | 10208 | 9675 | 9822 | 10016 | 10643 | 10864 | 11086 | 10933 | 10440 | 9900 | 9667 | 9541 | 9075 | 8579 | 8442 | 8570 | 9111 | 9794 | 10114 | 9956 | 9558 | 8842 | 8629 | 8741 | 8042 | 7449 | 7512 | 7566 | 8136 | 8709 | 9227 | 9186 | 8922 | 8260 | 8499 | 8716 | 8255 | 7650 | 7501 | 7700 | 8159 | 8993 | 9235 | 9338 | 8981 | 8277 | 8704 | 8890 | 8359 | 7755 | 7678 | 8057 | 8740 | 8949 | 9353 | 9409 | 8986 | 8410 | 9411 | 9525 | 9305 | 8670 | 8740 | 8723 | 9355 | 9563 | 9449 | |
All Downtown | Manhattan | Submarket | 3969 | 4140 | 4190 | 4201 | 4072 | 3860 | 3798 | 3767 | 3644 | 3447 | 3474 | 3487 | 3638 | 3624 | 3538 | 3576 | 3416 | 3262 | 3200 | 3223 | 3095 | 2914 | 2918 | 2970 | 3198 | 3299 | 3295 | 3302 | 3198 | 2881 | 2917 | 2969 | 2898 | 2718 | 2695 | 2768 | 2986 | 3071 | 3175 | 3167 | 3070 | 2902 | 2780 | 2652 | 2512 | 2369 | 2302 | 2340 | 2584 | 2858 | 2938 | 2935 | 2885 | 2637 | 2562 | 2615 | 2427 | 2270 | 2256 | 2230 | 2427 | 2611 | 2757 | 2751 | 2670 | 2484 | 2545 | 2640 | 2486 | 2220 | 2144 | 2218 | 2347 | 2653 | 2735 | 2768 | 2684 | 2463 | 2637 | 2687 | 2629 | 2456 | 2478 | 2600 | 2854 | 3094 | 3286 | 3269 | 3159 | 3023 | 3221 | 3223 | 3172 | 2892 | 2882 | 2841 | 3091 | 3140 | 3096 | |
All Midtown | Manhattan | Submarket | 2858 | 2945 | 2984 | 3045 | 2943 | 2852 | 2815 | 2846 | 2748 | 2619 | 2587 | 2691 | 2849 | 2922 | 2939 | 2883 | 2754 | 2604 | 2596 | 2589 | 2463 | 2330 | 2324 | 2362 | 2491 | 2529 | 2572 | 2528 | 2507 | 2349 | 2368 | 2384 | 2331 | 2237 | 2296 | 2341 | 2414 | 2433 | 2469 | 2438 | 2358 | 2274 | 2191 | 2190 | 2091 | 1969 | 1950 | 1980 | 2097 | 2202 | 2241 | 2148 | 2093 | 1967 | 1920 | 1963 | 1821 | 1654 | 1655 | 1687 | 1809 | 1900 | 1996 | 1973 | 1929 | 1822 | 1899 | 1930 | 1850 | 1766 | 1747 | 1793 | 1940 | 2107 | 2161 | 2162 | 2073 | 1927 | 2017 | 2093 | 1982 | 1882 | 1878 | 1996 | 2108 | 1762 | 1827 | 1843 | 1768 | 1649 | 2187 | 2208 | 2169 | 2092 | 2136 | 2136 | 2257 | 2276 | 2251 | |
All Upper West Side | Manhattan | Submarket | 2226 | 2331 | 2359 | 2364 | 2274 | 2187 | 2125 | 2128 | 2036 | 1970 | 1967 | 1950 | 2035 | 2068 | 2076 | 2054 | 1931 | 1807 | 1807 | 1866 | 1763 | 1650 | 1669 | 1714 | 1908 | 1961 | 2000 | 2010 | 1913 | 1704 | 1724 | 1706 | 1675 | 1551 | 1571 | 1638 | 1742 | 1790 | 1831 | 1798 | 1659 | 1528 | 1490 | 1470 | 1398 | 1317 | 1299 | 1328 | 1446 | 1608 | 1708 | 1698 | 1585 | 1448 | 1407 | 1405 | 1275 | 1166 | 1214 | 1237 | 1333 | 1443 | 1568 | 1540 | 1481 | 1318 | 1327 | 1336 | 1279 | 1196 | 1171 | 1227 | 1305 | 1480 | 1513 | 1559 | 1495 | 1388 | 1445 | 1431 | 1312 | 1185 | 1147 | 1137 | 1300 | 1431 | 1502 | 1511 | 1431 | 1329 | 1352 | 1395 | 1344 | 1221 | 1222 | 1216 | 1295 | 1369 | 1383 | |
All Upper East Side | Manhattan | Submarket | 2832 | 2995 | 3066 | 3094 | 3046 | 2876 | 2917 | 2901 | 2751 | 2529 | 2575 | 2633 | 2777 | 2856 | 2865 | 2839 | 2698 | 2505 | 2489 | 2538 | 2479 | 2362 | 2336 | 2376 | 2540 | 2636 | 2662 | 2642 | 2507 | 2256 | 2268 | 2325 | 2273 | 2173 | 2248 | 2273 | 2491 | 2546 | 2572 | 2504 | 2377 | 2243 | 2255 | 2302 | 2208 | 2056 | 2050 | 2130 | 2202 | 2318 | 2351 | 2313 | 2159 | 1975 | 1965 | 2013 | 1834 | 1693 | 1743 | 1762 | 1876 | 2025 | 2102 | 2091 | 2001 | 1841 | 1919 | 2009 | 1877 | 1768 | 1774 | 1817 | 1924 | 2085 | 2151 | 2140 | 2022 | 1854 | 1891 | 1970 | 1865 | 1722 | 1684 | 1798 | 1942 | 2103 | 2142 | 2208 | 2074 | 1886 | 1960 | 2022 | 1956 | 1851 | 1905 | 1962 | 2092 | 2181 | 2120 | |
All Upper Manhattan | Manhattan | Submarket | 1026 | 1083 | 1113 | 1121 | 1096 | 1050 | 1091 | 1115 | 1189 | 1176 | 1173 | 1209 | 1235 | 1266 | 1257 | 1225 | 1206 | 1107 | 1129 | 1126 | 1121 | 1097 | 1151 | 1090 | 1149 | 1150 | 1159 | 1199 | 1193 | 1078 | 1086 | 1040 | 1014 | 980 | 999 | 982 | 1001 | 1015 | 1027 | 1015 | 969 | 946 | 943 | 919 | 861 | 863 | 835 | 785 | 774 | 800 | 863 | 848 | 824 | 804 | 764 | 736 | 680 | 661 | 638 | 645 | 681 | 717 | 788 | 811 | 821 | 778 | 791 | 785 | 746 | 685 | 653 | 632 | 631 | 658 | 657 | 673 | 637 | 620 | 684 | 677 | 538 | 481 | 463 | 500 | 512 | 540 | 573 | 554 | 525 | 500 | 663 | 647 | 632 | 581 | 569 | 544 | 593 | 573 | 576 | |
Bronx | Bronx | Borough | 390 | 408 | 425 | 464 | 501 | 512 | 548 | 562 | 588 | 579 | 616 | 616 | 646 | 696 | 628 | 627 | 624 | 600 | 579 | 570 | 555 | 556 | 613 | 603 | 664 | 694 | 776 | 807 | 791 | 776 | 725 | 713 | 720 | 698 | 691 | 697 | 735 | 774 | 796 | 804 | 821 | 801 | 800 | 789 | 761 | 735 | 760 | 750 | 797 | 840 | 865 | 903 | 899 | 913 | 880 | 857 | 813 | 761 | 766 | 749 | 806 | 797 | 821 | 825 | 845 | 895 | 873 | 851 | 811 | 772 | 761 | 771 | 833 | 842 | 881 | 913 | 929 | 915 | 904 | 863 | 804 | 734 | 730 | 738 | 760 | 762 | 776 | 800 | 768 | 742 | 752 | 738 | 690 | 658 | 633 | 621 | 676 | 657 | 641 | |
Brooklyn | Brooklyn | Borough | 3579 | 3677 | 4617 | 4808 | 4934 | 4904 | 4987 | 5178 | 5220 | 5131 | 5261 | 5425 | 5650 | 6051 | 6016 | 6067 | 6094 | 6045 | 4571 | 4676 | 4732 | 4423 | 4574 | 4530 | 4791 | 4861 | 4953 | 5032 | 4864 | 4548 | 4497 | 4480 | 4299 | 4087 | 4010 | 3970 | 4164 | 4237 | 4364 | 4228 | 4004 | 3735 | 3654 | 3562 | 3316 | 3118 | 3139 | 3010 | 3084 | 3285 | 3507 | 3536 | 3401 | 3216 | 3018 | 3090 | 2863 | 2601 | 2599 | 2529 | 2625 | 2652 | 2755 | 3525 | 3437 | 3222 | 3590 | 3754 | 3458 | 3326 | 3273 | 3206 | 3358 | 3681 | 3904 | 4079 | 4016 | 3654 | 3713 | 3735 | 3517 | 3165 | 2995 | 2776 | 2964 | 3227 | 3392 | 3523 | 3394 | 3170 | 3405 | 3508 | 3483 | 3238 | 3159 | 3140 | 3274 | 3312 | 3483 | |
North Brooklyn | Brooklyn | Submarket | 832 | 811 | 738 | 705 | 702 | 641 | 659 | 677 | 685 | 639 | 654 | 682 | 717 | 798 | 770 | 729 | 657 | 686 | 660 | 659 | 717 | 605 | 642 | 570 | 554 | 534 | 508 | 488 | 462 | 408 | 415 | 403 | 395 | 374 | 362 | 347 | 353 | 332 | 342 | 303 | 243 | 208 | 204 | 219 | 205 | 192 | 187 | 188 | 216 | 257 | 278 | 271 | 243 | 243 | 260 | 260 | 251 | 200 | 185 | 181 | 203 | 228 | 245 | 242 | 265 | 242 | 284 | 280 | 246 | 245 | 231 | 226 | 240 | 277 | 323 | 361 | 361 | 334 | 345 | 349 | 307 | 250 | 275 | 290 | 350 | 388 | 421 | 465 | 436 | 416 | 491 | 486 | 470 | 433 | 428 | 452 | 479 | 465 | 461 | |
Northwest Brooklyn | Brooklyn | Submarket | 1205 | 1233 | 1281 | 1328 | 1320 | 1242 | 1240 | 1328 | 1306 | 1224 | 1204 | 1238 | 1213 | 1299 | 1312 | 1284 | 1254 | 1172 | 1151 | 1216 | 1226 | 1127 | 1142 | 1158 | 1178 | 1212 | 1253 | 1259 | 1181 | 1068 | 1050 | 1047 | 997 | 956 | 954 | 956 | 992 | 1042 | 1054 | 1016 | 922 | 837 | 833 | 833 | 784 | 719 | 683 | 671 | 681 | 723 | 746 | 732 | 701 | 665 | 642 | 645 | 609 | 522 | 509 | 484 | 529 | 591 | 636 | 650 | 657 | 590 | 622 | 668 | 609 | 562 | 554 | 557 | 624 | 713 | 783 | 791 | 747 | 659 | 714 | 742 | 697 | 614 | 587 | 558 | 603 | 679 | 738 | 766 | 723 | 666 | 748 | 789 | 734 | 693 | 672 | 665 | 686 | 699 | 678 | |
East Brooklyn | Brooklyn | Submarket | 341 | 394 | 431 | 445 | 462 | 461 | 453 | 419 | 410 | 448 | 453 | 441 | 440 | 477 | 476 | 461 | 468 | 484 | 444 | 460 | 497 | 445 | 457 | 464 | 461 | 463 | 460 | 468 | 448 | 428 | 390 | 403 | 404 | 393 | 330 | 344 | 346 | 350 | 343 | 305 | 286 | 261 | 285 | 269 | 258 | 248 | 259 | 230 | 239 | 247 | 268 | 272 | 270 | 268 | 275 | 288 | 277 | 255 | 255 | 250 | 260 | 257 | 267 | 297 | 316 | 308 | 330 | 357 | 362 | 367 | 385 | 378 | 391 | 428 | 411 | 437 | 434 | 402 | 410 | 434 | 426 | 397 | 382 | 359 | 371 | 395 | 406 | 416 | 408 | 394 | 415 | 409 | 406 | 375 | 365 | 353 | 360 | 347 | 352 | |
Prospect Park | Brooklyn | Submarket | 597 | 639 | 708 | 732 | 719 | 686 | 699 | 685 | 657 | 639 | 641 | 665 | 697 | 728 | 684 | 691 | 666 | 588 | 591 | 586 | 569 | 512 | 531 | 533 | 617 | 647 | 681 | 720 | 693 | 597 | 614 | 598 | 568 | 515 | 501 | 481 | 537 | 560 | 583 | 559 | 518 | 471 | 474 | 471 | 434 | 396 | 376 | 370 | 388 | 449 | 534 | 550 | 495 | 422 | 418 | 394 | 355 | 327 | 308 | 299 | 339 | 371 | 420 | 420 | 433 | 351 | 393 | 388 | 359 | 326 | 318 | 308 | 324 | 400 | 450 | 471 | 463 | 387 | 409 | 424 | 429 | 398 | 362 | 339 | 378 | 419 | 439 | 459 | 418 | 370 | 441 | 457 | 448 | 437 | 402 | 388 | 387 | 410 | 430 | |
South Brooklyn | Brooklyn | Submarket | 565 | 579 | 1430 | 1567 | 1700 | 1837 | 1887 | 2022 | 2117 | 2139 | 2271 | 2370 | 2543 | 2702 | 2725 | 2853 | 2998 | 3068 | 1688 | 1721 | 1680 | 1671 | 1724 | 1722 | 1887 | 1900 | 1949 | 2001 | 1996 | 1986 | 1980 | 1980 | 1890 | 1808 | 1826 | 1798 | 1890 | 1903 | 1984 | 2002 | 1992 | 1921 | 1829 | 1742 | 1611 | 1542 | 1614 | 1532 | 1542 | 1589 | 1654 | 1679 | 1660 | 1582 | 1388 | 1466 | 1343 | 1271 | 1318 | 1292 | 1269 | 1180 | 1166 | 1875 | 1734 | 1701 | 1922 | 2017 | 1842 | 1788 | 1744 | 1702 | 1739 | 1824 | 1900 | 1984 | 1978 | 1845 | 1813 | 1764 | 1638 | 1487 | 1375 | 1218 | 1249 | 1331 | 1373 | 1400 | 1389 | 1306 | 1292 | 1350 | 1412 | 1286 | 1274 | 1262 | 1341 | 1371 | 1541 | |
Queens | Queens | Borough | 777 | 791 | 958 | 1008 | 1023 | 1174 | 1308 | 1262 | 1231 | 1183 | 1181 | 1298 | 1366 | 1464 | 1532 | 1607 | 1693 | 1618 | 1586 | 1602 | 1628 | 1543 | 1491 | 1512 | 1665 | 1772 | 1830 | 1861 | 2061 | 1805 | 1650 | 1621 | 1490 | 1398 | 1384 | 1369 | 1446 | 1401 | 1489 | 1526 | 1517 | 1501 | 1439 | 1462 | 1458 | 1450 | 1474 | 1463 | 1516 | 1538 | 1654 | 1577 | 1545 | 1556 | 1468 | 1460 | 1414 | 1333 | 1275 | 1233 | 1353 | 1451 | 1554 | 1682 | 1797 | 1799 | 1803 | 1801 | 1694 | 1586 | 1538 | 1465 | 1580 | 1617 | 1733 | 1867 | 1919 | 1832 | 1833 | 1821 | 1735 | 1590 | 1568 | 1543 | 1562 | 1657 | 1731 | 1824 | 1842 | 1868 | 1906 | 1950 | 1969 | 1732 | 1746 | 1782 | 1951 | 1934 | 1984 | |
Staten Island | Staten Island | Borough | 40 | 40 | 43 | 43 | 47 | 47 | 195 | 202 | 213 | 214 | 264 | 197 | 191 | 208 | 214 | 192 | 220 | 202 | 71 | 83 | 89 | 93 | 97 | 99 | 123 | 131 | 128 | 139 | 149 | 141 | 138 | 128 | 109 | 98 | 81 | 77 | 89 | 95 | 109 | 112 | 107 | 133 | 134 | 131 | 115 | 112 | 113 | 113 | 125 | 139 | 150 | 154 | 165 | 165 | 170 | 173 | 195 | 191 | 221 | 262 | 350 | 446 | 571 | 761 | 954 | 946 | 914 | 816 | 705 | 668 | 681 | 678 | 744 | 683 | 400 | 316 | 172 | 176 | 174 | 172 | 164 | 155 | 122 | 110 | 108 | 106 | 103 | 103 | 96 | 91 | 105 | 105 | 105 | 90 | 76 | 76 | 86 | 106 | 128 | |
Astoria | Queens | Neighborhood | 32 | 36 | 50 | 42 | 49 | 70 | 85 | 93 | 101 | 92 | 108 | 131 | 141 | 130 | 137 | 137 | 141 | 139 | 124 | 104 | 122 | 102 | 87 | 80 | 58 | 80 | 82 | 97 | 117 | 137 | 125 | 139 | 129 | 123 | 102 | 88 | 93 | 62 | 57 | 56 | 55 | 52 | 53 | 68 | 71 | 71 | 77 | 64 | 58 | 63 | 66 | 65 | 66 | 69 | 65 | 73 | 77 | 74 | 86 | 90 | 92 | 90 | 93 | 100 | 106 | 100 | 107 | 107 | 106 | 98 | 96 | 98 | 107 | 102 | 94 | 116 | 113 | 114 | 102 | 98 | 90 | 85 | 73 | 68 | 70 | 69 | 74 | 85 | 90 | 88 | 89 | 80 | 84 | 78 | 71 | 67 | 79 | 73 | 74 | |
Auburndale | Queens | Neighborhood | 0 | 0 | 0 | 1 | 1 | 3 | 3 | 8 | 7 | 7 | 7 | 6 | 5 | 5 | 4 | 6 | 4 | 3 | 3 | 3 | 2 | 3 | 2 | 1 | 2 | 2 | 2 | 3 | 5 | 6 | 5 | 4 | 2 | 3 | 3 | 3 | 3 | 2 | 4 | 5 | 8 | 9 | 7 | 7 | 7 | 6 | 4 | 4 | 4 | 4 | 6 | 6 | 7 | 6 | 5 | 2 | 0 | 0 | 1 | 1 | 2 | 2 | 3 | 6 | 6 | 7 | 9 | 10 | 9 | 6 | 6 | 5 | 6 | 6 | 6 | 6 | 5 | 7 | 5 | 5 | 6 | 4 | 5 | 5 | 4 | 4 | 5 | 5 | 4 | 4 | 5 | 5 | 7 | 7 | 9 | 10 | 10 | 11 | 12 | |
Bath Beach | Brooklyn | Neighborhood | 1 | 1 | 10 | 11 | 14 | 16 | 22 | 26 | 27 | 26 | 26 | 25 | 27 | 25 | 27 | 29 | 33 | 33 | 19 | 21 | 19 | 18 | 30 | 31 | 33 | 33 | 34 | 37 | 42 | 43 | 38 | 38 | 38 | 29 | 32 | 32 | 33 | 32 | 28 | 23 | 23 | 20 | 13 | 13 | 16 | 22 | 21 | 23 | 26 | 20 | 21 | 18 | 21 | 21 | 18 | 17 | 13 | 12 | 11 | 8 | 11 | 10 | 8 | 29 | 12 | 10 | 28 | 30 | 30 | 27 | 31 | 28 | 26 | 28 | 25 | 25 | 25 | 29 | 32 | 28 | 23 | 29 | 24 | 16 | 14 | 18 | 16 | 16 | 13 | 14 | 15 | 20 | 21 | 14 | 13 | 11 | 8 | 9 | 10 | |
Battery Park City | Manhattan | Neighborhood | 223 | 240 | 237 | 235 | 262 | 265 | 247 | 229 | 230 | 219 | 219 | 208 | 213 | 226 | 187 | 214 | 191 | 247 | 262 | 257 | 251 | 252 | 261 | 262 | 290 | 291 | 295 | 259 | 232 | 206 | 203 | 203 | 198 | 185 | 185 | 189 | 182 | 179 | 194 | 197 | 196 | 202 | 192 | 190 | 173 | 162 | 150 | 140 | 147 | 150 | 146 | 148 | 146 | 139 | 127 | 122 | 109 | 88 | 89 | 92 | 101 | 103 | 111 | 114 | 122 | 108 | 99 | 91 | 92 | 91 | 93 | 117 | 144 | 165 | 170 | 175 | 185 | 156 | 168 | 146 | 134 | 129 | 128 | 122 | 125 | 128 | 137 | 133 | 123 | 112 | 115 | 115 | 110 | 107 | 111 | 107 | 114 | 127 | 140 | |
Bay Ridge | Brooklyn | Neighborhood | 57 | 49 | 166 | 180 | 194 | 225 | 246 | 256 | 254 | 258 | 268 | 280 | 287 | 300 | 329 | 357 | 384 | 412 | 209 | 209 | 194 | 188 | 191 | 195 | 221 | 219 | 222 | 232 | 239 | 233 | 228 | 240 | 213 | 200 | 198 | 206 | 205 | 206 | 218 | 238 | 236 | 233 | 232 | 226 | 216 | 193 | 209 | 199 | 195 | 204 | 199 | 218 | 218 | 209 | 195 | 193 | 177 | 169 | 182 | 193 | 177 | 173 | 172 | 276 | 227 | 210 | 239 | 248 | 221 | 200 | 197 | 175 | 191 | 188 | 193 | 200 | 195 | 184 | 192 | 186 | 171 | 158 | 144 | 127 | 131 | 142 | 162 | 162 | 162 | 164 | 161 | 171 | 179 | 172 | 156 | 173 | 181 | 189 | 200 | |
Bayside | Queens | Neighborhood | 6 | 7 | 12 | 17 | 18 | 27 | 45 | 35 | 43 | 47 | 46 | 51 | 64 | 78 | 78 | 78 | 85 | 75 | 69 | 81 | 79 | 68 | 70 | 84 | 89 | 86 | 87 | 68 | 83 | 69 | 71 | 68 | 66 | 62 | 60 | 59 | 59 | 59 | 63 | 68 | 64 | 65 | 65 | 66 | 62 | 65 | 61 | 59 | 61 | 61 | 65 | 61 | 59 | 53 | 56 | 52 | 62 | 55 | 61 | 60 | 75 | 88 | 101 | 124 | 137 | 139 | 142 | 133 | 111 | 107 | 104 | 89 | 79 | 99 | 114 | 107 | 115 | 117 | 116 | 113 | 97 | 77 | 68 | 64 | 70 | 80 | 86 | 90 | 90 | 85 | 88 | 98 | 97 | 85 | 68 | 66 | 83 | 78 | 92 | |
Bedford Park | Bronx | Neighborhood | 3 | 4 | 5 | 5 | 4 | 4 | 2 | 2 | 3 | 3 | 3 | 2 | 1 | 10 | 12 | 10 | 11 | 14 | 13 | 4 | 4 | 5 | 5 | 5 | 4 | 6 | 5 | 5 | 5 | 4 | 4 | 3 | 2 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 2 | 2 | 2 | 3 | 3 | 4 | 3 | 5 | 6 | 14 | 31 | 22 | 44 | 39 | 23 | 19 | 16 | 13 | 10 | 10 | 9 | 9 | 8 | 2 | 2 | 2 | 1 | 2 | 4 | 6 | 6 | 8 | 9 | 10 | 10 | 10 | 9 | 8 | 7 | 3 | 1 | 1 | 1 | 2 | 4 | 4 | 4 | 5 | 6 | 5 | 8 | 8 | 7 | 6 | 6 | 10 | 9 | 8 | |
Bedford-Stuyvesant | Brooklyn | Neighborhood | 122 | 121 | 148 | 146 | 145 | 149 | 143 | 127 | 118 | 140 | 128 | 130 | 126 | 150 | 145 | 148 | 162 | 187 | 186 | 192 | 230 | 181 | 190 | 197 | 207 | 211 | 206 | 204 | 196 | 189 | 173 | 178 | 183 | 177 | 124 | 150 | 144 | 154 | 141 | 125 | 122 | 110 | 110 | 98 | 99 | 94 | 106 | 90 | 89 | 90 | 99 | 104 | 102 | 105 | 102 | 118 | 123 | 119 | 121 | 128 | 122 | 123 | 118 | 123 | 139 | 131 | 146 | 153 | 149 | 146 | 159 | 151 | 156 | 168 | 170 | 178 | 182 | 171 | 185 | 190 | 184 | 175 | 172 | 155 | 154 | 164 | 167 | 170 | 163 | 156 | 169 | 179 | 168 | 149 | 142 | 149 | 148 | 149 | 148 | |
Bellerose | Queens | Neighborhood | 1 | 1 | 4 | 5 | 5 | 53 | 56 | 49 | 44 | 48 | 40 | 37 | 39 | 38 | 38 | 39 | 40 | 39 | 44 | 43 | 45 | 37 | 33 | 31 | 29 | 30 | 31 | 33 | 49 | 37 | 40 | 32 | 32 | 30 | 32 | 36 | 44 | 47 | 48 | 44 | 40 | 43 | 41 | 34 | 29 | 29 | 22 | 20 | 21 | 25 | 33 | 31 | 30 | 25 | 26 | 29 | 28 | 27 | 25 | 21 | 25 | 25 | 32 | 36 | 39 | 44 | 41 | 34 | 34 | 30 | 33 | 16 | 17 | 19 | 26 | 27 | 28 | 29 | 31 | 30 | 28 | 22 | 27 | 23 | 24 | 23 | 29 | 32 | 33 | 38 | 33 | 24 | 17 | 11 | 12 | 10 | 14 | 15 | 16 | |
Belmont | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | |
Bensonhurst | Brooklyn | Neighborhood | 2 | 3 | 43 | 65 | 70 | 73 | 74 | 77 | 83 | 86 | 90 | 90 | 100 | 104 | 105 | 111 | 116 | 120 | 44 | 42 | 37 | 40 | 40 | 41 | 53 | 59 | 58 | 60 | 51 | 47 | 50 | 52 | 43 | 42 | 43 | 38 | 40 | 40 | 44 | 43 | 44 | 34 | 30 | 30 | 29 | 26 | 26 | 22 | 26 | 28 | 28 | 23 | 23 | 22 | 20 | 22 | 19 | 16 | 18 | 21 | 23 | 26 | 25 | 32 | 28 | 29 | 42 | 40 | 34 | 34 | 32 | 33 | 36 | 35 | 46 | 44 | 43 | 50 | 56 | 53 | 40 | 32 | 21 | 15 | 13 | 18 | 16 | 23 | 25 | 28 | 23 | 23 | 22 | 16 | 18 | 21 | 29 | 33 | 29 | |
Bergen Beach | Brooklyn | Neighborhood | 2 | 2 | 11 | 13 | 14 | 17 | 17 | 16 | 17 | 18 | 22 | 28 | 30 | 34 | 32 | 36 | 37 | 44 | 29 | 32 | 36 | 35 | 41 | 44 | 39 | 38 | 35 | 43 | 48 | 50 | 49 | 48 | 49 | 45 | 36 | 36 | 40 | 41 | 45 | 36 | 33 | 36 | 34 | 33 | 32 | 23 | 23 | 29 | 28 | 25 | 25 | 28 | 31 | 32 | 32 | 43 | 38 | 40 | 41 | 39 | 41 | 42 | 43 | 58 | 60 | 53 | 53 | 64 | 58 | 58 | 45 | 45 | 45 | 50 | 49 | 55 | 58 | 52 | 49 | 49 | 50 | 47 | 38 | 38 | 39 | 36 | 37 | 41 | 43 | 40 | 29 | 28 | 28 | 27 | 28 | 29 | 30 | 27 | 33 | |
Boerum Hill | Brooklyn | Neighborhood | 73 | 77 | 81 | 81 | 79 | 72 | 68 | 64 | 54 | 49 | 51 | 53 | 59 | 60 | 45 | 47 | 42 | 37 | 33 | 34 | 28 | 29 | 31 | 33 | 36 | 37 | 38 | 36 | 37 | 34 | 33 | 29 | 28 | 26 | 31 | 39 | 32 | 35 | 34 | 30 | 31 | 30 | 37 | 34 | 29 | 26 | 17 | 26 | 26 | 34 | 35 | 33 | 34 | 34 | 40 | 39 | 35 | 31 | 26 | 20 | 28 | 37 | 45 | 44 | 50 | 46 | 49 | 55 | 43 | 54 | 50 | 44 | 50 | 53 | 55 | 56 | 53 | 48 | 59 | 65 | 64 | 52 | 47 | 44 | 51 | 59 | 57 | 69 | 80 | 90 | 127 | 138 | 130 | 133 | 131 | 114 | 101 | 80 | 71 | |
Borough Park | Brooklyn | Neighborhood | 2 | 2 | 24 | 25 | 26 | 25 | 28 | 28 | 28 | 31 | 31 | 32 | 31 | 33 | 33 | 34 | 36 | 37 | 9 | 10 | 7 | 8 | 9 | 11 | 14 | 13 | 14 | 17 | 13 | 14 | 16 | 16 | 12 | 12 | 10 | 12 | 15 | 21 | 30 | 27 | 28 | 23 | 20 | 21 | 20 | 21 | 13 | 8 | 10 | 9 | 9 | 6 | 7 | 5 | 7 | 9 | 8 | 7 | 7 | 9 | 10 | 7 | 6 | 10 | 8 | 8 | 13 | 12 | 9 | 8 | 6 | 7 | 6 | 9 | 8 | 8 | 7 | 12 | 15 | 16 | 17 | 12 | 9 | 11 | 11 | 9 | 8 | 9 | 12 | 8 | 10 | 11 | 9 | 10 | 8 | 8 | 10 | 9 | 12 | |
Briarwood | Queens | Neighborhood | 5 | 6 | 10 | 12 | 13 | 17 | 19 | 19 | 16 | 15 | 15 | 41 | 43 | 43 | 43 | 46 | 59 | 63 | 61 | 63 | 50 | 45 | 40 | 41 | 56 | 62 | 60 | 58 | 59 | 49 | 45 | 44 | 37 | 39 | 40 | 31 | 32 | 32 | 35 | 39 | 36 | 37 | 32 | 39 | 37 | 41 | 45 | 47 | 57 | 58 | 58 | 58 | 59 | 63 | 54 | 54 | 49 | 46 | 42 | 38 | 42 | 43 | 49 | 51 | 53 | 48 | 48 | 45 | 39 | 36 | 34 | 36 | 37 | 38 | 43 | 47 | 49 | 44 | 45 | 45 | 47 | 40 | 39 | 41 | 39 | 33 | 35 | 34 | 39 | 39 | 41 | 40 | 39 | 37 | 33 | 30 | 30 | 29 | 27 | |
Brighton Beach | Brooklyn | Neighborhood | 119 | 119 | 195 | 208 | 228 | 243 | 152 | 164 | 191 | 195 | 224 | 237 | 259 | 271 | 267 | 287 | 293 | 297 | 115 | 109 | 112 | 108 | 101 | 95 | 105 | 118 | 114 | 123 | 122 | 122 | 116 | 107 | 103 | 106 | 112 | 111 | 113 | 118 | 120 | 119 | 121 | 126 | 124 | 117 | 111 | 106 | 122 | 120 | 124 | 136 | 134 | 138 | 128 | 125 | 103 | 105 | 91 | 93 | 92 | 78 | 61 | 48 | 43 | 124 | 112 | 125 | 135 | 139 | 113 | 113 | 101 | 100 | 104 | 124 | 109 | 132 | 149 | 142 | 141 | 131 | 109 | 110 | 95 | 67 | 79 | 75 | 88 | 90 | 94 | 90 | 91 | 98 | 119 | 95 | 94 | 95 | 92 | 95 | 124 | |
Bronxwood | Bronx | Neighborhood | 3 | 3 | 4 | 4 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 5 | 6 | 4 | 4 | 5 | 6 | 6 | 8 | 7 | 6 | 5 | 5 | 7 | 7 | 6 | 7 | 7 | 6 | 6 | 7 | 5 | 5 | 5 | 6 | 8 | 7 | 9 | 11 | 11 | 12 | 6 | 5 | 5 | 5 | 6 | 7 | 7 | 5 | 5 | 6 | 7 | 8 | 10 | 9 | 8 | 8 | 8 | 7 | 5 | 6 | 10 | 7 | 10 | 12 | 10 | 9 | 10 | 10 | 9 | 7 | 8 | 9 | 9 | 8 | 7 | 9 | 8 | 6 | 7 | 5 | 6 | 8 | 9 | 11 | 8 | 10 | 10 | 16 | 16 | 15 | 14 | 12 | 11 | 13 | 14 | 11 | 11 | |
Brooklyn Heights | Brooklyn | Neighborhood | 212 | 212 | 224 | 232 | 211 | 208 | 213 | 249 | 273 | 257 | 250 | 270 | 230 | 254 | 249 | 248 | 231 | 212 | 216 | 217 | 215 | 186 | 198 | 214 | 255 | 259 | 276 | 290 | 277 | 236 | 224 | 208 | 207 | 196 | 201 | 199 | 210 | 238 | 263 | 247 | 224 | 204 | 207 | 201 | 198 | 181 | 183 | 156 | 163 | 173 | 166 | 159 | 145 | 129 | 120 | 117 | 121 | 104 | 109 | 108 | 121 | 137 | 148 | 145 | 133 | 114 | 115 | 124 | 112 | 97 | 101 | 99 | 119 | 139 | 155 | 162 | 151 | 123 | 142 | 151 | 146 | 122 | 122 | 112 | 132 | 170 | 180 | 189 | 169 | 143 | 155 | 168 | 159 | 148 | 142 | 157 | 157 | 174 | 167 | |
Brownsville | Brooklyn | Neighborhood | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 2 | 3 | 5 | 7 | 10 | 12 | 14 | 14 | 14 | 14 | 16 | 17 | 18 | 20 | 21 | 21 | 19 | 19 | 18 | 22 | 17 | 21 | 19 | 16 | 13 | 13 | 13 | 13 | 14 | 13 | 11 | 12 | 15 | 16 | 14 | 12 | 13 | 14 | 12 | 10 | 11 | 8 | 7 | 5 | 5 | 9 | 9 | 8 | 12 | 16 | 17 | 19 | 23 | 20 | 20 | 20 | 19 | 17 | 17 | 13 | 11 | 14 | 11 | 9 | 6 | 5 | 6 | 7 | 11 | 9 | 8 | 9 | 9 | 9 | 10 | 12 | 13 | 13 | 8 | 9 | 9 | |
Bushwick | Brooklyn | Neighborhood | 50 | 53 | 65 | 60 | 57 | 51 | 50 | 51 | 52 | 50 | 51 | 36 | 35 | 51 | 48 | 51 | 51 | 52 | 54 | 58 | 58 | 56 | 57 | 56 | 52 | 49 | 47 | 49 | 54 | 54 | 50 | 52 | 49 | 47 | 40 | 44 | 40 | 42 | 42 | 38 | 32 | 31 | 33 | 35 | 34 | 33 | 28 | 21 | 21 | 19 | 19 | 20 | 19 | 19 | 20 | 19 | 17 | 13 | 15 | 15 | 19 | 19 | 23 | 26 | 31 | 34 | 35 | 36 | 40 | 43 | 56 | 56 | 55 | 58 | 54 | 53 | 64 | 64 | 53 | 51 | 55 | 46 | 49 | 40 | 43 | 48 | 57 | 54 | 59 | 60 | 68 | 70 | 65 | 60 | 54 | 48 | 51 | 38 | 40 | |
Canarsie | Brooklyn | Neighborhood | 3 | 5 | 26 | 30 | 34 | 37 | 51 | 52 | 54 | 62 | 67 | 68 | 88 | 94 | 100 | 110 | 108 | 104 | 62 | 62 | 59 | 58 | 57 | 67 | 66 | 64 | 67 | 70 | 67 | 70 | 80 | 85 | 80 | 83 | 88 | 77 | 81 | 76 | 77 | 71 | 70 | 70 | 69 | 61 | 54 | 51 | 55 | 50 | 52 | 61 | 61 | 63 | 66 | 65 | 43 | 51 | 51 | 54 | 53 | 47 | 51 | 49 | 54 | 84 | 81 | 88 | 87 | 100 | 107 | 111 | 117 | 138 | 151 | 143 | 146 | 143 | 137 | 117 | 113 | 105 | 100 | 92 | 85 | 70 | 74 | 64 | 68 | 64 | 59 | 60 | 59 | 58 | 59 | 54 | 54 | 51 | 57 | 53 | 61 | |
Carnegie Hill | Manhattan | Neighborhood | 312 | 352 | 359 | 362 | 338 | 315 | 314 | 310 | 290 | 268 | 282 | 293 | 315 | 347 | 348 | 344 | 309 | 278 | 270 | 287 | 281 | 254 | 260 | 271 | 295 | 306 | 314 | 309 | 275 | 233 | 249 | 277 | 272 | 256 | 267 | 278 | 301 | 306 | 310 | 287 | 279 | 260 | 266 | 276 | 254 | 240 | 247 | 277 | 296 | 312 | 321 | 306 | 273 | 235 | 237 | 250 | 238 | 214 | 217 | 213 | 217 | 226 | 236 | 231 | 219 | 195 | 198 | 217 | 200 | 193 | 195 | 203 | 222 | 244 | 260 | 249 | 236 | 200 | 212 | 205 | 194 | 181 | 180 | 190 | 212 | 241 | 250 | 252 | 238 | 213 | 238 | 262 | 250 | 237 | 254 | 262 | 259 | 278 | 285 | |
Carroll Gardens | Brooklyn | Neighborhood | 101 | 120 | 109 | 112 | 131 | 101 | 110 | 90 | 80 | 77 | 71 | 60 | 60 | 82 | 93 | 90 | 87 | 78 | 79 | 84 | 84 | 83 | 86 | 79 | 80 | 83 | 91 | 93 | 94 | 79 | 76 | 82 | 77 | 67 | 53 | 51 | 56 | 67 | 67 | 69 | 61 | 55 | 59 | 71 | 68 | 64 | 57 | 56 | 57 | 67 | 74 | 76 | 64 | 67 | 62 | 58 | 48 | 43 | 43 | 40 | 43 | 42 | 44 | 41 | 45 | 41 | 47 | 54 | 44 | 35 | 40 | 41 | 40 | 59 | 62 | 65 | 67 | 59 | 66 | 65 | 65 | 48 | 40 | 39 | 40 | 44 | 48 | 50 | 47 | 45 | 46 | 61 | 56 | 53 | 49 | 48 | 51 | 50 | 44 | |
Central Harlem | Manhattan | Neighborhood | 502 | 530 | 523 | 548 | 531 | 529 | 557 | 565 | 641 | 617 | 636 | 667 | 665 | 684 | 667 | 647 | 641 | 563 | 573 | 554 | 565 | 568 | 591 | 549 | 575 | 576 | 569 | 603 | 571 | 523 | 519 | 500 | 492 | 482 | 501 | 497 | 504 | 491 | 488 | 484 | 481 | 452 | 442 | 428 | 400 | 379 | 364 | 334 | 327 | 328 | 370 | 363 | 352 | 345 | 299 | 307 | 292 | 285 | 273 | 276 | 283 | 292 | 319 | 324 | 304 | 282 | 303 | 304 | 298 | 272 | 270 | 263 | 250 | 252 | 277 | 298 | 266 | 235 | 274 | 267 | 132 | 111 | 114 | 124 | 119 | 135 | 145 | 139 | 134 | 134 | 285 | 299 | 287 | 266 | 261 | 247 | 258 | 251 | 261 | |
Central Park South | Manhattan | Neighborhood | 129 | 137 | 141 | 140 | 127 | 127 | 125 | 121 | 124 | 123 | 122 | 126 | 133 | 128 | 132 | 126 | 120 | 115 | 110 | 107 | 97 | 92 | 85 | 84 | 88 | 96 | 98 | 99 | 95 | 95 | 103 | 105 | 109 | 102 | 93 | 98 | 110 | 111 | 117 | 119 | 115 | 116 | 114 | 110 | 93 | 89 | 77 | 79 | 88 | 87 | 86 | 87 | 82 | 77 | 70 | 69 | 70 | 61 | 63 | 60 | 68 | 77 | 77 | 72 | 74 | 79 | 78 | 72 | 75 | 79 | 82 | 86 | 85 | 88 | 86 | 84 | 85 | 87 | 91 | 93 | 84 | 80 | 87 | 100 | 107 | 101 | 119 | 115 | 112 | 98 | 99 | 102 | 91 | 96 | 90 | 94 | 99 | 98 | 106 | |
Chelsea | Manhattan | Neighborhood | 691 | 715 | 710 | 707 | 655 | 623 | 619 | 602 | 549 | 524 | 536 | 537 | 567 | 567 | 586 | 588 | 562 | 529 | 525 | 533 | 521 | 471 | 469 | 474 | 497 | 520 | 505 | 519 | 506 | 465 | 469 | 465 | 436 | 413 | 423 | 419 | 471 | 486 | 502 | 487 | 456 | 426 | 409 | 412 | 391 | 363 | 350 | 355 | 401 | 434 | 444 | 421 | 417 | 398 | 390 | 399 | 382 | 353 | 346 | 342 | 383 | 428 | 443 | 448 | 419 | 395 | 387 | 404 | 386 | 339 | 323 | 329 | 341 | 396 | 412 | 423 | 411 | 371 | 393 | 423 | 426 | 387 | 378 | 386 | 429 | 450 | 490 | 473 | 445 | 418 | 450 | 456 | 465 | 412 | 427 | 415 | 455 | 451 | 457 | |
Chinatown | Manhattan | Neighborhood | 14 | 16 | 19 | 21 | 21 | 20 | 18 | 18 | 20 | 17 | 17 | 17 | 19 | 18 | 15 | 18 | 17 | 19 | 15 | 13 | 10 | 11 | 12 | 18 | 20 | 24 | 19 | 18 | 17 | 13 | 11 | 6 | 6 | 5 | 5 | 12 | 21 | 18 | 18 | 21 | 21 | 21 | 20 | 21 | 20 | 21 | 16 | 12 | 14 | 21 | 19 | 21 | 22 | 23 | 21 | 22 | 17 | 11 | 10 | 10 | 11 | 10 | 11 | 9 | 11 | 12 | 12 | 9 | 9 | 11 | 8 | 7 | 6 | 4 | 4 | 4 | 5 | 4 | 8 | 6 | 8 | 12 | 13 | 10 | 10 | 9 | 10 | 14 | 17 | 18 | 8 | 8 | 8 | 8 | 9 | 8 | 8 | 7 | 6 | |
Civic Center | Manhattan | Neighborhood | 9 | 10 | 10 | 8 | 6 | 6 | 5 | 4 | 10 | 9 | 10 | 6 | 10 | 9 | 8 | 7 | 10 | 10 | 10 | 10 | 12 | 11 | 9 | 10 | 9 | 8 | 7 | 9 | 10 | 9 | 9 | 7 | 8 | 6 | 8 | 6 | 7 | 9 | 9 | 11 | 10 | 10 | 10 | 11 | 12 | 11 | 13 | 13 | 12 | 14 | 13 | 10 | 12 | 13 | 13 | 13 | 13 | 11 | 13 | 12 | 13 | 13 | 12 | 11 | 8 | 8 | 8 | 8 | 7 | 6 | 6 | 4 | 4 | 5 | 5 | 4 | 3 | 5 | 4 | 4 | 6 | 4 | 5 | 5 | 5 | 7 | 7 | 7 | 6 | 6 | 5 | 10 | 9 | 6 | 6 | 9 | 10 | 11 | 10 | |
Clinton Hill | Brooklyn | Neighborhood | 110 | 114 | 127 | 142 | 138 | 132 | 145 | 138 | 153 | 125 | 124 | 122 | 122 | 152 | 157 | 168 | 169 | 159 | 165 | 169 | 181 | 171 | 171 | 185 | 156 | 174 | 173 | 186 | 181 | 175 | 178 | 172 | 151 | 141 | 133 | 117 | 116 | 119 | 118 | 112 | 107 | 102 | 102 | 107 | 106 | 91 | 89 | 96 | 88 | 102 | 105 | 111 | 111 | 108 | 102 | 104 | 104 | 89 | 91 | 91 | 102 | 108 | 116 | 118 | 123 | 105 | 101 | 107 | 98 | 89 | 79 | 76 | 84 | 106 | 114 | 111 | 103 | 109 | 125 | 125 | 118 | 108 | 92 | 94 | 93 | 93 | 103 | 99 | 96 | 88 | 94 | 93 | 96 | 100 | 106 | 93 | 104 | 115 | 110 | |
Cobble Hill | Brooklyn | Neighborhood | 29 | 29 | 31 | 40 | 39 | 36 | 36 | 45 | 45 | 46 | 51 | 51 | 50 | 59 | 55 | 42 | 41 | 29 | 23 | 34 | 37 | 55 | 54 | 70 | 71 | 74 | 91 | 83 | 70 | 69 | 76 | 89 | 83 | 86 | 90 | 99 | 101 | 101 | 106 | 99 | 79 | 75 | 72 | 67 | 60 | 53 | 54 | 54 | 63 | 61 | 58 | 60 | 51 | 53 | 55 | 53 | 53 | 43 | 41 | 37 | 44 | 52 | 52 | 53 | 48 | 42 | 46 | 50 | 42 | 43 | 41 | 41 | 51 | 48 | 60 | 59 | 58 | 41 | 43 | 42 | 40 | 38 | 33 | 29 | 37 | 44 | 50 | 47 | 42 | 36 | 37 | 39 | 31 | 25 | 19 | 24 | 30 | 37 | 49 | |
College Point | Queens | Neighborhood | 24 | 24 | 36 | 36 | 37 | 37 | 39 | 37 | 37 | 37 | 34 | 35 | 38 | 42 | 38 | 36 | 45 | 44 | 42 | 37 | 40 | 34 | 33 | 36 | 38 | 38 | 40 | 41 | 42 | 39 | 16 | 15 | 15 | 11 | 16 | 18 | 19 | 15 | 15 | 17 | 15 | 12 | 12 | 11 | 8 | 8 | 8 | 7 | 8 | 8 | 8 | 7 | 4 | 4 | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 6 | 8 | 9 | 12 | 12 | 8 | 7 | 7 | 6 | 5 | 5 | 5 | 3 | 4 | 6 | 5 | 5 | 5 | 4 | 4 | 1 | 2 | 5 | 10 | 10 | 15 | 13 | 12 | 8 | 7 | 9 | 8 | 6 | 7 | 5 | 4 | 5 | |
Columbia Street Waterfront District | Brooklyn | Neighborhood | 7 | 9 | 12 | 15 | 17 | 15 | 16 | 16 | 14 | 11 | 12 | 12 | 13 | 20 | 27 | 26 | 33 | 38 | 35 | 59 | 55 | 54 | 60 | 58 | 52 | 50 | 50 | 44 | 38 | 37 | 38 | 24 | 23 | 25 | 27 | 30 | 30 | 30 | 32 | 35 | 26 | 25 | 37 | 36 | 32 | 32 | 31 | 25 | 20 | 19 | 21 | 21 | 23 | 18 | 25 | 33 | 27 | 24 | 27 | 21 | 23 | 28 | 30 | 29 | 26 | 23 | 21 | 21 | 21 | 12 | 14 | 19 | 23 | 23 | 22 | 22 | 19 | 19 | 24 | 23 | 25 | 22 | 27 | 22 | 16 | 22 | 24 | 21 | 17 | 15 | 19 | 20 | 17 | 13 | 11 | 8 | 16 | 18 | 24 | |
Concourse | Bronx | Neighborhood | 34 | 34 | 37 | 30 | 30 | 33 | 31 | 29 | 29 | 32 | 32 | 36 | 40 | 46 | 43 | 43 | 43 | 43 | 44 | 41 | 40 | 36 | 33 | 32 | 41 | 39 | 42 | 34 | 34 | 32 | 27 | 27 | 22 | 21 | 19 | 20 | 18 | 22 | 23 | 26 | 24 | 30 | 25 | 24 | 25 | 27 | 24 | 27 | 27 | 26 | 29 | 29 | 32 | 32 | 35 | 31 | 30 | 28 | 27 | 31 | 30 | 34 | 35 | 32 | 34 | 36 | 32 | 26 | 27 | 28 | 30 | 28 | 28 | 27 | 33 | 33 | 33 | 35 | 30 | 32 | 31 | 28 | 28 | 26 | 26 | 21 | 23 | 28 | 27 | 30 | 37 | 31 | 36 | 34 | 34 | 37 | 41 | 37 | 36 | |
Coney Island | Brooklyn | Neighborhood | 6 | 6 | 34 | 35 | 37 | 43 | 46 | 49 | 51 | 51 | 56 | 58 | 63 | 68 | 68 | 71 | 78 | 82 | 38 | 41 | 41 | 41 | 37 | 32 | 35 | 38 | 32 | 33 | 27 | 26 | 25 | 29 | 23 | 21 | 26 | 32 | 36 | 38 | 42 | 49 | 46 | 42 | 37 | 36 | 24 | 22 | 29 | 31 | 35 | 40 | 42 | 43 | 45 | 48 | 44 | 48 | 40 | 40 | 42 | 33 | 33 | 35 | 36 | 57 | 53 | 56 | 66 | 59 | 50 | 48 | 47 | 46 | 43 | 47 | 57 | 61 | 71 | 65 | 66 | 61 | 46 | 45 | 56 | 39 | 45 | 46 | 44 | 36 | 34 | 38 | 42 | 44 | 49 | 53 | 52 | 55 | 54 | 52 | 69 | |
Corona | Queens | Neighborhood | 0 | 0 | 3 | 4 | 4 | 10 | 12 | 8 | 8 | 7 | 7 | 6 | 8 | 9 | 10 | 12 | 11 | 11 | 13 | 16 | 18 | 20 | 20 | 17 | 20 | 15 | 14 | 15 | 20 | 17 | 14 | 13 | 11 | 10 | 11 | 11 | 13 | 12 | 12 | 11 | 10 | 10 | 11 | 10 | 12 | 15 | 15 | 13 | 14 | 15 | 20 | 19 | 17 | 17 | 15 | 15 | 14 | 14 | 13 | 12 | 11 | 15 | 16 | 11 | 12 | 11 | 11 | 12 | 10 | 11 | 11 | 11 | 12 | 13 | 15 | 14 | 13 | 7 | 9 | 10 | 10 | 11 | 14 | 11 | 10 | 8 | 7 | 8 | 6 | 6 | 10 | 12 | 17 | 13 | 16 | 16 | 18 | 17 | 14 | |
Crown Heights | Brooklyn | Neighborhood | 141 | 193 | 190 | 208 | 228 | 228 | 228 | 207 | 205 | 222 | 235 | 238 | 239 | 236 | 243 | 219 | 209 | 199 | 165 | 165 | 162 | 156 | 150 | 145 | 144 | 147 | 151 | 159 | 142 | 121 | 99 | 91 | 98 | 100 | 102 | 99 | 109 | 102 | 109 | 92 | 85 | 79 | 81 | 79 | 69 | 66 | 66 | 54 | 64 | 69 | 62 | 57 | 59 | 54 | 63 | 62 | 56 | 45 | 45 | 48 | 53 | 55 | 66 | 82 | 80 | 77 | 80 | 88 | 85 | 91 | 85 | 80 | 84 | 97 | 100 | 128 | 110 | 103 | 118 | 131 | 124 | 111 | 105 | 106 | 103 | 107 | 108 | 109 | 104 | 106 | 107 | 96 | 102 | 95 | 97 | 91 | 98 | 102 | 99 | |
Ditmas Park | Brooklyn | Neighborhood | 37 | 33 | 40 | 43 | 56 | 72 | 73 | 82 | 83 | 84 | 85 | 107 | 105 | 116 | 114 | 102 | 90 | 83 | 83 | 77 | 76 | 70 | 77 | 82 | 88 | 95 | 98 | 93 | 91 | 84 | 90 | 89 | 83 | 80 | 87 | 86 | 93 | 96 | 90 | 83 | 75 | 73 | 70 | 72 | 71 | 66 | 59 | 54 | 47 | 50 | 46 | 54 | 58 | 51 | 48 | 47 | 41 | 37 | 38 | 36 | 33 | 36 | 42 | 49 | 53 | 49 | 55 | 52 | 45 | 47 | 41 | 45 | 49 | 54 | 56 | 62 | 60 | 54 | 56 | 58 | 55 | 53 | 54 | 51 | 55 | 62 | 70 | 70 | 61 | 54 | 57 | 53 | 50 | 47 | 45 | 41 | 47 | 54 | 59 | |
Douglaston | Queens | Neighborhood | 0 | 0 | 1 | 1 | 1 | 2 | 6 | 6 | 8 | 9 | 8 | 8 | 9 | 7 | 5 | 6 | 8 | 10 | 10 | 11 | 10 | 10 | 10 | 8 | 8 | 7 | 9 | 9 | 14 | 13 | 12 | 9 | 6 | 5 | 5 | 9 | 8 | 10 | 12 | 14 | 12 | 12 | 16 | 16 | 17 | 18 | 17 | 15 | 15 | 16 | 19 | 20 | 18 | 22 | 21 | 22 | 20 | 18 | 22 | 18 | 20 | 22 | 20 | 22 | 19 | 20 | 16 | 15 | 12 | 11 | 11 | 5 | 5 | 5 | 6 | 8 | 10 | 9 | 15 | 11 | 11 | 9 | 9 | 10 | 9 | 9 | 9 | 13 | 9 | 11 | 10 | 12 | 13 | 9 | 9 | 10 | 12 | 15 | 11 | |
Downtown Brooklyn | Brooklyn | Neighborhood | 330 | 323 | 323 | 328 | 325 | 285 | 285 | 299 | 269 | 253 | 259 | 264 | 263 | 272 | 305 | 306 | 304 | 309 | 301 | 304 | 302 | 254 | 260 | 255 | 273 | 269 | 262 | 251 | 235 | 197 | 191 | 187 | 176 | 171 | 176 | 169 | 174 | 169 | 168 | 166 | 153 | 133 | 126 | 126 | 117 | 119 | 108 | 106 | 108 | 104 | 115 | 101 | 103 | 97 | 93 | 90 | 81 | 66 | 66 | 64 | 68 | 66 | 85 | 87 | 103 | 90 | 99 | 101 | 104 | 91 | 99 | 99 | 119 | 130 | 131 | 133 | 114 | 98 | 83 | 96 | 90 | 83 | 93 | 81 | 95 | 99 | 101 | 109 | 105 | 97 | 99 | 91 | 87 | 68 | 65 | 67 | 71 | 74 | 67 | |
DUMBO | Brooklyn | Neighborhood | 69 | 82 | 90 | 87 | 80 | 78 | 74 | 85 | 80 | 80 | 78 | 76 | 83 | 87 | 89 | 87 | 85 | 73 | 80 | 77 | 87 | 82 | 79 | 80 | 81 | 95 | 101 | 116 | 99 | 95 | 106 | 134 | 135 | 132 | 134 | 140 | 154 | 162 | 151 | 149 | 132 | 96 | 87 | 86 | 78 | 70 | 65 | 78 | 75 | 81 | 89 | 92 | 84 | 73 | 67 | 72 | 74 | 66 | 53 | 56 | 57 | 56 | 56 | 68 | 64 | 67 | 75 | 78 | 74 | 76 | 73 | 80 | 73 | 82 | 96 | 98 | 100 | 88 | 84 | 87 | 70 | 73 | 70 | 78 | 85 | 89 | 100 | 100 | 92 | 84 | 93 | 98 | 87 | 90 | 90 | 90 | 89 | 83 | 80 | |
Dyker Heights | Brooklyn | Neighborhood | 5 | 7 | 24 | 24 | 24 | 24 | 26 | 27 | 26 | 27 | 28 | 29 | 31 | 33 | 26 | 26 | 33 | 32 | 18 | 22 | 24 | 25 | 25 | 27 | 33 | 40 | 39 | 37 | 37 | 43 | 38 | 35 | 29 | 23 | 24 | 16 | 19 | 19 | 17 | 20 | 20 | 17 | 16 | 17 | 15 | 11 | 9 | 8 | 12 | 14 | 15 | 13 | 13 | 11 | 12 | 12 | 11 | 11 | 17 | 15 | 18 | 14 | 17 | 26 | 20 | 21 | 35 | 35 | 32 | 24 | 20 | 22 | 29 | 40 | 44 | 46 | 49 | 45 | 40 | 37 | 37 | 31 | 27 | 24 | 22 | 36 | 35 | 42 | 42 | 41 | 39 | 46 | 49 | 39 | 38 | 35 | 31 | 29 | 36 | |
East Elmhurst | Queens | Neighborhood | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 | 3 | 3 | 3 | 3 | 4 | 2 | 2 | 3 | 3 | 2 | 3 | 2 | 2 | 4 | 2 | 4 | 4 | 6 | 5 | 5 | 6 | 5 | 5 | 8 | 8 | 7 | 7 | 6 | 7 | 8 | 11 | 9 | 10 | 9 | 6 | 3 | 4 | 4 | 5 | 8 | 5 | 9 | 12 | 7 | 10 | 8 | 9 | 8 | 8 | 13 | 13 | 15 | 16 | 12 | 9 | 8 | 8 | 6 | 8 | 7 | 2 | 2 | 3 | 3 | 4 | 3 | 4 | 4 | 7 | 6 | 5 | 5 | 8 | 9 | 9 | 9 | |
East Flushing | Queens | Neighborhood | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 1 | 1 | 3 | 4 | 6 | 5 | 4 | 5 | 8 | 9 | 7 | 8 | 6 | 6 | 9 | 7 | 8 | 12 | 12 | 12 | 13 | 14 | 12 | 12 | 11 | 11 | 10 | 11 | 9 | 9 | 9 | 9 | 9 | 7 | 7 | 7 | 7 | 8 | 8 | 9 | 4 | 5 | 4 | 4 | 4 | 0 | 2 | 4 | 3 | 4 | 4 | 4 | 4 | 5 | 6 | 6 | 6 | 6 | 8 | 12 | 14 | 13 | 13 | 13 | 14 | 6 | 7 | 7 | 6 | 7 | 7 | 8 | 8 | 8 | 8 | 10 | 9 | 10 | 13 | 14 | 12 | 11 | 12 | 9 | 10 | 3 | 1 | 3 | 3 | 3 | 3 | 2 | |
East Harlem | Manhattan | Neighborhood | 132 | 136 | 131 | 108 | 101 | 97 | 91 | 94 | 89 | 102 | 84 | 86 | 92 | 99 | 110 | 106 | 108 | 105 | 104 | 105 | 103 | 115 | 114 | 112 | 117 | 116 | 127 | 116 | 110 | 115 | 108 | 109 | 105 | 102 | 102 | 91 | 90 | 96 | 96 | 89 | 76 | 80 | 85 | 96 | 86 | 116 | 116 | 108 | 101 | 99 | 102 | 98 | 90 | 89 | 81 | 70 | 55 | 56 | 54 | 58 | 65 | 62 | 66 | 62 | 63 | 68 | 68 | 68 | 61 | 51 | 46 | 46 | 40 | 41 | 50 | 54 | 55 | 57 | 66 | 76 | 81 | 75 | 84 | 117 | 110 | 112 | 136 | 109 | 95 | 86 | 80 | 69 | 79 | 66 | 63 | 56 | 71 | 62 | 54 | |
East New York | Brooklyn | Neighborhood | 27 | 27 | 28 | 31 | 32 | 33 | 32 | 34 | 35 | 35 | 38 | 36 | 39 | 39 | 39 | 42 | 44 | 45 | 37 | 42 | 42 | 45 | 50 | 54 | 44 | 42 | 42 | 42 | 40 | 47 | 50 | 62 | 53 | 48 | 45 | 32 | 35 | 30 | 34 | 29 | 28 | 25 | 48 | 44 | 43 | 42 | 45 | 52 | 54 | 57 | 73 | 75 | 76 | 78 | 77 | 75 | 69 | 68 | 63 | 51 | 59 | 55 | 55 | 57 | 57 | 58 | 57 | 64 | 71 | 68 | 62 | 71 | 76 | 85 | 68 | 61 | 61 | 51 | 43 | 48 | 52 | 56 | 50 | 53 | 65 | 69 | 63 | 74 | 74 | 63 | 62 | 55 | 61 | 59 | 59 | 52 | 55 | 49 | 56 | |
East Tremont | Bronx | Neighborhood | 10 | 10 | 10 | 10 | 9 | 9 | 9 | 9 | 9 | 9 | 8 | 8 | 8 | 8 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | 2 | 1 | 1 | 1 | 1 | 0 | 0 | 9 | 10 | 11 | 11 | 11 | 8 | 13 | 12 | 13 | 13 | 13 | 12 | 13 | 12 | 13 | 10 | 8 | 7 | 7 | 6 | 6 | 6 | 6 | 2 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 1 | 1 | 3 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 3 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | 3 | 3 | 2 | 4 | 2 | 3 | |
East Village | Manhattan | Neighborhood | 196 | 214 | 217 | 214 | 214 | 214 | 219 | 222 | 202 | 195 | 200 | 206 | 212 | 229 | 212 | 224 | 206 | 208 | 197 | 184 | 188 | 189 | 184 | 190 | 193 | 198 | 212 | 211 | 191 | 164 | 167 | 173 | 161 | 150 | 141 | 146 | 158 | 169 | 174 | 174 | 159 | 146 | 135 | 132 | 123 | 108 | 107 | 116 | 128 | 163 | 164 | 182 | 186 | 172 | 184 | 179 | 157 | 149 | 134 | 131 | 145 | 151 | 167 | 169 | 163 | 162 | 160 | 169 | 155 | 132 | 115 | 117 | 127 | 146 | 163 | 169 | 172 | 149 | 149 | 143 | 137 | 122 | 130 | 124 | 167 | 205 | 208 | 206 | 191 | 196 | 206 | 202 | 196 | 185 | 185 | 180 | 202 | 207 | 187 | |
Elmhurst | Queens | Neighborhood | 11 | 10 | 15 | 15 | 13 | 16 | 16 | 14 | 11 | 12 | 10 | 9 | 9 | 10 | 11 | 22 | 24 | 25 | 24 | 26 | 33 | 25 | 25 | 26 | 33 | 28 | 27 | 20 | 23 | 24 | 23 | 22 | 22 | 19 | 18 | 18 | 21 | 29 | 30 | 29 | 28 | 34 | 25 | 25 | 23 | 22 | 24 | 24 | 19 | 18 | 21 | 21 | 18 | 21 | 23 | 19 | 20 | 25 | 24 | 21 | 22 | 23 | 24 | 26 | 31 | 29 | 27 | 23 | 43 | 28 | 16 | 18 | 17 | 15 | 29 | 42 | 31 | 36 | 42 | 45 | 43 | 42 | 40 | 42 | 37 | 36 | 33 | 37 | 34 | 29 | 30 | 38 | 29 | 31 | 31 | 29 | 32 | 28 | 41 | |
Far Rockaway | Queens | Neighborhood | 27 | 25 | 26 | 28 | 25 | 25 | 25 | 16 | 19 | 17 | 21 | 20 | 21 | 24 | 18 | 19 | 26 | 27 | 28 | 26 | 28 | 20 | 20 | 19 | 19 | 16 | 15 | 14 | 13 | 11 | 10 | 9 | 5 | 5 | 4 | 5 | 6 | 8 | 8 | 9 | 5 | 5 | 6 | 5 | 5 | 5 | 5 | 7 | 8 | 11 | 12 | 12 | 12 | 12 | 10 | 7 | 6 | 6 | 6 | 2 | 4 | 5 | 5 | 7 | 8 | 8 | 11 | 12 | 14 | 12 | 13 | 13 | 12 | 11 | 12 | 10 | 10 | 8 | 8 | 6 | 5 | 4 | 3 | 2 | 3 | 4 | 4 | 4 | 4 | 3 | 2 | 2 | 3 | 3 | 5 | 6 | 8 | 8 | 10 | |
Financial District | Manhattan | Neighborhood | 583 | 602 | 619 | 573 | 584 | 553 | 516 | 515 | 509 | 512 | 527 | 520 | 537 | 497 | 454 | 428 | 448 | 437 | 443 | 439 | 415 | 410 | 415 | 403 | 438 | 455 | 457 | 466 | 468 | 402 | 394 | 408 | 402 | 386 | 365 | 374 | 383 | 382 | 391 | 386 | 398 | 372 | 386 | 373 | 355 | 331 | 327 | 336 | 361 | 368 | 392 | 386 | 370 | 328 | 303 | 310 | 306 | 292 | 305 | 298 | 316 | 322 | 331 | 305 | 315 | 319 | 327 | 370 | 348 | 305 | 304 | 315 | 338 | 368 | 352 | 353 | 364 | 320 | 327 | 334 | 336 | 287 | 272 | 314 | 346 | 365 | 401 | 386 | 377 | 402 | 412 | 453 | 450 | 427 | 422 | 422 | 437 | 429 | 427 | |
Flatbush | Brooklyn | Neighborhood | 47 | 46 | 62 | 64 | 61 | 64 | 74 | 100 | 107 | 106 | 117 | 124 | 149 | 159 | 159 | 171 | 185 | 177 | 135 | 127 | 129 | 113 | 134 | 126 | 123 | 125 | 131 | 132 | 125 | 115 | 92 | 96 | 93 | 74 | 71 | 71 | 69 | 63 | 66 | 62 | 62 | 63 | 68 | 64 | 74 | 68 | 69 | 64 | 61 | 62 | 69 | 65 | 62 | 57 | 51 | 58 | 53 | 46 | 49 | 45 | 45 | 42 | 43 | 57 | 55 | 57 | 62 | 63 | 58 | 56 | 56 | 55 | 58 | 63 | 75 | 76 | 83 | 76 | 68 | 62 | 65 | 48 | 70 | 75 | 78 | 86 | 81 | 84 | 78 | 73 | 78 | 82 | 71 | 70 | 59 | 55 | 60 | 66 | 71 | |
Flatiron | Manhattan | Neighborhood | 374 | 390 | 389 | 427 | 386 | 328 | 315 | 315 | 323 | 270 | 271 | 273 | 278 | 273 | 266 | 275 | 267 | 243 | 245 | 261 | 256 | 240 | 243 | 258 | 282 | 265 | 256 | 229 | 216 | 209 | 208 | 210 | 212 | 192 | 189 | 194 | 219 | 231 | 232 | 230 | 216 | 206 | 201 | 193 | 183 | 171 | 168 | 183 | 234 | 274 | 267 | 288 | 291 | 276 | 291 | 286 | 255 | 242 | 245 | 231 | 248 | 253 | 266 | 265 | 256 | 227 | 239 | 240 | 226 | 191 | 186 | 184 | 190 | 221 | 238 | 251 | 235 | 224 | 251 | 262 | 268 | 252 | 252 | 259 | 284 | 295 | 320 | 321 | 318 | 305 | 339 | 337 | 332 | 316 | 289 | 272 | 296 | 297 | 289 | |
Flatlands | Brooklyn | Neighborhood | 2 | 2 | 8 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 6 | 7 | 7 | 12 | 13 | 15 | 18 | 24 | 24 | 26 | 24 | 26 | 27 | 30 | 30 | 28 | 28 | 32 | 34 | 41 | 43 | 41 | 35 | 39 | 43 | 36 | 38 | 35 | 34 | 33 | 29 | 30 | 27 | 23 | 23 | 22 | 25 | 27 | 28 | 25 | 23 | 26 | 23 | 29 | 20 | 27 | 25 | 24 | 25 | 26 | 21 | 22 | 22 | 31 | 35 | 35 | 42 | 53 | 47 | 53 | 52 | 50 | 57 | 58 | 56 | 61 | 64 | 62 | 60 | 62 | 57 | 53 | 45 | 40 | 45 | 46 | 44 | 37 | 41 | 40 | 34 | 25 | 23 | 18 | 18 | 15 | 19 | 18 | 22 | |
Flushing | Queens | Neighborhood | 29 | 33 | 44 | 64 | 51 | 55 | 57 | 59 | 58 | 56 | 55 | 53 | 60 | 102 | 122 | 95 | 99 | 87 | 86 | 88 | 100 | 97 | 94 | 95 | 98 | 90 | 92 | 85 | 83 | 69 | 60 | 71 | 70 | 67 | 63 | 80 | 81 | 88 | 116 | 118 | 121 | 109 | 103 | 83 | 128 | 125 | 115 | 140 | 143 | 133 | 131 | 112 | 93 | 81 | 56 | 50 | 53 | 53 | 43 | 45 | 44 | 46 | 43 | 53 | 56 | 60 | 52 | 52 | 47 | 41 | 40 | 30 | 54 | 57 | 64 | 83 | 68 | 72 | 68 | 66 | 65 | 51 | 90 | 90 | 57 | 50 | 49 | 29 | 30 | 88 | 100 | 100 | 101 | 68 | 98 | 124 | 144 | 142 | 146 | |
Fordham | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 3 | 4 | 4 | 5 | 5 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 3 | 4 | 5 | 6 | 7 | 7 | 6 | 4 | 4 | 3 | 4 | 6 | 7 | 7 | 7 | 9 | 9 | 9 | 9 | 10 | 8 | 6 | 5 | 5 | 5 | 5 | 4 | 5 | 4 | 4 | 3 | 3 | 3 | 2 | 2 | 2 | 3 | 3 | 1 | 2 | 2 | 2 | 3 | 3 | 3 | 5 | 5 | 6 | 4 | 4 | 4 | 2 | 2 | 2 | 3 | 4 | 4 | 3 | 4 | 4 | 5 | 6 | 5 | 4 | 4 | 4 | 4 | 5 | 5 | 5 | |
Forest Hills | Queens | Neighborhood | 58 | 55 | 61 | 68 | 75 | 77 | 79 | 75 | 75 | 69 | 69 | 71 | 73 | 84 | 118 | 141 | 148 | 137 | 145 | 136 | 139 | 147 | 165 | 175 | 203 | 219 | 237 | 259 | 258 | 202 | 196 | 193 | 184 | 176 | 173 | 178 | 187 | 187 | 196 | 215 | 226 | 221 | 224 | 241 | 225 | 215 | 224 | 217 | 227 | 239 | 243 | 248 | 253 | 251 | 251 | 264 | 256 | 240 | 238 | 249 | 279 | 304 | 313 | 316 | 331 | 330 | 330 | 362 | 334 | 307 | 291 | 295 | 313 | 302 | 300 | 319 | 336 | 285 | 291 | 297 | 289 | 264 | 246 | 245 | 266 | 276 | 314 | 351 | 345 | 335 | 344 | 335 | 337 | 314 | 320 | 322 | 344 | 342 | 353 | |
Fort Greene | Brooklyn | Neighborhood | 161 | 156 | 175 | 168 | 179 | 169 | 147 | 187 | 189 | 179 | 150 | 143 | 142 | 140 | 124 | 115 | 108 | 111 | 111 | 131 | 141 | 121 | 116 | 107 | 101 | 105 | 107 | 98 | 91 | 92 | 76 | 74 | 70 | 68 | 66 | 72 | 75 | 76 | 79 | 77 | 78 | 91 | 86 | 86 | 82 | 73 | 69 | 62 | 66 | 69 | 65 | 61 | 65 | 66 | 55 | 55 | 49 | 43 | 41 | 33 | 29 | 44 | 42 | 46 | 48 | 44 | 45 | 49 | 47 | 44 | 37 | 39 | 45 | 55 | 71 | 70 | 67 | 61 | 71 | 67 | 55 | 46 | 45 | 42 | 37 | 41 | 56 | 56 | 52 | 47 | 57 | 63 | 53 | 47 | 48 | 51 | 47 | 47 | 46 | |
Fresh Meadows | Queens | Neighborhood | 2 | 2 | 3 | 3 | 6 | 8 | 9 | 8 | 8 | 5 | 3 | 5 | 5 | 8 | 8 | 9 | 13 | 13 | 16 | 18 | 15 | 9 | 9 | 8 | 10 | 8 | 9 | 8 | 6 | 3 | 3 | 3 | 2 | 2 | 2 | 3 | 4 | 3 | 3 | 2 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 | 3 | 3 | 1 | 2 | 4 | 4 | 4 | 6 | 5 | 5 | 5 | 5 | 8 | 11 | 8 | 7 | 7 | 8 | 7 | 8 | 4 | 3 | 4 | 6 | 7 | 8 | 8 | 11 | 9 | 4 | 4 | 4 | 4 | 5 | 6 | 8 | 9 | 10 | 12 | 17 | 15 | 16 | 13 | 12 | 12 | 14 | 15 | 19 | |
Glen Oaks Village | Queens | Neighborhood | 3 | 3 | 4 | 2 | 2 | 3 | 3 | 4 | 3 | 4 | 4 | 3 | 3 | 4 | 4 | 6 | 6 | 7 | 8 | 10 | 7 | 6 | 7 | 7 | 6 | 6 | 6 | 6 | 13 | 11 | 13 | 14 | 14 | 13 | 14 | 11 | 9 | 6 | 5 | 6 | 6 | 7 | 7 | 7 | 7 | 9 | 9 | 7 | 6 | 4 | 7 | 7 | 7 | 8 | 6 | 5 | 5 | 3 | 5 | 3 | 3 | 3 | 2 | 2 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 10 | 20 | 20 | 24 | 24 | 23 | 22 | 19 | 17 | 18 | 14 | 12 | 12 | 12 | 19 | 27 | 35 | 31 | 29 | 22 | 26 | 23 | 17 | 14 | 17 | 20 | 26 | 26 | |
Glendale | Queens | Neighborhood | 0 | 0 | 0 | 1 | 1 | 2 | 2 | 3 | 3 | 3 | 2 | 2 | 3 | 4 | 3 | 3 | 5 | 3 | 4 | 4 | 4 | 5 | 5 | 4 | 10 | 10 | 11 | 13 | 13 | 5 | 4 | 4 | 4 | 6 | 5 | 3 | 1 | 3 | 3 | 4 | 3 | 3 | 2 | 2 | 3 | 2 | 2 | 2 | 2 | 2 | 4 | 2 | 3 | 3 | 3 | 3 | 2 | 4 | 3 | 5 | 7 | 8 | 9 | 9 | 10 | 11 | 10 | 10 | 9 | 8 | 4 | 4 | 6 | 7 | 11 | 13 | 14 | 12 | 12 | 11 | 9 | 6 | 6 | 6 | 7 | 13 | 11 | 13 | 14 | 8 | 9 | 7 | 7 | 7 | 8 | 8 | 11 | 9 | 13 | |
Gowanus | Brooklyn | Neighborhood | 102 | 99 | 98 | 112 | 111 | 136 | 139 | 140 | 136 | 135 | 149 | 153 | 163 | 163 | 159 | 148 | 147 | 123 | 102 | 96 | 86 | 82 | 77 | 73 | 68 | 60 | 57 | 55 | 52 | 48 | 47 | 42 | 39 | 34 | 34 | 25 | 27 | 27 | 22 | 18 | 16 | 13 | 7 | 8 | 6 | 5 | 5 | 5 | 9 | 6 | 10 | 10 | 11 | 11 | 12 | 14 | 12 | 10 | 9 | 13 | 13 | 18 | 15 | 17 | 15 | 14 | 15 | 17 | 19 | 17 | 15 | 15 | 18 | 15 | 13 | 11 | 11 | 8 | 10 | 13 | 14 | 13 | 10 | 10 | 10 | 11 | 12 | 18 | 14 | 11 | 9 | 8 | 10 | 8 | 3 | 5 | 10 | 11 | 8 | |
Gramercy Park | Manhattan | Neighborhood | 241 | 243 | 252 | 260 | 253 | 236 | 233 | 228 | 212 | 198 | 202 | 218 | 228 | 227 | 229 | 240 | 239 | 215 | 200 | 219 | 214 | 207 | 208 | 227 | 250 | 255 | 256 | 262 | 256 | 223 | 230 | 234 | 227 | 211 | 216 | 229 | 235 | 248 | 235 | 237 | 216 | 194 | 184 | 178 | 163 | 161 | 157 | 161 | 175 | 203 | 230 | 228 | 226 | 211 | 203 | 215 | 191 | 187 | 197 | 182 | 204 | 205 | 215 | 226 | 202 | 174 | 182 | 180 | 157 | 145 | 152 | 154 | 155 | 178 | 176 | 167 | 156 | 141 | 132 | 131 | 117 | 120 | 130 | 137 | 155 | 186 | 195 | 206 | 203 | 184 | 203 | 216 | 209 | 185 | 187 | 196 | 223 | 216 | 211 | |
Gravesend | Brooklyn | Neighborhood | 13 | 13 | 102 | 105 | 111 | 117 | 123 | 144 | 157 | 161 | 167 | 183 | 192 | 205 | 214 | 217 | 228 | 244 | 106 | 106 | 101 | 109 | 111 | 107 | 123 | 123 | 120 | 119 | 115 | 124 | 127 | 114 | 109 | 110 | 113 | 113 | 111 | 116 | 112 | 116 | 125 | 116 | 111 | 103 | 90 | 102 | 130 | 106 | 113 | 120 | 122 | 137 | 122 | 107 | 99 | 98 | 96 | 93 | 99 | 100 | 94 | 87 | 78 | 139 | 129 | 118 | 155 | 172 | 146 | 138 | 129 | 108 | 103 | 106 | 101 | 109 | 103 | 86 | 78 | 77 | 72 | 64 | 56 | 47 | 52 | 64 | 57 | 67 | 61 | 58 | 59 | 67 | 60 | 52 | 61 | 56 | 52 | 48 | 54 | |
Greenpoint | Brooklyn | Neighborhood | 178 | 175 | 121 | 128 | 122 | 79 | 102 | 132 | 120 | 112 | 116 | 123 | 137 | 170 | 149 | 146 | 135 | 156 | 159 | 161 | 175 | 161 | 157 | 129 | 123 | 113 | 103 | 100 | 116 | 106 | 111 | 100 | 94 | 89 | 78 | 67 | 76 | 69 | 68 | 57 | 47 | 45 | 43 | 42 | 40 | 39 | 39 | 40 | 44 | 48 | 55 | 59 | 49 | 60 | 56 | 66 | 66 | 56 | 49 | 43 | 43 | 51 | 49 | 52 | 61 | 57 | 52 | 48 | 39 | 36 | 41 | 42 | 37 | 42 | 51 | 55 | 53 | 53 | 48 | 51 | 41 | 36 | 31 | 31 | 45 | 61 | 65 | 84 | 74 | 75 | 102 | 104 | 109 | 109 | 121 | 124 | 122 | 96 | 88 | |
Greenwich Village | Manhattan | Neighborhood | 403 | 442 | 451 | 456 | 432 | 407 | 435 | 443 | 429 | 382 | 381 | 393 | 409 | 418 | 395 | 399 | 381 | 340 | 332 | 334 | 305 | 280 | 296 | 295 | 316 | 327 | 335 | 332 | 331 | 292 | 314 | 311 | 322 | 292 | 280 | 299 | 336 | 366 | 384 | 388 | 360 | 348 | 340 | 322 | 303 | 274 | 269 | 288 | 299 | 341 | 351 | 346 | 349 | 306 | 283 | 280 | 283 | 275 | 262 | 272 | 294 | 324 | 347 | 340 | 327 | 296 | 310 | 316 | 302 | 284 | 284 | 321 | 331 | 356 | 360 | 363 | 353 | 315 | 345 | 366 | 363 | 338 | 338 | 349 | 373 | 376 | 376 | 364 | 377 | 343 | 339 | 342 | 321 | 282 | 279 | 272 | 310 | 326 | 321 | |
Greenwood | Brooklyn | Neighborhood | 42 | 40 | 46 | 55 | 69 | 66 | 77 | 74 | 81 | 71 | 69 | 63 | 73 | 81 | 65 | 59 | 59 | 49 | 41 | 38 | 56 | 54 | 54 | 55 | 62 | 61 | 62 | 59 | 57 | 54 | 57 | 51 | 50 | 48 | 44 | 43 | 47 | 38 | 37 | 38 | 39 | 38 | 28 | 29 | 25 | 25 | 21 | 18 | 21 | 23 | 23 | 22 | 23 | 19 | 23 | 23 | 24 | 21 | 20 | 13 | 10 | 13 | 23 | 28 | 28 | 24 | 23 | 20 | 17 | 14 | 12 | 17 | 19 | 28 | 33 | 42 | 39 | 42 | 45 | 43 | 45 | 43 | 36 | 34 | 35 | 39 | 32 | 31 | 30 | 25 | 33 | 34 | 40 | 30 | 30 | 34 | 40 | 35 | 30 | |
Hamilton Heights | Manhattan | Neighborhood | 94 | 103 | 123 | 131 | 134 | 126 | 132 | 131 | 130 | 133 | 116 | 115 | 118 | 116 | 113 | 105 | 98 | 96 | 100 | 100 | 99 | 90 | 94 | 94 | 90 | 95 | 92 | 92 | 105 | 88 | 95 | 90 | 85 | 81 | 74 | 74 | 76 | 84 | 93 | 89 | 84 | 86 | 88 | 81 | 76 | 77 | 77 | 72 | 73 | 75 | 82 | 86 | 75 | 75 | 76 | 71 | 70 | 68 | 71 | 72 | 80 | 89 | 100 | 103 | 112 | 110 | 108 | 109 | 109 | 106 | 108 | 103 | 93 | 90 | 72 | 71 | 65 | 70 | 75 | 73 | 73 | 67 | 59 | 53 | 55 | 62 | 60 | 56 | 54 | 44 | 49 | 54 | 52 | 50 | 61 | 62 | 69 | 74 | 78 | |
Highbridge | Bronx | Neighborhood | 3 | 3 | 3 | 3 | 2 | 1 | 1 | 2 | 2 | 3 | 3 | 3 | 3 | 2 | 2 | 1 | 1 | 1 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 4 | 5 | 5 | 5 | 5 | 5 | 5 | 2 | 2 | 3 | 4 | 6 | 7 | 6 | 6 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 4 | 4 | 5 | 4 | 4 | 2 | 2 | 3 | 2 | 2 | 2 | 2 | 3 | 3 | 2 | 1 | 1 | 4 | 4 | 4 | 6 | 6 | 6 | 6 | 9 | 5 | 6 | 4 | 5 | 7 | 7 | 7 | 6 | 6 | 8 | 9 | 8 | 11 | 9 | 8 | 10 | 9 | 10 | 15 | 14 | 13 | 18 | 15 | 15 | 13 | 15 | |
Howard Beach | Queens | Neighborhood | 25 | 23 | 25 | 24 | 65 | 53 | 58 | 61 | 54 | 47 | 45 | 52 | 55 | 62 | 62 | 57 | 60 | 60 | 57 | 57 | 59 | 58 | 70 | 77 | 80 | 91 | 107 | 100 | 119 | 99 | 75 | 52 | 37 | 19 | 15 | 15 | 16 | 15 | 14 | 20 | 17 | 17 | 17 | 20 | 20 | 19 | 18 | 17 | 17 | 16 | 16 | 14 | 14 | 11 | 11 | 18 | 17 | 15 | 12 | 10 | 13 | 14 | 12 | 18 | 18 | 21 | 22 | 24 | 18 | 18 | 17 | 17 | 18 | 21 | 17 | 18 | 16 | 19 | 20 | 21 | 20 | 20 | 20 | 22 | 16 | 17 | 19 | 19 | 18 | 17 | 19 | 23 | 27 | 26 | 27 | 31 | 34 | 31 | 33 | |
Inwood | Manhattan | Neighborhood | 42 | 49 | 54 | 59 | 63 | 63 | 65 | 69 | 64 | 63 | 70 | 63 | 64 | 68 | 68 | 65 | 70 | 71 | 72 | 73 | 71 | 66 | 72 | 78 | 88 | 85 | 94 | 93 | 95 | 85 | 96 | 88 | 85 | 83 | 77 | 79 | 84 | 89 | 83 | 87 | 82 | 86 | 81 | 75 | 75 | 75 | 69 | 66 | 69 | 70 | 75 | 75 | 78 | 78 | 82 | 76 | 71 | 64 | 57 | 52 | 58 | 62 | 64 | 67 | 73 | 67 | 65 | 63 | 58 | 54 | 45 | 43 | 40 | 53 | 60 | 64 | 60 | 58 | 61 | 60 | 55 | 53 | 53 | 53 | 51 | 46 | 39 | 40 | 42 | 41 | 44 | 34 | 34 | 33 | 25 | 23 | 31 | 35 | 30 | |
Jackson Heights | Queens | Neighborhood | 27 | 23 | 30 | 32 | 29 | 35 | 42 | 43 | 47 | 50 | 56 | 58 | 59 | 73 | 72 | 73 | 77 | 74 | 72 | 86 | 87 | 77 | 70 | 71 | 73 | 82 | 89 | 93 | 123 | 109 | 104 | 102 | 94 | 85 | 91 | 87 | 101 | 102 | 114 | 120 | 125 | 132 | 135 | 137 | 120 | 115 | 109 | 113 | 117 | 122 | 142 | 139 | 127 | 139 | 136 | 135 | 123 | 118 | 106 | 97 | 109 | 111 | 118 | 116 | 114 | 111 | 112 | 121 | 112 | 103 | 109 | 99 | 98 | 94 | 105 | 107 | 113 | 108 | 111 | 115 | 113 | 110 | 109 | 104 | 111 | 126 | 126 | 131 | 133 | 136 | 142 | 157 | 158 | 142 | 136 | 130 | 137 | 139 | 131 | |
Jamaica | Queens | Neighborhood | 1 | 1 | 8 | 9 | 8 | 10 | 10 | 13 | 15 | 17 | 14 | 58 | 56 | 10 | 13 | 17 | 21 | 20 | 19 | 20 | 16 | 14 | 11 | 10 | 15 | 14 | 14 | 20 | 18 | 22 | 23 | 24 | 22 | 25 | 24 | 23 | 17 | 17 | 15 | 17 | 13 | 11 | 9 | 12 | 10 | 13 | 13 | 12 | 13 | 13 | 15 | 13 | 16 | 17 | 17 | 18 | 19 | 21 | 17 | 14 | 12 | 11 | 13 | 11 | 13 | 15 | 14 | 12 | 14 | 14 | 16 | 17 | 15 | 14 | 15 | 17 | 18 | 11 | 9 | 5 | 4 | 4 | 4 | 3 | 3 | 4 | 5 | 4 | 4 | 5 | 4 | 3 | 5 | 4 | 5 | 6 | 9 | 9 | 9 | |
Jamaica Estates | Queens | Neighborhood | 1 | 1 | 0 | 0 | 0 | 1 | 2 | 1 | 2 | 2 | 3 | 3 | 3 | 17 | 14 | 22 | 19 | 25 | 20 | 23 | 25 | 22 | 22 | 23 | 25 | 24 | 24 | 22 | 27 | 15 | 13 | 11 | 6 | 8 | 7 | 8 | 9 | 9 | 12 | 12 | 10 | 13 | 13 | 12 | 13 | 14 | 14 | 17 | 16 | 13 | 9 | 10 | 8 | 9 | 10 | 9 | 10 | 12 | 11 | 12 | 14 | 13 | 13 | 14 | 15 | 13 | 9 | 11 | 10 | 14 | 11 | 8 | 8 | 7 | 10 | 10 | 7 | 8 | 11 | 16 | 18 | 17 | 11 | 12 | 15 | 15 | 15 | 21 | 18 | 18 | 17 | 19 | 19 | 17 | 17 | 16 | 24 | 23 | 25 | |
Kensington | Brooklyn | Neighborhood | 58 | 69 | 99 | 100 | 109 | 110 | 112 | 99 | 100 | 101 | 100 | 100 | 106 | 117 | 118 | 123 | 113 | 109 | 84 | 85 | 87 | 86 | 82 | 78 | 90 | 88 | 94 | 93 | 107 | 111 | 106 | 99 | 99 | 88 | 88 | 79 | 83 | 100 | 97 | 106 | 99 | 98 | 83 | 83 | 78 | 73 | 69 | 71 | 67 | 79 | 80 | 77 | 72 | 68 | 63 | 62 | 66 | 57 | 48 | 46 | 45 | 57 | 61 | 73 | 70 | 61 | 66 | 72 | 77 | 70 | 65 | 61 | 64 | 78 | 99 | 95 | 90 | 88 | 86 | 80 | 80 | 71 | 65 | 69 | 69 | 65 | 83 | 89 | 85 | 78 | 76 | 65 | 63 | 60 | 53 | 57 | 63 | 70 | 76 | |
Kew Gardens | Queens | Neighborhood | 11 | 10 | 19 | 21 | 21 | 21 | 22 | 22 | 23 | 24 | 31 | 32 | 32 | 35 | 37 | 37 | 41 | 50 | 39 | 33 | 37 | 36 | 40 | 44 | 53 | 58 | 69 | 63 | 75 | 58 | 52 | 49 | 46 | 37 | 37 | 34 | 38 | 43 | 43 | 45 | 47 | 39 | 35 | 37 | 37 | 34 | 43 | 45 | 57 | 58 | 60 | 57 | 54 | 56 | 58 | 62 | 59 | 58 | 58 | 59 | 57 | 62 | 69 | 73 | 85 | 90 | 91 | 94 | 100 | 94 | 81 | 88 | 88 | 86 | 93 | 95 | 94 | 92 | 93 | 93 | 90 | 91 | 97 | 96 | 93 | 76 | 77 | 83 | 81 | 78 | 76 | 68 | 66 | 60 | 60 | 57 | 58 | 64 | 60 | |
Kew Gardens Hills | Queens | Neighborhood | 8 | 8 | 14 | 18 | 16 | 16 | 30 | 27 | 29 | 27 | 26 | 27 | 29 | 34 | 30 | 29 | 31 | 31 | 28 | 28 | 30 | 30 | 33 | 32 | 31 | 27 | 31 | 31 | 33 | 33 | 31 | 30 | 29 | 27 | 27 | 27 | 25 | 23 | 21 | 19 | 21 | 23 | 18 | 14 | 13 | 12 | 11 | 12 | 15 | 17 | 15 | 16 | 17 | 17 | 16 | 15 | 16 | 16 | 17 | 18 | 20 | 22 | 23 | 27 | 32 | 37 | 39 | 35 | 35 | 32 | 32 | 35 | 40 | 44 | 42 | 45 | 52 | 49 | 44 | 42 | 41 | 35 | 32 | 39 | 48 | 51 | 50 | 50 | 56 | 47 | 49 | 43 | 47 | 39 | 36 | 35 | 34 | 30 | 39 | |
Kingsbridge | Bronx | Neighborhood | 13 | 12 | 14 | 14 | 13 | 13 | 13 | 11 | 11 | 10 | 8 | 11 | 12 | 16 | 19 | 20 | 20 | 19 | 23 | 21 | 21 | 21 | 18 | 18 | 24 | 19 | 22 | 24 | 24 | 20 | 19 | 17 | 18 | 16 | 15 | 17 | 19 | 20 | 22 | 23 | 23 | 23 | 26 | 23 | 20 | 20 | 21 | 18 | 23 | 24 | 26 | 26 | 26 | 23 | 23 | 25 | 23 | 21 | 23 | 23 | 23 | 23 | 22 | 22 | 20 | 24 | 21 | 25 | 22 | 22 | 22 | 23 | 26 | 23 | 20 | 24 | 22 | 23 | 25 | 25 | 19 | 16 | 22 | 18 | 17 | 16 | 13 | 13 | 16 | 18 | 21 | 23 | 25 | 27 | 25 | 27 | 29 | 30 | 25 | |
Kips Bay | Manhattan | Neighborhood | 223 | 227 | 228 | 235 | 239 | 231 | 235 | 251 | 207 | 202 | 194 | 208 | 225 | 231 | 228 | 223 | 218 | 193 | 195 | 187 | 184 | 177 | 166 | 172 | 183 | 182 | 187 | 212 | 226 | 203 | 205 | 217 | 199 | 183 | 190 | 180 | 178 | 165 | 166 | 158 | 146 | 143 | 135 | 123 | 113 | 98 | 109 | 126 | 144 | 161 | 175 | 164 | 162 | 142 | 142 | 156 | 146 | 126 | 135 | 136 | 140 | 149 | 159 | 161 | 154 | 133 | 131 | 136 | 128 | 121 | 108 | 99 | 101 | 112 | 117 | 128 | 120 | 112 | 120 | 114 | 95 | 84 | 84 | 86 | 97 | 100 | 112 | 112 | 112 | 106 | 117 | 109 | 105 | 96 | 92 | 88 | 98 | 106 | 112 | |
Lenox Hill | Manhattan | Neighborhood | 783 | 841 | 861 | 882 | 868 | 820 | 846 | 845 | 807 | 771 | 783 | 809 | 861 | 862 | 844 | 849 | 827 | 776 | 768 | 772 | 784 | 748 | 719 | 725 | 780 | 800 | 819 | 798 | 757 | 670 | 681 | 691 | 678 | 656 | 684 | 670 | 723 | 731 | 736 | 725 | 690 | 666 | 664 | 653 | 645 | 605 | 615 | 618 | 617 | 641 | 648 | 645 | 591 | 547 | 579 | 622 | 577 | 562 | 572 | 599 | 650 | 684 | 702 | 702 | 684 | 634 | 666 | 691 | 656 | 633 | 630 | 638 | 673 | 710 | 723 | 734 | 721 | 682 | 691 | 747 | 712 | 677 | 660 | 680 | 721 | 759 | 776 | 776 | 754 | 691 | 710 | 694 | 670 | 639 | 653 | 674 | 722 | 753 | 738 | |
Lincoln Square | Manhattan | Neighborhood | 852 | 905 | 916 | 910 | 884 | 861 | 832 | 827 | 780 | 750 | 738 | 721 | 752 | 762 | 779 | 767 | 753 | 727 | 715 | 731 | 688 | 670 | 678 | 698 | 755 | 774 | 783 | 801 | 751 | 656 | 662 | 668 | 662 | 618 | 609 | 628 | 668 | 671 | 690 | 685 | 613 | 570 | 555 | 550 | 516 | 454 | 427 | 429 | 478 | 532 | 562 | 574 | 559 | 508 | 489 | 500 | 477 | 433 | 481 | 498 | 515 | 534 | 582 | 558 | 553 | 504 | 514 | 501 | 485 | 452 | 446 | 474 | 503 | 536 | 539 | 550 | 530 | 521 | 544 | 526 | 476 | 420 | 401 | 427 | 483 | 545 | 556 | 567 | 555 | 526 | 521 | 560 | 543 | 478 | 487 | 489 | 514 | 571 | 593 | |
Little Italy | Manhattan | Neighborhood | 14 | 13 | 13 | 13 | 11 | 11 | 11 | 11 | 9 | 9 | 8 | 8 | 7 | 7 | 11 | 11 | 9 | 12 | 11 | 11 | 10 | 10 | 9 | 11 | 13 | 16 | 18 | 19 | 17 | 14 | 14 | 13 | 13 | 9 | 8 | 10 | 11 | 12 | 14 | 14 | 17 | 18 | 21 | 18 | 17 | 13 | 12 | 12 | 16 | 17 | 13 | 14 | 13 | 13 | 16 | 17 | 12 | 11 | 12 | 13 | 12 | 12 | 10 | 9 | 10 | 7 | 6 | 10 | 17 | 16 | 7 | 12 | 15 | 13 | 14 | 15 | 15 | 14 | 15 | 15 | 15 | 16 | 17 | 17 | 19 | 18 | 22 | 29 | 12 | 11 | 11 | 12 | 11 | 11 | 11 | 12 | 12 | 9 | 12 | |
Little Neck | Queens | Neighborhood | 1 | 1 | 7 | 11 | 15 | 36 | 42 | 44 | 44 | 45 | 37 | 33 | 32 | 37 | 39 | 37 | 36 | 28 | 26 | 32 | 32 | 29 | 29 | 25 | 23 | 26 | 27 | 30 | 43 | 34 | 29 | 27 | 23 | 21 | 25 | 22 | 19 | 24 | 24 | 24 | 27 | 26 | 26 | 27 | 28 | 28 | 26 | 26 | 25 | 25 | 42 | 34 | 31 | 32 | 34 | 37 | 34 | 30 | 24 | 20 | 22 | 20 | 29 | 29 | 31 | 35 | 39 | 32 | 31 | 31 | 29 | 28 | 35 | 36 | 40 | 42 | 48 | 48 | 42 | 37 | 37 | 42 | 46 | 47 | 46 | 51 | 50 | 44 | 46 | 43 | 44 | 40 | 40 | 30 | 29 | 27 | 30 | 29 | 30 | |
Long Island City | Queens | Neighborhood | 341 | 357 | 352 | 344 | 306 | 300 | 279 | 243 | 231 | 211 | 197 | 201 | 195 | 204 | 243 | 264 | 256 | 239 | 249 | 249 | 270 | 240 | 197 | 204 | 204 | 252 | 243 | 252 | 254 | 252 | 252 | 254 | 216 | 212 | 232 | 224 | 248 | 218 | 220 | 216 | 206 | 201 | 167 | 155 | 154 | 136 | 145 | 146 | 150 | 161 | 159 | 158 | 153 | 145 | 134 | 126 | 107 | 94 | 92 | 88 | 100 | 117 | 119 | 125 | 131 | 114 | 114 | 117 | 103 | 95 | 96 | 93 | 108 | 118 | 119 | 149 | 136 | 146 | 165 | 165 | 153 | 152 | 161 | 152 | 153 | 164 | 158 | 163 | 154 | 150 | 150 | 192 | 215 | 166 | 164 | 180 | 203 | 207 | 185 | |
Lower East Side | Manhattan | Neighborhood | 154 | 149 | 159 | 163 | 155 | 153 | 151 | 157 | 159 | 156 | 141 | 149 | 164 | 161 | 213 | 234 | 212 | 204 | 195 | 201 | 191 | 162 | 158 | 156 | 161 | 180 | 175 | 189 | 171 | 182 | 185 | 182 | 169 | 160 | 163 | 157 | 164 | 171 | 172 | 173 | 226 | 211 | 215 | 141 | 134 | 127 | 127 | 126 | 124 | 144 | 140 | 134 | 133 | 127 | 116 | 113 | 103 | 96 | 92 | 89 | 101 | 106 | 114 | 108 | 102 | 94 | 97 | 112 | 96 | 83 | 76 | 84 | 84 | 107 | 111 | 109 | 100 | 104 | 115 | 104 | 100 | 82 | 88 | 98 | 98 | 107 | 110 | 116 | 120 | 117 | 157 | 151 | 182 | 153 | 160 | 156 | 175 | 196 | 182 | |
Manhattan Valley | Manhattan | Neighborhood | 105 | 108 | 103 | 106 | 106 | 103 | 98 | 97 | 94 | 88 | 86 | 80 | 87 | 90 | 96 | 97 | 98 | 91 | 92 | 96 | 93 | 80 | 73 | 73 | 85 | 84 | 81 | 84 | 87 | 74 | 79 | 78 | 78 | 66 | 69 | 68 | 76 | 74 | 79 | 79 | 74 | 61 | 61 | 63 | 62 | 57 | 49 | 51 | 57 | 65 | 69 | 70 | 59 | 57 | 56 | 50 | 45 | 44 | 43 | 39 | 45 | 64 | 77 | 83 | 83 | 75 | 74 | 75 | 67 | 62 | 57 | 54 | 59 | 60 | 54 | 62 | 55 | 50 | 52 | 48 | 43 | 40 | 43 | 44 | 53 | 55 | 58 | 60 | 53 | 50 | 48 | 47 | 46 | 48 | 49 | 41 | 45 | 41 | 44 | |
Manhattanville | Manhattan | Neighborhood | 8 | 8 | 9 | 9 | 9 | 1 | 1 | 1 | 1 | 2 | 3 | 3 | 4 | 4 | 4 | 3 | 3 | 3 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | |
Marble Hill | Manhattan | Neighborhood | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Marine Park | Brooklyn | Neighborhood | 3 | 4 | 4 | 5 | 4 | 3 | 4 | 5 | 5 | 5 | 5 | 9 | 10 | 10 | 10 | 10 | 15 | 13 | 14 | 21 | 23 | 21 | 23 | 27 | 32 | 30 | 35 | 39 | 45 | 43 | 52 | 55 | 51 | 44 | 39 | 36 | 40 | 38 | 39 | 42 | 45 | 46 | 50 | 48 | 45 | 38 | 36 | 27 | 24 | 24 | 29 | 30 | 26 | 26 | 23 | 26 | 22 | 18 | 19 | 17 | 20 | 15 | 13 | 18 | 20 | 22 | 28 | 27 | 27 | 25 | 31 | 33 | 30 | 34 | 38 | 35 | 37 | 42 | 42 | 52 | 49 | 47 | 45 | 37 | 34 | 34 | 34 | 34 | 27 | 24 | 27 | 27 | 26 | 20 | 25 | 27 | 30 | 36 | 40 | |
Maspeth | Queens | Neighborhood | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 2 | 3 | 3 | 5 | 4 | 4 | 4 | 3 | 4 | 4 | 3 | 11 | 5 | 5 | 3 | 2 | 2 | 2 | 2 | 2 | 6 | 7 | 8 | 8 | 9 | 4 | 3 | 5 | 8 | 10 | 7 | 7 | 6 | 6 | 7 | 6 | 4 | 4 | 3 | 3 | 3 | 3 | 2 | 2 | 3 | 3 | 1 | 2 | 4 | 4 | 4 | 5 | 3 | 5 | 8 | 2 | 2 | 3 | 6 | 6 | 6 | 4 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 3 | |
Melrose | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Middle Village | Queens | Neighborhood | 0 | 1 | 1 | 2 | 2 | 5 | 7 | 3 | 3 | 4 | 6 | 7 | 7 | 7 | 3 | 3 | 3 | 3 | 2 | 3 | 3 | 3 | 3 | 3 | 6 | 9 | 8 | 8 | 7 | 3 | 3 | 4 | 6 | 7 | 7 | 8 | 5 | 6 | 5 | 5 | 7 | 5 | 5 | 7 | 7 | 7 | 5 | 5 | 6 | 5 | 4 | 4 | 4 | 6 | 6 | 4 | 3 | 6 | 5 | 6 | 7 | 12 | 16 | 17 | 19 | 19 | 14 | 13 | 11 | 10 | 10 | 8 | 12 | 11 | 11 | 15 | 20 | 16 | 17 | 16 | 17 | 14 | 13 | 15 | 16 | 16 | 20 | 18 | 16 | 22 | 23 | 25 | 24 | 23 | 22 | 19 | 18 | 14 | 17 | |
Midtown | Manhattan | Neighborhood | 354 | 372 | 392 | 401 | 394 | 379 | 379 | 381 | 371 | 362 | 349 | 350 | 355 | 357 | 351 | 328 | 317 | 315 | 311 | 324 | 293 | 264 | 259 | 264 | 283 | 283 | 272 | 261 | 260 | 249 | 254 | 249 | 246 | 237 | 254 | 282 | 306 | 307 | 338 | 343 | 348 | 331 | 328 | 324 | 307 | 296 | 303 | 301 | 331 | 338 | 336 | 287 | 281 | 257 | 252 | 247 | 227 | 222 | 229 | 238 | 266 | 284 | 294 | 284 | 300 | 283 | 322 | 326 | 302 | 299 | 296 | 301 | 305 | 321 | 330 | 330 | 323 | 313 | 335 | 366 | 350 | 350 | 372 | 356 | 362 | 406 | 403 | 397 | 380 | 351 | 376 | 370 | 359 | 355 | 363 | 365 | 387 | 395 | 390 | |
Midtown South | Manhattan | Neighborhood | 165 | 156 | 150 | 146 | 150 | 139 | 139 | 142 | 140 | 131 | 135 | 130 | 157 | 149 | 149 | 163 | 162 | 161 | 151 | 142 | 133 | 120 | 121 | 117 | 122 | 120 | 155 | 142 | 138 | 141 | 147 | 144 | 146 | 155 | 183 | 181 | 158 | 155 | 144 | 145 | 129 | 129 | 126 | 123 | 127 | 124 | 110 | 110 | 110 | 109 | 99 | 96 | 93 | 94 | 96 | 99 | 104 | 88 | 79 | 87 | 92 | 94 | 102 | 102 | 101 | 95 | 92 | 105 | 97 | 99 | 90 | 88 | 93 | 107 | 115 | 116 | 113 | 102 | 106 | 101 | 109 | 104 | 105 | 110 | 121 | 113 | 122 | 128 | 131 | 124 | 137 | 131 | 126 | 124 | 120 | 124 | 113 | 123 | 121 | |
Midtown West | Manhattan | Neighborhood | 598 | 633 | 637 | 626 | 616 | 588 | 562 | 582 | 563 | 532 | 523 | 562 | 624 | 653 | 639 | 637 | 609 | 597 | 590 | 573 | 544 | 514 | 513 | 508 | 513 | 516 | 520 | 498 | 492 | 470 | 461 | 445 | 434 | 413 | 423 | 419 | 431 | 426 | 414 | 410 | 383 | 363 | 334 | 343 | 327 | 302 | 289 | 279 | 291 | 318 | 331 | 313 | 310 | 309 | 295 | 308 | 269 | 241 | 237 | 256 | 280 | 297 | 319 | 325 | 321 | 318 | 341 | 331 | 339 | 324 | 327 | 327 | 368 | 393 | 396 | 426 | 389 | 350 | 365 | 380 | 355 | 350 | 326 | 394 | 423 | 0 | 0 | 0 | 0 | 0 | 402 | 417 | 404 | 394 | 427 | 414 | 452 | 428 | 419 | |
Midwood | Brooklyn | Neighborhood | 22 | 18 | 62 | 77 | 86 | 95 | 101 | 116 | 121 | 120 | 128 | 132 | 146 | 149 | 151 | 160 | 170 | 173 | 70 | 79 | 72 | 82 | 78 | 74 | 80 | 80 | 77 | 86 | 85 | 79 | 78 | 79 | 72 | 68 | 69 | 77 | 84 | 90 | 95 | 92 | 94 | 89 | 93 | 87 | 70 | 61 | 58 | 57 | 61 | 62 | 73 | 70 | 64 | 57 | 47 | 50 | 45 | 45 | 44 | 46 | 52 | 49 | 46 | 61 | 68 | 63 | 73 | 74 | 60 | 57 | 56 | 55 | 57 | 67 | 72 | 76 | 83 | 79 | 72 | 71 | 66 | 59 | 61 | 52 | 59 | 56 | 59 | 60 | 72 | 58 | 53 | 55 | 56 | 50 | 52 | 45 | 59 | 70 | 78 | |
Mill Basin | Brooklyn | Neighborhood | 2 | 2 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 23 | 24 | 25 | 26 | 9 | 10 | 10 | 9 | 9 | 9 | 10 | 12 | 14 | 15 | 14 | 14 | 20 | 22 | 22 | 21 | 23 | 27 | 27 | 28 | 23 | 23 | 23 | 22 | 27 | 28 | 27 | 28 | 22 | 20 | 18 | 16 | 15 | 15 | 21 | 19 | 21 | 19 | 18 | 20 | 22 | 31 | 31 | 29 | 31 | 35 | 40 | 37 | 38 | 40 | 44 | 44 | 44 | 46 | 47 | 49 | 50 | 48 | 49 | 56 | 58 | 53 | 55 | 51 | 53 | 56 | 54 | 44 | 47 | 51 | 49 | 58 | 56 | 59 | 57 | 53 | 36 | 35 | 33 | 29 | 32 | 27 | 26 | 26 | 34 | |
Morningside Heights | Manhattan | Neighborhood | 63 | 68 | 69 | 70 | 65 | 72 | 70 | 75 | 81 | 75 | 72 | 76 | 81 | 93 | 95 | 97 | 87 | 84 | 89 | 91 | 86 | 76 | 77 | 83 | 101 | 101 | 105 | 101 | 108 | 94 | 90 | 89 | 89 | 86 | 85 | 84 | 88 | 96 | 96 | 90 | 90 | 90 | 87 | 69 | 68 | 66 | 66 | 62 | 69 | 73 | 87 | 87 | 83 | 75 | 69 | 65 | 51 | 48 | 56 | 64 | 70 | 74 | 85 | 85 | 79 | 72 | 65 | 64 | 61 | 55 | 47 | 48 | 55 | 62 | 64 | 69 | 73 | 65 | 74 | 64 | 60 | 56 | 52 | 56 | 69 | 76 | 85 | 82 | 83 | 78 | 74 | 65 | 59 | 55 | 49 | 48 | 45 | 45 | 46 | |
Morris Heights | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 6 | 6 | 6 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | |
Mott Haven | Bronx | Neighborhood | 5 | 5 | 3 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 0 | 1 | 1 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 2 | 0 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 2 | 2 | 1 | 1 | 1 | 0 | 0 | |
Murray Hill | Manhattan | Neighborhood | 425 | 417 | 434 | 445 | 418 | 417 | 420 | 421 | 418 | 380 | 377 | 383 | 398 | 423 | 436 | 410 | 382 | 362 | 368 | 381 | 373 | 356 | 369 | 397 | 429 | 429 | 449 | 428 | 409 | 379 | 371 | 374 | 372 | 347 | 353 | 350 | 377 | 390 | 415 | 408 | 404 | 396 | 358 | 352 | 344 | 330 | 327 | 342 | 372 | 409 | 408 | 402 | 386 | 360 | 357 | 348 | 313 | 290 | 285 | 282 | 308 | 297 | 311 | 314 | 302 | 284 | 285 | 307 | 287 | 266 | 260 | 259 | 293 | 322 | 318 | 309 | 288 | 273 | 267 | 279 | 277 | 268 | 269 | 298 | 288 | 305 | 314 | 327 | 312 | 293 | 308 | 313 | 303 | 289 | 286 | 294 | 306 | 349 | 346 | |
Murray Hill (Queens) | Queens | Neighborhood | 0 | 0 | 5 | 8 | 8 | 15 | 17 | 18 | 17 | 17 | 16 | 15 | 18 | 16 | 10 | 11 | 13 | 13 | 13 | 16 | 14 | 19 | 15 | 18 | 21 | 21 | 20 | 23 | 28 | 19 | 18 | 18 | 15 | 13 | 11 | 10 | 10 | 9 | 8 | 7 | 9 | 9 | 14 | 12 | 12 | 12 | 10 | 7 | 6 | 7 | 5 | 4 | 2 | 2 | 3 | 4 | 4 | 6 | 6 | 6 | 8 | 7 | 6 | 8 | 7 | 8 | 6 | 5 | 4 | 3 | 3 | 4 | 6 | 9 | 11 | 11 | 14 | 11 | 10 | 12 | 11 | 11 | 11 | 11 | 11 | 12 | 11 | 12 | 12 | 16 | 18 | 19 | 18 | 15 | 16 | 20 | 18 | 20 | 18 | |
New Dorp | Staten Island | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 2 | 3 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 1 | 1 | 2 | 3 | 3 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 2 | 2 | 6 | 6 | 4 | 4 | 3 | 1 | 1 | 1 | 3 | 4 | 4 | 4 | 3 | 4 | 4 | 4 | 4 | 5 | 6 | 6 | 5 | 8 | 10 | 11 | 7 | 7 | 7 | 6 | 8 | 11 | 13 | 10 | 6 | 4 | 5 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | |
Nolita | Manhattan | Neighborhood | 32 | 31 | 41 | 37 | 40 | 40 | 43 | 42 | 42 | 38 | 37 | 33 | 33 | 31 | 28 | 21 | 21 | 19 | 14 | 11 | 8 | 8 | 5 | 5 | 4 | 6 | 9 | 7 | 8 | 7 | 9 | 10 | 14 | 11 | 12 | 17 | 20 | 20 | 20 | 19 | 12 | 11 | 10 | 10 | 11 | 35 | 35 | 34 | 31 | 30 | 30 | 29 | 31 | 22 | 12 | 11 | 8 | 7 | 11 | 10 | 11 | 14 | 21 | 19 | 20 | 22 | 28 | 23 | 26 | 26 | 28 | 28 | 29 | 25 | 25 | 26 | 28 | 28 | 28 | 31 | 28 | 28 | 23 | 19 | 18 | 24 | 27 | 28 | 28 | 28 | 25 | 23 | 24 | 18 | 15 | 20 | 24 | 31 | 30 | |
North Corona | Queens | Neighborhood | 0 | 0 | 1 | 4 | 5 | 6 | 8 | 8 | 7 | 7 | 6 | 7 | 6 | 7 | 7 | 8 | 7 | 8 | 3 | 3 | 2 | 3 | 6 | 5 | 6 | 5 | 6 | 6 | 9 | 8 | 9 | 12 | 9 | 9 | 9 | 7 | 7 | 14 | 16 | 17 | 18 | 15 | 14 | 15 | 14 | 33 | 30 | 31 | 36 | 36 | 39 | 37 | 36 | 35 | 32 | 35 | 27 | 25 | 23 | 23 | 24 | 24 | 25 | 24 | 23 | 23 | 25 | 24 | 10 | 11 | 13 | 17 | 13 | 15 | 27 | 23 | 18 | 17 | 15 | 15 | 13 | 12 | 13 | 12 | 14 | 13 | 12 | 14 | 13 | 13 | 17 | 26 | 27 | 27 | 26 | 26 | 26 | 27 | 28 | |
North New York | Bronx | Neighborhood | 0 | 0 | 1 | 6 | 6 | 6 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 3 | 2 | 3 | 6 | 7 | 6 | 3 | 2 | 2 | 2 | 4 | 3 | 3 | 5 | 7 | 6 | 6 | 4 | 3 | 3 | 4 | 4 | 4 | 3 | 2 | |
Norwood | Bronx | Neighborhood | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 3 | 3 | 2 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 2 | 4 | 4 | 4 | 4 | 4 | 2 | 2 | 1 | 1 | 5 | 5 | 6 | 9 | 10 | 10 | 10 | 9 | 10 | 6 | 5 | 5 | 3 | 5 | 5 | 9 | 9 | 9 | 9 | 10 | 11 | 12 | 11 | 9 | 8 | 10 | 8 | 8 | 7 | 5 | 4 | 4 | 4 | 5 | 5 | 3 | 3 | 3 | 3 | 3 | 4 | 3 | 3 | 3 | 5 | 5 | 8 | 8 | 8 | 8 | 7 | 6 | 5 | 6 | 3 | 2 | 2 | 2 | 2 | 5 | 6 | 5 | 6 | 4 | 3 | 3 | 2 | 1 | 0 | 3 | 3 | 3 | |
Park Slope | Brooklyn | Neighborhood | 356 | 385 | 412 | 419 | 413 | 405 | 413 | 407 | 398 | 386 | 391 | 407 | 432 | 451 | 426 | 428 | 413 | 370 | 377 | 361 | 332 | 302 | 314 | 324 | 375 | 391 | 415 | 440 | 409 | 350 | 358 | 348 | 329 | 297 | 279 | 270 | 321 | 328 | 340 | 328 | 316 | 276 | 281 | 273 | 259 | 237 | 225 | 209 | 220 | 269 | 320 | 318 | 285 | 240 | 229 | 209 | 189 | 172 | 153 | 154 | 193 | 210 | 238 | 237 | 235 | 181 | 198 | 203 | 188 | 173 | 179 | 165 | 182 | 235 | 272 | 279 | 247 | 209 | 226 | 216 | 211 | 195 | 179 | 183 | 210 | 253 | 253 | 247 | 217 | 182 | 226 | 231 | 231 | 219 | 207 | 196 | 215 | 235 | 245 | |
Parkchester | Bronx | Neighborhood | 11 | 13 | 15 | 17 | 17 | 15 | 17 | 18 | 20 | 21 | 25 | 25 | 23 | 25 | 26 | 23 | 25 | 25 | 22 | 30 | 31 | 28 | 28 | 28 | 19 | 21 | 22 | 22 | 21 | 20 | 18 | 17 | 17 | 16 | 14 | 14 | 12 | 12 | 5 | 4 | 3 | 4 | 5 | 7 | 7 | 7 | 11 | 10 | 9 | 10 | 11 | 8 | 8 | 6 | 6 | 12 | 16 | 22 | 21 | 20 | 22 | 18 | 19 | 16 | 18 | 18 | 21 | 18 | 18 | 19 | 19 | 20 | 21 | 17 | 18 | 16 | 17 | 18 | 18 | 17 | 16 | 15 | 13 | 25 | 23 | 21 | 21 | 21 | 13 | 11 | 10 | 11 | 13 | 11 | 10 | 10 | 11 | 10 | 11 | |
Pelham Bay | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 3 | 3 | 3 | 3 | 1 | 1 | 2 | 2 | 4 | 5 | 5 | 3 | 3 | 2 | 2 | 1 | 2 | 3 | 3 | 3 | 1 | 1 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 5 | 4 | 5 | 5 | 8 | 8 | 8 | 8 | 8 | 9 | 11 | 10 | 10 | 8 | 8 | 8 | 7 | 4 | 4 | 6 | 6 | 6 | 5 | 3 | 4 | 5 | 5 | 6 | 6 | 4 | 4 | 4 | 3 | 2 | 2 | 2 | 4 | 6 | 7 | 7 | 5 | 4 | 3 | 3 | 3 | 3 | 4 | 5 | 4 | 4 | 4 | 4 | 3 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | |
Pelham Parkway | Bronx | Neighborhood | 5 | 9 | 10 | 10 | 14 | 15 | 19 | 19 | 20 | 20 | 23 | 19 | 15 | 18 | 11 | 17 | 17 | 20 | 20 | 19 | 15 | 14 | 10 | 10 | 10 | 9 | 10 | 10 | 11 | 12 | 13 | 16 | 12 | 14 | 15 | 16 | 17 | 17 | 17 | 22 | 22 | 22 | 19 | 23 | 24 | 22 | 20 | 21 | 23 | 29 | 25 | 24 | 26 | 25 | 26 | 24 | 20 | 17 | 17 | 16 | 17 | 16 | 15 | 17 | 17 | 15 | 19 | 17 | 13 | 12 | 10 | 11 | 14 | 14 | 18 | 17 | 17 | 15 | 18 | 16 | 18 | 16 | 16 | 17 | 14 | 15 | 15 | 14 | 13 | 14 | 13 | 12 | 13 | 10 | 11 | 9 | 9 | 9 | 6 | |
Prospect Heights | Brooklyn | Neighborhood | 137 | 146 | 183 | 202 | 201 | 184 | 188 | 171 | 161 | 156 | 158 | 161 | 164 | 160 | 139 | 133 | 118 | 102 | 106 | 120 | 122 | 114 | 119 | 110 | 118 | 126 | 128 | 136 | 156 | 134 | 128 | 128 | 121 | 111 | 114 | 103 | 104 | 110 | 111 | 114 | 103 | 101 | 102 | 101 | 86 | 76 | 71 | 77 | 80 | 95 | 107 | 118 | 105 | 90 | 91 | 82 | 74 | 75 | 72 | 74 | 68 | 70 | 75 | 73 | 79 | 67 | 89 | 88 | 80 | 73 | 66 | 66 | 58 | 64 | 75 | 89 | 120 | 101 | 106 | 109 | 126 | 117 | 108 | 87 | 97 | 97 | 110 | 126 | 115 | 105 | 129 | 140 | 140 | 144 | 122 | 118 | 97 | 94 | 92 | |
Prospect Lefferts Gardens | Brooklyn | Neighborhood | 27 | 30 | 25 | 27 | 22 | 22 | 23 | 27 | 23 | 24 | 24 | 24 | 25 | 32 | 32 | 39 | 42 | 37 | 34 | 34 | 45 | 31 | 34 | 35 | 36 | 40 | 44 | 45 | 43 | 38 | 51 | 50 | 46 | 45 | 45 | 45 | 46 | 46 | 49 | 36 | 30 | 27 | 30 | 27 | 25 | 26 | 25 | 26 | 30 | 27 | 42 | 48 | 43 | 42 | 48 | 50 | 47 | 47 | 47 | 45 | 47 | 48 | 51 | 41 | 40 | 31 | 30 | 20 | 26 | 26 | 27 | 29 | 32 | 40 | 40 | 39 | 38 | 30 | 27 | 33 | 31 | 30 | 27 | 27 | 27 | 23 | 24 | 23 | 25 | 25 | 25 | 29 | 30 | 29 | 28 | 27 | 28 | 26 | 25 | |
Prospect Park South | Brooklyn | Neighborhood | 29 | 26 | 25 | 26 | 25 | 22 | 21 | 19 | 14 | 11 | 10 | 10 | 10 | 10 | 9 | 10 | 11 | 11 | 12 | 14 | 14 | 12 | 12 | 13 | 16 | 16 | 17 | 20 | 16 | 15 | 15 | 15 | 14 | 12 | 11 | 10 | 13 | 14 | 16 | 15 | 15 | 14 | 14 | 18 | 17 | 14 | 17 | 16 | 15 | 16 | 20 | 19 | 18 | 12 | 14 | 13 | 14 | 9 | 14 | 12 | 12 | 12 | 12 | 16 | 19 | 18 | 20 | 23 | 19 | 15 | 13 | 13 | 12 | 12 | 11 | 11 | 12 | 11 | 14 | 16 | 15 | 12 | 12 | 11 | 9 | 10 | 10 | 13 | 12 | 9 | 8 | 8 | 8 | 9 | 10 | 13 | 14 | 13 | 16 | |
Queens Village | Queens | Neighborhood | 0 | 0 | 2 | 3 | 3 | 5 | 9 | 11 | 12 | 13 | 18 | 20 | 20 | 35 | 31 | 36 | 39 | 42 | 45 | 53 | 44 | 41 | 37 | 35 | 39 | 38 | 40 | 39 | 53 | 39 | 39 | 39 | 39 | 35 | 34 | 31 | 41 | 39 | 43 | 35 | 37 | 39 | 39 | 32 | 30 | 29 | 26 | 21 | 19 | 17 | 22 | 18 | 23 | 25 | 25 | 25 | 25 | 24 | 22 | 23 | 21 | 17 | 19 | 23 | 26 | 23 | 22 | 18 | 14 | 15 | 17 | 15 | 19 | 18 | 16 | 19 | 21 | 21 | 18 | 17 | 15 | 16 | 14 | 12 | 12 | 13 | 15 | 15 | 14 | 15 | 16 | 18 | 26 | 27 | 26 | 25 | 24 | 21 | 20 | |
Red Hook | Brooklyn | Neighborhood | 11 | 12 | 11 | 11 | 10 | 10 | 7 | 15 | 13 | 12 | 9 | 34 | 28 | 10 | 9 | 7 | 7 | 3 | 6 | 11 | 10 | 10 | 10 | 4 | 5 | 6 | 7 | 7 | 7 | 6 | 5 | 6 | 8 | 10 | 9 | 15 | 17 | 18 | 14 | 14 | 15 | 13 | 13 | 11 | 8 | 5 | 5 | 7 | 6 | 7 | 8 | 8 | 10 | 9 | 11 | 10 | 5 | 3 | 3 | 1 | 1 | 3 | 3 | 2 | 2 | 4 | 9 | 12 | 5 | 4 | 5 | 4 | 2 | 3 | 4 | 4 | 4 | 5 | 7 | 8 | 10 | 9 | 8 | 7 | 7 | 7 | 7 | 8 | 9 | 10 | 12 | 10 | 8 | 8 | 8 | 8 | 10 | 10 | 12 | |
Rego Park | Queens | Neighborhood | 18 | 19 | 18 | 19 | 15 | 17 | 20 | 19 | 22 | 20 | 17 | 18 | 21 | 25 | 22 | 28 | 31 | 26 | 30 | 34 | 37 | 37 | 41 | 43 | 62 | 70 | 70 | 69 | 71 | 54 | 40 | 34 | 39 | 34 | 32 | 38 | 45 | 54 | 57 | 64 | 69 | 69 | 67 | 71 | 66 | 58 | 62 | 69 | 75 | 85 | 85 | 86 | 93 | 88 | 91 | 94 | 96 | 84 | 78 | 73 | 80 | 81 | 88 | 96 | 97 | 95 | 105 | 113 | 115 | 106 | 96 | 82 | 78 | 73 | 78 | 89 | 103 | 87 | 85 | 91 | 87 | 69 | 64 | 64 | 56 | 68 | 70 | 88 | 98 | 103 | 102 | 91 | 84 | 75 | 77 | 67 | 80 | 77 | 75 | |
Richmond Hill | Queens | Neighborhood | 1 | 2 | 3 | 3 | 4 | 4 | 3 | 3 | 4 | 4 | 5 | 6 | 7 | 9 | 12 | 13 | 13 | 12 | 9 | 10 | 10 | 11 | 9 | 6 | 11 | 10 | 8 | 7 | 10 | 8 | 7 | 6 | 5 | 5 | 7 | 7 | 8 | 6 | 7 | 8 | 7 | 6 | 8 | 7 | 7 | 7 | 7 | 8 | 10 | 10 | 12 | 11 | 14 | 12 | 10 | 8 | 7 | 7 | 6 | 5 | 5 | 4 | 4 | 5 | 6 | 5 | 4 | 2 | 2 | 2 | 3 | 2 | 4 | 5 | 4 | 3 | 5 | 5 | 5 | 7 | 7 | 8 | 5 | 8 | 8 | 8 | 7 | 8 | 8 | 8 | 7 | 6 | 7 | 5 | 7 | 7 | 7 | 8 | 15 | |
Ridgewood | Queens | Neighborhood | 15 | 15 | 16 | 11 | 15 | 12 | 17 | 24 | 22 | 18 | 19 | 13 | 16 | 16 | 20 | 19 | 19 | 15 | 17 | 17 | 16 | 43 | 43 | 41 | 41 | 42 | 42 | 40 | 39 | 38 | 11 | 10 | 10 | 10 | 11 | 11 | 11 | 7 | 7 | 7 | 7 | 7 | 8 | 8 | 7 | 6 | 6 | 5 | 7 | 6 | 5 | 5 | 2 | 3 | 3 | 4 | 4 | 5 | 5 | 5 | 6 | 6 | 7 | 7 | 10 | 10 | 9 | 7 | 9 | 17 | 17 | 18 | 18 | 16 | 16 | 16 | 14 | 14 | 11 | 11 | 9 | 5 | 4 | 5 | 7 | 7 | 9 | 7 | 8 | 13 | 13 | 11 | 9 | 11 | 13 | 14 | 15 | 14 | 14 | |
Riverdale | Bronx | Neighborhood | 268 | 275 | 293 | 330 | 369 | 371 | 389 | 404 | 426 | 404 | 438 | 431 | 465 | 486 | 445 | 437 | 433 | 416 | 399 | 396 | 385 | 388 | 456 | 449 | 494 | 521 | 589 | 621 | 607 | 597 | 557 | 543 | 548 | 530 | 523 | 525 | 548 | 582 | 606 | 606 | 623 | 602 | 604 | 590 | 564 | 543 | 558 | 547 | 583 | 620 | 622 | 657 | 659 | 661 | 629 | 614 | 579 | 539 | 545 | 540 | 591 | 592 | 623 | 636 | 654 | 692 | 665 | 658 | 620 | 571 | 553 | 554 | 600 | 609 | 643 | 667 | 683 | 673 | 668 | 634 | 598 | 561 | 562 | 552 | 565 | 565 | 577 | 577 | 552 | 514 | 507 | 486 | 432 | 410 | 391 | 384 | 411 | 404 | 404 | |
Rockaway All | Queens | Neighborhood | 77 | 75 | 99 | 102 | 100 | 102 | 106 | 98 | 76 | 65 | 71 | 72 | 71 | 82 | 76 | 79 | 93 | 90 | 70 | 66 | 65 | 56 | 58 | 52 | 61 | 62 | 62 | 65 | 57 | 54 | 56 | 50 | 42 | 37 | 33 | 29 | 31 | 35 | 51 | 52 | 38 | 41 | 44 | 46 | 45 | 41 | 44 | 45 | 49 | 50 | 58 | 53 | 58 | 67 | 51 | 47 | 49 | 42 | 42 | 35 | 41 | 40 | 38 | 62 | 61 | 59 | 55 | 60 | 62 | 61 | 57 | 58 | 55 | 61 | 83 | 81 | 78 | 81 | 72 | 59 | 52 | 50 | 46 | 38 | 46 | 54 | 57 | 58 | 82 | 80 | 66 | 56 | 56 | 52 | 60 | 65 | 79 | 69 | 93 | |
Roosevelt Island | Manhattan | Neighborhood | 61 | 65 | 68 | 73 | 74 | 77 | 82 | 78 | 66 | 44 | 42 | 40 | 39 | 36 | 30 | 29 | 28 | 17 | 11 | 11 | 10 | 10 | 11 | 13 | 15 | 15 | 15 | 13 | 13 | 15 | 15 | 10 | 10 | 9 | 7 | 6 | 5 | 6 | 8 | 7 | 4 | 3 | 4 | 5 | 3 | 3 | 2 | 3 | 2 | 2 | 5 | 7 | 6 | 5 | 5 | 5 | 2 | 2 | 3 | 2 | 8 | 11 | 14 | 18 | 16 | 15 | 16 | 13 | 15 | 13 | 10 | 11 | 10 | 10 | 17 | 34 | 34 | 24 | 30 | 31 | 33 | 29 | 28 | 25 | 23 | 18 | 22 | 22 | 27 | 23 | 25 | 28 | 31 | 32 | 25 | 23 | 25 | 23 | 21 | |
Saint George | Staten Island | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 1 | 2 | 4 | 5 | 4 | 4 | 2 | 2 | 2 | 1 | 6 | 4 | 13 | 11 | 10 | 12 | 11 | 12 | 3 | 2 | 1 | 1 | 5 | 7 | 7 | 7 | 8 | 8 | 4 | 4 | 3 | 1 | 1 | 3 | 18 | 18 | 23 | 23 | 27 | 21 | 19 | 24 | 25 | 19 | 23 | 23 | 25 | 12 | 9 | 11 | 11 | 10 | 11 | 11 | 9 | 8 | 5 | 6 | 4 | 6 | 5 | 5 | 5 | 4 | 4 | 4 | 4 | 3 | 3 | 3 | 2 | 4 | 3 | |
Sheepshead Bay | Brooklyn | Neighborhood | 57 | 69 | 331 | 364 | 384 | 418 | 461 | 500 | 518 | 529 | 551 | 563 | 594 | 633 | 648 | 679 | 717 | 756 | 385 | 394 | 351 | 354 | 355 | 350 | 387 | 384 | 409 | 404 | 391 | 383 | 392 | 393 | 390 | 387 | 392 | 396 | 430 | 425 | 434 | 444 | 453 | 431 | 429 | 396 | 351 | 352 | 368 | 361 | 368 | 355 | 385 | 385 | 406 | 384 | 321 | 342 | 298 | 281 | 281 | 275 | 278 | 238 | 227 | 426 | 376 | 373 | 394 | 428 | 405 | 402 | 403 | 393 | 380 | 371 | 375 | 392 | 355 | 312 | 302 | 302 | 277 | 248 | 196 | 171 | 170 | 184 | 188 | 190 | 200 | 177 | 178 | 191 | 229 | 219 | 229 | 220 | 235 | 243 | 268 | |
Soho | Manhattan | Neighborhood | 245 | 248 | 243 | 246 | 241 | 229 | 231 | 229 | 227 | 226 | 237 | 238 | 252 | 258 | 260 | 261 | 237 | 213 | 233 | 224 | 212 | 196 | 187 | 212 | 217 | 225 | 222 | 235 | 229 | 223 | 214 | 210 | 206 | 189 | 192 | 184 | 193 | 182 | 208 | 212 | 202 | 199 | 157 | 171 | 171 | 153 | 159 | 142 | 156 | 156 | 159 | 155 | 136 | 132 | 137 | 190 | 187 | 182 | 178 | 175 | 177 | 194 | 209 | 202 | 197 | 188 | 186 | 180 | 183 | 147 | 141 | 144 | 161 | 163 | 171 | 165 | 152 | 141 | 153 | 160 | 143 | 147 | 152 | 188 | 193 | 219 | 230 | 228 | 213 | 184 | 214 | 140 | 149 | 134 | 135 | 136 | 134 | 134 | 138 | |
South Jamaica | Queens | Neighborhood | 1 | 1 | 4 | 3 | 4 | 5 | 9 | 8 | 8 | 9 | 12 | 13 | 11 | 10 | 11 | 14 | 16 | 16 | 12 | 13 | 15 | 17 | 17 | 17 | 17 | 17 | 17 | 16 | 16 | 16 | 17 | 18 | 18 | 22 | 20 | 20 | 19 | 18 | 16 | 17 | 19 | 16 | 14 | 15 | 18 | 16 | 12 | 9 | 8 | 7 | 11 | 11 | 10 | 11 | 11 | 11 | 10 | 9 | 9 | 9 | 7 | 10 | 10 | 13 | 15 | 14 | 13 | 11 | 14 | 13 | 14 | 18 | 18 | 17 | 15 | 15 | 14 | 13 | 10 | 13 | 20 | 17 | 13 | 19 | 21 | 20 | 18 | 18 | 22 | 18 | 25 | 28 | 30 | 30 | 35 | 35 | 33 | 30 | 28 | |
Sunnyside | Queens | Neighborhood | 26 | 24 | 23 | 23 | 10 | 9 | 12 | 12 | 12 | 15 | 16 | 20 | 54 | 42 | 41 | 46 | 42 | 40 | 47 | 27 | 25 | 25 | 21 | 18 | 31 | 32 | 37 | 34 | 32 | 32 | 30 | 36 | 31 | 27 | 27 | 29 | 30 | 28 | 35 | 39 | 42 | 42 | 29 | 32 | 29 | 27 | 28 | 29 | 30 | 30 | 34 | 33 | 33 | 29 | 26 | 25 | 27 | 20 | 13 | 17 | 17 | 23 | 29 | 35 | 37 | 37 | 34 | 39 | 45 | 36 | 39 | 39 | 42 | 42 | 41 | 48 | 48 | 51 | 50 | 49 | 46 | 37 | 36 | 34 | 33 | 40 | 47 | 44 | 46 | 37 | 40 | 39 | 35 | 32 | 32 | 31 | 31 | 35 | 28 | |
Sunset Park | Brooklyn | Neighborhood | 36 | 37 | 48 | 47 | 46 | 45 | 44 | 47 | 45 | 43 | 47 | 50 | 53 | 56 | 51 | 52 | 70 | 70 | 55 | 60 | 64 | 63 | 64 | 53 | 58 | 52 | 53 | 53 | 50 | 53 | 55 | 56 | 56 | 53 | 51 | 49 | 46 | 50 | 55 | 52 | 49 | 45 | 43 | 43 | 39 | 41 | 39 | 41 | 40 | 40 | 41 | 42 | 38 | 37 | 31 | 25 | 21 | 20 | 19 | 25 | 20 | 24 | 24 | 30 | 26 | 27 | 32 | 36 | 34 | 29 | 24 | 22 | 25 | 30 | 33 | 35 | 36 | 34 | 31 | 30 | 24 | 23 | 21 | 21 | 22 | 26 | 29 | 29 | 25 | 26 | 33 | 35 | 36 | 39 | 40 | 37 | 37 | 35 | 34 | |
Sutton Place | Manhattan | Neighborhood | 306 | 327 | 326 | 358 | 325 | 312 | 325 | 331 | 323 | 306 | 305 | 315 | 328 | 357 | 368 | 362 | 336 | 308 | 320 | 321 | 298 | 294 | 295 | 307 | 324 | 323 | 326 | 337 | 332 | 297 | 314 | 327 | 311 | 306 | 312 | 322 | 326 | 335 | 341 | 336 | 331 | 310 | 323 | 325 | 306 | 291 | 288 | 282 | 286 | 292 | 304 | 286 | 274 | 262 | 259 | 262 | 237 | 209 | 216 | 236 | 242 | 258 | 274 | 271 | 252 | 236 | 242 | 237 | 230 | 207 | 208 | 221 | 225 | 249 | 259 | 247 | 241 | 214 | 239 | 270 | 363 | 322 | 323 | 328 | 366 | 374 | 380 | 388 | 363 | 345 | 381 | 406 | 415 | 395 | 426 | 420 | 427 | 421 | 401 | |
Throgs Neck | Bronx | Neighborhood | 2 | 4 | 4 | 4 | 4 | 4 | 7 | 5 | 5 | 5 | 4 | 5 | 5 | 5 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | 4 | 3 | 4 | 3 | 3 | 2 | 2 | 3 | 2 | 2 | 4 | 6 | 5 | 7 | 7 | 7 | 5 | 5 | 7 | 5 | 4 | 3 | 3 | 1 | 1 | 2 | 2 | 2 | 3 | 5 | 6 | 7 | 7 | 6 | 6 | 8 | 7 | 8 | 6 | 6 | 7 | 5 | 3 | 2 | 3 | 4 | 6 | 7 | 7 | 8 | 9 | 7 | 7 | 6 | 9 | 8 | 6 | 7 | 7 | 7 | 8 | 8 | 10 | 9 | 9 | 11 | 10 | 12 | 14 | 14 | 12 | 16 | 16 | 17 | |
Tremont | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 1 | 1 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 4 | 2 | 2 | 2 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 3 | 3 | 4 | 3 | 4 | 2 | 3 | 3 | 3 | 5 | 5 | 5 | 5 | 5 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 2 | 3 | 3 | 3 | 3 | 3 | 1 | 1 | 1 | |
Tribeca | Manhattan | Neighborhood | 463 | 497 | 499 | 512 | 489 | 478 | 451 | 445 | 429 | 411 | 410 | 413 | 419 | 412 | 393 | 362 | 327 | 290 | 235 | 242 | 232 | 214 | 221 | 211 | 256 | 276 | 286 | 292 | 303 | 264 | 264 | 308 | 294 | 289 | 293 | 306 | 344 | 347 | 363 | 358 | 342 | 322 | 292 | 276 | 265 | 266 | 259 | 247 | 279 | 301 | 301 | 302 | 296 | 253 | 252 | 243 | 223 | 209 | 209 | 209 | 230 | 262 | 266 | 289 | 289 | 272 | 288 | 305 | 277 | 257 | 250 | 234 | 250 | 294 | 322 | 314 | 290 | 273 | 319 | 319 | 312 | 311 | 329 | 339 | 385 | 429 | 455 | 472 | 464 | 462 | 480 | 484 | 449 | 407 | 408 | 402 | 425 | 430 | 427 | |
Turtle Bay | Manhattan | Neighborhood | 510 | 519 | 515 | 530 | 514 | 503 | 485 | 468 | 450 | 438 | 429 | 466 | 472 | 476 | 496 | 494 | 478 | 435 | 431 | 435 | 419 | 395 | 396 | 387 | 411 | 444 | 433 | 428 | 424 | 393 | 390 | 392 | 388 | 367 | 368 | 386 | 400 | 415 | 405 | 402 | 385 | 364 | 361 | 368 | 355 | 326 | 340 | 344 | 353 | 372 | 379 | 389 | 386 | 366 | 352 | 377 | 362 | 329 | 320 | 304 | 322 | 344 | 353 | 330 | 327 | 302 | 291 | 300 | 285 | 266 | 274 | 286 | 323 | 362 | 380 | 372 | 371 | 350 | 367 | 363 | 327 | 303 | 296 | 306 | 326 | 344 | 359 | 360 | 345 | 324 | 358 | 359 | 365 | 343 | 330 | 335 | 372 | 352 | 351 | |
University Heights | Bronx | Neighborhood | 7 | 8 | 7 | 9 | 10 | 15 | 17 | 18 | 19 | 23 | 23 | 17 | 17 | 16 | 13 | 16 | 15 | 12 | 12 | 15 | 13 | 15 | 15 | 14 | 16 | 17 | 20 | 20 | 20 | 18 | 14 | 10 | 13 | 12 | 10 | 13 | 17 | 19 | 19 | 16 | 19 | 16 | 18 | 19 | 16 | 14 | 15 | 14 | 13 | 12 | 18 | 17 | 17 | 16 | 15 | 11 | 11 | 12 | 13 | 11 | 14 | 15 | 14 | 14 | 15 | 18 | 19 | 15 | 14 | 14 | 16 | 19 | 19 | 20 | 15 | 17 | 18 | 17 | 19 | 12 | 11 | 11 | 6 | 8 | 8 | 9 | 10 | 12 | 14 | 18 | 20 | 18 | 21 | 16 | 13 | 10 | 17 | 17 | 14 | |
Upper East Side | Manhattan | Neighborhood | 982 | 1023 | 1038 | 1057 | 1058 | 1027 | 1031 | 1027 | 971 | 849 | 853 | 881 | 910 | 936 | 953 | 944 | 913 | 850 | 851 | 869 | 831 | 793 | 784 | 798 | 832 | 868 | 857 | 857 | 812 | 734 | 715 | 732 | 723 | 689 | 716 | 739 | 802 | 826 | 837 | 816 | 768 | 728 | 738 | 780 | 746 | 701 | 670 | 698 | 724 | 748 | 759 | 755 | 706 | 642 | 639 | 638 | 557 | 511 | 525 | 529 | 564 | 629 | 638 | 620 | 593 | 564 | 608 | 645 | 599 | 555 | 530 | 548 | 572 | 606 | 648 | 652 | 599 | 551 | 571 | 601 | 576 | 518 | 515 | 549 | 593 | 648 | 659 | 668 | 631 | 579 | 608 | 633 | 618 | 579 | 573 | 595 | 642 | 652 | 602 | |
Upper West Side | Manhattan | Neighborhood | 1204 | 1249 | 1270 | 1277 | 1218 | 1151 | 1125 | 1129 | 1080 | 1055 | 1069 | 1071 | 1113 | 1121 | 1104 | 1091 | 992 | 904 | 910 | 948 | 896 | 824 | 841 | 860 | 967 | 1001 | 1030 | 1023 | 966 | 879 | 892 | 871 | 846 | 781 | 808 | 858 | 910 | 949 | 966 | 944 | 882 | 807 | 787 | 788 | 752 | 740 | 757 | 786 | 842 | 938 | 990 | 967 | 884 | 808 | 793 | 790 | 702 | 641 | 634 | 636 | 703 | 771 | 824 | 814 | 766 | 667 | 674 | 696 | 666 | 627 | 621 | 651 | 688 | 822 | 856 | 878 | 837 | 752 | 775 | 793 | 733 | 669 | 650 | 609 | 694 | 754 | 803 | 802 | 740 | 675 | 709 | 723 | 696 | 640 | 637 | 638 | 691 | 712 | 700 | |
Wakefield | Bronx | Neighborhood | 2 | 2 | 1 | 2 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 2 | 4 | 4 | 4 | 2 | 2 | 2 | 2 | 1 | 0 | 1 | 5 | 4 | 2 | 2 | 2 | 3 | 3 | 4 | 4 | 4 | 4 | 4 | 3 | 4 | 4 | 4 | 6 | 5 | 4 | 5 | 3 | 3 | 3 | 4 | 4 | 4 | 4 | 3 | 2 | 3 | 4 | 5 | 3 | 2 | 1 | 1 | 2 | 3 | 2 | 3 | 3 | 2 | 5 | 6 | 7 | 5 | 5 | 7 | 9 | 9 | 9 | 10 | 11 | 9 | 7 | 10 | 9 | 3 | 3 | 3 | 4 | 4 | 5 | 6 | 6 | 4 | 2 | 3 | 3 | 4 | 4 | 7 | 6 | 9 | 6 | |
Washington Heights | Manhattan | Neighborhood | 242 | 251 | 266 | 258 | 250 | 227 | 241 | 252 | 261 | 256 | 255 | 266 | 285 | 288 | 284 | 287 | 273 | 264 | 273 | 288 | 277 | 252 | 274 | 250 | 270 | 268 | 270 | 285 | 302 | 259 | 260 | 245 | 240 | 224 | 237 | 232 | 237 | 246 | 258 | 255 | 239 | 233 | 236 | 226 | 211 | 203 | 194 | 190 | 193 | 216 | 223 | 218 | 222 | 210 | 220 | 205 | 187 | 183 | 177 | 178 | 186 | 203 | 231 | 247 | 262 | 243 | 240 | 233 | 212 | 195 | 176 | 171 | 205 | 219 | 194 | 181 | 190 | 200 | 205 | 198 | 191 | 170 | 147 | 146 | 169 | 179 | 181 | 197 | 191 | 186 | 194 | 180 | 170 | 157 | 149 | 147 | 157 | 144 | 146 | |
West Harlem | Manhattan | Neighborhood | 6 | 6 | 7 | 8 | 8 | 7 | 4 | 3 | 3 | 3 | 9 | 9 | 7 | 7 | 11 | 12 | 13 | 5 | 5 | 6 | 6 | 6 | 6 | 7 | 8 | 9 | 6 | 9 | 9 | 7 | 7 | 7 | 6 | 7 | 7 | 8 | 9 | 8 | 8 | 10 | 5 | 7 | 9 | 11 | 11 | 11 | 13 | 13 | 9 | 10 | 9 | 8 | 7 | 7 | 6 | 7 | 5 | 5 | 5 | 7 | 7 | 7 | 7 | 7 | 6 | 7 | 6 | 7 | 8 | 7 | 8 | 6 | 3 | 3 | 3 | 4 | 1 | 0 | 3 | 3 | 6 | 5 | 6 | 6 | 7 | 5 | 11 | 12 | 9 | 9 | 11 | 10 | 9 | 8 | 9 | 8 | 6 | 6 | 5 | |
West Village | Manhattan | Neighborhood | 327 | 330 | 331 | 329 | 323 | 297 | 304 | 307 | 294 | 281 | 278 | 268 | 290 | 291 | 280 | 293 | 289 | 276 | 283 | 284 | 270 | 253 | 241 | 238 | 252 | 253 | 243 | 255 | 243 | 208 | 226 | 229 | 230 | 220 | 215 | 226 | 242 | 251 | 259 | 260 | 239 | 216 | 208 | 204 | 191 | 173 | 153 | 175 | 207 | 242 | 269 | 271 | 257 | 224 | 214 | 215 | 181 | 157 | 153 | 164 | 181 | 214 | 234 | 237 | 229 | 200 | 216 | 223 | 205 | 187 | 171 | 168 | 172 | 212 | 212 | 230 | 215 | 218 | 230 | 243 | 236 | 221 | 223 | 233 | 247 | 276 | 298 | 286 | 265 | 237 | 257 | 274 | 257 | 241 | 238 | 234 | 266 | 269 | 259 | |
Whitestone | Queens | Neighborhood | 2 | 2 | 7 | 6 | 8 | 11 | 15 | 16 | 14 | 14 | 15 | 22 | 22 | 26 | 22 | 28 | 27 | 26 | 31 | 32 | 29 | 32 | 30 | 29 | 25 | 27 | 28 | 33 | 40 | 31 | 25 | 21 | 25 | 24 | 22 | 18 | 23 | 23 | 22 | 16 | 13 | 11 | 12 | 12 | 14 | 11 | 19 | 15 | 16 | 18 | 20 | 18 | 19 | 26 | 28 | 27 | 29 | 24 | 23 | 24 | 36 | 42 | 50 | 57 | 65 | 62 | 65 | 54 | 43 | 38 | 37 | 33 | 35 | 40 | 39 | 35 | 40 | 40 | 41 | 40 | 39 | 41 | 40 | 38 | 47 | 62 | 59 | 58 | 55 | 52 | 52 | 54 | 69 | 52 | 48 | 46 | 53 | 50 | 52 | |
Williamsbridge | Bronx | Neighborhood | 4 | 4 | 3 | 4 | 4 | 4 | 3 | 4 | 4 | 4 | 4 | 4 | 5 | 5 | 3 | 2 | 3 | 1 | 2 | 2 | 2 | 3 | 2 | 1 | 2 | 3 | 3 | 2 | 2 | 2 | 1 | 2 | 4 | 6 | 6 | 6 | 8 | 8 | 7 | 7 | 7 | 5 | 5 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 5 | 5 | 7 | 8 | 7 | 9 | 12 | 11 | 11 | 9 | 6 | 6 | 3 | 4 | 4 | 5 | 3 | 2 | 3 | 4 | 4 | 5 | 4 | 4 | 5 | 8 | 13 | 13 | 11 | 11 | 5 | 3 | 4 | 5 | 6 | 6 | 6 | 8 | 8 | 6 | 7 | 8 | 6 | 5 | 3 | 5 | |
Williamsburg | Brooklyn | Neighborhood | 654 | 636 | 617 | 577 | 580 | 562 | 557 | 545 | 565 | 527 | 538 | 559 | 580 | 628 | 621 | 583 | 522 | 530 | 501 | 498 | 542 | 444 | 485 | 441 | 431 | 421 | 405 | 388 | 346 | 302 | 304 | 303 | 301 | 285 | 284 | 280 | 277 | 263 | 274 | 246 | 196 | 163 | 161 | 177 | 165 | 153 | 148 | 148 | 172 | 209 | 223 | 212 | 194 | 183 | 204 | 194 | 185 | 144 | 136 | 138 | 160 | 177 | 196 | 190 | 204 | 185 | 232 | 232 | 207 | 209 | 190 | 184 | 203 | 235 | 272 | 306 | 308 | 281 | 297 | 298 | 266 | 214 | 244 | 259 | 305 | 327 | 356 | 381 | 362 | 341 | 389 | 382 | 361 | 324 | 307 | 328 | 357 | 369 | 373 | |
Windsor Terrace | Brooklyn | Neighborhood | 48 | 52 | 63 | 58 | 58 | 53 | 54 | 61 | 61 | 62 | 58 | 63 | 66 | 75 | 78 | 81 | 82 | 68 | 62 | 57 | 56 | 53 | 52 | 51 | 72 | 74 | 77 | 79 | 69 | 60 | 62 | 57 | 58 | 50 | 52 | 53 | 53 | 62 | 67 | 66 | 54 | 53 | 47 | 52 | 47 | 43 | 38 | 42 | 43 | 42 | 45 | 47 | 44 | 38 | 36 | 40 | 31 | 24 | 22 | 14 | 19 | 31 | 44 | 53 | 60 | 54 | 56 | 54 | 46 | 39 | 33 | 35 | 40 | 49 | 52 | 53 | 46 | 36 | 36 | 50 | 46 | 44 | 36 | 31 | 35 | 36 | 42 | 50 | 49 | 49 | 53 | 49 | 39 | 36 | 35 | 34 | 33 | 42 | 52 | |
Woodhaven | Queens | Neighborhood | 3 | 4 | 8 | 11 | 12 | 14 | 20 | 15 | 12 | 8 | 5 | 3 | 5 | 6 | 6 | 9 | 13 | 14 | 17 | 16 | 16 | 14 | 13 | 11 | 12 | 13 | 11 | 13 | 15 | 15 | 11 | 9 | 10 | 12 | 13 | 15 | 16 | 15 | 14 | 13 | 12 | 11 | 11 | 13 | 12 | 14 | 15 | 15 | 17 | 12 | 12 | 8 | 8 | 11 | 7 | 11 | 13 | 10 | 10 | 12 | 10 | 7 | 5 | 5 | 5 | 4 | 5 | 4 | 6 | 7 | 9 | 9 | 14 | 12 | 13 | 12 | 19 | 17 | 17 | 24 | 23 | 18 | 18 | 20 | 14 | 11 | 12 | 12 | 12 | 14 | 19 | 21 | 21 | 23 | 21 | 25 | 26 | 21 | 17 | |
Woodside | Queens | Neighborhood | 4 | 6 | 11 | 12 | 18 | 17 | 28 | 31 | 30 | 27 | 25 | 25 | 25 | 26 | 27 | 26 | 21 | 24 | 23 | 23 | 21 | 17 | 18 | 16 | 30 | 34 | 35 | 39 | 45 | 46 | 47 | 45 | 45 | 41 | 35 | 35 | 28 | 24 | 26 | 25 | 25 | 31 | 29 | 37 | 39 | 45 | 45 | 42 | 39 | 33 | 44 | 42 | 41 | 40 | 35 | 30 | 28 | 28 | 27 | 25 | 27 | 30 | 32 | 29 | 31 | 25 | 25 | 23 | 23 | 22 | 20 | 14 | 21 | 22 | 23 | 23 | 26 | 27 | 28 | 36 | 32 | 31 | 30 | 35 | 28 | 32 | 38 | 36 | 32 | 29 | 38 | 40 | 39 | 34 | 37 | 38 | 37 | 38 | 31 | |
Woodstock | Bronx | Neighborhood | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 3 | 5 | 8 | 6 | 8 | 7 | 7 | 6 | 7 | 7 | 7 | 6 | 3 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 2 | 2 | 3 | 1 | 0 | 1 | 2 | 2 | 2 | 2 | 2 | 1 | 1 | 3 | 4 | 5 | 5 | 5 | 4 | 4 | 1 | |
Yorkville | Manhattan | Neighborhood | 736 | 760 | 790 | 774 | 764 | 704 | 714 | 705 | 670 | 620 | 635 | 630 | 671 | 691 | 701 | 676 | 623 | 577 | 577 | 585 | 557 | 527 | 533 | 541 | 590 | 620 | 629 | 633 | 619 | 564 | 569 | 571 | 538 | 518 | 519 | 521 | 596 | 607 | 622 | 615 | 586 | 540 | 541 | 543 | 514 | 465 | 474 | 490 | 515 | 560 | 563 | 551 | 534 | 503 | 464 | 459 | 420 | 371 | 392 | 390 | 413 | 453 | 492 | 508 | 477 | 421 | 425 | 434 | 400 | 367 | 400 | 410 | 436 | 501 | 492 | 479 | 445 | 399 | 398 | 398 | 360 | 325 | 311 | 360 | 393 | 430 | 430 | 488 | 427 | 386 | 387 | 420 | 405 | 385 | 415 | 420 | 453 | 479 | 474 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment