@@ -66,7 +66,7 @@ var HOVERTEXTPAD = constants.HOVERTEXTPAD;
6666//
6767// We wrap the hovers in a timer, to limit their frequency.
6868// 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 ) {
7070 if ( typeof gd === 'string' ) gd = document . getElementById ( gd ) ;
7171 if ( gd . _lastHoverTime === undefined ) gd . _lastHoverTime = 0 ;
7272
@@ -78,13 +78,13 @@ exports.hover = function hover(gd, evt, subplot) {
7878 // Is it more than 100ms since the last update? If so, force
7979 // an update now (synchronously) and exit
8080 if ( Date . now ( ) > gd . _lastHoverTime + constants . HOVERMINTIME ) {
81- _hover ( gd , evt , subplot ) ;
81+ _hover ( gd , evt , subplot , noHoverEvent ) ;
8282 gd . _lastHoverTime = Date . now ( ) ;
8383 return ;
8484 }
8585 // Queue up the next hover for 100ms from now (if no further events)
8686 gd . _hoverTimer = setTimeout ( function ( ) {
87- _hover ( gd , evt , subplot ) ;
87+ _hover ( gd , evt , subplot , noHoverEvent ) ;
8888 gd . _lastHoverTime = Date . now ( ) ;
8989 gd . _hoverTimer = undefined ;
9090 } , constants . HOVERMINTIME ) ;
@@ -168,8 +168,8 @@ exports.loneHover = function loneHover(hoverItem, opts) {
168168} ;
169169
170170// 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 ) {
173173 gd . emit ( 'plotly_hover' , {
174174 event : evt . originalEvent ,
175175 points : [ evt ]
@@ -505,7 +505,7 @@ function _hover(gd, evt, subplot) {
505505 }
506506
507507 // don't emit events if called manually
508- if ( ! evt . target || ! hoverChanged ( gd , evt , oldhoverdata ) ) return ;
508+ if ( ! evt . target || noHoverEvent || ! hoverChanged ( gd , evt , oldhoverdata ) ) return ;
509509
510510 if ( oldhoverdata ) {
511511 gd . emit ( 'plotly_unhover' , {
0 commit comments