viewof emdia = {
const brush = vl.selectInterval()
.encodings('x');
const MEDV = vl.markBar({width: 4})
.data(data)
.params(brush)
.encode(
vl.x().fieldQ('table').title('table'),
vl.y().count().title(null)
)
.width(600)
.height(50);
const ratings = vl.markCircle()
.data(data)
.encode(
vl.x().fieldQ('carat'),
vl.y().fieldQ('price'),
vl.tooltip(['carat','clarity','color','cut','depth','name','price','table','x','y','z']),
vl.opacity().if(brush, vl.value(0.75)).value(0.25)
)
.width(600)
.height(400);
return vl.vconcat(MEDV, ratings).spacing(5).render();
}