@@ -650,11 +650,10 @@ function _hover(gd, evt, subplot, noHoverEvent) {
650
650
hoverData [ 0 ] . trace . type !== 'splom' // TODO: add support for splom
651
651
) {
652
652
var winningPoint = hoverData [ 0 ] ;
653
- var isGrouped = ( fullLayout . boxmode === 'group' || fullLayout . violinmode === 'group' ) ;
654
653
655
654
findHoverPoints (
656
- customVal ( 'x' , winningPoint , isGrouped ) ,
657
- customVal ( 'y' , winningPoint , isGrouped )
655
+ customVal ( 'x' , winningPoint , fullLayout ) ,
656
+ customVal ( 'y' , winningPoint , fullLayout )
658
657
) ;
659
658
660
659
// Remove duplicated hoverData points
@@ -1898,15 +1897,21 @@ function orderPeriod(hoverData, hovermode) {
1898
1897
hoverData = first . concat ( last ) ;
1899
1898
}
1900
1899
1901
- function customVal ( axLetter , winningPoint , isGrouped ) {
1902
- var cd0 = winningPoint . cd [ winningPoint . index ] ;
1900
+ function customVal ( axLetter , winningPoint , fullLayout ) {
1903
1901
var ax = winningPoint [ axLetter + 'a' ] ;
1904
1902
var val = winningPoint [ axLetter + 'Val' ] ;
1905
1903
1906
- if ( ax . type === 'category' ) val = ax . _categoriesMap [ val ] ;
1907
- if ( ax . type === 'date' ) val = ax . d2c ( val ) ;
1908
- if ( cd0 && cd0 . t && cd0 . t . posLetter === ax . _id && isGrouped ) {
1909
- val += cd0 . t . dPos ;
1904
+ if ( ax . type === 'category' ) return ax . _categoriesMap [ val ] ;
1905
+ if ( ax . type === 'date' ) return ax . d2c ( val ) ;
1906
+
1907
+ var cd0 = winningPoint . cd [ winningPoint . index ] ;
1908
+ if ( cd0 && cd0 . t && cd0 . t . posLetter === ax . _id ) {
1909
+ if (
1910
+ fullLayout . boxmode === 'group' ||
1911
+ fullLayout . violinmode === 'group'
1912
+ ) {
1913
+ val += cd0 . t . dPos ;
1914
+ }
1910
1915
}
1911
1916
1912
1917
return val ;
0 commit comments