<commit_before>function initMap(msg, data) {
    // Eyes wide open for this narly hack.
    // There are lots of different ways to put a D3 layer on Leaflet, and I found
    // them all to be annoying and/or weird. So, here I'm adding the topojson as a
    // regular leaflet layer so Leaflet can manage zooming/redrawing/events/etc. However,
    // I want D3 to manage symbolization et al, so I rely on the fact that Leaflet
    // adds the polys in the topojson order to add a data-id and geom class to the
    // layer so I can handle it D3-ish rather than through the Leaflet API.

    d3Layer = L.geoJson(topojson.feature(data.geom, data.geom.objects[neighborhoods]), {
        style: {
            "fillColor": "rgba(0,0,0,0)",
            "color": "none",
            "fillOpacity": 1
        }
    }).addTo(map);

    map.setMaxBounds(d3Layer.getBounds());

    d3.selectAll(".leaflet-overlay-pane svg path").attr("class", "geom metric-hover").attr("data-id", function(d, i) {
      try {
        return data.geom.objects[neighborhoods].geometries[i].id;
      } catch (e) {
        console.log("i " + i + " " + e);
      }
    });

    d3Layer.on("click", function(d) {
        var sel = d3.select(".geom[data-id='" + d.layer.feature.id + "']");<commit_msg>Add padding to pan bounds<commit_after>function setPanBounds(padding) {
    // Creates pan bounds with custom padding around data extent.

    maxBounds = d3Layer.getBounds();
    southWest = maxBounds.getSouthWest();
    northEast = maxBounds.getNorthEast();
    newSouthWest = L.latLng(southWest.lat - padding, southWest.lng - padding);
    newNorthEast = L.latLng(northEast.lat + padding, northEast.lng + padding);
    return L.latLngBounds(newSouthWest, newNorthEast);

}

function initMap(msg, data) {
    // Eyes wide open for this narly hack.
    // There are lots of different ways to put a D3 layer on Leaflet, and I found
    // them all to be annoying and/or weird. So, here I'm adding the topojson as a
    // regular leaflet layer so Leaflet can manage zooming/redrawing/events/etc. However,
    // I want D3 to manage symbolization et al, so I rely on the fact that Leaflet
    // adds the polys in the topojson order to add a data-id and geom class to the
    // layer so I can handle it D3-ish rather than through the Leaflet API.

    d3Layer = L.geoJson(topojson.feature(data.geom, data.geom.objects[neighborhoods]), {
        style: {
            "fillColor": "rgba(0,0,0,0)",
            "color": "none",
            "fillOpacity": 1
        }
    }).addTo(map);

    map.setMaxBounds(setPanBounds(0.25));

    d3.selectAll(".leaflet-overlay-pane svg path").attr("class", "geom metric-hover").attr("data-id", function(d, i) {
      try {
        return data.geom.objects[neighborhoods].geometries[i].id;
      } catch (e) {
        console.log("i " + i + " " + e);
      }
    });

    d3Layer.on("click", function(d) {
        var sel = d3.select(".geom[data-id='" + d.layer.feature.id + "']");
{'fraction_non_alphanumeric': 0.1304931231130493, 'fraction_numerical': 0.009728279100972828, 'mean_word_length': 2.6860321384425214, 'pattern_counts': {'":': 6, '<': 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': '2248964', 'n_tokens_mistral': 1005, 'n_tokens_neox': 961, 'n_words': 290}