Skip to content

Commit 5a9983d

Browse files
authoredFeb 27, 2017
Merge pull request #1422 from plotly/geo-aitoff-sinusoidal
Add Aitoff and Sinusoidal projection types
2 parents c227d15 + 3fb5814 commit 5a9983d

File tree

4 files changed

+668
-2
lines changed

4 files changed

+668
-2
lines changed
 

‎src/plots/geo/constants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ params.projNames = {
3333
'hammer': 'hammer',
3434
'transverse mercator': 'transverseMercator',
3535
'albers usa': 'albersUsa',
36-
'winkel tripel': 'winkel3'
36+
'winkel tripel': 'winkel3',
37+
'aitoff': 'aitoff',
38+
'sinusoidal': 'sinusoidal'
3739
};
3840

3941
// name of the axes

‎src/plots/geo/geo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ proto.plot = function(geoCalcData, fullLayout, promises) {
8989
var mouse = d3.mouse(this),
9090
lonlat = _this.projection.invert(mouse);
9191

92-
if(isNaN(lonlat[0]) || isNaN(lonlat[1])) return;
92+
if(!lonlat || isNaN(lonlat[0]) || isNaN(lonlat[1])) return;
9393

9494
var evt = {
9595
target: true,
96.9 KB
Loading
Lines changed: 664 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,664 @@
1+
{
2+
"data": [
3+
{
4+
"text": [
5+
"Mt. Everest",
6+
"Nanga Parbat",
7+
"Jengish Chokusu (ex. Pik Pobedy)",
8+
"Bogda Shan",
9+
"Namcha Barwa",
10+
"Kinabalu",
11+
"K2",
12+
"Yu Shan",
13+
"Kangchenjunga",
14+
"Tirich Mir",
15+
"Gunung Kerinci",
16+
"Fuji San",
17+
"Gunung Rinjani",
18+
"Gunung Semeru",
19+
"Minya Konka",
20+
"Kongur Shan"
21+
],
22+
"lon": [
23+
"86.91666667",
24+
"74.6",
25+
"80.11666667",
26+
"88.33333333",
27+
"95.05",
28+
"116.5666667",
29+
"76.51666667",
30+
"120.95",
31+
"88.15",
32+
"71.85",
33+
"101.2666667",
34+
"138.7333333",
35+
"116.4666667",
36+
"112.9166667",
37+
"101.8833333",
38+
"75.31666667"
39+
],
40+
"lat": [
41+
"27.98333333",
42+
"35.23333333",
43+
"42.03333333",
44+
"43.8",
45+
"29.63333333",
46+
"6.066666667",
47+
"35.88333333",
48+
"23.46666667",
49+
"27.7",
50+
"36.25",
51+
"-1.7",
52+
"35.36666667",
53+
"-8.416666667",
54+
"-8.1",
55+
"29.6",
56+
"38.6"
57+
],
58+
"type": "scattergeo",
59+
"marker": {
60+
"symbol": "triangle-up",
61+
"sizeref": 1451.4,
62+
"size": [
63+
"29028",
64+
"15118",
65+
"13609",
66+
"13523",
67+
"13471",
68+
"13435",
69+
"13179",
70+
"12966",
71+
"12867",
72+
"12827",
73+
"12483",
74+
"12388",
75+
"12224",
76+
"12060",
77+
"11949",
78+
"11762"
79+
]
80+
},
81+
"name": "Asia"
82+
},
83+
{
84+
"text": [
85+
"Aconcagua",
86+
"Mt. McKinley (Denali)",
87+
"Cristobal Colon",
88+
"Mt. Logan",
89+
"Pico de Orizaba (Citlaltepetl)",
90+
"Mauna Kea",
91+
"Chimborazo",
92+
"Mt. Rainier",
93+
"Volcan Tajumulco",
94+
"Pico Bolivar",
95+
"Mt. Fairweather",
96+
"Cerro Chirripo",
97+
"Monte San Valentin",
98+
"Nevado Ojos del Salado",
99+
"Ritacuba Blanco",
100+
"Mt. Blackburn"
101+
],
102+
"lon": [
103+
"-70.01666667",
104+
"-151.05",
105+
"-73.68333333",
106+
"-140.4",
107+
"-97.26666667",
108+
"-155.4666667",
109+
"-78.81666667",
110+
"-121.7666667",
111+
"-91.9",
112+
"-71.05",
113+
"-137.5166667",
114+
"-83.48333333",
115+
"-73.33333333",
116+
"-68.53333333",
117+
"-72.3",
118+
"-143.4333333"
119+
],
120+
"lat": [
121+
"-32.65",
122+
"63.1",
123+
"10.83333333",
124+
"60.56666667",
125+
"19.03333333",
126+
"19.81666667",
127+
"-1.466666667",
128+
"46.85",
129+
"15.05",
130+
"8.533333333",
131+
"58.9",
132+
"9.483333333",
133+
"-46.6",
134+
"-27.11666667",
135+
"6.483333333",
136+
"61.73333333"
137+
],
138+
"type": "scattergeo",
139+
"marker": {
140+
"sizeref": 1142.05,
141+
"symbol": "triangle-up",
142+
"size": [
143+
"22841",
144+
"20138",
145+
"18074",
146+
"17224",
147+
"16148",
148+
"13796",
149+
"13523",
150+
"13196",
151+
"13058",
152+
"12982",
153+
"12956",
154+
"12228",
155+
"12126",
156+
"12100",
157+
"11959",
158+
"11598"
159+
]
160+
},
161+
"name": "Americas"
162+
},
163+
{
164+
"text": [
165+
"Kilimanjaro",
166+
"Gora Elbrus",
167+
"Damavand",
168+
"Ras Dejen",
169+
"Ngaliema (Mt. Stanley)",
170+
"Mt. Cameroon",
171+
"Mt. Kenya",
172+
"Jebel Toubkal",
173+
"Pico Teide",
174+
"Mt. Ararat (Agri Dagi)"
175+
],
176+
"lon": [
177+
"37.35",
178+
"42.43333333",
179+
"52.11666667",
180+
"38.36666667",
181+
"29.86666667",
182+
"9.166666667",
183+
"37.3",
184+
"-7.916666667",
185+
"-16.65",
186+
"44.3"
187+
],
188+
"lat": [
189+
"-3.066666667",
190+
"43.35",
191+
"35.95",
192+
"13.23333333",
193+
"0.383333333",
194+
"4.216666667",
195+
"-0.15",
196+
"31.06666667",
197+
"28.26666667",
198+
"39.7"
199+
],
200+
"type": "scattergeo",
201+
"marker": {
202+
"sizeref": 965.4,
203+
"symbol": "triangle-up",
204+
"size": [
205+
"19308",
206+
"15554",
207+
"15311",
208+
"13090",
209+
"12962",
210+
"12798",
211+
"12549",
212+
"12319",
213+
"12198",
214+
"11847"
215+
]
216+
},
217+
"name": "Middle East & Africa"
218+
},
219+
{
220+
"text": [
221+
"Mont Blanc",
222+
"Klyuchevskaya Volcano",
223+
"Gunnbjørnsfjeld"
224+
],
225+
"lon": [
226+
"6.866666667",
227+
"160.65",
228+
"-29.9"
229+
],
230+
"lat": [
231+
"45.83333333",
232+
"56.05",
233+
"68.91666667"
234+
],
235+
"type": "scattergeo",
236+
"marker": {
237+
"sizeref": 770.3,
238+
"symbol": "triangle-up",
239+
"size": [
240+
"15406",
241+
"15252",
242+
"12119"
243+
]
244+
},
245+
"name": "Europe"
246+
},
247+
{
248+
"text": [
249+
"Puncak Jaya",
250+
"Mt. Cook",
251+
"Finisterre Range HP"
252+
],
253+
"lon": [
254+
"137.1833333",
255+
"170.1333333",
256+
"146.3666667"
257+
],
258+
"lat": [
259+
"-4.066666667",
260+
"-43.6",
261+
"-5.95"
262+
],
263+
"type": "scattergeo",
264+
"marker": {
265+
"sizeref": 801.15,
266+
"symbol": "triangle-up",
267+
"size": [
268+
"16023",
269+
"12319",
270+
"12057"
271+
]
272+
},
273+
"name": "Oceania"
274+
},
275+
{
276+
"text": [
277+
"Vinson Massif",
278+
"Mt. Erebus"
279+
],
280+
"lon": [
281+
"-85.6",
282+
"167.1833333"
283+
],
284+
"lat": [
285+
"-78.51666667",
286+
"-77.51666667"
287+
],
288+
"type": "scattergeo",
289+
"marker": {
290+
"sizeref": 802.5,
291+
"symbol": "triangle-up",
292+
"size": [
293+
"16050",
294+
"12448"
295+
]
296+
},
297+
"name": "Antartica"
298+
},
299+
{
300+
"text": [
301+
"Mt. Everest",
302+
"Nanga Parbat",
303+
"Jengish Chokusu (ex. Pik Pobedy)",
304+
"Bogda Shan",
305+
"Namcha Barwa",
306+
"Kinabalu",
307+
"K2",
308+
"Yu Shan",
309+
"Kangchenjunga",
310+
"Tirich Mir",
311+
"Gunung Kerinci",
312+
"Fuji San",
313+
"Gunung Rinjani",
314+
"Gunung Semeru",
315+
"Minya Konka",
316+
"Kongur Shan"
317+
],
318+
"lon": [
319+
"86.91666667",
320+
"74.6",
321+
"80.11666667",
322+
"88.33333333",
323+
"95.05",
324+
"116.5666667",
325+
"76.51666667",
326+
"120.95",
327+
"88.15",
328+
"71.85",
329+
"101.2666667",
330+
"138.7333333",
331+
"116.4666667",
332+
"112.9166667",
333+
"101.8833333",
334+
"75.31666667"
335+
],
336+
"lat": [
337+
"27.98333333",
338+
"35.23333333",
339+
"42.03333333",
340+
"43.8",
341+
"29.63333333",
342+
"6.066666667",
343+
"35.88333333",
344+
"23.46666667",
345+
"27.7",
346+
"36.25",
347+
"-1.7",
348+
"35.36666667",
349+
"-8.416666667",
350+
"-8.1",
351+
"29.6",
352+
"38.6"
353+
],
354+
"type": "scattergeo",
355+
"marker": {
356+
"symbol": "triangle-up",
357+
"sizeref": 1451.4,
358+
"size": [
359+
"29028",
360+
"15118",
361+
"13609",
362+
"13523",
363+
"13471",
364+
"13435",
365+
"13179",
366+
"12966",
367+
"12867",
368+
"12827",
369+
"12483",
370+
"12388",
371+
"12224",
372+
"12060",
373+
"11949",
374+
"11762"
375+
]
376+
},
377+
"name": "Asia",
378+
"geo": "geo2"
379+
},
380+
{
381+
"text": [
382+
"Aconcagua",
383+
"Mt. McKinley (Denali)",
384+
"Cristobal Colon",
385+
"Mt. Logan",
386+
"Pico de Orizaba (Citlaltepetl)",
387+
"Mauna Kea",
388+
"Chimborazo",
389+
"Mt. Rainier",
390+
"Volcan Tajumulco",
391+
"Pico Bolivar",
392+
"Mt. Fairweather",
393+
"Cerro Chirripo",
394+
"Monte San Valentin",
395+
"Nevado Ojos del Salado",
396+
"Ritacuba Blanco",
397+
"Mt. Blackburn"
398+
],
399+
"lon": [
400+
"-70.01666667",
401+
"-151.05",
402+
"-73.68333333",
403+
"-140.4",
404+
"-97.26666667",
405+
"-155.4666667",
406+
"-78.81666667",
407+
"-121.7666667",
408+
"-91.9",
409+
"-71.05",
410+
"-137.5166667",
411+
"-83.48333333",
412+
"-73.33333333",
413+
"-68.53333333",
414+
"-72.3",
415+
"-143.4333333"
416+
],
417+
"lat": [
418+
"-32.65",
419+
"63.1",
420+
"10.83333333",
421+
"60.56666667",
422+
"19.03333333",
423+
"19.81666667",
424+
"-1.466666667",
425+
"46.85",
426+
"15.05",
427+
"8.533333333",
428+
"58.9",
429+
"9.483333333",
430+
"-46.6",
431+
"-27.11666667",
432+
"6.483333333",
433+
"61.73333333"
434+
],
435+
"type": "scattergeo",
436+
"marker": {
437+
"sizeref": 1142.05,
438+
"symbol": "triangle-up",
439+
"size": [
440+
"22841",
441+
"20138",
442+
"18074",
443+
"17224",
444+
"16148",
445+
"13796",
446+
"13523",
447+
"13196",
448+
"13058",
449+
"12982",
450+
"12956",
451+
"12228",
452+
"12126",
453+
"12100",
454+
"11959",
455+
"11598"
456+
]
457+
},
458+
"name": "Americas",
459+
"geo": "geo2"
460+
},
461+
{
462+
"text": [
463+
"Kilimanjaro",
464+
"Gora Elbrus",
465+
"Damavand",
466+
"Ras Dejen",
467+
"Ngaliema (Mt. Stanley)",
468+
"Mt. Cameroon",
469+
"Mt. Kenya",
470+
"Jebel Toubkal",
471+
"Pico Teide",
472+
"Mt. Ararat (Agri Dagi)"
473+
],
474+
"lon": [
475+
"37.35",
476+
"42.43333333",
477+
"52.11666667",
478+
"38.36666667",
479+
"29.86666667",
480+
"9.166666667",
481+
"37.3",
482+
"-7.916666667",
483+
"-16.65",
484+
"44.3"
485+
],
486+
"lat": [
487+
"-3.066666667",
488+
"43.35",
489+
"35.95",
490+
"13.23333333",
491+
"0.383333333",
492+
"4.216666667",
493+
"-0.15",
494+
"31.06666667",
495+
"28.26666667",
496+
"39.7"
497+
],
498+
"type": "scattergeo",
499+
"marker": {
500+
"sizeref": 965.4,
501+
"symbol": "triangle-up",
502+
"size": [
503+
"19308",
504+
"15554",
505+
"15311",
506+
"13090",
507+
"12962",
508+
"12798",
509+
"12549",
510+
"12319",
511+
"12198",
512+
"11847"
513+
]
514+
},
515+
"name": "Middle East & Africa",
516+
"geo": "geo2"
517+
},
518+
{
519+
"text": [
520+
"Mont Blanc",
521+
"Klyuchevskaya Volcano",
522+
"Gunnbjørnsfjeld"
523+
],
524+
"lon": [
525+
"6.866666667",
526+
"160.65",
527+
"-29.9"
528+
],
529+
"lat": [
530+
"45.83333333",
531+
"56.05",
532+
"68.91666667"
533+
],
534+
"type": "scattergeo",
535+
"marker": {
536+
"sizeref": 770.3,
537+
"symbol": "triangle-up",
538+
"size": [
539+
"15406",
540+
"15252",
541+
"12119"
542+
]
543+
},
544+
"name": "Europe",
545+
"geo": "geo2"
546+
},
547+
{
548+
"text": [
549+
"Puncak Jaya",
550+
"Mt. Cook",
551+
"Finisterre Range HP"
552+
],
553+
"lon": [
554+
"137.1833333",
555+
"170.1333333",
556+
"146.3666667"
557+
],
558+
"lat": [
559+
"-4.066666667",
560+
"-43.6",
561+
"-5.95"
562+
],
563+
"type": "scattergeo",
564+
"marker": {
565+
"sizeref": 801.15,
566+
"symbol": "triangle-up",
567+
"size": [
568+
"16023",
569+
"12319",
570+
"12057"
571+
]
572+
},
573+
"name": "Oceania",
574+
"geo": "geo2"
575+
},
576+
{
577+
"text": [
578+
"Vinson Massif",
579+
"Mt. Erebus"
580+
],
581+
"lon": [
582+
"-85.6",
583+
"167.1833333"
584+
],
585+
"lat": [
586+
"-78.51666667",
587+
"-77.51666667"
588+
],
589+
"type": "scattergeo",
590+
"marker": {
591+
"sizeref": 802.5,
592+
"symbol": "triangle-up",
593+
"size": [
594+
"16050",
595+
"12448"
596+
]
597+
},
598+
"name": "Antartica",
599+
"geo": "geo2"
600+
}
601+
],
602+
"layout": {
603+
"geo": {
604+
"showland": true,
605+
"landcolor": "rgb(255, 255, 255)",
606+
"lonaxis": {
607+
"gridcolor": "rgb(102, 102, 102)",
608+
"gridwidth": 0.5,
609+
"showgrid": true
610+
},
611+
"projection": {
612+
"type": "aitoff",
613+
"rotation": {
614+
"lon": -180
615+
}
616+
},
617+
"lataxis": {
618+
"gridcolor": "rgb(102, 102, 102)",
619+
"gridwidth": 0.5,
620+
"showgrid": true
621+
},
622+
"showlakes": true,
623+
"framecolor": "rgb(127, 127, 127)",
624+
"lakecolor": "rgb(127, 127, 127)",
625+
"showocean": true,
626+
"oceancolor": "rgb(255, 255, 255)",
627+
"countrycolor": "rgb(127, 127, 127)",
628+
"countrywidth": 0.5,
629+
"showcountries": true,
630+
"coastlinecolor": "rgb(127, 127, 127)"
631+
},
632+
"geo2": {
633+
"showland": true,
634+
"landcolor": "rgb(255, 255, 255)",
635+
"lonaxis": {
636+
"gridcolor": "rgb(102, 102, 102)",
637+
"gridwidth": 0.5,
638+
"showgrid": true
639+
},
640+
"projection": {
641+
"type": "sinusoidal",
642+
"rotation": {
643+
"lon": -180
644+
}
645+
},
646+
"lataxis": {
647+
"gridcolor": "rgb(102, 102, 102)",
648+
"gridwidth": 0.5,
649+
"showgrid": true
650+
},
651+
"showlakes": true,
652+
"framecolor": "rgb(127, 127, 127)",
653+
"lakecolor": "rgb(127, 127, 127)",
654+
"showocean": true,
655+
"oceancolor": "rgb(255, 255, 255)",
656+
"countrycolor": "rgb(127, 127, 127)",
657+
"countrywidth": 0.5,
658+
"showcountries": true,
659+
"coastlinecolor": "rgb(127, 127, 127)"
660+
},
661+
"width": 800,
662+
"showlegend": false
663+
}
664+
}

0 commit comments

Comments
 (0)
Please sign in to comment.