Public
Edited
Jan 27, 2023
Insert cell
Insert cell
data = FileAttachment("scatter_data@9.csv").csv({typed: true})
Insert cell
plotData = data.filter(d => d.place == state)
Insert cell
states = [...new Set(data.map(d => d.place).sort())]
Insert cell
viewof state = Inputs.select(states, { label: "State" })
Insert cell
viewof correlate = Inputs.select(
["p_black", "p_hisp", "p_noncit", "p_pov", "mdn_educ"], { label: "Correlate" }
)
Insert cell
plot = {
return Plot.plot({
inset: 8,
grid: true,
color: {
legend: true,
},
marks: [
Plot.dot(plotData, {x: correlate, y: "ees_per_capita"}),
Plot.linearRegressionY(plotData, {x: correlate, y: "ees_per_capita"})
],
// style: {
// background: "black",
// color: "white"
// }
})
}
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