Published
Edited
Jun 7, 2020
1 fork
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
hash = "43101d7aa68d4220281cbe51464663808324463e"
Insert cell
last_week_hash="bba8eca07f2137668623133f17a0ac9d7a126992"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
balance = aliasMap(a => {
return pastPayout.get(a) + fastPayout.get(a) + slowPayout.get(a);
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
users = {
const aliases = new Set(scores.users);
return Array.from(aliases);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
totalProportion = aliasMap((a) => totalCred.get(a) / sumTotalCred)
Insert cell
totalCred = aliasMap((a) => d3.sum(intervalCred.has(a) ? intervalCred.get(a).slice(0,last_week_idx+1) : 0))
Insert cell
Insert cell
sumTotalCred = d3.sum(Array.from(totalCred.values()))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
MIN_ACTIVE_CONTRIB_XP = 20
Insert cell
SEED_PER_WEEK_PER_CONTRIB = 50
Insert cell
activeContributors = scores.intervals.map((interval, i) => {
const contribs = scores.users.reduce(
(acc, user) => user.intervalCred[i] >= MIN_ACTIVE_CONTRIB_XP ? acc.concat(addressToAlias(user.address)) : acc,
[],
);
return contribs;
}
)
Insert cell
seedPerInterval = activeContributors.map(contribs => SEED_PER_WEEK_PER_CONTRIB * (contribs.length + 1))
Insert cell
totalSeed = d3.sum(seedPerInterval)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
percentFormat = d3.format(".1%")
Insert cell
Insert cell
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