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: 4435,
label: 'Monique Lafon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_m-lafon-site-web-2-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=20
// 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: 161187,
label: 'NEWS: Yellow fever: understanding the rare side effects of vaccines',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/news/genomic-diversity-contributes-to-the-neuroinvasiveness-of-the-yellow-fever-french-neurotropic-vaccine-nature-partner-journals-vaccines-26-april-2021/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4435161187,
size: 0.5,
source: 4435,
target: 161187,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1611874435,
size: 0.5,
source: 161187,
target: 4435 });
//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: 4880,
label: 'Nolwenn Jouvenet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_nolwenn-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/nolwenn-jouvenet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1611874880,
size: 0.5,
source: 161187,
target: 4880 });
//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: 102053,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 161187102053,
size: 0.5,
source: 161187,
target: 102053 });
// 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: 129552,
label: 'PROJECT: Main thematics of the laboratory',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/main-thematics-of-the-laboratory/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4435129552,
size: 0.5,
source: 4435,
target: 129552,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1295524435,
size: 0.5,
source: 129552,
target: 4435 });
// 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: 107539,
label: 'EVENT: “Functional CURE under some ENIGMATIC mechanisms: Choke-and-Mute, rather than Shoot-and-Kill ?” by Jacques Leibowitch – VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/functional-cure-under-some-enigmatic-mechanisms-choke-and-mute-rather-than-shoot-and-kill-by-jacques-leibowitch-virology-department-seminar/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4435107539,
size: 0.5,
source: 4435,
target: 107539,
});
//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: 4821,
label: 'Olivier Schwartz',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_photo-o.schwartz-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/olivier-schwartz/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1075394821,
size: 0.5,
source: 107539,
target: 4821 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1075394435,
size: 0.5,
source: 107539,
target: 4435 });
// 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: 107383,
label: 'EVENT: “Disruptive Discoveries for HIV, HCV and HBV Infections” by Raymond Schinazi – Virology & Immunology departments joint seminar',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/disruptive-discoveries-for-hiv-hcv-and-hbv-infections-by-raymond-schinazi-virology-immunology-departments-joint-seminar/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4435107383,
size: 0.5,
source: 4435,
target: 107383,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4821) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1073834821,
size: 0.5,
source: 107383,
target: 4821 });
//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: 4186,
label: 'Hélène Strick-Marchand',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_helena-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/helene-strick-marchand/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1073834186,
size: 0.5,
source: 107383,
target: 4186 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1073834435,
size: 0.5,
source: 107383,
target: 4435 });
//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: 4225,
label: 'Gérard Eberl',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_eberl-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/gerard-eberl/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1073834225,
size: 0.5,
source: 107383,
target: 4225 });
// 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: 88783,
label: 'EVENT: Pr Frederick P. ROTH – VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/pr-frederick-p-roth-virology-department-seminar/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443588783,
size: 0.5,
source: 4435,
target: 88783,
});
//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: 4928,
label: 'Yves Jacob',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=4928',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 887834928,
size: 0.5,
source: 88783,
target: 4928 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 887834435,
size: 0.5,
source: 88783,
target: 4435 });
//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: 7036,
label: 'Bernadette Di Duca',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=7036',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 887837036,
size: 0.5,
source: 88783,
target: 7036 });
// 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: 86869,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar-6/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443586869,
size: 0.5,
source: 4435,
target: 86869,
});
//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: 4955,
label: 'Marco Vignuzzi',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=4955',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 868694955,
size: 0.5,
source: 86869,
target: 4955 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 868694435,
size: 0.5,
source: 86869,
target: 4435 });
// 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: 86413,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar-5/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443586413,
size: 0.5,
source: 4435,
target: 86413,
});
//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: 4881,
label: 'Frédéric Tangy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig11-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/frederic-tangy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 864134881,
size: 0.5,
source: 86413,
target: 4881 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 864134435,
size: 0.5,
source: 86413,
target: 4435 });
// 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: 82776,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar-4/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443582776,
size: 0.5,
source: 4435,
target: 82776,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4955) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 827764955,
size: 0.5,
source: 82776,
target: 4955 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 827764435,
size: 0.5,
source: 82776,
target: 4435 });
// adding node
var x_node = Math.cos(2 * 8 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 8 * Math.PI / N) * 10;
g.nodes.push({
id: 82758,
label: 'EVENT: SEMINAR OF THE VIROLOGY DEPARTMENT',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/seminar-of-the-virology-department-2/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443582758,
size: 0.5,
source: 4435,
target: 82758,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4955) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 827584955,
size: 0.5,
source: 82758,
target: 4955 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 827584435,
size: 0.5,
source: 82758,
target: 4435 });
// adding node
var x_node = Math.cos(2 * 9 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 9 * Math.PI / N) * 10;
g.nodes.push({
id: 82547,
label: 'EVENT: SEMINAR OF THE VIROLOGY DEPARTMENT',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/seminar-of-the-virology-department/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443582547,
size: 0.5,
source: 4435,
target: 82547,
});
//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: 4162,
label: 'Francis Delpeyroux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_photo-mooc-cv-fr.delp_.-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/francis-delpeyroux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 825474162,
size: 0.5,
source: 82547,
target: 4162 });
//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: 4724,
label: 'Félix Rey',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-enfelix-a-reyfrfelix-rey-portrait-felixrey-1-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/felix-rey/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 825474724,
size: 0.5,
source: 82547,
target: 4724 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 825474435,
size: 0.5,
source: 82547,
target: 4435 });
// adding node
var x_node = Math.cos(2 * 10 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 10 * Math.PI / N) * 10;
g.nodes.push({
id: 79552,
label: 'NEWS: SEMINAR OF THE VIROLOGY DEPARTMENT',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/news/seminar-of-the-virology-department-2/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443579552,
size: 0.5,
source: 4435,
target: 79552,
});
//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: 4923,
label: 'Nadia Naffakh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_photo_web1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/nadia-naffakh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 795524923,
size: 0.5,
source: 79552,
target: 4923 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7036) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 795527036,
size: 0.5,
source: 79552,
target: 7036 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 795524435,
size: 0.5,
source: 79552,
target: 4435 });
// adding node
var x_node = Math.cos(2 * 11 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 11 * Math.PI / N) * 10;
g.nodes.push({
id: 76499,
label: 'NEWS: Seminar of the Virology Department',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/news/seminar-of-the-virology-department/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443576499,
size: 0.5,
source: 4435,
target: 76499,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 764994435,
size: 0.5,
source: 76499,
target: 4435 });
//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: 4255,
label: 'Anna-Bella Failloux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/12/research.pasteur.fr_ab-failloux3-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/anna-bella-failloux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 764994255,
size: 0.5,
source: 76499,
target: 4255 });
//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: 4258,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 764994258,
size: 0.5,
source: 76499,
target: 4258 });
// adding node
var x_node = Math.cos(2 * 12 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 12 * Math.PI / N) * 10;
g.nodes.push({
id: 76401,
label: 'NEWS: Virology afternoons – dedicated to Pasteurian scientists',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_image3-1-150x150.png',
page_url: 'https://research.pasteur.fr/fr/news/virology-afternoons/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443576401,
size: 0.5,
source: 4435,
target: 76401,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 764014435,
size: 0.5,
source: 76401,
target: 4435 });
//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: 4365,
label: 'Marie-Lise Gougeon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_marie-lise-gougeon-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/marie-lise-gougeon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 764014365,
size: 0.5,
source: 76401,
target: 4365 });
// adding node
var x_node = Math.cos(2 * 13 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 13 * Math.PI / N) * 10;
g.nodes.push({
id: 71865,
label: 'NEWS: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/news/virology-department-seminar/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443571865,
size: 0.5,
source: 4435,
target: 71865,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 718654435,
size: 0.5,
source: 71865,
target: 4435 });
//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: 4566,
label: 'Eliane Meurs',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig59-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/eliane-meurs/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 718654566,
size: 0.5,
source: 71865,
target: 4566 });
// adding node
var x_node = Math.cos(2 * 14 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 14 * Math.PI / N) * 10;
g.nodes.push({
id: 69363,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar-3/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443569363,
size: 0.5,
source: 4435,
target: 69363,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4821) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 693634821,
size: 0.5,
source: 69363,
target: 4821 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 693634435,
size: 0.5,
source: 69363,
target: 4435 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7036) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 693637036,
size: 0.5,
source: 69363,
target: 7036 });
// adding node
var x_node = Math.cos(2 * 15 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 15 * Math.PI / N) * 10;
g.nodes.push({
id: 69185,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar-2/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443569185,
size: 0.5,
source: 4435,
target: 69185,
});
//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: 4326,
label: 'Florence Buseyne',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-florence-buseyne-photofbtalensoft-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/florence-buseyne/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 691854326,
size: 0.5,
source: 69185,
target: 4326 });
//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: 4328,
label: 'Antoine Gessain',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_a.g-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/antoine-gessain/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 691854328,
size: 0.5,
source: 69185,
target: 4328 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 691854435,
size: 0.5,
source: 69185,
target: 4435 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7036) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 691857036,
size: 0.5,
source: 69185,
target: 7036 });
// adding node
var x_node = Math.cos(2 * 16 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 16 * Math.PI / N) * 10;
g.nodes.push({
id: 69103,
label: 'EVENT: VIROLOGY DEPARTMENT SEMINAR',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/virology-department-seminar/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443569103,
size: 0.5,
source: 4435,
target: 69103,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 691034435,
size: 0.5,
source: 69103,
target: 4435 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7036) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 691037036,
size: 0.5,
source: 69103,
target: 7036 });
// adding node
var x_node = Math.cos(2 * 17 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 17 * Math.PI / N) * 10;
g.nodes.push({
id: 41178,
label: 'PROGRAM_PROJECT: Grand Programme Fédérateur Microbes & Brain',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_grand-federative-program-microbes-brain-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/program_project/major-federating-program-microbes-brain/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443541178,
size: 0.5,
source: 4435,
target: 41178,
});
//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: 58995,
label: 'Mallory Perrin-Wolff',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/05/research_pasteur-mallory-perrin-wolff-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/mallory-perrin-wolff/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 4117858995,
size: 0.5,
source: 41178,
target: 58995 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4225) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 411784225,
size: 0.5,
source: 41178,
target: 4225 });
//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: 3806,
label: 'Pierre-Marie Lledo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-pierre-marie-lledo-lledo-pierre-marie-6653-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/pierre-marie-lledo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 411783806,
size: 0.5,
source: 41178,
target: 3806 });
//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: 3801,
label: 'Uwe Maskos',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/12/research.pasteur.fr_um_1-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/uwe-maskos/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 411783801,
size: 0.5,
source: 41178,
target: 3801 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 411784435,
size: 0.5,
source: 41178,
target: 4435 });
//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: 4355,
label: 'Ivo Gomperts Boneca',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-ivo-gomperts-boneca-p9090188-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/ivo-gomperts-boneca/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 411784355,
size: 0.5,
source: 41178,
target: 4355 });
// adding node
var x_node = Math.cos(2 * 18 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 18 * Math.PI / N) * 10;
g.nodes.push({
id: 20168,
label: 'PROJECT: Axonal regeneration of rabies virus infected adult mouse sensory neurons',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_lafon-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/project/axonal-regeneration-rabies-virus-infected-adult-mouse-sensory-neurons/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443520168,
size: 0.5,
source: 4435,
target: 20168,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4435) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 201684435,
size: 0.5,
source: 20168,
target: 4435 });
//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: 8359,
label: 'Corinne Baran',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_corinne-baran-site-web--e1442563195369-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/corinne-baran/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 201688359,
size: 0.5,
source: 20168,
target: 8359 });
//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: 4436,
label: 'Christophe Prehaud',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_c-prehaud-site-web--150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/christophe-prehaud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 201684436,
size: 0.5,
source: 20168,
target: 4436 });
//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: 4437,
label: 'Sandrine VITRY',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/02/research_pasteur-photo_sandrine_labo_bis-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/sandrine-vitry/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 201684437,
size: 0.5,
source: 20168,
target: 4437 });
// adding node
var x_node = Math.cos(2 * 19 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 19 * Math.PI / N) * 10;
g.nodes.push({
id: 34,
label: 'DEPARTMENT: Virologie',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/HIV1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/department/virology/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 443534,
size: 0.5,
source: 4435,
target: 34,
});
//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: 174732,
label: 'Bérangère Virlon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-berangere-virlon-virlon-berengere-2314-bv-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/berangere-virlon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 34174732,
size: 0.5,
source: 34,
target: 174732 });
//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: 184781,
label: 'Christine Letellier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/01/research_pasteur-christine-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/christine-letellier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 34184781,
size: 0.5,
source: 34,
target: 184781 });
//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: 4962,
label: 'Jean-Pierre Vartanian',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/09/research_pasteur-jean-pierre-vartanian-photo-jpv--150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/jean-pierre-vartanian/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 344962,
size: 0.5,
source: 34,
target: 4962 });
//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: 62643,
label: 'Sarah Merkling',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/02/research.pasteur.fr_img_1465-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/sarah-merkling/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 3462643,
size: 0.5,
source: 34,
target: 62643 });
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) {
});