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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more