-
Notifications
You must be signed in to change notification settings - Fork 0
/
timelines.html
117 lines (110 loc) · 3.9 KB
/
timelines.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
<meta charset="UTF-8">
<meta http-equiv="Content-Language" content="en-US" >
</head>
<body>
<style>
.axis {
shape-rendering: crispEdges;
}
.x.axis line {
stroke: #ccc;
}
.x.axis .minor {
stroke-opacity: .5;
}
.x.axis path {
display: none;
}
/*
.bar {
fill: steelblue;
}
*/
text {
color: black;
}
</style>
<link href="./nvd3/src/nv.d3.css" rel="stylesheet" type="text/css">
<style>
svg { height: auto; }
</style>
<script src="./bundle.js"></script>
<script>
/*
(function($){
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
$.getParameterByName = getParameterByName;
})(jQuery);
*/
//$(document).ready(function() {
d3.csv('./sampleData/huricane.csv', function (data) {
/*
if (!$.getParameterByName("fullData")) {
_(data).each(function(d) {
d.date = "2000"+d.date.slice(4) })
data = data.filter(function(d) {
return d.hur_id !== 'AL312005_ZETA_36' });
data = data.filter(function(d) {
return d.date.substr(5, 2) > '08' });
data = data.filter(function(d) {
return d.date.substr(5, 2) < '10' });
}
*/
var container = d3.select('body')
.append('div')
;
/*
var timelinesChart = nv.models.timelinesChart()
.entityIdProp('STUDYNUMBER')
.eventNameProp('EVENT')
.startDateProp('startdt')
.height($(window).height() - 150)
.width($(window).width() - 150)
.unitProp(1000*60*60*24) // days
.eventOrder(['In Development','Pending','Open','Enrolling',
'Closed to Accrual', 'Closed to Follow Up','POS/PAC','Concluded',
'On Hold','Deferred','Withdrawn',
'Temporarily Closed','FDA - IND Hold','Other' ])
;
*/
var timelinesChart = nv.models.timelinesChart()
.entityIdProp('hur_id')
.eventNameProp('status')
.startDateProp('date')
.eventOrder([
'Subtropical storm',
'Genesis',
'Disturbance',
'Subtropical Depression',
'Tropical Wave',
'Tropical Depression',
'Tropical Storm',
'Hurricane',
'Landfall',
'Extratropical',
'Low',
'Intensity Peak',
'Maximum wind',
'Status change'])
.timeUnits('minutes')
//.unitProp(1000*60) // minutes
//.unitProp(1000*60*60) // hours
//.unitProp(1000*60*60*24) // days
.height(window.innerHeight - 100)
.width(window.innerWidth - 100)
container
.datum(data)
.call(timelinesChart);
});
//});
</script>
</body>
</html>