Published
Edited
Dec 2, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
reset, chart.reset()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
percentageY = d3.scaleLinear()
.range([0, 1])
.domain([0, 195])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
yAxis = (g, y) => g
.call(d3.axisLeft(y).ticks(12 * k))
.call(g => g.select(".domain").attr("display", "none"))
.call(g => g.append("text")
.style("font-size", "18px")
.attr("transform", `rotate(${-90})`)
.attr("x", -height/2)
.attr("y", -margin.left/2)
.attr("fill", "grey")
.attr("text-anchor", "middle")
.text("Percentage of Labour MPs on twitter following"))
Insert cell
Insert cell
k = height / width
Insert cell
height = width
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