Public
Edited
Apr 19, 2023
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
point1 = circle.node().getPointAtLength(distance)
Insert cell
point2 = curve.node().getPointAtLength(distance)
Insert cell
{
svgObj.selectAll("#dot1").data([1]).join("circle")
.attr("cx", point1.x)
.attr("cy", point1.y)
.attr("r", 5)
.attr("id","dot1");

svgObj.selectAll("#dot2").data([1]).join("circle")
.attr("cx", point2.x)
.attr("cy", point2.y)
.attr("r", 5)
.attr("id","dot2");

svgObj.selectAll(".datadot")
.data(data)
.join("circle")
.attr("cx", d => curve2.node().getPointAtLength(d).x)
.attr("cy", d => curve2.node().getPointAtLength(d).y)
.attr("r", 5)
.classed("datadot", true);

}
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