Skip to content

Instantly share code, notes, and snippets.

@bkamapantula
Last active May 5, 2020 06:51
Show Gist options
  • Save bkamapantula/a607c19a3cb8f7adf9186cedf8c09474 to your computer and use it in GitHub Desktop.
Save bkamapantula/a607c19a3cb8f7adf9186cedf8c09474 to your computer and use it in GitHub Desktop.
update vega chart data
// where data is a JSON object
let changeset = vega.changeset().remove(() => true).insert(data)
view.change('table', changeset)
.run()
// and where view is
view = new vega.View(vega.parse(spec))
.renderer('svg')
.logLevel(vega.Warn)
.initialize('chart-container')
.hover()
.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment