This took quite a bit of figuring out because the web is littered with Vega 2 examples but Vega 3 is a bit different.
https://vega.github.io/vega/docs/api/view/#view_change
var spec = {
data: {"url": "https://fivethirtyeight.datasettes.com/fivethirtyeight-45d758d/most-common-name%2Fsurnames.json?_shape=array"},
mark: "bar",