-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
94 lines (74 loc) · 2.31 KB
/
index.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>#exosamsi Detrending Visualizations</title>
<style>
.axis line,
.axis path {
fill: none;
stroke: #111;
}
.axis text {
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 11px;
}
.datapoint {
fill: #111;
opacity: 0.5;
}
.bar {
fill: #222;
opacity: 0.5;
}
.gaussline {
fill: none;
stroke: steelblue;
stroke-width: 2px;
}
</style>
</head>
<body>
<div id="plot"></div>
<script src="lib/d3.v3.min.js"></script>
<script src="lib/plot.js"></script>
<script>
(function () {
var i, l;
var methods = ["sap", "pdc", "untrendy"],
datasets = [];
var chartfn = Chart().x(function (d) { return d.kbjd; })
.y(function (d) { return d.flux; });
function display (dsname) {
var thisdsname = dsname;
return function (data) {
// Save this dataset.
datasets[thisdsname] = data.filter(function (d) {
for (var k in d) if (isNaN(d[k])) return false;
return true;
}).map(function (d) {
for (var k in d) d[k] = parseFloat(d[k]);
return d;
});
// Exit if all the datasets aren't in yet.
var plt_datasets = [];
for (i = 0, l = methods.length; i < l; ++i) {
if (typeof datasets[methods[i]] == "undefined") return;
plt_datasets.push(datasets[methods[i]]);
}
// Build the plots.
var els = d3.select("#plot").selectAll(".lineplot")
.data(plt_datasets);
els.enter().append("div").attr("class", "lineplot");
els.call(chartfn);
els.exit().remove();
}
}
// Get the data.
for (i = 0, l = methods.length; i < l; ++i) {
d3.csv("data/"+methods[i]+"/demo.txt", display(methods[i]));
}
})();
</script>
</body>
</html>