null.html 470 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<!DOCTYPE html>
<body>
<script src="../../d3.v2.js"></script>
<script>
var svg = d3.select("body").append("svg")
    .attr("width", 960)
    .attr("height", 500);

var g = svg.append("g")
    .attr("transform", "translate(100,100)")
  .append("g");

var rect = g.append("rect")
    .attr("x", -25)
    .attr("y", -50)
    .attr("width", 50)
    .attr("height", 100);

g.transition()
    .duration(3000)
    .attr("transform", "translate(100,100)rotate(360)");
</script>