Public
Edited
Feb 8, 2023
Insert cell
Insert cell
WIDTH = 600
Insert cell
HEIGHT = 600
Insert cell
canvas = {
const ct = DOM.context2d(WIDTH, HEIGHT);
ct.canvas.ct = ct;

const s = ct.canvas.style;
s.margin = `0 ${(width - WIDTH) / 2}px`;
//s.backgroundColor = "blue";
s.border = "1px solid #333";

ct.setTransform(1,0,0,1, WIDTH, HEIGHT);
ct.strokeStyle = "white";
ct.lineWidth = 2;

ct.drawImage(cat, -200, -200);
return ct.canvas;
}
Insert cell
cat = FileAttachment("cat-400-400.jpg").image()
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