Published
Edited
Apr 12, 2021
1 fork
Insert cell
Insert cell
repoAndBranch = "sourcecred/cred/gh-pages"
Insert cell
addressSeparator = "/"
Insert cell
Insert cell
md`<br/><br/><br/><br/>
# Behind the Scenes`
Insert cell
improveNAddress = a => nodeModule.toParts(a).join(addressSeparator)
Insert cell
improveEAddress = a => edgeModule.toParts(a).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
import { serialize } from "@palewire/saving-csv"
Insert cell
sc = await require("sourcecred@latest")
Insert cell
credGraph = loadCredGraph(repoAndBranch)
Insert cell
async function loadCredGraph(repoAndBranch) {
if (!repoAndBranch) return null;
const base = `https://raw.githubusercontent.com/${repoAndBranch}/`;
const instance = sc.instance.readInstance.getNetworkReadInstance(base);
try {
return instance.readCredGraph();
} catch (e) {
return e;
}
}
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