-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewer.html
52 lines (44 loc) · 1 KB
/
viewer.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!--
# This file uses D3 to visualize the data from the dataset.csv file
# Created by Yogi Patel
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript" src="d3/d3.v3.js"></script>
<title>AssocVizualizer</title>
</head>
<body>
<script type="text/javascript">
d3.csv("data.csv", function(data){
var datapts = d3.select("body")
.selectAll("p")
.data(data)
.enter();
datapts.append("span").html(function(d){
return +d.time + ", " + d.duration +
"s, " + d.idx + ", " + d.uid + ", " +
d.metaid + ", " + d.correct + ", " +
d.hint + "</br>";});
var svg = d3
.select("body")
.append("svg")
.attr("width", 800)
.attr("height", 400);
var circles = svg
.selectAll("circle")
.data(datapts)
.enter()
.append("circle");
circles
.attr("cx", function(d,cx){return (d.uid);})
.attr("cy", function(d,cy){return (d.duration);})
.attr("r", function(d,r){return (23);})
.attr("fill", "steelblue")
.attr("stroke", "red")
});
</script>
</body>
</html>