(d)
| 18 | var project = geo.project; |
| 19 | |
| 20 | function distFn(d) { |
| 21 | var lonlat = d.lonlat; |
| 22 | |
| 23 | if(lonlat[0] === BADNUM) return Infinity; |
| 24 | if(isLonLatOverEdges(lonlat)) return Infinity; |
| 25 | |
| 26 | var pt = project(lonlat); |
| 27 | var px = project([xval, yval]); |
| 28 | var dx = Math.abs(pt[0] - px[0]); |
| 29 | var dy = Math.abs(pt[1] - px[1]); |
| 30 | var rad = Math.max(3, d.mrc || 0); |
| 31 | |
| 32 | // N.B. d.mrc is the calculated marker radius |
| 33 | // which is only set for trace with 'markers' mode. |
| 34 | |
| 35 | return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - 3 / rad); |
| 36 | } |
| 37 | |
| 38 | Fx.getClosest(cd, distFn, pointData); |
| 39 |
nothing calls this directly
no test coverage detected
searching dependent graphs…