<commit_before>/*
 * kb dashboard chart
 */

(function($){

"use strict";

$(document).ready(function() {
  if ($('body').is('.contributor-dashboard, .localization-dashboard')) {
    // Create the dashboard chart.
    makeVoteGraph($('#kpi-vote'), [
      {
        'name': gettext('Article Votes: % Helpful'),
        'slug': 'wiki_percent',
        'func': k.Graph.fraction('kb_helpful', 'kb_votes'),
        'percent': percent
      }
    ]);
  }

  // product selector page reloading
  $('#product-selector select').change(function() {
    var val = $(this).val();
    var queryParams = k.getQueryParamsAsDict(document.location.toString());

    if (val === '') {
      delete queryParams['product'];
    } else {
      queryParams['product'] = val;
    }
    document.location = document.location.pathname + '?' + $.param(queryParams);
  });
});

function makeVoteGraph($container, descriptors) {
  $.getJSON($container.data('url'), function(data) {
    new k.Graph($container, {
      data: {
        datums: data.objects,
        seriesSpec: descriptors
      },
      options: {
        legend: false,
        slider: true,
        bucket: true
      },
      graph: {
        width: 600,
        height: 300
      },
    }).render();
  });
}

}(jQuery));
<commit_msg>[bug 885715] Fix js error (typo) for kb dash charts.<commit_after>/*
 * kb dashboard chart
 */

(function($){

"use strict";

$(document).ready(function() {
  if ($('body').is('.contributor-dashboard, .localization-dashboard')) {
    // Create the dashboard chart.
    makeVoteGraph($('#kpi-vote'), [
      {
        name: gettext('Article Votes: % Helpful'),
        slug: 'wiki_percent',
        func: k.Graph.fraction('kb_helpful', 'kb_votes'),
        type: 'percent'
      }
    ]);
  }

  // product selector page reloading
  $('#product-selector select').change(function() {
    var val = $(this).val();
    var queryParams = k.getQueryParamsAsDict(document.location.toString());

    if (val === '') {
      delete queryParams['product'];
    } else {
      queryParams['product'] = val;
    }
    document.location = document.location.pathname + '?' + $.param(queryParams);
  });
});

function makeVoteGraph($container, descriptors) {
  $.getJSON($container.data('url'), function(data) {
    new k.Graph($container, {
      data: {
        datums: data.objects,
        seriesSpec: descriptors
      },
      options: {
        legend: false,
        slider: true,
        bucket: true
      },
      graph: {
        width: 600,
        height: 300
      },
    }).render();
  });
}

}(jQuery));

{'fraction_non_alphanumeric': 0.17621998450813323, 'fraction_numerical': 0.006971340046475601, 'mean_word_length': 2.533515731874145, 'pattern_counts': {'":': 0, '<': 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': '4028790', 'n_tokens_mistral': 817, 'n_tokens_neox': 785, 'n_words': 159}