~ev/errors/openid_auth_failure

« back to all changes in this revision

Viewing changes to static/js/d3/examples/moire/moire.html

  • Committer: Evan Dandrea
  • Date: 2012-03-31 17:07:36 UTC
  • Revision ID: evan.dandrea@canonical.com-20120331170736-rypmkpbayaeg1wji
Move to Django for the stats pages. Use d3.js instead of YUI3's charts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html>
 
2
<html>
 
3
  <head>
 
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">
 
8
 
 
9
circle {
 
10
  fill: none;
 
11
  stroke: #000;
 
12
}
 
13
 
 
14
    </style>
 
15
  </head>
 
16
  <body>
 
17
    <script type="text/javascript">
 
18
 
 
19
var w = 960,
 
20
    h = 500;
 
21
 
 
22
var svg = d3.select("body")
 
23
  .append("svg")
 
24
    .attr("width", w)
 
25
    .attr("height", h)
 
26
    .attr("pointer-events", "all");
 
27
 
 
28
svg.append("g")
 
29
  .selectAll("circle")
 
30
    .data(d3.range(110))
 
31
  .enter().append("circle")
 
32
    .attr("transform", "translate(" + w / 2 + "," + h / 2 + ")")
 
33
    .attr("r", function(d) { return d * 5; });
 
34
 
 
35
var circle = svg.append("g")
 
36
  .selectAll("circle")
 
37
    .data(d3.range(60))
 
38
  .enter().append("circle")
 
39
    .attr("transform", "translate(" + w / 2 + "," + h / 2 + ")")
 
40
    .attr("r", function(d) { return d * 3; });
 
41
 
 
42
svg.on("mousemove", function() {
 
43
  var mouse = d3.mouse(this),
 
44
      r = (Math.sqrt(mouse[0]) + 10) / 10;
 
45
 
 
46
  circle
 
47
      .attr("transform", "translate(" + mouse + ")")
 
48
      .attr("r", function(d) { return d * r; });
 
49
});
 
50
 
 
51
    </script>
 
52
  </body>
 
53
</html>