@ -1,85 +0,0 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>Network | Social Network</title> | |||||
<style> | |||||
body { | |||||
font: 10pt arial; | |||||
} | |||||
#mynetwork { | |||||
width: 600px; | |||||
height: 600px; | |||||
border: 1px solid lightgray; | |||||
background: #F3F3F3; | |||||
} | |||||
</style> | |||||
<script type="text/javascript" src="../../dist/vis.js"></script> | |||||
<link href="../../dist/vis.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript"> | |||||
var DIR = 'img/soft-scraps-icons/'; | |||||
var nodes = null; | |||||
var edges = null; | |||||
var network = null; | |||||
function draw() { | |||||
// create people | |||||
nodes = [ | |||||
{id: 1, label: 'Algie', image: DIR + 'Smiley-Angry-icon.png', shape: 'image'}, | |||||
{id: 2, label: 'Alston', image: DIR + 'Smiley-Grin-icon.png', shape: 'image'}, | |||||
{id: 3, label: 'Barney', image: DIR + 'User-Administrator-Blue-icon.png', shape: 'image'}, | |||||
{id: 4, label: 'Coley', image: DIR + 'User-Administrator-Green-icon.png', shape: 'image'}, | |||||
{id: 5, label: 'Grant', image: DIR + 'User-Coat-Blue-icon.png', shape: 'image'}, | |||||
{id: 6, label: 'Langdon', image: DIR + 'User-Coat-Green-icon.png', shape: 'image'}, | |||||
{id: 7, label: 'Lee', image: DIR + 'User-Coat-Red-icon.png', shape: 'image'}, | |||||
{id: 8, label: 'Merlin', image: DIR + 'User-Executive-Green-icon.png', shape: 'image'}, | |||||
{id: 9, label: 'Mick', image: DIR + 'User-Preppy-Blue-icon.png', shape: 'image'}, | |||||
{id: 10, label: 'Tod', image: DIR + 'User-Preppy-Red-icon.png', shape: 'image'} | |||||
]; | |||||
// create connections | |||||
var color = '#BFBFBF'; | |||||
edges = [ | |||||
{from: 2, to: 8, value: 3, label: 3, color: color}, | |||||
{from: 2, to: 9, value: 5, label: 5, color: color}, | |||||
{from: 2, to: 10, value: 1, label: 1, color: color}, | |||||
{from: 4, to: 6, value: 8, label: 8, color: color}, | |||||
{from: 5, to: 7, value: 2, label: 2, color: color}, | |||||
{from: 4, to: 5, value: 1, label: 1, color: color}, | |||||
{from: 9, to: 10, value: 2, label: 2, color: color}, | |||||
{from: 2, to: 3, value: 6, label: 6, color: color}, | |||||
{from: 3, to: 9, value: 4, label: 4, color: color}, | |||||
{from: 5, to: 3, value: 1, label: 1, color: color}, | |||||
{from: 2, to: 7, value: 4, label: 4, color: color} | |||||
]; | |||||
// create a network | |||||
var container = document.getElementById('mynetwork'); | |||||
var data = { | |||||
nodes: nodes, | |||||
edges: edges | |||||
}; | |||||
var options = { | |||||
physics: {stabilization: false} | |||||
}; | |||||
network = new vis.Network(container, data, options); | |||||
} | |||||
</script> | |||||
<script src="../googleAnalytics.js"></script> | |||||
</head> | |||||
<body onload="draw()"> | |||||
<p> | |||||
Create a social network showing the amount of interaction between people. | |||||
</p> | |||||
<div id="mynetwork"></div> | |||||
<p> | |||||
Icons: <a href="http://www.deleket.com/" target="_blank">Scrap Icons by Deleket</a> | |||||
</p> | |||||
<div id="info"></div> | |||||
</body> | |||||
</html> |
@ -0,0 +1,86 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>Network | Sizing</title> | |||||
<style type="text/css"> | |||||
html, body { | |||||
font: 10pt arial; | |||||
} | |||||
#mynetwork { | |||||
width: 600px; | |||||
height: 600px; | |||||
border: 1px solid lightgray; | |||||
} | |||||
</style> | |||||
<script type="text/javascript" src="../../../../dist/vis.js"></script> | |||||
<link href="../../../../dist/vis.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript"> | |||||
var nodes = null; | |||||
var edges = null; | |||||
var network = null; | |||||
function draw() { | |||||
// create people. | |||||
// value corresponds with the age of the person | |||||
nodes = [ | |||||
{id: 1, value: 2, label: 'Algie' }, | |||||
{id: 2, value: 31, label: 'Alston'}, | |||||
{id: 3, value: 12, label: 'Barney'}, | |||||
{id: 4, value: 16, label: 'Coley' }, | |||||
{id: 5, value: 17, label: 'Grant' }, | |||||
{id: 6, value: 15, label: 'Langdon'}, | |||||
{id: 7, value: 6, label: 'Lee'}, | |||||
{id: 8, value: 5, label: 'Merlin'}, | |||||
{id: 9, value: 30, label: 'Mick'}, | |||||
{id: 10, value: 18, label: 'Tod'}, | |||||
]; | |||||
// create connections between people | |||||
// value corresponds with the amount of contact between two people | |||||
edges = [ | |||||
{from: 2, to: 8, value: 3}, | |||||
{from: 2, to: 9, value: 5}, | |||||
{from: 2, to: 10,value: 1}, | |||||
{from: 4, to: 6, value: 8}, | |||||
{from: 5, to: 7, value: 2}, | |||||
{from: 4, to: 5, value: 1}, | |||||
{from: 9, to: 10,value: 2}, | |||||
{from: 2, to: 3, value: 6}, | |||||
{from: 3, to: 9, value: 4}, | |||||
{from: 5, to: 3, value: 1}, | |||||
{from: 2, to: 7, value: 4} | |||||
]; | |||||
// Instantiate our network object. | |||||
var container = document.getElementById('mynetwork'); | |||||
var data = { | |||||
nodes: nodes, | |||||
edges: edges | |||||
}; | |||||
var options = { | |||||
nodes: { | |||||
shape: 'dot', | |||||
scaling: { | |||||
customScalingFunction: function (min,max,total,value) { | |||||
return value/total; | |||||
}, | |||||
min:5, | |||||
max:150 | |||||
} | |||||
} | |||||
}; | |||||
network = new vis.Network(container, data, options); | |||||
} | |||||
</script> | |||||
<script src="../../../googleAnalytics.js"></script> | |||||
</head> | |||||
<body onload="draw()"> | |||||
<p> | |||||
Scale nodes and edges depending on their value. Hover over nodes and edges to get more information. | |||||
</p> | |||||
<div id="mynetwork"></div> | |||||
</body> | |||||
</html> |
@ -0,0 +1,85 @@ | |||||
<!doctype html> | |||||
<html> | |||||
<head> | |||||
<title>Network | Sizing</title> | |||||
<style type="text/css"> | |||||
html, body { | |||||
font: 10pt arial; | |||||
} | |||||
#mynetwork { | |||||
width: 600px; | |||||
height: 600px; | |||||
border: 1px solid lightgray; | |||||
} | |||||
</style> | |||||
<script type="text/javascript" src="../../../../dist/vis.js"></script> | |||||
<link href="../../../../dist/vis.css" rel="stylesheet" type="text/css" /> | |||||
<script type="text/javascript"> | |||||
var nodes = null; | |||||
var edges = null; | |||||
var network = null; | |||||
function draw() { | |||||
// create people. | |||||
// value corresponds with the age of the person | |||||
nodes = [ | |||||
{id: 1, value: 2, label: 'Algie' }, | |||||
{id: 2, value: 31, label: 'Alston'}, | |||||
{id: 3, value: 12, label: 'Barney'}, | |||||
{id: 4, value: 16, label: 'Coley' }, | |||||
{id: 5, value: 17, label: 'Grant' }, | |||||
{id: 6, value: 15, label: 'Langdon'}, | |||||
{id: 7, value: 6, label: 'Lee'}, | |||||
{id: 8, value: 5, label: 'Merlin'}, | |||||
{id: 9, value: 30, label: 'Mick'}, | |||||
{id: 10, value: 18, label: 'Tod'}, | |||||
]; | |||||
// create connections between people | |||||
// value corresponds with the amount of contact between two people | |||||
edges = [ | |||||
{from: 2, to: 8, value: 3, title: '3 emails per week'}, | |||||
{from: 2, to: 9, value: 5, title: '5 emails per week'}, | |||||
{from: 2, to: 10,value: 1, title: '1 emails per week'}, | |||||
{from: 4, to: 6, value: 8, title: '8 emails per week'}, | |||||
{from: 5, to: 7, value: 2, title: '2 emails per week'}, | |||||
{from: 4, to: 5, value: 1, title: '1 emails per week'}, | |||||
{from: 9, to: 10,value: 2, title: '2 emails per week'}, | |||||
{from: 2, to: 3, value: 6, title: '6 emails per week'}, | |||||
{from: 3, to: 9, value: 4, title: '4 emails per week'}, | |||||
{from: 5, to: 3, value: 1, title: '1 emails per week'}, | |||||
{from: 2, to: 7, value: 4, title: '4 emails per week'} | |||||
]; | |||||
// Instantiate our network object. | |||||
var container = document.getElementById('mynetwork'); | |||||
var data = { | |||||
nodes: nodes, | |||||
edges: edges | |||||
}; | |||||
var options = { | |||||
nodes: { | |||||
shape: 'dot', | |||||
scaling:{ | |||||
label: { | |||||
min:8, | |||||
max:20 | |||||
} | |||||
} | |||||
} | |||||
}; | |||||
network = new vis.Network(container, data, options); | |||||
} | |||||
</script> | |||||
<script src="../../../googleAnalytics.js"></script> | |||||
</head> | |||||
<body onload="draw()"> | |||||
<p> | |||||
Scale nodes and edges depending on their value. Hover over edges to get a popup with more information. | |||||
</p> | |||||
<div id="mynetwork"></div> | |||||
</body> | |||||
</html> |