~smagoun/whoopsie/whoopsie-lp1017637

« back to all changes in this revision

Viewing changes to backend/stats/static/js/d3/examples/hello-world/hello-transform.html

  • Committer: Evan Dandrea
  • Date: 2012-05-09 05:53:45 UTC
  • Revision ID: evan.dandrea@canonical.com-20120509055345-z2j41tmcbf4as5uf
The backend now lives in lp:daisy and the website (errors.ubuntu.com) now lives in lp:errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
<html>
3
 
  <head>
4
 
    <title>Hello, world!</title>
5
 
    <script type="text/javascript" src="../../d3.v2.js"></script>
6
 
  </head>
7
 
  <body>
8
 
    Your lucky numbers are:<br>
9
 
    <span></span>
10
 
    <span></span>
11
 
    <span></span>
12
 
    <span></span>
13
 
    <span></span>
14
 
    <script type="text/javascript">
15
 
 
16
 
d3.selectAll("span")
17
 
  .append("svg")
18
 
    .attr("width", 100)
19
 
    .attr("height", 100)
20
 
  .append("text")
21
 
    .attr("x", "50%")
22
 
    .attr("y", "50%")
23
 
    .attr("dy", ".35em")
24
 
    .attr("text-anchor", "middle")
25
 
    .attr("fill", "white")
26
 
    .attr("stroke", "black")
27
 
    .attr("stroke-width", 1.5)
28
 
    .style("font", "36pt Comic Sans MS")
29
 
    .style("text-shadow", "3px 3px 3px rgba(0,0,0,.4)")
30
 
    .text(function() { return ~~(Math.random() * 100); });
31
 
 
32
 
function transform() {
33
 
  d3.selectAll("text")
34
 
      .text(function() { return ~~(Math.random() * 100); });
35
 
}
36
 
 
37
 
window.addEventListener("keypress", transform, false);
38
 
 
39
 
    </script>
40
 
  </body>
41
 
</html>