@@ -132,10 +132,13 @@ module.exports = function plot(gd, calcData) {
132132 var linkHover = function ( element , d , sankey ) {
133133 if ( gd . _fullLayout . hovermode === false ) return ;
134134 d3 . select ( element ) . call ( linkHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
135- gd . emit ( 'plotly_hover' , {
136- event : d3 . event ,
137- points : [ d . link ]
138- } ) ;
135+ if ( d . link . trace . link . hoverinfo !== 'skip' ) {
136+ gd . emit ( 'plotly_hover' , {
137+ event : d3 . event ,
138+ points : [ d . link ]
139+ } ) ;
140+ }
141+
139142 } ;
140143
141144 var sourceLabel = _ ( gd , 'source:' ) + ' ' ;
@@ -145,7 +148,8 @@ module.exports = function plot(gd, calcData) {
145148
146149 var linkHoverFollow = function ( element , d ) {
147150 if ( gd . _fullLayout . hovermode === false ) return ;
148- var trace = d . link . trace ;
151+ var obj = d . link . trace . link ;
152+ if ( obj . hoverinfo === 'none' || obj . hoverinfo === 'skip' ) return ;
149153 var rootBBox = gd . _fullLayout . _paperdiv . node ( ) . getBoundingClientRect ( ) ;
150154 var boundingBox = element . getBoundingClientRect ( ) ;
151155 var hoverCenterX = boundingBox . left + boundingBox . width / 2 ;
@@ -160,11 +164,11 @@ module.exports = function plot(gd, calcData) {
160164 sourceLabel + d . link . source . label ,
161165 targetLabel + d . link . target . label
162166 ] . filter ( renderableValuePresent ) . join ( '<br>' ) ,
163- color : castHoverOption ( trace , 'bgcolor' ) || Color . addOpacity ( d . tinyColorHue , 1 ) ,
164- borderColor : castHoverOption ( trace , 'bordercolor' ) ,
165- fontFamily : castHoverOption ( trace , 'font.family' ) ,
166- fontSize : castHoverOption ( trace , 'font.size' ) ,
167- fontColor : castHoverOption ( trace , 'font.color' ) ,
167+ color : castHoverOption ( obj , 'bgcolor' ) || Color . addOpacity ( d . tinyColorHue , 1 ) ,
168+ borderColor : castHoverOption ( obj , 'bordercolor' ) ,
169+ fontFamily : castHoverOption ( obj , 'font.family' ) ,
170+ fontSize : castHoverOption ( obj , 'font.size' ) ,
171+ fontColor : castHoverOption ( obj , 'font.color' ) ,
168172 idealAlign : d3 . event . x < hoverCenterX ? 'right' : 'left'
169173 } , {
170174 container : fullLayout . _hoverlayer . node ( ) ,
@@ -179,10 +183,12 @@ module.exports = function plot(gd, calcData) {
179183 var linkUnhover = function ( element , d , sankey ) {
180184 if ( gd . _fullLayout . hovermode === false ) return ;
181185 d3 . select ( element ) . call ( linkNonHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
182- gd . emit ( 'plotly_unhover' , {
183- event : d3 . event ,
184- points : [ d . link ]
185- } ) ;
186+ if ( d . link . trace . link . hoverinfo !== 'skip' ) {
187+ gd . emit ( 'plotly_unhover' , {
188+ event : d3 . event ,
189+ points : [ d . link ]
190+ } ) ;
191+ }
186192
187193 Fx . loneUnhover ( fullLayout . _hoverlayer . node ( ) ) ;
188194 } ;
@@ -198,15 +204,19 @@ module.exports = function plot(gd, calcData) {
198204 var nodeHover = function ( element , d , sankey ) {
199205 if ( gd . _fullLayout . hovermode === false ) return ;
200206 d3 . select ( element ) . call ( nodeHoveredStyle , d , sankey ) ;
201- gd . emit ( 'plotly_hover' , {
202- event : d3 . event ,
203- points : [ d . node ]
204- } ) ;
207+ if ( d . node . trace . node . hoverinfo !== 'skip' ) {
208+ gd . emit ( 'plotly_hover' , {
209+ event : d3 . event ,
210+ points : [ d . node ]
211+ } ) ;
212+ }
205213 } ;
206214
207215 var nodeHoverFollow = function ( element , d ) {
208216 if ( gd . _fullLayout . hovermode === false ) return ;
209- var trace = d . node . trace ;
217+
218+ var obj = d . node . trace . node ;
219+ if ( obj . hoverinfo === 'none' || obj . hoverinfo === 'skip' ) return ;
210220 var nodeRect = d3 . select ( element ) . select ( '.' + cn . nodeRect ) ;
211221 var rootBBox = gd . _fullLayout . _paperdiv . node ( ) . getBoundingClientRect ( ) ;
212222 var boundingBox = nodeRect . node ( ) . getBoundingClientRect ( ) ;
@@ -224,11 +234,11 @@ module.exports = function plot(gd, calcData) {
224234 incomingLabel + d . node . targetLinks . length ,
225235 outgoingLabel + d . node . sourceLinks . length
226236 ] . filter ( renderableValuePresent ) . join ( '<br>' ) ,
227- color : castHoverOption ( trace , 'bgcolor' ) || d . tinyColorHue ,
228- borderColor : castHoverOption ( trace , 'bordercolor' ) ,
229- fontFamily : castHoverOption ( trace , 'font.family' ) ,
230- fontSize : castHoverOption ( trace , 'font.size' ) ,
231- fontColor : castHoverOption ( trace , 'font.color' ) ,
237+ color : castHoverOption ( obj , 'bgcolor' ) || d . tinyColorHue ,
238+ borderColor : castHoverOption ( obj , 'bordercolor' ) ,
239+ fontFamily : castHoverOption ( obj , 'font.family' ) ,
240+ fontSize : castHoverOption ( obj , 'font.size' ) ,
241+ fontColor : castHoverOption ( obj , 'font.color' ) ,
232242 idealAlign : 'left'
233243 } , {
234244 container : fullLayout . _hoverlayer . node ( ) ,
@@ -243,10 +253,12 @@ module.exports = function plot(gd, calcData) {
243253 var nodeUnhover = function ( element , d , sankey ) {
244254 if ( gd . _fullLayout . hovermode === false ) return ;
245255 d3 . select ( element ) . call ( nodeNonHoveredStyle , d , sankey ) ;
246- gd . emit ( 'plotly_unhover' , {
247- event : d3 . event ,
248- points : [ d . node ]
249- } ) ;
256+ if ( d . node . trace . node . hoverinfo !== 'skip' ) {
257+ gd . emit ( 'plotly_unhover' , {
258+ event : d3 . event ,
259+ points : [ d . node ]
260+ } ) ;
261+ }
250262
251263 Fx . loneUnhover ( fullLayout . _hoverlayer . node ( ) ) ;
252264 } ;
0 commit comments