Public
Edited
Nov 6, 2023
1 fork
4 stars
Insert cell
Insert cell
svg`<svg width="${width}" viewBox="0 0 200 100">
<g transform="translate(50, 45)">
${array(4000).map(i => {
let radius = random() * 45
let angle = random(TAU)
let x = Math.cos(angle) * radius
let y = Math.sin(angle) * radius
return `<line x1="${x}" y1="${y}" x2="${x}" y2="${y}" stroke="black" stroke-width=".5" stroke-linecap="round"/>`
}).join('')}
</g>
<text text-anchor="middle" x="50" y="98" fill="black" style="font: italic 5px sans-serif;">r = random() * radius</text>


<g transform="translate(150, 45)">
${array(4000).map(i => {
let radius = Math.sqrt(random()) * 45
let angle = random(TAU)
let x = Math.cos(angle) * radius
let y = Math.sin(angle) * radius
return `<line x1="${x}" y1="${y}" x2="${x}" y2="${y}" stroke="black" stroke-width=".5" stroke-linecap="round"/>`
}).join('')}
</g>
<text text-anchor="middle" x="150" y="98" fill="black" style="font: italic 5px sans-serif;">r = sqrt(random()) * radius</text>
</svg>`
Insert cell
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