Published
Edited
Sep 16, 2022
Insert cell
Insert cell
path = shape2path.line()
.attr("x1", d => d.x1)
.attr("x2", d => d.x2)
.attr("y1", d => d.y1)
.attr("y2", d => d.y2);
Insert cell
{
const svg = d3.select(DOM.svg(width, height));
svg.append("path")
.datum({x1, x2, y1, y2})
.attr("d", path)
.style("stroke", "black");
return svg.node();
}
Insert cell
Insert cell
Insert cell
Insert cell
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