forked from emeryberger/CSrankings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
csrankings.min.js
37 lines (37 loc) · 18.3 KB
/
csrankings.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+a++}}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.iteratorFromArray=function(a,b){$jscomp.initSymbolIterator();a instanceof String&&(a+="");var c=0,d={next:function(){if(c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d.next=function(){return{done:!0,value:void 0}};return d.next()}};d[Symbol.iterator]=function(){return d};return d};
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var f=a[d];f in c||(c[f]={});c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(a){return a})}},"es6","es3");
$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,f=0;f<d;f++){var g=a[f];if(b.call(c,g,f,a))return{i:f,v:g}}return{i:-1,v:void 0}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,c){return $jscomp.findInternal(this,a,c).v}},"es6","es3");
var CSRankings=function(){function a(){a.geoCheck();for(var b=0;b<a.areaMap.length;b++){var c=a.areaMap[b],d=c.area;c=c.title;a.areas[b]=d;a.areaNames[b]=c;a.fields[b]=d;a.areaDict[d]=a.areaNames[b];a.areaPosition[d]=b}b=0;for(c=a.aiAreas;b<c.length;b++)d=c[b],a.aiFields.push(a.areaPosition[d]);b=0;for(c=a.systemsAreas;b<c.length;b++)d=c[b],a.systemsFields.push(a.areaPosition[d]);b=0;for(c=a.theoryAreas;b<c.length;b++)d=c[b],a.theoryFields.push(a.areaPosition[d]);b=0;for(c=a.interdisciplinaryAreas;b<
c.length;b++)d=c[b],a.otherFields.push(a.areaPosition[d]);a.activateAll();(function(){a.loadAliases(a.aliases,function(){a.loadHomepages(a.homepages,function(){a.loadAuthorInfo(function(){a.loadCountryInfo(a.countryInfo,function(){a.loadScholarInfo(a.scholarInfo,a.rank)})})})})})();a.navigoRouter=new Navigo(null,!0);a.navigoRouter.on("/index",function(b,c){for(var d in a.areas)jQuery("input[name="+a.areas[d]+"]").prop("checked",!1);c.split("&").forEach(function(a){"none"!=a&&jQuery("input[name="+
a+"]").prop("checked",!0)})}).resolve()}a.translateNameToDBLP=function(a){a=a.replace(/'|\-|\./g,"=");a=a.replace(/\u00c1/g,"=Aacute=");a=a.replace(/\u00e1/g,"=aacute=");a=a.replace(/\u00e8/g,"=egrave=");a=a.replace(/\u00e9/g,"=eacute=");a=a.replace(/\u00ef/g,"=iuml=");a=a.replace(/\u00f3/g,"=oacute=");a=a.replace(/\u00e7/g,"=ccedil=");a=a.replace(/\u00e4/g,"=auml=");a=a.replace(/\u00f6/g,"=ouml=");a=a.replace(/\u00f8/g,"=oslash=");a=a.replace(/\u00d6/g,"=Ouml=");a=a.replace(/\u00fc/g,"=uuml=");a=
a.split(" ");var b=a[a.length-1];0<parseInt(b)&&(a.pop(),b=a[a.length-1]+"_"+b);a.pop();a=a.join(" ");a=a.replace(/\s/g,"_");a=a.replace(/\-/g,"=");return"http://dblp.uni-trier.de/pers/hd"+("/"+b[0].toLowerCase()+"/"+b+":"+a)};a.makePrologue=function(){return'<html><head><style type="text/css"> body { font-family: "Helvetica", "Arial"; } table td { vertical-align: top; }</style></head><body><div class="row"><div class="table" style="overflow:auto; height: 650px;"><table class="table-sm table-striped"id="ranking" valign="top">'};
a.compareNames=function(a,c){a=a.split(" ");c=c.split(" ");a=a[a.length-1];c=c[c.length-1];return a<c?-1:a>c?1:0};a.makeChart=function(b){console.assert(a.color.length>=a.areas.length,"Houston, we have a problem.");for(var c=[],d={},f=a.areas,g=unescape(b),e=0;e<f.length;e++){var h=f[e],k=a.authorAreas[g][h];k=Math.round(10*k)/10;0<k&&(h in d||(d[h]=0),d[h]+=k)}for(h in d)c.push({label:a.areaDict[h],value:Math.round(10*d[h])/10,color:a.color[a.areaPosition[h]]});new d3pie(b+"-chart",{header:{title:{text:g,
fontSize:24,font:"open sans"},subtitle:{text:"Publication Profile",color:"#999999",fontSize:14,font:"open sans"},titleSubtitlePadding:9},size:{canvasHeight:500,canvasWidth:500,pieInnerRadius:"38%",pieOuterRadius:"83%"},data:{content:c,smallSegmentGrouping:{enabled:!0,value:1}},labels:{outer:{pieDistance:32},inner:{format:"value",hideWhenLessThanPercentage:5},mainLabel:{fontSize:12},percentage:{color:"#ffffff",decimalPlaces:0},value:{color:"#ffffff",fontSize:10},lines:{enabled:!0},truncation:{enabled:!0}},
effects:{load:{effect:"none"},pullOutSegmentOnClick:{effect:"linear",speed:400,size:8}},misc:{gradient:{enabled:!0,percentage:100}}})};a.loadScholarInfo=function(b,c){Papa.parse(a.scholarFile,{header:!0,download:!0,complete:function(a){var d=0;for(a=a.data;d<a.length;d++){var g=a[d];b[g.name]=g.scholarid}setTimeout(c,0)}})};a.loadAliases=function(b,c){Papa.parse(a.aliasFile,{header:!0,download:!0,complete:function(a){var d=0;for(a=a.data;d<a.length;d++){var g=a[d];b[g.alias]=g.name}setTimeout(c,0)}})};
a.loadArticles=function(a){jQuery.getJSON("articles.json",function(b){setTimeout(a,0)})};a.loadCountryInfo=function(b,c){Papa.parse(a.countryinfoFile,{header:!0,download:!0,complete:function(a){var d=0;for(a=a.data;d<a.length;d++){var g=a[d];b[g.institution]=g.region}setTimeout(c,0)}})};a.loadAuthorInfo=function(b){var c=this;Papa.parse(a.authorinfoFile,{download:!0,header:!0,complete:function(d){c.authors=d.data;for(d=0;d<a.fields.length;d++)jQuery("input[name="+a.fields[d]+"]").click(function(){c.rank()});
setTimeout(b,0)}})};a.loadHomepages=function(b,c){Papa.parse(a.homepagesFile,{header:!0,download:!0,complete:function(a){var d=0;for(a=a.data;d<a.length;d++){var g=a[d];"undefined"!==typeof g.homepage&&(b[g.name.trim()]=g.homepage.trim())}setTimeout(c,0)}})};a.inRegion=function(b,c){switch(c){case "USA":if(b in a.countryInfo)return!1;break;case "europe":if(!(b in a.countryInfo)||"europe"!=a.countryInfo[b])return!1;break;case "canada":if(!(b in a.countryInfo)||"canada"!=a.countryInfo[b])return!1;break;
case "northamerica":if(b in a.countryInfo&&"canada"!=a.countryInfo[b])return!1;break;case "australasia":if(!(b in a.countryInfo)||"australasia"!=a.countryInfo[b])return!1;break;case "southamerica":if(!(b in a.countryInfo)||"southamerica"!=a.countryInfo[b])return!1;break;case "asia":if(!(b in a.countryInfo)||"asia"!=a.countryInfo[b])return!1}return!0};a.activateFields=function(b,c){for(var d=0;d<c.length;d++)jQuery("input[name="+a.fields[c[d]]+"]").prop("checked",b);a.rank();return!1};a.sortIndex=
function(a){var b=Object.keys(a);b.sort(function(b,c){return a[b]>a[c]?-1:a[c]>a[b]?1:b<c?-1:c<b?1:0});return b};a.countAuthorAreas=function(b,c,d,f){for(var g in b)if(b.hasOwnProperty(g)){var e=b[g],h=e.year;if(!(h<c||h>d)){h=e.area;var k=e.dept,q=parseFloat(e.count);e=e.name;e in a.aliases&&(e=a.aliases[e]);if(!(e in f)){f[e]={};for(var m in a.areaDict)a.areaDict.hasOwnProperty(m)&&(f[e][m]=0)}if(!(k in f))for(m in f[k]={},a.areaDict)a.areaDict.hasOwnProperty(m)&&(f[k][m]=0);f[e][h]+=q;f[k][h]+=
q}}};a.buildDepartments=function(b,c,d,f,g,e,h,k,q,m){var n={},l;for(l in b)if(b.hasOwnProperty(l)){var p=b[l],t=p.name,u=p.year,r=p.area;p=p.dept;t in a.aliases&&(t=a.aliases[t]);if("undefined"!==typeof p&&!(0===f[r]||u<c||u>d)&&a.inRegion(p,g)){r in a.parentMap&&(r=a.parentMap[r]);u=r+p;r=t+p;u in e||(e[u]=0);var w=parseInt(b[l].count),v=parseFloat(b[l].adjustedcount);e[u]+=v;t in n||(n[t]=!0,q[r]=0,m[r]=0,p in h||(h[p]=0,k[p]=[]),k[p].push(t),h[p]+=1);q[r]+=w;m[r]+=v}}};a.computeStats=function(b,
c,d,f,g,e){a.stats={};var h={},k;for(k in b)if(b.hasOwnProperty(k)){h[k]=g?1:0;for(var q=0,m=d;q<m.length;q++){var n=m[q];if(!(n in a.parentMap)){var l=n+k;l in c||(c[l]=0);0!=e[n]&&(h[k]=g?h[k]*(c[l]+1):h[k]+c[l])}}g&&(h[k]=Math.pow(h[k],1/f))}return h};a.updateWeights=function(b){for(var c=0,d=0;d<a.areas.length;d++){var f=a.areas[d];b[f]=jQuery("input[name="+a.fields[d]+"]").prop("checked")?1:0;1===b[f]&&c++}return c};a.canonicalizeNames=function(b,c,d){for(var f in b)if(b.hasOwnProperty(f))for(var g=
0;g<b[f].length;g++){var e=b[f][g];e in a.aliases&&(b[f][g]=a.aliases[e],a.aliases[e]+f in c?(c[a.aliases[e]+f]+=c[e+f],d[a.aliases[e]+f]+=d[e+f]):(c[a.aliases[e]+f]=c[e+f],d[a.aliases[e]+f]=d[e+f]))}};a.buildDropDown=function(b,c,d){var f={},g=function(e){if(!b.hasOwnProperty(e))return"continue";for(var g='<div class="row"><div class="table"><table class="table-striped" width="100%"><thead><th></th><td><small><em><abbr title="Click on an author\'s name to go to their home page.">Faculty</abbr></em></small></td><td align="right"><small><em> <abbr title="Total number of publications (click for DBLP entry).">Raw # Pubs</abbr></em></small></td><td align="right"><small><em><abbr title="Count divided by number of co-authors">Adjusted #</abbr></em></small></td></thead><tbody>',
h={},m=0,n=b[e];m<n.length;m++){var l=n[m];h[l]=c[l+e]}m=Object.keys(h);m.sort(function(b,c){if(h[c]===h[b]){var f=Math.round(10*d[c+e])/10,g=Math.round(10*d[b+e])/10;return f===g?a.compareNames(b,c):f-g}return h[c]-h[b]});for(n=0;n<m.length;n++){l=m[n];var p=encodeURI(a.homepages[l]),t=a.translateNameToDBLP(l);g+='<tr><td> </td><td><small><a title="Click for author\'s home page." target="_blank" href="'+p+'" onclick="trackOutboundLink(\''+p+"', true); return false;\">"+l+"</a> ";
a.scholarInfo.hasOwnProperty(l)&&(p="https://scholar.google.com/citations?user="+a.scholarInfo[l]+"&hl=en&oi=ao",g+='<a target="_blank" href="'+p+'" onclick="trackOutboundLink(\''+p+'\', true); return false;"><img src="https://scholar.google.com/favicon.ico" height="10" width="10"></a> ');g+="<span onclick=\"CSRankings.toggleChart('"+escape(l)+'\')" class="hovertip" ><font color="blue">'+a.PieChart+'</font></span></small></td><td align="right"><small><a title="Click for author\'s DBLP entry." target="_blank" href="'+
t+'" onclick="trackOutboundLink(\''+t+"', true); return false;\">"+h[l]+'</a></small></td><td align="right"><small>'+(Math.round(10*d[l+e])/10).toFixed(1)+'</small></td></tr><tr><td colspan="4"><div style="display:none;" id="'+escape(l)+'-chart"></div></td></tr>'}f[e]=g+"</tbody></table></div></div>"},e;for(e in b)g(e);return f};a.buildOutputString=function(b,c,d,f,g){var e=a.makePrologue(),h=parseInt(jQuery("#minToRank").find(":selected").val());e=(b?e+'<thead><tr><th align="left">Rank </th><th align="right">Institution </th><th align="right"><abbr title="Geometric mean count of papers published across all areas.">Avg. Count</abbr></th><th align="right"> <abbr title="Number of faculty who have published in these areas.">Faculty</abbr></th></th></tr></thead>':
e+'<thead><tr><th align="left">Rank </th><th align="right">Institution </th><th align="right">Adjusted Pub Count</th><th align="right"> Faculty</th></tr></thead>')+"<tbody>";if(0<c){b=1;c=0;for(var k=9999999.999,q=a.sortIndex(d),m=0;m<q.length;m++){var n=q[m],l=Math.round(10*d[n])/10;if(m>=h&&l!=k)break;if(0===l)break;k!=l&&(a.useDenseRankings?c+=1:(c+=b,b=0));k=escape(n);e+="\n<tr><td>"+c+"</td>";e+="<td><span onclick=\"CSRankings.toggleFaculty('"+n+'\')" class="hovertip" id="'+
n+'-widget"><font color="blue">'+a.RightTriangle+"</font></span> <span onclick=\"CSRankings.toggleFaculty('"+n+'\')" class="hovertip">'+n+"</span>";e+=' <font color="blue"><span onclick="CSRankings.toggleChart(\''+k+'\')" class="hovertip" id="'+k+'-widget">'+a.PieChart+"</span></font>";e+="</td>";e+='<td align="right">'+(Math.round(10*l)/10).toFixed(1)+"</td>";e+='<td align="right">'+f[n]+"<br />";e+="</td>";e+="</tr>\n";e+='<tr><td colspan="4"><div style="display:none;" style="width: 100%; height: 350px;" id="'+
k+'-chart"></div></td></tr>';e+='<tr><td colspan="4"><div style="display:none;" id="'+n+'-faculty">'+g[n]+"</div></td></tr>";b++;k=l}e+="</tbody></table><br />";a.allowRankingChange&&(e=a.useDenseRankings?e+'<em><a class="only_these_areas" onClick="deactivateDenseRankings(); return false;"><font color="blue"><b>Using dense rankings. Click to use competition rankings.</b></font></a><em>':e+'<em><a class="only_these_areas" onClick="activateDenseRankings(); return false;"><font color="blue"><b>Using competition rankings. Click to use dense rankings.</b></font></a></em>');
e+="</div></div>\n<br></body></html>"}else e="<h4>Please select at least one area.</h4>";return e};a.setAllCheckboxes=function(){a.activateAll()};a.rank=function(){var b={},c={},d={},f={},g={};a.areaDeptAdjustedCount={};var e=parseInt(jQuery("#startyear").find(":selected").text()),h=parseInt(jQuery("#endyear").find(":selected").text()),k=jQuery("#regions").find(":selected").val(),q=a.updateWeights(g);a.authorAreas={};a.countAuthorAreas(a.authors,e,h,a.authorAreas);a.buildDepartments(a.authors,e,h,
g,k,a.areaDeptAdjustedCount,c,b,d,f);a.stats=a.computeStats(b,a.areaDeptAdjustedCount,a.areas,q,!0,g);a.canonicalizeNames(b,d,f);b=a.buildDropDown(b,d,f);var m=a.buildOutputString(!0,q,a.stats,c,b);setTimeout(function(){jQuery("#success").html(m);a.urlUpdate()},0);return!1};a.toggleChart=function(b){var c=document.getElementById(b+"-chart");"block"===c.style.display?(c.style.display="none",c.innerHTML=""):(c.style.display="block",a.makeChart(b))};a.toggleConferences=function(b){var c=document.getElementById(b+
"-conferences"),d=document.getElementById(b+"-widget");"block"===c.style.display?(c.style.display="none",d.innerHTML='<font color="blue">'+a.RightTriangle+"</font>"):(c.style.display="block",d.innerHTML='<font color="blue">'+a.DownTriangle+"</font>");b=document.getElementById(b+"-conferences-checkboxes");b.style.display="block"===b.style.display?"none":"block"};a.toggleFaculty=function(b){var c=document.getElementById(b+"-faculty");b=document.getElementById(b+"-widget");"block"===c.style.display?
(c.style.display="none",b.innerHTML='<font color="blue">'+a.RightTriangle+"</font>"):(c.style.display="block",b.innerHTML='<font color="blue">'+a.DownTriangle+"</font>")};a.activateAll=function(b){void 0===b&&(b=!0);for(var c=0;c<a.areas.length;c++)if(jQuery("input[name="+a.fields[c]+"]").prop("checked",b),a.fields[c]in a.childMap)for(var d=0,f=a.childMap[a.fields[c]];d<f.length;d++)jQuery("input[name="+f[d]+"]").prop("checked",b);a.rank();return!1};a.activateNone=function(){return a.activateAll(!1)};
a.activateSystems=function(b){void 0===b&&(b=!0);return a.activateFields(b,a.systemsFields)};a.activateAI=function(b){void 0===b&&(b=!0);return a.activateFields(b,a.aiFields)};a.activateTheory=function(b){void 0===b&&(b=!0);return a.activateFields(b,a.theoryFields)};a.activateOthers=function(b){void 0===b&&(b=!0);return a.activateFields(b,a.otherFields)};a.deactivateSystems=function(){return a.activateSystems(!1)};a.deactivateAI=function(){return a.activateAI(!1)};a.deactivateTheory=function(){return a.activateTheory(!1)};
a.deactivateOthers=function(){return a.activateOthers(!1)};a.urlUpdate=function(){for(var b="",c=0,d=0;d<a.fields.length;d++)jQuery("input[name="+a.fields[d]+"]").prop("checked")&&(b+=a.fields[d]+"&",c+=1);0<c&&(b=b.slice(0,-1));b=c==a.fields.length?"":0==c?"/index?none":"/index?"+b;a.navigoRouter.navigate(b)};a.geoCheck=function(){jQuery.getJSON("http://freegeoip.net/json/",function(a){switch(a.country_code){case "US":case "CN":case "IN":case "KR":case "JP":case "TW":case "SG":break;default:jQuery("#regions").val("world")}})};
return a}();CSRankings.authorinfoFile="/generated-author-info.csv";CSRankings.countryinfoFile="/country-info.csv";CSRankings.aliasFile="/dblp-aliases.csv";CSRankings.homepagesFile="/homepages.csv";CSRankings.scholarFile="/scholar.csv";CSRankings.allowRankingChange=!1;CSRankings.parentMap={aaai:"ai",ijcai:"ai",cvpr:"vision",eccv:"vision",iccv:"vision"};CSRankings.childMap={ai:["aaai","ijcai"],vision:["cvpr","eccv","iccv"]};
CSRankings.areaMap=[{area:"ai",title:"AI"},{area:"vision",title:"Vision"},{area:"mlmining",title:"ML"},{area:"nlp",title:"NLP"},{area:"ir",title:"Web & IR"},{area:"arch",title:"Arch"},{area:"comm",title:"Networks"},{area:"sec",title:"Security"},{area:"mod",title:"DB"},{area:"hpc",title:"HPC"},{area:"mobile",title:"Mobile"},{area:"metrics",title:"Metrics"},{area:"ops",title:"OS"},{area:"plan",title:"PL"},{area:"soft",title:"SE"},{area:"act",title:"Theory"},{area:"crypt",title:"Crypto"},{area:"log",
title:"Logic"},{area:"graph",title:"Graphics"},{area:"chi",title:"HCI"},{area:"robotics",title:"Robotics"},{area:"bio",title:"Comp. Biology"},{area:"da",title:"EDA"},{area:"bed",title:"Embedded"},{area:"vis",title:"Visualization"},{area:"ecom",title:"ECom"}];CSRankings.aiAreas=["ai","vision","mlmining","nlp","ir"];CSRankings.systemsAreas="arch comm sec mod hpc mobile metrics ops plan soft da bed".split(" ");CSRankings.theoryAreas=["act","crypt","log"];CSRankings.interdisciplinaryAreas="graph chi robotics bio vis ecom".split(" ");
CSRankings.areas=[];CSRankings.areaNames=[];CSRankings.fields=[];CSRankings.aiFields=[];CSRankings.systemsFields=[];CSRankings.theoryFields=[];CSRankings.otherFields=[];CSRankings.areaDict={};CSRankings.areaPosition={};CSRankings.scholarInfo={};CSRankings.aliases={};CSRankings.countryInfo={};CSRankings.homepages={};CSRankings.useDenseRankings=!1;CSRankings.authors=[];CSRankings.authorAreas={};CSRankings.stats={};CSRankings.areaDeptAdjustedCount={};CSRankings.color="#f30000 #0600f3 #00b109 #14e4b4 #0fe7fb #67f200 #ff7e00 #8fe4fa #ff5300 #640000 #3854d1 #d00ed8 #7890ff #01664d #04231b #e9f117 #f3228e #7ce8ca #ff5300 #ff5300 #7eff30 #9a8cf6 #79aff9 #bfbfbf #56b510 #00e2f6 #ff4141 #61ff41".split(" ");
CSRankings.RightTriangle="►";CSRankings.DownTriangle="▼";CSRankings.PieChart="◕";function init(){new CSRankings}window.onload=init;