Is it possible to ‘animate’ the code of an SVG?

Very technical side note (not for the OP but for nerds): You can do some stuff with Hype Handlebars

It could be done by defining any arbitrary inner HTML containing the Handlebars notation, and Handlebars actually turns it into a function generating a string. Its pretty fast. Hence, updates do render the whole branch but by executing the dynamically prepared function based on the Handlebar syntax. The Only missing thing for this is the ability to hook up arbitrary animated properties in Hype as it currently needs code to update the values and that is the moment you lose no code people. Certainly, there isn’t only one way to Rome… another could be the "modern" custom elements…

There are even more ways like using anime.js (animation library etc.). The most obvious… key frameable SVG animations would be the best, though.