Skip to content

Instantly share code, notes, and snippets.

@mattwigway
Created June 7, 2012 00:38
Show Gist options
  • Save mattwigway/2885757 to your computer and use it in GitHub Desktop.
Save mattwigway/2885757 to your computer and use it in GitHub Desktop.
VTA Transit Times Analysis
<html>
<head>
<title>VTA 35S and 40S transfers</title>
<script src="http://d3js.org/d3.v2.js"></script>
</head>
<body>
<h2>VTA Transfer Time Analysis</h2>
<div id="barActual"></div>
<script src="transitTimes.js"></script>
</body>
</html>
// VTA 35
var line35TimesRaw = ["6:06 AM",
"6:34 AM",
"6:59 AM",
"7:30 AM",
"8:00 AM",
"8:30 AM",
"9:00 AM",
"9:30 AM",
"10:00 AM",
"10:29 AM",
"10:59 AM",
"11:29 AM",
"11:58 AM",
"12:27 PM",
"12:57 PM",
"1:27 PM",
"1:57 PM",
"2:28 PM",
"2:58 PM",
"3:28 PM",
"3:57 PM",
"4:27 PM",
"4:57 PM",
"5:27 PM",
"5:57 PM",
"6:27 PM",
"6:58 PM",
"7:25 PM",
"8:25 PM",
"9:29 PM",
"10:34 PM"];
var line40TimesRaw = ["6:30 AM",
"6:55 AM",
"7:30 AM",
"7:49 AM",
"8:25 AM",
"9:00 AM",
"9:30 AM",
"10:00 AM",
"10:30 AM",
"11:00 AM",
"11:30 AM",
"12:00 PM",
"12:30 PM",
"1:00 PM",
"1:25 PM",
"1:51 PM",
"2:26 PM",
"2:50 PM",
"3:18 PM",
"3:53 PM",
"4:28 PM",
"5:00 PM",
"5:28 PM",
"5:58 PM",
"6:28 PM",
"7:00 PM",
"7:41 PM",
"8:53 PM",
"9:54 PM"];
// parse the times
var line35Times = [];
var line40Times = [];
var timeFormat = d3.time.format('%Y-%m-%d %I:%M %p');
line35TimesRaw.forEach(function (time) {
// add a date
line35Times.push(timeFormat.parse('2012-01-01 ' + time));
});
line40TimesRaw.forEach(function (time) {
line40Times.push(timeFormat.parse('2012-01-01 ' + time));
});
// build a transfer time mapping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment