Published
Edited
Sep 17, 2019
1 fork
10 stars
Insert cell
Insert cell
Insert cell
vega_explicit = {
const [Vega, VegaLite] = await Promise.all([
require("vega@5/build/vega.min.js"),
require("vega-lite@3/build/vega-lite.min.js")
]);
return async spec => {
const div = document.createElement("div");
const view = new Vega.View(Vega.parse(VegaLite.compile(spec).spec));
await view.initialize(div).runAsync();
return div;
};
}
Insert cell
vega_explicit({
data: {url: "https://vega.github.io/vega-lite/data/seattle-weather.csv"},
mark: "tick",
encoding: {
x: {field: "precipitation", type: "quantitative"}
}
})
Insert cell
Insert cell
vega_embed = require("vega-embed@5")
Insert cell
vega_embed({
data: {url: "https://vega.github.io/vega-lite/data/seattle-weather.csv"},
mark: "tick",
encoding: {
x: {field: "precipitation", type: "quantitative"}
}
})
Insert cell
Insert cell
vegalite = require("@observablehq/vega-lite@0.2")
Insert cell
vegalite({
data: {url: "https://vega.github.io/vega-lite/data/seattle-weather.csv"},
mark: "tick",
encoding: {
x: {field: "precipitation", type: "quantitative"}
}
})
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