stations = {
const data = await d3.csv("https://gist.githubusercontent.com/clhenrick/a585388c95c14074ebe512458e359197/raw/189cfaa73aa6dc0676e33fed17c22158b40394fe/nyc_subway_names_lines.csv")
console.log(data);
return data
.sort((a, b) => {
const nameA = a.name.toUpperCase();
const nameB = b.name.toUpperCase();
return nameA.localeCompare(nameB, "en", {numeric: true, sensitivity: 'base'});
})
.reduce((acc, cur, i) => {
const re = RegExp("Express")
const name = cur.name;
let line = cur.line
.split("-")
.sort()
.filter(d => d.indexOf("Express") === -1);
if (acc.get(name)) {
acc.set(`${name}%${i}`, new Set([...line]))
} else {
acc.set(name, new Set(line));
}
return acc;
}, new Map());
}