data = {
const urls = {
nodes:
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTz_3alkMj1NY56P4ZJzBVjmgVDFN71XVCjmSK6rQX45awfBgXetpVI23xvEsKa39Jsz2NW-JvF7OYW/pub?gid=305618985&single=true&output=tsv",
links:
"https://docs.google.com/spreadsheets/d/e/2PACX-1vTz_3alkMj1NY56P4ZJzBVjmgVDFN71XVCjmSK6rQX45awfBgXetpVI23xvEsKa39Jsz2NW-JvF7OYW/pub?gid=624273204&single=true&output=tsv"
};
const _nodes = await d3.tsv(urls.nodes);
const _links = await d3.tsv(urls.links);
const groups = Object.fromEntries(
[...new Set(_nodes.map((node) => node.group))]
.sort()
.map((d, ix) => [d, ix])
);
const links = _links.map((link) =>
Object.assign({
source: link.source,
target: link.target,
link
})
);
const validLinks = _.flatten(links.map((l) => [l.source, l.target]));
const nodes = _nodes
.map((node) =>
Object.assign({
id: node.id,
group: groups[node.group],
node
})
)
.filter((d) => validLinks.includes(d.id));
return { nodes, links };
}