<commit_before>view = require("../../bone/view")
dom = require "../../utils/dom"

LabelView = view.extend

  initialize: (data) ->
    @seq = data.seq
    @g = data.g

    @manageEvents()

  manageEvents: ->
    events = {}
    events.click = "_onclick"
    if @g.config.get "registerMouseEvents"
      events.mousein = "_onmousein"
      events.mouseout = "_onmouseout"
    @delegateEvents events
    @listenTo @g.config, "change:registerMouseEvents", @manageEvents

  render: ->
    dom.removeAllChilds @el

    @el.style.width = "#{@g.zoomer.get "labelWidth"}px"
    @el.style.height = "#{@g.zoomer.get "rowHeight"}px"
    @el.style.fontSize = "#{@g.zoomer.get "labelFontsize"}px"
    @el.setAttribute "class", "biojs_msa_labels"

    if @.g.vis.get "labelId"
      id = document.createElement "span"
      id.textContent = @model.get "id"
      id.style.width = 30
      id.style.display = "inline-block"
      @el.appendChild id
    if @.g.vis.get "labelName"
      name = document.createElement "span"
      name.textContent = @model.get("name").substring 0, 20
      @el.appendChild name

    @el.style.overflow = scroll
    @

  _onclick: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:click", {seqId:seqId, evt:evt}

  _onmousein: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:mouseout", {seqId:seqId, evt:evt}

  _onmouseout: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:mouseout", {seqId:seqId, evt:evt}

module.exports = LabelView
<commit_msg>removed hardcoded label truncation<commit_after>view = require("../../bone/view")
dom = require "../../utils/dom"

LabelView = view.extend

  initialize: (data) ->
    @seq = data.seq
    @g = data.g

    @manageEvents()

  manageEvents: ->
    events = {}
    events.click = "_onclick"
    if @g.config.get "registerMouseEvents"
      events.mousein = "_onmousein"
      events.mouseout = "_onmouseout"
    @delegateEvents events
    @listenTo @g.config, "change:registerMouseEvents", @manageEvents

  render: ->
    dom.removeAllChilds @el

    @el.style.width = "#{@g.zoomer.get "labelWidth"}px"
    @el.style.height = "#{@g.zoomer.get "rowHeight"}px"
    @el.style.fontSize = "#{@g.zoomer.get "labelFontsize"}px"
    @el.setAttribute "class", "biojs_msa_labels"

    if @.g.vis.get "labelId"
      id = document.createElement "span"
      id.textContent = @model.get "id"
      id.style.width = 30
      id.style.display = "inline-block"
      @el.appendChild id
    if @.g.vis.get "labelName"
      name = document.createElement "span"
      name.textContent = @model.get("name")
      @el.appendChild name

    @el.style.overflow = scroll
    @

  _onclick: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:click", {seqId:seqId, evt:evt}

  _onmousein: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:mouseout", {seqId:seqId, evt:evt}

  _onmouseout: (evt) ->
    seqId = @model.get "id"
    @g.trigger "row:mouseout", {seqId:seqId, evt:evt}

module.exports = LabelView

{'fraction_non_alphanumeric': 0.16504528681650452, 'fraction_numerical': 0.0023482053002348204, 'mean_word_length': 2.8878748370273795, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7371010', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1083, 'n_words': 209}