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: 70664,
label: 'Chemoinformatics and proteochemometrics',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research_pasteur-group-olivier-sperandio-groupe-o-sperandio-150x150.png',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
N=6
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: 97155,
label: 'Alexandra Moine-Franel',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/11/research_pasteur-njkxotgw-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/alexandra-moine-franel/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 7066497155,
size: 0.5,
source: 70664,
target: 97155 });
//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: 138250,
label: 'Luis Checa Ruano',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/01/research_pasteur-cupfg7mx-udifpkhke7evsdzfrg-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/luis-checa-ruano/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 70664138250,
size: 0.5,
source: 70664,
target: 138250 });
//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: 187636,
label: 'Constantin Bogdan Ciambur',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-constantin-bogdan-ciambur-research-pasteur-constantin-bogdan-ciambur-microsoftteams-image-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/constantin-bogdan-ciambur/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 70664187636,
size: 0.5,
source: 70664,
target: 187636 });
//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: 202174,
label: 'Xiaosong Liu',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/05/research_pasteur-xiaosong-liu-1-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/xiaosong-liu/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 70664202174,
size: 0.5,
source: 70664,
target: 202174 });
//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: 208736,
label: 'Anuradha Kar',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/09/research_pasteur-enanuradha-karfranuradha-kar-img-20230913-172712-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/anuradha-kar/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 70664208736,
size: 0.5,
source: 70664,
target: 208736 });
//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: 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/fr/member/olivier-sperandio/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 7066470499,
size: 0.5,
source: 70664,
target: 70499 });
// update positions
x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
N=11
// 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: 194643,
label: 'PROGRAM_PROJECT: Intelligence Artificielle à l’Institut Pasteur',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/program_project/artificial-intelligence-and-machine-learning-at-the-institut-pasteur/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664194643,
size: 0.5,
source: 70664,
target: 194643 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 58995,
label: 'Mallory Perrin-Wolff',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/05/research_pasteur-mallory-perrin-wolff-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/mallory-perrin-wolff/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 19464358995,
size: 0.5,
source: 194643,
target: 58995 });
//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: 187008,
label: 'Elodie Dandelot',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-elodie-dandelot-1516808045836-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/elodie-dandelot/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 194643187008,
size: 0.5,
source: 194643,
target: 187008 });
//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: 195170,
label: 'Laura Cantini',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/01/research_pasteur-laura-cantini-lauracantini-33-modifier-hdprint-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/laura-cantini/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 194643195170,
size: 0.5,
source: 194643,
target: 195170 });
//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: 3957,
label: 'David Bikard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_photo_cropped-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/david-bikard/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1946433957,
size: 0.5,
source: 194643,
target: 3957 });
//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: 119690,
label: 'Rayan Chikhi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/05/research_pasteur-photo_pasteur-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/rayan-chikhi/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 194643119690,
size: 0.5,
source: 194643,
target: 119690 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 19464370499,
size: 0.5,
source: 194643,
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: 50133,
label: 'Jean-Baptiste Masson',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/06/research_pasteur-jbm_photo_serieux_low_res-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/jean-baptiste-masson/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 19464350133,
size: 0.5,
source: 194643,
target: 50133 });
//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: 117326,
label: 'Max Bonomi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-njkzmdmz-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/massimiliano-bonomi/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 194643117326,
size: 0.5,
source: 194643,
target: 117326 });
//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: 3968,
label: 'Roberto Toro',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_toror-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/roberto-toro/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1946433968,
size: 0.5,
source: 194643,
target: 3968 });
//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/fr/member/christophe-zimmer/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1946434977,
size: 0.5,
source: 194643,
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: 191920,
label: 'EVENT: Excellence in Molecular Design – A joint French Society for Medicinal Chemistry, Evotec & Institut Pasteur Symposium',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/save-the-date-excellence-in-molecular-design-a-joint-institut-pasteur-societe-de-chimie-therapeutique-evotec-symposium/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664191920,
size: 0.5,
source: 70664,
target: 191920 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 19192070499,
size: 0.5,
source: 191920,
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: 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/fr/member/emilie-boutet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 191920161202,
size: 0.5,
source: 191920,
target: 161202 });
// 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: 160998,
label: 'PROGRAM_PROJECT: Le criblage de molécules à l’Institut Pasteur',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/program_project/drug-discovery-screening-at-institut-pasteur/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664160998,
size: 0.5,
source: 70664,
target: 160998 });
//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 == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//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/fr/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/fr/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/fr/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/fr/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/fr/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/fr/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/fr/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
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//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/fr/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
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4977) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1609984977,
size: 0.5,
source: 160998,
target: 4977 });
// 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: 179140,
label: 'PROJECT: TheraEPI',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/project/theraepi/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664179140,
size: 0.5,
source: 70664,
target: 179140 });
//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: 4009,
label: 'Carmen Buchrieser',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_carmen1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/carmen-buchrieser/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1791404009,
size: 0.5,
source: 179140,
target: 4009 });
//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: 4851,
label: 'Agathe Subtil',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_photo-a-subtil-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/agathe-subtil/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1791404851,
size: 0.5,
source: 179140,
target: 4851 });
//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: 1791404087,
size: 0.5,
source: 179140,
target: 4087 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 17914070499,
size: 0.5,
source: 179140,
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: 1056,
label: 'Mariette Matondo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/Mariette_Matondo-e1424076805247-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/mariette-matondo-bouzanda/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1791401056,
size: 0.5,
source: 179140,
target: 1056 });
//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/fr/member/paola-arimondo/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 17914095915,
size: 0.5,
source: 179140,
target: 95915 });
// 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: 129502,
label: 'PROJECT: AntiBronchio',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/07/research_pasteur-screen-shot-2019-07-17-at-15.22.42-150x150.png',
page_url: 'https://research.pasteur.fr/fr/project/antibronchio/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664129502,
size: 0.5,
source: 70664,
target: 129502 });
//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: 129504,
label: 'Christina Sizun',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/epartner/christina-sizun/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 129502129504,
size: 0.5,
source: 129502,
target: 129504 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 97155) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 12950297155,
size: 0.5,
source: 129502,
target: 97155 });
//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: 123967,
label: 'Karen Druart',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-karen-druart-img-20210902-124522-1-scaled-e1669379413893-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/karen-druart/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 129502123967,
size: 0.5,
source: 129502,
target: 123967 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 12950270499,
size: 0.5,
source: 129502,
target: 70499 });
// 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: 111002,
label: 'TOOL: Chem-REST',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/02/research_pasteur-chem-rest-2-150x150.png',
page_url: 'https://research.pasteur.fr/fr/tool/bd-chem/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664111002,
size: 0.5,
source: 70664,
target: 111002 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 11100270499,
size: 0.5,
source: 111002,
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: 104972,
label: 'Bryan Brancotte',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/03/research_pasteur-me-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/bryan-brancotte/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 111002104972,
size: 0.5,
source: 111002,
target: 104972 });
//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: 6820,
label: 'Hervé Menager',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/10/research.pasteur.fr_face-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/herve-menager/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1110026820,
size: 0.5,
source: 111002,
target: 6820 });
//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: 109876,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 111002109876,
size: 0.5,
source: 111002,
target: 109876 });
//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: 104801,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 111002104801,
size: 0.5,
source: 111002,
target: 104801 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 123967) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 111002123967,
size: 0.5,
source: 111002,
target: 123967 });
// 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: 105563,
label: 'PROJECT: TARGETBONE',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/03/research_pasteur-screen-shot-2018-03-21-at-16.27.25-150x150.png',
page_url: 'https://research.pasteur.fr/fr/project/targetbone/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 70664105563,
size: 0.5,
source: 70664,
target: 105563 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 10556370499,
size: 0.5,
source: 105563,
target: 70499 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 123967) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 105563123967,
size: 0.5,
source: 105563,
target: 123967 });
//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: 105568,
label: 'Martine Cohen-Solal',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/martine-cohen-solal/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 105563105568,
size: 0.5,
source: 105563,
target: 105568 });
// 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: 78207,
label: 'TOOL: iPPI-DB Initiative',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/10/research_pasteur-ippi-db-initiative-image-150x150.png',
page_url: 'https://research.pasteur.fr/fr/tool/ippi-db-initiative/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 7066478207,
size: 0.5,
source: 70664,
target: 78207 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6820) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 782076820,
size: 0.5,
source: 78207,
target: 6820 });
//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: 6823,
label: 'Olivia Doppelt-Azeroual',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_olivia-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/olivia-doppelt-azeroual/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 782076823,
size: 0.5,
source: 78207,
target: 6823 });
//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: 7763,
label: 'Rachel Torchet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_rachelgrandintorchet-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/rachel-torchet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 782077763,
size: 0.5,
source: 78207,
target: 7763 });
//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: 6830,
label: 'Fabien Mareuil',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_imag0560_1_2-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/fabien-mareuil/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 782076830,
size: 0.5,
source: 78207,
target: 6830 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 97155) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 7820797155,
size: 0.5,
source: 78207,
target: 97155 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 104801) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 78207104801,
size: 0.5,
source: 78207,
target: 104801 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 104972) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 78207104972,
size: 0.5,
source: 78207,
target: 104972 });
//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: 120417,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 78207120417,
size: 0.5,
source: 78207,
target: 120417 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 123967) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 78207123967,
size: 0.5,
source: 78207,
target: 123967 });
//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: 81978,
label: 'Hélène Borges',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/helene-borges/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 7820781978,
size: 0.5,
source: 78207,
target: 81978 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 138250) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 78207138250,
size: 0.5,
source: 78207,
target: 138250 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 7820770499,
size: 0.5,
source: 78207,
target: 70499 });
// 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: 70875,
label: 'PROJECT: PPI-Chem',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_group-olivier-sperandio-2-150x150.png',
page_url: 'https://research.pasteur.fr/fr/project/ppi-chem/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 7066470875,
size: 0.5,
source: 70664,
target: 70875 });
//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: 70660,
label: 'Nicolas Bosc',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_njkwntgx-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/nicolas-bosc/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 7087570660,
size: 0.5,
source: 70875,
target: 70660 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 7087570499,
size: 0.5,
source: 70875,
target: 70499 });
// adding node
var x_node = Math.cos(2 * 9 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 9 * Math.PI / N) * 10;
g.nodes.push({
id: 6151,
label: 'TEAM: Bioinformatique structurale',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_structural-bioinformatics-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/team/structural-bioinformatics/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 706646151,
size: 0.5,
source: 70664,
target: 6151 });
//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: 144602,
label: 'Céline Dormoy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/07/research_pasteur-enceline-dormoyfrceline-dormoy-img-20210727-110618-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/fr-celine-dormoy/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6151144602,
size: 0.5,
source: 6151,
target: 144602 });
//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: 4610,
label: 'Quang Tru Huynh',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/quang-tru-huynh/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514610,
size: 0.5,
source: 6151,
target: 4610 });
//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: 4615,
label: 'Arnaud Blondel',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/01/research_pasteur-id-a_blondel-c-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/arnaud-blondel/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514615,
size: 0.5,
source: 6151,
target: 4615 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 615170499,
size: 0.5,
source: 6151,
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: 4616,
label: 'Guillaume Bouvier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/03/research.pasteur.fr_profile_1-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/guillaume-bouvier/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514616,
size: 0.5,
source: 6151,
target: 4616 });
//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: 4618,
label: 'Pak-Lee Chau',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/pak-lee-chau/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514618,
size: 0.5,
source: 6151,
target: 4618 });
//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: 4147,
label: 'Florence Cordier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/08/research_pasteur-photo_flo_2019.06.25a_crop-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/florence-cordier/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514147,
size: 0.5,
source: 6151,
target: 4147 });
//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: 4627,
label: 'Nathalie Duclert-Savatier',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/nathalie-duclert-savatier/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514627,
size: 0.5,
source: 6151,
target: 4627 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 187636) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151187636,
size: 0.5,
source: 6151,
target: 187636 });
//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: 231216,
label: 'Federico Croci',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/federico-croci/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6151231216,
size: 0.5,
source: 6151,
target: 231216 });
//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: 231730,
label: 'Zachariah Pieter Schuurs',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/zachariah-pieter-schuurs/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6151231730,
size: 0.5,
source: 6151,
target: 231730 });
//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: 232759,
label: 'Pauline Remont',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/pauline-remont/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6151232759,
size: 0.5,
source: 6151,
target: 232759 });
//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: 233953,
label: 'Arthur Carré',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/arthur-carre/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6151233953,
size: 0.5,
source: 6151,
target: 233953 });
//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: 4623,
label: 'Michael Nilges',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_dsc3513-copy-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/michael-nilges/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61514623,
size: 0.5,
source: 6151,
target: 4623 });
// adding node
var x_node = Math.cos(2 * 10 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 10 * Math.PI / N) * 10;
g.nodes.push({
id: 6151,
label: 'TEAM: Bioinformatique structurale',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_structural-bioinformatics-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/team/structural-bioinformatics/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 706646151,
size: 0.5,
source: 70664,
target: 6151 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 144602) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151144602,
size: 0.5,
source: 6151,
target: 144602 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4610) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514610,
size: 0.5,
source: 6151,
target: 4610 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4615) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514615,
size: 0.5,
source: 6151,
target: 4615 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 615170499,
size: 0.5,
source: 6151,
target: 70499 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514616,
size: 0.5,
source: 6151,
target: 4616 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4618) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514618,
size: 0.5,
source: 6151,
target: 4618 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4147) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514147,
size: 0.5,
source: 6151,
target: 4147 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4627) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514627,
size: 0.5,
source: 6151,
target: 4627 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 187636) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151187636,
size: 0.5,
source: 6151,
target: 187636 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 231216) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151231216,
size: 0.5,
source: 6151,
target: 231216 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 231730) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151231730,
size: 0.5,
source: 6151,
target: 231730 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 232759) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151232759,
size: 0.5,
source: 6151,
target: 232759 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 233953) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 6151233953,
size: 0.5,
source: 6151,
target: 233953 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 70664) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 61514623,
size: 0.5,
source: 6151,
target: 4623 });
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) {
});