<commit_before>GraphLegendItemView = Backbone.Marionette.ItemView.extend({
  initialize: function() {
    console.log('GraphLegendItemView initializing');
  },
  template: '#graphs-legend-template',
  events: {
    'drop': 'handleDrop'
  },
  handleDrop: function() {
    alert('Dropped!');
  }
});

GraphLegendCollection = Backbone.Marionette.CollectionView.extend({
  itemView: GraphLegendItemView,
  emptyView: Lizard.Map.NoItemsView
});
<commit_msg>Working on Graph legend view<commit_after>NoItemsView = Backbone.Marionette.ItemView.extend({
  template: "#show-no-items-message-template"
});

GraphLegendItemView = Backbone.Marionette.ItemView.extend({
  template: '#graphs-legend-template'
});

GraphLegendCollectionView = Backbone.Marionette.CollectionView.extend({
  itemView: GraphLegendItemView,
  emptyView: NoItemsView,
  initialize: function() {
    console.log('initialize()');
    // console.log($(this.el).parent('.row-fluid'));
    // var g = this.$el.parent('graph').initFlotGraph();
    // _.bind(this.collection);
  },
  onShow: function(e) {
    var that = this;
    this.$el.on('dragover dragenter', false);
    this.$el.on('drop', function(e) {
      e.preventDefault();
      console.log('e', e.originalEvent.target);
      var $target = $(e.target);
      var graph = new Lizard.Models.Graph();
      var uuid = e.originalEvent.dataTransfer.getData('Text');
      var timeserie = timeseriesCollection.get(uuid);
      that.collection.add(timeserie);


      $target.parent().removeClass("empty");
      // only fire for nearest .graph-drop parent (in case there is already a graph in the element)
      var $graph = $target;
      if (!$graph.hasClass('graph-drop')) {
          $graph = $target.parent('.graph-drop');
      }
      $graph.loadPlotData(settings.timeseries_url + 'events/' + uuid);

      // var $graph = $('#drop-one .graph-drop');
      // $graph.loadPlotData(settings.timeseries_url + 'events/' + uuid);
    });
  }
});

{'fraction_non_alphanumeric': 0.1629327902240326, 'fraction_numerical': 0.0, 'mean_word_length': 3.6897374701670644, 'pattern_counts': {'":': 0, '<': 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': '1674716', 'n_tokens_mistral': 621, 'n_tokens_neox': 616, 'n_words': 107}