GithubHelp home page GithubHelp logo

wcjohnson11 / livebus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pasdechocolat/livebus

0.0 1.0 0.0 3.7 MB

Real-time mapping of Honolulu's TheBus routes and vehicle locations.

Home Page: http://pasdechocolat.com/2013/07/20/livebus-with-meteor-and-d3/

livebus's Introduction

LiveBus

A bit of an experiment...

We're animating the movement of Honolulu's TheBus system, in the browser.

See the tutorial for more detailed description of how this works. There's also a live version courtesy of Meteor at http://livebus.meteor.com.

What is this?

Here's a taste of ~7 minutes compressed to 45 seconds on Vimeo.

This is a simple web app which combines:

This experiement was really an excuse for me to try out the Meteor web development framework. TheBus presented itself as a good candidate as it provides realtime information on its bus locations. Once bus positions are added/updated in MongoDB, Meteor syncs that data with any connected browsers.

D3 handles moving the dots on the map, since it ties data to SVG elements and animations to changes to that data.

In this way, I write very little code. It's fairly declarative in nature. Et, voilà ! Realtime bus map.

What is this for?

I don't know.

It kind of depends. This implementation is fairly specific to TheBus. But, that said, if your city uses GTFS-realtime, you could swap your system's data URL and .proto into server.js.

Of course, you'll also have to use a different map. I've written a bit about how to create these maps in D3 before. My write-up is just an extension of the formal D3 write-up by Mike Bostock, but mine's tailored to Hawai‘i.

How do I install and run this?

For Mac OS X

Prerequisites

  • Homebrew
  • Git

Do this:

Install node.js

$ brew install node

Make sure it's on your path:

export PATH="/usr/local/share/npm/bin:$PATH"

Install Meteor

$ curl https://install.meteor.com | /bin/sh

Grab LiveBus

$ git clone https://github.com/PasDeChocolat/LiveBus.git

Run app

$ cd LiveBus
$ meteor

Open a browser and point it to http://localhost:3000/

Notes

This is not using TheBus' older HEA API. It favors the GTFS-realtime feed, as this is the direction we seem to be going in for future services.

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Copyright © 2013 Pas de Chocolat, LLC

livebus's People

Contributors

mudphone avatar axelson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.