Options
All
  • Public
  • Public/Protected
  • All
Menu

Planner.js: A JS library for route planning

πŸ›ΈοΈ Build Status 🚴 MIT License πŸš‰ npm version πŸš€

$ npm install plannerjs

Include it in the browser:

<script src="https://planner.js.org/js/planner-latest.js"></script>

Include it in your JavaScript project:

const Planner = require('plannerjs').default;

// or

import Planner              from 'plannerjs';

Use it in both environments:

const planner = new Planner();

planner.query({
  from: "http://irail.be/stations/NMBS/008812005", // Brussels North
  to: "http://irail.be/stations/NMBS/008892007", // Ghent-Sint-Pieters
  minimumDepartureTime: new Date("Mon Feb 11 2019 16:00:00"),
  maximumArrivalTime: new Date("Mon Feb 11 2019 19:00:00"),
  publicTransportOnly: true,

  walkingSpeed: 3, // KmH
  minimumWalkingSpeed: 3, // KmH

  maximumWalkingDistance: 200, // meters

  minimumTransferDuration: Planner.Units.fromMinutes(1),
  maximumTransferDuration: Planner.Units.fromMinutes(30),

  maximumTravelDuration: Planner.Units.fromHours(1.5),

  maximumTransfers: 4,
})
  .take(3)
  .on('data', (path) => {
   console.log(path);
  })
  .on('end', () => {
    console.log('No more paths!')
  })
  .on('error', (error) => {
    console.error(error);
  });

Documentation

For further instructions, follow the documentation at https://planner.js.org/

Developing

  • Building the docs with typedoc: npm run doc
  • Testing with jest: npm test
  • Build a new browser version with npm run browser
  • Bundle the latest planner for the docs example npm run doc-bundle

Index

Modules

Enumerations

Classes

Interfaces

Type aliases

Variables

Object literals

Type aliases

ConnectionsFetcherFactory

ConnectionsFetcherFactory: function

Type declaration

DistanceM

DistanceM: number

Represents distance in m (meters)

DurationMs

DurationMs: number

Represents duration in ms (milliseconds)

SpeedKmH

SpeedKmH: number

Represents duration in km/h (kilometers per hour)

StopsFetcherFactory

StopsFetcherFactory: function

Type declaration

Variables

Const catalogDeLijn

catalogDeLijn: Catalog = new Catalog()

Const catalogNmbs

catalogNmbs: Catalog = new Catalog()

Object literals

Const TYPES

TYPES: object

Catalog

Catalog: symbol = Symbol("Catalog")

ConnectionsFetcher

ConnectionsFetcher: symbol = Symbol("ConnectionsFetcher")

ConnectionsFetcherFactory

ConnectionsFetcherFactory: symbol = Symbol("ConnectionsFetcherFactory")

ConnectionsProvider

ConnectionsProvider: symbol = Symbol("ConnectionsProvider")

Context

Context: symbol = Symbol("Context")

JourneyExtractor

JourneyExtractor: symbol = Symbol("JourneyExtractor")

LDFetch

LDFetch: symbol = Symbol("LDFetch")

LocationResolver

LocationResolver: symbol = Symbol("LocationResolver")

PublicTransportPlanner

PublicTransportPlanner: symbol = Symbol("PublicTransportPlanner")

PublicTransportPlannerFactory

PublicTransportPlannerFactory: symbol = Symbol("PublicTransportPlannerFactory")

QueryRunner

QueryRunner: symbol = Symbol("QueryRunner")

ReachableStopsFinder

ReachableStopsFinder: symbol = Symbol("ReachableStopsFinder")

RoadPlanner

RoadPlanner: symbol = Symbol("RoadPlanner")

RoadPlannerFactory

RoadPlannerFactory: symbol = Symbol("RoadPlannerFactory")

StopsFetcher

StopsFetcher: symbol = Symbol("StopsFetcher")

StopsFetcherFactory

StopsFetcherFactory: symbol = Symbol("StopsFetcherFactory")

StopsProvider

StopsProvider: symbol = Symbol("StopsProvider")

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc