<commit_before>var data = [];

function inside(xp, yp, x, y) {
        for(var i = 0; i < xp.length; i++) {
                var dx1 = xp[i] - x;
                var dy1 = yp[i] - y;
                var dx2 = xp[(i + 1) % xp.length] - x;
                var dy2 = yp[(i + 1) % xp.length] - y;

                if(dx1 * dy2 - dx2 * dy1 < 0) {
                        return false;
                }
        }
        return true;
}

var init = function() {
        console.log('initializing map');
        $("#info").hide();
        moved = function(e) {
                var imwidth = $("#map").width();
                var imheight = $("#map").height();
                var x = e.offsetX / imwidth;
                var y = e.offsetY / imheight;
                var idx = -1;
                for(var i = 1; i <= 100; i++) {
                        if(data[i].x && data[i].y) {
                                console.log(i);
                                if(inside(data[i].x, data[i].y, x, y)) {
                                        idx = i;
                                        break;
                                }
                        }
                }

                if(idx == -1) {
                        $("#info").hide();
                } else {
                        $("#info-head").text('Unit ' + idx);
                        if(data[idx].people) {
                                $("#info-bod").html(data[idx].people.join('<br>'));
                        } else {
                                $("#info-bod").html("???");
                        }
                        var imgoff = $("#image").offset();
                        var infow = $("#info").width();
                        var infoh = $("#info").height();
                        $("#info").offset({ top: e.offsetY + imgoff.top + 10, left: e.offsetX + imgoff.left - infoh / 2 });
                        $("#info").show();
                }
        }
        $("#image").mousemove(moved);
        $("#image").tap(moved);
        $("#image").click(function(e) {
                var imwidth = $("#map").width();<commit_msg>$.tap is not a thing<commit_after>var data = [];

function inside(xp, yp, x, y) {
        for(var i = 0; i < xp.length; i++) {
                var dx1 = xp[i] - x;
                var dy1 = yp[i] - y;
                var dx2 = xp[(i + 1) % xp.length] - x;
                var dy2 = yp[(i + 1) % xp.length] - y;

                if(dx1 * dy2 - dx2 * dy1 < 0) {
                        return false;
                }
        }
        return true;
}

var init = function() {
        console.log('initializing map');
        $("#info").hide();
        moved = function(e) {
                var imwidth = $("#map").width();
                var imheight = $("#map").height();
                var x = e.offsetX / imwidth;
                var y = e.offsetY / imheight;
                var idx = -1;
                for(var i = 1; i <= 100; i++) {
                        if(data[i].x && data[i].y) {
                                console.log(i);
                                if(inside(data[i].x, data[i].y, x, y)) {
                                        idx = i;
                                        break;
                                }
                        }
                }

                if(idx == -1) {
                        $("#info").hide();
                } else {
                        $("#info-head").text('Unit ' + idx);
                        if(data[idx].people) {
                                $("#info-bod").html(data[idx].people.join('<br>'));
                        } else {
                                $("#info-bod").html("???");
                        }
                        var imgoff = $("#image").offset();
                        var infow = $("#info").width();
                        var infoh = $("#info").height();
                        $("#info").offset({ top: e.offsetY + imgoff.top + 10, left: e.offsetX + imgoff.left - infoh / 2 });
                        $("#info").show();
                }
        }
        $("#image").mousemove(moved);
        $("#image").click(function(e) {
                var imwidth = $("#map").width();
{'fraction_non_alphanumeric': 0.1671018276762402, 'fraction_numerical': 0.009969143128412059, 'mean_word_length': 0.8450087565674256, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '586887', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1114, 'n_words': 240}