Finds out the data entry that is closer to the given position on pixels
@param  {Number} mouseX X position of the mouse
@return {obj}        Data entry that is closer to that x axis position
322608
function getNearestDataPoint(mouseX) {
            let points = dataByDate.filter(({date}) => Math.abs(xScale(date) - mouseX) <= epsilon);

            if (points.length) {
                return points[0];
            }
        }
549021
static float getRelativeX (NativeEvent e, Element target) {
    return (e.getClientX() - target.getAbsoluteLeft() + target.getScrollLeft() +
            target.getOwnerDocument().getScrollLeft()) / HtmlGraphics.experimentalScale;
  }
640031
function getNearestDataPoint2(mouseY) {
            let adjustedMouseY = mouseY - margin.bottom,
                epsilon = yScale.bandwidth(),
                nearest = [];

            layers.map(function (data) {
                let found = data.values.find((d2) => Math.abs(adjustedMouseY >= yScale(d2[nameLabel])) && Math.abs(adjustedMouseY - yScale(d2[nameLabel]) <= epsilon * 2));

                if (found) {
                    found.values = data.values;
                    found.key = found.name;
                    nearest.push(found)
                }
            });

            return nearest.length ? nearest[0] : undefined;
        }
796589
function compareGrabberAndMousePosition(m) {
			if (isScrollbarOver(m)) {
				if (ctrl.horizontal) {
					var start = getScrollbarArea().left + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.x < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.x > end)
						return 1;
					if (m.x >= start && m.x <= end)
						return 0;
				} else {
					var start = getScrollbarArea().top + getGrabberOffsetPixelFromPercent(getGrabberOffsetPercentFromBegin($scope.ngBegin));
					if (m.y < start)
						return -1;
					var end = start + getGrabberSizePixelFromPercent(getGrabberSizePercentFromScopeValues());
					if (m.y > end)
						return 1;
					if (m.y >= start && m.y <= end)
						return 0;
				}
			}
			return Number.NaN;
		}
639291
def index_at_event(self, event):
        
        # find index at mouse position
        globalpos = event.globalPos()
        viewport = self.viewport()
        pos = viewport.mapFromGlobal(globalpos)
        return self.indexAt(pos)
206201
function getPointProps(svg) {
            let mousePos = d3Selection.mouse(svg);

            mousePos[0] -= margin.left;
            mousePos[1] -= margin.top;

            return {
                closestPoint: voronoi.find(mousePos[0], mousePos[1]),
                mousePos
            };
        }
943963
public Object getValue(int x) {
    if (x >= width())
      throw new IllegalArgumentException("Index out of scope on axis (" + x + " >= " + width() + ")!");

    return m_Min + m_Step*x;
  }
1010479
def get_mouse_pos(self, window_pos=None):
    """"""
    window_pos = window_pos or pygame.mouse.get_pos()
    # +0.5 to center the point on the middle of the pixel.
    window_pt = point.Point(*window_pos) + 0.5
    for surf in reversed(self._surfaces):
      if (surf.surf_type != SurfType.CHROME and
          surf.surf_rect.contains_point(window_pt)):
        surf_rel_pt = window_pt - surf.surf_rect.tl
        world_pt = surf.world_to_surf.back_pt(surf_rel_pt)
        return MousePos(world_pt, surf)
1189070
function getRightEdge(index, cell) {
        return {
          index: index,
          x: editor.dom.getPos(cell).x + cell.offsetWidth
        };
      }
666503
def move_mouse_relative(self, x, y):
        
        _libxdo.xdo_move_mouse_relative(self._xdo, x, y)
263518
function findBoundingClientRect2(obj) {
        var offsetLeft = 0, offsetTop = 0, width = obj.offsetWidth, height = obj.offsetHeight;
        var scr = obj, fixed = false;
        while ((scr = scr.parentNode) && scr != document.body) {
            offsetLeft -= scr.scrollLeft || 0;
            offsetTop -= scr.scrollTop || 0;
            if (getStyle(scr, "position") == "fixed") fixed = true;
        }
        // You can take into account document.body.scrollLeft & document.body.scrollTop if you want to take into account global scroll of browser
        if (fixed && !window.opera) {
            var scrDist = scrollDist();
            offsetLeft += scrDist[0];
            offsetTop += scrDist[1];
        }
        do {
            offsetLeft += obj.offsetLeft;
            offsetTop += obj.offsetTop;
        } while (obj = obj.offsetParent);
        return {
            left: offsetLeft,
            top: offsetTop,
            width: width,
            height: height,
            right: offsetLeft + width - 1,
            bottom: offsetTop + height - 1
        };
    }
839192
function(x, y){
            var pos = this.canvas.getBoundingClientRect(),
                mx = x - pos.left,
                my = y - pos.top;
            return this.pixelToTileCoords(mx, my);
        }
58812
function getPointByClient(clientX, clientY) {
    var el = this.get('el');
    var pixelRatio = this.get('pixelRatio') || 1;
    var bbox = el.getBoundingClientRect();
    return {
      x: (clientX - bbox.left) * pixelRatio,
      y: (clientY - bbox.top) * pixelRatio
    };
  }
385136
private Coordinate getOrigin(HumanInputEvent<?> event) {
		// Get the original location for the lastly selected index:
		if (lastSelection != null) {
			try {
				return service.getIndexService().getVertex(service.getGeometry(), lastSelection);
			} catch (GeometryIndexNotFoundException e) {
			}
		}

		// Backup plan: mouse location.
		return getLocation(event, RenderSpace.SCREEN);
	}
550962
function findNearbyItem(mouseX, mouseY, seriesFilter, radius, computeDistance) {
            var maxDistance = radius,
                smallestDistance = maxDistance * maxDistance + 1,
                item = null,
                dx, dy, dist,
                i, j, ps;

            for (i = series.length - 1; i >= 0; --i) {
                if (!seriesFilter(i)) continue;

                var s = series[i];
                if (!s.datapoints) return;
                var x, y,
                    axisx = s.xaxis,
                    axisy = s.yaxis,
                    points = s.datapoints.points,
                    mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster
                    my = axisy.c2p(mouseY),
                    maxx = maxDistance / axisx.scale,
                    maxy = maxDistance / axisy.scale;

                ps = s.datapoints.pointsize;
                // with inverse transforms, we can't use the maxx/maxy
                // optimization, sadly
                if (axisx.options.inverseTransform) {
                    maxx = Number.MAX_VALUE;
                }

                if (axisy.options.inverseTransform) {
                    maxy = Number.MAX_VALUE;
                }

                for (j = 0; j < points.length; j += ps) {
                    x = points[j];
                    y = points[j + 1];
                    if (x == null) {
                        continue;
                    }

                    if (x - mx > maxx || x - mx < -maxx ||
                        y - my > maxy || y - my < -maxy) {
                        continue;
                    }

                    // We have to calculate distances in pixels, not in
                    // data units, because the scales of the axes may be different
                    dx = Math.abs(axisx.p2c(x) - mouseX);
                    dy = Math.abs(axisy.p2c(y) - mouseY);
                    dist = computeDistance ? computeDistance(dx, dy) : dx * dx + dy * dy;

                    // use <= to ensure last point takes precedence
                    // (last generally means on top of)
                    if (dist < smallestDistance) {
                        smallestDistance = dist;
                        item = [i, j / ps];
                    }
                }
            }

            if (item) {
                i = item[0];
                j = item[1];
                ps = series[i].datapoints.pointsize;

                return {
                    datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),
                    dataIndex: j,
                    series: series[i],
                    seriesIndex: i
                };
            }

            return null;
        }
780116
function(index){
    
        //check for out-of-bounds values
        if (index > -1 && index < this._length){
            var current = this._head,
                i = 0;
                
            while(i++ < index){
                current = current.next;            
            }
        
            return current.data;
        } else {
            return null;
        }
    }
427844
function getTopEdge(index, row) {
        return {
          index: index,
          y: editor.dom.getPos(row).y
        };
      }