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
// graph team
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: 24339,
label: 'Viral reservoirs and immune control',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_institutpasteur_i00606-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
N=7
var x_node = Math.cos(2 * 0 * Math.PI / N) * 2;
var y_node = Math.sin(2 * 0 * Math.PI / N) * 2;
var biggest_node_size = 0;
//check if content already exist
x_site = Math.cos(2 * 0 * Math.PI / N) * 2;
y_site = Math.sin(2 * 0 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 7065,
label: 'Valérie Monceaux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_valerie-monceaux-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/valerie-monceaux/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 243397065,
size: 0.5,
source: 24339,
target: 7065 });
//check if content already exist
x_site = Math.cos(2 * 1 * Math.PI / N) * 2;
y_site = Math.sin(2 * 1 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 191929,
label: 'Maël Gourvès',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/12/research_pasteur-mael-gourves-photo1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/mael-gourves/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 24339191929,
size: 0.5,
source: 24339,
target: 191929 });
//check if content already exist
x_site = Math.cos(2 * 2 * Math.PI / N) * 2;
y_site = Math.sin(2 * 2 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 206774,
label: 'Grégoire Launay',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/08/research_pasteur-gregoire-launay-1595678158138-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/glaunay/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 24339206774,
size: 0.5,
source: 24339,
target: 206774 });
//check if content already exist
x_site = Math.cos(2 * 3 * Math.PI / N) * 2;
y_site = Math.sin(2 * 3 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 206781,
label: 'Luis Romero Martín',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/luis-romero-martin/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 24339206781,
size: 0.5,
source: 24339,
target: 206781 });
//check if content already exist
x_site = Math.cos(2 * 4 * Math.PI / N) * 2;
y_site = Math.sin(2 * 4 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 229206,
label: 'Emy Taylor',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/emy-taylor/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 24339229206,
size: 0.5,
source: 24339,
target: 229206 });
//check if content already exist
x_site = Math.cos(2 * 5 * Math.PI / N) * 2;
y_site = Math.sin(2 * 5 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 233742,
label: 'Nicolas Bellini',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/nicolas-bellini/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 24339233742,
size: 0.5,
source: 24339,
target: 233742 });
//check if content already exist
x_site = Math.cos(2 * 6 * Math.PI / N) * 2;
y_site = Math.sin(2 * 6 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 4600,
label: 'Asier Sáez-Cirión',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_dsc2316-e1441290951360-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/asier-saez-cirion/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 243394600,
size: 0.5,
source: 24339,
target: 4600 });
// update positions
x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
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: 160998,
label: 'PROGRAM_PROJECT: Drug Discovery & Screening at Institut Pasteur',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/program_project/drug-discovery-screening-at-institut-pasteur/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 24339160998,
size: 0.5,
source: 24339,
target: 160998 });
//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: 161202,
label: 'Emilie Boutet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/06/research_pasteur-emilie-boutet-essai-jpeg-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/emilie-boutet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 160998161202,
size: 0.5,
source: 160998,
target: 161202 });
//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: 7850,
label: 'Fabrice Agou',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_image010-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fabrice-agou/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609987850,
size: 0.5,
source: 160998,
target: 7850 });
//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: 4357,
label: 'Nienke Buddelmeijer',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/10/research.pasteur.fr_nienke3a-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/nienke-buddelmeijer/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984357,
size: 0.5,
source: 160998,
target: 4357 });
//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: 152955,
label: 'Iuliana Ene',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/01/research_pasteur-iuliana-ene-ene-iuliana-1-copy-scaled-e1612802810122-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/iuliana-ene/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 160998152955,
size: 0.5,
source: 160998,
target: 152955 });
//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: 62876,
label: 'Marcel Hollenstein',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_thrashmanlessthrash-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marcel-hollenstein/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 16099862876,
size: 0.5,
source: 160998,
target: 62876 });
//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/en/member/nadia-naffakh/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984923,
size: 0.5,
source: 160998,
target: 4923 });
//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: 4847,
label: 'Eric Prina',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_eric-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/eric-prina/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984847,
size: 0.5,
source: 160998,
target: 4847 });
//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: 4143,
label: 'Ludovic Sauguet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-ludovic-sauguet-photo-sauguet-ludovic-scaled-e1650635785861-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/ludovic-sauguet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984143,
size: 0.5,
source: 160998,
target: 4143 });
//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: 70499,
label: 'Olivier Sperandio',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_sperandio-id-photo-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/olivier-sperandio/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 16099870499,
size: 0.5,
source: 160998,
target: 70499 });
//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/en/member/helene-strick-marchand/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984186,
size: 0.5,
source: 160998,
target: 4186 });
//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: 4977,
label: 'Christophe Zimmer',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-christophe-zimmer-chz-photo-resized-bw-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/christophe-zimmer/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1609984977,
size: 0.5,
source: 160998,
target: 4977 });
// 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: 157415,
label: 'PROJECT: Humoral immunity in HIV-1 post-treatment controllers',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/04/research_pasteur-humoral-immunoprofiling-in-hiv-1-post-treatment-controllers-hiv-sb-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/humoral-immunoprofiling-in-hiv-1-post-treatment-controllers/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 24339157415,
size: 0.5,
source: 24339,
target: 157415 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4600) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1574154600,
size: 0.5,
source: 157415,
target: 4600 });
//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: 4575,
label: 'Hugo Mouquet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/05/research_pasteur-mouquet_id-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/hugo-mouquet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1574154575,
size: 0.5,
source: 157415,
target: 4575 });
// 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: 80943,
label: 'PROGRAM_PROJECT: Antimicrobial resistance',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research_pasteur-enantimicrobial-resistance-frresistance-aux-agents-antimicrobiens-institutpasteur-34753-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/program_project/antimicrobial-resistance/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433980943,
size: 0.5,
source: 24339,
target: 80943 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 161202) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 80943161202,
size: 0.5,
source: 80943,
target: 161202 });
//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: 95915,
label: 'Paola Arimondo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/10/research_pasteur-p-arimondo_5757-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/paola-arimondo/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 8094395915,
size: 0.5,
source: 80943,
target: 95915 });
//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: 7209,
label: 'Philippe Glaser',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_ha41-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/philippe-glaser/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809437209,
size: 0.5,
source: 80943,
target: 7209 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7850) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 809437850,
size: 0.5,
source: 80943,
target: 7850 });
//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/en/member/anna-bella-failloux/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809434255,
size: 0.5,
source: 80943,
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: 4447,
label: 'Thierry Fontaine',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/07/research_pasteur-20190614_185922_crop-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thierry-fontaine/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809434447,
size: 0.5,
source: 80943,
target: 4447 });
//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: 4541,
label: 'Didier Mazel',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-didier-mazel-img-6478-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/didier-mazel/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809434541,
size: 0.5,
source: 80943,
target: 4541 });
//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: 95085,
label: 'Didier Ménard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/12/research_pasteur-92a3510-5-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/didier-menard/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 8094395085,
size: 0.5,
source: 80943,
target: 95085 });
//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: 8485,
label: 'Lulla Opatowski',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/01/research.pasteur.fr_photolulla4-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lulla-opatowski/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809438485,
size: 0.5,
source: 80943,
target: 8485 });
//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 A. 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/en/member/felix-rey/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 809434724,
size: 0.5,
source: 80943,
target: 4724 });
//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: 81199,
label: 'Kathleen Victoir',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/kathleen-victoir/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 8094381199,
size: 0.5,
source: 80943,
target: 81199 });
// 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: 43738,
label: 'PROJECT: ICISTEM-International Collaboration to guide and investigate the potential for HIV cure by Stem Cell Transplantation',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_epistem-european-project-to-guide-and-investigate-the-potential-for-hiv-cure-by-stem-cell-transplantation-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/epistem-european-project-to-guide-and-investigate-the-potential-for-hiv-cure-by-stem-cell-transplantation/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433943738,
size: 0.5,
source: 24339,
target: 43738 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4600) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 437384600,
size: 0.5,
source: 43738,
target: 4600 });
//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: 43750,
label: 'Javier Martinez-Picado',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/epartner/javier-martinez-picado/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 4373843750,
size: 0.5,
source: 43738,
target: 43750 });
//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: 43757,
label: 'Annemarie Wensing',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/epartner/annemarie-wensing/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 4373843757,
size: 0.5,
source: 43738,
target: 43757 });
// 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: 41909,
label: 'PROJECT: Etude ANRS-EP59-CLEAC (Comparison of Late versus Early Antiretroviral therapy in HIV-infected Children) : Etude physiopathologique comparant l’impact de l’instauration précoce (avant 6 mois) ou tardive (après 2 ans) du traitement antirétroviral sur l’évolution immuno-virologique des enfants infectés par le VIH-1 en période périnatale)',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/12/research_pasteur-logocleac2-1-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/etude-anrs-ep59-cleac-comparison-of-late-versus-early-antiretroviral-therapy-in-hiv-infected-children-etude-physiopathologique-comparant-limpact-de-linstauration-precoce-avant-6-2/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433941909,
size: 0.5,
source: 24339,
target: 41909 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4600) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 419094600,
size: 0.5,
source: 41909,
target: 4600 });
//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: 8578,
label: 'Daniel Scott-Algara',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/12/research.pasteur.fr_dsc7039-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/daniel-scott-algara/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 419098578,
size: 0.5,
source: 41909,
target: 8578 });
//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: 8632,
label: 'Thomas Montange',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/01/research_pasteur-thomas-montange-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thomas-montange/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 419098632,
size: 0.5,
source: 41909,
target: 8632 });
//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/en/member/florence-buseyne/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 419094326,
size: 0.5,
source: 41909,
target: 4326 });
// 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: 37814,
label: 'PROJECT: Natural Control of HIV-1 Infection',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research_pasteur-natural-control-of-hiv-1-infection-ctl-cd4-1-deconv-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/natural-control-of-hiv-1-infection/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433937814,
size: 0.5,
source: 24339,
target: 37814 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7065) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 378147065,
size: 0.5,
source: 37814,
target: 7065 });
//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: 4598,
label: 'Caroline Pereira Bittencourt Passaes',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/05/research_pasteur-caroline-passaes-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/caroline-pereira-bittencourt/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 378144598,
size: 0.5,
source: 37814,
target: 4598 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4600) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 378144600,
size: 0.5,
source: 37814,
target: 4600 });
// 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: 37544,
label: 'PROJECT: Role of CD8 T cells responses in the control of HIV-2 infection-ANRS Immunovir2',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_ctl-and-hiv-infected-cd4-t-cell-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/role-of-cd8-t-cells-responses-in-the-control-of-hiv-2-infection-anrs-immunovir2/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433937544,
size: 0.5,
source: 24339,
target: 37544 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4600) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 24339) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 375444600,
size: 0.5,
source: 37544,
target: 4600 });
//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: 4594,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 375444594,
size: 0.5,
source: 37544,
target: 4594 });
//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: 6928,
label: 'Gianfranco Pancino',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_gianfranco-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/gianfranco-pancino/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 375446928,
size: 0.5,
source: 37544,
target: 6928 });
// 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: 34,
label: 'DEPARTMENT: Virology',
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/en/department/virology/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433934,
size: 0.5,
source: 24339,
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/en/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/en/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/en/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/en/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 });
// 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: 32,
label: 'DEPARTMENT: Immunology',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2014/09/research_pasteur-enimmunologyfrimmunologie-new-banniereimmuno-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/department/immunology/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 2433932,
size: 0.5,
source: 24339,
target: 32 });
//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: 7039,
label: 'Marie-Laure Goupil',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_photo-marie-laure-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marie-laure-goupil/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 327039,
size: 0.5,
source: 32,
target: 7039 });
//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: 230940,
label: 'Daniel Manzoni-de-Almeida',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2014/09/research_pasteur-encell-biology-amp-infectionfrbiologie-cellulaire-et-infection-research-pasteur-encell-biology-amp-infectionfrbiologie-cellulaire-et-infection-screenshot-20240924-144250-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/daniel-manzoni-de-almeida/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 32230940,
size: 0.5,
source: 32,
target: 230940 });
//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: 3982,
label: 'Philippe Bousso',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_photopb-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/philippe-bousso/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 323982,
size: 0.5,
source: 32,
target: 3982 });
//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: 4171,
label: 'Caroline Demangel',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-caroline-demangel-id-caro2-2018-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/caroline-demangel/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 324171,
size: 0.5,
source: 32,
target: 4171 });
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: 12,
maxNodeSize: 30,
mouseWheelEnabled: false,
font: 'Montserrat',
labelThreshold:25,
borderSize:1,
defaultNodeBorderColor: '#333',
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;
//console.log(n.id);
//console.log(s.graph.nodes(n.id));
});
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) {
});