Public
Edited
May 6
Insert cell
Insert cell
viewof select = Inputs.select(
["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
{label: "Select a letter"}
)

Insert cell
selectedValue = select
Insert cell
Plot.plot({
projection: "albers-usa",
marks: [
Plot.geo(countymesh, {strokeWidth: 0.1}),
Plot.geo(statemesh, {strokeWidth: 0.5}),
Plot.dot(
counties,
Plot.centroid({
filter: (d) => d.properties.name.match(new RegExp(`^${selectedValue}`)),
fill: "red",
tip: true
//,stroke: "red"
})
)
]
})

Insert cell
us = FileAttachment("us-counties-10m.json").json()
Insert cell
counties = topojson.feature(us, us.objects.counties).features
Insert cell
countymesh = topojson.mesh(us, us.objects.counties)
Insert cell
statemesh = topojson.mesh(us, us.objects.states)
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