Public
Edited
Jan 3, 2024
Importers
Insert cell
Insert cell
function stats(app) {
let stats;

app
.on("beforeAll", () => {
const canvas = app.node();
stats = new Stats();
stats.dom.style.position = "inherit";
stats.dom.style.marginBottom = "0.5em";
requestAnimationFrame(() => {
canvas.parentNode.insertBefore(stats.dom, canvas);
});
})
.on("beforeEach", () => {
stats.begin();
})
.on("afterEach", () => {
stats.end();
})
.on("afterAll", () => {
stats.dom.remove();
});
}
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