-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconcurrent.html
59 lines (51 loc) · 1.42 KB
/
concurrent.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
53
54
55
56
57
58
59
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>GPS Heatmap Animation</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
body {
background: #210029;
}
svg {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<!-- Make a container for the SVG to append to -->
<div id="svgContainer"></div>
<!-- Append the SVG to the above container -->
<script>
xhr = new XMLHttpRequest();
xhr.open("GET","source-data/Rplots.svg",false);
// xhr.open("GET","source-data/Rplots-lots.svg",false);
xhr.overrideMimeType("image/svg+xml");
xhr.send("");
document.getElementById("svgContainer")
.appendChild(xhr.responseXML.documentElement);
</script>
<!-- Include D3 -->
<script src="vendor/js/d3.v3.min.js" charset="utf-8"></script>
<!-- Configure D3 -->
<script type="text/javascript">
var paths = d3.selectAll("path");
paths.each(function (d, i) {
var totalLength = this.getTotalLength();
path = d3.select(this)
.attr("stroke-dasharray", totalLength + " " + totalLength)
.attr("stroke-dashoffset", totalLength)
.attr("stroke", "purple")
.attr("opacity", "0.3")
.attr("fill", "none")
.attr("stroke-width", "0.25")
.transition()
.duration(20000)
.ease("linear")
.attr("stroke-dashoffset", 0)
});
</script>
</body>
</html>