{
const tempMinMax = vl.markArea({opacity: 0.3})
.data(weather_)
.encode(
vl.x().month('date'),
vl.y().average('temp_max'),
vl.y2().average('temp_min'),
vl.color().fieldN('nyc').legend(null)
);
const tempMid = vl.markLine()
.data(weather_)
.transform(
vl.calculate('(datum.temp_min + datum.temp_max) / 2').as('temp_mid')
)
.encode(
vl.x().month('date'),
vl.y().average('temp_mid'),
vl.color().fieldN('location')
);
return vl.layer(tempMinMax, tempMid)
.resolve({"scale": {"color": "independent"}}).render();
}