<commit_before>ES.TableView = Backbone.View.extend({
  initialize: function(o){
    this.num_row = 100;
    this.num_col = 20;
    this.elements_initialized = false;
  },
  render: function(){
    this.initializeElements();
    this.renderTable(); 
    return this;
  },
  initializeElements: function(){
    if(this.elements_initialized) return;
    this.$el.html(ES.template.sheet_table({id:this.getId()}));
    this.$table = $('#data-table-'+this.getId());
    this.$table_col_headers = $('#column-headers-'+this.getId());
    this.$table_row_headers = $('#row-headers-'+this.getId());
    this.elements_initialized = true;
  },
  getId: function(){
    return this.model.cid;
  },
  renderTable: function(){
    var html = ES.template.table({num_row:this.num_row,num_col:this.num_col});
    this.$table.html(html);
    html = ES.template.table_col_headers({num_col:this.num_col});
    this.$table_col_headers.html(html);
    html = ES.template.table_row_headers({num_row:this.num_row});
    this.$table_row_headers.html(html);
  }
});
<commit_msg>table view gets it's size from sheet data<commit_after>ES.TableView = Backbone.View.extend({
  initialize: function(o){
    this.sheet = this.model;
    this.num_row = this.sheet.rowCount();
    this.num_col = this.sheet.colCount();
    this.elements_initialized = false;
  },
  render: function(){
    this.initializeElements();
    this.renderTable(); 
    return this;
  },
  initializeElements: function(){
    if(this.elements_initialized) return;
    this.$el.html(ES.template.sheet_table({id:this.getId()}));
    this.$table = $('#data-table-'+this.getId());
    this.$table_col_headers = $('#column-headers-'+this.getId());
    this.$table_row_headers = $('#row-headers-'+this.getId());
    this.elements_initialized = true;
  },
  getId: function(){
    return this.model.cid;
  },
  renderTable: function(){
    var html = ES.template.table({num_row:this.num_row,num_col:this.num_col});
    this.$table.html(html);
    html = ES.template.table_col_headers({num_col:this.num_col});
    this.$table_col_headers.html(html);
    html = ES.template.table_row_headers({num_row:this.num_row});
    this.$table_row_headers.html(html);
  }
});

{'fraction_non_alphanumeric': 0.17349726775956284, 'fraction_numerical': 0.002276867030965392, 'mean_word_length': 4.121212121212121, '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': '2326155', 'n_tokens_mistral': 735, 'n_tokens_neox': 744, 'n_words': 99}