d3/d3-interpolate

interpolateTransform should work on CSS transforms, too?

mbostock opened this issue · 1 comments

Related d3/d3#2507.

This should be pretty easy since the CSS specification says that the computed transform value should either be "none" or matrix form (e.g., "matrix(1, 0, 0, 1, 0, 0)"), and in the latter case that is trivially parsed to the a, b, c, d, e and f used for SVG transforms.

The tricky part is that there would need to be separate interpolators for CSS and SVG, since the former requires units for the translate (px), rotate (deg) and skewX (deg) commands.

Also, that code path would only work with 2D transforms, obviously. But we could always add an interpolateTransform3d in the future.