mapchoro = vl.markGeoshape({stroke: '#888', strokeWidth: 0.25})
.data(bairros.features)
.transform(
vl.lookup('properties.NOME').from(vl.data(homicides).key('Bairro').fields('Bairro', 'Homicidios', 'Populacao')),
vl.calculate('(datum.Homicidios/datum.Populacao) * 100000').as('Taxa')
)
.encode(
vl.color().fieldQ('Taxa').scale({domain: [0, 250], type: 'quantize', clamp: true, scheme: {name: 'blues', count: 9}}).legend({title: 'Homicídios por 100 mil habitantes'}),
vl.tooltip([{field:'Bairro'} ,
{field:'Taxa', format: '.2f'}])
)
.project(vl.projection('mercator'))
.width(850).height(500)
.render()