0

I have a SVG file with 5 paths, each one has a different id assigned. The paths are exported from Illustrator.

<svg ...>
  <path id="state1" fill="#DDD" d="M274.727,341.564c-45.393,11.342-52....." />
  <path id="state2" fill="#DDD" d="....." />

How do I animate between the 5 id states in D3? In Snap.svg this can be easily done with

stage1.animate({"path" : (stage2.attr("path"))}, 1000);

Thanks!

Jure Srpcic
  • 612
  • 1
  • 7
  • 11
  • 2
    Get the `d` attributes for each, then assign to the path you want to modify in turn with `.transition()` in between. – Lars Kotthoff Oct 29 '14 at 15:02
  • It's actually that simple, thanks! I had problems with my path exported from Illustrator, that's why it wasn't working at first. When I deleted the newline characters (put the whole "d" string in one line), it worked. – Jure Srpcic Oct 29 '14 at 16:54

0 Answers0