data = d3
.csv(
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTX-fbHzk70bzNUMJxwNKsMnkEbtXJ0SPh9Fa8HZy-NRbn2gg721RIWD-wvFZv5xZta7uZLVJOgKgN2/pub?gid=0&single=true&output=csv"
)
.then((res) => {
for (let d of res) {
d.name = `${d["First Name"]} ${d["Last Name"]}`;
d.nameArray = d.name.split(" ");
d.date = dateFmt(d["Year Highest Degree Received"]);
d.type = "Faculty";
d["Interdisciplinary College 4"] = "Khoury College of Computer Sciences";
d["Job Title"] = d["Job Profile"];
if (dDataScrapped.has(d.name)) {
const s = dDataScrapped.get(d.name);
d.Campus = s.location;
d["Job Title"] = d.position;
}
d.Campus = d.Campus == "NU Boston Campus" ? "Boston": d.Campus;
d.photo = photosMap.get(d.name);
}
const dData = new Map(res.map(d => [d.name, d]));
for (let d of facultyFromScrape.filter(d => !dData.has(d.name))) {
res.push({
...d,
name: d.name,
"First Name": d.name.split(" ")[0],
"Last Name": d.name.split(" ").slice(1).join(" "),
"Job Profile": d.position,
"Title": d.position,
"Job Title": d.position,
Campus: d.location,
"Interdisciplinary Dept 1": "Khoury",
"Interdisciplinary College 1": "Khoury College of Computer Sciences",
"Interdisciplinary College 4": "Khoury College of Computer Sciences",
"Interdisciplinary College 3": "",
"Interdisciplinary College 2": "",
"Research Areas": "AI",
"Academic Track Type": "",
date: new Date(),
type: "Faculty",
})
}
return res;
})