From 70dbe74ca38af23b9e240fef302810bfefe27045 Mon Sep 17 00:00:00 2001 From: Mick Muzac Date: Mon, 9 Jun 2014 08:42:32 -0400 Subject: [PATCH] Updated version number in package.json --- dist/xapicollection.min.js | 2 +- dist/xapidashboard.min.js | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/xapicollection.min.js b/dist/xapicollection.min.js index 62bd56b..8b932b1 100644 --- a/dist/xapicollection.min.js +++ b/dist/xapicollection.min.js @@ -1,2 +1,2 @@ -/*! xAPI-Dashboard v0.2.0 | Built on 06-05-2014 */ +/*! xAPI-Dashboard v1.0.0 | Built on 06-09-2014 */ "use strict";try{window.ADL=window.ADL||{}}catch(e){var window={ADL:{}}}try{var workerScript=document.querySelector('script[src*="xapicollection"]').src}catch(e){}Array.isArray||(Array.isArray=function(a){return a.length>=0&&!a.length}),function(a){function b(a,c){if(void 0===c)return null;if(0===a.length)return c;var d;if(Array.isArray(a))d=a;else{d=a.split(".");for(var e=0;e0&&console.log("Warning: Your browser does not support WebWorker transfers. Performance of this site may suffer as a result.")}function e(a){return function(){var b=Array.prototype.slice.call(arguments);return this._worker.postMessage(d.serialize([a].concat(b))),this}}c.prototype.exec=function(a){return a(this.contents),this.parent},c.prototype.save=function(){return new c(this)},c.prototype.append=function(a){return this.contents.push.apply(this.contents,a),this},c.prototype.where=function(a){function c(a){function b(a){var c=/^\s*\((.*)\)\s*$/.exec(a);return c?b(c[1]):d(a)}function c(a){for(var b=0,c=0;c=|<=|=|>|<)\s*(.*)\s*$/.exec(a);if(!b)return e;var c=h(b[1]),d=i(b[3]);if(!c)return e;if(d instanceof RegExp)return"="===b[2]?{op:"re",xpath:c,value:d}:"!="===b[2]?{op:"nre",xpath:c,value:d}:(console.error("Regex comparison only supports = and !="),e);switch(b[2]){case"=":return{op:"eq",xpath:c,value:d};case"!=":return{op:"neq",xpath:c,value:d};case"<":return{op:"lt",xpath:c,value:d};case"<=":return{op:"leq",xpath:c,value:d};case">":return{op:"gt",xpath:c,value:d};case">=":return{op:"geq",xpath:c,value:d};default:return e}}function h(a){var b=/^\s*([^\.]+(?:\.[^\.]+)*)\s*$/.exec(a);return b?b[1]:e}function i(a){var b=null,c=a.trim();return(b=parseInt(a,10))?b:(b=parseFloat(a))?b:(b=/^\s*"(.*)"\s*$/.exec(a))?b[1]:(b=/^\s*\/(.*)\/(i?)\s*$/.exec(a))?new RegExp(b[1],b[2]):"null"===c?null:"true"===c||"false"===c?"true"===c:e}var j=b(a);return j!=e?j:null}function d(a,c){if(Array.isArray(a.and)&&0===a.and.length)return!0;if(Array.isArray(a.or)&&0===a.or.length)return!1;if(!a.op)return a.and?d(a.and[0],c)?d({and:a.and.slice(1)},c):!1:a.or?d(a.or[0],c)?!0:d({or:a.or.slice(1)},c):!1;switch(a.op){case"eq":return b(a.xpath,c)===a.value;case"neq":return b(a.xpath,c)!==a.value;case"geq":return b(a.xpath,c)>=a.value;case"leq":return b(a.xpath,c)<=a.value;case"lt":return b(a.xpath,c)a.value;case"re":return a.value.test(b(a.xpath,c));case"nre":return!a.value.test(b(a.xpath,c));default:return!1}}var e=0/0;if(a){var f=c(a);if(!f)return void console.error("Invalid where expression: "+a);for(var g=0;g0)for(var e=this.contents,f=0;f0)for(var g=0;gf?-1:1)*c}),this},c.prototype._groupByRange=function(a,c){if(!Array.isArray(c)||3!==c.length||c[2]%1!==0)return this.groupBy(a);var d,e,f=c[0],g=c[1],h=c[2];"string"==typeof f&&"string"==typeof g&&Date.parse(f)&&Date.parse(g)?(d=function(a){return Date.parse(a)},e=function(a,b){var c=new Date(Date.parse(a)+b);return c.toISOString()}):"string"==typeof f&&"string"==typeof g?(d=function(a){return a.charAt(0).toLowerCase().charCodeAt(0)-"a".charCodeAt(0)},e=function(a,b){return String.fromCharCode(a.charAt(0).toLowerCase().charCodeAt(0)+b)}):(d=function(a){return a},e=function(a,b){return a+b});var i=[];if((d(g)-d(f))*h<=0)console.error("Group range is open, cannot generate groups!"),console.log(JSON.stringify(c)),i=[f,g];else{if(d(f)>d(g))return groupByRange(a,[g,f,-h]),void dataStack.push(dataStack.pop().reverse());for(var j=f;d(j)0){for(var d=0;d0){for(var f=0;f0){for(var f=0;f0?h/j.data.length:0,j.sample=j.data[0],g.push(j)}return this.contents=g,this},c.prototype.min=function(a,d){if(!a)return this;var e=this.contents,f=[];if(e[0]&&e[0].group&&e[0].data){if(d&&d>0){for(var g=0;g0){for(var f=0;fsg&&(lg.scrollX||lg.scrollY)){c=jg.select(kg.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=c[0][0].getScreenCTM();sg=!(e.f||e.e),c.remove()}return sg?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function p(a){for(var b=-1,c=a.length,d=[];++b0&&(a=a.substring(0,h));var j=Eg.get(a);return j&&(a=j,i=H),h?b?e:d:b?E:f}function G(a,b){return function(c){var d=jg.event;jg.event=c,b[0]=this.__data__;try{a.apply(this,b)}finally{jg.event=d}}}function H(a,b){var c=G(a,b);return function(a){var b=this,d=a.relatedTarget;d&&(d===b||8&d.compareDocumentPosition(b))||c.call(b,a)}}function I(a,b){for(var c=0,d=a.length;d>c;c++)for(var e,f=a[c],g=0,h=f.length;h>g;g++)(e=f[g])&&b(e,g,c);return a}function J(a){return vg(a,Fg),a}function K(){}function L(a,b,c){return new M(a,b,c)}function M(a,b,c){this.h=a,this.s=b,this.l=c}function N(a,b,c){function d(a){return a>360?a-=360:0>a&&(a+=360),60>a?f+(g-f)*a/60:180>a?g:240>a?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(255*d(a))}var f,g;return a%=360,0>a&&(a+=360),b=0>b?0:b>1?1:b,c=0>c?0:c>1?1:c,g=.5>=c?c*(1+b):c+b-c*b,f=2*c-g,cb(e(a+120),e(a),e(a-120))}function O(a){return a>0?1:0>a?-1:0}function P(a){return Math.acos(Math.max(-1,Math.min(1,a)))}function Q(a){return a>1?Lg/2:-1>a?-Lg/2:Math.asin(a)}function R(a){return(Math.exp(a)-Math.exp(-a))/2}function S(a){return(Math.exp(a)+Math.exp(-a))/2}function T(a){return(a=Math.sin(a/2))*a}function U(a,b,c){return new V(a,b,c)}function V(a,b,c){this.h=a,this.c=b,this.l=c}function W(a,b,c){return X(c,Math.cos(a*=Ng)*b,Math.sin(a)*b)}function X(a,b,c){return new Y(a,b,c)}function Y(a,b,c){this.l=a,this.a=b,this.b=c}function Z(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=_(e)*Rg,d=_(d)*Sg,f=_(f)*Tg,cb(bb(3.2404542*e-1.5371385*d-.4985314*f),bb(-.969266*e+1.8760108*d+.041556*f),bb(.0556434*e-.2040259*d+1.0572252*f))}function $(a,b,c){return U(Math.atan2(c,b)*Og,Math.sqrt(b*b+c*c),a)}function _(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function ab(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function bb(a){return Math.round(255*(.00304>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function cb(a,b,c){return new db(a,b,c)}function db(a,b,c){this.r=a,this.g=b,this.b=c}function eb(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function fb(a,b,c){var d,e,f,g=0,h=0,i=0;if(d=/([a-z]+)\((.*)\)/i.exec(a))switch(e=d[2].split(","),d[1]){case"hsl":return c(parseFloat(e[0]),parseFloat(e[1])/100,parseFloat(e[2])/100);case"rgb":return b(jb(e[0]),jb(e[1]),jb(e[2]))}return(f=Wg.get(a))?b(f.r,f.g,f.b):(null!=a&&"#"===a.charAt(0)&&(4===a.length?(g=a.charAt(1),g+=g,h=a.charAt(2),h+=h,i=a.charAt(3),i+=i):7===a.length&&(g=a.substring(1,3),h=a.substring(3,5),i=a.substring(5,7)),g=parseInt(g,16),h=parseInt(h,16),i=parseInt(i,16)),b(g,h,i))}function gb(a,b,c){var d,e,f=Math.min(a/=255,b/=255,c/=255),g=Math.max(a,b,c),h=g-f,i=(g+f)/2;return h?(e=.5>i?h/(g+f):h/(2-g-f),d=a==g?(b-c)/h+(c>b?6:0):b==g?(c-a)/h+2:(a-b)/h+4,d*=60):e=d=0,L(d,e,i)}function hb(a,b,c){a=ib(a),b=ib(b),c=ib(c);var d=ab((.4124564*a+.3575761*b+.1804375*c)/Rg),e=ab((.2126729*a+.7151522*b+.072175*c)/Sg),f=ab((.0193339*a+.119192*b+.9503041*c)/Tg);return X(116*e-16,500*(d-e),200*(e-f))}function ib(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function jb(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function kb(a){return"function"==typeof a?a:function(){return a}}function lb(a){return a}function mb(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function nb(a,b){function c(a,c,f){arguments.length<3&&(f=c,c=null);var g=jg.xhr(a,b,f);return g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c},g.row(c)}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(h).join(a)}function h(a){return i.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var i=new RegExp('["'+a+"\n]"),j=a.charCodeAt(0);return c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})},c.parseRows=function(a,b){function c(){if(k>=i)return g;if(e)return e=!1,f;var b=k;if(34===a.charCodeAt(b)){for(var c=b;c++k;){var d=a.charCodeAt(k++),h=1;if(10===d)e=!0;else if(13===d)e=!0,10===a.charCodeAt(k)&&(++k,++h);else if(d!==j)continue;return a.substring(b,k-h)}return a.substring(b)}for(var d,e,f={},g={},h=[],i=a.length,k=0,l=0;(d=c())!==g;){for(var m=[];d!==f&&d!==g;)m.push(d),d=c();(!b||(m=b(m,l++)))&&h.push(m)}return h},c.format=function(b){if(Array.isArray(b[0]))return c.formatRows(b);var d=new g,e=[];return b.forEach(function(a){for(var b in a)d.has(b)||e.push(d.add(b))}),[e.map(h).join(a)].concat(b.map(function(b){return e.map(function(a){return h(b[a])}).join(a)})).join("\n")},c.formatRows=function(a){return a.map(f).join("\n")},c}function ob(){for(var a,b=Date.now(),c=_g;c;)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=pb()-b;d>24?(isFinite(d)&&(clearTimeout(Yg),Yg=setTimeout(ob,d)),Xg=0):(Xg=1,ah(ob))}function pb(){for(var a=null,b=_g,c=1/0;b;)b.flush?(delete $g[b.callback.id],b=a?a.next=b.next:_g=b.next):(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function qb(a,b){var c=Math.pow(10,3*Math.abs(8-b));return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function rb(a,b){return b-(a?Math.ceil(Math.log(a)/Math.LN10):1)}function sb(a){return a+""}function tb(a,b){a&&kh.hasOwnProperty(a.type)&&kh[a.type](a,b)}function ub(a,b,c){var d,e=-1,f=a.length-c;for(b.lineStart();++ea&&(d=a),a>f&&(f=a),e>b&&(e=b),b>g&&(g=b)}function c(){h.point=h.lineEnd=E}var d,e,f,g,h={point:b,lineStart:E,lineEnd:E,polygonStart:function(){h.lineEnd=c},polygonEnd:function(){h.point=b}};return function(b){return g=f=-(d=e=1/0),jg.geo.stream(b,a(h)),[[d,e],[f,g]]}}function yb(a,b){if(!ph){++qh,a*=Ng;var c=Math.cos(b*=Ng);rh+=(c*Math.cos(a)-rh)/qh,sh+=(c*Math.sin(a)-sh)/qh,th+=(Math.sin(b)-th)/qh}}function zb(){var a,b;ph=1,Ab(),ph=2;var c=uh.point;uh.point=function(d,e){c(a=d,b=e)},uh.lineEnd=function(){uh.point(a,b),Bb(),uh.lineEnd=Bb}}function Ab(){function a(a,e){a*=Ng;var f=Math.cos(e*=Ng),g=f*Math.cos(a),h=f*Math.sin(a),i=Math.sin(e),j=Math.atan2(Math.sqrt((j=c*i-d*h)*j+(j=d*g-b*i)*j+(j=b*h-c*g)*j),b*g+c*h+d*i);qh+=j,rh+=j*(b+(b=g)),sh+=j*(c+(c=h)),th+=j*(d+(d=i))}var b,c,d;ph>1||(1>ph&&(ph=1,qh=rh=sh=th=0),uh.point=function(e,f){e*=Ng;var g=Math.cos(f*=Ng);b=g*Math.cos(e),c=g*Math.sin(e),d=Math.sin(f),uh.point=a})}function Bb(){uh.point=yb}function Cb(a){var b=a[0],c=a[1],d=Math.cos(c);return[d*Math.cos(b),d*Math.sin(b),Math.sin(c)]}function Db(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function Eb(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function Fb(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function Gb(a,b){return[a[0]*b,a[1]*b,a[2]*b]}function Hb(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);a[0]/=b,a[1]/=b,a[2]/=b}function Ib(){return!0}function Jb(a){return[Math.atan2(a[1],a[0]),Math.asin(Math.max(-1,Math.min(1,a[2])))]}function Kb(a,b){return Math.abs(a[0]-b[0])h;++h)e.point((c=a[h])[0],c[1]);return void e.lineEnd()}var i={point:c,points:a,other:null,visited:!1,entry:!0,subject:!0},j={point:c,points:[c],other:i,visited:!1,entry:!1,subject:!1};i.other=j,f.push(i),g.push(j),i={point:d,points:[d],other:null,visited:!1,entry:!1,subject:!0},j={point:d,points:[d],other:i,visited:!1,entry:!0,subject:!1},i.other=j,f.push(i),g.push(j)}}),g.sort(b),Mb(f),Mb(g),f.length){if(c)for(var h=1,i=!c(g[0].point),j=g.length;j>h;++h)g[h].entry=i=!i;for(var k,l,m,n=f[0];;){for(k=n;k.visited;)if((k=k.next)===n)return;l=k.points,e.lineStart();do{if(k.visited=k.other.visited=!0,k.entry){if(k.subject)for(var h=0;h=0;)e.point((m=l[h])[0],m[1])}else d(k.point,k.prev.point,-1,e);k=k.prev}k=k.other,l=k.points}while(!k.visited);e.lineEnd()}}}function Mb(a){if(b=a.length){for(var b,c,d=0,e=a[0];++d1&&2&b&&c.push(c.pop().concat(c.shift())),l.push(c.filter(Ob))}var l,m,n,o,p,q=b(d),r={point:e,lineStart:g,lineEnd:h,polygonStart:function(){r.point=i,r.lineStart=j,r.lineEnd=k,o=!1,n=m=0,l=[],d.polygonStart()},polygonEnd:function(){r.point=e,r.lineStart=g,r.lineEnd=h,l=jg.merge(l),l.length?Lb(l,Rb,null,c,d):(-Mg>m||o&&-Mg>n)&&(d.lineStart(),c(null,null,1,d),d.lineEnd()),d.polygonEnd(),l=null},sphere:function(){d.polygonStart(),d.lineStart(),c(null,null,1,d),d.lineEnd(),d.polygonEnd()}},s=Pb(),t=b(s);return r}}function Ob(a){return a.length>1}function Pb(){var a,b=[];return{lineStart:function(){b.push(a=[])},point:function(b,c){a.push([b,c])},lineEnd:E,buffer:function(){var c=b;return b=[],a=null,c},rejoin:function(){b.length>1&&b.push(b.pop().concat(b.shift()))}}}function Qb(a,b){if(!(c=a.length))return 0;for(var c,d,e,f=0,g=0,h=a[0],i=h[0],j=h[1],k=Math.cos(j),l=Math.atan2(b*Math.sin(i)*k,Math.sin(j)),m=1-b*Math.cos(i)*k,n=l;++f2&&(g+=4*(d-l)):g+=Math.abs(m-2)0?Lg:-Lg,i=Math.abs(f-c);Math.abs(i-Lg)0?Lg/2:-Lg/2),a.point(e,d),a.lineEnd(),a.lineStart(),a.point(h,d),a.point(f,d),b=0):e!==h&&i>=Lg&&(Math.abs(c-e)Mg?Math.atan((Math.sin(b)*(f=Math.cos(d))*Math.sin(c)-Math.sin(d)*(e=Math.cos(b))*Math.sin(a))/(e*f*g)):(b+d)/2}function Ub(a,b,c,d){var e;if(null==a)e=c*Lg/2,d.point(-Lg,e),d.point(0,e),d.point(Lg,e),d.point(Lg,0),d.point(Lg,-e),d.point(0,-e),d.point(-Lg,-e),d.point(-Lg,0),d.point(-Lg,e);else if(Math.abs(a[0]-b[0])>Mg){var f=(a[0]f}function c(a){var c,f,i,j,k;return{lineStart:function(){j=i=!1,k=1},point:function(l,m){var n,o=[l,m],p=b(l,m),q=g?p?0:e(l,m):p?e(l+(0>l?Lg:-Lg),m):0;if(!c&&(j=i=p)&&a.lineStart(),p!==i&&(n=d(c,o),(Kb(c,n)||Kb(o,n))&&(o[0]+=Mg,o[1]+=Mg,p=b(o[0],o[1]))),p!==i)k=0,p?(a.lineStart(),n=d(o,c),a.point(n[0],n[1])):(n=d(c,o),a.point(n[0],n[1]),a.lineEnd()),c=n;else if(h&&c&&g^p){var r;q&f||!(r=d(o,c,!0))||(k=0,g?(a.lineStart(),a.point(r[0][0],r[0][1]),a.point(r[1][0],r[1][1]),a.lineEnd()):(a.point(r[1][0],r[1][1]),a.lineEnd(),a.lineStart(),a.point(r[0][0],r[0][1])))}!p||c&&Kb(c,o)||a.point(o[0],o[1]),c=o,i=p,f=q},lineEnd:function(){i&&a.lineEnd(),c=null},clean:function(){return k|(j&&i)<<1}}}function d(a,b,c){var d=Cb(a),e=Cb(b),g=[1,0,0],h=Eb(d,e),i=Db(h,h),j=h[0],k=i-j*j;if(!k)return!c&&a;var l=f*i/k,m=-f*j/k,n=Eb(g,h),o=Gb(g,l),p=Gb(h,m);Fb(o,p);var q=n,r=Db(o,q),s=Db(q,q),t=r*r-s*(Db(o,o)-1);if(!(0>t)){var u=Math.sqrt(t),v=Gb(q,(-r-u)/s);if(Fb(v,o),v=Jb(v),!c)return v;var w,x=a[0],y=b[0],z=a[1],A=b[1];x>y&&(w=x,x=y,y=w);var B=y-x,C=Math.abs(B-Lg)B;if(!C&&z>A&&(w=z,z=A,A=w),D?C?z+A>0^v[1]<(Math.abs(v[0]-x)Lg^(x<=v[0]&&v[0]<=y)){var E=Gb(q,(-r+u)/s);return Fb(E,o),[v,Jb(E)]}}}function e(b,c){var d=g?a:Lg-a,e=0;return-d>b?e|=1:b>d&&(e|=2),-d>c?e|=4:c>d&&(e|=8),e}var f=Math.cos(a),g=f>0,h=Math.abs(f)>Mg,i=gc(a,6*Ng);return Nb(b,c,i)}function Wb(a,c,d,e){function f(b,e){return Math.abs(b[0]-a)0?0:3:Math.abs(b[0]-d)0?2:1:Math.abs(b[1]-c)0?1:0:e>0?3:2}function g(a,b){return h(a.point,b.point)}function h(a,b){var c=f(a,1),d=f(b,1);return c!==d?c-d:0===c?b[1]-a[1]:1===c?a[0]-b[0]:2===c?a[1]-b[1]:b[0]-a[0]}function i(b,f){var g=f[0]-b[0],h=f[1]-b[1],i=[0,1];return Math.abs(g)0&&(b[0]+=i[0]*g,b[1]+=i[0]*h),!0):!1}return function(j){function k(b){var g=f(b,-1),h=l([0===g||3===g?a:d,g>1?e:c]);return h}function l(a){for(var c=0,d=u.length,e=a[1],f=0;d>f;++f)for(var g=1,h=u[f],i=h.length,j=h[0];i>g;++g)b=h[g],j[1]<=e?b[1]>e&&m(j,b,a)>0&&++c:b[1]<=e&&m(j,b,a)<0&&--c,j=b;return 0!==c}function m(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])}function n(b,g,i,j){var k=0,l=0;if(null==b||(k=f(b,i))!==(l=f(g,i))||h(b,g)<0^i>0){do j.point(0===k||3===k?a:d,k>1?e:c);while((k=(k+i+4)%4)!==l)}else j.point(g[0],g[1])}function o(b,f){return b>=a&&d>=b&&f>=c&&e>=f}function p(a,b){o(a,b)&&j.point(a,b)}function q(){F.point=s,u&&u.push(v=[]),C=!0,B=!1,z=A=0/0}function r(){t&&(s(w,x),y&&B&&E.rejoin(),t.push(E.buffer())),F.point=p,B&&j.lineEnd()}function s(a,b){a=Math.max(-wh,Math.min(wh,a)),b=Math.max(-wh,Math.min(wh,b));var c=o(a,b);if(u&&v.push([a,b]),C)w=a,x=b,y=c,C=!1,c&&(j.lineStart(),j.point(a,b));else if(c&&B)j.point(a,b);else{var d=[z,A],e=[a,b];i(d,e)?(B||(j.lineStart(),j.point(d[0],d[1])),j.point(e[0],e[1]),c||j.lineEnd()):(j.lineStart(),j.point(a,b))}z=a,A=b,B=c}var t,u,v,w,x,y,z,A,B,C,D=j,E=Pb(),F={point:p,lineStart:q,lineEnd:r,polygonStart:function(){j=E,t=[],u=[]},polygonEnd:function(){j=D,(t=jg.merge(t)).length?(j.polygonStart(),Lb(t,g,k,n,j),j.polygonEnd()):l([a,c])&&(j.polygonStart(),j.lineStart(),n(null,null,1,j),j.lineEnd(),j.polygonEnd()),t=u=v=null}};return F}}function Xb(a,b,c){if(Math.abs(b)=a;var d=a/b;if(b>0){if(d>c[1])return!1;d>c[0]&&(c[0]=d)}else{if(d4*d&&p--){var u=g+m,v=h+n,w=i+o,x=Math.sqrt(u*u+v*v+w*w),y=Math.asin(w/=x),z=Math.abs(Math.abs(w)-1)d||Math.abs((r*D+s*E)/t-.5)>.3)&&(c(b,e,f,g,h,i,B,C,z,u/=x,v/=x,w,p,q),q.point(B,C),c(B,C,z,u,v,w,j,k,l,m,n,o,p,q))}}var d=.5,e=16;return b.precision=function(a){return arguments.length?(e=(d=a*a)>0&&16,b):Math.sqrt(d)},b}function $b(a){return _b(function(){return a})()}function _b(a){function b(a){return a=g(a[0]*Ng,a[1]*Ng),[a[0]*k+h,i-a[1]*k]}function c(a){return a=g.invert((a[0]-h)/k,(i-a[1])/k),a&&[a[0]*Og,a[1]*Og]}function d(){g=Yb(f=cc(p,q,r),e);var a=e(n,o);return h=l-a[0]*k,i=m+a[1]*k,b}var e,f,g,h,i,j=Zb(function(a,b){return a=e(a,b),[a[0]*k+h,i-a[1]*k]}),k=150,l=480,m=250,n=0,o=0,p=0,q=0,r=0,s=vh,t=lb,u=null,v=null;return b.stream=function(a){return ac(f,s(j(t(a))))},b.clipAngle=function(a){return arguments.length?(s=null==a?(u=a,vh):Vb((u=+a)*Ng),b):u},b.clipExtent=function(a){return arguments.length?(v=a,t=null==a?lb:Wb(a[0][0],a[0][1],a[1][0],a[1][1]),b):v},b.scale=function(a){return arguments.length?(k=+a,d()):k},b.translate=function(a){return arguments.length?(l=+a[0],m=+a[1],d()):[l,m]},b.center=function(a){return arguments.length?(n=a[0]%360*Ng,o=a[1]%360*Ng,d()):[n*Og,o*Og]},b.rotate=function(a){return arguments.length?(p=a[0]%360*Ng,q=a[1]%360*Ng,r=a.length>2?a[2]%360*Ng:0,d()):[p*Og,q*Og,r*Og]},jg.rebind(b,j,"precision"),function(){return e=a.apply(this,arguments),b.invert=e.invert&&c,d()}}function ac(a,b){return{point:function(c,d){d=a(c*Ng,d*Ng),c=d[0],b.point(c>Lg?c-2*Lg:-Lg>c?c+2*Lg:c,d[1])},sphere:function(){b.sphere()},lineStart:function(){b.lineStart()},lineEnd:function(){b.lineEnd()},polygonStart:function(){b.polygonStart()},polygonEnd:function(){b.polygonEnd()}}}function bc(a,b){return[a,b]}function cc(a,b,c){return a?b||c?Yb(ec(a),fc(b,c)):ec(a):b||c?fc(b,c):bc}function dc(a){return function(b,c){return b+=a,[b>Lg?b-2*Lg:-Lg>b?b+2*Lg:b,c]}}function ec(a){var b=dc(a);return b.invert=dc(-a),b}function fc(a,b){function c(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*d+h*e;return[Math.atan2(i*f-k*g,h*d-j*e),Math.asin(Math.max(-1,Math.min(1,k*f+i*g)))]}var d=Math.cos(a),e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);return c.invert=function(a,b){var c=Math.cos(b),h=Math.cos(a)*c,i=Math.sin(a)*c,j=Math.sin(b),k=j*f-i*g;return[Math.atan2(i*f+j*g,h*d+k*e),Math.asin(Math.max(-1,Math.min(1,k*d-h*e)))]},c}function gc(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){null!=e?(e=hc(c,e),f=hc(c,f),(g>0?f>e:e>f)&&(e+=2*g*Lg)):(e=a+2*g*Lg,f=a);for(var i,j=g*b,k=e;g>0?k>f:f>k;k-=j)h.point((i=Jb([c,-d*Math.cos(k),-d*Math.sin(k)]))[0],i[1])}}function hc(a,b){var c=Cb(b);c[0]-=a,Hb(c);var d=P(-c[1]);return((-c[2]<0?-d:d)+2*Math.PI-Mg)%(2*Math.PI)}function ic(a,b,c){var d=jg.range(a,b-Mg,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function jc(a,b,c){var d=jg.range(a,b-Mg,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function kc(a){return a.source}function lc(a){return a.target}function mc(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),i=e*Math.cos(a),j=e*Math.sin(a),k=g*Math.cos(c),l=g*Math.sin(c),m=2*Math.asin(Math.sqrt(T(d-b)+e*g*T(c-a))),n=1/Math.sin(m),o=m?function(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,d=c*i+b*k,e=c*j+b*l,g=c*f+b*h;return[Math.atan2(e,d)*Og,Math.atan2(g,Math.sqrt(d*d+e*e))*Og]}:function(){return[a*Og,b*Og]};return o.distance=m,o}function nc(){function a(a,e){var f=Math.sin(e*=Ng),g=Math.cos(e),h=Math.abs((a*=Ng)-b),i=Math.cos(h);xh+=Math.atan2(Math.sqrt((h=g*Math.sin(h))*h+(h=d*f-c*g*i)*h),c*f+d*g*i),b=a,c=f,d=g}var b,c,d;yh.point=function(e,f){b=e*Ng,c=Math.sin(f*=Ng),d=Math.cos(f),yh.point=a},yh.lineEnd=function(){yh.point=yh.lineEnd=E}}function oc(a){var b=0,c=Lg/3,d=_b(a),e=d(b,c);return e.parallels=function(a){return arguments.length?d(b=a[0]*Lg/180,c=a[1]*Lg/180):[b/Lg*180,c/Lg*180]},e}function pc(a,b){function c(a,b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;return c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,Math.asin((f-(a*a+c*c)*e*e)/(2*e))]},c}function qc(a,b){var c=a(b[0]),d=a([.5*(b[0][0]+b[1][0]),b[0][1]]),e=a([b[1][0],b[0][1]]),f=a(b[1]),g=d[1]-c[1],h=d[0]-c[0],i=e[1]-d[1],j=e[0]-d[0],k=g/h,l=i/j,m=.5*(k*l*(c[1]-e[1])+l*(c[0]+d[0])-k*(d[0]+e[0]))/(l-k),n=(.5*(c[0]+d[0])-m)/k+.5*(c[1]+d[1]),o=f[0]-m,p=f[1]-n,q=c[0]-m,r=c[1]-n,s=o*o+p*p,t=q*q+r*r,u=Math.atan2(p,o),v=Math.atan2(r,q);return function(b){var c=b[0]-m,d=b[1]-n,e=c*c+d*d,f=Math.atan2(d,c);return e>s&&t>e&&f>u&&v>f?a.invert(b):void 0}}function rc(){function a(a,b){Ah+=e*a-d*b,d=a,e=b}var b,c,d,e;Bh.point=function(f,g){Bh.point=a,b=d=f,c=e=g},Bh.lineEnd=function(){a(b,c)}}function sc(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b),h.point=c}function c(a,b){g.push("L",a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=yc(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d,h.point=a},pointRadius:function(a){return f=yc(a),h},result:function(){if(g.length){var a=g.join("");return g=[],a}}};return h}function tc(a,b){ph||(rh+=a,sh+=b,++th)}function uc(){function a(a,d){var e=a-b,f=d-c,g=Math.sqrt(e*e+f*f);rh+=g*(b+a)/2,sh+=g*(c+d)/2,th+=g,b=a,c=d}var b,c;if(1!==ph){if(!(1>ph))return;ph=1,rh=sh=th=0}Ch.point=function(d,e){Ch.point=a,b=d,c=e}}function vc(){Ch.point=tc}function wc(){function a(a,b){var c=e*a-d*b;rh+=c*(d+a),sh+=c*(e+b),th+=3*c,d=a,e=b}var b,c,d,e;2>ph&&(ph=2,rh=sh=th=0),Ch.point=function(f,g){Ch.point=a,b=d=f,c=e=g},Ch.lineEnd=function(){a(b,c)}}function xc(a){function b(b,c){a.moveTo(b,c),a.arc(b,c,g,0,2*Lg)}function c(b,c){a.moveTo(b,c),h.point=d}function d(b,c){a.lineTo(b,c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e,h.point=b},pointRadius:function(a){return g=a,h},result:E};return h}function yc(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function zc(a){var b=Zb(function(b,c){return a([b*Og,c*Og])});return function(a){return a=b(a),{point:function(b,c){a.point(b*Ng,c*Ng)},sphere:function(){a.sphere()},lineStart:function(){a.lineStart()},lineEnd:function(){a.lineEnd()},polygonStart:function(){a.polygonStart()},polygonEnd:function(){a.polygonEnd()}}}}function Ac(a,b){function c(b,c){var d=Math.cos(b),e=Math.cos(c),f=a(d*e);return[f*e*Math.sin(b),f*Math.sin(c)]}return c.invert=function(a,c){var d=Math.sqrt(a*a+c*c),e=b(d),f=Math.sin(e),g=Math.cos(e);return[Math.atan2(a*f,d*g),Math.asin(d&&c*f/d)]},c}function Bc(a,b){function c(a,b){var c=Math.abs(Math.abs(b)-Lg/2)1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j9&&(e=3*b/Math.sqrt(e),g[h]=e*c,g[h+1]=e*d)); for(h=-1;++h<=i;)e=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),f.push([e||0,g[h]*e||0]);return f}function _c(a){return a.length<3?Jc(a):a[0]+Qc(a,$c(a))}function ad(a,b,c,d){var e,f,g,h,i,j,k;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1],(k-g)*(h-f)-(i-g)*(j-f)>0}function bd(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function cd(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f,i=a[1],j=c[1],k=b[1]-i,l=d[1]-j,m=(h*(i-j)-l*(e-f))/(l*g-h*k);return[e+m*g,i+m*k]}function dd(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.yb.y?1:a.xb.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));return b=b.l},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return null==a.edge?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return null==a.edge?c.bottomSite:a.edge.region[Mh[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;return c.c=a.x*d+a.y*e+.5*(d*d+e*e),f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f,g,h=(c.c*d.b-d.c*c.b)/e,i=(d.c*c.a-c.c*d.a)/e,j=c.region.r,k=d.region.r;j.y=g.region.r.x;return l&&"l"===f.side||!l&&"r"===f.side?null:{x:h,y:i}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&"l"===a.side)return 1;if(!e&&"r"===a.side)return 0;if(1===c.a){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;if(!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1)),!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)m*m+n*n}return"l"===a.side?i:!i},endPoint:function(a,c,d){a.ep[c]=d,a.ep[Mh[c]]&&b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;g>d;d++){var h=e[d];if(!(a.ystar>h.ystar||a.ystar==h.ystar&&b.x>h.vertex.x))break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;d>b&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return 0===f.list.length},nextEvent:function(a){for(var b=0,c=f.list,d=c.length;d>b;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=f.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return f.list.shift()}};d.init(),c.bottomSite=c.list.shift();for(var g,h,i,j,k,l,m,n,o,p,q,r,s,t=c.list.shift();;)if(f.empty()||(g=f.min()),t&&(f.empty()||t.yn.y&&(o=m,m=n,n=o,s="r"),r=e.bisect(m,n),l=d.createHalfEdge(r,s),d.insert(j,l),e.endPoint(r,Mh[s],q),p=e.intersect(j,l),p&&(f.del(j),f.insert(j,p,e.distance(p,m))),p=e.intersect(l,k),p&&f.insert(l,p,e.distance(p,m))}for(h=d.right(d.leftEnd);h!=d.rightEnd;h=d.right(h))b(h.edge)}function ed(a){return a.x}function fd(a){return a.y}function gd(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function hd(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f),i=b.nodes;i[0]&&hd(a,i[0],c,d,g,h),i[1]&&hd(a,i[1],g,d,e,h),i[2]&&hd(a,i[2],c,h,g,f),i[3]&&hd(a,i[3],g,h,e,f)}}function id(a,b){a=jg.rgb(a),b=jg.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+eb(Math.round(c+f*a))+eb(Math.round(d+g*a))+eb(Math.round(e+h*a))}}function jd(a){var b=[a.a,a.b],c=[a.c,a.d],d=ld(b),e=kd(b,c),f=ld(md(c,b,-e))||0;b[0]*c[1]180?k+=360:k-j>180&&(j+=360),e.push({i:d.push(d.pop()+"rotate(",null,")")-2,x:nd(j,k)})):k&&d.push(d.pop()+"rotate("+k+")"),l!=m?e.push({i:d.push(d.pop()+"skewX(",null,")")-2,x:nd(l,m)}):m&&d.push(d.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(c=d.push(d.pop()+"scale(",null,",",null,")"),e.push({i:c-4,x:nd(n[0],o[0])},{i:c-2,x:nd(n[1],o[1])})):(1!=o[0]||1!=o[1])&&d.push(d.pop()+"scale("+o+")"),c=e.length,function(a){for(var b,f=-1;++fd;++d)if(g=k[d],g.x==c[0]){if(g.i)if(null==j[g.i+1])for(j[g.i-1]+=g.x,j.splice(g.i,1),e=d+1;f>e;++e)k[e].i--;else for(j[g.i-1]+=g.x+j[g.i+1],j.splice(g.i,2),e=d+1;f>e;++e)k[e].i-=2;else if(null==j[g.i+1])j[g.i]=g.x;else for(j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1),e=d+1;f>e;++e)k[e].i--;k.splice(d,1),f--,d--}else g.x=nd(parseFloat(c[0]),parseFloat(g.x));for(;f>d;)g=k.pop(),null==j[g.i+1]?j[g.i]=g.x:(j[g.i]=g.x+j[g.i+1],j.splice(g.i+1,1)),f--;return 1===j.length?null==j[0]?k[0].x:function(){return b}:function(a){for(d=0;f>d;++d)j[(g=k[d]).i]=g.x(a);return j.join("")}}function rd(a,b){for(var c,d=jg.interpolators.length;--d>=0&&!(c=jg.interpolators[d](a,b)););return c}function sd(a){return"transform"==a?od:rd}function td(a,b){var c,d=[],e=[],f=a.length,g=b.length,h=Math.min(a.length,b.length);for(c=0;h>c;++c)d.push(rd(a[c],b[c]));for(;f>c;++c)e[c]=a[c];for(;g>c;++c)e[c]=b[c];return function(a){for(c=0;h>c;++c)e[c]=d[c](a);return e}}function ud(a){return function(b){return 0>=b?0:b>=1?1:a(b)}}function vd(a){return function(b){return 1-a(1-b)}}function wd(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function xd(a){return a*a}function yd(a){return a*a*a}function zd(a){if(0>=a)return 0;if(a>=1)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function Ad(a){return function(b){return Math.pow(b,a)}}function Bd(a){return 1-Math.cos(a*Lg/2)}function Cd(a){return Math.pow(2,10*(a-1))}function Dd(a){return 1-Math.sqrt(1-a*a)}function Ed(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/(2*Lg)*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin(2*(d-c)*Lg/b)}}function Fd(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function Gd(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Hd(a,b){a=jg.hcl(a),b=jg.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return f>180?f-=360:-180>f&&(f+=360),function(a){return W(c+f*a,d+g*a,e+h*a)+""}}function Id(a,b){a=jg.hsl(a),b=jg.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return f>180?f-=360:-180>f&&(f+=360),function(a){return N(c+f*a,d+g*a,e+h*a)+""}}function Jd(a,b){a=jg.lab(a),b=jg.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return Z(c+f*a,d+g*a,e+h*a)+""}}function Kd(a,b){return b-=a,function(c){return Math.round(a+b*c)}}function Ld(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function Md(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function Nd(a){for(var b=a.source,c=a.target,d=Pd(b,c),e=[b];b!==d;)b=b.parent,e.push(b);for(var f=e.length;c!==d;)e.splice(f,0,c),c=c.parent;return e}function Od(a){for(var b=[],c=a.parent;null!=c;)b.push(a),a=c,c=c.parent;return b.push(a),b}function Pd(a,b){if(a===b)return a;for(var c=Od(a),d=Od(b),e=c.pop(),f=d.pop(),g=null;e===f;)g=e,e=c.pop(),f=d.pop();return g}function Qd(a){a.fixed|=2}function Rd(a){a.fixed&=-7}function Sd(a){a.fixed|=4,a.px=a.x,a.py=a.y}function Td(a){a.fixed&=-5}function Ud(a,b,c){var d=0,e=0;if(a.charge=0,!a.leaf)for(var f,g=a.nodes,h=g.length,i=-1;++ic;++c)(b=a[c][1])>e&&(d=c,e=b);return d}function ee(a){return a.reduce(fe,0)}function fe(a,b){return a+b[1]}function ge(a,b){return he(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function he(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function ie(a){return[jg.min(a),jg.max(a)]}function je(a,b){return a.parent==b.parent?1:2}function ke(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function le(a){var b,c=a.children;return c&&(b=c.length)?c[b-1]:a._tree.thread}function me(a,b){var c=a.children;if(c&&(e=c.length))for(var d,e,f=-1;++f0&&(a=d);return a}function ne(a,b){return a.x-b.x}function oe(a,b){return b.x-a.x}function pe(a,b){return a.depth-b.depth}function qe(a,b){function c(a,d){var e=a.children;if(e&&(g=e.length))for(var f,g,h=null,i=-1;++i=0;)b=e[f]._tree,b.prelim+=c,b.mod+=c,c+=b.shift+(d+=b.change)}function se(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function te(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function ue(a,b){return a.value-b.value}function ve(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function we(a,b){a._pack_next=b,b._pack_prev=a}function xe(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return e*e-c*c-d*d>.001}function ye(a){function b(a){k=Math.min(a.x-a.r,k),l=Math.max(a.x+a.r,l),m=Math.min(a.y-a.r,m),n=Math.max(a.y+a.r,n)}if((c=a.children)&&(j=c.length)){var c,d,e,f,g,h,i,j,k=1/0,l=-1/0,m=1/0,n=-1/0;if(c.forEach(ze),d=c[0],d.x=-d.r,d.y=0,b(d),j>1&&(e=c[1],e.x=e.r,e.y=0,b(e),j>2))for(f=c[2],Ce(d,e,f),b(f),ve(d,f),d._pack_prev=f,ve(f,e),e=d._pack_next,g=3;j>g;g++){Ce(d,e,f=c[g]);var o=0,p=1,q=1;for(h=e._pack_next;h!==e;h=h._pack_next,p++)if(xe(h,f)){o=1;break}if(1==o)for(i=d._pack_prev;i!==h._pack_prev&&!xe(i,f);i=i._pack_prev,q++);o?(q>p||p==q&&e.rg;g++)f=c[g],f.x-=r,f.y-=s,t=Math.max(t,f.r+Math.sqrt(f.x*f.x+f.y*f.y));a.r=t,c.forEach(Ae)}}function ze(a){a._pack_next=a._pack_prev=a}function Ae(a){delete a._pack_next,delete a._pack_prev}function Be(a,b,c,d){var e=a.children;if(a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d,e)for(var f=-1,g=e.length;++fe&&(c+=e/2,e=0),0>f&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function Je(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function Ke(a){return a.rangeExtent?a.rangeExtent():Je(a.range())}function Le(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function Me(a,b){var c,d=0,e=a.length-1,f=a[d],g=a[e];return f>g&&(c=d,d=e,e=c,c=f,f=g,g=c),(b=b(g-f))&&(a[d]=b.floor(f),a[e]=b.ceil(g)),a}function Ne(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;for(a[h]2?Ne:Le,i=d?Md:Ld;return g=e(a,b,i,c),h=e(b,a,i,rd),f}function f(a){return g(a)}var g,h;return f.invert=function(a){return h(a)},f.domain=function(b){return arguments.length?(a=b.map(Number),e()):a},f.range=function(a){return arguments.length?(b=a,e()):b},f.rangeRound=function(a){return f.range(a).interpolate(Kd)},f.clamp=function(a){return arguments.length?(d=a,e()):d},f.interpolate=function(a){return arguments.length?(c=a,e()):c},f.ticks=function(b){return Se(a,b)},f.tickFormat=function(b,c){return Te(a,b,c)},f.nice=function(){return Me(a,Qe),e()},f.copy=function(){return Oe(a,b,c,d)},e()}function Pe(a,b){return jg.rebind(a,b,"range","rangeRound","interpolate","clamp")}function Qe(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),a&&{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function Re(a,b){var c=Je(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return.15>=f?e*=10:.35>=f?e*=5:.75>=f&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+.5*e,c[2]=e,c}function Se(a,b){return jg.range.apply(jg,Re(a,b))}function Te(a,b,c){var d=-Math.floor(Math.log(Re(a,b)[2])/Math.LN10+.01);return jg.format(c?c.replace(fh,function(a,b,c,e,f,g,h,i,j,k){return[b,c,e,f,g,h,i,j||"."+(d-2*("%"===k)),k].join("")}):",."+d+"f")}function Ue(a,b,c,d){function e(b){return a(c(b))}return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(b[0]<0?(c=Xe,d=Ye):(c=Ve,d=We),a.domain(b.map(c)),e):a.domain().map(d)},e.base=function(a){return arguments.length?(b=+a,e):b},e.nice=function(){return a.domain(Me(a.domain(),Ze(b))),e},e.ticks=function(){var e=Je(a.domain()),f=[];if(e.every(isFinite)){var g=Math.log(b),h=Math.floor(e[0]/g),i=Math.ceil(e[1]/g),j=d(e[0]),k=d(e[1]),l=b%1?2:b;if(c===Xe)for(f.push(-Math.pow(b,-h));h++0;m--)f.push(-Math.pow(b,-h)*m);else{for(;i>h;h++)for(var m=1;l>m;m++)f.push(Math.pow(b,h)*m);f.push(Math.pow(b,h))}for(h=0;f[h]k;i--);f=f.slice(h,i)}return f},e.tickFormat=function(a,f){if(arguments.length<2&&(f=Xh),!arguments.length)return f;var g,h=Math.log(b),i=Math.max(.1,a/e.ticks().length),j=c===Xe?(g=-1e-12,Math.floor):(g=1e-12,Math.ceil);return function(a){return a/d(h*j(c(a)/h+g))<=i?f(a):""}},e.copy=function(){return Ue(a.copy(),b,c,d)},Pe(e,a)}function Ve(a){return Math.log(0>a?0:a)}function We(a){return Math.exp(a)}function Xe(a){return-Math.log(a>0?0:-a)}function Ye(a){return-Math.exp(-a)}function Ze(a){a=Math.log(a);var b={floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}};return function(){return b}}function $e(a,b){function c(b){return a(d(b))}var d=_e(b),e=_e(1/b);return c.invert=function(b){return e(a.invert(b))},c.domain=function(b){return arguments.length?(a.domain(b.map(d)),c):a.domain().map(e)},c.ticks=function(a){return Se(c.domain(),a)},c.tickFormat=function(a,b){return Te(c.domain(),a,b)},c.nice=function(){return c.domain(Me(c.domain(),Qe))},c.exponent=function(a){if(!arguments.length)return b;var f=c.domain();return d=_e(b=a),e=_e(1/b),c.domain(f)},c.copy=function(){return $e(a.copy(),b)},Pe(c,a)}function _e(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function af(a,b){function c(b){return g[((e.get(b)||e.set(b,a.push(b)))-1)%g.length]}function d(b,c){return jg.range(a.length).map(function(a){return b+c*a})}var e,g,h;return c.domain=function(d){if(!arguments.length)return a;a=[],e=new f;for(var g,h=-1,i=d.length;++hc?j():(e.active=c,m.start.call(a,k,b),g.tween.forEach(function(c,d){(d=d.call(a,k,b))&&p.push(d)}),i(d)||jg.timer(i,0,h),1)}function i(d){if(e.active!==c)return j();for(var f=(d-n)/o,g=l(f),h=p.length;h>0;)p[--h].call(a,g);return f>=1?(j(),m.end.call(a,k,b),1):void 0}function j(){return--e.count?delete e[c]:delete a.__transition__,1}var k=a.__data__,l=g.ease,m=g.event,n=g.delay,o=g.duration,p=[];return d>=n?f(d):jg.timer(f,n,h),1},0,h),g}}function wf(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function xf(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function yf(a,b,c){if(d=[],c&&b.length>1){for(var d,e,f,g=Je(a.domain()),h=-1,i=b.length,j=(b[1]-b[0])/++c;++h0;)(f=+b[h]-e*j)>=g[0]&&d.push(f);for(--h,e=0;++e1?Date.UTC.apply(this,arguments):arguments[0])}function Af(a,b,c){function d(b){var c=a(b),d=f(c,1);return d-b>b-c?c:d}function e(c){return b(c=a(new ni(c-1)),1),c}function f(a,c){return b(a=new ni(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)for(;d>g;)c(g)%f||h.push(new Date(+g)),b(g,1);else for(;d>g;)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{ni=zf;var d=new zf;return d._=a,g(d,b,c)}finally{ni=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=Bf(a);return i.floor=i,i.round=Bf(d),i.ceil=Bf(e),i.offset=Bf(f),i.range=h,a}function Bf(a){return function(b,c){try{ni=zf;var d=new zf;return d._=b,a(d,c)._}finally{ni=Date}}}function Cf(a,b,c,d){for(var e,f,g=0,h=b.length,i=c.length;h>g;){if(d>=i)return-1;if(e=b.charCodeAt(g++),37===e){if(f=Fi[b.charAt(g++)],!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function Df(a){return new RegExp("^(?:"+a.map(jg.requote).join("|")+")","i")}function Ef(a){for(var b=new f,c=-1,d=a.length;++cd?new Array(c-d+1).join(b)+a:a}function Gf(a,b,c){yi.lastIndex=0;var d=yi.exec(b.substring(c));return d?c+=d[0].length:-1}function Hf(a,b,c){xi.lastIndex=0;var d=xi.exec(b.substring(c));return d?c+=d[0].length:-1}function If(a,b,c){Bi.lastIndex=0;var d=Bi.exec(b.substring(c));return d?(a.m=Ci.get(d[0].toLowerCase()),c+=d[0].length):-1}function Jf(a,b,c){zi.lastIndex=0;var d=zi.exec(b.substring(c));return d?(a.m=Ai.get(d[0].toLowerCase()),c+=d[0].length):-1}function Kf(a,b,c){return Cf(a,Ei.c.toString(),b,c)}function Lf(a,b,c){return Cf(a,Ei.x.toString(),b,c)}function Mf(a,b,c){return Cf(a,Ei.X.toString(),b,c)}function Nf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+=d[0].length):-1}function Of(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.y=Pf(+d[0]),c+=d[0].length):-1}function Pf(a){return a+(a>68?1900:2e3)}function Qf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+=d[0].length):-1}function Rf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+=d[0].length):-1}function Sf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+=d[0].length):-1}function Tf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+=d[0].length):-1}function Uf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+=d[0].length):-1}function Vf(a,b,c){Gi.lastIndex=0;var d=Gi.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+=d[0].length):-1}function Wf(a,b,c){var d=Hi.get(b.substring(c,c+=2).toLowerCase());return null==d?-1:(a.p=d,c)}function Xf(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(Math.abs(b)/60),e=Math.abs(b)%60;return c+Ff(d,"0",2)+Ff(e,"0",2)}function Yf(a){return a.toISOString()}function Zf(a,b,c){function d(b){return a(b)}return d.invert=function(b){return _f(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(_f)},d.nice=function(a){return d.domain(Me(d.domain(),function(){return a}))},d.ticks=function(c,e){var f=$f(d.domain());if("function"!=typeof c){var g=f[1]-f[0],h=g/c,i=jg.bisect(Ji,h);if(i==Ji.length)return b.year(f,c);if(!i)return a.ticks(c).map(_f);Math.log(h/Ji[i-1])b?[b,c]:[c,b]}function _f(a){return new Date(a)}function ag(a){return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}function bg(a){var b=new Date(a,0,1);return b.setFullYear(a),b}function cg(a){var b=a.getFullYear(),c=bg(b),d=bg(b+1);return b+(a-c)/(d-c)}function dg(a){var b=new Date(Date.UTC(a,0,1));return b.setUTCFullYear(a),b}function eg(a){var b=a.getUTCFullYear(),c=dg(b),d=dg(b+1);return b+(a-c)/(d-c)}function fg(a){return a.responseText}function gg(a){return JSON.parse(a.responseText)}function hg(a){var b=kg.createRange();return b.selectNode(kg.body),b.createContextualFragment(a.responseText)}function ig(a){return a.responseXML}var jg={version:"3.1.5"};Date.now||(Date.now=function(){return+new Date});var kg=document,lg=window;try{kg.createElement("div").style.setProperty("opacity",0,"")}catch(mg){var ng=lg.CSSStyleDeclaration.prototype,og=ng.setProperty;ng.setProperty=function(a,b,c){og.call(this,a,b+"",c)}}jg.ascending=function(a,b){return b>a?-1:a>b?1:a>=b?0:0/0},jg.descending=function(a,b){return a>b?-1:b>a?1:b>=a?0:0/0},jg.min=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++ed&&(c=d)}else{for(;++ed&&(c=d)}return c},jg.max=function(a,b){var c,d,e=-1,f=a.length;if(1===arguments.length){for(;++ec&&(c=d)}else{for(;++ec&&(c=d)}return c},jg.extent=function(a,b){var c,d,e,f=-1,g=a.length;if(1===arguments.length){for(;++fd&&(c=d),d>e&&(e=d))}else{for(;++fd&&(c=d),d>e&&(e=d))}return[c,e]},jg.sum=function(a,b){var c,d=0,e=a.length,f=-1;if(1===arguments.length)for(;++f1&&(b=b.map(c)),b=b.filter(a),b.length?jg.quantile(b.sort(jg.ascending),.5):void 0},jg.bisector=function(a){return{left:function(b,c,d,e){for(arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);e>d;){var f=d+e>>>1;a.call(b,b[f],f)d;){var f=d+e>>>1;cc)for(;(e=a+c*++h)>b;)f.push(e/g);else for(;(e=a+c*++h)=g.length)return d?d.call(e,h):c?h.sort(c):h;for(var j,k,l,m,n=-1,o=h.length,p=g[i++],q=new f;++n=g.length)return a;var d=[],e=h[c++];return a.forEach(function(a,e){d.push({key:a,values:b(e,c)})}),e?d.sort(function(a,b){return e(a.key,b.key)}):d}var c,d,e={},g=[],h=[];return e.map=function(b,c){return a(c,b,0)},e.entries=function(c){return b(a(jg.map,c,0),0)},e.key=function(a){return g.push(a),e},e.sortKeys=function(a){return h[g.length-1]=a,e},e.sortValues=function(a){return c=a,e},e.rollup=function(a){return d=a,e},e},jg.set=function(a){var b=new g;if(a)for(var c=0;c=0&&(d=a.substring(c+1),a=a.substring(0,c)),a)return arguments.length<2?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)this.hasOwnProperty(a)&&this[a].on(d,null);return this}},jg.event=null,jg.mouse=function(a){return o(a,l())};var sg=/WebKit/.test(lg.navigator.userAgent)?-1:0,tg=q;try{tg(kg.documentElement.childNodes)[0].nodeType}catch(ug){tg=p}var vg=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};jg.touches=function(a,b){return arguments.length<2&&(b=l().touches),b?tg(b).map(function(b){var c=o(a,b);return c.identifier=b.identifier,c}):[]},jg.behavior.drag=function(){function a(){this.on("mousedown.drag",b).on("touchstart.drag",b)}function b(){function a(){var a=g.parentNode;return null!=j?jg.touches(a).filter(function(a){return a.identifier===j})[0]:jg.mouse(a)}function b(){if(!g.parentNode)return e();var b=a(),c=b[0]-l[0],d=b[1]-l[1];n|=c|d,l=b,k(),h({type:"drag",x:b[0]+f[0],y:b[1]+f[1],dx:c,dy:d})}function e(){h({type:"dragend"}),n&&(k(),jg.event.target===i&&m(o,"click")),o.on(null!=j?"touchmove.drag-"+j:"mousemove.drag",null).on(null!=j?"touchend.drag-"+j:"mouseup.drag",null)}var f,g=this,h=c.of(g,arguments),i=jg.event.target,j=jg.event.touches?jg.event.changedTouches[0].identifier:null,l=a(),n=0,o=jg.select(lg).on(null!=j?"touchmove.drag-"+j:"mousemove.drag",b).on(null!=j?"touchend.drag-"+j:"mouseup.drag",e,!0);d?(f=d.apply(g,arguments),f=[f.x-l[0],f.y-l[1]]):f=[0,0],null==j&&k(),h({type:"dragstart"})}var c=n(a,"drag","dragstart","dragend"),d=null;return a.origin=function(b){return arguments.length?(d=b,a):d},jg.rebind(a,c,"on")};var wg=function(a,b){return b.querySelector(a)},xg=function(a,b){return b.querySelectorAll(a)},yg=kg.documentElement,zg=yg.matchesSelector||yg.webkitMatchesSelector||yg.mozMatchesSelector||yg.msMatchesSelector||yg.oMatchesSelector,Ag=function(a,b){return zg.call(a,b)};"function"==typeof Sizzle&&(wg=function(a,b){return Sizzle(a,b)[0]||null},xg=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},Ag=Sizzle.matchesSelector);var Bg=[];jg.selection=function(){return Gg},jg.selection.prototype=Bg,Bg.select=function(a){var b,c,d,e,f=[];"function"!=typeof a&&(a=s(a));for(var g=-1,h=this.length;++g=0&&(c=a.substring(0,b),a=a.substring(b+1)),Cg.hasOwnProperty(c)?{space:Cg[c],local:a}:a}},Bg.attr=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node();return a=jg.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(u(b,a[b]));return this}return this.each(u(a,b))},jg.requote=function(a){return a.replace(Dg,"\\$&")};var Dg=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Bg.classed=function(a,b){if(arguments.length<2){if("string"==typeof a){var c=this.node(),d=(a=a.trim().split(/^|\s+/g)).length,e=-1;if(b=c.classList){for(;++ed){if("string"!=typeof a){2>d&&(b="");for(c in a)this.each(z(c,a[c],b));return this}if(2>d)return lg.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(z(a,b,c))},Bg.property=function(a,b){if(arguments.length<2){if("string"==typeof a)return this.node()[a];for(b in a)this.each(A(b,a[b]));return this}return this.each(A(a,b))},Bg.text=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent=""}:function(){this.textContent=a}):this.node().textContent},Bg.html=function(a){return arguments.length?this.each("function"==typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML},Bg.append=function(a){function b(){return this.appendChild(kg.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(kg.createElementNS(a.space,a.local))}return a=jg.ns.qualify(a),this.select(a.local?c:b)},Bg.insert=function(a,b){function c(c,d){return this.insertBefore(kg.createElementNS(this.namespaceURI,a),b.call(this,c,d))}function d(c,d){return this.insertBefore(kg.createElementNS(a.space,a.local),b.call(this,c,d))}return a=jg.ns.qualify(a),"function"!=typeof b&&(b=s(b)),this.select(a.local?d:c)},Bg.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},Bg.data=function(a,b){function c(a,c){var d,e,g,h=a.length,l=c.length,m=Math.min(h,l),n=new Array(l),o=new Array(l),p=new Array(h);if(b){var q,r=new f,s=new f,t=[];for(d=-1;++dd;++d)o[d]=B(c[d]);for(;h>d;++d)p[d]=a[d]}o.update=n,o.parentNode=n.parentNode=p.parentNode=a.parentNode,i.push(o),j.push(n),k.push(p)}var d,e,g=-1,h=this.length;if(!arguments.length){for(a=new Array(h=(d=this[0]).length);++gf;f++){e.push(b=[]),b.parentNode=(c=this[f]).parentNode;for(var h=0,i=c.length;i>h;h++)(d=c[h])&&a.call(d,d.__data__,h)&&b.push(d)}return r(e)},Bg.order=function(){for(var a=-1,b=this.length;++a=0;)(c=d[e])&&(f&&f!==c.nextSibling&&f.parentNode.insertBefore(c,f),f=c);return this},Bg.sort=function(a){a=D.apply(this,arguments);for(var b=-1,c=this.length;++bd){if("string"!=typeof a){2>d&&(b=!1);for(c in a)this.each(F(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(F(a,b,c))};var Eg=jg.map({mouseenter:"mouseover",mouseleave:"mouseout"});Eg.forEach(function(a){"on"+a in kg&&Eg.remove(a)}),Bg.each=function(a){return I(this,function(b,c,d){a.call(b,b.__data__,c,d)})},Bg.call=function(a){var b=tg(arguments);return a.apply(b[0]=this,b),this},Bg.empty=function(){return!this.node()},Bg.node=function(){for(var a=0,b=this.length;b>a;a++)for(var c=this[a],d=0,e=c.length;e>d;d++){var f=c[d];if(f)return f}return null};var Fg=[];jg.selection.enter=J,jg.selection.enter.prototype=Fg,Fg.append=Bg.append,Fg.insert=Bg.insert,Fg.empty=Bg.empty,Fg.node=Bg.node,Fg.select=function(a){for(var b,c,d,e,f,g=[],h=-1,i=this.length;++hc-w){var f=a[0],h=b(a[0]);d(2*y),e(f,h),g(A.of(this,arguments))}w=c}}function p(){var a=jg.touches(this),b=a[0],c=q[b.identifier];if(f=a[1]){var f,h=q[f.identifier];b=[(b[0]+f[0])/2,(b[1]+f[1])/2],c=[(c[0]+h[0])/2,(c[1]+h[1])/2],d(jg.event.scale*r)}e(b,c),w=null,g(A.of(this,arguments))}var q,r,s,t,u,v,w,x=[0,0],y=1,z=Ig,A=n(a,"zoom");return a.translate=function(b){return arguments.length?(x=b.map(Number),f(),a):x},a.scale=function(b){return arguments.length?(y=+b,f(),a):y},a.scaleExtent=function(b){return arguments.length?(z=null==b?Ig:b.map(Number),a):z},a.x=function(b){return arguments.length?(t=b,s=b.copy(),x=[0,0],y=1,a):t},a.y=function(b){return arguments.length?(v=b,u=b.copy(),x=[0,0],y=1,a):v},jg.rebind(a,A,"on")};var Hg,Ig=[0,1/0],Jg="onwheel"in kg?(Hg=function(){return-jg.event.deltaY*(jg.event.deltaMode?120:1)},"wheel"):"onmousewheel"in kg?(Hg=function(){return jg.event.wheelDelta},"mousewheel"):(Hg=function(){return-jg.event.detail},"MozMousePixelScroll");K.prototype.toString=function(){return this.rgb()+""},jg.hsl=function(a,b,c){return 1===arguments.length?a instanceof M?L(a.h,a.s,a.l):fb(""+a,gb,L):L(+a,+b,+c)};var Kg=M.prototype=new K;Kg.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),L(this.h,this.s,this.l/a)},Kg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),L(this.h,this.s,a*this.l)},Kg.rgb=function(){return N(this.h,this.s,this.l)};var Lg=Math.PI,Mg=1e-6,Ng=Lg/180,Og=180/Lg;jg.hcl=function(a,b,c){return 1===arguments.length?a instanceof V?U(a.h,a.c,a.l):a instanceof Y?$(a.l,a.a,a.b):$((a=hb((a=jg.rgb(a)).r,a.g,a.b)).l,a.a,a.b):U(+a,+b,+c)};var Pg=V.prototype=new K;Pg.brighter=function(a){return U(this.h,this.c,Math.min(100,this.l+Qg*(arguments.length?a:1)))},Pg.darker=function(a){return U(this.h,this.c,Math.max(0,this.l-Qg*(arguments.length?a:1)))},Pg.rgb=function(){return W(this.h,this.c,this.l).rgb()},jg.lab=function(a,b,c){return 1===arguments.length?a instanceof Y?X(a.l,a.a,a.b):a instanceof V?W(a.l,a.c,a.h):hb((a=jg.rgb(a)).r,a.g,a.b):X(+a,+b,+c)};var Qg=18,Rg=.95047,Sg=1,Tg=1.08883,Ug=Y.prototype=new K;Ug.brighter=function(a){return X(Math.min(100,this.l+Qg*(arguments.length?a:1)),this.a,this.b)},Ug.darker=function(a){return X(Math.max(0,this.l-Qg*(arguments.length?a:1)),this.a,this.b)},Ug.rgb=function(){return Z(this.l,this.a,this.b)},jg.rgb=function(a,b,c){return 1===arguments.length?a instanceof db?cb(a.r,a.g,a.b):fb(""+a,cb,N):cb(~~a,~~b,~~c)};var Vg=db.prototype=new K;Vg.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return b||c||d?(b&&e>b&&(b=e),c&&e>c&&(c=e),d&&e>d&&(d=e),cb(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a)))):cb(e,e,e)},Vg.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),cb(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},Vg.hsl=function(){return gb(this.r,this.g,this.b)},Vg.toString=function(){return"#"+eb(this.r)+eb(this.g)+eb(this.b)};var Wg=jg.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"});Wg.forEach(function(a,b){Wg.set(a,fb(b,cb,N))}),jg.functor=kb,jg.xhr=function(a,b,c){function d(){var a=i.status;!a&&i.responseText||a>=200&&300>a||304===a?f.load.call(e,h.call(e,i)):f.error.call(e,i)}var e={},f=jg.dispatch("progress","load","error"),g={},h=lb,i=new(lg.XDomainRequest&&/^(http(s)?:)?\/\//.test(a)?XDomainRequest:XMLHttpRequest);return"onload"in i?i.onload=i.onerror=d:i.onreadystatechange=function(){i.readyState>3&&d()},i.onprogress=function(a){var b=jg.event;jg.event=a;try{f.progress.call(e,i)}finally{jg.event=b}},e.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?g[a]:(null==b?delete g[a]:g[a]=b+"",e)},e.mimeType=function(a){return arguments.length?(b=null==a?null:a+"",e):b},e.response=function(a){return h=a,e},["get","post"].forEach(function(a){e[a]=function(){return e.send.apply(e,[a].concat(tg(arguments)))}}),e.send=function(c,d,f){if(2===arguments.length&&"function"==typeof d&&(f=d,d=null),i.open(c,a,!0),null==b||"accept"in g||(g.accept=b+",*/*"),i.setRequestHeader)for(var h in g)i.setRequestHeader(h,g[h]);return null!=b&&i.overrideMimeType&&i.overrideMimeType(b),null!=f&&e.on("error",f).on("load",function(a){f(null,a)}),i.send(null==d?null:d),e},e.abort=function(){return i.abort(),e},jg.rebind(e,f,"on"),2===arguments.length&&"function"==typeof b&&(c=b,b=null),null==c?e:e.get(mb(c))},jg.csv=nb(",","text/csv"),jg.tsv=nb(" ","text/tab-separated-values");var Xg,Yg,Zg=0,$g={},_g=null;jg.timer=function(a,b,c){if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}var d=$g[a.id];d&&d.callback===a?(d.then=c,d.delay=b):$g[a.id=++Zg]=_g={callback:a,then:c,delay:b,next:_g},Xg||(Yg=clearTimeout(Yg),Xg=1,ah(ob))},jg.timer.flush=function(){for(var a,b=Date.now(),c=_g;c;)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;pb()};var ah=lg.requestAnimationFrame||lg.webkitRequestAnimationFrame||lg.mozRequestAnimationFrame||lg.oRequestAnimationFrame||lg.msRequestAnimationFrame||function(a){setTimeout(a,17)},bh=".",ch=",",dh=[3,3],eh=["y","z","a","f","p","n","ยต","m","","k","M","G","T","P","E","Z","Y"].map(qb);jg.formatPrefix=function(a,b){var c=0;return a&&(0>a&&(a*=-1),b&&(a=jg.round(a,rb(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((0>=c?c+1:c-1)/3)))),eh[8+c/3]},jg.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},jg.format=function(a){var b=fh.exec(a),c=b[1]||" ",d=b[2]||">",e=b[3]||"",f=b[4]||"",g=b[5],h=+b[6],i=b[7],j=b[8],k=b[9],l=1,m="",n=!1;switch(j&&(j=+j.substring(1)),(g||"0"===c&&"="===d)&&(g=c="0",d="=",i&&(h-=Math.floor((h-1)/4))),k){case"n":i=!0,k="g";break;case"%":l=100,m="%",k="f";break;case"p":l=100,m="%",k="r";break;case"b":case"o":case"x":case"X":f&&(f="0"+k.toLowerCase());case"c":case"d":n=!0,j=0;break;case"s":l=-1,k="r"}"#"===f&&(f=""),"r"!=k||j||(k="g"),null!=j&&("g"==k?j=Math.max(1,Math.min(21,j)):("e"==k||"f"==k)&&(j=Math.max(0,Math.min(20,j)))),k=gh.get(k)||sb;var o=g&&i;return function(a){if(n&&a%1)return"";var b=0>a||0===a&&0>1/a?(a=-a,"-"):e;if(0>l){var p=jg.formatPrefix(a,j);a=p.scale(a),m=p.symbol}else a*=l;a=k(a,j),!g&&i&&(a=hh(a));var q=f.length+a.length+(o?0:b.length),r=h>q?new Array(q=h-q+1).join(c):"";return o&&(a=hh(r+a)),bh&&a.replace(".",bh),b+=f,("<"===d?b+a+r:">"===d?r+b+a:"^"===d?r.substring(0,q>>=1)+b+a+r.substring(q):b+(o?a:r+a))+m}};var fh=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,gh=jg.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=jg.round(a,rb(a,b))).toFixed(Math.max(0,Math.min(20,rb(a*(1+1e-15),b))))}}),hh=lb;if(dh){var ih=dh.length;hh=function(a){for(var b=a.lastIndexOf("."),c=b>=0?"."+a.substring(b+1):(b=a.length,""),d=[],e=0,f=dh[0];b>0&&f>0;)d.push(a.substring(b-=f,b+f)),f=dh[e=(e+1)%ih];return d.reverse().join(ch||"")+c}}jg.geo={},jg.geo.stream=function(a,b){a&&jh.hasOwnProperty(a.type)?jh[a.type](a,b):tb(a,b)};var jh={Feature:function(a,b){tb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++da?4*Lg+a:a,oh.lineStart=oh.lineEnd=oh.point=E}};jg.geo.bounds=xb(lb),jg.geo.centroid=function(a){ph=qh=rh=sh=th=0,jg.geo.stream(a,uh);var b;return qh&&Math.abs(b=Math.sqrt(rh*rh+sh*sh+th*th))>Mg?[Math.atan2(sh,rh)*Og,Math.asin(Math.max(-1,Math.min(1,th/b)))*Og]:void 0};var ph,qh,rh,sh,th,uh={sphere:function(){2>ph&&(ph=2,qh=rh=sh=th=0)},point:yb,lineStart:Ab,lineEnd:Bb,polygonStart:function(){2>ph&&(ph=2,qh=rh=sh=th=0),uh.lineStart=zb},polygonEnd:function(){uh.lineStart=Ab}},vh=Nb(Ib,Sb,Ub),wh=1e9;jg.geo.projection=$b,jg.geo.projectionMutator=_b,(jg.geo.equirectangular=function(){return $b(bc)}).raw=bc.invert=bc,jg.geo.rotation=function(a){function b(b){return b=a(b[0]*Ng,b[1]*Ng),b[0]*=Og,b[1]*=Og,b}return a=cc(a[0]%360*Ng,a[1]*Ng,a.length>2?a[2]*Ng:0),b.invert=function(b){return b=a.invert(b[0]*Ng,b[1]*Ng),b[0]*=Og,b[1]*=Og,b},b},jg.geo.circle=function(){function a(){var a="function"==typeof d?d.apply(this,arguments):d,b=cc(-a[0]*Ng,-a[1]*Ng,0).invert,e=[];return c(null,null,1,{point:function(a,c){e.push(a=b(a,c)),a[0]*=Og,a[1]*=Og}}),{type:"Polygon",coordinates:[e]}}var b,c,d=[0,0],e=6;return a.origin=function(b){return arguments.length?(d=b,a):d},a.angle=function(d){return arguments.length?(c=gc((b=+d)*Ng,e*Ng),a):b},a.precision=function(d){return arguments.length?(c=gc(b*Ng,(e=+d)*Ng),a):e},a.angle(90)},jg.geo.distance=function(a,b){var c,d=(b[0]-a[0])*Ng,e=a[1]*Ng,f=b[1]*Ng,g=Math.sin(d),h=Math.cos(d),i=Math.sin(e),j=Math.cos(e),k=Math.sin(f),l=Math.cos(f);return Math.atan2(Math.sqrt((c=l*g)*c+(c=j*k-i*l*h)*c),i*k+j*l*h)},jg.geo.graticule=function(){function a(){return{type:"MultiLineString",coordinates:b()}}function b(){return jg.range(Math.ceil(f/q)*q,e,q).map(m).concat(jg.range(Math.ceil(j/r)*r,i,r).map(n)).concat(jg.range(Math.ceil(d/o)*o,c,o).filter(function(a){return Math.abs(a%q)>Mg}).map(k)).concat(jg.range(Math.ceil(h/p)*p,g,p).filter(function(a){return Math.abs(a%r)>Mg}).map(l))}var c,d,e,f,g,h,i,j,k,l,m,n,o=10,p=o,q=90,r=360,s=2.5;return a.lines=function(){return b().map(function(a){return{type:"LineString",coordinates:a}})},a.outline=function(){return{type:"Polygon",coordinates:[m(f).concat(n(i).slice(1),m(e).reverse().slice(1),n(j).reverse().slice(1))]}},a.extent=function(b){return arguments.length?a.majorExtent(b).minorExtent(b):a.minorExtent()},a.majorExtent=function(b){return arguments.length?(f=+b[0][0],e=+b[1][0],j=+b[0][1],i=+b[1][1],f>e&&(b=f,f=e,e=b),j>i&&(b=j,j=i,i=b),a.precision(s)):[[f,j],[e,i]]},a.minorExtent=function(b){return arguments.length?(d=+b[0][0],c=+b[1][0],h=+b[0][1],g=+b[1][1],d>c&&(b=d,d=c,c=b),h>g&&(b=h,h=g,g=b),a.precision(s)):[[d,h],[c,g]]},a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()},a.majorStep=function(b){return arguments.length?(q=+b[0],r=+b[1],a):[q,r]},a.minorStep=function(b){return arguments.length?(o=+b[0],p=+b[1],a):[o,p]},a.precision=function(b){return arguments.length?(s=+b,k=ic(h,g,90),l=jc(d,c,s),m=ic(j,i,90),n=jc(f,e,s),a):s},a.majorExtent([[-180,-90+Mg],[180,90-Mg]]).minorExtent([[-180,-80-Mg],[180,80+Mg]])},jg.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[b||d.apply(this,arguments),c||e.apply(this,arguments)]}}var b,c,d=kc,e=lc;return a.distance=function(){return jg.geo.distance(b||d.apply(this,arguments),c||e.apply(this,arguments))},a.source=function(c){return arguments.length?(d=c,b="function"==typeof c?null:c,a):d},a.target=function(b){return arguments.length?(e=b,c="function"==typeof b?null:b,a):e},a.precision=function(){return arguments.length?a:0},a},jg.geo.interpolate=function(a,b){return mc(a[0]*Ng,a[1]*Ng,b[0]*Ng,b[1]*Ng)},jg.geo.length=function(a){return xh=0,jg.geo.stream(a,yh),xh};var xh,yh={sphere:E,point:E,lineStart:nc,lineEnd:E,polygonStart:E,polygonEnd:E};(jg.geo.conicEqualArea=function(){return oc(pc)}).raw=pc,jg.geo.albersUsa=function(){function a(a){return b(a)(a)}function b(a){var b=a[0],c=a[1];return c>50?g:-140>b?h:21>c?i:f}var c,d,e,f=jg.geo.conicEqualArea().rotate([98,0]).center([0,38]).parallels([29.5,45.5]),g=jg.geo.conicEqualArea().rotate([160,0]).center([0,60]).parallels([55,65]),h=jg.geo.conicEqualArea().rotate([160,0]).center([0,20]).parallels([8,18]),i=jg.geo.conicEqualArea().rotate([60,0]).center([0,10]).parallels([8,18]);return a.invert=function(a){return c(a)||d(a)||e(a)||f.invert(a)},a.scale=function(b){return arguments.length?(f.scale(b),g.scale(.6*b),h.scale(b),i.scale(1.5*b),a.translate(f.translate())):f.scale()},a.translate=function(b){if(!arguments.length)return f.translate();var j=f.scale(),k=b[0],l=b[1];return f.translate(b),g.translate([k-.4*j,l+.17*j]),h.translate([k-.19*j,l+.2*j]),i.translate([k+.58*j,l+.43*j]),c=qc(g,[[-180,50],[-130,72]]),d=qc(h,[[-164,18],[-154,24]]),e=qc(i,[[-67.5,17.5],[-65,19]]),a},a.scale(1e3)};var zh,Ah,Bh={point:E,lineStart:E,lineEnd:E,polygonStart:function(){Ah=0,Bh.lineStart=rc},polygonEnd:function(){Bh.lineStart=Bh.lineEnd=Bh.point=E,zh+=Math.abs(Ah/2)}},Ch={point:tc,lineStart:uc,lineEnd:vc,polygonStart:function(){Ch.lineStart=wc},polygonEnd:function(){Ch.point=tc,Ch.lineStart=uc,Ch.lineEnd=vc}};jg.geo.path=function(){function a(a){return a&&jg.geo.stream(a,d(e.pointRadius("function"==typeof f?+f.apply(this,arguments):f))),e.result()}var b,c,d,e,f=4.5;return a.area=function(a){return zh=0,jg.geo.stream(a,d(Bh)),zh},a.centroid=function(a){return ph=rh=sh=th=0,jg.geo.stream(a,d(Ch)),th?[rh/th,sh/th]:void 0},a.bounds=function(a){return xb(d)(a)},a.projection=function(c){return arguments.length?(d=(b=c)?c.stream||zc(c):lb,a):b},a.context=function(b){return arguments.length?(e=null==(c=b)?new sc:new xc(b),a):c},a.pointRadius=function(b){return arguments.length?(f="function"==typeof b?b:+b,a):f},a.projection(jg.geo.albersUsa()).context(null)},jg.geo.albers=function(){return jg.geo.conicEqualArea().parallels([29.5,45.5]).rotate([98,0]).center([0,38]).scale(1e3)};var Dh=Ac(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(jg.geo.azimuthalEqualArea=function(){return $b(Dh)}).raw=Dh;var Eh=Ac(function(a){var b=Math.acos(a);return b&&b/Math.sin(b)},lb);(jg.geo.azimuthalEquidistant=function(){return $b(Eh)}).raw=Eh,(jg.geo.conicConformal=function(){return oc(Bc)}).raw=Bc,(jg.geo.conicEquidistant=function(){return oc(Cc)}).raw=Cc;var Fh=Ac(function(a){return 1/a},Math.atan);(jg.geo.gnomonic=function(){return $b(Fh)}).raw=Fh,Dc.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-Lg/2]},(jg.geo.mercator=function(){return Ec(Dc)}).raw=Dc;var Gh=Ac(function(){return 1},Math.asin);(jg.geo.orthographic=function(){return $b(Gh)}).raw=Gh;var Hh=Ac(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(jg.geo.stereographic=function(){return $b(Hh)}).raw=Hh,Fc.invert=function(a,b){return[Math.atan2(R(a),Math.cos(b)),Q(Math.sin(b)/S(a))]},(jg.geo.transverseMercator=function(){return Ec(Fc)}).raw=Fc,jg.geom={},jg.svg={},jg.svg.line=function(){return Gc(lb)};var Ih=jg.map({linear:Jc,"linear-closed":Kc,"step-before":Lc,"step-after":Mc,basis:Sc,"basis-open":Tc,"basis-closed":Uc,bundle:Vc,cardinal:Pc,"cardinal-open":Nc,"cardinal-closed":Oc,monotone:_c});Ih.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var Jh=[0,2/3,1/3,0],Kh=[0,1/3,2/3,0],Lh=[0,1/6,2/3,1/6];jg.geom.hull=function(a){function b(a){if(a.length<3)return[];var b,e,f,g,h,i,j,k,l,m,n,o,p=kb(c),q=kb(d),r=a.length,s=r-1,t=[],u=[],v=0;if(p===Hc&&d===Ic)b=a;else for(f=0,b=[];r>f;++f)b.push([+p.call(this,e=a[f],f),+q.call(this,e,f)]);for(f=1;r>f;++f)b[f][1]f;++f)f!==v&&(i=b[f][1]-b[v][1],h=b[f][0]-b[v][0],t.push({angle:Math.atan2(i,h),index:f}));for(t.sort(function(a,b){return a.angle-b.angle}),n=t[0].angle,m=t[0].index,l=0,f=1;s>f;++f)g=t[f].index,n==t[f].angle?(h=b[m][0]-b[v][0],i=b[m][1]-b[v][1],j=b[g][0]-b[v][0],k=b[g][1]-b[v][1],h*h+i*i>=j*j+k*k?t[f].index=-1:(t[l].index=-1,n=t[f].angle,l=f,m=g)):(n=t[f].angle,l=f,m=g);for(u.push(v),f=0,g=0;2>f;++g)-1!==t[g].index&&(u.push(t[g].index),f++);for(o=u.length;s>g;++g)if(-1!==t[g].index){for(;!ad(u[o-2],u[o-1],t[g].index,b);)--o;u[o++]=t[g].index}var w=[];for(f=0;o>f;++f)w.push(a[u[f]]);return w}var c=Hc,d=Ic;return arguments.length?b(a):(b.x=function(a){return arguments.length?(c=a,b):c},b.y=function(a){return arguments.length?(d=a,b):d},b)},jg.geom.polygon=function(a){return a.area=function(){for(var b=0,c=a.length,d=a[c-1][1]*a[0][0]-a[c-1][0]*a[0][1];++bh;h++)c.push([e,b[h],b[h+1]])}),c},jg.geom.voronoi=function(a){function b(a){var b,d,g,h=a.map(function(){return[]}),i=kb(e),j=kb(f),k=a.length,l=1e6;if(i===Hc&&j===Ic)b=a;else for(b=[],g=0;k>g;++g)b.push([+i.call(this,d=a[g],g),+j.call(this,d,g)]);if(dd(b,function(a){var b,c,d,e,f,g;1===a.a&&a.b>=0?(b=a.ep.r,c=a.ep.l):(b=a.ep.l,c=a.ep.r),1===a.a?(f=b?b.y:-l,d=a.c-a.b*f,g=c?c.y:l,e=a.c-a.b*g):(d=b?b.x:-l,f=a.c-a.a*d,e=c?c.x:l,g=a.c-a.a*e);var i=[d,f],j=[e,g];h[a.region.l.index].push(i,j),h[a.region.r.index].push(i,j)}),h=h.map(function(a,c){var d=b[c][0],e=b[c][1],f=a.map(function(a){return Math.atan2(a[0]-d,a[1]-e)}),g=jg.range(a.length).sort(function(a,b){return f[a]-f[b]});return g.filter(function(a,b){return!b||f[a]-f[g[b-1]]>Mg}).map(function(b){return a[b]})}),h.forEach(function(a,c){var d=a.length;if(!d)return a.push([-l,-l],[-l,l],[l,l],[l,-l]);if(!(d>2)){var e=b[c],f=a[0],g=a[1],h=e[0],i=e[1],j=f[0],k=f[1],m=g[0],n=g[1],o=Math.abs(m-j),p=n-k;if(Math.abs(p)i?-l:l;a.push([-l,q],[l,q])}else if(Mg>o){var r=j>h?-l:l;a.push([r,-l],[r,l])}else{var q=(j-h)*(n-k)>(m-j)*(k-i)?l:-l,s=Math.abs(p)-o;Math.abs(s)p?q:-q,q]):(s>0&&(q*=-1),a.push([-l,q],[l,q]))}}}),c)for(g=0;k>g;++g)c(h[g]);for(g=0;k>g;++g)h[g].point=a[g];return h}var c,d=null,e=Hc,f=Ic;return arguments.length?b(a):(b.x=function(a){return arguments.length?(e=a,b):e},b.y=function(a){return arguments.length?(f=a,b):f},b.size=function(a){return arguments.length?(null==a?c=null:(d=[+a[0],+a[1]],c=jg.geom.polygon([[0,0],[0,d[1]],d,[d[0],0]]).clip),b):d},b.links=function(a){var b,c,d,g=a.map(function(){return[]}),h=[],i=kb(e),j=kb(f),k=a.length;if(i===Hc&&j===Ic)b=a;else for(d=0;k>d;++d)b.push([+i.call(this,c=a[d],d),+j.call(this,c,d)]);return dd(b,function(b){var c=b.region.l.index,d=b.region.r.index;g[c][d]||(g[c][d]=g[d][c]=!0,h.push({source:a[c],target:a[d]}))}),h},b.triangles=function(a){if(e===Hc&&f===Ic)return jg.geom.delaunay(a); diff --git a/package.json b/package.json index ee2c800..3b1c2ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xAPI-Dashboard", - "version": "0.2.0", + "version": "1.0.0", "devDependencies": { "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.6.3",