Skip to content

Commit 5ea57a3

Browse files
committed
Fix gl marker symbols logic/test
1 parent e6223b6 commit 5ea57a3

File tree

2 files changed

+236
-750
lines changed

2 files changed

+236
-750
lines changed

Diff for: src/traces/scattergl/index.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -997,16 +997,21 @@ function hoverPoints(pointData, xval, yval, hovermode) {
997997

998998
// FIXME: make sure this is a proper way to calc search radius
999999
if(stash.tree) {
1000+
var xl = xa.p2c(xpx - MAXDIST),
1001+
xr = xa.p2c(xpx + MAXDIST),
1002+
yl = ya.p2c(ypx - MAXDIST),
1003+
yr = ya.p2c(ypx + MAXDIST);
1004+
10001005
if(hovermode === 'x') {
10011006
ids = stash.tree.range(
1002-
xa.p2c(xpx - MAXDIST), ya._rl[0],
1003-
xa.p2c(xpx + MAXDIST), ya._rl[1]
1007+
Math.min(xl, xr), Math.min(ya._rl[0], ya._rl[1]),
1008+
Math.max(xl, xr), Math.max(ya._rl[0], ya._rl[1])
10041009
);
10051010
}
10061011
else {
10071012
ids = stash.tree.range(
1008-
xa.p2c(xpx - MAXDIST), ya.p2c(ypx + MAXDIST),
1009-
xa.p2c(xpx + MAXDIST), ya.p2c(ypx - MAXDIST)
1013+
Math.min(xl, xr), Math.min(yl, yr),
1014+
Math.max(xl, xr), Math.max(yl, yr)
10101015
);
10111016
}
10121017
}

0 commit comments

Comments
 (0)