<commit_before>// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/jquery-2.0.js
// ==/ClosureCompiler==
//
$(function() {

  var disabled = {
    enabled: false
  };
  var noText = {
    text: null
  };
  var noAnimation = {
    animation: disabled
  };
  var theme = Highcharts.theme;
  var defaults = {
    yAxis: {
      title: noText
    },
    credits: disabled,
    legend: disabled
  };

  function mergeDefaults(config) {
    return $.extend(true, {}, defaults, config);
  }

  if ($('div.rating_history').length) {
    $('div.rating_history').highcharts('StockChart', mergeDefaults({
      rangeSelector: {
        enabled: true,
        selected: 1,
        inputEnabled: false,
        labelStyle: {
          display: 'none'
        }
      },
      xAxis: {
        title: noText,
        labels: disabled,
        lineWidth: 0,
        tickWidth: 0
      },
      scrollbar: disabled,
      series: _.map(lichess_rating_series, function(serie) {
        return {
          name: serie.name,
          type: 'line',
          marker: {
            enabled: true,
            radius: 2
          },
          data: _.map(serie.points, function(r) {
            return [Date.UTC(r[0], r[1], r[2]), r[3]];
          })
        };
      })
    }));
  }

  $('#adv_chart').each(function() {
    var $this = $(this);
    var cpMax = parseInt($this.data('max'), 10) / 100;
    $(this).highcharts(mergeDefaults({
      series: [{
        name: 'Advantage',
        data: _.map($this.data('rows'), function(row) {
          row.y = row.y / 100;
          return row;
        })
      }],
      chart: {
        type: 'area',
        margin: 0,
        marginTop: 20,
        spacing: [10, 0, 0, 0]
      },
      plotOptions: {
        area: {
          color: theme.colors[7],
          negativeColor: theme.colors[1],
          threshold: 0,
          lineWidth: 1,
          allowPointSelect: true,
          column: noAnimation,
          cursor: 'pointer',
          events: {
            click: function(event) {
              if (event.point) {
                event.point.select();
                lichess.analyse.jump(event.point.x + 1, 0);
              }
            }
          },
          marker: {
            radius: 1,
            states: {
              hover: {
                radius: 3,
                lineColor: '#b57600',
                fillColor: '#ffffff'
              },
              select: {
                radius: 4,
                lineColor: '#b57600',
                fillColor: '#ffffff'
              }
            }
          }
        }
      },
      title: {
        text: $this.data('title'),
        align: 'left',
        y: 5
      },
      xAxis: {
        title: noText,
        labels: disabled,
        lineWidth: 0,
        tickWidth: 0
      },
      yAxis: {
        min: -cpMax,
        max: cpMax,
        labels: disabled,<commit_msg>Show mid/end-game in advantage chart<commit_after>// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url http://closure-compiler.googlecode.com/svn/trunk/contrib/externs/jquery-2.0.js
// ==/ClosureCompiler==
//
$(function() {

  var disabled = {
    enabled: false
  };
  var noText = {
    text: null
  };
  var noAnimation = {
    animation: disabled
  };
  var theme = Highcharts.theme;
  var defaults = {
    yAxis: {
      title: noText
    },
    credits: disabled,
    legend: disabled
  };

  function mergeDefaults(config) {
    return $.extend(true, {}, defaults, config);
  }

  if ($('div.rating_history').length) {
    $('div.rating_history').highcharts('StockChart', mergeDefaults({
      rangeSelector: {
        enabled: true,
        selected: 1,
        inputEnabled: false,
        labelStyle: {
          display: 'none'
        }
      },
      xAxis: {
        title: noText,
        labels: disabled,
        lineWidth: 0,
        tickWidth: 0
      },
      scrollbar: disabled,
      series: _.map(lichess_rating_series, function(serie) {
        return {
          name: serie.name,
          type: 'line',
          marker: {
            enabled: true,
            radius: 2
          },
          data: _.map(serie.points, function(r) {
            return [Date.UTC(r[0], r[1], r[2]), r[3]];
          })
        };
      })
    }));
  }

  $('#adv_chart').each(function() {
    var $this = $(this);
    var cpMax = parseInt($this.data('max'), 10) / 100;
    var mid = parseInt($this.data('division-mid'));
    var end = parseInt($this.data('division-end'));

    $(this).highcharts(mergeDefaults({
      series: [{
        name: 'Advantage',
        data: _.map($this.data('rows'), function(row) {
          row.y = row.y / 100;
          return row;
        })
      }],
      chart: {
        type: 'area',
        margin: 0,
        marginTop: 20,
        spacing: [10, 0, 0, 0]
      },
      plotOptions: {
        area: {
          color: theme.colors[7],
          negativeColor: theme.colors[1],
          threshold: 0,
          lineWidth: 1,
          allowPointSelect: true,
          column: noAnimation,
          cursor: 'pointer',
          events: {
            click: function(event) {
              if (event.point) {
                event.point.select();
                lichess.analyse.jump(event.point.x + 1, 0);
              }
            }
          },
          marker: {
            radius: 1,
            states: {
              hover: {
                radius: 3,
                lineColor: '#b57600',
                fillColor: '#ffffff'
              },
              select: {
                radius: 4,
                lineColor: '#b57600',
                fillColor: '#ffffff'
              }
            }
          }
        }
      },
      title: {
        text: $this.data('title'),
        align: 'left',
        y: 5
      },
      xAxis: {
        title: noText,
        labels: disabled,
        lineWidth: 0,
        tickWidth: 0,
        plotLines: [
        {
          label: {
            text: 'Opening',
            verticalAlign: 'top',
            align: 'left',
            x: 10,
            style: {
              color: '#aaa',
              weight: 'bold'
            }
          },
          color: '#30cc4d',
          width: 2,
          value: 0
        },
        {
          label: {
            text: 'Mid-Game',
            verticalAlign: 'top',
            align: 'left',
            x: 10,
            style: {
              color: '#aaa',
              weight: 'bold'
            }
          },
          color: '#3093cc',
          width: (mid == null)? 0 : 2,
          value: mid
        },
        {
          label: {
            text: 'End-Game',
            verticalAlign: 'top',
            align: 'left',
            x: 10,
            style: {
              color: '#aaa',
              weight: 'bold'
            }
          },
          color: '#cc9730',
          width: (end == null)? 0 : 2,
          value: end
        }]
      },
      yAxis: {
        min: -cpMax,
        max: cpMax,
        labels: disabled,
{'fraction_non_alphanumeric': 0.13811922753988246, 'fraction_numerical': 0.016652672823957458, 'mean_word_length': 1.2732188295165394, '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': '5297274', 'n_tokens_mistral': 2247, 'n_tokens_neox': 2105, 'n_words': 442}