<commit_before><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Network Graph</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="<NAME>">
<script type="text/javascript" src="/javascripts/d3.v3.js.pagespeed.ce.dFNRrGTALe.js"></script>
<style>
body{
    font-family:"Helvetica Neue",Arial,sans-serif;
    font-size:.95em;
    font-weight:bold;
    padding:2em
}
.pacticpantLabel {
    cursor: default
 }
 .relationship {
    cursor: pointer;
 }
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- developed by <NAME> - hypothete.com -->
</head>
<body>
<h1>Network graph of <%= pacticipant_name %> relationships</h1>
<script type="text/javascript">
var windowWidth, windowHeight, svg;

var enlargeCanvasToFit = function (radius) {
    //Make SVG canvas bigger if it won't fit
    if (3 * radius > windowWidth) {
        windowWidth = 3 * radius;
        svg.attr("width", windowWidth);
    }
    if (3.5 * radius > windowHeight) {
        windowHeight = 3.5 * radius;
        svg.attr("height", windowHeight);
    }
};

var parseCSV = function (data) {
    var pacticipants = [];
    data.forEach(
        function(row) {
            var pacticipant = {
                id: row[0],
                pacticipantName: row[1],
                order: parseInt(row[5]),
                connectedPacticipantIds: row.slice(6).filter(function(e) {
                    if (parseInt(e) != NaN && parseInt(e) > 0) {
                        return e;
                    }
                })
            };

            pacticipants.push(pacticipant);
        });
    pacticipants.sort(function(a, b) {
        return d3.ascending(a.order, b.order);
    });
    return pacticipants;
};

var getPacticipantNames = function (pacticipants) {
    return pacticipants.map(function(p){ return p.pacticipantName });
};

var relationshipPath = function(relationship, nodeLocations, pacticipants) {
    var dx = nodeLocations[relationship.endId].x - nodeLocations[relationship.startId].x;
    var dy = nodeLocations[relationship.endId].y - nodeLocations[relationship.startId].y;
    var dr = Math.sqrt(dx * dx + dy * dy);
    var inout = 1;

    var indexOfEndGreaterThanIndexOfStart = nodeLocations[relationship.endId].i > nodeLocations[relationship.startId].i;
    var differenceBetweenStartAndEndIndexes = Math.abs(nodeLocations[relationship.endId].i - nodeLocations[relationship.startId].i);
    var indexOfEndLessThanIndexOfStart = nodeLocations[relationship.endId].i < nodeLocations[relationship.startId].i

    if ((indexOfEndGreaterThanIndexOfStart && differenceBetweenStartAndEndIndexes <= pacticipants.length / 2) || (indexOfEndLessThanIndexOfStart && differenceBetweenStartAndEndIndexes > pacticipants.length / 2)) {
        inout = 0;
    }
    return "M" + 0 + "," + 0 + "A" + dr + ", " + dr + " 0 0," + inout + " " + dx + "," + dy;
};

var latestPactUrl = function (consumerName, providerName) {
    //TODO send this with the relationship data
    return 'http://localhost:9292/pacts/provider/' + providerName + '/consumer/' + consumerName + '/latest';
};

var relationshipData = function(pacticipant, relationships) {
    var relationshipsInvolvingPacticipant = [];
    var relationshipLinks = [];
    relationships.forEach(function(relationship) {
        var dummyRelationship = {};
        dummyRelationship.id = relationship.id;
        if (relationship.consumerId == pacticipant.id) {
            dummyRelationship.startId = relationship.consumerId;
            dummyRelationship.endId = relationship.providerId;
            if (relationship.relationshipType) {
                dummyRelationship.relationshipType = relationship.relationshipType;
            } else {
                dummyRelationship.relationshipType = 'consumer';
            }
            dummyRelationship.href = relationship.href;
            relationshipsInvolvingPacticipant.push(dummyRelationship);
            var relationshipLink = {};
            relationshipLink.startId = relationship.consumerId;
            relationshipLink.endId = relationship.providerId;
            relationshipLink.relationshipType = 'link';
            relationshipLink.href = relationship.href;
            relationshipLink.id = relationship.id;
            relationshipLinks.push(relationshipLink);
        }
        else if (relationship.providerId == pacticipant.id) {
            dummyRelationship.startId = relationship.providerId;
            dummyRelationship.endId = relationship.consumerId;<commit_msg>Fixed pact URL<commit_after><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Network Graph</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="<NAME>">
<script type="text/javascript" src="/javascripts/d3.v3.js.pagespeed.ce.dFNRrGTALe.js"></script>
<style>
body{
    font-family:"Helvetica Neue",Arial,sans-serif;
    font-size:.95em;
    font-weight:bold;
    padding:2em
}
.pacticpantLabel {
    cursor: default
 }
 .relationship {
    cursor: pointer;
 }
</style>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- developed by <NAME> - hypothete.com -->
</head>
<body>
<h1>Network graph of <%= pacticipant_name %> relationships</h1>
<script type="text/javascript">
var windowWidth, windowHeight, svg;

var enlargeCanvasToFit = function (radius) {
    //Make SVG canvas bigger if it won't fit
    if (3 * radius > windowWidth) {
        windowWidth = 3 * radius;
        svg.attr("width", windowWidth);
    }
    if (3.5 * radius > windowHeight) {
        windowHeight = 3.5 * radius;
        svg.attr("height", windowHeight);
    }
};

var parseCSV = function (data) {
    var pacticipants = [];
    data.forEach(
        function(row) {
            var pacticipant = {
                id: row[0],
                pacticipantName: row[1],
                order: parseInt(row[5]),
                connectedPacticipantIds: row.slice(6).filter(function(e) {
                    if (parseInt(e) != NaN && parseInt(e) > 0) {
                        return e;
                    }
                })
            };

            pacticipants.push(pacticipant);
        });
    pacticipants.sort(function(a, b) {
        return d3.ascending(a.order, b.order);
    });
    return pacticipants;
};

var getPacticipantNames = function (pacticipants) {
    return pacticipants.map(function(p){ return p.pacticipantName });
};

var relationshipPath = function(relationship, nodeLocations, pacticipants) {
    var dx = nodeLocations[relationship.endId].x - nodeLocations[relationship.startId].x;
    var dy = nodeLocations[relationship.endId].y - nodeLocations[relationship.startId].y;
    var dr = Math.sqrt(dx * dx + dy * dy);
    var inout = 1;

    var indexOfEndGreaterThanIndexOfStart = nodeLocations[relationship.endId].i > nodeLocations[relationship.startId].i;
    var differenceBetweenStartAndEndIndexes = Math.abs(nodeLocations[relationship.endId].i - nodeLocations[relationship.startId].i);
    var indexOfEndLessThanIndexOfStart = nodeLocations[relationship.endId].i < nodeLocations[relationship.startId].i

    if ((indexOfEndGreaterThanIndexOfStart && differenceBetweenStartAndEndIndexes <= pacticipants.length / 2) || (indexOfEndLessThanIndexOfStart && differenceBetweenStartAndEndIndexes > pacticipants.length / 2)) {
        inout = 0;
    }
    return "M" + 0 + "," + 0 + "A" + dr + ", " + dr + " 0 0," + inout + " " + dx + "," + dy;
};

var latestPactUrl = function (consumerName, providerName) {
    //TODO send this with the relationship data
    return '/pacts/provider/' + providerName + '/consumer/' + consumerName + '/latest';
};

var relationshipData = function(pacticipant, relationships) {
    var relationshipsInvolvingPacticipant = [];
    var relationshipLinks = [];
    relationships.forEach(function(relationship) {
        var dummyRelationship = {};
        dummyRelationship.id = relationship.id;
        if (relationship.consumerId == pacticipant.id) {
            dummyRelationship.startId = relationship.consumerId;
            dummyRelationship.endId = relationship.providerId;
            if (relationship.relationshipType) {
                dummyRelationship.relationshipType = relationship.relationshipType;
            } else {
                dummyRelationship.relationshipType = 'consumer';
            }
            dummyRelationship.href = relationship.href;
            relationshipsInvolvingPacticipant.push(dummyRelationship);
            var relationshipLink = {};
            relationshipLink.startId = relationship.consumerId;
            relationshipLink.endId = relationship.providerId;
            relationshipLink.relationshipType = 'link';
            relationshipLink.href = relationship.href;
            relationshipLink.id = relationship.id;
            relationshipLinks.push(relationshipLink);
        }
        else if (relationship.providerId == pacticipant.id) {
            dummyRelationship.startId = relationship.providerId;
            dummyRelationship.endId = relationship.consumerId;
{'fraction_non_alphanumeric': 0.12595907928388747, 'fraction_numerical': 0.008312020460358057, 'mean_word_length': 2.9449348465741907, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 67, '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': '3216671', 'n_tokens_mistral': 2861, 'n_tokens_neox': 2680, 'n_words': 531}