<commit_before>// override Leaflet implementation for fast symbol rendering
(function () {
	'use strict';

	var proto = L.Canvas.prototype;
	var prev = proto._updateCircle;

	proto._updateCircle = function (layer) {
		if (!layer.options.boostType) {
			return prev.call(this, layer);
		}

		if (!this._drawing || layer._empty()) {
			return;
		}

		var p = {
				x: layer._point.x,
				y: layer._point.y
			},
			ctx = this._ctx,
			r = layer._radius,
			s = (layer._radiusY || r) / r;

		this._drawnLayers[layer._leaflet_id] = layer;

		if (s !== 1) {
			ctx.save();
			ctx.scale(1, s);
		}

		ctx.beginPath();

		if (s !== 1) {
			ctx.restore();
		}

		var options = layer.options;

		var zoomScale;
		var scale = Math.pow(2, this._map.getZoom()) * 256 / Math.PI / 6378137;
		scale = Math.pow(scale, options.boostExp) * options.boostScale;
		r = r * scale;

		// if(options.boostType === 'ball')
		// 	p.y = p.y - r;

		switch (options.boostType) {
			case 'ball':
				if (options.fill) {
					if(options.stroke && options.weight !== 0)
						r = r + options.weight * 0.5 * scale;
					var grd = ctx.createRadialGradient(p.x - r/2, p.y - r/2, 0, p.x, p.y, 1.25 * r);
					grd.addColorStop(0, options.fillColor);
					grd.addColorStop(1, options.color);
					ctx.beginPath();
					ctx.fillStyle = grd;
					ctx.arc(p.x, p.y / s,  r, 0, Math.PI * 2, false);
					ctx.fill(options.fillRule || 'evenodd');
				}
				break;
			default:
				if (options.stroke && options.weight !== 0) {
					ctx.arc(p.x, p.y / s, r + options.weight * 0.5 * scale, 0, Math.PI * 2, false);
					ctx.fillStyle = options.color;
					ctx.fill(options.fillRule || 'evenodd');
				}

				ctx.beginPath();
				if (options.fill) {
					ctx.arc(p.x, p.y / s, r - ((options.stroke && options.weight !== 0) ? options.weight * 0.5 * scale : 0), 0, Math.PI * 2, false);
					ctx.fillStyle = options.fillColor || options.color;
					ctx.fill(options.fillRule || 'evenodd');
				}
		}
	};

	var xproto = L.CircleMarker.prototype;
	var xprev = xproto._containsPoint;

	xproto._containsPoint = function (p) {
		var r = this._radius;
		
		if (this.options.boostType) {

			var options = this.options;
		
			var scale = Math.pow(2, this._map.getZoom()) * 256 / Math.PI / 6378137;
			scale = Math.pow(scale, options.boostExp) * options.boostScale;
			r = r * scale;

			// if(options.boostType === 'ball')
			// 	p.y = p.y - r/2;
		}

		// clickTolerance olny for mobile!
		return p.distanceTo(p) <= r 
			+ (this.options.stroke ? this.options.weight * scale / 2 : 0) 
			+ (L.Browser.touch || L.Browser.mobile ? 10 : 0);
	};

	var cproto = L.Layer.prototype;
	var cprev = cproto._openPopup;
	cproto._openPopup = function (e) {
		var layer = e.layer || e.target;

		if (!(layer instanceof L.CircleMarker))
			return cprev.call(this, e);

		if (!this._popup) {
			return;
		}

		if (!this._map) {
			return;
		}

		// prevent map click
		L.DomEvent.stop(e);

		// treat it like a marker and figure out<commit_msg>fixed clickTolerance<commit_after>// override Leaflet implementation for fast symbol rendering
(function () {
	'use strict';

	var proto = L.Canvas.prototype;
	var prev = proto._updateCircle;

	proto._updateCircle = function (layer) {
		if (!layer.options.boostType) {
			return prev.call(this, layer);
		}

		if (!this._drawing || layer._empty()) {
			return;
		}

		var p = {
				x: layer._point.x,
				y: layer._point.y
			},
			ctx = this._ctx,
			r = layer._radius,
			s = (layer._radiusY || r) / r;

		this._drawnLayers[layer._leaflet_id] = layer;

		if (s !== 1) {
			ctx.save();
			ctx.scale(1, s);
		}

		ctx.beginPath();

		if (s !== 1) {
			ctx.restore();
		}

		var options = layer.options;

		var zoomScale;
		var scale = Math.pow(2, this._map.getZoom()) * 256 / Math.PI / 6378137;
		scale = Math.pow(scale, options.boostExp) * options.boostScale;
		r = r * scale;

		// if(options.boostType === 'ball')
		// 	p.y = p.y - r;

		switch (options.boostType) {
			case 'ball':
				if (options.fill) {
					if(options.stroke && options.weight !== 0)
						r = r + options.weight * 0.5 * scale;
					var grd = ctx.createRadialGradient(p.x - r/2, p.y - r/2, 0, p.x, p.y, 1.25 * r);
					grd.addColorStop(0, options.fillColor);
					grd.addColorStop(1, options.color);
					ctx.beginPath();
					ctx.fillStyle = grd;
					ctx.arc(p.x, p.y / s,  r, 0, Math.PI * 2, false);
					ctx.fill(options.fillRule || 'evenodd');
				}
				break;
			default:
				if (options.stroke && options.weight !== 0) {
					ctx.arc(p.x, p.y / s, r + options.weight * 0.5 * scale, 0, Math.PI * 2, false);
					ctx.fillStyle = options.color;
					ctx.fill(options.fillRule || 'evenodd');
				}

				ctx.beginPath();
				if (options.fill) {
					ctx.arc(p.x, p.y / s, r - ((options.stroke && options.weight !== 0) ? options.weight * 0.5 * scale : 0), 0, Math.PI * 2, false);
					ctx.fillStyle = options.fillColor || options.color;
					ctx.fill(options.fillRule || 'evenodd');
				}
		}
	};

	var xproto = L.CircleMarker.prototype;
	var xprev = xproto._containsPoint;

	xproto._containsPoint = function (p) {
		var r = this._radius;
		
		if (this.options.boostType) {
			var options = this.options;
		
			var scale = Math.pow(2, this._map.getZoom()) * 256 / Math.PI / 6378137;
			scale = Math.pow(scale, options.boostExp) * options.boostScale;
			r = r * scale;
			r = r + (this.options.stroke ? this.options.weight * scale / 2 : 0);

			// if(options.boostType === 'ball')
			// 	p.y = p.y - r/2;
		}

		// clickTolerance olny for mobile!
		return p.distanceTo(this._point) <= r + ((L.Browser.touch && L.Browser.mobile) ? 10 : 0);
	};

	var cproto = L.Layer.prototype;
	var cprev = cproto._openPopup;
	cproto._openPopup = function (e) {
		var layer = e.layer || e.target;

		if (!(layer instanceof L.CircleMarker))
			return cprev.call(this, e);

		if (!this._popup) {
			return;
		}

		if (!this._map) {
			return;
		}

		// prevent map click
		L.DomEvent.stop(e);

		// treat it like a marker and figure out
{'fraction_non_alphanumeric': 0.1702448842670245, 'fraction_numerical': 0.01845018450184502, 'mean_word_length': 2.562126642771804, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4006520', 'n_tokens_mistral': 2686, 'n_tokens_neox': 2207, 'n_words': 514}