I am trying to animate an svg <path>
element. The initial <path>
element has L(lineto)
commands whereas the <path>
that I'm trying to animate it to has C(cubic-bezier curve)
commands. I've tried animating it but it doesn't really transition between the two paths. Is something like this possible?
<svg>
<path id="path" d="M0,50 L25,40 L50,60 L75,40 L100,60 L125,40 L150,50" fill="none" stroke-width="2" stroke="#000" />
<animate xlink:href="#path"
attributeName="d"
dur="3s"
from="M 0 50 L 25 40 L 50 60 L 75 40 L 100 60 L 125 40 L 150 50"
to="M 0 80 C 25 55 50 55 75 80 C 100 105 125 105 150 80"
repeatCount="indefinite" />
</svg>