Public
Edited
Oct 3, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof range = Inputs.range([0, 200], { label: "Quanti pallini?", step: 1 })
Insert cell
mySvg = {
let svg = d3.create("svg").attr("width", 200).attr("height", 200);

for (let i = 0; i < range; i++) {
let x = Math.random() * 200;
let y = Math.random() * 200;
let r = Math.random() * 4 + 1;

svg.append("circle").attr("cx", x).attr("cy", y).attr("r", r);
}

return svg.node();
}
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