Skip to content

Commit

Permalink
fix and comment on bar positionFn passVal
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Feb 19, 2018
1 parent a2fc07a commit ad38f8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/traces/bar/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode) {
};

function _positionFn(_minPos, _maxPos) {
// add a little to the pseudo-distance for wider bars, so that like scatter,
// if you are over two overlapping bars, the narrower one wins.
return Fx.inbox(_minPos - posVal, _maxPos - posVal,
maxHoverDistance - Math.min(1, Math.abs(_maxPos - _minPos) / pRangeCalc));
maxHoverDistance + Math.min(1, Math.abs(_maxPos - _minPos) / pRangeCalc) - 1);
}

function positionFn(di) {
Expand Down

0 comments on commit ad38f8d

Please sign in to comment.