Published
Edited
Jan 9, 2022
8 stars
Also listed in…
Work Utils
Insert cell
Insert cell
{
const node = svg`<svg height=300 width="${width}">
<circle cx='${width/2-20}' cy=100 stroke="orange" fill="orange" r=5 />
</svg>`;
let circle = d3.select(node).select('circle');
pulse(circle);

function pulse(circle) {
(function repeat() {
circle
.transition()
.duration(500)
.attr("stroke-width", 0)
.attr('stroke-opacity', 0)
.transition()
.duration(500)
.attr("stroke-width", 0)
.attr('stroke-opacity', 0.5)
.transition()
.duration(1000)
.attr("stroke-width", 65)
.attr('stroke-opacity', 0)
.ease(d3.easeSin)
.on("end", repeat);
})();
}

return node;
}
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