Published
Edited
Jul 7, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mbfcCleaned.find(d => d.name === "Breitbart")
Insert cell
mbfcCleaned = {
const partisanIndex = (bias, reporting) => {
const biasIndex = bias => {
if (bias === "FN" || bias === "CP") {
return 3;
} else if (bias === "R") {
return 2;
} else if (bias === "RC") {
return 1;
} else if (bias === "C") {
return 0;
} else if (bias === "LC") {
return -1;
} else if (bias === "L") {
return -2;
} else {
return 0;
}
};

const reportingIndex = reporting => {
if (reporting === "VH") {
return 1;
} else if (reporting === "H") {
return 2;
} else if (reporting === "MF") {
return 3;
} else if (reporting === "M") {
return 4;
} else if (reporting === "L") {
return 5;
} else if (reporting === "VL") {
return 6;
} else {
return 0;
}
};

return biasIndex(bias) * reportingIndex(reporting);
};

return Object.values(mbfc.sources).map(
d => new Object({ name: d.n, domain: d.d, bias: partisanIndex(d.b, d.r) })
);
}
Insert cell
mbfc = d3.json(
await 'https://raw.githubusercontent.com/drmikecrowe/mbfcext/master/docs/v2/combined.json'
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
groupByTitle(cleanData(rawDataCI))
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
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
Insert cell
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