<commit_before>var width   = 3800,
    height  = 500,
    margin  = 20,
    pad     = margin / 2,
    radius  = 6,
    yfixed  = pad + radius;

// Legend variables
var legend_x = 0,
    legend_y = 5,
    legend_width = 175,
    legend_height = 620,
    legend_margin = 20
    key_y = 40,
    key_x = 16,
    mapped_y = legend_y + legend_height - 90;

var color = d3.scale.category20();

/**
  * Helper Functions
  */

function addTooltip(circle) {
    // code
}

/**
  * Main
  */

function arcDiagram(graph) {
  var radius = d3.scale.sqrt()
    .domain([0, 20])
    .range([0, 15]);

  var svg = d3.select("#chart").append("svg")
      .attr("id", "arc")
      .attr("width", width)
      .attr("height", height);

  // create plot within svg
  var plot = svg.append("g")
    .attr("id", "plot")
    .attr("transform", "translate(" + pad + ", " + pad + ")");

  // fix graph links to map to objects
  graph.links.forEach(function(d,i) {
    d.source = isNaN(d.source) ? d.source : graph.nodes[d.source];
    d.target = isNaN(d.target) ? d.target : graph.nodes[d.target];
  });

  linearLayout(graph.nodes);
  drawLinks(graph.links);
  drawNodes(graph.nodes);

  //   var legend = svg.append("g")
  //   .attr("class", "legend")
  //   .attr("transform", "translate(" + (width - 50) + "," + (height - 20) + ")")
  // .selectAll("g")
  //   .data([5, 10, 15])
  // .enter().append("g");

  // legend.append("circle")
  //   .attr("cy", function(d) { return -radius(d); })
  //   .attr("r", radius);

  // legend.append("text")
  //   .attr("y", function(d) { return -2 * radius(d); })
  //   .attr("dy", "1.3em")
  //   .text(d3.format(".1s"));

    /* 
     * Legend
     */

    var legend = svg.append("g")
        .attr("class", "legend");
    var key = legend.append("g")

    // Initial
    key.append("circle")
        .attr("id", "legend_initial")
        .attr("cx", legend_x + key_x)
        .attr("cy", legend_y + key_y + 5)
        .attr("r", 5)
        .style("fill", "blue");

    key.append("text")
        .attr("class", "legendText")
        .attr("id", "legend_initial_label")
        .attr("x", legend_x + key_x + 10 )
        .attr("y", legend_y + 10 + key_y )
        .text("Initial");

    // Selection
    key.append("circle")
        .attr("id", "legend_selection")
        .attr("cx", function () { return legend_x + key_x })
        .attr("cy", function () { return legend_y + legend_margin + key_y + 5 })
        .attr("r", 5)
        .style("fill", "lightblue");

    key.append("text")
        .attr("class", "legendText")
        .attr("id", "legend_selection_label")
        .attr("x", legend_x + key_x + 10)
        .attr("y", legend_y + legend_margin + 10 + key_y)
        .text("Selection");

    // Final
    key.append("circle")
        .attr("id", "legend_final")
        .attr("cx", legend_x + key_x)
        .attr("cy", legend_y + 2 * legend_margin + key_y + 5)
        .attr("r", 5)
        .style("fill", "orange");

    key.append("text")
        .attr("class", "legendText")<commit_msg>Minor edit<commit_after>var width   = 3800,
    height  = 500,
    margin  = 20,
    pad     = margin / 2,
    radius  = 6,
    yfixed  = pad + radius;

// Legend variables
var legend_x = 0,
    legend_y = 5,
    legend_width = 175,
    legend_height = 620,
    legend_margin = 20
    key_y = 40,
    key_x = 16,
    mapped_y = legend_y + legend_height - 90;

var color = d3.scale.category20();

/**
  * Helper Functions
  */

function addTooltip(circle) {
    // code
}

/**
  * Main
  */

function arcDiagram(graph) {
  var radius = d3.scale.sqrt()
    .domain([0, 20])
    .range([0, 15]);

  var svg = d3.select("#chart").append("svg")
      .attr("id", "arc")
      .attr("width", width)
      .attr("height", height);

  // create plot within svg
  var plot = svg.append("g")
    .attr("id", "plot")
    .attr("transform", "translate(" + pad + ", " + pad + ")");

  // fix graph links to map to objects
  graph.links.forEach(function(d,i) {
    d.source = isNaN(d.source) ? d.source : graph.nodes[d.source];
    d.target = isNaN(d.target) ? d.target : graph.nodes[d.target];
  });

  linearLayout(graph.nodes);
  drawLinks(graph.links);
  drawNodes(graph.nodes);

  /* 
   * Legend
   */

  var legend = svg.append("g")
      .attr("class", "legend");
  var key = legend.append("g")

  // Initial
  key.append("circle")
      .attr("id", "legend_initial")
      .attr("cx", legend_x + key_x)
      .attr("cy", legend_y + key_y + 5)
      .attr("r", 5)
      .style("fill", "blue");

    key.append("text")
      .attr("class", "legendText")
      .attr("id", "legend_initial_label")
      .attr("x", legend_x + key_x + 10 )
      .attr("y", legend_y + 10 + key_y )
      .text("Initial");

    // Selection
    key.append("circle")
        .attr("id", "legend_selection")
        .attr("cx", function () { return legend_x + key_x })
        .attr("cy", function () { return legend_y + legend_margin + key_y + 5 })
        .attr("r", 5)
        .style("fill", "lightblue");

    key.append("text")
        .attr("class", "legendText")
        .attr("id", "legend_selection_label")
        .attr("x", legend_x + key_x + 10)
        .attr("y", legend_y + legend_margin + 10 + key_y)
        .text("Selection");

    // Final
    key.append("circle")
        .attr("id", "legend_final")
        .attr("cx", legend_x + key_x)
        .attr("cy", legend_y + 2 * legend_margin + key_y + 5)
        .attr("r", 5)
        .style("fill", "orange");

    key.append("text")
        .attr("class", "legendText")
{'fraction_non_alphanumeric': 0.19790348816193748, 'fraction_numerical': 0.021688053497198625, 'mean_word_length': 2.276494967436353, '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': '765816', 'n_tokens_mistral': 2107, 'n_tokens_neox': 1958, 'n_words': 408}