There are two parts to that: where are the tracks and how far along the tracks are the trains. The How page at
http://tubenoise.com/how.html sets it all out. The train data comes from a London Underground api called Trackernet that provides estimates of how long it will take the train to get to the next station.