<commit_before>'use strict';

const defaultTo = require('lodash/defaultTo');
const EventType = require('../../event/EventType');
const ClickEvent = require('../../event/ClickEvent');
const MouseEvent = require('../../event/MouseEvent');
const RTree = require('./rtree/RTree');
const CollisionType = require('./rtree/CollisionType');
const WebGLVertexRenderer = require('./WebGLVertexRenderer');

// Constants

/**
 * Click event handler symbol.
 * @private
 * @constant
 */
const CLICK = Symbol();

/**
 * Mousemove event handler symbol.
 * @private
 * @constant
 */
const MOUSE_MOVE = Symbol();

/**
 * Zoom end event handler symbol.
 * @private
 * @constant
 */
const ZOOM_START = Symbol();

// Private Methods

const getCollision = function(renderer, plotPx) {
	const plot = renderer.layer.plot;
	// points are hashed in un-scaled coordinates, unscale the point
	const targetZoom = Math.round(plot.zoom);
	const scale = Math.pow(2, targetZoom - plot.zoom);
	// unscaled points
	const sx = plotPx.x * scale;
	const sy = plotPx.y * scale;
	// get the tree for the zoom
	const tree = renderer.trees.get(targetZoom);
	if (!tree) {
		// no data for tile<commit_msg>Prevent collision when zooming for interactive renderer.<commit_after>'use strict';

const defaultTo = require('lodash/defaultTo');
const EventType = require('../../event/EventType');
const ClickEvent = require('../../event/ClickEvent');
const MouseEvent = require('../../event/MouseEvent');
const RTree = require('./rtree/RTree');
const CollisionType = require('./rtree/CollisionType');
const WebGLVertexRenderer = require('./WebGLVertexRenderer');

// Constants

/**
 * Click event handler symbol.
 * @private
 * @constant
 */
const CLICK = Symbol();

/**
 * Mousemove event handler symbol.
 * @private
 * @constant
 */
const MOUSE_MOVE = Symbol();

/**
 * Zoom end event handler symbol.
 * @private
 * @constant
 */
const ZOOM_START = Symbol();

// Private Methods

const getCollision = function(renderer, plotPx) {
	const plot = renderer.layer.plot;
	// don't return collision if zooming
	if (plot.zoomAnimation) {
		return null;
	}
	// points are hashed in un-scaled coordinates, unscale the point
	const targetZoom = Math.round(plot.zoom);
	const scale = Math.pow(2, targetZoom - plot.zoom);
	// unscaled points
	const sx = plotPx.x * scale;
	const sy = plotPx.y * scale;
	// get the tree for the zoom
	const tree = renderer.trees.get(targetZoom);
	if (!tree) {
		// no data for tile
{'fraction_non_alphanumeric': 0.14926590538336051, 'fraction_numerical': 0.0008156606851549756, 'mean_word_length': 3.847826086956522, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2002498', 'n_tokens_mistral': 758, 'n_tokens_neox': 753, 'n_words': 220}