(function(n,t){var i={min:n.validator.methods.min,max:n.validator.methods.max,range:n.validator.methods.range};n.validator.methods.number=function(i,r){var u=t.parseFloat(i);return this.optional(r)||n.isNumeric(u)};n.validator.methods.date=function(n,i){console.log("value",n);var r=t.parseDate(n);return console.log("val",r),this.optional(i)||r};n.validator.methods.min=function(n,r,u){var f=t.parseFloat(n);return i.min.call(this,f,r,u)};n.validator.methods.max=function(n,r,u){var f=t.parseFloat(n);return i.max.call(this,f,r,u)};n.validator.methods.range=function(n,r,u){var f=t.parseFloat(n);return i.range.call(this,f,r,u)}})(jQuery,Globalize),function(){function gc(n,t){try{for(var i in t)Object.defineProperty(n.prototype,i,{value:t[i],enumerable:!1})}catch(r){n.prototype=t}}function nl(n){for(var t=-1,r=n.length,i=[];++t<r;)i.push(n[t]);return i}function tl(n){return Array.prototype.slice.call(n)}function y(){}function k(n){return n}function il(){return this}function ne(){return!0}function i(n){return typeof n=="function"?n:function(){return n}}function rl(n,t,i){return function(){var r=i.apply(t,arguments);return arguments.length?n:r}}function vr(n){return n!=null&&!isNaN(n)}function ul(n){return n.length}function fl(n){return n==null}function te(n){return n.trim().replace(/\s+/g," ")}function el(n){for(var t=1;n*t%1;)t*=10;return t}function yr(){}function ie(n){function r(){for(var i=t,r=-1,f=i.length,u;++r<f;)(u=i[r].on)&&u.apply(this,arguments);return n}var t=[],i=new y;return r.on=function(r,u){var f=i.get(r),e;return arguments.length<2?f&&f.on:(f&&(f.on=null,t=t.slice(0,e=t.indexOf(f)).concat(t.slice(e+1)),i.remove(r)),u&&t.push(i.set(r,{on:u})),n)},r}function re(n,t){return t-(n?1+Math.floor(Math.log(n+Math.pow(10,1+Math.floor(Math.log(n)/Math.LN10)-t))/Math.LN10):1)}function ol(n){return n+""}function ue(n){for(var t=n.lastIndexOf("."),r=t>=0?n.substring(t):(t=n.length,""),i=[];t>0;)i.push(n.substring(t-=3,t+3));return i.reverse().join(",")+r}function sl(n,t){var i=Math.pow(10,Math.abs(8-t)*3);return{scale:t>8?function(n){return n/i}:function(n){return n*i},symbol:n}}function hl(n){return function(t){return t<=0?0:t>=1?1:n(t)}}function fe(n){return function(t){return 1-n(1-t)}}function ee(n){return function(t){return.5*(t<.5?n(2*t):2-n(2-2*t))}}function pr(n){return n}function wr(n){return function(t){return Math.pow(t,n)}}function cl(n){return 1-Math.cos(n*Math.PI/2)}function ll(n){return Math.pow(2,10*(n-1))}function al(n){return 1-Math.sqrt(1-n*n)}function vl(n,t){var i;return arguments.length<2&&(t=.45),arguments.length<1?(n=1,i=t/4):i=t/(2*Math.PI)*Math.asin(1/n),function(r){return 1+n*Math.pow(2,10*-r)*Math.sin((r-i)*2*Math.PI/t)}}function yl(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function pl(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function o(){d3.event.stopPropagation();d3.event.preventDefault()}function oe(){for(var n=d3.event,t;t=n.sourceEvent;)n=t;return n}function br(n){for(var t=new yr,i=0,r=arguments.length;++i<r;)t[arguments[i]]=ie(t);return t.of=function(i,r){return function(u){try{var f=u.sourceEvent=d3.event;u.target=n;d3.event=u;t[u.type].apply(i,r)}finally{d3.event=f}}},t}function se(n){var t=[n.a,n.b],i=[n.c,n.d],r=ce(t),u=he(t,i),f=ce(wl(i,t,-u))||0;t[0]*i[1]<i[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1);this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-i[0],i[1]))*hf;this.translate=[n.e,n.f];this.scale=[r,f];this.skew=f?Math.atan2(u,f)*hf:0}function he(n,t){return n[0]*t[0]+n[1]*t[1]}function ce(n){var t=Math.sqrt(he(n,n));return t&&(n[0]/=t,n[1]/=t),t}function wl(n,t,i){return n[0]+=i*t[0],n[1]+=i*t[1],n}function le(n){return n=="transform"?d3.interpolateTransform:d3.interpolate}function bl(n,t){return t=t-(n=+n)?1/(t-n):0,function(i){return(i-n)*t}}function kl(n,t){return t=t-(n=+n)?1/(t-n):0,function(i){return Math.max(0,Math.min(1,(i-n)*t))}}function c(n,t,i){return new d(n,t,i)}function d(n,t,i){this.r=n;this.g=t;this.b=i}function ft(n){return n<16?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function kr(n,t,i){var r=0,u=0,e=0,o,f,s;if(o=/([a-z]+)\((.*)\)/i.exec(n),o){f=o[2].split(",");switch(o[1]){case"hsl":return i(parseFloat(f[0]),parseFloat(f[1])/100,parseFloat(f[2])/100);case"rgb":return t(gr(f[0]),gr(f[1]),gr(f[2]))}}return(s=ni.get(n))?t(s.r,s.g,s.b):(n!=null&&n.charAt(0)==="#"&&(n.length===4?(r=n.charAt(1),r+=r,u=n.charAt(2),u+=u,e=n.charAt(3)+e):n.length===7&&(r=n.substring(1,3),u=n.substring(3,5),e=n.substring(5,7)),r=parseInt(r,16),u=parseInt(u,16),e=parseInt(e,16)),t(r,u,e))}function ae(n,t,i){var f=Math.min(n/=255,t/=255,i/=255),r=Math.max(n,t,i),u=r-f,e,o,s=(r+f)/2;return u?(o=s<.5?u/(r+f):u/(2-r-f),e=(n==r?(t-i)/u+(t<i?6:0):t==r?(i-n)/u+2:(n-t)/u+4)*60):o=e=0,et(e,o,s)}function ve(n,t,i){n=dr(n);t=dr(t);i=dr(i);var u=iu((.4124564*n+.3575761*t+.1804375*i)/dh),r=iu((.2126729*n+.7151522*t+.072175*i)/gh),f=iu((.0193339*n+.119192*t+.9503041*i)/nc);return ot(116*r-16,500*(u-r),200*(r-f))}function dr(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function gr(n){var t=parseFloat(n);return n.charAt(n.length-1)==="%"?Math.round(t*2.55):t}function et(n,t,i){return new g(n,t,i)}function g(n,t,i){this.h=n;this.s=t;this.l=i}function ri(n,t,i){function e(n){return(n>360?n-=360:n<0&&(n+=360),n<60)?r+(u-r)*n/60:n<180?u:n<240?r+(u-r)*(240-n)/60:r}function f(n){return Math.round(e(n)*255)}var r,u;return n=n%360,n<0&&(n+=360),t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,u=i<=.5?i*(1+t):i+t-i*t,r=2*i-u,c(f(n+120),f(n),f(n-120))}function yt(n,t,i){return new nt(n,t,i)}function nt(n,t,i){this.h=n;this.c=t;this.l=i}function nu(n,t,i){return ot(i,Math.cos(n*=Math.PI/180)*t,Math.sin(n)*t)}function ot(n,t,i){return new tt(n,t,i)}function tt(n,t,i){this.l=n;this.a=t;this.b=i}function ye(n,t,i){var r=(n+16)/116,u=r+t/500,f=r-i/200;return u=tu(u)*dh,r=tu(r)*gh,f=tu(f)*nc,c(ru(3.2404542*u-1.5371385*r-.4985314*f),ru(-.969266*u+1.8760108*r+.041556*f),ru(.0556434*u-.2040259*r+1.0572252*f))}function pe(n,t,i){return yt(Math.atan2(i,t)/Math.PI*180,Math.sqrt(t*t+i*i),n)}function tu(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function iu(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ru(n){return Math.round(255*(n<=.00304?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function l(n){return bi(n,t),n}function we(n){return function(){return gi(n,this)}}function be(n){return function(){return tc(n,this)}}function ke(n,t){function i(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function f(){this.setAttributeNS(n.space,n.local,t)}function e(){var i=t.apply(this,arguments);i==null?this.removeAttribute(n):this.setAttribute(n,i)}function o(){var i=t.apply(this,arguments);i==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,i)}return n=d3.ns.qualify(n),t==null?n.local?r:i:typeof t=="function"?n.local?o:e:n.local?f:u}function de(n){return new RegExp("(?:^|\\s+)"+d3.requote(n)+"(?:\\s+|$)","g")}function ge(n,t){function r(){for(var r=-1;++r<i;)n[r](this,t)}function u(){for(var r=-1,u=t.apply(this,arguments);++r<i;)n[r](this,u)}n=n.trim().split(/\s+/).map(dl);var i=n.length;return typeof t=="function"?u:r}function dl(n){var t=de(n);return function(i,r){if(f=i.classList)return r?f.add(n):f.remove(n);var f=i.className,e=f.baseVal!=null,u=e?f.baseVal:f;r?(t.lastIndex=0,t.test(u)||(u=te(u+" "+n),e?f.baseVal=u:i.className=u)):u&&(u=te(u.replace(t," ")),e?f.baseVal=u:i.className=u)}}function no(n,t,i){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,i)}function f(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(n):this.style.setProperty(n,r,i)}return t==null?r:typeof t=="function"?f:u}function to(n,t){function i(){delete this[n]}function r(){this[n]=t}function u(){var i=t.apply(this,arguments);i==null?delete this[n]:this[n]=i}return t==null?i:typeof t=="function"?u:r}function uu(n){return{__data__:n}}function io(n){return function(){return ic(this,n)}}function gl(n){return arguments.length||(n=d3.ascending),function(t,i){return n(t&&t.__data__,i&&i.__data__)}}function ro(n,t,i){function u(){var t=this[r];t&&(this.removeEventListener(n,t,t.$),delete this[r])}function e(){function f(n){var i=d3.event;d3.event=n;o[0]=e.__data__;try{t.apply(e,o)}finally{d3.event=i}}var e=this,o=arguments;u.call(this);this.addEventListener(n,this[r]=f,f.$=i);f._=t}var r="__on"+n,f=n.indexOf(".");return f>0&&(n=n.substring(0,f)),t?e:u}function pt(n,t){for(var i=0,u=n.length;i<u;i++)for(var f=n[i],r=0,o=f.length,e;r<o;r++)(e=f[r])&&t(e,r,i);return n}function uo(n){return bi(n,p),n}function ui(n,t,i){bi(n,f);var r=new y,u=d3.dispatch("start","end"),e=ir;return n.id=t,n.time=i,n.tween=function(t,i){return arguments.length<2?r.get(t):(i==null?r.remove(t):r.set(t,i),n)},n.ease=function(t){return arguments.length?(e=typeof t=="function"?t:d3.ease.apply(d3,arguments),n):e},n.each=function(t,i){if(arguments.length<2)return na.call(n,t);u.on(t,i);return n},d3.timer(function(f){return pt(n,function(n,o){function v(f){return s.active>t?h():(s.active=t,r.forEach(function(t,i){(i=i.call(n,a,o))&&c.push(i)}),u.start.call(n,a,o),y(f)||d3.timer(y,0,i),1)}function y(i){if(s.active!==t)return h();for(var r=(i-l)/p,v=e(r),f=c.length;f>0;)c[--f].call(n,v);if(r>=1)return h(),ut=t,u.end.call(n,a,o),ut=0,1}function h(){return--s.count||delete n.__transition__,1}var c=[],l=n.delay,p=n.duration,s=(n=n.node).__transition__||(n.__transition__={active:0,count:0}),a=n.__data__;++s.count;l<=f?v(f):d3.timer(v,l,i)})},0,i),n}function na(n){var t=ut,i=ir,r=nr,u=tr;return ut=this.id,ir=this.ease(),pt(this,function(t,i,r){nr=t.delay;tr=t.duration;n.call(t=t.node,t.__data__,i,r)}),ut=t,ir=i,nr=r,tr=u,this}function ta(n,t,i){return i!=""&&at}function fi(n,t){return d3.tween(n,le(t))}function fu(){for(var i,r=Date.now(),n=w,t;n;)i=r-n.then,i>=n.delay&&(n.flush=n.callback(i)),n=n.next;t=fo()-r;t>24?(isFinite(t)&&(clearTimeout(ur),ur=setTimeout(fu,t)),rr=0):(rr=1,cf(fu))}function fo(){for(var t=null,n=w,i=Infinity;n;)n.flush?n=t?t.next=n.next:w=n.next:(i=Math.min(i,n.then+n.delay),n=(t=n).next);return i}function eo(n,t){var r=n.ownerSVGElement||n,i,u,f;return r.createSVGPoint?(i=r.createSVGPoint(),fr<0&&(window.scrollX||window.scrollY)&&(r=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0),u=r[0][0].getScreenCTM(),fr=!(u.f||u.e),r.remove()),fr?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]):(f=n.getBoundingClientRect(),[t.clientX-f.left-n.clientLeft,t.clientY-f.top-n.clientTop])}function wt(n){var t=n[0],i=n[n.length-1];return t<i?[t,i]:[i,t]}function ei(n){return n.rangeExtent?n.rangeExtent():wt(n.range())}function oi(n,t){var u=0,f=n.length-1,i=n[u],r=n[f],e;return r<i&&(e=u,u=f,f=e,e=i,i=r,r=e),(t=t(r-i))&&(n[u]=t.floor(i),n[f]=t.ceil(r)),n}function ia(){return Math}function oo(n,t,i,r){function f(){var f=Math.min(n.length,t.length)>2?ua:ra,s=r?kl:bl;return e=f(n,t,s,i),o=f(t,n,s,d3.interpolate),u}function u(n){return e(n)}var e,o;return u.invert=function(n){return o(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),f()):n},u.range=function(n){return arguments.length?(t=n,f()):t},u.rangeRound=function(n){return u.range(n).interpolate(d3.interpolateRound)},u.clamp=function(n){return arguments.length?(r=n,f()):r},u.interpolate=function(n){return arguments.length?(i=n,f()):i},u.ticks=function(t){return eu(n,t)},u.tickFormat=function(t){return ou(n,t)},u.nice=function(){return oi(n,ho),f()},u.copy=function(){return oo(n,t,i,r)},f()}function so(n,t){return d3.rebind(n,t,"range","rangeRound","interpolate","clamp")}function ho(n){return n=Math.pow(10,Math.round(Math.log(n)/Math.LN10)-1),n&&{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}}function co(n,t){var r=wt(n),f=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(f/t)/Math.LN10)),u=t/f*i;return u<=.15?i*=10:u<=.35?i*=5:u<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+i*.5,r[2]=i,r}function eu(n,t){return d3.range.apply(d3,co(n,t))}function ou(n,t){return d3.format(",."+Math.max(0,-Math.floor(Math.log(co(n,t)[2])/Math.LN10+.01))+"f")}function ra(n,t,i,r){var u=i(n[0],n[1]),f=r(t[0],t[1]);return function(n){return f(u(n))}}function ua(n,t,i,r){var e=[],o=[],u=0,f=Math.min(n.length,t.length)-1;for(n[f]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++u<=f;)e.push(i(n[u-1],n[u])),o.push(r(t[u-1],t[u]));return function(t){var i=d3.bisect(n,t,1,f)-1;return o[i](e[i](t))}}function lo(n,t){function i(i){return n(t(i))}var r=t.pow;return i.invert=function(t){return r(n.invert(t))},i.domain=function(u){return arguments.length?(t=u[0]<0?si:su,r=t.pow,n.domain(u.map(t)),i):n.domain().map(r)},i.nice=function(){return n.domain(oi(n.domain(),ia)),i},i.ticks=function(){var o=wt(n.domain()),u=[],f;if(o.every(isFinite)){var i=Math.floor(o[0]),e=Math.ceil(o[1]),s=r(o[0]),h=r(o[1]);if(t===si)for(u.push(r(i));i++<e;)for(f=9;f>0;f--)u.push(r(i)*f);else{for(;i<e;i++)for(f=1;f<10;f++)u.push(r(i)*f);u.push(r(i))}for(i=0;u[i]<s;i++);for(e=u.length;u[e-1]>h;e--);u=u.slice(i,e)}return u},i.tickFormat=function(n,u){if(arguments.length<2&&(u=rc),arguments.length<1)return u;var e=Math.max(.1,n/i.ticks().length),o=t===si?(f=-1e-12,Math.floor):(f=1e-12,Math.ceil),f;return function(n){return n/r(o(t(n)+f))<=e?u(n):""}},i.copy=function(){return lo(n.copy(),t)},so(i,n)}function su(n){return Math.log(n<0?0:n)/Math.LN10}function si(n){return-Math.log(n>0?0:-n)/Math.LN10}function ao(n,t){function i(t){return n(r(t))}var r=hi(t),u=hi(1/t);return i.invert=function(t){return u(n.invert(t))},i.domain=function(t){return arguments.length?(n.domain(t.map(r)),i):n.domain().map(u)},i.ticks=function(n){return eu(i.domain(),n)},i.tickFormat=function(n){return ou(i.domain(),n)},i.nice=function(){return i.domain(oi(i.domain(),ho))},i.exponent=function(n){if(!arguments.length)return t;var f=i.domain();return r=hi(t=n),u=hi(1/t),i.domain(f)},i.copy=function(){return ao(n.copy(),t)},so(i,n)}function hi(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function vo(n,t){function i(t){return r[((u.get(t)||u.set(t,n.push(t)))-1)%r.length]}function e(t,i){return d3.range(n.length).map(function(n){return t+i*n})}var u,r,f;return i.domain=function(r){if(!arguments.length)return n;n=[];u=new y;for(var e=-1,o=r.length,f;++e<o;)u.has(f=r[e])||u.set(f,n.push(f));return i[t.t].apply(i,t.a)},i.range=function(n){return arguments.length?(r=n,f=0,t={t:"range",a:arguments},i):r},i.rangePoints=function(u,o){arguments.length<2&&(o=0);var s=u[0],h=u[1],c=(h-s)/(Math.max(1,n.length-1)+o);return r=e(n.length<2?(s+h)/2:s+c*o/2,c),f=0,t={t:"rangePoints",a:arguments},i},i.rangeBands=function(u,o,s){arguments.length<2&&(o=0);arguments.length<3&&(s=o);var h=u[1]<u[0],l=u[+h],a=u[1-h],c=(a-l)/(n.length-o+2*s);return r=e(l+c*s,c),h&&r.reverse(),f=c*(1-o),t={t:"rangeBands",a:arguments},i},i.rangeRoundBands=function(u,o,s){arguments.length<2&&(o=0);arguments.length<3&&(s=o);var h=u[1]<u[0],c=u[+h],a=u[1-h],l=Math.floor((a-c)/(n.length-o+2*s)),v=a-c-(n.length-o)*l;return r=e(c+Math.round(v/2),l),h&&r.reverse(),f=Math.round(l*(1-o)),t={t:"rangeRoundBands",a:arguments},i},i.rangeBand=function(){return f},i.rangeExtent=function(){return wt(t.a[0])},i.copy=function(){return vo(n,t)},i.domain(n)}function yo(n,t){function u(){var u=0,e=n.length,f=t.length;for(r=[];++u<f;)r[u-1]=d3.quantile(n,u/f);return i}function i(n){return isNaN(n=+n)?NaN:t[d3.bisect(r,n)]}var r;return i.domain=function(t){return arguments.length?(n=t.filter(function(n){return!isNaN(n)}).sort(d3.ascending),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.quantiles=function(){return r},i.copy=function(){return yo(n,t)},u()}function po(n,t,i){function r(t){return i[Math.max(0,Math.min(e,Math.floor(f*(t-n))))]}function u(){return f=i.length/(t-n),e=i.length-1,r}var f,e;return r.domain=function(i){return arguments.length?(n=+i[0],t=+i[i.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(i=n,u()):i},r.copy=function(){return po(n,t,i)},u()}function wo(n,t){function i(i){return t[d3.bisect(n,i)]}return i.domain=function(t){return arguments.length?(n=t,i):n},i.range=function(n){return arguments.length?(t=n,i):t},i.copy=function(){return wo(n,t)},i}function bo(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=i.map(t),t):n},t.ticks=function(t){return eu(n,t)},t.tickFormat=function(t){return ou(n,t)},t.copy=function(){return bo(n)},t}function fa(n){return n.innerRadius}function ea(n){return n.outerRadius}function ko(n){return n.startAngle}function go(n){return n.endAngle}function ns(n){function t(t){function a(){c.push("M",r(n(e),h))}for(var c=[],e=[],s=-1,v=t.length,l,y=i(u),p=i(f);++s<v;)o.call(this,l=t[s],s)?e.push([+y.call(this,l,s),+p.call(this,l,s)]):e.length&&(a(),e=[]);return e.length&&a(),c.length?c.join(""):null}var u=hu,f=ts,o=ne,r=e,s=r.key,h=.7;return t.x=function(n){return arguments.length?(u=n,t):u},t.y=function(n){return arguments.length?(f=n,t):f},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(s=typeof n=="function"?r=n:(r=er.get(n)||e).key,t):s},t.tension=function(n){return arguments.length?(h=n,t):h},t}function hu(n){return n[0]}function ts(n){return n[1]}function e(n){return n.join("L")}function oa(n){return e(n)+"Z"}function cu(n){for(var i=0,u=n.length,t=n[0],r=[t[0],",",t[1]];++i<u;)r.push("V",(t=n[i])[1],"H",t[0]);return r.join("")}function lu(n){for(var i=0,u=n.length,t=n[0],r=[t[0],",",t[1]];++i<u;)r.push("H",(t=n[i])[0],"V",t[1]);return r.join("")}function sa(n,t){return n.length<4?e(n):n[1]+ci(n.slice(1,n.length-1),au(n,t))}function ha(n,t){return n.length<3?e(n):n[0]+ci((n.push(n[0]),n),au([n[n.length-2]].concat(n,[n[1]]),t))}function ca(n,t){return n.length<3?e(n):n[0]+ci(n,au(n,t))}function ci(n,t){var s,c;if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return e(n);var l=n.length!=t.length,f="",h=n[0],i=n[1],o=t[0],r=o,u=1;if(l&&(f+="Q"+(i[0]-o[0]*2/3)+","+(i[1]-o[1]*2/3)+","+i[0]+","+i[1],h=n[1],u=2),t.length>1)for(r=t[1],i=n[u],u++,f+="C"+(h[0]+o[0])+","+(h[1]+o[1])+","+(i[0]-r[0])+","+(i[1]-r[1])+","+i[0]+","+i[1],s=2;s<t.length;s++,u++)i=n[u],r=t[s],f+="S"+(i[0]-r[0])+","+(i[1]-r[1])+","+i[0]+","+i[1];return l&&(c=n[u],f+="Q"+(i[0]+r[0]*2/3)+","+(i[1]+r[1]*2/3)+","+c[0]+","+c[1]),f}function au(n,t){for(var u=[],f=(1-t)/2,r,e=n[0],i=n[1],o=1,s=n.length;++o<s;)r=e,e=i,i=n[o],u.push([f*(i[0]-r[0]),f*(i[1]-r[1])]);return u}function is(n){if(n.length<3)return e(n);var u=1,h=n.length,t=n[0],f=t[0],o=t[1],i=[f,f,f,(t=n[1])[0]],r=[o,o,o,t[1]],s=[f,",",o];for(bt(s,i,r);++u<h;)t=n[u],i.shift(),i.push(t[0]),r.shift(),r.push(t[1]),bt(s,i,r);for(u=-1;++u<2;)i.shift(),i.push(t[0]),r.shift(),r.push(t[1]),bt(s,i,r);return s.join("")}function la(n){if(n.length<4)return e(n);for(var f=[],i=-1,o=n.length,t,r=[0],u=[0];++i<3;)t=n[i],r.push(t[0]),u.push(t[1]);for(f.push(h(vt,r)+","+h(vt,u)),--i;++i<o;)t=n[i],r.shift(),r.push(t[0]),u.shift(),u.push(t[1]),bt(f,r,u);return f.join("")}function aa(n){for(var f,i=-1,e=n.length,o=e+4,t,r=[],u=[];++i<4;)t=n[i%e],r.push(t[0]),u.push(t[1]);for(f=[h(vt,r),",",h(vt,u)],--i;++i<o;)t=n[i%e],r.shift(),r.push(t[0]),u.shift(),u.push(t[1]),bt(f,r,u);return f.join("")}function va(n,t){var i=n.length-1;if(i)for(var e=n[0][0],o=n[0][1],s=n[i][0]-e,h=n[i][1]-o,u=-1,r,f;++u<=i;)r=n[u],f=u/i,r[0]=t*r[0]+(1-t)*(e+f*s),r[1]=t*r[1]+(1-t)*(o+f*h);return is(n)}function h(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function bt(n,t,i){n.push("C",h(fc,t),",",h(fc,i),",",h(ec,t),",",h(ec,i),",",h(vt,t),",",h(vt,i))}function vu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function ya(n){for(var t=0,e=n.length-1,i=[],f=n[0],r=n[1],u=i[0]=vu(f,r);++t<e;)i[t]=(u+(u=vu(f=r,r=n[t+1])))/2;return i[t]=u,i}function pa(n){for(var s=[],u,f,e,i,r=ya(n),t=-1,o=n.length-1;++t<o;)u=vu(n[t],n[t+1]),Math.abs(u)<1e-6?r[t]=r[t+1]=0:(f=r[t]/u,e=r[t+1]/u,i=f*f+e*e,i>9&&(i=u*3/Math.sqrt(i),r[t]=i*f,r[t+1]=i*e));for(t=-1;++t<=o;)i=(n[Math.min(o,t+1)][0]-n[Math.max(0,t-1)][0])/(6*(1+r[t]*r[t])),s.push([i||0,r[t]*i||0]);return s}function wa(n){return n.length<3?e(n):n[0]+ci(n,pa(n))}function rs(n){for(var t,u=-1,f=n.length,i,r;++u<f;)t=n[u],i=t[0],r=t[1]+b,t[0]=i*Math.cos(r),t[1]=i*Math.sin(r);return n}function us(n){function t(t){function b(){p.push("M",r(n(w),h),v,a(n(l.reverse()),h),"Z")}for(var p=[],l=[],w=[],e=-1,g=t.length,y,nt=i(o),tt=i(s),it=o===u?function(){return k}:i(u),rt=s===f?function(){return d}:i(f),k,d;++e<g;)c.call(this,y=t[e],e)?(l.push([k=+nt.call(this,y,e),d=+tt.call(this,y,e)]),w.push([+it.call(this,y,e),+rt.call(this,y,e)])):l.length&&(b(),l=[],w=[]);return l.length&&b(),p.length?p.join(""):null}var o=hu,u=hu,s=0,f=ts,c=ne,r=e,l=r.key,a=r,v="L",h=.7;return t.x=function(n){return arguments.length?(o=u=n,t):u},t.x0=function(n){return arguments.length?(o=n,t):o},t.x1=function(n){return arguments.length?(u=n,t):u},t.y=function(n){return arguments.length?(s=f=n,t):f},t.y0=function(n){return arguments.length?(s=n,t):s},t.y1=function(n){return arguments.length?(f=n,t):f},t.defined=function(n){return arguments.length?(c=n,t):c},t.interpolate=function(n){return arguments.length?(l=typeof n=="function"?r=n:(r=er.get(n)||e).key,a=r.reverse||r,v=r.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(h=n,t):h},t}function fs(n){return n.source}function es(n){return n.target}function ba(n){return n.radius}function os(n){return[n.x,n.y]}function ka(n){return function(){var t=n.apply(this,arguments),i=t[0],r=t[1]+b;return[i*Math.cos(r),i*Math.sin(r)]}}function da(){return 64}function ga(){return"circle"}function ss(n){var t=Math.sqrt(n/Math.PI);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function hs(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function cs(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function nv(n,t,i){if(u=[],i&&t.length>1){for(var o=wt(n.domain()),u,f=-1,h=t.length,s=(t[1]-t[0])/++i,r,e;++f<h;)for(r=i;--r>0;)(e=+t[f]-r*s)>=o[0]&&u.push(e);for(--f,r=0;++r<i&&(e=+t[f]+r*s)<o[1];)u.push(e)}return u}function tv(){ii||(ii=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var n=d3.event,t;try{ii.scrollTop=1e3;ii.dispatchEvent(n);t=1e3-ii.scrollTop}catch(i){t=n.wheelDelta||-n.detail*5}return t}function iv(n){for(var t=n.source,i=n.target,u=rv(t,i),r=[t],f;t!==u;)t=t.parent,r.push(t);for(f=r.length;i!==u;)r.splice(f,0,i),i=i.parent;return r}function ls(n){for(var i=[],t=n.parent;t!=null;)i.push(n),n=t,t=t.parent;return i.push(n),i}function rv(n,t){if(n===t)return n;for(var r=ls(n),u=ls(t),i=r.pop(),f=u.pop(),e=null;i===f;)e=i,i=r.pop(),f=u.pop();return e}function uv(n){n.fixed|=2}function fv(n){n.fixed&=1}function ev(n){n.fixed|=4}function ov(n){n.fixed&=3}function as(n,t,i){var f=0,e=0,u;if(n.charge=0,!n.leaf)for(var o=n.nodes,h=o.length,s=-1,r;++s<h;)(r=o[s],r!=null)&&(as(r,t,i),n.charge+=r.charge,f+=r.charge*r.cx,e+=r.charge*r.cy);n.point&&(n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5),u=t*i[n.point.index],n.charge+=n.pointCharge=u,f+=u*n.point.x,e+=u*n.point.y);n.cx=f/n.charge;n.cy=e/n.charge}function sv(){return 20}function hv(){return 1}function cv(n){return n.x}function lv(n){return n.y}function av(n,t,i){n.y0=t;n.y=i}function yu(n){return d3.range(n.length)}function pu(n){for(var t=-1,r=n[0].length,i=[];++t<r;)i[t]=0;return i}function vv(n){for(var t=1,i=0,r=n[0][1],u,f=n.length;t<f;++t)(u=n[t][1])>r&&(i=t,r=u);return i}function yv(n){return n.reduce(pv,0)}function pv(n,t){return n+t[1]}function wv(n,t){return vs(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function vs(n,t){for(var i=-1,r=+n[0],f=(n[1]-r)/t,u=[];++i<=t;)u[i]=f*i+r;return u}function bv(n){return[d3.min(n),d3.max(n)]}function kt(n,t){return d3.rebind(n,t,"sort","children","value"),n.links=ny,n.nodes=function(t){return sr=!0,(n.nodes=n)(t)},n}function kv(n){return n.children}function dv(n){return n.value}function gv(n,t){return t.value-n.value}function ny(n){return d3.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ty(n,t){return n.value-t.value}function wu(n,t){var i=n._pack_next;n._pack_next=t;t._pack_prev=n;t._pack_next=i;i._pack_prev=t}function ys(n,t){n._pack_next=t;t._pack_prev=n}function ps(n,t){var i=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return u*u-i*i-r*r>.001}function ws(n){function h(n){c=Math.min(n.x-n.r,c);l=Math.max(n.x+n.r,l);a=Math.min(n.y-n.r,a);v=Math.max(n.y+n.r,v)}if((u=n.children)&&(s=u.length)){var u,c=Infinity,l=-Infinity,a=Infinity,v=-Infinity,i,r,t,f,e,o,s;if(u.forEach(iy),i=u[0],i.x=-i.r,i.y=0,h(i),s>1&&(r=u[1],r.x=r.r,r.y=0,h(r),s>2))for(t=u[2],ks(i,r,t),h(t),wu(i,t),i._pack_prev=t,wu(t,r),r=i._pack_next,f=3;f<s;f++){ks(i,r,t=u[f]);var y=0,p=1,w=1;for(e=r._pack_next;e!==r;e=e._pack_next,p++)if(ps(e,t)){y=1;break}if(y==1)for(o=i._pack_prev;o!==e._pack_prev;o=o._pack_prev,w++)if(ps(o,t))break;y?(p<w||p==w&&r.r<i.r?ys(i,r=e):ys(i=o,r),f--):(wu(i,t),r=t,h(t))}var k=(c+l)/2,d=(a+v)/2,b=0;for(f=0;f<s;f++)t=u[f],t.x-=k,t.y-=d,b=Math.max(b,t.r+Math.sqrt(t.x*t.x+t.y*t.y));n.r=b;u.forEach(ry)}}function iy(n){n._pack_next=n._pack_prev=n}function ry(n){delete n._pack_next;delete n._pack_prev}function bs(n,t,i,r){var u=n.children,f,e;if(n.x=t+=r*n.x,n.y=i+=r*n.y,n.r*=r,u)for(f=-1,e=u.length;++f<e;)bs(u[f],t,i,r)}function ks(n,t,i){var r=n.r+i.r,f=t.x-n.x,e=t.y-n.y,u,o,s,h;r&&(f||e)?(u=t.r+i.r,o=f*f+e*e,u*=u,r*=r,s=.5+(r-u)/(2*o),h=Math.sqrt(Math.max(0,2*u*(r+o)-(r-=o)*r-u*u))/(2*o),i.x=n.x+s*f+h*e,i.y=n.y+s*e-h*f):(i.x=n.x+r,i.y=n.y)}function uy(n){return 1+d3.max(n,function(n){return n.y})}function fy(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function ds(n){var t=n.children;return t&&t.length?ds(t[0]):n}function gs(n){var t=n.children,i;return t&&(i=t.length)?gs(t[i-1]):n}function nh(n,t){return n.parent==t.parent?1:2}function bu(n){var t=n.children;return t&&t.length?t[0]:n._tree.thread}function ku(n){var t=n.children,i;return t&&(i=t.length)?t[i-1]:n._tree.thread}function li(n,t){var i=n.children,u,f,r;if(i&&(f=i.length))for(r=-1;++r<f;)t(u=li(i[r],t),n)>0&&(n=u);return n}function ey(n,t){return n.x-t.x}function oy(n,t){return t.x-n.x}function sy(n,t){return n.depth-t.depth}function a(n,t){function i(n,r){var u=n.children,f,e,o,s;if(u&&(s=u.length))for(e=null,o=-1;++o<s;)f=u[o],i(f,e),e=f;t(n,r)}i(n,null)}function hy(n){for(var i=0,f=0,r=n.children,u=r.length,t;--u>=0;)t=r[u]._tree,t.prelim+=i,t.mod+=i,i+=t.shift+(f+=t.change)}function cy(n,t,i){n=n._tree;t=t._tree;var r=i/(t.number-n.number);n.change+=r;t.change-=r;t.shift+=i;t.prelim+=i;t.mod+=i}function ly(n,t,i){return n._tree.ancestor.parent==t.parent?n._tree.ancestor:i}function du(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function th(n,t){var u=n.x+t[3],f=n.y+t[0],i=n.dx-t[1]-t[3],r=n.dy-t[0]-t[2];return i<0&&(u+=i/2,i=0),r<0&&(f+=r/2,r=0),{x:u,y:f,dx:i,dy:r}}function ih(n,t){function r(n,i){d3.text(n,t,function(n){i(n&&r.parse(n))})}function u(t){return t.map(f).join(n)}function f(n){return e.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var i=new RegExp("\r\n|["+n+"\r\n]","g"),e=new RegExp('["'+n+"\n]"),o=n.charCodeAt(0);return r.parse=function(n){var t;return r.parseRows(n,function(n,i){if(i){for(var u={},r=-1,f=t.length;++r<f;)u[t[r]]=n[r];return u}return t=n,null})},r.parseRows=function(n,t){function s(){var r,t,s,f;if(i.lastIndex>=n.length)return e;if(u)return u=!1,h;if(r=i.lastIndex,n.charCodeAt(r)===34){for(t=r;t++<n.length;)if(n.charCodeAt(t)===34){if(n.charCodeAt(t+1)!==34)break;t++}return i.lastIndex=t+2,s=n.charCodeAt(t+1),s===13?(u=!0,n.charCodeAt(t+2)===10&&i.lastIndex++):s===10&&(u=!0),n.substring(r+1,t).replace(/""/g,'"')}return(f=i.exec(n),f)?(u=f[0].charCodeAt(0)!==o,n.substring(r,f.index)):(i.lastIndex=n.length,n.substring(r))}var h={},e={},c=[],l=0,r,u,f;for(i.lastIndex=0;(r=s())!==e;){for(f=[];r!==h&&r!==e;)f.push(r),r=s();(!t||(f=t(f,l++)))&&c.push(f)}return c},r.format=function(n){return n.map(u).join("\n")},r}function ai(n,t){return function(i){return i&&n.hasOwnProperty(i.type)?n[i.type](i):t}}function gu(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function vi(n,t){pf.hasOwnProperty(n.type)&&pf[n.type](n,t)}function ay(n,t){vi(n.geometry,t)}function vy(n,t){for(var r=n.features,i=0,u=r.length;i<u;i++)vi(r[i].geometry,t)}function yy(n,t){for(var r=n.geometries,i=0,u=r.length;i<u;i++)vi(r[i],t)}function rh(n,t){for(var r=n.coordinates,i=0,u=r.length;i<u;i++)t.apply(null,r[i])}function py(n,t){for(var u=n.coordinates,i=0,e=u.length;i<e;i++)for(var f=u[i],r=0,o=f.length;r<o;r++)t.apply(null,f[r])}function wy(n,t){for(var u=n.coordinates,i=0,e=u.length;i<e;i++)for(var f=u[i][0],r=0,o=f.length;r<o;r++)t.apply(null,f[r])}function by(n,t){t.apply(null,n.coordinates)}function ky(n,t){for(var r=n.coordinates[0],i=0,u=r.length;i<u;i++)t.apply(null,r[i])}function dy(n){return n.source}function gy(n){return n.target}function uh(){function i(i){var r=Math.sin(i*=t)*h,u=Math.sin(t-i)*h,f=u*l+r*y,o=u*a+r*p,c=u*e+r*s;return[Math.atan2(o,f)/n,Math.atan2(c,Math.sqrt(f*f+o*o))/n]}var f,c,r,e,l,a,o,v,u,s,y,p,t,h;return i.distance=function(){return t==null&&(h=1/Math.sin(t=Math.acos(Math.max(-1,Math.min(1,e*s+r*u*Math.cos(o-f)))))),t},i.source=function(u){var o=Math.cos(f=u[0]*n),s=Math.sin(f);return r=Math.cos(c=u[1]*n),e=Math.sin(c),l=r*o,a=r*s,t=null,i},i.target=function(r){var f=Math.cos(o=r[0]*n),e=Math.sin(o);return u=Math.cos(v=r[1]*n),s=Math.sin(v),y=u*f,p=u*e,t=null,i},i}function fh(n,t){var i=uh().source(n).target(t);return i.distance(),i}function np(n){for(var t=0,i=0;;){if(n(t,i))return[t,i];t===0?(t=i+1,i=0):(t=t-1,i=i+1)}}function tp(n,t,i,r){var u,f,e,o,s,h,c;return u=r[n],f=u[0],e=u[1],u=r[t],o=u[0],s=u[1],u=r[i],h=u[0],c=u[1],(c-e)*(o-f)-(s-e)*(h-f)>0}function nf(n,t,i){return(i[0]-t[0])*(n[1]-t[1])<(i[1]-t[1])*(n[0]-t[0])}function eh(n,t,i,r){var u=n[0],v=t[0],e=i[0],y=r[0],f=n[1],p=t[1],o=i[1],w=r[1],b=u-e,s=v-u,h=y-e,k=f-o,c=p-f,l=w-o,a=(h*k-l*b)/(l*s-h*c);return[u+a*s,f+a*c]}function oh(n,t){var l={list:n.map(function(n,t){return{index:t,x:n[0],y:n[1]}}).sort(function(n,t){return n.y<t.y?-1:n.y>t.y?1:n.x<t.x?-1:n.x>t.x?1:0}),bottomSite:null},i={list:[],leftEnd:null,rightEnd:null,init:function(){i.leftEnd=i.createHalfEdge(null,"l");i.rightEnd=i.createHalfEdge(null,"l");i.leftEnd.r=i.rightEnd;i.rightEnd.l=i.leftEnd;i.list.unshift(i.leftEnd,i.rightEnd)},createHalfEdge:function(n,t){return{edge:n,side:t,vertex:null,l:null,r:null}},insert:function(n,t){t.l=n;t.r=n.r;n.r.l=t;n.r=t},leftBound:function(n){var t=i.leftEnd;do t=t.r;while(t!=i.rightEnd&&e.rightOf(t,n));return t.l},del:function(n){n.l.r=n.r;n.r.l=n.l;n.edge=null},right:function(n){return n.r},left:function(n){return n.l},leftRegion:function(n){return n.edge==null?l.bottomSite:n.edge.region[n.side]},rightRegion:function(n){return n.edge==null?l.bottomSite:n.edge.region[hr[n.side]]}},e={bisect:function(n,t){var u={region:{l:n,r:t},ep:{l:null,r:null}},i=t.x-n.x,r=t.y-n.y,f=i>0?i:-i,e=r>0?r:-r;return u.c=n.x*i+n.y*r+(i*i+r*r)*.5,f>e?(u.a=1,u.b=r/i,u.c/=i):(u.b=1,u.a=i/r,u.c/=r),u},intersect:function(n,t){var i=n.edge,r=t.edge,u,h;if(!i||!r||i.region.r==r.region.r||(u=i.a*r.b-i.b*r.a,Math.abs(u)<1e-10))return null;var c=(i.c*r.b-r.c*i.b)/u,l=(r.c*i.a-i.c*r.a)/u,e=i.region.r,o=r.region.r,f,s;return(e.y<o.y||e.y==o.y&&e.x<o.x?(f=n,s=i):(f=t,s=r),h=c>=s.region.r.x,h&&f.side==="l"||!h&&f.side==="r")?null:{x:c,y:l}},rightOf:function(n,t){var i=n.edge,u=i.region.r,f=t.x>u.x,h;if(f&&n.side==="l")return 1;if(!f&&n.side==="r")return 0;if(i.a===1){var e=t.y-u.y,o=t.x-u.x,s=0,r=0;!f&&i.b<0||f&&i.b>=0?r=s=e>=i.b*o:(r=t.x+t.y*i.b>i.c,i.b<0&&(r=!r),r||(s=1));s||(h=u.x-i.region.l.x,r=i.b*(o*o-e*e)<h*e*(1+2*o/h+i.b*i.b),i.b<0&&(r=!r))}else{var c=i.c-i.a*t.x,l=t.y-c,a=t.x-u.x,v=c-u.y;r=l*l>a*a+v*v}return n.side==="l"?r:!r},endPoint:function(n,i,r){(n.ep[i]=r,n.ep[hr[i]])&&t(n)},distance:function(n,t){var i=n.x-t.x,r=n.y-t.y;return Math.sqrt(i*i+r*r)}},u={list:[],insert:function(n,t,i){var f;n.vertex=t;n.ystar=t.y+i;for(var r=0,e=u.list,o=e.length;r<o;r++)if(f=e[r],n.ystar>f.ystar||n.ystar==f.ystar&&t.x>f.vertex.x)continue;else break;e.splice(r,0,n)},del:function(n){for(var t=0,i=u.list,r=i.length;t<r&&i[t]!=n;++t);i.splice(t,1)},empty:function(){return u.list.length===0},nextEvent:function(n){for(var t=0,i=u.list,r=i.length;t<r;++t)if(i[t]==n)return i[t+1];return null},min:function(){var n=u.list[0];return{x:n.vertex.x,y:n.ystar}},extractMin:function(){return u.list.shift()}},s,p,r,h,v,k,o,c,y,d,f,w,a,b;for(i.init(),l.bottomSite=l.list.shift(),s=l.list.shift();;)if(u.empty()||(p=u.min()),s&&(u.empty()||s.y<p.y||s.y==p.y&&s.x<p.x))r=i.leftBound(s),h=i.right(r),c=i.rightRegion(r),a=e.bisect(c,s),o=i.createHalfEdge(a,"l"),i.insert(r,o),f=e.intersect(r,o),f&&(u.del(r),u.insert(r,f,e.distance(f,s))),r=o,o=i.createHalfEdge(a,"r"),i.insert(r,o),f=e.intersect(o,h),f&&u.insert(o,f,e.distance(f,s)),s=l.list.shift();else if(u.empty())break;else r=u.extractMin(),v=i.left(r),h=i.right(r),k=i.right(h),c=i.leftRegion(r),y=i.rightRegion(h),w=r.vertex,e.endPoint(r.edge,r.side,w),e.endPoint(h.edge,h.side,w),i.del(r),u.del(h),i.del(h),b="l",c.y>y.y&&(d=c,c=y,y=d,b="r"),a=e.bisect(c,y),o=i.createHalfEdge(a,b),i.insert(v,o),e.endPoint(a,hr[b],w),f=e.intersect(v,o),f&&(u.del(v),u.insert(v,f,e.distance(f,c))),f=e.intersect(o,k),f&&u.insert(o,f,e.distance(f,c));for(r=i.right(i.leftEnd);r!=i.rightEnd;r=i.right(r))t(r.edge)}function sh(){return{leaf:!0,nodes:[],point:null}}function dt(n,t,i,r,u,f){if(!n(t,i,r,u,f)){var o=(i+u)*.5,s=(r+f)*.5,e=t.nodes;e[0]&&dt(n,e[0],i,r,o,s);e[1]&&dt(n,e[1],o,r,u,s);e[2]&&dt(n,e[2],i,s,o,f);e[3]&&dt(n,e[3],o,s,u,f)}}function ip(n){return{x:n[0],y:n[1]}}function it(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function hh(n){return n.substring(0,3)}function yi(n,t,i,r){for(var u,f,e=0,o=t.length,s=i.length;e<o;){if(r>=s)return-1;if(u=t.charCodeAt(e++),u==37){if(f=dw[t.charAt(e++)],!f||(r=f(n,i,r))<0)return-1}else if(u!=i.charCodeAt(r++))return-1}return r}function pi(n){return new RegExp("^(?:"+n.map(d3.requote).join("|")+")","i")}function ch(n){for(var i=new y,t=-1,r=n.length;++t<r;)i.set(n[t].toLowerCase(),t);return i}function rp(n,t,i){pc.lastIndex=0;var r=pc.exec(t.substring(i));return r?i+=r[0].length:-1}function up(n,t,i){yc.lastIndex=0;var r=yc.exec(t.substring(i));return r?i+=r[0].length:-1}function fp(n,t,i){bc.lastIndex=0;var r=bc.exec(t.substring(i));return r?(n.m=kw.get(r[0].toLowerCase()),i+=r[0].length):-1}function ep(n,t,i){wc.lastIndex=0;var r=wc.exec(t.substring(i));return r?(n.m=bw.get(r[0].toLowerCase()),i+=r[0].length):-1}function op(n,t,i){return yi(n,lr.c.toString(),t,i)}function sp(n,t,i){return yi(n,lr.x.toString(),t,i)}function hp(n,t,i){return yi(n,lr.X.toString(),t,i)}function cp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+4));return r?(n.y=+r[0],i+=r[0].length):-1}function lp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.y=ap(+r[0]),i+=r[0].length):-1}function ap(n){return n+(n>68?1900:2e3)}function vp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.m=r[0]-1,i+=r[0].length):-1}function lh(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.d=+r[0],i+=r[0].length):-1}function ah(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.H=+r[0],i+=r[0].length):-1}function yp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.M=+r[0],i+=r[0].length):-1}function pp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+2));return r?(n.S=+r[0],i+=r[0].length):-1}function wp(n,t,i){u.lastIndex=0;var r=u.exec(t.substring(i,i+3));return r?(n.L=+r[0],i+=r[0].length):-1}function bp(n,t,i){var r=gw.get(t.substring(i,i+=2).toLowerCase());return r==null?-1:(n.p=r,i)}function kp(n){var t=n.getTimezoneOffset(),i=t>0?"-":"+",r=~~(Math.abs(t)/60),u=Math.abs(t)%60;return i+s(r)+s(u)}function tf(n){return n.toISOString()}function rt(n,t,i){function o(t){var i=n(t),r=e(i,1);return t-i<r-t?i:r}function f(i){return t(i=n(new r(i-1)),1),i}function e(n,i){return t(n=new r(+n),i),n}function s(n,r,u){var e=f(n),o=[];if(u>1)while(e<r)i(e)%u||o.push(new Date(+e)),t(e,1);else while(e<r)o.push(new Date(+e)),t(e,1);return o}function h(n,t,i){try{r=it;var u=new it;return u._=n,s(u,t,i)}finally{r=Date}}n.floor=n;n.round=o;n.ceil=f;n.offset=e;n.range=s;var u=n.utc=wi(n);return u.floor=u,u.round=wi(o),u.ceil=wi(f),u.offset=wi(e),u.range=h,n}function wi(n){return function(t,i){try{r=it;var u=new it;return u._=t,n(u,i)._}finally{r=Date}}}function rf(n,t,i){function r(t){return n(t)}return r.invert=function(t){return uf(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(uf)},r.nice=function(n){return r.domain(oi(r.domain(),function(){return n}))},r.ticks=function(i,u){var e=dp(r.domain());if(typeof i!="function"){var s=e[1]-e[0],o=s/i,f=d3.bisect(ar,o);if(f==ar.length)return t.year(e,i);if(!f)return n.ticks(i).map(uf);Math.log(o/ar[f-1])<Math.log(ar[f]/o)&&--f;i=t[f];u=i[1];i=i[0].range}return i(e[0],new Date(+e[1]+1),u)},r.tickFormat=function(){return i},r.copy=function(){return rf(n.copy(),t,i)},d3.rebind(r,n,"range","rangeRound","interpolate","clamp")}function dp(n){var t=n[0],i=n[n.length-1];return t<i?[t,i]:[i,t]}function uf(n){return new Date(n)}function vh(n){return function(t){for(var r=n.length-1,i=n[r];!i[1](t);)i=n[--r];return i[0](t)}}function ff(n){var t=new Date(n,0,1);return t.setFullYear(n),t}function gp(n){var t=n.getFullYear(),i=ff(t),r=ff(t+1);return t+(n-i)/(r-i)}function ef(n){var t=new Date(Date.UTC(n,0,1));return t.setUTCFullYear(n),t}function nw(n){var t=n.getUTCFullYear(),i=ef(t),r=ef(t+1);return t+(n-i)/(r-i)}var of,yh,st,bi,ht,ph,sf,wh,ki,hf,kh,gt,ni,t,lt,p,at,w,rr,ur,cf,fr,rc,b,uc,er,lf,ti,af,oc,or,ii,vf,yf,sc,hc,sr,n,pf,cc,lc,hr,r,wf,df;Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(ob){of=CSSStyleDeclaration.prototype;yh=of.setProperty;of.setProperty=function(n,t,i){yh.call(this,n,t+"",i)}}d3={version:"2.10.2"};st=tl;try{st(document.documentElement.childNodes)[0].nodeType}catch(sb){st=nl}bi=[].__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var i in t)n[i]=t[i]};d3.map=function(n){var t=new y;for(var i in n)t.set(i,n[i]);return t};gc(y,{has:function(n){return ht+n in this},get:function(n){return this[ht+n]},set:function(n,t){return this[ht+n]=t},remove:function(n){return n=ht+n,n in this&&delete this[n]},keys:function(){var n=[];return this.forEach(function(t){n.push(t)}),n},values:function(){var n=[];return this.forEach(function(t,i){n.push(i)}),n},entries:function(){var n=[];return this.forEach(function(t,i){n.push({key:t,value:i})}),n},forEach:function(n){for(var t in this)t.charCodeAt(0)===ph&&n.call(this,t.substring(1),this[t])}});ht="\0";ph=ht.charCodeAt(0);d3.functor=i;d3.rebind=function(n,t){for(var i=1,u=arguments.length,r;++i<u;)n[r=arguments[i]]=rl(n,t,t[r]);return n};d3.ascending=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN};d3.descending=function(n,t){return t<n?-1:t>n?1:t>=n?0:NaN};d3.mean=function(n,t){var e=n.length,u,i=0,r=-1,f=0;if(arguments.length===1)while(++r<e)vr(u=n[r])&&(i+=(u-i)/++f);else while(++r<e)vr(u=t.call(n,n[r],r))&&(i+=(u-i)/++f);return f?i:undefined};d3.median=function(n,t){return arguments.length>1&&(n=n.map(t)),n=n.filter(vr),n.length?d3.quantile(n.sort(d3.ascending),.5):undefined};d3.min=function(n,t){var r=-1,f=n.length,i,u;if(arguments.length===1){while(++r<f&&((i=n[r])==null||i!=i))i=undefined;while(++r<f)(u=n[r])!=null&&i>u&&(i=u)}else{while(++r<f&&((i=t.call(n,n[r],r))==null||i!=i))i=undefined;while(++r<f)(u=t.call(n,n[r],r))!=null&&i>u&&(i=u)}return i};d3.max=function(n,t){var r=-1,f=n.length,i,u;if(arguments.length===1){while(++r<f&&((i=n[r])==null||i!=i))i=undefined;while(++r<f)(u=n[r])!=null&&u>i&&(i=u)}else{while(++r<f&&((i=t.call(n,n[r],r))==null||i!=i))i=undefined;while(++r<f)(u=t.call(n,n[r],r))!=null&&u>i&&(i=u)}return i};d3.extent=function(n,t){var r=-1,e=n.length,i,u,f;if(arguments.length===1){while(++r<e&&((i=f=n[r])==null||i!=i))i=f=undefined;while(++r<e)(u=n[r])!=null&&(i>u&&(i=u),f<u&&(f=u))}else{while(++r<e&&((i=f=t.call(n,n[r],r))==null||i!=i))i=undefined;while(++r<e)(u=t.call(n,n[r],r))!=null&&(i>u&&(i=u),f<u&&(f=u))}return[i,f]};d3.random={normal:function(n,t){var i=arguments.length;return i<2&&(t=1),i<1&&(n=0),function(){var r,u,i;do r=Math.random()*2-1,u=Math.random()*2-1,i=r*r+u*u;while(!i||i>1);return n+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(n,t){var i=arguments.length,r;return i<2&&(t=1),i<1&&(n=0),r=d3.random.normal(),function(){return Math.exp(n+t*r())}},irwinHall:function(n){return function(){for(var t=0,i=0;i<n;i++)t+=Math.random();return t/n}}};d3.sum=function(n,t){var u=0,f=n.length,r,i=-1;if(arguments.length===1)while(++i<f)isNaN(r=+n[i])||(u+=r);else while(++i<f)isNaN(r=+t.call(n,n[i],i))||(u+=r);return u};d3.quantile=function(n,t){var u=(n.length-1)*t+1,i=Math.floor(u),r=n[i-1],f=u-i;return f?r+f*(n[i]-r):r};d3.transpose=function(n){return d3.zip.apply(d3,n)};d3.zip=function(){var n,i,f;if(!(i=arguments.length))return[];for(var t=-1,r=d3.min(arguments,ul),u=new Array(r);++t<r;)for(n=-1,f=u[t]=new Array(i);++n<i;)f[n]=arguments[n][t];return u};d3.bisector=function(n){return{left:function(t,i,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);r<u;){var f=r+u>>>1;n.call(t,t[f],f)<i?r=f+1:u=f}return r},right:function(t,i,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);r<u;){var f=r+u>>>1;i<n.call(t,t[f],f)?u=f:r=f+1}return r}}};sf=d3.bisector(function(n){return n});d3.bisectLeft=sf.left;d3.bisect=d3.bisectRight=sf.right;d3.first=function(n,t){var r=0,f=n.length,i=n[0],u;for(arguments.length===1&&(t=d3.ascending);++r<f;)t.call(n,i,u=n[r])>0&&(i=u);return i};d3.last=function(n,t){var r=0,f=n.length,i=n[0],u;for(arguments.length===1&&(t=d3.ascending);++r<f;)t.call(n,i,u=n[r])<=0&&(i=u);return i};d3.nest=function(){function i(f,e){if(e>=t.length)return u?u.call(n,f):r?f.sort(r):f;for(var h=-1,v=f.length,p=t[e++],c,o,s=new y,l,a={};++h<v;)(l=s.get(c=p(o=f[h])))?l.push(o):s.set(c,[o]);return s.forEach(function(n,t){a[n]=i(t,e)}),a}function f(n,i){if(i>=t.length)return n;var r=[],u=e[i++];for(var o in n)r.push({key:o,values:f(n[o],i)});return u&&r.sort(function(n,t){return u(n.key,t.key)}),r}var n={},t=[],e=[],r,u;return n.map=function(n){return i(n,0)},n.entries=function(n){return f(i(n,0),0)},n.key=function(i){return t.push(i),n},n.sortKeys=function(i){return e[t.length-1]=i,n},n.sortValues=function(t){return r=t,n},n.rollup=function(t){return u=t,n},n};d3.keys=function(n){var t=[];for(var i in n)t.push(i);return t};d3.values=function(n){var t=[];for(var i in n)t.push(n[i]);return t};d3.entries=function(n){var t=[];for(var i in n)t.push({key:i,value:n[i]});return t};d3.permute=function(n,t){for(var r=[],i=-1,u=t.length;++i<u;)r[i]=n[t[i]];return r};d3.merge=function(n){return Array.prototype.concat.apply([],n)};d3.split=function(n,t){var u=[],i=[],f,r=-1,e=n.length;for(arguments.length<2&&(t=fl);++r<e;)t.call(i,f=n[r],r)?i=[]:(i.length||u.push(i),i.push(f));return u};d3.range=function(n,t,i){if(arguments.length<3&&(i=1,arguments.length<2&&(t=n,n=0)),(t-n)/i==Infinity)throw new Error("infinite range");var f=[],r=el(Math.abs(i)),e=-1,u;if(n*=r,t*=r,i*=r,i<0)while((u=n+i*++e)>t)f.push(u/r);else while((u=n+i*++e)<t)f.push(u/r);return f};d3.requote=function(n){return n.replace(wh,"\\$&")};wh=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};d3.xhr=function(n,t,i){var r=new XMLHttpRequest;arguments.length<3?(i=t,t=null):t&&r.overrideMimeType&&r.overrideMimeType(t);r.open("GET",n,!0);t&&r.setRequestHeader("Accept",t);r.onreadystatechange=function(){if(r.readyState===4){var n=r.status;i(!n&&r.response||n>=200&&n<300||n===304?r:null)}};r.send(null)};d3.text=function(n,t,i){function r(n){i(n&&n.responseText)}arguments.length<3&&(i=t,t=null);d3.xhr(n,t,r)};d3.json=function(n,t){d3.text(n,"application/json",function(n){t(n?JSON.parse(n):null)})};d3.html=function(n,t){d3.text(n,"text/html",function(n){if(n!=null){var i=document.createRange();i.selectNode(document.body);n=i.createContextualFragment(n)}t(n)})};d3.xml=function(n,t,i){function r(n){i(n&&n.responseXML)}arguments.length<3&&(i=t,t=null);d3.xhr(n,t,r)};ki={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:ki,qualify:function(n){var t=n.indexOf(":"),i=n;return t>=0&&(i=n.substring(0,t),n=n.substring(t+1)),ki.hasOwnProperty(i)?{space:ki[i],local:n}:n}};d3.dispatch=function(){for(var n=new yr,t=-1,i=arguments.length;++t<i;)n[arguments[t]]=ie(n);return n};yr.prototype.on=function(n,t){var i=n.indexOf("."),r="";return i>0&&(r=n.substring(i+1),n=n.substring(0,i)),arguments.length<2?this[n].on(r):this[n].on(r,t)};d3.format=function(n){var i=tw.exec(n),s=i[1]||" ",l=i[3]||"",h=i[5],u=+i[6],e=i[7],r=i[8],t=i[9],f=1,o="",c=!1;r&&(r=+r.substring(1));h&&(s="0",e&&(u-=Math.floor((u-1)/4)));switch(t){case"n":e=!0;t="g";break;case"%":f=100;o="%";t="f";break;case"p":f=100;o="%";t="r";break;case"d":c=!0;r=0;break;case"s":f=-1;t="r"}return t!="r"||r||(t="g"),t=iw.get(t)||ol,function(n){var a,v,i;return c&&n%1?"":(a=n<0&&(n=-n)?"-":l,f<0?(v=d3.formatPrefix(n,r),n=v.scale(n),o=v.symbol):n*=f,n=t(n,r),h?(i=n.length+a.length,i<u&&(n=new Array(u-i+1).join(s)+n),e&&(n=ue(n)),n=a+n):(e&&(n=ue(n)),n=a+n,i=n.length,i<u&&(n=new Array(u-i+1).join(s)+n)),n+o)}};var tw=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,iw=d3.map({g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return d3.round(n,t=re(n,t)).toFixed(Math.max(0,Math.min(20,t)))}}),rw=["y","z","a","f","p","n","Î¼","m","","k","M","G","T","P","E","Z","Y"].map(sl);d3.formatPrefix=function(n,t){var i=0;return n&&(n<0&&(n*=-1),t&&(n=d3.round(n,re(n,t))),i=1+Math.floor(1e-12+Math.log(n)/Math.LN10),i=Math.max(-24,Math.min(24,Math.floor((i<=0?i+1:i-1)/3)*3))),rw[8+i/3]};var uw=wr(2),fw=wr(3),bh=function(){return pr},ew=d3.map({linear:bh,poly:wr,quad:function(){return uw},cubic:function(){return fw},sin:function(){return cl},exp:function(){return ll},circle:function(){return al},elastic:vl,back:yl,bounce:function(){return pl}}),ow=d3.map({"in":pr,out:fe,"in-out":ee,"out-in":function(n){return ee(fe(n))}});d3.ease=function(n){var t=n.indexOf("-"),i=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return i=ew.get(i)||bh,r=ow.get(r)||pr,hl(r(i.apply(null,Array.prototype.slice.call(arguments,1))))};d3.event=null;d3.transform=function(n){var t=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(n){t.setAttribute("transform",n);var i=t.transform.baseVal.consolidate();return new se(i?i.matrix:kh)})(n)};se.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};hf=180/Math.PI;kh={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(n,t){for(var i=d3.interpolators.length,r;--i>=0&&!(r=d3.interpolators[i](n,t)););return r};d3.interpolateNumber=function(n,t){return t-=n,function(i){return n+t*i}};d3.interpolateRound=function(n,t){return t-=n,function(i){return Math.round(n+t*i)}};d3.interpolateString=function(n,t){var s,u,f,h=0,c=0,r=[],e=[],o,i;for(gt.lastIndex=0,u=0;s=gt.exec(t);++u)s.index&&r.push(t.substring(h,c=s.index)),e.push({i:r.length,x:s[0]}),r.push(null),h=gt.lastIndex;for(h<t.length&&r.push(t.substring(h)),u=0,o=e.length;(s=gt.exec(n))&&u<o;++u)if(i=e[u],i.x==s[0]){if(i.i)if(r[i.i+1]==null)for(r[i.i-1]+=i.x,r.splice(i.i,1),f=u+1;f<o;++f)e[f].i--;else for(r[i.i-1]+=i.x+r[i.i+1],r.splice(i.i,2),f=u+1;f<o;++f)e[f].i-=2;else if(r[i.i+1]==null)r[i.i]=i.x;else for(r[i.i]=i.x+r[i.i+1],r.splice(i.i+1,1),f=u+1;f<o;++f)e[f].i--;e.splice(u,1);o--;u--}else i.x=d3.interpolateNumber(parseFloat(s[0]),parseFloat(i.x));while(u<o)i=e.pop(),r[i.i+1]==null?r[i.i]=i.x:(r[i.i]=i.x+r[i.i+1],r.splice(i.i+1,1)),o--;return r.length===1?r[0]==null?e[0].x:function(){return t}:function(n){for(u=0;u<o;++u)r[(i=e[u]).i]=i.x(n);return r.join("")}};d3.interpolateTransform=function(n,t){var i=[],e=[],o,h=d3.transform(n),c=d3.transform(t),l=h.translate,r=c.translate,s=h.rotate,u=c.rotate,y=h.skew,a=c.skew,v=h.scale,f=c.scale;return l[0]!=r[0]||l[1]!=r[1]?(i.push("translate(",null,",",null,")"),e.push({i:1,x:d3.interpolateNumber(l[0],r[0])},{i:3,x:d3.interpolateNumber(l[1],r[1])})):r[0]||r[1]?i.push("translate("+r+")"):i.push(""),s!=u?(s-u>180?u+=360:u-s>180&&(s+=360),e.push({i:i.push(i.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(s,u)})):u&&i.push(i.pop()+"rotate("+u+")"),y!=a?e.push({i:i.push(i.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(y,a)}):a&&i.push(i.pop()+"skewX("+a+")"),v[0]!=f[0]||v[1]!=f[1]?(o=i.push(i.pop()+"scale(",null,",",null,")"),e.push({i:o-4,x:d3.interpolateNumber(v[0],f[0])},{i:o-2,x:d3.interpolateNumber(v[1],f[1])})):(f[0]!=1||f[1]!=1)&&i.push(i.pop()+"scale("+f+")"),o=e.length,function(n){for(var t=-1,r;++t<o;)i[(r=e[t]).i]=r.x(n);return i.join("")}};d3.interpolateRgb=function(n,t){n=d3.rgb(n);t=d3.rgb(t);var i=n.r,r=n.g,u=n.b,f=t.r-i,e=t.g-r,o=t.b-u;return function(n){return"#"+ft(Math.round(i+f*n))+ft(Math.round(r+e*n))+ft(Math.round(u+o*n))}};d3.interpolateHsl=function(n,t){n=d3.hsl(n);t=d3.hsl(t);var r=n.h,u=n.s,f=n.l,i=t.h-r,e=t.s-u,o=t.l-f;return i>180?i-=360:i<-180&&(i+=360),function(n){return ri(r+i*n,u+e*n,f+o*n)+""}};d3.interpolateLab=function(n,t){n=d3.lab(n);t=d3.lab(t);var i=n.l,r=n.a,u=n.b,f=t.l-i,e=t.a-r,o=t.b-u;return function(n){return ye(i+f*n,r+e*n,u+o*n)+""}};d3.interpolateHcl=function(n,t){n=d3.hcl(n);t=d3.hcl(t);var r=n.h,u=n.c,f=n.l,i=t.h-r,e=t.c-u,o=t.l-f;return i>180?i-=360:i<-180&&(i+=360),function(n){return nu(r+i*n,u+e*n,f+o*n)+""}};d3.interpolateArray=function(n,t){for(var u=[],r=[],e=n.length,o=t.length,f=Math.min(n.length,t.length),i=0;i<f;++i)u.push(d3.interpolate(n[i],t[i]));for(;i<e;++i)r[i]=n[i];for(;i<o;++i)r[i]=t[i];return function(n){for(i=0;i<f;++i)r[i]=u[i](n);return r}};d3.interpolateObject=function(n,t){var u={},r={};for(var i in n)i in t?u[i]=le(i)(n[i],t[i]):r[i]=n[i];for(i in t)i in n||(r[i]=t[i]);return function(n){for(i in u)r[i]=u[i](n);return r}};gt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(n,t){return t instanceof Array&&d3.interpolateArray(n,t)},function(n,t){return(typeof n=="string"||typeof t=="string")&&d3.interpolateString(n+"",t+"")},function(n,t){return(typeof t=="string"?ni.has(t)||/^(#|rgb\(|hsl\()/.test(t):t instanceof d||t instanceof g)&&d3.interpolateRgb(n,t)},function(n,t){return!isNaN(n=+n)&&!isNaN(t=+t)&&d3.interpolateNumber(n,t)}];d3.rgb=function(n,t,i){return arguments.length===1?n instanceof d?c(n.r,n.g,n.b):kr(""+n,c,ri):c(~~n,~~t,~~i)};d.prototype.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var i=this.r,r=this.g,u=this.b,t=30;return!i&&!r&&!u?c(t,t,t):(i&&i<t&&(i=t),r&&r<t&&(r=t),u&&u<t&&(u=t),c(Math.min(255,Math.floor(i/n)),Math.min(255,Math.floor(r/n)),Math.min(255,Math.floor(u/n))))};d.prototype.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),c(Math.floor(n*this.r),Math.floor(n*this.g),Math.floor(n*this.b))};d.prototype.hsl=function(){return ae(this.r,this.g,this.b)};d.prototype.toString=function(){return"#"+ft(this.r)+ft(this.g)+ft(this.b)};ni=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});ni.forEach(function(n,t){ni.set(n,kr(t,c,ri))});d3.hsl=function(n,t,i){return arguments.length===1?n instanceof g?et(n.h,n.s,n.l):kr(""+n,ae,et):et(+n,+t,+i)};g.prototype.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),et(this.h,this.s,this.l/n)};g.prototype.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),et(this.h,this.s,n*this.l)};g.prototype.rgb=function(){return ri(this.h,this.s,this.l)};g.prototype.toString=function(){return this.rgb().toString()};d3.hcl=function(n,t,i){return arguments.length===1?n instanceof nt?yt(n.h,n.c,n.l):n instanceof tt?pe(n.l,n.a,n.b):pe((n=ve((n=d3.rgb(n)).r,n.g,n.b)).l,n.a,n.b):yt(+n,+t,+i)};nt.prototype.brighter=function(n){return yt(this.h,this.c,Math.min(100,this.l+di*(arguments.length?n:1)))};nt.prototype.darker=function(n){return yt(this.h,this.c,Math.max(0,this.l-di*(arguments.length?n:1)))};nt.prototype.rgb=function(){return nu(this.h,this.c,this.l).rgb()};nt.prototype.toString=function(){return this.rgb()+""};d3.lab=function(n,t,i){return arguments.length===1?n instanceof tt?ot(n.l,n.a,n.b):n instanceof nt?nu(n.l,n.c,n.h):ve((n=d3.rgb(n)).r,n.g,n.b):ot(+n,+t,+i)};var di=18,dh=.95047,gh=1,nc=1.08883;tt.prototype.brighter=function(n){return ot(Math.min(100,this.l+di*(arguments.length?n:1)),this.a,this.b)};tt.prototype.darker=function(n){return ot(Math.max(0,this.l-di*(arguments.length?n:1)),this.a,this.b)};tt.prototype.rgb=function(){return ye(this.l,this.a,this.b)};tt.prototype.toString=function(){return this.rgb()+""};var gi=function(n,t){return t.querySelector(n)},tc=function(n,t){return t.querySelectorAll(n)},ct=document.documentElement,sw=ct.matchesSelector||ct.webkitMatchesSelector||ct.mozMatchesSelector||ct.msMatchesSelector||ct.oMatchesSelector,ic=function(n,t){return sw.call(n,t)};typeof Sizzle=="function"&&(gi=function(n,t){return Sizzle(n,t)[0]||null},tc=function(n,t){return Sizzle.uniqueSort(Sizzle(n,t))},ic=Sizzle.matchesSelector);t=[];d3.selection=function(){return lt};d3.selection.prototype=t;t.select=function(n){var o=[],i,u,f,t,e,s,r,h;for(typeof n!="function"&&(n=we(n)),e=-1,s=this.length;++e<s;)for(o.push(i=[]),i.parentNode=(f=this[e]).parentNode,r=-1,h=f.length;++r<h;)(t=f[r])?(i.push(u=n.call(t,t.__data__,r)),u&&"__data__"in t&&(u.__data__=t.__data__)):i.push(null);return l(o)};t.selectAll=function(n){var u=[],f,t,i,e;for(typeof n!="function"&&(n=be(n)),i=-1,e=this.length;++i<e;)for(var o=this[i],r=-1,s=o.length;++r<s;)(t=o[r])&&(u.push(f=st(n.call(t,t.__data__,r))),f.parentNode=t);return l(u)};t.attr=function(n,t){if(arguments.length<2){if(typeof n=="string"){var i=this.node();return n=d3.ns.qualify(n),n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}for(t in n)this.each(ke(t,n[t]));return this}return this.each(ke(n,t))};t.classed=function(n,t){if(arguments.length<2){if(typeof n=="string"){var r=this.node(),u=(n=n.trim().split(/^|\s+/g)).length,i=-1;if(t=r.classList){while(++i<u)if(!t.contains(n[i]))return!1}else for(t=r.className,t.baseVal!=null&&(t=t.baseVal);++i<u;)if(!de(n[i]).test(t))return!1;return!0}for(t in n)this.each(ge(t,n[t]));return this}return this.each(ge(n,t))};t.style=function(n,t,i){var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t="");for(i in n)this.each(no(i,n[i],t));return this}if(r<2)return window.getComputedStyle(this.node(),null).getPropertyValue(n);i=""}return this.each(no(n,t,i))};t.property=function(n,t){if(arguments.length<2){if(typeof n=="string")return this.node()[n];for(t in n)this.each(to(t,n[t]));return this}return this.each(to(n,t))};t.text=function(n){return arguments.length<1?this.node().textContent:this.each(typeof n=="function"?function(){var t=n.apply(this,arguments);this.textContent=t==null?"":t}:n==null?function(){this.textContent=""}:function(){this.textContent=n})};t.html=function(n){return arguments.length<1?this.node().innerHTML:this.each(typeof n=="function"?function(){var t=n.apply(this,arguments);this.innerHTML=t==null?"":t}:n==null?function(){this.innerHTML=""}:function(){this.innerHTML=n})};t.append=function(n){function t(){return this.appendChild(document.createElementNS(this.namespaceURI,n))}function i(){return this.appendChild(document.createElementNS(n.space,n.local))}return n=d3.ns.qualify(n),this.select(n.local?i:t)};t.insert=function(n,t){function i(){return this.insertBefore(document.createElementNS(this.namespaceURI,n),gi(t,this))}function r(){return this.insertBefore(document.createElementNS(n.space,n.local),gi(t,this))}return n=d3.ns.qualify(n),this.select(n.local?r:i)};t.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})};t.data=function(n,t){function e(n,i){var r,p=n.length,w=i.length,k=Math.min(p,w),d=Math.max(p,w),o=[],c=[],u=[],e,a;if(t){var v=new y,b=[],l,g=i.length;for(r=-1;++r<p;)l=t.call(e=n[r],e.__data__,r),v.has(l)?u[g++]=e:v.set(l,e),b.push(l);for(r=-1;++r<w;)l=t.call(i,a=i[r],r),v.has(l)?(o[r]=e=v.get(l),e.__data__=a,c[r]=u[r]=null):(c[r]=uu(a),o[r]=u[r]=null),v.remove(l);for(r=-1;++r<p;)v.has(b[r])&&(u[r]=n[r])}else{for(r=-1;++r<k;)e=n[r],a=i[r],e?(e.__data__=a,o[r]=e,c[r]=u[r]=null):(c[r]=uu(a),o[r]=u[r]=null);for(;r<w;++r)c[r]=uu(i[r]),o[r]=u[r]=null;for(;r<d;++r)u[r]=n[r],c[r]=o[r]=null}c.update=o;c.parentNode=o.parentNode=u.parentNode=n.parentNode;s.push(c);f.push(o);h.push(u)}var i=-1,u=this.length,r,o;if(!arguments.length){for(n=new Array(u=(r=this[0]).length);++i<u;)(o=r[i])&&(n[i]=o.__data__);return n}var s=uo([]),f=l([]),h=l([]);if(typeof n=="function")while(++i<u)e(r=this[i],n.call(r,r.parentNode.__data__,i));else while(++i<u)e(r=this[i],n);return f.enter=function(){return s},f.exit=function(){return h},f};t.datum=t.map=function(n){return arguments.length<1?this.property("__data__"):this.property("__data__",n)};t.filter=function(n){var e=[],u,f,i,r,o,t,s;for(typeof n!="function"&&(n=io(n)),r=0,o=this.length;r<o;r++)for(e.push(u=[]),u.parentNode=(f=this[r]).parentNode,t=0,s=f.length;t<s;t++)(i=f[t])&&n.call(i,i.__data__,t)&&u.push(i);return l(e)};t.order=function(){for(var i=-1,f=this.length;++i<f;)for(var r=this[i],u=r.length-1,n=r[u],t;--u>=0;)(t=r[u])&&(n&&n!==t.nextSibling&&n.parentNode.insertBefore(t,n),n=t);return this};t.sort=function(n){n=gl.apply(this,arguments);for(var t=-1,i=this.length;++t<i;)this[t].sort(n);return this.order()};t.on=function(n,t,i){var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t=!1);for(i in n)this.each(ro(i,n[i],t));return this}if(r<2)return(r=this.node()["__on"+n])&&r._;i=!1}return this.each(ro(n,t,i))};t.each=function(n){return pt(this,function(t,i,r){n.call(t,t.__data__,i,r)})};t.call=function(n){return n.apply(this,(arguments[0]=this,arguments)),this};t.empty=function(){return!this.node()};t.node=function(){for(var i,n=0,r=this.length;n<r;n++)for(var u=this[n],t=0,f=u.length;t<f;t++)if(i=u[t],i)return i;return null};t.transition=function(){for(var n=[],t,i,r=-1,e=this.length;++r<e;){n.push(t=[]);for(var u=this[r],f=-1,o=u.length;++f<o;)t.push((i=u[f])?{node:i,delay:nr,duration:tr}:null)}return ui(n,ut||++hw,Date.now())};lt=l([[document]]);lt[0].parentNode=ct;d3.select=function(n){return typeof n=="string"?lt.select(n):l([[n]])};d3.selectAll=function(n){return typeof n=="string"?lt.selectAll(n):l([st(n)])};p=[];d3.selection.enter=uo;d3.selection.enter.prototype=p;p.append=t.append;p.insert=t.insert;p.empty=t.empty;p.node=t.node;p.select=function(n){for(var i,h,f=[],r,e,o,t,u,s=-1,c=this.length;++s<c;)for(o=(t=this[s]).update,f.push(r=[]),r.parentNode=t.parentNode,i=-1,h=t.length;++i<h;)(u=t[i])?(r.push(o[i]=e=n.call(t.parentNode,u.__data__,i)),e.__data__=u.__data__):r.push(null);return l(f)};var f=[],hw=0,ut=0,cw=d3.ease("cubic-in-out"),nr=0,tr=250,ir=cw;f.call=t.call;d3.transition=function(n){return arguments.length?ut?n.transition():n:lt.transition()};d3.transition.prototype=f;f.select=function(n){var e=[],i,r,t,u,o;for(typeof n!="function"&&(n=we(n)),u=-1,o=this.length;++u<o;){e.push(i=[]);for(var s=this[u],f=-1,h=s.length;++f<h;)(t=s[f])&&(r=n.call(t.node,t.node.__data__,f))?("__data__"in t.node&&(r.__data__=t.node.__data__),i.push({node:r,delay:t.delay,duration:t.duration})):i.push(null)}return ui(e,this.id,this.time).ease(this.ease())};f.selectAll=function(n){var e=[],o,i,t,r,s,f,c;for(typeof n!="function"&&(n=be(n)),r=-1,s=this.length;++r<s;)for(var h=this[r],u=-1,l=h.length;++u<l;)if(t=h[u])for(i=n.call(t.node,t.node.__data__,u),e.push(o=[]),f=-1,c=i.length;++f<c;)o.push({node:i[f],delay:t.delay,duration:t.duration});return ui(e,this.id,this.time).ease(this.ease())};f.filter=function(n){var u=[],f,e,t,i,o;for(typeof n!="function"&&(n=io(n)),i=0,o=this.length;i<o;i++){u.push(f=[]);for(var e=this[i],r=0,s=e.length;r<s;r++)(t=e[r])&&n.call(t.node,t.node.__data__,r)&&f.push(t)}return ui(u,this.id,this.time).ease(this.ease())};f.attr=function(n,t){if(arguments.length<2){for(t in n)this.attrTween(t,fi(n[t],t));return this}return this.attrTween(n,fi(t,n))};f.attrTween=function(n,t){function r(n,r){var u=t.call(this,n,r,this.getAttribute(i));return u===at?(this.removeAttribute(i),null):u&&function(n){this.setAttribute(i,u(n))}}function u(n,r){var u=t.call(this,n,r,this.getAttributeNS(i.space,i.local));return u===at?(this.removeAttributeNS(i.space,i.local),null):u&&function(n){this.setAttributeNS(i.space,i.local,u(n))}}var i=d3.ns.qualify(n);return this.tween("attr."+n,i.local?u:r)};f.style=function(n,t,i){var r=arguments.length;if(r<3){if(typeof n!="string"){r<2&&(t="");for(i in n)this.styleTween(i,fi(n[i],i),t);return this}i=""}return this.styleTween(n,fi(t,n),i)};f.styleTween=function(n,t,i){return arguments.length<3&&(i=""),this.tween("style."+n,function(r,u){var f=t.call(this,r,u,window.getComputedStyle(this,null).getPropertyValue(n));return f===at?(this.style.removeProperty(n),null):f&&function(t){this.style.setProperty(n,f(t),i)}})};f.text=function(n){return this.tween("text",function(t,i){this.textContent=typeof n=="function"?n.call(this,t,i):n})};f.remove=function(){return this.each("end.transition",function(){var n;!this.__transition__&&(n=this.parentNode)&&n.removeChild(this)})};f.delay=function(n){return pt(this,typeof n=="function"?function(t,i,r){t.delay=n.call(t=t.node,t.__data__,i,r)|0}:(n=n|0,function(t){t.delay=n}))};f.duration=function(n){return pt(this,typeof n=="function"?function(t,i,r){t.duration=Math.max(1,n.call(t=t.node,t.__data__,i,r)|0)}:(n=Math.max(1,n|0),function(t){t.duration=n}))};f.transition=function(){return this.select(il)};d3.tween=function(n,t){function i(i,r,u){var f=n.call(this,i,r);return f==null?u!=""&&at:u!=f&&t(u,f)}function r(i,r,u){return u!=n&&t(u,n)}return typeof n=="function"?i:n==null?ta:(n+="",r)};at={};w=null;d3.timer=function(n,t,i){var u=!1,f,r=w;if(arguments.length<3){if(arguments.length<2)t=0;else if(!isFinite(t))return;i=Date.now()}while(r){if(r.callback===n){r.then=i;r.delay=t;u=!0;break}f=r;r=r.next}u||(w={callback:n,then:i,delay:t,next:w});rr||(ur=clearTimeout(ur),rr=1,cf(fu))};d3.timer.flush=function(){for(var t,i=Date.now(),n=w;n;)t=i-n.then,n.delay||(n.flush=n.callback(t)),n=n.next;fo()};cf=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){setTimeout(n,17)};d3.mouse=function(n){return eo(n,oe())};fr=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(n,t){return arguments.length<2&&(t=oe().touches),t?st(t).map(function(t){var i=eo(n,t);return i.identifier=t.identifier,i}):[]};d3.scale={};d3.scale.linear=function(){return oo([0,1],[0,1],d3.interpolate,!1)};d3.scale.log=function(){return lo(d3.scale.linear(),su)};rc=d3.format(".0e");su.pow=function(n){return Math.pow(10,n)};si.pow=function(n){return-Math.pow(10,-n)};d3.scale.pow=function(){return ao(d3.scale.linear(),1)};d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)};d3.scale.ordinal=function(){return vo([],{t:"range",a:[[]]})};d3.scale.category10=function(){return d3.scale.ordinal().range(lw)};d3.scale.category20=function(){return d3.scale.ordinal().range(aw)};d3.scale.category20b=function(){return d3.scale.ordinal().range(vw)};d3.scale.category20c=function(){return d3.scale.ordinal().range(yw)};var lw=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],aw=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],vw=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],yw=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return yo([],[])};d3.scale.quantize=function(){return po(0,1,[0,1])};d3.scale.threshold=function(){return wo([.5],[0,1])};d3.scale.identity=function(){return bo([0,1])};d3.svg={};d3.svg.arc=function(){function n(){var i=t.apply(this,arguments),n=r.apply(this,arguments),e=u.apply(this,arguments)+b,o=f.apply(this,arguments)+b,s=(o<e&&(s=e,e=o,o=s),o-e),h=s<Math.PI?"0":"1",c=Math.cos(e),l=Math.sin(e),a=Math.cos(o),v=Math.sin(o);return s>=uc?i?"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"M0,"+i+"A"+i+","+i+" 0 1,0 0,"+-i+"A"+i+","+i+" 0 1,0 0,"+i+"Z":"M0,"+n+"A"+n+","+n+" 0 1,1 0,"+-n+"A"+n+","+n+" 0 1,1 0,"+n+"Z":i?"M"+n*c+","+n*l+"A"+n+","+n+" 0 "+h+",1 "+n*a+","+n*v+"L"+i*a+","+i*v+"A"+i+","+i+" 0 "+h+",0 "+i*c+","+i*l+"Z":"M"+n*c+","+n*l+"A"+n+","+n+" 0 "+h+",1 "+n*a+","+n*v+"L0,0Z"}var t=fa,r=ea,u=ko,f=go;return n.innerRadius=function(r){return arguments.length?(t=i(r),n):t},n.outerRadius=function(t){return arguments.length?(r=i(t),n):r},n.startAngle=function(t){return arguments.length?(u=i(t),n):u},n.endAngle=function(t){return arguments.length?(f=i(t),n):f},n.centroid=function(){var n=(t.apply(this,arguments)+r.apply(this,arguments))/2,i=(u.apply(this,arguments)+f.apply(this,arguments))/2+b;return[Math.cos(i)*n,Math.sin(i)*n]},n};b=-Math.PI/2;uc=2*Math.PI-1e-6;d3.svg.line=function(){return ns(k)};er=d3.map({linear:e,"linear-closed":oa,"step-before":cu,"step-after":lu,basis:is,"basis-open":la,"basis-closed":aa,bundle:va,cardinal:ca,"cardinal-open":sa,"cardinal-closed":ha,monotone:wa});er.forEach(function(n,t){t.key=n;t.closed=/-closed$/.test(n)});var fc=[0,2/3,1/3,0],ec=[0,1/3,2/3,0],vt=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var n=ns(rs);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n};cu.reverse=lu;lu.reverse=cu;d3.svg.area=function(){return us(k)};d3.svg.area.radial=function(){var n=us(rs);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n};d3.svg.chord=function(){function n(n,i){var f=s(this,r,n,i),e=s(this,u,n,i);return"M"+f.p0+h(f.r,f.p1,f.a1-f.a0)+(c(f,e)?t(f.r,f.p1,f.r,f.p0):t(f.r,f.p1,e.r,e.p0)+h(e.r,e.p1,e.a1-e.a0)+t(e.r,e.p1,f.r,f.p0))+"Z"}function s(n,t,i,r){var s=t.call(n,i,r),u=f.call(n,s,r),h=e.call(n,s,r)+b,c=o.call(n,s,r)+b;return{r:u,a0:h,a1:c,p0:[u*Math.cos(h),u*Math.sin(h)],p1:[u*Math.cos(c),u*Math.sin(c)]}}function c(n,t){return n.a0==t.a0&&n.a1==t.a1}function h(n,t,i){return"A"+n+","+n+" 0 "+ +(i>Math.PI)+",1 "+t}function t(n,t,i,r){return"Q 0,0 "+r}var r=fs,u=es,f=ba,e=ko,o=go;return n.radius=function(t){return arguments.length?(f=i(t),n):f},n.source=function(t){return arguments.length?(r=i(t),n):r},n.target=function(t){return arguments.length?(u=i(t),n):u},n.startAngle=function(t){return arguments.length?(e=i(t),n):e},n.endAngle=function(t){return arguments.length?(o=i(t),n):o},n};d3.svg.diagonal=function(){function n(n,i){var e=t.call(this,n,i),o=r.call(this,n,i),s=(e.y+o.y)/2,f=[e,{x:e.x,y:s},{x:o.x,y:s},o];return f=f.map(u),"M"+f[0]+"C"+f[1]+" "+f[2]+" "+f[3]}var t=fs,r=es,u=os;return n.source=function(r){return arguments.length?(t=i(r),n):t},n.target=function(t){return arguments.length?(r=i(t),n):r},n.projection=function(t){return arguments.length?(u=t,n):u},n};d3.svg.diagonal.radial=function(){var n=d3.svg.diagonal(),t=os,i=n.projection;return n.projection=function(n){return arguments.length?i(ka(t=n)):t},n};d3.svg.mouse=d3.mouse;d3.svg.touches=d3.touches;d3.svg.symbol=function(){function n(n,i){return(lf.get(t.call(this,n,i))||ss)(r.call(this,n,i))}var t=ga,r=da;return n.type=function(r){return arguments.length?(t=i(r),n):t},n.size=function(t){return arguments.length?(r=i(t),n):r},n};lf=d3.map({circle:ss,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*af)),i=t*af;return"M0,"+-t+"L"+i+",0 0,"+t+" "+-i+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ti),i=t*ti/2;return"M0,"+i+"L"+t+","+-i+" "+-t+","+-i+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ti),i=t*ti/2;return"M0,"+-i+"L"+t+","+i+" "+-t+","+i+"Z"}});d3.svg.symbolTypes=lf.keys();ti=Math.sqrt(3);af=Math.tan(Math.PI/6);d3.svg.axis=function(){function t(t){t.each(function(){var rt=d3.select(this),et=o==null?i.ticks?i.ticks.apply(i,e):i.domain():o,ct=s==null?i.tickFormat?i.tickFormat.apply(i,e):String:s,lt=nv(i,et,c),ut=rt.selectAll(".minor").data(lt,String),y=ut.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),at=d3.transition(ut.exit()).style("opacity",1e-6).remove(),p=d3.transition(ut).style("opacity",1),w=rt.selectAll("g").data(et,String),v=w.enter().insert("g","path").style("opacity",1e-6),vt=d3.transition(w.exit()).style("opacity",1e-6).remove(),b=d3.transition(w).style("opacity",1),t,l=ei(i),ot=rt.selectAll(".domain").data([0]),yt=ot.enter().append("path").attr("class","domain"),k=d3.transition(ot),a=i.copy(),st=this.__chart__||a,ht,ft;this.__chart__=a;v.append("line").attr("class","tick");v.append("text");var d=v.select("line"),g=b.select("line"),nt=w.select("text").text(ct),tt=v.select("text"),it=b.select("text");switch(h){case"bottom":t=hs;y.attr("y2",u);p.attr("x2",0).attr("y2",u);d.attr("y2",n);tt.attr("y",Math.max(n,0)+r);g.attr("x2",0).attr("y2",n);it.attr("x",0).attr("y",Math.max(n,0)+r);nt.attr("dy",".71em").attr("text-anchor","middle");k.attr("d","M"+l[0]+","+f+"V0H"+l[1]+"V"+f);break;case"top":t=hs;y.attr("y2",-u);p.attr("x2",0).attr("y2",-u);d.attr("y2",-n);tt.attr("y",-(Math.max(n,0)+r));g.attr("x2",0).attr("y2",-n);it.attr("x",0).attr("y",-(Math.max(n,0)+r));nt.attr("dy","0em").attr("text-anchor","middle");k.attr("d","M"+l[0]+","+-f+"V0H"+l[1]+"V"+-f);break;case"left":t=cs;y.attr("x2",-u);p.attr("x2",-u).attr("y2",0);d.attr("x2",-n);tt.attr("x",-(Math.max(n,0)+r));g.attr("x2",-n).attr("y2",0);it.attr("x",-(Math.max(n,0)+r)).attr("y",0);nt.attr("dy",".32em").attr("text-anchor","end");k.attr("d","M"+-f+","+l[0]+"H0V"+l[1]+"H"+-f);break;case"right":t=cs;y.attr("x2",u);p.attr("x2",u).attr("y2",0);d.attr("x2",n);tt.attr("x",Math.max(n,0)+r);g.attr("x2",n).attr("y2",0);it.attr("x",Math.max(n,0)+r).attr("y",0);nt.attr("dy",".32em").attr("text-anchor","start");k.attr("d","M"+f+","+l[0]+"H0V"+l[1]+"H"+f)}i.ticks?(v.call(t,st),b.call(t,a),vt.call(t,a),y.call(t,st),p.call(t,a),at.call(t,a)):(ht=a.rangeBand()/2,ft=function(n){return a(n)+ht},v.call(t,ft),b.call(t,ft))})}var i=d3.scale.linear(),h="bottom",n=6,u=6,f=6,r=3,e=[10],o=null,s,c=0;return t.scale=function(n){return arguments.length?(i=n,t):i},t.orient=function(n){return arguments.length?(h=n,t):h},t.ticks=function(){return arguments.length?(e=arguments,t):e},t.tickValues=function(n){return arguments.length?(o=n,t):o},t.tickFormat=function(n){return arguments.length?(s=n,t):s},t.tickSize=function(i,r){if(!arguments.length)return n;var e=arguments.length-1;return n=+i,u=e>1?+r:n,f=e>0?+arguments[e]:n,t},t.tickPadding=function(n){return arguments.length?(r=+n,t):r},t.tickSubdivide=function(n){return arguments.length?(c=+n,t):c},t};d3.svg.brush=function(){function r(n){n.each(function(){var u=d3.select(this),o=u.selectAll(".background").data([0]),a=u.selectAll(".extent").data([0]),l=u.selectAll(".resize").data(f,String),n;u.style("pointer-events","all").on("mousedown.brush",c).on("touchstart.brush",c);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");a.enter().append("rect").attr("class","extent").style("cursor","move");l.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return oc[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");l.style("display",r.empty()?"none":null);l.exit().remove();t&&(n=ei(t),o.attr("x",n[0]).attr("width",n[1]-n[0]),s(u));i&&(n=ei(i),o.attr("y",n[0]).attr("height",n[1]-n[0]),h(u));e(u)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+n[+/e$/.test(t)][0]+","+n[+/^s/.test(t)][1]+")"})}function s(t){t.select(".extent").attr("x",n[0][0]);t.selectAll(".extent,.n>rect,.s>rect").attr("width",n[1][0]-n[0][0])}function h(t){t.select(".extent").attr("y",n[0][1]);t.selectAll(".extent,.e>rect,.w>rect").attr("height",n[1][1]-n[0][1])}function c(){function tt(){var n=d3.event.changedTouches;return n?d3.touches(w,n)[0]:d3.mouse(w)}function ut(){d3.event.keyCode==32&&(c||(a=null,f[0]-=n[1][0],f[1]-=n[1][1],c=2),o())}function ft(){d3.event.keyCode==32&&c==2&&(f[0]+=n[1][0],f[1]+=n[1][1],c=0,o())}function p(){var r=tt(),u=!1;b&&(r[0]+=b[0],r[1]+=b[1]);c||(d3.event.altKey?(a||(a=[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]),f[0]=n[+(r[0]<a[0])][0],f[1]=n[+(r[1]<a[1])][1]):a=null);et&&it(r,t,0)&&(s(v),u=!0);ot&&it(r,i,1)&&(h(v),u=!0);u&&(e(v),d({type:"brush",mode:c?"move":"resize"}))}function it(t,i,r){var v=ei(i),h=v[0],l=v[1],o=f[r],y=n[1][r]-n[0][r],e,s;return c&&(h-=o,l-=y+o),e=Math.max(h,Math.min(l,t[r])),c?s=(e+=o)+y:(a&&(o=Math.max(h,Math.min(l,2*a[r]-e))),o<e?(s=e,e=o):s=o),n[0][r]!==e||n[1][r]!==s?(u=null,n[0][r]=e,n[1][r]=s,!0):void 0}function rt(){p();v.style("pointer-events","all").selectAll(".resize").style("display",r.empty()?"none":null);d3.select("body").style("cursor",null);st.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);d({type:"brushend"});o()}var w=this,k=d3.select(d3.event.target),d=l.of(w,arguments),v=d3.select(w),y=k.datum(),et=!/^(n|s)$/.test(y)&&t,ot=!/^(e|w)$/.test(y)&&i,c=k.classed("extent"),a,f=tt(),b,st=d3.select(window).on("mousemove.brush",p).on("mouseup.brush",rt).on("touchmove.brush",p).on("touchend.brush",rt).on("keydown.brush",ut).on("keyup.brush",ft),g,nt;c?(f[0]=n[0][0]-f[0],f[1]=n[0][1]-f[1]):y?(g=+/w$/.test(y),nt=+/^n/.test(y),b=[n[1-g][0]-f[0],n[1-nt][1]-f[1]],f[0]=n[g][0],f[1]=n[nt][1]):d3.event.altKey&&(a=f.slice());v.style("pointer-events","none").selectAll(".resize").style("display",null);d3.select("body").style("cursor",k.style("cursor"));d({type:"brushstart"});p();o()}var l=br(r,"brushstart","brush","brushend"),t=null,i=null,f=or[0],n=[[0,0],[0,0]],u;return r.x=function(n){return arguments.length?(t=n,f=or[!t<<1|!i],r):t},r.y=function(n){return arguments.length?(i=n,f=or[!t<<1|!i],r):i},r.extent=function(f){var e,o,s,h,c;return arguments.length?(u=[[0,0],[0,0]],t&&(e=f[0],o=f[1],i&&(e=e[0],o=o[0]),u[0][0]=e,u[1][0]=o,t.invert&&(e=t(e),o=t(o)),o<e&&(c=e,e=o,o=c),n[0][0]=e|0,n[1][0]=o|0),i&&(s=f[0],h=f[1],t&&(s=s[1],h=h[1]),u[0][1]=s,u[1][1]=h,i.invert&&(s=i(s),h=i(h)),h<s&&(c=s,s=h,h=c),n[0][1]=s|0,n[1][1]=h|0),r):(f=u||n,t&&(e=f[0][0],o=f[1][0],u||(e=n[0][0],o=n[1][0],t.invert&&(e=t.invert(e),o=t.invert(o)),o<e&&(c=e,e=o,o=c))),i&&(s=f[0][1],h=f[1][1],u||(s=n[0][1],h=n[1][1],i.invert&&(s=i.invert(s),h=i.invert(h)),h<s&&(c=s,s=h,h=c))),t&&i?[[e,s],[o,h]]:t?[e,o]:i&&[s,h])},r.clear=function(){return u=null,n[0][0]=n[0][1]=n[1][0]=n[1][1]=0,r},r.empty=function(){return t&&n[0][0]===n[1][0]||i&&n[0][1]===n[1][1]},d3.rebind(r,l,"on")};oc={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};or=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={};d3.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",i)}function i(){function h(){var t=f.parentNode;return n?d3.touches(t).filter(function(t){return t.identifier===n})[0]:d3.mouse(t)}function a(){if(!f.parentNode)return c();var n=h(),t=n[0]-u[0],r=n[1]-u[1];l|=t|r;u=n;o();e({type:"drag",x:n[0]+i[0],y:n[1]+i[1],dx:t,dy:r})}function c(){if(e({type:"dragend"}),l&&(o(),d3.event.target===y))s.on("click.drag",v,!0);s.on(n?"touchmove.drag-"+n:"mousemove.drag",null).on(n?"touchend.drag-"+n:"mouseup.drag",null)}function v(){o();s.on("click.drag",null)}var f=this,e=r.of(f,arguments),y=d3.event.target,n=d3.event.touches&&d3.event.changedTouches[0].identifier,i,u=h(),l=0,s=d3.select(window).on(n?"touchmove.drag-"+n:"mousemove.drag",a).on(n?"touchend.drag-"+n:"mouseup.drag",c,!0);t?(i=t.apply(f,arguments),i=[i.x-u[0],i.y-u[1]]):i=[0,0];n||o();e({type:"dragstart"})}var r=br(n,"drag","dragstart","dragend"),t=null;return n.origin=function(i){return arguments.length?(t=i,n):t},d3.rebind(n,r,"on")};d3.behavior.zoom=function(){function t(){this.on("mousedown.zoom",g).on("mousewheel.zoom",w).on("mousemove.zoom",nt).on("DOMMouseScroll.zoom",w).on("dblclick.zoom",tt).on("touchstart.zoom",b).on("touchmove.zoom",it).on("touchend.zoom",b)}function f(t){return[(t[0]-i[0])/n,(t[1]-i[1])/n]}function d(t){return[t[0]*n+i[0],t[1]*n+i[1]]}function h(t){n=Math.max(c[0],Math.min(c[1],t))}function e(n,t){t=d(t);i[0]+=n[0]-t[0];i[1]+=n[1]-t[1]}function s(t){l&&l.domain(v.range().map(function(t){return(t-i[0])/n}).map(v.invert));a&&a.domain(y.range().map(function(t){return(t-i[1])/n}).map(y.invert));d3.event.preventDefault();t({type:"zoom",scale:n,translate:i})}function g(){function r(){t=1;e(d3.mouse(n),v);s(l)}function h(){t&&o();i.on("mousemove.zoom",null).on("mouseup.zoom",null);if(t&&d3.event.target===a)i.on("click.zoom",c,!0)}function c(){o();i.on("click.zoom",null)}var n=this,l=u.of(n,arguments),a=d3.event.target,t=0,i=d3.select(window).on("mousemove.zoom",r).on("mouseup.zoom",h),v=f(d3.mouse(n));window.focus();o()}function w(){r||(r=f(d3.mouse(this)));h(Math.pow(2,tv()*.002)*n);e(d3.mouse(this),r);s(u.of(this,arguments))}function nt(){r=null}function tt(){var t=d3.mouse(this),i=f(t);h(d3.event.shiftKey?n/2:n*2);e(t,i);s(u.of(this,arguments))}function b(){var t=d3.touches(this),i=Date.now(),c,l;k=n;r={};t.forEach(function(n){r[n.identifier]=f(n)});o();t.length===1&&(i-p<500&&(c=t[0],l=f(t[0]),h(n*2),e(c,l),s(u.of(this,arguments))),p=i)}function it(){var o=d3.touches(this),n=o[0],t=r[n.identifier],i,f;(i=o[1])&&(f=r[i.identifier],n=[(n[0]+i[0])/2,(n[1]+i[1])/2],t=[(t[0]+f[0])/2,(t[1]+f[1])/2],h(d3.event.scale*k));e(n,t);p=null;s(u.of(this,arguments))}var i=[0,0],r,n=1,k,c=vf,u=br(t,"zoom"),v,l,y,a,p;return t.translate=function(n){return arguments.length?(i=n.map(Number),t):i},t.scale=function(i){return arguments.length?(n=+i,t):n},t.scaleExtent=function(n){return arguments.length?(c=n==null?vf:n.map(Number),t):c},t.x=function(n){return arguments.length?(l=n,v=n.copy(),t):l},t.y=function(n){return arguments.length?(a=n,y=n.copy(),t):a},d3.rebind(t,u,"on")};vf=[0,Infinity];d3.layout={};d3.layout.bundle=function(){return function(n){for(var t=[],i=-1,r=n.length;++i<r;)t.push(iv(n[i]));return t}};d3.layout.chord=function(){function h(){var w={},b=[],nt=d3.range(i),k=[],a,n,d,h,l,y,p;for(t=[],r=[],a=0,h=-1;++h<i;){for(n=0,l=-1;++l<i;)n+=u[h][l];b.push(n);k.push(d3.range(i));a+=n}for(e&&nt.sort(function(n,t){return e(b[n],b[t])}),o&&k.forEach(function(n,t){n.sort(function(n,i){return o(u[t][n],u[t][i])})}),a=(2*Math.PI-f*i)/a,n=0,h=-1;++h<i;){for(d=n,l=-1;++l<i;){var v=nt[h],g=k[v][l],tt=u[v][g],it=n,rt=n+=tt*a;w[v+"-"+g]={index:v,subindex:g,startAngle:it,endAngle:rt,value:tt}}r[v]={index:v,startAngle:d,endAngle:n,value:(n-d)/a};n+=f}for(h=-1;++h<i;)for(l=h-1;++l<i;)y=w[h+"-"+l],p=w[l+"-"+h],(y.value||p.value)&&t.push(y.value<p.value?{source:p,target:y}:{source:y,target:p});s&&c()}function c(){t.sort(function(n,t){return s((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var n={},t,r,u,i,f=0,e,o,s;return n.matrix=function(f){return arguments.length?(i=(u=f)&&u.length,t=r=null,n):u},n.padding=function(i){return arguments.length?(f=i,t=r=null,n):f},n.sortGroups=function(i){return arguments.length?(e=i,t=r=null,n):e},n.sortSubgroups=function(i){return arguments.length?(o=i,t=null,n):o},n.sortChords=function(i){return arguments.length?(s=i,t&&c(),n):s},n.chords=function(){return t||h(),t},n.groups=function(){return r||h(),r},n};d3.layout.force=function(){function b(n){return function(t,i,r,u){var e;if(t.point!==n){var o=t.cx-n.x,s=t.cy-n.y,f=1/Math.sqrt(o*o+s*s);if((u-i)*f<y)return e=t.charge*f*f,n.px-=o*e,n.py-=s*e,!0;t.point&&isFinite(f)&&(e=t.pointCharge*f*f,n.px-=o*e,n.py-=s*e)}return!t.charge}}function d(t){t.px=d3.event.x;t.py=d3.event.y;n.resume()}var n={},o=d3.dispatch("start","tick","end"),f=[1,1],c,r,s=.9,l=sv,a=hv,e=-30,v=.1,y=.8,t=[],u=[],p,w,h;return n.tick=function(){if((r*=.99)<.005)return o.end({type:"end",alpha:r=0}),!0;for(var g=t.length,tt=u.length,nt,n,y,d,k,c,l,a,i=0;i<tt;++i)n=u[i],y=n.source,d=n.target,l=d.x-y.x,a=d.y-y.y,(k=l*l+a*a)&&(k=r*w[i]*((k=Math.sqrt(k))-p[i])/k,l*=k,a*=k,d.x-=l*(c=y.weight/(d.weight+y.weight)),d.y-=a*c,y.x+=l*(c=1-c),y.y+=a*c);if((c=r*v)&&(l=f[0]/2,a=f[1]/2,i=-1,c))while(++i<g)n=t[i],n.x+=(l-n.x)*c,n.y+=(a-n.y)*c;if(e)for(as(nt=d3.geom.quadtree(t),r,h),i=-1;++i<g;)(n=t[i]).fixed||nt.visit(b(n));for(i=-1;++i<g;)n=t[i],n.fixed?(n.x=n.px,n.y=n.py):(n.x-=(n.px-(n.px=n.x))*s,n.y-=(n.py-(n.py=n.y))*s);o.tick({type:"tick",alpha:r})},n.nodes=function(i){return arguments.length?(t=i,n):t},n.links=function(t){return arguments.length?(u=t,n):u},n.size=function(t){return arguments.length?(f=t,n):f},n.linkDistance=function(t){return arguments.length?(l=i(t),n):l},n.distance=n.linkDistance,n.linkStrength=function(t){return arguments.length?(a=i(t),n):a},n.friction=function(t){return arguments.length?(s=t,n):s},n.charge=function(t){return arguments.length?(e=typeof t=="function"?t:+t,n):e},n.gravity=function(t){return arguments.length?(v=t,n):v},n.theta=function(t){return arguments.length?(y=t,n):y},n.alpha=function(t){return arguments.length?(r?r=t>0?t:0:t>0&&(o.start({type:"start",alpha:r=t}),d3.timer(n.tick)),n):r},n.start=function(){function v(n,t){for(var r=b(i),u=-1,e=r.length,f;++u<e;)if(!isNaN(f=r[u][n]))return f;return Math.random()*t}function b(){if(!s){for(s=[],o=0;o<c;++o)s[o]=[];for(o=0;o<y;++o){var n=u[o];s[n.source.index].push(n.target);s[n.target.index].push(n.source)}}return s[i]}for(var o,c=t.length,y=u.length,k=f[0],d=f[1],s,r,i=0;i<c;++i)(r=t[i]).index=i,r.weight=0;for(p=[],w=[],i=0;i<y;++i)r=u[i],typeof r.source=="number"&&(r.source=t[r.source]),typeof r.target=="number"&&(r.target=t[r.target]),p[i]=l.call(this,r,i),w[i]=a.call(this,r,i),++r.source.weight,++r.target.weight;for(i=0;i<c;++i)r=t[i],isNaN(r.x)&&(r.x=v("x",k)),isNaN(r.y)&&(r.y=v("y",d)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(h=[],typeof e=="function")for(i=0;i<c;++i)h[i]=+e.call(this,t[i],i);else for(i=0;i<c;++i)h[i]=e;return n.resume()},n.resume=function(){return n.alpha(.1)},n.stop=function(){return n.alpha(0)},n.drag=function(){c||(c=d3.behavior.drag().origin(k).on("dragstart",uv).on("drag",d).on("dragend",fv));this.on("mouseover.force",ev).on("mouseout.force",ov).call(c)},d3.rebind(n,o,"on")};d3.layout.partition=function(){function i(n,t,r,u){var f=n.children,e,o,s,h;if(n.x=t,n.y=n.depth*u,n.dx=r,n.dy=u,f&&(o=f.length))for(e=-1,r=n.value?r/n.value:0;++e<o;)i(s=f[e],t,h=s.value*r,u),t+=h}function r(n){var t=n.children,i=0,u,f;if(t&&(f=t.length))for(u=-1;++u<f;)i=Math.max(i,r(t[u]));return 1+i}function t(t,f){var e=u.call(this,t,f);return i(e[0],0,n[0],n[1]/r(e[0])),e}var u=d3.layout.hierarchy(),n=[1,1];return t.size=function(i){return arguments.length?(n=i,t):n},kt(t,u)};d3.layout.pie=function(){function n(f){var e=f.map(function(t,i){return+u.call(n,t,i)}),s=+(typeof t=="function"?t.apply(this,arguments):t),c=((typeof r=="function"?r.apply(this,arguments):r)-t)/d3.sum(e),h=d3.range(f.length),o;return i!=null&&h.sort(i===yf?function(n,t){return e[t]-e[n]}:function(n,t){return i(f[n],f[t])}),o=[],h.forEach(function(n){var t;o[n]={data:f[n],value:t=e[n],startAngle:s,endAngle:s+=t*c}}),o}var u=Number,i=yf,t=0,r=2*Math.PI;return n.value=function(t){return arguments.length?(u=t,n):u},n.sort=function(t){return arguments.length?(i=t,n):i},n.startAngle=function(i){return arguments.length?(t=i,n):t},n.endAngle=function(t){return arguments.length?(r=t,n):r},n};yf={};d3.layout.stack=function(){function n(o,s){var c=o.map(function(t,r){return i.call(n,t,r)}),l=c.map(function(t){return t.map(function(t,i){return[f.call(n,t,i),e.call(n,t,i)]})}),v=r.call(n,l,s);c=d3.permute(c,v);l=d3.permute(l,v);for(var p=u.call(n,l,s),w=c.length,b=c[0].length,a,y,h=0;h<b;++h)for(t.call(n,c[0][h],y=p[h],l[0][h][1]),a=1;a<w;++a)t.call(n,c[a][h],y+=l[a-1][h][1],l[a][h][1]);return o}var i=k,r=yu,u=pu,t=av,f=cv,e=lv;return n.values=function(t){return arguments.length?(i=t,n):i},n.order=function(t){return arguments.length?(r=typeof t=="function"?t:sc.get(t)||yu,n):r},n.offset=function(t){return arguments.length?(u=typeof t=="function"?t:hc.get(t)||pu,n):u},n.x=function(t){return arguments.length?(f=t,n):f},n.y=function(t){return arguments.length?(e=t,n):e},n.out=function(i){return arguments.length?(t=i,n):t},n};sc=d3.map({"inside-out":function(n){for(var r=n.length,t,u=n.map(vv),f=n.map(yv),c=d3.range(r).sort(function(n,t){return u[n]-u[t]}),e=0,o=0,s=[],h=[],i=0;i<r;++i)t=c[i],e<o?(e+=f[t],s.push(t)):(o+=f[t],h.push(t));return h.reverse().concat(s)},reverse:function(n){return d3.range(n.length).reverse()},"default":yu});hc=d3.map({silhouette:function(n){for(var s=n.length,f=n[0].length,e=[],u=0,r,i,o=[],t=0;t<f;++t){for(r=0,i=0;r<s;r++)i+=n[r][t][1];i>u&&(u=i);e.push(i)}for(t=0;t<f;++t)o[t]=(u-e[t])/2;return o},wiggle:function(n){var a=n.length,h=n[0],v=h.length,i,t,r,u,c,l,f,e,o,s=[];for(s[0]=e=o=0,t=1;t<v;++t){for(i=0,u=0;i<a;++i)u+=n[i][t][1];for(i=0,c=0,f=h[t][0]-h[t-1][0];i<a;++i){for(r=0,l=(n[i][t][1]-n[i][t-1][1])/(2*f);r<i;++r)l+=(n[r][t][1]-n[r][t-1][1])/f;c+=l*n[i][t][1]}s[t]=e-=u?c/u*f:0;e<o&&(o=e)}for(t=0;t<v;++t)s[t]-=o;return s},expand:function(n){for(var r=n.length,f=n[0].length,o=1/r,t,u,e=[],i=0;i<f;++i){for(t=0,u=0;t<r;t++)u+=n[t][i][1];if(u)for(t=0;t<r;t++)n[t][i][1]/=u;else for(t=0;t<r;t++)n[t][i][1]=o}for(i=0;i<f;++i)e[i]=0;return e},zero:pu});d3.layout.histogram=function(){function n(n,i){for(var c=[],o=n.map(r,this),l=u.call(this,o,i),s=f.call(this,l,o,i),e,i=-1,v=o.length,a=s.length-1,y=t?1:1/v,h;++i<a;)e=c[i]=[],e.dx=s[i+1]-(e.x=s[i]),e.y=0;if(a>0)for(i=-1;++i<v;)h=o[i],h>=l[0]&&h<=l[1]&&(e=c[d3.bisect(s,h,1,a)-1],e.y+=y,e.push(n[i]));return c}var t=!0,r=Number,u=bv,f=wv;return n.value=function(t){return arguments.length?(r=t,n):r},n.range=function(t){return arguments.length?(u=i(t),n):u},n.bins=function(t){return arguments.length?(f=typeof t=="number"?function(n){return vs(n,t)}:i(t),n):f},n.frequency=function(i){return arguments.length?(t=!!i,n):t},n};d3.layout.hierarchy=function(){function u(f,e,o){var c=r.call(n,f,e),s=sr?f:{data:f};if(s.depth=e,o.push(s),c&&(a=c.length)){for(var l=-1,a,v=s.children=[],y=0,p=e+1,h;++l<a;)h=u(c[l],p,o),h.parent=s,v.push(h),y+=h.value;i&&v.sort(i);t&&(s.value=y)}else t&&(s.value=+t.call(n,f,e)||0);return s}function f(i,r){var e=i.children,u=0,o,s,h;if(e&&(s=e.length))for(o=-1,h=r+1;++o<s;)u+=f(e[o],h);else t&&(u=+t.call(n,sr?i:i.data,r)||0);return t&&(i.value=u),u}function n(n){var t=[];return u(n,0,t),t}var i=gv,r=kv,t=dv;return n.sort=function(t){return arguments.length?(i=t,n):i},n.children=function(t){return arguments.length?(r=t,n):r},n.value=function(i){return arguments.length?(t=i,n):t},n.revalue=function(n){return f(n,0),n},n};sr=!1;d3.layout.pack=function(){function n(n,u){var c=r.call(this,n,u),f=c[0],h;f.x=0;f.y=0;a(f,function(n){n.r=Math.sqrt(n.value)});a(f,ws);var e=i[0],o=i[1],s=Math.max(2*f.r/e,2*f.r/o);return t>0&&(h=t*s/2,a(f,function(n){n.r+=h}),a(f,ws),a(f,function(n){n.r-=h}),s=Math.max(2*f.r/e,2*f.r/o)),bs(f,e/2,o/2,1/s),c}var r=d3.layout.hierarchy().sort(ty),t=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.padding=function(i){return arguments.length?(t=+i,n):t},kt(n,r)};d3.layout.cluster=function(){function n(n,u){var h=r.call(this,n,u),f=h[0],e,l=0;a(f,function(n){var i=n.children;i&&i.length?(n.x=fy(i),n.y=uy(i)):(n.x=e?l+=t(n,e):0,n.y=0,e=n)});var o=ds(f),s=gs(f),c=o.x-t(o,s)/2,v=s.x+t(s,o)/2;return a(f,function(n){n.x=(n.x-c)/(v-c)*i[0];n.y=(1-(f.y?n.y/f.y:1))*i[1]}),h}var r=d3.layout.hierarchy().sort(null).value(null),t=nh,i=[1,1];return n.separation=function(i){return arguments.length?(t=i,n):t},n.size=function(t){return arguments.length?(i=t,n):i},kt(n,r)};d3.layout.tree=function(){function t(t,u){function s(t,i){var f=t.children,r=t._tree,o;if(f&&(h=f.length)){for(var h,c=f[0],e,l=c,u,a=-1;++a<h;)u=f[a],s(u,e),l=v(u,e,l),e=u;hy(t);o=.5*(c._tree.prelim+u._tree.prelim);i?(r.prelim=i._tree.prelim+n(t,i),r.mod=r.prelim-o):r.prelim=o}else i&&(r.prelim=i._tree.prelim+n(t,i))}function h(n,t){var i,r,u;if(n.x=n._tree.prelim+t,i=n.children,i&&(u=i.length))for(r=-1,t+=n._tree.mod;++r<u;)h(i[r],t)}function v(t,i,r){if(i){for(var f=t,e=t,u=i,o=t.parent.children[0],h=f._tree.mod,c=e._tree.mod,l=u._tree.mod,a=o._tree.mod,s;u=ku(u),f=bu(f),u&&f;)o=bu(o),e=ku(e),e._tree.ancestor=t,s=u._tree.prelim+l-f._tree.prelim-h+n(u,f),s>0&&(cy(ly(u,t,r),t,s),h+=s,c+=s),l+=u._tree.mod,h+=f._tree.mod,a+=o._tree.mod,c+=e._tree.mod;u&&!ku(e)&&(e._tree.thread=u,e._tree.mod+=l-c);f&&!bu(o)&&(o._tree.thread=f,o._tree.mod+=h-a,r=t)}return r}var c=r.call(this,t,u),f=c[0];a(f,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}});s(f);h(f,-f._tree.prelim);var e=li(f,oy),o=li(f,ey),y=li(f,sy),l=e.x-n(e,o)/2,p=o.x+n(o,e)/2,w=y.depth||1;return a(f,function(n){n.x=(n.x-l)/(p-l)*i[0];n.y=n.depth/w*i[1];delete n._tree}),c}var r=d3.layout.hierarchy().sort(null).value(null),n=nh,i=[1,1];return t.separation=function(i){return arguments.length?(n=i,t):n},t.size=function(n){return arguments.length?(i=n,t):i},kt(t,r)};d3.layout.treemap=function(){function f(n,t){for(var r=-1,f=n.length,u,i;++r<f;)i=(u=n[r]).value*(t<0?0:t),u.area=isNaN(i)||i<=0?0:i}function c(n){var r=n.children;if(r&&r.length){var i=s(n),t=[],u=r.slice(),l,h=Infinity,a,o=Math.min(i.dx,i.dy),y;for(f(u,i.dx*i.dy/n.value),t.area=0;(y=u.length)>0;)t.push(l=u[y-1]),t.area+=l.area,(a=v(t,o))<=h?(u.pop(),h=a):(t.area-=t.pop().area,e(t,o,i,!1),o=Math.min(i.dx,i.dy),t.length=t.area=0,h=Infinity);t.length&&(e(t,o,i,!0),t.length=t.area=0);r.forEach(c)}}function l(n){var u=n.children;if(u&&u.length){var i=s(n),o=u.slice(),r,t=[];for(f(o,i.dx*i.dy/n.value),t.area=0;r=o.pop();)t.push(r),t.area+=r.area,r.z!=null&&(e(t,r.z?i.dx:i.dy,i,!o.length),t.length=t.area=0);u.forEach(l)}}function v(n,t){for(var i=n.area,r,f=0,e=Infinity,o=-1,s=n.length;++o<s;)(r=n[o].area)&&(r<e&&(e=r),r>f&&(f=r));return i*=i,t*=t,i?Math.max(t*f*u/i,i/(t*e*u)):Infinity}function e(n,i,r,u){var h=-1,c=n.length,o=r.x,s=r.y,e=i?t(n.area/i):0,f;if(i==r.dx){for((u||e>r.dy)&&(e=r.dy);++h<c;)f=n[h],f.x=o,f.y=s,f.dy=e,o+=f.dx=Math.min(r.x+r.dx-o,e?t(f.area/e):0);f.z=!0;f.dx+=r.x+r.dx-o;r.y+=e;r.dy-=e}else{for((u||e>r.dx)&&(e=r.dx);++h<c;)f=n[h],f.x=o,f.y=s,f.dx=e,s+=f.dy=Math.min(r.y+r.dy-s,e?t(f.area/e):0);f.z=!1;f.dy+=r.y+r.dy-s;r.x+=e;r.dx-=e}}function n(n){var u=i||o(n),t=u[0];return t.x=0,t.y=0,t.dx=r[0],t.dy=r[1],i&&o.revalue(t),f([t],t.dx*t.dy/t.value),(i?l:c)(t),h&&(i=u),u}var o=d3.layout.hierarchy(),t=Math.round,r=[1,1],a=null,s=du,h=!1,i,u=.5*(1+Math.sqrt(5));return n.size=function(t){return arguments.length?(r=t,n):r},n.padding=function(t){function u(i){var r=t.call(n,i,i.depth);return r==null?du(i):th(i,typeof r=="number"?[r,r,r,r]:r)}function i(n){return th(n,t)}if(!arguments.length)return a;var r;return s=(a=t)==null?du:(r=typeof t)=="function"?u:r==="number"?(t=[t,t,t,t],i):i,n},n.round=function(i){return arguments.length?(t=i?Math.round:Number,n):t!=Number},n.sticky=function(t){return arguments.length?(h=t,i=null,n):h},n.ratio=function(t){return arguments.length?(u=t,n):u},kt(n,o)};d3.csv=ih(",","text/csv");d3.tsv=ih("\t","text/tab-separated-values");d3.geo={};n=Math.PI/180;d3.geo.azimuthal=function(){function i(i){var l=i[0]*n-s,a=i[1]*n,v=Math.cos(l),w=Math.sin(l),c=Math.cos(a),y=Math.sin(a),o=t!=="orthographic"?e*y+f*c*v:null,h,p=t==="stereographic"?1/(1+o):t==="gnomonic"?1/o:t==="equidistant"?(h=Math.acos(o),h?h/Math.sin(h):0):t==="equalarea"?Math.sqrt(2/(1+o)):1,b=p*c*w,k=p*(e*c*v-f*y);return[r*b+u[0],r*k+u[1]]}var t="orthographic",o,r=200,u=[480,250],s,h,f,e;return i.invert=function(i){var c=(i[0]-u[0])/r,h=(i[1]-u[1])/r,o=Math.sqrt(c*c+h*h),a=t==="stereographic"?2*Math.atan(o):t==="gnomonic"?Math.atan(o):t==="equidistant"?o:t==="equalarea"?2*Math.asin(.5*o):Math.asin(o),l=Math.sin(a),v=Math.cos(a);return[(s+Math.atan2(c*l,o*f*v+h*e*l))/n,Math.asin(v*e-(o?h*l*f/o:0))/n]},i.mode=function(n){return arguments.length?(t=n+"",i):t},i.origin=function(t){return arguments.length?(o=t,s=o[0]*n,h=o[1]*n,f=Math.cos(h),e=Math.sin(h),i):o},i.scale=function(n){return arguments.length?(r=+n,i):r},i.translate=function(n){return arguments.length?(u=[+n[0],+n[1]],i):u},i.origin([0,0])};d3.geo.albers=function(){function i(i){var f=t*(n*i[0]-h),e=Math.sqrt(o-2*t*Math.sin(n*i[1]))/t;return[r*e*Math.sin(f)+u[0],r*(e*Math.cos(f)-c)+u[1]]}function s(){var r=n*e[0],l=n*e[1],a=n*f[1],u=Math.sin(r),s=Math.cos(r);return h=n*f[0],t=.5*(u+Math.sin(l)),o=s*s+2*t*u,c=Math.sqrt(o-2*t*Math.sin(a))/t,i}var f=[-98,38],e=[29.5,45.5],r=1e3,u=[480,250],h,t,o,c;return i.invert=function(i){var f=(i[0]-u[0])/r,l=(i[1]-u[1])/r,e=c+l,a=Math.atan2(f,e),s=Math.sqrt(f*f+e*e);return[(h+a/t)/n,Math.asin((o-s*s*t*t)/(2*t))/n]},i.origin=function(n){return arguments.length?(f=[+n[0],+n[1]],s()):f},i.parallels=function(n){return arguments.length?(e=[+n[0],+n[1]],s()):e},i.scale=function(n){return arguments.length?(r=+n,i):r},i.translate=function(n){return arguments.length?(u=[+n[0],+n[1]],i):u},s()};d3.geo.albersUsa=function(){function t(t){var e=t[0],f=t[1];return(f>50?i:e<-140?r:f<21?u:n)(t)}var n=d3.geo.albers(),i=d3.geo.albers().origin([-160,60]).parallels([55,65]),r=d3.geo.albers().origin([-160,20]).parallels([8,18]),u=d3.geo.albers().origin([-60,10]).parallels([8,18]);return t.scale=function(f){return arguments.length?(n.scale(f),i.scale(f*.6),r.scale(f),u.scale(f*1.5),t.translate(n.translate())):n.scale()},t.translate=function(f){if(!arguments.length)return n.translate();var e=n.scale()/1e3,o=f[0],s=f[1];return n.translate(f),i.translate([o-400*e,s+170*e]),r.translate([o-190*e,s+200*e]),u.translate([o+580*e,s+430*e]),t},t.scale(n.scale())};d3.geo.bonne=function(){function t(t){var h=t[0]*n-e,s=t[1]*n-o,c,l;return u?(c=f+u-s,l=h*Math.cos(s)/c,h=c*Math.sin(l),s=c*Math.cos(l)-f):(h*=Math.cos(s),s*=-1),[i*h+r[0],i*s+r[1]]}var i=200,r=[480,250],e,o,u,f;return t.invert=function(t){var o=(t[0]-r[0])/i,s=(t[1]-r[1])/i,h,c;return u?(h=f+s,c=Math.sqrt(o*o+h*h),s=f+u-c,o=e+c*Math.atan2(o,h)/Math.cos(s)):(s*=-1,o/=Math.cos(s)),[o/n,s/n]},t.parallel=function(i){return arguments.length?(f=1/Math.tan(u=i*n),t):u/n},t.origin=function(i){return arguments.length?(e=i[0]*n,o=i[1]*n,t):[e/n,o/n]},t.scale=function(n){return arguments.length?(i=+n,t):i},t.translate=function(n){return arguments.length?(r=[+n[0],+n[1]],t):r},t.origin([0,0]).parallel(45)};d3.geo.equirectangular=function(){function n(n){var r=n[0]/360,u=-n[1]/360;return[t*r+i[0],t*u+i[1]]}var t=500,i=[480,250];return n.invert=function(n){var r=(n[0]-i[0])/t,u=(n[1]-i[1])/t;return[360*r,-360*u]},n.scale=function(i){return arguments.length?(t=+i,n):t},n.translate=function(t){return arguments.length?(i=[+t[0],+t[1]],n):i},n};d3.geo.mercator=function(){function t(t){var u=t[0]/360,f=-(Math.log(Math.tan(Math.PI/4+t[1]*n/2))/n)/360;return[i*u+r[0],i*Math.max(-.5,Math.min(.5,f))+r[1]]}var i=500,r=[480,250];return t.invert=function(t){var u=(t[0]-r[0])/i,f=(t[1]-r[1])/i;return[360*u,2*Math.atan(Math.exp(-360*f*n))/n-90]},t.scale=function(n){return arguments.length?(i=+n,t):i},t.translate=function(n){return arguments.length?(r=[+n[0],+n[1]],t):r},t};d3.geo.path=function(){function t(t){typeof r=="function"&&(f=gu(r.apply(this,arguments)));e(t);var i=n.length?n.join(""):null;return n=[],i}function i(n){return u(n).join(",")}function s(n){for(var t=c(n[0]),i=0,r=n.length;++i<r;)t-=c(n[i]);return t}function h(n){for(var i=d3.geom.polygon(n[0].map(u)),t=i.area(),r=i.centroid(t<0?(t*=-1,1):-1),f=r[0],e=r[1],o=t,s=0,h=n.length;++s<h;)i=d3.geom.polygon(n[s].map(u)),t=i.area(),r=i.centroid(t<0?(t*=-1,1):-1),f-=r[0],e-=r[1],o-=t;return[f,e,6*o]}function c(n){return Math.abs(d3.geom.polygon(n.map(u)).area())}var r=4.5,f=gu(r),u=d3.geo.albersUsa(),n=[],e=ai({FeatureCollection:function(t){for(var i=t.features,r=-1,u=i.length;++r<u;)n.push(e(i[r].geometry))},Feature:function(n){e(n.geometry)},Point:function(t){n.push("M",i(t.coordinates),f)},MultiPoint:function(t){for(var r=t.coordinates,u=-1,e=r.length;++u<e;)n.push("M",i(r[u]),f)},LineString:function(t){var r=t.coordinates,u=-1,f=r.length;for(n.push("M");++u<f;)n.push(i(r[u]),"L");n.pop()},MultiLineString:function(t){for(var f=t.coordinates,e=-1,s=f.length,r,u,o;++e<s;){for(r=f[e],u=-1,o=r.length,n.push("M");++u<o;)n.push(i(r[u]),"L");n.pop()}},Polygon:function(t){for(var f=t.coordinates,e=-1,s=f.length,r,u,o;++e<s;)if(r=f[e],u=-1,(o=r.length-1)>0){for(n.push("M");++u<o;)n.push(i(r[u]),"L");n[n.length-1]="Z"}},MultiPolygon:function(t){for(var o=t.coordinates,s=-1,l=o.length,r,u,h,f,e,c;++s<l;)for(r=o[s],u=-1,h=r.length;++u<h;)if(f=r[u],e=-1,(c=f.length-1)>0){for(n.push("M");++e<c;)n.push(i(f[e]),"L");n[n.length-1]="Z"}},GeometryCollection:function(t){for(var i=t.geometries,r=-1,u=i.length;++r<u;)n.push(e(i[r]))}}),o=t.area=ai({FeatureCollection:function(n){for(var t=0,i=n.features,r=-1,u=i.length;++r<u;)t+=o(i[r]);return t},Feature:function(n){return o(n.geometry)},Polygon:function(n){return s(n.coordinates)},MultiPolygon:function(n){for(var t=0,i=n.coordinates,r=-1,u=i.length;++r<u;)t+=s(i[r]);return t},GeometryCollection:function(n){for(var t=0,i=n.geometries,r=-1,u=i.length;++r<u;)t+=o(i[r]);return t}},0),l=t.centroid=ai({Feature:function(n){return l(n.geometry)},Polygon:function(n){var t=h(n.coordinates);return[t[0]/t[2],t[1]/t[2]]},MultiPolygon:function(n){for(var r=n.coordinates,t,u=0,f=0,i=0,e=-1,o=r.length;++e<o;)t=h(r[e]),u+=t[0],f+=t[1],i+=t[2];return[u/i,f/i]}});return t.projection=function(n){return u=n,t},t.pointRadius=function(n){return typeof n=="function"?r=n:(r=+n,f=gu(r)),t},t};d3.geo.bounds=function(n){var t=Infinity,i=Infinity,r=-Infinity,u=-Infinity;return vi(n,function(n,f){n<t&&(t=n);n>r&&(r=n);f<i&&(i=f);f>u&&(u=f)}),[[t,i],[r,u]]};pf={Feature:ay,FeatureCollection:vy,GeometryCollection:yy,LineString:rh,MultiLineString:py,MultiPoint:rh,MultiPolygon:wy,Point:by,Polygon:ky};d3.geo.circle=function(){function r(){}function s(n){return t.distance(n)<u}function e(n){for(var c=-1,l=n.length,r=[],e,i,f,o,s;++c<l;)s=t.distance(f=n[c]),s<u?(i&&r.push(fh(i,f)((o-u)/(o-s))),r.push(f),e=i=null):(i=f,!e&&r.length&&(r.push(fh(r[r.length-1],i)((u-o)/(s-o))),e=i)),o=s;return e=n[0],i=r[0],!i||f[0]!==e[0]||f[1]!==e[1]||f[0]===i[0]&&f[1]===i[1]||r.push(i),h(r)}function h(n){for(var i=0,f=n.length,r,e,o=f?[n[0]]:n,u,s=t.source();++i<f;)for(u=t.source(n[i-1])(n[i]).coordinates,r=0,e=u.length;++r<e;)o.push(u[r]);return t.source(s),o}var i=[0,0],o=90-.01,u=o*n,t=d3.geo.greatArc().source(i).target(k),f;return r.clip=function(n){return typeof i=="function"&&t.source(i.apply(this,arguments)),f(n)||null},f=ai({FeatureCollection:function(n){var t=n.features.map(f).filter(k);return t&&(n=Object.create(n),n.features=t,n)},Feature:function(n){var t=f(n.geometry);return t&&(n=Object.create(n),n.geometry=t,n)},Point:function(n){return s(n.coordinates)&&n},MultiPoint:function(n){var t=n.coordinates.filter(s);return t.length&&{type:n.type,coordinates:t}},LineString:function(n){var t=e(n.coordinates);return t.length&&(n=Object.create(n),n.coordinates=t,n)},MultiLineString:function(n){var t=n.coordinates.map(e).filter(function(n){return n.length});return t.length&&(n=Object.create(n),n.coordinates=t,n)},Polygon:function(n){var t=n.coordinates.map(e);return t[0].length&&(n=Object.create(n),n.coordinates=t,n)},MultiPolygon:function(n){var t=n.coordinates.map(function(n){return n.map(e)}).filter(function(n){return n[0].length});return t.length&&(n=Object.create(n),n.coordinates=t,n)},GeometryCollection:function(n){var t=n.geometries.map(f).filter(k);return t.length&&(n=Object.create(n),n.geometries=t,n)}}),r.origin=function(n){return arguments.length?(i=n,typeof i!="function"&&t.source(i),r):i},r.angle=function(t){return arguments.length?(u=(o=+t)*n,r):o},d3.rebind(r,t,"precision")};d3.geo.greatArc=function(){function t(){for(var r=t.distance.apply(this,arguments),i=0,s=o/r,n=[f];(i+=s)<1;)n.push(u(i));return n.push(e),{type:"LineString",coordinates:n}}var i=dy,f,r=gy,e,o=6*n,u=uh();return t.distance=function(){return typeof i=="function"&&u.source(f=i.apply(this,arguments)),typeof r=="function"&&u.target(e=r.apply(this,arguments)),u.distance()},t.source=function(n){return arguments.length?(i=n,typeof i!="function"&&u.source(f=i),t):i},t.target=function(n){return arguments.length?(r=n,typeof r!="function"&&u.target(e=r),t):r},t.precision=function(i){return arguments.length?(o=i*n,t):o/n},t};d3.geo.greatCircle=d3.geo.circle;d3.geom={};d3.geom.contour=function(n,t){var o=t||np(n),c=[],r=o[0],u=o[1],f=0,e=0,s=NaN,h=NaN,i=0;do i=0,n(r-1,u-1)&&(i+=1),n(r,u-1)&&(i+=2),n(r-1,u)&&(i+=4),n(r,u)&&(i+=8),i===6?(f=h===-1?-1:1,e=0):i===9?(f=0,e=s===1?-1:1):(f=cc[i],e=lc[i]),f!=s&&e!=h&&(c.push([r,u]),s=f,h=e),r+=f,u+=e;while(o[0]!=r||o[1]!=u);return c};cc=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN];lc=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(n){var p;if(n.length<3)return[];for(var a=n.length,w=a-1,i=[],f=[],r,u=0,o,s,v,y,c,h,l,e,t=1;t<a;++t)n[t][1]<n[u][1]?u=t:n[t][1]==n[u][1]&&(u=n[t][0]<n[u][0]?t:u);for(t=0;t<a;++t)t!==u&&(s=n[t][1]-n[u][1],o=n[t][0]-n[u][0],i.push({angle:Math.atan2(s,o),index:t}));for(i.sort(function(n,t){return n.angle-t.angle}),l=i[0].angle,h=i[0].index,c=0,t=1;t<w;++t)r=i[t].index,l==i[t].angle?(o=n[h][0]-n[u][0],s=n[h][1]-n[u][1],v=n[r][0]-n[u][0],y=n[r][1]-n[u][1],o*o+s*s>=v*v+y*y?i[t].index=-1:(i[c].index=-1,l=i[t].angle,c=t,h=r)):(l=i[t].angle,c=t,h=r);for(f.push(u),t=0,r=0;t<2;++r)i[r].index!==-1&&(f.push(i[r].index),t++);for(e=f.length;r<w;++r)if(i[r].index!==-1){while(!tp(f[e-2],f[e-1],i[r].index,n))--e;f[e++]=i[r].index}for(p=[],t=0;t<e;++t)p.push(n[f[t]]);return p};d3.geom.polygon=function(n){return n.area=function(){for(var t=0,i=n.length,r=n[i-1][0]*n[0][1],u=n[i-1][1]*n[0][0];++t<i;)r+=n[t-1][0]*n[t][1],u+=n[t-1][1]*n[t][0];return(u-r)*.5},n.centroid=function(t){var f=-1,e=n.length,o=0,s=0,r,i=n[e-1],u;for(arguments.length||(t=-1/(6*n.area()));++f<e;)r=i,i=n[f],u=r[0]*i[1]-i[0]*r[1],o+=(r[0]+i[0])*u,s+=(r[1]+i[1])*u;return[o*t,s*t]},n.clip=function(t){for(var e,s=-1,h=n.length,o,c,r=n[h-1],i,u,f;++s<h;){for(e=t.slice(),t.length=0,i=n[s],u=e[(c=e.length)-1],o=-1;++o<c;)f=e[o],nf(f,r,i)?(nf(u,r,i)||t.push(eh(u,f,r,i)),t.push(f)):nf(u,r,i)&&t.push(eh(u,f,r,i)),u=f;r=i}return t},n};d3.geom.voronoi=function(n){var t=n.map(function(){return[]});return oh(n,function(n){var i,r,u,f,e,o,s,h;n.a===1&&n.b>=0?(i=n.ep.r,r=n.ep.l):(i=n.ep.l,r=n.ep.r);n.a===1?(e=i?i.y:-1e6,u=n.c-n.b*e,o=r?r.y:1e6,f=n.c-n.b*o):(u=i?i.x:-1e6,e=n.c-n.a*u,f=r?r.x:1e6,o=n.c-n.a*f);s=[u,e];h=[f,o];t[n.region.l.index].push(s,h);t[n.region.r.index].push(s,h)}),t.map(function(t,i){var r=n[i][0],u=n[i][1];return t.forEach(function(n){n.angle=Math.atan2(n[0]-r,n[1]-u)}),t.sort(function(n,t){return n.angle-t.angle}).filter(function(n,i){return!i||n.angle-t[i-1].angle>1e-10})})};hr={l:"r",r:"l"};d3.geom.delaunay=function(n){var t=n.map(function(){return[]}),i=[];return oh(n,function(i){t[i.region.l.index].push(n[i.region.r.index])}),t.forEach(function(t,r){var f=n[r],o=f[0],s=f[1],u,e;for(t.forEach(function(n){n.angle=Math.atan2(n[0]-o,n[1]-s)}),t.sort(function(n,t){return n.angle-t.angle}),u=0,e=t.length-1;u<e;u++)i.push([f,t[u],t[u+1]])}),i};d3.geom.quadtree=function(n,t,i,r,u){function c(n,t,i,r,u,f){if(!isNaN(t.x)&&!isNaN(t.y))if(n.leaf){var e=n.point;e?Math.abs(e.x-t.x)+Math.abs(e.y-t.y)<.01?o(n,t,i,r,u,f):(n.point=null,o(n,e,i,r,u,f),o(n,t,i,r,u,f)):n.point=t}else o(n,t,i,r,u,f)}function o(n,t,i,r,u,f){var e=(i+u)*.5,o=(r+f)*.5,s=t.x>=e,h=t.y>=o,l=(h<<1)+s;n.leaf=!1;n=n.nodes[l]||(n.nodes[l]=sh());s?i=e:u=e;h?r=o:f=o;c(n,t,i,r,u,f)}var f,l=-1,a=n.length,s,h,e;if(a&&isNaN(n[0].x)&&(n=n.map(ip)),arguments.length<5)if(arguments.length===3)u=r=i,i=t;else{for(t=i=Infinity,r=u=-Infinity;++l<a;)f=n[l],f.x<t&&(t=f.x),f.y<i&&(i=f.y),f.x>r&&(r=f.x),f.y>u&&(u=f.y);s=r-t;h=u-i;s>h?u=i+s:r=t+h}return e=sh(),e.add=function(n){c(e,n,t,i,r,u)},e.visit=function(n){dt(n,e,t,i,r,u)},n.forEach(e.add),e};d3.time={};r=Date;wf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];it.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){v.setUTCDate.apply(this._,arguments)},setDay:function(){v.setUTCDay.apply(this._,arguments)},setFullYear:function(){v.setUTCFullYear.apply(this._,arguments)},setHours:function(){v.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){v.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){v.setUTCMinutes.apply(this._,arguments)},setMonth:function(){v.setUTCMonth.apply(this._,arguments)},setSeconds:function(){v.setUTCSeconds.apply(this._,arguments)},setTime:function(){v.setTime.apply(this._,arguments)}};var v=Date.prototype,bf=wf,ac=bf.map(hh),cr=["January","February","March","April","May","June","July","August","September","October","November","December"],kf=cr.map(hh);d3.time.format=function(n){function t(t){for(var u=[],r=-1,f=0,e,o;++r<i;)n.charCodeAt(r)==37&&(u.push(n.substring(f,r),(o=lr[e=n.charAt(++r)])?o(t):e),f=r+1);return u.push(n.substring(f,r)),u.join("")}var i=n.length;return t.parse=function(t){var i={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},f=yi(i,n,t,0),u;return f!=t.length?null:("p"in i&&(i.H=i.H%12+i.p*12),u=new r,u.setFullYear(i.y,i.m,i.d),u.setHours(i.H,i.M,i.S,i.L),u)},t.toString=function(){return n},t};var s=d3.format("02d"),vc=d3.format("03d"),pw=d3.format("04d"),ww=d3.format("2d"),yc=pi(bf),pc=pi(ac),wc=pi(cr),bw=ch(cr),bc=pi(kf),kw=ch(kf),lr={a:function(n){return ac[n.getDay()]},A:function(n){return bf[n.getDay()]},b:function(n){return kf[n.getMonth()]},B:function(n){return cr[n.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(n){return s(n.getDate())},e:function(n){return ww(n.getDate())},H:function(n){return s(n.getHours())},I:function(n){return s(n.getHours()%12||12)},j:function(n){return vc(1+d3.time.dayOfYear(n))},L:function(n){return vc(n.getMilliseconds())},m:function(n){return s(n.getMonth()+1)},M:function(n){return s(n.getMinutes())},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n){return s(n.getSeconds())},U:function(n){return s(d3.time.sundayOfYear(n))},w:function(n){return n.getDay()},W:function(n){return s(d3.time.mondayOfYear(n))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(n){return s(n.getFullYear()%100)},Y:function(n){return pw(n.getFullYear()%1e4)},Z:kp,"%":function(){return"%"}},dw={a:rp,A:up,b:fp,B:ep,c:op,d:lh,e:lh,H:ah,I:ah,L:wp,m:vp,M:yp,p:bp,S:pp,x:sp,X:hp,y:lp,Y:cp},u=/^\s*\d+/,gw=d3.map({am:0,pm:1});d3.time.format.utc=function(n){function t(n){try{r=it;var t=new r;return t._=n,i(t)}finally{r=Date}}var i=d3.time.format(n);return t.parse=function(n){try{r=it;var t=i.parse(n);return t&&t._}finally{r=Date}},t.toString=i.toString,t};df=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?tf:df;tf.parse=function(n){var t=new Date(n);return isNaN(t)?null:t};tf.toString=df.toString;d3.time.second=rt(function(n){return new r(Math.floor(n/1e3)*1e3)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*1e3)},function(n){return n.getSeconds()});d3.time.seconds=d3.time.second.range;d3.time.seconds.utc=d3.time.second.utc.range;d3.time.minute=rt(function(n){return new r(Math.floor(n/6e4)*6e4)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*6e4)},function(n){return n.getMinutes()});d3.time.minutes=d3.time.minute.range;d3.time.minutes.utc=d3.time.minute.utc.range;d3.time.hour=rt(function(n){var t=n.getTimezoneOffset()/60;return new r((Math.floor(n/36e5-t)+t)*36e5)},function(n,t){n.setTime(n.getTime()+Math.floor(t)*36e5)},function(n){return n.getHours()});d3.time.hours=d3.time.hour.range;d3.time.hours.utc=d3.time.hour.utc.range;d3.time.day=rt(function(n){var t=new r(1970,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1});d3.time.days=d3.time.day.range;d3.time.days.utc=d3.time.day.utc.range;d3.time.dayOfYear=function(n){var t=d3.time.year(n);return Math.floor((n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)};wf.forEach(function(n,t){n=n.toLowerCase();t=7-t;var i=d3.time[n]=rt(function(n){return(n=d3.time.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+Math.floor(t)*7)},function(n){var i=d3.time.year(n).getDay();return Math.floor((d3.time.dayOfYear(n)+(i+t)%7)/7)-(i!==t)});d3.time[n+"s"]=i.range;d3.time[n+"s"].utc=i.utc.range;d3.time[n+"OfYear"]=function(n){var i=d3.time.year(n).getDay();return Math.floor((d3.time.dayOfYear(n)+(i+t)%7)/7)}});d3.time.week=d3.time.sunday;d3.time.weeks=d3.time.sunday.range;d3.time.weeks.utc=d3.time.sunday.utc.range;d3.time.weekOfYear=d3.time.sundayOfYear;d3.time.month=rt(function(n){return n=d3.time.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()});d3.time.months=d3.time.month.range;d3.time.months.utc=d3.time.month.utc.range;d3.time.year=rt(function(n){return n=d3.time.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()});d3.time.years=d3.time.year.range;d3.time.years.utc=d3.time.year.utc.range;var ar=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],gf=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],nb=[[d3.time.format("%Y"),function(){return!0}],[d3.time.format("%B"),function(n){return n.getMonth()}],[d3.time.format("%b %d"),function(n){return n.getDate()!=1}],[d3.time.format("%a %d"),function(n){return n.getDay()&&n.getDate()!=1}],[d3.time.format("%I %p"),function(n){return n.getHours()}],[d3.time.format("%I:%M"),function(n){return n.getMinutes()}],[d3.time.format(":%S"),function(n){return n.getSeconds()}],[d3.time.format(".%L"),function(n){return n.getMilliseconds()}]],kc=d3.scale.linear(),tb=vh(nb);gf.year=function(n,t){return kc.domain(n.map(gp)).ticks(t).map(ff)};d3.time.scale=function(){return rf(d3.scale.linear(),gf,tb)};var dc=gf.map(function(n){return[n[0].utc,n[1]]}),ib=[[d3.time.format.utc("%Y"),function(){return!0}],[d3.time.format.utc("%B"),function(n){return n.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(n){return n.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(n){return n.getUTCDay()&&n.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(n){return n.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(n){return n.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(n){return n.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(n){return n.getUTCMilliseconds()}]],rb=vh(ib);dc.year=function(n,t){return kc.domain(n.map(nw)).ticks(t).map(ef)};d3.time.scale.utc=function(){return rf(d3.scale.linear(),dc,rb)}}(),function(){function i(n,t){return new Date(t,n+1,0).getDate()}function r(n,t,i){return function(r,u,f){var e=n(r),o=[],s;if(e<r&&t(e),f>1)while(e<u)s=new Date(+e),i(s)%f==0&&o.push(s),t(e);else while(e<u)o.push(new Date(+e)),t(e);return o}}var n=window.nv||{};if(n.version="0.0.1a",n.dev=!0,window.nv=n,n.tooltip={},n.utils={},n.models={},n.charts={},n.graphs=[],n.logs={},n.dispatch=d3.dispatch("render_start","render_end"),n.dev){n.dispatch.on("render_start",function(){n.logs.startTime=+new Date});n.dispatch.on("render_end",function(){n.logs.endTime=+new Date;n.logs.totalTime=n.logs.endTime-n.logs.startTime;n.log("total",n.logs.totalTime)})}n.log=function(){return n.dev&&console.log&&console.log.apply&&console.log.apply(console,arguments),arguments[arguments.length-1]};n.render=function t(i){i=i||1;t.active=!0;n.dispatch.render_start();setTimeout(function(){for(var u,r=0;r<i&&(graph=t.queue[r]);r++)u=graph.generate(),typeof graph.callback==typeof Function&&graph.callback(u),n.graphs.push(u);t.queue.splice(0,r);t.queue.length?setTimeout(arguments.callee,0):(n.render.active=!1,n.dispatch.render_end())},0)};n.render.active=!1;n.render.queue=[];n.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]});n.render.queue.push(t);n.render.active||n.render()};n.identity=function(n){return n};n.strip=function(n){return n.replace(/(\s|&)/g,"")};d3.time.monthEnd=function(n){return new Date(n.getFullYear(),n.getMonth(),0)};d3.time.monthEnds=r(d3.time.monthEnd,function(n){n.setUTCDate(n.getUTCDate()+1);n.setDate(i(n.getMonth()+1,n.getFullYear()))},function(n){return n.getMonth()}),function(){var t=window.nv.tooltip={};t.show=function(t,i,r,u,f,e){var h=document.createElement("div"),p;h.className="nvtooltip "+(e?e:"xy-tooltip");r=r||"s";u=u||20;p=f?f:document.getElementsByTagName("body")[0];h.innerHTML=i;h.style.left=0;h.style.top=0;h.style.opacity=0;p.appendChild(h);var l=parseInt(h.offsetHeight),a=parseInt(h.offsetWidth),v=n.utils.windowSize().width,w=n.utils.windowSize().height,c=p.scrollTop,y=p.scrollLeft,o,s;switch(r){case"e":o=t[0]-a-u;s=t[1]-l/2;o<y&&(o=t[0]+u);s<c&&(s=c+5);s+l>c+w&&(s=c-l-5);break;case"w":o=t[0]+u;s=t[1]-l/2;o+a>v&&(o=t[0]-a-u);s<c&&(s=c+5);s+l>c+w&&(s=c-l-5);break;case"n":o=t[0]-a/2;s=t[1]+u;o<y&&(o=y+5);o+a>v&&(o=v-a-5);s+l>c+w&&(s=t[1]-l-u);break;case"s":o=t[0]-a/2;s=t[1]-l-u;o<y&&(o=y+5);o+a>v&&(o=v-a-5);c>s&&(s=t[1]+20)}return h.style.left=o+"px",h.style.top=s+"px",h.style.opacity=1,h.style.position="absolute",h.style.pointerEvents="none",h};t.cleanup=function(){for(var n=document.getElementsByClassName("nvtooltip"),t=[];n.length;)t.push(n[0]),n[0].style.transitionDelay="0 !important",n[0].style.opacity=0,n[0].className="nvtooltip-pending-removal";setTimeout(function(){while(t.length){var n=t.pop();n.parentNode.removeChild(n)}},500)}}();n.utils.windowSize=function(){var n={width:640,height:480};return document.body&&document.body.offsetWidth&&(n.width=document.body.offsetWidth,n.height=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(n.width=document.documentElement.offsetWidth,n.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(n.width=window.innerWidth,n.height=window.innerHeight),n};n.utils.windowResize=function(n){var t=window.onresize;window.onresize=function(i){typeof t=="function"&&t(i);n(i)}};n.utils.getColor=function(t){return arguments.length?Object.prototype.toString.call(t)==="[object Array]"?function(n,i){return n.color||t[i%t.length]}:t:n.utils.defaultColor()};n.utils.defaultColor=function(){var n=d3.scale.category20().range();return function(t,i){return t.color||n[i%n.length]}};n.utils.customTheme=function(n,t,i){t=t||function(n){return n.key};i=i||d3.scale.category20().range();var r=i.length;return function(u){var f=t(u);return r||(r=i.length),typeof n[f]!="undefined"?typeof n[f]=="function"?n[f]():n[f]:i[--r]}};n.utils.pjax=function(t,i){function r(r){d3.html(r,function(r){var u=d3.select(i).node();u.parentNode.replaceChild(d3.select(r).select(i).node(),u);n.utils.pjax(t,i)})}d3.selectAll(t).on("click",function(){history.pushState(this.href,this.textContent,this.href);r(this.href);d3.event.preventDefault()});d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})};n.models.axis=function(){function t(v){return v.each(function(t){var rt=d3.select(this),p=rt.selectAll("g.nv-wrap.nv-axis").data([t]),ut=p.enter().append("g").attr("class","nvd3 nv-wrap nv-axis"),ft=ut.append("g"),b=p.select("g"),w,y,tt,it,d,v,k;h!==null?i.ticks(h):(i.orient()=="top"||i.orient()=="bottom")&&i.ticks(Math.abs(n.range()[1]-n.range()[0])/100);d3.transition(b).call(i);o=o||i.scale();w=i.tickFormat();w==null&&(w=o.tickFormat());y=b.selectAll("text.nv-axislabel").data([c||null]);y.exit().remove();switch(i.orient()){case"top":y.enter().append("text").attr("class","nv-axislabel").attr("text-anchor","middle").attr("y",0);d=n.range().length==2?n.range()[1]:n.range()[n.range().length-1]+(n.range()[1]-n.range()[0]);y.attr("x",d/2);e&&(v=p.selectAll("g.nv-axisMaxMin").data(n.domain()),v.enter().append("g").attr("class","nv-axisMaxMin").append("text"),v.exit().remove(),v.attr("transform",function(t){return"translate("+n(t)+",0)"}).select("text").attr("dy","0em").attr("y",-i.tickPadding()).attr("text-anchor","middle").text(function(n){var t=w(n);return(""+t).match("NaN")?"":t}),d3.transition(v).attr("transform",function(t,i){return"translate("+n.range()[i]+",0)"}));break;case"bottom":var it=30,g=30,nt=b.selectAll("g").select("text");f%360&&(nt.each(function(){var n=this.getBBox().width;n>g&&(g=n)}),tt=Math.abs(Math.sin(f*Math.PI/180)),it=(tt?tt*g:g)+30,nt.attr("transform",function(){return"rotate("+f+" 0,0)"}).attr("text-anchor",f%360>0?"start":"end"));y.enter().append("text").attr("class","nv-axislabel").attr("text-anchor","middle").attr("y",it);d=n.range().length==2?n.range()[1]:n.range()[n.range().length-1]+(n.range()[1]-n.range()[0]);y.attr("x",d/2);e&&(v=p.selectAll("g.nv-axisMaxMin").data(n.domain()),v.enter().append("g").attr("class","nv-axisMaxMin").append("text"),v.exit().remove(),v.attr("transform",function(t){return"translate("+n(t)+",0)"}).select("text").attr("dy",".71em").attr("y",i.tickPadding()).attr("transform",function(){return"rotate("+f+" 0,0)"}).attr("text-anchor",f?f%360>0?"start":"end":"middle").text(function(n){var t=w(n);return(""+t).match("NaN")?"":t}),d3.transition(v).attr("transform",function(t,i){return"translate("+n.range()[i]+",0)"}));a&&nt.attr("transform",function(n,t){return"translate(0,"+(t%2==0?"0":"12")+")"});break;case"right":y.enter().append("text").attr("class","nv-axislabel").attr("text-anchor",u?"middle":"begin").attr("transform",u?"rotate(90)":"").attr("y",u?-Math.max(r.right,s)-12:-10);y.attr("x",u?n.range()[0]/2:i.tickPadding());e&&(v=p.selectAll("g.nv-axisMaxMin").data(n.domain()),v.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),v.exit().remove(),v.attr("transform",function(t){return"translate(0,"+n(t)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",i.tickPadding()).attr("text-anchor","start").text(function(n){var t=w(n);return(""+t).match("NaN")?"":t}),d3.transition(v).attr("transform",function(t,i){return"translate(0,"+n.range()[i]+")"}).select("text").style("opacity",1));break;case"left":y.enter().append("text").attr("class","nv-axislabel").attr("text-anchor",u?"middle":"end").attr("transform",u?"rotate(-90)":"").attr("y",u?-Math.max(r.left,s)+12:-10);y.attr("x",u?-n.range()[0]/2:-i.tickPadding());e&&(v=p.selectAll("g.nv-axisMaxMin").data(n.domain()),v.enter().append("g").attr("class","nv-axisMaxMin").append("text").style("opacity",0),v.exit().remove(),v.attr("transform",function(n){return"translate(0,"+o(n)+")"}).select("text").attr("dy",".32em").attr("y",0).attr("x",-i.tickPadding()).attr("text-anchor","end").text(function(n){var t=w(n);return(""+t).match("NaN")?"":t}),d3.transition(v).attr("transform",function(t,i){return"translate(0,"+n.range()[i]+")"}).select("text").style("opacity",1))}y.text(function(n){return n});e&&(i.orient()==="left"||i.orient()==="right")&&b.selectAll("g").each(function(t){(n(t)<n.range()[1]+10||n(t)>n.range()[0]-10)&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())});e&&(i.orient()==="top"||i.orient()==="bottom")&&(k=[],p.selectAll("g.nv-axisMaxMin").each(function(t,i){i?k.push(n(t)-this.getBBox().width-4):k.push(n(t)+this.getBBox().width+4)}),b.selectAll("g").each(function(t){(n(t)<k[0]||n(t)>k[1])&&(t>1e-10||t<-1e-10?d3.select(this).remove():d3.select(this).select("text").remove())}));l&&b.selectAll("line.tick").filter(function(n){return!parseFloat(Math.round(n*1e5)/1e6)}).classed("zero",!0);o=n.copy()}),t}var i=d3.svg.axis(),r={top:0,right:0,bottom:0,left:0},s=60,v=60,n=d3.scale.linear(),c=null,e=!0,l=!0,f=0,u=!0,a=!1,h=null,o;return i.scale(n).orient("bottom").tickFormat(function(n){return n}),t.axis=i,d3.rebind(t,i,"orient","tickValues","tickSubdivide","tickSize","tickPadding","tickFormat"),d3.rebind(t,n,"domain","range","rangeBand","rangeBands"),t.margin=function(n){return arguments.length?(r.top=typeof n.top!="undefined"?n.top:r.top,r.right=typeof n.right!="undefined"?n.right:r.right,r.bottom=typeof n.bottom!="undefined"?n.bottom:r.bottom,r.left=typeof n.left!="undefined"?n.left:r.left,t):r},t.width=function(n){return arguments.length?(s=n,t):s},t.ticks=function(n){return arguments.length?(h=n,t):h},t.height=function(n){return arguments.length?(v=n,t):v},t.axisLabel=function(n){return arguments.length?(c=n,t):c},t.showMaxMin=function(n){return arguments.length?(e=n,t):e},t.highlightZero=function(n){return arguments.length?(l=n,t):l},t.scale=function(r){return arguments.length?(n=r,i.scale(n),d3.rebind(t,n,"domain","range","rangeBand","rangeBands"),t):n},t.rotateYLabel=function(n){return arguments.length?(u=n,t):u},t.rotateLabels=function(n){return arguments.length?(f=n,t):f},t.staggerLabels=function(n){return arguments.length?(a=n,t):a},t};n.models.historicalBar=function(){function t(n){return n.each(function(n){var k=h-u.left-u.right,d=c-u.top-u.bottom,g=d3.select(this),b,ut;r.domain(p||d3.extent(n[0].values.map(o).concat(l))).range([0,k]);i.domain(w||d3.extent(n[0].values.map(f).concat(a))).range([d,0]);(r.domain()[0]===r.domain()[1]||i.domain()[0]===i.domain()[1])&&(singlePoint=!0);r.domain()[0]===r.domain()[1]&&(r.domain()[0]?r.domain([r.domain()[0]-r.domain()[0]*.01,r.domain()[1]+r.domain()[1]*.01]):r.domain([-1,1]));i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]+i.domain()[0]*.01,i.domain()[1]-i.domain()[1]*.01]):i.domain([-1,1]));var t=g.selectAll("g.nv-wrap.nv-bar").data([n[0].values]),nt=t.enter().append("g").attr("class","nvd3 nv-wrap nv-bar"),tt=nt.append("defs"),it=nt.append("g"),rt=t.select("g");it.append("g").attr("class","nv-bars");t.attr("transform","translate("+u.left+","+u.top+")");g.on("click",function(n,t){s.chartClick({data:n,index:t,pos:d3.event,id:e})});tt.append("clipPath").attr("id","nv-chart-clip-path-"+e).append("rect");t.select("#nv-chart-clip-path-"+e+" rect").attr("width",k).attr("height",d);rt.attr("clip-path",v?"url(#nv-chart-clip-path-"+e+")":"");b=t.select(".nv-bars").selectAll(".nv-bar").data(function(n){return n});b.exit().remove();ut=b.enter().append("rect").attr("x",0).attr("y",function(n,t){return i(Math.max(0,f(n,t)))}).attr("height",function(n,t){return Math.abs(i(f(n,t))-i(0))}).on("mouseover",function(t,u){d3.select(this).classed("hover",!0);s.elementMouseover({point:t,series:n[0],pos:[r(o(t,u)),i(f(t,u))],pointIndex:u,seriesIndex:0,e:d3.event})}).on("mouseout",function(t,i){d3.select(this).classed("hover",!1);s.elementMouseout({point:t,series:n[0],pointIndex:i,seriesIndex:0,e:d3.event})}).on("click",function(n,t){s.elementClick({value:f(n,t),data:n,index:t,pos:[r(o(n,t)),i(f(n,t))],e:d3.event,id:e});d3.event.stopPropagation()}).on("dblclick",function(n,t){s.elementDblClick({value:f(n,t),data:n,index:t,pos:[r(o(n,t)),i(f(n,t))],e:d3.event,id:e});d3.event.stopPropagation()});b.attr("fill",function(n,t){return y(n,t)}).attr("class",function(n,t,i){return(f(n,t)<0?"nv-bar negative":"nv-bar positive")+" nv-bar-"+i+"-"+t}).attr("transform",function(t,i){return"translate("+(r(o(t,i))-k/n[0].values.length*.5)+",0)"}).attr("width",k/n[0].values.length*.9);d3.transition(b).attr("y",function(n,t){return i(Math.max(0,f(n,t)))}).attr("height",function(n,t){return Math.abs(i(f(n,t))-i(0))})}),t}var u={top:0,right:0,bottom:0,left:0},h=960,c=500,e=Math.floor(Math.random()*1e4),r=d3.scale.linear(),i=d3.scale.linear(),o=function(n){return n.x},f=function(n){return n.y},l=[],a=[0],v=!0,y=n.utils.defaultColor(),p,w,s=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return t.dispatch=s,t.x=function(n){return arguments.length?(o=n,t):o},t.y=function(n){return arguments.length?(f=n,t):f},t.margin=function(n){return arguments.length?(u.top=typeof n.top!="undefined"?n.top:u.top,u.right=typeof n.right!="undefined"?n.right:u.right,u.bottom=typeof n.bottom!="undefined"?n.bottom:u.bottom,u.left=typeof n.left!="undefined"?n.left:u.left,t):u},t.width=function(n){return arguments.length?(h=n,t):h},t.height=function(n){return arguments.length?(c=n,t):c},t.xScale=function(n){return arguments.length?(r=n,t):r},t.yScale=function(n){return arguments.length?(i=n,t):i},t.xDomain=function(n){return arguments.length?(p=n,t):p},t.yDomain=function(n){return arguments.length?(w=n,t):w},t.forceX=function(n){return arguments.length?(l=n,t):l},t.forceY=function(n){return arguments.length?(a=n,t):a},t.clipEdge=function(n){return arguments.length?(v=n,t):v},t.color=function(i){return arguments.length?(y=n.utils.getColor(i),t):y},t.id=function(n){return arguments.length?(e=n,t):e},t};n.models.bullet=function(){function t(n){return n.each(function(n,t){var d=h-i.left-i.right,f=c-i.top-i.bottom,ft=d3.select(this),g=e.call(this,n,t).slice().sort(d3.descending),nt=o.call(this,n,t).slice().sort(d3.descending),tt=s.call(this,n,t).slice().sort(d3.descending),a=d3.scale.linear().domain([0,Math.max(g[0],nt[0],tt[0])]).range(u?[d,0]:[0,d]),y=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(a.range()),k,p,v;this.__chart__=a;var w=ft.selectAll("g.nv-wrap.nv-bullet").data([n]),et=w.enter().append("g").attr("class","nvd3 nv-wrap nv-bullet"),ot=et.append("g"),b=w.select("g");w.attr("transform","translate("+i.left+","+i.top+")");var it=function(n){return Math.abs(y(n)-y(0))},rt=function(n){return Math.abs(a(n)-a(0))},ut=b.selectAll("rect.nv-range").data(g);ut.enter().append("rect").attr("class",function(n,t){return"nv-range nv-s"+t}).attr("width",it).attr("height",f).attr("x",u?y:0).on("mouseover",function(n,t){r.elementMouseover({value:n,label:t<=0?"Maximum":t>1?"Minimum":"Mean",pos:[a(n),f/2]})}).on("mouseout",function(n,t){r.elementMouseout({value:n,label:t<=0?"Minimum":t>=1?"Maximum":"Mean"})});d3.transition(ut).attr("x",u?a:0).attr("width",rt).attr("height",f);k=b.selectAll("rect.nv-measure").data(tt);k.enter().append("rect").attr("class",function(n,t){return"nv-measure nv-s"+t}).style("fill",function(n,t){return l(n,t)}).attr("width",it).attr("height",f/3).attr("x",u?y:0).attr("y",f/3).on("mouseover",function(n){r.elementMouseover({value:n,label:"Current",pos:[a(n),f/2]})}).on("mouseout",function(n){r.elementMouseout({value:n,label:"Current"})});d3.transition(k).attr("width",rt).attr("height",f/3).attr("x",u?a:0).attr("y",f/3);p=b.selectAll("path.nv-markerTriangle").data(nt);v=f/6;p.enter().append("path").attr("class","nv-markerTriangle").attr("transform",function(n){return"translate("+y(n)+","+f/2+")"}).attr("d","M0,"+v+"L"+v+","+-v+" "+-v+","+-v+"Z").on("mouseover",function(n){r.elementMouseover({value:n,label:"Previous",pos:[a(n),f/2]})}).on("mouseout",function(n){r.elementMouseout({value:n,label:"Previous"})});d3.transition(p).attr("transform",function(n){return"translate("+a(n)+","+f/2+")"});p.exit().remove()}),d3.timer.flush(),t}var i={top:0,right:0,bottom:0,left:0},f="left",u=!1,e=function(n){return n.ranges},o=function(n){return n.markers},s=function(n){return n.measures},a=[0],h=380,c=30,v=null,l=n.utils.getColor(["#1f77b4"]),r=d3.dispatch("elementMouseover","elementMouseout");return t.dispatch=r,t.orient=function(n){return arguments.length?(f=n,u=f=="right"||f=="bottom",t):f},t.ranges=function(n){return arguments.length?(e=n,t):e},t.markers=function(n){return arguments.length?(o=n,t):o},t.measures=function(n){return arguments.length?(s=n,t):s},t.forceX=function(n){return arguments.length?(a=n,t):a},t.width=function(n){return arguments.length?(h=n,t):h},t.height=function(n){return arguments.length?(c=n,t):c},t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.tickFormat=function(n){return arguments.length?(v=n,t):v},t.color=function(i){return arguments.length?(l=n.utils.getColor(i),t):l},t};n.models.bulletChart=function(){function t(n){return n.each(function(f,v){var rt=d3.select(this),k=(l||parseInt(rt.style("width"))||960)-i.left-i.right,b=e-i.top-i.bottom,ht=this,p,d,et,it;t.update=function(){t(n)};t.container=this;var ct=s.call(this,f,v).slice().sort(d3.descending),lt=h.call(this,f,v).slice().sort(d3.descending),at=c.call(this,f,v).slice().sort(d3.descending),g=rt.selectAll("g.nv-wrap.nv-bulletChart").data([f]),vt=g.enter().append("g").attr("class","nvd3 nv-wrap nv-bulletChart"),nt=vt.append("g"),ut=g.select("g");nt.append("g").attr("class","nv-bulletWrap");nt.append("g").attr("class","nv-titles");g.attr("transform","translate("+i.left+","+i.top+")");p=d3.scale.linear().domain([0,Math.max(ct[0],lt[0],at[0])]).range(y?[k,0]:[0,k]);d=this.__chart__||d3.scale.linear().domain([0,Infinity]).range(p.range());this.__chart__=p;var yt=function(n){return Math.abs(d(n)-d(0))},pt=function(n){return Math.abs(p(n)-p(0))},ft=nt.select(".nv-titles").append("g").attr("text-anchor","end").attr("transform","translate(-6,"+(e-i.top-i.bottom)/2+")");ft.append("text").attr("class","nv-title").text(function(n){return n.title});ft.append("text").attr("class","nv-subtitle").attr("dy","1em").text(function(n){return n.subtitle});r.width(k).height(b);et=ut.select(".nv-bulletWrap");d3.transition(et).call(r);var ot=a||p.tickFormat(k/100),tt=ut.selectAll("g.nv-tick").data(p.ticks(k/100),function(n){return this.textContent||ot(n)}),st=tt.enter().append("g").attr("class","nv-tick").attr("transform",function(n){return"translate("+d(n)+",0)"}).style("opacity",1e-6);st.append("line").attr("y1",b).attr("y2",b*7/6);st.append("text").attr("text-anchor","middle").attr("dy","1em").attr("y",b*7/6).text(ot);it=d3.transition(tt).attr("transform",function(n){return"translate("+p(n)+",0)"}).style("opacity",1);it.select("line").attr("y1",b).attr("y2",b*7/6);it.select("text").attr("y",b*7/6);d3.transition(tt.exit()).attr("transform",function(n){return"translate("+p(n)+",0)"}).style("opacity",1e-6).remove();u.on("tooltipShow",function(n){n.key=data[0].title;o&&w(n,ht.parentNode)})}),d3.timer.flush(),t}var r=n.models.bullet(),f="left",y=!1,i={top:5,right:40,bottom:20,left:120},s=function(n){return n.ranges},h=function(n){return n.markers},c=function(n){return n.measures},l=null,e=55,a=null,o=!0,v=function(n,t,i){return"<h3>"+t+"<\/h3><p>"+i+"<\/p>"},p="No Data Available.",u=d3.dispatch("tooltipShow","tooltipHide"),w=function(r,u){var f=r.pos[0]+(u.offsetLeft||0)+i.left,e=r.pos[1]+(u.offsetTop||0)+i.top,o=v(r.key,r.label,r.value,r,t);n.tooltip.show([f,e],o,r.value<0?"e":"w",null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){u.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){u.tooltipHide(n)});u.on("tooltipHide",function(){o&&n.tooltip.cleanup()});return t.dispatch=u,t.bullet=r,d3.rebind(t,r,"color"),t.orient=function(n){return arguments.length?(f=n,y=f=="right"||f=="bottom",t):f},t.ranges=function(n){return arguments.length?(s=n,t):s},t.markers=function(n){return arguments.length?(h=n,t):h},t.measures=function(n){return arguments.length?(c=n,t):c},t.width=function(n){return arguments.length?(l=n,t):l},t.height=function(n){return arguments.length?(e=n,t):e},t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.tickFormat=function(n){return arguments.length?(a=n,t):a},t.tooltips=function(n){return arguments.length?(o=n,t):o},t.tooltipContent=function(n){return arguments.length?(v=n,t):v},t.noData=function(n){return arguments.length?(p=n,t):p},t};n.models.cumulativeLineChart=function(){function ut(){}function ft(n){n.x+=d3.event.dx;n.i=Math.round(e.invert(n.x));d3.select(this).attr("transform","translate("+e(n.i)+",0)");t.update()}function et(){t.update()}function t(n){return n.each(function(k){function bt(){lt.data([u]);t.update()}var ht=d3.select(this).classed("nv-chart-"+tt,!0),kt=this,ft=(y||parseInt(ht.style("width"))||960)-i.left-i.right,et=(l||parseInt(ht.style("height"))||400)-i.top-i.bottom,at,vt,pt,wt,yt,lt;if(t.update=function(){t(n)},t.container=this,k&&k.length&&k.filter(function(n){return n.values.length}).length)ht.selectAll(".nv-noData").remove();else return at=ht.selectAll(".nv-noData").data([g]),at.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),at.attr("x",i.left+ft/2).attr("y",i.top+et/2).text(function(n){return n}),t;nt=r.xScale();d=r.yScale();b?r.yDomain(null):(vt=k.filter(function(n){return!n.disabled}).map(function(n){var t=d3.extent(n.values,r.y());return[(t[0]-t[1])/(1+t[1]),(t[1]-t[0])/(1+t[0])]}),pt=[d3.min(vt,function(n){return n[0]}),d3.max(vt,function(n){return n[1]})],r.yDomain(pt));e.domain([0,k[0].values.length-1]).range([0,ft]).clamp(!0);var k=ot(u.i,k),ct=ht.selectAll("g.nv-wrap.nv-cumulativeLine").data([k]),st=ct.enter().append("g").attr("class","nvd3 nv-wrap nv-cumulativeLine").append("g"),ut=ct.select("g");st.append("g").attr("class","nv-x nv-axis");st.append("g").attr("class","nv-y nv-axis");st.append("g").attr("class","nv-background");st.append("g").attr("class","nv-linesWrap");st.append("g").attr("class","nv-legendWrap");st.append("g").attr("class","nv-controlsWrap");p&&(f.width(ft),ut.select(".nv-legendWrap").datum(k).call(f),i.top!=f.height()&&(i.top=f.height(),et=(l||parseInt(ht.style("height"))||400)-i.top-i.bottom),ut.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")"));w&&(wt=[{key:"Re-scale y-axis",disabled:!b}],v.width(140).color(["#444","#444","#444"]),ut.select(".nv-controlsWrap").datum(wt).attr("transform","translate(0,"+-i.top+")").call(v));ct.attr("transform","translate("+i.left+","+i.top+")");st.select(".nv-background").append("rect").attr("width",ft).attr("height",et);r.y(function(n){return n.display.y}).width(ft).height(et).color(k.map(function(n,t){return n.color||c(n,t)}).filter(function(n,t){return!k[t].disabled}));yt=ut.select(".nv-linesWrap").datum(k.filter(function(n){return!n.disabled}));yt.call(r);lt=yt.selectAll(".nv-indexLine").data([u]);lt.enter().append("rect").attr("class","nv-indexLine").attr("width",3).attr("x",-2).attr("fill","red").attr("fill-opacity",.5).call(rt);lt.attr("transform",function(n){return"translate("+e(n.i)+",0)"}).attr("height",et);o.scale(nt).ticks(ft/100).tickSize(-et,0);ut.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")");d3.transition(ut.select(".nv-x.nv-axis")).call(o);s.scale(d).ticks(et/36).tickSize(-ft,0);d3.transition(ut.select(".nv-y.nv-axis")).call(s);ut.select(".nv-background rect").on("click",function(){u.x=d3.mouse(this)[0];u.i=Math.round(e.invert(u.x));bt()});r.dispatch.on("elementClick",function(n){u.i=n.pointIndex;u.x=e(u.i);bt()});v.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;b=!i.disabled;n.call(t)});f.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;k.filter(function(n){return!n.disabled}).length||k.map(function(n){return n.disabled=!1,ct.selectAll(".nv-series").classed("disabled",!1),n});n.call(t)});h.on("tooltipShow",function(n){a&&it(n,kt.parentNode)})}),t}function ot(n,t){return t.map(function(t){var i=r.y()(t.values[n],n);return t.values=t.values.map(function(n,t){return n.display={y:(r.y()(n,t)-i)/(1+i)},n}),t})}var r=n.models.line(),o=n.models.axis(),s=n.models.axis(),f=n.models.legend(),v=n.models.legend(),i={top:30,right:30,bottom:50,left:60},c=n.utils.defaultColor(),y=null,l=null,p=!0,a=!0,w=!0,b=!0,k=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" at "+t+"<\/p>"},nt,d,tt=r.id(),g="No Data Available.",h=d3.dispatch("tooltipShow","tooltipHide");o.orient("bottom").tickPadding(5);s.orient("left");var e=d3.scale.linear(),u={i:0,x:0},it=function(i,u){var f=i.pos[0]+(u.offsetLeft||0),e=i.pos[1]+(u.offsetTop||0),h=o.tickFormat()(r.x()(i.point,i.pointIndex)),c=s.tickFormat()(r.y()(i.point,i.pointIndex)),l=k(i.series.key,h,c,i,t);n.tooltip.show([f,e],l,null,null,u)},rt=d3.behavior.drag().on("dragstart",ut).on("drag",ft).on("dragend",et);r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];h.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){h.tooltipHide(n)});h.on("tooltipHide",function(){a&&n.tooltip.cleanup()});return t.dispatch=h,t.lines=r,t.legend=f,t.xAxis=o,t.yAxis=s,d3.rebind(t,r,"defined","isArea","x","y","size","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(y=n,t):y},t.height=function(n){return arguments.length?(l=n,t):l},t.color=function(i){return arguments.length?(c=n.utils.getColor(i),f.color(c),t):c},t.showControls=function(n){return arguments.length?(w=n,t):w},t.showLegend=function(n){return arguments.length?(p=n,t):p},t.tooltips=function(n){return arguments.length?(a=n,t):a},t.tooltipContent=function(n){return arguments.length?(k=n,t):k},t.noData=function(n){return arguments.length?(g=n,t):g},t};n.models.discreteBar=function(){function t(n){return n.each(function(n){var it=a-f.left-f.right,tt=v-f.top-f.bottom,rt=d3.select(this),g,k,t,nt;n=n.map(function(n,t){return n.values=n.values.map(function(n){return n.series=t,n}),n});g=c&&l?[]:n.map(function(n){return n.values.map(function(n,t){return{x:e(n,t),y:r(n,t),y0:n.y0}})});u.domain(c||d3.merge(g).map(function(n){return n.x})).rangeBands([0,it],.1);i.domain(l||d3.extent(d3.merge(g).map(function(n){return n.y}).concat(y)));h?i.range([tt-(i.domain()[0]<0?12:0),i.domain()[1]>0?12:0]):i.range([tt,0]);w=w||u;b=b||i.copy().range([i(0),i(0)]);var d=rt.selectAll("g.nv-wrap.nv-discretebar").data([n]),ut=d.enter().append("g").attr("class","nvd3 nv-wrap nv-discretebar"),ft=ut.append("g"),et=d.select("g");ft.append("g").attr("class","nv-groups");d.attr("transform","translate("+f.left+","+f.top+")");k=d.select(".nv-groups").selectAll(".nv-group").data(function(n){return n},function(n){return n.key});k.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);d3.transition(k.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove();k.attr("class",function(n,t){return"nv-group nv-series-"+t}).classed("hover",function(n){return n.hover});d3.transition(k).style("stroke-opacity",1).style("fill-opacity",.75);t=k.selectAll("g.nv-bar").data(function(n){return n.values});t.exit().remove();nt=t.enter().append("g").attr("transform",function(n,t){return"translate("+u(e(n,t))+", "+i(0)+")"}).on("mouseover",function(t,f){d3.select(this).classed("hover",!0);o.elementMouseover({value:r(t,f),point:t,series:n[t.series],pos:[u(e(t,f))+u.rangeBand()*(t.series+.5)/n.length,i(r(t,f))],pointIndex:f,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,i){d3.select(this).classed("hover",!1);o.elementMouseout({value:r(t,i),point:t,series:n[t.series],pointIndex:i,seriesIndex:t.series,e:d3.event})}).on("click",function(t,f){o.elementClick({value:r(t,f),point:t,series:n[t.series],pos:[u(e(t,f))+u.rangeBand()*(t.series+.5)/n.length,i(r(t,f))],pointIndex:f,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(t,f){o.elementDblClick({value:r(t,f),point:t,series:n[t.series],pos:[u(e(t,f))+u.rangeBand()*(t.series+.5)/n.length,i(r(t,f))],pointIndex:f,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()});nt.append("rect").attr("height",0).attr("width",u.rangeBand()/n.length);h?(nt.append("text").attr("text-anchor","middle"),t.select("text").attr("x",u.rangeBand()/2).attr("y",function(n,t){return r(n,t)<0?i(r(n,t))-i(0)+12:-4}).text(function(n,t){return p(r(n,t))})):t.selectAll("text").remove();t.attr("class",function(n,t){return r(n,t)<0?"nv-bar negative":"nv-bar positive"}).style("fill",function(n,t){return n.color||s(n,t)}).style("stroke",function(n,t){return n.color||s(n,t)}).select("rect").attr("width",u.rangeBand()/n.length);d3.transition(t).attr("transform",function(n,t){return"translate("+u(e(n,t))+", "+(r(n,t)<0?i(0):i(r(n,t)))+")"}).select("rect").attr("height",function(n,t){return Math.abs(i(r(n,t))-i(0))});w=u.copy();b=i.copy()}),t}var f={top:0,right:0,bottom:0,left:0},a=960,v=500,k=Math.floor(Math.random()*1e4),u=d3.scale.ordinal(),i=d3.scale.linear(),e=function(n){return n.x},r=function(n){return n.y},y=[0],s=n.utils.defaultColor(),h=!1,p=d3.format(",.2f"),c,l,o=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),w,b;return t.dispatch=o,t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.margin=function(n){return arguments.length?(f.top=typeof n.top!="undefined"?n.top:f.top,f.right=typeof n.right!="undefined"?n.right:f.right,f.bottom=typeof n.bottom!="undefined"?n.bottom:f.bottom,f.left=typeof n.left!="undefined"?n.left:f.left,t):f},t.width=function(n){return arguments.length?(a=n,t):a},t.height=function(n){return arguments.length?(v=n,t):v},t.xScale=function(n){return arguments.length?(u=n,t):u},t.yScale=function(n){return arguments.length?(i=n,t):i},t.xDomain=function(n){return arguments.length?(c=n,t):c},t.yDomain=function(n){return arguments.length?(l=n,t):l},t.forceY=function(n){return arguments.length?(y=n,t):y},t.color=function(i){return arguments.length?(s=n.utils.getColor(i),t):s},t.id=function(n){return arguments.length?(k=n,t):k},t.showValues=function(n){return arguments.length?(h=n,t):h},t.valueFormat=function(n){return arguments.length?(p=n,t):p},t};n.models.discreteBarChart=function(){function t(n){return n.each(function(v){var b=d3.select(this),ut=this,k=(l||parseInt(b.style("width"))||960)-i.left-i.right,d=(a||parseInt(b.style("height"))||400)-i.top-i.bottom,nt,it,rt;if(t.update=function(){n.transition().call(t)},t.container=this,v&&v.length&&v.filter(function(n){return n.values.length}).length)b.selectAll(".nv-noData").remove();else return nt=b.selectAll(".nv-noData").data([p]),nt.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),nt.attr("x",i.left+k/2).attr("y",i.top+d/2).text(function(n){return n}),t;h=r.xScale();c=r.yScale();var tt=b.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([v]),g=tt.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),ft=g.append("defs"),y=tt.select("g");g.append("g").attr("class","nv-x nv-axis");g.append("g").attr("class","nv-y nv-axis");g.append("g").attr("class","nv-barsWrap");y.attr("transform","translate("+i.left+","+i.top+")");r.width(k).height(d);it=y.select(".nv-barsWrap").datum(v.filter(function(n){return!n.disabled}));d3.transition(it).call(r);ft.append("clipPath").attr("id","nv-x-label-clip-"+r.id()).append("rect");y.select("#nv-x-label-clip-"+r.id()+" rect").attr("width",h.rangeBand()*(e?2:1)).attr("height",16).attr("x",-h.rangeBand()/(e?1:2));u.scale(h).ticks(k/100).tickSize(-d,0);y.select(".nv-x.nv-axis").attr("transform","translate(0,"+(c.range()[0]+(r.showValues()&&c.domain()[0]<0?16:0))+")");y.select(".nv-x.nv-axis").transition().duration(0).call(u);rt=y.select(".nv-x.nv-axis").selectAll("g");e&&rt.selectAll("text").attr("transform",function(n,t,i){return"translate(0,"+(i%2==0?"0":"12")+")"});f.scale(c).ticks(d/36).tickSize(-k,0);d3.transition(y.select(".nv-y.nv-axis")).call(f);o.on("tooltipShow",function(n){s&&w(n,ut.parentNode)})}),t}var r=n.models.discreteBar(),u=n.models.axis(),f=n.models.axis(),i={top:15,right:10,bottom:50,left:60},l=null,a=null,v=n.utils.getColor(),e=!1,s=!0,y=function(n,t,i){return"<h3>"+t+"<\/h3><p>"+i+"<\/p>"},h,c,p="No Data Available.",o=d3.dispatch("tooltipShow","tooltipHide"),w;u.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(n){return n});f.orient("left").tickFormat(d3.format(",.1f"));w=function(i,e){var o=i.pos[0]+(e.offsetLeft||0),s=i.pos[1]+(e.offsetTop||0),h=u.tickFormat()(r.x()(i.point,i.pointIndex)),c=f.tickFormat()(r.y()(i.point,i.pointIndex)),l=y(i.series.key,h,c,i,t);n.tooltip.show([o,s],l,i.value<0?"n":"s",null,e)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];o.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){o.tooltipHide(n)});o.on("tooltipHide",function(){s&&n.tooltip.cleanup()});return t.dispatch=o,t.discretebar=r,t.xAxis=u,t.yAxis=f,d3.rebind(t,r,"x","y","xDomain","yDomain","forceX","forceY","id","showValues","valueFormat"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(l=n,t):l},t.height=function(n){return arguments.length?(a=n,t):a},t.color=function(i){return arguments.length?(v=n.utils.getColor(i),r.color(v),t):v},t.staggerLabels=function(n){return arguments.length?(e=n,t):e},t.tooltips=function(n){return arguments.length?(s=n,t):s},t.tooltipContent=function(n){return arguments.length?(y=n,t):y},t.noData=function(n){return arguments.length?(p=n,t):p},t};n.models.distribution=function(){function t(n){return n.each(function(n){var w=o-(r==="x"?i.left+i.right:i.top+i.bottom),a=r=="x"?"y":"x",v=d3.select(this),t,c;e=e||f;var l=v.selectAll("g.nv-distribution").data([n]),y=l.enter().append("g").attr("class","nvd3 nv-distribution"),b=y.append("g"),p=l.select("g");l.attr("transform","translate("+i.left+","+i.top+")");t=p.selectAll("g.nv-dist").data(function(n){return n},function(n){return n.key});t.enter().append("g");t.attr("class",function(n,t){return"nv-dist nv-series-"+t}).style("stroke",function(n,t){return h(n,t)});c=t.selectAll("line.nv-dist"+r).data(function(n){return n.values});c.enter().append("line").attr(r+"1",function(n,t){return e(u(n,t))}).attr(r+"2",function(n,t){return e(u(n,t))});d3.transition(t.exit().selectAll("line.nv-dist"+r)).attr(r+"1",function(n,t){return f(u(n,t))}).attr(r+"2",function(n,t){return f(u(n,t))}).style("stroke-opacity",0).remove();c.attr("class",function(n,t){return"nv-dist"+r+" nv-dist"+r+"-"+t}).attr(a+"1",0).attr(a+"2",s);d3.transition(c).attr(r+"1",function(n,t){return f(u(n,t))}).attr(r+"2",function(n,t){return f(u(n,t))});e=f.copy()}),t}var i={top:0,right:0,bottom:0,left:0},o=400,s=8,r="x",u=function(n){return n[r]},h=n.utils.defaultColor(),f=d3.scale.linear(),e;return t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(o=n,t):o},t.axis=function(n){return arguments.length?(r=n,t):r},t.size=function(n){return arguments.length?(s=n,t):s},t.getData=function(n){return arguments.length?(u=d3.functor(n),t):u},t.scale=function(n){return arguments.length?(f=n,t):f},t.color=function(i){return arguments.length?(h=n.utils.getColor(i),t):h},t};n.models.indentedTree=function(){function t(n){return n.each(function(i){function tt(n,i,r){if(d3.event.stopPropagation(),d3.event.shiftKey&&!r)return d3.event.shiftKey=!1,n.values&&n.values.forEach(function(n){(n.values||n._values)&&tt(n,0,!0)}),!0;if(!ot(n))return!0;n.values?(n._values=n.values,n.values=null):(n.values=n._values,n._values=null);t.update()}function v(n){return n._values&&n._values.length?l:n.values&&n.values.length?a:""}function it(n){return n._values&&n._values.length}function ot(n){var t=n.values||n._values;return t&&t.length}var rt=0,p=1,w=d3.layout.tree().children(function(n){return n.values}).size([r,h]),d,g,y,e,nt;t.update=function(){n.transition().call(t)};t.container=this;i[0]||(i[0]={key:s});var b=w.nodes(i[0]),k=d3.select(this).selectAll("div").data([[b]]),ut=k.enter().append("div").attr("class","nvd3 nv-wrap nv-indentedtree"),ft=ut.append("table"),et=k.select("table").attr("width","100%").attr("class",c);o&&(d=ft.append("thead"),g=d.append("tr"),u.forEach(function(n){g.append("th").attr("width",n.width?n.width:"10%").style("text-align",n.type=="numeric"?"right":"left").append("span").text(n.label)}));y=et.selectAll("tbody").data(function(n){return n});y.enter().append("tbody");p=d3.max(b,function(n){return n.depth});w.size([r,p*h]);e=y.selectAll("tr").data(function(n){return n},function(n){return n.id||n.id==++rt});e.exit().remove();e.select("img.nv-treeicon").attr("src",v).classed("folded",it);nt=e.enter().append("tr");u.forEach(function(n,t){var i=nt.append("td").style("padding-left",function(n){return(t?0:n.depth*h+12+(v(n)?0:16))+"px"},"important").style("text-align",n.type=="numeric"?"right":"left");if(t==0)i.append("img").classed("nv-treeicon",!0).classed("nv-folded",it).attr("src",v).style("width","14px").style("height","14px").style("padding","0 1px").style("display",function(n){return v(n)?"inline-block":"none"}).on("click",tt);if(i.append("span").attr("class",d3.functor(n.classes)).text(function(t){return n.format?n.format(t):t[n.key]||"-"}),n.showCount&&i.append("span").attr("class","nv-childrenCount").text(function(n){return n.values&&n.values.length||n._values&&n._values.length?"("+(n.values&&n.values.length||n._values&&n._values.length)+")":""}),n.click)i.select("span").on("click",n.click)});e.order().on("click",function(n){f.elementClick({row:this,data:n,pos:[n.x,n.y]})}).on("dblclick",function(n){f.elementDblclick({row:this,data:n,pos:[n.x,n.y]})}).on("mouseover",function(n){f.elementMouseover({row:this,data:n,pos:[n.x,n.y]})}).on("mouseout",function(n){f.elementMouseout({row:this,data:n,pos:[n.x,n.y]})})}),t}var i={top:0,right:0,bottom:0,left:0},v=960,r=500,e=n.utils.defaultColor(),y=Math.floor(Math.random()*1e4),o=!0,s="No Data Available.",h=20,u=[{key:"key",label:"Name",type:"text"}],c=null,l="images/grey-plus.png",a="images/grey-minus.png",f=d3.dispatch("elementClick","elementDblclick","elementMouseover","elementMouseout");return t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(v=n,t):v},t.height=function(n){return arguments.length?(r=n,t):r},t.color=function(i){return arguments.length?(e=n.utils.getColor(i),scatter.color(e),t):e},t.id=function(n){return arguments.length?(y=n,t):y},t.header=function(n){return arguments.length?(o=n,t):o},t.noData=function(n){return arguments.length?(s=n,t):s},t.columns=function(n){return arguments.length?(u=n,t):u},t.tableClass=function(n){return arguments.length?(c=n,t):c},t.iconOpen=function(n){return arguments.length?(l=n,t):l},t.iconClose=function(n){return arguments.length?(a=n,t):a},t};n.models.legend=function(){function i(n){return n.each(function(n){var rt=r-t.left-t.right,ut=d3.select(this),w=ut.selectAll("g.nv-legend").data([n]),ft=w.enter().append("g").attr("class","nvd3 nv-legend").append("g"),b=w.select("g"),h,d,c,g,v,nt;if(w.attr("transform","translate("+t.left+","+t.top+")"),h=b.selectAll(".nv-series").data(function(n){return n}),d=h.enter().append("g").attr("class","nv-series").on("mouseover",function(n,t){u.legendMouseover(n,t)}).on("mouseout",function(n,t){u.legendMouseout(n,t)}).on("click",function(n,t){u.legendClick(n,t)}).on("dblclick",function(n,t){u.legendDblclick(n,t)}),d.append("circle").style("stroke-width",2).attr("r",5),d.append("text").attr("text-anchor","start").attr("dy",".32em").attr("dx","8"),h.classed("disabled",function(n){return n.disabled}),h.exit().remove(),h.select("circle").style("fill",function(n,t){return n.color||e(n,t)}).style("stroke",function(n,t){return n.color||e(n,t)}),h.select("text").text(o),s){c=[];h.each(function(){c.push(d3.select(this).select("text").node().getComputedTextLength()+28)});for(var i=0,a=0,l=[];a<rt&&i<c.length;)l[i]=c[i],a+=c[i++];while(a>rt&&i>1){for(l=[],i--,k=0;k<c.length;k++)c[k]>(l[k%i]||0)&&(l[k%i]=c[k]);a=l.reduce(function(n,t){return n+t})}for(g=[],v=0,nt=0;v<i;v++)g[v]=nt,nt+=l[v];h.attr("transform",function(n,t){return"translate("+g[t%i]+","+(5+Math.floor(t/i)*20)+")"});b.attr("transform","translate("+(r-t.right-a)+","+t.top+")");f=t.top+t.bottom+Math.ceil(c.length/i)*20}else{var tt=5,y=5,it=0,p;h.attr("transform",function(){var n=d3.select(this).select("text").node().getComputedTextLength()+28;return p=y,r<t.left+t.right+p+n&&(y=p=5,tt+=20),y+=n,y>it&&(it=y),"translate("+p+","+tt+")"});b.attr("transform","translate("+(r-t.right-it)+","+t.top+")");f=t.top+t.bottom+tt+15}}),i}var t={top:5,right:0,bottom:5,left:0},r=400,f=20,o=function(n){return n.key},e=n.utils.defaultColor(),s=!0,u=d3.dispatch("legendClick","legendDblclick","legendMouseover","legendMouseout");return i.dispatch=u,i.margin=function(n){return arguments.length?(t.top=typeof n.top!="undefined"?n.top:t.top,t.right=typeof n.right!="undefined"?n.right:t.right,t.bottom=typeof n.bottom!="undefined"?n.bottom:t.bottom,t.left=typeof n.left!="undefined"?n.left:t.left,i):t},i.width=function(n){return arguments.length?(r=n,i):r},i.height=function(n){return arguments.length?(f=n,i):f},i.key=function(n){return arguments.length?(o=n,i):o},i.color=function(t){return arguments.length?(e=n.utils.getColor(t),i):e},i.align=function(n){return arguments.length?(s=n,i):s},i};n.models.line=function(){function t(n){return n.each(function(n){var nt=y-u.left-u.right,tt=p-u.top-u.bottom,ut=d3.select(this),k,t,d,g;a=r.xScale();i=r.yScale();c=c||a;e=e||i;var b=ut.selectAll("g.nv-wrap.nv-line").data([n]),it=b.enter().append("g").attr("class","nvd3 nv-wrap nv-line"),ft=it.append("defs"),rt=it.append("g"),et=b.select("g");rt.append("g").attr("class","nv-groups");rt.append("g").attr("class","nv-scatterWrap");b.attr("transform","translate("+u.left+","+u.top+")");r.width(nt).height(tt);k=b.select(".nv-scatterWrap");d3.transition(k).call(r);ft.append("clipPath").attr("id","nv-edge-clip-"+r.id()).append("rect");b.select("#nv-edge-clip-"+r.id()+" rect").attr("width",nt).attr("height",tt);et.attr("clip-path",v?"url(#nv-edge-clip-"+r.id()+")":"");k.attr("clip-path",v?"url(#nv-edge-clip-"+r.id()+")":"");t=b.select(".nv-groups").selectAll(".nv-group").data(function(n){return n},function(n){return n.key});t.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);d3.transition(t.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove();t.attr("class",function(n,t){return"nv-group nv-series-"+t}).classed("hover",function(n){return n.hover}).style("fill",function(n,t){return l(n,t)}).style("stroke",function(n,t){return l(n,t)});d3.transition(t).style("stroke-opacity",1).style("fill-opacity",.5);d=t.selectAll("path.nv-area").data(function(n){return w(n)?[n]:[]});d.enter().append("path").attr("class","nv-area").attr("d",function(n){return d3.svg.area().interpolate(h).defined(s).x(function(n,t){return c(o(n,t))}).y0(function(n,t){return e(f(n,t))}).y1(function(){return e(i.domain()[0]<=0?i.domain()[1]>=0?0:i.domain()[1]:i.domain()[0])}).apply(this,[n.values])});d3.transition(t.exit().selectAll("path.nv-area")).attr("d",function(n){return d3.svg.area().interpolate(h).defined(s).x(function(n,t){return c(o(n,t))}).y0(function(n,t){return e(f(n,t))}).y1(function(){return e(i.domain()[0]<=0?i.domain()[1]>=0?0:i.domain()[1]:i.domain()[0])}).apply(this,[n.values])});d3.transition(d).attr("d",function(n){return d3.svg.area().interpolate(h).defined(s).x(function(n,t){return c(o(n,t))}).y0(function(n,t){return e(f(n,t))}).y1(function(){return e(i.domain()[0]<=0?i.domain()[1]>=0?0:i.domain()[1]:i.domain()[0])}).apply(this,[n.values])});g=t.selectAll("path.nv-line").data(function(n){return[n.values]});g.enter().append("path").attr("class","nv-line").attr("d",d3.svg.line().interpolate(h).defined(s).x(function(n,t){return c(o(n,t))}).y(function(n,t){return e(f(n,t))}));d3.transition(t.exit().selectAll("path.nv-line")).attr("d",d3.svg.line().interpolate(h).defined(s).x(function(n,t){return a(o(n,t))}).y(function(n,t){return i(f(n,t))}));d3.transition(g).attr("d",d3.svg.line().interpolate(h).defined(s).x(function(n,t){return a(o(n,t))}).y(function(n,t){return i(f(n,t))}));c=a.copy();e=i.copy()}),t}var r=n.models.scatter(),u={top:0,right:0,bottom:0,left:0},y=960,p=500,l=n.utils.defaultColor(),o=function(n){return n.x},f=function(n){return n.y},s=function(n,t){return!isNaN(f(n,t))&&f(n,t)!==null},w=function(n){return n.area},v=!1,a,i,h="linear",c,e;return r.size(16).sizeDomain([16,256]),t.dispatch=r.dispatch,t.scatter=r,d3.rebind(t,r,"id","interactive","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","forceX","forceY","forceSize","clipVoronoi","clipRadius"),t.margin=function(n){return arguments.length?(u.top=typeof n.top!="undefined"?n.top:u.top,u.right=typeof n.right!="undefined"?n.right:u.right,u.bottom=typeof n.bottom!="undefined"?n.bottom:u.bottom,u.left=typeof n.left!="undefined"?n.left:u.left,t):u},t.width=function(n){return arguments.length?(y=n,t):y},t.height=function(n){return arguments.length?(p=n,t):p},t.x=function(n){return arguments.length?(o=n,r.x(n),t):o},t.y=function(n){return arguments.length?(f=n,r.y(n),t):f},t.clipEdge=function(n){return arguments.length?(v=n,t):v},t.color=function(i){return arguments.length?(l=n.utils.getColor(i),r.color(l),t):l},t.interpolate=function(n){return arguments.length?(h=n,t):h},t.defined=function(n){return arguments.length?(s=n,t):s},t.isArea=function(n){return arguments.length?(w=d3.functor(n),t):w},t};n.models.lineChart=function(){function t(n){return n.each(function(v){var k=d3.select(this),ft=this,d=(l||parseInt(k.style("width"))||960)-i.left-i.right,g=(h||parseInt(k.style("height"))||400)-i.top-i.bottom,rt,ut;if(t.update=function(){t(n)},t.container=this,v&&v.length&&v.filter(function(n){return n.values.length}).length)k.selectAll(".nv-noData").remove();else return rt=k.selectAll(".nv-noData").data([p]),rt.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),rt.attr("x",i.left+d/2).attr("y",i.top+g/2).text(function(n){return n}),t;w=r.xScale();y=r.yScale();var nt=k.selectAll("g.nv-wrap.nv-lineChart").data([v]),it=nt.enter().append("g").attr("class","nvd3 nv-wrap nv-lineChart").append("g"),tt=nt.select("g");it.append("g").attr("class","nv-x nv-axis");it.append("g").attr("class","nv-y nv-axis");it.append("g").attr("class","nv-linesWrap");it.append("g").attr("class","nv-legendWrap");a&&(u.width(d),tt.select(".nv-legendWrap").datum(v).call(u),i.top!=u.height()&&(i.top=u.height(),g=(h||parseInt(k.style("height"))||400)-i.top-i.bottom),nt.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")"));nt.attr("transform","translate("+i.left+","+i.top+")");r.width(d).height(g).color(v.map(function(n,t){return n.color||s(n,t)}).filter(function(n,t){return!v[t].disabled}));ut=tt.select(".nv-linesWrap").datum(v.filter(function(n){return!n.disabled}));d3.transition(ut).call(r);f.scale(w).ticks(d/100).tickSize(-g,0);tt.select(".nv-x.nv-axis").attr("transform","translate(0,"+y.range()[0]+")");d3.transition(tt.select(".nv-x.nv-axis")).call(f);e.scale(y).ticks(g/36).tickSize(-d,0);d3.transition(tt.select(".nv-y.nv-axis")).call(e);u.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;v.filter(function(n){return!n.disabled}).length||v.map(function(n){return n.disabled=!1,nt.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});o.on("tooltipShow",function(n){c&&b(n,ft.parentNode)})}),t}var r=n.models.line(),f=n.models.axis(),e=n.models.axis(),u=n.models.legend(),i={top:30,right:20,bottom:50,left:60},s=n.utils.defaultColor(),l=null,h=null,a=!0,c=!0,v=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" at "+t+"<\/p>"},w,y,p="No Data Available.",o=d3.dispatch("tooltipShow","tooltipHide"),b;f.orient("bottom").tickPadding(5);e.orient("left");b=function(i,u){var s,o,h;u&&(s=d3.select(u).select("svg"),o=s.attr("viewBox"),o&&(o=o.split(" "),h=parseInt(s.style("width"))/o[2],i.pos[0]=i.pos[0]*h,i.pos[1]=i.pos[1]*h));var c=i.pos[0]+(u.offsetLeft||0),l=i.pos[1]+(u.offsetTop||0),a=f.tickFormat()(r.x()(i.point,i.pointIndex)),y=e.tickFormat()(r.y()(i.point,i.pointIndex)),p=v(i.series.key,a,y,i,t);n.tooltip.show([c,l],p,null,null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];o.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){o.tooltipHide(n)});o.on("tooltipHide",function(){c&&n.tooltip.cleanup()});return t.dispatch=o,t.lines=r,t.legend=u,t.xAxis=f,t.yAxis=e,d3.rebind(t,r,"defined","isArea","x","y","size","xScale","yScale","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id","interpolate"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(l=n,t):l},t.height=function(n){return arguments.length?(h=n,t):h},t.color=function(i){return arguments.length?(s=n.utils.getColor(i),u.color(s),t):s},t.showLegend=function(n){return arguments.length?(a=n,t):a},t.tooltips=function(n){return arguments.length?(c=n,t):c},t.tooltipContent=function(n){return arguments.length?(v=n,t):v},t.noData=function(n){return arguments.length?(p=n,t):p},t};n.models.linePlusBarChart=function(){function t(n){return n.each(function(b){var et=d3.select(this),vt=this,it=(p||parseInt(et.style("width"))||960)-i.left-i.right,ut=(l||parseInt(et.style("height"))||400)-i.top-i.bottom,ht,lt,at;if(t.update=function(){t(n)},t.container=this,b&&b.length&&b.filter(function(n){return n.values.length}).length)et.selectAll(".nv-noData").remove();else return ht=et.selectAll(".nv-noData").data([g]),ht.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),ht.attr("x",i.left+it/2).attr("y",i.top+ut/2).text(function(n){return n}),t;k=o.scale();d=u.yScale();nt=r.yScale();var ot=b.filter(function(n){return!n.disabled&&n.bar}),ct=b.filter(function(n){return!n.bar}),yt=b.filter(function(n){return!n.disabled&&n.bar}).map(function(n){return n.values.map(function(n,t){return{x:a(n,t),y:v(n,t)}})}),pt=b.filter(function(n){return!n.disabled&&!n.bar}).map(function(n){return n.values.map(function(n,t){return{x:a(n,t),y:v(n,t)}})});k.domain(d3.extent(d3.merge(yt.concat(pt)),function(n){return n.x})).range([0,it]);var st=d3.select(this).selectAll("g.nv-wrap.nv-linePlusBar").data([b]),ft=st.enter().append("g").attr("class","nvd3 nv-wrap nv-linePlusBar").append("g"),rt=st.select("g");ft.append("g").attr("class","nv-x nv-axis");ft.append("g").attr("class","nv-y1 nv-axis");ft.append("g").attr("class","nv-y2 nv-axis");ft.append("g").attr("class","nv-barsWrap");ft.append("g").attr("class","nv-linesWrap");ft.append("g").attr("class","nv-legendWrap");w&&(f.width(it/2),rt.select(".nv-legendWrap").datum(b.map(function(n){return n.originalKey=n.originalKey===undefined?n.key:n.originalKey,n.key=n.originalKey+(n.bar?" (left axis)":" (right axis)"),n})).call(f),i.top!=f.height()&&(i.top=f.height(),ut=(l||parseInt(et.style("height"))||400)-i.top-i.bottom),rt.select(".nv-legendWrap").attr("transform","translate("+it/2+","+-i.top+")"));st.attr("transform","translate("+i.left+","+i.top+")");r.width(it).height(ut).color(b.map(function(n,t){return n.color||c(n,t)}).filter(function(n,t){return!b[t].disabled&&!b[t].bar}));u.width(it).height(ut).color(b.map(function(n,t){return n.color||c(n,t)}).filter(function(n,t){return!b[t].disabled&&b[t].bar}));lt=rt.select(".nv-barsWrap").datum(ot.length?ot:[{values:[]}]);at=rt.select(".nv-linesWrap").datum(ct[0].disabled?[{values:[]}]:ct);d3.transition(lt).call(u);d3.transition(at).call(r);o.ticks(it/100).tickSize(-ut,0);rt.select(".nv-x.nv-axis").attr("transform","translate(0,"+d.range()[0]+")");d3.transition(rt.select(".nv-x.nv-axis")).call(o);s.scale(d).ticks(ut/36).tickSize(-it,0);d3.transition(rt.select(".nv-y1.nv-axis")).style("opacity",ot.length?1:0).call(s);h.scale(nt).ticks(ut/36).tickSize(ot.length?0:-it,0);rt.select(".nv-y2.nv-axis").style("opacity",ct.length?1:0).attr("transform","translate("+k.range()[1]+",0)");d3.transition(rt.select(".nv-y2.nv-axis")).call(h);f.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;b.filter(function(n){return!n.disabled}).length||b.map(function(n){return n.disabled=!1,st.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});e.on("tooltipShow",function(n){y&&tt(n,vt.parentNode)})}),t}var r=n.models.line(),u=n.models.historicalBar(),o=n.models.axis(),s=n.models.axis(),h=n.models.axis(),f=n.models.legend(),i={top:30,right:60,bottom:50,left:60},p=null,l=null,a=function(n){return n.x},v=function(n){return n.y},c=n.utils.defaultColor(),w=!0,y=!0,b=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" at "+t+"<\/p>"},k,d,nt,g="No Data Available.",e=d3.dispatch("tooltipShow","tooltipHide"),tt;r.clipEdge(!1);o.orient("bottom").tickPadding(5);s.orient("left");h.orient("right");tt=function(i,u){var f=i.pos[0]+(u.offsetLeft||0),e=i.pos[1]+(u.offsetTop||0),c=o.tickFormat()(r.x()(i.point,i.pointIndex)),l=(i.series.bar?s:h).tickFormat()(r.y()(i.point,i.pointIndex)),a=b(i.series.key,c,l,i,t);n.tooltip.show([f,e],a,i.value<0?"n":"s",null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];e.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){e.tooltipHide(n)});u.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];e.tooltipShow(n)});u.dispatch.on("elementMouseout.tooltip",function(n){e.tooltipHide(n)});e.on("tooltipHide",function(){y&&n.tooltip.cleanup()});return t.dispatch=e,t.legend=f,t.lines=r,t.bars=u,t.xAxis=o,t.y1Axis=s,t.y2Axis=h,d3.rebind(t,r,"defined","size","clipVoronoi","interpolate"),t.x=function(n){return arguments.length?(a=n,r.x(n),u.x(n),t):a},t.y=function(n){return arguments.length?(v=n,r.y(n),u.y(n),t):v},t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(p=n,t):p},t.height=function(n){return arguments.length?(l=n,t):l},t.color=function(i){return arguments.length?(c=n.utils.getColor(i),f.color(c),t):c},t.showLegend=function(n){return arguments.length?(w=n,t):w},t.tooltips=function(n){return arguments.length?(y=n,t):y},t.tooltipContent=function(n){return arguments.length?(b=n,t):b},t.noData=function(n){return arguments.length?(g=n,t):g},t};n.models.lineWithFocusChart=function(){function t(n){return n.each(function(it){function ni(n){var r=+(n=="e"),i=r?1:-1,t=ht/3;return"M"+.5*i+","+t+"A6,6 0 0 "+r+" "+6.5*i+","+(t+6)+"V"+(2*t-6)+"A6,6 0 0 "+r+" "+.5*i+","+2*t+"ZM"+2.5*i+","+(t+8)+"V"+(2*t-8)+"M"+4.5*i+","+(t+8)+"V"+(2*t-8)}function ti(){u.empty()||u.extent(c);wt.data([u.empty()?e.domain():c]).each(function(n){var t=e(n[0])-b.range()[0],i=b.range()[1]-e(n[1]);d3.select(this).select(".left").attr("width",t<0?0:t);d3.select(this).select(".right").attr("x",e(n[1])).attr("width",i<0?0:i)})}function dt(){c=u.empty()?null:u.extent();extent=u.empty()?e.domain():u.extent();l.brush({extent:extent,brush:u});ti();var n=et.select(".nv-focus .nv-linesWrap").datum(it.filter(function(n){return!n.disabled}).map(function(n){return{key:n.key,values:n.values.filter(function(n,t){return r.x()(n,t)>=extent[0]&&r.x()(n,t)<=extent[1]})}}));d3.transition(n).call(r);d3.transition(et.select(".nv-focus .nv-x.nv-axis")).call(o);d3.transition(et.select(".nv-focus .nv-y.nv-axis")).call(s)}var ct=d3.select(this),gt=this,ot=(g||parseInt(ct.style("width"))||960)-i.left-i.right,st=(w||parseInt(ct.style("height"))||400)-i.top-i.bottom-nt,ht=nt-y.top-y.bottom,yt,vt,lt,kt,wt,bt;if(t.update=function(){t(n)},t.container=this,it&&it.length&&it.filter(function(n){return n.values.length}).length)ct.selectAll(".nv-noData").remove();else return yt=ct.selectAll(".nv-noData").data([rt]),yt.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),yt.attr("x",i.left+ot/2).attr("y",i.top+st/2).text(function(n){return n}),t;b=r.xScale();ut=r.yScale();e=f.xScale();k=f.yScale();var at=ct.selectAll("g.nv-wrap.nv-lineWithFocusChart").data([it]),pt=at.enter().append("g").attr("class","nvd3 nv-wrap nv-lineWithFocusChart").append("g"),et=at.select("g");pt.append("g").attr("class","nv-legendWrap");vt=pt.append("g").attr("class","nv-focus");vt.append("g").attr("class","nv-x nv-axis");vt.append("g").attr("class","nv-y nv-axis");vt.append("g").attr("class","nv-linesWrap");lt=pt.append("g").attr("class","nv-context");lt.append("g").attr("class","nv-x nv-axis");lt.append("g").attr("class","nv-y nv-axis");lt.append("g").attr("class","nv-linesWrap");lt.append("g").attr("class","nv-brushBackground");lt.append("g").attr("class","nv-x nv-brush");tt&&(h.width(ot),et.select(".nv-legendWrap").datum(it).call(h),i.top!=h.height()&&(i.top=h.height(),st=(w||parseInt(ct.style("height"))||400)-i.top-i.bottom-nt),et.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")"));at.attr("transform","translate("+i.left+","+i.top+")");r.width(ot).height(st).color(it.map(function(n,t){return n.color||p(n,t)}).filter(function(n,t){return!it[t].disabled}));f.defined(r.defined()).width(ot).height(ht).color(it.map(function(n,t){return n.color||p(n,t)}).filter(function(n,t){return!it[t].disabled}));et.select(".nv-context").attr("transform","translate(0,"+(st+i.bottom+y.top)+")");kt=et.select(".nv-context .nv-linesWrap").datum(it.filter(function(n){return!n.disabled}));d3.transition(kt).call(f);o.scale(b).ticks(ot/100).tickSize(-st,0);s.scale(ut).ticks(st/36).tickSize(-ot,0);et.select(".nv-focus .nv-x.nv-axis").attr("transform","translate(0,"+st+")");u.x(e).on("brush",dt);c&&u.extent(c);wt=et.select(".nv-brushBackground").selectAll("g").data([c||u.extent()]);bt=wt.enter().append("g");bt.append("rect").attr("class","left").attr("x",0).attr("y",0).attr("height",ht);bt.append("rect").attr("class","right").attr("x",0).attr("y",0).attr("height",ht);gBrush=et.select(".nv-x.nv-brush").call(u);gBrush.selectAll("rect").attr("height",ht);gBrush.selectAll(".resize").append("path").attr("d",ni);dt();a.scale(e).ticks(ot/100).tickSize(-ht,0);et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+k.range()[0]+")");d3.transition(et.select(".nv-context .nv-x.nv-axis")).call(a);v.scale(k).ticks(ht/36).tickSize(-ot,0);d3.transition(et.select(".nv-context .nv-y.nv-axis")).call(v);et.select(".nv-context .nv-x.nv-axis").attr("transform","translate(0,"+k.range()[0]+")");h.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;it.filter(function(n){return!n.disabled}).length||it.map(function(n){return n.disabled=!1,at.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});l.on("tooltipShow",function(n){d&&ft(n,gt.parentNode)})}),t}var r=n.models.line(),f=n.models.line(),o=n.models.axis(),s=n.models.axis(),a=n.models.axis(),v=n.models.axis(),h=n.models.legend(),u=d3.svg.brush(),i={top:30,right:30,bottom:30,left:60},y={top:0,right:30,bottom:20,left:60},p=n.utils.defaultColor(),g=null,w=null,nt=100,b,ut,e,k,tt=!0,c=null,d=!0,it=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" at "+t+"<\/p>"},rt="No Data Available.",l=d3.dispatch("tooltipShow","tooltipHide","brush"),ft;r.clipEdge(!0);f.interactive(!1);o.orient("bottom").tickPadding(5);s.orient("left");a.orient("bottom").tickPadding(5);v.orient("left");ft=function(i,u){var f=i.pos[0]+(u.offsetLeft||0),e=i.pos[1]+(u.offsetTop||0),h=o.tickFormat()(r.x()(i.point,i.pointIndex)),c=s.tickFormat()(r.y()(i.point,i.pointIndex)),l=it(i.series.key,h,c,i,t);n.tooltip.show([f,e],l,null,null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];l.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){l.tooltipHide(n)});l.on("tooltipHide",function(){d&&n.tooltip.cleanup()});return t.dispatch=l,t.legend=h,t.lines=r,t.lines2=f,t.xAxis=o,t.yAxis=s,t.x2Axis=a,t.y2Axis=v,d3.rebind(t,r,"defined","isArea","size","xDomain","yDomain","forceX","forceY","interactive","clipEdge","clipVoronoi","id"),t.x=function(n){return arguments.length?(r.x(n),f.x(n),t):r.x},t.y=function(n){return arguments.length?(r.y(n),f.y(n),t):r.y},t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.margin2=function(n){return arguments.length?(y=n,t):y},t.width=function(n){return arguments.length?(g=n,t):g},t.height=function(n){return arguments.length?(w=n,t):w},t.color=function(i){return arguments.length?(p=n.utils.getColor(i),h.color(p),t):p},t.showLegend=function(n){return arguments.length?(tt=n,t):tt},t.tooltips=function(n){return arguments.length?(d=n,t):d},t.tooltipContent=function(n){return arguments.length?(it=n,t):it},t.interpolate=function(n){return arguments.length?(r.interpolate(n),f.interpolate(n),t):r.interpolate()},t.noData=function(n){return arguments.length?(rt=n,t):rt},t.xTickFormat=function(n){return arguments.length?(o.tickFormat(n),a.tickFormat(n),t):o.tickFormat()},t.yTickFormat=function(n){return arguments.length?(s.tickFormat(n),v.tickFormat(n),t):s.tickFormat()},t};n.models.multiBar=function(){function t(n){return n.each(function(n){var it=y-e.left-e.right,rt=p-e.top-e.bottom,ft=d3.select(this),tt,g,t,ht;u&&(n=d3.layout.stack().offset("zero").values(function(n){return n.values}).y(f)(n));n=n.map(function(n,t){return n.values=n.values.map(function(n){return n.series=t,n}),n});tt=k&&v?[]:n.map(function(n){return n.values.map(function(n,t){return{x:o(n,t),y:f(n,t),y0:n.y0}})});i.domain(d3.merge(tt).map(function(n){return n.x})).rangeBands([0,it],.1);r.domain(v||d3.extent(d3.merge(tt).map(function(n){return n.y+(u?n.y0:0)}).concat(w))).range([rt,0]);(i.domain()[0]===i.domain()[1]||r.domain()[0]===r.domain()[1])&&(singlePoint=!0);i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]-i.domain()[0]*.01,i.domain()[1]+i.domain()[1]*.01]):i.domain([-1,1]));r.domain()[0]===r.domain()[1]&&(r.domain()[0]?r.domain([r.domain()[0]+r.domain()[0]*.01,r.domain()[1]-r.domain()[1]*.01]):r.domain([-1,1]));d=d||i;h=h||r;var nt=ft.selectAll("g.nv-wrap.nv-multibar").data([n]),ut=nt.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),et=ut.append("defs"),ot=ut.append("g"),st=nt.select("g");ot.append("g").attr("class","nv-groups");nt.attr("transform","translate("+e.left+","+e.top+")");et.append("clipPath").attr("id","nv-edge-clip-"+c).append("rect");nt.select("#nv-edge-clip-"+c+" rect").attr("width",it).attr("height",rt);st.attr("clip-path",b?"url(#nv-edge-clip-"+c+")":"");g=nt.select(".nv-groups").selectAll(".nv-group").data(function(n){return n},function(n){return n.key});g.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);d3.transition(g.exit()).selectAll("rect.nv-bar").delay(function(t,i){return i*l/n[0].values.length}).attr("y",function(n){return u?h(n.y0):h(0)}).attr("height",0).remove();g.attr("class",function(n,t){return"nv-group nv-series-"+t}).classed("hover",function(n){return n.hover}).style("fill",function(n,t){return s(n,t)}).style("stroke",function(n,t){return s(n,t)});d3.transition(g).style("stroke-opacity",1).style("fill-opacity",.75);t=g.selectAll("rect.nv-bar").data(function(n){return n.values});t.exit().remove();ht=t.enter().append("rect").attr("class",function(n,t){return f(n,t)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,r,f){return u?0:f*i.rangeBand()/n.length}).attr("y",function(n){return h(u?n.y0:0)}).attr("height",0).attr("width",i.rangeBand()/(u?1:n.length));t.style("fill",function(n,t,i){return s(n,i,t)}).style("stroke",function(n,t,i){return s(n,i,t)}).on("mouseover",function(t,e){d3.select(this).classed("hover",!0);a.elementMouseover({value:f(t,e),point:t,series:n[t.series],pos:[i(o(t,e))+i.rangeBand()*(u?n.length/2:t.series+.5)/n.length,r(f(t,e)+(u?t.y0:0))],pointIndex:e,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,i){d3.select(this).classed("hover",!1);a.elementMouseout({value:f(t,i),point:t,series:n[t.series],pointIndex:i,seriesIndex:t.series,e:d3.event})}).on("click",function(t,e){a.elementClick({value:f(t,e),point:t,series:n[t.series],pos:[i(o(t,e))+i.rangeBand()*(u?n.length/2:t.series+.5)/n.length,r(f(t,e)+(u?t.y0:0))],pointIndex:e,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(t,e){a.elementDblClick({value:f(t,e),point:t,series:n[t.series],pos:[i(o(t,e))+i.rangeBand()*(u?n.length/2:t.series+.5)/n.length,r(f(t,e)+(u?t.y0:0))],pointIndex:e,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()});t.attr("class",function(n,t){return f(n,t)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(n,t){return"translate("+i(o(n,t))+",0)"});u?d3.transition(t).delay(function(t,i){return i*l/n[0].values.length}).attr("y",function(n,t){return r(f(n,t)+(u?n.y0:0))}).attr("height",function(n){return Math.abs(r(n.y+(u?n.y0:0))-r(u?n.y0:0))}).each("end",function(){d3.transition(d3.select(this)).attr("x",function(t){return u?0:t.series*i.rangeBand()/n.length}).attr("width",i.rangeBand()/(u?1:n.length))}):d3.transition(t).delay(function(t,i){return i*l/n[0].values.length}).attr("x",function(t){return t.series*i.rangeBand()/n.length}).attr("width",i.rangeBand()/n.length).each("end",function(){d3.transition(d3.select(this)).attr("y",function(n,t){return f(n,t)<0?r(0):r(f(n,t))}).attr("height",function(n,t){return Math.abs(r(f(n,t))-r(0))})});d=i.copy();h=r.copy()}),t}var e={top:0,right:0,bottom:0,left:0},y=960,p=500,i=d3.scale.ordinal(),r=d3.scale.linear(),c=Math.floor(Math.random()*1e4),o=function(n){return n.x},f=function(n){return n.y},w=[0],b=!0,u=!1,s=n.utils.defaultColor(),l=1200,k,v,a=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),d,h;return t.dispatch=a,t.x=function(n){return arguments.length?(o=n,t):o},t.y=function(n){return arguments.length?(f=n,t):f},t.margin=function(n){return arguments.length?(e.top=typeof n.top!="undefined"?n.top:e.top,e.right=typeof n.right!="undefined"?n.right:e.right,e.bottom=typeof n.bottom!="undefined"?n.bottom:e.bottom,e.left=typeof n.left!="undefined"?n.left:e.left,t):e},t.width=function(n){return arguments.length?(y=n,t):y},t.height=function(n){return arguments.length?(p=n,t):p},t.xScale=function(n){return arguments.length?(i=n,t):i},t.yScale=function(n){return arguments.length?(r=n,t):r},t.xDomain=function(n){return arguments.length?(k=n,t):k},t.yDomain=function(n){return arguments.length?(v=n,t):v},t.forceY=function(n){return arguments.length?(w=n,t):w},t.stacked=function(n){return arguments.length?(u=n,t):u},t.clipEdge=function(n){return arguments.length?(b=n,t):b},t.color=function(i){return arguments.length?(s=n.utils.getColor(i),t):s},t.id=function(n){return arguments.length?(c=n,t):c},t.delay=function(n){return arguments.length?(l=n,t):l},t};n.models.multiBarChart=function(){function t(n){return n.each(function(s){var rt=d3.select(this),lt=this,it=(y||parseInt(rt.style("width"))||960)-i.left-i.right,ut=(c||parseInt(rt.style("height"))||400)-i.top-i.bottom,ht,ot,ct,st;if(t.update=function(){n.transition().call(t)},t.container=this,s&&s.length&&s.filter(function(n){return n.values.length}).length)rt.selectAll(".nv-noData").remove();else return ht=rt.selectAll(".nv-noData").data([d]),ht.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),ht.attr("x",i.left+it/2).attr("y",i.top+ut/2).text(function(n){return n}),t;g=r.xScale();k=r.yScale();var et=rt.selectAll("g.nv-wrap.nv-multiBarWithLegend").data([s]),ft=et.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarWithLegend").append("g"),tt=et.select("g");ft.append("g").attr("class","nv-x nv-axis");ft.append("g").attr("class","nv-y nv-axis");ft.append("g").attr("class","nv-barsWrap");ft.append("g").attr("class","nv-legendWrap");ft.append("g").attr("class","nv-controlsWrap");w&&(u.width(it/2),tt.select(".nv-legendWrap").datum(s).call(u),i.top!=u.height()&&(i.top=u.height(),ut=(c||parseInt(rt.style("height"))||400)-i.top-i.bottom),tt.select(".nv-legendWrap").attr("transform","translate("+it/2+","+-i.top+")"));p&&(ot=[{key:"Grouped",disabled:r.stacked()},{key:"Stacked",disabled:!r.stacked()}],v.width(180).color(["#444","#444","#444"]),tt.select(".nv-controlsWrap").datum(ot).attr("transform","translate(0,"+-i.top+")").call(v));et.attr("transform","translate("+i.left+","+i.top+")");r.width(it).height(ut).color(s.map(function(n,t){return n.color||l(n,t)}).filter(function(n,t){return!s[t].disabled}));ct=tt.select(".nv-barsWrap").datum(s.filter(function(n){return!n.disabled}));d3.transition(ct).call(r);f.scale(g).ticks(it/100).tickSize(-ut,0);tt.select(".nv-x.nv-axis").attr("transform","translate(0,"+k.range()[0]+")");d3.transition(tt.select(".nv-x.nv-axis")).call(f);st=tt.select(".nv-x.nv-axis > g").selectAll("g");st.selectAll("line, text").style("opacity",1);b&&st.filter(function(n,t){return t%Math.ceil(s[0].values.length/(it/100))!=0}).selectAll("text, line").style("opacity",0);o&&st.selectAll("text").attr("transform",function(){return"rotate("+o+" 0,0)"}).attr("text-transform",o>0?"start":"end");e.scale(k).ticks(ut/36).tickSize(-it,0);d3.transition(tt.select(".nv-y.nv-axis")).call(e);u.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;s.filter(function(n){return!n.disabled}).length||s.map(function(n){return n.disabled=!1,et.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});v.dispatch.on("legendClick",function(i){if(i.disabled){ot=ot.map(function(n){return n.disabled=!0,n});i.disabled=!1;switch(i.key){case"Grouped":r.stacked(!1);break;case"Stacked":r.stacked(!0)}n.transition().call(t)}});h.on("tooltipShow",function(n){a&&nt(n,lt.parentNode)})}),t}var r=n.models.multiBar(),f=n.models.axis(),e=n.models.axis(),u=n.models.legend(),v=n.models.legend(),i={top:30,right:20,bottom:30,left:60},y=null,c=null,l=n.utils.defaultColor(),p=!0,w=!0,b=!0,o=0,a=!0,s=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" on "+t+"<\/p>"},g,k,d="No Data Available.",h=d3.dispatch("tooltipShow","tooltipHide"),nt;r.stacked(!1);f.orient("bottom").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(n){return n});e.orient("left").tickFormat(d3.format(",.1f"));nt=function(i,u){var o=i.pos[0]+(u.offsetLeft||0),h=i.pos[1]+(u.offsetTop||0),c=f.tickFormat()(r.x()(i.point,i.pointIndex)),l=e.tickFormat()(r.y()(i.point,i.pointIndex)),a=s(i.series.key,c,l,i,t);n.tooltip.show([o,h],a,i.value<0?"n":"s",null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];h.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){h.tooltipHide(n)});h.on("tooltipHide",function(){a&&n.tooltip.cleanup()});return t.dispatch=h,t.multibar=r,t.legend=u,t.xAxis=f,t.yAxis=e,d3.rebind(t,r,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","stacked","delay"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(y=n,t):y},t.height=function(n){return arguments.length?(c=n,t):c},t.color=function(i){return arguments.length?(l=n.utils.getColor(i),u.color(l),t):l},t.showControls=function(n){return arguments.length?(p=n,t):p},t.showLegend=function(n){return arguments.length?(w=n,t):w},t.reduceXTicks=function(n){return arguments.length?(b=n,t):b},t.rotateLabels=function(n){return arguments.length?(o=n,t):o},t.tooltip=function(n){return arguments.length?(s=n,t):s},t.tooltips=function(n){return arguments.length?(a=n,t):a},t.tooltipContent=function(n){return arguments.length?(s=n,t):s},t.noData=function(n){return arguments.length?(d=n,t):d},t};n.models.multiBarHorizontal=function(){function t(n){return n.each(function(n){var rt=p-e.left-e.right,ft=w-e.top-e.bottom,ot=d3.select(this),tt,g,t,it;f&&(n=d3.layout.stack().offset("zero").values(function(n){return n.values}).y(u)(n));n=n.map(function(n,t){return n.values=n.values.map(function(n){return n.series=t,n}),n});tt=a&&v?[]:n.map(function(n){return n.values.map(function(n,t){return{x:o(n,t),y:u(n,t),y0:n.y0}})});r.domain(a||d3.merge(tt).map(function(n){return n.x})).rangeBands([0,ft],.1);i.domain(v||d3.extent(d3.merge(tt).map(function(n){return n.y+(f?n.y0:0)}).concat(b)));c&&!f?i.range([i.domain()[0]<0?l:0,rt-(i.domain()[1]>0?l:0)]):i.range([0,rt]);d=d||r;y=y||d3.scale.linear().domain(i.domain()).range([i(0),i(0)]);var nt=d3.select(this).selectAll("g.nv-wrap.nv-multibarHorizontal").data([n]),ut=nt.enter().append("g").attr("class","nvd3 nv-wrap nv-multibarHorizontal"),st=ut.append("defs"),et=ut.append("g"),ht=nt.select("g");et.append("g").attr("class","nv-groups");nt.attr("transform","translate("+e.left+","+e.top+")");g=nt.select(".nv-groups").selectAll(".nv-group").data(function(n){return n},function(n){return n.key});g.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);d3.transition(g.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove();g.attr("class",function(n,t){return"nv-group nv-series-"+t}).classed("hover",function(n){return n.hover}).style("fill",function(n,t){return h(n,t)}).style("stroke",function(n,t){return h(n,t)});d3.transition(g).style("stroke-opacity",1).style("fill-opacity",.75);t=g.selectAll("g.nv-bar").data(function(n){return n.values});t.exit().remove();it=t.enter().append("g").attr("transform",function(t,i,u){return"translate("+y(f?t.y0:0)+","+(f?0:u*r.rangeBand()/n.length+r(o(t,i)))+")"});it.append("rect").attr("width",0).attr("height",r.rangeBand()/(f?1:n.length));t.on("mouseover",function(t,e){d3.select(this).classed("hover",!0);s.elementMouseover({value:u(t,e),point:t,series:n[t.series],pos:[i(u(t,e)+(f?t.y0:0)),r(o(t,e))+r.rangeBand()*(f?n.length/2:t.series+.5)/n.length],pointIndex:e,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,i){d3.select(this).classed("hover",!1);s.elementMouseout({value:u(t,i),point:t,series:n[t.series],pointIndex:i,seriesIndex:t.series,e:d3.event})}).on("click",function(t,e){s.elementClick({value:u(t,e),point:t,series:n[t.series],pos:[r(o(t,e))+r.rangeBand()*(f?n.length/2:t.series+.5)/n.length,i(u(t,e)+(f?t.y0:0))],pointIndex:e,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()}).on("dblclick",function(t,e){s.elementDblClick({value:u(t,e),point:t,series:n[t.series],pos:[r(o(t,e))+r.rangeBand()*(f?n.length/2:t.series+.5)/n.length,i(u(t,e)+(f?t.y0:0))],pointIndex:e,seriesIndex:t.series,e:d3.event});d3.event.stopPropagation()});c&&!f?(it.append("text").attr("text-anchor",function(n,t){return u(n,t)<0?"end":"start"}),t.select("text").attr("y",r.rangeBand()/2).attr("dy","-.32em").text(function(n,t){return k(u(n,t))}),d3.transition(t).select("text").attr("x",function(n,t){return u(n,t)<0?-4:i(u(n,t))-i(0)+4})):t.selectAll("text").remove();t.attr("class",function(n,t){return u(n,t)<0?"nv-bar negative":"nv-bar positive"});f?d3.transition(t).attr("transform",function(n,t){return"translate("+i(n.y0)+","+r(o(n,t))+")"}).select("rect").attr("width",function(n,t){return Math.abs(i(u(n,t)+n.y0)-i(n.y0))}).attr("height",r.rangeBand()):d3.transition(t).attr("transform",function(t,f){return"translate("+(u(t,f)<0?i(u(t,f)):i(0))+","+(t.series*r.rangeBand()/n.length+r(o(t,f)))+")"}).select("rect").attr("height",r.rangeBand()/n.length).attr("width",function(n,t){return Math.abs(i(u(n,t))-i(0))});d=r.copy();y=i.copy()}),t}var e={top:0,right:0,bottom:0,left:0},p=960,w=500,g=Math.floor(Math.random()*1e4),r=d3.scale.ordinal(),i=d3.scale.linear(),o=function(n){return n.x},u=function(n){return n.y},b=[0],h=n.utils.defaultColor(),f=!1,c=!1,l=60,k=d3.format(",.2f"),nt=1200,a,v,s=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout"),d,y;return t.dispatch=s,t.x=function(n){return arguments.length?(o=n,t):o},t.y=function(n){return arguments.length?(u=n,t):u},t.margin=function(n){return arguments.length?(e.top=typeof n.top!="undefined"?n.top:e.top,e.right=typeof n.right!="undefined"?n.right:e.right,e.bottom=typeof n.bottom!="undefined"?n.bottom:e.bottom,e.left=typeof n.left!="undefined"?n.left:e.left,t):e},t.width=function(n){return arguments.length?(p=n,t):p},t.height=function(n){return arguments.length?(w=n,t):w},t.xScale=function(n){return arguments.length?(r=n,t):r},t.yScale=function(n){return arguments.length?(i=n,t):i},t.xDomain=function(n){return arguments.length?(a=n,t):a},t.yDomain=function(n){return arguments.length?(v=n,t):v},t.forceY=function(n){return arguments.length?(b=n,t):b},t.stacked=function(n){return arguments.length?(f=n,t):f},t.color=function(i){return arguments.length?(h=n.utils.getColor(i),t):h},t.id=function(n){return arguments.length?(g=n,t):g},t.delay=function(n){return arguments.length?(nt=n,t):nt},t.showValues=function(n){return arguments.length?(c=n,t):c},t.valueFormat=function(n){return arguments.length?(k=n,t):k},t.valuePadding=function(n){return arguments.length?(l=n,t):l},t};n.models.multiBarHorizontalChart=function(){function t(n){return n.each(function(o){var nt=d3.select(this),ht=this,tt=(v||parseInt(nt.style("width"))||960)-i.left-i.right,it=(h||parseInt(nt.style("height"))||400)-i.top-i.bottom,et,ft,ot,st;if(t.update=function(){n.transition().call(t)},t.container=this,o&&o.length&&o.filter(function(n){return n.values.length}).length)nt.selectAll(".nv-noData").remove();else return et=nt.selectAll(".nv-noData").data([w]),et.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),et.attr("x",i.left+tt/2).attr("y",i.top+it/2).text(function(n){return n}),t;b=r.xScale();k=r.yScale();var ut=nt.selectAll("g.nv-wrap.nv-multiBarHorizontalChart").data([o]),rt=ut.enter().append("g").attr("class","nvd3 nv-wrap nv-multiBarHorizontalChart").append("g"),g=ut.select("g");rt.append("g").attr("class","nv-x nv-axis");rt.append("g").attr("class","nv-y nv-axis");rt.append("g").attr("class","nv-barsWrap");rt.append("g").attr("class","nv-legendWrap");rt.append("g").attr("class","nv-controlsWrap");p&&(u.width(tt/2),g.select(".nv-legendWrap").datum(o).call(u),i.top!=u.height()&&(i.top=u.height(),it=(h||parseInt(nt.style("height"))||400)-i.top-i.bottom),g.select(".nv-legendWrap").attr("transform","translate("+tt/2+","+-i.top+")"));y&&(ft=[{key:"Grouped",disabled:r.stacked()},{key:"Stacked",disabled:!r.stacked()}],a.width(180).color(["#444","#444","#444"]),g.select(".nv-controlsWrap").datum(ft).attr("transform","translate(0,"+-i.top+")").call(a));ut.attr("transform","translate("+i.left+","+i.top+")");r.width(tt).height(it).color(o.map(function(n,t){return n.color||c(n,t)}).filter(function(n,t){return!o[t].disabled}));ot=g.select(".nv-barsWrap").datum(o.filter(function(n){return!n.disabled}));d3.transition(ot).call(r);f.scale(b).ticks(it/24).tickSize(-tt,0);d3.transition(g.select(".nv-x.nv-axis")).call(f);st=g.select(".nv-x.nv-axis").selectAll("g");st.selectAll("line, text").style("opacity",1);e.scale(k).ticks(tt/100).tickSize(-it,0);g.select(".nv-y.nv-axis").attr("transform","translate(0,"+it+")");d3.transition(g.select(".nv-y.nv-axis")).call(e);u.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;o.filter(function(n){return!n.disabled}).length||o.map(function(n){return n.disabled=!1,ut.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});a.dispatch.on("legendClick",function(i){if(i.disabled){ft=ft.map(function(n){return n.disabled=!0,n});i.disabled=!1;switch(i.key){case"Grouped":r.stacked(!1);break;case"Stacked":r.stacked(!0)}n.transition().call(t)}});s.on("tooltipShow",function(n){l&&d(n,ht.parentNode)})}),t}var r=n.models.multiBarHorizontal(),f=n.models.axis(),e=n.models.axis(),u=n.models.legend().height(30),a=n.models.legend().height(30),i={top:30,right:20,bottom:50,left:60},v=null,h=null,c=n.utils.defaultColor(),y=!0,p=!0,l=!0,o=function(n,t,i){return"<h3>"+n+" - "+t+"<\/h3><p>"+i+"<\/p>"},b,k,w="No Data Available.",s=d3.dispatch("tooltipShow","tooltipHide"),d;r.stacked(!1);f.orient("left").tickPadding(5).highlightZero(!1).showMaxMin(!1).tickFormat(function(n){return n});e.orient("bottom").tickFormat(d3.format(",.1f"));d=function(i,u){var s=i.pos[0]+(u.offsetLeft||0),h=i.pos[1]+(u.offsetTop||0),c=f.tickFormat()(r.x()(i.point,i.pointIndex)),l=e.tickFormat()(r.y()(i.point,i.pointIndex)),a=o(i.series.key,c,l,i,t);n.tooltip.show([s,h],a,i.value<0?"e":"w",null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];s.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){s.tooltipHide(n)});s.on("tooltipHide",function(){l&&n.tooltip.cleanup()});return t.dispatch=s,t.multibar=r,t.legend=u,t.xAxis=f,t.yAxis=e,d3.rebind(t,r,"x","y","xDomain","yDomain","forceX","forceY","clipEdge","id","delay","showValues","valueFormat","stacked"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(v=n,t):v},t.height=function(n){return arguments.length?(h=n,t):h},t.color=function(i){return arguments.length?(c=n.utils.getColor(i),u.color(c),t):c},t.showControls=function(n){return arguments.length?(y=n,t):y},t.showLegend=function(n){return arguments.length?(p=n,t):p},t.tooltip=function(n){return arguments.length?(o=n,t):o},t.tooltips=function(n){return arguments.length?(l=n,t):l},t.tooltipContent=function(n){return arguments.length?(o=n,t):o},t.noData=function(n){return arguments.length?(w=n,t):w},t};n.models.multiChart=function(){function t(n){return n.each(function(nt){var ot=d3.select(this),bt=this,ft=(d||parseInt(ot.style("width"))||960)-i.left-i.right,ut=(y||parseInt(ot.style("height"))||400)-i.top-i.bottom,at=nt.filter(function(n){return!n.disabled&&n.type=="line"&&n.yAxis==1}),vt=nt.filter(function(n){return!n.disabled&&n.type=="line"&&n.yAxis==2}),yt=nt.filter(function(n){return!n.disabled&&n.type=="bar"&&n.yAxis==1}),pt=nt.filter(function(n){return!n.disabled&&n.type=="bar"&&n.yAxis==2}),st=nt.filter(function(n){return!n.disabled&&n.type=="area"&&n.yAxis==1}),ht=nt.filter(function(n){return!n.disabled&&n.type=="area"&&n.yAxis==2}),wt=nt.filter(function(n){return!n.disabled&&n.yAxis==1}).map(function(n){return n.values.map(function(n){return{x:n.x,y:n.y}})}),lt=nt.filter(function(n){return!n.disabled&&n.yAxis==2}).map(function(n){return n.values.map(function(n){return{x:n.x,y:n.y}})}),ct,et,rt;tt.domain(d3.extent(d3.merge(wt.concat(lt)),function(n){return n.x})).range([0,ft]);ct=ot.selectAll("g.wrap.multiChart").data([nt]);et=ct.enter().append("g").attr("class","wrap nvd3 multiChart").append("g");et.append("g").attr("class","x axis");et.append("g").attr("class","y1 axis");et.append("g").attr("class","y2 axis");et.append("g").attr("class","lines1Wrap");et.append("g").attr("class","lines2Wrap");et.append("g").attr("class","bars1Wrap");et.append("g").attr("class","bars2Wrap");et.append("g").attr("class","stack1Wrap");et.append("g").attr("class","stack2Wrap");et.append("g").attr("class","legendWrap");rt=ct.select("g");g&&(v.width(ft/2),rt.select(".legendWrap").datum(nt.map(function(n){return n.originalKey=n.originalKey===undefined?n.key:n.originalKey,n.key=n.originalKey+(n.yAxis==1?"":" (right axis)"),n})).call(v),i.top!=v.height()&&(i.top=v.height(),ut=(y||parseInt(ot.style("height"))||400)-i.top-i.bottom),rt.select(".legendWrap").attr("transform","translate("+ft/2+","+-i.top+")"));f.width(ft).height(ut).interpolate("monotone").color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==1&&nt[t].type=="line"}));s.width(ft).height(ut).interpolate("monotone").color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==2&&nt[t].type=="line"}));h.width(ft).height(ut).color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==1&&nt[t].type=="bar"}));a.width(ft).height(ut).color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==2&&nt[t].type=="bar"}));c.width(ft).height(ut).color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==1&&nt[t].type=="area"}));l.width(ft).height(ut).color(nt.map(function(n,t){return n.color||u[t%u.length]}).filter(function(n,t){return!nt[t].disabled&&nt[t].yAxis==2&&nt[t].type=="area"}));rt.attr("transform","translate("+i.left+","+i.top+")");var kt=rt.select(".lines1Wrap").datum(at),dt=rt.select(".bars1Wrap").datum(yt),gt=rt.select(".stack1Wrap").datum(st),ni=rt.select(".lines2Wrap").datum(vt),ti=rt.select(".bars2Wrap").datum(pt),ii=rt.select(".stack2Wrap").datum(ht),ri=st.length?st.map(function(n){return n.values}).reduce(function(n,t){return n.map(function(n,i){return{x:n.x,y:n.y+t[i].y}})}).concat([{x:0,y:0}]):[],ui=ht.length?ht.map(function(n){return n.values}).reduce(function(n,t){return n.map(function(n,i){return{x:n.x,y:n.y+t[i].y}})}).concat([{x:0,y:0}]):[];e.domain(d3.extent(d3.merge(wt).concat(ri),function(n){return n.y})).range([0,ut]);o.domain(d3.extent(d3.merge(lt).concat(ui),function(n){return n.y})).range([0,ut]);f.yDomain(e.domain());h.yDomain(e.domain());c.yDomain(e.domain());s.yDomain(o.domain());a.yDomain(o.domain());l.yDomain(o.domain());st.length&&d3.transition(gt).call(c);ht.length&&d3.transition(ii).call(l);yt.length&&d3.transition(dt).call(h);pt.length&&d3.transition(ti).call(a);at.length&&d3.transition(kt).call(f);vt.length&&d3.transition(ni).call(s);w.ticks(ft/100).tickSize(-ut,0);rt.select(".x.axis").attr("transform","translate(0,"+ut+")");d3.transition(rt.select(".x.axis")).call(w);b.ticks(ut/36).tickSize(-ft,0);d3.transition(rt.select(".y1.axis")).call(b);k.ticks(ut/36).tickSize(-ft,0);d3.transition(rt.select(".y2.axis")).call(k);rt.select(".y2.axis").style("opacity",lt.length?1:0).attr("transform","translate("+tt.range()[1]+",0)");v.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;nt.filter(function(n){return!n.disabled}).length||nt.map(function(n){return n.disabled=!1,ct.selectAll(".series").classed("disabled",!1),n});n.transition().call(t)});r.on("tooltipShow",function(n){p&&it(n,bt.parentNode)})}),t.update=function(){t(n)},t.container=this,t}var i={top:30,right:20,bottom:50,left:60},u=d3.scale.category20().range(),d=null,y=null,g=!0,p=!0,nt=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" at "+t+"<\/p>"},tt=d3.scale.linear(),e=d3.scale.linear(),o=d3.scale.linear(),f=n.models.line().yScale(e),s=n.models.line().yScale(o),h=n.models.multiBar().stacked(!1).yScale(e),a=n.models.multiBar().stacked(!1).yScale(o),c=n.models.stackedArea().yScale(e),l=n.models.stackedArea().yScale(o),w=n.models.axis().scale(tt).orient("bottom").tickPadding(5),b=n.models.axis().scale(e).orient("left"),k=n.models.axis().scale(o).orient("right"),v=n.models.legend().height(30),r=d3.dispatch("tooltipShow","tooltipHide"),it=function(i,r){var u=i.pos[0]+(r.offsetLeft||0),e=i.pos[1]+(r.offsetTop||0),o=w.tickFormat()(f.x()(i.point,i.pointIndex)),s=(i.series.bar?b:k).tickFormat()(f.y()(i.point,i.pointIndex)),h=nt(i.series.key,o,s,i,t);n.tooltip.show([u,e],h,undefined,undefined,r.offsetParent)};f.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});f.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});s.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});s.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});h.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});h.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});a.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});a.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});c.dispatch.on("tooltipShow",function(n){if(!Math.round(c.y()(n.point)*100))return setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1;n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});c.dispatch.on("tooltipHide",function(n){r.tooltipHide(n)});l.dispatch.on("tooltipShow",function(n){if(!Math.round(l.y()(n.point)*100))return setTimeout(function(){d3.selectAll(".point.hover").classed("hover",!1)},0),!1;n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});l.dispatch.on("tooltipHide",function(n){r.tooltipHide(n)});f.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});f.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});s.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];r.tooltipShow(n)});s.dispatch.on("elementMouseout.tooltip",function(n){r.tooltipHide(n)});r.on("tooltipHide",function(){p&&n.tooltip.cleanup()});return t.dispatch=r,t.lines1=f,t.lines2=s,t.bars1=h,t.bars2=a,t.stack1=c,t.stack2=l,t.xAxis=w,t.yAxis1=b,t.yAxis2=k,t.x=function(n){return arguments.length?(getX=n,f.x(n),h.x(n),t):getX},t.y=function(n){return arguments.length?(getY=n,f.y(n),h.y(n),t):getY},t.margin=function(n){return arguments.length?(i=n,t):i},t.width=function(n){return arguments.length?(d=n,t):d},t.height=function(n){return arguments.length?(y=n,t):y},t.color=function(n){return arguments.length?(u=n,v.color(n),t):u},t.showLegend=function(n){return arguments.length?(g=n,t):g},t.tooltips=function(n){return arguments.length?(p=n,t):p},t.tooltipContent=function(n){return arguments.length?(nt=n,t):nt},t};n.models.ohlcBar=function(){function t(n){return n.each(function(n){var nt=y-u.left-u.right,tt=p-u.top-u.bottom,rt=d3.select(this),g,ot;r.domain(k||d3.extent(n[0].values.map(e).concat(w))).range([0,nt]);i.domain(d||[d3.min(n[0].values.map(c).concat(v)),d3.max(n[0].values.map(h).concat(v))]).range([tt,0]);(r.domain()[0]===r.domain()[1]||i.domain()[0]===i.domain()[1])&&(singlePoint=!0);r.domain()[0]===r.domain()[1]&&(r.domain()[0]?r.domain([r.domain()[0]-r.domain()[0]*.01,r.domain()[1]+r.domain()[1]*.01]):r.domain([-1,1]));i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]+i.domain()[0]*.01,i.domain()[1]-i.domain()[1]*.01]):i.domain([-1,1]));var t=d3.select(this).selectAll("g.nv-wrap.nv-ohlcBar").data([n[0].values]),it=t.enter().append("g").attr("class","nvd3 nv-wrap nv-ohlcBar"),ut=it.append("defs"),ft=it.append("g"),et=t.select("g");ft.append("g").attr("class","nv-ticks");t.attr("transform","translate("+u.left+","+u.top+")");rt.on("click",function(n,t){a.chartClick({data:n,index:t,pos:d3.event,id:f})});ut.append("clipPath").attr("id","nv-chart-clip-path-"+f).append("rect");t.select("#nv-chart-clip-path-"+f+" rect").attr("width",nt).attr("height",tt);et.attr("clip-path",b?"url(#nv-chart-clip-path-"+f+")":"");g=t.select(".nv-ticks").selectAll(".nv-tick").data(function(n){return n});g.exit().remove();ot=g.enter().append("path").attr("class",function(n,t,i){return(o(n,t)>l(n,t)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+i+"-"+t}).attr("d",function(t,r){var u=nt/n[0].values.length*.9;return"m0,0l0,"+(i(o(t,r))-i(h(t,r)))+"l"+-u/2+",0l"+u/2+",0l0,"+(i(c(t,r))-i(o(t,r)))+"l0,"+(i(l(t,r))-i(c(t,r)))+"l"+u/2+",0l"+-u/2+",0z"}).attr("transform",function(n,t){return"translate("+r(e(n,t))+","+i(h(n,t))+")"}).on("mouseover",function(t,u){d3.select(this).classed("hover",!0);a.elementMouseover({point:t,series:n[0],pos:[r(e(t,u)),i(s(t,u))],pointIndex:u,seriesIndex:0,e:d3.event})}).on("mouseout",function(t,i){d3.select(this).classed("hover",!1);a.elementMouseout({point:t,series:n[0],pointIndex:i,seriesIndex:0,e:d3.event})}).on("click",function(n,t){a.elementClick({value:s(n,t),data:n,index:t,pos:[r(e(n,t)),i(s(n,t))],e:d3.event,id:f});d3.event.stopPropagation()}).on("dblclick",function(n,t){a.elementDblClick({value:s(n,t),data:n,index:t,pos:[r(e(n,t)),i(s(n,t))],e:d3.event,id:f});d3.event.stopPropagation()});g.attr("class",function(n,t,i){return(o(n,t)>l(n,t)?"nv-tick negative":"nv-tick positive")+" nv-tick-"+i+"-"+t});d3.transition(g).attr("transform",function(n,t){return"translate("+r(e(n,t))+","+i(h(n,t))+")"}).attr("d",function(t,r){var u=nt/n[0].values.length*.9;return"m0,0l0,"+(i(o(t,r))-i(h(t,r)))+"l"+-u/2+",0l"+u/2+",0l0,"+(i(c(t,r))-i(o(t,r)))+"l0,"+(i(l(t,r))-i(c(t,r)))+"l"+u/2+",0l"+-u/2+",0z"})}),t}var u={top:0,right:0,bottom:0,left:0},y=960,p=500,f=Math.floor(Math.random()*1e4),r=d3.scale.linear(),i=d3.scale.linear(),e=function(n){return n.x},s=function(n){return n.y},o=function(n){return n.open},l=function(n){return n.close},h=function(n){return n.high},c=function(n){return n.low},w=[],v=[],b=!0,g=n.utils.defaultColor(),k,d,a=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return t.dispatch=a,t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(s=n,t):s},t.open=function(n){return arguments.length?(o=n,t):o},t.close=function(n){return arguments.length?(l=n,t):l},t.high=function(n){return arguments.length?(h=n,t):h},t.low=function(n){return arguments.length?(c=n,t):c},t.margin=function(n){return arguments.length?(u.top=typeof n.top!="undefined"?n.top:u.top,u.right=typeof n.right!="undefined"?n.right:u.right,u.bottom=typeof n.bottom!="undefined"?n.bottom:u.bottom,u.left=typeof n.left!="undefined"?n.left:u.left,t):u},t.width=function(n){return arguments.length?(y=n,t):y},t.height=function(n){return arguments.length?(p=n,t):p},t.xScale=function(n){return arguments.length?(r=n,t):r},t.yScale=function(n){return arguments.length?(i=n,t):i},t.xDomain=function(n){return arguments.length?(k=n,t):k},t.yDomain=function(n){return arguments.length?(d=n,t):d},t.forceX=function(n){return arguments.length?(w=n,t):w},t.forceY=function(n){return arguments.length?(v=n,t):v},t.clipEdge=function(n){return arguments.length?(b=n,t):b},t.color=function(i){return arguments.length?(g=n.utils.getColor(i),t):g},t.id=function(n){return arguments.length?(f=n,t):f},t};n.models.pie=function(){function t(n){return n.each(function(n){function ot(n){s||(n.innerRadius=0);var t=d3.interpolate(this._current,n);return this._current=t(0),function(n){return p(t(n))}}var g=h-i.left-i.right,nt=c-i.top-i.bottom,t=Math.min(g,nt)/2,tt=d3.select(this),b=tt.selectAll(".nv-wrap.nv-pie").data([l(n[0])]),rt=b.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+r),ut=rt.append("g"),ft=b.select("g"),p,it,w,d,et,k;ut.append("g").attr("class","nv-pie");b.attr("transform","translate("+i.left+","+i.top+")");ft.select(".nv-pie").attr("transform","translate("+g/2+","+nt/2+")");tt.on("click",function(n,t){e.chartClick({data:n,index:t,pos:d3.event,id:r})});p=d3.svg.arc().outerRadius(t-t/5);s&&p.innerRadius(t/2);it=d3.layout.pie().sort(null).value(function(n){return n.disabled?0:f(n)});w=b.select(".nv-pie").selectAll(".nv-slice").data(it);w.exit().remove();d=w.enter().append("g").attr("class","nv-slice").on("mouseover",function(n,t){d3.select(this).classed("hover",!0);e.elementMouseover({label:u(n.data),value:f(n.data),point:n.data,pointIndex:t,pos:[d3.event.pageX,d3.event.pageY],id:r})}).on("mouseout",function(n,t){d3.select(this).classed("hover",!1);e.elementMouseout({label:u(n.data),value:f(n.data),point:n.data,index:t,id:r})}).on("click",function(n,t){e.elementClick({label:u(n.data),value:f(n.data),point:n.data,index:t,pos:d3.event,id:r});d3.event.stopPropagation()}).on("dblclick",function(n,t){e.elementDblClick({label:u(n.data),value:f(n.data),point:n.data,index:t,pos:d3.event,id:r});d3.event.stopPropagation()});w.attr("fill",function(n,t){return o(n,t)}).attr("stroke",function(n,t){return o(n,t)});et=d.append("path").each(function(n){this._current=n});d3.transition(w.select("path")).attr("d",p).attrTween("d",ot);a&&(k=p,v&&(k=d3.svg.arc().outerRadius(p.outerRadius())),d.append("g").classed("nv-label",!0).each(function(){var n=d3.select(this);n.attr("transform",function(n){return n.outerRadius=t+10,n.innerRadius=t+15,"translate("+k.centroid(n)+")"});n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3);n.append("text").style("text-anchor","middle").style("fill","#000")}),w.select(".nv-label").transition().attr("transform",function(n){return n.outerRadius=t+10,n.innerRadius=t+15,"translate("+k.centroid(n)+")"}),w.each(function(){var t=d3.select(this),n;t.select(".nv-label text").text(function(n){var t=(n.endAngle-n.startAngle)/(2*Math.PI);return n.value&&t>y?u(n.data):""});n=t.select("text").node().getBBox();t.select(".nv-label rect").attr("width",n.width+10).attr("height",n.height+10).attr("transform",function(){return"translate("+[n.x-5,n.y-5]+")"})}))}),t}var i={top:0,right:0,bottom:0,left:0},h=500,c=500,l=function(n){return n.values},u=function(n){return n.x},f=function(n){return n.y},r=Math.floor(Math.random()*1e4),o=n.utils.defaultColor(),p=d3.format(",.2f"),a=!0,v=!1,y=.02,s=!1,e=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return t.dispatch=e,t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(h=n,t):h},t.height=function(n){return arguments.length?(c=n,t):c},t.values=function(n){return arguments.length?(l=n,t):l},t.x=function(n){return arguments.length?(u=n,t):u},t.y=function(n){return arguments.length?(f=d3.functor(n),t):f},t.showLabels=function(n){return arguments.length?(a=n,t):a},t.donutLabelsOutside=function(n){return arguments.length?(v=n,t):v},t.donut=function(n){return arguments.length?(s=n,t):s},t.id=function(n){return arguments.length?(r=n,t):r},t.color=function(i){return arguments.length?(o=n.utils.getColor(i),t):o},t.valueFormat=function(n){return arguments.length?(p=n,t):p},t.labelThreshold=function(n){return arguments.length?(y=n,t):y},t};n.models.pieChart=function(){function t(n){return n.each(function(o){var s=d3.select(this),d=this,v=(h||parseInt(s.style("width"))||960)-i.left-i.right,y=(e||parseInt(s.style("height"))||400)-i.top-i.bottom,p,b;if(t.update=function(){t(n)},t.container=this,o&&o.length)s.selectAll(".nv-noData").remove();else return p=s.selectAll(".nv-noData").data([a]),p.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),p.attr("x",i.left+v/2).attr("y",i.top+y/2).text(function(n){return n}),t;var l=s.selectAll("g.nv-wrap.nv-pieChart").data([o]),w=l.enter().append("g").attr("class","nvd3 nv-wrap nv-pieChart").append("g"),k=l.select("g");w.append("g").attr("class","nv-pieWrap");w.append("g").attr("class","nv-legendWrap");c&&(u.width(v).key(r.x()),l.select(".nv-legendWrap").datum(r.values()(o[0])).call(u),i.top!=u.height()&&(i.top=u.height(),y=(e||parseInt(s.style("height"))||400)-i.top-i.bottom),l.select(".nv-legendWrap").attr("transform","translate(0,"+-i.top+")"));l.attr("transform","translate("+i.left+","+i.top+")");r.width(v).height(y);b=k.select(".nv-pieWrap").datum(o);d3.transition(b).call(r);u.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;r.values()(o[0]).filter(function(n){return!n.disabled}).length||r.values()(o[0]).map(function(n){return n.disabled=!1,l.selectAll(".nv-series").classed("disabled",!1),n});n.transition().call(t)});r.dispatch.on("elementMouseout.tooltip",function(n){f.tooltipHide(n)})}),t}var r=n.models.pie(),u=n.models.legend(),i={top:30,right:20,bottom:20,left:20},h=null,e=null,c=!0,o=n.utils.defaultColor(),s=!0,l=function(n,t){return"<h3>"+n+"<\/h3><p>"+t+"<\/p>"},a="No Data Available.",f=d3.dispatch("tooltipShow","tooltipHide"),v=function(i,u){var f=i.pos[0]+(u&&u.offsetLeft||0),e=i.pos[1]+(u&&u.offsetTop||0),o=r.valueFormat()(r.y()(i.point)),s=l(r.x()(i.point),o,i,t);n.tooltip.show([f,e],s,i.value<0?"n":"s",null,u)};r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];f.tooltipShow(n)});f.on("tooltipShow",function(n){s&&v(n)});f.on("tooltipHide",function(){s&&n.tooltip.cleanup()});return t.dispatch=f,t.pie=r,d3.rebind(t,r,"valueFormat","values","x","y","id","showLabels","donutLabelsOutside","donut","labelThreshold"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(h=n,t):h},t.height=function(n){return arguments.length?(e=n,t):e},t.color=function(i){return arguments.length?(o=n.utils.getColor(i),u.color(o),r.color(o),t):o},t.showLegend=function(n){return arguments.length?(c=n,t):c},t.tooltips=function(n){return arguments.length?(s=n,t):s},t.tooltipContent=function(n){return arguments.length?(l=n,t):l},t.noData=function(n){return arguments.length?(a=n,t):a},t};n.models.scatter=function(){function t(n){return n.each(function(n){function ti(){var v,s,a,p,c,w;if(!l)return!1;s=d3.merge(n.map(function(n,t){return n.values.map(function(n,u){return[i(e(n,u))*(Math.random()/1e12+1),r(o(n,u))*(Math.random()/1e12+1),t,u,n]}).filter(function(n,t){return et(n[4],t)})}));y&&(kt.append("clipPath").attr("id","nv-points-clip-"+f),a=t.select("#nv-points-clip-"+f).selectAll("circle").data(s),a.enter().append("circle").attr("r",st),a.exit().remove(),a.attr("cx",function(n){return n[0]}).attr("cy",function(n){return n[1]}),t.select(".nv-point-paths").attr("clip-path","url(#nv-points-clip-"+f+")"));d===!0?(p=d3.geom.voronoi(s).map(function(n,t){return{data:n,series:s[t][2],point:s[t][3]}}),c=t.select(".nv-point-paths").selectAll("path").data(p),c.enter().append("path").attr("class",function(n,t){return"nv-path-"+t}),c.exit().remove(),c.attr("d",function(n){return"M"+n.data.join(",")+"Z"}),v=c):(w=s.map(function(n,t){return{data:n,series:s[t][2],point:s[t][3]}}),v=t.select(".nv-groups").selectAll(".nv-group").selectAll("path.nv-point").data(w).style("pointer-events","auto"));v.on("click",function(t){var s=n[t.series],f=s.values[t.point];h.elementClick({point:f,series:s,pos:[i(e(f,t.point))+u.left,r(o(f,t.point))+u.top],seriesIndex:t.series,pointIndex:t.point})}).on("mouseover",function(t){var s=n[t.series],f=s.values[t.point];h.elementMouseover({point:f,series:s,pos:[i(e(f,t.point))+u.left,r(o(f,t.point))+u.top],seriesIndex:t.series,pointIndex:t.point})}).on("mouseout",function(t){var i=n[t.series],r=i.values[t.point];h.elementMouseout({point:r,series:i,seriesIndex:t.series,pointIndex:t.point})})}var pt=tt-u.left-u.right,wt=it-u.top-u.bottom,gt=d3.select(this),yt,at,vt;n=n.map(function(n,t){return n.values=n.values.map(function(n){return n.series=t,n}),n});yt=p&&w&&b?[]:d3.merge(n.map(function(n){return n.values.map(function(n,t){return{x:e(n,t),y:o(n,t),size:c(n,t)}})}));i.domain(p||d3.extent(yt.map(function(n){return n.x}).concat(rt))).range([0,pt]);r.domain(w||d3.extent(yt.map(function(n){return n.y}).concat(ut))).range([wt,0]);s.domain(b||d3.extent(yt.map(function(n){return n.size}).concat(ft))).range(ht||[16,256]);(i.domain()[0]===i.domain()[1]||r.domain()[0]===r.domain()[1])&&(k=!0);i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]-i.domain()[0]*.01,i.domain()[1]+i.domain()[1]*.01]):i.domain([-1,1]));r.domain()[0]===r.domain()[1]&&(r.domain()[0]?r.domain([r.domain()[0]+r.domain()[0]*.01,r.domain()[1]-r.domain()[1]*.01]):r.domain([-1,1]));g=g||i;nt=nt||r;ct=ct||s;var t=gt.selectAll("g.nv-wrap.nv-scatter").data([n]),bt=t.enter().append("g").attr("class","nvd3 nv-wrap nv-scatter nv-chart-"+f+(k?" nv-single-point":"")),kt=bt.append("defs"),dt=bt.append("g"),ni=t.select("g");dt.append("g").attr("class","nv-groups");dt.append("g").attr("class","nv-point-paths");t.attr("transform","translate("+u.left+","+u.top+")");kt.append("clipPath").attr("id","nv-edge-clip-"+f).append("rect");t.select("#nv-edge-clip-"+f+" rect").attr("width",pt).attr("height",wt);ni.attr("clip-path",ot?"url(#nv-edge-clip-"+f+")":"");at=t.select(".nv-groups").selectAll(".nv-group").data(function(n){return n},function(n){return n.key});at.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6);d3.transition(at.exit()).style("stroke-opacity",1e-6).style("fill-opacity",1e-6).remove();at.attr("class",function(n,t){return"nv-group nv-series-"+t}).classed("hover",function(n){return n.hover});d3.transition(at).style("fill",function(n,t){return a(n,t)}).style("stroke",function(n,t){return a(n,t)}).style("stroke-opacity",1).style("fill-opacity",.5);vt=at.selectAll("path.nv-point").data(function(n){return n.values});vt.enter().append("path").attr("transform",function(n,t){return"translate("+g(e(n,t))+","+nt(o(n,t))+")"}).attr("d",d3.svg.symbol().type(v).size(function(n,t){return s(c(n,t))}));vt.exit().remove();d3.transition(at.exit().selectAll("path.nv-point")).attr("transform",function(n,t){return"translate("+i(e(n,t))+","+r(o(n,t))+")"}).remove();vt.attr("class",function(n,t){return"nv-point nv-point-"+t});d3.transition(vt).attr("transform",function(n,t){return"translate("+i(e(n,t))+","+r(o(n,t))+")"}).attr("d",d3.svg.symbol().type(v).size(function(n,t){return s(c(n,t))}));clearTimeout(lt);lt=setTimeout(ti,1e3);g=i.copy();nt=r.copy();ct=s.copy()}),t}var u={top:0,right:0,bottom:0,left:0},tt=960,it=500,a=n.utils.defaultColor(),f=Math.floor(Math.random()*1e5),i=d3.scale.linear(),r=d3.scale.linear(),s=d3.scale.linear(),e=function(n){return n.x},o=function(n){return n.y},c=function(n){return n.size||1},v=function(n){return n.shape||"circle"},rt=[],ut=[],ft=[],l=!0,et=function(n){return!n.notActive},ot=!1,y=!0,st=function(){return 25},p=null,w=null,b=null,ht=null,k=!1,h=d3.dispatch("elementClick","elementMouseover","elementMouseout"),d=!0,g,nt,ct,lt;h.on("elementMouseover.point",function(n){l&&d3.select(".nv-chart-"+f+" .nv-series-"+n.seriesIndex+" .nv-point-"+n.pointIndex).classed("hover",!0)});h.on("elementMouseout.point",function(n){l&&d3.select(".nv-chart-"+f+" .nv-series-"+n.seriesIndex+" .nv-point-"+n.pointIndex).classed("hover",!1)});return t.dispatch=h,t.x=function(n){return arguments.length?(e=d3.functor(n),t):e},t.y=function(n){return arguments.length?(o=d3.functor(n),t):o},t.size=function(n){return arguments.length?(c=d3.functor(n),t):c},t.margin=function(n){return arguments.length?(u.top=typeof n.top!="undefined"?n.top:u.top,u.right=typeof n.right!="undefined"?n.right:u.right,u.bottom=typeof n.bottom!="undefined"?n.bottom:u.bottom,u.left=typeof n.left!="undefined"?n.left:u.left,t):u},t.width=function(n){return arguments.length?(tt=n,t):tt},t.height=function(n){return arguments.length?(it=n,t):it},t.xScale=function(n){return arguments.length?(i=n,t):i},t.yScale=function(n){return arguments.length?(r=n,t):r},t.zScale=function(n){return arguments.length?(s=n,t):s},t.xDomain=function(n){return arguments.length?(p=n,t):p},t.yDomain=function(n){return arguments.length?(w=n,t):w},t.sizeDomain=function(n){return arguments.length?(b=n,t):b},t.sizeRange=function(n){return arguments.length?(ht=n,t):ht},t.forceX=function(n){return arguments.length?(rt=n,t):rt},t.forceY=function(n){return arguments.length?(ut=n,t):ut},t.forceSize=function(n){return arguments.length?(ft=n,t):ft},t.interactive=function(n){return arguments.length?(l=n,t):l},t.pointActive=function(n){return arguments.length?(et=n,t):et},t.clipEdge=function(n){return arguments.length?(ot=n,t):ot},t.clipVoronoi=function(n){return arguments.length?(y=n,t):y},t.useVoronoi=function(n){return arguments.length?(d=n,d===!1&&(y=!1),t):d},t.clipRadius=function(n){return arguments.length?(st=n,t):st},t.color=function(i){return arguments.length?(a=n.utils.getColor(i),t):a},t.shape=function(n){return arguments.length?(v=n,t):v},t.id=function(n){return arguments.length?(f=n,t):f},t.singlePoint=function(n){return arguments.length?(k=n,t):k},t};n.models.scatterChart=function(){function t(n){return n.each(function(g){function ni(){if(v)return nt.select(".nv-point-paths").style("pointer-events","all"),!1;nt.select(".nv-point-paths").style("pointer-events","none");var n=d3.mouse(this);f.distortion(a).focus(n[0]);u.distortion(a).focus(n[1]);nt.select(".nv-scatterWrap").call(r);nt.select(".nv-x.nv-axis").call(e);nt.select(".nv-y.nv-axis").call(o);nt.select(".nv-distributionX").datum(g.filter(function(n){return!n.disabled})).call(l);nt.select(".nv-distributionY").datum(g.filter(function(n){return!n.disabled})).call(s)}var pt=d3.select(this),dt=this,at=(it||parseInt(pt.style("width"))||960)-i.left-i.right,vt=(k||parseInt(pt.style("height"))||400)-i.top-i.bottom,wt,bt,kt;if(t.update=function(){t(n)},t.container=this,g&&g.length&&g.filter(function(n){return n.values.length}).length)pt.selectAll(".nv-noData").remove();else return wt=pt.selectAll(".nv-noData").data([ot]),wt.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),wt.attr("x",i.left+at/2).attr("y",i.top+vt/2).text(function(n){return n}),t;st=st||f;ht=ht||u;var yt=pt.selectAll("g.nv-wrap.nv-scatterChart").data([g]),gt=yt.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+r.id()),tt=gt.append("g"),nt=yt.select("g");if(tt.append("rect").attr("class","nvd3 nv-background"),tt.append("g").attr("class","nv-x nv-axis"),tt.append("g").attr("class","nv-y nv-axis"),tt.append("g").attr("class","nv-scatterWrap"),tt.append("g").attr("class","nv-distWrap"),tt.append("g").attr("class","nv-legendWrap"),tt.append("g").attr("class","nv-controlsWrap"),ft&&(c.width(at/2),yt.select(".nv-legendWrap").datum(g).call(c),i.top!=c.height()&&(i.top=c.height(),vt=(k||parseInt(pt.style("height"))||400)-i.top-i.bottom),yt.select(".nv-legendWrap").attr("transform","translate("+at/2+","+-i.top+")")),et&&(b.width(180).color(["#444"]),nt.select(".nv-controlsWrap").datum(lt).attr("transform","translate(0,"+-i.top+")").call(b)),yt.attr("transform","translate("+i.left+","+i.top+")"),r.width(at).height(vt).color(g.map(function(n,t){return n.color||h(n,t)}).filter(function(n,t){return!g[t].disabled})),yt.select(".nv-scatterWrap").datum(g.filter(function(n){return!n.disabled})).call(r),y&&(bt=f.domain()[1]-f.domain()[0],f.domain([f.domain()[0]-y*bt,f.domain()[1]+y*bt])),p&&(kt=u.domain()[1]-u.domain()[0],u.domain([u.domain()[0]-p*kt,u.domain()[1]+p*kt])),e.scale(f).ticks(e.ticks()&&e.ticks().length?e.ticks():at/100).tickSize(-vt,0),nt.select(".nv-x.nv-axis").attr("transform","translate(0,"+u.range()[0]+")").call(e),o.scale(u).ticks(o.ticks()&&o.ticks().length?o.ticks():vt/36).tickSize(-at,0),nt.select(".nv-y.nv-axis").call(o),rt&&(l.getData(r.x()).scale(f).width(at).color(g.map(function(n,t){return n.color||h(n,t)}).filter(function(n,t){return!g[t].disabled})),tt.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),nt.select(".nv-distributionX").attr("transform","translate(0,"+u.range()[0]+")").datum(g.filter(function(n){return!n.disabled})).call(l)),ut&&(s.getData(r.y()).scale(u).width(vt).color(g.map(function(n,t){return n.color||h(n,t)}).filter(function(n,t){return!g[t].disabled})),tt.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),nt.select(".nv-distributionY").attr("transform","translate(-"+s.size()+",0)").datum(g.filter(function(n){return!n.disabled})).call(s)),d3.fisheye){nt.select(".nv-background").attr("width",at).attr("height",vt);nt.select(".nv-background").on("mousemove",ni);nt.select(".nv-background").on("click",function(){v=!v});r.dispatch.on("elementClick.freezeFisheye",function(){v=!v})}b.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;a=i.disabled?0:2.5;nt.select(".nv-background").style("pointer-events",i.disabled?"none":"all");nt.select(".nv-point-paths").style("pointer-events",i.disabled?"all":"none");i.disabled?(f.distortion(a).focus(0),u.distortion(a).focus(0),nt.select(".nv-scatterWrap").call(r),nt.select(".nv-x.nv-axis").call(e),nt.select(".nv-y.nv-axis").call(o)):v=!1;t(n)});c.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;g.filter(function(n){return!n.disabled}).length||g.map(function(n){return n.disabled=!1,yt.selectAll(".nv-series").classed("disabled",!1),n});t(n)});r.dispatch.on("elementMouseover.tooltip",function(n){d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-distx-"+n.pointIndex).attr("y1",n.pos[1]-vt);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-disty-"+n.pointIndex).attr("x2",n.pos[0]+l.size());n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];w.tooltipShow(n)});w.on("tooltipShow",function(n){d&&ct(n,dt.parentNode)});st=f.copy();ht=u.copy()}),t}var r=n.models.scatter(),e=n.models.axis(),o=n.models.axis(),c=n.models.legend(),b=n.models.legend(),l=n.models.distribution(),s=n.models.distribution(),i={top:30,right:20,bottom:50,left:60},it=null,k=null,h=n.utils.defaultColor(),f=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):r.xScale(),u=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):r.yScale(),y=0,p=0,rt=!1,ut=!1,ft=!0,et=!!d3.fisheye,a=0,v=!1,d=!0,g=function(n,t){return"<strong>"+t+"<\/strong>"},nt=function(n,t,i){return"<strong>"+i+"<\/strong>"},tt=null,w=d3.dispatch("tooltipShow","tooltipHide"),ot="No Data Available.",st,ht,ct,lt;r.xScale(f).yScale(u);e.orient("bottom").tickPadding(10);o.orient("left").tickPadding(10);l.axis("x");s.axis("y");ct=function(s,h){var a=s.pos[0]+(h.offsetLeft||0),v=s.pos[1]+(h.offsetTop||0),y=s.pos[0]+(h.offsetLeft||0),p=u.range()[0]+i.top+(h.offsetTop||0),w=f.range()[0]+i.left+(h.offsetLeft||0),b=s.pos[1]+(h.offsetTop||0),c=e.tickFormat()(r.x()(s.point,s.pointIndex)),l=o.tickFormat()(r.y()(s.point,s.pointIndex));g!=null&&n.tooltip.show([y,p],g(s.series.key,c,l,s,t),"n",1,h,"x-nvtooltip");nt!=null&&n.tooltip.show([w,b],nt(s.series.key,c,l,s,t),"e",1,h,"y-nvtooltip");tt!=null&&n.tooltip.show([a,v],tt(s.series.key,c,l,s,t),s.value<0?"n":"s",null,h)};lt=[{key:"Magnify",disabled:!0}];r.dispatch.on("elementMouseout.tooltip",function(n){w.tooltipHide(n);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-distx-"+n.pointIndex).attr("y1",0);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-disty-"+n.pointIndex).attr("x2",s.size())});w.on("tooltipHide",function(){d&&n.tooltip.cleanup()});return t.dispatch=w,t.scatter=r,t.legend=c,t.controls=b,t.xAxis=e,t.yAxis=o,t.distX=l,t.distY=s,d3.rebind(t,r,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(it=n,t):it},t.height=function(n){return arguments.length?(k=n,t):k},t.color=function(i){return arguments.length?(h=n.utils.getColor(i),c.color(h),l.color(h),s.color(h),t):h},t.showDistX=function(n){return arguments.length?(rt=n,t):rt},t.showDistY=function(n){return arguments.length?(ut=n,t):ut},t.showControls=function(n){return arguments.length?(et=n,t):et},t.showLegend=function(n){return arguments.length?(ft=n,t):ft},t.fisheye=function(n){return arguments.length?(a=n,t):a},t.xPadding=function(n){return arguments.length?(y=n,t):y},t.yPadding=function(n){return arguments.length?(p=n,t):p},t.tooltips=function(n){return arguments.length?(d=n,t):d},t.tooltipContent=function(n){return arguments.length?(tt=n,t):tt},t.tooltipXContent=function(n){return arguments.length?(g=n,t):g},t.tooltipYContent=function(n){return arguments.length?(nt=n,t):nt},t.noData=function(n){return arguments.length?(ot=n,t):ot},t};n.models.scatterPlusLineChart=function(){function t(n){return n.each(function(k){function dt(){if(v)return d.select(".nv-point-paths").style("pointer-events","all"),!1;d.select(".nv-point-paths").style("pointer-events","none");var n=d3.mouse(this);u.distortion(a).focus(n[0]);f.distortion(a).focus(n[1]);d.select(".nv-scatterWrap").datum(k.filter(function(n){return!n.disabled})).call(r);d.select(".nv-x.nv-axis").call(e);d.select(".nv-y.nv-axis").call(o);d.select(".nv-distributionX").datum(k.filter(function(n){return!n.disabled})).call(l);d.select(".nv-distributionY").datum(k.filter(function(n){return!n.disabled})).call(h)}var vt=d3.select(this),wt=this,lt=(nt||parseInt(vt.style("width"))||960)-i.left-i.right,at=(w||parseInt(vt.style("height"))||400)-i.top-i.bottom,yt,pt,kt;if(t.update=function(){t(n)},t.container=this,k&&k.length&&k.filter(function(n){return n.values.length}).length)vt.selectAll(".nv-noData").remove();else return yt=vt.selectAll(".nv-noData").data([ft]),yt.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),yt.attr("x",i.left+lt/2).attr("y",i.top+at/2).text(function(n){return n}),t;u=r.xScale();f=r.yScale();et=et||u;ot=ot||f;var ct=vt.selectAll("g.nv-wrap.nv-scatterChart").data([k]),bt=ct.enter().append("g").attr("class","nvd3 nv-wrap nv-scatterChart nv-chart-"+r.id()),g=bt.append("g"),d=ct.select("g");if(g.append("rect").attr("class","nvd3 nv-background"),g.append("g").attr("class","nv-x nv-axis"),g.append("g").attr("class","nv-y nv-axis"),g.append("g").attr("class","nv-scatterWrap"),g.append("g").attr("class","nv-regressionLinesWrap"),g.append("g").attr("class","nv-distWrap"),g.append("g").attr("class","nv-legendWrap"),g.append("g").attr("class","nv-controlsWrap"),ct.attr("transform","translate("+i.left+","+i.top+")"),rt&&(c.width(lt/2),ct.select(".nv-legendWrap").datum(k).call(c),i.top!=c.height()&&(i.top=c.height(),at=(w||parseInt(vt.style("height"))||400)-i.top-i.bottom),ct.select(".nv-legendWrap").attr("transform","translate("+lt/2+","+-i.top+")")),ut&&(p.width(180).color(["#444"]),d.select(".nv-controlsWrap").datum(ht).attr("transform","translate(0,"+-i.top+")").call(p)),r.width(lt).height(at).color(k.map(function(n,t){return n.color||s(n,t)}).filter(function(n,t){return!k[t].disabled})),ct.select(".nv-scatterWrap").datum(k.filter(function(n){return!n.disabled})).call(r),ct.select(".nv-regressionLinesWrap").attr("clip-path","url(#nv-edge-clip-"+r.id()+")"),pt=ct.select(".nv-regressionLinesWrap").selectAll(".nv-regLines").data(function(n){return n}),kt=pt.enter().append("g").attr("class","nv-regLines").append("line").attr("class","nv-regLine").style("stroke-opacity",0),pt.selectAll(".nv-regLines line").attr("x1",u.range()[0]).attr("x2",u.range()[1]).attr("y1",function(n){return f(u.domain()[0]*n.slope+n.intercept)}).attr("y2",function(n){return f(u.domain()[1]*n.slope+n.intercept)}).style("stroke",function(n,t,i){return s(n,i)}).style("stroke-opacity",function(n){return n.disabled||typeof n.slope=="undefined"||typeof n.intercept=="undefined"?0:1}),e.scale(u).ticks(e.ticks()?e.ticks():lt/100).tickSize(-at,0),d.select(".nv-x.nv-axis").attr("transform","translate(0,"+f.range()[0]+")").call(e),o.scale(f).ticks(o.ticks()?o.ticks():at/36).tickSize(-lt,0),d.select(".nv-y.nv-axis").call(o),tt&&(l.getData(r.x()).scale(u).width(lt).color(k.map(function(n,t){return n.color||s(n,t)}).filter(function(n,t){return!k[t].disabled})),g.select(".nv-distWrap").append("g").attr("class","nv-distributionX"),d.select(".nv-distributionX").attr("transform","translate(0,"+f.range()[0]+")").datum(k.filter(function(n){return!n.disabled})).call(l)),it&&(h.getData(r.y()).scale(f).width(at).color(k.map(function(n,t){return n.color||s(n,t)}).filter(function(n,t){return!k[t].disabled})),g.select(".nv-distWrap").append("g").attr("class","nv-distributionY"),d.select(".nv-distributionY").attr("transform","translate(-"+h.size()+",0)").datum(k.filter(function(n){return!n.disabled})).call(h)),d3.fisheye){d.select(".nv-background").attr("width",lt).attr("height",at);d.select(".nv-background").on("mousemove",dt);d.select(".nv-background").on("click",function(){v=!v});r.dispatch.on("elementClick.freezeFisheye",function(){v=!v})}p.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;a=i.disabled?0:2.5;d.select(".nv-background").style("pointer-events",i.disabled?"none":"all");d.select(".nv-point-paths").style("pointer-events",i.disabled?"all":"none");i.disabled?(u.distortion(a).focus(0),f.distortion(a).focus(0),d.select(".nv-scatterWrap").call(r),d.select(".nv-x.nv-axis").call(e),d.select(".nv-y.nv-axis").call(o)):v=!1;t(n)});c.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;k.filter(function(n){return!n.disabled}).length||k.map(function(n){return n.disabled=!1,ct.selectAll(".nv-series").classed("disabled",!1),n});t(n)});r.dispatch.on("elementMouseover.tooltip",function(n){d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-distx-"+n.pointIndex).attr("y1",n.pos[1]-at);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-disty-"+n.pointIndex).attr("x2",n.pos[0]+l.size());n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];y.tooltipShow(n)});y.on("tooltipShow",function(n){b&&st(n,wt.parentNode)});et=u.copy();ot=f.copy()}),t}var r=n.models.scatter(),e=n.models.axis(),o=n.models.axis(),c=n.models.legend(),p=n.models.legend(),l=n.models.distribution(),h=n.models.distribution(),i={top:30,right:20,bottom:50,left:60},nt=null,w=null,s=n.utils.defaultColor(),u=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):r.xScale(),f=d3.fisheye?d3.fisheye.scale(d3.scale.linear).distortion(0):r.yScale(),tt=!1,it=!1,rt=!0,ut=!!d3.fisheye,a=0,v=!1,b=!0,k=function(n,t){return"<strong>"+t+"<\/strong>"},d=function(n,t,i){return"<strong>"+i+"<\/strong>"},g=null,y=d3.dispatch("tooltipShow","tooltipHide"),ft="No Data Available.",et,ot,st,ht;r.xScale(u).yScale(f);e.orient("bottom").tickPadding(10);o.orient("left").tickPadding(10);l.axis("x");h.axis("y");st=function(s,h){var a=s.pos[0]+(h.offsetLeft||0),v=s.pos[1]+(h.offsetTop||0),y=s.pos[0]+(h.offsetLeft||0),p=f.range()[0]+i.top+(h.offsetTop||0),w=u.range()[0]+i.left+(h.offsetLeft||0),b=s.pos[1]+(h.offsetTop||0),c=e.tickFormat()(r.x()(s.point,s.pointIndex)),l=o.tickFormat()(r.y()(s.point,s.pointIndex));k!=null&&n.tooltip.show([y,p],k(s.series.key,c,l,s,t),"n",1,h,"x-nvtooltip");d!=null&&n.tooltip.show([w,b],d(s.series.key,c,l,s,t),"e",1,h,"y-nvtooltip");g!=null&&n.tooltip.show([a,v],g(s.series.key,c,l,s,t),s.value<0?"n":"s",null,h)};ht=[{key:"Magnify",disabled:!0}];r.dispatch.on("elementMouseout.tooltip",function(n){y.tooltipHide(n);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-distx-"+n.pointIndex).attr("y1",0);d3.select(".nv-chart-"+r.id()+" .nv-series-"+n.seriesIndex+" .nv-disty-"+n.pointIndex).attr("x2",h.size())});y.on("tooltipHide",function(){b&&n.tooltip.cleanup()});return t.dispatch=y,t.scatter=r,t.legend=c,t.controls=p,t.xAxis=e,t.yAxis=o,t.distX=l,t.distY=h,d3.rebind(t,r,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(nt=n,t):nt},t.height=function(n){return arguments.length?(w=n,t):w},t.color=function(i){return arguments.length?(s=n.utils.getColor(i),c.color(s),l.color(s),h.color(s),t):s},t.showDistX=function(n){return arguments.length?(tt=n,t):tt},t.showDistY=function(n){return arguments.length?(it=n,t):it},t.showControls=function(n){return arguments.length?(ut=n,t):ut},t.showLegend=function(n){return arguments.length?(rt=n,t):rt},t.fisheye=function(n){return arguments.length?(a=n,t):a},t.tooltips=function(n){return arguments.length?(b=n,t):b},t.tooltipContent=function(n){return arguments.length?(g=n,t):g},t.tooltipXContent=function(n){return arguments.length?(k=n,t):k},t.tooltipYContent=function(n){return arguments.length?(d=n,t):d},t.noData=function(n){return arguments.length?(ft=n,t):ft},t};n.models.sparkline=function(){function t(n){return n.each(function(n){var y=o-i.left-i.right,p=s-i.top-i.bottom,w=d3.select(this),a,v;r.domain(c||d3.extent(n,f)).range([0,y]);u.domain(l||d3.extent(n,e)).range([p,0]);var t=w.selectAll("g.nv-wrap.nv-sparkline").data([n]),b=t.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),k=b.append("g"),d=t.select("g");t.attr("transform","translate("+i.left+","+i.top+")");a=t.selectAll("path").data(function(n){return[n]});a.enter().append("path");a.exit().remove();a.style("stroke",function(n,t){return n.color||h(n,t)}).attr("d",d3.svg.line().x(function(n,t){return r(f(n,t))}).y(function(n,t){return u(e(n,t))}));v=t.selectAll("circle.nv-point").data(function(n){return n.map(function(n,t){return(u.domain().indexOf(e(n,t))!=-1||f(n,t)==r.domain()[1])&&(n.pointIndex=t),n}).filter(function(n){return typeof n.pointIndex!="undefined"})});v.enter().append("circle");v.exit().remove();v.attr("cx",function(n){return r(f(n,n.pointIndex))}).attr("cy",function(n){return u(e(n,n.pointIndex))}).attr("r",2).attr("class",function(n){return f(n,n.pointIndex)==r.domain()[1]?"nv-point nv-currentValue":e(n,n.pointIndex)==u.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),t}var i={top:2,right:0,bottom:2,left:0},o=400,s=32,a=!0,r=d3.scale.linear(),u=d3.scale.linear(),f=function(n){return n.x},e=function(n){return n.y},h=n.utils.getColor(["#000"]),c,l;return t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(o=n,t):o},t.height=function(n){return arguments.length?(s=n,t):s},t.x=function(n){return arguments.length?(f=d3.functor(n),t):f},t.y=function(n){return arguments.length?(e=d3.functor(n),t):e},t.xScale=function(n){return arguments.length?(r=n,t):r},t.yScale=function(n){return arguments.length?(u=n,t):u},t.xDomain=function(n){return arguments.length?(c=n,t):c},t.yDomain=function(n){return arguments.length?(l=n,t):l},t.animate=function(n){return arguments.length?(a=n,t):a},t.color=function(i){return arguments.length?(h=n.utils.getColor(i),t):h},t};n.models.sparklinePlus=function(){function i(n){return n.each(function(v){function it(){f||(y.data([u]),y.transition().duration(250).style("stroke-opacity",function(n){return n===null?0:1}).style("fill-opacity",function(n){return n===null?0:1}),u!=null)&&(y.attr("transform",function(n){return"translate("+s(r.x()(v[n],n))+",0)"}),y.select(".nv-xValue").text(h(r.x()(v[u],u))),y.select(".nv-yValue").text(c(r.y()(v[u],u))))}function ft(){function i(n,t){for(var u=Math.abs(r.x()(n[0],0)-t),f=0,i=0;i<n.length;i++)Math.abs(r.x()(n[i],i)-t)<u&&(u=Math.abs(r.x()(n[i],i)-t),f=i);return f}if(!f){var n=d3.mouse(this)[0]-t.left;u=i(v,Math.round(s.invert(n)));it()}}var p=d3.select(this),b=(e||parseInt(p.style("width"))||960)-t.left-t.right,w=(o||parseInt(p.style("height"))||400)-t.top-t.bottom,k,rt;if(i.update=function(){i(n)},i.container=this,v&&v.length)p.selectAll(".nv-noData").remove();else return k=p.selectAll(".nv-noData").data([l]),k.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),k.attr("x",t.left+b/2).attr("y",t.top+w/2).text(function(n){return n}),i;s=r.xScale();a=r.yScale();var d=p.selectAll("g.nv-wrap.nv-sparklineplus").data([v]),ut=d.enter().append("g").attr("class","nvd3 nv-wrap nv-sparklineplus"),g=ut.append("g"),nt=d.select("g");g.append("g").attr("class","nv-sparklineWrap");g.append("g").attr("class","nv-hoverArea");d.attr("transform","translate("+t.left+","+t.top+")");rt=nt.select(".nv-sparklineWrap");r.width(b).height(w);rt.call(r);g.select(".nv-hoverArea").append("rect").on("mousemove",ft).on("click",function(){f=!f}).on("mouseout",function(){u=null;it()});nt.select(".nv-hoverArea rect").attr("transform",function(){return"translate("+-t.left+","+-t.top+")"}).attr("width",b+t.left+t.right).attr("height",w+t.top);u=typeof u=="undefined"?null:u;var y=nt.selectAll(".nv-hoverValue").data([u]),tt=y.enter().append("g").attr("class","nv-hoverValue"),et=tt.append("line").attr("x1",0).attr("y1",-t.top).attr("x2",0).attr("y2",w),ot=tt.append("text").attr("class","nv-xValue").attr("x",-6).attr("y",-t.top).attr("text-anchor","end").attr("dy",".9em"),st=tt.append("text").attr("class","nv-yValue").attr("x",6).attr("y",-t.top).attr("text-anchor","start").attr("dy",".9em");it()}),i}var r=n.models.sparkline(),t={top:15,right:60,bottom:3,left:50},e=null,o=null,s,a,u,f=!1,h=d3.format(",r"),c=d3.format(",.2f"),l="No Data Available.";return i.sparkline=r,d3.rebind(i,r,"x","y","xScale","yScale","color"),i.margin=function(n){return arguments.length?(t.top=typeof n.top!="undefined"?n.top:t.top,t.right=typeof n.right!="undefined"?n.right:t.right,t.bottom=typeof n.bottom!="undefined"?n.bottom:t.bottom,t.left=typeof n.left!="undefined"?n.left:t.left,i):t},i.width=function(n){return arguments.length?(e=n,i):e},i.height=function(n){return arguments.length?(o=n,i):o},i.xTickFormat=function(n){return arguments.length?(h=n,i):h},i.yTickFormat=function(n){return arguments.length?(c=n,i):c},i.noData=function(n){return arguments.length?(l=n,i):l},i};n.models.stackedArea=function(){function t(n){return n.each(function(n){var d=c-i.left-i.right,g=l-i.top-i.bottom,rt=d3.select(this),it;b=r.xScale();s=r.yScale();n=n.map(function(n){return n.values=n.values.map(function(t,i){return t.index=i,t.stackedY=n.disabled?0:a(t,i),t}),n});n=d3.layout.stack().order(p).offset(y).values(function(n){return n.values}).x(f).y(function(n){return n.stackedY}).out(function(n,t,i){n.display={y:i,y0:t}})(n);var v=rt.selectAll("g.nv-wrap.nv-stackedarea").data([n]),nt=v.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedarea"),ut=nt.append("defs"),tt=nt.append("g"),t=v.select("g");tt.append("g").attr("class","nv-areaWrap");tt.append("g").attr("class","nv-scatterWrap");v.attr("transform","translate("+i.left+","+i.top+")");r.width(d).height(g).x(f).y(function(n){return n.display.y+n.display.y0}).forceY([0]).color(n.map(function(n,t){return n.color||e(n,t)}).filter(function(t,i){return!n[i].disabled}));it=t.select(".nv-scatterWrap").datum(n.filter(function(n){return!n.disabled}));d3.transition(it).call(r);ut.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect");v.select("#nv-edge-clip-"+o+" rect").attr("width",d).attr("height",g);t.attr("clip-path",w?"url(#nv-edge-clip-"+o+")":"");var ft=d3.svg.area().x(function(n,t){return b(f(n,t))}).y0(function(n){return s(n.display.y0)}).y1(function(n){return s(n.display.y+n.display.y0)}).interpolate(h),et=d3.svg.area().x(function(n,t){return b(f(n,t))}).y0(function(n){return s(n.display.y0)}).y1(function(n){return s(n.display.y0)}),k=t.select(".nv-areaWrap").selectAll("path.nv-area").data(function(n){return n});k.enter().append("path").attr("class",function(n,t){return"nv-area nv-area-"+t}).on("mouseover",function(n,t){d3.select(this).classed("hover",!0);u.areaMouseover({point:n,series:n.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})}).on("mouseout",function(n,t){d3.select(this).classed("hover",!1);u.areaMouseout({point:n,series:n.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})}).on("click",function(n,t){d3.select(this).classed("hover",!1);u.areaClick({point:n,series:n.key,pos:[d3.event.pageX,d3.event.pageY],seriesIndex:t})});d3.transition(k.exit()).attr("d",function(n,t){return et(n.values,t)}).remove();k.style("fill",function(n,t){return n.color||e(n,t)}).style("stroke",function(n,t){return n.color||e(n,t)});d3.transition(k).attr("d",function(n,t){return ft(n.values,t)});r.dispatch.on("elementMouseover.area",function(n){t.select(".nv-chart-"+o+" .nv-area-"+n.seriesIndex).classed("hover",!0)});r.dispatch.on("elementMouseout.area",function(n){t.select(".nv-chart-"+o+" .nv-area-"+n.seriesIndex).classed("hover",!1)})}),t}var i={top:0,right:0,bottom:0,left:0},c=960,l=500,e=n.utils.defaultColor(),o=Math.floor(Math.random()*1e5),f=function(n){return n.x},a=function(n){return n.y},v="stack",y="zero",p="default",h="linear",w=!1,b,s,r=n.models.scatter(),u=d3.dispatch("tooltipShow","tooltipHide","areaClick","areaMouseover","areaMouseout");r.size(2.2).sizeDomain([2.2]);r.dispatch.on("elementClick.area",function(n){u.areaClick(n)});r.dispatch.on("elementMouseover.tooltip",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];u.tooltipShow(n)});r.dispatch.on("elementMouseout.tooltip",function(n){u.tooltipHide(n)});return t.dispatch=u,t.scatter=r,d3.rebind(t,r,"interactive","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","forceX","forceY","forceSize","clipVoronoi","clipRadius"),t.x=function(n){return arguments.length?(f=d3.functor(n),t):f},t.y=function(n){return arguments.length?(a=d3.functor(n),t):a},t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(c=n,t):c},t.height=function(n){return arguments.length?(l=n,t):l},t.clipEdge=function(n){return arguments.length?(w=n,t):w},t.color=function(i){return arguments.length?(e=n.utils.getColor(i),t):e},t.offset=function(n){return arguments.length?(y=n,t):y},t.order=function(n){return arguments.length?(p=n,t):p},t.style=function(n){if(!arguments.length)return v;v=n;switch(v){case"stack":t.offset("zero");t.order("default");break;case"stream":t.offset("wiggle");t.order("inside-out");break;case"stream-center":t.offset("silhouette");t.order("inside-out");break;case"expand":t.offset("expand");t.order("default")}return t},t.interpolate=function(n){return arguments.length?h=n:h},t};n.models.stackedAreaChart=function(){function t(n){return n.each(function(s){var nt=d3.select(this),st=this,tt=(b||parseInt(nt.style("width"))||960)-i.left-i.right,it=(c||parseInt(nt.style("height"))||400)-i.top-i.bottom,ft,ut,ot;if(t.update=function(){t(n)},t.container=this,s&&s.length&&s.filter(function(n){return n.values.length}).length)nt.selectAll(".nv-noData").remove();else return ft=nt.selectAll(".nv-noData").data([w]),ft.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),ft.attr("x",i.left+tt/2).attr("y",i.top+it/2).text(function(n){return n}),t;k=r.xScale();d=r.yScale();var et=nt.selectAll("g.nv-wrap.nv-stackedAreaChart").data([s]),rt=et.enter().append("g").attr("class","nvd3 nv-wrap nv-stackedAreaChart").append("g"),l=et.select("g");rt.append("g").attr("class","nv-x nv-axis");rt.append("g").attr("class","nv-y nv-axis");rt.append("g").attr("class","nv-stackedWrap");rt.append("g").attr("class","nv-legendWrap");rt.append("g").attr("class","nv-controlsWrap");y&&(f.width(tt*2/3),l.select(".nv-legendWrap").datum(s).call(f),i.top!=f.height()&&(i.top=f.height(),it=(c||parseInt(nt.style("height"))||400)-i.top-i.bottom),l.select(".nv-legendWrap").attr("transform","translate("+tt/3+","+-i.top+")"));v&&(ut=[{key:"Stacked",disabled:r.offset()!="zero"},{key:"Stream",disabled:r.offset()!="wiggle"},{key:"Expanded",disabled:r.offset()!="expand"}],e.width(Math.min(280,tt/3)).color(["#444","#444","#444"]),l.select(".nv-controlsWrap").datum(ut).call(e),i.top!=Math.max(e.height(),f.height())&&(i.top=Math.max(e.height(),f.height()),it=(c||parseInt(nt.style("height"))||400)-i.top-i.bottom),l.select(".nv-controlsWrap").attr("transform","translate(0,"+-i.top+")"));et.attr("transform","translate("+i.left+","+i.top+")");r.width(tt).height(it);ot=l.select(".nv-stackedWrap").datum(s);d3.transition(ot).call(r);o.scale(k).ticks(tt/100).tickSize(-it,0);l.select(".nv-x.nv-axis").attr("transform","translate(0,"+it+")");d3.transition(l.select(".nv-x.nv-axis")).call(o);u.scale(d).ticks(r.offset()=="wiggle"?0:it/36).tickSize(-tt,0).setTickFormat(r.offset()=="expand"?d3.format("%"):p);d3.transition(l.select(".nv-y.nv-axis")).call(u);r.dispatch.on("areaClick.toggle",function(i){s=s.filter(function(n){return!n.disabled}).length===1?s.map(function(n){return n.disabled=!1,n}):s.map(function(n,t){return n.disabled=t!=i.seriesIndex,n});n.transition().call(t)});f.dispatch.on("legendClick",function(i){i.disabled=!i.disabled;s.filter(function(n){return!n.disabled}).length||s.map(function(n){return n.disabled=!1,n});n.transition().call(t)});e.dispatch.on("legendClick",function(i){if(i.disabled){ut=ut.map(function(n){return n.disabled=!0,n});i.disabled=!1;switch(i.key){case"Stacked":r.style("stack");break;case"Stream":r.style("stream");break;case"Expanded":r.style("expand")}n.transition().call(t)}});h.on("tooltipShow",function(n){a&&g(n,st.parentNode)})}),t}var r=n.models.stackedArea(),o=n.models.axis(),u=n.models.axis(),f=n.models.legend(),e=n.models.legend(),i={top:30,right:25,bottom:50,left:60},b=null,c=null,l=n.utils.defaultColor(),v=!0,y=!0,a=!0,s=function(n,t,i){return"<h3>"+n+"<\/h3><p>"+i+" on "+t+"<\/p>"},k,d,p=d3.format(",.2f"),w="No Data Available.",h=d3.dispatch("tooltipShow","tooltipHide"),g;o.orient("bottom").tickPadding(5);u.orient("left");r.scatter.pointActive(function(n){return!!Math.round(r.y()(n)*100)});g=function(i,f){var e=i.pos[0]+(f.offsetLeft||0),h=i.pos[1]+(f.offsetTop||0),c=o.tickFormat()(r.x()(i.point,i.pointIndex)),l=u.tickFormat()(r.y()(i.point,i.pointIndex)),a=s(i.series.key,c,l,i,t);n.tooltip.show([e,h],a,i.value<0?"n":"s",null,f)};r.dispatch.on("tooltipShow",function(n){n.pos=[n.pos[0]+i.left,n.pos[1]+i.top];h.tooltipShow(n)});r.dispatch.on("tooltipHide",function(n){h.tooltipHide(n)});h.on("tooltipHide",function(){a&&n.tooltip.cleanup()});return t.dispatch=h,t.stacked=r,t.legend=f,t.controls=e,t.xAxis=o,t.yAxis=u,d3.rebind(t,r,"x","y","size","xScale","yScale","xDomain","yDomain","sizeDomain","interactive","offset","order","style","clipEdge","forceX","forceY","forceSize","interpolate"),t.margin=function(n){return arguments.length?(i.top=typeof n.top!="undefined"?n.top:i.top,i.right=typeof n.right!="undefined"?n.right:i.right,i.bottom=typeof n.bottom!="undefined"?n.bottom:i.bottom,i.left=typeof n.left!="undefined"?n.left:i.left,t):i},t.width=function(n){return arguments.length?(b=n,t):getWidth},t.height=function(n){return arguments.length?(c=n,t):getHeight},t.color=function(i){return arguments.length?(l=n.utils.getColor(i),f.color(l),r.color(l),t):l},t.showControls=function(n){return arguments.length?(v=n,t):v},t.showLegend=function(n){return arguments.length?(y=n,t):y},t.tooltip=function(n){return arguments.length?(s=n,t):s},t.tooltips=function(n){return arguments.length?(a=n,t):a},t.tooltipContent=function(n){return arguments.length?(s=n,t):s},t.noData=function(n){return arguments.length?(w=n,t):w},u.setTickFormat=u.tickFormat,u.tickFormat=function(n){return arguments.length?(p=n,u):p},t}}()