Hi All -
Is it possible to apply multiple transformations on the same item? when I add more than one, only the last one is applied:
var svg = d3.select("body").append("svg");
svg.selectAll("rect")
.data([1])
.enter()
.append("g")
.append("svg:rect")
.attr({x: 50, y: 80, height: 100, width: 300, fill: "#000", stroke: "none"})
.attr("transform", "scale(2)")
.attr("transform", "translate(200,200)")
In the example above, the position is shifted but not the scale. When I reverse them the scale is doubled but the position is not affected:
svg.selectAll("rect")
.data([1])
.enter()
.append("g")
.append("svg:rect")
.attr({x: 50, y: 80, height: 100, width: 300, fill: "#000", stroke: "none"})
.attr("transform", "translate(200,200)")
.attr("transform", "scale(2)")
and this does nothing at all
svg.selectAll("rect")
.data([1])
.enter()
.append("g")
.append("svg:rect")
.attr({x: 50, y: 80, height: 100, width: 300, fill: "#000", stroke: "none"})
.attr("transform", "scale(2);translate(200,200);")
Any idea on this?
Thanks!