mbostock/d3 — Issue #375: "transform" attribute transitions broken for "scale" in v2.5.0
Author: larskotthoff
Created: 2011-11-14 21:29:44+00:00
State: open

Transitions on the "transform" attribute are somewhat broken in v2.5.0 for "scale" transformations. Example:

```JavaScript
var svg = d3.select("body")
.append("svg:svg")
.attr("height", 200)
.attr("width", 200);
svg.append("svg:g")
.attr("transform", "translate(50,50)")
.append("svg:rect")
.attr("width", 50)
.attr("height", 100)
.attr("fill", "black")
.attr("transform", "scale(1,1)")
.transition().duration(1000)
.attr("transform", "scale(1,-1)");
```

There's no animation in the example and the end result is different if commenting the .transition() line. This problem only seems to occur only in this particular configuration, i.e. with scale(1,-1) as target. I've had a quick look at the code trying to figure out what's going on, but I got lost in a maze of twisty little functions, all alike :)

I've also noticed that adding a "transform" attribute in a transition (i.e. originally the element was defined without one) doesn't work anymore in v2.5.0 -- that causes JavaScript errors.