I have a small scatterplot that i want to brush in *x* and y*,* but it currently only selects along the *y* axis.
I cannot see what the problem is. Using vl API v5.
Code:
{
const selectBrush = vl.selectInterval();
return vl
.markCircle({ stroke: "black", strokeWidth: 1 })
.width(400)
.params(selectBrush)
.title({
text: "NonViolent Crime Totals by Neighbourhoods Summer 2016",
subtitle: headerString
})
// .title(headerString)
.data(crimeDensityTotal)
.encode(
vl
.size()
.fieldQ("population")
.legend({ orient: "right" })
.scale({ domain: [0, 50000] }),
vl
.y()
.fieldQ("sqm")
.title("Square M per person")
.scale({ domain: [0, 500] }),
vl
.x()
.fieldQ("Offense")
.aggregate("count")
.scale({ type: "log" })
.title("Total Crimes"),
vl
.color()
.scale({ range: OffenseCatColors })
.legend({ orient: "right" })
.if( selectBrush, vl.fieldN("Offense Category")).value("lightgrey")
).render();
}