Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
const vgSpec = vl.compile(spec).spec
const runtime = vega.parse(vgSpec)
const view = new vega.View(runtime, {
loader,
logLevel,
renderer
})
.initialize(this.nodeRef.current)
.change('source', vega.changeset().insert(data))
try {
VegaTooltip(view)
} catch (e) {}
this.view = view
await view.runAsync()
onViewRender && onViewRender(view)
} catch (e) {}
}