<commit_before>$(document).ready(function(){
if( $("body").hasClass("twubbles")) {

  // Controls the floating bubbles' text changing
  var nextSadTweetText = "This is a lonely place";

  var changeBubbleText = function(e,bubble) {
    if(e.animationName == "moveclouds") {
      $(this).children(":first").text(nextSadTweetText[Math.floor(Math.random()*nextSadTweetText.length)]);
    }
  }

  function startListening() {
    $('.x1')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x2')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x3')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x4')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x5')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
  }

  startListening();

  // Start the code for the pop up bubbles

  var bubble = d3.layout.pack()
    .sort(null)
    .size([$('#bubbles').width(),$('#bubbles').height()])
    .padding(2)
    .value(function(d) { return 2*d.size; } );

  var svg = d3.select('svg');
    // .attr('width', SIZE)
    // .attr('height', SIZE);

  var color = d3.scale.category10();

  updateBubbles();

  function updateBubbles() {
  d3.json('twubbles.json', function(error, root) {
    update(root);
  });
  setTimeout(updateBubbles, 1000);
}

function update (data){
  nextSadTweetText = data['sad_tweets'];
<commit_msg>Troubleshooting Twubbles<commit_after>
console.log("1")
$(document).ready(function(){
console.log("2")
if( $("body").hasClass("twubbles")) {
console.log("3")
  // Controls the floating bubbles' text changing
  var nextSadTweetText = "This is a lonely place";

  var changeBubbleText = function(e,bubble) {
    if(e.animationName == "moveclouds") {
      $(this).children(":first").text(nextSadTweetText[Math.floor(Math.random()*nextSadTweetText.length)]);
    }
  }

  function startListening() {
    $('.x1')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x2')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x3')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x4')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
    $('.x5')[0].addEventListener("webkitAnimationIteration", changeBubbleText, false);
  }

  startListening();

  // Start the code for the pop up bubbles

  var bubble = d3.layout.pack()
    .sort(null)
    .size([$('#bubbles').width(),$('#bubbles').height()])
    .padding(2)
    .value(function(d) { return 2*d.size; } );

  var svg = d3.select('svg');
    // .attr('width', SIZE)
    // .attr('height', SIZE);

  var color = d3.scale.category10();

  updateBubbles();

  function updateBubbles() {
  d3.json('twubbles.json', function(error, root) {
    update(root);
    console.log("4")
  });
  setTimeout(updateBubbles, 1000);
}

function update (data){
  nextSadTweetText = data['sad_tweets'];

{'fraction_non_alphanumeric': 0.18598472268349386, 'fraction_numerical': 0.015941547658585187, 'mean_word_length': 4.748091603053435, 'pattern_counts': {'":': 2, '<': 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': '107815', 'n_tokens_mistral': 1040, 'n_tokens_neox': 985, 'n_words': 168}