File: mouse-test.html

package info (click to toggle)
d3 3.5.17-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,464 kB
  • sloc: javascript: 43,334; makefile: 8; xml: 4
file content (22 lines) | stat: -rw-r--r-- 448 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTML Mouse Test</title>
<body>
<script src="../../d3.js"></script>
<script>

var body = d3.select("body");

var div = body.append("div")
    .style("width", "1000px")
    .style("height", "500px")
    .style("border", "solid black 1px")
    .style("cursor", "crosshair");

var span = body.append("span");

d3.select(window).on("mousemove", function() {
  span.text(d3.mouse(div[0][0]));
});

</script>