vega-lite api selectInterval() not working

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.

  const selectBrush = vl.selectInterval();

  return vl
    .markCircle({ stroke: "black", strokeWidth: 1 })
      text: "NonViolent Crime Totals by Neighbourhoods Summer 2016",
      subtitle: headerString
    // .title(headerString)

        .legend({ orient: "right" })
        .scale({ domain: [0, 50000] }),
        .title("Square M per person")
        .scale({ domain: [0, 500] }),
        .scale({ type: "log" })
        .title("Total Crimes"),
        .scale({ range: OffenseCatColors })
        .legend({ orient: "right" })
        .if( selectBrush, vl.fieldN("Offense Category")).value("lightgrey")

Can you share your example as a notebook?

There is a lot in this notebook but the simpler example is at the end as the single (nonfaceted) scatter plot.
Note that neither brush works, not even the solution copied from Jeff Heer’s example.

Your notebook seems to be private?

Public now


It seems that you can’t use a selection on an aggregated channel, at least not in multiple views (see docs):

vl.selectInterval().encodings(["x", "y"])

WARN Cannot project a selection on encoding channel “y” as it uses an aggregate function (“count”).

Thank you! That seems very limiting.