File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ modeBarButtons.hoverClosestGeo = {
447
447
toggle : true ,
448
448
icon : Icons . tooltip_basic ,
449
449
gravity : 'ne' ,
450
- click : handleGeo
450
+ click : toggleHover
451
451
} ;
452
452
453
453
function handleGeo ( gd , ev ) {
@@ -468,7 +468,6 @@ function handleGeo(gd, ev) {
468
468
geo . render ( ) ;
469
469
}
470
470
else if ( attr === 'reset' ) geo . zoomReset ( ) ;
471
- else if ( attr === 'hovermode' ) geo . showHover = ! geo . showHover ;
472
471
}
473
472
}
474
473
Original file line number Diff line number Diff line change @@ -2336,9 +2336,9 @@ Plotly.relayout = function relayout(gd, astr, val) {
2336
2336
2337
2337
// this is decoupled enough it doesn't need async regardless
2338
2338
if ( domodebar ) {
2339
+ var subplotIds ;
2339
2340
manageModeBar ( gd ) ;
2340
2341
2341
- var subplotIds ;
2342
2342
subplotIds = Plots . getSubplotIds ( fullLayout , 'gl3d' ) ;
2343
2343
for ( i = 0 ; i < subplotIds . length ; i ++ ) {
2344
2344
scene = fullLayout [ subplotIds [ i ] ] . _scene ;
@@ -2350,6 +2350,12 @@ Plotly.relayout = function relayout(gd, astr, val) {
2350
2350
scene = fullLayout . _plots [ subplotIds [ i ] ] . _scene2d ;
2351
2351
scene . updateFx ( fullLayout ) ;
2352
2352
}
2353
+
2354
+ subplotIds = Plots . getSubplotIds ( fullLayout , 'geo' ) ;
2355
+ for ( i = 0 ; i < subplotIds . length ; i ++ ) {
2356
+ var geo = fullLayout [ subplotIds [ i ] ] . _geo ;
2357
+ geo . updateFx ( fullLayout . hovermode ) ;
2358
+ }
2353
2359
}
2354
2360
}
2355
2361
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ function Geo(options, fullLayout) {
39
39
// a subset of https://github.com/d3/d3-geo-projection
40
40
addProjectionsToD3 ( ) ;
41
41
42
- this . showHover = ( fullLayout . hovermode === 'closest' ) ;
43
42
this . hoverContainer = null ;
44
43
45
44
this . topojsonName = null ;
@@ -56,6 +55,7 @@ function Geo(options, fullLayout) {
56
55
this . zoomReset = null ;
57
56
58
57
this . makeFramework ( ) ;
58
+ this . updateFx ( fullLayout . hovermode ) ;
59
59
}
60
60
61
61
module . exports = Geo ;
@@ -174,6 +174,15 @@ proto.onceTopojsonIsLoaded = function(geoData, geoLayout) {
174
174
this . render ( ) ;
175
175
} ;
176
176
177
+ proto . updateFx = function ( hovermode ) {
178
+ this . showHover = ( hovermode !== false ) ;
179
+
180
+ // TODO should more strict, any layout.hovermode other
181
+ // then false will make all geo subplot display hover text.
182
+ // Instead each geo should have its own geo.hovermode
183
+ // to control hover visibility independently of other subplots.
184
+ } ;
185
+
177
186
proto . makeProjection = function ( geoLayout ) {
178
187
var projLayout = geoLayout . projection ,
179
188
projType = projLayout . type ,
You can’t perform that action at this time.
0 commit comments