{
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 eventsByDepth = vl.markBar()
.title('Events by Depth (km)')
.data(earthquakes)
.encode(
vl.x().fieldQ('depth').bin({ maxbins:30}).title('Depth'),
vl.y().count().title(null)
)
.width(width * 0.40)
.height(200)
const eventsPerHour = vl.markLine()
.title('Events per Hour')
.data(earthquakes)
.encode(
vl.x().fieldT('origintime').timeUnit('hoursdatemonth').title('Date').axis({tickCount: 10}),
vl.y().count().title(null)
)
.width(width)
.height(150)
return vl.vconcat(vl.hconcat(vl.vconcat(magBarChart, eventsByDepth), map_view), eventsPerHour)
.resolve({scale: {size: 'independent'}})
.render()
}