Published
Edited
Jun 5, 2020
Insert cell
Insert cell
container = {
let w = 200
let h = 200
const container = document.createElement('div');
container.style.width = w + 'px';
container.style.height = h + 'px';
container.style.backgroundColor = "green";
const interior = document.createElement('div');
interior.style.width = w/2 + 'px';
interior.style.height = h/2 + 'px';
interior.style.backgroundColor = "blue";
container.appendChild(interior)
container.interior = interior
return container
}
Insert cell
container.onpointerdown = e => {
if (container.interior.contains(e.target)) {
++mutable click
}
};
Insert cell
mutable click = 0
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