Public
Edited
Apr 27, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
viewof plot = embed(vlSpec);
Insert cell
{
// Initialize the plot data using a changeSet.
const data = [
{"a": "A", "b": 28}, {"a": "B", "b": 55}, {"a": "C", "b": 43},
{"a": "D", "b": 91}, {"a": "E", "b": 81}, {"a": "F", "b": 53},
{"a": "G", "b": 19}, {"a": "H", "b": 87}, {"a": "I", "b": 52}
];
const changeSet = embed.vega.changeset().insert(data);
plot.change('table', changeSet).run();
return data;
}
Insert cell
{
// Manually set the value for a signal, to externally trigger a highlight event.
plot
.signal("highlight_tuple", {"unit":"","fields":[{"type":"E","field":"_vgsid_"}],"values":[3]})
.runAsync();
return plot.getState().signals;
}
Insert cell
Insert cell
Insert cell
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