<commit_before>

renderD3Web = function() {
  var maxNodes = 40;
  // var showFirst;
  // var hideEdges;

  // $("#max_nodes").mousemove(function () {
  //   $("#text").text($("#max_nodes").val());
  //   maxNodes = $("#max_nodes").val();
  //   console.log(maxNodes);
  //   showFirst(10);
  //   hideEdges(25);
  // });




  var width = 960,
    height = 600

  var svg = d3.select(".graph").append("svg")
    .attr("width", width)
    .attr("height", height);

  var force = d3.layout.force()
    .gravity(.5)
    .distance(350)
    .charge(-10)
    .size([width, height]);

  function toQuintile(value) {
    switch (true) {
      case value > 85:
        return "hsl(5, 90%, 50%)";
        break;
      case value > 65:
        return "hsl(10, 80%, 50%)";
        break;
      case value > 50:
        return "hsl(15, 70%, 50%)";
        break;
      case value > 35:
        return "hsl(20, 60%, 50%)";
        break;
      case value > 20:
        return "hsl(25, 50%, 50%)";
        break;
      case value > 5:
        return "hsl(30, 40%, 50%)";
        break;
      case value == -1:
        return "hsl(0, 0%, 50%)";
        break;
    }
  }

  d3.json("/beliefs.json", function(error, json) {

    var data = json.beliefs.filter(function(d) {return d.id < maxNodes;});
    console.log(data);
    var edges = [];
    json.connections.forEach(function(e) {
      var sourceBelief = json.beliefs.filter(function(n) {
          return n.id === e.source;
        })[0],
        targetBelief = json.beliefs.filter(function(n) {
          return n.id === e.target;
        })[0];

        edges.push({
          source: sourceBelief,
          target: targetBelief,
          value: e.value
        });

    });

    // showFirst = function showFirst(x) {
    //   debugger;
    //   var node = svg.selectAll(".node")
    //     .data(edges.filter(function(d) { return d.id < x; }))
    //     .attr("display", "none");<commit_msg>made filtering by number of nodes possible<commit_after>

renderD3Web = function() {
  var maxNodes = 40;
  // var showFirst;
  // var hideEdges;

  // $("#max_nodes").mousemove(function () {
  //   $("#text").text($("#max_nodes").val());
  //   maxNodes = $("#max_nodes").val();
  //   console.log(maxNodes);
  //   showFirst(10);
  //   hideEdges(25);
  // });




  var width = 960,
    height = 600

  var svg = d3.select(".graph").append("svg")
    .attr("width", width)
    .attr("height", height);

  var force = d3.layout.force()
    .gravity(.5)
    .distance(350)
    .charge(-10)
    .size([width, height]);

  function toQuintile(value) {
    switch (true) {
      case value > 85:
        return "hsl(5, 90%, 50%)";
        break;
      case value > 65:
        return "hsl(10, 80%, 50%)";
        break;
      case value > 50:
        return "hsl(15, 70%, 50%)";
        break;
      case value > 35:
        return "hsl(20, 60%, 50%)";
        break;
      case value > 20:
        return "hsl(25, 50%, 50%)";
        break;
      case value > 5:
        return "hsl(30, 40%, 50%)";
        break;
      case value == -1:
        return "hsl(0, 0%, 50%)";
        break;
    }
  }

  d3.json("/beliefs.json", function(error, json) {
    var data = json.beliefs.filter(function(d) {return d.id < maxNodes;});
    console.log(data);
    var edges = [];
    json.connections.forEach(function(e) {
      var sourceBelief = json.beliefs.filter(function(n) {
          return n.id === e.source;
        })[0],
        targetBelief = json.beliefs.filter(function(n) {
          return n.id === e.target;
        })[0];

        edges.push({
          source: sourceBelief,
          target: targetBelief,
          value: e.value
        });

    });

    // showFirst = function showFirst(x) {
    //   debugger;
    //   var node = svg.selectAll(".node")
    //     .data(edges.filter(function(d) { return d.id < x; }))
    //     .attr("display", "none");
{'fraction_non_alphanumeric': 0.18493852459016394, 'fraction_numerical': 0.038422131147540985, 'mean_word_length': 1.9272863568215892, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '4025030', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1326, 'n_words': 291}