vl.spec({
mark: { type: 'geoshape', stroke: '#aaa', strokeWidth: 0.25 },
data: { values: countiesData },
transform: [
{
lookup: 'id',
from: { data: { values: waPopulation }, key: 'GEOID_TIGER', fields: ['County', 'Estimate2022'] }
},
],
encoding: {
color: {
field: 'Estimate2022', type: 'Q',
scale: { scheme:'viridis', domain: [0, 3000000], clamp: true },
legend: { orient: "top-left" }
},
tooltip: {field: 'County', type: 'N' }
},
projection: { type: 'mercator', feature: 'counties'},
width: width,
height: height
})
.render()