# transitive-js

> A tool for generating dynamic stylized transit maps that are easy to understand.

Latest version **0.14.1** (published 2022-05-16) · 0 weekly downloads

## Install

```sh
npm install transitive-js
pnpm add transitive-js
yarn add transitive-js
bun add transitive-js
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.14.1 |
| Published | 2022-05-16 |
| First published | 2015-11-12 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 702 |
| Author | Conveyal |
| Maintainers | trevorgerhardt, david.emory, evansiroky, landonreed |
| Keywords | d3, maps, GTFS |

## Links

- npm: https://www.npmjs.com/package/transitive-js
- Repository: https://github.com/conveyal/transitive.js
- Homepage: http://conveyal.com/
- Issues: https://github.com/conveyal/transitive.js/issues
- npm.io page: https://npm.io/package/transitive-js

## Dependencies (11)

- [d3](https://npm.io/package/d3.md) ^3.5.8
- [debug](https://npm.io/package/debug.md) ^2.5.1
- [svg.js](https://npm.io/package/svg.js.md) ^2.6.5
- [augment](https://npm.io/package/augment.md) 4.3.0
- [measure-text](https://npm.io/package/measure-text.md) ^0.0.4
- [rounded-rect](https://npm.io/package/rounded-rect.md) ^0.0.1
- [component-each](https://npm.io/package/component-each.md) 0.2.6
- [lodash.foreach](https://npm.io/package/lodash.foreach.md) ^4.5.0
- [priorityqueuejs](https://npm.io/package/priorityqueuejs.md) 1.0.0
- [component-emitter](https://npm.io/package/component-emitter.md) 1.2.1
- [sphericalmercator](https://npm.io/package/sphericalmercator.md) ^1.0.5

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.14.1 (latest) — 2022-05-16
- 0.14.0 — 2021-10-18
- 0.13.8 — 2021-06-03
- 0.13.7 — 2021-04-26
- 0.13.6 — 2021-04-06
- 0.13.5 — 2020-12-01
- 0.13.4 — 2020-11-05
- 0.13.3 — 2020-06-22
- 0.13.2 — 2020-05-23
- 0.13.1 — 2020-05-22
- 0.13.0 — 2019-06-21
- 0.12.0 — 2018-04-11
- 0.11.0 — 2018-02-28
- 0.10.0 — 2017-12-12
- 0.9.2 — 2016-11-21
- … 7 more at https://npm.io/package/transitive-js/versions

## README

# transitive.js [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url]

A tool for generating dynamic stylized transit maps that are easy to understand. Transitive takes in information describing specific transport network elements (routes, stops, journeys) -- typically produced by the OpenTripPlanner Profiler extension -- and produces a schematic map of those elements:

![threeoptions](img/threeoptions.png)

Dynamic styling of the network elements allows for interactivity and flexibility in the visual presentation. For instance, a single journey can be highlighted:

![threeoptions_focused](img/threeoptions_focused.png)

A Transitive map can be embedded as a freestanding web element or overlaid onto a [Leaflet](http://leafletjs.com/) map using the [Leaflet.TransitiveLayer](https://github.com/conveyal/Leaflet.TransitiveLayer) plugin.

Transitive is supported by the [Mobility Lab](http://mobilitylab.org/) [Transit Tech Initiative](http://mobilitylab.org/tech/transit-tech-initiative/). Read more in [this Mobility Lab article](http://mobilitylab.org/2014/04/16/the-technology-behind-a-new-kind-of-travel-planning/).

## Storybook

To view samples of Transitive in action, [check out the live Storybook](https://s3.amazonaws.com/transitive.js/index.html).

You can also run this locally with:

```bash
git clone https://github.com/conveyal/transitive.js
cd transitive.js
yarn start
# Go to http://localhost:5555 to view the storybook (the web page should open automatically)
```

### Usage of otp-ui

These stories rely on the [otp-ui](https://github.com/opentripplanner/otp-ui)
project to render transitive data on a Leaflet map. Specifically, it uses:
- @opentripplanner/base-map - renders a Leaflet base map
- @opentripplanner/core-utils - converts an OpenTripPlanner itinerary object into
  data that Transitive can read.
- @opentripplanner/transitive-overlay - copied from the otp-ui project and
  replaces the Transitive import with the local copy (useful for testing local
  changes)

### BYOD - Bring your own data

To test out how your own data (e.g., an OpenTripPlanner itinerary) would appear in
Transitive, try replacing the `itinerary` prop in the [Itinerary](https://s3.amazonaws.com/transitive.js/index.html?path=/story/example-transitive--itinerary) (for OpenTripPlanner itineraries) story (or `transitiveData`
in the [Profile](https://s3.amazonaws.com/transitive.js/index.html?path=/story/example-transitive--profile)
story).

You can also override the default style by adding a `style` prop. See a style
example here: https://github.com/conveyal/transitive-demo/blob/master/styles.js

## Demo

* [Demo of a freestanding Transitive map](http://conveyal.github.io/transitive.js)
* [Demo using Leaflet and Leaflet.TransitiveLayer](http://conveyal.github.io/Leaflet.TransitiveLayer)

## API

[See documentation here](https://github.com/conveyal/transitive.js/wiki/API-Documentation).

## See Also

- [conveyal/modeify](https://github.com/conveyal/modeify)

## License

MIT

[npm-image]: https://img.shields.io/npm/v/transitive-js.svg?maxAge=2592000&style=flat-square
[npm-url]: https://www.npmjs.com/package/transitive-js
[travis-image]: https://img.shields.io/travis/conveyal/transitive.js.svg?style=flat-square
[travis-url]: https://travis-ci.org/conveyal/transitive.js

---
_Source: https://npm.io/package/transitive-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
