Published
Edited
Feb 2, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
specBasic = ({
width: 500,
data: { url: url, format: { type: "arrow" } },
mark: { type: "point" },
encoding: {
x: { field: "AIR_TIME", type: "quantitative" },
y: { field: "ARR_DELAY", type: "quantitative" }
}
})
Insert cell
specIntegrated = {
const result = _.cloneDeep(specBasic);

result.title = "Reactive value used in spec definition";
result.mark.opacity = opacity;

return result;
}
Insert cell
specView = {
const result = _.cloneDeep(specBasic);

result.title = "Rective value used with view API";
result.params = [{ name: "opacity", value: 0.5 }];
result.mark.opacity = { signal: "opacity" };

return result;
}
Insert cell
chartView.signal("opacity", opacity).runAsync()
Insert cell
Insert cell
embed = {
const embed = await require('vega-embed');
const loader = await require('vega-loader-arrow');
embed.vega.formats('arrow', loader); // register arrow as a supported format
return embed;
}
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