@@ -45,6 +45,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
45
45
var traceNow = gd . _fullData [ trace . index ] ;
46
46
var cdi = pt . data . data ;
47
47
var ptNumber = cdi . i ;
48
+ var isRoot = helpers . isHierarchyRoot ( pt ) ;
48
49
49
50
var _cast = function ( astr ) {
50
51
return Lib . castOption ( traceNow , ptNumber , astr ) ;
@@ -88,7 +89,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
88
89
}
89
90
90
91
hoverPt . currentPath = pt . currentPath = helpers . getPath ( pt . data ) ;
91
- if ( hasFlag ( 'current path' ) ) {
92
+ if ( hasFlag ( 'current path' ) && ! isRoot ) {
92
93
thisText . push ( hoverPt . currentPath ) ;
93
94
}
94
95
@@ -97,7 +98,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
97
98
var insertPercent = function ( ) {
98
99
if ( tx !== prevTx ) { // no need to add redundant info
99
100
thisText . push ( tx ) ;
100
- prevTx = tx ;
101
+ prevTx = '' + tx ; // i.e. deep copy
101
102
}
102
103
} ;
103
104
@@ -117,7 +118,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
117
118
if ( ref1 && getVal ( ref1 ) ) {
118
119
hoverPt . percentEntry = pt . percentEntry = val / getVal ( ref1 ) ;
119
120
hoverPt . entry = pt . entry = helpers . getLabelString ( ref1 . data . data . label ) ;
120
- if ( hasFlag ( 'percent entry' ) ) {
121
+ if ( hasFlag ( 'percent entry' ) && ! isRoot && ! pt . _onPathbar ) {
121
122
tx = helpers . formatPercent ( hoverPt . percentEntry , separators ) + ' of ' + hoverPt . entry ;
122
123
insertPercent ( ) ;
123
124
}
@@ -127,7 +128,7 @@ module.exports = function attachFxHandlers(sliceTop, entry, gd, cd, opts) {
127
128
if ( ref0 && getVal ( ref0 ) ) {
128
129
hoverPt . percentRoot = pt . percentRoot = val / getVal ( ref0 ) ;
129
130
hoverPt . root = pt . root = helpers . getLabelString ( ref0 . data . data . label ) ;
130
- if ( hasFlag ( 'percent root' ) ) {
131
+ if ( hasFlag ( 'percent root' ) && ! isRoot ) {
131
132
tx = helpers . formatPercent ( hoverPt . percentRoot , separators ) + ' of ' + hoverPt . root ;
132
133
insertPercent ( ) ;
133
134
}
0 commit comments