<commit_before>import swallow_data from './swallow_data.json'
import elasticsearch from 'elasticsearch'
import randomcolor from 'randomcolor'

export default class MapController {
  constructor(leafletData, $scope, leafletMapEvents) {
    this.esclient = null
    this.markers = {}
    this.paths = {}

    this.layers = {
      baselayers: {
        landscape: {
          name: 'Landscape',
          url: 'http://a.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
          type: 'xyz'
        },
        osm: {
          name: 'Basic',
          url: 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
          type: 'xyz'
        },
        hills: {
          name: 'Hillshade',
          url: 'http://c.tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png',
          type: 'xyz'
        }
      }
    }

    // Example center for now
    this.center = {
      lat: -21.053744,
      lng: -58.359375,
      zoom: 4
    }

    // Register events to listen on
    this.events = {
      map: {
        enable: ['dragend'],
        logic: 'emit'
      }
    }

    // Connect to Elasticsearch
    this.connectEs()

    // Event listeners
    let self = this

    $scope.$on('leafletDirectiveMap.map.dragend', (e) => {
      console.log("dragend")
      this.populateTweetMarkers(self)
    })

    // ALL THE HACKINESS
    // Initial call to populate markers
    this.populateTweetMarkers(self)
<commit_msg>Added "fake" european swallow migration path<commit_after>import swallow_data from './swallow_data.json'
import elasticsearch from 'elasticsearch'
import randomcolor from 'randomcolor'

export default class MapController {
  constructor(leafletData, $scope, leafletMapEvents) {
    this.esclient = null
    this.markers = {}
    this.paths = {}

    this.layers = {
      baselayers: {
        landscape: {
          name: 'Landscape',
          url: 'http://a.tile.thunderforest.com/landscape/{z}/{x}/{y}.png',
          type: 'xyz'
        },
        osm: {
          name: 'Basic',
          url: 'https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png',
          type: 'xyz'
        },
        hills: {
          name: 'Hillshade',
          url: 'http://c.tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png',
          type: 'xyz'
        }
      }
    }

    // Example center for now
    this.center = {
      lat: -21.053744,
      lng: -58.359375,
      zoom: 4
    }

    // Register events to listen on
    this.events = {
      map: {
        enable: ['dragend'],
        logic: 'emit'
      }
    }

    // Connect to Elasticsearch
    this.connectEs()

    // Event listeners
    let self = this

    $scope.$on('leafletDirectiveMap.map.dragend', (e) => {
      console.log("dragend")
      this.populateTweetMarkers(self)
    })

    // ALL THE HACKINESS
    // Initial call to populate markers
    this.populateTweetMarkers(self)


    // Rough European Swallow data
    this.paths.swallow1 = {
      color: '#777',
      weight: 3,
      latlngs: [
        {lat:52.635563, lng:-1.582031},
        {lat:47.627455, lng:-0.175781},
        {lat:40.604569, lng:-1.845703},
        {lat:32.350963, lng:-6.767578},
        {lat:25.511461, lng:-12.788086},
      ]
    }

    // Rough European Swallow data
    this.paths.swallow2 = {
      color: '#777',
      weight: 3,
      latlngs: [
        {lat:52.635563, lng:-1.582031},
        {lat:47.419725, lng:2.856445},
        {lat:40.470980, lng:-0.703125},
        {lat:18.599395, lng:10.019531},
        {lat:2.235151, lng:17.226563},
        {lat:-27.103144, lng:20.742188},
      ]
    }

{'fraction_non_alphanumeric': 0.15205327413984462, 'fraction_numerical': 0.058823529411764705, 'mean_word_length': 1.9096045197740112, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2968585', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1249, 'n_words': 227}