~ubuntu-branches/ubuntu/precise/whoopsie-daisy/precise-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Evan Dandrea
  • Date: 2012-04-10 14:28:58 UTC
  • Revision ID: package-import@ubuntu.com-20120410142858-nk453o1z7t7py3bs
Tags: 0.1.26
* Take ownership of the NetworkManager state variant on setup and
  unref it, plugging a memory leak.
* Log the reason the server rejected the submitted crash report.
* Send the Whoopsie version with each crash submission.
* Delete both .upload and .uploaded files after 14 days. Thanks
  Marc Deslauriers (LP: #973687).

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
    <script type="text/javascript">
 
11
 
 
12
var data = [4, 8, 15, 16, 23, 42];
 
13
 
 
14
d3.select("span")
 
15
  .selectAll("svg")
 
16
    .data(data)
 
17
  .enter().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
    .attr("cursor", "pointer")
 
29
    .style("font", "36pt Comic Sans MS")
 
30
    .style("text-shadow", "3px 3px 3px rgba(0,0,0,.4)")
 
31
    .text(function(d) { return d; })
 
32
    .on("click", click)
 
33
    .on("mouseover", mouseover)
 
34
    .on("mouseout", mouseout);
 
35
 
 
36
function click(d, i) {
 
37
  console.log("click", d, i);
 
38
}
 
39
 
 
40
function mouseover(d, i) {
 
41
  d3.select(this)
 
42
      .attr("fill", "brown")
 
43
      .attr("stroke", "grey");
 
44
}
 
45
 
 
46
function mouseout(d, i) {
 
47
  d3.select(this)
 
48
      .attr("fill", "orange");
 
49
}
 
50
 
 
51
    </script>
 
52
  </body>
 
53
</html>