Published
Edited
Sep 14, 2020
Insert cell
Insert cell
svg = {
const svg = html`<svg id= "svg" ></svg>`
const container = d3.select(svg)
const pathData = d3.line().x(d => d.x).y(d => d.y).curve(d3.curveStep)(data)
container.append("path")
.attr("stroke", "black")
.attr("fill", "none")
.attr("d", pathData)
return svg
}
Insert cell
data = {
const data = []
for(let i = 0; i < 100; i = i + 1){
data.push({x:Math.random()*600, y:Math.random()*300 })
}
return data
}
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