Published
Edited
Mar 25, 2020
Insert cell
Insert cell
svg = {
let height = 600;
const svg = DOM.svg(width,height);
let centerX = width/2;
let centerY = height/2;
let circleCount = 100;
let radius = 100;
let circleArray = [];
for (let i = 0; i < circleCount; i++) {
circleArray[i] = i;
}
d3.select(svg).selectAll("circle")
.data(circleArray)
.enter()
.append("circle")
.attr("fill","none")
.attr("stroke","black")
.attr("stroke-width",1)
.attr("r",radius)
.attr("cx",centerX)
.attr("cy",d => radius+d*4);

return svg;
}
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