Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/vbb-line-variant-score
Identify the canonical variants of a VBB line.
https://github.com/derhuerst/vbb-line-variant-score
berlin bvg public-transport transit vbb
Last synced: 3 days ago
JSON representation
Identify the canonical variants of a VBB line.
- Host: GitHub
- URL: https://github.com/derhuerst/vbb-line-variant-score
- Owner: derhuerst
- License: isc
- Created: 2018-05-03T18:39:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-05T10:21:58.000Z (over 6 years ago)
- Last Synced: 2024-11-08T09:17:16.989Z (about 2 months ago)
- Topics: berlin, bvg, public-transport, transit, vbb
- Language: JavaScript
- Homepage: https://github.com/derhuerst/vbb-line-variant-score#vbb-line-variant-score
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# vbb-line-variant-score
**Identify the canonical variants of a VBB line.**
[![npm version](https://img.shields.io/npm/v/vbb-line-variant-score.svg)](https://www.npmjs.com/package/vbb-line-variant-score)
[![build status](https://api.travis-ci.org/derhuerst/vbb-line-variant-score.svg?branch=master)](https://travis-ci.org/derhuerst/vbb-line-variant-score)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/vbb-line-variant-score.svg)
[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)
[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)## Installing
```shell
npm install vbb-line-variant-score
```## Usage
```js
const readLines = require('vbb-lines')readLines()
.on('data', (line) => {
const computeLineVariantScore = create(line.variants)for (let variant of line.variants) {
console.log(
computeLineVariantScore(variant),
variant
)
}
})
```Most VBB lines have 1 "canonical" set of stations, hence 2 "canonical" variants. They will be the 2 variants with the highest score.
## Contributing
If you have a question or have difficulties using `vbb-line-variant-score`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/vbb-line-variant-score/issues).