<commit_before>class ERD
  constructor: (@name, @elem, @edges) ->
    svg_width = @elem.data('svg_width')
    svg_height = @elem.data('svg_height')
    if (svg_width > @elem.width())
      size = @elem.width() / svg_width
      $('#erd > .model').each ->
        left = parseFloat $(this).css('left')
        top = parseFloat $(this).css('top')
        $(this).css({left: left * size, top: top * size})
    @paper = Raphael(name, @elem.width(), svg_height)
    @setup_handlers()
    models = @elem.find('.model')
    @models = {}
    for model in models
      @models[$(model).data('model_name')] = model
    @connect_arrows(@edges)

  upsert_change: (action, model, column, from, to) ->
    rows = ($(tr).find('td') for tr in $('#changes > tbody > tr'))
    existing = null
    $(rows).each (i, row) ->
      existing = row if (action == $(row[0]).html()) && (model == $(row[1]).html()) && (column == $(row[2]).html())
    if existing == null
      $('#changes > tbody').append("""
        <tr>
          <td data-name="action">#{action}</td>
          <td data-name="model">#{model}</td>
          <td data-name="column">#{column}</td>
          <td data-name="from">#{from}</td>
          <td data-name="to">#{to}</td>
        </tr>
      """)
    else
      $(existing[3]).text(from)
      $(existing[4]).text(to)
    $('#changes').show()

  positions: (div) ->
    [left, width, top, height] = [parseFloat(div.css('left')), parseFloat(div.css('width')), parseFloat(div.css('top')), parseFloat(div.css('height'))]
    {left: left, right: left + width, top: top, bottom: top + height, center: {x: (left + left + width) / 2, y: (top + top + height) / 2}, vertex: {}}
<commit_msg>don't shrink the SVG paper<commit_after>class ERD
  constructor: (@name, @elem, @edges) ->
    @paper = Raphael(name, @elem.data('svg_width'), @elem.data('svg_height'))
    @setup_handlers()
    models = @elem.find('.model')
    @models = {}
    for model in models
      @models[$(model).data('model_name')] = model
    @connect_arrows(@edges)

  upsert_change: (action, model, column, from, to) ->
    rows = ($(tr).find('td') for tr in $('#changes > tbody > tr'))
    existing = null
    $(rows).each (i, row) ->
      existing = row if (action == $(row[0]).html()) && (model == $(row[1]).html()) && (column == $(row[2]).html())
    if existing == null
      $('#changes > tbody').append("""
        <tr>
          <td data-name="action">#{action}</td>
          <td data-name="model">#{model}</td>
          <td data-name="column">#{column}</td>
          <td data-name="from">#{from}</td>
          <td data-name="to">#{to}</td>
        </tr>
      """)
    else
      $(existing[3]).text(from)
      $(existing[4]).text(to)
    $('#changes').show()

  positions: (div) ->
    [left, width, top, height] = [parseFloat(div.css('left')), parseFloat(div.css('width')), parseFloat(div.css('top')), parseFloat(div.css('height'))]
    {left: left, right: left + width, top: top, bottom: top + height, center: {x: (left + left + width) / 2, y: (top + top + height) / 2}, vertex: {}}

{'fraction_non_alphanumeric': 0.232527759634226, 'fraction_numerical': 0.0045721750489875895, 'mean_word_length': 2.98828125, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 44, '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': '512926', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1045, 'n_words': 232}