forked from emeryberger/CSrankings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
csrankings.min.js
58 lines (58 loc) · 29.4 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
var __awaiter=this&&this.__awaiter||function(a,c,d,b){function e(h){return h instanceof d?h:new d(function(f){f(h)})}return new (d||=Promise)(function(h,f){function l(m){try{k(b.next(m))}catch(n){f(n)}}function g(m){try{k(b["throw"](m))}catch(n){f(n)}}function k(m){m.done?h(m.value):e(m.value).then(l,g)}k((b=b.apply(a,c||[])).next())})};
class CSRankings{constructor(){this.note={};this.authorFile="./csrankings.csv";this.authorinfoFile="./generated-author-info.csv";this.countryinfoFile="./country-info.csv";this.turingFile="./turing.csv";this.turingImage="./png/acm-turing-award.png";this.acmfellowFile="./acm-fellows.csv";this.acmfellowImage="./png/acm.png";this.homepageImage="./png/house-logo.png";this.allowRankingChange=!1;this.areaMap=[{area:"ai",title:"AI"},{area:"aaai",title:"AI"},{area:"ijcai",title:"AI"},{area:"vision",title:"Vision"},
{area:"cvpr",title:"Vision"},{area:"eccv",title:"Vision"},{area:"iccv",title:"Vision"},{area:"mlmining",title:"ML"},{area:"icml",title:"ML"},{area:"kdd",title:"ML"},{area:"nips",title:"ML"},{area:"nlp",title:"NLP"},{area:"acl",title:"NLP"},{area:"emnlp",title:"NLP"},{area:"naacl",title:"NLP"},{area:"ir",title:"Web+IR"},{area:"sigir",title:"Web+IR"},{area:"www",title:"Web+IR"},{area:"arch",title:"Arch"},{area:"asplos",title:"Arch"},{area:"isca",title:"Arch"},{area:"micro",title:"Arch"},{area:"hpca",
title:"Arch"},{area:"comm",title:"Networks"},{area:"sigcomm",title:"Networks"},{area:"nsdi",title:"Networks"},{area:"sec",title:"Security"},{area:"ccs",title:"Security"},{area:"oakland",title:"Security"},{area:"usenixsec",title:"Security"},{area:"ndss",title:"Security"},{area:"pets",title:"Security"},{area:"mod",title:"DB"},{area:"sigmod",title:"DB"},{area:"vldb",title:"DB"},{area:"icde",title:"DB"},{area:"pods",title:"DB"},{area:"hpc",title:"HPC"},{area:"sc",title:"HPC"},{area:"hpdc",title:"HPC"},
{area:"ics",title:"HPC"},{area:"mobile",title:"Mobile"},{area:"mobicom",title:"Mobile"},{area:"mobisys",title:"Mobile"},{area:"sensys",title:"Mobile"},{area:"metrics",title:"Metrics"},{area:"imc",title:"Metrics"},{area:"sigmetrics",title:"Metrics"},{area:"ops",title:"OS"},{area:"sosp",title:"OS"},{area:"osdi",title:"OS"},{area:"fast",title:"OS"},{area:"usenixatc",title:"OS"},{area:"eurosys",title:"OS"},{area:"pldi",title:"PL"},{area:"popl",title:"PL"},{area:"icfp",title:"PL"},{area:"oopsla",title:"PL"},
{area:"plan",title:"PL"},{area:"soft",title:"SE"},{area:"fse",title:"SE"},{area:"icse",title:"SE"},{area:"ase",title:"SE"},{area:"issta",title:"SE"},{area:"act",title:"Theory"},{area:"focs",title:"Theory"},{area:"soda",title:"Theory"},{area:"stoc",title:"Theory"},{area:"crypt",title:"Crypto"},{area:"crypto",title:"Crypto"},{area:"eurocrypt",title:"Crypto"},{area:"log",title:"Logic"},{area:"cav",title:"Logic"},{area:"lics",title:"Logic"},{area:"graph",title:"Graphics"},{area:"siggraph",title:"Graphics"},
{area:"siggraph-asia",title:"Graphics"},{area:"chi",title:"HCI"},{area:"chiconf",title:"HCI"},{area:"ubicomp",title:"HCI"},{area:"uist",title:"HCI"},{area:"robotics",title:"Robotics"},{area:"icra",title:"Robotics"},{area:"iros",title:"Robotics"},{area:"rss",title:"Robotics"},{area:"bio",title:"Comp. Bio"},{area:"ismb",title:"Comp. Bio"},{area:"recomb",title:"Comp. Bio"},{area:"da",title:"EDA"},{area:"dac",title:"EDA"},{area:"iccad",title:"EDA"},{area:"bed",title:"Embedded"},{area:"emsoft",title:"Embedded"},
{area:"rtas",title:"Embedded"},{area:"rtss",title:"Embedded"},{area:"visualization",title:"Visualization"},{area:"vis",title:"Visualization"},{area:"vr",title:"Visualization"},{area:"ecom",title:"ECom"},{area:"ec",title:"ECom"},{area:"wine",title:"ECom"}];this.aiAreas=["ai","vision","mlmining","nlp","ir"];this.systemsAreas="arch comm sec mod da bed hpc mobile metrics ops plan soft".split(" ");this.theoryAreas=["act","crypt","log"];this.interdisciplinaryAreas="bio graph ecom chi robotics visualization".split(" ");
this.areaNames=[];this.fields=[];this.aiFields=[];this.systemsFields=[];this.theoryFields=[];this.otherFields=[];this.areaDict={};this.areaPosition={};this.subareas={};this.scholarInfo={};this.aliases={};this.turing={};this.acmfellow={};this.countryInfo={};this.countryAbbrv={};this.homepages={};this.useDenseRankings=!1;this.authors=[];this.dblpAuthors={};this.authorAreas={};this.stats={};this.areaDeptAdjustedCount={};this.areaStringMap={};this.usePieChart=!1;this.RightTriangle="►";this.DownTriangle=
"▼";this.BarChartIcon="<img class='closed_chart_icon chart_icon' alt='closed chart' src='png/barchart.png'>";this.OpenBarChartIcon="<img class='open_chart_icon chart_icon' alt='opened chart' src='png/barchart-open.png'>";this.PieChartIcon="<img class='closed_chart_icon chart_icon' alt='closed chart' src='png/piechart.png'>";this.OpenPieChartIcon="<img class='open_chart_icon chart_icon' alt='opened chart' src='png/piechart-open.png'>";this.ChartIcon=this.BarChartIcon;this.OpenChartIcon=this.OpenBarChartIcon;
CSRankings.theInstance=this;this.navigoRouter=new Navigo(null,!0);for(var a=0;a<this.areaMap.length;a++){const {area:b,title:e}=this.areaMap[a];CSRankings.areas[a]=b;b in CSRankings.parentMap||(CSRankings.topLevelAreas[b]=b);b in CSRankings.nextTier||(CSRankings.topTierAreas[b]=b);this.areaNames[a]=e;this.fields[a]=b;this.areaDict[b]=e;this.areaPosition[b]=a}a=[...this.aiAreas.map(b=>({[this.areaDict[b]]:"ai"})),...this.systemsAreas.map(b=>({[this.areaDict[b]]:"systems"})),...this.theoryAreas.map(b=>
({[this.areaDict[b]]:"theory"})),...this.interdisciplinaryAreas.map(b=>({[this.areaDict[b]]:"interdisciplinary"}))];for(var c of a)for(var d in c)this.subareas[d]=c[d];for(const b of this.aiAreas)this.aiFields.push(this.areaPosition[b]);for(const b of this.systemsAreas)this.systemsFields.push(this.areaPosition[b]);for(const b of this.theoryAreas)this.theoryFields.push(this.areaPosition[b]);for(const b of this.interdisciplinaryAreas)this.otherFields.push(this.areaPosition[b]);c=0;for(const b in CSRankings.parentMap)d=
CSRankings.parentMap[b],d in CSRankings.childMap?CSRankings.childMap[d].push(b):(CSRankings.childMap[d]=[b],CSRankings.parentIndex[d]=c,c+=1);this.displayProgress(1);(()=>__awaiter(this,void 0,void 0,function*(){yield this.loadTuring(this.turing);yield this.loadACMFellow(this.acmfellow);this.displayProgress(2);yield this.loadAuthorInfo();this.displayProgress(3);yield this.loadAuthors();this.setAllOn();this.navigoRouter.on({"/index":this.navigation,"/fromyear/:fromyear/toyear/:toyear/index":this.navigation}).resolve();
this.displayProgress(4);this.countAuthorAreas();yield this.loadCountryInfo(this.countryInfo,this.countryAbbrv);this.addListeners();CSRankings.geoCheck();this.rank();document.getElementById("overlay-loading").style.display="none";document.cookie.split("; ").find(b=>b.startsWith("surveyDisplayed"))||localStorage.getItem("surveyDisplayed");localStorage.getItem("sponsorshipDisplayed")||0!=Math.floor(20*Math.random())||(localStorage.setItem("sponsorshipDisplayed","true"),document.getElementById("overlay-sponsor").style.display=
"block")}))()}static updateMinimum(a){return 500>=CSRankings.minToRank?(a=a.scrollTop,CSRankings.minToRank=5E3,CSRankings.getInstance().rank(),a):0}static getInstance(){return CSRankings.theInstance}static promise(a){"undefined"!==typeof Promise?Promise.resolve().then(a):setTimeout(a,0)}translateNameToDBLP(a){a=a.replace(/ Jr\./g,"_Jr.");a=a.replace(/ II/g,"_II");a=a.replace(/ III/g,"_III");a=a.replace(/'|\-|\./g,"=");a=he.encode(a,{useNamedReferences:!0,allowUnsafeSymbols:!0});a=a.replace(/&/g,"=");
a=a.replace(/;/g,"=");a=a.split(" ");var c=a[a.length-1];0<parseInt(c)&&(a.pop(),c=a[a.length-1]+"_"+c);a.pop();a=a.join(" ");a=a.replace(/\s/g,"_");a=a.replace(/\-/g,"=");a=encodeURIComponent(a);return"https://dblp.org/pers/hd"+`/${c[0].toLowerCase()}/${c}:${a}`}makePrologue(){return'<div class="table-responsive" style="overflow:auto; height:700px;"><table class="table table-fit table-sm table-striped"id="ranking" valign="top">'}static sum(a){let c=0;for(let d=0;d<a.length;d++)c+=a[d];return c}static average(a){return CSRankings.sum(a)/
a.length}static stddev(a){const c=CSRankings.average(a),d=a.map(function(b){b-=c;return b*b});return Math.sqrt(CSRankings.sum(d)/(a.length-1))}areaString(a){if(a in this.areaStringMap)return this.areaStringMap[a];if(!this.authorAreas[a])return"";let c={};var d=CSRankings.topTierAreas,b=0;for(var e in d)d=this.authorAreas[a][e],e in CSRankings.parentMap&&(e=this.areaDict[e]),0<d&&(e in c||(c[e]=0),c[e]+=d,b=c[e]>b?c[e]:b);e=[];for(var h in c)e.push(c[h]);h=CSRankings.sum(e);d=0;1<e.length&&(d=Math.ceil(1*
CSRankings.stddev(e)));e=[];for(const f in c)c[f]>=b-d&&.2<=1*c[f]/h&&1<c[f]&&e.push(f);b=e.sort((f,l)=>c[l]-c[f]).slice(0,3);this.areaStringMap[a]=b.map(f=>`<span class="${this.subareas[f]}-area">${f}</span>`).join(",");return this.areaStringMap[a]}compareNames(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}makeChart(a,c){let d=[],b={};var e=CSRankings.topTierAreas,h=unescape(a),f=[...this.aiAreas.map(g=>({key:g,label:this.areaDict[g],color:"#377eb8"})),
...this.systemsAreas.map(g=>({key:g,label:this.areaDict[g],color:"#ff7f00"})),...this.theoryAreas.map(g=>({key:g,label:this.areaDict[g],color:"#4daf4a"})),...this.interdisciplinaryAreas.map(g=>({key:g,label:this.areaDict[g],color:"#984ea3"}))];f.forEach(g=>b[g.key]=0);for(let g in e){if(!(h in this.authorAreas))return;e=Math.round(10*this.authorAreas[h][g])/10;0<e&&(g in CSRankings.parentMap&&(g=CSRankings.parentMap[g]),b[g]+=e)}let l=0;f.forEach(g=>{l+=b[g.key]});f.forEach((g,k)=>{d.push({index:k,
area:this.areaDict[g.key],value:Math.round(10*b[g.key])/10,ratio:b[g.key]/l});g.label=this.areaDict[g.key]});f=f.sort((g,k)=>g.label>k.label?1:g.label<k.label?-1:0).map(g=>g.color);h={$schema:"https://vega.github.io/schema/vega-lite/v5.json",data:{values:d},mark:"bar",encoding:{x:{field:"area",type:"nominal",sort:null,axis:{title:null}},y:{field:"value",type:"quantitative",axis:{title:null}},tooltip:[{field:"area",type:"nominal",title:"Area"},{field:"value",type:"quantitative",title:"Count"}],color:{field:"area",
type:"nominal",scale:{range:f},legend:null}},width:420,height:80,padding:{left:25,top:3}};f={$schema:"https://vega.github.io/schema/vega-lite/v5.json",data:{values:d},encoding:{theta:{field:"value",type:"quantitative",stack:!0},color:{field:"area",type:"nominal",scale:{range:f},legend:null},order:{field:"index"},tooltip:[{field:"area",type:"nominal",title:"Area"},{field:"value",type:"quantitative",title:"Count"},{field:"ratio",type:"quantitative",title:"Ratio",format:".1%"}]},layer:[{mark:{type:"arc",
outerRadius:90,stroke:"#fdfdfd",strokeWidth:1}},{mark:{type:"text",radius:108,dy:-3},encoding:{text:{field:"area",type:"nominal"},color:{condition:{test:"datum.ratio < 0.03",value:"rgba(255, 255, 255, 0)"},field:"area",type:"nominal",scale:{range:f}}}},{mark:{type:"text",radius:108,fontSize:9,dy:7},encoding:{text:{field:"value",type:"quantitative"},color:{condition:{test:"datum.ratio < 0.03",value:"rgba(255, 255, 255, 0)"},field:"area",type:"nominal",scale:{range:f}}}}],width:400,height:250,padding:{left:25,
top:3}};vegaEmbed(`div[id="${a}-chart"]`,c?f:h,{actions:!1})}displayProgress(a){a=`<strong>${["Initializing.","Loading author information.","Loading publication data.","Computing ranking."][a-1]}</strong><br />`;const c=document.querySelector("#progress");c&&(c.innerHTML=a)}loadTuring(a){return __awaiter(this,void 0,void 0,function*(){const c=yield new Promise(d=>{Papa.parse(this.turingFile,{header:!0,download:!0,complete:b=>{d(b.data)}})});for(const d of c)a[d.name]=d.year})}loadACMFellow(a){return __awaiter(this,
void 0,void 0,function*(){const c=yield new Promise(d=>{Papa.parse(this.acmfellowFile,{header:!0,download:!0,complete:b=>{d(b.data)}})});for(const d of c)a[d.name]=d.year})}loadCountryInfo(a,c){return __awaiter(this,void 0,void 0,function*(){const d=yield new Promise(b=>{Papa.parse(this.countryinfoFile,{header:!0,download:!0,complete:e=>{b(e.data)}})});for(const b of d)a[b.institution]=b.region,c[b.institution]=b.countryabbrv})}loadAuthorInfo(){return __awaiter(this,void 0,void 0,function*(){const a=
yield new Promise(c=>{Papa.parse(this.authorFile,{download:!0,header:!0,complete:d=>{c(d.data)}})});for(let c=0;c<a.length;c++){const d=a[c];let b=d.name.trim();const e=b.match(CSRankings.nameMatcher);e&&(b=e[1].trim(),this.note[b]=e[2]);""!==b&&(this.dblpAuthors[b]=this.translateNameToDBLP(b),this.homepages[b]=d.homepage,this.scholarInfo[b]=d.scholarid)}})}loadAuthors(){return __awaiter(this,void 0,void 0,function*(){this.authors=yield new Promise(a=>{Papa.parse(this.authorinfoFile,{download:!0,
header:!0,complete:c=>{a(c.data)}})})})}inRegion(a,c){switch(c){case "us":if(a in this.countryInfo)return!1;break;case "at":case "au":case "br":case "ca":case "ch":case "cn":case "de":case "dk":case "es":case "fr":case "gr":case "hk":case "il":case "in":case "it":case "jp":case "kr":case "nl":case "nz":case "tr":case "uk":if(this.countryAbbrv[a]!=c)return!1;break;case "europe":if(!(a in this.countryInfo)||"europe"!=this.countryInfo[a])return!1;break;case "northamerica":if(a in this.countryInfo&&"canada"!=
this.countryInfo[a])return!1;break;case "australasia":if(!(a in this.countryInfo)||"australasia"!=this.countryInfo[a])return!1;break;case "southamerica":if(!(a in this.countryInfo)||"southamerica"!=this.countryInfo[a])return!1;break;case "asia":if(!(a in this.countryInfo)||"asia"!=this.countryInfo[a])return!1;break;case "africa":if(!(a in this.countryInfo)||"africa"!=this.countryInfo[a])return!1}return!0}activateFields(a,c){for(let d=0;d<c.length;d++){const b=this.fields[c[d]],e=`input[name=${b}]`;
$(e).prop("checked",a);b in CSRankings.childMap&&($(e).prop("disabled",!1),CSRankings.childMap[b].forEach(h=>{const f=`input[name=${h}]`;h in CSRankings.nextTier?$(f).prop("checked",!1):$(f).prop("checked",a)}))}this.rank();return!1}sortIndex(a){let c=Object.keys(a);c.sort((d,b)=>a[d]!=a[b]?a[b]-a[d]:d<b?-1:b<d?1:0);return c}countAuthorAreas(){const a=parseInt($("#fromyear").find(":selected").text()),c=parseInt($("#toyear").find(":selected").text());this.authorAreas={};for(const b in this.authors){const {area:e}=
this.authors[b];if(e in CSRankings.nextTier)continue;var {year:d}=this.authors[b];if(d<a||d>c)continue;const {name:h,dept:f,count:l}=this.authors[b];d=parseFloat(l);if(!(h in this.authorAreas)){this.authorAreas[h]={};for(const g in this.areaDict)this.areaDict.hasOwnProperty(g)&&(this.authorAreas[h][g]=0)}if(!(f in this.authorAreas)){this.authorAreas[f]={};for(const g in this.areaDict)this.areaDict.hasOwnProperty(g)&&(this.authorAreas[f][g]=0)}this.authorAreas[h][e]+=d;this.authorAreas[f][e]+=d}}buildDepartments(a,
c,d,b,e,h,f,l){const g={};for(const q in this.authors){if(!this.authors.hasOwnProperty(q))continue;var k=this.authors[q];const p=k.dept;if(!this.inRegion(p,b))continue;var m=k.area;if(0===d[m])continue;var n=k.year;if(n<a||n>c)continue;if("undefined"===typeof p)continue;k=k.name;m in CSRankings.parentMap&&(m=CSRankings.parentMap[m]);m+=p;m in this.areaDeptAdjustedCount||(this.areaDeptAdjustedCount[m]=0);n=parseInt(this.authors[q].count);const r=parseFloat(this.authors[q].adjustedcount);this.areaDeptAdjustedCount[m]+=
r;k in g||(g[k]=!0,f[k]=0,l[k]=0,p in e||(e[p]=0,h[p]=[]),h[p].push(k),e[p]+=1);f[k]+=n;l[k]+=r}}computeStats(a,c,d){this.stats={};for(const b in a)if(a.hasOwnProperty(b)){this.stats[b]=1;for(const e in CSRankings.topLevelAreas){const h=e+b;h in this.areaDeptAdjustedCount||(this.areaDeptAdjustedCount[h]=0);0!=d[e]&&(this.stats[b]*=this.areaDeptAdjustedCount[h]+1)}this.stats[b]=Math.pow(this.stats[b],1/c)}}updateWeights(a){let c=0;for(let d=0;d<CSRankings.areas.length;d++){const b=CSRankings.areas[d];
a[b]=$(`input[name=${this.fields[d]}]`).prop("checked")?1:0;1!==a[b]||b in CSRankings.parentMap||c++}return c}buildDropDown(a,c,d){let b={};for(const f in a){if(!a.hasOwnProperty(f))continue;let l='<div class="table"><table class="table table-sm table-striped"><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)."># Pubs</abbr> </em></small></td><td align="right"><small><em><abbr title="Count divided by number of co-authors">Adj. #</abbr></em></small></td></thead><tbody>',
g={};for(const k of a[f])g[k]=c[k];var e=Object.keys(g);e.sort((k,m)=>g[m]===g[k]?this.compareNames(k,m):g[m]-g[k]);for(const k of e){var h=encodeURI(this.homepages[k]);e=this.dblpAuthors[k];l+="<tr><td> </td><td><small>"+`<a title="Click for author\'s home page." target="_blank" href="${h}" `+`onclick="trackOutboundLink('${h}', true); return false;"`+`>${k}</a> `;this.note.hasOwnProperty(k)&&(l+=`<span class="note" title="Note">[${`<a href="${CSRankings.noteMap[this.note[k]]}">`+
this.note[k]}</a>]</span> `);this.acmfellow.hasOwnProperty(k)&&(l+=`<span title="ACM Fellow (${this.acmfellow[k]})"><img alt="ACM Fellow" src="${this.acmfellowImage}"></span> `);this.turing.hasOwnProperty(k)&&(l+=`<span title="Turing Award"><img alt="Turing Award" src="${this.turingImage}"></span> `);l+=`<span class="areaname">${this.areaString(k).toLowerCase()}</span> `;l+=`<a title="Click for author\'s home page." target="_blank" href="${h}" `+`onclick="trackOutboundLink(\'${h}\', true); return false;"`+
">"+`<img alt=\"Home page\" src=\"${this.homepageImage}\"></a> `;this.scholarInfo.hasOwnProperty(k)&&"NOSCHOLARPAGE"!=this.scholarInfo[k]&&(h=`https://scholar.google.com/citations?user=${this.scholarInfo[k]}&hl=en&oi=ao`,l+=`<a title="Click for author\'s Google Scholar page." target="_blank" href="${h}" onclick="trackOutboundLink('${h}', true); return false;">`+'<img alt="Google Scholar" src="scholar-favicon.ico" height="10" width="10"></a> ');l+=`<a title="Click for author\'s DBLP entry." target="_blank" href="${e}" onclick="trackOutboundLink('${e}', true); return false;">`;
l+='<img alt="DBLP" src="dblp.png"></a>';l+=`<span onclick='csr.toggleChart("${escape(k)}"); ga("send", "event", "chart", "toggle", "toggle ${escape(k)} ${$("#charttype").find(":selected").val()} chart");' title="Click for author's publication profile." class="hovertip" id="${escape(k)+"-chartwidget"}">`;l+=this.ChartIcon+'</span></small></td><td align="right"><small>'+`<a title="Click for author's DBLP entry." target="_blank" href="${e}" `+`onclick="trackOutboundLink('${e}', true); return false;">${g[k]}</a>`+
'</small></td><td align="right"><small>'+(Math.round(10*d[k])/10).toFixed(1)+'</small></td></tr><tr><td colspan="4">'+`<div class="csr-chart" id="${escape(k)}-chart">`+"</div></td></tr>"}l+="</tbody></table></div>";b[f]=l}return b}buildOutputString(a,c,d,b,e){let h=this.makePrologue();h=h+'<thead><tr><th align="left"><font color="#777">#</font></th><th align="left"><font color="#777">Institution</font>'+" ".repeat(20)+'</th><th align="right"><abbr title="Geometric mean count of papers published across all areas."><font color="#777">Count</font></abbr></th><th align="right"> <abbr title="Number of faculty who have published in these areas."><font color="#777">Faculty</font></abbr></th></th></tr></thead>';
h+="<tbody>";if(0<a){a=1;let g=0;var f=9999999.999;for(var l in this.stats)this.stats[l]=Math.round(10*this.stats[l])/10;l=this.sortIndex(this.stats);for(let k=0;k<l.length;k++){const m=l[k],n=this.stats[m];if(k>=e&&n!=f)break;if(0===n)break;f!=n&&(this.useDenseRankings?g+=1:(g+=a,a=0));f=escape(m);h+="\n<tr><td>"+g;h+=" ".repeat(4-Math.ceil(Math.log10(g)));h+="</td>";h+="<td>"+`<span class="hovertip" onclick="csr.toggleFaculty('${f}');" id="${f}-widget">`+this.RightTriangle+"</span>";let q=
"us";m in c&&(q=c[m]);h+=" "+`<span onclick="csr.toggleFaculty('${f}');">${m}</span>`+` <img src="/flags/${q}.png"> `+`<span class="hovertip" onclick='csr.toggleChart("${f}"); ga("send", "event", "chart", "toggle-department", "toggle ${f} ${$("#charttype").find(":selected").val()} chart");' id='${f+"-chartwidget"}'>`+this.ChartIcon+"</span>";h+="</td>";h+=`<td align="right">${(Math.round(10*n)/10).toFixed(1)}</td>`;h+=`<td align="right">${d[m]}`;h+="</td>";h+="</tr>\n";h+=`<tr><td colspan="4"><div class="csr-chart" id="${f}-chart"></div></td></tr>`;
h+=`<tr><td colspan="4"><div style="display:none;" id="${f}-faculty">${b[m]}</div></td></tr>`;a++;f=n}h+="</tbody></table><br /></div></div>\n<br></body></html>"}else h="<h3>Please select at least one area by clicking one or more checkboxes.</h3>";return h}setAllOn(a=!0){for(let c=0;c<CSRankings.areas.length;c++){const d=this.fields[c],b=`input[name=${d}]`;a?d in CSRankings.nextTier?$(b).prop("checked",!1):($(b).prop("checked",!0),$(b).prop("disabled",!1)):($(b).prop("checked",!1),$(b).prop("disabled",
!1))}}rank(a=!0){const c=performance.now();var d={},b={};let e={},h={},f={};this.areaDeptAdjustedCount={};const l=parseInt($("#fromyear").find(":selected").text()),g=parseInt($("#toyear").find(":selected").text()),k=String($("#regions").find(":selected").val());var m=this.updateWeights(f);this.buildDepartments(l,g,f,k,b,d,e,h);this.computeStats(d,m,f);d=this.buildDropDown(d,e,h);b=this.buildOutputString(m,this.countryAbbrv,b,d,CSRankings.minToRank);m=performance.now();console.log(`Before render: rank took ${m-
c} milliseconds.`);document.getElementById("success").innerHTML=b;$("div").scroll(function(){if(this.scrollTop+this.clientHeight>this.scrollHeight-50){const n=CSRankings.updateMinimum(this);n&&$("div").scrollTop(n)}});a?this.navigoRouter.resume():this.navigoRouter.pause();a=this.updatedURL();this.navigoRouter.navigate(a);m=performance.now();console.log(`Rank took ${m-c} milliseconds.`);return!1}toggleChart(a){const c=document.getElementById(a+"-chart"),d=document.getElementById(a+"-chartwidget");
"block"===c.style.display?(c.style.display="none",c.innerHTML="",d.innerHTML=this.ChartIcon):(c.style.display="block",this.makeChart(a,this.usePieChart),d.innerHTML=this.OpenChartIcon)}toggleConferences(a){const c=document.getElementById(a+"-conferences");a=document.getElementById(a+"-widget");"block"===c.style.display?(c.style.display="none",a.innerHTML=this.RightTriangle):(c.style.display="block",a.innerHTML=this.DownTriangle)}toggleFaculty(a){const c=document.getElementById(a+"-faculty");a=document.getElementById(a+
"-widget");"block"===c.style.display?(c.style.display="none",a.innerHTML=this.RightTriangle):(c.style.display="block",a.innerHTML=this.DownTriangle)}activateAll(a=!0){this.setAllOn(a);this.rank();return!1}activateNone(){return this.activateAll(!1)}activateSystems(a=!0){return this.activateFields(a,this.systemsFields)}activateAI(a=!0){return this.activateFields(a,this.aiFields)}activateTheory(a=!0){return this.activateFields(a,this.theoryFields)}activateOthers(a=!0){return this.activateFields(a,this.otherFields)}deactivateSystems(){return this.activateSystems(!1)}deactivateAI(){return this.activateAI(!1)}deactivateTheory(){return this.activateTheory(!1)}deactivateOthers(){return this.activateOthers(!1)}updatedURL(){let a=
"",c=0,d=0;for(var b=0;b<this.fields.length;b++){var e=`input[name=${this.fields[b]}]`;this.fields[b]in CSRankings.parentMap||(d+=1);if($(e).prop("checked")&&!(this.fields[b]in CSRankings.parentMap)){let g=1;this.fields[b]in CSRankings.childMap&&CSRankings.childMap[this.fields[b]].forEach(k=>{let m=$(`input[name=${k}]`).prop("checked");g=k in CSRankings.nextTier?g&(m?0:1):g&m});g&&(a+=`${this.fields[b]}&`,c+=1)}}0<c&&(a=a.slice(0,-1));b=$("#regions").find(":selected").val();e="";const h=(new Date).getFullYear(),
f=parseInt($("#fromyear").find(":selected").text()),l=parseInt($("#toyear").find(":selected").text());if(f!=h-10||l!=h)e+=`/fromyear/${f.toString()}`,e+=`/toyear/${l.toString()}`;e=c==d?e+"/index?all":0==c?e+"/index?none":e+`/index?${a}`;"USA"!=b&&(e+=`&${b}`);if("pie"==$("#charttype").find(":selected").val()){this.usePieChart=!0;for(const g of document.getElementsByClassName("chart_icon"))g.src="png/piechart.png";for(const g of document.getElementsByClassName("open_chart_icon"))g.src="png/piechart-open.png";
for(const g of document.getElementsByClassName("closed_chart_icon"))g.src="png/piechart.png";this.ChartIcon=this.PieChartIcon;this.OpenChartIcon=this.OpenPieChartIcon;e+="&pie"}else{this.usePieChart=!1;for(const g of document.getElementsByClassName("chart_icon"))g.src="png/barchart.png";for(const g of document.getElementsByClassName("open_chart_icon"))g.src="png/barchart-open.png";for(const g of document.getElementsByClassName("closed_chart_icon"))g.src="png/barchart.png";this.ChartIcon=this.BarChartIcon;
this.OpenChartIcon=this.OpenBarChartIcon}return e}static geoCheck(){navigator.geolocation.getCurrentPosition(a=>{a=whichContinent(a.coords.latitude,a.coords.longitude);let c=document.getElementById("regions");switch(a){case "northamerica":return;case "europe":case "asia":case "southamerica":case "africa":c.value=a;break;default:c.value="world"}CSRankings.getInstance().rank()})}navigation(a,c){null!==a&&Object.keys(a).forEach(f=>{$("#{key}").prop("value",a[f].toString())});CSRankings.clearNonSubsetted();
let d=c.split("&");c=d.some(f=>"all"==f);d.some(f=>"survey"==f)&&(document.getElementById("overlay-survey").style.display="block");const b=d.some(f=>"none"==f);if(d.some(f=>0<=CSRankings.regions.indexOf(f))){let f=0;d.forEach(l=>{0<=CSRankings.regions.indexOf(l)&&(d.splice(f,1),$("#regions").val(l));f+=1})}d.some(f=>"pie"==f)&&$("#charttype").val("pie");if(c)for(var e in CSRankings.topTierAreas){var h=`input[name=${e}]`;$(h).prop("checked",!0);e in CSRankings.childMap&&($(h).prop("disabled",!1),CSRankings.childMap[e].forEach(f=>
{f in CSRankings.nextTier||$(`input[name=${f}]`).prop("checked",!0)}))}else if(b)CSRankings.clearNonSubsetted();else{CSRankings.clearNonSubsetted();for(h of d)"none"!=h&&""!=h&&(e=`input[name=${h}]`,$(e).prop("checked",!0),$(e).prop("disabled",!1),h in CSRankings.childMap&&CSRankings.childMap[h].forEach(f=>{f in CSRankings.nextTier||$(`input[name=${f}]`).prop("checked",!0)}))}}static clearNonSubsetted(){for(const a of CSRankings.areas)if(a in CSRankings.childMap){const c=CSRankings.childMap[a];if(!CSRankings.subsetting(c)){const d=
`input[name=${a}]`;$(d).prop("checked",!1);$(d).prop("disabled",!1);c.forEach(b=>{$(`input[name=${b}]`).prop("checked",!1)})}}}static subsetting(a){let c=[],d=[];a.forEach(h=>{h in CSRankings.nextTier?d.push(h):c.push(h)});let b=0;c.forEach(h=>{$(`input[name=${h}]`).prop("checked")&&b++});let e=0;d.forEach(h=>{$(`input[name=${h}]`).prop("checked")&&e++});a=0<e&&0!=d.length;return 0<b&&b<c.length||a}addListeners(){["toyear","fromyear","regions","charttype"].forEach(b=>{document.getElementById(b).addEventListener("change",
()=>{this.countAuthorAreas();this.rank()})});for(var a=0;a<CSRankings.areas.length;a++){let b=CSRankings.areas[a];if(!(b in CSRankings.parentMap)){var c=document.getElementById(`${b}-widget`);c&&c.addEventListener("click",()=>{this.toggleConferences(b)})}}for(a=0;a<this.fields.length;a++){const b=`input[name=${this.fields[a]}]`,e=this.fields[a];(c=document.getElementById(this.fields[a]))&&c.addEventListener("click",()=>{let h=!0;if(e in CSRankings.parentMap){h=!1;var f=CSRankings.parentMap[e],l=`input[name=${f}]`;
let g=0,k=1;CSRankings.childMap[f].forEach(m=>{const n=$(`input[name=${m}]`).prop("checked");g|=n;k=m in CSRankings.nextTier?k&(n?0:1):k&n});$(l).prop("checked",g);g&&!k||$(l).prop("disabled",!1);g&&!k&&$(l).prop("disabled",!0)}else if(f=$(b).prop("checked"),e in CSRankings.childMap)for(l of CSRankings.childMap[e]){const g=`input[name=${l}]`;l in CSRankings.nextTier?$(g).prop("checked",!1):$(g).prop("checked",f)}this.rank(h)})}const d={all_areas_on:()=>{this.activateAll()},all_areas_off:()=>{this.activateNone()},
ai_areas_on:()=>{this.activateAI()},ai_areas_off:()=>{this.deactivateAI()},systems_areas_on:()=>{this.activateSystems()},systems_areas_off:()=>{this.deactivateSystems()},theory_areas_on:()=>{this.activateTheory()},theory_areas_off:()=>{this.deactivateTheory()},other_areas_on:()=>{this.activateOthers()},other_areas_off:()=>{this.deactivateOthers()}};for(const b in d)document.getElementById(b).addEventListener("click",()=>{d[b]()})}}CSRankings.minToRank=30;CSRankings.areas=[];
CSRankings.topLevelAreas={};CSRankings.topTierAreas={};CSRankings.regions="europe northamerica southamerica australasia asia africa world au at br ca cn dk fr de gr hk in il it jp nl nz kr es ch tr uk us".split(" ");CSRankings.nameMatcher=RegExp("(.*)\\s+\\[(.*)\\]");CSRankings.parentIndex={};
CSRankings.parentMap={aaai:"ai",ijcai:"ai",cvpr:"vision",eccv:"vision",iccv:"vision",icml:"mlmining",kdd:"mlmining",nips:"mlmining",acl:"nlp",emnlp:"nlp",naacl:"nlp",sigir:"ir",www:"ir",asplos:"arch",isca:"arch",micro:"arch",hpca:"arch",ccs:"sec",oakland:"sec",usenixsec:"sec",ndss:"sec",pets:"sec",vldb:"mod",sigmod:"mod",icde:"mod",pods:"mod",dac:"da",iccad:"da",emsoft:"bed",rtas:"bed",rtss:"bed",sc:"hpc",hpdc:"hpc",ics:"hpc",mobicom:"mobile",mobisys:"mobile",sensys:"mobile",imc:"metrics",sigmetrics:"metrics",
osdi:"ops",sosp:"ops",eurosys:"ops",fast:"ops",usenixatc:"ops",popl:"plan",pldi:"plan",oopsla:"plan",icfp:"plan",fse:"soft",icse:"soft",ase:"soft",issta:"soft",nsdi:"comm",sigcomm:"comm",siggraph:"graph","siggraph-asia":"graph",focs:"act",soda:"act",stoc:"act",crypto:"crypt",eurocrypt:"crypt",cav:"log",lics:"log",ismb:"bio",recomb:"bio",ec:"ecom",wine:"ecom",chiconf:"chi",ubicomp:"chi",uist:"chi",icra:"robotics",iros:"robotics",rss:"robotics",vis:"visualization",vr:"visualization"};
CSRankings.nextTier={ase:!0,issta:!0,icde:!0,pods:!0,hpca:!0,ndss:!0,pets:!0,eurosys:!0,fast:!0,usenixatc:!0,icfp:!0,oopsla:!0};CSRankings.childMap={};CSRankings.noteMap={Tech:"https://tech.cornell.edu/",CBG:"https://www.cis.mpg.de/cbg/",INF:"https://www.cis.mpg.de/mpi-inf/",IS:"https://www.cis.mpg.de/is/",MG:"https://www.cis.mpg.de/molgen/",SP:"https://www.cis.mpg.de/mpi-for-security-and-privacy/",SWS:"https://www.cis.mpg.de/mpi-sws/"};var csr=new CSRankings;