{
const svg = d3.create("svg").attr("viewBox", [0, 0, width, 500]).attr("transform", "scale(1,-1)");
const h = svg
.append("path")
.style("stroke", "lightblue")
.style("fill-opacity", "0.3")
.style("fill", "none");
const p = svg
.append("g")
.selectAll("circle")
.data(points)
.join("circle")
.attr("r", 4)
.attr("cx", d => d[0])
.attr("cy", d => d[1])
.style("fill", "#444");
for (let i = 2; i <= hull.length; i++) {
const visible = hull.slice(0, i);
h.attr("d", `M${visible.join("L")}Z`);
p.style("fill", d => (visible.includes(d) ? "orange" : "#444"));
yield svg.node();
await Promises.delay(200);
}
h.transition().style("fill", "lightblue");
}