Public
Edited
Aug 22, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
width: 975,
height: 610,
projection: "identity",
color: {
type: "quantize",
n: 9,
domain: [1, 100],
scheme: "blues",
label: "No Computer or Internet Estimate (%)",
legend: true
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: d => nocomputer.get(d.id),
tip: true,
channels: {
County: d => d.properties.name,
State: d => statemap.get(d.id.slice(0,2)).properties.name
}
})),
Plot.geo(states, {stroke: "gray"})
]
})
Insert cell
nocomputer = new Map((await FileAttachment("data.csv").csv()).map(d => [d.id, +d["% No Computer or Internet Estimate"]]))
Insert cell
Plot.plot({
width: 975,
height: 610,
projection: "identity",
color: {
type: "quantize",
n: 9,
domain: [1, 100],
scheme: "blues",
label: "Crowded Conditions Estimate (%)",
legend: true
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: d => crowded.get(d.id),
tip: true,
channels: {
County: d => d.properties.name,
State: d => statemap.get(d.id.slice(0,2)).properties.name
}
})),
Plot.geo(states, {stroke: "gray"})
]
})
Insert cell
crowded = new Map((await FileAttachment("data.csv").csv()).map(d => [d.id, +d["% Crowded Conditions Estimate"]]))
Insert cell
Plot.plot({
width: 975,
height: 610,
projection: "identity",
color: {
type: "quantize",
n: 9,
domain: [1, 100],
scheme: "blues",
label: "HHs with Vulnerable Jobs (%)",
legend: true
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: d => jobs.get(d.id),
tip: true,
channels: {
County: d => d.properties.name,
State: d => statemap.get(d.id.slice(0,2)).properties.name
}
})),
Plot.geo(states, {stroke: "gray"})
]
})
Insert cell
jobs = new Map((await FileAttachment("data.csv").csv()).map(d => [d.id, +d["% HHs With Vulnerable Job Estimate"]]))
Insert cell
Plot.plot({
width: 975,
height: 610,
projection: "identity",
color: {
type: "quantize",
n: 9,
domain: [1, 100],
scheme: "blues",
label: "Single Parent Households (%)",
legend: true
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: d => singleparent.get(d.id),
tip: true,
channels: {
County: d => d.properties.name,
State: d => statemap.get(d.id.slice(0,2)).properties.name
}
})),
Plot.geo(states, {stroke: "gray"})
]
})
Insert cell
singleparent = new Map((await FileAttachment("data.csv").csv()).map(d => [d.id, +d["% Single Parent Estimate"]]))
Insert cell
=====Plot.plot({
width: 975,
height: 610,
projection: "identity",
color: {
type: "quantize",
n: 9,
domain: [1, 100],
scheme: "blues",
label: "Poverty Estimate (%)",
legend: true
},
marks: [
Plot.geo(counties, Plot.centroid({
fill: d => poverty.get(d.id),
tip: true,
channels: {
County: d => d.properties.name,
State: d => statemap.get(d.id.slice(0,2)).properties.name
}
})),
Plot.geo(states, {stroke: "gray"})
]
})
Insert cell
poverty = new Map((await FileAttachment("data.csv").csv()).map(d => [d.id, +d["% Poverty (SAIPE Estimate)"]]))
Insert cell
Insert cell
us = FileAttachment("counties-albers-10m.json").json()
Insert cell
counties = topojson.feature(us, us.objects.counties)
Insert cell
states = topojson.feature(us, us.objects.states)
Insert cell
statemap = new Map(states.features.map(d => [d.id, d]))
Insert cell
Insert cell
statemesh = topojson.mesh(us, us.objects.states, (a, b) => a !== b)
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