viewof circles = {
var width = 300
var height = 200
const context = DOM.context2d(width, height);
const canvas = context.canvas;
var radius = 2
const circles = canvas.value = [{x: 100, y: 100, r:60}, {x: 190, y: 100, r:30}, {x: 225, y: 100, r:5}];
function render() {
context.clearRect(0, 0, width, height);
for (const {x, y, r} of circles) {
context.beginPath();
context.moveTo(x + radius, y);
context.arc(x, y, r, 0, 2 * Math.PI);
context.fill();
context.lineWidth = 2;
context.stroke();
}
}
render();
return canvas;
}