<commit_before>function loadChartBuilder(pageData, onSave, chart) {

  var pageUrl = localStorage.getItem('pageurl');
  var html = templates.chartBuilder(chart);
  var table = false;
  var html = templates.chartBuilder();
  $('body').append(html);
  $('.chart-builder').css("display", "block");

  if(chart) {
    $('#chart-data').val(toTsv(chart));
  }

  checkSeries(true);
  renderChart();

  $('#edit-chart :input').on('input', function () {
    checkSeries(true);
    renderChart();
  });

  // create series selector
  function checkSeries (reload) {
    if (reload) {
      var valueSelected = $('#chart-type').val();
      if (valueSelected === 'barline') {
        chart = buildChartObject();
        data = chart.series;
        var html = templates.chartBuilderBarlines(data);
        $('#barline').html(html);
        // add new listeners
        $('#barline').off();
        $('#barline').on('change', function (e) {
          renderChart();
        });
      }
    } else {
      $('#chart-type').on('change', function (e) {
        var optionSelected = $("option:selected", this);
        var valueSelected = this.value;
        if (valueSelected === 'barline') {
          chart = buildChartObject();
          data = chart.series;
          var html = templates.chartBuilderBarlines(data);
          $('#barline').html(html);
          // add new listeners
          $('#barline').off();
          $('#barline').on('change', function (e) {<commit_msg>Fix series selector not hiding<commit_after>function loadChartBuilder(pageData, onSave, chart) {

  var pageUrl = localStorage.getItem('pageurl');
  var html = templates.chartBuilder(chart);
  var table = false;
  var html = templates.chartBuilder();
  $('body').append(html);
  $('.chart-builder').css("display", "block");

  if(chart) {
    $('#chart-data').val(toTsv(chart));
  }

  checkSeries(true);
  renderChart();

  $('#edit-chart :input').on('input', function () {
    checkSeries(true);
    renderChart();
  });

  // create series selector
  function checkSeries (reload) {
    if (reload) {
      var valueSelected = $('#chart-type').val();
      if (valueSelected === 'barline') {
        chart = buildChartObject();
        data = chart.series;
        var html = templates.chartBuilderBarlines(data);
        $('#barline').html(html);
        // add new listeners
        $('#barline').off();
        $('#barline').on('change', function (e) {
          renderChart();
        });
      } else {
        $('#barline').empty();
      }
    } else {
      $('#chart-type').on('change', function (e) {
        var optionSelected = $("option:selected", this);
        var valueSelected = this.value;
        if (valueSelected === 'barline') {
          chart = buildChartObject();
          data = chart.series;
          var html = templates.chartBuilderBarlines(data);
          $('#barline').html(html);
          // add new listeners
          $('#barline').off();
          $('#barline').on('change', function (e) {
{'fraction_non_alphanumeric': 0.18272757585861954, 'fraction_numerical': 0.0, 'mean_word_length': 2.658536585365854, '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': '252696', 'n_tokens_mistral': 854, 'n_tokens_neox': 864, 'n_words': 180}