From 4180a776aac54f0ed665ab4bfa526bdb8b4ff700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Ca=C3=B1as=20D=C3=ADaz?= Date: Tue, 7 Apr 2015 11:12:29 +0200 Subject: [PATCH] Add StoryBoard support to dash - New JS library added with StoryBoard support - New templates/ to produce StoryBoard HTML - HTML panels updated for StoryBoard data Change-Id: I881f20d9808da2f91b3e0434b96070a017a8ab6a --- browser/config/menu-elements.json | 6 +- browser/index.html | 6 + browser/lib/vizgrimoire.min.js | 18 +-- browser/people.html | 4 + browser/storyboard-companies.html | 117 ++++++++++++++++ browser/storyboard-contributors.html | 80 +++++++++++ browser/storyboard.html | 182 +++++++++++++++++++++++++ templates/common/overview.tmpl | 5 + templates/common/people.tmpl | 3 + templates/gen.sh | 16 +-- templates/storyboard/contributors.tmpl | 24 ++++ templates/storyboard/overview.tmpl | 129 ++++++++++++++++++ templates/storyboard/projects.tmpl | 69 ++++++++++ templates/storyboard/states-jira.tmpl | 107 +++++++++++++++ templates/storyboard/states.tmpl | 66 +++++++++ 15 files changed, 814 insertions(+), 18 deletions(-) create mode 100644 browser/storyboard-companies.html create mode 100644 browser/storyboard-contributors.html create mode 100644 browser/storyboard.html create mode 100644 templates/storyboard/contributors.tmpl create mode 100644 templates/storyboard/overview.tmpl create mode 100644 templates/storyboard/projects.tmpl create mode 100644 templates/storyboard/states-jira.tmpl create mode 100644 templates/storyboard/states.tmpl diff --git a/browser/config/menu-elements.json b/browser/config/menu-elements.json index b4b85b58..44899079 100644 --- a/browser/config/menu-elements.json +++ b/browser/config/menu-elements.json @@ -22,9 +22,13 @@ "its": [ "companies", "contributors", - "states", + "states", "repos" ], + "storyboard": [ + "companies", + "contributors" + ], "scr": [ "companies" ], diff --git a/browser/index.html b/browser/index.html index 5bfb46fc..f5865da7 100644 --- a/browser/index.html +++ b/browser/index.html @@ -46,6 +46,11 @@ data-box-metrics="allhistory_participants,its_closers,its_openers" data-ts-metrics="its_closed,its_closers"> +
+
+ diff --git a/browser/lib/vizgrimoire.min.js b/browser/lib/vizgrimoire.min.js index cff10185..794b3158 100644 --- a/browser/lib/vizgrimoire.min.js +++ b/browser/lib/vizgrimoire.min.js @@ -6,12 +6,12 @@ return typeof a!="undefined"?this.each(function(b){(e=b.tagName.match(h))?f(b,e[ return 4*(a<.5?c:3*(a-b)+c-.75)}function E(a){return function(b){return Math.pow(b,a)}}function F(a){return 1-Math.cos(a*kd/2)}function G(a){return Math.pow(2,10*(a-1))}function H(a){return 1-Math.sqrt(1-a*a)}function I(a,b){var c;return arguments.length<2&&(b=.45),arguments.length?c=b/(2*kd)*Math.asin(1/a):(a=1,c=b/4),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*kd/b)}}function J(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function K(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function L(){d3.event.stopPropagation(),d3.event.preventDefault()}function M(){var a=d3.event,b;while(b=a.sourceEvent)a=b;return a}function N(a){var b=new t,c=0,d=arguments.length;while(++c360?a-=360:a<0&&(a+=360),a<60?f+(g-f)*a/60:a<180?g:a<240?f+(g-f)*(240-a)/60:f}function e(a){return Math.round(d(a)*255)}var f,g;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,g=c<=.5?c*(1+b):c+b-c*b,f=2*c-g,W(e(a+120),e(a),e(a-120))}function fb(a,b,c){return new gb(a,b,c)}function gb(a,b,c){this.h=a,this.c=b,this.l=c}function hb(a,b,c){return ib(c,Math.cos(a*=md)*b,Math.sin(a)*b)}function ib(a,b,c){return new jb(a,b,c)}function jb(a,b,c){this.l=a,this.a=b,this.b=c}function kb(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=mb(e)*Ld,d=mb(d)*Md,f=mb(f)*Nd,W(ob(3.2404542*e-1.5371385*d-.4985314*f),ob(-.969266*e+1.8760108*d+.041556*f),ob(.0556434*e-.2040259*d+1.0572252*f))}function lb(a,b,c){return fb(Math.atan2(c,b)/kd*180,Math.sqrt(b*b+c*c),a)}function mb(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function nb(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function ob(a){return Math.round(255*(a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function pb(a){return qd(a,Ud),a}function qb(a){return function(){return Pd(a,this)}}function rb(a){return function(){return Qd(a,this)}}function sb(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=d3.ns.qualify(a),b==null?a.local?d:c:typeof b=="function"?a.local?h:g:a.local?f:e}function tb(a){return new RegExp("(?:^|\\s+)"+d3.requote(a)+"(?:\\s+|$)","g")}function ub(a,b){function c(){var c=-1;while(++c0&&(a=a.substring(0,g)),b?e:d}function Cb(a,b){for(var c=0,d=a.length;cc?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)||d3.timer(i,0,h),1)}function i(d){if(e.active!==c)return j();var f=(d-n)/o,g=l(f),h=p.length;while(h>0)p[--h].call(a,g);if(f>=1)return j(),m.end.call(a,k,b),1}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 n<=d?f(d):d3.timer(f,n,h),1},0,h),g}}function Gb(a){return a==null&&(a=""),function(){this.textContent=a}}function Hb(a,b,c,d){var e=a.id;return Cb(a,typeof c=="function"?function(a,f,g){a.__transition__[e].tween.set(b,d(c.call(a,a.__data__,f,g)))}:(c=d(c),function(a){a.__transition__[e].tween.set(b,c)}))}function Ib(){var a,b=Date.now(),c=be;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=Jb()-b;d>24?(isFinite(d)&&(clearTimeout(de),de=setTimeout(Ib,d)),ce=0):(ce=1,ee(Ib))}function Jb(){var a=null,b=be,c=Infinity;while(b)b.flush?(delete ae[b.callback.id],b=a?a.next=b.next:be=b.next):(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function Kb(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(fe<0&&(window.scrollX||window.scrollY)){c=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=c[0][0].getScreenCTM();fe=!e.f&&!e.e,c.remove()}return fe?(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 Lb(){}function Mb(a){var b=a[0],c=a[a.length-1];return b2?Xb:Wb,i=d?U:T;return g=e(a,b,i,c),h=e(b,a,i,d3.interpolate),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(d3.interpolateRound)},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 Ub(a,b)},f.tickFormat=function(b){return Vb(a,b)},f.nice=function(){return Ob(a,Sb),e()},f.copy=function(){return Qb(a,b,c,d)},e()}function Rb(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clamp")}function Sb(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 Tb(a,b){var c=Mb(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function Ub(a,b){return d3.range.apply(d3,Tb(a,b))}function Vb(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Tb(a,b)[2])/Math.LN10+.01))+"f")}function Wb(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 Xb(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;a[h]0;j--)e.push(d(f)*j)}else{for(;fi;g--);e=e.slice(f,g)}return e},c.tickFormat=function(a,e){arguments.length<2&&(e=ge);if(!arguments.length)return e;var f=Math.max(.1,a/c.ticks().length),g=b===$b?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/d(g(b(a)+h))<=f?e(a):""}},c.copy=function(){return Yb(a.copy(),b)},Rb(c,a)}function Zb(a){return Math.log(a<0?0:a)/Math.LN10}function $b(a){return-Math.log(a>0?0:-a)/Math.LN10}function _b(a,b){function c(b){return a(d(b))}var d=ac(b),e=ac(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 Ub(c.domain(),a)},c.tickFormat=function(a){return Vb(c.domain(),a)},c.nice=function(){return c.domain(Ob(c.domain(),Sb))},c.exponent=function(a){if(!arguments.length)return b;var f=c.domain();return d=ac(b=a),e=ac(1/b),c.domain(f)},c.copy=function(){return _b(a.copy(),b)},Rb(c,a)}function ac(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function bc(a,b){function c(b){return g[((e.get(b)||e.set(b,a.push(b)))-1)%g.length]}function d(b,c){return d3.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;var g=-1,h=d.length,i;while(++gd&&(c=b,d=e);return c}function wc(a){return a.reduce(xc,0)}function xc(a,b){return a+b[1]}function yc(a,b){return zc(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function zc(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function Ac(a){return[d3.min(a),d3.max(a)]}function Bc(a,b){return d3.rebind(a,b,"sort","children","value"),a.nodes=a,a.links=Fc,a}function Cc(a){return a.children}function Dc(a){return a.value}function Ec(a,b){return b.value-a.value}function Fc(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function Gc(a,b){return a.value-b.value}function Hc(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function Ic(a,b){a._pack_next=b,b._pack_prev=a}function Jc(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 Kc(a){function b(a){d=Math.min(a.x-a.r,d),e=Math.max(a.x+a.r,e),f=Math.min(a.y-a.r,f),g=Math.max(a.y+a.r,g)}if(!(c=a.children)||!(n=c.length))return;var c,d=Infinity,e=-Infinity,f=Infinity,g=-Infinity,h,i,j,k,l,m,n;c.forEach(Lc),h=c[0],h.x=-h.r,h.y=0,b(h);if(n>1){i=c[1],i.x=i.r,i.y=0,b(i);if(n>2){j=c[2],Oc(h,i,j),b(j),Hc(h,j),h._pack_prev=j,Hc(j,i),i=h._pack_next;for(k=3;k0&&(a=d)}return a}function Xc(a,b){return a.x-b.x}function Yc(a,b){return b.x-a.x}function Zc(a,b){return a.depth-b.depth}function $c(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function ad(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 bd(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function cd(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function dd(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}var ed=".",fd=",",gd=[3,3];Date.now||(Date.now=function(){return+new Date});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(hd){var id=CSSStyleDeclaration.prototype,jd=id.setProperty;id.setProperty=function(a,b,c){jd.call(this,a,b+"",c)}}d3={version:"3.0.2"};var kd=Math.PI,ld=1e-6,md=kd/180,nd=180/kd,od=e;try{od(document.documentElement.childNodes)[0].nodeType}catch(pd){od=d}var qd=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.map=function(a){var b=new f;for(var c in a)b.set(c,a[c]);return b},c(f,{has:function(a){return rd+a in this},get:function(a){return this[rd+a]},set:function(a,b){return this[rd+a]=b},remove:function(a){return a=rd+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function(b,c){a.push({key:b,value:c})}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===sd&&a.call(this,b.substring(1),this[b])}});var rd="\x00",sd=rd.charCodeAt(0);d3.functor=i,d3.rebind=function(a,b){var c=1,d=arguments.length,e;while(++cb?1:a>=b?0:NaN},d3.descending=function(a,b){return ba?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f1&&(a=a.map(b)),a=a.filter(k),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++cf&&(e=f)}else{while(++cf&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++ce&&(e=f)}else{while(++ce&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++cf&&(e=f),gf&&(e=f),g1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(a,b){var c=arguments.length;c<2&&(b=1),c<1&&(a=0);var d=d3.random.normal();return function(){return Math.exp(a+b*d())}},irwinHall:function(a){return function(){for(var b=0,c=0;c>>1;a.call(b,b[f],f)>>1;c=d.length)return h?h.call(c,b):g?b.sort(g):b;var i=-1,j=b.length,k=d[e++],l,m,n=new f,o,p={};while(++i=d.length)return a;var f=[],g=e[c++],h;for(h in a)f.push({key:h,values:b(a[h],c)});return g&&f.sort(function(a,b){return g(a.key,b.key)}),f}var c={},d=[],e=[],g,h;return c.map=function(b){return a(b,0)},c.entries=function(c){return b(a(c,0),0)},c.key=function(a){return d.push(a),c},c.sortKeys=function(a){return e[d.length-1]=a,c},c.sortValues=function(a){return g=a,c},c.rollup=function(a){return h=a,c},c},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++db)d.push(g/e);else while((g=a+c*++f)=200&&a<300||a===304?f.load.call(e,i.call(e,j)):f.error.call(e,j)}var e={},f=d3.dispatch("progress","load","error"),h={},i=g,j=new(window.XDomainRequest&&/^(http(s)?:)?\/\//.test(a)?XDomainRequest:XMLHttpRequest);return"onload"in j?j.onload=j.onerror=d:j.onreadystatechange=function(){j.readyState>3&&d()},j.onprogress=function(a){var b=d3.event;d3.event=a;try{f.progress.call(e,j)}finally{d3.event=b}},e.header=function(a,b){return a=(a+"").toLowerCase(),arguments.length<2?h[a]:(b==null?delete h[a]:h[a]=b+"",e)},e.mimeType=function(a){return arguments.length?(b=a==null?null:a+"",e):b},e.response=function(a){return i=a,e},["get","post"].forEach(function(a){e[a]=function(){return e.send.apply(e,[a].concat(od(arguments)))}}),e.send=function(c,d,f){arguments.length===2&&typeof d=="function"&&(f=d,d=null),j.open(c,a,!0),b!=null&&!("accept"in h)&&(h.accept=b+",*/*");if(j.setRequestHeader)for(var g in h)j.setRequestHeader(g,h[g]);return b!=null&&j.overrideMimeType&&j.overrideMimeType(b),f!=null&&e.on("error",f).on("load",function(a){f(null,a)}),j.send(d==null?null:d),e},e.abort=function(){return j.abort(),e},d3.rebind(e,f,"on"),arguments.length===2&&typeof b=="function"&&(c=b,b=null),c==null?e:e.get(o(c))},d3.text=function(){return d3.xhr.apply(d3,arguments).response(p)},d3.json=function(a,b){return d3.xhr(a,"application/json",b).response(q)},d3.html=function(a,b){return d3.xhr(a,"text/html",b).response(r)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(s)};var vd={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:vd,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),vd.hasOwnProperty(c)?{space:vd[c],local:a}:a}},d3.dispatch=function(){var a=new t,b=-1,c=arguments.length;while(++b0&&(d=a.substring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):this[a].on(d,b)},d3.format=function(a){var b=wd.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;j&&(j=+j.substring(1));if(g||c==="0"&&d==="=")g=c="0",d="=",i&&(h-=Math.floor((h-1)/4));switch(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=""),k=="r"&&!j&&(k="g"),k=xd.get(k)||w;var o=g&&i;return function(a){if(n&&a%1)return"";var b=a<0||a===0&&1/a<0?(a=-a,"-"):e;if(l<0){var p=d3.formatPrefix(a,j);a=p.scale(a),m=p.symbol}else a*=l;a=k(a,j),!g&&i&&(a=yd(a));var q=f.length+a.length+(o?0:b.length),r=q"?r+b+a:d==="^"?r.substring(0,q>>=1)+b+a+r.substring(q):b+(o?a:r+a))+m}};var wd=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,xd=d3.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 d3.round(a,b=v(a,b)).toFixed(Math.max(0,Math.min(20,b)))}}),yd=g;if(gd){var zd=gd.length;yd=function(a){var b=a.lastIndexOf("."),c=b>=0?"."+a.substring(b+1):(b=a.length,""),d=[],e=0,f=gd[0];while(b>0&&f>0)d.push(a.substring(b-=f,b+f)),f=gd[e=(e+1)%zd];return d.reverse().join(fd||"")+c}}var Ad=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(x);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,v(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),Ad[8+c/3]};var Bd=function(){return g},Cd=d3.map({linear:Bd,poly:E,quad:function(){return B},cubic:function(){return C},sin:function(){return F},exp:function(){return G},circle:function(){return H},elastic:I,back:J,bounce:function(){return K}}),Dd=d3.map({"in":g,out:z,"in-out":A,"out-in":function(a){return A(z(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=Cd.get(c)||Bd,d=Dd.get(d)||g,y(d(c.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate();return new O(c?c.matrix:Ed)})(a)},O.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Ed={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;Fd.lastIndex=0;for(d=0;c=Fd.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=Fd.lastIndex;f180?k+=360:k-j>180&&(j+=360),d.push({i:c.push(c.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(j,k)})):k&&c.push(c.pop()+"rotate("+k+")"),l!=m?d.push({i:c.push(c.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,m)}):m&&c.push(c.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(e=c.push(c.pop()+"scale(",null,",",null,")"),d.push({i:e-4,x:d3.interpolateNumber(n[0],o[0])},{i:e-2,x:d3.interpolateNumber(n[1],o[1])})):(o[0]!=1||o[1]!=1)&&c.push(c.pop()+"scale("+o+")"),e=d.length,function(a){var b=-1,f;while(++b180?f-=360:f<-180&&(f+=360),function(a){return eb(c+f*a,d+g*a,e+h*a)+""}},d3.interpolateLab=function(a,b){a=d3.lab(a),b=d3.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 kb(c+f*a,d+g*a,e+h*a)+"" }},d3.interpolateHcl=function(a,b){a=d3.hcl(a),b=d3.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:f<-180&&(f+=360),function(a){return hb(c+f*a,d+g*a,e+h*a)+""}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},Ud.sort=function(a){a=Ab.apply(this,arguments);for(var b=-1,c=this.length;++b0?h=a:h=0:a>0&&(d.start({type:"start",alpha:h=a}),d3.timer(c.tick)),c):h},c.start=function(){function a(a,c){var e=b(d),f=-1,g=e.length,h;while(++fe&&(e=h),d.push(h)}for(g=0;g0){f=-1;while(++f=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(a[f]))}return g}var b=!0,c=Number,d=Ac,e=yc;return a.value=function(b){return arguments.length?(c=b,a):c},a.range=function(b){return arguments.length?(d=i(b),a):d},a.bins=function(b){return arguments.length?(e=typeof b=="number"?function(a){return zc(a,b)}:i(b),a):e},a.frequency=function(c){return arguments.length?(b=!!c,a):b},a},d3.layout.hierarchy=function(){function a(b,g,h){var i=e.call(c,b,g);b.depth=g,h.push(b);if(i&&(k=i.length)){var j=-1,k,l=b.children=[],m=0,n=g+1,o;while(++j0){var k=c*j/2;$c(g,function(a){a.r+=k}),$c(g,Kc),$c(g,function(a){a.r-=k}),j=Math.max(2*g.r/h,2*g.r/i)}return Nc(g,h/2,i/2,1/j),f}var b=d3.layout.hierarchy().sort(Gc),c=0,d=[1,1];return a.size=function(b){return arguments.length?(d=b,a):d},a.padding=function(b){return arguments.length?(c=+b,a):c},Bc(a,b)},d3.layout.cluster=function(){function a(a,e){var f=b.call(this,a,e),g=f[0],h,i=0;$c(g,function(a){var b=a.children;b&&b.length?(a.x=Qc(b),a.y=Pc(b)):(a.x=h?i+=c(a,h):0,a.y=0,h=a)});var j=Rc(g),k=Sc(g),l=j.x-c(j,k)/2,m=k.x+c(k,j)/2;return $c(g,function(a){a.x=(a.x-l)/(m-l)*d[0],a.y=(1-(g.y?a.y/g.y:1))*d[1]}),f}var b=d3.layout.hierarchy().sort(null).value(null),c=Tc,d=[1,1];return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(d=b,a):d},Bc(a,b)},d3.layout.tree=function(){function a(a,e){function f(a,b){var d=a.children,e=a._tree;if(d&&(g=d.length)){var g,i=d[0],j,k=i,l,m=-1;while(++m0&&(ad(bd(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!Vc(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!Uc(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}var i=b.call(this,a,e),j=i[0];$c(j,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),f(j),g(j,-j._tree.prelim);var k=Wc(j,Yc),l=Wc(j,Xc),m=Wc(j,Zc),n=k.x-c(k,l)/2,o=l.x+c(l,k)/2,p=m.depth||1;return $c(j,function(a){a.x=(a.x-n)/(o-n)*d[0],a.y=a.depth/p*d[1],delete a._tree}),i}var b=d3.layout.hierarchy().sort(null).value(null),c=Tc,d=[1,1];return a.separation=function(b){return arguments.length?(c=b,a):c},a.size=function(b){return arguments.length?(d=b,a):d},Bc(a,b)},d3.layout.treemap=function(){function a(a,b){var c=-1,d=a.length,e,f;while(++c0)h.push(j=i[p-1]),h.area+=j.area,n!=="squarify"||(m=d(h,o))<=l?(i.pop(),l=m):(h.area-=h.pop().area,e(h,o,g,!1),o=Math.min(g.dx,g.dy),h.length=h.area=0,l=Infinity);h.length&&(e(h,o,g,!0),h.length=h.area=0),f.forEach(b)}}function c(b){var d=b.children;if(d&&d.length){var f=k(b),g=d.slice(),h,i=[];a(g,f.dx*f.dy/b.value),i.area=0;while(h=g.pop())i.push(h),i.area+=h.area,h.z!=null&&(e(i,h.z?f.dx:f.dy,f,!g.length),i.length=i.area=0);d.forEach(c)}}function d(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,h=a.length;while(++ge&&(e=d)}return c*=c,b*=b,c?Math.max(b*e*o/c,c/(b*f*o)):Infinity}function e(a,b,c,d){var e=-1,f=a.length,g=c.x,i=c.y,j=b?h(a.area/b):0,k;if(b==c.dx){if(d||j>c.dy)j=c.dy;while(++ec.dx)j=c.dx;while(++e=a.x1&&b.x1<=a.x2||b.x2>=a.x1&&b.x2<=a.x2||a.x1>=b.x1&&a.x2<=b.x2){x=true}if(b.y1>=a.y1&&b.y1<=a.y2||b.y2>=a.y1&&b.y2<=a.y2||a.y1>=b.y1&&a.y2<=b.y2){y=true}return x&&y};fn.detect_overlapping_region=function(a,b){var regionX="";var regionY="";if(a.y1>b.cy&&a.y1b.y1&&a.y2b.cx&&a.x1b.x1&&a.x2this.player_max_left){left=this.player_max_left}else if(left=mouse_down_zone){nextScrollTop=scrollTop+30;if(nextScrollTop0){$window.scrollTop(nextScrollTop);this.scrollOffset=this.scrollOffset-30}}};fn.calculate_positions=function(e){this.window_height=$window.height()};fn.drag_handler=function(e){var node=e.target.nodeName;if(this.disabled||e.which!==1&&!isTouch){return}if(this.ignore_drag(e)){return}var self=this;var first=true;this.$player=$(e.currentTarget);this.el_init_pos=this.get_actual_pos(this.$player);this.mouse_init_pos=this.get_mouse_pos(e);this.offsetY=this.mouse_init_pos.top-this.el_init_pos.top;this.$body.on(pointer_events.move,function(mme){var mouse_actual_pos=self.get_mouse_pos(mme);var diff_x=Math.abs(mouse_actual_pos.left-self.mouse_init_pos.left);var diff_y=Math.abs(mouse_actual_pos.top-self.mouse_init_pos.top);if(!(diff_x>self.options.distance||diff_y>self.options.distance)){return false}if(first){first=false;self.on_dragstart.call(self,mme);return false}if(self.is_dragging===true){self.on_dragmove.call(self,mme)}return false});return false};fn.on_dragstart=function(e){e.preventDefault();this.drag_start=true;this.is_dragging=true;var offset=this.$container.offset();this.baseX=Math.round(offset.left);this.baseY=Math.round(offset.top);this.doc_height=$(document).height();if(this.options.helper==="clone"){this.$helper=this.$player.clone().appendTo(this.$container).addClass("helper");this.helper=true}else{this.helper=false}this.scrollOffset=0;this.el_init_offset=this.$player.offset();this.player_width=this.$player.width();this.player_height=this.$player.height();this.player_max_left=this.$container.width()-this.player_width+this.options.offset_left;if(this.options.start){this.options.start.call(this.$player,e,{helper:this.helper?this.$helper:this.$player})}return false};fn.on_dragmove=function(e){var offset=this.get_offset(e);this.options.autoscroll&&this.manage_scroll(offset);(this.helper?this.$helper:this.$player).css({position:"absolute",left:offset.left,top:offset.top});var ui={position:{left:offset.left,top:offset.top}};if(this.options.drag){this.options.drag.call(this.$player,e,ui)}return false};fn.on_dragstop=function(e){var offset=this.get_offset(e);this.drag_start=false;var ui={position:{left:offset.left,top:offset.top}};if(this.options.stop){this.options.stop.call(this.$player,e,ui)}if(this.helper){this.$helper.remove()}return false};fn.on_select_start=function(e){if(this.disabled){return}if(this.ignore_drag(e)){return}return false};fn.enable=function(){this.disabled=false};fn.disable=function(){this.disabled=true};fn.destroy=function(){this.disable();$.removeData(this.$container,"drag")};fn.ignore_drag=function(event){if(this.options.handle){return!$(event.target).is(this.options.handle)}return $.inArray(event.target.nodeName,this.options.ignore_dragging)>=0};$.fn.drag=function(options){return this.each(function(){if(!$.data(this,"drag")){$.data(this,"drag",new Draggable(this,options))}})}})(jQuery,window,document);(function($,window,document,undefined){var defaults={namespace:"",widget_selector:"li",widget_margins:[10,10],widget_base_dimensions:[400,225],extra_rows:0,extra_cols:0,min_cols:1,min_rows:15,max_size_x:6,autogenerate_stylesheet:true,avoid_overlapped_widgets:true,serialize_params:function($w,wgd){return{col:wgd.col,row:wgd.row,size_x:wgd.size_x,size_y:wgd.size_y}},collision:{},draggable:{distance:4}};function Gridster(el,options){this.options=$.extend(true,defaults,options);this.$el=$(el);this.$wrapper=this.$el.parent();this.$widgets=this.$el.children(this.options.widget_selector).addClass("gs_w");this.widgets=[];this.$changed=$([]);this.wrapper_width=this.$wrapper.width();this.min_widget_width=this.options.widget_margins[0]*2+this.options.widget_base_dimensions[0];this.min_widget_height=this.options.widget_margins[1]*2+this.options.widget_base_dimensions[1];this.init()}Gridster.generated_stylesheets=[];var fn=Gridster.prototype;fn.init=function(){this.generate_grid_and_stylesheet();this.get_widgets_from_DOM();this.set_dom_grid_height();this.$wrapper.addClass("ready");this.draggable();$(window).bind("resize",throttle($.proxy(this.recalculate_faux_grid,this),200))};fn.disable=function(){this.$wrapper.find(".player-revert").removeClass("player-revert");this.drag_api.disable();return this};fn.enable=function(){this.drag_api.enable();return this};fn.add_widget=function(html,size_x,size_y,col,row){var pos;size_x||(size_x=1);size_y||(size_y=1);if(!col&!row){pos=this.next_position(size_x,size_y)}else{pos={col:col,row:row};this.empty_cells(col,row,size_x,size_y)}var $w=$(html).attr({"data-col":pos.col,"data-row":pos.row,"data-sizex":size_x,"data-sizey":size_y}).addClass("gs_w").appendTo(this.$el).hide();this.$widgets=this.$widgets.add($w);this.register_widget($w);this.add_faux_rows(pos.size_y);this.set_dom_grid_height();return $w.fadeIn()};fn.resize_widget=function($widget,size_x,size_y){var wgd=$widget.coords().grid;size_x||(size_x=wgd.size_x);size_y||(size_y=wgd.size_y);if(size_x>this.cols){size_x=this.cols}var old_cells_occupied=this.get_cells_occupied(wgd);var old_size_x=wgd.size_x;var old_size_y=wgd.size_y;var old_col=wgd.col;var new_col=old_col;var wider=size_x>old_size_x;var taller=size_y>old_size_y;if(old_col+size_x-1>this.cols){var diff=old_col+(size_x-1)-this.cols;var c=old_col-diff;new_col=Math.max(1,c)}var new_grid_data={col:new_col,row:wgd.row,size_x:size_x,size_y:size_y};var new_cells_occupied=this.get_cells_occupied(new_grid_data);var empty_cols=[];$.each(old_cells_occupied.cols,function(i,col){if($.inArray(col,new_cells_occupied.cols)===-1){empty_cols.push(col)}});var occupied_cols=[];$.each(new_cells_occupied.cols,function(i,col){if($.inArray(col,old_cells_occupied.cols)===-1){occupied_cols.push(col)}});var empty_rows=[];$.each(old_cells_occupied.rows,function(i,row){if($.inArray(row,new_cells_occupied.rows)===-1){empty_rows.push(row)}});var occupied_rows=[];$.each(new_cells_occupied.rows,function(i,row){if($.inArray(row,old_cells_occupied.rows)===-1){occupied_rows.push(row)}});this.remove_from_gridmap(wgd);if(occupied_cols.length){var cols_to_empty=[new_col,wgd.row,size_x,Math.min(old_size_y,size_y),$widget];this.empty_cells.apply(this,cols_to_empty)}if(occupied_rows.length){var rows_to_empty=[new_col,wgd.row,size_x,size_y,$widget];this.empty_cells.apply(this,rows_to_empty)}wgd.col=new_col;wgd.size_x=size_x;wgd.size_y=size_y;this.add_to_gridmap(new_grid_data,$widget);$widget.data("coords").update({width:size_x*this.options.widget_base_dimensions[0]+(size_x-1)*this.options.widget_margins[0]*2,height:size_y*this.options.widget_base_dimensions[1]+(size_y-1)*this.options.widget_margins[1]*2});if(size_y>old_size_y){this.add_faux_rows(size_y-old_size_y)}if(size_x>old_size_x){this.add_faux_cols(size_x-old_size_x)}$widget.attr({"data-col":new_col,"data-sizex":size_x,"data-sizey":size_y});if(empty_cols.length){var cols_to_remove_holes=[empty_cols[0],wgd.row,empty_cols.length,Math.min(old_size_y,size_y),$widget];this.remove_empty_cells.apply(this,cols_to_remove_holes)}if(empty_rows.length){var rows_to_remove_holes=[new_col,wgd.row,size_x,size_y,$widget];this.remove_empty_cells.apply(this,rows_to_remove_holes)}return $widget};fn.empty_cells=function(col,row,size_x,size_y,$exclude){var $nexts=this.widgets_below({col:col,row:row-size_y,size_x:size_x,size_y:size_y});$nexts.not($exclude).each($.proxy(function(i,w){var wgd=$(w).coords().grid;if(!(wgd.row<=row+size_y-1)){return}var diff=row+size_y-wgd.row;this.move_widget_down($(w),diff)},this));this.set_dom_grid_height();return this};fn.remove_empty_cells=function(col,row,size_x,size_y,exclude){var $nexts=this.widgets_below({col:col,row:row,size_x:size_x,size_y:size_y});$nexts.not(exclude).each($.proxy(function(i,widget){this.move_widget_up($(widget),size_y)},this));this.set_dom_grid_height();return this};fn.next_position=function(size_x,size_y){size_x||(size_x=1);size_y||(size_y=1);var ga=this.gridmap;var cols_l=ga.length;var valid_pos=[];var rows_l;for(var c=1;c",{"class":"preview-holder","data-row":this.$player.attr("data-row"),"data-col":this.$player.attr("data-col"),css:{width:coords.width,height:coords.height}}).appendTo(this.$el);if(this.options.draggable.start){this.options.draggable.start.call(this,event,ui)}};fn.on_drag=function(event,ui){if(this.$player===null){return false}var abs_offset={left:ui.position.left+this.baseX,top:ui.position.top+this.baseY};this.colliders_data=this.collision_api.get_closest_colliders(abs_offset);this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column);this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row);if(this.helper&&this.$player){this.$player.css({left:ui.position.left,top:ui.position.top})}if(this.options.draggable.drag){this.options.draggable.drag.call(this,event,ui)}};fn.on_stop_drag=function(event,ui){this.$helper.add(this.$player).add(this.$wrapper).removeClass("dragging");ui.position.left=ui.position.left+this.baseX;ui.position.top=ui.position.top+this.baseY;this.colliders_data=this.collision_api.get_closest_colliders(ui.position);this.on_overlapped_column_change(this.on_start_overlapping_column,this.on_stop_overlapping_column);this.on_overlapped_row_change(this.on_start_overlapping_row,this.on_stop_overlapping_row);this.$player.addClass("player-revert").removeClass("player").attr({"data-col":this.placeholder_grid_data.col,"data-row":this.placeholder_grid_data.row}).css({left:"",top:""});this.$changed=this.$changed.add(this.$player);this.cells_occupied_by_player=this.get_cells_occupied(this.placeholder_grid_data);this.set_cells_player_occupies(this.placeholder_grid_data.col,this.placeholder_grid_data.row);this.$player.coords().grid.row=this.placeholder_grid_data.row;this.$player.coords().grid.col=this.placeholder_grid_data.col;if(this.options.draggable.stop){this.options.draggable.stop.call(this,event,ui)}this.$preview_holder.remove();this.$player=null;this.$helper=null;this.placeholder_grid_data={};this.player_grid_data={};this.cells_occupied_by_placeholder={};this.cells_occupied_by_player={};this.set_dom_grid_height()};fn.on_overlapped_column_change=function(start_callback,stop_callback){if(!this.colliders_data.length){return}var cols=this.get_targeted_columns(this.colliders_data[0].el.data.col);var last_n_cols=this.last_cols.length;var n_cols=cols.length;var i;for(i=0;ib.row){return 1}return-1});return widgets};fn.sort_by_row_and_col_asc=function(widgets){widgets=widgets.sort(function(a,b){if(a.row>b.row||a.row===b.row&&a.col>b.col){return 1}return-1});return widgets};fn.sort_by_col_asc=function(widgets){widgets=widgets.sort(function(a,b){if(a.col>b.col){return 1}return-1});return widgets};fn.sort_by_row_desc=function(widgets){widgets=widgets.sort(function(a,b){if(a.row+a.size_y=0&&$.inArray(row,c.rows)>=0};fn.is_placeholder_in=function(col,row){var c=this.cells_occupied_by_placeholder||{};return this.is_placeholder_in_col(col)&&$.inArray(row,c.rows)>=0};fn.is_placeholder_in_col=function(col){var c=this.cells_occupied_by_placeholder||[];return $.inArray(col,c.cols)>=0};fn.is_empty=function(col,row){if(typeof this.gridmap[col]!=="undefined"&&typeof this.gridmap[col][row]!=="undefined"&&this.gridmap[col][row]===false){return true}return false};fn.is_occupied=function(col,row){if(!this.gridmap[col]){return false}if(this.gridmap[col][row]){return true}return false};fn.is_widget=function(col,row){var cell=this.gridmap[col];if(!cell){return false}cell=cell[row];if(cell){return cell}return false};fn.is_widget_under_player=function(col,row){if(this.is_widget(col,row)){return this.is_player_in(col,row)}return false};fn.get_widgets_under_player=function(cells){cells||(cells=this.cells_occupied_by_player||{cols:[],rows:[]});var $widgets=$([]);$.each(cells.cols,$.proxy(function(i,col){$.each(cells.rows,$.proxy(function(i,row){if(this.is_widget(col,row)){$widgets=$widgets.add(this.gridmap[col][row])}},this))},this));return $widgets};fn.set_placeholder=function(col,row){var phgd=$.extend({},this.placeholder_grid_data);var $nexts=this.widgets_below({col:phgd.col,row:phgd.row,size_y:phgd.size_y,size_x:phgd.size_x});var right_col=col+phgd.size_x-1;if(right_col>this.cols){col=col-(right_col-col)}var moved_down=this.placeholder_grid_data.row0){if(this.is_empty(tcol,r)||this.is_player(tcol,r)||this.is_widget(tcol,r)&&grid_col[r].is($widgets_under_player)){upper_rows[tcol].push(r);min_row=r0){if(this.is_widget(tcol,r)&&!this.is_player_in(tcol,r)){if(!grid_col[r].is(widget_grid_data.el)){break}}if(!this.is_player(tcol,r)&&!this.is_placeholder_in(tcol,r)&&!this.is_player_in(tcol,r)){upper_rows[tcol].push(r)}if(r=size_y?arr[result[0]]:false};fn.get_widgets_overlapped=function(){var $w;var $widgets=$([]);var used=[];var rows_from_bottom=this.cells_occupied_by_player.rows.slice(0);rows_from_bottom.reverse();$.each(this.cells_occupied_by_player.cols,$.proxy(function(i,col){$.each(rows_from_bottom,$.proxy(function(i,row){if(!this.gridmap[col]){return true}var $w=this.gridmap[col][row];if(this.is_occupied(col,row)&&!this.is_player($w)&&$.inArray($w,used)===-1){$widgets=$widgets.add($w);used.push($w)}},this))},this));return $widgets};fn.on_start_overlapping_column=function(col){this.set_player(col,false)};fn.on_start_overlapping_row=function(row){this.set_player(false,row)};fn.on_stop_overlapping_column=function(col){this.set_player(col,false);var self=this;this.for_each_widget_below(col,this.cells_occupied_by_player.rows[0],function(tcol,trow){self.move_widget_up(this,self.player_grid_data.size_y)})};fn.on_stop_overlapping_row=function(row){this.set_player(false,row);var self=this;var cols=this.cells_occupied_by_player.cols;for(var c=0,cl=cols.length;c0){this.move_widget_down($w,tmp_y)}},this));widget_grid_data.row=next_row;this.update_widget_position(widget_grid_data,$widget);$widget.attr("data-row",widget_grid_data.row);this.$changed=this.$changed.add($widget);moved.push($widget)}};fn.can_go_up_to_row=function(widget_grid_data,col,row){var ga=this.gridmap;var result=true;var urc=[];var actual_row=widget_grid_data.row;var r;this.for_each_column_occupied(widget_grid_data,function(tcol){var grid_col=ga[tcol];urc[tcol]=[];r=actual_row;while(r--){if(this.is_empty(tcol,r)&&!this.is_placeholder_in(tcol,r)){urc[tcol].push(r)}else{break}}if(!urc[tcol].length){result=false;return true}});if(!result){return false}r=row;for(r=1;r0?y_units:0};fn.widgets_below=function($el){var el_grid_data=$.isPlainObject($el)?$el:$el.coords().grid;var self=this;var ga=this.gridmap;var next_row=el_grid_data.row+el_grid_data.size_y-1;var $nexts=$([]);this.for_each_column_occupied(el_grid_data,function(col){self.for_each_widget_below(col,next_row,function(tcol,trow){if(!self.is_player(this)&&$.inArray(this,$nexts)===-1){$nexts=$nexts.add(this);return true}})});return this.sort_by_row_asc($nexts)};fn.set_cells_player_occupies=function(col,row){this.remove_from_gridmap(this.placeholder_grid_data);this.placeholder_grid_data.col=col;this.placeholder_grid_data.row=row;this.add_to_gridmap(this.placeholder_grid_data,this.$player);return this};fn.empty_cells_player_occupies=function(){this.remove_from_gridmap(this.placeholder_grid_data);return this};fn.can_go_up=function($el){var el_grid_data=$el.coords().grid;var initial_row=el_grid_data.row;var prev_row=initial_row-1;var ga=this.gridmap;var upper_rows_by_column=[];var result=true;if(initial_row===1){return false}this.for_each_column_occupied(el_grid_data,function(col){var $w=this.is_widget(col,prev_row);if(this.is_occupied(col,prev_row)||this.is_player(col,prev_row)||this.is_placeholder_in(col,prev_row)||this.is_player_in(col,prev_row)){result=false;return true}});return result};fn.can_move_to=function(widget_grid_data,col,row,max_row){var ga=this.gridmap;var $w=widget_grid_data.el;var future_wd={size_y:widget_grid_data.size_y,size_x:widget_grid_data.size_x,col:col,row:row};var result=true;var right_col=col+widget_grid_data.size_x-1;if(right_col>this.cols){return false}if(max_row&&max_row0&&this.is_widget(col,trow)&&$.inArray(ga[col][trow],matched)===-1){cr=callback.call(ga[col][trow],col,trow);matched.push(ga[col][trow]);if(cr){break}}}},"for_each/below":function(){for(trow=row+1,max=ga[col].length;trow=1;c--){for(r=gm[c].length-1;r>=1;r--){if(this.is_widget(c,r)){rows.push(r);row_in_col[r]=c;break}}}var highest_row=Math.max.apply(Math,rows);this.highest_occupied_cell={col:row_in_col[highest_row],row:highest_row};return this.highest_occupied_cell};fn.get_widgets_from=function(col,row){var ga=this.gridmap;var $widgets=$();if(col){$widgets=$widgets.add(this.$widgets.filter(function(){var tcol=$(this).attr("data-col");return tcol===col||tcol>col}))}if(row){$widgets=$widgets.add(this.$widgets.filter(function(){var trow=$(this).attr("data-row");return trow===row||trow>row}))}return $widgets};fn.set_dom_grid_height=function(){var r=this.get_highest_occupied_cell().row;this.$el.css("height",r*this.min_widget_height);return this};fn.generate_stylesheet=function(opts){var styles="";var max_size_x=this.options.max_size_x;var max_rows=0;var max_cols=0;var i;var rules;opts||(opts={});opts.cols||(opts.cols=this.cols);opts.rows||(opts.rows=this.rows);opts.namespace||(opts.namespace=this.options.namespace);opts.widget_base_dimensions||(opts.widget_base_dimensions=this.options.widget_base_dimensions);opts.widget_margins||(opts.widget_margins=this.options.widget_margins);opts.min_widget_width=opts.widget_margins[0]*2+opts.widget_base_dimensions[0];opts.min_widget_height=opts.widget_margins[1]*2+opts.widget_base_dimensions[1];var serialized_opts=$.param(opts);if($.inArray(serialized_opts,Gridster.generated_stylesheets)>=0){return false}Gridster.generated_stylesheets.push(serialized_opts);for(i=opts.cols;i>=0;i--){styles+=opts.namespace+' [data-col="'+(i+1)+'"] { left:'+(i*opts.widget_base_dimensions[0]+i*opts.widget_margins[0]+(i+1)*opts.widget_margins[0])+"px;} "}for(i=opts.rows;i>=0;i--){styles+=opts.namespace+' [data-row="'+(i+1)+'"] { top:'+(i*opts.widget_base_dimensions[1]+i*opts.widget_margins[1]+(i+1)*opts.widget_margins[1])+"px;} "}for(var y=1;y<=opts.rows;y++){styles+=opts.namespace+' [data-sizey="'+y+'"] { height:'+(y*opts.widget_base_dimensions[1]+(y-1)*(opts.widget_margins[1]*2))+"px;}"}for(var x=1;x<=max_size_x;x++){styles+=opts.namespace+' [data-sizex="'+x+'"] { width:'+(x*opts.widget_base_dimensions[0]+(x-1)*(opts.widget_margins[0]*2))+"px;}"}return this.add_style_tag(styles)};fn.add_style_tag=function(css){var d=document;var tag=d.createElement("style");d.getElementsByTagName("head")[0].appendChild(tag);tag.setAttribute("type","text/css");if(tag.styleSheet){tag.styleSheet.cssText=css}else{tag.appendChild(document.createTextNode(css))}return this};fn.generate_faux_grid=function(rows,cols){this.faux_grid=[];this.gridmap=[];var col;var row;for(col=cols;col>0;col--){this.gridmap[col]=[];for(row=rows;row>0;row--){this.add_faux_cell(row,col)}}return this};fn.add_faux_cell=function(row,col){var coords=$({left:this.baseX+(col-1)*this.min_widget_width,top:this.baseY+(row-1)*this.min_widget_height,width:this.min_widget_width,height:this.min_widget_height,col:col,row:row,original_col:col,original_row:row}).coords();if(!$.isArray(this.gridmap[col])){this.gridmap[col]=[]}this.gridmap[col][row]=false;this.faux_grid.push(coords);return this};fn.add_faux_rows=function(rows){var actual_rows=this.rows;var max_rows=actual_rows+(rows||1);for(var r=max_rows;r>actual_rows;r--){for(var c=this.cols;c>=1;c--){this.add_faux_cell(r,c)}}this.rows=max_rows;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this};fn.add_faux_cols=function(cols){var actual_cols=this.cols;var max_cols=actual_cols+(cols||1);for(var c=actual_cols;c=1;r--){this.add_faux_cell(r,c)}}this.cols=max_cols;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this};fn.recalculate_faux_grid=function(){var aw=this.$wrapper.width();this.baseX=($(window).width()-aw)/2;this.baseY=this.$wrapper.offset().top;$.each(this.faux_grid,$.proxy(function(i,coords){this.faux_grid[i]=coords.update({left:this.baseX+(coords.data.col-1)*this.min_widget_width,top:this.baseY+(coords.data.row-1)*this.min_widget_height})},this));return this};fn.get_widgets_from_DOM=function(){this.$widgets.each($.proxy(function(i,widget){this.register_widget($(widget))},this));return this};fn.generate_grid_and_stylesheet=function(){var aw=this.$wrapper.width();var ah=this.$wrapper.height();var cols=Math.floor(aw/this.min_widget_width)+this.options.extra_cols;var actual_cols=this.$widgets.map(function(){return $(this).attr("data-col")});actual_cols=Array.prototype.slice.call(actual_cols,0);actual_cols.length||(actual_cols=[0]);var min_cols=Math.max.apply(Math,actual_cols);var max_rows=this.options.extra_rows;this.$widgets.each(function(i,w){max_rows+=+$(w).attr("data-sizey")});this.cols=Math.max(min_cols,cols,this.options.min_cols);this.rows=Math.max(max_rows,this.options.min_rows);this.baseX=($(window).width()-aw)/2;this.baseY=this.$wrapper.offset().top;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this.generate_faux_grid(this.rows,this.cols)};$.fn.gridster=function(options){return this.each(function(){if(!$(this).data("gridster")){$(this).data("gridster",new Gridster(this,options))}})};$.Gridster=fn})(jQuery,window,document);vizjslib_git_revision="450348954739d64e03083be5e070c3503a36651b";vizjslib_git_tag="15.02-42-g4503489";(function(){var V=envision,global_data={};function getDefaultsMarkers(option,markers,dates){var mark="";if(!markers||markers.length===0)return mark;for(var i=0;i-1){metrics=DS.getMetrics();getDefaultsMetrics(DS,viz,metrics,default_config)}})}config=default_config;viz.summary=getEnvisionDefaultsGraph("report-summary",config);viz.summary.config.xaxis={noTickets:10,showLabels:true};viz.summary.config.handles={show:true};viz.summary.config.selection={mode:"x"};viz.summary.config.mouse={};viz.connection={name:"report-connection",adapterConstructor:V.components.QuadraticDrawing};return viz}function getOrderedDataSources(ds_list,main_metric){var ordered=[];var main_DS=null;$.each(ds_list,function(i,DS){if(DS.getMetrics()[main_metric]){main_DS=DS;return false}});ordered.push(main_DS);$.each(ds_list,function(i,DS){if(DS===main_DS)return;ordered.push(DS)});return ordered}function Envision_Report(options,data_sources){var main_metric=options.data.main_metric;global_data=options.data;if(!data_sources)data_sources=Report.getDataSources();data_sources=getOrderedDataSources(data_sources,main_metric);var ds=[];for(var i=0;i-1)data_load_companies();if($.inArray("repositories",active_reports)>-1)data_load_repos();if($.inArray("countries",active_reports)>-1)data_load_countries();if($.inArray("domains",active_reports)>-1)data_load_domains();if($.inArray("projects",active_reports)>-1)data_load_projects();if($.inArray("people",active_reports)>-1){data_load_people();data_load_people_identities()}}else{data_load_companies();data_load_repos();data_load_countries();data_load_domains();data_load_projects();data_load_people();data_load_people_identities()}};Loader.get_file_data_div=function(file,cb,div){$.when($.getJSON(file)).done(function(history){cb(div,file,history)}).fail(function(){cb(file,null)})};function get_data_from_all(file,fn_data_set,self){all_data_found=false;if(all_data){file_no_path=file.replace(Report.getDataDir()+"/","");data=all_data[file_no_path];if(data){fn_data_set(data,self);end_data_load();all_data_found=true}else{if(window.console){Report.log("Can't find in "+Report.all_json_file+" "+file)}}}return all_data_found}function data_load_file(file,fn_data_set,self){if(get_data_from_all(file,fn_data_set,self))return;$.when($.getJSON(file)).done(function(history){fn_data_set(history,self);end_data_load()}).fail(function(){fn_data_set([],self);end_data_load()})}function data_load_companies(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setCompaniesData([]);else data_load_file(DS.getCompaniesDataFile(),DS.setCompaniesData,DS)})}function data_load_repos(){var ds_not_supported=["mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1){DS.setReposData([])}else{data_load_file(DS.getReposDataFile(),DS.setReposData,DS)}});data_load_file(Report.getReposMapFile(),Report.setReposMap)}function data_load_countries(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setCountriesData([]);else data_load_file(DS.getCountriesDataFile(),DS.setCountriesData,DS)})}function data_load_domains(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setDomainsData([]);else data_load_file(DS.getDomainsDataFile(),DS.setDomainsData,DS)})}function data_load_projects(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setProjectsData([]);else data_load_file(DS.getProjectsDataFile(),DS.setProjectsData,DS)})}function data_load_time_to_fix(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="its")data_load_file(DS.getTimeToFixDataFile(),DS.setTimeToFixData,DS)})}function data_load_markov_table(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="its")data_load_file(DS.getMarkovTableDataFile(),DS.setMarkovTableData,DS)})}function data_load_time_to_attention(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="mls")data_load_file(DS.getTimeToAttentionDataFile(),DS.setTimeToAttentionData,DS)})}function data_load_demographics(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getDemographicsAgingFile(),DS.setDemographicsAgingData,DS);data_load_file(DS.getDemographicsBirthFile(),DS.setDemographicsBirthData,DS)})}function data_load_tops(metric){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){var file_all=DS.getTopDataFile();if(get_data_from_all(file_all,DS.setGlobalTopData,DS))return;$.when($.getJSON(file_all)).done(function(history){DS.setGlobalTopData(history);end_data_load()}).fail(function(){DS.setGlobalTopData([],DS);end_data_load()})})}Loader.check_filters_page=function(page){var check=true;var filters=["repos","companies","countries"];$.each(filters,function(index,filter){if(!Loader.check_filter_page(page,filter)){check=false;return false}});return check};Loader.check_filter_page=function(page,filter){var check=true;if(page===undefined)page=1;var start=Report.getPageSize()*(page-1);var end=start+Report.getPageSize();$.each(Report.getDataSources(),function(index,DS){var total=0;if(filter==="repos")total=DS.getReposData().length;if(filter==="companies")total=DS.getCompaniesData().length;if(filter==="countries")total=DS.getCountriesData().length;if(filter==="domains")total=DS.getDomainsData().length;if(filter==="projects")total=DS.getProjectsData().length;if(end>total)end=total;for(var i=start;i-1){ds=DS;return false}}if(filter=="companies"){if($.inArray(item,DS.getCompaniesData())>-1){ds=DS;return false}}if(filter=="countries"){if($.inArray(item,DS.getCountriesData())>-1){ds=DS;return false}}if(filter=="domains"){if($.inArray(item,DS.getDomainsData())>-1){ds=DS;return false}}if(filter=="projects"){if($.inArray(item,DS.getProjectsData())>-1){ds=DS;return false}}});return ds}Loader.filterTopCheck=function(item,filter){var check=true;if(filter==="repos"){if(Loader.check_item(item,filter,"top")===false){ds=getItemDS(item,filter);if(ds===null){Report.log("Can't find data source for "+item);return true}if($.inArray(ds.getName(),ds_supporting_top_repos)>=0){Loader.data_load_item_top(item,ds,null,Convert.convertFilterTop,filter,"top")}return false}}return check};Loader.FilterItemCheck=function(item,filter){var check=true,ds;var map=Report.getReposMap();if(filter==="repos"){if(Loader.check_item(item,filter)===false){ds=getItemDS(item,filter);if(ds===null){Report.log("Can't find data source for "+item);return true}Loader.data_load_item(item,ds,null,Convert.convertFilterStudyItem,filter,null);if($.inArray(ds.getName(),ds_supporting_top_repos)>=0){Loader.data_load_item_top(item,ds,null,Convert.convertFilterStudyItem,filter)}return false}if(map!==undefined&&map.length!==0){var items_map=[];$.each(Report.getDataSources(),function(index,DS){var itmap=Convert.getRealItem(DS,filter,item);if(itmap!==undefined&&itmap!==null)items_map.push(itmap)});if(Loader.check_items(items_map,filter)===false){for(var i=0;i=0&&$.inArray(item,DS.getReposData())>=0&&DS.getRepositoriesTopData()[item]!==undefined){check=true;return false}}else{if(DS.getReposGlobalData()[item]!==undefined&&DS.getReposMetricsData()[item]!==undefined){check=true;return false}}}else if(filter==="companies"){var companies=DS.getCompaniesData();if(companies.length===0)check=true;else if($.inArray(item,companies)===-1)check=true;else if(DS.getCompaniesGlobalData()[item]===undefined||DS.getCompaniesMetricsData()[item]===undefined){check=false;return false}else if($.inArray(DS.getName(),ds_not_supported_company_top)===-1&&DS.getCompaniesTopData()[item]===undefined){check=false;return false}else check=true}else if(filter==="countries"){var countries=DS.getCountriesData();if(countries.length===0)check=true;else if($.inArray(item,countries)===-1)check=true;else if(DS.getCountriesGlobalData()[item]===undefined||DS.getCountriesMetricsData()[item]===undefined){check=false;return false}else check=true}else if(filter==="domains"){var domains=DS.getDomainsData();if(domains.length===0)check=true;else if($.inArray(item,domains)===-1)check=true;else if(DS.getDomainsGlobalData()[item]===undefined||DS.getDomainsMetricsData()[item]===undefined){check=false;return false}else check=true}else if(filter==="projects"){var projects=DS.getProjectsData();if(projects.length===0)check=true;else if($.inArray(item,projects)===-1)check=true;else if(DS.getProjectsGlobalData()[item]===undefined||DS.getProjectsMetricsData()[item]===undefined){check=false;return false}else check=true}});return check};Loader.check_items=function(items,filter){var check=true;$.each(items,function(id,item){if(Loader.check_item(item,filter)===false){check=false;return false}});return check};Loader.data_load_items_page=function(DS,page,cb,filter){if(page===undefined)page=1;if(filter==="repos")if(DS.getReposData()===null)return false;if(filter==="companies")if(DS.getCompaniesData()===null)return false;if(filter==="countries")if(DS.getCountriesData()===null)return false;if(filter==="domains")if(DS.getDomainsData()===null)return false;if(filter==="projects")if(DS.getProjectsData()===null)return false;var total=0;if(filter==="repos")total=DS.getReposData().length;if(filter==="companies")total=DS.getCompaniesData().length;if(filter==="countries")total=DS.getCountriesData().length;if(filter==="domains")total=DS.getDomainsData().length;if(filter==="projects")total=DS.getProjectsData().length;if(total===0)return true;var start=Report.getPageSize()*(page-1);var end=start+Report.getPageSize();if(end>total)end=total;for(var i=start;i-1){DS.addRepoMetricsData(item,[],DS);DS.addRepoGlobalData(item,[],DS);return}}else if(filter==="companies"){if($.inArray(DS.getName(),ds_not_supported_companies)>-1){DS.addCompanyMetricsData(item,[],DS);DS.addCompanyGlobalData(item,[],DS);return}}else if(filter==="countries"){if($.inArray(DS.getName(),ds_not_supported_countries)>-1){DS.addCountryMetricsData(item,[],DS);DS.addCountryGlobalData(item,[],DS);return}}else if(filter==="domains"){if($.inArray(DS.getName(),ds_not_supported_domains)>-1){DS.addDomainMetricsData(item,[],DS);DS.addDomainGlobalData(item,[],DS);return}}else if(filter==="projects"){if($.inArray(DS.getName(),ds_not_supported_projects)>-1){DS.addDomainMetricsData(item,[],DS);DS.addDomainGlobalData(item,[],DS);return}}else return;var item_uri=encodeURIComponent(item);var file=DS.getDataDir()+"/"+item_uri+"-";file+=DS.getName()+"-"+getFilterSuffix(filter);var file_evo=file+"-evolutionary.json";var file_static=file+"-static.json";function addData(item,evo,global,DS){if(filter==="repos"){DS.addRepoMetricsData(item,evo,DS);DS.addRepoGlobalData(item,global,DS)}else if(filter==="companies"){DS.addCompanyMetricsData(item,evo,DS);DS.addCompanyGlobalData(item,global,DS)}else if(filter==="countries"){DS.addCountryMetricsData(item,evo,DS);DS.addCountryGlobalData(item,global,DS)}else if(filter==="domains"){DS.addDomainMetricsData(item,evo,DS);DS.addDomainGlobalData(item,global,DS)}else if(filter==="projects"){DS.addProjectMetricsData(item,evo,DS);DS.addProjectGlobalData(item,global,DS)}}function check_data(){if(page!==null){if(Loader.check_filter_page(page,filter)){if(cb.called_page===undefined){cb.called_page={};cb.called_page[filter]=true;cb(filter)}else if(!cb.called_page[filter]){cb(filter);cb.called_page[filter]=true}}}else if(items_map!==null){if(Loader.check_items(items_map,filter)){if(cb.called_map===undefined){cb.called_map={};cb.called_map[filter]=true;cb(filter)}else if(!cb.called_map[filter]){cb(filter);cb.called_map[filter]=true}}}else{if(Loader.check_item(item,filter)){if(cb.called_item===undefined){cb.called_item={};cb.called_item[filter]=true;cb(filter,item)}else if(!cb.called_item[filter]){cb(filter,item);cb.called_item[filter]=true}}}}if(all_data){file_evo_no_path=decodeURIComponent(file_evo.replace(Report.getDataDir()+"/",""));file_static_no_path=decodeURIComponent(file_static.replace(Report.getDataDir()+"/",""));data_evo=all_data[file_evo_no_path];data_static=all_data[file_static_no_path];if(data_evo&&data_static){addData(item,data_evo,data_static,DS);check_data();return}}$.when($.getJSON(file_evo),$.getJSON(file_static)).done(function(evo,global){addData(item,evo[0],global[0],DS)}).always(function(){check_data()})};function data_load_metrics(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getDataFile(),DS.setData,DS);data_load_file(DS.getGlobalDataFile(),DS.setGlobalData,DS);if(DS instanceof MLS){data_load_file(DS.getListsFile(),DS.setListsData,DS)}})}function data_load_metrics_definition(){data_load_file("VizGrimoireJS/data/metrics.json",Report.setMetricsDefinition)}function data_load_people(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getPeopleDataFile(),DS.setPeopleData,DS)})}function data_load_people_identities(){data_load_file(Report.getDataDir()+"/people.json",Report.setPeopleIdentities)}function check_companies_loaded(DS){if(DS.getCompaniesData()===null)return false;return true}function check_repos_loaded(DS){if(DS.getReposData()===null)return false;return true}function check_countries_loaded(DS){if(DS.getCountriesData()===null)return false;return true}function check_domains_loaded(DS){if(DS.getDomainsData()===null)return false;return true}function check_projects_loaded(DS){if(DS.getProjectsData()===null)return false;return true}function check_meta_projects_loaded(){var projects_loaded=0;var projects_data=Report.getProjectsData();var projects_dirs=Report.getProjectsDirs();for(var key in projects_data){projects_loaded++}if(projects_loaded-1)if(!check_companies_loaded(DS)){check=false;return false}if($.inArray("repositories",active_reports)>-1)if(!check_repos_loaded(DS)){check=false;return false}if($.inArray("countries",active_reports)>-1)if(!check_countries_loaded(DS)){check=false;return false}if($.inArray("domains",active_reports)>-1)if(!check_domains_loaded(DS)){check=false;return false}if($.inArray("projects",active_reports)>-1)if(!check_projects_loaded(DS)){check=false;return false}if(DS instanceof MLS){if(DS.getListsData()===null){check=false;return false}}});return check};function end_data_load(){if(check_data_loaded_global()){for(var i=0;i-1){clean=email.split("@")[0]}return clean};DataProcess.selectPersonName=function(person){var name="",cname,ctype,i;if(person.identity){for(i=0;iname.length)name=cname}}}else if(person.name){for(i=0;iname.length)name=cname}}return name};DataProcess.selectPersonEmail=function(person){var email="",cemail,ctype;if(person.identity===undefined)return;for(var i=0;i=0;i--){if(history[metric][i]===0)new_offset++;else{if(offset_end===-1)offset_end=new_offset;if(new_offset=total-offset_end)continue;new_history[key].push(history[key][i])}}return new_history};DataProcess.filterDates=function(start_id,end_id,history){var history_dates={};$.each(history,function(name,data){history_dates[name]=[];$.each(data,function(i,value){var id=history.unixtime[i];if(id>start_id)if(!end_id||end_id&&id<=end_id)history_dates[name].push(value)})});return history_dates};DataProcess.filterYear=function(year,history){year=parseInt(year,null);var min_id=new Date(year.toString()).getTime();var max_id=new Date((year+1).toString()).getTime();var history_year=filterDates(min_id,max_id,history);return history_year};DataProcess.fillDates=function(dates_orig,more_dates){if(dates_orig[0].length===0)return more_dates;var new_dates=[[],[]];var i=0;if(dates_orig[0][0]>more_dates[0][0]){for(i=0;i-1){var metric_agg=[];metric_agg[0]=data[metric][0];for(var i=1;i1){params=document.URL.split("?")[1]}return params}function filenameInURL(){aux=document.URL.split("?")[0].split("/");res=aux[aux.length-1];return res}function createLink(target){url=target;if(paramsInURL().length>0)url+="?"+paramsInURL();return url}function createReleaseLink(target){url=target;if(isReleasePage()){if(url.indexOf("?")>=0){url+="&release="+$.urlParam("release")}else{url+="?release="+$.urlParam("release")}}return url}function getParameter(param){if($.urlParam(param)===null)return false;return $.urlParam(param)}})();String.prototype.supplant=function(o){return this.replace(/{([^{}]*)}/g,function(a,b){var r=o[b];return typeof r==="string"||typeof r==="number"?r:a})};var HTMLComposer={};(function(){HTMLComposer.personDSBlock=personDSBlock;HTMLComposer.filterDSBlock=filterDSBlock;HTMLComposer.DSBlock=DSBlock;HTMLComposer.DSBlockProject=DSBlockProject;HTMLComposer.repositorySummaryTable=repositorySummaryTable;HTMLComposer.personSummaryTable=personSummaryTable;HTMLComposer.personName=personName;HTMLComposer.itemName=itemName;HTMLComposer.releaseSelector=releaseSelector;HTMLComposer.sideBarLinks=sideBarLinks;HTMLComposer.overallSummaryBlock=overallSummaryBlock;HTMLComposer.smartLinks=smartLinks;HTMLComposer.TopByPeriod=TopByPeriod;HTMLComposer.companyFilters=companyFilters;function personDSBlock(ds_name,metric_name){var html='
';html+='
';html+='
';html+='
';html+="

"+title4DS(ds_name)+"

";html+="
";html+='
';html+='
';html+="
";html+='
';html+='
';html+="
";html+='
';html+='
';$.each(metric_names,function(id,metric){html+='


';html+='
';html+='
';html+='
';html+="
"});html+="
";return html}function repositorySummaryTable(ds,global_data,id_label){var html="";html+='";var html_irow="";$.each(global_data,function(id,value){if(ds.getMetrics()[id]){html+=html_irow+ds.getMetrics()[id].name;if(id==="first_date"||id==="last_date"){html+='

'+title4DS(ds.getName())+"

";var html_erow="
'+value+html_erow}else{html+=''+Report.formatValue(value)+html_erow}}else if(id_label[id]){html+=html_irow+id_label[id];if(id==="first_date"||id==="last_date"){html+=''+value+html_erow}else{html+=''+Report.formatValue(value)+html_erow}}});html+="
";return html}function personSummaryTable(ds_name,history){var html="";html+="";html+="
";html+="First contribution:
";html+="  "+history.first_date;html+="
";html+="Last contribution:
";html+="  "+history.last_date;html+="
";if(ds_name=="scm")html+="Commits:
  "+history.scm_commits;else if(ds_name=="its")html+="Closed:
  "+history.its_closed;else if(ds_name=="mls")html+="Sent:
  "+history.mls_sent;else if(ds_name=="irc")html+="Sent:
  "+history.irc_sent;else if(ds_name=="scr")html+="Closed:
  "+history.scr_closed;html+="
";return html}function personName(name,email){var html='

  ';if(name.length>0)html+=name;else if(email.length>0){if(email.indexOf("@")>0)email=email.split("@")[0];html+=email}html+="

";return html}function itemName(text,filter_name){var html='

';if(filter_name==="companies")html+='   ';html+=text;html+="

";return html}function title4DS(ds_name){var title="";if(ds_name==="scm")title=' Source Code Management';else if(ds_name==="scr")title=' Source Code Review';else if(ds_name==="its")title=' Issue tracking system';else if(ds_name==="mls")title=' Mailing Lists';else if(ds_name==="irc")title=' IRC Channels';else if(ds_name==="mediawiki")title=' Wiki';else if(ds_name==="releases")title=' Forge Releases';return title}function releaseSelector(current_release,release_names){function get_label(url,labels){label="";$.each(labels,function(pos,data){if(data[1]===url){label=data[0];return false}});return label}if(release_names.length===0)return"";var release_names_labels=null;if(release_names[0]instanceof Array){var old_relase_names=[];$.each(release_names,function(pos,data){old_relase_names.push(data[1])});release_names_labels=release_names;release_names=old_relase_names}unsupported=["irc.html","qaforums.html","project.html"];ah_label=" All history ";label=current_release;if(label===null)label=ah_label;else{label=decodeURIComponent(label);if(release_names_labels!==null){label=get_label(label,release_names_labels);label="  "+label+"  "}else{label="  "+label[0].toUpperCase()+label.substring(1)+" release  "}release_names.reverse().push(ah_label);release_names.reverse()}html='
';html+='";html+='";html+="
";return html}function DSBlock(ds_name,box_labels,box_metrics,ts_metrics){html="";html+="";html+='
';blabels=box_labels.split(",");bmetrics=box_metrics.split(",");html+=DSSummaryBox(ds_name,blabels,bmetrics,false);html+='
';tsm=ts_metrics.split(",");html+=DSTimeSerie(ds_name,tsm[0],false);html+="
";html+='
';html+=DSTimeSerie(ds_name,tsm[1],false);html+="
";html+="
";html+="";return html}function DSBlockProject(ds_name,box_labels,box_metrics,ts_metrics,pname){html="";html+="";html+='
';blabels=box_labels.split(",");bmetrics=box_metrics.split(",");html+=DSSummaryBox(ds_name,blabels,bmetrics,true);html+='
';tsm=ts_metrics.split(",");html+=DSTimeSerie(ds_name,tsm[0],true);html+="
";html+='
';html+=DSTimeSerie(ds_name,tsm[1],true);html+="
";html+="
";html+="";return html}function summaryCell(width,label,ds_name,metric,project_flag){if(project_flag){widget_name="ProjectData"}else{widget_name="GlobalData"}html="";html+='
';html+='
';html+='
'+label+"
";html+="
";html+='
';html+='
';target_page=Utils.createLink(ds_name+".html");if(project_flag){html+=''}else{html+=' ';html+=""}html+="
";html+="
";html+="
";return html}function DSSummaryBox(ds_name,labels,metrics,project_flag){if(project_flag){widget_name="ProjectData"}else{widget_name="GlobalData"}html="";html+="";html+='
';html+='
';html+='
';html+='
'+labels[0]+"
";html+="
";html+='
';html+='
';target_page=Utils.createLink(ds_name+".html");if(ds_name==="releases")target_page=Utils.createLink("forge.html");if(project_flag){html+=''}else{html+=' ';html+=""}html+="
";html+="
";html+='
';if(labels.length===2&&metrics.length===2){html+=summaryCell("12",labels[1],ds_name,metrics[1],project_flag)}else if(labels.length===3&&metrics.length===3){html+=summaryCell("6",labels[1],ds_name,metrics[1],project_flag);html+=summaryCell("6",labels[2],ds_name,metrics[2],project_flag)}else if(labels.length===4&&metrics.length===4){html+=summaryCell("4",labels[1],ds_name,metrics[1],project_flag);html+=summaryCell("4",labels[2],ds_name,metrics[2],project_flag);html+=summaryCell("4",labels[3],ds_name,metrics[3],project_flag)}html+="
";html+="
";html+="
";html+="";return html}function DSTimeSerie(ds_name,metric,project_flag){if(project_flag){ts_widget_name="FilterItemMetricsEvol";trend_widget_name="FilterItemMicrodashText";filter_name="projects"}else{ts_widget_name="MetricsEvol";trend_widget_name="MicrodashText";filter_name=""}html="";html+='
';html+='
'}else{html+='';html+=' ';html+=""}html+="
";return html}function sideBarLinks(icon_text,title,ds_name,elements){text={companies:"Companies","companies-summary":"Companies summary",contributors:"Contributors",countries:"Countries",domains:"Domains",projects:"Projects",repos:"Repositories",tags:"Tags",states:"States"};html="";html+='";return html}function overallSummaryBlock(){html="";html+="";html+='
';html+='
';html+='
';html+='
=0)link_exists=true;if(Utils.isReleasePage()&&link_exists){link_to=Utils.createReleaseLink(target_page);html=''+label+""}else if(link_exists){html=''+label+""}else{html=label}}catch(err){html=label}return html}function TopByPeriod(ds_name,metric,npeople,is_release){if(is_release){periods=[""]}else{periods=["last month","last year",""]}width=12/periods.length;html='
';$.each(periods,function(id,value){html+='
';html+='
';html+="
"});html+="
";return html}var defaultFilterValues={scm:{metric_names:"commits+authors",order_by:"commits_365"},its:{metric_names:"closed+closers",order_by:"closed_365"}}; -function getFilterName(ds_name,metric_one,metric_two){filters={scm:{company:{country:"SCM by country"}},its:{company:{country:"ITS by country"}}};return filters[ds_name][metric_one][metric_two]}function companyFilters(company_name){var html="",filter_ds={};var mele=Report.getMenuElements();var menu_filters=mele.filter;if(menu_filters===undefined){return html}$.each(menu_filters,function(id,value){var ds_name=value.split(":")[0],combo=value.split(":")[1],mylen;if(Object.keys(filter_ds).indexOf(combo)<0){filter_ds[combo]=[]}mylen=filter_ds[combo].length;filter_ds[combo][mylen]=ds_name});$.each(Object.keys(filter_ds),function(id,value){switch(value){case"company+country":$.each(filter_ds[value],function(subid,ds_name){if(subid===0){html='
'+'"+'
"}})}});return html}})();var Convert={};(function(){Convert.convertMicrodashText=function(){var divs=$(".MicrodashText");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var metric=$(this).data("metric");var show_name=$(this).data("name");var ds=Report.getMetricDS(metric)[0];if(ds===undefined)return;var total=ds.getGlobalData()[metric];var html='
';if(show_name){html+='
';html+=''+ds.basic_metrics[metric].name+"";html+="
"}$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var value=ds.getGlobalData()[metric+"_"+period];var netvalue=ds.getGlobalData()["diff_net"+column+"_"+period];var percentagevalue=ds.getGlobalData()["percentage_"+column+"_"+period];percentagevalue=Math.round(percentagevalue*10)/10;if(value===undefined)return;var str_percentagevalue="";if(percentagevalue===0){str_percentagevalue=Math.abs(percentagevalue)}else if(netvalue>0){str_percentagevalue="+"+percentagevalue}else if(netvalue<0){str_percentagevalue="-"+Math.abs(percentagevalue)}if(show_name){html+='
'}else{html+='
'}html+='Last '+period+" days:";html+=" "+Report.formatValue(value)+"
";if(percentagevalue===0){html+='  '+str_percentagevalue+"% "}else if(netvalue>0){html+='  '+str_percentagevalue+"% "}else if(netvalue<0){html+='  '+str_percentagevalue+"% "}html+="
"});html+="
";$(div).append(html)})}};Convert.convertMicrodash=function(){var divs=$(".Microdash");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var metric=$(this).data("metric");var text=$(this).data("text");var ds=Report.getMetricDS(metric)[0];var total=ds.getGlobalData()[metric];var html="
";html+='
';html+=''+Report.formatValue(total);html+=" "+ds.getMetrics()[metric].name;html+="
";html+='
';html+='
';$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var netvalue=ds.getGlobalData()["diff_net"+column+"_"+period];var percentagevalue=ds.getGlobalData()["percentage_"+column+"_"+period];var value=ds.getGlobalData()[metric+"_"+period];if(value===undefined)return;html+=""+period+" Days Change:"+Report.formatValue(value)+" ";if(netvalue===0){html+=""}else if(netvalue>0){html+='';html+="(+"+percentagevalue+"%) "}else if(netvalue<0){html+='';html+="(-"+Math.abs(percentagevalue)+"%) "}});html+="
";html+="
";$(div).append(html)})}};function getProjectTitle(project_id,hierarchy){if(hierarchy.hasOwnProperty(project_id)&&hierarchy[project_id].title){return hierarchy[project_id].title}else{return undefined}}function compareProjectTitles(a,b){if(a.project_idb.project_id){return 1}else{return 0}}function getParentProjects(project_id,hierarchy){var parent=[];var iterate_p=project_id;var parent_id="";var aux={};while(hierarchy[iterate_p].hasOwnProperty("parent_project")){parent_id=hierarchy[iterate_p].parent_project;aux=hierarchy[parent_id];aux.project_id=parent_id;parent.push(aux);iterate_p=parent_id}return parent.reverse()}function getChildrenProjects(project_id,hierarchy){var children=[];var aux={};$.each(hierarchy,function(id,p){if(hierarchy[id].parent_project===project_id){aux=hierarchy[id];aux.project_id=id;children.push(aux)}});children.sort(compareProjectTitles);return children}function composePBreadcrumbsHTMLlast(project_id,children,hierarchy){var html="";var clen=children.length;if(clen>0){children_sort=[];children_names=[];$.each(children,function(id,value){children_names.push(value.title)});children_names=children_names.sort();$.each(children_names,function(id,name){$.each(children,function(id,value){if(name===value.title){children_sort.push(value);return false}})});children=children_sort;html+='"}else{html+="
  • "+getProjectTitle(project_id,hierarchy)+"
  • "}return html}function composeProjectBreadcrumbs(project_id){var html='";return html}function escapeString(string){var aux="";aux=string.replace(" ","_");aux=aux.toLowerCase();return aux}function composeHTMLNestedProjects(project_id,children,hierarchy){var html="";var clen=children.length;var epid=project_id;var divid=epid.replace(".","");if(clen>0){html+="
  • ";html+=''+getProjectTitle(project_id,hierarchy)+"";html+=' ';html+=''+clen+" subprojects";html+='
      ';$.each(children,function(id,value){gchildren=getChildrenProjects(value.project_id,hierarchy);html+=composeHTMLNestedProjects(value.project_id,gchildren,hierarchy)});html+="
  • "}else{html+='
  • '+getProjectTitle(project_id,hierarchy)+"
  • "}return html}function composeProjectMap(){var html="
      ";var hierarchy=Report.getProjectsHierarchy();if(hierarchy.length===0){return""}project_id="root";var children=getChildrenProjects(project_id,hierarchy);var parents=getParentProjects(project_id,hierarchy);$.each(children,function(id,value){grandchildren=getChildrenProjects(value.project_id,hierarchy);html+=composeHTMLNestedProjects(value.project_id,grandchildren,hierarchy)});html+="
    ";return html}function getSectionName4Release(){var result=[];var sections={data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain","scm-companies":"Activity on code repositories by companies","mls-companies":"Activity on mailing lists by companies","its-companies":"Activity on issue trackers by companies"};url_no_params=document.URL.split("?")[0];url_tokens=url_no_params.split("/");var section=url_tokens[url_tokens.length-1].split(".")[0];if(section==="project"||section==="index"||section==="release"||section===""){return[]}else{if(sections.hasOwnProperty(section)){result.push([section,sections[section]])}else{return[["#","Unavailable section name"]]}return result}}function getSectionName(){var result=[];var sections={mls:"MLS overview",irc:"IRC overview",its:"ITS overview",qaforums:"QA Forums overview",scr:"Code Review overview",scm:"SCM overview",wiki:"Wiki overview",downloads:"Downloads",forge:"Forge releases",demographics:"Demographics",data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain",release:"Companies analysis by release",project_comparison:"Project comparison"};var filters={companies:"Activity by companies",contributors:"Activity by contributors",countries:"Activity by countries",domains:"Activity by domains",projects:"Activity by project",repos:"Activity by repositories",states:"Activity by states",tags:"Activity by tags"};var filters2={repository:"Repository",countries:"Activity by countries"};url_no_params=document.URL.split("?")[0];url_tokens=url_no_params.split("/");var section=url_tokens[url_tokens.length-1].split(".")[0];if(section==="project"||section==="index"||section===""){return[]}else if(section==="filter"){var filter_by=$.urlParam("filter_by_item");var filter_names=$.urlParam("filter_names");switch(filter_names){case"company+country":result=[["company","Company"],["Activity by country and company","Activity by country and company"]]}return result}else{var s_tokens=section.split("-");if(s_tokens[0]==="repository"){ds_name=$.urlParam("ds");s_tokens=[ds_name,"repos","repository"]}if(sections.hasOwnProperty(s_tokens[0])){result.push([s_tokens[0],sections[s_tokens[0]]]);if(s_tokens.length>0){if(filters.hasOwnProperty(s_tokens[1])){result.push([s_tokens[0]+"-"+s_tokens[1],filters[s_tokens[1]]]);if(s_tokens.length>2){if(filters2.hasOwnProperty(s_tokens[2])){result.push([s_tokens[0],filters2[s_tokens[2]]])}}}}}else{return[["#","Unavailable section name"]]}return result}}function isURLRelease(){if($.urlParam("release")!==null&&$.urlParam("release").length>0)return true;else return false}function composeSideBar(project_id){if(project_id===undefined){project_id="root"}var html="";var html_extra="";html+='";return html}Convert.convertSideBar=function(project_id){var divs=$(".SideNavBar");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="SideNavBar";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeSideBar(label);$("#"+div.id).append(htmlaux);data=Report.getProjectData();$(".report_name").text(data.project_name);if(Utils.isReleasePage())$(".report_name").attr("href","./?release="+$.urlParam("release"))})}};Convert.convertProjectNavBar=function(project_id){var divs=$(".ProjectNavBar");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ProjectNavBar";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeProjectBreadcrumbs(label);$("#"+div.id).append(htmlaux)})}};Convert.convertNavbar=function(){$.get(Report.getHtmlDir()+"navbar.html",function(navigation){$("#Navbar").html(navigation);var project_id=Report.getParameterByName("project");Convert.convertProjectNavBar(project_id);Convert.convertReleaseSelector();Convert.convertSideBar(project_id)})};Convert.convertReleaseSelector=function(){var releases=Report.getReleaseNames();if(releases===undefined){return}if(releases.length>0){var divs=$(".ReleaseSelector");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ReleaseSelector"+getRandomId();var htmlaux=HTMLComposer.releaseSelector($.urlParam("release"),releases);$("#"+div.id).append(htmlaux)})}}};function composeSectionBreadCrumb(project_id){var html='";return html}Convert.convertSectionBreadcrumb=function(project_id){var divs=$(".SectionBreadcrumb");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="SectionBreadcrumb";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeSectionBreadCrumb(label);$("#"+div.id).append(htmlaux)})}};Convert.convertProjectMap=function(){var divs=$(".ProjectMap");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ProjectMap";var label;var htmlaux=composeProjectMap();$("#"+div.id).append(htmlaux)})}};Convert.convertFooter=function(){$.get(Report.getHtmlDir()+"footer.html",function(footer){$("#Footer").html(footer);$("#vizjs-lib-version").append(vizjslib_git_tag)})};Convert.convertSummary=function(){div_param="Summary";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;div.id=ds+"-Summary";DS.displayGlobalSummary(div.id)})}};function composeDropDownRepo(DS){var repository=Report.getParameterByName("repository");if(repository&&$.inArray(repository,DS.getReposData())<0)return"";var dsname=DS.getName();var section="";var label_repo=DS.getLabelForRepository();var label_repo_plural=DS.getLabelForRepositories();if(repository!==undefined){section=repository}else{section="All "+label_repo_plural}html='
    ';html='
    1. Filtered by '+label_repo+":  
    2. ";html+='
    3. "}var repo_names=DS.getReposData();repo_names.sort();$.each(repo_names,function(id,value){if(value===repository)return;html+='
    4. ';html+=value;html+="
    5. "});html+="
    ";html+="
    ";return html}Convert.convertRepositorySelector=function(){var divs=$(".repository-selector");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;div.id=ds+"-repository-selector";var htmlaux=composeDropDownRepo(DS);$("#"+div.id).append(htmlaux)})}};function displayReportData(){data=Report.getProjectData();document.title=data.project_name+" Report by Bitergia";if(data.title)document.title=data.title;$(".report_date").text(data.date);$(".report_name").text(data.project_name);str=data.blog_url;if(str&&str.length>0){$("#blogEntry").html("
    Blog post with some more details");$(".blog_url").attr("href",data.blog_url)}else{$("#more_info").hide()}str=data.producer;if(str&&str.length>0){$("#producer").html(str)}else{$("#producer").html("Bitergia")}$(".project_name").text(data.project_name);$("#project_url").attr("href",data.project_url)}Convert.convertRefcard=function(){$.when($.get(Report.getHtmlDir()+"refcard.html"),$.get(Report.getHtmlDir()+"project-card.html")).done(function(res1,res2){refcard=res1[0];projcard=res2[0];$("#Refcard").html(refcard);displayReportData();$.each(Report.getProjectsData(),function(prj_name,prj_data){var new_div="card-"+prj_name.replace(".","").replace(" ","");$("#Refcard #projects_info").append(projcard);$("#Refcard #projects_info #new_card").attr("id",new_div);$.each(Report.getDataSources(),function(i,DS){if(DS.getProject()!==prj_name){$("#"+new_div+" ."+DS.getName()+"-info").hide();return}DS.displayData(new_div)});$("#"+new_div+" #project_name").text(prj_name);if(Report.getProjectsDirs.length>1)$("#"+new_div+" .project_info").append(' Report');$("#"+new_div+" #project_url").attr("href",prj_data.url)})})};Convert.convertGlobalData=function(){var divs=$(".GlobalData");if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var data=DS.getGlobalData();var key=$(this).data("field");$(this).text(Report.formatValue(data[key],key))})}};Convert.convertProjectData=function(){var divs=$(".ProjectData");var p=Report.getParameterByName("project");if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var data=DS.getProjectsGlobalData()[p];if(data===undefined){return}var key=$(this).data("field");$(this).text(Report.formatValue(data[key],key))})}};Convert.convertRadarActivity=function(){var div_param="RadarActivity";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});Viz.displayRadarActivity(div_param)}};Convert.convertRadarCommunity=function(){var div_param="RadarCommunity";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});Viz.displayRadarCommunity("RadarCommunity")}};Convert.convertTreemap=function(){var div_param="Treemap";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});var file=$("#Treemap").data("file");$("#Treemap").empty();Viz.displayTreeMap("Treemap",file)}};Convert.convertBubbles=function(){div_param="Bubbles";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var radius=$(this).data("radius");div.id=ds+"-Bubbles";DS.displayBubbles(div.id,radius)})}};function loadHTMLEvolParameters(htmldiv,config_viz){config_viz.help=true;var help=$(htmldiv).data("help");if(help!==undefined)config_viz.help=help;config_viz.show_legend=false;if($(htmldiv).data("frame-time"))config_viz.frame_time=true;config_viz.graph=$(htmldiv).data("graph");if($(htmldiv).data("min")){config_viz.show_legend=false;config_viz.show_labels=true;config_viz.show_grid=true;config_viz.help=false}if($(htmldiv).data("legend"))config_viz.show_legend=true;config_viz.ligth_style=false;if($(htmldiv).data("light-style")){config_viz.light_style=true}if($(htmldiv).data("custom-title")){config_viz.custom_title=$(htmldiv).data("custom-title")}if(config_viz.help&&$(htmldiv).data("custom-help")){config_viz.custom_help=$(htmldiv).data("custom-help")}else{config_viz.custom_help=""}if($(htmldiv).data("repo-filter")){config_viz.repo_filter=$(htmldiv).data("repo-filter")}var start=$(htmldiv).data("start");if(start)config_viz.start_time=start;var end=$(htmldiv).data("end");if(end)config_viz.end_time=end;var remove_last_point=$(htmldiv).data("remove-last-point");if(remove_last_point)config_viz.remove_last_point=true;return config_viz}Convert.convertMetricsEvol=function(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvol";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");config_viz.title=$(this).data("title");var DS=Report.getDataSourceByName(ds);if(DS===null)return;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+this.id;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolCustomized=function(filter){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvolCustomized";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){if(filter!==$(this).data("filter"))return;var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");config_viz.title=$(this).data("title");var DS=Report.getDataSourceByName(ds);if(DS===null)return;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+this.id;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolSelector=function(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvol";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;var repository=Report.getParameterByName("repository");config_viz.repo_filter=repository;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+repository;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolSet=function(){div_param="MetricsEvolSet";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var all=$(this).data("all");var relative=$(this).data("relative");var summary_graph=$(this).data("summary-graph");var legend=$(this).data("legend-show");div.id=ds+"-MetricsEvolSet-"+this.id;if(all===true){div.id=ds+"-All";Viz.displayEnvisionAll(div.id,relative,legend,summary_graph);return false}var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;DS.displayEnvision(div.id,relative,legend,summary_graph)})}};Convert.convertTimeTo=function(){var div_tt="TimeTo";divs=$("."+div_tt);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;var quantil=$(this).data("quantil");var type=$(this).data("type");div.id=ds+"-time-to-"+type+"-"+quantil;if(type==="fix")DS.displayTimeToFix(div.id,quantil);if(type==="attention")DS.displayTimeToAttention(div.id,quantil)})}};Convert.convertMarkovTable=function(){var div_id_mt="MarkovTable";var divs=$("."+div_id_mt);var DS,ds;if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var title=$(this).data("title");div.id=ds+"-markov-table";DS.displayMarkovTable(div.id,title)})}};Convert.convertLastActivity=function(){var all_metrics=Report.getAllMetrics();function activityInfo(div,period,label){var html="

    Last "+label+"

    ";$.each(Report.getDataSources(),function(index,DS){var data=DS.getGlobalData();$.each(data,function(key,val){var suffix="_"+period;if(key.indexOf(suffix,key.length-suffix.length)!==-1){var metric=key.substring(0,key.length-suffix.length);label=metric;if(all_metrics[metric])label=all_metrics[metric].name;html+=label+":"+data[key]+"
    "}})});$(div).append(html)}var divs=$(".LastActivity");var period=null;var days={Week:7,Month:30,Quarter:90,Year:365};if(divs.length>0)$.each(divs,function(id,div){period=$(div).data("period");activityInfo(div,days[period],period)})};Convert.convertTopByPeriod=function(){var div_id_top="TopByPeriod";var divs=$("."+div_id_top);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var show_all=false;if($(this).data("show_all"))show_all=true;var top_metric=$(this).data("metric");var npeople=$(this).data("limit");var is_release=Utils.isReleasePage();var html=HTMLComposer.TopByPeriod(ds,top_metric,npeople,is_release);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertTop=function(){var div_id_top="Top";var divs=$("."+div_id_top);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var show_all=false;if($(this).data("show_all"))show_all=true;var top_metric=$(this).data("metric");var limit=$(this).data("limit");var graph=$(this).data("graph");var people_links=$(this).data("people_links");var threads_links=$(this).data("threads_links");var period=$(this).data("period");var period_all=$(this).data("period_all");var repository=Report.getParameterByName("repository");div.id=ds+"-"+div_id_top+unique++;if(graph){div.id+="-"+graph}if(period===undefined&&period_all===undefined){period_all=true}if(limit===undefined){limit=10}DS.displayTop(div.id,show_all,top_metric,period,period_all,graph,limit,people_links,threads_links,repository)})}};Convert.convertPersonMetrics=function(upeople_id,upeople_identifier){var config_metric={};config_metric.show_desc=false;config_metric.show_title=false;config_metric.show_labels=true;divs=$(".PersonMetrics");if(divs.length){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var metrics=$(this).data("metrics");config_metric.show_legend=false;config_metric.help=false;if($(this).data("frame-time"))config_metric.frame_time=true;if($(this).data("legend"))config_metric.show_legend=true;if($(this).data("person_id"))upeople_id=$(this).data("person_id"); -if($(this).data("person_name"))upeople_identifier=$(this).data("person_name");div.id=metrics.replace(/,/g,"-")+"-people-metrics";DS.displayMetricsPeople(upeople_id,upeople_identifier,metrics.split(","),div.id,config_metric)})}};function getRandomId(){return Math.floor(Math.random()*1e3+1)}Convert.convertPersonData=function(upeople_id,upeople_identifier){var divs=$(".PersonData"),name,email;if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if($(this).data("person_id"))upeople_id=$(this).data("person_id");if(!div.id)div.id="PersonData"+"-"+upeople_id+"-"+getRandomId();var data=Report.getPeopleIdentities()[upeople_id];if(data){name=DataProcess.selectPersonName(data);email=DataProcess.selectPersonEmail(data);email="("+DataProcess.hideEmail(email)+")"}else{if(upeople_identifier!==undefined)name=upeople_identifier;else name=upeople_id;email=""}html=HTMLComposer.personName(name,email);$("#"+div.id).append(html)})}};Convert.personSummaryBlock=function(upeople_id){var divs=$(".PersonSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");metric_name=$(this).data("metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(DS.getPeopleMetricsData()[upeople_id].length===0)return;var html=HTMLComposer.personDSBlock(ds_name,metric_name);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertPersonSummary=function(upeople_id,upeople_identifier){var divs=$(".PersonSummary");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if($(this).data("person_id"))upeople_id=$(this).data("person_id");if($(this).data("person_name"))upeople_identifier=$(this).data("person_name");div.id=ds+"-refcard-people";DS.displayPeopleSummary(div.id,upeople_id,upeople_identifier,DS)})}};Convert.convertPeople=function(upeople_id,upeople_identifier){if(upeople_id===undefined)upeople_id=Report.getParameterByName("id");if(upeople_identifier===undefined)upeople_identifier=Report.getParameterByName("name");if(upeople_id===undefined)return;if(Loader.check_people_item(upeople_id)===false){$.each(Report.getDataSources(),function(index,DS){Loader.data_load_people_item(upeople_id,DS,Convert.convertPeople)});return}Convert.personSummaryBlock(upeople_id);Convert.convertPersonData(upeople_id,upeople_identifier);Convert.convertPersonSummary(upeople_id,upeople_identifier);Convert.convertPersonMetrics(upeople_id,upeople_identifier);Convert.activateHelp()};function dataFilterAvailable(filter_name,item_name){if(filter_name==="repos"){if(DS.getReposGlobalData()[item_name]===undefined||DS.getReposGlobalData()[item_name].length===0)return false}else if(filter_name==="companies"){if(DS.getCompaniesGlobalData()[item_name]===undefined||DS.getCompaniesGlobalData()[item_name].length===0)return false}else if(filter_name==="countries"){if(DS.getCountriesGlobalData()[item_name]===undefined||DS.getCountriesGlobalData()[item_name].length===0)return false}else if(filter_name==="companies"){if(DS.getDomainsGlobalData()[item_name]===undefined||DS.getDomainsGlobalData()[item_name].length===0)return false}return true}Convert.repositoryDSBlock=function(repo_id){var divs=$(".FilterDSBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");filter_name=$(this).data("filter");aux=$(this).data("metrics");metric_names=aux.split(",");$.each(metric_names,function(id,value){metric_names[id]=metric_names[id].replace(/:/g,",")});DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(dataFilterAvailable(filter_name,repo_id)){var html=HTMLComposer.filterDSBlock(ds_name,filter_name,metric_names);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)}})}};Convert.convertDSSummaryBlock=function(upeople_id){var divs=$(".DSSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");box_labels=$(this).data("box-labels");box_metrics=$(this).data("box-metrics");ts_metrics=$(this).data("ts-metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;var html=HTMLComposer.DSBlock(ds_name,box_labels,box_metrics,ts_metrics);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertDSSummaryBlockProjectFiltered=function(upeople_id){var divs=$(".DSSummaryBlockProjectFiltered");var pname=Report.getParameterByName("project");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");box_labels=$(this).data("box-labels");box_metrics=$(this).data("box-metrics");ts_metrics=$(this).data("ts-metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getProjectsGlobalData()[pname]===undefined)return;if(DS.getProjectsGlobalData()[pname].length===0)return;var html=HTMLComposer.DSBlockProject(ds_name,box_labels,box_metrics,ts_metrics,pname);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertOverallSummaryBlock=function(){var divs=$(".OverallSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;var html=HTMLComposer.overallSummaryBlock();if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertDemographics=function(){var divs=$(".Demographics");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var period=$(this).data("period");div.id="Demographics"+"-"+ds+"-"+"-"+period;DS.displayDemographics(div.id,period)})}};function filterItemsConfig(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=false;config_metric.show_labels=true;config_metric.show_legend=false;return config_metric}Convert.getRealItem=function(ds,filter,item){var map=Report.getReposMap();if(map===undefined||map.length===0){if($.inArray(item,ds.getReposData())>-1)return item;else return null}var map_item=null;if(filter==="repos"){var rdata=ds.getReposMetricsData()[item];if(rdata===undefined){$.each(map,function(id,repos){$.each(Report.getDataSources(),function(index,DS){if(repos[DS.getName()]===item){map_item=repos[ds.getName()];return false}});if(map_item!==null)return false})}else map_item=item}else map_item=item;return map_item};Convert.convertFilterItemsSummary=function(filter){var divlabel="FilterItemsSummary";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;div.id=ds+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayReposSummary(div.id,DS);if(filter==="countries")DS.displayCountriesSummary(div.id,DS);if(filter==="companies")DS.displayCompaniesSummary(div.id,DS);if(filter==="domains")DS.displayDomainsSummary(div.id,DS);if(filter==="projects")DS.displayProjectsSummary(div.id,DS)})}};Convert.convertFilterItemsGlobal=function(filter){var config_metric=filterItemsConfig();var divlabel="FilterItemsGlobal";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;var metric=$(this).data("metric");var show_others=$(this).data("show-others");var order_by=$(this).data("order-by");config_metric.show_legend=$(this).data("legend");if($("#"+$(this).data("legend-div")).length>0){config_metric.legend={container:$(this).data("legend-div")}}else config_metric.legend={container:null};config_metric.graph=$(this).data("graph");config_metric.title=$(this).data("title");config_metric.show_title=1;div.id=metric+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayMetricReposStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="countries")DS.displayMetricCountriesStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="companies")DS.displayMetricCompaniesStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="domains")DS.displayMetricDomainsStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="projects")DS.displayMetricProjectsStatic(metric,div.id,config_metric,order_by,show_others)})}};Convert.convertFilterItemsNav=function(filter,page){var divlabel="FilterItemsNav";divs=$("."+divlabel);if(divs.length>0){var cont=0;$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("page"))page=$(this).data("page");order_by=$(this).data("order-by");div.id=ds+"-"+divlabel+"-"+cont;cont+=1;$(this).empty();if(filter==="repos")DS.displayItemsNav(div.id,filter,page,order_by);else if(filter==="countries")DS.displayItemsNav(div.id,filter,page);else if(filter==="companies")DS.displayItemsNav(div.id,filter,page);else if(filter==="domains")DS.displayItemsNav(div.id,filter,page);else if(filter==="projects")DS.displayItemsNav(div.id,filter,page)})}};Convert.convertFilterItemsMetricsEvol=function(filter){var config_metric=filterItemsConfig();var divlabel="FilterItemsMetricsEvol";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;var metric=$(this).data("metric");var stacked=false;if($(this).data("stacked"))stacked=true;if($(this).data("min")){config_viz.show_legend=false;config_viz.show_labels=true;config_viz.show_grid=true;config_viz.help=false}var start=$(this).data("start");var end=$(this).data("end");config_metric.lines={stacked:stacked};if($("#"+$(this).data("legend-div")).length>0){config_metric.legend={container:$(this).data("legend-div")}}else config_metric.legend={container:null};config_metric.show_legend=$(this).data("legend");config_metric.mouse_tracker=$(this).data("mouse_tracker");var remove_last_point=$(this).data("remove-last-point");if(remove_last_point)config_metric.remove_last_point=true;div.id=metric+"-"+divlabel;$(this).empty();if(filter==="companies")DS.displayMetricCompanies(metric,div.id,config_metric,start,end);else if(filter==="repos")DS.displayMetricRepos(metric,div.id,config_metric,start,end);else if(filter==="domains")DS.displayMetricDomains(metric,div.id,config_metric,start,end);else if(filter==="projects")DS.displayMetricProjects(metric,div.id,config_metric,start,end)})}};Convert.convertFilterItemsMiniCharts=function(filter,page){var config_metric=filterItemsConfig();var divlabel="FilterItemsMiniCharts";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("page"))page=$(this).data("page");var metrics=$(this).data("metrics");var order_by=$(this).data("order-by");var show_links=true;if($(this).data("show_links")!==undefined)show_links=$(this).data("show_links");var start=$(this).data("start");var end=$(this).data("end");var convert=$(this).data("convert");if($(this).data("frame-time"))config_metric.frame_time=true;var remove_last_point=$(this).data("remove-last-point");if(remove_last_point)config_metric.remove_last_point=true;div.id=metrics.replace(/,/g,"-")+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayReposList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="countries")DS.displayCountriesList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="companies")DS.displayCompaniesList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="domains")DS.displayDomainsList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="projects")DS.displayProjectsList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert)})}};Convert.convertFilterItemData=function(filter,item){var divs=$(".FilterItemData");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var label=Report.cleanLabel(item);if(!div.id)div.id="FilterItemData"+getRandomId();html=HTMLComposer.itemName(label,filter);$("#"+div.id).append(html)})}};Convert.convertFilterItemSummary=function(filter,item){var divlabel="FilterItemSummary";divs=$("."+divlabel);if(item!==null&&divs.length>0){$.each(divs,function(id,div){var real_item=item;ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");div.id=ds+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos"){DS.displayRepoSummary(div.id,real_item,DS)}else if(filter==="countries")DS.displayCountrySummary(div.id,real_item,DS);else if(filter==="companies")DS.displayCompanySummary(div.id,real_item,DS);else if(filter==="domains")DS.displayDomainSummary(div.id,real_item,DS);else if(filter==="projects")DS.displayProjectSummary(div.id,real_item,DS)})}};Convert.convertFilterItemMicrodashText=function(filter,item){var divs=$(".FilterItemMicrodashText");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var global_data;var real_item=item;var metric=$(this).data("metric");var show_name=$(this).data("name");var ds=Report.getMetricDS(metric)[0];if(ds===undefined)return;if(filter==="projects"){global_data=ds.getProjectsGlobalData()[item];if(global_data===undefined){return}}else{return}var html='
    ';if(show_name){html+='
    ';html+=''+ds.basic_metrics[metric].name+"";html+="
    "}$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var value=global_data[metric+"_"+period];var netvalue=global_data["diff_net"+column+"_"+period];var percentagevalue=global_data["percentage_"+column+"_"+period];percentagevalue=Math.round(percentagevalue*10)/10;if(value===undefined)return;var str_percentagevalue="";if(netvalue>0)str_percentagevalue="+"+percentagevalue;if(netvalue<0)str_percentagevalue="-"+Math.abs(percentagevalue);if(show_name){html+='
    '}else{html+='
    '}html+='Last '+period+" days:";html+=" "+Report.formatValue(value)+"
    ";if(netvalue===0){html+='  '+str_percentagevalue+"% "}else if(netvalue>0){html+='  '+str_percentagevalue+"% "}else if(netvalue<0){html+='  '+str_percentagevalue+"% "}html+="
    "});html+="
    ";$(div).append(html)})}};Convert.convertFilterItemMetricsEvol=function(filter,item){var config_metric=filterItemsConfig();var divlabel="FilterItemMetricsEvol";divs=$("."+divlabel);if(item!==null&&divs.length>0){$.each(divs,function(id,div){var real_item=item;var metrics=$(this).data("metrics");ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");config_metric=loadHTMLEvolParameters(div,config_metric);div.id=Report.cleanLabel(item).replace(/ /g,"_")+"-";div.id+=metrics.replace(/,/g,"-")+"-"+ds+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos"){DS.displayMetricsRepo(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="countries"){DS.displayMetricsCountry(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="companies"){DS.displayMetricsCompany(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="domains"){DS.displayMetricsDomain(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="projects"){DS.displayMetricsProject(real_item,metrics.split(","),div.id,config_metric)}})}};Convert.convertFilterItemTop=function(filter,item){var divlabel="FilterItemTop";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){var real_item=item;$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");var metric=$(this).data("metric");var period=$(this).data("period");var titles=$(this).data("titles");div.id=metric+"-"+ds+"-"+filter+"-"+divlabel+"-"+getRandomId();$(this).empty();div.className="";if(filter==="companies")DS.displayTopCompany(real_item,div.id,metric,period,titles)})}};Convert.convertSmartLinks=function(){var divs=$(".SmartLinks");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;target_page=$(this).data("target");label=$(this).data("label");var html=HTMLComposer.smartLinks(target_page,label);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.companyFilters=function(){var divs=$(".CompanyFilters");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;company_name=Report.getParameterByName("company");var html=HTMLComposer.companyFilters(company_name);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertFilterStudyItem=function(filter,item){var convertfn=Convert.convertFilterStudyItem;if(convertfn.done===undefined){convertfn.done={}}else if(convertfn.done[filter]===true)return;if(filter==="repositories")filter="repos";if(item===undefined){if(filter==="repos")item=Report.getParameterByName("repository");if(filter==="countries")item=Report.getParameterByName("country");if(filter==="companies")item=Report.getParameterByName("company");if(filter==="domains")item=Report.getParameterByName("domain");if(filter==="projects")item=Report.getParameterByName("project")}if(!item)return;if(Loader.FilterItemCheck(item,filter)===false)return;Convert.repositoryDSBlock(item);Convert.convertDSSummaryBlockProjectFiltered();Convert.convertFilterItemData(filter,item);Convert.convertFilterItemSummary(filter,item);Convert.convertFilterItemMetricsEvol(filter,item);Convert.convertFilterItemTop(filter,item);Convert.convertFilterItemMicrodashText(filter,item);Convert.convertProjectData();Convert.activateHelp();Convert.convertMetricsEvolSelector();convertfn.done[filter]=true};Convert.activateHelp=function(){$(".help").popover({html:true,trigger:"manual"}).click(function(e){$(this).popover("toggle");e.stopPropagation()})};Convert.convertFilterStudy=function(filter){var page=Report.getCurrentPage();if(page===null){page=Report.getParameterByName("page");if(page!==undefined)Report.setCurrentPage(page)}if(page===undefined){if($("[class^='FilterItems']").length>0){page=1;Report.setCurrentPage(page)}else return}if(filter==="repositories")filter="repos";if(Loader.check_filter_page(page,filter)===false){$.each(Report.getDataSources(),function(index,DS){Loader.data_load_items_page(DS,page,Convert.convertFilterStudy,filter)});return}Convert.convertFilterItemsSummary(filter);Convert.convertFilterItemsGlobal(filter);Convert.convertFilterItemsNav(filter,page);Convert.convertFilterItemsMetricsEvol(filter);Convert.convertFilterItemsMiniCharts(filter,page)};Convert.convertDSTable=function(){var dst="DataSourcesTable";var divs=$("."+dst);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();div.id=dst+unique++;Viz.displayDataSourcesTable(div)})}};Convert.convertBasicDivs=function(){Convert.convertNavbar();Convert.convertSmartLinks();Convert.convertSectionBreadcrumb();Convert.convertProjectMap();Convert.convertFooter();Convert.convertOverallSummaryBlock();Convert.convertDSSummaryBlock();Convert.convertDSTable();Convert.convertGlobalData();Convert.convertSummary();Convert.convertTopByPeriod();Convert.companyFilters()};Convert.convertBasicDivsMisc=function(){Convert.convertRadarActivity();Convert.convertRadarCommunity();Convert.convertTreemap();Convert.convertBubbles()};Convert.convertBasicMetrics=function(config){var item=Report.getParameterByName("repository");if(item===undefined)Convert.convertMetricsEvol();Convert.convertTimeTo();Convert.convertMarkovTable()};Convert.convertFilterTop=function(filter){var item=Report.getParameterByName("repository");if(item!==undefined){if(Loader.filterTopCheck(item,filter)===false)return}Convert.convertTop();Convert.convertRepositorySelector()}})();if(Report===undefined)var Report={};(function(){var project_data=null,markers=null,viz_config=null,gridster={},data_sources=[],report_config=null,html_dir="",menu_elements;var data_dir="data/json";var config_dir="config";var default_data_dir="data/json";var default_html_dir="";var projects_dirs=[default_data_dir];var projects_data={};var projects_datasources={};var repos_map;Report.all_json_file=data_dir+"/all.json";var project_file=config_dir+"/project-info.json";viz_config_file=data_dir+"/viz_cfg.json";markers_file=data_dir+"/markers.json";repos_map_file=data_dir+"/repos-map.json";projects_hierarchy_file=data_dir+"/projects_hierarchy.json";menu_elements_file=config_dir+"/menu-elements.json";var page_size=10,page=null;var project_people_identities={};Report.createDataSources=createDataSources;Report.getAllMetrics=getAllMetrics;Report.getMarkers=getMarkers;Report.getVizConfig=getVizConfig;Report.getProjectsHierarchy=getProjectsHierarchy;Report.getMenuElements=getMenuElements;Report.getMenuElementsReleases=getMenuElementsReleases;Report.getReleaseNames=getReleaseNames;Report.getMetricDS=getMetricDS;Report.getGridster=getGridster;Report.setGridster=setGridster;Report.getCurrentPage=function(){return page};Report.setCurrentPage=function(current_page){page=current_page};Report.getPageSize=function(){return page_size};Report.setPageSize=function(size){page_size=size};Report.getProjectData=getProjectData;Report.getProjectsData=getProjectsData;Report.convertStudies=convertStudies;Report.getDataSources=function(){return data_sources};Report.registerDataSource=function(backend){data_sources.push(backend)};Report.setHtmlDir=function(dir){html_dir=dir};Report.getHtmlDir=function(){return html_dir};Report.getDataDir=function(){return data_dir};Report.setDataDir=function(dataDir){data_dir=dataDir;project_file=dataDir+"/project-info.json";config_file=dataDir+"/viz_cfg.json";markers_file=dataDir+"/markers.json";repos_mapping_file=data_dir+"/repos-mapping.json";projects_hierarchy_file=data_dir+"/projects_hierarchy.json"};function getMarkers(){return markers}Report.setMarkers=function(data){markers=data};Report.getMarkersFile=function(){return markers_file};Report.getReposMap=function(){return repos_map};Report.setReposMap=function(data){repos_map=data};Report.getReposMapFile=function(){return repos_map_file};function getVizConfig(){return viz_config}Report.setVizConfig=function(cfg){viz_config=cfg};Report.getVizConfigFile=function(){return viz_config_file};function getProjectsHierarchy(){return projects_hierarchy}Report.setProjectsHierarchy=function(data){projects_hierarchy=data};Report.getProjectsHierarchyFile=function(){return projects_hierarchy_file};function getMenuElements(){var elements;if(menu_elements!==undefined){elements=menu_elements.menu}return elements}function getMenuElementsReleases(){var releases;if(menu_elements!==undefined){releases=menu_elements.menu_releases}return releases}function getReleaseNames(){var names;if(menu_elements!==undefined){names=menu_elements.releases}return names}Report.setMenuElements=function(data){menu_elements=data};Report.getMenuElementsFile=function(){return menu_elements_file};function getGridster(){return gridster}function setGridster(grid){gridster=grid}function getProjectData(){return project_data}Report.setProjectData=function(data){project_data=data};Report.getProjectFile=function(){return project_file};function getProjectsData(){return projects_data}Report.getProjectsDirs=function(){return projects_dirs};Report.setProjectsDirs=function(dirs){projects_dirs=dirs};Report.getProjectsList=function(){var projects_list=[];$.each(getProjectsData(),function(key,val){projects_list.push(key)});return projects_list};Report.getProjectsDataSources=function(){return projects_datasources};Report.setMetricsDefinition=function(metrics){$.each(Report.getDataSources(),function(i,DS){DS.setMetricsDefinition(metrics[DS.getName()])})};Report.getPeopleIdentities=function(){return project_people_identities};Report.setPeopleIdentities=function(people){project_people_identities=people};Report.cleanLabel=function(item){var label=item;var aux=null;if(item.split("___").length===2){aux=item.split(" ");label=aux[0]}else if(item.lastIndexOf("https:__api.github.com_repos_")===0){label=label.replace("https:__api.github.com_repos_","");label=label.split("_")[1]}else if(item.lastIndexOf("http")===0||item.split("_").length>3){aux=item.split("_");label=aux.pop();if(label==="")label=aux.pop();label=label.replace("buglist.cgi?product=","");label=label.replace("gmane.comp.sysutils.","")}else if(item.lastIndexOf("<")===0)label=MLS.displayMLSListName(item);return label};function strNumberWithThousands(x){var parts=x.toString().split(".");parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return parts.join(".")}Report.formatValue=function(number,field){if(number===undefined)return"-";var date_fields=["last_date","first_date"];var reports=["repositories","companies","countries","domains","projects"];var value=number;try{value=parseFloat(number).toFixed(1).toString().replace(/\.0$/,"");value=strNumberWithThousands(value);if(navigator.language==="es"){var parts=value.split(".");parts[0]=parts[0].replace(/,/g,".");value=parts.join(",")}}catch(err){}if(typeof value==="number"&&isNaN(value))value=number.toString();if(field!==undefined&&$.inArray(field,date_fields)>-1)value=number.toString();if(field!==undefined&&value==="0"){$.each(reports,function(i,report){if(field.indexOf(report)!=1){value="-"}})}return value};Report.escapeHtml=function(unsafe){return unsafe.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};Report.getParameterByName=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?undefined:Report.escapeHtml(decodeURIComponent(results[1].replace(/\+/g," ")))};function getMetricDS(metric_id){var ds=[];$.each(Report.getDataSources(),function(i,DS){if(DS.getMetrics()[metric_id]){ds.push(DS)}});return ds}Report.getDataSourceByName=function(ds){var DS=null;$.each(Report.getDataSources(),function(index,DSaux){if(DSaux.getName()===ds){DS=DSaux;return false}});return DS};function getAllMetrics(){var all={};$.each(Report.getDataSources(),function(index,DS){all=$.extend({},all,DS.getMetrics())});return all}Report.displayActiveMenu=function(){var active=window.location.href;var page=active.substr(active.lastIndexOf("/")+1,active.length);page=page.split(".html")[0];if(page.indexOf("scm")===0){$(".scm-menu")[0].className=$(".scm-menu")[0].className+" active"}else if(page.indexOf("its")===0){$(".its-menu")[0].className=$(".its-menu")[0].className+" active"}else if(page.indexOf("mls")===0){$(".mls-menu")[0].className=$(".mls-menu")[0].className+" active"}else if(page.indexOf("scr")===0){$(".scr-menu")[0].className=$(".scr-menu")[0].className+" active"}else if(page.indexOf("irc")===0){$(".irc-menu")[0].className=$(".irc-menu")[0].className+" active"}else if(page.indexOf("qaforum")===0){$(".qaforum-menu")[0].className=$(".qaforum-menu")[0].className+" active"}else if(page.indexOf("studies")===0){$(".studies-menu")[0].className=$(".studies-menu")[0].className+" active"}else if(page.indexOf("wiki")===0){$(".wiki-menu")[0].className=$(".wiki-menu")[0].className+" active"}else if(page.indexOf("downloads")===0){$(".downloads-menu")[0].className=$(".downloads-menu")[0].className+" active"}else if(page.indexOf("projects")===0){$(".listprojects-menu")[0].className=$(".listprojects-menu")[0].className+" active"}else if(page.indexOf("index")===0||page===""){if($(".summary-menu").length===0)return;$(".summary-menu")[0].className=$(".summary-menu")[0].className+" active"}else{if($(".experimental-menu")[0])$(".experimental-menu")[0].className=$(".experimental-menu")[0].className+" active"}};function checkDynamicConfig(){var data_sources=[];var release=$.urlParam("release");if(release!==null&&release.length>0){data_sources.push("data/json/"+release);Report.setDataDir("data/json/"+release);if(data_sources.length>0)Report.setProjectsDirs(data_sources)}}function createDataSources(){checkDynamicConfig();var projects_dirs=Report.getProjectsDirs();var scm,its,its_1,mls,scr,irc,mediawiki,people,downloads,qaforums,releases;$.each(projects_dirs,function(i,project){if(Report.getConfig()===null||Report.getConfig()["data-sources"]===undefined){its=new ITS;Report.registerDataSource(its);its_1=new ITS_1;Report.registerDataSource(its_1);mls=new MLS;Report.registerDataSource(mls);scm=new SCM;Report.registerDataSource(scm);scr=new SCR;Report.registerDataSource(scr);irc=new IRC;Report.registerDataSource(irc);mediawiki=new MediaWiki;Report.registerDataSource(mediawiki);people=new People;Report.registerDataSource(people);downloads=new Downloads;Report.registerDataSource(downloads);qaforums=new QAForums;Report.registerDataSource(qaforums);releases=new Releases;Report.registerDataSource(releases)}else{var active_ds=Report.getConfig()["data-sources"];$.each(active_ds,function(i,name){if(name==="its"){its=new ITS;Report.registerDataSource(its)}else if(name==="its_1"){its_1=new ITS_1;Report.registerDataSource(its_1)}else if(name==="mls"){mls=new MLS;Report.registerDataSource(mls)}else if(name==="scm"){scm=new SCM;Report.registerDataSource(scm)}else if(name==="scr"){scr=new SCR;Report.registerDataSource(scr)}else if(name==="irc"){irc=new IRC;Report.registerDataSource(irc)}else if(name==="mediawiki"){mediawiki=new MediaWiki;Report.registerDataSource(mediawiki)}else if(name==="people"){people=new People;Report.registerDataSource(people)}else if(name==="downloads"){downloads=new Downloads;Report.registerDataSource(downloads)}else if(name==="qaforums"){qaforums=new QAForums;Report.registerDataSource(qaforums)}else if(name==="releases"){releases=new Releases;Report.registerDataSource(releases)}else Report.log("Not support data source "+name)})}if(its)its.setDataDir(project);if(its_1)its_1.setDataDir(project);if(mls)mls.setDataDir(project);if(scm)scm.setDataDir(project);if(scr)scr.setDataDir(project);if(irc)irc.setDataDir(project);if(mediawiki)mediawiki.setDataDir(project);if(people)people.setDataDir(project);if(downloads)downloads.setDataDir(project);if(qaforums)qaforums.setDataDir(project);if(releases)releases.setDataDir(project);if(scm&&its)scm.setITS(its)});return true}Report.addDataDir=function(){var addURL;var querystr=window.location.search.substr(1);if(querystr&&querystr.indexOf("data_dir")!==-1){addURL=window.location.search.substr(1)}return addURL};Report.configDataSources=function(){var prjs_dss=Report.getProjectsDataSources();$.each(Report.getDataSources(),function(index,ds){if(ds.getData()instanceof Array)return;$.each(projects_data,function(name,project){if(project.dir===ds.getDataDir()){if(prjs_dss[name]===undefined)prjs_dss[name]=[]; -$.each(prjs_dss[name],function(prj,prjds){if(ds.getName()===prjds.getName())return false});ds.setProject(name);prjs_dss[name].push(ds);return false}})})};Report.getConfig=function(){return report_config};Report.setConfig=function(data){report_config=data;if(data){Report.log("Global config file found");if(data["global-html-dir"])Report.setHtmlDir(data["global-html-dir"]);if(data["global-data-dir"]){Report.setDataDir(data["global-data-dir"]);Report.setProjectsDirs([data["global-data-dir"]])}if(data["projects-data-dirs"])Report.setProjectsDirs(data["projects-data-dirs"])}};Report.convertGlobal=function(){Convert.convertBasicDivs();Convert.convertBasicDivsMisc();Convert.convertBasicMetrics();Convert.convertDemographics();Convert.convertMetricsEvolSet();Convert.convertLastActivity();Convert.convertMicrodash();Convert.convertMicrodashText()};Report.getActiveStudies=function(){var activeStudies=[];var reports;var reports_study=["repositories","countries","companies","domains","projects"];if(Report.getConfig()!==null)reports=Report.getConfig().reports;else reports=reports_study;$.each(reports_study,function(i,study){if($.inArray(study,reports)>-1)activeStudies.push(study)});return activeStudies};Report.convertStudiesGlobal=function(){Convert.convertPeople()};function convertStudies(){$.each(Report.getActiveStudies(),function(i,study){var filter=study;if(study==="repositories")filter="repos";DataProcess.orderItems(filter);Convert.convertFilterStudy(study);Convert.convertFilterStudyItem(study)})}var log_on=true;Report.getLog=function(){return log_on};Report.setLog=function(status){log_on=status};Report.log=function(msg){if(Report.getLog()===true)if(window.console)console.log(msg)}})();Loader.data_ready_global(function(){Report.configDataSources();Report.convertGlobal();Report.convertStudiesGlobal()});Loader.data_ready(function(){study="repos";Convert.convertFilterTop(study)});Loader.data_ready(function(){Report.convertStudies();$("body").css("cursor","auto");$("html").click(function(e){$(".help").popover("hide")});Convert.activateHelp()});$(document).ready(function(){$.getJSON(Report.getMenuElementsFile(),function(data){Report.setMenuElements(data)}).fail(function(){if(window.console)Report.log("Can't read global config file "+Report.getMenuElementsFile())}).always(function(data){Report.createDataSources();$.getJSON(Report.all_json_file,function(data){if(window.console){Report.log("Loaded all JSON data from "+Report.all_json_file)}Loader.set_all_data(data)}).always(function(data){Loader.data_load()});$("body").css("cursor","progress")})});function resizedw(){if(true){return}Report.convertGlobal();Report.convertStudiesGlobal();Report.convertStudies();Convert.activateHelp()}var resized;$(window).resize(function(){clearTimeout(resized);resized=setTimeout(resizedw,100)});function DataSource(name,basic_metrics){this.top_data_file=this.data_dir+"/"+this.name+"-top.json";this.getTopDataFile=function(){return this.top_data_file};this.getMetrics=function(){return this.basic_metrics};this.setMetrics=function(metrics){this.basic_metrics=metrics};this.setMetricsDefinition=function(metrics){if(metrics===undefined)return;this.setMetrics(metrics)};this.data_file=this.data_dir+"/"+this.name+"-evolutionary.json";this.getDataFile=function(){return this.data_file};this.setDataFile=function(file){this.data_file=file};this.data=null;this.getData=function(){return this.data};function nameSpaceMetrics(plain_metrics,ds){if(plain_metrics instanceof Array)return plain_metrics;var metrics={};if(plain_metrics===null){return metrics}$.each(plain_metrics,function(name,value){var basic_name=name;var aux=name.split("_");if(isNaN(aux[aux.length-1])===false)basic_name=aux.slice(0,aux.length-1).join("_");var ns_basic_name=ds.getName()+"_"+basic_name;var ns_name=ds.getName()+"_"+name;if(ds.getMetrics()[ns_basic_name]===undefined)metrics[name]=value;else metrics[ns_name]=value});return metrics}this.setData=function(load_data,self){if(self===undefined)self=this;self.data=nameSpaceMetrics(load_data,self)};this.demographics_aging_file=this.data_dir+"/"+this.name+"-demographics-aging.json";this.demographics_birth_file=this.data_dir+"/"+this.name+"-demographics-birth.json";this.getDemographicsAgingFile=function(){return this.demographics_aging_file};this.getDemographicsBirthFile=function(){return this.demographics_birth_file};this.demographics_data={};this.getDemographicsData=function(){return this.demographics_data};this.setDemographicsAgingData=function(data,self){if(self===undefined)self=this;self.demographics_data.aging=data};this.setDemographicsBirthData=function(data,self){if(self===undefined)self=this;self.demographics_data.birth=data};this.data_dir="data/json";this.getDataDir=function(){return this.data_dir};this.setDataDir=function(dataDir){this.data_dir=dataDir;this.data_file=dataDir+"/"+this.name+"-evolutionary.json";this.demographics_aging_file=dataDir+"/"+this.name+"-demographics-aging.json";this.demographics_birth_file=dataDir+"/"+this.name+"-demographics-birth.json";this.global_data_file=dataDir+"/"+this.name+"-static.json";this.top_data_file=dataDir+"/"+this.name+"-top.json";this.companies_data_file=dataDir+"/"+this.name+"-companies.json";this.repos_data_file=dataDir+"/"+this.name+"-repos.json";this.countries_data_file=dataDir+"/"+this.name+"-countries.json";this.domains_data_file=dataDir+"/"+this.name+"-domains.json";this.projects_data_file=dataDir+"/"+this.name+"-projects.json";this.time_to_fix_data_file=dataDir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json"};this.global_data_file=this.data_dir+"/"+this.name+"-static.json";this.getGlobalDataFile=function(){return this.global_data_file};this.global_data=null;this.getGlobalData=function(){return this.global_data};this.setGlobalData=function(data,self){if(self===undefined)self=this;var aux=Report.getMenuElements();var active_companies=null;if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0&&Object.keys(data).indexOf("companies")>=0){data.companies=active_companies.length}self.global_data=nameSpaceMetrics(data,self)};this.global_top_data=null;this.getGlobalTopData=function(){return this.global_top_data};this.setGlobalTopData=function(data,self){if(self===undefined)self=this;self.global_top_data=data};this.name=name;this.getName=function(){return this.name};this.people_data_file=this.data_dir+"/"+this.name+"-people.json";this.getPeopleDataFile=function(){return this.people_data_file};this.people=null;this.getPeopleData=function(){return this.people};this.setPeopleData=function(people,self){if(self===undefined)self=this;self.people=people};this.time_to_fix_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json";this.getTimeToFixDataFile=function(){return this.time_to_fix_data_file};this.time_to_fix_data=null;this.getTimeToFixData=function(){return this.time_to_fix_data};this.setTimeToFixData=function(data,self){if(self===undefined)self=this;self.time_to_fix_data=data};this.time_to_attention_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_attention_hour.json";this.getTimeToAttentionDataFile=function(){return this.time_to_attention_data_file};this.time_to_attention_data=null;this.getTimeToAttentionData=function(){return this.time_to_attention_data};this.setTimeToAttentionData=function(data,self){if(self===undefined)self=this;self.time_to_attention_data=data};this.project=null;this.getProject=function(){return this.project};this.setProject=function(project){this.project=project};this.markov_table_data_file=this.data_dir+"/"+this.name+"-markov.json";this.getMarkovTableDataFile=function(){return this.markov_table_data_file};this.markov_table_data=null;this.getMarkovTableData=function(){return this.markov_table_data};this.setMarkovTableData=function(data,self){if(self===undefined)self=this;self.markov_table_data=data};this.companies_data_file=this.data_dir+"/"+this.name+"-companies.json";this.getCompaniesDataFile=function(){return this.companies_data_file};this.companies=null;this.getCompaniesDataFull=function(){return this.companies};this.getCompaniesData=function(){var items=this.companies;if(items instanceof Array===false){if(this.companies!==null){items=this.companies.name}}return items};function filterOutCompaniesArray(com_data){var aux=Report.getMenuElements(),active_companies=null,result=[];if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0){$.each(com_data,function(pos,name){if(active_companies.indexOf(name)>=0){result[result.length]=name}})}else{result=com_data}return result}function filterOutCompanies(com_data){var aux=Report.getMenuElements();var active_companies=null;if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0){var keys=Object.keys(com_data);var positions=[];$.each(com_data.name,function(pos,name){if(active_companies.indexOf(name)>=0){positions[positions.length]=pos}});var new_obj={};$.each(keys,function(id,k){new_obj[k]=[];$.each(positions,function(subid,pos){var l=new_obj[k].length;new_obj[k][l]=com_data[k][pos]})});com_data=new_obj}return com_data}this.setCompaniesData=function(companies,self){if(companies===null)companies=[];if(self===undefined)self=this;if(Array.isArray(companies)){self.companies=filterOutCompaniesArray(companies)}else if(typeof companies==="object"){self.companies=filterOutCompanies(companies)}};this.companies_metrics_data={};this.addCompanyMetricsData=function(company,data,self){if(self===undefined)self=this;self.companies_metrics_data[company]=nameSpaceMetrics(data,self)};this.getCompaniesMetricsData=function(){return this.companies_metrics_data};this.companies_global_data={};this.addCompanyGlobalData=function(company,data,self){if(self===undefined)self=this;self.companies_global_data[company]=nameSpaceMetrics(data,self)};this.getCompaniesGlobalData=function(){return this.companies_global_data};this.companies_top_data={};this.addCompanyTopData=function(company,data,self){if(self===undefined)self=this;if(self.companies_top_data[company]===undefined)self.companies_top_data[company]={};self.companies_top_data[company]=data};this.getCompaniesTopData=function(){return this.companies_top_data};this.setCompaniesTopData=function(data,self){if(self===undefined)self=this;self.companies_top_data=data};this.repos_data_file=this.data_dir+"/"+this.name+"-repos.json";this.getReposDataFile=function(){return this.repos_data_file};this.repos=null;this.getReposDataFull=function(){return this.repos};this.getReposData=function(){var items=this.repos;if(items instanceof Array===false){if(this.repos!==null){items=this.repos.name}}return items};this.setReposData=function(repos,self){if(self===undefined)self=this;self.repos=repos;if(self.getName()!=="its")return;repos_names=[];if(repos instanceof Array===true){self.repos={};self.repos.name=repos}var filtered_repos=[];for(var i=0;i=0){if(self.getName()==="mls"){var mls_name=MLS.displayMLSListName(value);data[mls_name]=self.getReposMetricsData()[value]}else{data[value]=self.getReposMetricsData()[value]}}})}else{data=this.getData()}if(convert){data=DataProcess.convert(data,convert,metric_ids);if(convert==="divide"){mlabel=this.getMetrics()[metric_ids[0]].name+"/";mlabel+=this.getMetrics()[metric_ids[1]].name;metric_ids=["divide"];this.getMetrics().divide={name:mlabel}}if(convert==="substract"){mlabel=this.getMetrics()[metric_ids[0]].name+"-";mlabel+=this.getMetrics()[metric_ids[1]].name;metric_ids=["substract"];this.getMetrics().substract={name:mlabel}}}Viz.displayMetricsEvol(this,metric_ids,data,div_target,config,repositories)};this.isPageDisplayed=function(visited,linked,total,displayed){var window=Math.floor((displayed-3)/2);var lowest_barrier=visited-window;var highest_barrier=visited+window;if(linked===1||linked===total||linked==visited){return true}else if(linked>=lowest_barrier&&linkedvisited){return true}else{return false}};this.displayItemsNav=function(div_nav,type,page_str,order_by){var page=parseInt(page_str,null);if(isNaN(page))page=1;var items=null;var title="";var total=0;var displayed_pages=5;if(type==="companies"){items=this.getCompaniesData();title="List of companies"}else if(type==="repos"){items=this.getReposData();if(order_by)items=DataProcess.sortGlobal(this,order_by,type)}else if(type==="countries"){items=this.getCountriesData()}else if(type==="domains"){items=this.getDomainsData()}else if(type==="projects"){items=this.getProjectsData()}else{return}total=items.length;var nav="";var psize=Report.getPageSize();if(page){nav+=""}if(Report.getPageSize()>10)$.each(items,function(id,item){var label=Report.cleanLabel(item);nav+=""+label+" "});$("#"+div_nav).append(nav)};this.displayCompaniesLinks=function(div_links,limit,sort_metric){var sorted_companies=DataProcess.sortGlobal(this,sort_metric,"companies");var links="";var i=0;$.each(sorted_companies,function(id,company){links+='| ";if(i++>=limit-1)return false});$("#"+div_links).append(links)};this.displayCompaniesList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("companies",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayReposList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("repos",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayCountriesList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("countries",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayDomainsList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("domains",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayProjectsList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("projects",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displaySubReportList=function(report,metrics,div_id,config_metric,sort_metric,page_str,show_links,start,end,convert){var page=parseInt(page_str,null);if(isNaN(page))page=1;var list="";var cont=(page-1)*Report.getPageSize()+1;var ds=this;var data=null,sorted=null;if(show_links===undefined)show_links=true;if(report==="companies"){data=this.getCompaniesMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="repos"){data=this.getReposMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="countries"){data=this.getCountriesMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="domains"){data=this.getDomainsMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="projects"){data=this.getProjectsMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else return;sorted=DataProcess.paginate(sorted,page);list+='';list+="";$.each(metrics,function(id,metric){if(ds.getMetrics()[metric]){title=ds.getMetrics()[metric].name;list+=""}else{list+=""}});list+="";$.each(sorted,function(id,item){list+="";$.each(metrics,function(id,metric){list+="";rows_html+="";rows_html+=""}return rows_html}function composeTopRowsThreads(threads_data,limit,threads_links){var rows_html="";for(var i=0;i";rows_html+="'}else{rows_html+=""}rows_html+="";rows_html+="";rows_html+=""}return rows_html}function composeTopRowsPeople(people_data,limit,people_links,var_names){var rows_html="";for(var j=0;j";rows_html+="";rows_html+=""}return rows_html}function composeTopTabs(periods,metric,data,ds_name){var tabs_html="";var first=true;tabs_html+='";return tabs_html}function composeTitle(metric,ds_name,tabs,desc_metrics,selected_period){var key=ds_name+"_"+metric;var desc="";var title="";if(key in desc_metrics){desc=desc_metrics[key].desc;desc=desc.toLowerCase()}if(selected_period===""){data_period_formatted="Complete history"}else if(selected_period==="last month"){data_period_formatted="Last 30 days"}else if(selected_period==="last year"){data_period_formatted="Last 365 days"}if(Utils.isReleasePage())data_period_formatted="Release history";if(tabs===true){title+="
    Top "+desc+"
    "}else{title+='
    '+data_period_formatted+"
    "}return title}String.prototype.capitalize=function(){return this.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()})};function displayTopMetric_new(div_id,data,metric,limit,desc_metrics,people_links,threads_links,selected_period){var tabs="";var tables="";var title="";var gen_tabs=true;var div=$("#"+div_id);var ds_name=div.attr("data-data-source");if(Report.getParameterByName("repository")!==undefined){people_links=false}periods=getSortedPeriods();if(selected_period!==undefined){gen_tabs=false}title+=composeTitle(metric,ds_name,gen_tabs,desc_metrics,selected_period);if(gen_tabs===true){tabs+=composeTopTabs(periods,metric,data,ds_name)}tables+='
    ';var var_names=getTopVarsFromMetric(metric,ds_name);if(gen_tabs===true){var first=true;var html="";for(var k=0;k';tables+='
    "+title+""+metric+"
    ";list+="#"+cont+" ";cont++;var addURL=null;if(Report.addDataDir())addURL=Report.addDataDir();if(show_links){var release_var="";if(Utils.isReleasePage())release_var="&release="+$.urlParam("release");if(report==="companies"){list+=""}else if(report==="repos"){list+=""}else if(report==="countries"){list+=""}else if(report==="domains"){list+=""}else if(report==="projects"){list+=""}}list+="";list+=Report.cleanLabel(item);list+="";if(show_links)list+="";list+="";list+="
    ";if(data.companies_2006)html+="Companies in 2006: "+data.companies_2006+"
    ";if(data.companies_2009)html+="Companies in 2009: "+data.companies_2009+"
    ";if(data.companies_2012)html+="Companies in 2012: "+data.companies_2012+"
    ";$("#"+divid).append(html)};this.getSummaryLabels=function(){};this.getLabelForRepository=function(){return"repository"};this.getLabelForRepositories=function(){return"repositories"};this.displaySummary=function(report,divid,item,ds){if(!item)item="";var html="
    "+ds.getTitle()+"
    ";var id_label=this.getSummaryLabels();var global_data=null;if(report==="companies")global_data=ds.getCompaniesGlobalData()[item];else if(report==="countries")global_data=ds.getCountriesGlobalData()[item];else if(report==="repositories")global_data=ds.getReposGlobalData()[item];else if(report==="domains")global_data=ds.getDomainsGlobalData()[item];else if(report==="projects")global_data=ds.getProjectsGlobalData()[item];else global_data=ds.getGlobalData();if(!global_data)return;html=HTMLComposer.repositorySummaryTable(ds,global_data,id_label);$("#"+divid).append(html)};this.displayReposSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total repositories: "+data[ds.getName()+"_repositories"]+"
    ";$("#"+divid).append(html)};this.displayCountriesSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total countries: "+data[ds.getName()+"_countries"]+"
    ";$("#"+divid).append(html)};this.displayDomainsSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total domains: "+data.domains+"
    ";$("#"+divid).append(html)};this.displayProjectsSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total projects: "+data.projects+"
    ";$("#"+divid).append(html)};this.displayDemographics=function(divid,period){var data=this.getDemographicsData();Viz.displayDemographicsChart(divid,data,period)};this.displayTimeToAttention=function(div_id,column,labels,title){labels=true;title="Time to Attention "+column;var data=this.getTimeToAttentionData();if(data instanceof Array)return;Viz.displayTimeToAttention(div_id,data,column,labels,title)};this.displayTimeToFix=function(div_id,column,labels,title){labels=true;title="Time to Fix "+column;var data=this.getTimeToFixData();if(data instanceof Array)return;Viz.displayTimeToFix(div_id,this.getTimeToFixData(),column,labels,title) -};this.displayMarkovTable=function(div_id,title){var data=this.getMarkovTableData();if(data===undefined){Report.log("No Markov data available");return}Viz.displayMarkovTable(div_id,data,title)};this.displayTop=function(div,all,show_metric,period,period_all,graph,limit,people_links,threads_links,repository){if(all===undefined)all=true;var titles=null;Viz.displayTop(div,this,all,show_metric,period,period_all,null,null,limit,people_links,threads_links,repository)};this.displayTopCompany=function(company,div,metric_id,period,titles){var data=this.getCompaniesTopData()[company];if(data===undefined)return;var metric=this.getMetrics()[metric_id];Viz.displayTopCompany(company,data,div,metric,period,titles)};this.displayTopGlobal=function(div,metric,period,titles){Viz.displayTopGlobal(div,this,metric,period,titles)};this.envisionEvo=function(div_id,history,relative,legend_show,summary_graph){config=Report.getVizConfig();var options=Viz.getEnvisionOptions(div_id,history,this.getName(),Report.getVizConfig()[this.getName()+"_hide"],summary_graph);options.legend_show=legend_show;if(relative)DataProcess.addRelativeValues(options.data,this.getMainMetric());new envision.templates.Envision_Report(options,[this])};this.displayEnvision=function(divid,relative,legend_show,summary_graph){var projects_full_data=Report.getProjectsDataSources();this.envisionEvo(divid,projects_full_data,relative,legend_show,summary_graph)}}if(Viz===undefined)var Viz={};(function(){var bitergiaColor="#ffa500";Viz.displayTop=displayTop;Viz.displayTopCompany=displayTopCompany;Viz.displayTopGlobal=displayTopGlobal;Viz.displayBasicChart=displayBasicChart;Viz.displayMetricCompanies=displayMetricCompanies;Viz.displayMetricSubReportStatic=displayMetricSubReportStatic;Viz.displayMetricsCompany=displayMetricsCompany;Viz.displayMetricsDomain=displayMetricsDomain;Viz.displayMetricsProject=displayMetricsProject;Viz.displayMetricsPeople=displayMetricsPeople;Viz.displayMetricsRepo=displayMetricsRepo;Viz.displayMetricRepos=displayMetricRepos;Viz.displayMetricsCountry=displayMetricsCountry;Viz.displayMetricDomains=displayMetricDomains;Viz.displayMetricProjects=displayMetricProjects;Viz.displayMetricsEvol=displayMetricsEvol;Viz.displayBubbles=displayBubbles;Viz.displayDemographicsChart=displayDemographicsChart;Viz.displayEnvisionAll=displayEnvisionAll;Viz.displayTimeToFix=displayTimeToFix;Viz.displayTimeToAttention=displayTimeToAttention;Viz.displayMetricSubReportLines=displayMetricSubReportLines;Viz.displayRadarActivity=displayRadarActivity;Viz.displayRadarCommunity=displayRadarCommunity;Viz.displayTreeMap=displayTreeMap;Viz.displayMarkovTable=displayMarkovTable;Viz.displayDataSourcesTable=displayDataSourcesTable;Viz.getEnvisionOptions=getEnvisionOptions;Viz.checkBasicConfig=checkBasicConfig;Viz.displayTimeZone=displayTimeZone;function findMetricDoer(history,metric_id){var doer="";$.each(Report.getAllMetrics(),function(name,metric){if(metric.action===metric_id){doer=metric.column;return false}});return doer}function displayMarkovTable(div_id,data,title){var html="

    "+title+"

    ";var table='';table+="";$.each(data,function(i,val){subdata=data[i];old_value="old_value";new_value="new_value";percent="f";number="issue";for(var k=0;k";table+="";table+=""}});table+="
    TransitionNumberPercent
    "+i+" -> "+value_new+""+value_num+""+value_p+"
    ";html+=table;div=$("#"+div_id);div.append(html);return}function translate(labels,l){if(labels.hasOwnProperty(l)){return labels[l]}else{return l}}function getTopVarsFromMetric(metric,ds_name){var var_names={};var_names.id="id";if(metric==="senders"&&(ds_name==="mls"||ds_name==="irc")){var_names.name="senders";var_names.action="sent"}if(metric==="authors"&&ds_name==="scm"){var_names.name="authors";var_names.action="commits"}if(metric==="closers"&&(ds_name==="its"||ds_name==="its_1")){var_names.name="closers";var_names.action="closed"}if(ds_name==="scr"){if(metric==="mergers"){var_names.name="mergers";var_names.action="merged"}if(metric==="openers"){var_names.name="openers";var_names.action="opened"}if(metric==="reviewers"){var_names.name="reviewers";var_names.action="reviews"}}if(ds_name==="downloads"){if(metric==="ips"){var_names.name="ips";var_names.action="downloads"}if(metric==="packages"){var_names.name="packages";var_names.action="downloads"}}if(ds_name==="mediawiki"){if(metric==="authors"){var_names.name="authors";var_names.action="reviews"}}if(ds_name==="qaforums"){if(metric==="senders"||metric==="asenders"||metric==="qsenders"){var_names.name="senders";var_names.action="sent"}else if(metric==="participants"){var_names.name="name";var_names.action="messages_sent"}}if(ds_name==="releases"){if(metric==="authors"){var_names.name="username";var_names.action="releases"}}return var_names}function getSortedPeriods(){return["last month","last year",""]}function composeTopRowsDownloads(dl_data,limit,var_names){var rows_html="";for(var j=0;j
    "+(j+1)+"";rows_html+=dl_data[var_names.name][j];rows_html+=""+metric_value+"
    #"+(i+1)+"";if(threads_links===true){var url="http://www.google.com/search?output=search&q=X&btnI=1";if(threads_data.hasOwnProperty("url")&&threads_data.url[i].length>0){url="http://www.google.com/search?output=search&q=X%20site%3AY&btnI=1";url=url.replace(/Y/g,threads_data.url[i])}url=url.replace(/X/g,threads_data.subject[i]);rows_html+="";rows_html+='';rows_html+=threads_data.subject[i]+"";rows_html+=' "+threads_data.subject[i]+""+threads_data.initiator_name[i]+""+threads_data.length[i]+"
    "+(j+1)+"";if(people_links){rows_html+='"}else{rows_html+=DataProcess.hideEmail(people_data[var_names.name][j])}rows_html+=""+metric_value+"
    ';if(metric==="threads"){tables+=composeTopRowsThreads(data[key],limit,threads_links)}else if(metric==="packages"||metric==="ips"){unit=desc_metrics[ds_name+"_"+metric].action;metric_name=desc_metrics[ds_name+"_"+metric].name;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsDownloads(data[key],limit,var_names)}else{unit=desc_metrics[ds_name+"_"+metric].action;metric_name=desc_metrics[ds_name+"_"+metric].name;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data[key],limit,people_links,var_names);tables+=""}tables+="
    #"+metric_name.capitalize()+""+unit.capitalize()+"
    #"+metric_name.capitalize()+""+unit.capitalize()+"
    ";tables+="
    "}}}else{tables+='';if(metric==="threads"){tables+=composeTopRowsThreads(data,limit,threads_links)}else if(metric==="packages"||metric==="ips"){unit=desc_metrics[ds_name+"_"+metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsDownloads(data,limit,var_names)}else{unit=desc_metrics[ds_name+"_"+metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data,limit,people_links,var_names);tables+=""}tables+="
    #"+metric.capitalize()+""+unit.capitalize()+"
    #"+metric.capitalize()+""+unit.capitalize()+"
    "}tables+="
    ";if(gen_tabs===false){div.append(title)}div.append(tabs);div.append(tables);if(gen_tabs===true){script="";div.append(script)}}function displayTopMetric(div_id,metric,metric_period,history,graph,titles,limit,people_links){var top_metric_id=metric.name;if(!history||$.isEmptyObject(history))return;var metric_id=metric.action;if(limit&&history[metric_id].length
    "}new_div+=table;div=$("#"+div_id);div.append(new_div);if(graph){var labels=history[doer];var data=history[metric_id];if(limit){labels=[];data=[];for(var i=0;i';html+="Data SourceFrom";html+="To (Updated on)";$.each(dsources,function(key,ds){if(ds.getName()==="people")return;var gdata=ds.getGlobalData();var ds_name=ds.getTitle();if(ds_name===undefined){ds_name="-"}var last_date=gdata.last_date;if(last_date===undefined){return}var first_date=gdata.first_date;if(first_date===undefined){first_date="-"}var type=gdata.type;html+=""+ds_name;if(type!==undefined){type=type.toLowerCase();type=type.charAt(0).toUpperCase()+type.slice(1);html+=" ("+type+")"}html+="";html+=""+first_date+"";html+=""+last_date+""});html+="";$(div).append(html)}function showHelp(div_id,metrics,custom_help){var all_metrics=Report.getAllMetrics();var help='"+value.name+": "+value.desc+"
    ";return false}};for(var i=0;iDescription: "+custom_help}help+='data-content="'+content+'" data-html="true">';help+='
    ';var old_help=$("#"+div_id).prev()[0];if(old_help&&old_help.className==="help")$("#"+div_id).prev().empty();$("#"+div_id).before(help)}function displayMetricsLines(div_id,metrics,history,title,config){if(!(config&&config.help===false))showHelp(div_id,metrics,config.custom_help);var lines_data=[];if(config.remove_last_point)history=DataProcess.revomeLastPoint(history);if(config.frame_time)history=DataProcess.frameTime(history,metrics);if(config.start_time)history=DataProcess.filterDates(config.start_time,config.end_time,history);$.each(metrics,function(id,metric){if(!history[metric])return;var mdata=[];$.each(history[metric],function(i,value){mdata[i]=[history.id[i],history[metric][i]]});var label=metric;if(Report.getAllMetrics()[metric])label=Report.getAllMetrics()[metric].name;lines_data.push({label:label,data:mdata})});displayDSLines(div_id,history,lines_data,title,config)}function displayMetricsLinesRepos(div_id,metrics,history,title,config,repositories){if(!(config&&config.help===false))showHelp(div_id,metrics,config.custom_help);var lines_data=[];var metric=metrics[0];var aux={};$.each(history,function(item,data){if(data===undefined)return false;if(data[metric]===undefined)return false;if(config.remove_last_point)data=DataProcess.revomeLastPoint(data);if(config.frame_time)data=DataProcess.frameTime(data,[metric]);if(config.start_time)data=DataProcess.filterDates(config.start_time,config.end_time,data);var mdata=[[],[]];$.each(data[metric],function(i,value){mdata[i]=[data.id[i],data[metric][i]]});lines_data.push({label:item,data:mdata});aux=data});displayDSLines(div_id,aux,lines_data,title,config)}function displayMetricSubReportLines(div_id,metric,items,title,config,start,end,convert,order){var lines_data=[];var history={};$.each(items,function(item,data){if(data===undefined)return false;if(data[metric]===undefined)return false;if(convert)data=DataProcess.convert(data,convert,metric);if(start)data=DataProcess.filterDates(start,end,data);if(config.frame_time)data=DataProcess.frameTime(data,[metric]);var cdata=[[],[]];for(var i=0;i1){if(lines_data[i].label!==undefined)company_name=lines_data[i].label;label+=lines_data[i].label+":"}label+=""+Report.formatValue(value)+"";if(company_name)label+="("+companies[company_name].pending[o.index]+")";label+="
    "}return label};function getConfLinesChart(title,legend_div,history,lines_data,mouse_tracker_fn){var config={subtitle:title,legend:{show:true,container:legend_div},xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",margin:true},yaxis:{min:null,noTicks:2,autoscale:true},grid:{verticalLines:false,color:"#000000",outlineWidth:1,outline:"s"},mouse:{container:legend_div,track:true,trackY:false,relative:true,position:"ne",trackFormatter:function(o){var label=history.date[parseInt(o.index,10)];if(label===undefined)label="";else label+="
    ";for(var i=0;i1){if(lines_data[i].label!==undefined){value_name=lines_data[i].label;label+=value_name+":"}}label+=""+Report.formatValue(value)+"
    "}return label}},selection:{mode:"x",fps:10},shadowSize:4};if(mouse_tracker_fn){Viz._history=history;Viz._lines_data=lines_data;config.mouse.trackFormatter=Viz[mouse_tracker_fn]}return config}function dropLastLineValue(history,lines_data){if(lines_data.length===0)return lines_data;if(lines_data.length>1){for(var j=0;jb[1]||b[1]===undefined?1:-1});return bi_array}function getMax(multiple_array,from_unixstamp,to_unixstamp){from_unixstamp=Math.round(from_unixstamp);to_unixstamp=Math.round(to_unixstamp);var narrays=multiple_array.length;var aux_array=[];for(var i=0;i0;z--){var aux_value=multiple_array[i].data[z][0];var cond=aux_valueto_unixstamp;if(cond){multiple_array[i].data.splice(z,1)}}}var res=[];for(i=0;i1){if(lines_data[i].label!==undefined)label+=lines_data[i].label+":"}label+=Report.formatValue(value)+"
    "}return label}}};if(config_metric){if(!config_metric.show_title)config.title="";if("show_legend"in config_metric){if(config_metric.show_legend===true)config.legend.show=true;else config.legend.show=false}if(config_metric.lines&&config_metric.lines.stacked)config.lines={stacked:true,fill:true,fillOpacity:1,fillBorder:true,lineWidth:.01};if(!config_metric.show_labels){config.xaxis.showLabels=false;config.yaxis.showLabels=false}if(config_metric.show_grid===false){config.grid.verticalLines=false;config.grid.horizontalLines=false;config.grid.outlineWidth=0}if(config_metric.show_mouse===false){config.mouse.track=false}if(config_metric.graph==="bars"){config.bars={show:true}}if(config_metric.light_style===true){config.grid.color="#ccc";config.legend.show=false}if(config_metric.custom_title){config.subtitle=config_metric.custom_title}}var showLastPoint=false;if(config_metric.graph!=="bars"&&lines_data.length===1&&lines_data[0].data[0][0]===0){showLastPoint=true}if(showLastPoint){lines_data=lastLineValueToPoint(history,lines_data);var next_id=history.id[history.id.length-1]+1;lines_data[0].data.push([next_id,undefined]);lines_data[1].data.push([next_id,undefined]);history.date.push("");history.id.push(next_id)}graph=Flotr.draw(container,lines_data,config);if(showLastPoint){if(history.date)history.date.pop();if(history.id)history.id.pop()}}function guessBarWidth(lines_data,history){var gap_size;var data_sets=lines_data.length;gap_size=parseInt(history.unixtime[1],10)-parseInt(history.unixtime[0],10);return gap_size/(data_sets+1)}function timeToUnixTime(lines_data,history,bars_flag,bar_width){var number_lines=lines_data.length;var data_length=lines_data[0].data.length;for(var z=0;z1)config.legend.show=true;lines_data=timeToUnixTime(lines_data,history,bars_flag,bar_width);var showLastPoint=false;if(Utils.isReleasePage()===false){if(config_metric.graph!=="bars"&&lines_data.length===1){showLastPoint=true}if(showLastPoint){lines_data=lastLineValueToPoint(history,lines_data);addEmptyValue(lines_data)}else if(!showLastPoint&&lines_data.length>1){dropLastLineValue(history,lines_data)}}function drawGraph(opts){var o=Flotr._.extend(Flotr._.clone(config),opts||{});return Flotr.draw(container,lines_data,o)}graph=drawGraph();Flotr.EventAdapter.observe(container,"flotr:select",function(area){var zoom_options={xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",min:area.x1,max:area.x2},yaxis:{min:area.y1,autoscale:true},grid:{verticalLines:true,color:"#000000",outlineWidth:1,outline:"s"}};zoom_options.subtitle=composeRangeText(config.subtitle,area.xfirst,area.xsecond);var new_lines_data_object=JSON.parse(JSON.stringify(lines_data));var max_value=getMax(new_lines_data_object,area.x1,area.x2);zoom_options.yaxis.max=max_value+max_value*.2;graph=drawGraph(zoom_options)});Flotr.EventAdapter.observe(container,"flotr:click",function(){drawGraph()});$(window).resize(function(){drawGraph()})}function displayTimeZone(divid,labels,data,metric_name){var title="Time zones for "+metric_name;var container=document.getElementById(divid);var chart_data=[],i;var legend_div=null;for(i=0;i0)label+="+"+value;else label+=value;return label},color:"#000000",tickDecimals:0},yaxis:{showLabels:true,min:0,noTicks:2,color:"#000000"},mouse:{track:true,trackY:false,relative:true,position:"n",trackDecimals:0,trackFormatter:function(tuple){var label="UTC ";if(tuple.x>0)label+="+"+tuple.x;else label+=tuple.x;pretty_name=metric_name.charAt(0).toUpperCase()+metric_name.slice(1);label+="
    "+pretty_name+": "+tuple.y+"";return label}},legend:{show:false},bars:{show:true,color:"#008080",fillColor:"#008080",fillOpacity:.6}};graph=Flotr.draw(container,chart_data,config);$(window).resize(function(){graph=Flotr.draw(container,chart_data,config)})}function displayBasicChart(divid,labels,data,graph,title,config_metric,rotate,fixColor,yformatter){var horizontal=false;if(rotate)horizontal=true;var container=document.getElementById(divid);var legend_div=null;if(config_metric&&config_metric.legend&&config_metric.legend.container)legend_div=$("#"+config_metric.legend.container);var chart_data=[],i;var label="";if(!horizontal){for(i=0;ilseries)lseries=data[1].length;var horizontal=false;if(rotate)horizontal=true;var container=document.getElementById(divid);var legend_div=null;if(config_metric&&config_metric.legend&&config_metric.legend.container)legend_div=$("#"+config_metric.legend.container);var serie1=[],i,serie2=[],data_viz=[];for(i=0;ii)val1=data[0][i];else val1=undefined;if(data[1].length>i)val2=data[1][i];else val2=undefined;if(!horizontal){serie1.push([i-bar_width/2,val1]);serie2.push([i+bar_width/2,val2])}else{serie1.push([val1,i-bar_width/2]);serie2.push([val2,i+bar_width/2])}}data_viz=[{data:serie1,label:labels[0]},{data:serie2,label:labels[1]}];var config={title:title,bars:{show:true,horizontal:horizontal,barWidth:bar_width},grid:{verticalLines:false,horizontalLines:false,outlineWidth:0},xaxis:{showLabels:false,min:0},yaxis:{showLabels:true,min:0},mouse:{container:legend_div,track:true,trackFormatter:function(o){var index;var i="x";if(horizontal)i="y";var point=parseFloat(o[i],1);var point_down=Math.round((point-.2)*10)/10;var point_up=Math.round((point+.2)*10)/10;if(point_down===parseInt(point,10))index=point_down;else index=point_up;var years=index;if(period_year)years=index*period_year;var label=years+" years: ";var val1,val2;if(serie1[index]===undefined)val1=0;else val1=parseInt(serie1[index][0],10);if(isNaN(val1))val1=0;if(serie2[index]===undefined)val2=0;else val2=parseInt(serie2[index][0],10);if(isNaN(val2))val2=0;label+=val1+" "+labels[0];label+=" , ";label+=val2+" "+labels[1];label+=" ("+parseInt(val1/val2*100,10)+"% )";return label}},legend:{show:true,position:"ne",backgroundColor:"#D2E8FF",container:legend_div}};if(config_metric){if(!config_metric.show_title)config.title="";if(config_metric.show_legend)config.legend.show=true}if(config_metric&&config_metric.show_legend!==false)config.legend={show:true,position:"ne",container:legend_div};config.grid.horizontalLines=true;config.yaxis={showLabels:true,min:0};if(yformatter){config.yaxis={showLabels:true,min:0,tickFormatter:yformatter}}if(config_metric&&config_metric.xaxis)config.xaxis={showLabels:config_metric.xaxis,min:0};graph=Flotr.draw(container,data_viz,config)}function displayBubbles(divid,metric1,metric2,radius){var container=document.getElementById(divid);var DS=Report.getMetricDS(metric1)[0];var DS1=Report.getMetricDS(metric2)[0];var bdata=[];if(DS!=DS1){Report.log("Metrics for bubbles have different data sources");return}var full_data=[];var projects=[];$.each(Report.getDataSources(),function(index,ds){if(ds.getName()===DS.getName()){full_data.push(ds.getData()); -projects.push(ds.getProject())}});var dates=[[],[]];dates=[full_data[0].id,full_data[0].date];for(var i=0;imax){max=value;max=parseInt(max*(1+border),10)}}}(function(){var x=[data,ticks]})();graph=Flotr.draw(container,data,{radar:{show:true},mouse:{track:true,trackFormatter:function(o){var value="";for(var i=0;i"}return value}},grid:{circular:true,minorHorizontalLines:true},yaxis:{min:0,max:max,minorTickFreq:1},xaxis:{ticks:ticks}})}function displayRadar(div_id,metrics){var data=[],ticks=[];var radar_data=[];var projects=[];var i=0,j=0;for(i=0;i";for(var metric in basic_metrics){if(history[metric]===undefined)continue;value+=history[metric][index]+" "+metric+" , "}return value};return options};function getEnvisionOptions(div_id,projects_data,ds_name,hide,summary_graph){var basic_metrics=null,main_metric="",summary_data=[[],[]];if(ds_name){$.each(Report.getDataSources(),function(i,DS){if(DS.getName()===ds_name){basic_metrics=DS.getMetrics();return false}})}else basic_metrics=Report.getAllMetrics();$.each(Report.getDataSources(),function(i,DS){main_metric=DS.getMainMetric();if(ds_name===null&&DS.getName()==="scm"||ds_name&&DS.getName()==ds_name){summary_data=[DS.getData().id,DS.getData()[main_metric]];if(summary_graph===false)summary_data=[DS.getData().id,[]];return false}});var dates=[[],[]];$.each(projects_data,function(project,data){$.each(data,function(index,DS){if(ds_name&&ds_name!==DS.getName())return;dates=DataProcess.fillDates(dates,[DS.getData().id,DS.getData().date])})});var firstMonth=dates[0][0],container=document.getElementById(div_id),options;var markers=Report.getMarkers();options={container:container,xTickFormatter:function(index){var label=dates[1][index-firstMonth];if(label==="0")label="";return label},yTickFormatter:function(n){return n+""},selection:{data:{x:{min:dates[0][0],max:dates[0][dates[0].length-1]}}}};options.data={summary:DataProcess.fillHistory(dates[0],summary_data),markers:markers,dates:dates[1],envision_hide:hide,main_metric:main_metric};var project=null;var buildProjectInfo=function(index,ds){var data=ds.getData();if(data[metric]===undefined)return;if(options.data[metric]===undefined)options.data[metric]=[];var full_data=DataProcess.fillHistory(dates[0],[data.id,data[metric]]);if(metric===main_metric){options.data[metric].push({label:project,data:full_data});if(data[metric+"_relative"]===undefined)return;if(options.data[metric+"_relative"]===undefined)options.data[metric+"_relative"]=[];full_data=DataProcess.fillHistory(dates[0],[data.id,data[metric+"_relative"]]);options.data[metric+"_relative"].push({label:project,data:full_data})}else{options.data[metric].push({label:project,data:full_data})}};var buildProjectsInfo=function(name,pdata){project=name;$.each(pdata,buildProjectInfo)};for(var metric in basic_metrics){$.each(projects_data,buildProjectsInfo)}options.trackFormatter=function(o){var sdata=o.series.data,index=sdata[o.index][0]-firstMonth;var project_metrics={};var projects=Report.getProjectsList();for(var j=0;j";for(var metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;for(j=0;j"+dates[1][index]+"";value+="";if(projects.length>1)value+="";for(metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;value+=""+basic_metrics[metric].name+""}value+="";$.each(project_metrics,function(project,metrics){var row="";for(var metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;mvalue=project_metrics[project][metric];if(mvalue===undefined)mvalue="n/a";row+=""+mvalue+""}if(projects.length>1)row=""+project+""+row;row+="";value+=row});value+="";return value};return options}function checkBasicConfig(config){if(config===undefined)config={};if(config.show_desc===undefined)config.show_desc=true;if(config.show_title===undefined)config.show_title=true;if(config.show_labels===undefined)config.show_labels=true;return config}function getMetricFriendlyName(ds,metrics){var desc_metrics=ds.getMetrics();var title="";for(var i=0;i1){list_name=list_name_tokens[list_name_tokens.length-1];if(list_name==="")list_name=list_name_tokens[list_name_tokens.length-2]}else{list_name=listinfo.replace("<","");list_name=list_name.replace(">","");list_name_tokens=list_name.split(".");list_name=list_name_tokens[0]}return list_name};function getUserLists(){var form=document.getElementById("form_mls_selector");var lists=[];for(var i=0;i-1)continue;file_messages=this.getDataDir()+"/mls-";file_messages+=l;file_messages+="-evolutionary.json";displayBasicList(div_id,l,file_messages,config_metric)}};this.getTitle=function(){return"Mailing Lists"};function displayBasicList(div_id,l,mls_file,config_metric){var config=Viz.checkBasicConfig(config_metric);for(var id in basic_metrics){var metric=basic_metrics[id];var title="";if(config.show_title)title=metric.name;if($.inArray(metric.column,Report.getConfig().mls_hide)>-1)continue;var new_div="
    ";new_div+="

    "+metric.name+" "+MLS.displayMLSListName(l)+"

    ";new_div+="
    ";if(config.show_desc)new_div+="

    "+metric.desc+"

    ";new_div+="
    ";$("#"+div_id).append(new_div);Viz.displayBasicLinesFile(metric.divid+"_"+l,mls_file,metric.column,config.show_labels,title)}}function getReportId(){var project_data=Report.getProjectData();return project_data.date+"_"+project_data.project_name}function getMLSId(){return getReportId()+"_mls_lists"}this.displayEvoListsMain=function(id){if(localStorage){if(localStorage.length&&localStorage.getItem(getMLSId())){lists=JSON.parse(localStorage.getItem(getMLSId()));return this.displayEvoLists(id,lists)}}history=this.getListsData();lists=history.mailing_list;if(lists===undefined)return;var config=Report.getConfig();lists_hide=config.mls_hide_lists;if(typeof lists==="string"){lists=[lists]}var filtered_lists=[];for(var i=0;i-1)form.elements[i].checked=true;else form.elements[i].checked=false}}};this.displayBasicDefault=function(div_id){var obj=self;if(this instanceof MLS)obj=this;cleanLocalStorage();obj.displaySelectorCheckDefault();$("#"+div_id).empty();obj.displayBasic(div_id)};this.displayEvoDefault=function(div_id){var obj=self;if(this instanceof MLS)obj=this;cleanLocalStorage();if(document.getElementById("form_mls_selector"))obj.displaySelectorCheckDefault();$("#"+div_id).empty();obj.displayEvoLists(div_id,obj.getDefaultLists())};this.displayEvoUserAll=function(id,all){var form=document.getElementById("form_mls_selector");for(var i=0;i-1)html+="checked ";html+=">";html+=MLS.displayMLSListName(l);html+="
    "}html+='1){$("#"+div_id_sel).append("Not supported in multiproject");$("#"+div_id_sel+" :input").attr("disabled",true)}};function filterHistory(history){if(typeof history.id==="number"){$.each(history,function(key,value){value=[value]})}return history}this.displayEvoLists=function(id,lists){for(var i=0;i1){list_name=list_name_tokens[list_name_tokens.length-1];if(list_name==="")list_name=list_name_tokens[list_name_tokens.length-2]}else{list_name=listinfo.replace("<","");list_name=list_name.replace(">","");list_name_tokens=list_name.split(".");list_name=list_name_tokens[0]}return list_name};this.getTitle=function(){return"Source Code Review"}}SCR.prototype=new DataSource("scr");function People(){this.basic_metrics={people_members:{column:"members",name:"Members",desc:"Community Members"}};this.getMainMetric=function(){return"people_members"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .mediawiki_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().mediawiki_url}if(this.global_data.type)$(div_id+" #mediawiki_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #mediawiki_url").attr("href",url);$(div_id+" #mediawiki_name").text("MediaWiki "+this.global_data.type)}else{$(div_id+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url);$(div_id+" #mediawiki_name").text(Report.getProjectData().mediawiki_name);$(div_id+" #mediawiki_type").text(Report.getProjectData().mediawiki_type)}var data=this.getGlobalData();$(div_id+" #mediawikiFirst").text(data.first_date);$(div_id+" #mediawikiLast").text(data.last_date);$(div_id+" #mediawikiSent").text(data.mediawiki_reviews)};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"mediawiki_reviews","mediawiki_authors",radius)};this.getTitle=function(){return"Community Members"}}People.prototype=new DataSource("people");function Downloads(){var self=this;this.basic_metrics={downloads_downloads:{name:"Total downloads",column:"downloads"},downloads_packages:{divid:"",column:"packages",name:"Packages downloaded",desc:"",action:"downloads"},downloads_ips:{divid:"",column:"ips",name:"IP addresses",desc:"",action:"downloads"}};this.getMainMetric=function(){return"downloads_downloads"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"mediawiki_reviews","mediawiki_authors",radius)};this.getTitle=function(){return"Downloads"}}Downloads.prototype=new DataSource("downloads");function QAForums(){var self=this;this.basic_metrics={qaforums_sent:{name:"Messages posted",desc:"Number of messages posted to Q&A forums(s)",column:"sent"},qaforums_qsent:{name:"Questions posted",desc:"Number of questions posted to Q&A forums(s)",column:"qsent"},qaforums_asent:{name:"Answers posted",desc:"Number of answers posted to Q&A forums(s)",column:"asent"},qaforums_unanswered:{name:"Unanswered questions",desc:"Backlog of unanswered questions",column:"unanswered"},qaforums_senders:{name:"Persons posting messages",desc:"Number of persons posting messages to Q&A forums(s)",column:"senders"},qaforums_asenders:{name:"Persons posting answers",desc:"Number of persons answering in Q&A forums(s)",column:"asenders"},qaforums_qsenders:{divid:"qaforums_qsenders",name:"Persons posting questions",desc:"Number of persons asking questions in Q&A forums(s)",column:"qsenders"},qaforums_participants:{name:"Participants",desc:"Number of persons posting messages",column:"participants"}};this.getMainMetric=function(){return"qaforums_qsent"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"qaforums_quetions","qaforums_authors",radius)};this.getSummaryLabels=function(){var id_label={first_date:"Start",last_date:"End",sent:"Messages posted",qsent:"Questions posted",asent:"Answers posted",qunanswered:"Unanswered questions",senders:"Persons posting messages",asenders:"Persons posting answers",qsenders:"Persons posting questions"};return id_label};this.getTitle=function(){return"QAForums"}}QAForums.prototype=new DataSource("qaforums");function Releases(){var self=this;this.basic_metrics={releases_modules:{name:"Modules created",desc:"Number of modules created on the forge",column:"modules"},releases_authors:{name:"Module authors",desc:"Module authors",column:"authors"},releases_releases:{name:"Number of module releases",desc:"Number of module releases",column:"releases"}};this.getMainMetric=function(){return"releases_modules"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"releases_modules","releases_releases",radius)};this.getSummaryLabels=function(){var id_label={first_date:"Start",last_date:"End",modules:"Modules created",releases:"Module releases created",authors:"Persons creating/updating modules"};return id_label};this.getTitle=function(){return"Releases"}}Releases.prototype=new DataSource("releases");var Identity={};(function(){var unique_list="unique-sortable";function sortSelList(list_divid,list,name){var connect="";if(list_divid===unique_list)connect="";else connect=unique_list;$("#"+name).sortable({handle:".handle",connectWith:"#"+connect,start:function(e,info){info.item.siblings(".ui-selected").appendTo(info.item)},stop:function(e,info){if(info.item.parent()[0].id===unique_list)info.item.find(".handle").remove();info.item.parent().append(info.item.find("li"));info.item.parent().find("li").addClass("mjs-nestedSortable-leaf")}}).selectable().find("li").prepend("
    ")}Identity.showListNested=function(list_divid,ds){list="
      div",maxLevels:2,isTree:true,expandOnHover:700,startCollapsed:true});$(".disclose").on("click",function(){$(this).closest("li").toggleClass("mjs-nestedSortable-collapsed").toggleClass("mjs-nestedSortable-expanded")})};function showFilter(ds,filter_data){$("#"+ds.getName()+"filter").autocomplete({source:filter_data,select:function(event,ui){$("#"+ds.getName()+"filter").val("");$("#"+ds.getName()+"_people_"+ui.item.value).addClass("ui-selected");return false}})}Identity.showList=function(list_divid,ds){var list="";var people=ds.getPeopleData();var filter_data=[];list='
        ';for(var i=0;i");showFilter(ds,filter_data);$("#"+list_divid).append(list);sortSelList(list_divid,list,ds.getName()+"-sortable")}})();var Charts={};(function(){Charts.plotLinesChart=plotLinesChart;function plotLinesChart(div_id,line_names,raw_data){var flt_data=buildFlotrData(line_names,raw_data);var config=getChartConfig(flt_data,raw_data.strdate);if(raw_data.max){config.yaxis.max=raw_data.max}if(flt_data.length>1)config.legend.show=true;config.subtitle=composeTitle(line_names);flt_data=decorateLines(flt_data);plotFlotr2LinesChart(div_id,flt_data,config)}function buildFlotrData(line_names,raw_data){var aux=[];$.each(raw_data.lines_data,function(id,array){var line=[];$.each(array,function(subid,value){line[line.length]=[raw_data.unixtime[subid],value]});var aux2={};aux2.data=line;aux2.label=line_names[id];aux[aux.length]=aux2});return aux}function decorateLines(flotr2_data){if(Utils.isReleasePage()===false){if(flotr2_data.length===1){flotr2_data=lastLineValueToPoint(flotr2_data);flotr2_data=addEmptyValue(flotr2_data)}else if(flotr2_data.length>1){flotr2_data=dropLastLineValue(flotr2_data)}}return flotr2_data}function lastLineValueToPoint(flotr2_data){if(flotr2_data.length!==1)return flotr2_data;var last=flotr2_data[0].data.length;var dots=[];var utime=0;for(var i=0;i1){for(var j=0;j1){if(flotr2_data[i].label!==undefined){value_name=flotr2_data[i].label;label+=value_name+":"}}label+=""+Report.formatValue(value)+"
        "}return label}},selection:{mode:"x",fps:10},shadowSize:4};return config}function composeRangeText(former_title,starting_utime,end_utime){var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var date=new Date(parseInt(starting_utime,10)*1e3);var starting_date=months[date.getMonth()]+" "+date.getFullYear();date=new Date(parseInt(end_utime,10)*1e3);var end_date=months[date.getMonth()]+" "+date.getFullYear();return former_title+" ( "+starting_date+" - "+end_date+" )"}function getMax(flotr2_data,from_unixstamp,to_unixstamp){from_unixstamp=Math.round(from_unixstamp);to_unixstamp=Math.round(to_unixstamp);var narrays=flotr2_data.length;var aux_array=[];for(var i=0;i0;z--){var aux_value=flotr2_data[i][z][0];var cond=aux_valueto_unixstamp;if(cond){flotr2_data[i].splice(z,1)}}}var res=[];for(i=0;ib[1]||b[1]===undefined?1:-1});return bi_array}})();String.prototype.supplant=function(o){return this.replace(/{([^{}]*)}/g,function(a,b){var r=o[b];return typeof r==="string"||typeof r==="number"?r:a})};var Table={};(function(){Table.displayTopTable=displayTopTable;Table.simpleTable=displaySimpleTable;function displaySimpleTable(div,data,headers,cols){var tables,aux_html;tables='';aux_html="";$.each(headers,function(id,value){aux_html+=""});aux_html+="";aux_html+="";var first_col,aux_col;if(typeof data[cols[0]]!=="object"){aux_col=[];aux_col[0]=data[cols[0]];first_col=aux_col}else{first_col=data[cols[0]]}$.each(first_col,function(id,value){aux_html+="";var cont=id+1;aux_html+="";$.each(cols,function(subid,name){if(typeof data[name]!=="object"){aux_html+=""}else{aux_html+=""}});aux_html+=""});aux_html+="";tables+=aux_html;tables+="
        #"+value+"
        "+cont+""+data[name]+""+data[name][id]+"
        ";$("#"+div.id).append(tables)}function displayTopTable(div,data,opts){var first=true,gen_tabs=true,tabs="",tables="";if(opts.period!=="all"){gen_tabs=false}else{tabs+=composeTopTabs(data,opts.metric,opts.class_name)}periods=getSortedPeriods();tables+='
        ';var var_names=getTopVarsFromMetric(opts.metric,opts.ds_name);for(var k=0;k';tables+='';unit=opts.desc_metrics[opts.ds_name+"_"+opts.metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data[key],opts.limit,opts.links_enabled,var_names);tables+="";tables+="
        #"+opts.metric.capitalize()+""+unit.capitalize()+"
        ";tables+="
        "}}tables+="
    ";$("#"+div.id).append(tabs+tables)}function composeTopRowsPeople(people_data,limit,people_links,var_names){var rows_html="";for(var j=0;j"+(j+1)+"";rows_html+="";if(people_links){rows_html+='"}else{rows_html+=DataProcess.hideEmail(people_data[var_names.name][j])}rows_html+="";rows_html+=""+metric_value+""}return rows_html}function getSortedPeriods(){return["last month","last year",""]}function composeTopTabs(data,metric,class_name){var first=true,tabs_html='";return tabs_html}function getTopVarsFromMetric(metric,ds_name){var var_names={};var_names.id="id";if(metric==="senders"&&(ds_name==="mls"||ds_name==="irc")){var_names.name="senders";var_names.action="sent" -}if(metric==="authors"&&ds_name==="scm"){var_names.name="authors";var_names.action="commits"}if(metric==="closers"&&ds_name==="its"){var_names.name="closers";var_names.action="closed"}if(ds_name==="scr"){if(metric==="mergers"){var_names.name="mergers";var_names.action="merged"}if(metric==="openers"){var_names.name="openers";var_names.action="opened"}if(metric==="reviewers"){var_names.name="reviewers";var_names.action="reviews"}}if(ds_name==="downloads"){if(metric==="ips"){var_names.name="ips";var_names.action="downloads"}if(metric==="packages"){var_names.name="packages";var_names.action="downloads"}}if(ds_name==="mediawiki"){if(metric==="authors"){var_names.name="authors";var_names.action="reviews"}}if(ds_name==="qaforums"){if(metric==="senders"||metric==="asenders"||metric==="qsenders"){var_names.name="senders";var_names.action="sent"}else if(metric==="participants"){var_names.name="name";var_names.action="messages_sent"}}if(ds_name==="releases"){if(metric==="authors"){var_names.name="username";var_names.action="releases"}}return var_names}})();var Demographics={};(function(){var data_dg={};Demographics.widget=function(){var divs=$(".DemographicsCompany"),ds_name,company_name,DS,period;if(divs.length>0){$.each(divs,function(id,div){ds_name="";ds_name=$(this).data("data-source");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;period=$(this).data("period");company_name=Utils.getParameter("company");loadDemographicsData(div,ds_name,company_name,period,displayDemographics)})}};function loadDemographicsData(div,ds_name,company_name,period,cb){var suffix=ds_name.toLowerCase(),preffix,ag_file,b_file;preffix="data/json/"+company_name+"-"+suffix+"-com-demographics-";ag_file=preffix+"aging.json";b_file=preffix+"birth.json";$.when($.getJSON(ag_file),$.getJSON(b_file)).done(function(ag_data,b_data){data_dg[company_name]={};data_dg[company_name][ds_name]={aging:undefined,birth:undefined};data_dg[company_name][ds_name].aging=ag_data[0];data_dg[company_name][ds_name].birth=b_data[0];cb(div,ds_name,company_name,period)}).fail(function(){console.log("Demographics Company widget disabled. Missing "+ds_name+" files for company "+company_name)})}function displayDemographics(div,ds_name,company_name,period){if(!div.id)div.id="Parsed"+getRandomId();if(data_dg[company_name]!==undefined&&data_dg[company_name][ds_name]!==undefined){Viz.displayDemographicsChart(div.id,data_dg[company_name][ds_name],period)}}function getRandomId(){return Math.floor(Math.random()*1e3+1)}})();Loader.data_ready(function(){Demographics.widget()});vizjslib_git_revision="5f2ee1cf4c35060cd264f48e7f3532f20635b62d";vizjslib_git_tag="15.02-43-g5f2ee1c"; \ No newline at end of file +var wgd=$w.coords().grid;var can_go_up=self.can_go_widget_up(wgd);if(can_go_up&&can_go_up!==wgd.row){self.move_widget_to($w,can_go_up)}});return this};fn.move_widget_up=function($widget,y_units){var el_grid_data=$widget.coords().grid;var actual_row=el_grid_data.row;var moved=[];var can_go_up=true;y_units||(y_units=1);if(!this.can_go_up($widget)){return false}this.for_each_column_occupied(el_grid_data,function(col){if($.inArray($widget,moved)===-1){var widget_grid_data=$widget.coords().grid;var next_row=actual_row-y_units;next_row=this.can_go_up_to_row(widget_grid_data,col,next_row);if(!next_row){return true}var $next_widgets=this.widgets_below($widget);this.remove_from_gridmap(widget_grid_data);widget_grid_data.row=next_row;this.add_to_gridmap(widget_grid_data);$widget.attr("data-row",widget_grid_data.row);this.$changed=this.$changed.add($widget);moved.push($widget);$next_widgets.each($.proxy(function(i,widget){this.move_widget_up($(widget),y_units)},this))}})};fn.move_widget_down=function($widget,y_units){var el_grid_data=$widget.coords().grid;var actual_row=el_grid_data.row;var moved=[];var y_diff=y_units;if(!$widget){return false}if($.inArray($widget,moved)===-1){var widget_grid_data=$widget.coords().grid;var next_row=actual_row+y_units;var $next_widgets=this.widgets_below($widget);this.remove_from_gridmap(widget_grid_data);$next_widgets.each($.proxy(function(i,widget){var $w=$(widget);var wd=$w.coords().grid;var tmp_y=this.displacement_diff(wd,widget_grid_data,y_diff);if(tmp_y>0){this.move_widget_down($w,tmp_y)}},this));widget_grid_data.row=next_row;this.update_widget_position(widget_grid_data,$widget);$widget.attr("data-row",widget_grid_data.row);this.$changed=this.$changed.add($widget);moved.push($widget)}};fn.can_go_up_to_row=function(widget_grid_data,col,row){var ga=this.gridmap;var result=true;var urc=[];var actual_row=widget_grid_data.row;var r;this.for_each_column_occupied(widget_grid_data,function(tcol){var grid_col=ga[tcol];urc[tcol]=[];r=actual_row;while(r--){if(this.is_empty(tcol,r)&&!this.is_placeholder_in(tcol,r)){urc[tcol].push(r)}else{break}}if(!urc[tcol].length){result=false;return true}});if(!result){return false}r=row;for(r=1;r0?y_units:0};fn.widgets_below=function($el){var el_grid_data=$.isPlainObject($el)?$el:$el.coords().grid;var self=this;var ga=this.gridmap;var next_row=el_grid_data.row+el_grid_data.size_y-1;var $nexts=$([]);this.for_each_column_occupied(el_grid_data,function(col){self.for_each_widget_below(col,next_row,function(tcol,trow){if(!self.is_player(this)&&$.inArray(this,$nexts)===-1){$nexts=$nexts.add(this);return true}})});return this.sort_by_row_asc($nexts)};fn.set_cells_player_occupies=function(col,row){this.remove_from_gridmap(this.placeholder_grid_data);this.placeholder_grid_data.col=col;this.placeholder_grid_data.row=row;this.add_to_gridmap(this.placeholder_grid_data,this.$player);return this};fn.empty_cells_player_occupies=function(){this.remove_from_gridmap(this.placeholder_grid_data);return this};fn.can_go_up=function($el){var el_grid_data=$el.coords().grid;var initial_row=el_grid_data.row;var prev_row=initial_row-1;var ga=this.gridmap;var upper_rows_by_column=[];var result=true;if(initial_row===1){return false}this.for_each_column_occupied(el_grid_data,function(col){var $w=this.is_widget(col,prev_row);if(this.is_occupied(col,prev_row)||this.is_player(col,prev_row)||this.is_placeholder_in(col,prev_row)||this.is_player_in(col,prev_row)){result=false;return true}});return result};fn.can_move_to=function(widget_grid_data,col,row,max_row){var ga=this.gridmap;var $w=widget_grid_data.el;var future_wd={size_y:widget_grid_data.size_y,size_x:widget_grid_data.size_x,col:col,row:row};var result=true;var right_col=col+widget_grid_data.size_x-1;if(right_col>this.cols){return false}if(max_row&&max_row0&&this.is_widget(col,trow)&&$.inArray(ga[col][trow],matched)===-1){cr=callback.call(ga[col][trow],col,trow);matched.push(ga[col][trow]);if(cr){break}}}},"for_each/below":function(){for(trow=row+1,max=ga[col].length;trow=1;c--){for(r=gm[c].length-1;r>=1;r--){if(this.is_widget(c,r)){rows.push(r);row_in_col[r]=c;break}}}var highest_row=Math.max.apply(Math,rows);this.highest_occupied_cell={col:row_in_col[highest_row],row:highest_row};return this.highest_occupied_cell};fn.get_widgets_from=function(col,row){var ga=this.gridmap;var $widgets=$();if(col){$widgets=$widgets.add(this.$widgets.filter(function(){var tcol=$(this).attr("data-col");return tcol===col||tcol>col}))}if(row){$widgets=$widgets.add(this.$widgets.filter(function(){var trow=$(this).attr("data-row");return trow===row||trow>row}))}return $widgets};fn.set_dom_grid_height=function(){var r=this.get_highest_occupied_cell().row;this.$el.css("height",r*this.min_widget_height);return this};fn.generate_stylesheet=function(opts){var styles="";var max_size_x=this.options.max_size_x;var max_rows=0;var max_cols=0;var i;var rules;opts||(opts={});opts.cols||(opts.cols=this.cols);opts.rows||(opts.rows=this.rows);opts.namespace||(opts.namespace=this.options.namespace);opts.widget_base_dimensions||(opts.widget_base_dimensions=this.options.widget_base_dimensions);opts.widget_margins||(opts.widget_margins=this.options.widget_margins);opts.min_widget_width=opts.widget_margins[0]*2+opts.widget_base_dimensions[0];opts.min_widget_height=opts.widget_margins[1]*2+opts.widget_base_dimensions[1];var serialized_opts=$.param(opts);if($.inArray(serialized_opts,Gridster.generated_stylesheets)>=0){return false}Gridster.generated_stylesheets.push(serialized_opts);for(i=opts.cols;i>=0;i--){styles+=opts.namespace+' [data-col="'+(i+1)+'"] { left:'+(i*opts.widget_base_dimensions[0]+i*opts.widget_margins[0]+(i+1)*opts.widget_margins[0])+"px;} "}for(i=opts.rows;i>=0;i--){styles+=opts.namespace+' [data-row="'+(i+1)+'"] { top:'+(i*opts.widget_base_dimensions[1]+i*opts.widget_margins[1]+(i+1)*opts.widget_margins[1])+"px;} "}for(var y=1;y<=opts.rows;y++){styles+=opts.namespace+' [data-sizey="'+y+'"] { height:'+(y*opts.widget_base_dimensions[1]+(y-1)*(opts.widget_margins[1]*2))+"px;}"}for(var x=1;x<=max_size_x;x++){styles+=opts.namespace+' [data-sizex="'+x+'"] { width:'+(x*opts.widget_base_dimensions[0]+(x-1)*(opts.widget_margins[0]*2))+"px;}"}return this.add_style_tag(styles)};fn.add_style_tag=function(css){var d=document;var tag=d.createElement("style");d.getElementsByTagName("head")[0].appendChild(tag);tag.setAttribute("type","text/css");if(tag.styleSheet){tag.styleSheet.cssText=css}else{tag.appendChild(document.createTextNode(css))}return this};fn.generate_faux_grid=function(rows,cols){this.faux_grid=[];this.gridmap=[];var col;var row;for(col=cols;col>0;col--){this.gridmap[col]=[];for(row=rows;row>0;row--){this.add_faux_cell(row,col)}}return this};fn.add_faux_cell=function(row,col){var coords=$({left:this.baseX+(col-1)*this.min_widget_width,top:this.baseY+(row-1)*this.min_widget_height,width:this.min_widget_width,height:this.min_widget_height,col:col,row:row,original_col:col,original_row:row}).coords();if(!$.isArray(this.gridmap[col])){this.gridmap[col]=[]}this.gridmap[col][row]=false;this.faux_grid.push(coords);return this};fn.add_faux_rows=function(rows){var actual_rows=this.rows;var max_rows=actual_rows+(rows||1);for(var r=max_rows;r>actual_rows;r--){for(var c=this.cols;c>=1;c--){this.add_faux_cell(r,c)}}this.rows=max_rows;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this};fn.add_faux_cols=function(cols){var actual_cols=this.cols;var max_cols=actual_cols+(cols||1);for(var c=actual_cols;c=1;r--){this.add_faux_cell(r,c)}}this.cols=max_cols;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this};fn.recalculate_faux_grid=function(){var aw=this.$wrapper.width();this.baseX=($(window).width()-aw)/2;this.baseY=this.$wrapper.offset().top;$.each(this.faux_grid,$.proxy(function(i,coords){this.faux_grid[i]=coords.update({left:this.baseX+(coords.data.col-1)*this.min_widget_width,top:this.baseY+(coords.data.row-1)*this.min_widget_height})},this));return this};fn.get_widgets_from_DOM=function(){this.$widgets.each($.proxy(function(i,widget){this.register_widget($(widget))},this));return this};fn.generate_grid_and_stylesheet=function(){var aw=this.$wrapper.width();var ah=this.$wrapper.height();var cols=Math.floor(aw/this.min_widget_width)+this.options.extra_cols;var actual_cols=this.$widgets.map(function(){return $(this).attr("data-col")});actual_cols=Array.prototype.slice.call(actual_cols,0);actual_cols.length||(actual_cols=[0]);var min_cols=Math.max.apply(Math,actual_cols);var max_rows=this.options.extra_rows;this.$widgets.each(function(i,w){max_rows+=+$(w).attr("data-sizey")});this.cols=Math.max(min_cols,cols,this.options.min_cols);this.rows=Math.max(max_rows,this.options.min_rows);this.baseX=($(window).width()-aw)/2;this.baseY=this.$wrapper.offset().top;if(this.options.autogenerate_stylesheet){this.generate_stylesheet()}return this.generate_faux_grid(this.rows,this.cols)};$.fn.gridster=function(options){return this.each(function(){if(!$(this).data("gridster")){$(this).data("gridster",new Gridster(this,options))}})};$.Gridster=fn})(jQuery,window,document);vizjslib_git_revision="b9507b20f12b48b57539eafb44179d6d3242a2da";vizjslib_git_tag="15.02-53-gb9507b2";(function(){var V=envision,global_data={};function getDefaultsMarkers(option,markers,dates){var mark="";if(!markers||markers.length===0)return mark;for(var i=0;i-1){metrics=DS.getMetrics();getDefaultsMetrics(DS,viz,metrics,default_config)}})}config=default_config;viz.summary=getEnvisionDefaultsGraph("report-summary",config);viz.summary.config.xaxis={noTickets:10,showLabels:true};viz.summary.config.handles={show:true};viz.summary.config.selection={mode:"x"};viz.summary.config.mouse={};viz.connection={name:"report-connection",adapterConstructor:V.components.QuadraticDrawing};return viz}function getOrderedDataSources(ds_list,main_metric){var ordered=[];var main_DS=null;$.each(ds_list,function(i,DS){if(DS.getMetrics()[main_metric]){main_DS=DS;return false}});ordered.push(main_DS);$.each(ds_list,function(i,DS){if(DS===main_DS)return;ordered.push(DS)});return ordered}function Envision_Report(options,data_sources){var main_metric=options.data.main_metric;global_data=options.data;if(!data_sources)data_sources=Report.getDataSources();data_sources=getOrderedDataSources(data_sources,main_metric);var ds=[];for(var i=0;i-1)data_load_companies();if($.inArray("repositories",active_reports)>-1)data_load_repos();if($.inArray("countries",active_reports)>-1)data_load_countries();if($.inArray("domains",active_reports)>-1)data_load_domains();if($.inArray("projects",active_reports)>-1)data_load_projects();if($.inArray("people",active_reports)>-1){data_load_people();data_load_people_identities()}}else{data_load_companies();data_load_repos();data_load_countries();data_load_domains();data_load_projects();data_load_people();data_load_people_identities()}};Loader.get_file_data_div=function(file,cb,div){$.when($.getJSON(file)).done(function(history){cb(div,file,history)}).fail(function(){cb(file,null)})};function get_data_from_all(file,fn_data_set,self){all_data_found=false;if(all_data){file_no_path=file.replace(Report.getDataDir()+"/","");data=all_data[file_no_path];if(data){fn_data_set(data,self);end_data_load();all_data_found=true}else{if(window.console){Report.log("Can't find in "+Report.all_json_file+" "+file)}}}return all_data_found}function data_load_file(file,fn_data_set,self){if(get_data_from_all(file,fn_data_set,self))return;$.when($.getJSON(file)).done(function(history){fn_data_set(history,self);end_data_load()}).fail(function(){fn_data_set([],self);end_data_load()})}function data_load_companies(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setCompaniesData([]);else data_load_file(DS.getCompaniesDataFile(),DS.setCompaniesData,DS)})}function data_load_repos(){var ds_not_supported=["mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1){DS.setReposData([])}else{data_load_file(DS.getReposDataFile(),DS.setReposData,DS)}});data_load_file(Report.getReposMapFile(),Report.setReposMap)}function data_load_countries(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setCountriesData([]);else data_load_file(DS.getCountriesDataFile(),DS.setCountriesData,DS)})}function data_load_domains(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setDomainsData([]);else data_load_file(DS.getDomainsDataFile(),DS.setDomainsData,DS)})}function data_load_projects(){var ds_not_supported=["irc","mediawiki"];var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if($.inArray(DS.getName(),ds_not_supported)>-1)DS.setProjectsData([]);else data_load_file(DS.getProjectsDataFile(),DS.setProjectsData,DS)})}function data_load_time_to_fix(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="its")data_load_file(DS.getTimeToFixDataFile(),DS.setTimeToFixData,DS)})}function data_load_markov_table(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="its")data_load_file(DS.getMarkovTableDataFile(),DS.setMarkovTableData,DS)})}function data_load_time_to_attention(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){if(DS.getName()==="mls")data_load_file(DS.getTimeToAttentionDataFile(),DS.setTimeToAttentionData,DS)})}function data_load_demographics(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getDemographicsAgingFile(),DS.setDemographicsAgingData,DS);data_load_file(DS.getDemographicsBirthFile(),DS.setDemographicsBirthData,DS)})}function data_load_tops(metric){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){var file_all=DS.getTopDataFile();if(get_data_from_all(file_all,DS.setGlobalTopData,DS))return;$.when($.getJSON(file_all)).done(function(history){DS.setGlobalTopData(history);end_data_load()}).fail(function(){DS.setGlobalTopData([],DS);end_data_load()})})}Loader.check_filters_page=function(page){var check=true;var filters=["repos","companies","countries"];$.each(filters,function(index,filter){if(!Loader.check_filter_page(page,filter)){check=false;return false}});return check};Loader.check_filter_page=function(page,filter){var check=true;if(page===undefined)page=1;var start=Report.getPageSize()*(page-1);var end=start+Report.getPageSize();$.each(Report.getDataSources(),function(index,DS){var total=0;if(filter==="repos")total=DS.getReposData().length;if(filter==="companies")total=DS.getCompaniesData().length;if(filter==="countries")total=DS.getCountriesData().length;if(filter==="domains")total=DS.getDomainsData().length;if(filter==="projects")total=DS.getProjectsData().length;if(end>total)end=total;for(var i=start;i-1){ds=DS;return false}}if(filter=="companies"){if($.inArray(item,DS.getCompaniesData())>-1){ds=DS;return false}}if(filter=="countries"){if($.inArray(item,DS.getCountriesData())>-1){ds=DS;return false}}if(filter=="domains"){if($.inArray(item,DS.getDomainsData())>-1){ds=DS;return false}}if(filter=="projects"){if($.inArray(item,DS.getProjectsData())>-1){ds=DS;return false}}});return ds}Loader.filterTopCheck=function(item,filter){var check=true;if(filter==="repos"){if(Loader.check_item(item,filter,"top")===false){ds=getItemDS(item,filter);if(ds===null){Report.log("Can't find data source for "+item);return true}if($.inArray(ds.getName(),ds_supporting_top_repos)>=0){Loader.data_load_item_top(item,ds,null,Convert.convertFilterTop,filter,"top")}return false}}return check};Loader.FilterItemCheck=function(item,filter){var check=true,ds;var map=Report.getReposMap();if(filter==="repos"){if(Loader.check_item(item,filter)===false){ds=getItemDS(item,filter);if(ds===null){Report.log("Can't find data source for "+item);return true}Loader.data_load_item(item,ds,null,Convert.convertFilterStudyItem,filter,null);if($.inArray(ds.getName(),ds_supporting_top_repos)>=0){Loader.data_load_item_top(item,ds,null,Convert.convertFilterStudyItem,filter)}return false}if(map!==undefined&&map.length!==0){var items_map=[];$.each(Report.getDataSources(),function(index,DS){var itmap=Convert.getRealItem(DS,filter,item);if(itmap!==undefined&&itmap!==null)items_map.push(itmap)});if(Loader.check_items(items_map,filter)===false){for(var i=0;i=0&&$.inArray(item,DS.getReposData())>=0&&DS.getRepositoriesTopData()[item]!==undefined){check=true;return false}}else{if(DS.getReposGlobalData()[item]!==undefined&&DS.getReposMetricsData()[item]!==undefined){check=true;return false}}}else if(filter==="companies"){var companies=DS.getCompaniesData();if(companies.length===0)check=true;else if($.inArray(item,companies)===-1)check=true;else if(DS.getCompaniesGlobalData()[item]===undefined||DS.getCompaniesMetricsData()[item]===undefined){check=false;return false}else if($.inArray(DS.getName(),ds_not_supported_company_top)===-1&&DS.getCompaniesTopData()[item]===undefined){check=false;return false}else check=true}else if(filter==="countries"){var countries=DS.getCountriesData();if(countries.length===0)check=true;else if($.inArray(item,countries)===-1)check=true;else if(DS.getCountriesGlobalData()[item]===undefined||DS.getCountriesMetricsData()[item]===undefined){check=false;return false}else check=true}else if(filter==="domains"){var domains=DS.getDomainsData();if(domains.length===0)check=true;else if($.inArray(item,domains)===-1)check=true;else if(DS.getDomainsGlobalData()[item]===undefined||DS.getDomainsMetricsData()[item]===undefined){check=false;return false}else check=true}else if(filter==="projects"){var projects=DS.getProjectsData();if(projects.length===0)check=true;else if($.inArray(item,projects)===-1)check=true;else if(DS.getProjectsGlobalData()[item]===undefined||DS.getProjectsMetricsData()[item]===undefined){check=false;return false}else check=true}});return check};Loader.check_items=function(items,filter){var check=true;$.each(items,function(id,item){if(Loader.check_item(item,filter)===false){check=false;return false}});return check};Loader.data_load_items_page=function(DS,page,cb,filter){if(page===undefined)page=1;if(filter==="repos")if(DS.getReposData()===null)return false;if(filter==="companies")if(DS.getCompaniesData()===null)return false;if(filter==="countries")if(DS.getCountriesData()===null)return false;if(filter==="domains")if(DS.getDomainsData()===null)return false;if(filter==="projects")if(DS.getProjectsData()===null)return false;var total=0;if(filter==="repos")total=DS.getReposData().length;if(filter==="companies")total=DS.getCompaniesData().length;if(filter==="countries")total=DS.getCountriesData().length;if(filter==="domains")total=DS.getDomainsData().length;if(filter==="projects")total=DS.getProjectsData().length;if(total===0)return true;var start=Report.getPageSize()*(page-1);var end=start+Report.getPageSize();if(end>total)end=total;for(var i=start;i-1){DS.addRepoMetricsData(item,[],DS);DS.addRepoGlobalData(item,[],DS);return}}else if(filter==="companies"){if($.inArray(DS.getName(),ds_not_supported_companies)>-1){DS.addCompanyMetricsData(item,[],DS);DS.addCompanyGlobalData(item,[],DS);return}}else if(filter==="countries"){if($.inArray(DS.getName(),ds_not_supported_countries)>-1){DS.addCountryMetricsData(item,[],DS);DS.addCountryGlobalData(item,[],DS);return}}else if(filter==="domains"){if($.inArray(DS.getName(),ds_not_supported_domains)>-1){DS.addDomainMetricsData(item,[],DS);DS.addDomainGlobalData(item,[],DS);return}}else if(filter==="projects"){if($.inArray(DS.getName(),ds_not_supported_projects)>-1){DS.addDomainMetricsData(item,[],DS);DS.addDomainGlobalData(item,[],DS);return}}else return;var item_uri=encodeURIComponent(item);var file=DS.getDataDir()+"/"+item_uri+"-";file+=DS.getName()+"-"+getFilterSuffix(filter);var file_evo=file+"-evolutionary.json";var file_static=file+"-static.json";function addData(item,evo,global,DS){if(filter==="repos"){DS.addRepoMetricsData(item,evo,DS);DS.addRepoGlobalData(item,global,DS)}else if(filter==="companies"){DS.addCompanyMetricsData(item,evo,DS);DS.addCompanyGlobalData(item,global,DS)}else if(filter==="countries"){DS.addCountryMetricsData(item,evo,DS);DS.addCountryGlobalData(item,global,DS)}else if(filter==="domains"){DS.addDomainMetricsData(item,evo,DS);DS.addDomainGlobalData(item,global,DS)}else if(filter==="projects"){DS.addProjectMetricsData(item,evo,DS);DS.addProjectGlobalData(item,global,DS)}}function check_data(){if(page!==null){if(Loader.check_filter_page(page,filter)){if(cb.called_page===undefined){cb.called_page={};cb.called_page[filter]=true;cb(filter)}else if(!cb.called_page[filter]){cb(filter);cb.called_page[filter]=true}}}else if(items_map!==null){if(Loader.check_items(items_map,filter)){if(cb.called_map===undefined){cb.called_map={};cb.called_map[filter]=true;cb(filter)}else if(!cb.called_map[filter]){cb(filter);cb.called_map[filter]=true}}}else{if(Loader.check_item(item,filter)){if(cb.called_item===undefined){cb.called_item={};cb.called_item[filter]=true;cb(filter,item)}else if(!cb.called_item[filter]){cb(filter,item);cb.called_item[filter]=true}}}}if(all_data){file_evo_no_path=decodeURIComponent(file_evo.replace(Report.getDataDir()+"/",""));file_static_no_path=decodeURIComponent(file_static.replace(Report.getDataDir()+"/",""));data_evo=all_data[file_evo_no_path];data_static=all_data[file_static_no_path];if(data_evo&&data_static){addData(item,data_evo,data_static,DS);check_data();return}}$.when($.getJSON(file_evo),$.getJSON(file_static)).done(function(evo,global){addData(item,evo[0],global[0],DS)}).always(function(){check_data()})};function data_load_metrics(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getDataFile(),DS.setData,DS);data_load_file(DS.getGlobalDataFile(),DS.setGlobalData,DS);if(DS instanceof MLS){data_load_file(DS.getListsFile(),DS.setListsData,DS)}})}function data_load_metrics_definition(){data_load_file("VizGrimoireJS/data/metrics.json",Report.setMetricsDefinition)}function data_load_people(){var data_sources=Report.getDataSources();$.each(data_sources,function(i,DS){data_load_file(DS.getPeopleDataFile(),DS.setPeopleData,DS)})}function data_load_people_identities(){data_load_file(Report.getDataDir()+"/people.json",Report.setPeopleIdentities)}function check_companies_loaded(DS){if(DS.getCompaniesData()===null)return false;return true}function check_repos_loaded(DS){if(DS.getReposData()===null)return false;return true}function check_countries_loaded(DS){if(DS.getCountriesData()===null)return false;return true}function check_domains_loaded(DS){if(DS.getDomainsData()===null)return false;return true}function check_projects_loaded(DS){if(DS.getProjectsData()===null)return false;return true}function check_meta_projects_loaded(){var projects_loaded=0;var projects_data=Report.getProjectsData();var projects_dirs=Report.getProjectsDirs();for(var key in projects_data){projects_loaded++}if(projects_loaded-1)if(!check_companies_loaded(DS)){check=false;return false}if($.inArray("repositories",active_reports)>-1)if(!check_repos_loaded(DS)){check=false;return false}if($.inArray("countries",active_reports)>-1)if(!check_countries_loaded(DS)){check=false;return false}if($.inArray("domains",active_reports)>-1)if(!check_domains_loaded(DS)){check=false;return false}if($.inArray("projects",active_reports)>-1)if(!check_projects_loaded(DS)){check=false;return false}if(DS instanceof MLS){if(DS.getListsData()===null){check=false;return false}}});return check};function end_data_load(){if(check_data_loaded_global()){for(var i=0;i-1){clean=email.split("@")[0]}return clean};DataProcess.selectPersonName=function(person){var name="",cname,ctype,i;if(person.identity){for(i=0;iname.length)name=cname}}}else if(person.name){if(person.name.constructor!==Array){person.name=[person.name]}for(i=0;iname.length)name=cname}}return name};DataProcess.selectPersonEmail=function(person){var email="",cemail,ctype;if(person.identity===undefined)return;for(var i=0;i=0;i--){if(history[metric][i]===0)new_offset++;else{if(offset_end===-1)offset_end=new_offset;if(new_offset=total-offset_end)continue;new_history[key].push(history[key][i])}}return new_history};DataProcess.filterDates=function(start_id,end_id,history){var history_dates={};$.each(history,function(name,data){history_dates[name]=[];$.each(data,function(i,value){var id=history.unixtime[i];if(id>start_id)if(!end_id||end_id&&id<=end_id)history_dates[name].push(value)})});return history_dates};DataProcess.filterYear=function(year,history){year=parseInt(year,null);var min_id=new Date(year.toString()).getTime();var max_id=new Date((year+1).toString()).getTime();var history_year=filterDates(min_id,max_id,history);return history_year};DataProcess.fillDates=function(dates_orig,more_dates){if(dates_orig[0].length===0)return more_dates;var new_dates=[[],[]];var i=0;if(dates_orig[0][0]>more_dates[0][0]){for(i=0;i-1){var metric_agg=[];metric_agg[0]=data[metric][0];for(var i=1;i1){params=document.URL.split("?")[1]}return params}function filenameInURL(){aux=document.URL.split("?")[0].split("/");res=aux[aux.length-1];return res}function createLink(target){url=target;if(paramsInURL().length>0)url+="?"+paramsInURL();return url}function createReleaseLink(target){url=target;if(isReleasePage()){if(url.indexOf("?")>=0){url+="&release="+$.urlParam("release")}else{url+="?release="+$.urlParam("release")}}return url}function getParameter(param){if($.urlParam(param)===null)return false;return $.urlParam(param)}})();String.prototype.supplant=function(o){return this.replace(/{([^{}]*)}/g,function(a,b){var r=o[b];return typeof r==="string"||typeof r==="number"?r:a})};var HTMLComposer={};(function(){HTMLComposer.personDSBlock=personDSBlock;HTMLComposer.filterDSBlock=filterDSBlock;HTMLComposer.DSBlock=DSBlock;HTMLComposer.DSBlockProject=DSBlockProject;HTMLComposer.repositorySummaryTable=repositorySummaryTable;HTMLComposer.personSummaryTable=personSummaryTable;HTMLComposer.personName=personName;HTMLComposer.itemName=itemName;HTMLComposer.releaseSelector=releaseSelector;HTMLComposer.sideBarLinks=sideBarLinks;HTMLComposer.overallSummaryBlock=overallSummaryBlock;HTMLComposer.smartLinks=smartLinks;HTMLComposer.TopByPeriod=TopByPeriod;HTMLComposer.companyFilters=companyFilters;function personDSBlock(ds_name,metric_name,ds_realname){var html='
    ';html+='
    ';html+='
    ';html+='
    ';if(ds_realname===undefined){html+="

    "+title4DS(ds_name)+"

    "}else{html+="

    "+title4DS(ds_realname)+"

    "}html+="
    ";html+='
    ';html+='
    ';html+="
    ";html+='
    ';html+='
    ';html+="
    ";html+='
    ';html+='
    ';$.each(metric_names,function(id,metric){html+='


    ';html+='
    ';html+='
    ';html+='
    ';html+="
    "});html+="
    ";return html}function repositorySummaryTable(ds,global_data,id_label){var html="";html+='";var html_irow="";$.each(global_data,function(id,value){if(ds.getMetrics()[id]){html+=html_irow+ds.getMetrics()[id].name;if(id==="first_date"||id==="last_date"){html+='

    '+title4DS(ds.getName())+"

    ";var html_erow="
    '+value+html_erow}else{html+=''+Report.formatValue(value)+html_erow}}else if(id_label[id]){html+=html_irow+id_label[id];if(id==="first_date"||id==="last_date"){html+=''+value+html_erow}else{html+=''+Report.formatValue(value)+html_erow}}});html+="
    ";return html}function personSummaryTable(ds_name,history){var html="";html+="";html+="
    ";html+="First contribution:
    ";html+="  "+history.first_date;html+="
    ";html+="Last contribution:
    ";html+="  "+history.last_date;html+="
    ";if(ds_name=="scm")html+="Commits:
      "+history.scm_commits;else if(ds_name=="its")html+="Closed:
      "+history.its_closed;else if(ds_name=="mls")html+="Sent:
      "+history.mls_sent;else if(ds_name=="irc")html+="Sent:
      "+history.irc_sent;else if(ds_name=="scr"){if(history.scr_closed!==undefined){html+="Closed:
      "+history.scr_closed}if(history.scr_submissions!==undefined){html+="Submissions:
      "+history.scr_submissions}}html+="
    ";return html}function personName(name,email){var html='

      ';if(name.length>0)html+=name;else if(email.length>0){if(email.indexOf("@")>0)email=email.split("@")[0];html+=email}html+="

    ";return html}function itemName(text,filter_name){var html='

    ';if(filter_name==="companies")html+='   ';html+=text;html+="

    ";return html}function title4DS(ds_name){var title="";if(ds_name==="scm")title=' Source Code Management';else if(ds_name==="scr")title=' Source Code Review';else if(ds_name==="its")title=' Issue tracking system';else if(ds_name==="storyboard")title=' StoryBoard';else if(ds_name==="mls")title=' Mailing Lists';else if(ds_name==="irc")title=' IRC Channels';else if(ds_name==="mediawiki")title=' Wiki';else if(ds_name==="releases")title=' Forge Releases';return title}function releaseSelector(current_release,release_names){function get_label(url,labels){label="";$.each(labels,function(pos,data){if(data[1]===url){label=data[0];return false}});return label}if(release_names.length===0)return"";var release_names_labels=null;if(release_names[0]instanceof Array){var old_relase_names=[];$.each(release_names,function(pos,data){old_relase_names.push(data[1])});release_names_labels=release_names;release_names=old_relase_names}unsupported=["irc.html","qaforums.html","project.html"];ah_label=" All history ";label=current_release;if(label===null)label=ah_label;else{label=decodeURIComponent(label);if(release_names_labels!==null){label=get_label(label,release_names_labels);label="  "+label+"  "}else{label="  "+label[0].toUpperCase()+label.substring(1)+" release  "}release_names.reverse().push(ah_label);release_names.reverse()}html='
    ';html+='";html+='";html+="
    ";return html}function DSBlock(ds_name,box_labels,box_metrics,ts_metrics){html="";html+="";html+='
    ';blabels=box_labels.split(",");bmetrics=box_metrics.split(",");html+=DSSummaryBox(ds_name,blabels,bmetrics,false,ds_realname);html+='
    ';tsm=ts_metrics.split(",");html+=DSTimeSerie(ds_name,tsm[0],false,ds_realname);html+="
    ";html+='
    ';html+=DSTimeSerie(ds_name,tsm[1],false,ds_realname);html+="
    ";html+="
    ";html+="";return html}function DSBlockProject(ds_name,box_labels,box_metrics,ts_metrics,pname){html="";html+="";html+='
    ';blabels=box_labels.split(",");bmetrics=box_metrics.split(",");html+=DSSummaryBox(ds_name,blabels,bmetrics,true);html+='
    ';tsm=ts_metrics.split(",");html+=DSTimeSerie(ds_name,tsm[0],true);html+="
    ";html+='
    ';html+=DSTimeSerie(ds_name,tsm[1],true);html+="
    ";html+="
    ";html+="";return html}function linkToPanel(ds_name,ds_realname){if(ds_realname===undefined){target_page=Utils.createLink(ds_name+".html")}else{target_page=Utils.createLink(ds_realname+".html")}return target_page}function summaryCell(width,label,ds_name,metric,project_flag,ds_realname){var target_page=linkToPanel(ds_name,ds_realname);if(project_flag){widget_name="ProjectData"}else{widget_name="GlobalData"}html="";html+='
    ';html+='
    ';html+='
    '+label+"
    ";html+="
    ";html+='
    ';html+='
    ';if(project_flag){html+=''}else{html+=' ';html+=""}html+="
    ";html+="
    ";html+="
    ";return html}function DSSummaryBox(ds_name,labels,metrics,project_flag,ds_realname){var target_page=linkToPanel(ds_name,ds_realname);if(project_flag){widget_name="ProjectData"}else{widget_name="GlobalData"}html="";html+="";html+='
    ';html+='
    ';html+='
    ';html+='
    '+labels[0]+"
    ";html+="
    ";html+='
    ';html+='
    ';if(ds_name==="releases")target_page=Utils.createLink("forge.html");if(project_flag){html+=''}else{html+=' ';html+=""}html+="
    ";html+="
    ";html+='
    ';if(labels.length===2&&metrics.length===2){html+=summaryCell("12",labels[1],ds_name,metrics[1],project_flag,ds_realname)}else if(labels.length===3&&metrics.length===3){html+=summaryCell("6",labels[1],ds_name,metrics[1],project_flag,ds_realname);html+=summaryCell("6",labels[2],ds_name,metrics[2],project_flag,ds_realname)}else if(labels.length===4&&metrics.length===4){html+=summaryCell("4",labels[1],ds_name,metrics[1],project_flag,ds_realname);html+=summaryCell("4",labels[2],ds_name,metrics[2],project_flag,ds_realname);html+=summaryCell("4",labels[3],ds_name,metrics[3],project_flag,ds_realname)}html+="
    ";html+="
    ";html+="
    ";html+="";return html}function DSTimeSerie(ds_name,metric,project_flag,ds_realname){if(project_flag){ts_widget_name="FilterItemMetricsEvol";trend_widget_name="FilterItemMicrodashText";filter_name="projects"}else{ts_widget_name="MetricsEvol";trend_widget_name="MicrodashText";filter_name=""}html="";html+='
    ';html+='
    '}else{if(ds_realname===undefined){html+=''}else{html+=''}html+=' ';html+=""}html+="
    ";return html}function sideBarLinks(icon_text,title,ds_name,elements){text={companies:"Companies","companies-summary":"Companies summary",contributors:"Contributors",countries:"Countries",domains:"Domains",projects:"Projects",repos:"Repositories",tags:"Tags",states:"States"};html="";html+='";return html}function overallSummaryBlock(){html="";html+="";html+='
    ';html+='
    ';html+='
    ';html+='
    =0)link_exists=true; +if(Utils.isReleasePage()&&link_exists){link_to=Utils.createReleaseLink(target_page);html=''+label+""}else if(link_exists){html=''+label+""}else{html=label}}catch(err){html=label}return html}function TopByPeriod(ds_name,metric,npeople,is_release){if(is_release){periods=[""]}else{periods=["last month","last year",""]}width=12/periods.length;html='
    ';$.each(periods,function(id,value){html+='
    ';html+='
    ';html+="
    "});html+="
    ";return html}var defaultFilterValues={scm:{metric_names:"commits+authors",order_by:"commits_365"},its:{metric_names:"closed+closers",order_by:"closed_365"}};function getFilterName(ds_name,metric_one,metric_two){filters={scm:{company:{country:"SCM by country"}},its:{company:{country:"ITS by country"}}};return filters[ds_name][metric_one][metric_two]}function companyFilters(company_name){var html="",filter_ds={};var mele=Report.getMenuElements();var menu_filters=mele.filter;if(menu_filters===undefined){return html}$.each(menu_filters,function(id,value){var ds_name=value.split(":")[0],combo=value.split(":")[1],mylen;if(Object.keys(filter_ds).indexOf(combo)<0){filter_ds[combo]=[]}mylen=filter_ds[combo].length;filter_ds[combo][mylen]=ds_name});$.each(Object.keys(filter_ds),function(id,value){switch(value){case"company+country":$.each(filter_ds[value],function(subid,ds_name){if(subid===0){html='
    '+'"+'
    "}})}});return html}})();var Convert={};(function(){Convert.convertMicrodashText=function(){var divs=$(".MicrodashText");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var metric=$(this).data("metric");var show_name=$(this).data("name");var ds=Report.getMetricDS(metric)[0];if(ds===undefined)return;var total=ds.getGlobalData()[metric];var html='
    ';if(show_name){html+='
    ';html+=''+ds.basic_metrics[metric].name+"";html+="
    "}$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var value=ds.getGlobalData()[metric+"_"+period];var netvalue=ds.getGlobalData()["diff_net"+column+"_"+period];var percentagevalue=ds.getGlobalData()["percentage_"+column+"_"+period];percentagevalue=Math.round(percentagevalue*10)/10;if(value===undefined)return;var str_percentagevalue="";if(percentagevalue===0){str_percentagevalue=Math.abs(percentagevalue)}else if(netvalue>0){str_percentagevalue="+"+percentagevalue}else if(netvalue<0){str_percentagevalue="-"+Math.abs(percentagevalue)}if(show_name){html+='
    '}else{html+='
    '}html+='Last '+period+" days:";html+=" "+Report.formatValue(value)+"
    ";if(percentagevalue===0){html+='  '+str_percentagevalue+"% "}else if(netvalue>0){html+='  '+str_percentagevalue+"% "}else if(netvalue<0){html+='  '+str_percentagevalue+"% "}html+="
    "});html+="
    ";$(div).append(html)})}};Convert.convertMicrodash=function(){var divs=$(".Microdash");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var metric=$(this).data("metric");var text=$(this).data("text");var ds=Report.getMetricDS(metric)[0];var total=ds.getGlobalData()[metric];var html="
    ";html+='
    ';html+=''+Report.formatValue(total);html+=" "+ds.getMetrics()[metric].name;html+="
    ";html+='
    ';html+='
    ';$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var netvalue=ds.getGlobalData()["diff_net"+column+"_"+period];var percentagevalue=ds.getGlobalData()["percentage_"+column+"_"+period];var value=ds.getGlobalData()[metric+"_"+period];if(value===undefined)return;html+=""+period+" Days Change:"+Report.formatValue(value)+" ";if(netvalue===0){html+=""}else if(netvalue>0){html+='';html+="(+"+percentagevalue+"%) "}else if(netvalue<0){html+='';html+="(-"+Math.abs(percentagevalue)+"%) "}});html+="
    ";html+="
    ";$(div).append(html)})}};function getProjectTitle(project_id,hierarchy){if(hierarchy.hasOwnProperty(project_id)&&hierarchy[project_id].title){return hierarchy[project_id].title}else{return undefined}}function compareProjectTitles(a,b){if(a.project_idb.project_id){return 1}else{return 0}}function getParentProjects(project_id,hierarchy){var parent=[];var iterate_p=project_id;var parent_id="";var aux={};while(hierarchy[iterate_p].hasOwnProperty("parent_project")){parent_id=hierarchy[iterate_p].parent_project;aux=hierarchy[parent_id];aux.project_id=parent_id;parent.push(aux);iterate_p=parent_id}return parent.reverse()}function getChildrenProjects(project_id,hierarchy){var children=[];var aux={};$.each(hierarchy,function(id,p){if(hierarchy[id].parent_project===project_id){aux=hierarchy[id];aux.project_id=id;children.push(aux)}});children.sort(compareProjectTitles);return children}function composePBreadcrumbsHTMLlast(project_id,children,hierarchy){var html="";var clen=children.length;if(clen>0){children_sort=[];children_names=[];$.each(children,function(id,value){children_names.push(value.title)});children_names=children_names.sort();$.each(children_names,function(id,name){$.each(children,function(id,value){if(name===value.title){children_sort.push(value);return false}})});children=children_sort;html+='"}else{html+="
  • "+getProjectTitle(project_id,hierarchy)+"
  • "}return html}function composeProjectBreadcrumbs(project_id){var html='";return html}function escapeString(string){var aux="";aux=string.replace(" ","_");aux=aux.toLowerCase();return aux}function composeHTMLNestedProjects(project_id,children,hierarchy){var html="";var clen=children.length;var epid=project_id;var divid=epid.replace(".","");if(clen>0){html+="
  • ";html+=''+getProjectTitle(project_id,hierarchy)+"";html+=' ';html+=''+clen+" subprojects";html+='
      ';$.each(children,function(id,value){gchildren=getChildrenProjects(value.project_id,hierarchy);html+=composeHTMLNestedProjects(value.project_id,gchildren,hierarchy)});html+="
  • "}else{html+='
  • '+getProjectTitle(project_id,hierarchy)+"
  • "}return html}function composeProjectMap(){var html="
      ";var hierarchy=Report.getProjectsHierarchy();if(hierarchy.length===0){return""}project_id="root";var children=getChildrenProjects(project_id,hierarchy);var parents=getParentProjects(project_id,hierarchy);$.each(children,function(id,value){grandchildren=getChildrenProjects(value.project_id,hierarchy);html+=composeHTMLNestedProjects(value.project_id,grandchildren,hierarchy)});html+="
    ";return html}function getSectionName4Release(){var result=[];var sections={data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain","scm-companies":"Activity on code repositories by companies","mls-companies":"Activity on mailing lists by companies","its-companies":"Activity on issue trackers by companies"};url_no_params=document.URL.split("?")[0];url_tokens=url_no_params.split("/");var section=url_tokens[url_tokens.length-1].split(".")[0];if(section==="project"||section==="index"||section==="release"||section===""){return[]}else{if(sections.hasOwnProperty(section)){result.push([section,sections[section]])}else{return[["#","Unavailable section name"]]}return result}}function getSectionName(){var result=[];var sections={mls:"MLS overview",irc:"IRC overview",its:"ITS overview",storyboard:"Storyboard overview",qaforums:"QA Forums overview",scr:"Code Review overview",scm:"SCM overview",wiki:"Wiki overview",downloads:"Downloads",forge:"Forge releases",demographics:"Demographics",data_sources:"Data sources",project_map:"Project map",people:"Contributor",company:"Company",country:"Country",domain:"Domain",release:"Companies analysis by release",project_comparison:"Project comparison"};var filters={companies:"Activity by companies",contributors:"Activity by contributors",countries:"Activity by countries",domains:"Activity by domains",projects:"Activity by project",repos:"Activity by repositories",states:"Activity by states",tags:"Activity by tags"};var filters2={repository:"Repository",countries:"Activity by countries"};url_no_params=document.URL.split("?")[0];url_tokens=url_no_params.split("/");var section=url_tokens[url_tokens.length-1].split(".")[0];if(section==="project"||section==="index"||section===""){return[]}else if(section==="filter"){var filter_by=$.urlParam("filter_by_item");var filter_names=$.urlParam("filter_names");switch(filter_names){case"company+country":result=[["company","Company"],["Activity by country and company","Activity by country and company"]]}return result}else{var s_tokens=section.split("-");if(s_tokens[0]==="repository"){ds_name=$.urlParam("ds");s_tokens=[ds_name,"repos","repository"]}if(sections.hasOwnProperty(s_tokens[0])){result.push([s_tokens[0],sections[s_tokens[0]]]);if(s_tokens.length>0){if(filters.hasOwnProperty(s_tokens[1])){result.push([s_tokens[0]+"-"+s_tokens[1],filters[s_tokens[1]]]);if(s_tokens.length>2){if(filters2.hasOwnProperty(s_tokens[2])){result.push([s_tokens[0],filters2[s_tokens[2]]])}}}}}else{return[["#","Unavailable section name"]]}return result}}function isURLRelease(){if($.urlParam("release")!==null&&$.urlParam("release").length>0)return true;else return false}function composeSideBar(project_id){if(project_id===undefined){project_id="root"}var html="";var html_extra="";html+='";return html}Convert.convertSideBar=function(project_id){var divs=$(".SideNavBar");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="SideNavBar";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeSideBar(label);$("#"+div.id).append(htmlaux);data=Report.getProjectData();$(".report_name").text(data.project_name);if(Utils.isReleasePage())$(".report_name").attr("href","./?release="+$.urlParam("release"))})}};Convert.convertProjectNavBar=function(project_id){var divs=$(".ProjectNavBar");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ProjectNavBar";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeProjectBreadcrumbs(label);$("#"+div.id).append(htmlaux)})}};Convert.convertNavbar=function(){$.get(Report.getHtmlDir()+"navbar.html",function(navigation){$("#Navbar").html(navigation);var project_id=Report.getParameterByName("project");Convert.convertProjectNavBar(project_id);Convert.convertReleaseSelector();Convert.convertSideBar(project_id)})};Convert.convertReleaseSelector=function(){var releases=Report.getReleaseNames();if(releases===undefined){return}if(releases.length>0){var divs=$(".ReleaseSelector");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ReleaseSelector"+getRandomId();var htmlaux=HTMLComposer.releaseSelector($.urlParam("release"),releases);$("#"+div.id).append(htmlaux)})}}};function composeSectionBreadCrumb(project_id){var html='";return html}Convert.convertSectionBreadcrumb=function(project_id){var divs=$(".SectionBreadcrumb");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="SectionBreadcrumb";var label;if(project_id){label=Report.cleanLabel(project_id)}var htmlaux=composeSectionBreadCrumb(label);$("#"+div.id).append(htmlaux)})}};Convert.convertProjectMap=function(){var divs=$(".ProjectMap");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if(!div.id)div.id="ProjectMap";var label;var htmlaux=composeProjectMap();$("#"+div.id).append(htmlaux)})}};Convert.convertFooter=function(){$.get(Report.getHtmlDir()+"footer.html",function(footer){$("#Footer").html(footer);$("#vizjs-lib-version").append(vizjslib_git_tag)})};Convert.convertSummary=function(){div_param="Summary";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;div.id=ds+"-Summary";DS.displayGlobalSummary(div.id)})}};function composeDropDownRepo(DS){var repository=Report.getParameterByName("repository");if(repository&&$.inArray(repository,DS.getReposData())<0)return"";var dsname=DS.getName();var section="";var label_repo=DS.getLabelForRepository();var label_repo_plural=DS.getLabelForRepositories();if(repository!==undefined){section=repository}else{section="All "+label_repo_plural}html='
    ';html='
    1. Filtered by '+label_repo+":  
    2. ";html+='
    3. "}var repo_names=DS.getReposData();repo_names.sort();$.each(repo_names,function(id,value){if(value===repository)return;html+='
    4. ';html+=value;html+="
    5. "});html+="
    ";html+="
    ";return html}Convert.convertRepositorySelector=function(){var divs=$(".repository-selector");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;div.id=ds+"-repository-selector";var htmlaux=composeDropDownRepo(DS);$("#"+div.id).append(htmlaux)})}};function displayReportData(){data=Report.getProjectData();document.title=data.project_name+" Report by Bitergia";if(data.title)document.title=data.title;$(".report_date").text(data.date);$(".report_name").text(data.project_name);str=data.blog_url;if(str&&str.length>0){$("#blogEntry").html("
    Blog post with some more details");$(".blog_url").attr("href",data.blog_url)}else{$("#more_info").hide()}str=data.producer;if(str&&str.length>0){$("#producer").html(str)}else{$("#producer").html("Bitergia")}$(".project_name").text(data.project_name);$("#project_url").attr("href",data.project_url)}Convert.convertRefcard=function(){$.when($.get(Report.getHtmlDir()+"refcard.html"),$.get(Report.getHtmlDir()+"project-card.html")).done(function(res1,res2){refcard=res1[0];projcard=res2[0];$("#Refcard").html(refcard);displayReportData();$.each(Report.getProjectsData(),function(prj_name,prj_data){var new_div="card-"+prj_name.replace(".","").replace(" ","");$("#Refcard #projects_info").append(projcard);$("#Refcard #projects_info #new_card").attr("id",new_div);$.each(Report.getDataSources(),function(i,DS){if(DS.getProject()!==prj_name){$("#"+new_div+" ."+DS.getName()+"-info").hide();return}DS.displayData(new_div)});$("#"+new_div+" #project_name").text(prj_name);if(Report.getProjectsDirs.length>1)$("#"+new_div+" .project_info").append(' Report');$("#"+new_div+" #project_url").attr("href",prj_data.url)})})};Convert.convertGlobalData=function(){var divs=$(".GlobalData");if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var data=DS.getGlobalData();var key=$(this).data("field");$(this).text(Report.formatValue(data[key],key))})}};Convert.convertProjectData=function(){var divs=$(".ProjectData");var p=Report.getParameterByName("project");if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var data=DS.getProjectsGlobalData()[p];if(data===undefined){return}var key=$(this).data("field");$(this).text(Report.formatValue(data[key],key))})}};Convert.convertRadarActivity=function(){var div_param="RadarActivity";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});Viz.displayRadarActivity(div_param)}};Convert.convertRadarCommunity=function(){var div_param="RadarCommunity";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});Viz.displayRadarCommunity("RadarCommunity")}};Convert.convertTreemap=function(){var div_param="Treemap";var divs=$("#"+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty()});var file=$("#Treemap").data("file");$("#Treemap").empty();Viz.displayTreeMap("Treemap",file)}};Convert.convertBubbles=function(){div_param="Bubbles";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var radius=$(this).data("radius");div.id=ds+"-Bubbles";DS.displayBubbles(div.id,radius)})}};function loadHTMLEvolParameters(htmldiv,config_viz){config_viz.help=true;var help=$(htmldiv).data("help");if(help!==undefined)config_viz.help=help;config_viz.show_legend=false;if($(htmldiv).data("frame-time"))config_viz.frame_time=true;config_viz.graph=$(htmldiv).data("graph");if($(htmldiv).data("min")){config_viz.show_legend=false;config_viz.show_labels=true;config_viz.show_grid=true;config_viz.help=false}if($(htmldiv).data("legend"))config_viz.show_legend=true;config_viz.ligth_style=false;if($(htmldiv).data("light-style")){config_viz.light_style=true}if($(htmldiv).data("custom-title")){config_viz.custom_title=$(htmldiv).data("custom-title")}if(config_viz.help&&$(htmldiv).data("custom-help")){config_viz.custom_help=$(htmldiv).data("custom-help")}else{config_viz.custom_help=""}if($(htmldiv).data("repo-filter")){config_viz.repo_filter=$(htmldiv).data("repo-filter")}var start=$(htmldiv).data("start");if(start)config_viz.start_time=start;var end=$(htmldiv).data("end");if(end)config_viz.end_time=end;var remove_last_point=$(htmldiv).data("remove-last-point");if(remove_last_point)config_viz.remove_last_point=true;return config_viz}Convert.convertMetricsEvol=function(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvol";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");config_viz.title=$(this).data("title");var DS=Report.getDataSourceByName(ds);if(DS===null)return;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+this.id;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolCustomized=function(filter){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvolCustomized";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){if(filter!==$(this).data("filter"))return;var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");config_viz.title=$(this).data("title");var DS=Report.getDataSourceByName(ds);if(DS===null)return;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+this.id;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolSelector=function(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=true;config_metric.show_labels=true;var config=Report.getVizConfig();if(config){$.each(config,function(key,value){config_metric[key]=value})}var div_param="MetricsEvol";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){var config_viz={};$.each(config_metric,function(key,value){config_viz[key]=value});$(this).empty();var metrics=$(this).data("metrics");var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;var repository=Report.getParameterByName("repository");config_viz.repo_filter=repository;config_viz=loadHTMLEvolParameters(div,config_viz);div.id=metrics.replace(/,/g,"-")+"-"+ds+"-metrics-evol-"+repository;div.id=div.id.replace(/\n|\s/g,"");DS.displayMetricsEvol(metrics.split(","),div.id,config_viz,$(this).data("convert"))})}};Convert.convertMetricsEvolSet=function(){div_param="MetricsEvolSet";var divs=$("."+div_param);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var all=$(this).data("all");var relative=$(this).data("relative");var summary_graph=$(this).data("summary-graph");var legend=$(this).data("legend-show");div.id=ds+"-MetricsEvolSet-"+this.id;if(all===true){div.id=ds+"-All";Viz.displayEnvisionAll(div.id,relative,legend,summary_graph);return false}var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;DS.displayEnvision(div.id,relative,legend,summary_graph)})}};Convert.convertTimeTo=function(){var div_tt="TimeTo";divs=$("."+div_tt);if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var ds=$(this).data("data-source");var DS=Report.getDataSourceByName(ds);if(DS===null)return;var quantil=$(this).data("quantil");var type=$(this).data("type");div.id=ds+"-time-to-"+type+"-"+quantil;if(type==="fix")DS.displayTimeToFix(div.id,quantil);if(type==="attention")DS.displayTimeToAttention(div.id,quantil)})}};Convert.convertMarkovTable=function(){var div_id_mt="MarkovTable";var divs=$("."+div_id_mt);var DS,ds;if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var title=$(this).data("title");div.id=ds+"-markov-table";DS.displayMarkovTable(div.id,title)})}};Convert.convertLastActivity=function(){var all_metrics=Report.getAllMetrics();function activityInfo(div,period,label){var html="

    Last "+label+"

    ";$.each(Report.getDataSources(),function(index,DS){var data=DS.getGlobalData();$.each(data,function(key,val){var suffix="_"+period;if(key.indexOf(suffix,key.length-suffix.length)!==-1){var metric=key.substring(0,key.length-suffix.length);label=metric;if(all_metrics[metric])label=all_metrics[metric].name;html+=label+":"+data[key]+"
    "}})});$(div).append(html)}var divs=$(".LastActivity");var period=null;var days={Week:7,Month:30,Quarter:90,Year:365};if(divs.length>0)$.each(divs,function(id,div){period=$(div).data("period");activityInfo(div,days[period],period)})};Convert.convertTopByPeriod=function(){var div_id_top="TopByPeriod";var divs=$("."+div_id_top);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var show_all=false;if($(this).data("show_all"))show_all=true;var top_metric=$(this).data("metric");var npeople=$(this).data("limit");var is_release=Utils.isReleasePage();var html=HTMLComposer.TopByPeriod(ds,top_metric,npeople,is_release);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertTop=function(){var div_id_top="Top";var divs=$("."+div_id_top);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(DS.getData().length===0)return;var show_all=false;if($(this).data("show_all"))show_all=true;var top_metric=$(this).data("metric");var limit=$(this).data("limit");var graph=$(this).data("graph");var people_links=$(this).data("people_links");var threads_links=$(this).data("threads_links"); +var period=$(this).data("period");var period_all=$(this).data("period_all");var repository=Report.getParameterByName("repository");div.id=ds+"-"+div_id_top+unique++;if(graph){div.id+="-"+graph}if(period===undefined&&period_all===undefined){period_all=true}if(limit===undefined){limit=10}DS.displayTop(div.id,show_all,top_metric,period,period_all,graph,limit,people_links,threads_links,repository)})}};Convert.convertPersonMetrics=function(upeople_id,upeople_identifier){var config_metric={};config_metric.show_desc=false;config_metric.show_title=false;config_metric.show_labels=true;divs=$(".PersonMetrics");if(divs.length){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var metrics=$(this).data("metrics");config_metric.show_legend=false;config_metric.help=false;if($(this).data("frame-time"))config_metric.frame_time=true;if($(this).data("legend"))config_metric.show_legend=true;if($(this).data("person_id"))upeople_id=$(this).data("person_id");if($(this).data("person_name"))upeople_identifier=$(this).data("person_name");div.id=metrics.replace(/,/g,"-")+"-people-metrics";DS.displayMetricsPeople(upeople_id,upeople_identifier,metrics.split(","),div.id,config_metric)})}};function getRandomId(){return Math.floor(Math.random()*1e3+1)}Convert.convertPersonData=function(upeople_id,upeople_identifier){var divs=$(".PersonData"),name,email;if(divs.length>0){$.each(divs,function(id,div){$(this).empty();if($(this).data("person_id"))upeople_id=$(this).data("person_id");if(!div.id)div.id="PersonData"+"-"+upeople_id+"-"+getRandomId();var data=Report.getPeopleIdentities()[upeople_id];if(data){name=DataProcess.selectPersonName(data);email=DataProcess.selectPersonEmail(data);email="("+DataProcess.hideEmail(email)+")"}else{if(upeople_identifier!==undefined)name=upeople_identifier;else name=upeople_id;email=""}html=HTMLComposer.personName(name,email);$("#"+div.id).append(html)})}};Convert.personSummaryBlock=function(upeople_id){var divs=$(".PersonSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");ds_realname=$(this).data("data-realname");metric_name=$(this).data("metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(DS.getPeopleMetricsData()[upeople_id].length===0)return;var html=HTMLComposer.personDSBlock(ds_name,metric_name,ds_realname);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertPersonSummary=function(upeople_id,upeople_identifier){var divs=$(".PersonSummary");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if($(this).data("person_id"))upeople_id=$(this).data("person_id");if($(this).data("person_name"))upeople_identifier=$(this).data("person_name");div.id=ds+"-refcard-people";DS.displayPeopleSummary(div.id,upeople_id,upeople_identifier,DS)})}};Convert.convertPeople=function(upeople_id,upeople_identifier){if(upeople_id===undefined)upeople_id=Report.getParameterByName("id");if(upeople_identifier===undefined)upeople_identifier=Report.getParameterByName("name");if(upeople_id===undefined)return;if(Loader.check_people_item(upeople_id)===false){$.each(Report.getDataSources(),function(index,DS){Loader.data_load_people_item(upeople_id,DS,Convert.convertPeople)});return}Convert.personSummaryBlock(upeople_id);Convert.convertPersonData(upeople_id,upeople_identifier);Convert.convertPersonSummary(upeople_id,upeople_identifier);Convert.convertPersonMetrics(upeople_id,upeople_identifier);Convert.activateHelp()};function dataFilterAvailable(filter_name,item_name){if(filter_name==="repos"){if(DS.getReposGlobalData()[item_name]===undefined||DS.getReposGlobalData()[item_name].length===0)return false}else if(filter_name==="companies"){if(DS.getCompaniesGlobalData()[item_name]===undefined||DS.getCompaniesGlobalData()[item_name].length===0)return false}else if(filter_name==="countries"){if(DS.getCountriesGlobalData()[item_name]===undefined||DS.getCountriesGlobalData()[item_name].length===0)return false}else if(filter_name==="companies"){if(DS.getDomainsGlobalData()[item_name]===undefined||DS.getDomainsGlobalData()[item_name].length===0)return false}return true}Convert.repositoryDSBlock=function(repo_id){var divs=$(".FilterDSBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");filter_name=$(this).data("filter");aux=$(this).data("metrics");metric_names=aux.split(",");$.each(metric_names,function(id,value){metric_names[id]=metric_names[id].replace(/:/g,",")});DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;if(dataFilterAvailable(filter_name,repo_id)){var html=HTMLComposer.filterDSBlock(ds_name,filter_name,metric_names);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)}})}};Convert.convertDSSummaryBlock=function(upeople_id){var divs=$(".DSSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");ds_realname=$(this).data("data-realname");box_labels=$(this).data("box-labels");box_metrics=$(this).data("box-metrics");ts_metrics=$(this).data("ts-metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;var html=HTMLComposer.DSBlock(ds_name,box_labels,box_metrics,ts_metrics,ds_realname);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertDSSummaryBlockProjectFiltered=function(upeople_id){var divs=$(".DSSummaryBlockProjectFiltered");var pname=Report.getParameterByName("project");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;ds_name=$(this).data("data-source");box_labels=$(this).data("box-labels");box_metrics=$(this).data("box-metrics");ts_metrics=$(this).data("ts-metrics");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getProjectsGlobalData()[pname]===undefined)return;if(DS.getProjectsGlobalData()[pname].length===0)return;var html=HTMLComposer.DSBlockProject(ds_name,box_labels,box_metrics,ts_metrics,pname);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertOverallSummaryBlock=function(){var divs=$(".OverallSummaryBlock");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;var html=HTMLComposer.overallSummaryBlock();if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertDemographics=function(){var divs=$(".Demographics");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;var period=$(this).data("period");div.id="Demographics"+"-"+ds+"-"+"-"+period;DS.displayDemographics(div.id,period)})}};function filterItemsConfig(){var config_metric={};config_metric.show_desc=false;config_metric.show_title=false;config_metric.show_labels=true;config_metric.show_legend=false;return config_metric}Convert.getRealItem=function(ds,filter,item){var map=Report.getReposMap();if(map===undefined||map.length===0){if($.inArray(item,ds.getReposData())>-1)return item;else return null}var map_item=null;if(filter==="repos"){var rdata=ds.getReposMetricsData()[item];if(rdata===undefined){$.each(map,function(id,repos){$.each(Report.getDataSources(),function(index,DS){if(repos[DS.getName()]===item){map_item=repos[ds.getName()];return false}});if(map_item!==null)return false})}else map_item=item}else map_item=item;return map_item};Convert.convertFilterItemsSummary=function(filter){var divlabel="FilterItemsSummary";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;div.id=ds+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayReposSummary(div.id,DS);if(filter==="countries")DS.displayCountriesSummary(div.id,DS);if(filter==="companies")DS.displayCompaniesSummary(div.id,DS);if(filter==="domains")DS.displayDomainsSummary(div.id,DS);if(filter==="projects")DS.displayProjectsSummary(div.id,DS)})}};Convert.convertFilterItemsGlobal=function(filter){var config_metric=filterItemsConfig();var divlabel="FilterItemsGlobal";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;var metric=$(this).data("metric");var show_others=$(this).data("show-others");var order_by=$(this).data("order-by");config_metric.show_legend=$(this).data("legend");if($("#"+$(this).data("legend-div")).length>0){config_metric.legend={container:$(this).data("legend-div")}}else config_metric.legend={container:null};config_metric.graph=$(this).data("graph");config_metric.title=$(this).data("title");config_metric.show_title=1;div.id=metric+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayMetricReposStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="countries")DS.displayMetricCountriesStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="companies")DS.displayMetricCompaniesStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="domains")DS.displayMetricDomainsStatic(metric,div.id,config_metric,order_by,show_others);if(filter==="projects")DS.displayMetricProjectsStatic(metric,div.id,config_metric,order_by,show_others)})}};Convert.convertFilterItemsNav=function(filter,page){var divlabel="FilterItemsNav";divs=$("."+divlabel);if(divs.length>0){var cont=0;$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("page"))page=$(this).data("page");order_by=$(this).data("order-by");div.id=ds+"-"+divlabel+"-"+cont;cont+=1;$(this).empty();if(filter==="repos")DS.displayItemsNav(div.id,filter,page,order_by);else if(filter==="countries")DS.displayItemsNav(div.id,filter,page);else if(filter==="companies")DS.displayItemsNav(div.id,filter,page);else if(filter==="domains")DS.displayItemsNav(div.id,filter,page);else if(filter==="projects")DS.displayItemsNav(div.id,filter,page)})}};Convert.convertFilterItemsMetricsEvol=function(filter){var config_metric=filterItemsConfig();var divlabel="FilterItemsMetricsEvol";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;var metric=$(this).data("metric");var stacked=false;if($(this).data("stacked"))stacked=true;if($(this).data("min")){config_viz.show_legend=false;config_viz.show_labels=true;config_viz.show_grid=true;config_viz.help=false}var start=$(this).data("start");var end=$(this).data("end");config_metric.lines={stacked:stacked};if($("#"+$(this).data("legend-div")).length>0){config_metric.legend={container:$(this).data("legend-div")}}else config_metric.legend={container:null};config_metric.show_legend=$(this).data("legend");config_metric.mouse_tracker=$(this).data("mouse_tracker");var remove_last_point=$(this).data("remove-last-point");if(remove_last_point)config_metric.remove_last_point=true;div.id=metric+"-"+divlabel;$(this).empty();if(filter==="companies")DS.displayMetricCompanies(metric,div.id,config_metric,start,end);else if(filter==="repos")DS.displayMetricRepos(metric,div.id,config_metric,start,end);else if(filter==="domains")DS.displayMetricDomains(metric,div.id,config_metric,start,end);else if(filter==="projects")DS.displayMetricProjects(metric,div.id,config_metric,start,end)})}};Convert.convertFilterItemsMiniCharts=function(filter,page){var config_metric=filterItemsConfig();var divlabel="FilterItemsMiniCharts";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("page"))page=$(this).data("page");var metrics=$(this).data("metrics");var order_by=$(this).data("order-by");var show_links=true;if($(this).data("show_links")!==undefined)show_links=$(this).data("show_links");var start=$(this).data("start");var end=$(this).data("end");var convert=$(this).data("convert");if($(this).data("frame-time"))config_metric.frame_time=true;var remove_last_point=$(this).data("remove-last-point");if(remove_last_point)config_metric.remove_last_point=true;div.id=metrics.replace(/,/g,"-")+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos")DS.displayReposList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="countries")DS.displayCountriesList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="companies")DS.displayCompaniesList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="domains")DS.displayDomainsList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert);else if(filter==="projects")DS.displayProjectsList(metrics.split(","),div.id,config_metric,order_by,page,show_links,start,end,convert)})}};Convert.convertFilterItemData=function(filter,item){var divs=$(".FilterItemData");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var label=Report.cleanLabel(item);if(!div.id)div.id="FilterItemData"+getRandomId();html=HTMLComposer.itemName(label,filter);$("#"+div.id).append(html)})}};Convert.convertFilterItemSummary=function(filter,item){var divlabel="FilterItemSummary";divs=$("."+divlabel);if(item!==null&&divs.length>0){$.each(divs,function(id,div){var real_item=item;ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");div.id=ds+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos"){DS.displayRepoSummary(div.id,real_item,DS)}else if(filter==="countries")DS.displayCountrySummary(div.id,real_item,DS);else if(filter==="companies")DS.displayCompanySummary(div.id,real_item,DS);else if(filter==="domains")DS.displayDomainSummary(div.id,real_item,DS);else if(filter==="projects")DS.displayProjectSummary(div.id,real_item,DS)})}};Convert.convertFilterItemMicrodashText=function(filter,item){var divs=$(".FilterItemMicrodashText");if(divs.length>0){$.each(divs,function(id,div){$(this).empty();var global_data;var real_item=item;var metric=$(this).data("metric");var show_name=$(this).data("name");var ds=Report.getMetricDS(metric)[0];if(ds===undefined)return;if(filter==="projects"){global_data=ds.getProjectsGlobalData()[item];if(global_data===undefined){return}}else{return}var html='
    ';if(show_name){html+='
    ';html+=''+ds.basic_metrics[metric].name+"";html+="
    "}$.each([365,30,7],function(index,period){var column=ds.getMetrics()[metric].column;var value=global_data[metric+"_"+period];var netvalue=global_data["diff_net"+column+"_"+period];var percentagevalue=global_data["percentage_"+column+"_"+period];percentagevalue=Math.round(percentagevalue*10)/10;if(value===undefined)return;var str_percentagevalue="";if(netvalue>0)str_percentagevalue="+"+percentagevalue;if(netvalue<0)str_percentagevalue="-"+Math.abs(percentagevalue);if(show_name){html+='
    '}else{html+='
    '}html+='Last '+period+" days:";html+=" "+Report.formatValue(value)+"
    ";if(netvalue===0){html+='  '+str_percentagevalue+"% "}else if(netvalue>0){html+='  '+str_percentagevalue+"% "}else if(netvalue<0){html+='  '+str_percentagevalue+"% "}html+="
    "});html+="
    ";$(div).append(html)})}};Convert.convertFilterItemMetricsEvol=function(filter,item){var config_metric=filterItemsConfig();var divlabel="FilterItemMetricsEvol";divs=$("."+divlabel);if(item!==null&&divs.length>0){$.each(divs,function(id,div){var real_item=item;var metrics=$(this).data("metrics");ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");config_metric=loadHTMLEvolParameters(div,config_metric);div.id=Report.cleanLabel(item).replace(/ /g,"_")+"-";div.id+=metrics.replace(/,/g,"-")+"-"+ds+"-"+filter+"-"+divlabel;$(this).empty();if(filter==="repos"){DS.displayMetricsRepo(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="countries"){DS.displayMetricsCountry(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="companies"){DS.displayMetricsCompany(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="domains"){DS.displayMetricsDomain(real_item,metrics.split(","),div.id,config_metric)}else if(filter==="projects"){DS.displayMetricsProject(real_item,metrics.split(","),div.id,config_metric)}})}};Convert.convertFilterItemTop=function(filter,item){var divlabel="FilterItemTop";divs=$("."+divlabel);if(divs.length>0){$.each(divs,function(id,div){var real_item=item;$(this).empty();ds=$(this).data("data-source");DS=Report.getDataSourceByName(ds);if(DS===null)return;if(filter===undefined)filter=$(this).data("filter");if(filter!==$(this).data("filter"))return;if(!filter)return;if($(this).data("item"))real_item=$(this).data("item");var metric=$(this).data("metric");var period=$(this).data("period");var titles=$(this).data("titles");div.id=metric+"-"+ds+"-"+filter+"-"+divlabel+"-"+getRandomId();$(this).empty();div.className="";if(filter==="companies")DS.displayTopCompany(real_item,div.id,metric,period,titles)})}};Convert.convertSmartLinks=function(){var divs=$(".SmartLinks");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;target_page=$(this).data("target");label=$(this).data("label");var html=HTMLComposer.smartLinks(target_page,label);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.companyFilters=function(){var divs=$(".CompanyFilters");if(divs.length>0){$.each(divs,function(id,div){if(div.id.indexOf("Parsed")>=0)return;company_name=Report.getParameterByName("company");var html=HTMLComposer.companyFilters(company_name);if(!div.id)div.id="Parsed"+getRandomId();$("#"+div.id).append(html)})}};Convert.convertFilterStudyItem=function(filter,item){var convertfn=Convert.convertFilterStudyItem;if(convertfn.done===undefined){convertfn.done={}}else if(convertfn.done[filter]===true)return;if(filter==="repositories")filter="repos";if(item===undefined){if(filter==="repos")item=Report.getParameterByName("repository");if(filter==="countries")item=Report.getParameterByName("country");if(filter==="companies")item=Report.getParameterByName("company");if(filter==="domains")item=Report.getParameterByName("domain");if(filter==="projects")item=Report.getParameterByName("project")}if(!item)return;if(Loader.FilterItemCheck(item,filter)===false)return;Convert.repositoryDSBlock(item);Convert.convertDSSummaryBlockProjectFiltered();Convert.convertFilterItemData(filter,item);Convert.convertFilterItemSummary(filter,item);Convert.convertFilterItemMetricsEvol(filter,item);Convert.convertFilterItemTop(filter,item);Convert.convertFilterItemMicrodashText(filter,item);Convert.convertProjectData();Convert.activateHelp();Convert.convertMetricsEvolSelector();convertfn.done[filter]=true};Convert.activateHelp=function(){$(".help").popover({html:true,trigger:"manual"}).click(function(e){$(this).popover("toggle");e.stopPropagation()})};Convert.convertFilterStudy=function(filter){var page=Report.getCurrentPage();if(page===null){page=Report.getParameterByName("page");if(page!==undefined)Report.setCurrentPage(page)}if(page===undefined){if($("[class^='FilterItems']").length>0){page=1;Report.setCurrentPage(page)}else return}if(filter==="repositories")filter="repos";if(Loader.check_filter_page(page,filter)===false){$.each(Report.getDataSources(),function(index,DS){Loader.data_load_items_page(DS,page,Convert.convertFilterStudy,filter)});return}Convert.convertFilterItemsSummary(filter);Convert.convertFilterItemsGlobal(filter);Convert.convertFilterItemsNav(filter,page);Convert.convertFilterItemsMetricsEvol(filter);Convert.convertFilterItemsMiniCharts(filter,page)};Convert.convertDSTable=function(){var dst="DataSourcesTable";var divs=$("."+dst);var DS,ds;if(divs.length>0){var unique=0;$.each(divs,function(id,div){$(this).empty();div.id=dst+unique++;Viz.displayDataSourcesTable(div)})}};Convert.convertBasicDivs=function(){Convert.convertNavbar();Convert.convertSmartLinks();Convert.convertSectionBreadcrumb();Convert.convertProjectMap();Convert.convertFooter();Convert.convertOverallSummaryBlock();Convert.convertDSSummaryBlock();Convert.convertDSTable();Convert.convertGlobalData();Convert.convertSummary();Convert.convertTopByPeriod();Convert.companyFilters()};Convert.convertBasicDivsMisc=function(){Convert.convertRadarActivity();Convert.convertRadarCommunity();Convert.convertTreemap();Convert.convertBubbles()};Convert.convertBasicMetrics=function(config){var item=Report.getParameterByName("repository");if(item===undefined)Convert.convertMetricsEvol();Convert.convertTimeTo();Convert.convertMarkovTable()};Convert.convertFilterTop=function(filter){var item=Report.getParameterByName("repository");if(item!==undefined){if(Loader.filterTopCheck(item,filter)===false)return}Convert.convertTop();Convert.convertRepositorySelector()}})();if(Report===undefined)var Report={};(function(){var project_data=null,markers=null,viz_config=null,gridster={},data_sources=[],report_config=null,html_dir="",menu_elements;var data_dir="data/json";var config_dir="config";var default_data_dir="data/json";var default_html_dir="";var projects_dirs=[default_data_dir];var projects_data={};var projects_datasources={};var repos_map;Report.all_json_file=data_dir+"/all.json";var project_file=config_dir+"/project-info.json";viz_config_file=data_dir+"/viz_cfg.json";markers_file=data_dir+"/markers.json";repos_map_file=data_dir+"/repos-map.json";projects_hierarchy_file=data_dir+"/projects_hierarchy.json";menu_elements_file=config_dir+"/menu-elements.json";var page_size=10,page=null;var project_people_identities={};Report.createDataSources=createDataSources;Report.getAllMetrics=getAllMetrics;Report.getMarkers=getMarkers;Report.getVizConfig=getVizConfig;Report.getProjectsHierarchy=getProjectsHierarchy;Report.getMenuElements=getMenuElements;Report.getMenuElementsReleases=getMenuElementsReleases;Report.getReleaseNames=getReleaseNames;Report.getThreadsSite=getThreadsSite;Report.getMetricDS=getMetricDS;Report.getGridster=getGridster;Report.setGridster=setGridster;Report.getCurrentPage=function(){return page};Report.setCurrentPage=function(current_page){page=current_page};Report.getPageSize=function(){return page_size};Report.setPageSize=function(size){page_size=size};Report.getProjectData=getProjectData;Report.getProjectsData=getProjectsData;Report.convertStudies=convertStudies;Report.getDataSources=function(){return data_sources};Report.registerDataSource=function(backend){data_sources.push(backend)};Report.setHtmlDir=function(dir){html_dir=dir};Report.getHtmlDir=function(){return html_dir};Report.getDataDir=function(){return data_dir};Report.setDataDir=function(dataDir){data_dir=dataDir;project_file=dataDir+"/project-info.json";config_file=dataDir+"/viz_cfg.json";markers_file=dataDir+"/markers.json";repos_mapping_file=data_dir+"/repos-mapping.json";projects_hierarchy_file=data_dir+"/projects_hierarchy.json"};function getMarkers(){return markers}Report.setMarkers=function(data){markers=data};Report.getMarkersFile=function(){return markers_file};Report.getReposMap=function(){return repos_map};Report.setReposMap=function(data){repos_map=data};Report.getReposMapFile=function(){return repos_map_file};function getVizConfig(){return viz_config}Report.setVizConfig=function(cfg){viz_config=cfg};Report.getVizConfigFile=function(){return viz_config_file};function getProjectsHierarchy(){return projects_hierarchy}Report.setProjectsHierarchy=function(data){projects_hierarchy=data};Report.getProjectsHierarchyFile=function(){return projects_hierarchy_file};function getMenuElements(){var elements;if(menu_elements!==undefined){elements=menu_elements.menu}return elements}function getMenuElementsReleases(){var releases;if(menu_elements!==undefined){releases=menu_elements.menu_releases}return releases}function getReleaseNames(){var names;if(menu_elements!==undefined){names=menu_elements.releases}return names}function getThreadsSite(){var site;if(menu_elements!==undefined){site=menu_elements.threads_site}return site}Report.setMenuElements=function(data){menu_elements=data};Report.getMenuElementsFile=function(){return menu_elements_file};function getGridster(){return gridster}function setGridster(grid){gridster=grid}function getProjectData(){return project_data}Report.setProjectData=function(data){project_data=data};Report.getProjectFile=function(){return project_file};function getProjectsData(){return projects_data}Report.getProjectsDirs=function(){return projects_dirs};Report.setProjectsDirs=function(dirs){projects_dirs=dirs};Report.getProjectsList=function(){var projects_list=[];$.each(getProjectsData(),function(key,val){projects_list.push(key)});return projects_list};Report.getProjectsDataSources=function(){return projects_datasources};Report.setMetricsDefinition=function(metrics){$.each(Report.getDataSources(),function(i,DS){DS.setMetricsDefinition(metrics[DS.getName()])})};Report.getPeopleIdentities=function(){return project_people_identities};Report.setPeopleIdentities=function(people){project_people_identities=people};Report.cleanLabel=function(item){var label=item;var aux=null;if(item.split("___").length===2){aux=item.split(" ");label=aux[0]}else if(item.lastIndexOf("https:__api.github.com_repos_")===0){label=label.replace("https:__api.github.com_repos_","");label=label.split("_")[1]}else if(item.lastIndexOf("http")===0||item.split("_").length>3){aux=item.split("_");label=aux.pop();if(label==="")label=aux.pop();label=label.replace("buglist.cgi?product=","");label=label.replace("gmane.comp.sysutils.","")}else if(item.lastIndexOf("<")===0)label=MLS.displayMLSListName(item);return label};function strNumberWithThousands(x){var parts=x.toString().split(".");parts[0]=parts[0].replace(/\B(?=(\d{3})+(?!\d))/g,",");return parts.join(".")}Report.formatValue=function(number,field){if(number===undefined)return"-";var date_fields=["last_date","first_date"];var reports=["repositories","companies","countries","domains","projects"];var value=number;try{value=parseFloat(number).toFixed(1).toString().replace(/\.0$/,"");value=strNumberWithThousands(value);if(navigator.language==="es"){var parts=value.split(".");parts[0]=parts[0].replace(/,/g,".");value=parts.join(",")}}catch(err){}if(typeof value==="number"&&isNaN(value))value=number.toString();if(field!==undefined&&$.inArray(field,date_fields)>-1)value=number.toString();if(field!==undefined&&value==="0"){$.each(reports,function(i,report){if(field.indexOf(report)!=1){value="-"}})}return value};Report.escapeHtml=function(unsafe){return unsafe.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")};Report.getParameterByName=function(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?undefined:Report.escapeHtml(decodeURIComponent(results[1].replace(/\+/g," ")))};function getMetricDS(metric_id){var ds=[];$.each(Report.getDataSources(),function(i,DS){if(DS.getMetrics()[metric_id]){ds.push(DS)}});return ds}Report.getDataSourceByName=function(ds){var DS=null;$.each(Report.getDataSources(),function(index,DSaux){if(DSaux.getName()===ds){DS=DSaux;return false}});return DS};function getAllMetrics(){var all={};$.each(Report.getDataSources(),function(index,DS){all=$.extend({},all,DS.getMetrics())});return all}Report.displayActiveMenu=function(){var active=window.location.href;var page=active.substr(active.lastIndexOf("/")+1,active.length);page=page.split(".html")[0];if(page.indexOf("scm")===0){$(".scm-menu")[0].className=$(".scm-menu")[0].className+" active"}else if(page.indexOf("its")===0){$(".its-menu")[0].className=$(".its-menu")[0].className+" active"}else if(page.indexOf("mls")===0){$(".mls-menu")[0].className=$(".mls-menu")[0].className+" active"}else if(page.indexOf("scr")===0){$(".scr-menu")[0].className=$(".scr-menu")[0].className+" active"}else if(page.indexOf("irc")===0){$(".irc-menu")[0].className=$(".irc-menu")[0].className+" active"}else if(page.indexOf("qaforum")===0){$(".qaforum-menu")[0].className=$(".qaforum-menu")[0].className+" active"}else if(page.indexOf("studies")===0){$(".studies-menu")[0].className=$(".studies-menu")[0].className+" active"}else if(page.indexOf("wiki")===0){$(".wiki-menu")[0].className=$(".wiki-menu")[0].className+" active"}else if(page.indexOf("downloads")===0){$(".downloads-menu")[0].className=$(".downloads-menu")[0].className+" active"}else if(page.indexOf("projects")===0){$(".listprojects-menu")[0].className=$(".listprojects-menu")[0].className+" active"}else if(page.indexOf("index")===0||page===""){if($(".summary-menu").length===0)return;$(".summary-menu")[0].className=$(".summary-menu")[0].className+" active"}else{if($(".experimental-menu")[0])$(".experimental-menu")[0].className=$(".experimental-menu")[0].className+" active"}};function checkDynamicConfig(){var data_sources=[];var release=$.urlParam("release");if(release!==null&&release.length>0){data_sources.push("data/json/"+release);Report.setDataDir("data/json/"+release);if(data_sources.length>0)Report.setProjectsDirs(data_sources)}}function createDataSources(){checkDynamicConfig();var projects_dirs=Report.getProjectsDirs();var scm,its,its_1,mls,scr,irc,mediawiki,people,downloads,qaforums,releases;$.each(projects_dirs,function(i,project){if(Report.getConfig()===null||Report.getConfig()["data-sources"]===undefined){its=new ITS;Report.registerDataSource(its);its_1=new ITS_1;Report.registerDataSource(its_1);mls=new MLS;Report.registerDataSource(mls);scm=new SCM;Report.registerDataSource(scm);scr=new SCR;Report.registerDataSource(scr);irc=new IRC;Report.registerDataSource(irc);mediawiki=new MediaWiki;Report.registerDataSource(mediawiki);people=new People;Report.registerDataSource(people);downloads=new Downloads;Report.registerDataSource(downloads);qaforums=new QAForums;Report.registerDataSource(qaforums);releases=new Releases;Report.registerDataSource(releases)}else{var active_ds=Report.getConfig()["data-sources"];$.each(active_ds,function(i,name){if(name==="its"){its=new ITS;Report.registerDataSource(its)}else if(name==="its_1"){its_1=new ITS_1;Report.registerDataSource(its_1)}else if(name==="mls"){mls=new MLS;Report.registerDataSource(mls)}else if(name==="scm"){scm=new SCM;Report.registerDataSource(scm)}else if(name==="scr"){scr=new SCR;Report.registerDataSource(scr)}else if(name==="irc"){irc=new IRC;Report.registerDataSource(irc)}else if(name==="mediawiki"){mediawiki=new MediaWiki; +Report.registerDataSource(mediawiki)}else if(name==="people"){people=new People;Report.registerDataSource(people)}else if(name==="downloads"){downloads=new Downloads;Report.registerDataSource(downloads)}else if(name==="qaforums"){qaforums=new QAForums;Report.registerDataSource(qaforums)}else if(name==="releases"){releases=new Releases;Report.registerDataSource(releases)}else Report.log("Not support data source "+name)})}if(its)its.setDataDir(project);if(its_1)its_1.setDataDir(project);if(mls)mls.setDataDir(project);if(scm)scm.setDataDir(project);if(scr)scr.setDataDir(project);if(irc)irc.setDataDir(project);if(mediawiki)mediawiki.setDataDir(project);if(people)people.setDataDir(project);if(downloads)downloads.setDataDir(project);if(qaforums)qaforums.setDataDir(project);if(releases)releases.setDataDir(project);if(scm&&its)scm.setITS(its)});return true}Report.addDataDir=function(){var addURL;var querystr=window.location.search.substr(1);if(querystr&&querystr.indexOf("data_dir")!==-1){addURL=window.location.search.substr(1)}return addURL};Report.configDataSources=function(){var prjs_dss=Report.getProjectsDataSources();$.each(Report.getDataSources(),function(index,ds){if(ds.getData()instanceof Array)return;$.each(projects_data,function(name,project){if(project.dir===ds.getDataDir()){if(prjs_dss[name]===undefined)prjs_dss[name]=[];$.each(prjs_dss[name],function(prj,prjds){if(ds.getName()===prjds.getName())return false});ds.setProject(name);prjs_dss[name].push(ds);return false}})})};Report.getConfig=function(){return report_config};Report.setConfig=function(data){report_config=data;if(data){Report.log("Global config file found");if(data["global-html-dir"])Report.setHtmlDir(data["global-html-dir"]);if(data["global-data-dir"]){Report.setDataDir(data["global-data-dir"]);Report.setProjectsDirs([data["global-data-dir"]])}if(data["projects-data-dirs"])Report.setProjectsDirs(data["projects-data-dirs"])}};Report.convertGlobal=function(){Convert.convertBasicDivs();Convert.convertBasicDivsMisc();Convert.convertBasicMetrics();Convert.convertDemographics();Convert.convertMetricsEvolSet();Convert.convertLastActivity();Convert.convertMicrodash();Convert.convertMicrodashText()};Report.getActiveStudies=function(){var activeStudies=[];var reports;var reports_study=["repositories","countries","companies","domains","projects"];if(Report.getConfig()!==null)reports=Report.getConfig().reports;else reports=reports_study;$.each(reports_study,function(i,study){if($.inArray(study,reports)>-1)activeStudies.push(study)});return activeStudies};Report.convertStudiesGlobal=function(){Convert.convertPeople()};function convertStudies(){$.each(Report.getActiveStudies(),function(i,study){var filter=study;if(study==="repositories")filter="repos";DataProcess.orderItems(filter);Convert.convertFilterStudy(study);Convert.convertFilterStudyItem(study)})}var log_on=true;Report.getLog=function(){return log_on};Report.setLog=function(status){log_on=status};Report.log=function(msg){if(Report.getLog()===true)if(window.console)console.log(msg)}})();Loader.data_ready_global(function(){Report.configDataSources();Report.convertGlobal();Report.convertStudiesGlobal()});Loader.data_ready(function(){study="repos";Convert.convertFilterTop(study)});Loader.data_ready(function(){Report.convertStudies();$("body").css("cursor","auto");$("html").click(function(e){$(".help").popover("hide")});Convert.activateHelp()});$(document).ready(function(){$.getJSON(Report.getMenuElementsFile(),function(data){Report.setMenuElements(data)}).fail(function(){if(window.console)Report.log("Can't read global config file "+Report.getMenuElementsFile())}).always(function(data){Report.createDataSources();$.getJSON(Report.all_json_file,function(data){if(window.console){Report.log("Loaded all JSON data from "+Report.all_json_file)}Loader.set_all_data(data)}).always(function(data){Loader.data_load()});$("body").css("cursor","progress")})});function resizedw(){if(true){return}Report.convertGlobal();Report.convertStudiesGlobal();Report.convertStudies();Convert.activateHelp()}var resized;$(window).resize(function(){clearTimeout(resized);resized=setTimeout(resizedw,100)});function DataSource(name,basic_metrics){this.top_data_file=this.data_dir+"/"+this.name+"-top.json";this.getTopDataFile=function(){return this.top_data_file};this.getMetrics=function(){return this.basic_metrics};this.setMetrics=function(metrics){this.basic_metrics=metrics};this.setMetricsDefinition=function(metrics){if(metrics===undefined)return;this.setMetrics(metrics)};this.data_file=this.data_dir+"/"+this.name+"-evolutionary.json";this.getDataFile=function(){return this.data_file};this.setDataFile=function(file){this.data_file=file};this.data=null;this.getData=function(){return this.data};function nameSpaceMetrics(plain_metrics,ds){if(plain_metrics instanceof Array)return plain_metrics;var metrics={};if(plain_metrics===null){return metrics}$.each(plain_metrics,function(name,value){var basic_name=name;var aux=name.split("_");if(isNaN(aux[aux.length-1])===false)basic_name=aux.slice(0,aux.length-1).join("_");var ns_basic_name=ds.getName()+"_"+basic_name;var ns_name=ds.getName()+"_"+name;if(ds.getMetrics()[ns_basic_name]===undefined)metrics[name]=value;else metrics[ns_name]=value});return metrics}this.setData=function(load_data,self){if(self===undefined)self=this;self.data=nameSpaceMetrics(load_data,self)};this.demographics_aging_file=this.data_dir+"/"+this.name+"-demographics-aging.json";this.demographics_birth_file=this.data_dir+"/"+this.name+"-demographics-birth.json";this.getDemographicsAgingFile=function(){return this.demographics_aging_file};this.getDemographicsBirthFile=function(){return this.demographics_birth_file};this.demographics_data={};this.getDemographicsData=function(){return this.demographics_data};this.setDemographicsAgingData=function(data,self){if(self===undefined)self=this;self.demographics_data.aging=data};this.setDemographicsBirthData=function(data,self){if(self===undefined)self=this;self.demographics_data.birth=data};this.data_dir="data/json";this.getDataDir=function(){return this.data_dir};this.setDataDir=function(dataDir){this.data_dir=dataDir;this.data_file=dataDir+"/"+this.name+"-evolutionary.json";this.demographics_aging_file=dataDir+"/"+this.name+"-demographics-aging.json";this.demographics_birth_file=dataDir+"/"+this.name+"-demographics-birth.json";this.global_data_file=dataDir+"/"+this.name+"-static.json";this.top_data_file=dataDir+"/"+this.name+"-top.json";this.companies_data_file=dataDir+"/"+this.name+"-companies.json";this.repos_data_file=dataDir+"/"+this.name+"-repos.json";this.countries_data_file=dataDir+"/"+this.name+"-countries.json";this.domains_data_file=dataDir+"/"+this.name+"-domains.json";this.projects_data_file=dataDir+"/"+this.name+"-projects.json";this.time_to_fix_data_file=dataDir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json"};this.global_data_file=this.data_dir+"/"+this.name+"-static.json";this.getGlobalDataFile=function(){return this.global_data_file};this.global_data=null;this.getGlobalData=function(){return this.global_data};this.setGlobalData=function(data,self){if(self===undefined)self=this;var aux=Report.getMenuElements();var active_companies=null;if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0&&Object.keys(data).indexOf("companies")>=0){data.companies=active_companies.length}self.global_data=nameSpaceMetrics(data,self)};this.global_top_data=null;this.getGlobalTopData=function(){return this.global_top_data};this.setGlobalTopData=function(data,self){if(self===undefined)self=this;self.global_top_data=data};this.name=name;this.getName=function(){return this.name};this.people_data_file=this.data_dir+"/"+this.name+"-people.json";this.getPeopleDataFile=function(){return this.people_data_file};this.people=null;this.getPeopleData=function(){return this.people};this.setPeopleData=function(people,self){if(self===undefined)self=this;self.people=people};this.time_to_fix_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_fix_hour.json";this.getTimeToFixDataFile=function(){return this.time_to_fix_data_file};this.time_to_fix_data=null;this.getTimeToFixData=function(){return this.time_to_fix_data};this.setTimeToFixData=function(data,self){if(self===undefined)self=this;self.time_to_fix_data=data};this.time_to_attention_data_file=this.data_dir+"/"+this.name+"-quantiles-month-time_to_attention_hour.json";this.getTimeToAttentionDataFile=function(){return this.time_to_attention_data_file};this.time_to_attention_data=null;this.getTimeToAttentionData=function(){return this.time_to_attention_data};this.setTimeToAttentionData=function(data,self){if(self===undefined)self=this;self.time_to_attention_data=data};this.project=null;this.getProject=function(){return this.project};this.setProject=function(project){this.project=project};this.markov_table_data_file=this.data_dir+"/"+this.name+"-markov.json";this.getMarkovTableDataFile=function(){return this.markov_table_data_file};this.markov_table_data=null;this.getMarkovTableData=function(){return this.markov_table_data};this.setMarkovTableData=function(data,self){if(self===undefined)self=this;self.markov_table_data=data};this.companies_data_file=this.data_dir+"/"+this.name+"-companies.json";this.getCompaniesDataFile=function(){return this.companies_data_file};this.companies=null;this.getCompaniesDataFull=function(){return this.companies};this.getCompaniesData=function(){var items=this.companies;if(items instanceof Array===false){if(this.companies!==null){items=this.companies.name}}return items};function filterOutCompaniesArray(com_data){var aux=Report.getMenuElements(),active_companies=null,result=[];if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0){$.each(com_data,function(pos,name){if(active_companies.indexOf(name)>=0){result[result.length]=name}})}else{result=com_data}return result}function filterOutCompanies(com_data){var aux=Report.getMenuElements();var active_companies=null;if(aux&&typeof aux.filter_companies!==undefined){active_companies=aux.filter_companies}if(active_companies&&active_companies.length>0){var keys=Object.keys(com_data);var positions=[];$.each(com_data.name,function(pos,name){if(active_companies.indexOf(name)>=0){positions[positions.length]=pos}});var new_obj={};$.each(keys,function(id,k){new_obj[k]=[];$.each(positions,function(subid,pos){var l=new_obj[k].length;new_obj[k][l]=com_data[k][pos]})});com_data=new_obj}return com_data}this.setCompaniesData=function(companies,self){if(companies===null)companies=[];if(self===undefined)self=this;if(Array.isArray(companies)){self.companies=filterOutCompaniesArray(companies)}else if(typeof companies==="object"){self.companies=filterOutCompanies(companies)}};this.companies_metrics_data={};this.addCompanyMetricsData=function(company,data,self){if(self===undefined)self=this;self.companies_metrics_data[company]=nameSpaceMetrics(data,self)};this.getCompaniesMetricsData=function(){return this.companies_metrics_data};this.companies_global_data={};this.addCompanyGlobalData=function(company,data,self){if(self===undefined)self=this;self.companies_global_data[company]=nameSpaceMetrics(data,self)};this.getCompaniesGlobalData=function(){return this.companies_global_data};this.companies_top_data={};this.addCompanyTopData=function(company,data,self){if(self===undefined)self=this;if(self.companies_top_data[company]===undefined)self.companies_top_data[company]={};self.companies_top_data[company]=data};this.getCompaniesTopData=function(){return this.companies_top_data};this.setCompaniesTopData=function(data,self){if(self===undefined)self=this;self.companies_top_data=data};this.repos_data_file=this.data_dir+"/"+this.name+"-repos.json";this.getReposDataFile=function(){return this.repos_data_file};this.repos=null;this.getReposDataFull=function(){return this.repos};this.getReposData=function(){var items=this.repos;if(items instanceof Array===false){if(this.repos!==null){items=this.repos.name}}return items};this.setReposData=function(repos,self){if(self===undefined)self=this;self.repos=repos;if(self.getName()!=="its")return;repos_names=[];if(repos instanceof Array===true){self.repos={};self.repos.name=repos}var filtered_repos=[];for(var i=0;i=0){if(self.getName()==="mls"){var mls_name=MLS.displayMLSListName(value);data[mls_name]=self.getReposMetricsData()[value]}else{data[value]=self.getReposMetricsData()[value]}}})}else{data=this.getData()}if(convert){data=DataProcess.convert(data,convert,metric_ids);if(convert==="divide"){mlabel=this.getMetrics()[metric_ids[0]].name+"/";mlabel+=this.getMetrics()[metric_ids[1]].name;metric_ids=["divide"];this.getMetrics().divide={name:mlabel}}if(convert==="substract"){mlabel=this.getMetrics()[metric_ids[0]].name+"-";mlabel+=this.getMetrics()[metric_ids[1]].name;metric_ids=["substract"];this.getMetrics().substract={name:mlabel}}}Viz.displayMetricsEvol(this,metric_ids,data,div_target,config,repositories)};this.isPageDisplayed=function(visited,linked,total,displayed){var window=Math.floor((displayed-3)/2);var lowest_barrier=visited-window;var highest_barrier=visited+window;if(linked===1||linked===total||linked==visited){return true}else if(linked>=lowest_barrier&&linkedvisited){return true}else{return false}};this.displayItemsNav=function(div_nav,type,page_str,order_by){var page=parseInt(page_str,null);if(isNaN(page))page=1;var items=null;var title="";var total=0;var displayed_pages=5;if(type==="companies"){items=this.getCompaniesData();title="List of companies"}else if(type==="repos"){items=this.getReposData();if(order_by)items=DataProcess.sortGlobal(this,order_by,type)}else if(type==="countries"){items=this.getCountriesData()}else if(type==="domains"){items=this.getDomainsData()}else if(type==="projects"){items=this.getProjectsData()}else{return}total=items.length;var nav="";var psize=Report.getPageSize();if(page){nav+=""}if(Report.getPageSize()>10)$.each(items,function(id,item){var label=Report.cleanLabel(item);nav+=""+label+" "});$("#"+div_nav).append(nav)};this.displayCompaniesLinks=function(div_links,limit,sort_metric){var sorted_companies=DataProcess.sortGlobal(this,sort_metric,"companies");var links="";var i=0;$.each(sorted_companies,function(id,company){links+='| ";if(i++>=limit-1)return false});$("#"+div_links).append(links)};this.displayCompaniesList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("companies",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayReposList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("repos",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayCountriesList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("countries",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayDomainsList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("domains",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displayProjectsList=function(metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert){this.displaySubReportList("projects",metrics,div_id,config_metric,sort_metric,page,show_links,start,end,convert)};this.displaySubReportList=function(report,metrics,div_id,config_metric,sort_metric,page_str,show_links,start,end,convert){var page=parseInt(page_str,null);if(isNaN(page))page=1;var list="";var cont=(page-1)*Report.getPageSize()+1;var ds=this;var data=null,sorted=null;if(show_links===undefined)show_links=true;if(report==="companies"){data=this.getCompaniesMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="repos"){data=this.getReposMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="countries"){data=this.getCountriesMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="domains"){data=this.getDomainsMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else if(report==="projects"){data=this.getProjectsMetricsData();sorted=DataProcess.sortGlobal(this,sort_metric,report)}else return;sorted=DataProcess.paginate(sorted,page);list+='';list+="";$.each(metrics,function(id,metric){if(ds.getMetrics()[metric]){title=ds.getMetrics()[metric].name;list+=""}else{list+=""}});list+="";$.each(sorted,function(id,item){list+="";var width=Math.floor(10/metrics.length);$.each(metrics,function(id,metric){var mywidth=width;list+="";rows_html+="";rows_html+=""}return rows_html}function composeTopRowsThreads(threads_data,limit,threads_links){var rows_html="";for(var i=0;i";rows_html+="'}else{rows_html+=""}rows_html+="";rows_html+="";rows_html+=""}return rows_html}function composeTopRowsPeople(people_data,limit,people_links,var_names){var rows_html="";for(var j=0;j";rows_html+="";rows_html+=""}return rows_html}function composeTopTabs(periods,metric,data,ds_name){var tabs_html="";var first=true;tabs_html+='";return tabs_html}function composeTitle(metric,ds_name,tabs,desc_metrics,selected_period){var key=ds_name+"_"+metric;var desc="";var title="";if(key in desc_metrics){desc=desc_metrics[key].desc;desc=desc.toLowerCase()}if(selected_period===""){data_period_formatted="Complete history"}else if(selected_period==="last month"){data_period_formatted="Last 30 days"}else if(selected_period==="last year"){data_period_formatted="Last 365 days"}if(Utils.isReleasePage())data_period_formatted="Release history";if(tabs===true){title+="
    Top "+desc+"
    "}else{title+='
    '+data_period_formatted+"
    "}return title}String.prototype.capitalize=function(){return this.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()})};function displayTopMetric_new(div_id,data,metric,limit,desc_metrics,people_links,threads_links,selected_period){var tabs="";var tables="";var title="";var gen_tabs=true;var div=$("#"+div_id);var ds_name=div.attr("data-data-source");if(Report.getParameterByName("repository")!==undefined){people_links=false}periods=getSortedPeriods();if(selected_period!==undefined){gen_tabs=false}title+=composeTitle(metric,ds_name,gen_tabs,desc_metrics,selected_period);if(gen_tabs===true){tabs+=composeTopTabs(periods,metric,data,ds_name)}tables+='
    ';var var_names=getTopVarsFromMetric(metric,ds_name);if(gen_tabs===true){var first=true;var html="";for(var k=0;k';tables+='
    "+title+""+metric+"
    ";list+="#"+cont+" ";cont++;var addURL=null;if(Report.addDataDir())addURL=Report.addDataDir();if(show_links){var release_var="";if(Utils.isReleasePage())release_var="&release="+$.urlParam("release");if(report==="companies"){list+=""}else if(report==="repos"){list+=""}else if(report==="countries"){list+=""}else if(report==="domains"){list+=""}else if(report==="projects"){list+=""}}list+="";list+=Report.cleanLabel(item);list+="";if(show_links)list+="";list+="";list+="
    ";if(data.companies_2006)html+="Companies in 2006: "+data.companies_2006+"
    ";if(data.companies_2009)html+="Companies in 2009: "+data.companies_2009+"
    ";if(data.companies_2012)html+="Companies in 2012: "+data.companies_2012+"
    ";$("#"+divid).append(html)};this.getSummaryLabels=function(){};this.getLabelForRepository=function(){return"repository"};this.getLabelForRepositories=function(){return"repositories"};this.displaySummary=function(report,divid,item,ds){if(!item)item="";var html="
    "+ds.getTitle()+"
    ";var id_label=this.getSummaryLabels();var global_data=null;if(report==="companies")global_data=ds.getCompaniesGlobalData()[item];else if(report==="countries")global_data=ds.getCountriesGlobalData()[item];else if(report==="repositories")global_data=ds.getReposGlobalData()[item];else if(report==="domains")global_data=ds.getDomainsGlobalData()[item];else if(report==="projects")global_data=ds.getProjectsGlobalData()[item]; +else global_data=ds.getGlobalData();if(!global_data)return;html=HTMLComposer.repositorySummaryTable(ds,global_data,id_label);$("#"+divid).append(html)};this.displayReposSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total repositories: "+data[ds.getName()+"_repositories"]+"
    ";$("#"+divid).append(html)};this.displayCountriesSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total countries: "+data[ds.getName()+"_countries"]+"
    ";$("#"+divid).append(html)};this.displayDomainsSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total domains: "+data.domains+"
    ";$("#"+divid).append(html)};this.displayProjectsSummary=function(divid,ds){var html="";var data=ds.getGlobalData();html+="Total projects: "+data.projects+"
    ";$("#"+divid).append(html)};this.displayDemographics=function(divid,period){var data=this.getDemographicsData();Viz.displayDemographicsChart(divid,data,period)};this.displayTimeToAttention=function(div_id,column,labels,title){labels=true;title="Time to Attention "+column;var data=this.getTimeToAttentionData();if(data instanceof Array)return;Viz.displayTimeToAttention(div_id,data,column,labels,title)};this.displayTimeToFix=function(div_id,column,labels,title){labels=true;title="Time to Fix "+column;var data=this.getTimeToFixData();if(data instanceof Array)return;Viz.displayTimeToFix(div_id,this.getTimeToFixData(),column,labels,title)};this.displayMarkovTable=function(div_id,title){var data=this.getMarkovTableData();if(data===undefined){Report.log("No Markov data available");return}Viz.displayMarkovTable(div_id,data,title)};this.displayTop=function(div,all,show_metric,period,period_all,graph,limit,people_links,threads_links,repository){if(all===undefined)all=true;var titles=null;Viz.displayTop(div,this,all,show_metric,period,period_all,null,null,limit,people_links,threads_links,repository)};this.displayTopCompany=function(company,div,metric_id,period,titles){var data=this.getCompaniesTopData()[company];if(data===undefined)return;var metric=this.getMetrics()[metric_id];Viz.displayTopCompany(company,data,div,metric,period,titles)};this.displayTopGlobal=function(div,metric,period,titles){Viz.displayTopGlobal(div,this,metric,period,titles)};this.envisionEvo=function(div_id,history,relative,legend_show,summary_graph){config=Report.getVizConfig();var options=Viz.getEnvisionOptions(div_id,history,this.getName(),Report.getVizConfig()[this.getName()+"_hide"],summary_graph);options.legend_show=legend_show;if(relative)DataProcess.addRelativeValues(options.data,this.getMainMetric());new envision.templates.Envision_Report(options,[this])};this.displayEnvision=function(divid,relative,legend_show,summary_graph){var projects_full_data=Report.getProjectsDataSources();this.envisionEvo(divid,projects_full_data,relative,legend_show,summary_graph)}}if(Viz===undefined)var Viz={};(function(){var bitergiaColor="#ffa500";Viz.displayTop=displayTop;Viz.displayTopCompany=displayTopCompany;Viz.displayTopGlobal=displayTopGlobal;Viz.displayBasicChart=displayBasicChart;Viz.displayMetricCompanies=displayMetricCompanies;Viz.displayMetricSubReportStatic=displayMetricSubReportStatic;Viz.displayMetricsCompany=displayMetricsCompany;Viz.displayMetricsDomain=displayMetricsDomain;Viz.displayMetricsProject=displayMetricsProject;Viz.displayMetricsPeople=displayMetricsPeople;Viz.displayMetricsRepo=displayMetricsRepo;Viz.displayMetricRepos=displayMetricRepos;Viz.displayMetricsCountry=displayMetricsCountry;Viz.displayMetricDomains=displayMetricDomains;Viz.displayMetricProjects=displayMetricProjects;Viz.displayMetricsEvol=displayMetricsEvol;Viz.displayBubbles=displayBubbles;Viz.displayDemographicsChart=displayDemographicsChart;Viz.displayEnvisionAll=displayEnvisionAll;Viz.displayTimeToFix=displayTimeToFix;Viz.displayTimeToAttention=displayTimeToAttention;Viz.displayMetricSubReportLines=displayMetricSubReportLines;Viz.displayRadarActivity=displayRadarActivity;Viz.displayRadarCommunity=displayRadarCommunity;Viz.displayTreeMap=displayTreeMap;Viz.displayMarkovTable=displayMarkovTable;Viz.displayDataSourcesTable=displayDataSourcesTable;Viz.getEnvisionOptions=getEnvisionOptions;Viz.checkBasicConfig=checkBasicConfig;Viz.displayTimeZone=displayTimeZone;function findMetricDoer(history,metric_id){var doer="";$.each(Report.getAllMetrics(),function(name,metric){if(metric.action===metric_id){doer=metric.column;return false}});return doer}function displayMarkovTable(div_id,data,title){var html="

    "+title+"

    ";var table='';table+="";$.each(data,function(i,val){subdata=data[i];old_value="old_value";new_value="new_value";percent="f";number="issue";for(var k=0;k";table+="";table+=""}});table+="
    TransitionNumberPercent
    "+i+" -> "+value_new+""+value_num+""+value_p+"
    ";html+=table;div=$("#"+div_id);div.append(html);return}function translate(labels,l){if(labels.hasOwnProperty(l)){return labels[l]}else{return l}}function getTopVarsFromMetric(metric,ds_name){var var_names={};var_names.id="id";if(metric==="senders"&&(ds_name==="mls"||ds_name==="irc")){var_names.name="senders";var_names.action="sent"}if(metric==="authors"&&ds_name==="scm"){var_names.name="authors";var_names.action="commits"}if(metric==="closers"&&(ds_name==="its"||ds_name==="its_1")){var_names.name="closers";var_names.action="closed"}if(ds_name==="scr"){if(metric==="mergers"){var_names.name="mergers";var_names.action="merged"}if(metric==="openers"){var_names.name="openers";var_names.action="opened"}if(metric==="reviewers"){var_names.name="reviewers";var_names.action="reviews"}if(metric==="active_core_reviewers"){var_names.name="identifier";var_names.action="reviews"}if(metric==="participants"){var_names.name="identifier";var_names.action="events"}}if(ds_name==="downloads"){if(metric==="ips"){var_names.name="ips";var_names.action="downloads"}if(metric==="packages"){var_names.name="packages";var_names.action="downloads"}}if(ds_name==="mediawiki"){if(metric==="authors"){var_names.name="authors";var_names.action="reviews"}}if(ds_name==="qaforums"){if(metric==="senders"||metric==="asenders"||metric==="qsenders"){var_names.name="senders";var_names.action="sent"}else if(metric==="participants"){var_names.name="name";var_names.action="messages_sent"}}if(ds_name==="releases"){if(metric==="authors"){var_names.name="username";var_names.action="releases"}}return var_names}function getSortedPeriods(){return["last month","last year",""]}function composeTopRowsDownloads(dl_data,limit,var_names){var rows_html="";for(var j=0;j
    "+(j+1)+"";rows_html+=dl_data[var_names.name][j];rows_html+=""+metric_value+"
    #"+(i+1)+"";if(threads_links===true){var url="http://www.google.com/search?output=search&q=X&btnI=1";if(Report.getThreadsSite()!==undefined){url="http://www.google.com/search?output=search&q=X%20site%3AY&btnI=1";url=url.replace(/Y/g,Report.getThreadsSite())}else if(threads_data.hasOwnProperty("url")&&threads_data.url[i].length>0){url="http://www.google.com/search?output=search&q=X%20site%3AY&btnI=1";url=url.replace(/Y/g,threads_data.url[i])}url=url.replace(/X/g,threads_data.subject[i]);rows_html+="";rows_html+='';rows_html+=threads_data.subject[i]+"";rows_html+=' "+threads_data.subject[i]+""+threads_data.initiator_name[i]+""+threads_data.length[i]+"
    "+(j+1)+"";if(people_links){rows_html+='"}else{rows_html+=DataProcess.hideEmail(people_data[var_names.name][j])}rows_html+=""+metric_value+"
    ';if(metric==="threads"){tables+=composeTopRowsThreads(data[key],limit,threads_links)}else if(metric==="packages"||metric==="ips"){unit=desc_metrics[ds_name+"_"+metric].action;metric_name=desc_metrics[ds_name+"_"+metric].name;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsDownloads(data[key],limit,var_names)}else{unit=desc_metrics[ds_name+"_"+metric].action;metric_name=desc_metrics[ds_name+"_"+metric].name;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data[key],limit,people_links,var_names);tables+=""}tables+="
    #"+metric_name.capitalize()+""+unit.capitalize()+"
    #"+metric_name.capitalize()+""+unit.capitalize()+"
    ";tables+="
    "}}}else{tables+='';if(metric==="threads"){tables+=composeTopRowsThreads(data,limit,threads_links)}else if(metric==="packages"||metric==="ips"){unit=desc_metrics[ds_name+"_"+metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsDownloads(data,limit,var_names)}else{unit=desc_metrics[ds_name+"_"+metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data,limit,people_links,var_names);tables+=""}tables+="
    #"+metric.capitalize()+""+unit.capitalize()+"
    #"+metric.capitalize()+""+unit.capitalize()+"
    "}tables+="
    ";if(gen_tabs===false){div.append(title)}div.append(tabs);div.append(tables);if(gen_tabs===true){script="";div.append(script)}}function displayTopMetric(div_id,metric,metric_period,history,graph,titles,limit,people_links){var top_metric_id=metric.name;if(!history||$.isEmptyObject(history))return;var metric_id=metric.action;if(limit&&history[metric_id].length
    "}new_div+=table;div=$("#"+div_id);div.append(new_div);if(graph){var labels=history[doer];var data=history[metric_id];if(limit){labels=[];data=[];for(var i=0;i';html+="Data SourceFrom";html+="To (Updated on)";$.each(dsources,function(key,ds){if(ds.getName()==="people")return;var gdata=ds.getGlobalData();var ds_name=ds.getTitle();if(ds_name===undefined){ds_name="-"}var last_date=gdata.last_date;if(last_date===undefined){return}var first_date=gdata.first_date;if(first_date===undefined){first_date="-"}var type=gdata.type;html+=""+ds_name;if(type!==undefined){type=type.toLowerCase();type=type.charAt(0).toUpperCase()+type.slice(1);html+=" ("+type+")"}html+="";html+=""+first_date+"";html+=""+last_date+""});html+="";$(div).append(html)}function showHelp(div_id,metrics,custom_help){var all_metrics=Report.getAllMetrics();var help='"+value.name+": "+value.desc+"
    ";return false}};for(var i=0;iDescription: "+custom_help}help+='data-content="'+content+'" data-html="true">';help+='
    ';var old_help=$("#"+div_id).prev()[0];if(old_help&&old_help.className==="help")$("#"+div_id).prev().empty();$("#"+div_id).before(help)}function displayMetricsLines(div_id,metrics,history,title,config){if(!(config&&config.help===false))showHelp(div_id,metrics,config.custom_help);var lines_data=[];if(config.remove_last_point)history=DataProcess.revomeLastPoint(history);if(config.frame_time)history=DataProcess.frameTime(history,metrics);if(config.start_time)history=DataProcess.filterDates(config.start_time,config.end_time,history);$.each(metrics,function(id,metric){if(!history[metric])return;var mdata=[];$.each(history[metric],function(i,value){mdata[i]=[history.id[i],history[metric][i]]});var label=metric;if(Report.getAllMetrics()[metric])label=Report.getAllMetrics()[metric].name;lines_data.push({label:label,data:mdata})});displayDSLines(div_id,history,lines_data,title,config)}function displayMetricsLinesRepos(div_id,metrics,history,title,config,repositories){if(!(config&&config.help===false))showHelp(div_id,metrics,config.custom_help);var lines_data=[];var metric=metrics[0];var aux={};$.each(history,function(item,data){if(data===undefined)return false;if(data[metric]===undefined)return false;if(config.remove_last_point)data=DataProcess.revomeLastPoint(data);if(config.frame_time)data=DataProcess.frameTime(data,[metric]);if(config.start_time)data=DataProcess.filterDates(config.start_time,config.end_time,data);var mdata=[[],[]];$.each(data[metric],function(i,value){mdata[i]=[data.id[i],data[metric][i]]});lines_data.push({label:item,data:mdata});aux=data});displayDSLines(div_id,aux,lines_data,title,config)}function displayMetricSubReportLines(div_id,metric,items,title,config,start,end,convert,order){var lines_data=[];var history={};$.each(items,function(item,data){if(data===undefined)return false;if(data[metric]===undefined)return false;if(convert)data=DataProcess.convert(data,convert,metric);if(start)data=DataProcess.filterDates(start,end,data);if(config.frame_time)data=DataProcess.frameTime(data,[metric]);var cdata=[[],[]];for(var i=0;i1){if(lines_data[i].label!==undefined)company_name=lines_data[i].label;label+=lines_data[i].label+":"}label+=""+Report.formatValue(value)+"";if(company_name)label+="("+companies[company_name].pending[o.index]+")";label+="
    "}return label};function getConfLinesChart(title,legend_div,history,lines_data,mouse_tracker_fn){var config={subtitle:title,legend:{show:true,container:legend_div},xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",margin:true},yaxis:{min:null,noTicks:2,autoscale:true},grid:{verticalLines:false,color:"#000000",outlineWidth:1,outline:"s"},mouse:{container:legend_div,track:true,trackY:false,relative:true,position:"ne",trackFormatter:function(o){var label=history.date[parseInt(o.index,10)];if(label===undefined)label="";else label+="
    ";for(var i=0;i1){if(lines_data[i].label!==undefined){value_name=abbreviateLabel(lines_data[i].label);label+=value_name+":"}}label+=""+Report.formatValue(value)+"
    "}return label}},selection:{mode:"x",fps:10},shadowSize:4};if(mouse_tracker_fn){Viz._history=history;Viz._lines_data=lines_data;config.mouse.trackFormatter=Viz[mouse_tracker_fn]}return config}function dropLastLineValue(history,lines_data){if(lines_data.length===0)return lines_data;if(lines_data.length>1){for(var j=0;jb[1]||b[1]===undefined?1:-1});return bi_array}function getMax(multiple_array,from_unixstamp,to_unixstamp){from_unixstamp=Math.round(from_unixstamp);to_unixstamp=Math.round(to_unixstamp);var narrays=multiple_array.length;var aux_array=[];for(var i=0;i0;z--){var aux_value=multiple_array[i].data[z][0];var cond=aux_valueto_unixstamp;if(cond){multiple_array[i].data.splice(z,1)}}}var res=[];for(i=0;i=18){var l=string.length;return".."+string.slice(string.length-16)}else{return string}}function displayDSLinesStacked(div_id,history,lines_data,title,config_metric){var container=document.getElementById(div_id);var legend_div=null;if(config_metric&&config_metric.legend&&config_metric.legend.container)legend_div=$("#"+config_metric.legend.container);var config={subtitle:title,legend:{show:true,container:legend_div},xaxis:{minorTickFreq:4,tickFormatter:function(x){var index=null;for(var i=0;i1){if(lines_data[i].label!==undefined)label+=abbreviateLabel(lines_data[i].label)+":"}label+=Report.formatValue(value)+"
    "}return label}}};if(config_metric){if(!config_metric.show_title)config.title="";if("show_legend"in config_metric){if(config_metric.show_legend===true)config.legend.show=true;else config.legend.show=false}if(config_metric.lines&&config_metric.lines.stacked)config.lines={stacked:true,fill:true,fillOpacity:1,fillBorder:true,lineWidth:.01};if(!config_metric.show_labels){config.xaxis.showLabels=false;config.yaxis.showLabels=false}if(config_metric.show_grid===false){config.grid.verticalLines=false;config.grid.horizontalLines=false;config.grid.outlineWidth=0}if(config_metric.show_mouse===false){config.mouse.track=false}if(config_metric.graph==="bars"){config.bars={show:true}}if(config_metric.light_style===true){config.grid.color="#ccc";config.legend.show=false}if(config_metric.custom_title){config.subtitle=config_metric.custom_title}}var showLastPoint=false;if(config_metric.graph!=="bars"&&lines_data.length===1&&lines_data[0].data[0][0]===0){showLastPoint=true}if(showLastPoint){lines_data=lastLineValueToPoint(history,lines_data);var next_id=history.id[history.id.length-1]+1;lines_data[0].data.push([next_id,undefined]);lines_data[1].data.push([next_id,undefined]);history.date.push("");history.id.push(next_id)}graph=Flotr.draw(container,lines_data,config);if(showLastPoint){if(history.date)history.date.pop();if(history.id)history.id.pop()}}function guessBarWidth(lines_data,history){var gap_size;var data_sets=lines_data.length;gap_size=parseInt(history.unixtime[1],10)-parseInt(history.unixtime[0],10);return gap_size/(data_sets+1)}function timeToUnixTime(lines_data,history,bars_flag,bar_width){var number_lines=lines_data.length;var data_length=lines_data[0].data.length;for(var z=0;z1)config.legend.show=true;lines_data=timeToUnixTime(lines_data,history,bars_flag,bar_width);var showLastPoint=false;if(Utils.isReleasePage()===false){if(config_metric.graph!=="bars"&&lines_data.length===1){showLastPoint=true}if(showLastPoint){lines_data=lastLineValueToPoint(history,lines_data);addEmptyValue(lines_data)}else if(!showLastPoint&&lines_data.length>1){dropLastLineValue(history,lines_data)}}function drawGraph(opts){var o=Flotr._.extend(Flotr._.clone(config),opts||{});return Flotr.draw(container,lines_data,o)}graph=drawGraph();Flotr.EventAdapter.observe(container,"flotr:select",function(area){var zoom_options={xaxis:{minorTickFreq:4,mode:"time",timeUnit:"second",timeFormat:"%b %y",min:area.x1,max:area.x2},yaxis:{min:area.y1,autoscale:true},grid:{verticalLines:true,color:"#000000",outlineWidth:1,outline:"s"}};zoom_options.subtitle=composeRangeText(config.subtitle,area.xfirst,area.xsecond);var new_lines_data_object=JSON.parse(JSON.stringify(lines_data));var max_value=getMax(new_lines_data_object,area.x1,area.x2);zoom_options.yaxis.max=max_value+max_value*.2;graph=drawGraph(zoom_options)});Flotr.EventAdapter.observe(container,"flotr:click",function(){drawGraph()});$(window).resize(function(){drawGraph()})}function displayTimeZone(divid,labels,data,metric_name){var pretty_mname=metric_name.charAt(0).toUpperCase()+metric_name.slice(1);var title=pretty_mname+" by Time Zone";var container=document.getElementById(divid);var chart_data=[],i;var legend_div=null;for(i=0;i0)label+="+"+value;else label+=value;return label},color:"#000000",tickDecimals:0},yaxis:{showLabels:true,min:0,noTicks:2,color:"#000000"},mouse:{track:true,trackY:false,relative:true,position:"n",trackDecimals:0,trackFormatter:function(tuple){var label="UTC ";if(tuple.x>0)label+="+"+tuple.x;else label+=tuple.x;pretty_name=metric_name.charAt(0).toUpperCase()+metric_name.slice(1);label+="
    "+pretty_name+": "+tuple.y+"";return label}},legend:{show:false},bars:{show:true,color:"#008080",fillColor:"#008080",fillOpacity:.6}};graph=Flotr.draw(container,chart_data,config);$(window).resize(function(){graph=Flotr.draw(container,chart_data,config)})}function displayBasicChart(divid,labels,data,graph,title,config_metric,rotate,fixColor,yformatter){var horizontal=false;if(rotate)horizontal=true;var container=document.getElementById(divid);var legend_div=null;if(config_metric&&config_metric.legend&&config_metric.legend.container)legend_div=$("#"+config_metric.legend.container);var chart_data=[],i;var label="";if(!horizontal){for(i=0;ilseries)lseries=data[1].length;var horizontal=false;if(rotate)horizontal=true;var container=document.getElementById(divid);var legend_div=null;if(config_metric&&config_metric.legend&&config_metric.legend.container)legend_div=$("#"+config_metric.legend.container);var serie1=[],i,serie2=[],data_viz=[];for(i=0;ii)val1=data[0][i];else val1=undefined;if(data[1].length>i)val2=data[1][i];else val2=undefined;if(!horizontal){serie1.push([i-bar_width/2,val1]);serie2.push([i+bar_width/2,val2]) +}else{serie1.push([val1,i-bar_width/2]);serie2.push([val2,i+bar_width/2])}}data_viz=[{data:serie1,label:labels[0]},{data:serie2,label:labels[1]}];var config={title:title,bars:{show:true,horizontal:horizontal,barWidth:bar_width},grid:{verticalLines:false,horizontalLines:false,outlineWidth:0},xaxis:{showLabels:false,min:0},yaxis:{showLabels:true,min:0},mouse:{container:legend_div,track:true,trackFormatter:function(o){var index;var i="x";if(horizontal)i="y";var point=parseFloat(o[i],1);var point_down=Math.round((point-.2)*10)/10;var point_up=Math.round((point+.2)*10)/10;if(point_down===parseInt(point,10))index=point_down;else index=point_up;var years=index;if(period_year)years=index*period_year;var label=years+" years: ";var val1,val2;if(serie1[index]===undefined)val1=0;else val1=parseInt(serie1[index][0],10);if(isNaN(val1))val1=0;if(serie2[index]===undefined)val2=0;else val2=parseInt(serie2[index][0],10);if(isNaN(val2))val2=0;label+=val1+" "+labels[0];label+=" , ";label+=val2+" "+labels[1];label+=" ("+parseInt(val1/val2*100,10)+"% )";return label}},legend:{show:true,position:"ne",backgroundColor:"#D2E8FF",container:legend_div}};if(config_metric){if(!config_metric.show_title)config.title="";if(config_metric.show_legend)config.legend.show=true}if(config_metric&&config_metric.show_legend!==false)config.legend={show:true,position:"ne",container:legend_div};config.grid.horizontalLines=true;config.yaxis={showLabels:true,min:0};if(yformatter){config.yaxis={showLabels:true,min:0,tickFormatter:yformatter}}if(config_metric&&config_metric.xaxis)config.xaxis={showLabels:config_metric.xaxis,min:0};graph=Flotr.draw(container,data_viz,config)}function displayBubbles(divid,metric1,metric2,radius){var container=document.getElementById(divid);var DS=Report.getMetricDS(metric1)[0];var DS1=Report.getMetricDS(metric2)[0];var bdata=[];if(DS!=DS1){Report.log("Metrics for bubbles have different data sources");return}var full_data=[];var projects=[];$.each(Report.getDataSources(),function(index,ds){if(ds.getName()===DS.getName()){full_data.push(ds.getData());projects.push(ds.getProject())}});var dates=[[],[]];dates=[full_data[0].id,full_data[0].date];for(var i=0;imax){max=value;max=parseInt(max*(1+border),10)}}}(function(){var x=[data,ticks]})();graph=Flotr.draw(container,data,{radar:{show:true},mouse:{track:true,trackFormatter:function(o){var value="";for(var i=0;i"}return value}},grid:{circular:true,minorHorizontalLines:true},yaxis:{min:0,max:max,minorTickFreq:1},xaxis:{ticks:ticks}})}function displayRadar(div_id,metrics){var data=[],ticks=[];var radar_data=[];var projects=[];var i=0,j=0;for(i=0;i";for(var metric in basic_metrics){if(history[metric]===undefined)continue;value+=history[metric][index]+" "+metric+" , "}return value};return options};function getEnvisionOptions(div_id,projects_data,ds_name,hide,summary_graph){var basic_metrics=null,main_metric="",summary_data=[[],[]];if(ds_name){$.each(Report.getDataSources(),function(i,DS){if(DS.getName()===ds_name){basic_metrics=DS.getMetrics();return false}})}else basic_metrics=Report.getAllMetrics();$.each(Report.getDataSources(),function(i,DS){main_metric=DS.getMainMetric();if(ds_name===null&&DS.getName()==="scm"||ds_name&&DS.getName()==ds_name){summary_data=[DS.getData().id,DS.getData()[main_metric]];if(summary_graph===false)summary_data=[DS.getData().id,[]];return false}});var dates=[[],[]];$.each(projects_data,function(project,data){$.each(data,function(index,DS){if(ds_name&&ds_name!==DS.getName())return;dates=DataProcess.fillDates(dates,[DS.getData().id,DS.getData().date])})});var firstMonth=dates[0][0],container=document.getElementById(div_id),options;var markers=Report.getMarkers();options={container:container,xTickFormatter:function(index){var label=dates[1][index-firstMonth];if(label==="0")label="";return label},yTickFormatter:function(n){return n+""},selection:{data:{x:{min:dates[0][0],max:dates[0][dates[0].length-1]}}}};options.data={summary:DataProcess.fillHistory(dates[0],summary_data),markers:markers,dates:dates[1],envision_hide:hide,main_metric:main_metric};var project=null;var buildProjectInfo=function(index,ds){var data=ds.getData();if(data[metric]===undefined)return;if(options.data[metric]===undefined)options.data[metric]=[];var full_data=DataProcess.fillHistory(dates[0],[data.id,data[metric]]);if(metric===main_metric){options.data[metric].push({label:project,data:full_data});if(data[metric+"_relative"]===undefined)return;if(options.data[metric+"_relative"]===undefined)options.data[metric+"_relative"]=[];full_data=DataProcess.fillHistory(dates[0],[data.id,data[metric+"_relative"]]);options.data[metric+"_relative"].push({label:project,data:full_data})}else{options.data[metric].push({label:project,data:full_data})}};var buildProjectsInfo=function(name,pdata){project=name;$.each(pdata,buildProjectInfo)};for(var metric in basic_metrics){$.each(projects_data,buildProjectsInfo)}options.trackFormatter=function(o){var sdata=o.series.data,index=sdata[o.index][0]-firstMonth;var project_metrics={};var projects=Report.getProjectsList();for(var j=0;j";for(var metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;for(j=0;j"+dates[1][index]+"";value+="";if(projects.length>1)value+="";for(metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;value+=""+basic_metrics[metric].name+""}value+="";$.each(project_metrics,function(project,metrics){var row="";for(var metric in basic_metrics){if(options.data[metric]===undefined)continue;if($.inArray(metric,options.data.envision_hide)>-1)continue;mvalue=project_metrics[project][metric];if(mvalue===undefined)mvalue="n/a";row+=""+mvalue+""}if(projects.length>1)row=""+project+""+row;row+="";value+=row});value+="";return value};return options}function checkBasicConfig(config){if(config===undefined)config={};if(config.show_desc===undefined)config.show_desc=true;if(config.show_title===undefined)config.show_title=true;if(config.show_labels===undefined)config.show_labels=true;return config}function getMetricFriendlyName(ds,metrics){var desc_metrics=ds.getMetrics();var title="";for(var i=0;i1){list_name=list_name_tokens[list_name_tokens.length-1];if(list_name==="")list_name=list_name_tokens[list_name_tokens.length-2]}else{list_name=listinfo.replace("<","");list_name=list_name.replace(">","");list_name_tokens=list_name.split(".");list_name=list_name_tokens[0]}return list_name};function getUserLists(){var form=document.getElementById("form_mls_selector");var lists=[];for(var i=0;i-1)continue;file_messages=this.getDataDir()+"/mls-";file_messages+=l;file_messages+="-evolutionary.json";displayBasicList(div_id,l,file_messages,config_metric)}};this.getTitle=function(){return"Mailing Lists"};function displayBasicList(div_id,l,mls_file,config_metric){var config=Viz.checkBasicConfig(config_metric);for(var id in basic_metrics){var metric=basic_metrics[id];var title="";if(config.show_title)title=metric.name;if($.inArray(metric.column,Report.getConfig().mls_hide)>-1)continue;var new_div="
    ";new_div+="

    "+metric.name+" "+MLS.displayMLSListName(l)+"

    ";new_div+="
    ";if(config.show_desc)new_div+="

    "+metric.desc+"

    ";new_div+="
    ";$("#"+div_id).append(new_div);Viz.displayBasicLinesFile(metric.divid+"_"+l,mls_file,metric.column,config.show_labels,title)}}function getReportId(){var project_data=Report.getProjectData();return project_data.date+"_"+project_data.project_name}function getMLSId(){return getReportId()+"_mls_lists"}this.displayEvoListsMain=function(id){if(localStorage){if(localStorage.length&&localStorage.getItem(getMLSId())){lists=JSON.parse(localStorage.getItem(getMLSId()));return this.displayEvoLists(id,lists)}}history=this.getListsData();lists=history.mailing_list;if(lists===undefined)return;var config=Report.getConfig();lists_hide=config.mls_hide_lists;if(typeof lists==="string"){lists=[lists]}var filtered_lists=[];for(var i=0;i-1)form.elements[i].checked=true;else form.elements[i].checked=false}}};this.displayBasicDefault=function(div_id){var obj=self;if(this instanceof MLS)obj=this;cleanLocalStorage();obj.displaySelectorCheckDefault();$("#"+div_id).empty();obj.displayBasic(div_id)};this.displayEvoDefault=function(div_id){var obj=self;if(this instanceof MLS)obj=this;cleanLocalStorage();if(document.getElementById("form_mls_selector"))obj.displaySelectorCheckDefault();$("#"+div_id).empty();obj.displayEvoLists(div_id,obj.getDefaultLists())};this.displayEvoUserAll=function(id,all){var form=document.getElementById("form_mls_selector");for(var i=0;i-1)html+="checked ";html+=">";html+=MLS.displayMLSListName(l);html+="
    "}html+='1){$("#"+div_id_sel).append("Not supported in multiproject");$("#"+div_id_sel+" :input").attr("disabled",true)}};function filterHistory(history){if(typeof history.id==="number"){$.each(history,function(key,value){value=[value]})}return history}this.displayEvoLists=function(id,lists){for(var i=0;i1){list_name=list_name_tokens[list_name_tokens.length-1];if(list_name==="")list_name=list_name_tokens[list_name_tokens.length-2]}else{list_name=listinfo.replace("<","");list_name=list_name.replace(">","");list_name_tokens=list_name.split(".");list_name=list_name_tokens[0]}return list_name};this.getTitle=function(){return"Source Code Review"}}SCR.prototype=new DataSource("scr");function People(){this.basic_metrics={people_members:{column:"members",name:"Members",desc:"Community Members"}};this.getMainMetric=function(){return"people_members"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .mediawiki_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().mediawiki_url}if(this.global_data.type)$(div_id+" #mediawiki_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #mediawiki_url").attr("href",url);$(div_id+" #mediawiki_name").text("MediaWiki "+this.global_data.type)}else{$(div_id+" #mediawiki_url").attr("href",Report.getProjectData().mediawiki_url);$(div_id+" #mediawiki_name").text(Report.getProjectData().mediawiki_name);$(div_id+" #mediawiki_type").text(Report.getProjectData().mediawiki_type)}var data=this.getGlobalData();$(div_id+" #mediawikiFirst").text(data.first_date);$(div_id+" #mediawikiLast").text(data.last_date);$(div_id+" #mediawikiSent").text(data.mediawiki_reviews)};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"mediawiki_reviews","mediawiki_authors",radius)};this.getTitle=function(){return"Community Members"}}People.prototype=new DataSource("people");function Downloads(){var self=this;this.basic_metrics={downloads_downloads:{name:"Total downloads",column:"downloads"},downloads_packages:{divid:"",column:"packages",name:"Packages downloaded",desc:"",action:"downloads"},downloads_ips:{divid:"",column:"ips",name:"IP addresses",desc:"",action:"downloads"}};this.getMainMetric=function(){return"downloads_downloads"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"mediawiki_reviews","mediawiki_authors",radius)};this.getTitle=function(){return"Downloads"}}Downloads.prototype=new DataSource("downloads");function QAForums(){var self=this;this.basic_metrics={qaforums_sent:{name:"Messages posted",desc:"Number of messages posted to Q&A forums(s)",column:"sent"},qaforums_qsent:{name:"Questions posted",desc:"Number of questions posted to Q&A forums(s)",column:"qsent"},qaforums_asent:{name:"Answers posted",desc:"Number of answers posted to Q&A forums(s)",column:"asent"},qaforums_unanswered:{name:"Unanswered questions",desc:"Backlog of unanswered questions",column:"unanswered"},qaforums_senders:{name:"Persons posting messages",desc:"Number of persons posting messages to Q&A forums(s)",column:"senders"},qaforums_asenders:{name:"Persons posting answers",desc:"Number of persons answering in Q&A forums(s)",column:"asenders"},qaforums_qsenders:{divid:"qaforums_qsenders",name:"Persons posting questions",desc:"Number of persons asking questions in Q&A forums(s)",column:"qsenders"},qaforums_participants:{name:"Participants",desc:"Number of persons posting messages",column:"participants"}};this.getMainMetric=function(){return"qaforums_qsent"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"qaforums_quetions","qaforums_authors",radius)};this.getSummaryLabels=function(){var id_label={first_date:"Start",last_date:"End",sent:"Messages posted",qsent:"Questions posted",asent:"Answers posted",qunanswered:"Unanswered questions",senders:"Persons posting messages",asenders:"Persons posting answers",qsenders:"Persons posting questions"};return id_label};this.getTitle=function(){return"QAForums"}}QAForums.prototype=new DataSource("qaforums");function Releases(){var self=this;this.basic_metrics={releases_modules:{name:"Modules created",desc:"Number of modules created on the forge",column:"modules"},releases_authors:{name:"Module authors",desc:"Module authors",column:"authors"},releases_releases:{name:"Number of module releases",desc:"Number of module releases",column:"releases"}};this.getMainMetric=function(){return"releases_modules"};this.displayData=function(divid){var div_id="#"+divid;var str=this.global_data.url;if(!str||str.length===0){$(div_id+" .irc_info").hide();return}var url="";if(this.global_data.repositories===1){url=this.global_data.url}else{url=Report.getProjectData().irc_url}if(this.global_data.type)$(div_id+" #irc_type").text(this.global_data.type);if(this.global_data.url&&this.global_data.url!=="."&&this.global_data.type!==undefined){$(div_id+" #irc_url").attr("href",url);$(div_id+" #irc_name").text("IRC "+this.global_data.type)}else{$(div_id+" #irc_url").attr("href",Report.getProjectData().irc_url);$(div_id+" #irc_name").text(Report.getProjectData().irc_name);$(div_id+" #irc_type").text(Report.getProjectData().irc_type)}var data=this.getGlobalData();$(div_id+" #ircFirst").text(data.first_date);$(div_id+" #ircLast").text(data.last_date);$(div_id+" #ircSent").text(data.irc_sent);$(div_id+" #ircRepositories").text(data.irc_repositories);if(data.repositories===1)$(div_id+" #ircRepositories").hide()};this.displayBubbles=function(divid,radius){if(false)Viz.displayBubbles(divid,"releases_modules","releases_releases",radius)};this.getSummaryLabels=function(){var id_label={first_date:"Start",last_date:"End",modules:"Modules created",releases:"Module releases created",authors:"Persons creating/updating modules"};return id_label};this.getTitle=function(){return"Releases"}}Releases.prototype=new DataSource("releases");var Identity={};(function(){var unique_list="unique-sortable";function sortSelList(list_divid,list,name){var connect="";if(list_divid===unique_list)connect="";else connect=unique_list;$("#"+name).sortable({handle:".handle",connectWith:"#"+connect,start:function(e,info){info.item.siblings(".ui-selected").appendTo(info.item)},stop:function(e,info){if(info.item.parent()[0].id===unique_list)info.item.find(".handle").remove();info.item.parent().append(info.item.find("li"));info.item.parent().find("li").addClass("mjs-nestedSortable-leaf")}}).selectable().find("li").prepend("
    ")}Identity.showListNested=function(list_divid,ds){list="
      div",maxLevels:2,isTree:true,expandOnHover:700,startCollapsed:true});$(".disclose").on("click",function(){$(this).closest("li").toggleClass("mjs-nestedSortable-collapsed").toggleClass("mjs-nestedSortable-expanded")})};function showFilter(ds,filter_data){$("#"+ds.getName()+"filter").autocomplete({source:filter_data,select:function(event,ui){$("#"+ds.getName()+"filter").val("");$("#"+ds.getName()+"_people_"+ui.item.value).addClass("ui-selected");return false}})}Identity.showList=function(list_divid,ds){var list="";var people=ds.getPeopleData();var filter_data=[];list='
        ';for(var i=0;i");showFilter(ds,filter_data);$("#"+list_divid).append(list);sortSelList(list_divid,list,ds.getName()+"-sortable")}})();var Charts={};(function(){Charts.plotLinesChart=plotLinesChart;function plotLinesChart(div_id,line_names,raw_data){var flt_data=buildFlotrData(line_names,raw_data);var config=getChartConfig(flt_data,raw_data.strdate);if(raw_data.max){config.yaxis.max=raw_data.max}if(flt_data.length>1)config.legend.show=true;config.subtitle=composeTitle(line_names);flt_data=decorateLines(flt_data);plotFlotr2LinesChart(div_id,flt_data,config)}function buildFlotrData(line_names,raw_data){var aux=[];$.each(raw_data.lines_data,function(id,array){var line=[];$.each(array,function(subid,value){line[line.length]=[raw_data.unixtime[subid],value]});var aux2={};aux2.data=line;aux2.label=line_names[id];aux[aux.length]=aux2});return aux}function decorateLines(flotr2_data){if(Utils.isReleasePage()===false){if(flotr2_data.length===1){flotr2_data=lastLineValueToPoint(flotr2_data);flotr2_data=addEmptyValue(flotr2_data)}else if(flotr2_data.length>1){flotr2_data=dropLastLineValue(flotr2_data)}}return flotr2_data}function lastLineValueToPoint(flotr2_data){if(flotr2_data.length!==1)return flotr2_data;var last=flotr2_data[0].data.length;var dots=[];var utime=0;for(var i=0;i1){for(var j=0;j1){if(flotr2_data[i].label!==undefined){value_name=flotr2_data[i].label;label+=value_name+":"}}label+=""+Report.formatValue(value)+"
        "}return label}},selection:{mode:"x",fps:10},shadowSize:4};return config}function composeRangeText(former_title,starting_utime,end_utime){var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var date=new Date(parseInt(starting_utime,10)*1e3);var starting_date=months[date.getMonth()]+" "+date.getFullYear();date=new Date(parseInt(end_utime,10)*1e3);var end_date=months[date.getMonth()]+" "+date.getFullYear();return former_title+" ( "+starting_date+" - "+end_date+" )"}function getMax(flotr2_data,from_unixstamp,to_unixstamp){from_unixstamp=Math.round(from_unixstamp);to_unixstamp=Math.round(to_unixstamp);var narrays=flotr2_data.length;var aux_array=[];for(var i=0;i0;z--){var aux_value=flotr2_data[i][z][0];var cond=aux_valueto_unixstamp;if(cond){flotr2_data[i].splice(z,1)}}}var res=[];for(i=0;ib[1]||b[1]===undefined?1:-1});return bi_array}})();String.prototype.supplant=function(o){return this.replace(/{([^{}]*)}/g,function(a,b){var r=o[b];return typeof r==="string"||typeof r==="number"?r:a})};var Table={};(function(){Table.displayTopTable=displayTopTable;Table.simpleTable=displaySimpleTable;function displaySimpleTable(div,data,headers,cols){var tables,aux_html;tables='';aux_html="";$.each(headers,function(id,value){aux_html+=""});aux_html+="";aux_html+="";var first_col,aux_col;if(typeof data[cols[0]]!=="object"){aux_col=[];aux_col[0]=data[cols[0]];first_col=aux_col}else{first_col=data[cols[0]]}$.each(first_col,function(id,value){aux_html+="";var cont=id+1;aux_html+="";$.each(cols,function(subid,name){if(typeof data[name]!=="object"){aux_html+=""}else{aux_html+=""}});aux_html+=""});aux_html+="";tables+=aux_html;tables+="
        #"+value+"
        "+cont+""+data[name]+""+data[name][id]+"
        ";$("#"+div.id).append(tables)}function displayTopTable(div,data,opts){var first=true,gen_tabs=true,tabs="",tables="";if(opts.period!=="all"){gen_tabs=false +}else{tabs+=composeTopTabs(data,opts.metric,opts.class_name)}periods=getSortedPeriods();tables+='
        ';var var_names=getTopVarsFromMetric(opts.metric,opts.ds_name);for(var k=0;k';tables+='';unit=opts.desc_metrics[opts.ds_name+"_"+opts.metric].action;tables+="";if(unit!==undefined)tables+="";tables+="";tables+=composeTopRowsPeople(data[key],opts.limit,opts.links_enabled,var_names);tables+="";tables+="
        #"+opts.metric.capitalize()+""+unit.capitalize()+"
        ";tables+="
        "}}tables+="
    ";$("#"+div.id).append(tabs+tables)}function composeTopRowsPeople(people_data,limit,people_links,var_names){var rows_html="";for(var j=0;j"+(j+1)+"";rows_html+="";if(people_links){rows_html+='"}else{rows_html+=DataProcess.hideEmail(people_data[var_names.name][j])}rows_html+="";rows_html+=""+metric_value+""}return rows_html}function getSortedPeriods(){return["last month","last year",""]}function composeTopTabs(data,metric,class_name){var first=true,tabs_html='";return tabs_html}function getTopVarsFromMetric(metric,ds_name){var var_names={};var_names.id="id";if(metric==="senders"&&(ds_name==="mls"||ds_name==="irc")){var_names.name="senders";var_names.action="sent"}if(metric==="authors"&&ds_name==="scm"){var_names.name="authors";var_names.action="commits"}if(metric==="closers"&&ds_name==="its"){var_names.name="closers";var_names.action="closed"}if(ds_name==="scr"){if(metric==="mergers"){var_names.name="mergers";var_names.action="merged"}if(metric==="openers"){var_names.name="openers";var_names.action="opened"}if(metric==="reviewers"){var_names.name="reviewers";var_names.action="reviews"}}if(ds_name==="downloads"){if(metric==="ips"){var_names.name="ips";var_names.action="downloads"}if(metric==="packages"){var_names.name="packages";var_names.action="downloads"}}if(ds_name==="mediawiki"){if(metric==="authors"){var_names.name="authors";var_names.action="reviews"}}if(ds_name==="qaforums"){if(metric==="senders"||metric==="asenders"||metric==="qsenders"){var_names.name="senders";var_names.action="sent"}else if(metric==="participants"){var_names.name="name";var_names.action="messages_sent"}}if(ds_name==="releases"){if(metric==="authors"){var_names.name="username";var_names.action="releases"}}return var_names}})();var Demographics={};(function(){var data_dg={};Demographics.widget=function(){var divs=$(".DemographicsCompany"),ds_name,company_name,DS,period;if(divs.length>0){$.each(divs,function(id,div){ds_name="";ds_name=$(this).data("data-source");DS=Report.getDataSourceByName(ds_name);if(DS===null)return;if(DS.getData().length===0)return;period=$(this).data("period");company_name=Utils.getParameter("company");loadDemographicsData(div,ds_name,company_name,period,displayDemographics)})}};function loadDemographicsData(div,ds_name,company_name,period,cb){var suffix=ds_name.toLowerCase(),preffix,ag_file,b_file;preffix="data/json/"+company_name+"-"+suffix+"-com-demographics-";ag_file=preffix+"aging.json";b_file=preffix+"birth.json";$.when($.getJSON(ag_file),$.getJSON(b_file)).done(function(ag_data,b_data){data_dg[company_name]={};data_dg[company_name][ds_name]={aging:undefined,birth:undefined};data_dg[company_name][ds_name].aging=ag_data[0];data_dg[company_name][ds_name].birth=b_data[0];cb(div,ds_name,company_name,period)}).fail(function(){console.log("Demographics Company widget disabled. Missing "+ds_name+" files for company "+company_name)})}function displayDemographics(div,ds_name,company_name,period){if(!div.id)div.id="Parsed"+getRandomId();if(data_dg[company_name]!==undefined&&data_dg[company_name][ds_name]!==undefined){Viz.displayDemographicsChart(div.id,data_dg[company_name][ds_name],period)}}function getRandomId(){return Math.floor(Math.random()*1e3+1)}})();Loader.data_ready(function(){Demographics.widget()});vizjslib_git_revision="b9507b20f12b48b57539eafb44179d6d3242a2da";vizjslib_git_tag="15.02-53-gb9507b2"; \ No newline at end of file diff --git a/browser/people.html b/browser/people.html index 203ae205..4ebc2f08 100644 --- a/browser/people.html +++ b/browser/people.html @@ -48,6 +48,9 @@
    +
    +
    @@ -76,6 +79,7 @@ + diff --git a/browser/storyboard-companies.html b/browser/storyboard-companies.html new file mode 100644 index 00000000..177fe6a2 --- /dev/null +++ b/browser/storyboard-companies.html @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    +
    +
    +

    Some charts and tables for top companies in the project, and a summary of the evolution of their participation with links to more detailed information per company

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    + + +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    + +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + diff --git a/browser/storyboard-contributors.html b/browser/storyboard-contributors.html new file mode 100644 index 00000000..c3c6428c --- /dev/null +++ b/browser/storyboard-contributors.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + diff --git a/browser/storyboard.html b/browser/storyboard.html new file mode 100644 index 00000000..a6ff4f31 --- /dev/null +++ b/browser/storyboard.html @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    + + + +
    + +
    +
    +
    +

    Issue tracking system

    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + +
    + + + +
    people submitting ticketspeople closing tickets
    people submitting tickets last weekpeople closing tickets last week
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    + +
    + + + +
    + +
    +
    + + + + + + + + + + + + + + diff --git a/templates/common/overview.tmpl b/templates/common/overview.tmpl index 50160551..c2581fac 100644 --- a/templates/common/overview.tmpl +++ b/templates/common/overview.tmpl @@ -15,6 +15,11 @@ data-box-metrics="allhistory_participants,its_closers,its_openers" data-ts-metrics="its_closed,its_closers">
    +
    +
    +
    +
    diff --git a/templates/gen.sh b/templates/gen.sh index c6d6541c..af4dd0d4 100755 --- a/templates/gen.sh +++ b/templates/gen.sh @@ -18,18 +18,18 @@ cp common/navbar.tmpl ../browser/navbar.html # its python apply_template.py --template body.template --content its/overview.tmpl > ../browser/its.html -#python apply_template.py --template body.template --content its/companies.tmpl > ../browser/its-companies.html python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its-companies > ../browser/its-companies.html python apply_template.py --template body.template --content its/contributors.tmpl > ../browser/its-contributors.html -#python apply_template.py --template body.template --content its/countries.tmpl > ../browser/its-countries.html -#python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its-countries > ../browser/its-countries.html -#python apply_template.py --template body.template --content its/domains.tmpl > ../browser/its-domains.html -#python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its-domains > ../browser/its-domains.html -#python apply_template.py --template body.template --content its/projects.tmpl > ../browser/its-projects.html -#python apply_template.py --template body.template --content its/repos.tmpl > ../browser/its-repos.html python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its-repos > ../browser/its-repos.html python apply_template.py --template body.template --content its/states.tmpl > ../browser/its-states.html -#python apply_template.py --template body.template --content its/states-jira.tmpl > ../browser/its-states-jira.html + +# its_1 +python apply_template.py --template body.template --content storyboard/overview.tmpl > ../browser/storyboard.html +python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its_1-companies > ../browser/storyboard-companies.html +python apply_template.py --template body.template --content storyboard/contributors.tmpl > ../browser/storyboard-contributors.html +python build_panel.py --template body.template --content common/list-of-filters.tmpl --conf conf/main.conf --panel its_1-repos > ../browser/storyboard-repos.html +#python apply_template.py --template body.template --content storyboard/states.tmpl > ../browser/storyboard-states.html + # irc python apply_template.py --template body.template --content irc/overview.tmpl > ../browser/irc.html diff --git a/templates/storyboard/contributors.tmpl b/templates/storyboard/contributors.tmpl new file mode 100644 index 00000000..fb86c108 --- /dev/null +++ b/templates/storyboard/contributors.tmpl @@ -0,0 +1,24 @@ +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + diff --git a/templates/storyboard/overview.tmpl b/templates/storyboard/overview.tmpl new file mode 100644 index 00000000..d83317dc --- /dev/null +++ b/templates/storyboard/overview.tmpl @@ -0,0 +1,129 @@ + +
    + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + +
    + + + +
    + +
    +
    +
    +

    Issue tracking system

    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + +
    + + + +
    people submitting ticketspeople closing tickets
    people submitting tickets last weekpeople closing tickets last week
    +
    +
    +
    + + + + +
    +
    +
    + +
    +
    + +
    diff --git a/templates/storyboard/projects.tmpl b/templates/storyboard/projects.tmpl new file mode 100644 index 00000000..05ec2e92 --- /dev/null +++ b/templates/storyboard/projects.tmpl @@ -0,0 +1,69 @@ +
    +

    Information about all projects

    +
    + +
    +
    Some charts and tables for top projects in + the project, and a summary of the evolution of their participation with + links to more detailed information per project.
    +
    + + Active Projects per month + +
    +
    +
    + + + + + + + + + +
    +
    + +
    +
    + Submitted per project (aggregated) + +
    +
    + + +
    + + +
    + Senders per project (aggregated) + +
    +
    + +
    +
    +
    + + +
    + + +
    +
    +
    + + diff --git a/templates/storyboard/states-jira.tmpl b/templates/storyboard/states-jira.tmpl new file mode 100644 index 00000000..01525b2a --- /dev/null +++ b/templates/storyboard/states-jira.tmpl @@ -0,0 +1,107 @@ +
    +
    +
    +

    Evolution of States charts show the evolution of + the states in the analysis of the issue tracking system. +

    + +

    Each chart represents the number of issues in such state + in each period of time.

    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    Current Status charts show the current 'photo' of each of the states. +

    +

    For each of the states shown, it is specified when the issue was born.

    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    The most likely changes tables show the percentages of changes among states. +

    +
    +
    +
    +
    +
    + + diff --git a/templates/storyboard/states.tmpl b/templates/storyboard/states.tmpl new file mode 100644 index 00000000..77d67b74 --- /dev/null +++ b/templates/storyboard/states.tmpl @@ -0,0 +1,66 @@ +
    +
    +
    +

    Evolution of States charts show the evolution of + the states in the analysis of the issue tracking system. +

    + +

    Each chart represents the number of issues in such state + in each period of time.

    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Current Status charts show the current 'photo' of each of the states. +

    +

    For each of the states shown, it is specified when the issue was born.

    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +

    The most likely changes tables show the percentages of changes among states. +

    +
    +
    +
    +
    +
    + + +