Skip to content

Commit f4a465e

Browse files
committed
clarify winning point - avoid extra hd variable
1 parent c6260e3 commit f4a465e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/fx/hover.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,20 +649,20 @@ function _hover(gd, evt, subplot, noHoverEvent) {
649649
hoverData[0].length !== 0 &&
650650
hoverData[0].trace.type !== 'splom' // TODO: add support for splom
651651
) {
652-
var hd = hoverData[0];
653-
var cd0 = hd.cd[hd.index];
652+
var winningPoint = hoverData[0];
653+
var cd0 = winningPoint.cd[winningPoint.index];
654654
var isGrouped = (fullLayout.boxmode === 'group' || fullLayout.violinmode === 'group');
655655

656-
var xVal = hd.xVal;
657-
var ax = hd.xa;
656+
var xVal = winningPoint.xVal;
657+
var ax = winningPoint.xa;
658658
if(ax.type === 'category') xVal = ax._categoriesMap[xVal];
659659
if(ax.type === 'date') xVal = ax.d2c(xVal);
660660
if(cd0 && cd0.t && cd0.t.posLetter === ax._id && isGrouped) {
661661
xVal += cd0.t.dPos;
662662
}
663663

664-
var yVal = hd.yVal;
665-
ax = hd.ya;
664+
var yVal = winningPoint.yVal;
665+
ax = winningPoint.ya;
666666
if(ax.type === 'category') yVal = ax._categoriesMap[yVal];
667667
if(ax.type === 'date') yVal = ax.d2c(yVal);
668668
if(cd0 && cd0.t && cd0.t.posLetter === ax._id && isGrouped) {

0 commit comments

Comments
 (0)