Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Dygraph.prototype.findClosestPoint = function(domX, domY) {
if (Dygraph.VERSION !== '2.0.0') {
console.error(
`Dygraph version changed to ${Dygraph.VERSION} - re-copy findClosestPoint`
)
}
let minXDist = Infinity
let minYDist = Infinity
let xdist, ydist, dx, dy, point, closestPoint, closestSeries, closestRow
for (let setIdx = this.layout_.points.length - 1; setIdx >= 0; --setIdx) {
const points = this.layout_.points[setIdx]
for (let i = 0; i < points.length; ++i) {
point = points[i]
if (!isValidPoint(point, null)) {
continue
}
dx = point.canvasx - domX
dy = point.canvasy - domY
Dygraph.prototype.findClosestPoint = function(domX, domY) {
if (Dygraph.VERSION !== '2.0.0') {
console.error(
`Dygraph version changed to ${Dygraph.VERSION} - re-copy findClosestPoint`
)
}
let minXDist = Infinity
let minYDist = Infinity
let xdist, ydist, dx, dy, point, closestPoint, closestSeries, closestRow
for (let setIdx = this.layout_.points.length - 1; setIdx >= 0; --setIdx) {
const points = this.layout_.points[setIdx]
for (let i = 0; i < points.length; ++i) {
point = points[i]
if (!isValidPoint(point, null)) {
continue
}
dx = point.canvasx - domX