12 comments

[ 2.1 ms ] story [ 35.4 ms ] thread
[comments below without realizing that the post is from about a year ago, and that the author might not be reading this...]

That's really nice work, and I had always been curious if anyone had produced such a chart!

I note though, looks like you're using quite an old schedule as your input data, as the departure times of the weekday southbound trains in the plot don't match the current morning schedule (4:55, 5:25, 6:05, 6:15, 6:35, 6:45, 6:59, 7:05, etc) which has been in place for more than 2 years. Also on the weekends, it's missing the bullet trains (2 per day). Also for some reason if you select the weekend, the connecting lines between data points disappear.

Aside from that, really revealing chart! Interesting to see how basically trains can pass each other only at 2 stations: Bayshore and Lawrence. And the "falling off a cliff" effect for trains south of San Jose / Tamien is entertaining (though sad). One hopes that with coming electrification (will it ever arrive?), every line will be flattened by a factor, and new lines will be added (if what Caltrain claims about electrification turns out to be true). Amazing how a graphic can reveal these insights better.

Is it possible to add a function to output this as PDF or save the result as PNG? The tooltip prevents saving otherwise. Also to switch the axes and have time running along x-axis (which is a bit more traditional) producing a plot in landscape format? Then the distance north-south in also in an intuitive direction on the page.

>Interesting to see how basically trains can pass each other only at 2 stations: Bayshore and Lawrence

A Caltrain conductor told me that the only time it makes sense to not take from San Francisco the next leaving train is if the train after that is a Baby Bullet.

> Is it possible to add a function to output this as PDF or save the result as PNG?

Fortunately, in Observable, every cell that contains SVG or canvas graphics has image export built in. Just click the dotted menu to the left of the cell, and it will offer you downloads in either SVG or PNG flavors.

This is my rewrite of a chart I made about 10 years ago (using Protovis, the predecessor to D3), hence the old data. Back then there were no baby bullets on weekends!

http://mbostock.github.io/protovis/ex/caltrain.html

If someone wants to collect the new data and send me a suggestion I’d be happy to update the chart.

What did you use as the original data source? I've been poking at some GTFS data but there seems to be no obvious way to get distance traveled between stations (aside from as-the-crow-flies).
Good question. The times were published on Caltrain’s website, but I don’t recall where we got the distance data; it’s possible the initial implementation and data collection was done by collaborator, Vadim Ogievetsky. Wikipedia has track distances:

https://en.wikipedia.org/wiki/List_of_Caltrain_stations

Ah. I was actually looking at making a similar plot of some other Bay Area transit agencies. Good to know about the Caltrain distances tho.
You could make a 3D version of this chart with all the trains in a country, which would be more interesting because it can show crossings (the graph in the article shows crossings but you can't see if there are collisions).
I'm currently building a realtime Marey diagram chart for Sydney buses to visualise congestion and bus bunching, feel free to reach out if you'd like me to let you know when I've shipped a demo!
What would be the major cost of running the trains twice as frequently with half the number of cars, especially outside rush hour?
Probably quite high as Caltrain runs into hard limits with their train control software, they probably don't have that many extra locomotives, and they still contend with freight traffic.