4
<title>Hello, world!</title>
5
<script type="text/javascript" src="../../d3.v2.js"></script>
8
Your lucky numbers are:<br>
10
<script type="text/javascript">
12
var data = [4, 8, 15, 16, 23, 42];
17
.enter().append("svg")
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; })
33
.on("mouseover", mouseover)
34
.on("mouseout", mouseout);
36
function click(d, i) {
37
console.log("click", d, i);
40
function mouseover(d, i) {
42
.attr("fill", "brown")
43
.attr("stroke", "grey");
46
function mouseout(d, i) {
48
.attr("fill", "orange");