Public
Edited
Mar 24, 2023
Insert cell
Insert cell
Insert cell
Insert cell
function calculateResults(values) {
const results = {
grant: 0,
deny: 0,
continue: 0,
cancelled: 0,
split: 0,
postpone: 0,
waive: 0,
stip: 0,
total: 0
};

values.forEach((r) => {
const result = r.result.toLowerCase();
if (result.includes("grant")) {
results.grant += 1;
} else if (result.includes("deny")) {
results.deny += 1;
} else if (result.includes("continue")) {
results.continue += 1;
} else if (result.includes("split")) {
results.split += 1;
} else if (result.includes("postpone")) {
results.postpone += 1;
} else if (result.includes("waive")) {
results.waive += 1;
} else if (result.includes("stip")) {
results.stip += 1;
}
results.total += 1;
});

return results;
}
Insert cell
Insert cell
// https://github.com/jeremiak/ca-bph-hearing-results/blob/main/hearing-results.json
fileFromGithub = FileAttachment("hearing-results.json").json()
Insert cell
endpoint = d3.json("https://ca-bph-hearing-results.netlify.app/stats.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