<commit_before>"use strict";

function chartFailure(chart, title) {
  var $chartDiv = $(chart.renderTo);
  var $chartWrapper = $chartDiv.parent();
  var $titleH3 = $chartWrapper.find('h3');

  $titleH3.text(title + ' chart');
  $chartWrapper.addClass('alert alert-warning');
  $chartDiv.remove();

  $('div#nav-row').before('<div class="alert alert-warning" role="alert">' + title + ' <a href="#' + $chartWrapper.attr('id') + '" class="alert-link">chart</a></div>');
}

function chartSuccess(chart_data, chart, noAdvice, noZoom) {

  var $chartDiv = $(chart.renderTo);
  var chartType = chart_data.chart1_type;
  var seriesData = chart_data.series_data;

  if (! noAdvice) {
    var $chartWrapper = $chartDiv.parent();
    var titleH3 = $chartWrapper.find('h3');

    if ($chartDiv.data('chart-index') === 0) {
      titleH3.text(chart_data.title);
    } else {
      titleH3.before('<hr class="analysis"/>');
      titleH3.text(chart_data.title);
    }

    var adviceHeader = chart_data.advice_header;
    var adviceFooter = chart_data.advice_footer;

    if (adviceHeader) {
      $chartDiv.before('<div>' + adviceHeader + '</div>');
    }

    if (adviceFooter) {
      $chartDiv.after('<div>' + adviceFooter + '</div>');
    }
  }

  if (chartType == 'bar' || chartType == 'column' || chartType == 'line') {

    barColumnLine(chart_data, chart, seriesData, chartType, noZoom);

  // Scatter
  } else if (chartType == 'scatter') {
    scatter(chart_data, chart, seriesData);

  // Pie
  } else if (chartType == 'pie') {
    pie(chart_data, chart, seriesData, $chartDiv);
  }

  if(chart_data.allowed_operations){
    processAnalysisOperations(chart, chart_data.allowed_operations, chart_data.drilldown_available, noZoom, chart_data.parent_timescale_description)
  }

  if(chart_data.annotations){
    var xAxis = chart.xAxis[0];

    var xAxisCategories = xAxis.categories;
    if(chart_data.annotations == 'weekly'){
      var data = {<commit_msg>Pass correct parameters to analysis operations<commit_after>"use strict";

function chartFailure(chart, title) {
  var $chartDiv = $(chart.renderTo);
  var $chartWrapper = $chartDiv.parent();
  var $titleH3 = $chartWrapper.find('h3');

  $titleH3.text(title + ' chart');
  $chartWrapper.addClass('alert alert-warning');
  $chartDiv.remove();

  $('div#nav-row').before('<div class="alert alert-warning" role="alert">' + title + ' <a href="#' + $chartWrapper.attr('id') + '" class="alert-link">chart</a></div>');
}

function chartSuccess(chart_data, chart, noAdvice, noZoom) {

  var $chartDiv = $(chart.renderTo);
  var chartType = chart_data.chart1_type;
  var seriesData = chart_data.series_data;

  if (! noAdvice) {
    var $chartWrapper = $chartDiv.parent();
    var titleH3 = $chartWrapper.find('h3');

    if ($chartDiv.data('chart-index') === 0) {
      titleH3.text(chart_data.title);
    } else {
      titleH3.before('<hr class="analysis"/>');
      titleH3.text(chart_data.title);
    }

    var adviceHeader = chart_data.advice_header;
    var adviceFooter = chart_data.advice_footer;

    if (adviceHeader) {
      $chartDiv.before('<div>' + adviceHeader + '</div>');
    }

    if (adviceFooter) {
      $chartDiv.after('<div>' + adviceFooter + '</div>');
    }
  }

  if (chartType == 'bar' || chartType == 'column' || chartType == 'line') {

    barColumnLine(chart_data, chart, seriesData, chartType, noZoom);

  // Scatter
  } else if (chartType == 'scatter') {
    scatter(chart_data, chart, seriesData);

  // Pie
  } else if (chartType == 'pie') {
    pie(chart_data, chart, seriesData, $chartDiv);
  }

  if(chart_data.allowed_operations){
    processAnalysisOperations(chart, chart_data.allowed_operations, chart_data.drilldown_available, chart_data.parent_timescale_description)
  }

  if(chart_data.annotations){
    var xAxis = chart.xAxis[0];

    var xAxisCategories = xAxis.categories;
    if(chart_data.annotations == 'weekly'){
      var data = {
{'fraction_non_alphanumeric': 0.16509793945560927, 'fraction_numerical': 0.005596540320529127, 'mean_word_length': 4.021711366538953, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '1060401', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1306, 'n_words': 244}