Skip to content

Commit 37e419f

Browse files
committed
fix hoverdistance and spikedistance when it set to 0
1 parent e5875a9 commit 37e419f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/fx/hover.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ function _hover(gd, evt, subplot, noHoverEvent) {
332332
// within one trace mode can sometimes be overridden
333333
mode = hovermode;
334334

335-
var hoverdistance = fullLayout.hoverdistance ? fullLayout.hoverdistance === 0 ? Infinity : fullLayout.hoverdistance : constants.MAXDIST;
336-
var spikedistance = fullLayout.spikedistance ? fullLayout.spikedistance === 0 ? Infinity : fullLayout.spikedistance : hoverdistance;
335+
var hoverdistance = fullLayout.hoverdistance === 0 ? Infinity : fullLayout.hoverdistance;
336+
var spikedistance = fullLayout.spikedistance === 0 ? Infinity : fullLayout.spikedistance;
337337

338338
// container for new point, also used to pass info into module.hoverPoints
339339
pointData = {

src/components/fx/layout_attributes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = {
4040
},
4141
hoverdistance: {
4242
valType: 'integer',
43-
min: -1,
43+
min: 0,
4444
dflt: 20,
4545
role: 'style',
4646
editType: 'none',
@@ -51,13 +51,13 @@ module.exports = {
5151
},
5252
spikedistance: {
5353
valType: 'integer',
54-
min: -1,
54+
min: 0,
5555
dflt: 20,
5656
role: 'style',
5757
editType: 'none',
5858
description: [
5959
'Sets the default distance (in points) to look for data to draw',
60-
'spikelines to (zero means no cutoff). By default inherits from hoverdistance'
60+
'spikelines to (zero means no cutoff).'
6161
].join(' ')
6262
},
6363
hoverlabel: {

0 commit comments

Comments
 (0)