Skip to content

Commit 7e0d980

Browse files
committed
refactor setting Infinity for hoverdistance and spikedistance
1 parent 3f33829 commit 7e0d980

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/fx/hover.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,11 @@ function _hover(gd, evt, subplot, noHoverEvent) {
248248
return dragElement.unhoverRaw(gd, evt);
249249
}
250250

251-
var hoverdistance = fullLayout.hoverdistance === -1 ? Infinity : fullLayout.hoverdistance;
252-
var spikedistance = fullLayout.spikedistance === -1 ? Infinity : fullLayout.spikedistance;
251+
var hoverdistance = fullLayout.hoverdistance;
252+
if(hoverdistance === -1) hoverdistance = Infinity;
253+
254+
var spikedistance = fullLayout.spikedistance;
255+
if(spikedistance === -1) spikedistance = Infinity;
253256

254257
// hoverData: the set of candidate points we've found to highlight
255258
var hoverData = [];

0 commit comments

Comments
 (0)