Published
Edited
Jan 15, 2022
Insert cell
Insert cell
Insert cell
Insert cell
svg = {
const svg = DOM.svg(450,450);
d3.select(svg)
.selectAll("path")
.data(d3.pie().value(d => d.value)(dataset))
.enter()
.append("path")
.attr("transform", "translate(" +450 / 2 + "," + 450 / 2 + ")")
.attr('fill', d => color(d.data.name))
.style("opacity", 0.7)
.attr("d", d3.arc().innerRadius(170).outerRadius(Math.min(450,450) / 2));
return svg;
}
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