4
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
5
<title>Transform Transitions</title>
6
<script type="text/javascript" src="../../d3.v2.js"></script>
7
<style type="text/css">
21
<script type="text/javascript">
29
var svg = d3.select("body").append("svg")
31
.attr("height", height);
34
.data(d3.range(x * y))
35
.enter().append("rect")
36
.attr("transform", translate)
39
.style("fill", d3.scale.linear().domain([0, x * y]).range(["brown", "steelblue"]))
40
.on("mouseover", mouseover);
42
function translate(d) {
43
return "translate(" + (d % x) * z + "," + Math.floor(d / x) * z + ")";
46
function mouseover(d) {
47
this.parentNode.appendChild(this);
48
d3.select(this).transition()
50
.attr("transform", "translate(480,480)scale(23)rotate(180)")
53
.attr("transform", "translate(240,240)scale(0)rotate(180)")
54
.style("fill-opacity", 0)