Skip to content

Commit 2e06b88

Browse files
Merge pull request #105 from conveyal/dev
v0.7.0
2 parents 08ff877 + e1a8f2c commit 2e06b88

File tree

83 files changed

+11108
-3245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+11108
-3245
lines changed

.flowconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[ignore]
2+
.*/node_modules/auth0-lock/.*
3+
.*/node_modules/config-chain/.*
4+
.*/node_modules/npmconf/.*
5+
.*/node_modules/mapbox.js/docs/examples/.*
6+
.*/node_modules/react-leaflet/src/.*
7+
8+
[include]
9+
10+
[libs]
11+
12+
[options]

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ assets
44
configurations/*
55
!configurations/default
66
!configurations/messages
7+
tmp

.travis.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
sudo: false
22
language: node_js
33
cache:
4-
directories:
5-
- ~/.yarn-cache
4+
yarn: true
65
notifications:
76
email: false
87
node_js:
98
- '6'
109
before_install:
11-
- npm i -g yarn
12-
install:
13-
- yarn
10+
- yarn global add codecov
11+
scripts:
12+
- yarn test -- --coverage --coverage-paths src/**/*.js
13+
- codecov
14+
- yarn run build
1415
after_success:
1516
- yarn run semantic-release
1617
branches:

__mocks__/leaflet.js

+176
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/* global jest, module, require */
2+
3+
import assign from 'lodash/assign'
4+
5+
const L = require.requireActual('leaflet')
6+
const LeafletMock = jest.genMockFromModule('leaflet')
7+
8+
class ControlMock extends LeafletMock.Control {
9+
constructor (options) {
10+
super()
11+
this.options = {...L.Control.prototype.options, ...options}
12+
}
13+
14+
getPosition () {
15+
return this.options.position
16+
}
17+
18+
setPosition (position) {
19+
this.options.position = position
20+
return this
21+
}
22+
}
23+
24+
const controlMock = options => new ControlMock(options)
25+
26+
class LayersControlMock extends ControlMock {
27+
constructor (baseLayers = [], overlays = [], options) {
28+
super(options)
29+
this._layers = []
30+
31+
baseLayers.forEach((layer, i) => {
32+
this._addLayer(layer, i)
33+
})
34+
overlays.forEach((layer, i) => {
35+
this._addLayer(layer, i, true)
36+
})
37+
}
38+
39+
_addLayer (layer, name, overlay) {
40+
this._layers.push({layer, name, overlay})
41+
}
42+
43+
addBaseLayer (layer, name) {
44+
this._addLayer(layer, name)
45+
return this
46+
}
47+
48+
addOverlay (layer, name) {
49+
this._addLayer(layer, name, true)
50+
return this
51+
}
52+
53+
removeLayer (obj) {
54+
this._layers.splice(this._layers.indexOf(obj), 1)
55+
}
56+
}
57+
58+
ControlMock.Layers = LayersControlMock
59+
controlMock.layers = (baseLayers, overlays, options) => {
60+
return new LayersControlMock(baseLayers, overlays, options)
61+
}
62+
63+
class MapMock extends LeafletMock.Map {
64+
constructor (id, options = {}) {
65+
super()
66+
assign(this, L.Mixin.Events)
67+
68+
this.options = {...L.Map.prototype.options, ...options}
69+
this._container = id
70+
71+
if (options.bounds) {
72+
this.fitBounds(options.bounds, options.boundsOptions)
73+
}
74+
75+
if (options.maxBounds) {
76+
this.setMaxBounds(options.maxBounds)
77+
}
78+
79+
if (options.center && options.zoom !== undefined) {
80+
this.setView(L.latLng(options.center), options.zoom)
81+
}
82+
}
83+
84+
_limitZoom (zoom) {
85+
const min = this.getMinZoom()
86+
const max = this.getMaxZoom()
87+
return Math.max(min, Math.min(max, zoom))
88+
}
89+
90+
_resetView (center, zoom) {
91+
this._initialCenter = center
92+
this._zoom = zoom
93+
}
94+
95+
fitBounds (bounds, options) {
96+
this._bounds = bounds
97+
this._boundsOptions = options
98+
}
99+
100+
getBounds () {
101+
return this._bounds
102+
}
103+
104+
getCenter () {
105+
return this._initialCenter
106+
}
107+
108+
getMaxZoom () {
109+
return this.options.maxZoom === undefined ? Infinity : this.options.maxZoom
110+
}
111+
112+
getMinZoom () {
113+
return this.options.minZoom === undefined ? 0 : this.options.minZoom
114+
}
115+
116+
getZoom () {
117+
return this._zoom
118+
}
119+
120+
setMaxBounds (bounds) {
121+
bounds = L.latLngBounds(bounds)
122+
this.options.maxBounds = bounds
123+
return this
124+
}
125+
126+
setView (center, zoom) {
127+
zoom = zoom === undefined ? this.getZoom() : zoom
128+
this._resetView(L.latLng(center), this._limitZoom(zoom))
129+
return this
130+
}
131+
132+
setZoom (zoom) {
133+
return this.setView(this.getCenter(), zoom)
134+
}
135+
}
136+
137+
class PopupMock extends LeafletMock.Popup {
138+
constructor (options, source) {
139+
super()
140+
assign(this, L.Mixin.Events)
141+
142+
this.options = {...L.Popup.prototype.options, ...options}
143+
this._source = source
144+
}
145+
146+
getContent () {
147+
return this._content
148+
}
149+
150+
setContent (content) {
151+
this._content = content
152+
}
153+
}
154+
155+
module.exports = {
156+
...LeafletMock,
157+
Control: ControlMock,
158+
control: controlMock,
159+
LatLng: L.LatLng,
160+
latLng: L.latLng,
161+
LatLngBounds: L.LatLngBounds,
162+
latLngBounds: L.latLngBounds,
163+
geoJson (data, props) {
164+
return {
165+
data,
166+
getLayers () {
167+
return []
168+
},
169+
props
170+
}
171+
},
172+
Map: MapMock,
173+
map: (id, options) => new MapMock(id, options),
174+
Popup: PopupMock,
175+
popup: (options, source) => new PopupMock(options, source)
176+
}

__mocks__/react-leaflet.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* global jest */
2+
const ReactLeaflet = require.requireActual('react-leaflet')
3+
const ReactLeafletMock = jest.genMockFromModule('react-leaflet')
4+
5+
ReactLeaflet.ZoomControl = ReactLeafletMock.ZoomControl
6+
7+
module.exports = ReactLeaflet

configurations/default/messages.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Systems:
2+
CalculatingAccessibility: Calculating accessibility...
3+
SelectStart: Select a location to see accessibility
4+
SelectEnd: Select an endpoint to see possible trips
5+
Show: show
26
AccessTitle: Access to
37
BaseTitle: Proposed Transit
48
ComparisonTitle: Current Transit

configurations/default/settings.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ entries:
55
env: development
66
flyle: true
77
s3bucket: taui
8-
serve: true

configurations/default/store.yml

+31-12
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,50 @@
11
browsochrones:
2-
active: base
3-
base: null
4-
comparison: null
2+
active: 0
3+
instances: []
54
gridsUrl: https://dz69bcpxxuhn6.cloudfront.net/indy-baseline-z9/intgrids
65
grids:
76
- Jobs_total
87
- Workers_total
98
origins:
10-
- https://dz69bcpxxuhn6.cloudfront.net/indyconnect-marion-v6
11-
- https://dz69bcpxxuhn6.cloudfront.net/indy-baseline-v6
9+
- name: Baseline
10+
url: https://dz69bcpxxuhn6.cloudfront.net/indy-baseline-v6
11+
- name: Marion
12+
url: https://dz69bcpxxuhn6.cloudfront.net/indyconnect-marion-v6
13+
destinations: []
1214
geocoder:
1315
focusLatlng:
1416
lat: 39.7691
1517
lng: -86.1570
1618
boundary:
1719
country: us
1820
rect:
19-
maxLatlng:
20-
lat: 40.271143686084194
21-
lng: -85.462646484375
22-
minLatlng:
23-
lat: 39.35978526869001
24-
lng: -86.8524169921875
21+
maxLat: 40.271143686084194
22+
maxLon: -85.462646484375
23+
minLat: 39.35978526869001
24+
minLon: -86.8524169921875
25+
pointsOfInterest:
26+
- name: Location 1
27+
coordinates: [-86.1570, 39.7691]
28+
- name: Location 2
29+
coordinates: [-86.1580, 39.7681]
2530
map:
26-
active: base
31+
active: 0
2732
centerCoordinates: [39.7691, -86.1570]
2833
geojson: []
2934
zoom: 11
35+
transitive: null
36+
isochrones: []
37+
transitives: []
38+
travelTimes: []
39+
inVehicleTravelTimes: []
40+
waitTimes: []
41+
zoom: 11
42+
mapMarkers:
43+
start: {}
44+
end: {}
45+
timeCutoff:
46+
selected: 60
47+
times: []
3048
ui:
3149
fetches: 0
50+
showLog: true

configurations/test/env.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
BROWSOCHRONES_BASE_URL:
2+
LEAFLET_TILE_URL:
3+
LEAFLET_RETINA_URL:
4+
LEAFLET_ATTRIBUTION:
5+
MAPBOX_ACCESS_TOKEN:
6+
MAPZEN_SEARCH_KEY:
7+
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// flow-typed signature: 351afdb4dc19c4d3a1be1ffa1fa58d3f
2+
// flow-typed version: <<STUB>>/@conveyal/lonlat_v^1.1.1/flow_v0.45.0
3+
4+
/**
5+
* This is an autogenerated libdef stub for:
6+
*
7+
* '@conveyal/lonlat'
8+
*
9+
* Fill this stub out by replacing all the `any` types.
10+
*
11+
* Once filled out, we encourage you to share your work with the
12+
* community by sending a pull request to:
13+
* https://github.com/flowtype/flow-typed
14+
*/
15+
16+
declare module '@conveyal/lonlat' {
17+
declare module.exports: any;
18+
}
19+
20+
/**
21+
* We include stubs for each file inside this npm package in case you need to
22+
* require those files directly. Feel free to delete any files that aren't
23+
* needed.
24+
*/
25+
declare module '@conveyal/lonlat/index.test' {
26+
declare module.exports: any;
27+
}
28+
29+
// Filename aliases
30+
declare module '@conveyal/lonlat/index' {
31+
declare module.exports: $Exports<'@conveyal/lonlat'>;
32+
}
33+
declare module '@conveyal/lonlat/index.js' {
34+
declare module.exports: $Exports<'@conveyal/lonlat'>;
35+
}
36+
declare module '@conveyal/lonlat/index.test.js' {
37+
declare module.exports: $Exports<'@conveyal/lonlat/index.test'>;
38+
}

0 commit comments

Comments
 (0)