Published
Edited
Jun 2, 2020
Insert cell
Insert cell
viewof graphic = {
return html`${viewof blueDiv}${viewof redDiv}`
}
Insert cell
viewof blueDiv = {
yield coloredDiv("blue")
}
Insert cell
viewof redDiv = {
yield coloredDiv("red")
}
Insert cell
function coloredDiv(color) {
let w = 40
let h = 40
const container = document.createElement('div');
container.style.position = "relative";
container.style.width = w + 'px';
container.style.height = h + 'px';
container.style.backgroundColor = color;
return container
}
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