@@ -133,6 +133,7 @@ module.exports = function plot(gd, calcData) {
133133 if ( gd . _fullLayout . hovermode === false ) return ;
134134 d3 . select ( element ) . call ( linkHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
135135 if ( d . link . trace . link . hoverinfo !== 'skip' ) {
136+ d . link . fullData = d . link . trace ;
136137 gd . emit ( 'plotly_hover' , {
137138 event : d3 . event ,
138139 points : [ d . link ]
@@ -155,10 +156,13 @@ module.exports = function plot(gd, calcData) {
155156 var hoverCenterX = boundingBox . left + boundingBox . width / 2 ;
156157 var hoverCenterY = boundingBox . top + boundingBox . height / 2 ;
157158
159+ var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . link . value ) + d . valueSuffix } ;
160+ d . link . fullData = d . link . trace ;
161+
158162 var tooltip = Fx . loneHover ( {
159163 x : hoverCenterX - rootBBox . left ,
160164 y : hoverCenterY - rootBBox . top ,
161- name : d3 . format ( d . valueFormat ) ( d . link . value ) + d . valueSuffix ,
165+ name : hovertemplateLabels . valueLabel ,
162166 text : [
163167 d . link . label || '' ,
164168 sourceLabel + d . link . source . label ,
@@ -169,7 +173,11 @@ module.exports = function plot(gd, calcData) {
169173 fontFamily : castHoverOption ( obj , 'font.family' ) ,
170174 fontSize : castHoverOption ( obj , 'font.size' ) ,
171175 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 ]
173181 } , {
174182 container : fullLayout . _hoverlayer . node ( ) ,
175183 outerContainer : fullLayout . _paper . node ( ) ,
@@ -184,6 +192,7 @@ module.exports = function plot(gd, calcData) {
184192 if ( gd . _fullLayout . hovermode === false ) return ;
185193 d3 . select ( element ) . call ( linkNonHoveredStyle . bind ( 0 , d , sankey , true ) ) ;
186194 if ( d . link . trace . link . hoverinfo !== 'skip' ) {
195+ d . link . fullData = d . link . trace ;
187196 gd . emit ( 'plotly_unhover' , {
188197 event : d3 . event ,
189198 points : [ d . link ]
@@ -205,6 +214,7 @@ module.exports = function plot(gd, calcData) {
205214 if ( gd . _fullLayout . hovermode === false ) return ;
206215 d3 . select ( element ) . call ( nodeHoveredStyle , d , sankey ) ;
207216 if ( d . node . trace . node . hoverinfo !== 'skip' ) {
217+ d . node . fullData = d . node . trace ;
208218 gd . emit ( 'plotly_hover' , {
209219 event : d3 . event ,
210220 points : [ d . node ]
@@ -224,6 +234,9 @@ module.exports = function plot(gd, calcData) {
224234 var hoverCenterX1 = boundingBox . right + 2 - rootBBox . left ;
225235 var hoverCenterY = boundingBox . top + boundingBox . height / 4 - rootBBox . top ;
226236
237+ var hovertemplateLabels = { valueLabel : d3 . format ( d . valueFormat ) ( d . node . value ) + d . valueSuffix } ;
238+ d . node . fullData = d . node . trace ;
239+
227240 var tooltip = Fx . loneHover ( {
228241 x0 : hoverCenterX0 ,
229242 x1 : hoverCenterX1 ,
@@ -239,7 +252,11 @@ module.exports = function plot(gd, calcData) {
239252 fontFamily : castHoverOption ( obj , 'font.family' ) ,
240253 fontSize : castHoverOption ( obj , 'font.size' ) ,
241254 fontColor : castHoverOption ( obj , 'font.color' ) ,
242- idealAlign : 'left'
255+ idealAlign : 'left' ,
256+
257+ hovertemplate : obj . hovertemplate ,
258+ hovertemplateLabels : hovertemplateLabels ,
259+ eventData : [ d . node ]
243260 } , {
244261 container : fullLayout . _hoverlayer . node ( ) ,
245262 outerContainer : fullLayout . _paper . node ( ) ,
@@ -254,6 +271,7 @@ module.exports = function plot(gd, calcData) {
254271 if ( gd . _fullLayout . hovermode === false ) return ;
255272 d3 . select ( element ) . call ( nodeNonHoveredStyle , d , sankey ) ;
256273 if ( d . node . trace . node . hoverinfo !== 'skip' ) {
274+ d . node . fullData = d . node . trace ;
257275 gd . emit ( 'plotly_unhover' , {
258276 event : d3 . event ,
259277 points : [ d . node ]
0 commit comments