Published
Edited
Jan 15, 2020
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
sc = sc_mod.default
Insert cell
loadTimelineCred = async (url) => {
const file = await fetch(url);
const json = await file.json();
return sc.analysis.timeline.timelineCred.TimelineCred.fromJSON(json);
}
Insert cell
tc = loadTimelineCred(distribution_history_file)
Insert cell
lastIntervalIndex = tc.intervals().length - 2;
Insert cell
lastInterval = tc.intervals()[lastIntervalIndex]
Insert cell
Insert cell
Insert cell
lastWeekCredNodes = nonUserCredNodes.map((x) => {
return {node: x.node, cred: x.cred[lastIntervalIndex]}
}).sort((a,b) => b.cred-a.cred).filter((x)=>x.cred>1)
Insert cell
sc
Insert cell
d3 = require("d3@5")
Insert cell
hash = "c83d6bbe1d7130425a6e268356fe719484f268cc"
Insert cell
credFormat = d3.format(".1f")
Insert cell
distribution_history_file = `https://raw.githubusercontent.com/sourcecred/cred/${hash}/docs/api/v1/data/projects/QHNvdXJjZWNyZWQ/cred.json`
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