Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds node and edge data #2

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# p2p-cy
p2p simulation framework network visualisation demo using cytoscape
# simple-p2p-d3
p2p simulation framework network visualisation demo using d3

d3 code copy pasted from
https://github.com/significance/p2p-d3

and just adapted to original
https://github.com/zelig/p2p-cy

to replace cytoscape with d3
33 changes: 0 additions & 33 deletions cy-demo.html

This file was deleted.

35 changes: 0 additions & 35 deletions cy.css

This file was deleted.

138 changes: 0 additions & 138 deletions cy.js

This file was deleted.

105 changes: 105 additions & 0 deletions d3-demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>p2p Network Connectivity Graph</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">

<script src="js/lib/jquery-2.2.4.min.js"></script>
<script src="js/lib/d3.v4.min.js"></script>
<script src="js/visuals.js"></script>
<script src="js/network.js"></script>

<script>
$(document).ready(function() {
console.log("loaded");
$('#start-visualisation').on('click',function(){
initializeServer("0");
});
});
</script>

<link rel="stylesheet" href="d3.css">

</head>
<body>
<div class="wrapper">
<h1>p2p Network Connectivity Graph</h1>
<div id="sidebar" class=sidebar>
<div id="selected-node">
<div class="actions">
<button class="inline" id="start-visualisation">Start New Visualisation</button>
<div class="inline elapsed">Time elapsed: <span id="time-elapsed"></span></div>
</div>
<div class="counts">
<h3>Nodes</h1>
<table class="node-counts counts-table">
<thead>
<td>UP</td>
<td>ADD</td>
<td>REMOVE</td>
</thead>
<tbody>
<td id="nodes-up-count"></td>
<td id="nodes-add-count"></td>
<td id="nodes-remove-count"></td>
</tbody>
</table>
</div>

<div class="counts clear">
<h3>Connections</h1>
<table class="edge-counts counts-table">
<thead>
<td>UP</td>
<td>ADD</td>
<td>REMOVE</td>
</thead>
<tbody>
<td id="edges-up-count"></td>
<td id="edges-add-count"></td>
<td id="edges-remove-count"></td>
</tbody>
</table>
</div>

<div class="node-selected">
<div class="node-info">
<h3>Node Information</h1>
<ul>
<li> ID: <span class="node-id"></span> </li>
<li> Database Size: <span class="node-balance"></span> </li>
</ul>

<pre id="kamemlia-text-table" class="fixed-width"> ___ __ ________ ________
|\ \|\ \ |\ __ \|\ ___ \
\ \ \/ /|\ \ \|\ \ \ \_|\ \
\ \ ___ \ \ __ \ \ \ \\ \
\ \ \\ \ \ \ \ \ \ \ \_\\ \
\ \__\\ \__\ \__\ \__\ \_______\
\|__| \|__|\|__|\|__|\|_______|



</pre>

<!-- <table class="node-kademlia-table">
<thead>
<td>Id</td>
<td>IP:Port</td>
<td>Distance</td>
</thead>
<tbody>

</tbody>
</table> -->
</div>
</div>
</div>
</div>
<svg id="network-visualisation" width="780" height="780"></svg>
</div>
</body>
</html>


Loading