Published
Edited
Sep 5, 2022
Insert cell
## GROUPING SVG elements
Insert cell
height= 200
Insert cell
data_arr= Array.from( { length: 100}).map( d => ({
x: Math.random() * width,
y: Math.random() * height
}))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`
<svg viewBox= "0 0 ${width} ${height}">
${ data_arr.map(
d=>
`<g transform= "translate( ${d.x}, ${d.y})">

<circle r="3"/>
<text >N</>
</g>`
)}
</svg>
`
Insert cell
Insert cell
html`
<svg viewBox= "0 0 ${width} ${height}">

${data_arr.map( d=>
`<g transform= "translate( ${d.x}, ${d.y})">
<circle fill="green" r="3"/>
</g>`
)}
<path stroke="blue" fill= "none" d= "$"
</svg>
`
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