File: transform-null-matrix-test.html

package info (click to toggle)
d3 3.5.17-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,464 kB
  • sloc: javascript: 43,334; makefile: 8; xml: 4
file content (26 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="../../d3.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")
    .attr("transform", "matrix(1 0 0 1 0 0)rotate(0)");

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

g.transition()
    .duration(3000)
    .attrTween("transform", d3.tween("matrix(1 0 0 1 100 100)rotate(360)", d3.interpolateString));

</script>