{
const magBarChart = vl.markBar()
.title("Number of events by Magnitude")
.data(earthquakes)
.encode(
vl.x().fieldQ('magnitude').bin({maxbins: 30}).title("Magnitude"),
vl.y().count().title(null)
)
.width(width*0.40)
.height(200)
const depBarChart = vl.markBar()
.title("Events by Depth")
.data(earthquakes)
.encode(
vl.x().fieldQ('depth').bin({maxbins: 30}).title("Depth"),
vl.y().count().title(null)
)
.width(width/2 - 40)
.height(180)
const eventsPerHour = vl.markLine()
.title("Events per Hour")
.data(earthquakes)
.encode(
vl.x().fieldT('origintime').timeUnit('hoursdatemonth'),
vl.y().count()
)
.width(width-40)
.height(150)
return vl
.vconcat(
vl.hconcat(
vl.vconcat(magBarChart,depBarChart),map_view),
eventsPerHour)
.resolve({scale: {size: 'independent'}})
.render();
}