Published
Edited
Feb 28, 2022
Insert cell
Insert cell
// This will alert you of formatting errors if you make any.
parsedConfig = sc.credequate.config.configsByTargetParser.parseOrThrow(sourcecredConfig)
Insert cell
sourcecredConfig = ({
"453243919774253079": [
{
memo: "Initial Config",
startDate: "1/1/2021",
weights: [
{
key: "emoji",
default: 1,
subkeys: [
{
subkey: ":value2:",
weight: 2
},
{
subkey: ":value3:",
weight: 3
},
{
subkey: ":value5:",
weight: 5
},
{
subkey: ":value8:",
weight: 8
},
{
subkey: ":value13:",
weight: 13
},
{
subkey: "sourcecred:626763367893303303",
weight: 3
},
{
subkey: "👎",
weight: 0
}
]
},
{
key: "role",
default: 0,
subkeys: [
{
subkey: "477551557723029514",
weight: 2,
memo: "contributors"
},
{
subkey: "717905734863421472",
weight: 1,
memo: "community"
}
]
},
{
key: "channel",
default: 1,
subkeys: [
{
subkey: "743545520445718700",
weight: 8,
memo: "meeting-notes"
},
{
subkey: "718512695875469353",
weight: 0.1,
memo: "announcements"
},
{
subkey: "454007860926611478",
weight: 3,
memo: "any-questions"
},
{
subkey: "679064720375808026",
weight: 15,
memo: "props"
},
{
subkey: "543168537062014987",
weight: 12,
memo: "did-a-thing"
}
]
},
{
key: "category",
default: 1,
subkeys: []
}
],
operators: [
{
key: "reactionsAcrossParticipants",
operator: "AVERAGE"
},
{
key: "reactionsOfSingleParticipant",
operator: "MAX"
}
],
shares: [
{
key: "author",
default: 1,
subkeys: [
{
subkey: "743545520445718700",
weight: 0.05,
memo: "meeting-notes"
},
{
subkey: "679064720375808026",
weight: 0,
memo: "props"
}
]
},
{
key: "mention",
default: 1,
subkeys: []
}
]
}
]
})
Insert cell
credGrainViewCredTable(credGrainView, 10)
Insert cell
Insert cell
Insert cell
import {spacer, credGrainViewCredTable} from "@sourcecred/quick-imports"
Insert cell
sc = require("sourcecred@0.10.3")
Insert cell
instance = sc.instance.readInstance.getRawGithubReadInstance("sourcecred","cred2","gh-pages")
Insert cell
ledger = instance.readLedger()
Insert cell
contributions = (await instance.readPluginContributions("sourcecred/discord")).contributionsByTarget["453243919774253079"]
Insert cell
credequateInput = instance.readCredequateInput()
Insert cell
credequateOutput = Array.from(sc.api.credequate.credequate({
...credequateInput,
rawInstanceConfig: {
"credEquatePlugins": [
{
"id": "sourcecred/discord",
"configsByTarget": parsedConfig,
}
]
}
}).scoredContributions)
Insert cell
credGrainView = {
return sc.core.CredGrainView.fromScoredContributionsAndLedger(
credequateOutput,
ledger,
sc.credequate.config.getEarliestStartForConfigs([parsedConfig])
)
}
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