@@ -143,7 +143,7 @@ var layout = {
143
143
} ,
144
144
annotations : [ {
145
145
showarrow : false ,
146
- text : 'fitbounds<br>\'locations\'<br>for all<br>projection<br>types' ,
146
+ text : 'all<br>projection<br>types<br>in Plotly ' ,
147
147
font : { size : 20 } ,
148
148
x : 1 ,
149
149
xref : 'paper' ,
@@ -164,24 +164,36 @@ for(var col = 0; col < nCol; col++) {
164
164
var geo = 'geo' + ( n ? n + 1 : '' ) ;
165
165
var usa = name . indexOf ( 'usa' ) !== - 1 ;
166
166
var locationmode = usa ? 'USA-states' : undefined ;
167
- var locations = usa ? [ 'WA' ] : [ 'AUS' ] ;
167
+ var locations = usa ? [ 'TX' , ' WA', 'NY' , 'AK' ] : [ 'GHA' , 'ARG' , ' AUS' , 'CAN '] ;
168
168
169
169
data . push ( {
170
170
name : name ,
171
171
geo : geo ,
172
172
type : 'choropleth' ,
173
173
locationmode : locationmode ,
174
174
locations : locations ,
175
- z : [ 10 ] ,
175
+ z : [ 1 , 2 , 3 , 4 ] ,
176
176
showscale : false ,
177
177
hovertemplate : name
178
178
} ) ;
179
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
+
180
191
data . push ( {
181
192
geo : geo ,
182
193
type : 'scattergeo' ,
183
194
mode : 'text' ,
184
- text : name . replace ( ' ' , '<br>' ) ,
195
+ text : [ name . replace ( ' ' , '<br>' ) ] ,
196
+ textfont : { color : 'darkblue' , family : 'Gravitas One, cursive' } ,
185
197
locationmode : locationmode ,
186
198
locations : locations ,
187
199
hoverinfo : 'skip'
@@ -192,10 +204,24 @@ for(var col = 0; col < nCol; col++) {
192
204
row : row ,
193
205
column : col ,
194
206
} ,
195
- showocean : usa ? false : true ,
196
207
projection : { type : name } ,
197
- fitbounds : 'locations'
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'
198
219
} ;
220
+
221
+ if ( ! usa ) {
222
+ layout [ geo ] . showcoastlines = false ;
223
+ layout [ geo ] . showocean = true ;
224
+ }
199
225
}
200
226
}
201
227
0 commit comments