<commit_before>import { isDesktop, AUTOCOMPLETE_DEFAULTS } from 'lib/shared'
import Turbolinks from 'turbolinks'
import 'tipsy-1a'
import 'devbridge-autocomplete'
import 'sticky-kit/dist/sticky-kit.js'
import { VisTreemap, VisSlider, VisBubbles, VisBubbleLegend } from 'lib/visualizations'
import { getBudgetLevelData } from './getBudgetLevelData.js'
// flight components
import './budgetLineBreadcrumb.js'
import './featuredBudgetLine.js'
import './intelligenceBudgetLines.js'
import './intelligenceBudgetLinesMeans.js'
import './visLine.js'

$(document).on('turbolinks:load ajax:complete ajaxSuccess', function() {
  if($('#expense-treemap').length && !$('#expense-treemap svg').length){
    let expenseTreemap = new VisTreemap('#expense-treemap', 'big', true);
    expenseTreemap.render($('#expense-treemap').data('functional-url'));

    window.addEventListener("resize", _.debounce(function () {
      expenseTreemap.render($('#expense-treemap').data('functional-url'));
    }, 250));
  }

  if($('#treemap').length && !$('#treemap svg').length){
    let expenseTreemap = new VisTreemap('#treemap', 'big', true);
    expenseTreemap.render($('#treemap').data('url'));

    window.addEventListener("resize", _.debounce(function () {
      expenseTreemap.render($('#treemap').data('url'));
    }, 250));
  }
})

$(document).on('turbolinks:load', function() {

  if(!isDesktop()) {
    $('.open_line_browser').hide();
  }

  if($('.vis-bubbles-expense').length && $('.vis-bubbles-income').length && !$('.vis-bubbles-expense svg').length && !$('.vis-bubbles-income svg').length) {
    var getBubbleData = new getBudgetLevelData();

    getBubbleData.getData(function() {
      new VisSlider('.timeline', window.budgetLevels);

      var visBubblesExpense = new VisBubbles('.vis-bubbles-expense', 'expense', window.budgetLevels);
      visBubblesExpense.render();

      var visBubblesIncome = new VisBubbles('.vis-bubbles-income', 'income', window.budgetLevels);
      visBubblesIncome.render();

      window.addEventListener("resize", _.debounce(function () {
        new VisSlider('.timeline', window.budgetLevels);

        visBubblesExpense.resize();
        visBubblesIncome.resize();

        if (window.innerWidth >= 1024) {
          new VisBubbleLegend('.bubble_legend');
        } else {
          $('.bubble_legend svg').remove();<commit_msg>fix tipsy on treemap<commit_after>import { isDesktop, AUTOCOMPLETE_DEFAULTS } from 'lib/shared'
import Turbolinks from 'turbolinks'
import 'tipsy-1a'
import 'devbridge-autocomplete'
import 'sticky-kit/dist/sticky-kit.js'
import { VisTreemap, VisSlider, VisBubbles, VisBubbleLegend } from 'lib/visualizations'
import { getBudgetLevelData } from './getBudgetLevelData.js'
// flight components
import './budgetLineBreadcrumb.js'
import './featuredBudgetLine.js'
import './intelligenceBudgetLines.js'
import './intelligenceBudgetLinesMeans.js'
import './visLine.js'

$(document).on('turbolinks:load', function() {

  if(!isDesktop()) {
    $('.open_line_browser').hide();
  }

  if($('#expense-treemap').length && !$('#expense-treemap svg').length){
    let expenseTreemap = new VisTreemap('#expense-treemap', 'big', true);
    expenseTreemap.render($('#expense-treemap').data('functional-url'));

    window.addEventListener("resize", _.debounce(function () {
      expenseTreemap.render($('#expense-treemap').data('functional-url'));
    }, 250));
  }

  if($('#treemap').length && !$('#treemap svg').length){
    let expenseTreemap = new VisTreemap('#treemap', 'big', true);
    expenseTreemap.render($('#treemap').data('url'));

    window.addEventListener("resize", _.debounce(function () {
      expenseTreemap.render($('#treemap').data('url'));
    }, 250));
  }

  if($('.vis-bubbles-expense').length && $('.vis-bubbles-income').length && !$('.vis-bubbles-expense svg').length && !$('.vis-bubbles-income svg').length) {
    var getBubbleData = new getBudgetLevelData();

    getBubbleData.getData(function() {
      new VisSlider('.timeline', window.budgetLevels);

      var visBubblesExpense = new VisBubbles('.vis-bubbles-expense', 'expense', window.budgetLevels);
      visBubblesExpense.render();

      var visBubblesIncome = new VisBubbles('.vis-bubbles-income', 'income', window.budgetLevels);
      visBubblesIncome.render();

      window.addEventListener("resize", _.debounce(function () {
        new VisSlider('.timeline', window.budgetLevels);

        visBubblesExpense.resize();
        visBubblesIncome.resize();

        if (window.innerWidth >= 1024) {
          new VisBubbleLegend('.bubble_legend');
        } else {
          $('.bubble_legend svg').remove();
{'fraction_non_alphanumeric': 0.17827117913343393, 'fraction_numerical': 0.004742401379607674, 'mean_word_length': 4.439624853458382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7146268', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1530, 'n_words': 232}