viewof marginalHistograms_1 = {
const x = vl.x().fieldQ("A").scale({ zero: false });
const y = vl.y().fieldQ("B").scale({ zero: false });
const color = vl.color().fieldN("type").scale({ scheme: "set2" });
const scatter = vl.markCircle({opacity: 0.5, size: 15})
.encode(x, y, color);
const right = vl.markBar()
.encode(
y.axis(null),
vl.x().count(),
color
)
.width(50);
const top = vl.markBar()
.encode(
x.axis(null),
vl.y().count(),
color
)
.height(50);
return vl.vconcat(top, vl.hconcat(scatter, right))
.data(data)
.config({ concat: { spacing: 0 } })
.render();
}