Published
Edited
Dec 8, 2021
Insert cell
Insert cell
Insert cell
Insert cell
md`# Settings`
Insert cell
repoAndBranch = "sourcecred/cred/gh-pages"
Insert cell
addressSeparator = "/"
Insert cell
batchSize = 800000
Insert cell
md`<br/><br/><br/><br/>
# Behind the Scenes`
Insert cell
joinHtml = (arr) => {
let result = html``;
arr.forEach((element) => (result = html`${result} ${element}`));
return result;
}
Insert cell
batch = (arr, batchSize) => {
let result = [];
let backlog = arr;
while (backlog.length) {
result.push(backlog.slice(0, batchSize));
backlog = backlog.slice(batchSize);
}
return result;
}
Insert cell
import { serialize } from "@palewire/saving-csv"
Insert cell
escapedRepoBranch = repoAndBranch.replace(/[\/\\\.]/g, "_")
Insert cell
improveNAddress = (a, n = Infinity) =>
nodeModule.toParts(a).slice(0, n).join(addressSeparator)
Insert cell
improveEAddress = (a, n = Infinity) =>
edgeModule.toParts(a).slice(0, n).join(addressSeparator)
Insert cell
nodeModule = sc.core.address.makeAddressModule({
name: "NodeAddress",
nonce: "N",
otherNonces: new Map().set("E", "EdgeAddress")
})
Insert cell
edgeModule = sc.core.address.makeAddressModule({
name: "EdgeAddress",
nonce: "E",
otherNonces: new Map().set("N", "NodeAddress")
})
Insert cell
sc = await require("sourcecred@latest")
Insert cell
credGraph = loadCredGraph(repoAndBranch)
Insert cell
import { loadCredGraph } from "@sourcecred/quick-imports"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more