Learn more about [how Vega works here](https://observablehq.com/@vega/how-vega-works).
vega=require("vega")
dataflowSpec=vega.parse(inputSpec,{ast:true})
view1=newvega.View(dataflowSpec)
{
constdiv=document.createElement("div");
div.value=view1.initialize(div).run();
returndiv;
}
serialized=JSON.stringify(dataflowSpec)
deserialized=JSON.parse(serialized)
view2=newvega.View(deserialized)
{
constdiv=document.createElement("div");
div.value=view2.initialize(div).run();
returndiv;
}
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.