{
const zoom = vl.selectInterval()
.encodings('x')
.bind('scales')
.name('zoom');
const area = vl.markArea({interpolate: 'monotone'}, {opacity: 0.7})
.params(zoom)
.encode(
vl.x().fieldT('date'),
vl.y().fieldQ('temp_min'),
vl.y2().fieldQ('temp_max'),
vl.color().fieldN('city')
)
.width(900)
.height(100);
const scatterplot = vl.markCircle({ size: 30 })
.transform(
vl.filter(zoom)
)
.encode(
vl.x().fieldQ('wind_avg').title("Average wind speed (mph)"),
vl.y().fieldQ('precipitation'),
vl.color().fieldN('city')
)
.width(300)
.height(200)
.facet({ column: vl.field('city') })
.params(zoom);
return vl.vconcat(scatterplot, area)
.data(weather)
.render();
}