<commit_before>var frames = (function () {
    var frames = null;
    $.ajax({
        'async': false,
        'global': false,
        'url': "rotationtest.json",
        'dataType': "json",
        'success': function (data) {
            frames = data;  // Python data structure is empty but correct structure for Plotly animation plotting
        }
    });
    return frames;
})();

console.log(frames);

Plotly.plot('graph', [{
  x: frames[0].x,
  y: frames[0].y,
  line: {simplify: false}}],
  {xaxis: {range: [-2, 2]},
    yaxis: {range: [-2, 2]}}
).then(function () {
  // Add the frames so we can animate them.
  Plotly.addFrames('graph', [frames.x[0], frames.y[0]]);
});

function randomize() {
  Plotly.animate('graph', {
    data:
      [{x: frames.x[1],
      y: frames.y[1]}],
//        traces: [0],
      layout: {}
      }, {
    transition: {
      duration: 100,
      easing: 'cubic-in-out'
      }

    })
}

randomize()<commit_msg>tiny modification.<commit_after>var frames = (function () {
    var frames = null;
    $.ajax({
        'async': false,
        'global': false,
        'url': "rotationtest.json",
        'dataType': "json",
        'success': function (data) {
            frames = data;  // Python data structure is empty but correct structure for Plotly animation plotting
        }
    });
    return frames;
})();

console.log(frames);

Plotly.plot('graph', [{
  x: frames[34].x,
  y: frames[34].y,
  line: {simplify: false}}],
  {xaxis: {range: [-2, 2]},
    yaxis: {range: [-2, 2]}}
).then(function () {
  // Add the frames so we can animate them.
  Plotly.addFrames('graph', frames);
});

function startAnimation () {
  Plotly.animate('graph', null, {
    transition: {
      duration: 500,
      easing: 'linear'
    },
    frame: {
      duration: 500,
      redraw: false,
    },
    mode: 'immediate'
  });
}
{'fraction_non_alphanumeric': 0.18157327586206898, 'fraction_numerical': 0.015086206896551725, 'mean_word_length': 2.3580470162748646, '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': '6640797', 'n_tokens_mistral': 649, 'n_tokens_neox': 623, 'n_words': 158}