<commit_before><script>
  export default {
    name: 'vgMap',

    mounted() {
      let tiles = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
        attribution: 'VeggieMap',
        maxZoom: 20,
        id: 'mapbox.streets',
        accessToken: '<KEY>'
      });

      let latlng = L.latLng(50.5, 30.51);

      // Marker clusters
      this.markersLayer = L.markerClusterGroup({
        maxClusterRadius: 120,
        spiderfyOnMaxZoom: false,
        showCoverageOnHover: false,
        zoomToBoundsOnClick: true
      });

      this.map = L.map('map-container', {
        center: latlng,
        zoom: 15,
        scrollWheelZoom: false,
        layers: [tiles]
      });
    },

    data() {
      return {
        veggies_array: [],
        arrayOfLatLngs: []
      }
    },

    methods: {
      updateVeggie(data) {
        this.addNewMarker(data.veggies_array);
      },

      updateVeggies(data) {
        if (data && data.veggies !== null) {

          for (let item in data.veggies) {
            this.veggies_array.push(data.veggies[item]);
          }

          this.addNewMarker(this.veggies_array);
        }
      },

      addNewMarker(markerArray) {
        this.map.removeLayer(this.markersLayer);

        markerArray.forEach((item) => {
          if (item && item.veggie) {
            // add the lat/lng of each marker to array
            this.arrayOfLatLngs.push([item.veggie.location[0], item.veggie.location[1]]);

            // add markers on map
            let title = `<h4>${item.veggie.name}</h4> <small>${item.veggie.address}</small>`;

            let marker = L.marker(new L.LatLng(item.veggie.location[0], item.veggie.location[1]), {
              title: title
            });

            marker.bindPopup(title);
            this.markersLayer.addLayer(marker);
          }
        });

        let bounds = new L.LatLngBounds(this.arrayOfLatLngs);
        this.map.fitBounds(bounds);

        this.map.addLayer(this.markersLayer);
      }
    },
<commit_msg>Adiciona comentário ao código.<commit_after><script>
  export default {
    name: 'vgMap',

    mounted() {
      let tiles = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
        attribution: 'VeggieMap',
        maxZoom: 20,
        id: 'mapbox.streets',
        accessToken: '<KEY>'
      });

      let latlng = L.latLng(50.5, 30.51);

      // Marker clusters
      this.markersLayer = L.markerClusterGroup({
        maxClusterRadius: 120,
        spiderfyOnMaxZoom: false,
        showCoverageOnHover: false,
        zoomToBoundsOnClick: true
      });

      this.map = L.map('map-container', {
        center: latlng,
        zoom: 15,
        scrollWheelZoom: false,
        layers: [tiles]
      });
    },

    data() {
      return {
        veggies_array: [],
        arrayOfLatLngs: []
      }
    },

    methods: {
      updateVeggie(data) {
        this.addNewMarker(data.veggies_array);
      },

      updateVeggies(data) {
        if (data && data.veggies !== null) {

          for (let item in data.veggies) {
            this.veggies_array.push(data.veggies[item]);
          }

          this.addNewMarker(this.veggies_array);
        }
      },

      addNewMarker(markerArray) {
        this.map.removeLayer(this.markersLayer);

        markerArray.forEach((item) => {
          if (item && item.veggie) {
            // add the lat/lng of each marker to array
            this.arrayOfLatLngs.push([item.veggie.location[0], item.veggie.location[1]]);

            // add markers on map
            let title = `<h4>${item.veggie.name}</h4> <small>${item.veggie.address}</small>`;

            let marker = L.marker(new L.LatLng(item.veggie.location[0], item.veggie.location[1]), {
              title: title
            });

            marker.bindPopup(title);
            this.markersLayer.addLayer(marker);
          }
        });

        // centraliza o mapa seguindo os marcadores
        let bounds = new L.LatLngBounds(this.arrayOfLatLngs);
        this.map.fitBounds(bounds);

        this.map.addLayer(this.markersLayer);
      }
    },

{'fraction_non_alphanumeric': 0.1399856424982053, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 1.878787878787879, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '2812855', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1367, 'n_words': 211}