<commit_before><html title="sankey">

<style>
.node rect {
  cursor: move;
  fill-opacity: .9;
  shape-rendering: crispEdges;
}
.node text {
  pointer-events: none;
  text-shadow: 0 1px 0 #fff;
}
.link {
  fill: none;
  stroke: #000;
  stroke-opacity: .2;
}
.link:hover {
  stroke-opacity: .5;
}
</style>
<title>2001relevant-2.3.2-10k</title>
<body>
<p id="chart">
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/d3/d3-plugins/master/sankey/sankey.js"></script>
<script>
var units = "Messages";

var margin = {top: 10, right: 10, bottom: 10, left: 10},
    width = 1400 - margin.left - margin.right,
    height = 800 - margin.top - margin.bottom;

var formatNumber = d3.format(",.0f"),    // zero decimal places
    format = function(d) { return formatNumber(d) + " " + units; },
    color = d3.scale.category20();

// append the svg canvas to the page
var svg = d3.select("#chart").append("svg")
    .attr("width", width + margin.left + margin.right)
    .attr("height", height + margin.top + margin.bottom)
  .append("g")
    .attr("transform", 
          "translate(" + margin.left + "," + margin.top + ")");

// Set the sankey diagram properties
var sankey = d3.sankey()
    .nodeWidth(36)
    .nodePadding(40)
    .size([width, height]);

var path = sankey.link();

graph = JSON.parse('{"nodes":[{"name":"52"},{"name":"4"},{"name":"5"},{"name":"2"},{"name":"3"},{"name":"8"},{"name":"9"},{"name":"6"},{"name":"7"},{"name":"26"},{"name":"17"},{"name":"16"},{"name":"19"},{"name":"18"},{"name":"20"},{"name":"21"},{"name":"22"},{"name":"23"},{"name":"14"},{"name":"24"},{"name":"15"},{"name":"13"},{"name":"11"},{"name":"12"},{"name":"10"},{"name":"1"}],"links":[{"source":9,"value":21,"target":15},{"source":9,"value":19,"target":12},{"source":9,"value":26,"target":14},{"source":9,"value":16,"target":20},{"source":9,"value":18,"target":19},{"source":9,"value":23,"target":11},{"source":9,"value":25,"target":17},{"source":9,"value":26,"target":10},{"source":9,"value":27,"target":16},{"source":9,"value":14,"target":13},{"source":9,"value":14,"target":21},{"source":9,"value":21,"target":18},{"source":0,"value":310,"target":23},{"source":0,"value":282,"target":24},{"source":0,"value":277,"target":22},{"source":0,"value":277,"target":3},{"source":0,"value":282,"target":25},{"source":0,"value":285,"target":1},{"source":0,"value":278,"target":4},{"source":0,"value":269,"target":6},{"source":0,"value":266,"target":7},{"source":0,"value":283,"target":2},{"source":0,"value":253,"target":5},{"source":0,"value":281,"target":8}]}');

  sankey
      .nodes(graph.nodes)
      .links(graph.links)
      .layout(32);

// add in the links
  var link = svg.append("g").selectAll(".link")
      .data(graph.links)
    .enter().append("path")
      .attr("class", "link")
      .attr("d", path)
      .style("stroke-width", function(d) { return Math.max(1, d.dy); })
      .sort(function(a, b) { return b.dy - a.dy; });

// add the link titles
  link.append("title")
        .text(function(d) {
            return d.source.name + " → " + 
                d.target.name + "\n" + format(d.value); });

// add in the nodes
  var node = svg.append("g").selectAll(".node")
      .data(graph.nodes)<commit_msg>put fix for new naming scheme<commit_after><html title="sankey">

<style>
.node rect {
  cursor: move;
  fill-opacity: .9;
  shape-rendering: crispEdges;
}
.node text {
  pointer-events: none;
  text-shadow: 0 1px 0 #fff;
}
.link {
  fill: none;
  stroke: #000;
  stroke-opacity: .2;
}
.link:hover {
  stroke-opacity: .5;
}
</style>
<title>2001relevant-2.3.2-10k</title>
<body>
<p id="chart">
<script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/d3/d3-plugins/master/sankey/sankey.js"></script>
<script>
var units = "Messages";

var margin = {top: 10, right: 10, bottom: 10, left: 10},
    width = 1400 - margin.left - margin.right,
    height = 800 - margin.top - margin.bottom;

var formatNumber = d3.format(",.0f"),    // zero decimal places
    format = function(d) { return formatNumber(d) + " " + units; },
    color = d3.scale.category20();

// append the svg canvas to the page
var svg = d3.select("#chart").append("svg")
    .attr("width", width + margin.left + margin.right)
    .attr("height", height + margin.top + margin.bottom)
  .append("g")
    .attr("transform", 
          "translate(" + margin.left + "," + margin.top + ")");

// Set the sankey diagram properties
var sankey = d3.sankey()
    .nodeWidth(36)
    .nodePadding(40)
    .size([width, height]);

var path = sankey.link();

graph = JSON.parse('{"nodes":[{"name":"52"},{"name":"4"},{"name":"5"},{"name":"2"},{"name":"3"},{"name":"8"},{"name":"9"},{"name":"6"},{"name":"7"},{"name":"26"},{"name":"17"},{"name":"16"},{"name":"19"},{"name":"18"},{"name":"20"},{"name":"21"},{"name":"22"},{"name":"23"},{"name":"14"},{"name":"24"},{"name":"15"},{"name":"13"},{"name":"11"},{"name":"12"},{"name":"10"},{"name":"1"}],"links":[{"source":9,"value":21,"target":15},{"source":9,"value":19,"target":12},{"source":9,"value":26,"target":14},{"source":9,"value":16,"target":20},{"source":9,"value":18,"target":19},{"source":9,"value":23,"target":11},{"source":9,"value":25,"target":17},{"source":9,"value":26,"target":10},{"source":9,"value":27,"target":16},{"source":9,"value":14,"target":13},{"source":9,"value":14,"target":21},{"source":9,"value":21,"target":18},{"source":0,"value":310,"target":23},{"source":0,"value":282,"target":24},{"source":0,"value":277,"target":22},{"source":0,"value":277,"target":3},{"source":0,"value":282,"target":25},{"source":0,"value":285,"target":1},{"source":0,"value":278,"target":4},{"source":0,"value":269,"target":6},{"source":0,"value":266,"target":7},{"source":0,"value":283,"target":2},{"source":0,"value":253,"target":5},{"source":0,"value":281,"target":8}]}');

/************************** Workaround ***************************
  The Sankey.js file expects the "source" and "target" values of the links array, to refer to the respective index of the nodes array. We
  store not indices, but names for the source and target values. The following lines replace these names with their respective index values
  and overrides the values of the links-array in the graph struct afterwards.
*/

// convert links map into
var nameToIndexMap = {};
var nodes = graph.nodes;
for (var i=0; i < nodes.length; i++) {
  nameToIndexMap[nodes[i]["name"]] = i;
}
// now, in the links array, replace all names with their respective index value from the nodes array
var links = graph.links;
for (var i=0; i < links.length; i++) {
  sourceId = links[i]["source"];
  targetId = links[i]["target"];
  links[i]["source"] = nameToIndexMap[sourceId] // example: the map maps name->1
  links[i]["target"] = nameToIndexMap[targetId]
}
graph.links = links // override original
/************************** Workaround ****************************/


  sankey
      .nodes(graph.nodes)
      .links(graph.links)
      .layout(32);

// add in the links
  var link = svg.append("g").selectAll(".link")
      .data(graph.links)
    .enter().append("path")
      .attr("class", "link")
      .attr("d", path)
      .style("stroke-width", function(d) { return Math.max(1, d.dy); })
      .sort(function(a, b) { return b.dy - a.dy; });

// add the link titles
  link.append("title")
        .text(function(d) {
            return d.source.name + " → " + 
                d.target.name + "\n" + format(d.value); });

// add in the nodes
  var node = svg.append("g").selectAll(".node")
      .data(graph.nodes)
{'fraction_non_alphanumeric': 0.2772406584792265, 'fraction_numerical': 0.057616932322968384, 'mean_word_length': 5.128903122497999, 'pattern_counts': {'":': 200, '<': 29, '<?xml version=': 0, '>': 28, 'https://': 2, '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': '6189961', 'n_tokens_mistral': 2864, 'n_tokens_neox': 2649, 'n_words': 450}