addTooltips(
Plot.plot({
grid: true,
x: {
label: "Percentage of a denomination in an urban population →",
tickFormat: ".0%",
},
y: {
label: "↑ City population in 1926",
type: "log",
},
marks: [
Plot.ruleX([0]),
Plot.dot(combined, {x: d => (d.members / d.population_1926),
y: "population_1926",
r: "churches",
stroke: "group",
title: (d) => `${d.group} denominations in ${d.city}, ${d.state} in 1926 \n members: ${d.members} \n churches: ${d.churches} \n denominations: ${d.denominations}`
})
],
color: {
legend: true,
}
})
)