Permalink
Browse files

Added some Canadian and European affiliations.

  • Loading branch information...
1 parent 101602d commit 97fd75bc6bf247af2f821afc0425a06c8cc4b985 @emeryberger committed Jul 2, 2016
Showing with 6,218 additions and 1,429 deletions.
  1. +45 −8 csrank.js
  2. +51 −9 csrank.ts
  3. +376 −0 experimental/non-us-faculty-affiliations.csv
  4. +703 −0 faculty-affiliations.csv
  5. +5,031 −1,405 generated-author-info.csv
  6. +12 −7 index.html
View
@@ -1,21 +1,31 @@
+/*
+
+ CSrankings.ts
+
+ @author Emery Berger <emery@cs.umass.edu> http://www.emeryberger.com
+
+*/
/// <reference path="./typescript/jquery.d.ts" />
/// <reference path="./typescript/papaparse.d.ts" />
/// <reference path="./typescript/set.d.ts" />
/// <reference path="./typescript/pako.d.ts" />
var coauthorFile = "faculty-coauthors.csv";
var authorinfoFile = "generated-author-info.csv";
+var countryinfoFile = "country-info.csv";
var allowRankingChange = false; /* Can we change the kind of rankings being used? */
var maxCoauthors = 30; /* Max co-authors to display. */
var useArithmeticMean = false;
-var useGeometricMean = true;
+var useGeometricMean = true; /* This is the default and arguably only principled choice. */
var useHarmonicMean = false;
var useDenseRankings = false; /* Set to true for "dense rankings" vs. "competition rankings". */
/* All the areas, in order by their 'field_' number (the checkboxes) in index.html. */
var areas = ["proglang", "softeng", "opsys", "networks", "security", "database", "metrics", "mlmining", "ai", "nlp", "web", "vision", "theory", "logic", "arch", "graphics", "hci", "mobile", "robotics", "highperf", "oopfp", "crypto"];
;
;
-var authors; /* The data which will hold the parsed CSV of author info. */
-var coauthors; /* The data which will hold the parsed CSV of co-author info. */
+;
+var authors = []; /* The data which will hold the parsed CSV of author info. */
+var coauthors = []; /* The data which will hold the parsed CSV of co-author info. */
+var countryInfo = {};
/* The prologue that we preface each generated HTML page with (the results). */
function makePrologue() {
var s = "<html>"
@@ -113,6 +123,23 @@ function loadCoauthors(cont) {
}
});
}
+function loadCountryInfo(cont) {
+ Papa.parse(countryinfoFile, {
+ download: true,
+ header: true,
+ complete: function (results) {
+ var data = results.data;
+ var ci = data;
+ console.log(ci);
+ console.log(ci.length);
+ for (var i = 0; i < ci.length; i++) {
+ console.log(ci[i]);
+ countryInfo[ci[i].institution] = ci[i].region;
+ }
+ cont();
+ }
+ });
+}
function loadAuthorInfo(cont) {
Papa.parse(authorinfoFile, {
download: true,
@@ -127,16 +154,20 @@ function loadAuthorInfo(cont) {
rank();
});
})(str);
+ cont();
}
- rank();
+ /* rank(); */
}
});
- cont();
}
function init() {
jQuery(document).ready(function () {
setAllCheckboxes();
- loadAuthorInfo(function () { loadCoauthors(rank); });
+ loadAuthorInfo(function () {
+ loadCoauthors(function () {
+ loadCountryInfo(rank);
+ });
+ });
});
}
function activateAll(value) {
@@ -252,12 +283,17 @@ function countPapers(areacount, areaAdjustedCount, areaDeptAdjustedCount, author
areaAdjustedCount[area] += adjustedCount;
}
}
-function buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights) {
+function buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights, regions) {
/* Build the dictionary of departments (and count) to be ranked. */
var visited = {}; /* contains an author name if that author has been processed. */
for (var r in authors) {
var area = authors[r].area;
var dept = authors[r].dept;
+ if (regions == "USA") {
+ if (dept in countryInfo) {
+ continue;
+ }
+ }
var areaDept = area + dept;
if (!(areaDept in areaDeptAdjustedCount)) {
areaDeptAdjustedCount[areaDept] = 0;
@@ -363,6 +399,7 @@ function rank() {
var displayPercentages = Boolean(parseInt(jQuery("#displayPercent").find(":selected").val()));
/* Show the top N (with more if tied at the end) */
var minToRank = 50; /* parseInt(jQuery("#minToRank").find(":selected").val()); */
+ var whichRegions = jQuery("#regions").find(":selected").val();
var numAreas = 0; /* Total number of areas checked */
/* Update the 'weights' of each area from the checkboxes. */
for (var ind = 0; ind < areas.length; ind++) {
@@ -376,7 +413,7 @@ function rank() {
}
var coauthorList = computeCoauthors(coauthors, startyear, endyear, weights);
countPapers(areacount, areaAdjustedCount, areaDeptAdjustedCount, authors, startyear, endyear, weights);
- buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights);
+ buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights, whichRegions);
/* (university, total or average number of papers) */
var univagg = computeStats(deptNames, areaAdjustedCount, areaDeptAdjustedCount, areas, numAreas, displayPercentages, weights);
var s = makePrologue();
View
@@ -1,16 +1,25 @@
+/*
+
+ CSrankings.ts
+
+ @author Emery Berger <emery@cs.umass.edu> http://www.emeryberger.com
+
+*/
+
/// <reference path="./typescript/jquery.d.ts" />
/// <reference path="./typescript/papaparse.d.ts" />
/// <reference path="./typescript/set.d.ts" />
/// <reference path="./typescript/pako.d.ts" />
const coauthorFile = "faculty-coauthors.csv";
const authorinfoFile = "generated-author-info.csv";
+const countryinfoFile = "country-info.csv";
const allowRankingChange = false; /* Can we change the kind of rankings being used? */
const maxCoauthors = 30; /* Max co-authors to display. */
const useArithmeticMean = false;
-const useGeometricMean = true;
-const useHarmonicMean = false;
+const useGeometricMean = true; /* This is the default and arguably only principled choice. */
+const useHarmonicMean = false;
var useDenseRankings = false; /* Set to true for "dense rankings" vs. "competition rankings". */
@@ -34,8 +43,15 @@ interface Coauthor {
area : string;
};
-var authors : Array<Author>; /* The data which will hold the parsed CSV of author info. */
-var coauthors : Array<Coauthor>; /* The data which will hold the parsed CSV of co-author info. */
+interface CountryInfo {
+ institution : string;
+ region : string;
+};
+
+var authors : Array<Author> = []; /* The data which will hold the parsed CSV of author info. */
+var coauthors : Array<Coauthor> = []; /* The data which will hold the parsed CSV of co-author info. */
+var countryInfo : {[key:string] : string} = {};
+
/* The prologue that we preface each generated HTML page with (the results). */
@@ -152,6 +168,24 @@ function loadCoauthors(cont : () => void ) : void {
});
}
+function loadCountryInfo(cont : () => void ) : void {
+ Papa.parse(countryinfoFile, {
+ download : true,
+ header: true,
+ complete : function(results) {
+ var data : any = results.data;
+ var ci = data as Array<CountryInfo>;
+ console.log(ci);
+ console.log(ci.length);
+ for (var i = 0; i < ci.length; i++) {
+ console.log(ci[i]);
+ countryInfo[ci[i].institution] = ci[i].region;
+ }
+ cont();
+ }
+ });
+}
+
function loadAuthorInfo(cont : () => void) : void {
Papa.parse(authorinfoFile, {
download : true,
@@ -165,18 +199,19 @@ function loadAuthorInfo(cont : () => void) : void {
jQuery(s).click(function() {
rank();
});})(str);
+ cont();
}
- rank();
+/* rank(); */
}
});
- cont();
}
function init() : void {
jQuery(document).ready(
function() {
setAllCheckboxes();
- loadAuthorInfo(function() { loadCoauthors(rank) ; });
+ loadAuthorInfo(function() { loadCoauthors(function() {
+ loadCountryInfo(rank) ; }); });
});
}
@@ -329,13 +364,19 @@ function buildDepartments(areaDeptAdjustedCount : {[key:string] : number},
authors : Array<Author>,
startyear : number,
endyear : number,
- weights : {[key:string] : number}) : void
+ weights : {[key:string] : number},
+ regions : string) : void
{
/* Build the dictionary of departments (and count) to be ranked. */
var visited : {[key:string] : boolean} = {}; /* contains an author name if that author has been processed. */
for (var r in authors) {
const area : string = authors[r].area;
const dept : string = authors[r].dept;
+ if (regions == "USA") {
+ if (dept in countryInfo) {
+ continue;
+ }
+ }
const areaDept : string = area+dept;
if (!(areaDept in areaDeptAdjustedCount)) {
areaDeptAdjustedCount[areaDept] = 0;
@@ -451,6 +492,7 @@ function rank() : boolean {
const displayPercentages = Boolean(parseInt(jQuery("#displayPercent").find(":selected").val()));
/* Show the top N (with more if tied at the end) */
const minToRank = 50; /* parseInt(jQuery("#minToRank").find(":selected").val()); */
+ const whichRegions = jQuery("#regions").find(":selected").val();
var numAreas = 0; /* Total number of areas checked */
@@ -467,7 +509,7 @@ function rank() : boolean {
const coauthorList = computeCoauthors(coauthors, startyear, endyear, weights);
countPapers(areacount, areaAdjustedCount, areaDeptAdjustedCount, authors, startyear, endyear, weights);
- buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights);
+ buildDepartments(areaDeptAdjustedCount, deptCounts, deptNames, facultycount, facultyAdjustedCount, authors, startyear, endyear, weights, whichRegions);
/* (university, total or average number of papers) */
var univagg = computeStats(deptNames, areaAdjustedCount, areaDeptAdjustedCount, areas, numAreas, displayPercentages, weights);
Oops, something went wrong.

0 comments on commit 97fd75b

Please sign in to comment.