Public
Edited
Mar 31, 2021
10 stars
Insert cell
Insert cell
Insert cell
Insert cell
{
const svg = d3.create("svg")
.attr("width", "500")
.attr("height", "200")
.attr("id", "svg");
let rect = svg.append("rect")
.attr("x", "220")
.attr("y", "80")
.attr("width", "100")
.attr("height", "50")
.attr("class", "rect");

return svg.node();
}
Insert cell
Insert cell
html`
<style type="text/css">

#svg {
background-color: black;
}

.rect {
fill: white;
}

</style>
`
Insert cell
Insert cell
d3 = require("d3@6")
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