-
Notifications
You must be signed in to change notification settings - Fork 160
/
index.html
217 lines (188 loc) · 11.8 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A Day in the Life</title>
<link rel='stylesheet' href='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.css' />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=174160066065207&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><span class="glyphicon glyphicon-road "></span> NYC Taxis: A Day in the Life</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><div class = "about">About</div></li>
<li><div class = "asterisks">Asterisks</div></li>
<li><div class = "attribution">Attribution</div></li>
<li>
<div class="fb-like" data-href="http://nyctaxi.herokuapp.com/" data-layout="button_count" data-action="recommend" data-show-faces="true" data-share="true"></div>
</li>
<li class=twitter-button>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://nyctaxi.herokuapp.com" data-text="A Day in the Life of an NYC Taxi: Data Visualization by @chris_whong" data-hashtags="dataviz">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div id="map">
</div>
<div class="container overlay">
<div class="jumbotron">
<h1>NYC Taxis: A Day in the Life</h1>
<p>This visualization displays the data for one random NYC yellow taxi on a single day in 2013. See where it operated, how much money it made, and how busy it was over 24 hours.</p><br/>
<p class = 'text-center'><a id = "begin" class="btn btn-primary btn-lg" role="button">Begin <span class="glyphicon glyphicon-play"></span></a></p>
<br/>
<p style = 'font-size:16px'>A Special Thanks goes out to <a href = "http://www.mapbox.com">Mapbox</a> and <a href = "http://www.heroku.com">Heroku</a> for assistance with covering the surge of activity when this project was first released in 2014. </p>
<p style = 'font-size:16px'> Here's <a href = "http://chriswhong.com/data-visualization/taxitechblog1/">Technical Blog Post #1</a> and <a href = "http://chriswhong.com/open-data/taxi-techblog-2-leaflet-d3-and-other-frontend-fun/">#2</a> about how this visualization was built. </p>
<div class = "badges">
<a href = "http://www.informationisbeautifulawards.com/news/49-2014-the-winners"><img src = "img/kantariib.png"></a>
<a href = "http://www.andresmh.com/nyctaxitrips/"><img src = "img/getDataButton.png"></a>
</div>
</div>
</div>
<div class = 'container popup aboutPopup'>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">About</h3><span class="glyphicon glyphicon-remove"></span>
</div>
<div class="panel-body">
<strong><p>NYC Taxis: A Day in the Life - A Data Visualization by <a href = "http://chriswhong.com">Chris Whong</a></p></strong>
<p>This civic technology project visualizes <a href = "http://www.andresmh.com/nyctaxitrips/">taxi trip data from 2013</a>, showing the activities of a single taxi on a single day. The original data include ~170 Million trips. Of these, 30 cab/days were queried at random for inclusion in this project. The data were provided by the <a href = "http://www.nyc.gov/html/tlc/html/home/home.shtml">Taxi and Limousine Commission</a> via a <a href = "http://chriswhong.com/open-data/foil_nyc_taxi/">FOIL request.</a></p>
<p>
The intent is to analyze running counts of fares, taxes, etc, over the course of a day, and to see how/when taxis move around New York.
</p>
<p>
The raw data include only start and end locations for each trip. These points were run through Google's Directions API to create the routes shown in this visualization. Of course, these are Google's best choice, not necessarily the one the taxi took.
</p>
<p>Support Civic Hacking and Open Data! </p>
<p>Check out <a href = "http://www.betanyc.us">BetaNYC</a>, New York City's Civic Hacking Community.</p>
<p><a href = "https://github.com/chriswhong/taxitracker">Code on Github</a></p>
<img src = "http://i.creativecommons.org/l/by-sa/3.0/88x31.png">
<br/>
<br/>
<a href="https://twitter.com/chris_whong" class="twitter-follow-button" data-show-count="false">Follow @chris_whong</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
</div>
</div>
<div class = 'container popup asterisksPopup'>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Asterisks</h3><span class="glyphicon glyphicon-remove"></span>
</div>
<div class="panel-body">
<h4>Here are some gotchas:</h4>
<ul>
<li><strong>Trip Routes</strong> are a result of passing the start and end locations to the <a href = "https://developers.google.com/maps/documentation/directions/">Google Directions API</a>. They are a possible route that the taxi took, but should not be assumed to be accurate.</li>
<li><strong>Empty Taxis</strong> also follow the "best route" between a dropoff and the next pickup. Just as with the trips, this is just an effective way to move the marker around, but doesn't reflect the reality of where the taxi traveled. </li>
<li><strong>Tips</strong> are only reported in the data for credit card transactions. Cash tips are not included. </li>
</ul>
</div>
</div>
</div>
<div class = 'container popup attributionPopup'>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Attribution</h3><span class="glyphicon glyphicon-remove"></span>
</div>
<div class="panel-body">
<ul>
<li><a href = "http://bost.ocks.org/mike/leaflet/">Mike Bostock's D3 + Leaflet</a> - The foundation for throwing geoJSON onto Leaflet with external tiles.
</li>
<li><a href = "http://bl.ocks.org/KoGor/8163022">KoGor's Marker Animation Along SVG Path</a> - This technique made the animated cab marker work!
</li>
<li>
<a href = "http://www.mapbox.com">Mapbox</a> for super-simple subdued basemap tiles, and for releasing a totally sweet node package for converting Google Encoded Polylines into raw Coordinates.
</li>
<li>
Thanks to <a href = "http://www.reddit.com/r/bigquery/comments/28ialf/173_million_2013_nyc_taxi_rides_shared_on_bigquery/">u/fhoffa on Reddit</a> for importing the data into BigQuery helping me with the custom query I needed to pull full days of data for random taxis.
</li>
</ul>
</div>
</div>
</div>
<div class="dateTimeBox box">
<div class = "date"></div>
<div class = "time"><span class="glyphicon glyphicon-time"></span> <span class = "readableTime"></span></div>
<div class= "controls">
<button type="button" class="btn btn-default btn-xs slower"><span class="glyphicon glyphicon-backward"></span> Slower</button>
<button type="button" class="btn btn-default btn-xs faster">Faster <span class="glyphicon glyphicon-forward"></span> </button>
</div>
<div>Time Factor: <span class = "timeFactor"></span> minutes per second</div>
</div>
<div class="legendBox box">
<div class = "boxHeader"><span class="glyphicon glyphicon-map-marker"></span> Legend</div>
<div class = 'legendItem'>
<svg>
<circle r="5" id="marker" transform="translate(20,20)"></circle>
</svg><p>Full Taxi</p></div>
<div class = 'legendItem'>
<svg>
<circle r="20" id="marker" transform="translate(20,20)" style="opacity:0.30000000000000004"></circle>
</svg><p>Empty Taxi<sup>*</sup></p></div>
<div class = 'legendItem'>
<svg>
<circle r="5" class="startPoint" transform="translate(20,20)"></circle>
</svg><p>Trip Start Point</p></div>
<div class = 'legendItem'>
<svg>
<circle r="5" class="endPoint" transform="translate(20,20)"></circle>
</svg><p>Trip End Point</p></div>
<div class = 'legendItem'>
<svg>
<path class="trip true" style="opacity:.7" d="M10,10L30,30" ></path>
</svg><p>Trip Route<sup>*</sup></p></div>
</div>
<div class="newBox box">
<button type="button" class="btn btn-default btn-lg reload">
<span class="glyphicon glyphicon-refresh"></span> Load Another Taxi!
</button>
</div>
<!--$: <span class = "runningFare">Test</span>-->
<div class="totalsBox box">
<div class = "boxHeader"><span class="glyphicon glyphicon-dashboard"></span> Running Totals</div>
<p>Fares: <span class = "runningFare running"></span></p>
<p>Surcharge: <span class = "runningSurcharge running"></span></p>
<p>MTA Tax: <span class = "runningTax running"></span></p>
<p>Tips<sup>*</sup>: <span class = "runningTip running"></span></p>
<p class = "tolls">Tolls: <span class = "runningTolls running"></span></p>
<p>Total: <span class = "runningTotal running"></span></p>
<p>Passengers: <span class = "runningPassengers running"></span></p>
<div class = "passengerGlyphs"></div>
</div>
<div class="areaChartBox box">
</div>
<script src="js/moment.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox.js/v1.6.4/mapbox.js'></script>
<script src="js/script.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-4921346-5', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>