GUIDE
- Left-click and drag the background to move the graph
- Left-click and drag the nodes to reorganize
- Left-click a node to view first level connections
- Double left-click a node to navigate to its page
- Double left-click the background to zoom in
- Right-click the background to zoom out
sigma.utils.pkg('sigma.canvas.nodes');
sigma.canvas.nodes.image = (function() {
var _cache = {},
_loading = {},
_callbacks = {};
// Return the renderer itself:
var renderer = function(node, context, settings) {
var args = arguments,
prefix = settings('prefix') || '',
size = node[prefix + 'size'],
color = node.color || settings('defaultNodeColor'),
url = node.url;
if (_cache[url]) {
context.save();
// Draw the clipping disc:
context.beginPath();
context.arc(
node[prefix + 'x'],
node[prefix + 'y'],
node[prefix + 'size'],
0,
Math.PI * 2,
true
);
context.closePath();
context.clip();
// Draw the image
context.drawImage(
_cache[url],
node[prefix + 'x'] - size,
node[prefix + 'y'] - size,
2 * size,
2 * size
);
// Quit the "clipping mode":
context.restore();
// Draw the border:
context.beginPath();
context.arc(
node[prefix + 'x'],
node[prefix + 'y'],
node[prefix + 'size'],
0,
Math.PI * 2,
true
);
context.lineWidth = 1;
context.strokeStyle = node.color || settings('defaultNodeColor');
context.stroke();
} else {
sigma.canvas.nodes.image.cache(url);
sigma.canvas.nodes.def.apply(
sigma.canvas.nodes,
args
);
}
};
// Let's add a public method to cache images, to make it possible to
// preload images before the initial rendering:
renderer.cache = function(url, callback) {
if (callback)
_callbacks[url] = callback;
if (_loading[url])
return;
var img = new Image();
img.onload = function() {
_loading[url] = false;
_cache[url] = img;
if (_callbacks[url]) {
_callbacks[url].call(this, img);
delete _callbacks[url];
}
};
_loading[url] = true;
img.src = url;
};
return renderer;
})();
var i,
s,
o,
offset_left = 0.5,
N = 1,
E = 40,
C = 5,
d = 0.5,
cs = [],
g = {
nodes: [],
edges: []
};
if (!sigma.classes.graph.hasMethod('neighbors')){
sigma.classes.graph.addMethod('neighbors', function(nodeId) {
var k,
neighbors = {},
index = this.allNeighborsIndex[nodeId] || {};
for (k in index)
neighbors[k] = this.nodesIndex[k];
return neighbors;
});
}
//adding the central node
g.nodes.push({
id: 3976,
label: 'Perrine Parize',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-perrine-p1-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=8
// adding node
var x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
g.nodes.push({
id: 228453,
label: 'COURSE: International course on Surveillance and Control of Rabies Zimbabwe – 2 to 12 December 2024',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/course/international-course-on-surveillance-and-control-of-rabieszimbabwe-2-to-12-december-2024/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 3976228453,
size: 0.5,
source: 3976,
target: 228453,
});
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 3977,
label: 'Hervé Bourhy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig50-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/herve-bourhy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2284533977,
size: 0.5,
source: 228453,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2284533976,
size: 0.5,
source: 228453,
target: 3976 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 87539,
label: 'Malika Jellaoui',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-mj2-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/malika-jellaoui/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 22845387539,
size: 0.5,
source: 228453,
target: 87539 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 198678,
label: 'Katherine Worsley-Tonks',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/katherine-worsley-tonks/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 228453198678,
size: 0.5,
source: 228453,
target: 198678 });
// adding node
var x_node = Math.cos(2 * 1 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 1 * Math.PI / N) * 10;
g.nodes.push({
id: 211546,
label: 'PROJECT: Rabies Control and Elimination (RACE) in Cameroon',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/race/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 3976211546,
size: 0.5,
source: 3976,
target: 211546,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2115463977,
size: 0.5,
source: 211546,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 198678) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 211546198678,
size: 0.5,
source: 211546,
target: 198678 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2115463976,
size: 0.5,
source: 211546,
target: 3976 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 87539) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 21154687539,
size: 0.5,
source: 211546,
target: 87539 });
// adding node
var x_node = Math.cos(2 * 2 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 2 * Math.PI / N) * 10;
g.nodes.push({
id: 184772,
label: 'COURSE: Rabies MOOC',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/08/research_pasteur-rabies-mooc-mooc-rabies-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/course/rabies-mooc/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 3976184772,
size: 0.5,
source: 3976,
target: 184772,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1847723977,
size: 0.5,
source: 184772,
target: 3977 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4900,
label: 'Noël Tordo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig58-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/noel-tordo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1847724900,
size: 0.5,
source: 184772,
target: 4900 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 42508,
label: 'Guilherme Dias de Melo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research_pasteur-guilherme-dias-de-melo-photo-pour-profil-prix-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/guilherme-dias-de-melo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 18477242508,
size: 0.5,
source: 184772,
target: 42508 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1847723976,
size: 0.5,
source: 184772,
target: 3976 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 3978,
label: 'Cécile Troupin',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/cecile-troupin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1847723978,
size: 0.5,
source: 184772,
target: 3978 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 7063,
label: 'Monica Sala',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-monica-sala-research-pasteur-monica-sala-monicaphoto2020-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/monica-sala/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1847727063,
size: 0.5,
source: 184772,
target: 7063 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 6816,
label: 'Clementine Schilte',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-clementine-schilte-photo-2022-scaled-e1692277761405-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/clementine-schilte/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1847726816,
size: 0.5,
source: 184772,
target: 6816 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 917,
label: 'Odile Sismeiro',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/OdileSismeiro-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/odile-sismeiro/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 184772917,
size: 0.5,
source: 184772,
target: 917 });
// adding node
var x_node = Math.cos(2 * 3 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 3 * Math.PI / N) * 10;
g.nodes.push({
id: 173800,
label: 'COURSE: International course on surveillance and control of rabies',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/course/international-course-on-surveillance-and-control-of-rabies/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 3976173800,
size: 0.5,
source: 3976,
target: 173800,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1738003977,
size: 0.5,
source: 173800,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1738003976,
size: 0.5,
source: 173800,
target: 3976 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 3975,
label: 'Laurent Dacheux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/06/research_pasteur-dsc5234-e1498809574771-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/laurent-dacheux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1738003975,
size: 0.5,
source: 173800,
target: 3975 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 87539) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 17380087539,
size: 0.5,
source: 173800,
target: 87539 });
// adding node
var x_node = Math.cos(2 * 4 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 4 * Math.PI / N) * 10;
g.nodes.push({
id: 19909,
label: 'PROJECT: General Objectives of the Unit Lyssavirus Dynamics and Host adaptation',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/lyssavirus-dynamics-and-host-adaptation/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 397619909,
size: 0.5,
source: 3976,
target: 19909,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199093977,
size: 0.5,
source: 19909,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3975) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199093975,
size: 0.5,
source: 19909,
target: 3975 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 8314,
label: 'Pascal Cozette',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=8314',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 199098314,
size: 0.5,
source: 19909,
target: 8314 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 3981,
label: 'Florence Larrous',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/06/research_pasteur-photo-flo-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florence-larrous/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 199093981,
size: 0.5,
source: 19909,
target: 3981 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 88599,
label: 'Simon Bonas',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/06/research_pasteur-simon-1--150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-simon-bonas/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1990988599,
size: 0.5,
source: 19909,
target: 88599 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199093976,
size: 0.5,
source: 19909,
target: 3976 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 7783,
label: 'Lauriane Kergoat',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/07/research_pasteur-photo-site-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lauriane-kergoat/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 199097783,
size: 0.5,
source: 19909,
target: 7783 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 42508) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1990942508,
size: 0.5,
source: 19909,
target: 42508 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 120614,
label: 'Lena Feige',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/01/research_pasteur-lena-img_20190106_1013061-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lena-feige/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 19909120614,
size: 0.5,
source: 19909,
target: 120614 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 107778,
label: 'Wahiba Aouadi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/04/research_pasteur-photo-salon-du-laboratoire-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-wahiba-aouadi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 19909107778,
size: 0.5,
source: 19909,
target: 107778 });
// adding node
var x_node = Math.cos(2 * 5 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 5 * Math.PI / N) * 10;
g.nodes.push({
id: 141170,
label: 'PROJECT: International workshops on rabies diagnosis',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/international-workshops-on-rabies-diagnosis/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 3976141170,
size: 0.5,
source: 3976,
target: 141170,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1411703977,
size: 0.5,
source: 141170,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8314) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1411708314,
size: 0.5,
source: 141170,
target: 8314 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1411703976,
size: 0.5,
source: 141170,
target: 3976 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 87539) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 14117087539,
size: 0.5,
source: 141170,
target: 87539 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3975) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1411703975,
size: 0.5,
source: 141170,
target: 3975 });
// adding node
var x_node = Math.cos(2 * 6 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 6 * Math.PI / N) * 10;
g.nodes.push({
id: 27262,
label: 'NRC: Rabies',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_lyssavirus-dynamics-and-host-adaptation-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/nrc/rabies/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 397627262,
size: 0.5,
source: 3976,
target: 27262,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7783) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 272627783,
size: 0.5,
source: 27262,
target: 7783 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3981) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 272623981,
size: 0.5,
source: 27262,
target: 3981 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 87539) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2726287539,
size: 0.5,
source: 27262,
target: 87539 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 165290,
label: 'Julien Lannoy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-julien-lannoy-photo-julien-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/julien-lannoy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 27262165290,
size: 0.5,
source: 27262,
target: 165290 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 156790,
label: 'Aurélien Gibaud',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/aurelien-gibaud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 27262156790,
size: 0.5,
source: 27262,
target: 156790 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 272623977,
size: 0.5,
source: 27262,
target: 3977 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 272623976,
size: 0.5,
source: 27262,
target: 3976 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 182053,
label: 'Said Mougari',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/06/research_pasteur-said-mougari-mougari-said-7514-e1721127271732-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/said-mougari/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 27262182053,
size: 0.5,
source: 27262,
target: 182053 });
// adding node
var x_node = Math.cos(2 * 7 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 7 * Math.PI / N) * 10;
g.nodes.push({
id: 6180,
label: 'TEAM: Lyssavirus epidemiology and neuropathology',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_lyssavirus-dynamics-and-host-adaptation-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/lyssavirus-epidemiology-and-neuropathology/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 39766180,
size: 0.5,
source: 3976,
target: 6180,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3981) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61803981,
size: 0.5,
source: 6180,
target: 3981 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3976) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61803976,
size: 0.5,
source: 6180,
target: 3976 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 87539) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 618087539,
size: 0.5,
source: 6180,
target: 87539 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7783) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61807783,
size: 0.5,
source: 6180,
target: 7783 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 42508) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 618042508,
size: 0.5,
source: 6180,
target: 42508 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 165290) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6180165290,
size: 0.5,
source: 6180,
target: 165290 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 165385,
label: 'Seonhee Kim',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-seonhee-kim-photo-seonhee-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/seonhee-kim/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180165385,
size: 0.5,
source: 6180,
target: 165385 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 173805,
label: 'Juliette Perrot',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/juliette-perrot/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180173805,
size: 0.5,
source: 6180,
target: 173805 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 173823,
label: 'Marilys Castet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-marilys-castet-marilys-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marilys-castet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180173823,
size: 0.5,
source: 6180,
target: 173823 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 198678) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6180198678,
size: 0.5,
source: 6180,
target: 198678 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 212348,
label: 'Anthony Coleon',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/anthony-coleon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180212348,
size: 0.5,
source: 6180,
target: 212348 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 156790) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6180156790,
size: 0.5,
source: 6180,
target: 156790 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 182053) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6180182053,
size: 0.5,
source: 6180,
target: 182053 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4922,
label: 'Sandie Munier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_sandiemunier-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sandie-munier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61804922,
size: 0.5,
source: 6180,
target: 4922 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3977) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61803977,
size: 0.5,
source: 6180,
target: 3977 });
var s = new sigma({
//container: document.getElementById('graph-main'),
graph: g,
renderer: {
// IMPORTANT:
// This works only with the canvas renderer, so the
// renderer type set as "canvas" is necessary here.
container: document.getElementById('graph-main'),
type: 'canvas'
},
settings: {
minNodeSize: 6,
maxNodeSize: 35,
mouseWheelEnabled: false,
font: 'Montserrat',
labelThreshold:25,
borderSize:1,
defaultNodeBorderColor: '#999',
sideMargin:25,
}
});
// We first need to save the original colors of our
// nodes and edges, like this:
s.graph.nodes().forEach(function(n) {
n.originalColor = n.color;
});
s.graph.edges().forEach(function(e) {
e.originalColor = e.color;
});
// When a node is clicked, we check for each node
// if it is a neighbor of the clicked one. If not,
// we set its color as grey, and else, it takes its
// original color.
// We do the same for the edges, and we only keep
// edges that have both extremities colored.
s.bind('clickNode', function(e) {
var nodeId = e.data.node.id,
toKeep = s.graph.neighbors(nodeId);
toKeep[nodeId] = e.data.node;
s.graph.nodes().forEach(function(n) {
if (toKeep[n.id])
n.color = '#35a9f5';
else
n.color = '#dddddd';
});
s.graph.edges().forEach(function(e) {
if (toKeep[e.source] && toKeep[e.target])
e.color = '#35a9f5';
else
e.color = '#dddddd';
});
// Since the data has been modified, we need to
// call the refresh method to make the colors
// update effective.
s.refresh();
});
// When the stage is clicked, we just color each
// node and edge with its original color.
s.bind('clickStage', function(e) {
s.graph.nodes().forEach(function(n) {
n.color = n.originalColor;
});
s.graph.edges().forEach(function(e) {
e.color = e.originalColor;
});
// Same as in the previous event:
s.refresh();
});
s.bind("doubleClickNode", function (e) {
$("#canvas-wrap, .sigma-scene, .sigma-mouse").val();
ajax_load_page( e.data.node.page_url );
});
var c = s.camera;
s.bind("rightClickStage", function (e) {
sigma.misc.animation.camera(c, {
ratio: c.ratio * c.settings('zoomingRatio')
}, {
duration: 200
});
});
// Configure the noverlap layout:
var noverlapListener = s.configNoverlap({
nodeMargin: 10,
scaleNodes: 0.3,
gridSize: 1,
easing: 'quadraticInOut', // animation transition function
duration: 4000 // animation duration. Long here for the purposes of this example only
});
// Bind the events:
noverlapListener.bind('start stop interpolate', function(e) {
//console.log(e.type);
if(e.type === 'start') {
//console.time('noverlap');
}
if(e.type === 'interpolate') {
//console.timeEnd('noverlap');
}
});
// Start the layout:
s.startNoverlap();
//s.refresh();
// Initialize the dragNodes plugin:
var dragListener = sigma.plugins.dragNodes(s, s.renderers[0]);
dragListener.bind('startdrag', function(event) {
});
dragListener.bind('drag', function(event) {
});
dragListener.bind('drop', function(event) {
});
dragListener.bind('dragend', function(event) {
});