Public
Edited
Jan 31, 2023
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
screenshot20230131At132510 = FileAttachment("Screenshot 2023-01-31 at 13.25.10.png").image()
Insert cell
Insert cell
Insert cell
rawrawData
select year, member, votes/ballots as turnout, ballots from rawrawData
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// sortedYearsR = d3.rollups(years, v => v.length, d => d).sort((a, b) => d3.descending(a[1], b[1])).map(d => d[0]).reverse()
Insert cell
// sortedYears = d3.rollups(years, v => v.length, d => d).sort((a, b) => d3.descending(a[1], b[1])).map(d => d[0])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
rawData = getExpandedData(rawrawData)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
legend_size = 15
Insert cell
opacity = d3.scaleOrdinal().domain([0, 1]).range([0.3, 1])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// yScale = d3.scaleBand(sortedYears, yRange).paddingInner(yPadding);
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
py_colors = ({
grey: "#646464",
sunglow: "#FFD43B",
shandy: "#FFE873",
lapislazuli: "#306998",
azure: "#4B8BBE"
})
Insert cell
georgi_colors = ({
grey: "#15151b",
dark: "#6917D0",
mid: "#07BEB8",
light: "#FF1791",
shandy: "#FFE873",
text: "white"
})
Insert cell
colors = ({
background: "#d8d6a4",
textcolor: "#864e1b",
light: "#aabba3",
dark: "#cc7420",
mix: "#799368"
})
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more