@@ -66,7 +66,7 @@ var HOVERTEXTPAD = constants.HOVERTEXTPAD;
66
66
//
67
67
// We wrap the hovers in a timer, to limit their frequency.
68
68
// The actual rendering is done by private function _hover.
69
- exports . hover = function hover ( gd , evt , subplot ) {
69
+ exports . hover = function hover ( gd , evt , subplot , noHoverEvent ) {
70
70
if ( typeof gd === 'string' ) gd = document . getElementById ( gd ) ;
71
71
if ( gd . _lastHoverTime === undefined ) gd . _lastHoverTime = 0 ;
72
72
@@ -78,13 +78,13 @@ exports.hover = function hover(gd, evt, subplot) {
78
78
// Is it more than 100ms since the last update? If so, force
79
79
// an update now (synchronously) and exit
80
80
if ( Date . now ( ) > gd . _lastHoverTime + constants . HOVERMINTIME ) {
81
- _hover ( gd , evt , subplot ) ;
81
+ _hover ( gd , evt , subplot , noHoverEvent ) ;
82
82
gd . _lastHoverTime = Date . now ( ) ;
83
83
return ;
84
84
}
85
85
// Queue up the next hover for 100ms from now (if no further events)
86
86
gd . _hoverTimer = setTimeout ( function ( ) {
87
- _hover ( gd , evt , subplot ) ;
87
+ _hover ( gd , evt , subplot , noHoverEvent ) ;
88
88
gd . _lastHoverTime = Date . now ( ) ;
89
89
gd . _hoverTimer = undefined ;
90
90
} , constants . HOVERMINTIME ) ;
@@ -168,8 +168,8 @@ exports.loneHover = function loneHover(hoverItem, opts) {
168
168
} ;
169
169
170
170
// The actual implementation is here:
171
- function _hover ( gd , evt , subplot ) {
172
- if ( subplot === 'pie' || subplot === 'sankey' ) {
171
+ function _hover ( gd , evt , subplot , noHoverEvent ) {
172
+ if ( ( subplot === 'pie' || subplot === 'sankey' ) && ! noHoverEvent ) {
173
173
gd . emit ( 'plotly_hover' , {
174
174
event : evt . originalEvent ,
175
175
points : [ evt ]
@@ -504,7 +504,7 @@ function _hover(gd, evt, subplot) {
504
504
}
505
505
506
506
// don't emit events if called manually
507
- if ( ! evt . target || ! hoverChanged ( gd , evt , oldhoverdata ) ) return ;
507
+ if ( ! evt . target || noHoverEvent || ! hoverChanged ( gd , evt , oldhoverdata ) ) return ;
508
508
509
509
if ( oldhoverdata ) {
510
510
gd . emit ( 'plotly_unhover' , {
0 commit comments