Published
Edited
Dec 13, 2019
Insert cell
Insert cell
Insert cell
plot = function(spec, options) {
const div = html`<div></div>`;
const opt = Object.assign({
loader: vega.loader({baseURL: 'https://vega.github.io/vega-datasets/'}),
renderer: 'svg',
container: div
}, options);
div.value = new vega.View(vega.parse(spec), opt).run();
return div;
}
Insert cell
vega = {
const [vega, d3] = await Promise.all([
'vega@5',
'd3-geo-projection@2'
].map(module => require(module)));

addProjections(vega, d3, extendedProjections);
return vega;
}
Insert cell
Insert cell
extendedProjections = [
'naturalEarth1'
]
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