Skip to content
Michael Barry edited this page Aug 26, 2014 · 2 revisions

http://mbtaviz.github.io/#your-commute

This section lets you choose two stops along the same line then renders a scatter plot with range bands that show what the wait and transit time between those stops is across all weekdays during the month. your-commute.js renders the map glyph, scatter plot scaffolding, and sets up interaction with surrounding text. Each time a user begins dragging from one stop to the next it reads in a data file containing transit and wait times for the month from that starting station and renders the data when the user finishes dragging.

http://mbtaviz.github.io/#your-commute

Required data format

This visualization requires 3 data files to render the initial map glyph

  • station-network.json nodes (stations) and links that represent the network topology of the subway system
  • spider.json screen placement for stations in order to render the map glyph
  • station-paths.json list of valid stations that you can drag between (a list of station IDs per line)

Then when a user begins dragging, an additional file is read in that contains wait and transit times from the starting station to all other stations

  • upick2-weekday-rollup-<starting station GTFS ID>.json wait and transit times to all stations from the station with the given ID

station-network.json and spider.json are described in [Common Data Files](Common Data Files).

station-paths.json

Contains a list of station IDs per line used to determine what stations you can drag to from a starting station.

[
  [
    "GTFS ID of station along line 1", ...
  ],
  [
    "GTFS ID of station along line 2", ...
  ], ...
]

upick2-weekday-rollup-.json

Contains the historical wait and transit times from this starting stations to all other ending stations.

{
  "ending station GTFS ID": {
    "results": [
      [
        hour of day bucket,
        [
          10% transit time in minutes,
          50% transit time in minutes,
          90% transit time in minutes
        ],
        [
          10% wait time in minutes,
          50% wait time in minutes,
          90% wait time in minutes
        ]
      ]
    ],
    "actuals": [
      [
        hour of day,
        transit time in minutes to this stop,
        wait time in minutes between stops
      ]
    ]
  }
}