Published
Edited
Sep 19, 2020
Fork of Axes
Insert cell
Insert cell
svg = {
const svg = html`<svg id = "svg"></svg>`
const container = d3.select(svg)
const scale = d3.scaleLinear().domain([0,10]).range([30,570])
const axis = container.append("g").attr("transform","translate(0,150)")
d3.axisBottom(scale)(axis)
for(let i = 0;i < 20; i = i + 1){
const x = Math.random()*10
container.append("circle")
.attr("r",5)
.attr("cy",150)
.attr("cx",scale(x))
}
return svg
}
Insert cell
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