Published
Edited
Apr 19, 2019
7 stars
Insert cell
Insert cell
Insert cell
Insert cell
// A simple function to show a Vega specification in an Observable cell, and
// bind the Vega View instance as the value property of the container div.
plot = function(spec) {
const div = html`<div></div>`;
div.value = new vega.View(vega.parse(spec)).renderer('svg').initialize(div).run();
return div;
}
Insert cell
// use addArrowFormat utility, see import below
vega = addArrowFormat(await require('vega@5'))
Insert cell
import {addArrowFormat} from '@vega/vega-utilities'
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more