Published
Edited
Apr 22, 2022
1 fork
7 stars
Insert cell
Insert cell
viewof n = Inputs.range([1, maxN], { step: 1 })
Insert cell
Insert cell
shuffle
Insert cell
chart = html`
<svg width="${width}" height="${height}">
${circles.slice(0, n)}
</svg>
`
Insert cell
circles = {
shuffle;
return Array.from({ length: maxN }).map(
() =>
`<circle
cx=${Math.random() * width}
cy=${Math.random() * height}
r=${Math.random() * maxR}
fill = #${Math.floor(Math.random()*256**3).toString(16)}
></circle>`
);
}
Insert cell
maxR = 20
Insert cell
height = 300
Insert cell
maxN = 700
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