4
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
5
<title>Moiré Patterns</title>
6
<script type="text/javascript" src="../../d3.v2.js"></script>
7
<style type="text/css">
17
<script type="text/javascript">
22
var svg = d3.select("body")
26
.attr("pointer-events", "all");
31
.enter().append("circle")
32
.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")")
33
.attr("r", function(d) { return d * 5; });
35
var circle = svg.append("g")
38
.enter().append("circle")
39
.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")")
40
.attr("r", function(d) { return d * 3; });
42
svg.on("mousemove", function() {
43
var mouse = d3.mouse(this),
44
r = (Math.sqrt(mouse[0]) + 10) / 10;
47
.attr("transform", "translate(" + mouse + ")")
48
.attr("r", function(d) { return d * r; });