mapchoro = vl.markGeoshape({stroke: '#888', strokeWidth: 0.25})
.data(vl.topojson(bairros).feature('POLIGONAIS'))
.transform(
vl.lookup('properties.Name')
.from(vl.data(dadosComTaxa)
.key('Bairro')
.fields('Bairro', 'Número de Homicidios', 'taxaPor100mil'))
)
.encode(
vl.color().fieldQ('taxaPor100mil')
.scale({
domain: minMaxTaxa,
type: 'quantize',
clamp: true,
scheme: {name: 'blues', count: 12}
}),
vl.tooltip([
{field: 'Bairro', type: 'nominal'},
{field: 'Número de Homicidios', type: 'quantitative'},
{field: 'taxaPor100mil', type: 'quantitative', title: 'Taxa (por 100 mil)', format: '.1f'}
])
)
.project(vl.projection('mercator'))
.width(850).height(500)
.render()