viewof dashboard = {
const barras = vl.markBar()
.encode(
vl.x().fieldN('Primary Type').title('Primary Type'),
vl.y().count().title(null),
vl.color().fieldN('Primary Type').title('Crime Type')
)
const barrasLayer = vl.layer(
barras.params(brush).encode(vl.color().value("lightgrey")),
barras.transform(vl.filter(brush))
)
.title("Number of Crimes by Type")
.data(crimes)
.width(300)
.height(200)
const linhas = vl.markLine()
.data(crimes)
.transform(vl.filter(brush))
.encode(
vl.x().fieldT("Date").timeUnit("monthdate").title("Date (month-date)"),
vl.y().count().title(null),
vl.color().fieldN("Primary Type")
)
.width(300)
.height(200)
.title("Number of Crimes by Day")
return vl.hconcat(top_view, vl.vconcat((barras, barrasLayer), linhas)).title({text: "Crimes in Chicago in April 2025", fontSize: 26}) .render()
}