chart = {
const brush = vl.selectInterval();
const sp = (xAttr, yAttr) =>
vl.markCircle({ tooltip: true }).encode(
vl
.x()
.fieldQ(xAttr)
.scale({ zero: false }),
vl
.y()
.fieldQ(yAttr)
.scale({ zero: false })
);
const overview = sp("distance", "delay")
.select(brush)
.encode(
vl
.color()
.value("steelblue")
.if(brush, vl.value("firebrick"))
)
.width((width * 0.8) / 3)
.height((width * 0.8) / 3),
detail = sp("distance", "delay")
.transform(vl.filter(brush))
.width((width * 0.8 * 2) / 3)
.height((width * 0.8 * 2) / 3);
return vl
.concat(overview, detail)
.data(flights)
.render();
}