~ev/errors/openid_auth_failure

« back to all changes in this revision

Viewing changes to static/js/d3/examples/delaunay/delaunay.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>Delaunay Triangulation</title>
 
6
    <script type="text/javascript" src="../../d3.v2.js"></script>
 
7
    <style type="text/css">
 
8
 
 
9
@import url("../../lib/colorbrewer/colorbrewer.css");
 
10
 
 
11
path {
 
12
  stroke: #000;
 
13
  stroke-width: .5px;
 
14
}
 
15
 
 
16
    </style>
 
17
  </head>
 
18
  <body>
 
19
    <script type="text/javascript">
 
20
 
 
21
var w = 960,
 
22
    h = 500;
 
23
 
 
24
var vertices = d3.range(500).map(function(d) {
 
25
  return [Math.random() * w, Math.random() * h];
 
26
});
 
27
 
 
28
var svg = d3.select("body")
 
29
  .append("svg")
 
30
    .attr("width", w)
 
31
    .attr("height", h)
 
32
    .attr("class", "PiYG");
 
33
 
 
34
svg.append("g")
 
35
  .selectAll("path")
 
36
    .data(d3.geom.delaunay(vertices))
 
37
  .enter().append("path")
 
38
    .attr("class", function(d, i) { return "q" + (i % 9) + "-9"; })
 
39
    .attr("d", function(d) { return "M" + d.join("L") + "Z"; });
 
40
 
 
41
    </script>
 
42
  </body>
 
43
</html>