{"id":24669279,"url":"https://github.com/samcfuchs/mta-viz","last_synced_at":"2025-07-12T20:02:14.020Z","repository":{"id":272849043,"uuid":"917747215","full_name":"Samcfuchs/mta-viz","owner":"Samcfuchs","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-04T18:36:54.000Z","size":507,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T19:37:03.987Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samcfuchs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-16T15:16:42.000Z","updated_at":"2025-02-04T18:36:59.000Z","dependencies_parsed_at":"2025-02-04T19:29:13.266Z","dependency_job_id":"a079246f-0a6d-4523-b4ac-4d9ed4995dfa","html_url":"https://github.com/Samcfuchs/mta-viz","commit_stats":null,"previous_names":["samcfuchs/mta-viz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samcfuchs%2Fmta-viz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samcfuchs%2Fmta-viz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samcfuchs%2Fmta-viz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samcfuchs%2Fmta-viz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samcfuchs","download_url":"https://codeload.github.com/Samcfuchs/mta-viz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244805034,"owners_count":20513211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-26T09:20:16.098Z","updated_at":"2025-07-12T20:02:14.014Z","avatar_url":"https://github.com/Samcfuchs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MTA Live Data Visualization\n\n![`A screenshot of the app`](image.png)\n\nThis app provides a 3-D interactive view of the live state of the NYC\nsubway system, as data is provided through the MTA GTFS-RT API. Train\npositions are interpolated from the most recent data, as a \"best guess\"\nbased on the train's anticipated arrival time at its next station.\nAlthough this is inexact, it is *no less* accurate than the information\nthe MTA itself has on the tracks that have not implemented CBTC\n(Communications-Based Train Control). To my knowledge, CBTC data from\nthe routes that have implemented it (the L and 7 lines) is not yet\navailable through a real-time API. You can read more about the MTA's\nCBTC rollout [here](https://new.mta.info/project/cbtc-signal-upgrades).\n\n## Setup\n\nThere's a [Dockerfile](./Dockerfile) now, so setting this up is actually quite\neasy. I'm working on a deployment to get this live using the docker image. Stay\ntuned. Meanwhile, run it yourself like so:\n\n```bash\ndocker build -t mta .\ndocker run -p 3000:3000 mta\n```\n\nThe site will be live at http://localhost:3000. For a non-containerized\ninstance, run this instead:\n\n```bash\nnpm install\nmkdir -p ./data/rt\ncurl -L -o ./data/gtfs_subway.zip https://rrgtfsfeeds.s3.amazonaws.com/gtfs_subway.zip\nunzip ./data/gtfs_subway.zip -d ./data/gtfs_subway\nnpm run build:server\nnpm run run:server\n\nnode dist/RealTime.js\n```\n\n## Future Work\n\n- [ ] Live deploy: Deploy the server onto a public device to get this live for\n  viewing.\n- [ ] Map overlay: Get 2D or 3D file from openstreetmap, google earth, or\n  similar to add context.\n- [ ] Better tooltips: current tooltips are designed mostly for debugging\n  purposes. Streamline these and format information in a more useful way.\n- [ ] Add details pane: provide more information about each train in a vertical\n  pane.\n- [ ] Improve train interpolation: Fit train positions to the curves of their\n  tracks and match their orientations as well.\n- [ ] Stop data: Add detailed interactivity for stations\n    - [ ] Add hover and click functions to view stop details\n    - [ ] Label stops with their actual names rather than IDs\n    - [ ] Graphically represent conjoined stations with multiple stops\n- [x] Improve train matching between data refreshes: sometimes trains are not\n  correctly matched between realtime data sets and they seem to jump between\n  locations.\n  - [x] Interpolate between updates: Trains that are correctly matched but\n    receive a \"drastic\" update should accelerate toward their new location, but\n    should not snap from place to place.\n- [ ] Continuous turning: Trains currently don't animate orientation changes,\n  they simply snap to the new direction they'll point toward. Smooth this out.\n- [ ] Separate data updates from the animation loop: While the data fetch is\n  appropriately separate from animations, the actual loading of the data into\n  individual trains is not, so there is a brief hitch in the animations every 30\n  seconds. Separate this data further so that it doesn't impact the UX.\n- [ ] Default animation loop: Add a default camera motion for nicer\n  \"screensaver\" behavior.\n- [ ] Fix a bug: There is still one bug which interrupts updates occasionally.\n  Investigate this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamcfuchs%2Fmta-viz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamcfuchs%2Fmta-viz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamcfuchs%2Fmta-viz/lists"}