Public
Edited
Sep 24, 2023
13 stars
Also listed in…
Political Issues
Maps
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
five_thirty_eight = {
let five_thirty_eight_reduced = await FileAttachment(
"five_thirty_eight_reduced@1.json"
).json();
five_thirty_eight_reduced.forEach(function (o) {
o.purple_cnt = o.pc;
o.yellow_cnt = 15 - o.purple_cnt;
delete o.pc;
o.precincts.forEach(function (p) {
p.id = `precinct_${p.i}_${p.j}`;
p.color = p.c == "p" ? "purple" : "yellow";
delete p.c;
p.district = p.d;
delete p.d;
if (minorities.find((a) => a[0] == p.i && a[1] == p.j)) {
p.minority = true;
}
});
});
return five_thirty_eight_reduced;
}
Insert cell
import { setup_hexmap, minorities } from "@mcmcclur/setting-up-hexapolis"
Insert cell
import { Scrubber } from "@mbostock/scrubber"
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