@@ -133,6 +133,7 @@ module.exports = function plot(gd, calcData) {
133
133
if ( gd . _fullLayout . hovermode === false ) return ;
134
134
d3 . select ( element ) . call ( linkHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
135
135
if ( d . link . trace . link . hoverinfo !== 'skip' ) {
136
+ d . link . fullData = d . link . trace ;
136
137
gd . emit ( 'plotly_hover' , {
137
138
event : d3 . event ,
138
139
points : [ d . link ]
@@ -155,10 +156,13 @@ module.exports = function plot(gd, calcData) {
155
156
var hoverCenterX = boundingBox . left + boundingBox . width / 2 ;
156
157
var hoverCenterY = boundingBox . top + boundingBox . height / 2 ;
157
158
159
+ var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . link . value ) + d . valueSuffix } ;
160
+ d . link . fullData = d . link . trace ;
161
+
158
162
var tooltip = Fx . loneHover ( {
159
163
x : hoverCenterX - rootBBox . left ,
160
164
y : hoverCenterY - rootBBox . top ,
161
- name : d3 . format ( d . valueFormat ) ( d . link . value ) + d . valueSuffix ,
165
+ name : hovertemplateLabels . valueLabel ,
162
166
text : [
163
167
d . link . label || '' ,
164
168
sourceLabel + d . link . source . label ,
@@ -169,7 +173,11 @@ module.exports = function plot(gd, calcData) {
169
173
fontFamily : castHoverOption ( obj , 'font.family' ) ,
170
174
fontSize : castHoverOption ( obj , 'font.size' ) ,
171
175
fontColor : castHoverOption ( obj , 'font.color' ) ,
172
- idealAlign : d3 . event . x < hoverCenterX ? 'right' : 'left'
176
+ idealAlign : d3 . event . x < hoverCenterX ? 'right' : 'left' ,
177
+
178
+ hovertemplate : obj . hovertemplate ,
179
+ hovertemplateLabels : hovertemplateLabels ,
180
+ eventData : [ d . link ]
173
181
} , {
174
182
container : fullLayout . _hoverlayer . node ( ) ,
175
183
outerContainer : fullLayout . _paper . node ( ) ,
@@ -184,6 +192,7 @@ module.exports = function plot(gd, calcData) {
184
192
if ( gd . _fullLayout . hovermode === false ) return ;
185
193
d3 . select ( element ) . call ( linkNonHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
186
194
if ( d . link . trace . link . hoverinfo !== 'skip' ) {
195
+ d . link . fullData = d . link . trace ;
187
196
gd . emit ( 'plotly_unhover' , {
188
197
event : d3 . event ,
189
198
points : [ d . link ]
@@ -205,6 +214,7 @@ module.exports = function plot(gd, calcData) {
205
214
if ( gd . _fullLayout . hovermode === false ) return ;
206
215
d3 . select ( element ) . call ( nodeHoveredStyle , d , sankey ) ;
207
216
if ( d . node . trace . node . hoverinfo !== 'skip' ) {
217
+ d . node . fullData = d . node . trace ;
208
218
gd . emit ( 'plotly_hover' , {
209
219
event : d3 . event ,
210
220
points : [ d . node ]
@@ -224,6 +234,9 @@ module.exports = function plot(gd, calcData) {
224
234
var hoverCenterX1 = boundingBox . right + 2 - rootBBox . left ;
225
235
var hoverCenterY = boundingBox . top + boundingBox . height / 4 - rootBBox . top ;
226
236
237
+ var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
238
+ d . node . fullData = d . node . trace ;
239
+
227
240
var tooltip = Fx . loneHover ( {
228
241
x0 : hoverCenterX0 ,
229
242
x1 : hoverCenterX1 ,
@@ -239,7 +252,11 @@ module.exports = function plot(gd, calcData) {
239
252
fontFamily : castHoverOption ( obj , 'font.family' ) ,
240
253
fontSize : castHoverOption ( obj , 'font.size' ) ,
241
254
fontColor : castHoverOption ( obj , 'font.color' ) ,
242
- idealAlign : 'left'
255
+ idealAlign : 'left' ,
256
+
257
+ hovertemplate : obj . hovertemplate ,
258
+ hovertemplateLabels : hovertemplateLabels ,
259
+ eventData : [ d . node ]
243
260
} , {
244
261
container : fullLayout . _hoverlayer . node ( ) ,
245
262
outerContainer : fullLayout . _paper . node ( ) ,
@@ -254,6 +271,7 @@ module.exports = function plot(gd, calcData) {
254
271
if ( gd . _fullLayout . hovermode === false ) return ;
255
272
d3 . select ( element ) . call ( nodeNonHoveredStyle , d , sankey ) ;
256
273
if ( d . node . trace . node . hoverinfo !== 'skip' ) {
274
+ d . node . fullData = d . node . trace ;
257
275
gd . emit ( 'plotly_unhover' , {
258
276
event : d3 . event ,
259
277
points : [ d . node ]
0 commit comments