genevalidator 1.6.5 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff764d4fe5b0f8eba2e8ee9985b2e20f4bbed3d4
4
- data.tar.gz: 1b6f4e1be010efaa41935965138fc34989b00773
3
+ metadata.gz: 226cca4c8766700b659ff1884a6b408530acded0
4
+ data.tar.gz: 67b9714e84b33e691b49fe0bff4053842d8d2251
5
5
  SHA512:
6
- metadata.gz: 41c5bf06a489d747bf08acba973c252c57addf8a7811f5a67b272a2ea8ea6f77250d1cfe1fe2f7e28764333323e3036b021235ddb60df9158fdc0d0804221ae4
7
- data.tar.gz: 9b0837c0fc50b5418411872defe0052f8198e7726af946646484cdb578f194a6e00360027037004eda4df1a7a9aee8c234434803862cdb54ed07341709f87da6
6
+ metadata.gz: a273e0fbe5727fc629c26b568b1137b52381ce5e7ae61fee298ea480b6f0f331645f12ef3ad6e33b2da4e369004263f96304860f0524decb61d86f4c92e120bd
7
+ data.tar.gz: e62f370f8f67878c72b8f5827c87913f6a675ee2f2988a3924eb7191fc5a0904a255c1c0335e0b701a027c5fd9c951f10a005a195e539c6954de93b69294f316
@@ -23,6 +23,6 @@ else for(;(u=n+r*++a)<t;)i.push(u/o);return i},vo.map=function(n){var t=new u;if
23
23
  },n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(v=+t[0],m=+t[1],n):[v,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],d=+t[1],n):[p,d]},n.precision=function(t){return arguments.length?(y=+t,s=Te(a,o,90),f=ze(r,e,y),h=Te(l,c,90),g=ze(i,u,y),n):y},n.majorExtent([[-180,-90+$o],[180,90-$o]]).minorExtent([[-180,-80-$o],[180,80+$o]])},vo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Ce,u=De;return n.distance=function(){return vo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},vo.geo.interpolate=function(n,t){return je(n[0]*Jo,n[1]*Jo,t[0]*Jo,t[1]*Jo)},vo.geo.length=function(n){return uc=0,vo.geo.stream(n,ic),uc};var uc,ic={sphere:c,point:c,lineStart:Le,lineEnd:c,polygonStart:c,polygonEnd:c},oc=He(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(vo.geo.azimuthalEqualArea=function(){return xe(oc)}).raw=oc;var ac=He(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},pt);(vo.geo.azimuthalEquidistant=function(){return xe(ac)}).raw=ac,(vo.geo.conicConformal=function(){return oe(Fe)}).raw=Fe,(vo.geo.conicEquidistant=function(){return oe(Pe)}).raw=Pe;var cc=He(function(n){return 1/n},Math.atan);(vo.geo.gnomonic=function(){return xe(cc)}).raw=cc,Oe.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Bo/2]},(vo.geo.mercator=function(){return Re(Oe)}).raw=Oe;var lc=He(function(){return 1},Math.asin);(vo.geo.orthographic=function(){return xe(lc)}).raw=lc;var sc=He(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(vo.geo.stereographic=function(){return xe(sc)}).raw=sc,Ye.invert=function(n,t){return[Math.atan2(O(n),Math.cos(t)),P(Math.sin(t)/R(n))]},(vo.geo.transverseMercator=function(){return Re(Ye)}).raw=Ye,vo.geom={},vo.svg={},vo.svg.line=function(){return Ie(pt)};var fc=vo.map({linear:Ze,"linear-closed":Xe,step:Be,"step-before":$e,"step-after":We,basis:tr,"basis-open":er,"basis-closed":rr,bundle:ur,cardinal:Ke,"cardinal-open":Je,"cardinal-closed":Ge,monotone:sr});fc.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var hc=[0,2/3,1/3,0],gc=[0,1/3,2/3,0],pc=[0,1/6,2/3,1/6];vo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u,i,o,a,c,l,s,f,h,g,p,d=gt(e),v=gt(r),m=n.length,y=m-1,M=[],x=[],b=0;if(d===Ue&&r===Ve)t=n;else for(i=0,t=[];m>i;++i)t.push([+d.call(this,u=n[i],i),+v.call(this,u,i)]);for(i=1;m>i;++i)(t[i][1]<t[b][1]||t[i][1]==t[b][1]&&t[i][0]<t[b][0])&&(b=i);for(i=0;m>i;++i)i!==b&&(c=t[i][1]-t[b][1],a=t[i][0]-t[b][0],M.push({angle:Math.atan2(c,a),index:i}));for(M.sort(function(n,t){return n.angle-t.angle}),g=M[0].angle,h=M[0].index,f=0,i=1;y>i;++i){if(o=M[i].index,g==M[i].angle){if(a=t[h][0]-t[b][0],c=t[h][1]-t[b][1],l=t[o][0]-t[b][0],s=t[o][1]-t[b][1],a*a+c*c>=l*l+s*s){M[i].index=-1;continue}M[f].index=-1}g=M[i].angle,f=i,h=o}for(x.push(b),i=0,o=0;2>i;++o)M[o].index>-1&&(x.push(M[o].index),i++);for(p=x.length;y>o;++o)if(!(M[o].index<0)){for(;!fr(x[p-2],x[p-1],M[o].index,t);)--p;x[p++]=M[o].index}var _=[];for(i=p-1;i>=0;--i)_.push(n[x[i]]);return _}var e=Ue,r=Ve;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},vo.geom.polygon=function(n){return jo(n,dc),n};var dc=vo.geom.polygon.prototype=[];dc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},dc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},dc.clip=function(n){for(var t,e,r,u,i,o,a=pr(n),c=-1,l=this.length-pr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],hr(o,s,u)?(hr(i,s,u)||n.push(gr(i,o,s,u)),n.push(o)):hr(i,s,u)&&n.push(gr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n},vo.geom.delaunay=function(n){var t=n.map(function(){return[]}),e=[];return dr(n,function(e){t[e.region.l.index].push(n[e.region.r.index])}),t.forEach(function(t,r){var u=n[r],i=u[0],o=u[1];t.forEach(function(n){n.angle=Math.atan2(n[0]-i,n[1]-o)}),t.sort(function(n,t){return n.angle-t.angle});for(var a=0,c=t.length-1;c>a;a++)e.push([u,t[a],t[a+1]])}),e},vo.geom.voronoi=function(n){function t(n){var t,i,o,a=n.map(function(){return[]}),c=gt(e),l=gt(r),s=n.length,f=1e6;if(c===Ue&&l===Ve)t=n;else for(t=new Array(s),o=0;s>o;++o)t[o]=[+c.call(this,i=n[o],o),+l.call(this,i,o)];if(dr(t,function(n){var t,e,r,u,i,o;1===n.a&&n.b>=0?(t=n.ep.r,e=n.ep.l):(t=n.ep.l,e=n.ep.r),1===n.a?(i=t?t.y:-f,r=n.c-n.b*i,o=e?e.y:f,u=n.c-n.b*o):(r=t?t.x:-f,i=n.c-n.a*r,u=e?e.x:f,o=n.c-n.a*u);var c=[r,i],l=[u,o];a[n.region.l.index].push(c,l),a[n.region.r.index].push(c,l)}),a=a.map(function(n,e){var r=t[e][0],u=t[e][1],i=n.map(function(n){return Math.atan2(n[0]-r,n[1]-u)}),o=vo.range(n.length).sort(function(n,t){return i[n]-i[t]});return o.filter(function(n,t){return!t||i[n]-i[o[t-1]]>$o}).map(function(t){return n[t]})}),a.forEach(function(n,e){var r=n.length;if(!r)return n.push([-f,-f],[-f,f],[f,f],[f,-f]);if(!(r>2)){var u=t[e],i=n[0],o=n[1],a=u[0],c=u[1],l=i[0],s=i[1],h=o[0],g=o[1],p=Math.abs(h-l),d=g-s;if(Math.abs(d)<$o){var v=s>c?-f:f;n.push([-f,v],[f,v])}else if($o>p){var m=l>a?-f:f;n.push([m,-f],[m,f])}else{var v=(l-a)*(g-s)>(h-l)*(s-c)?f:-f,y=Math.abs(d)-p;Math.abs(y)<$o?n.push([0>d?v:-v,v]):(y>0&&(v*=-1),n.push([-f,v],[f,v]))}}}),u)for(o=0;s>o;++o)u.clip(a[o]);for(o=0;s>o;++o)a[o].point=n[o];return a}var e=Ue,r=Ve,u=null;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.clipExtent=function(n){if(!arguments.length)return u&&[u[0],u[2]];if(null==n)u=null;else{var e=+n[0][0],r=+n[0][1],i=+n[1][0],o=+n[1][1];u=vo.geom.polygon([[e,r],[e,o],[i,o],[i,r]])}return t},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):u&&u[2]},t.links=function(n){var t,u,i,o=n.map(function(){return[]}),a=[],c=gt(e),l=gt(r),s=n.length;if(c===Ue&&l===Ve)t=n;else for(t=new Array(s),i=0;s>i;++i)t[i]=[+c.call(this,u=n[i],i),+l.call(this,u,i)];return dr(t,function(t){var e=t.region.l.index,r=t.region.r.index;o[e][r]||(o[e][r]=o[r][e]=!0,a.push({source:n[e],target:n[r]}))}),a},t.triangles=function(n){if(e===Ue&&r===Ve)return vo.geom.delaunay(n);for(var t,u=new Array(c),i=gt(e),o=gt(r),a=-1,c=n.length;++a<c;)(u[a]=[+i.call(this,t=n[a],a),+o.call(this,t,a)]).data=t;return vo.geom.delaunay(u).map(function(n){return n.map(function(n){return n.data})})},t)};var vc={l:"r",r:"l"};vo.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(Math.abs(c-e)+Math.abs(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=yr()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,d,v,m,y,M=gt(a),x=gt(c);if(null!=t)d=t,v=e,m=r,y=u;else if(m=y=-(d=v=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<d&&(d=s.x),s.y<v&&(v=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);d>b&&(d=b),v>_&&(v=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-d,S=y-v;w>S?y=v+w:m=d+S;var E=yr();if(E.add=function(n){i(E,n,+M(n,++g),+x(n,g),d,v,m,y)},E.visit=function(n){Mr(n,E,d,v,m,y)},g=-1,null==t){for(;++g<p;)i(E,n[g],f[g],h[g],d,v,m,y);--g}else n.forEach(E.add);return f=h=n=s=null,E}var o,a=Ue,c=Ve;return(o=arguments.length)?(a=vr,c=mr,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},vo.interpolateRgb=xr,vo.interpolateObject=br,vo.interpolateNumber=_r,vo.interpolateString=wr;var mc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;vo.interpolate=Sr,vo.interpolators=[function(n,t){var e=typeof t;return("string"===e?ha.has(t)||/^(#|rgb\(|hsl\()/.test(t)?xr:wr:t instanceof U?xr:"object"===e?Array.isArray(t)?Er:br:_r)(n,t)}],vo.interpolateArray=Er;var yc=function(){return pt},Mc=vo.map({linear:yc,poly:Cr,quad:function(){return qr},cubic:function(){return Tr},sin:function(){return Dr},exp:function(){return jr},circle:function(){return Lr},elastic:Hr,back:Fr,bounce:function(){return Pr}}),xc=vo.map({"in":pt,out:Ar,"in-out":Nr,"out-in":function(n){return Nr(Ar(n))}});vo.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=Mc.get(e)||yc,r=xc.get(r)||pt,kr(r(e.apply(null,Array.prototype.slice.call(arguments,1))))},vo.interpolateHcl=Or,vo.interpolateHsl=Rr,vo.interpolateLab=Yr,vo.interpolateRound=Ir,vo.transform=function(n){var t=Mo.createElementNS(vo.ns.prefix.svg,"g");return(vo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Ur(e?e.matrix:bc)})(n)},Ur.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bc={a:1,b:0,c:0,d:1,e:0,f:0};vo.interpolateTransform=Br,vo.layout={},vo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},vo.layout.chord=function(){function n(){var n,l,f,h,g,p={},d=[],v=vo.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];d.push(l),m.push(vo.range(i)),n+=l}for(o&&v.sort(function(n,t){return o(d[n],d[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(2*Bo-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=v[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},vo.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=1/Math.sqrt(i*i+o*o);if(d>(u-e)*a){var c=t.charge*a*a;return n.px-=i*c,n.py-=o*c,!0}if(t.point&&isFinite(a)){var c=t.pointCharge*a*a;n.px-=i*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=vo.event.x,n.py=vo.event.y,a.resume()}var e,r,u,i,o,a={},c=vo.dispatch("start","tick","end"),l=[1,1],s=.9,f=_c,h=wc,g=-30,p=.1,d=.8,v=[],m=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,d,y,M,x,b=v.length,_=m.length;for(e=0;_>e;++e)a=m[e],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(d=M*M+x*x)&&(d=r*i[e]*((d=Math.sqrt(d))-u[e])/d,M*=d,x*=d,h.x-=M*(y=f.weight/(h.weight+f.weight)),h.y-=x*y,f.x+=M*(y=1-y),f.y+=x*y);if((y=r*p)&&(M=l[0]/2,x=l[1]/2,e=-1,y))for(;++e<b;)a=v[e],a.x+=(M-a.x)*y,a.y+=(x-a.y)*y;if(g)for(ru(t=vo.geom.quadtree(v),r,o),e=-1;++e<b;)(a=v[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=v[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(v=n,a):v},a.links=function(n){return arguments.length?(m=n,a):m},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.gravity=function(n){return arguments.length?(p=+n,a):p},a.theta=function(n){return arguments.length?(d=+n,a):d},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),vo.timer(a.tick)),a):r},a.start=function(){function n(n,r){for(var u,i=t(e),o=-1,a=i.length;++o<a;)if(!isNaN(u=i[o][n]))return u;return Math.random()*r}function t(){if(!c){for(c=[],r=0;p>r;++r)c[r]=[];for(r=0;d>r;++r){var n=m[r];c[n.source.index].push(n.target),c[n.target.index].push(n.source)}}return c[e]}var e,r,c,s,p=v.length,d=m.length,y=l[0],M=l[1];for(e=0;p>e;++e)(s=v[e]).index=e,s.weight=0;for(e=0;d>e;++e)s=m[e],"number"==typeof s.source&&(s.source=v[s.source]),"number"==typeof s.target&&(s.target=v[s.target]),++s.source.weight,++s.target.weight;for(e=0;p>e;++e)s=v[e],isNaN(s.x)&&(s.x=n("x",y)),isNaN(s.y)&&(s.y=n("y",M)),isNaN(s.px)&&(s.px=s.x),isNaN(s.py)&&(s.py=s.y);if(u=[],"function"==typeof f)for(e=0;d>e;++e)u[e]=+f.call(this,m[e],e);else for(e=0;d>e;++e)u[e]=f;if(i=[],"function"==typeof h)for(e=0;d>e;++e)i[e]=+h.call(this,m[e],e);else for(e=0;d>e;++e)i[e]=h;if(o=[],"function"==typeof g)for(e=0;p>e;++e)o[e]=+g.call(this,v[e],e);else for(e=0;p>e;++e)o[e]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=vo.behavior.drag().origin(pt).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?(this.on("mouseover.force",tu).on("mouseout.force",eu).call(e),void 0):e},vo.rebind(a,c,"on")};var _c=20,wc=1;vo.layout.hierarchy=function(){function n(t,o,a){var c=u.call(e,t,o);if(t.depth=o,a.push(t),c&&(l=c.length)){for(var l,s,f=-1,h=t.children=[],g=0,p=o+1;++f<l;)s=n(c[f],p,a),s.parent=t,h.push(s),g+=s.value;r&&h.sort(r),i&&(t.value=g)}else i&&(t.value=+i.call(e,t,o)||0);return t}function t(n,r){var u=n.children,o=0;if(u&&(a=u.length))for(var a,c=-1,l=r+1;++c<a;)o+=t(u[c],l);else i&&(o=+i.call(e,n,r)||0);return i&&(n.value=o),o}function e(t){var e=[];return n(t,0,e),e}var r=au,u=iu,i=ou;return e.sort=function(n){return arguments.length?(r=n,e):r},e.children=function(n){return arguments.length?(u=n,e):u},e.value=function(n){return arguments.length?(i=n,e):i},e.revalue=function(n){return t(n,0),n},e},vo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=vo.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},uu(e,r)},vo.layout.pie=function(){function n(i){var o=i.map(function(e,r){return+t.call(n,e,r)}),a=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/vo.sum(o),l=vo.range(i.length);null!=e&&l.sort(e===Sc?function(n,t){return o[t]-o[n]}:function(n,t){return e(i[n],i[t])});var s=[];return l.forEach(function(n){var t;s[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),s}var t=Number,e=Sc,r=0,u=2*Bo;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var Sc={};vo.layout.stack=function(){function n(a,c){var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=vo.permute(l,f),s=vo.permute(s,f);var h,g,p,d=r.call(n,s,c),v=l.length,m=l[0].length;for(g=0;m>g;++g)for(u.call(n,l[0][g],p=d[g],s[0][g][1]),h=1;v>h;++h)u.call(n,l[h][g],p+=s[h-1][g][1],s[h][g][1]);return a}var t=pt,e=hu,r=gu,u=fu,i=lu,o=su;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:Ec.get(t)||hu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:kc.get(t)||gu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var Ec=vo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(pu),i=n.map(du),o=vo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return vo.range(n.length).reverse()},"default":hu}),kc=vo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:gu});vo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[vo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=Mu,u=mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=gt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return yu(n,t)}:gt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},vo.layout.tree=function(){function n(n,i){function o(n,t){var r=n.children,u=n._tree;if(r&&(i=r.length)){for(var i,a,l,s=r[0],f=s,h=-1;++h<i;)l=r[h],o(l,a),f=c(l,a,f),a=l;Nu(n);var g=.5*(s._tree.prelim+l._tree.prelim);t?(u.prelim=t._tree.prelim+e(n,t),u.mod=u.prelim-g):u.prelim=g}else t&&(u.prelim=t._tree.prelim+e(n,t))}function a(n,t){n.x=n._tree.prelim+t;var e=n.children;if(e&&(r=e.length)){var r,u=-1;for(t+=n._tree.mod;++u<r;)a(e[u],t)}}function c(n,t,r){if(t){for(var u,i=n,o=n,a=t,c=n.parent.children[0],l=i._tree.mod,s=o._tree.mod,f=a._tree.mod,h=c._tree.mod;a=_u(a),i=bu(i),a&&i;)c=bu(c),o=_u(o),o._tree.ancestor=n,u=a._tree.prelim+f-i._tree.prelim-l+e(a,i),u>0&&(qu(Tu(a,n,r),n,u),l+=u,s+=u),f+=a._tree.mod,l+=i._tree.mod,h+=c._tree.mod,s+=o._tree.mod;a&&!_u(o)&&(o._tree.thread=a,o._tree.mod+=f-s),i&&!bu(c)&&(c._tree.thread=i,c._tree.mod+=l-h,r=n)}return r}var l=t.call(this,n,i),s=l[0];Au(s,function(n,t){n._tree={ancestor:n,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),o(s),a(s,-s._tree.prelim);var f=wu(s,Eu),h=wu(s,Su),g=wu(s,ku),p=f.x-e(f,h)/2,d=h.x+e(h,f)/2,v=g.depth||1;return Au(s,u?function(n){n.x*=r[0],n.y=n.depth*r[1],delete n._tree}:function(n){n.x=(n.x-p)/(d-p)*r[0],n.y=n.depth/v*r[1],delete n._tree}),l}var t=vo.layout.hierarchy().sort(null).value(null),e=xu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},vo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Au(a,function(n){n.r=+s(n.value)}),Au(a,Lu),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Au(a,function(n){n.r+=f}),Au(a,Lu),Au(a,function(n){n.r-=f})}return Pu(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=vo.layout.hierarchy().sort(zu),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},vo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Au(c,function(n){var t=n.children;t&&t.length?(n.x=Yu(t),n.y=Ru(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Iu(c),f=Uu(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Au(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=vo.layout.hierarchy().sort(null).value(null),e=xu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},vo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,d="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,d))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,d,l,!1),d=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,d,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=vo.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Vu,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Vu(t):Zu(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Zu(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Vu:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},uu(i,a)},vo.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=vo.random.normal.apply(vo,arguments);return function(){return Math.exp(n())}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t/n}}},vo.scale={};var Ac={floor:pt,ceil:pt};vo.scale.linear=function(){return Ku([0,1],[0,1],Sr,!1)},vo.scale.log=function(){return ui(vo.scale.linear().domain([0,1]),10,!0,[1,10])};var Nc=vo.format(".0e"),qc={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};vo.scale.pow=function(){return ii(vo.scale.linear(),1,[0,1])},vo.scale.sqrt=function(){return vo.scale.pow().exponent(.5)},vo.scale.ordinal=function(){return ai([],{t:"range",a:[[]]})},vo.scale.category10=function(){return vo.scale.ordinal().range(Tc)},vo.scale.category20=function(){return vo.scale.ordinal().range(zc)},vo.scale.category20b=function(){return vo.scale.ordinal().range(Cc)},vo.scale.category20c=function(){return vo.scale.ordinal().range(Dc)};var Tc=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ut),zc=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ut),Cc=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ut),Dc=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ut);vo.scale.quantile=function(){return ci([],[])},vo.scale.quantize=function(){return li(0,1,[0,1])},vo.scale.threshold=function(){return si([.5],[0,1])},vo.scale.identity=function(){return fi([0,1])},vo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+jc,a=u.apply(this,arguments)+jc,c=(o>a&&(c=o,o=a,a=c),a-o),l=Bo>c?"0":"1",s=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);return c>=Lc?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+l+",0 "+n*s+","+n*f+"Z":"M"+i*s+","+i*f+"A"+i+","+i+" 0 "+l+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=hi,e=gi,r=pi,u=di;return n.innerRadius=function(e){return arguments.length?(t=gt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=gt(t),n):e},n.startAngle=function(t){return arguments.length?(r=gt(t),n):r},n.endAngle=function(t){return arguments.length?(u=gt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+jc;return[Math.cos(i)*n,Math.sin(i)*n]},n};var jc=-Bo/2,Lc=2*Bo-1e-6;vo.svg.line.radial=function(){var n=Ie(vi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},$e.reverse=We,We.reverse=$e,vo.svg.area=function(){return mi(pt)},vo.svg.area.radial=function(){var n=mi(vi);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},vo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+jc,s=l.call(n,u,r)+jc;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Bo)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=Ce,o=De,a=yi,c=pi,l=di;return n.radius=function(t){return arguments.length?(a=gt(t),n):a},n.source=function(t){return arguments.length?(i=gt(t),n):i},n.target=function(t){return arguments.length?(o=gt(t),n):o},n.startAngle=function(t){return arguments.length?(c=gt(t),n):c},n.endAngle=function(t){return arguments.length?(l=gt(t),n):l},n},vo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=Ce,e=De,r=Mi;return n.source=function(e){return arguments.length?(t=gt(e),n):t},n.target=function(t){return arguments.length?(e=gt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},vo.svg.diagonal.radial=function(){var n=vo.svg.diagonal(),t=Mi,e=n.projection;return n.projection=function(n){return arguments.length?e(xi(t=n)):t},n},vo.svg.symbol=function(){function n(n,r){return(Hc.get(t.call(this,n,r))||wi)(e.call(this,n,r))}var t=_i,e=bi;return n.type=function(e){return arguments.length?(t=gt(e),n):t},n.size=function(t){return arguments.length?(e=gt(t),n):e},n};var Hc=vo.map({circle:wi,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*Rc)),e=t*Rc;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},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/Oc),e=t*Oc/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Oc),e=t*Oc/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});vo.svg.symbolTypes=Hc.keys();var Fc,Pc,Oc=Math.sqrt(3),Rc=Math.tan(30*Jo),Yc=[],Ic=0;Yc.call=Oo.call,Yc.empty=Oo.empty,Yc.node=Oo.node,Yc.size=Oo.size,vo.transition=function(n){return arguments.length?Fc?n.transition():n:Io.transition()},vo.transition.prototype=Yc,Oo.transition=function(){for(var n,t,e=Fc||++Ic,r=[],u=Pc||{time:Date.now(),ease:zr,delay:0,duration:250},i=-1,o=this.length;++i<o;){r.push(n=[]);for(var a=this[i],c=-1,l=a.length;++c<l;)(t=a[c])&&Ni(t,c,e,u),n.push(t)}return Si(r,e)},Oo.interrupt=function(){return this.each(Ei)},Yc.select=function(n){var t,e,r,u=this.id,i=[];n=d(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],l=-1,s=c.length;++l<s;)(r=c[l])&&(e=n.call(r,r.__data__,l,o))?("__data__"in r&&(e.__data__=r.__data__),Ni(e,l,u,r.__transition__[u]),t.push(e)):t.push(null)}return Si(i,u)},Yc.selectAll=function(n){var t,e,r,u,i,o=this.id,a=[];n=v(n);for(var c=-1,l=this.length;++c<l;)for(var s=this[c],f=-1,h=s.length;++f<h;)if(r=s[f]){i=r.__transition__[o],e=n.call(r,r.__data__,f,c),a.push(t=[]);for(var g=-1,p=e.length;++g<p;)(u=e[g])&&Ni(u,g,o,i),t.push(u)}return Si(a,o)},Yc.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=k(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a)&&t.push(r)}return Si(u,this.id)},Yc.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):N(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Yc.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Br:Sr,a=vo.ns.qualify(n);return ki(this,"attr."+n,t,a.local?i:u)},Yc.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=vo.ns.qualify(n);
24
24
  return this.tween("attr."+n,u.local?r:e)},Yc.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=bo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=Sr(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return ki(this,"style."+n,t,u)},Yc.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,bo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Yc.text=function(n){return ki(this,"text",n,Ai)},Yc.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Yc.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=vo.ease.apply(vo,arguments)),N(this,function(e){e.__transition__[t].ease=n}))},Yc.delay=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Yc.duration=function(n){var t=this.id;return N(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Yc.each=function(n,t){var e=this.id;if(arguments.length<2){var r=Pc,u=Fc;Fc=e,N(this,function(t,r,u){Pc=t.__transition__[e],n.call(t,t.__data__,r,u)}),Pc=r,Fc=u}else N(this,function(r){var u=r.__transition__[e];(u.event||(u.event=vo.dispatch("start","end"))).on(n,t)});return this},Yc.transition=function(){for(var n,t,e,r,u=this.id,i=++Ic,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],l=0,s=t.length;s>l;l++)(e=t[l])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Ni(e,l,i,r)),n.push(e)}return Si(o,i)},vo.svg.axis=function(){function n(n){n.each(function(){var n,l=vo.select(this),s=null==c?e.ticks?e.ticks.apply(e,a):e.domain():c,f=null==t?e.tickFormat?e.tickFormat.apply(e,a):pt:t,h=l.selectAll(".tick").data(s,pt),g=h.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),p=vo.transition(h.exit()).style("opacity",1e-6).remove(),d=vo.transition(h).style("opacity",1),v=Bu(e),m=l.selectAll(".domain").data([0]),y=(m.enter().append("path").attr("class","domain"),vo.transition(m)),M=e.copy(),x=this.__chart__||M;this.__chart__=M,g.append("line"),g.append("text");var b=g.select("line"),_=d.select("line"),w=h.select("text").text(f),S=g.select("text"),E=d.select("text");switch(r){case"bottom":n=qi,b.attr("y2",u),S.attr("y",Math.max(u,0)+o),_.attr("x2",0).attr("y2",u),E.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+i+"V0H"+v[1]+"V"+i);break;case"top":n=qi,b.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),_.attr("x2",0).attr("y2",-u),E.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),y.attr("d","M"+v[0]+","+-i+"V0H"+v[1]+"V"+-i);break;case"left":n=Ti,b.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),_.attr("x2",-u).attr("y2",0),E.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),y.attr("d","M"+-i+","+v[0]+"H0V"+v[1]+"H"+-i);break;case"right":n=Ti,b.attr("x2",u),S.attr("x",Math.max(u,0)+o),_.attr("x2",u).attr("y2",0),E.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),y.attr("d","M"+i+","+v[0]+"H0V"+v[1]+"H"+i)}if(e.rangeBand){var k=M.rangeBand()/2,A=function(n){return M(n)+k};g.call(n,A),d.call(n,A)}else g.call(n,x),d.call(n,M),p.call(n,M)})}var t,e=vo.scale.linear(),r=Uc,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Vc?t+"":Uc,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Uc="bottom",Vc={top:1,right:1,bottom:1,left:1};vo.svg.brush=function(){function n(i){i.each(function(){var i=vo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(v,pt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Zc[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"),a.style("display",n.empty()?"none":null);var s,f=vo.transition(i),h=vo.transition(o);c&&(s=Bu(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),e(f)),l&&(s=Bu(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function r(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){var n=vo.event.changedTouches;return n?vo.touches(_,n)[0]:vo.mouse(_)}function g(){32==vo.event.keyCode&&(q||(x=null,z[0]-=s[1],z[1]-=h[1],q=2),f())}function v(){32==vo.event.keyCode&&2==q&&(z[0]+=s[1],z[1]+=h[1],q=0,f())}function m(){var n=u(),i=!1;b&&(n[0]+=b[0],n[1]+=b[1]),q||(vo.event.altKey?(x||(x=[(s[0]+s[1])/2,(h[0]+h[1])/2]),z[0]=s[+(n[0]<x[0])],z[1]=h[+(n[1]<x[1])]):x=null),A&&y(n,c,0)&&(e(E),i=!0),N&&y(n,l,1)&&(r(E),i=!0),i&&(t(E),S({type:"brush",mode:q?"move":"resize"}))}function y(n,t,e){var r,u,a=Bu(t),c=a[0],l=a[1],f=z[e],g=e?h:s,v=g[1]-g[0];return q&&(c-=f,l-=v+f),r=(e?d:p)?Math.max(c,Math.min(l,n[e])):n[e],q?u=(r+=f)+v:(x&&(f=Math.max(c,Math.min(l,2*x[e]-r))),r>f?(u=r,r=f):u=f),g[0]!=r||g[1]!=u?(e?o=null:i=null,g[0]=r,g[1]=u,!0):void 0}function M(){m(),E.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),vo.select("body").style("cursor",null),C.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),S({type:"brushend"})}var x,b,_=this,w=vo.select(vo.event.target),S=a.of(_,arguments),E=vo.select(_),k=w.datum(),A=!/^(n|s)$/.test(k)&&c,N=!/^(e|w)$/.test(k)&&l,q=w.classed("extent"),T=j(),z=u(),C=vo.select(bo).on("keydown.brush",g).on("keyup.brush",v);if(vo.event.changedTouches?C.on("touchmove.brush",m).on("touchend.brush",M):C.on("mousemove.brush",m).on("mouseup.brush",M),E.interrupt().selectAll("*").interrupt(),q)z[0]=s[0]-z[0],z[1]=h[0]-z[1];else if(k){var D=+/w$/.test(k),L=+/^n/.test(k);b=[s[1-D]-z[0],h[1-L]-z[1]],z[0]=s[D],z[1]=h[L]}else vo.event.altKey&&(x=z.slice());E.style("pointer-events","none").selectAll(".resize").style("display",null),vo.select("body").style("cursor",w.style("cursor")),S({type:"brushstart"}),m()}var i,o,a=g(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],h=[0,0],p=!0,d=!0,v=Xc[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:h,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Fc?vo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=Er(s,t.x),r=Er(h,t.y);return i=o=null,function(u){s=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Xc[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,v=Xc[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(p=!!t[0],d=!!t[1]):c?p=!!t:l&&(d=!!t),n):c&&l?[p,d]:c?p:l?d:null},n.extent=function(t){var e,r,u,a,f;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(f=e,e=r,r=f),(e!=s[0]||r!=s[1])&&(s=[e,r])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(f=u,u=a,a=f),(u!=h[0]||a!=h[1])&&(h=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(f=e,e=r,r=f))),l&&(o?(u=o[0],a=o[1]):(u=h[0],a=h[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(f=u,u=a,a=f))),c&&l?[[e,u],[r,a]]:c?[e,r]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&h[0]==h[1]},vo.rebind(n,a,"on")};var Zc={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Xc=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bc=vo.time={},$c=Date,Wc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];zi.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(){Jc.setUTCDate.apply(this._,arguments)},setDay:function(){Jc.setUTCDay.apply(this._,arguments)},setFullYear:function(){Jc.setUTCFullYear.apply(this._,arguments)},setHours:function(){Jc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Jc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Jc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Jc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Jc.setUTCSeconds.apply(this._,arguments)},setTime:function(){Jc.setTime.apply(this._,arguments)}};var Jc=Date.prototype,Gc="%a %b %e %X %Y",Kc="%m/%d/%Y",Qc="%H:%M:%S",nl=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],tl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],el=["January","February","March","April","May","June","July","August","September","October","November","December"],rl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Bc.year=Ci(function(n){return n=Bc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Bc.years=Bc.year.range,Bc.years.utc=Bc.year.utc.range,Bc.day=Ci(function(n){var t=new $c(2e3,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}),Bc.days=Bc.day.range,Bc.days.utc=Bc.day.utc.range,Bc.dayOfYear=function(n){var t=Bc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},Wc.forEach(function(n,t){n=n.toLowerCase(),t=7-t;var e=Bc[n]=Ci(function(n){return(n=Bc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Bc.year(n).getDay();return Math.floor((Bc.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Bc[n+"s"]=e.range,Bc[n+"s"].utc=e.utc.range,Bc[n+"OfYear"]=function(n){var e=Bc.year(n).getDay();return Math.floor((Bc.dayOfYear(n)+(e+t)%7)/7)}}),Bc.week=Bc.sunday,Bc.weeks=Bc.sunday.range,Bc.weeks.utc=Bc.sunday.utc.range,Bc.weekOfYear=Bc.sundayOfYear,Bc.format=ji;var ul=Hi(nl),il=Fi(nl),ol=Hi(tl),al=Fi(tl),cl=Hi(el),ll=Fi(el),sl=Hi(rl),fl=Fi(rl),hl=/^%/,gl={"-":"",_:" ",0:"0"},pl={a:function(n){return tl[n.getDay()]},A:function(n){return nl[n.getDay()]},b:function(n){return rl[n.getMonth()]},B:function(n){return el[n.getMonth()]},c:ji(Gc),d:function(n,t){return Pi(n.getDate(),t,2)},e:function(n,t){return Pi(n.getDate(),t,2)},H:function(n,t){return Pi(n.getHours(),t,2)},I:function(n,t){return Pi(n.getHours()%12||12,t,2)},j:function(n,t){return Pi(1+Bc.dayOfYear(n),t,3)},L:function(n,t){return Pi(n.getMilliseconds(),t,3)},m:function(n,t){return Pi(n.getMonth()+1,t,2)},M:function(n,t){return Pi(n.getMinutes(),t,2)},p:function(n){return n.getHours()>=12?"PM":"AM"},S:function(n,t){return Pi(n.getSeconds(),t,2)},U:function(n,t){return Pi(Bc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Pi(Bc.mondayOfYear(n),t,2)},x:ji(Kc),X:ji(Qc),y:function(n,t){return Pi(n.getFullYear()%100,t,2)},Y:function(n,t){return Pi(n.getFullYear()%1e4,t,4)},Z:oo,"%":function(){return"%"}},dl={a:Oi,A:Ri,b:Vi,B:Zi,c:Xi,d:Qi,e:Qi,H:to,I:to,j:no,L:uo,m:Ki,M:eo,p:io,S:ro,U:Ii,w:Yi,W:Ui,x:Bi,X:$i,y:Ji,Y:Wi,"%":ao},vl=/^\s*\d+/,ml=vo.map({am:0,pm:1});ji.utc=co;var yl=co("%Y-%m-%dT%H:%M:%S.%LZ");ji.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?lo:yl,lo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},lo.toString=yl.toString,Bc.second=Ci(function(n){return new $c(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Bc.seconds=Bc.second.range,Bc.seconds.utc=Bc.second.utc.range,Bc.minute=Ci(function(n){return new $c(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Bc.minutes=Bc.minute.range,Bc.minutes.utc=Bc.minute.utc.range,Bc.hour=Ci(function(n){var t=n.getTimezoneOffset()/60;return new $c(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Bc.hours=Bc.hour.range,Bc.hours.utc=Bc.hour.utc.range,Bc.month=Ci(function(n){return n=Bc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Bc.months=Bc.month.range,Bc.months.utc=Bc.month.utc.range;var Ml=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],xl=[[Bc.second,1],[Bc.second,5],[Bc.second,15],[Bc.second,30],[Bc.minute,1],[Bc.minute,5],[Bc.minute,15],[Bc.minute,30],[Bc.hour,1],[Bc.hour,3],[Bc.hour,6],[Bc.hour,12],[Bc.day,1],[Bc.day,2],[Bc.week,1],[Bc.month,1],[Bc.month,3],[Bc.year,1]],bl=[[ji("%Y"),Vt],[ji("%B"),function(n){return n.getMonth()}],[ji("%b %d"),function(n){return 1!=n.getDate()}],[ji("%a %d"),function(n){return n.getDay()&&1!=n.getDate()}],[ji("%I %p"),function(n){return n.getHours()}],[ji("%I:%M"),function(n){return n.getMinutes()}],[ji(":%S"),function(n){return n.getSeconds()}],[ji(".%L"),function(n){return n.getMilliseconds()}]],_l=ho(bl);xl.year=Bc.year,Bc.scale=function(){return so(vo.scale.linear(),xl,_l)};var wl={range:function(n,t,e){return vo.range(+n,+t,e).map(fo)}},Sl=xl.map(function(n){return[n[0].utc,n[1]]}),El=[[co("%Y"),Vt],[co("%B"),function(n){return n.getUTCMonth()}],[co("%b %d"),function(n){return 1!=n.getUTCDate()}],[co("%a %d"),function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],[co("%I %p"),function(n){return n.getUTCHours()}],[co("%I:%M"),function(n){return n.getUTCMinutes()}],[co(":%S"),function(n){return n.getUTCSeconds()}],[co(".%L"),function(n){return n.getUTCMilliseconds()}]],kl=ho(El);return Sl.year=Bc.year.utc,Bc.scale.utc=function(){return so(vo.scale.linear(),Sl,kl)},vo.text=dt(function(n){return n.responseText}),vo.json=function(n,t){return vt(n,"application/json",go,t)},vo.html=function(n,t){return vt(n,"text/html",po,t)},vo.xml=dt(function(n){return n.responseXML}),vo}();
25
25
  // plot.js
26
- var GV;GV||(GV={}),function(){"use strict";GV.toggleAllPlots=function(t){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var a=$(".plot_btn");a.length>30?$("#alert").modal():($("#spinner1").modal({backdrop:"static",keyboard:"false"}),"pressed"!==t.status?(t.status="pressed",$("#show_all_plots").html("Hide All Charts"),GV.showAllPlots()):(t.status="released",$("#show_all_plots").html("Show All Charts"),GV.removeAllPlots()),$("#spinner1").modal("hide"))}},GV.showAllPlots=function(){$(".plot_btn").each(function(){"pressed"!==this.status&&GV.addData(this,"all")})},GV.removeAllPlots=function(){$(".tablesorter-childRow").each(function(){$(this).remove()}),$(".plot_btn").each(function(){this.status="released"})},GV.addData=function(t,a){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var e=$(t).closest("tr"),r=e.attr("data-target"),n=$("#mainrow"+r);n.length&&"pressed"!==t.status?(GV.emptyChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):0===n.length?(GV.createChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):n.length&&GV.removeChildRow(e,n,t),$("table").trigger("update")}},GV.toggleOverviewBtn=function(){if(window.chrome&&"file:"===window.location.protocol)$("#overview").remove();else{var t="files/json/overview.json";$.getJSON(t,function(t){var a=$("<span>"+t.less+"</span><br>"),e=$("<span>"+t.evaluation+"</span><br>");$("#overview_btn").hasClass("active")?($("#overview_text").html(e),$("#overview_btn").text("Show Less"),GV.addPlot(t.data,"overview",t.type,t.title,t.footer,t.xtitle,t.ytitle)):($("#overview").find("svg").remove(),$("#overview_text").html(a),$("#overview_btn").text("Show More"))})}},GV.createChildRow=function(t,a,e){var r='<tr class="tablesorter-childRow" id="mainrow'+a+'"><td colspan="12" id="row'+a+'"><div id="'+a+'" class="expanded-child"></div></td></tr>';t.addClass("tablesorter-hasChildRow"),t.after(r),e.status="pressed"},GV.removeChildRow=function(t,a,e){t.removeClass("tablesorter-hasChildRow"),a.remove(),e.status="released"},GV.emptyChildRow=function(t,a,e){var r="#"+a,n="#"+a+"explanation";$(r).empty(),$(n).remove(),GV.resetStatusOfOtherButtons(t),e.status="pressed"},GV.resetStatusOfOtherButtons=function(t){t.find("td").each(function(){"pressed"==this.status&&(this.status="released")}),t.find(".plot_btn").each(function(){"pressed"==this.status&&(this.status="released")})},GV.addDataToChildRow=function(t,a,e){var r=t.attr("data-jsonFile");$.getJSON(r,function(t){if("all"===e)for(var r in t.validations)void 0!==t.validations[r].graphs&&GV.generatePlotCommands(t.validations[r].graphs,a);else GV.addExplanation(a,t.validations[e]),void 0!==t.validations[e].graphs&&GV.generatePlotCommands(t.validations[e].graphs,a)})},GV.generatePlotCommands=function(t,a){for(var e=0;e<t.length;e++){var r=t[e];GV.addPlot(r.data,a,r.type,r.title,r.footer,r.xtitle,r.ytitle,r.aux1,r.aux2)}},GV.addExplanation=function(t,a){var e="#row"+t,r="<p><b>Approach:</b> "+a.approach+"</p>",n="<p><b>Explanation:</b> "+a.explanation+"</p>",o="<p><b>Conclusion:</b> "+a.conclusion+"</p>",l=$('<div id="'+t+'explanation" class="alert alert-info explanation_alert" role="alert">'+r+n+o+"</div>");$(e).prepend(l)},GV.addPlot=function(t,a,e,r,n,o,l,s,i){var c;switch(c=""===n?[]:n.split(";"),e){case"scatter":GV.plot_scatter(t,a,r,n,o,l,s,i);break;case"bars":GV.plot_bars(t,a,r,c,o,l,s);break;case"simplebars":GV.plot_simple_bars(t,a,r,c,o,l);break;case"lines":null!==i&&(i=i.split(",")),GV.plot_lines(t,a,r,c,o,l,s,i);break;case"align":null!==i&&(i=i.split(",")),GV.plot_align(t,a,r,c,o,l,s,i)}},GV.color_beautification=function(t){switch(t){case"red":return d3.rgb(189,54,47);case"blue":return d3.rgb(58,135,173);case"green":return d3.rgb(70,136,71);case"yellow":return d3.rgb(255,255,51);case"orange":return d3.rgb(248,148,6);case"violet":return d3.rgb(153,0,153);case"gray":return d3.rgb(160,160,160);default:return t}},GV.plot_bars=function(t,a,e,r,n,o,l){var s={top:70,right:50,bottom:75,left:50},i=600-s.left-s.right,c=500-s.top-s.bottom,d=d3.select("#".concat(a)).append("svg").attr("width",i+s.left+s.right).attr("height",c+s.top+s.bottom).append("g").attr("transform","translate("+s.left+","+s.top+")");d.append("text").attr("x",i/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var p=100,u=[].concat.apply([],t),f=d3.max(u,function(t){return t.value})+3,h=d3.scale.linear().domain([0,f+f/10]).range([c,0]),x=d3.min(u,function(t){return t.key});void 0!==l&&(x=Math.min(x,l));var g=d3.max(u,function(t){return t.key});void 0!==l&&(g=Math.max(g,l));var m=d3.scale.linear().domain([x-p,g+p]).range([13,i]),v=d3.svg.axis().scale(m).orient("bottom").ticks(8),y=d3.svg.axis().scale(h).orient("left").tickFormat(d3.format("d")).ticks(8);d.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(v).append("text").attr("class","label").attr("x",(i-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),d.append("g").attr("class","y axis").call(y).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(c+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){d.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return m(t.key)}).attr("width",6).attr("y",function(t){return h(t.value)}).attr("height",function(t){return c-h(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})}),void 0!==l&&(d.append("rect").attr("x",m(l)).attr("width",4).attr("y",h(f+f/10)).style("opacity",.6).attr("height",c-h(f+f/8)).attr("fill",GV.color_beautification("black")),d.append("text").attr("transform","rotate(-90)").attr("x",-f/10-35).attr("y",m(l)-5).text("query"));for(var b=0,w=0,G=0;G<r.length;G++){var V=r[G].split(",");w=w+8*V[0].length+15}for(var k=0;k<r.length;k++){var _=r[k].split(",");d.append("rect").attr("x",(i-w)/2+b).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(_[1].replace(/\s+/g,""))),d.append("text").attr("x",(i-w)/2+b+15).attr("y",-20).text(_[0]),b=b+8*_[0].length+15}},GV.plot_simple_bars=function(t,a,e,r,n,o){var l={top:70,right:50,bottom:75,left:50},s=600-l.left-l.right,i=500-l.top-l.bottom,c=d3.select("#".concat(a)).append("svg").attr("width",s+l.left+l.right).attr("height",i+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")");c.append("text").attr("x",s/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var d=0,p=[].concat.apply([],t),u=d3.max(p,function(t){return t.value})+3,f=d3.scale.linear().domain([0,u]).range([i,0]),h=d3.min(p,function(t){return t.key}),x=d3.max(p,function(t){return t.key}),g=d3.scale.linear().domain([h-d,x+d]).range([13,s]),m=d3.svg.axis().scale(g).orient("bottom").ticks(8),v=d3.svg.axis().scale(f).orient("left").tickFormat(d3.format("d")).ticks(8);c.append("g").attr("class","x axis").attr("transform","translate(0,"+i+")").call(m).append("text").attr("class","label").attr("x",(s-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),c.append("g").attr("class","y axis").call(v).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(i+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){c.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return g(t.key)}).attr("width",6).attr("y",function(t){return f(t.value)}).attr("height",function(t){return i-f(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})})},GV.plot_scatter=function(t,a,e,r,n,o,l,s){var i={top:50,right:30,bottom:75,left:50},c=500-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(8)),h=d3.svg.axis().scale(u).orient("left").tickFormat(d3.format("d")).ticks(8),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-25).attr("text-anchor","middle").style("font-size","16px").text(e),x.append("text").attr("x",c/2).attr("y",d+55).attr("text-anchor","middle").style("font-size","12px").text(r);var g=d3.max(t,function(t){return t.x}),m=d3.min(t,function(t){return t.x}),v=d3.max(t,function(t){return t.y}),y=d3.min(t,function(t){return t.y});if(p.domain(d3.extent(t,function(t){return t.x})).nice(),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("circle").attr("r",2).attr("cx",function(t){return p(t.x)}).attr("cy",function(t){return u(t.y)}).style("fill",function(){return GV.color_beautification("red")}).style("opacity",.6),void 0!==s&&""!==s&&void 0!==l&&""!==l){l=parseFloat(l.replace(",","."));var b=g,w=l+s*g;w>v&&(b=(v-l)/s,w=v),y>w&&(b=(y-l)/s,w=y);var G=m,V=l+s*m;V>v&&(G=(v-l)/s,V=y),y>V&&(G=(y-l)/s,V=y),x.append("line").attr("x1",p(G)).attr("y1",u(V)).attr("x2",p(b)).attr("y2",u(w)).attr("stroke-width",2).attr("stroke","black")}},GV.plot_lines=function(t,a,e,r,n,o,l,s){var i={top:70,right:50,bottom:75,left:50},c=600-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),"");f="Open Reading Frames in all 6 Frames"===e?d3.svg.axis().scale(p).orient("bottom").ticks(0):d3.svg.axis().scale(p).orient("bottom").ticks(5);var h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return void 0===t.dotted?"red"==t.color?d/l/2.5:d/l:d/l/5}).style("stroke-dasharray",function(t){return void 0===t.dotted?"0, 0":"2, 6"}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=(x.append("g").attr("class","legend").attr("height",100).attr("width",100).attr("transform","translate(-20,50)"),40),v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}},GV.plot_align=function(t,a,e,r,n,o,l,s){var i={top:75,right:50,bottom:75,left:150},c=600-i.left-i.right,d=300-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(5)),h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").style("vertical-align","top").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return-1==t.height?d/l:d/l*t.height}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=0,v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}}}();
26
+ var GV;GV||(GV={}),function(){"use strict";GV.toggleAllPlots=function(t){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var a=$(".plot_btn");a.length>30?$("#alert").modal():($("#spinner1").modal({backdrop:"static",keyboard:"false"}),"pressed"!==t.status?(t.status="pressed",$("#show_all_plots").html("Hide All Charts"),GV.showAllPlots()):(t.status="released",$("#show_all_plots").html("Show All Charts"),GV.removeAllPlots()),$("#spinner1").modal("hide"))}},GV.showAllPlots=function(){$(".plot_btn").each(function(){"pressed"!==this.status&&GV.addData(this,"all")})},GV.removeAllPlots=function(){$(".tablesorter-childRow").each(function(){$(this).remove()}),$(".plot_btn").each(function(){this.status="released"})},GV.addData=function(t,a){if(window.chrome&&"file:"===window.location.protocol)$("#browseralert").modal();else{var e=$(t).closest("tr"),r=e.attr("data-target"),n=$("#mainrow"+r);n.length&&"pressed"!==t.status?(GV.emptyChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):0===n.length?(GV.createChildRow(e,r,t),GV.addDataToChildRow(e,r,a)):n.length&&GV.removeChildRow(e,n,t),$("table").trigger("update")}},GV.toggleOverviewBtn=function(){if(window.chrome&&"file:"===window.location.protocol)$("#overview").remove();else{var t="files/json/overview.json";$.getJSON(t,function(t){var a=$("<span>"+t.less+"</span><br>"),e=$("<span>"+t.evaluation+"</span><br>");$("#overview_btn").hasClass("active")?($("#overview_text").html(e),$("#overview_btn").text("Show Less"),GV.addPlot(t.data,"overview",t.type,t.title,t.footer,t.xtitle,t.ytitle)):($("#overview").find("svg").remove(),$("#overview_text").html(a),$("#overview_btn").text("Show More"))})}},GV.createChildRow=function(t,a,e){var r='<tr class="tablesorter-childRow" id="mainrow'+a+'"><td colspan="20" id="row'+a+'"><div id="'+a+'" class="expanded-child"></div></td></tr>';t.addClass("tablesorter-hasChildRow"),t.after(r),e.status="pressed"},GV.removeChildRow=function(t,a,e){t.removeClass("tablesorter-hasChildRow"),a.remove(),e.status="released"},GV.emptyChildRow=function(t,a,e){var r="#"+a,n="#"+a+"explanation";$(r).empty(),$(n).remove(),GV.resetStatusOfOtherButtons(t),e.status="pressed"},GV.resetStatusOfOtherButtons=function(t){t.find("td").each(function(){"pressed"==this.status&&(this.status="released")}),t.find(".plot_btn").each(function(){"pressed"==this.status&&(this.status="released")})},GV.addDataToChildRow=function(t,a,e){var r=t.attr("data-jsonFile");$.getJSON(r,function(t){if("all"===e)for(var r in t.validations)void 0!==t.validations[r].graphs&&GV.generatePlotCommands(t.validations[r].graphs,a);else GV.addExplanation(a,t.validations[e]),void 0!==t.validations[e].graphs&&GV.generatePlotCommands(t.validations[e].graphs,a)})},GV.generatePlotCommands=function(t,a){for(var e=0;e<t.length;e++){var r=t[e];GV.addPlot(r.data,a,r.type,r.title,r.footer,r.xtitle,r.ytitle,r.aux1,r.aux2)}},GV.addExplanation=function(t,a){var e="#row"+t,r="<p><b>Approach:</b> "+a.approach+"</p>",n="<p><b>Explanation:</b> "+a.explanation+"</p>",o="<p><b>Conclusion:</b> "+a.conclusion+"</p>",l=$('<div id="'+t+'explanation" class="alert alert-info explanation_alert" role="alert">'+r+n+o+"</div>");$(e).prepend(l)},GV.addPlot=function(t,a,e,r,n,o,l,s,i){var c;switch(c=""===n?[]:n.split(";"),e){case"scatter":GV.plot_scatter(t,a,r,n,o,l,s,i);break;case"bars":GV.plot_bars(t,a,r,c,o,l,s);break;case"simplebars":GV.plot_simple_bars(t,a,r,c,o,l);break;case"lines":null!==i&&(i=i.split(",")),GV.plot_lines(t,a,r,c,o,l,s,i);break;case"align":null!==i&&(i=i.split(",")),GV.plot_align(t,a,r,c,o,l,s,i)}},GV.color_beautification=function(t){switch(t){case"red":return d3.rgb(189,54,47);case"blue":return d3.rgb(58,135,173);case"green":return d3.rgb(70,136,71);case"yellow":return d3.rgb(255,255,51);case"orange":return d3.rgb(248,148,6);case"violet":return d3.rgb(153,0,153);case"gray":return d3.rgb(160,160,160);default:return t}},GV.plot_bars=function(t,a,e,r,n,o,l){var s={top:70,right:50,bottom:75,left:50},i=600-s.left-s.right,c=500-s.top-s.bottom,d=d3.select("#".concat(a)).append("svg").attr("width",i+s.left+s.right).attr("height",c+s.top+s.bottom).append("g").attr("transform","translate("+s.left+","+s.top+")");d.append("text").attr("x",i/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var p=100,u=[].concat.apply([],t),f=d3.max(u,function(t){return t.value})+3,h=d3.scale.linear().domain([0,f+f/10]).range([c,0]),x=d3.min(u,function(t){return t.key});void 0!==l&&(x=Math.min(x,l));var g=d3.max(u,function(t){return t.key});void 0!==l&&(g=Math.max(g,l));var m=d3.scale.linear().domain([x-p,g+p]).range([13,i]),v=d3.svg.axis().scale(m).orient("bottom").ticks(8),y=d3.svg.axis().scale(h).orient("left").tickFormat(d3.format("d")).ticks(8);d.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(v).append("text").attr("class","label").attr("x",(i-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),d.append("g").attr("class","y axis").call(y).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(c+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){d.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return m(t.key)}).attr("width",6).attr("y",function(t){return h(t.value)}).attr("height",function(t){return c-h(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})}),void 0!==l&&(d.append("rect").attr("x",m(l)).attr("width",4).attr("y",h(f+f/10)).style("opacity",.6).attr("height",c-h(f+f/8)).attr("fill",GV.color_beautification("black")),d.append("text").attr("transform","rotate(-90)").attr("x",-f/10-35).attr("y",m(l)-5).text("query"));for(var b=0,w=0,G=0;G<r.length;G++){var V=r[G].split(",");w=w+8*V[0].length+15}for(var k=0;k<r.length;k++){var _=r[k].split(",");d.append("rect").attr("x",(i-w)/2+b).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(_[1].replace(/\s+/g,""))),d.append("text").attr("x",(i-w)/2+b+15).attr("y",-20).text(_[0]),b=b+8*_[0].length+15}},GV.plot_simple_bars=function(t,a,e,r,n,o){var l={top:70,right:50,bottom:75,left:50},s=600-l.left-l.right,i=500-l.top-l.bottom,c=d3.select("#".concat(a)).append("svg").attr("width",s+l.left+l.right).attr("height",i+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")");c.append("text").attr("x",s/2).attr("y",-45).attr("text-anchor","middle").style("font-size","16px").text(e);var d=0,p=[].concat.apply([],t),u=d3.max(p,function(t){return t.value})+3,f=d3.scale.linear().domain([0,u]).range([i,0]),h=d3.min(p,function(t){return t.key}),x=d3.max(p,function(t){return t.key}),g=d3.scale.linear().domain([h-d,x+d]).range([13,s]),m=d3.svg.axis().scale(g).orient("bottom").ticks(8),v=d3.svg.axis().scale(f).orient("left").tickFormat(d3.format("d")).ticks(8);c.append("g").attr("class","x axis").attr("transform","translate(0,"+i+")").call(m).append("text").attr("class","label").attr("x",(s-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),c.append("g").attr("class","y axis").call(v).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(i+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),t.map(function(t){c.selectAll(".bar").data(t).enter().append("rect").attr("x",function(t){return g(t.key)}).attr("width",6).attr("y",function(t){return f(t.value)}).attr("height",function(t){return i-f(t.value)}).attr("fill",function(t){return t.main===!0?GV.color_beautification("red"):GV.color_beautification("blue")})})},GV.plot_scatter=function(t,a,e,r,n,o,l,s){var i={top:50,right:30,bottom:75,left:50},c=500-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(8)),h=d3.svg.axis().scale(u).orient("left").tickFormat(d3.format("d")).ticks(8),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-25).attr("text-anchor","middle").style("font-size","16px").text(e),x.append("text").attr("x",c/2).attr("y",d+55).attr("text-anchor","middle").style("font-size","12px").text(r);var g=d3.max(t,function(t){return t.x}),m=d3.min(t,function(t){return t.x}),v=d3.max(t,function(t){return t.y}),y=d3.min(t,function(t){return t.y});if(p.domain(d3.extent(t,function(t){return t.x})).nice(),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("circle").attr("r",2).attr("cx",function(t){return p(t.x)}).attr("cy",function(t){return u(t.y)}).style("fill",function(){return GV.color_beautification("red")}).style("opacity",.6),void 0!==s&&""!==s&&void 0!==l&&""!==l){l=parseFloat(l.replace(",","."));var b=g,w=l+s*g;w>v&&(b=(v-l)/s,w=v),y>w&&(b=(y-l)/s,w=y);var G=m,V=l+s*m;V>v&&(G=(v-l)/s,V=y),y>V&&(G=(y-l)/s,V=y),x.append("line").attr("x1",p(G)).attr("y1",u(V)).attr("x2",p(b)).attr("y2",u(w)).attr("stroke-width",2).attr("stroke","black")}},GV.plot_lines=function(t,a,e,r,n,o,l,s){var i={top:70,right:50,bottom:75,left:50},c=600-i.left-i.right,d=500-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),"");f="Open Reading Frames in all 6 Frames"===e?d3.svg.axis().scale(p).orient("bottom").ticks(0):d3.svg.axis().scale(p).orient("bottom").ticks(5);var h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return void 0===t.dotted?"red"==t.color?d/l/2.5:d/l:d/l/5}).style("stroke-dasharray",function(t){return void 0===t.dotted?"0, 0":"2, 6"}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=(x.append("g").attr("class","legend").attr("height",100).attr("width",100).attr("transform","translate(-20,50)"),40),v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}},GV.plot_align=function(t,a,e,r,n,o,l,s){var i={top:75,right:50,bottom:75,left:150},c=600-i.left-i.right,d=300-i.top-i.bottom,p=d3.scale.linear().range([0,c]),u=d3.scale.linear().range([d,0]),f=(d3.scale.category10(),d3.svg.axis().scale(p).orient("bottom").ticks(5)),h=d3.svg.axis().scale(u).orient("left").ticks(5),x=d3.select("#".concat(a)).append("svg").style("vertical-align","top").attr("width",c+i.left+i.right).attr("height",d+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");x.append("text").attr("x",c/2).attr("y",-35).attr("text-anchor","middle").style("font-size","16px").text(e);var g=-1;p.domain([0,d3.max(t,function(t){return t.stop})]),u.domain(d3.extent(t,function(t){return t.y})).nice(),x.append("g").attr("class","x axis").attr("transform","translate(0,"+(d+d/l)+")").call(f).append("text").attr("class","label").attr("x",(c-n.length)/2-50).attr("y",35).style("text-anchor","start").text(n),null!==s?x.append("g").attr("class","y axis").call(h.ticks(s.length).tickFormat(function(){return g+=1,s[g]})).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o):x.append("g").attr("class","y axis").call(h).append("text").attr("class","label").attr("transform","rotate(-90)").attr("x",-(d+o.length)/2-50).attr("y",-40).style("text-anchor","start").text(o),x.selectAll(".dot").data(t).enter().append("line").attr("x1",function(t){return p(t.start)}).attr("y1",function(t){return u(t.y)}).attr("x2",function(t){return p(t.stop)}).attr("y2",function(t){return u(t.y)}).attr("stroke-width",function(t){return-1==t.height?d/l:d/l*t.height}).attr("stroke",function(t){return GV.color_beautification(t.color)});for(var m=0,v=0,y=0;y<r.length;y++){var b=r[y].split(",");v=v+8*b[0].length+15}for(var w=0;w<r.length;w++){var G=r[w].split(",");x.append("rect").attr("x",(c-v)/2+m).attr("y",-30).attr("width",10).attr("height",10).style("fill",GV.color_beautification(G[1].replace(/\s+/g,""))),x.append("text").attr("x",(c-v)/2+m+15).attr("y",-20).text(G[0]),m=m+8*G[0].length+15}}}();
27
27
  // Script.js
28
28
  function initTableSorter(){$.tablesorter.addParser({id:"star_scores",is:function(){return!1},format:function(t,e,r,a){var s=$(r);return 1===a?s.attr("data-score")||t:t},parsed:!1,type:"numeric"}),$("table").tablesorter({headers:{1:{sorter:"star_scores"}},sortList:[[0,0]]})}$(document).ready(function(){window.chrome&&"file:"===window.location.protocol&&($("#mainbrowseralertText").text("Some features are not supported in this browser and have been disabled."),$("#browseralert").modal()),GV.toggleOverviewBtn(),initTableSorter(),$("[data-toggle='tooltip']").tooltip()}),$(document).on("click","td, .plot_btn",function(t){if($(this).hasClass("success")||$(this).hasClass("danger")){var e=$(this).attr("title"),r=e.replace(/[ \/]/g,"");GV.addData(this,r)}else $(this).hasClass("plot_btn")&&GV.addData(this,"all")});
@@ -103,7 +103,7 @@ if (!GV) {
103
103
 
104
104
  GV.createChildRow = function ($currentRow, target, source) {
105
105
  var childRowHTML = '<tr class="tablesorter-childRow" id="mainrow' + target +
106
- '"><td colspan="12" id="row' + target + '"><div id="' +
106
+ '"><td colspan="20" id="row' + target + '"><div id="' +
107
107
  target + '" class="expanded-child"></div></td></tr>';
108
108
  $currentRow.addClass('tablesorter-hasChildRow');
109
109
  $currentRow.after(childRowHTML);
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency('minitest', '~> 5.4')
27
27
  s.add_dependency('bio', '~> 1.4')
28
28
  s.add_dependency('bio-blastxmlparser', '~>2.0')
29
- s.add_dependency('statsample', '1.4') # Updating to 1.5 breaks GV
29
+ s.add_dependency('statsample', '2.0.1')
30
30
 
31
31
  s.files = `git ls-files -z`.split("\x0")
32
32
  s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -50,6 +50,8 @@ module GeneValidator
50
50
  @opt[:num_threads] = Integer(@opt[:num_threads])
51
51
  unless @opt[:num_threads] > 0
52
52
  $stderr.puts 'Number of threads can not be lower than 0'
53
+ $stderr.puts 'Setting number of threads to 1'
54
+ @opt[:num_threads] = 1
53
55
  end
54
56
  return unless @opt[:num_threads] > 256
55
57
  $stderr.puts "Number of threads set at #{@opt[:num_threads]} is" \
@@ -34,4 +34,8 @@ end
34
34
 
35
35
  class Array
36
36
  include GeneValidator::ExtraArrayMethods
37
+
38
+ def mean
39
+ inject(:+).to_f / length
40
+ end
37
41
  end
@@ -1,10 +1,14 @@
1
1
  require 'forwardable'
2
+ # Statsample: must loaded before /ext/array as they modify a built-in class
3
+ require 'statsample'
2
4
 
3
5
  require 'genevalidator/blast'
4
6
  require 'genevalidator/exceptions'
7
+ require 'genevalidator/ext/array'
5
8
  require 'genevalidator/output'
6
9
  require 'genevalidator/pool'
7
10
  require 'genevalidator/query'
11
+ require 'genevalidator/validation_maker_qi'
8
12
  require 'genevalidator/validation_length_cluster'
9
13
  require 'genevalidator/validation_length_rank'
10
14
  require 'genevalidator/validation_blast_reading_frame'
@@ -32,6 +36,8 @@ module GeneValidator
32
36
  def run_validations(iterator)
33
37
  p = Pool.new(@opt[:num_threads]) if @opt[:num_threads] > 1
34
38
 
39
+ check_if_maker_input?
40
+
35
41
  while @config[:idx] + 1 < @query_idx.length
36
42
  prediction = get_info_on_query_sequence
37
43
  @config[:idx] += 1
@@ -74,6 +80,20 @@ module GeneValidator
74
80
  prediction
75
81
  end
76
82
 
83
+ # Adds 'maker' to @opt[:validations] if the first definiton in the input
84
+ # fasta file contains MAKER's QI (quality index) score
85
+ def check_if_maker_input?(input_file = @opt[:input_fasta_file])
86
+ query = IO.binread(input_file, @query_idx[1], @query_idx[0])
87
+ parse_query = query.scan(/>([^\n]*)\n([A-Za-z\n]*)/)[0]
88
+ definition = parse_query[0].gsub("\n", '')
89
+ number = '\d*\.?\d*'
90
+ qi_match = definition.match(/QI:#{number}\|#{number}\|#{number}\|
91
+ #{number}\|#{number}\|#{number}\|
92
+ #{number}\|#{number}\|#{number}/x)
93
+ return if qi_match.nil?
94
+ @opt[:validations] << 'maker_qi'
95
+ end
96
+
77
97
  def parse_next_iteration(iterator, prediction)
78
98
  iterator.next if @config[:idx] < @config[:start_idx]
79
99
  if @opt[:blast_xml_file]
@@ -159,18 +179,22 @@ module GeneValidator
159
179
 
160
180
  def create_validation_tests(prediction, hits)
161
181
  val = []
182
+ val.push MakerQIValidation.new(prediction, hits)
162
183
  val.push LengthClusterValidation.new(prediction, hits)
163
184
  val.push LengthRankValidation.new(prediction, hits)
164
185
  val.push GeneMergeValidation.new(prediction, hits)
165
186
  val.push DuplicationValidation.new(prediction, hits)
166
- if @config[:type] == :nucleotide
167
- val.push BlastReadingFrameValidation.new(prediction, hits)
168
- val.push OpenReadingFrameValidation.new(prediction, hits)
169
- end
187
+ init_nucleotide_only_validations(val, prediction, hits)
170
188
  val.push AlignmentValidation.new(prediction, hits)
171
189
  val.select { |v| @opt[:validations].include? v.cli_name.downcase }
172
190
  end
173
191
 
192
+ def init_nucleotide_only_validations(val, prediction, hits)
193
+ return unless @config[:type] == :nucleotide
194
+ val.push BlastReadingFrameValidation.new(prediction, hits)
195
+ val.push OpenReadingFrameValidation.new(prediction, hits)
196
+ end
197
+
174
198
  def check_validations(vals)
175
199
  # check the class type of the elements in the list
176
200
  vals.each { |v| fail ValidationClassError unless v.is_a? ValidationTest }
@@ -444,7 +444,7 @@ module GeneValidator
444
444
  :align,
445
445
  'Missing/Extra sequences Validation: Multiple Align. &' \
446
446
  'Statistical model of hits',
447
- 'Conserved Region, Yellow',
447
+ 'Aligned Hit Sequence, red; Conserved Region, Yellow',
448
448
  'Offset in the Alignment',
449
449
  '',
450
450
  ma.length + 1,
@@ -251,9 +251,9 @@ module GeneValidator
251
251
  # wilcox test implementation from statsample ruby gem
252
252
  # many thanks to Claudio for helping us with the implementation!
253
253
  def wilcox_test(averages)
254
- wilcox = Statsample::Test.wilcoxon_signed_rank(averages.to_scale,
255
- Array.new(averages.length,
256
- 1).to_scale)
254
+ wilcox = Statsample::Test.wilcoxon_signed_rank(Daru::Vector.new(averages),
255
+ Daru::Vector.new(Array.new(averages.length,
256
+ 1)))
257
257
 
258
258
  (averages.length < 15) ? wilcox.probability_exact : wilcox.probability_z
259
259
  end
@@ -0,0 +1,108 @@
1
+ require 'forwardable'
2
+
3
+ require 'genevalidator/exceptions'
4
+ require 'genevalidator/validation_report'
5
+ require 'genevalidator/validation_test'
6
+
7
+ module GeneValidator
8
+ ##
9
+ # Class that stores the validation output information
10
+ class MakerQIValidationOutput < ValidationReport
11
+ def initialize(short_header, header, description, splice_sites, exons,
12
+ expected = :yes)
13
+ @short_header, @header, @description = short_header, header, description
14
+ @splice_sites = splice_sites
15
+ @exons = exons
16
+ @expected = expected
17
+ @result = validation
18
+ @approach = 'We obtain the fraction of splice sites and exons' \
19
+ ' confirmed by EST/RNASeq alignment from the FASTA' \
20
+ ' defline for MAKER predicted gene models. RNASeq is' \
21
+ ' often best evidence to ascertain the quality of gene' \
22
+ ' models'
23
+ @explanation = explain
24
+ @conclusion = conclude
25
+ end
26
+
27
+ def explain
28
+ "#{@exons}% of exons match an EST/mRNA-seq alignment and" \
29
+ " #{@splice_sites}% of splice sites are confirmed by EST/mRNA-seq" \
30
+ " alignment."
31
+ end
32
+
33
+ def conclude
34
+ if @result == :yes
35
+ 'More than 80% of this gene is confirmed by RNASeq evidence.' \
36
+ 'Thus, the MAKER Quality Index suggests that the query sequence is of' \
37
+ ' a good quality.'
38
+ else
39
+ 'Less than 80% of this gene is confirmed by RNASeq evidence.' \
40
+ 'Thus, the MAKER Quality Index suggests that there may be some issues'\
41
+ ' with the query seqeunce.'
42
+ end
43
+ end
44
+
45
+ def print
46
+ "Exons:&nbsp;#{@exons}%;" \
47
+ " Splice&nbsp;Sites:&nbsp;#{@splice_sites}%"
48
+ end
49
+
50
+ def validation
51
+ (@splice_sites > 80 && @exons > 80) ? :yes : :no
52
+ end
53
+ end
54
+
55
+ ##
56
+ # This class contains the methods necessary for
57
+ # reading frame validation based on BLAST output
58
+ class MakerQIValidation < ValidationTest
59
+ def initialize(type, prediction, hits = nil)
60
+ super
61
+ @short_header = 'QualityIndex'
62
+ @header = 'Quality Index'
63
+ @description = 'MAKER mRNA Quality Index'
64
+ @cli_name = 'maker_qi'
65
+ end
66
+
67
+ ##
68
+ # Check reading frame inconsistency
69
+ # Params:
70
+ # +lst+: vector of +Sequence+ objects
71
+ # Output:
72
+ # +QIValidationOutput+ object
73
+ def run
74
+ fail unless prediction.is_a?(Query)
75
+
76
+ start = Time.now
77
+
78
+ number = '\d*\.?\d*'
79
+ match = @prediction.definition.match(/QI:#{number}\|(#{number})\|
80
+ (#{number})\|#{number}\|
81
+ #{number}\|#{number}\|#{number}\|
82
+ #{number}\|#{number}/x)
83
+
84
+ fail NotEnoughEvidence if match.nil?
85
+
86
+ # % of splice sites confirmed by EST/mRNA-seq alignment
87
+ splice_sites = (match[1].to_f * 100).round
88
+ # % of exons that match an EST/mRNA-seq alignment
89
+ exons = (match[2].to_f * 100).round
90
+
91
+ @validation_report = MakerQIValidationOutput.new(@short_header, @header,
92
+ @description,
93
+ splice_sites, exons)
94
+ @validation_report.run_time = Time.now - start
95
+ @validation_report
96
+
97
+ rescue NotEnoughEvidence
98
+ @validation_report = ValidationReport.new('Not enough evidence',
99
+ :warning, @short_header,
100
+ @header, @description)
101
+ rescue
102
+ @validation_report = ValidationReport.new('Unexpected error', :error,
103
+ @short_header, @header,
104
+ @description)
105
+ @validation_report.errors.push 'Unexpected Error'
106
+ end
107
+ end
108
+ end
@@ -1,3 +1,3 @@
1
1
  module GeneValidator
2
- VERSION = '1.6.5'
2
+ VERSION = '1.6.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genevalidator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Monica Dragan
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-08-03 00:00:00.000000000 Z
14
+ date: 2015-10-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -123,14 +123,14 @@ dependencies:
123
123
  requirements:
124
124
  - - '='
125
125
  - !ruby/object:Gem::Version
126
- version: '1.4'
126
+ version: 2.0.1
127
127
  type: :runtime
128
128
  prerelease: false
129
129
  version_requirements: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '='
132
132
  - !ruby/object:Gem::Version
133
- version: '1.4'
133
+ version: 2.0.1
134
134
  description: The tool validates the input predicted genes and provides useful information
135
135
  (length validation, gene merge validation, sequence duplication checking, ORF finding)
136
136
  based on the similarities to genes in public databases.
@@ -209,6 +209,7 @@ files:
209
209
  - lib/genevalidator/validation_gene_merge.rb
210
210
  - lib/genevalidator/validation_length_cluster.rb
211
211
  - lib/genevalidator/validation_length_rank.rb
212
+ - lib/genevalidator/validation_maker_qi.rb
212
213
  - lib/genevalidator/validation_open_reading_frame.rb
213
214
  - lib/genevalidator/validation_report.rb
214
215
  - lib/genevalidator/validation_test.rb