<commit_before>$(function() {
  var zoom = d3.behavior
  .zoom()
  .scaleExtent([1, 8])
  .on("zoom", zoomed);

  var container = d3.select(".outer-container")
  .call(zoom);

  function zoomed() {
    var scale = d3.event.scale;
    var translateX = d3.event.translate[0];
    var translateY = d3.event.translate[1];

    var transformString = "translate(" + translateX + "px," + translateY + "px) scale(" + scale + ")";

    $('.container').css({
      "transform" : transformString,
      "-webkit-transform" : transformString,
      "-ms-transform" : transformString
    });
  }
});
<commit_msg>show full version of elements when zoomed > 2x<commit_after>$(function() {
  var scale; // the current scale level

  var zoom = d3.behavior
  .zoom()
  .scaleExtent([1, 8])
  .on("zoom", zoomed);

  var container = d3.select(".outer-container")
  .call(zoom);

  function zoomed() {
    scale = d3.event.scale;
    var translateX = d3.event.translate[0];
    var translateY = d3.event.translate[1];

    var transformString = "translate(" + translateX + "px," + translateY + "px) scale(" + scale + ")";

    $('.container').css({
      "transform" : transformString,
      "-webkit-transform" : transformString,
      "-ms-transform" : transformString
    });

    $('.node-container').each(function(_, element) {
      $element = $(element);
      if(elementZoomedAboveThreshold(element)) {
        $element.addClass("full").removeClass("summary");
      } else {
        $element.addClass("summary").removeClass("full");
      };
    })
  }

  var elementZoomedAboveThreshold = function($element) {
    var threshold = 2;
    var elementScaleX = $element.getBoundingClientRect().width / $element.offsetWidth;
    return elementScaleX > threshold;
    // return scale > threshold; // shortcut if all things are considered to have the same zoom level
  }
});

{'fraction_non_alphanumeric': 0.16245293168370092, 'fraction_numerical': 0.010758472296933835, 'mean_word_length': 3.189189189189189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '2457278', 'n_tokens_mistral': 582, 'n_tokens_neox': 561, 'n_words': 128}