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: 10385,
label: 'Institut Pasteur de la Guyane',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/PF-gallery28-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
N=10
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: 11267,
label: 'Mirdad Kazanji',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/25eb936-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/riip_member/mirdad-kazanji/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1038511267,
size: 0.5,
source: 10385,
target: 11267 });
//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: 148682,
label: 'Rachel Ajenoe',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/riip_member/rachel-ajenoe/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 10385148682,
size: 0.5,
source: 10385,
target: 148682 });
//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: 148679,
label: 'Stanislas Talaga',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/riip_member/stanislas-talaga/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 10385148679,
size: 0.5,
source: 10385,
target: 148679 });
//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: 137491,
label: 'Chloé Gapp',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/riip_member/chloe-gapp/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 10385137491,
size: 0.5,
source: 10385,
target: 137491 });
//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: 134564,
label: 'Estelle Chabanol',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/11/research_pasteur-estelle-chabanol-petit-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/riip_member/estelle-chabanol/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 10385134564,
size: 0.5,
source: 10385,
target: 134564 });
//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: 114687,
label: 'Johan Claes Schönbeck',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/04/research_pasteur-claes-square-2-150x150.png',
page_url: 'https://research.pasteur.fr/en/riip_member/johan-claes-schonbeck/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 10385114687,
size: 0.5,
source: 10385,
target: 114687 });
//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: 98862,
label: 'Katy Heu',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/04/research_pasteur-katy-heu-square-150x150.png',
page_url: 'https://research.pasteur.fr/en/riip_member/katy-heu/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1038598862,
size: 0.5,
source: 10385,
target: 98862 });
//check if content already exist
x_site = Math.cos(2 * 7 * Math.PI / N) * 2;
y_site = Math.sin(2 * 7 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 98858,
label: 'Ottavia Romoli',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/04/research_pasteur-ottavia-romoli-2-square-150x150.png',
page_url: 'https://research.pasteur.fr/en/riip_member/ottavia-romoli/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1038598858,
size: 0.5,
source: 10385,
target: 98858 });
//check if content already exist
x_site = Math.cos(2 * 8 * Math.PI / N) * 2;
y_site = Math.sin(2 * 8 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 72345,
label: 'Dominique Rousset',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/06/544-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/riip_member/dominique-rousset/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1038572345,
size: 0.5,
source: 10385,
target: 72345 });
//check if content already exist
x_site = Math.cos(2 * 9 * Math.PI / N) * 2;
y_site = Math.sin(2 * 9 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 27382,
label: 'Lise Musset',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_lise-musset-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/riip_member/lise-musset/',
x: x_site,
y: y_site,
size: 20,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1038527382,
size: 0.5,
source: 10385,
target: 27382 });
// update positions
x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
N=6
// 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: 135276,
label: 'EVENT: HDR defense – Host-bacteria interactions in insects – Implications in pathogen transmission [in French]',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/hdr-defense-host-bacteria-interactions-in-insects-implications-in-pathogen-transmission-in-french/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 10385135276,
size: 0.5,
source: 10385,
target: 135276 });
//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: 86347,
label: 'Mathilde Gendrin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/05/research_pasteur-p1000264-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/mathilde-gendrin/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 13527686347,
size: 0.5,
source: 135276,
target: 86347 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10385) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 13527610385,
size: 0.5,
source: 135276,
target: 10385 });
// 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: 114679,
label: 'PROJECT: Reshaping the microbiota of mosquitoes to study its impact on malaria transmission',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/08/research_pasteur-larves-anopheles-darlingi-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/reshaping-the-microbiota-of-mosquitoes-to-study-its-impact-on-malaria-transmission/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 10385114679,
size: 0.5,
source: 10385,
target: 114679 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 98862) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 11467998862,
size: 0.5,
source: 114679,
target: 98862 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 114687) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 114679114687,
size: 0.5,
source: 114679,
target: 114687 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 86347) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 11467986347,
size: 0.5,
source: 114679,
target: 86347 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10385) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 11467910385,
size: 0.5,
source: 114679,
target: 10385 });
// 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: 74796,
label: 'PROGRAM_PROJECT: Outbreak Investigation Task Force',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/program_project/outbreak-investigation-taskforce/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1038574796,
size: 0.5,
source: 10385,
target: 74796 });
// 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: 64510,
label: 'PROJECT: Emergency response to global threats of emerging and re-emerging pathogens',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/02/research.pasteur.fr_img_4640-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/emergency-response-to-global-threats-of-emerging-and-re-emerging-pathogens/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1038564510,
size: 0.5,
source: 10385,
target: 64510 });
//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: 7142,
label: 'Christian Bréchot',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/0305_CB-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/christian-brechot/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645107142,
size: 0.5,
source: 64510,
target: 7142 });
//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: 4028,
label: 'Simon Cauchemez',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig45-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/simon-cauchemez/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645104028,
size: 0.5,
source: 64510,
target: 4028 });
//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: 2624,
label: 'Arnaud Fontanet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_arnaud-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/arnaud-fontanet/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645102624,
size: 0.5,
source: 64510,
target: 2624 });
//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: 7170,
label: 'Marc Jouan',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/marc-jouan/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645107170,
size: 0.5,
source: 64510,
target: 7170 });
//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: 4508,
label: 'Jean-Claude Manuguerra',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig43-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/jean-claude-manuguerra/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645104508,
size: 0.5,
source: 64510,
target: 4508 });
//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: 11348,
label: 'Malik Peiris',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/Malik-Peiris-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/riip_member/malik-peiris/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451011348,
size: 0.5,
source: 64510,
target: 11348 });
//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: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645104724,
size: 0.5,
source: 64510,
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: 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/en/member/frederic-tangy/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645104881,
size: 0.5,
source: 64510,
target: 4881 });
//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: 4268,
label: 'Maria Van Kerkhove',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_mvk-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/maria-van-kerkhove/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645104268,
size: 0.5,
source: 64510,
target: 4268 });
//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: 3928,
label: 'Fernando Arenzana-Seisdedos',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig60-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fernando-arenzana-seisdedos/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 645103928,
size: 0.5,
source: 64510,
target: 3928 });
//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: 11275,
label: 'Myrielle Dupont-rouzeyrol',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/riip_member/myrielle-dupont-rouzeyrol/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451011275,
size: 0.5,
source: 64510,
target: 11275 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 11267) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6451011267,
size: 0.5,
source: 64510,
target: 11267 });
//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: 10378,
label: 'Hong Kong University-Pasteur Research Pole',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/hku-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/hong-kong-university-pasteur-research-centre/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010378,
size: 0.5,
source: 64510,
target: 10378 });
//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: 10372,
label: 'Institut Pasteur',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_institutpasteur_i00845-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-paris-france/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010372,
size: 0.5,
source: 64510,
target: 10372 });
//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: 10380,
label: 'Institut Pasteur d’Algérie',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/20120420100411_1451_pasteur-alger_guide_image_congres_medical-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-algeria/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010380,
size: 0.5,
source: 64510,
target: 10380 });
//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: 10383,
label: 'Institut Pasteur du Cambodge',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/institut-pasteur-du-cambodge-panoramic-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-cambodia/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010383,
size: 0.5,
source: 64510,
target: 10383 });
//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: 10373,
label: 'Institut Pasteur de Dakar',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/82041945_o-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-dakar-senegal/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010373,
size: 0.5,
source: 64510,
target: 10373 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10385) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6451010385,
size: 0.5,
source: 64510,
target: 10385 });
//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: 10386,
label: 'Institut Pasteur de la Guadeloupe',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/panorama_small-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-guadeloupe/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010386,
size: 0.5,
source: 64510,
target: 10386 });
//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: 10381,
label: 'Institut Pasteur in Iran',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/iran-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-iran/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010381,
size: 0.5,
source: 64510,
target: 10381 });
//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: 10390,
label: 'Institut Pasteur de Madagascar',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/Le-batiment-Monod-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-madagascar/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010390,
size: 0.5,
source: 64510,
target: 10390 });
//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: 10394,
label: 'Institut Pasteur de Nouvelle-Calédonie',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/nouvelle_caledonie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-new-caledonia/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010394,
size: 0.5,
source: 64510,
target: 10394 });
//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: 10392,
label: 'Institut Pasteur du Maroc',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/institut_pasteur_maroc-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-morocco/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010392,
size: 0.5,
source: 64510,
target: 10392 });
//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: 10397,
label: 'Institut Pasteur Korea',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/PF-gallery10-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-korea/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010397,
size: 0.5,
source: 64510,
target: 10397 });
//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: 10376,
label: 'Oswaldo Cruz Foundation',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/Castelo_fiocruz_panoramico-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/oswaldo-cruz-foundation-fiocruz-brazil/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010376,
size: 0.5,
source: 64510,
target: 10376 });
//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: 10398,
label: 'Institut Pasteur of Shanghai, Chinese Academy of Sciences',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/10154916v0m4-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-of-shanghai-chinese-academy-of-sciences/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010398,
size: 0.5,
source: 64510,
target: 10398 });
//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: 10391,
label: 'Institut Pasteur de Montevideo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/20090616a01g-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-montevideo/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6451010391,
size: 0.5,
source: 64510,
target: 10391 });
// 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: 31316,
label: 'PROGRAM_PROJECT: Defeat Dengue',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_image-defeat-dengue-150x150.png',
page_url: 'https://research.pasteur.fr/en/program_project/defeat-dengue/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1038531316,
size: 0.5,
source: 10385,
target: 31316 });
//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: 51234,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 3131651234,
size: 0.5,
source: 31316,
target: 51234 });
//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: 4764,
label: 'Anavaj Sakuntabhai',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_l1000961-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/anavaj-sakuntabhai/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 313164764,
size: 0.5,
source: 31316,
target: 4764 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4881) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 313164881,
size: 0.5,
source: 31316,
target: 4881 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10383) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610383,
size: 0.5,
source: 31316,
target: 10383 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10373) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610373,
size: 0.5,
source: 31316,
target: 10373 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10385) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610385,
size: 0.5,
source: 31316,
target: 10385 });
//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: 10387,
label: 'Institut Pasteur in Ho Chi Minh City',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/VienPasteurHCM-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-in-ho-chi-minh-city-vietnam/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 3131610387,
size: 0.5,
source: 31316,
target: 10387 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10397) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610397,
size: 0.5,
source: 31316,
target: 10397 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10394) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610394,
size: 0.5,
source: 31316,
target: 10394 });
//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: 10388,
label: 'Institut Pasteur du Laos',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/32nd-Institut-Pasteur-Institute-Launched-In-Vientiene-Laos-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/network/institut-pasteur-laos/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 3131610388,
size: 0.5,
source: 31316,
target: 10388 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10376) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 3131610376,
size: 0.5,
source: 31316,
target: 10376 });
// 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: 14686,
label: 'PROGRAM_PROJECT: LabEx IBEID – Integrative Biology of Emerging Infectious Diseases',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_labex-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/program_project/integrative-biology-of-emerging-infectious-diseases/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1038514686,
size: 0.5,
source: 10385,
target: 14686 });
//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: 4779,
label: 'Thierry Planchenault',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/10/research.pasteur.fr_thierry_identité-light1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thierry-planchenault/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 146864779,
size: 0.5,
source: 14686,
target: 4779 });
//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: 3949,
label: 'Philippe Bastin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_philippe_bastin-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/philippe-bastin/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 146863949,
size: 0.5,
source: 14686,
target: 3949 });
//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: 4775,
label: 'Carla Saleh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_ha68-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/carla-saleh/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 146864775,
size: 0.5,
source: 14686,
target: 4775 });
//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: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_img_2799-copy-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marco-vignuzzi/',
x: x_site,
y: y_site,
size: 15,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 146864955,
size: 0.5,
source: 14686,
target: 4955 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 10385) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 10385) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1468610385,
size: 0.5,
source: 14686,
target: 10385 });
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: 40,
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) {
});