<commit_before>var picks = {};

picks.removed = []; // List of markers that have been removed from map (filtered)
picks.symbols = []; // List of all unique symbols
picks.visible = []; // List of symbols that are set to be visible
picks.descriptions  = {};

picks.start = function(url) {

    // Create marker layer
    picks.layer = mmg().factory(simplestyle_factory).url(url, function(feat, l) {

        // Add interaction
        mmg_interaction(l);

        // Create a list of all unique marker symbols
        picks.symbols = picks.visible = _.uniq(
            _.map(picks.layer.markers(), function(m) {
                return m.data.properties['marker-symbol'];
            }));

        // Create a symbol based filter
        var container = document.getElementById('about');
        _.each(picks.symbols, function(s) {

            var img = document.createElement('img');
            img.src = 'maki/' + s + '-24.png';
            img.className = 'markerfilter selected';

            img.onclick = function(a) {
                var index = _.indexOf(picks.visible, s);
                if (index < 0) {
                    picks.visible.push(s);
                    img.className = 'markerfilter selected';
                    picks.show(s);
                } else {
                    picks.visible.splice(index, 1);
                    img.className = 'markerfilter';
                    picks.hide(s);
                }
            }

            container.appendChild(img);
        });

    });
    MM_map.addLayer(picks.layer);

}


// Set all markers with specified symbol to be shown
picks.show = function(s) {

    picks.removed = _.reject(picks.removed, function(m) {
        if (m.data.properties['marker-symbol'] == s) {
            picks.layer.add(m);
            return true;
        }
    });
    picks.layer.draw();
}

picks.hide = function(s) {

    var newRemovals = _.filter(picks.layer.markers(), function(m) {
        return !_.include(picks.visible, m.data.properties['marker-symbol']);
    });

    _.each(newRemovals, function(m) {
        picks.layer.remove(m);
        picks.removed.push(m);<commit_msg>Further simplification<commit_after>var picks = {};

picks.removed = []; // List of markers that have been removed from map (filtered)
picks.symbols = []; // List of all unique symbols
picks.descriptions  = {};

picks.start = function(url) {

    // Create marker layer
    picks.layer = mmg().factory(simplestyle_factory).url(url, function(feat, l) {

        // Add interaction
        mmg_interaction(l);

        // Create a list of all unique marker symbols
        picks.symbols =  _.uniq(
            _.map(picks.layer.markers(), function(m) {
                return m.data.properties['marker-symbol'];
            }));

        // Create a symbol based filter
        var container = document.getElementById('about');
        _.each(picks.symbols, function(s) {

            var img = document.createElement('img');
            img.src = 'maki/' + s + '-24.png';
            img.className = 'markerfilter selected';
            img.selected = true;

            img.onclick = function(a) {
                img.selected = !img.selected;
                if (img.selected) {
                    img.className = 'markerfilter selected';
                    picks.show(s);
                } else {
                    img.className = 'markerfilter';
                    picks.hide(s);
                }
            }

            container.appendChild(img);
        });

    });
    MM_map.addLayer(picks.layer);

}


// Set all markers with specified symbol to be shown
picks.show = function(s) {

    picks.removed = _.reject(picks.removed, function(m) {
        if (m.data.properties['marker-symbol'] == s) {
            picks.layer.add(m);
            return true;
        }
    });
    picks.layer.draw();
}

picks.hide = function(s) {

    var newRemovals = _.filter(picks.layer.markers(), function(m) {
        return (m.data.properties['marker-symbol'] == s);
    });

    _.each(newRemovals, function(m) {
        picks.layer.remove(m);
        picks.removed.push(m);
{'fraction_non_alphanumeric': 0.13519417475728154, 'fraction_numerical': 0.0014563106796116505, 'mean_word_length': 1.8168147641831853, 'pattern_counts': {'":': 0, '<': 4, '<?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': '41871', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1174, 'n_words': 251}