What is 's.animate({ ..... supposed to be doing ?
s is the Snap paper/svg. So if you animate that, it won't have any points to animate. The animation needs to be on the element that has points.
Similar with f.selectAll('points'), there probably won't be anything there. You probably want the element name, like f.selectAll('polygon')
and then in the function something like...
var anim = function() {
this.animate({ points: newPoints }, 2000);
}
You also can't do svg2.attr('points'), only one element will have points, so you need to figure which element that is.
You could do a forEach, pseudocode something like...
function anim() {
var polys1 = svg1.selectAll('polygon');
var polys2 = svg2.selectAll('polygon');
polys1.forEach( function( el, index ) {
polys1[index].animate({ point: polys2[index].point},2000);
the above line probably won't interpolate a whole bunch of points in one go, so you will probably have to loop over each single point and animate that to its equivalent in polys2
})
}
note, my guess this will be pretty ineffecient compared to css or svg markup, so I think this will be quite a bit of work, with disappointing results, but it may be an interesting experiment and learning curve.