@@ -132,10 +132,13 @@ module.exports = function plot(gd, calcData) {
132
132
var linkHover = function ( element , d , sankey ) {
133
133
if ( gd . _fullLayout . hovermode === false ) return ;
134
134
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
+
139
142
} ;
140
143
141
144
var sourceLabel = _ ( gd , 'source:' ) + ' ' ;
@@ -145,7 +148,8 @@ module.exports = function plot(gd, calcData) {
145
148
146
149
var linkHoverFollow = function ( element , d ) {
147
150
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 ;
149
153
var rootBBox = gd . _fullLayout . _paperdiv . node ( ) . getBoundingClientRect ( ) ;
150
154
var boundingBox = element . getBoundingClientRect ( ) ;
151
155
var hoverCenterX = boundingBox . left + boundingBox . width / 2 ;
@@ -160,11 +164,11 @@ module.exports = function plot(gd, calcData) {
160
164
sourceLabel + d . link . source . label ,
161
165
targetLabel + d . link . target . label
162
166
] . 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' ) ,
168
172
idealAlign : d3 . event . x < hoverCenterX ? 'right' : 'left'
169
173
} , {
170
174
container : fullLayout . _hoverlayer . node ( ) ,
@@ -179,10 +183,12 @@ module.exports = function plot(gd, calcData) {
179
183
var linkUnhover = function ( element , d , sankey ) {
180
184
if ( gd . _fullLayout . hovermode === false ) return ;
181
185
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
+ }
186
192
187
193
Fx . loneUnhover ( fullLayout . _hoverlayer . node ( ) ) ;
188
194
} ;
@@ -198,15 +204,19 @@ module.exports = function plot(gd, calcData) {
198
204
var nodeHover = function ( element , d , sankey ) {
199
205
if ( gd . _fullLayout . hovermode === false ) return ;
200
206
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
+ }
205
213
} ;
206
214
207
215
var nodeHoverFollow = function ( element , d ) {
208
216
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 ;
210
220
var nodeRect = d3 . select ( element ) . select ( '.' + cn . nodeRect ) ;
211
221
var rootBBox = gd . _fullLayout . _paperdiv . node ( ) . getBoundingClientRect ( ) ;
212
222
var boundingBox = nodeRect . node ( ) . getBoundingClientRect ( ) ;
@@ -224,11 +234,11 @@ module.exports = function plot(gd, calcData) {
224
234
incomingLabel + d . node . targetLinks . length ,
225
235
outgoingLabel + d . node . sourceLinks . length
226
236
] . 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' ) ,
232
242
idealAlign : 'left'
233
243
} , {
234
244
container : fullLayout . _hoverlayer . node ( ) ,
@@ -243,10 +253,12 @@ module.exports = function plot(gd, calcData) {
243
253
var nodeUnhover = function ( element , d , sankey ) {
244
254
if ( gd . _fullLayout . hovermode === false ) return ;
245
255
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
+ }
250
262
251
263
Fx . loneUnhover ( fullLayout . _hoverlayer . node ( ) ) ;
252
264
} ;
0 commit comments