Published
Edited
Feb 10, 2020
Insert cell
Insert cell
Insert cell
data = [{x:0, y:0}, {x:300, y:150}, {x:475, y:221}, {x:50, y:100}, {x:600, y:300}, ]
Insert cell
data[0].x
Insert cell
{
var svg = d3.select(DOM.svg(600,300)).attr("style","background:white;border:1px solid black")
for(var i =0; i<data.length; i++) {
svg.append ("circle")
.attr ("r", 20)
.attr ("fill", "cornflowerblue")
.attr ("stroke", "black")
.attr ("cx", data[i].x)
.attr ("cy", data[i].y)
}
return svg.node()
}
Insert cell
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