Published
Edited
Sep 16, 2022
Insert cell
Insert cell
path = shape2path.rect()
.attr("x", d => d.x)
.attr("y", d => d.y)
.attr("width", d => d.w)
.attr("height", d => d.h)
.attr("rx", d => d.rx)
.attr("ry", d => d.ry);
Insert cell
{
const svg = d3.select(DOM.svg(width, height));
svg.append("rect")
.attr("transform", "translate(120)")
.attr("x", x)
.attr("y", y)
.attr("width", w)
.attr("height", h)
.attr("rx", rx)
.attr("ry", ry);
svg.append("path")
.datum({x, y, w, h, rx, ry})
.attr("d", path);
return svg.node();
}
Insert cell
Insert cell
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