<commit_before>;(function () {
  var LinkVertexShaderSource = require('./shaders/link.vert'),
      LinkFragmentShaderSource = require('./shaders/link.frag'),
      NodeVertexShaderSource = require('./shaders/node.vert'),
      NodeFragmentShaderSource = require('./shaders/node.frag'),
      Renderer = require('../renderer.js');

  var WebGLRenderer = Renderer.extend({
    init: function (o) {
      this.initGL(o.webGL);
      this._super(o);

      this.NODE_ATTRIBUTES = 6;
      this.LINKS_ATTRIBUTES = 3;
    },

    initGL: function (gl) {
      this.gl = gl;

      this.linksProgram = this.initShaders(LinkVertexShaderSource, LinkFragmentShaderSource);
      this.nodesProgram = this.initShaders(NodeVertexShaderSource, NodeFragmentShaderSource);

      this.gl.linkProgram(this.linksProgram);
      this.gl.linkProgram(this.nodesProgram);

      this.gl.blendFuncSeparate(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA, this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA);
      this.gl.enable(this.gl.BLEND);
    },

    initShaders: function (vertexShaderSource, fragmentShaderSource) {
      var vertexShader = this.getShaders(this.gl.VERTEX_SHADER, vertexShaderSource);
      var fragmentShader = this.getShaders(this.gl.FRAGMENT_SHADER, fragmentShaderSource);
      var shaderProgram = this.gl.createProgram();
      this.gl.attachShader(shaderProgram, vertexShader);
      this.gl.attachShader(shaderProgram, fragmentShader);
      return shaderProgram;
    },

    getShaders: function (type, source) {
      var shader = this.gl.createShader(type);
      this.gl.shaderSource(shader, source);
      this.gl.compileShader(shader);
      return shader;
    },

    updateNodesBuffer: function () {
      var j = 0;
      this.nodes = [];
      for (var i = 0; i < this.nodeObjects.length; i++) {
        var node = this.nodeObjects[i];
        var cx = this.transformX(node.x) * this.resolution;
        var cy = this.transformY(node.y) * this.resolution;
        // adding one px to keep shader area big enough for antialiasing pixesls
        var r = node.r * Math.abs(this.scale * this.resolution) + 1;
        var color = node.color;


        this.nodes[j++] = (cx - r);
        this.nodes[j++] = (cy - r);
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;

        this.nodes[j++] = (cx + (1 + Math.sqrt(2))*r);
        this.nodes[j++] = cy - r;
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;

        this.nodes[j++] = (cx - r);
        this.nodes[j++] = (cy + (1 + Math.sqrt(2))*r);
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;
      }
    },

    updateLinksBuffer: function () {
      var j = 0;
      this.links = [];
      for (var i = 0; i < this.linkObjects.length; i++) {
        var link = this.linkObjects[i];
        var x1 = this.transformX(link.x1) * this.resolution;
        var y1 = this.transformY(link.y1) * this.resolution;
        var x2 = this.transformX(link.x2) * this.resolution;
        var y2 = this.transformY(link.y2) * this.resolution;
        var color = link.color;

        this.links[j++] = x1;
        this.links[j++] = y1;
        this.links[j++] = color;

        this.links[j++] = x2;
        this.links[j++] = y2;
        this.links[j++] = color;
      }
    },

    resize: function (width, height) {
      this._super(width, height);
      this.gl.viewport(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight);
    },

    render: function () {
      this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);

      this.resize();
      this.updateNodesBuffer();
      this.updateLinksBuffer();<commit_msg>removing depth buffer bit from clear<commit_after>;(function () {
  var LinkVertexShaderSource = require('./shaders/link.vert'),
      LinkFragmentShaderSource = require('./shaders/link.frag'),
      NodeVertexShaderSource = require('./shaders/node.vert'),
      NodeFragmentShaderSource = require('./shaders/node.frag'),
      Renderer = require('../renderer.js');

  var WebGLRenderer = Renderer.extend({
    init: function (o) {
      this.initGL(o.webGL);
      this._super(o);

      this.NODE_ATTRIBUTES = 6;
      this.LINKS_ATTRIBUTES = 3;
    },

    initGL: function (gl) {
      this.gl = gl;

      this.linksProgram = this.initShaders(LinkVertexShaderSource, LinkFragmentShaderSource);
      this.nodesProgram = this.initShaders(NodeVertexShaderSource, NodeFragmentShaderSource);

      this.gl.linkProgram(this.linksProgram);
      this.gl.linkProgram(this.nodesProgram);

      this.gl.blendFuncSeparate(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA, this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA);
      this.gl.enable(this.gl.BLEND);
    },

    initShaders: function (vertexShaderSource, fragmentShaderSource) {
      var vertexShader = this.getShaders(this.gl.VERTEX_SHADER, vertexShaderSource);
      var fragmentShader = this.getShaders(this.gl.FRAGMENT_SHADER, fragmentShaderSource);
      var shaderProgram = this.gl.createProgram();
      this.gl.attachShader(shaderProgram, vertexShader);
      this.gl.attachShader(shaderProgram, fragmentShader);
      return shaderProgram;
    },

    getShaders: function (type, source) {
      var shader = this.gl.createShader(type);
      this.gl.shaderSource(shader, source);
      this.gl.compileShader(shader);
      return shader;
    },

    updateNodesBuffer: function () {
      var j = 0;
      this.nodes = [];
      for (var i = 0; i < this.nodeObjects.length; i++) {
        var node = this.nodeObjects[i];
        var cx = this.transformX(node.x) * this.resolution;
        var cy = this.transformY(node.y) * this.resolution;
        // adding one px to keep shader area big enough for antialiasing pixesls
        var r = node.r * Math.abs(this.scale * this.resolution) + 1;
        var color = node.color;


        this.nodes[j++] = (cx - r);
        this.nodes[j++] = (cy - r);
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;

        this.nodes[j++] = (cx + (1 + Math.sqrt(2))*r);
        this.nodes[j++] = cy - r;
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;

        this.nodes[j++] = (cx - r);
        this.nodes[j++] = (cy + (1 + Math.sqrt(2))*r);
        this.nodes[j++] = color;
        this.nodes[j++] = cx;
        this.nodes[j++] = cy;
        this.nodes[j++] = r;
      }
    },

    updateLinksBuffer: function () {
      var j = 0;
      this.links = [];
      for (var i = 0; i < this.linkObjects.length; i++) {
        var link = this.linkObjects[i];
        var x1 = this.transformX(link.x1) * this.resolution;
        var y1 = this.transformY(link.y1) * this.resolution;
        var x2 = this.transformX(link.x2) * this.resolution;
        var y2 = this.transformY(link.y2) * this.resolution;
        var color = link.color;

        this.links[j++] = x1;
        this.links[j++] = y1;
        this.links[j++] = color;

        this.links[j++] = x2;
        this.links[j++] = y2;
        this.links[j++] = color;
      }
    },

    resize: function (width, height) {
      this._super(width, height);
      this.gl.viewport(0, 0, this.gl.drawingBufferWidth, this.gl.drawingBufferHeight);
    },

    render: function () {
      this.gl.clear(this.gl.COLOR_BUFFER_BIT);

      this.resize();
      this.updateNodesBuffer();
      this.updateLinksBuffer();
{'fraction_non_alphanumeric': 0.1529458179905313, 'fraction_numerical': 0.006575486586007364, 'mean_word_length': 2.5046082949308754, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2741256', 'n_tokens_mistral': 2547, 'n_tokens_neox': 2467, 'n_words': 459}