vl.spec({
mark: { type: 'geoshape', stroke: '#706545', strokeWidth: '0.5' },
data: { values: countiesData },
transform: [
{
lookup: "id",
from: {
data: { values: waPopulation },
key: "GEOID_TIGER",
fields: ["County", "Estimate2022"]
}
}
],
projection: {
type: 'mercator'
},
encoding: {
color: {
field: "Estimate2022",
type: "quantitative",
title: "Population (2022)",
scale: {
scheme: "blues"
}
},
tooltip: [
{field: "County", type: "nominal", title: "County"},
{field: "Estimate2022", type: "quantitative", title: "Population (2022)", format: ","}
]
},
width: width,
height: height
})
.render()