@@ -123,113 +123,6 @@ exports.projNames = {
123123 'peirce quincuncial' : 'peirceQuincuncial' ,
124124} ;
125125
126- var keys = Object . keys ( exports . projNames ) . sort ( ) ;
127- var totalN = keys . length ;
128- var nRow = 8 ;
129- var nCol = Math . ceil ( totalN / nRow ) ;
130- var layout = {
131- grid : {
132- rows : nRow ,
133- columns : nCol
134- } ,
135- showlegend : false ,
136- width : 1800 ,
137- height : 1200 ,
138- margin : {
139- l : 20 ,
140- t : 20 ,
141- r : 20 ,
142- b : 20
143- } ,
144- annotations : [ {
145- showarrow : false ,
146- text : 'all<br>projection<br>types<br>in Plotly' ,
147- font : { size : 20 } ,
148- x : 1 ,
149- xref : 'paper' ,
150- xanchor : 'right' ,
151- yref : 'paper' ,
152- y : 0 ,
153- yanchor : 'bottom'
154- } ] ,
155- } ;
156- var data = [ ] ;
157- var n = - 1 ;
158- for ( var col = 0 ; col < nCol ; col ++ ) {
159- for ( var row = 0 ; row < nRow ; row ++ ) {
160- n ++ ;
161- if ( n >= totalN ) continue ;
162-
163- var name = keys [ n ] ;
164- var geo = 'geo' + ( n ? n + 1 : '' ) ;
165- var usa = name . indexOf ( 'usa' ) !== - 1 ;
166- var locationmode = usa ? 'USA-states' : undefined ;
167- var locations = usa ? [ 'TX' , 'WA' , 'NY' , 'AK' ] : [ 'GHA' , 'ARG' , 'AUS' , 'CAN' ] ;
168-
169- data . push ( {
170- name : name ,
171- geo : geo ,
172- type : 'choropleth' ,
173- locationmode : locationmode ,
174- locations : locations ,
175- z : [ 1 , 2 , 3 , 4 ] ,
176- showscale : false ,
177- hovertemplate : name
178- } ) ;
179-
180- data . push ( {
181- geo : geo ,
182- type : 'scattergeo' ,
183- mode : 'markers+text' ,
184- text : [ 'Cape Town' , 'Los Angeles' ] ,
185- textfont : { size : 6 } ,
186- marker : { color : [ 'lightgreen' , 'yellow' ] , size : [ 20 , 10 ] } ,
187- lat : [ - 34 , 34 ] ,
188- lon : [ 18 , - 118 ]
189- } ) ;
190-
191- data . push ( {
192- geo : geo ,
193- type : 'scattergeo' ,
194- mode : 'text' ,
195- text : [ name . replace ( ' ' , '<br>' ) ] ,
196- textfont : { color : 'darkblue' , family : 'Gravitas One, cursive' } ,
197- locationmode : locationmode ,
198- locations : locations ,
199- hoverinfo : 'skip'
200- } ) ;
201-
202- layout [ geo ] = {
203- domain : {
204- row : row ,
205- column : col ,
206- } ,
207- projection : { type : name } ,
208- lonaxis : {
209- showgrid : true ,
210- gridwidth : 1 ,
211- gridcolor : 'lightgray'
212- } ,
213- lataxis : {
214- showgrid : true ,
215- gridwidth : 1 ,
216- gridcolor : 'lightgray'
217- }
218- // fitbounds: 'locations'
219- } ;
220-
221- if ( ! usa ) {
222- layout [ geo ] . showcoastlines = false ;
223- layout [ geo ] . showocean = true ;
224- }
225- }
226- }
227-
228- console . log ( JSON . stringify ( {
229- data : data ,
230- layout : layout
231- } , null , 2 ) ) ;
232-
233126// name of the axes
234127exports . axesNames = [ 'lonaxis' , 'lataxis' ] ;
235128
0 commit comments