-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
258 lines (214 loc) · 7.94 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<!-- Title -->
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="text-center">
<b>If you hate flight delays</b>
</h1>
<p class="text-center lead">don't book flights between 11pm-3am</p>
<p class="lead">
Using <a href="http://www.transtats.bts.gov/OT_Delay/OT_DelayCause1.asp">RITA flight delay information</a> for US domestic flights in 2008, below you can explore
the relationship between <b>average departure delay time</b> during different time periods.
</p>
<p class="lead">
The average flight delay between US domestic flights is <b>9 minutes</b>. This simple average calculation can be quite
deceiving.
</p>
<blockquote class="">
<p>What if I told you that depending on a choice that you have, you can expect to wait 2 hours or even depart early?</p>
</blockquote>
</div>
</div>
<!-- end of row -->
<!-- Dashboard visualization. Gives overview of flight data
Right now, commented out because it is not finished.
<div class="row summary">
<div class="col-md-12">
<svg id="summary_visualization"></svg>
</div>
</div>
<!-- end of row -->
<br>
<section class="fill">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="text-center">Average flight delays by hour of day <small>(minutes)</small></h2>
<div id="hourBar"></div>
<p><small>*Note: Red bars indicate delays of more than 40 minutes.</small></p>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<br>
<p class="lead">
Clearly passangers wait longer on flights <em>scheduled</em> to depart from 11pm to 3am. This graph provides
a quick overview of the potentially best times to fly during any day of the week.
</p>
<p class="lead">
<em>Here comes the interesting part...</em>
</p>
</div>
</div>
</section>
<hr>
<section class="fill">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="text-center">Number of flights by hour of day</h2>
<div id="hourNumberOfFlights"></div>
<p><small>*Note: Red bars indicate number of flights less than 50,000.</small></p>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<br>
<p class="lead">
Surprisingly, average flight delays appear to be inversely related to the volume
of flights happening in a given hour. In other words, <b>hours with the highest number of flights also have
the lowest average delay times</b>. There seems to be one exception though, at 4am
there is a relatively low volume of flights and a low average delay time.
</p>
<p class="lead">
<em>Are there similar patterns if we look at flights by day of week?</em>
</p>
<br>
</div>
</div>
</section>
<hr>
<!--
Grid visualization. Depicts three features, departure delays on day of week vs hour of day.
It uses a table as base, and there is some HTML element injection via Javascript.
-->
<div class="row">
<div class="col-md-12">
<h2 class="text-center">Average delay by <b>hour of day</b> and <b>day of week</b> <small>24/7</small></h2>
<table class="rbow1">
<tr>
<th colspan="5">
Legend: Color intensity
</th>
</tr>
<tr>
<td class="q1-9 legend-tile"></td>
<td class="q2-9 legend-tile"></td>
<td class="q3-9 legend-tile"></td>
<td class="q4-9 legend-tile"></td>
<td class="q5-9 legend-tile"></td>
<td class="q6-9 legend-tile"></td>
<td class="q7-9 legend-tile"></td>
<td class="q8-9 legend-tile"></td>
<td class="q9-9 legend-tile"></td>
<!-- Depending on which color palette is used, these
should be commented out -->
<!-- <td class="q10-11 legend-tile"></td>
<td class="q11-11 legend-tile"></td> -->
</tr>
<tr>
<td colspan="5">
<p class="pull-left">15 minutes</p>
</td>
<td colspan="6" >
<p class="pull-right">80 minutes</p>
</td>
<tr>
</table>
</div>
</div>
<!-- end of row -->
<!-- Grid visualization -->
<div class="row">
<div class="col-md-10">
<div id="visualization" class="rbow1">
</div>
</div>
<div class="col-md-2">
<p class="">
The horizontal axis represents the hour of day, and the vertical axis the
days of the week. A <em>lighter blue</em> (e.g. almost white) cell
in the grid represent <em>shorter</em> average delay times <small>(from 15 minutes)</small> and <em>more intense
blue</em> (e.g. deep blue) represent <em>longer</em> delay times <small>(up to 75 minutes)</small>.
</p>
</div>
</div>
<!-- end of row -->
<br>
<div class="row">
<div class="col-md-12">
<br>
<p class="lead">
<em>Not really.</em>
</p>
<p class="lead">
Like the bar chart, here we can see that the highest average delays seem to happen between 12am-3am.
<em>There seems to be no significant difference in delays between days of week.</em>
</p>
<p class="lead">
<em>What about months of the year?</em>
</p>
<br>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 class="text-center">Average flight delays by month <small>(minutes)</small></h2>
<div id="chartContainer"></div>
<p><small>*Note: Red dots indicate delays of more than 9 minutes (the average)</small></p>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<br>
<p class="lead">
December clearly stands out as the month with longest average flight delay,
over <b>17 minutes</b>. But the difference between the best and worst months
is just <b>13 minutes</b>, while the difference between the best and worst hour of day
is a staggaring <b>130 minutes</b> <small>(at 5am there is negative time delay)</small>.
</p>
<p class="lead">
<em>So it seems a prudent advice for the time conscious travelers to book
flights between 4am and 12pm'ish'.</em>
</p>
<br>
</div>
</div>
<hr>
</div>
<!-- end of container -->
<footer>
<div class="container">
<div class="row">
<div class="col-md-12">
<p>
The 247 graphic is based on <a href="http://www.trulia.com/vis/tru247/">Trulias 247 graphic.</a>
The code was adapted to use Rita flight data.
</p>
</div>
</div>
</div>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="js/d3.v3.min.js"></script>
<script src="js/dimple.v2.1.2.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>