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: 107505,
label: 'Elisabeth Labruyère',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/04/research_pasteur-elisabeth-labruyere-capture-decran-2021-01-14-a-13.10.50-150x150.png',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=9
// 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: 188679,
label: 'EVENT: Cell la vie 2! A SBCF-organized international congress',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/cell-la-vie-2-a-sbcf-organized-international-congress/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505188679,
size: 0.5,
source: 107505,
target: 188679,
});
//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: 8199,
label: 'Maria Manich',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-maria-manich-image1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/maria-manich/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1886798199,
size: 0.5,
source: 188679,
target: 8199 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 188679107505,
size: 0.5,
source: 188679,
target: 107505 });
// 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: 188677,
label: 'EVENT: “Pushing the frontiers of cell adhesion and invasion”, the 2022 Invadosome Consortium Meeting',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/pushing-the-frontiers-of-cell-adhesion-and-invasion-the-2022-invadosome-consortium-meeting/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505188677,
size: 0.5,
source: 107505,
target: 188677,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8199) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1886778199,
size: 0.5,
source: 188677,
target: 8199 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 188677107505,
size: 0.5,
source: 188677,
target: 107505 });
// 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: 152818,
label: 'PROJECT: Call Emulate 2020 – Mucibiome – Impact of the colon mucus layer colonized by microbiota on the colonic epithelium mechanics under strech and on the pathogenesis of Entamoeba histolytica',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/call-emulate-2020-mucibiome-impact-of-the-colon-mucus-layer-colonized-by-microbiota-on-the-colonic-epithelium-mechanics-under-strech-and-on-the-pathogenesis-of-entamoeba-histolytica/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505152818,
size: 0.5,
source: 107505,
target: 152818,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8199) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1528188199,
size: 0.5,
source: 152818,
target: 8199 });
//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: 4778,
label: 'Giulia Nigro',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_nigro-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/giulia-nigro/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1528184778,
size: 0.5,
source: 152818,
target: 4778 });
//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: 124775,
label: 'Héloïse Mary',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=124775',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 152818124775,
size: 0.5,
source: 152818,
target: 124775 });
//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: 6834,
label: 'Samy Gobaa',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-samy-gobaa-gobaa-samy-1510-e1634550888980-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/samy-gobaa/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1528186834,
size: 0.5,
source: 152818,
target: 6834 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 152818107505,
size: 0.5,
source: 152818,
target: 107505 });
// 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: 152267,
label: 'PROJECT: PTR 232-2019. Mechabiome. Computational imaging of the spatiotemporal distribution of forces in gut tissue: a study of the cross talk between cell mechanics, microbiome and infectious processes',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/mechabiome-organ-on-chips/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505152267,
size: 0.5,
source: 107505,
target: 152267,
});
//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: 148710,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 152267148710,
size: 0.5,
source: 152267,
target: 148710 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8199) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1522678199,
size: 0.5,
source: 152267,
target: 8199 });
//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: 98491,
label: 'Aleix Boquet-Pujadas',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/11/research_pasteur-aleix-boquet-pujadas-img-6651-1-e1619772034953-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/aleix-boquet-i-pujadas/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 15226798491,
size: 0.5,
source: 152267,
target: 98491 });
//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: 4792,
label: 'Nathalie Sauvonnet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/11/research.pasteur.fr_nathaliesauvonnet-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/nathalie-sauvonnet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1522674792,
size: 0.5,
source: 152267,
target: 4792 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 124775) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 152267124775,
size: 0.5,
source: 152267,
target: 124775 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6834) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1522676834,
size: 0.5,
source: 152267,
target: 6834 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 152267107505,
size: 0.5,
source: 152267,
target: 107505 });
// 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: 151830,
label: 'PROJECT: Impact of tissue components on cell migration: adhesion strength, cell morpho-dynamics and intracellular biophysics parameters.',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/cell-morphodynamics/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505151830,
size: 0.5,
source: 107505,
target: 151830,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8199) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1518308199,
size: 0.5,
source: 151830,
target: 8199 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 98491) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 15183098491,
size: 0.5,
source: 151830,
target: 98491 });
//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: 1043,
label: 'Pascal Bochet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_pascal-bochet-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/pascal-bochet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1518301043,
size: 0.5,
source: 151830,
target: 1043 });
//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: 836,
label: 'Thierry Rose',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/Thierry_Rose-e1423234985507-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/thierry-rose/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 151830836,
size: 0.5,
source: 151830,
target: 836 });
//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: 6939,
label: 'Nancy Guillen',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-nancy-guillen-nancy-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/nancy-guillen/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1518306939,
size: 0.5,
source: 151830,
target: 6939 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 151830107505,
size: 0.5,
source: 151830,
target: 107505 });
// 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: 135512,
label: 'PROJECT: Impact of gut mechanical forces and 3D architecture on the intestine homeostasis during pathogen interaction and in cancer disease',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/11/research_pasteur-diapositive1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/project/impact-of-gut-mechanical-forces-and-3d-architecture-on-the-intestine-homeostasis-and-how-it-can-be-imbalanced-during-pathogens-interaction-or-cancer-disease/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505135512,
size: 0.5,
source: 107505,
target: 135512,
});
//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: 53195,
label: 'Clement Bonamy',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=53195',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 13551253195,
size: 0.5,
source: 135512,
target: 53195 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4778) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1355124778,
size: 0.5,
source: 135512,
target: 4778 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 98491) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 13551298491,
size: 0.5,
source: 135512,
target: 98491 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 135512107505,
size: 0.5,
source: 135512,
target: 107505 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6834) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1355126834,
size: 0.5,
source: 135512,
target: 6834 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4792) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1355124792,
size: 0.5,
source: 135512,
target: 4792 });
// 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: 133102,
label: 'EVENT: Eukaryome Impact on Intestine homeostasis and mucosal immunology',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/eukaryome-impact-on-intestine-homeostasis-and-mucosal-immunology/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505133102,
size: 0.5,
source: 107505,
target: 133102,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6939) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1331026939,
size: 0.5,
source: 133102,
target: 6939 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 133102107505,
size: 0.5,
source: 133102,
target: 107505 });
// 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: 124782,
label: 'PROJECT: Organ-on-Chip Center',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/organ-on-chip-center/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505124782,
size: 0.5,
source: 107505,
target: 124782,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 124775) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 124782124775,
size: 0.5,
source: 124782,
target: 124775 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4792) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1247824792,
size: 0.5,
source: 124782,
target: 4792 });
//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: 4788,
label: 'Alexandre Grassart',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=4788',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824788,
size: 0.5,
source: 124782,
target: 4788 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 124782107505,
size: 0.5,
source: 124782,
target: 107505 });
//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: 4245,
label: 'Batiste Boeda',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/batiste-boeda/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824245,
size: 0.5,
source: 124782,
target: 4245 });
//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: 4094,
label: 'Javier Pizarro-Cerda',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-javier-pizarro-cerda-javier-pizarro-1300-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/javier-pizarro-cerda/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824094,
size: 0.5,
source: 124782,
target: 4094 });
//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: 58778,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 12478258778,
size: 0.5,
source: 124782,
target: 58778 });
//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: 3931,
label: 'Lisa Chakrabarti',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_lc2-photo-medium-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/lisa-chakrabarti/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247823931,
size: 0.5,
source: 124782,
target: 3931 });
//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: 60986,
label: 'Lida Katsimpardi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-dsc1996-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/lida-katsimpardi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 12478260986,
size: 0.5,
source: 124782,
target: 60986 });
//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: 4483,
label: 'Han Li',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_han_li_small-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/han-li/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824483,
size: 0.5,
source: 124782,
target: 4483 });
//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: 126536,
label: 'Elsa Charifou',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/02/research_pasteur-capture-decran-2020-02-25-a-14.42.51-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/elsa-charifou/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 124782126536,
size: 0.5,
source: 124782,
target: 126536 });
//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: 1247824355,
size: 0.5,
source: 124782,
target: 4355 });
//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: 4360,
label: 'Richard Wheeler',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/11/research.pasteur.fr_photo-for-lab-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/richard-wheeler/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824360,
size: 0.5,
source: 124782,
target: 4360 });
//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: 83719,
label: 'Michael Connor',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/04/research_pasteur-michael-connor-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/michael-connor/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 12478283719,
size: 0.5,
source: 124782,
target: 83719 });
//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: 4087,
label: 'Mélanie Hamon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_p1010312-version-2-4-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/melanie-hamon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1247824087,
size: 0.5,
source: 124782,
target: 4087 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6834) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1247826834,
size: 0.5,
source: 124782,
target: 6834 });
// 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: 517,
label: 'TEAM: Analyse d’Images Biologiques',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2014/12/grid01-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/team/bioimage-analysis/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 107505517,
size: 0.5,
source: 107505,
target: 517,
});
//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: 223899,
label: 'Olivia Gardette',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/03/research_pasteur-enolivia-gardettefrolivia-gardette-olivia-gardette-jpg-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/olivia-gardette/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517223899,
size: 0.5,
source: 517,
target: 223899 });
//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: 4630,
label: 'Thibault Lagache',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_p10400571-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/thibault-lagache/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 5174630,
size: 0.5,
source: 517,
target: 4630 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 107505) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 517107505,
size: 0.5,
source: 517,
target: 107505 });
//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: 4636,
label: 'Vannary Meas-Yedid Hardy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_measyedidvannary-250x145-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/vannary-meas-yedid-hardy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 5174636,
size: 0.5,
source: 517,
target: 4636 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6939) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 5176939,
size: 0.5,
source: 517,
target: 6939 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8199) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 5178199,
size: 0.5,
source: 517,
target: 8199 });
//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: 226501,
label: 'Somoballi GHOSHAL',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/06/research_pasteur-ensomoballi-ghoshalfrsomoballi-ghoshal-somoballi2-14.41.26-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/somoballi-ghoshal/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517226501,
size: 0.5,
source: 517,
target: 226501 });
//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: 224746,
label: 'Sarah Gaubi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/04/research_pasteur-ensarah-gaubifrsarah-gaubi-carte-didentite-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/sarah-gaubi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517224746,
size: 0.5,
source: 517,
target: 224746 });
//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: 231868,
label: 'Joséphine Lahmani',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/10/research_pasteur-enjosephine-lahmanifrjosephine-lahmani-photo-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/josephine-lahmani/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517231868,
size: 0.5,
source: 517,
target: 231868 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1043) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 5171043,
size: 0.5,
source: 517,
target: 1043 });
//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: 187296,
label: 'Giacomo Nardi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-giacomo-nardi-pic-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/giacomo-nardi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517187296,
size: 0.5,
source: 517,
target: 187296 });
//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: 189972,
label: 'Thomas Musset',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/11/research_pasteur-thomas-musset-1670935836812-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/thomas-musset/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517189972,
size: 0.5,
source: 517,
target: 189972 });
//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: 174288,
label: 'Benjamin Dorra',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-benjamin-dorra-selfiecropcompressed-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/benjamin-dorra/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517174288,
size: 0.5,
source: 517,
target: 174288 });
//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: 164388,
label: 'Mounib Mohamed Benimam',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-mounib-mohamed-benimam-1588170203182-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/mounib-mohamed-benimam/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517164388,
size: 0.5,
source: 517,
target: 164388 });
//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: 179330,
label: 'Raphael Reme',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/04/research_pasteur-raphael-reme-me-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/raphael-reme/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517179330,
size: 0.5,
source: 517,
target: 179330 });
//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: 194622,
label: 'Thomas Treport',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/01/research_pasteur-thomas-treport-20220920-172855-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/thomas-treport/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517194622,
size: 0.5,
source: 517,
target: 194622 });
//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: 231884,
label: 'Tristan Manneville',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/10/research_pasteur-entristan-manneville-frtristan-manneville-image001-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/tristan-manneville/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517231884,
size: 0.5,
source: 517,
target: 231884 });
//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: 388,
label: 'Jean-Christophe Olivo-Marin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/04/research_pasteur-photojcom_2016_2-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/jean-christophe-olivo-marin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 517388,
size: 0.5,
source: 517,
target: 388 });
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) {
});