-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathconstants.js
260 lines (243 loc) · 7.25 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
'use strict';
// projection names to d3 function name
exports.projNames = {
airy: 'airy',
aitoff: 'aitoff',
'albers usa': 'albersUsa',
albers: 'albers',
// 'armadillo': 'armadillo',
august: 'august',
'azimuthal equal area': 'azimuthalEqualArea',
'azimuthal equidistant': 'azimuthalEquidistant',
baker: 'baker',
// 'berghaus': 'berghaus',
bertin1953: 'bertin1953',
boggs: 'boggs',
bonne: 'bonne',
bottomley: 'bottomley',
bromley: 'bromley',
// 'chamberlin africa': 'chamberlinAfrica',
// 'chamberlin': 'chamberlin',
collignon: 'collignon',
'conic conformal': 'conicConformal',
'conic equal area': 'conicEqualArea',
'conic equidistant': 'conicEquidistant',
craig: 'craig',
craster: 'craster',
'cylindrical equal area': 'cylindricalEqualArea',
'cylindrical stereographic': 'cylindricalStereographic',
eckert1: 'eckert1',
eckert2: 'eckert2',
eckert3: 'eckert3',
eckert4: 'eckert4',
eckert5: 'eckert5',
eckert6: 'eckert6',
eisenlohr: 'eisenlohr',
'equal earth': 'equalEarth',
equirectangular: 'equirectangular',
fahey: 'fahey',
'foucaut sinusoidal': 'foucautSinusoidal',
foucaut: 'foucaut',
// 'gilbert': 'gilbert',
// 'gingery': 'gingery',
ginzburg4: 'ginzburg4',
ginzburg5: 'ginzburg5',
ginzburg6: 'ginzburg6',
ginzburg8: 'ginzburg8',
ginzburg9: 'ginzburg9',
gnomonic: 'gnomonic',
'gringorten quincuncial': 'gringortenQuincuncial',
gringorten: 'gringorten',
guyou: 'guyou',
// 'hammer retroazimuthal': 'hammerRetroazimuthal',
hammer: 'hammer',
// 'healpix': 'healpix',
hill: 'hill',
homolosine: 'homolosine',
hufnagel: 'hufnagel',
hyperelliptical: 'hyperelliptical',
// 'interrupted boggs': 'interruptedBoggs',
// 'interrupted homolosine': 'interruptedHomolosine',
// 'interrupted mollweide hemispheres': 'interruptedMollweideHemispheres',
// 'interrupted mollweide': 'interruptedMollweide',
// 'interrupted quartic authalic': 'interruptedQuarticAuthalic',
// 'interrupted sinu mollweide': 'interruptedSinuMollweide',
// 'interrupted sinusoidal': 'interruptedSinusoidal',
kavrayskiy7: 'kavrayskiy7',
lagrange: 'lagrange',
larrivee: 'larrivee',
laskowski: 'laskowski',
// 'littrow': 'littrow',
loximuthal: 'loximuthal',
mercator: 'mercator',
miller: 'miller',
// 'modified stereographic alaska': 'modifiedStereographicAlaska',
// 'modified stereographic gs48': 'modifiedStereographicGs48',
// 'modified stereographic gs50': 'modifiedStereographicGs50',
// 'modified stereographic lee': 'modifiedStereographicLee',
// 'modified stereographic miller': 'modifiedStereographicMiller',
// 'modified stereographic': 'modifiedStereographic',
mollweide: 'mollweide',
'mt flat polar parabolic': 'mtFlatPolarParabolic',
'mt flat polar quartic': 'mtFlatPolarQuartic',
'mt flat polar sinusoidal': 'mtFlatPolarSinusoidal',
'natural earth': 'naturalEarth',
'natural earth1': 'naturalEarth1',
'natural earth2': 'naturalEarth2',
'nell hammer': 'nellHammer',
nicolosi: 'nicolosi',
orthographic: 'orthographic',
patterson: 'patterson',
'peirce quincuncial': 'peirceQuincuncial',
polyconic: 'polyconic',
// 'polyhedral butterfly': 'polyhedralButterfly',
// 'polyhedral collignon': 'polyhedralCollignon',
// 'polyhedral waterman': 'polyhedralWaterman',
'rectangular polyconic': 'rectangularPolyconic',
robinson: 'robinson',
satellite: 'satellite',
'sinu mollweide': 'sinuMollweide',
sinusoidal: 'sinusoidal',
stereographic: 'stereographic',
times: 'times',
'transverse mercator': 'transverseMercator',
// 'two point azimuthalUsa': 'twoPointAzimuthalUsa',
// 'two point azimuthal': 'twoPointAzimuthal',
// 'two point equidistantUsa': 'twoPointEquidistantUsa',
// 'two point equidistant': 'twoPointEquidistant',
'van der grinten': 'vanDerGrinten',
'van der grinten2': 'vanDerGrinten2',
'van der grinten3': 'vanDerGrinten3',
'van der grinten4': 'vanDerGrinten4',
wagner4: 'wagner4',
wagner6: 'wagner6',
// 'wagner7': 'wagner7',
// 'wagner': 'wagner',
wiechel: 'wiechel',
'winkel tripel': 'winkel3',
winkel3: 'winkel3',
};
// name of the axes
exports.axesNames = ['lonaxis', 'lataxis'];
// max longitudinal angular span (EXPERIMENTAL)
exports.lonaxisSpan = {
orthographic: 180,
'azimuthal equal area': 360,
'azimuthal equidistant': 360,
'conic conformal': 180,
gnomonic: 160,
stereographic: 180,
'transverse mercator': 180,
'*': 360
};
// max latitudinal angular span (EXPERIMENTAL)
exports.lataxisSpan = {
'conic conformal': 150,
stereographic: 179.5,
'*': 180
};
var world = {
lonaxisRange: [-180, 180],
lataxisRange: [-90, 90],
projType: 'equirectangular',
projRotate: [0, 0, 0]
};
// defaults for each scope
exports.scopeDefaults = {
un: world,
world: world,
usa: {
lonaxisRange: [-180, -50],
lataxisRange: [15, 80],
projType: 'albers usa'
},
europe: {
lonaxisRange: [-30, 60],
lataxisRange: [30, 85],
projType: 'conic conformal',
projRotate: [15, 0, 0],
projParallels: [0, 60]
},
asia: {
lonaxisRange: [22, 160],
lataxisRange: [-15, 55],
projType: 'mercator',
projRotate: [0, 0, 0]
},
africa: {
lonaxisRange: [-30, 60],
lataxisRange: [-40, 40],
projType: 'mercator',
projRotate: [0, 0, 0]
},
'north america': {
lonaxisRange: [-180, -45],
lataxisRange: [5, 85],
projType: 'conic conformal',
projRotate: [-100, 0, 0],
projParallels: [29.5, 45.5]
},
'south america': {
lonaxisRange: [-100, -30],
lataxisRange: [-60, 15],
projType: 'mercator',
projRotate: [0, 0, 0]
}
};
// angular pad to avoid rounding error around clip angles
exports.clipPad = 1e-3;
// map projection precision
exports.precision = 0.1;
// default land and water fill colors
exports.landColor = '#F0DC82';
exports.waterColor = '#3399FF';
// locationmode to layer name
exports.locationmodeToLayer = {
'ISO-3': 'countries',
'USA-states': 'subunits',
'country names': 'countries'
};
// SVG element for a sphere (use to frame maps)
exports.sphereSVG = {type: 'Sphere'};
// N.B. base layer names must be the same as in the topojson files
// base layer with a fill color
exports.fillLayers = {
ocean: 1,
land: 1,
lakes: 1
};
// base layer with a only a line color
exports.lineLayers = {
subunits: 1,
countries: 1,
coastlines: 1,
rivers: 1,
frame: 1
};
exports.layers = [
'bg',
'ocean', 'land', 'lakes',
'subunits', 'countries', 'coastlines', 'rivers',
'lataxis', 'lonaxis', 'frame',
'backplot',
'frontplot'
];
exports.layersForChoropleth = [
'bg',
'ocean', 'land',
'subunits', 'countries', 'coastlines',
'lataxis', 'lonaxis', 'frame',
'backplot',
'rivers', 'lakes',
'frontplot'
];
exports.layerNameToAdjective = {
ocean: 'ocean',
land: 'land',
lakes: 'lake',
subunits: 'subunit',
countries: 'country',
coastlines: 'coastline',
rivers: 'river',
frame: 'frame'
};