<commit_before>lichess.advantageChart = function(data) {
  lichess.loadScript('/assets/javascripts/chart/common.js').done(function() {
    lichess.loadScript('/assets/javascripts/chart/division.js').done(function() {
      lichess.chartCommon('highchart').done(function() {

        lichess.advantageChart.update = function(d) {
          $elem.highcharts().series[0].setData(makeSerieData(d));
        };

        var $elem = $('#adv_chart');
        var max = 10;

        var makeSerieData = function(d) {
          return d.treeParts.slice(1).map(function(node) {
            var y = null;
            if (node.eval && typeof node.eval.cp !== 'undefined') y = node.eval.cp;
            else if (node.eval && node.eval.mate) {
              y = max * 100 - Math.abs(node.eval.mate);
              if (node.eval.mate < 0) y = -y;
            }
            var turn = Math.floor((node.ply - 1) / 2) + 1;
            var dots = node.ply % 2 === 1 ? '.' : '...';
            return y === null ? {
              y: null
            } : {
              name: turn + dots + ' ' + node.san,
              y: Math.max(-9.9, Math.min(y / 100, 9.9))
            };
          });
        };

        var disabled = {<commit_msg>graph checkmate<commit_after>lichess.advantageChart = function(data) {
  lichess.loadScript('/assets/javascripts/chart/common.js').done(function() {
    lichess.loadScript('/assets/javascripts/chart/division.js').done(function() {
      lichess.chartCommon('highchart').done(function() {

        lichess.advantageChart.update = function(d) {
          $elem.highcharts().series[0].setData(makeSerieData(d));
        };

        var $elem = $('#adv_chart');
        var max = 10;

        var makeSerieData = function(d) {
          return d.treeParts.slice(1).map(function(node) {
            var y = null;
            if (node.eval && typeof node.eval.cp !== 'undefined') y = node.eval.cp;
            else if (node.eval && node.eval.mate) {
              y = max * 100 - Math.abs(node.eval.mate);
              if (node.eval.mate < 0) y = -y;
            } else if (node.san.indexOf('#')) {
              y = 100 * (node.ply % 2 === 1 ? max : -max);
            }
            var turn = Math.floor((node.ply - 1) / 2) + 1;
            var dots = node.ply % 2 === 1 ? '.' : '...';
            return y === null ? {
              y: null
            } : {
              name: turn + dots + ' ' + node.san,
              y: Math.max(-9.9, Math.min(y / 100, 9.9))
            };
          });
        };

        var disabled = {
{'fraction_non_alphanumeric': 0.1696113074204947, 'fraction_numerical': 0.0176678445229682, 'mean_word_length': 1.6431535269709543, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5884361', 'n_tokens_mistral': 844, 'n_tokens_neox': 784, 'n_words': 149}