• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    JavaScript
  • Created about 10 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚠 Browser, NodeJs library and command-line tool for handling tube data

Tubemaps

Gitter

Given a dataset, get all the tube/stations relations done!

London tubemap

Visualizing the tube in D3 and TubeMaps.

Install

$ npm install --save tubemaps

For command-line use:

$ npm install --g tubemaps

Soon on bower.

Command line tool

For now Command line only supports London

$ tubemaps path  --from "Euston" --to "Hammersmith"
# Victoria Line: Euston to Warren Street
# Victoria Line: Warren Street to Oxford Circus
# Victoria Line: Oxford Circus to Green Park
# Victoria Line: Green Park to Victoria
# Victoria Line: Victoria to Sloane Square
# District Line: Sloane Square to South Kensington
# Piccadilly Line: South Kensington to Gloucester Road
# Piccadilly Line: Gloucester Road to Earl's Court
# District Line: Earl's Court to Barons Court
# Piccadilly Line: Barons Court to Hammersmith

$ tubemaps station "Euston" --london                    
# Northern Line: Camden Town
# Victoria Line: King's Cross St. Pancras
# Northern Line: Mornington Crescent
# Victoria Line: Warren Street
# Victoria Line: King's Cross St. Pancras
# Victoria Line: Warren Street

NodeJS Library

var TubeMap = require('tubemaps').TubeMap;
var london = new TubeMap({
  stations: csv.stations,
  lines: csv.lines,
  connections: csv.connections
});

// Find information about a station
var victoriaStation = london.getStationByName('Victoria');
// {conns:[{display_name: "Euston"}, ...], ..}

// Find information a line
var victoriaLine = london.getLineByName('Victoria Line');
// [station1, station2,..]

// Find all connections in a line
var conns = london.line(victoriaLine)
// [{station1: #euston, station2: #warrentStreet}]

// Find path between two stations
var conns = london.path(euston, victoria)
// [{station1: #euston, station2: #warrentStreet, line: #victoriaLine}]

// Find path between two stations in a line
var conns = london.path(euston, victoria, line)
// [{station1: #euston, station2: #warrentStreet, line: #victoriaLine}]

Existing datasets

London

var Maps = require('tubemaps/maps');

Maps("london", function(err, tube) {
  var euston = tube.getStationByName("Euston");
  var victoria = tube.getStationByName("Victoria");
  console.log(tube.path(euston, victoria))
})

Use yours

Look at our datasets and make it identical but with your data

var TubeMap = require('tubemaps').TubeMap;
var readCSVs = require('tubemaps/csv').readCSVs;

var files = {
  connections: __dirname + '/../datasets/london.connections.csv',
  lines: __dirname + '/../datasets/london.lines.csv',
  stations: __dirname + '/../datasets/london.stations.csv'
};

readCSVs(files, function(err, csvs) {

  var tubemap = new TubeMap({
    connections: csvs[0],
    lines: csvs[1],
    stations: csvs[2]
  });

  var victoriaLine = tubemap.getLineByName("Victoria Line");
  console.log(tubemap.line(victoriaLine.line));

});

Examples

Want to contribute or add dataset?

  • Ping me on twitter @nicolagreco, or a PR here.

More Repositories

1

node-imessage

πŸ“¬ Query iMessage from terminal and NodeJS
JavaScript
432
star
2

decentralized-research

πŸ“– My reading list of academic papers and research notes
TeX
241
star
3

poem-flowers

[POEM] Interactive visualization and code poetry. (probably) first poem in git commits
HTML
61
star
4

js-gossip-cyclon

πŸ‘ͺ Cyclon Gossip: (P2P membership management) in Javascript
JavaScript
45
star
5

emoji-commits

πŸš€ The new generation of git commit messages
30
star
6

isawake

πŸŒ… The (eventually) biggest crowdsourced database of people awake, sign up with a pull-request
HTML
27
star
7

crowd

Crowd computing in javascript. Distribute tasks to execute in connected browsers
JavaScript
19
star
8

node-fxos

πŸ”₯πŸ• Simplify interaction between mankind and FirefoxOS during webapps development
JavaScript
18
star
9

rust-yinyan

Rust
11
star
10

learningmachinelearning

Resources I am using to learn machine learning
10
star
11

NFT-Auction

A basic ERC721 generator and auction with a minimal (bad) user interface.
JavaScript
8
star
12

spacebar

Spacebar when you are ready
JavaScript
6
star
13

schemas

Javascript library and command-line tool to rock Schemas and Linked Data
JavaScript
6
star
14

hh

It makes a javascript function an high order function
JavaScript
5
star
15

node-solid

Node implementation of Solid
JavaScript
5
star
16

qmongo

Simple helper to use Q promises with Mongoose
JavaScript
5
star
17

node-deepdream

Deepdreams in nodejs
JavaScript
5
star
18

captain-log

Automating the logs from your favorite captains
JavaScript
4
star
19

cross-data-paths

Paths that follow the links (JSON Pointers with followable links to other documents)
JavaScript
4
star
20

fx-ports

Discover Firefox Desktop and Firefox OS remote debugging tools listening ports in NodeJS/CLI
JavaScript
4
star
21

connectable

Connect data, devices and things with each other
Python
3
star
22

fxos-start

Start a Firefox OS simulator in NodeJS/CLI
JavaScript
3
star
23

poem-love-season

[POEM] Interactive visualization and code poetry. Love season
JavaScript
3
star
24

node-solid-idp

Identity provider for Solid in Node/Javascript
JavaScript
3
star
25

bubbles

🍑 Data Containers (interoperable and decentralized)
JavaScript
2
star
26

folder-to-rdf

Get an RDF graph of the contents of a folder
JavaScript
2
star
27

fireplay-atom

A fantastic plugin connecting your favorite editor with your favorite web debugger
CoffeeScript
2
star
28

mount-solid

Mount Solid
JavaScript
2
star
29

filecoin-tla

this is a playground
TLA
2
star
30

node-solid-acl

Node/Javascript implementation of Access Control List for Solid
JavaScript
2
star
31

code-poems

Poems in Code by Nicola Greco
2
star
32

js-simple-ipld

Simple pimple, easy peasy IPLD
JavaScript
2
star
33

python-simplified-graph-algorithms

Graph algorithm written in python in a simplified way. UCL COMP1002 Theory 1
Python
2
star
34

simplerdf-parse

WIP Parse RDF strings in a simple way
JavaScript
2
star
35

obs

JavaScript
2
star
36

rdf-store-acl

Add ACL support to your RDF store
JavaScript
2
star
37

fxos-deploy

Deploy apps to FirefoxOS in NodeJS/CLI
JavaScript
2
star
38

fxos-simulators

Find Firefox OS simulators in your Firefox path in NodeJS/CLI
JavaScript
2
star
39

security-project

Python
1
star
40

fxos-findapp

Find a particular app in FirefoxOS in NodeJS/CLI
JavaScript
1
star
41

hackathons-the-book

δ½ ε₯½
1
star
42

r2

Attempt to implement fastest PoRep.Replicate algorithm
Rust
1
star
43

berryaccelerator

Move your robot with your phone accelerator or remotely from a web interface
JavaScript
1
star
44

authenticated-rdf

Making RDF Authenticated
1
star
45

datacontainer

WIP Containers for data (with json pointers)
JavaScript
1
star
46

fxos-console

Get the console of your FirefoxOS
JavaScript
1
star
47

on-decentralization

Issues and notes on decentralization
1
star
48

fxos-connect

Connect to a FirefoxOS
JavaScript
1
star
49

js-gossip-vicinity

πŸ‘ͺ Vicinity Gossip implemented in Javascript
1
star
50

json-to-ldp

Navigate JSON in a Linked Data Platform fashion
JavaScript
1
star
51

nicola.github.io

SCSS
1
star
52

natural-html

Writing HTML in Natural Language
1
star
53

bubbles-server

Interoperable decentralized data storage
JavaScript
1
star
54

gulp-firefoxos-example

Use gulp to deploy and live reload CSS while developing FirefoxOS apps
JavaScript
1
star
55

verifiable-markets

1
star
56

js-peer-set-cyclon

πŸ‘ͺ Set of neighboors for the gossip protocol Cyclon
JavaScript
1
star
57

fxos-reloadcss

Live-reload CSS in FirefoxOS, without reloading the app in NodeJS/CLI
JavaScript
1
star
58

decentralized-user-security-model

A set of principles that a federated/decentralized system should provide to their users
1
star