<commit_before>function GetColorByGroup(num){
  switch (num) {
    case 0:
      return "#00A1B7"
    case 1:
      return "#277884"
    case 2:
      return "#005E6B"
    case 3:
      return "#003138"
    case 4:
      return "#E35EA2"
    case 5:
      return "#E31A80"
    case 6:
      return "#971155"
    case 7:
      return "#640B38"
    case 8:
      return "#C7F38B"
    case 9:
      return "#A8F342"
    case 10:
      return "#94B667"
    case 11:
        return "#50741F"
    default:
      return "#FFF"
  }
}

function GetDistanceByValue(num){
  return num*12;
}

function GetSizeBySelected(col){
  if(col=="#FFF"){
    return 20;
  }
  return 12;
}
var gr="";

var parentWidth=parseInt($(window).width());
//var parentHeight=$("#chart").height();
var parentHeight=500;

console.log(parentWidth+" "+parentHeight);

var svgl = d3.select("#linkerSvg");
      //width = +svg.attr("width"),
      //height = +svg.attr("height");

var color = d3.scaleOrdinal(d3.schemeCategory20);

var simulation = d3.forceSimulation()
    .force("link", d3.forceLink().id(function(d) { return d.id; })
                                   .distance(function(d) { return GetDistanceByValue(d.value); }))
    .force("charge", d3.forceManyBody())
    .force("center", d3.forceCenter(parentWidth/2, parentHeight/2));

$("#linkerTitle").text("Relación de palabras para "+" \""+"love"+"\"");
$("#linkerLoader").hide();

function updateSimulation(){
  var w=$("#frase").val();
  if(w==""){
    w="love";
  }
  var text="Relación de palabras para "+" \""+w+"\"";
  $("#linkerTitle").text(text);
  $("#linkerLoader").hide();
  console.log("updateLinker");
  var parentWidth=parseInt($(window).width());
  var parentHeight=500;

  console.log(parentWidth+" "+parentHeight);
  simulation = d3.forceSimulation()
      .force("link", d3.forceLink().id(function(d) { return d.id; })
                                     .distance(function(d) { return GetDistanceByValue(d.value); }))
      .force("charge", d3.forceManyBody())
      .force("center", d3.forceCenter(parentWidth/2, parentHeight/2));

      d3.json("Resources/data.json", function(error, graph) {
        if (error) throw error;

        if(gr!=""){
          graph=gr;
        }

        svgl.selectAll("g").remove();
<commit_msg>added.2<commit_after>function GetColorByGroup(num){
  switch (num) {
    case 0:
      return "#00A1B7"
    case 1:
      return "#277884"
    case 2:
      return "#005E6B"
    case 3:
      return "#003138"
    case 4:
      return "#E35EA2"
    case 5:
      return "#E31A80"
    case 6:
      return "#971155"
    case 7:
      return "#640B38"
    case 8:
      return "#C7F38B"
    case 9:
      return "#A8F342"
    case 10:
      return "#94B667"
    case 11:
        return "#50741F"
    default:
      return "#FFF"
  }
}

function GetDistanceByValue(num){
  return num*12;
}

function GetSizeBySelected(col){
  if(col=="#FFF"){
    return 20;
  }
  return 12;
}
var gr="";

var parentWidth=parseInt($(window).width());
//var parentHeight=$("#chart").height();
var parentHeight=500;

console.log(parentWidth+" "+parentHeight);

var svgl = d3.select("#linkerSvg");
      //width = +svg.attr("width"),
      //height = +svg.attr("height");

var color = d3.scaleOrdinal(d3.schemeCategory20);

var simulation = d3.forceSimulation()
    .force("link", d3.forceLink().id(function(d) { return d.id; })
                                   .distance(function(d) { return GetDistanceByValue(d.value); }))
    .force("charge", d3.forceManyBody())
    .force("center", d3.forceCenter(parentWidth/2, parentHeight/2));

$("#linkerTitle").text("Relación de palabras para "+" \""+"ciencia"+"\"");
$("#linkerLoader").hide();

function updateSimulation(){
  var w=$("#frase").val();
  if(w==""){
    w="ciencia";
  }
  var text="Relación de palabras para "+" \""+w+"\"";
  $("#linkerTitle").text(text);
  $("#linkerLoader").hide();
  console.log("updateLinker");
  var parentWidth=parseInt($(window).width());
  var parentHeight=500;

  console.log(parentWidth+" "+parentHeight);
  simulation = d3.forceSimulation()
      .force("link", d3.forceLink().id(function(d) { return d.id; })
                                     .distance(function(d) { return GetDistanceByValue(d.value); }))
      .force("charge", d3.forceManyBody())
      .force("center", d3.forceCenter(parentWidth/2, parentHeight/2));

      d3.json("Resources/data.json", function(error, graph) {
        if (error) throw error;

        if(gr!=""){
          graph=gr;
        }

        svgl.selectAll("g").remove();

{'fraction_non_alphanumeric': 0.18475395430579966, 'fraction_numerical': 0.04371704745166959, 'mean_word_length': 2.898116438356164, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1506983', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1558, 'n_words': 304}