|
10 | 10 | 'use strict';
|
11 | 11 |
|
12 | 12 | var Fx = require('../../plots/cartesian/graph_interact');
|
| 13 | +var constants = require('../../plots/cartesian/constants'); |
13 | 14 | var Lib = require('../../lib');
|
14 | 15 |
|
15 | 16 |
|
16 | 17 | module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour) {
|
17 | 18 | // never let a heatmap override another type as closest point
|
18 |
| - if(pointData.distance < Fx.MAXDIST) return; |
| 19 | + if(pointData.distance < constants.MAXDIST) return; |
19 | 20 |
|
20 | 21 | var cd0 = pointData.cd[0],
|
21 | 22 | trace = cd0.trace,
|
@@ -46,8 +47,8 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour)
|
46 | 47 | return;
|
47 | 48 | }
|
48 | 49 | }
|
49 |
| - else if(Fx.inbox(xval - x[0], xval - x[x.length - 1]) > Fx.MAXDIST || |
50 |
| - Fx.inbox(yval - y[0], yval - y[y.length - 1]) > Fx.MAXDIST) { |
| 50 | + else if(Fx.inbox(xval - x[0], xval - x[x.length - 1]) > constants.MAXDIST || |
| 51 | + Fx.inbox(yval - y[0], yval - y[y.length - 1]) > constants.MAXDIST) { |
51 | 52 | return;
|
52 | 53 | }
|
53 | 54 | else {
|
@@ -99,7 +100,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, contour)
|
99 | 100 | return [Lib.extendFlat(pointData, {
|
100 | 101 | index: [ny, nx],
|
101 | 102 | // never let a 2D override 1D type as closest point
|
102 |
| - distance: Fx.MAXDIST + 10, |
| 103 | + distance: constants.MAXDIST + 10, |
103 | 104 | x0: x0,
|
104 | 105 | x1: x1,
|
105 | 106 | y0: y0,
|
|
0 commit comments