All examples By author By category About

hlvoorhees

affixing an element to a transitioning path in d3

Using attrtween to affix an svg element to an svg path undergoing transition.

In order to compute its position, 1/3 of the way along the path, the element binds the path as data. (See var linkLabel, toward the end of the javascript file.) Then it uses attrTween (not attr) to fetch the correct position at each animation frame during the transition.