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: 4354,
label: 'Elisa Gomez Perdiguero',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_portrait-gomezperdiguero-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=10
// 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: 160048,
label: 'NEWS: The embryonic megakaryopoiesis is a two-tier process',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/05/research_pasteur-the-embryonic-megakaryopoiesis-is-a-two-tier-process-elisa-150x150.png',
page_url: 'https://research.pasteur.fr/en/news/the-embryonic-megakaryopoiesis-is-a-two-tier-process/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4354160048,
size: 0.5,
source: 4354,
target: 160048,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1600484354,
size: 0.5,
source: 160048,
target: 4354 });
//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: 62788,
label: 'Lorea Iturri Torrea',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_lorea-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lorea-iturri-torrea/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 16004862788,
size: 0.5,
source: 160048,
target: 62788 });
//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: 95460,
label: 'Laina Freyer',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-laina-freyer-img-7969-institut-pasteur-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/laina-freyer/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 16004895460,
size: 0.5,
source: 160048,
target: 95460 });
//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: 8370,
label: 'Pascal Dardenne',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_pascal-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/pascal-dardenne/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1600488370,
size: 0.5,
source: 160048,
target: 8370 });
//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: 8371,
label: 'Yvan Lallemand',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_img_0567-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/yvan-lallemand/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1600488371,
size: 0.5,
source: 160048,
target: 8371 });
// 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: 137731,
label: 'PROJECT: ERC-2016-StG _ResidentMacroPhage – Development, Maintenance and Functions of Resident Macrophages',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/erc-2016-stg-_residentmacrophage-development-maintenance-and-functions-of-resident-macrophages/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4354137731,
size: 0.5,
source: 4354,
target: 137731,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 95460) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 13773195460,
size: 0.5,
source: 137731,
target: 95460 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 62788) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 13773162788,
size: 0.5,
source: 137731,
target: 62788 });
//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: 135485,
label: 'Rebeca Ponce Landete',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=135485',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 137731135485,
size: 0.5,
source: 137731,
target: 135485 });
//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: 88711,
label: 'Kémy Ade',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/04/research.pasteur.fr_kemy_ade-1-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/kemy-ade/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 13773188711,
size: 0.5,
source: 137731,
target: 88711 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8371) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1377318371,
size: 0.5,
source: 137731,
target: 8371 });
//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: 149599,
label: 'Tobias Weinberger',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/11/research_pasteur-tobias-weinberger-tobias-weinberger-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/tobias-weinberger/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 137731149599,
size: 0.5,
source: 137731,
target: 149599 });
//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: 135482,
label: 'Alina Sommer',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/11/research_pasteur-alina-sommer_pasteur-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/alina-sommer/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 137731135482,
size: 0.5,
source: 137731,
target: 135482 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1377314354,
size: 0.5,
source: 137731,
target: 4354 });
// 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: 108243,
label: 'EVENT: BDCS Department seminar by Professor Stuart Forbes, Director of the Centre for Regenerative Medicine, Professor of Transplantation and Regenerative Medicine. The University of Edinburgh, UK',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/bdcs-department-seminar-by-professor-stuart-forbes-director-of-the-centre-for-regenerative-medicine-professor-of-transplantation-and-regenerative-medicine-the-university-of-edinburgh-uk/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4354108243,
size: 0.5,
source: 4354,
target: 108243,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1082434354,
size: 0.5,
source: 108243,
target: 4354 });
// 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: 107300,
label: 'EVENT: Seminar by Thomas Wynn, Head of the Early Discovery, Inflammation and Immunology unit, Pfizer Worldwide R&D',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/developmental-and-stem-cell-biology-department-seminar-by-thomas-wynn-head-of-the-early-discovery-inflammation-and-immunology-unit-pfizer-worldwide-rd/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4354107300,
size: 0.5,
source: 4354,
target: 107300,
});
//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: 4229,
label: 'Lucie Peduto',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_lp-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lucie-peduto/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1073004229,
size: 0.5,
source: 107300,
target: 4229 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1073004354,
size: 0.5,
source: 107300,
target: 4354 });
// 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: 85630,
label: 'PROGRAM_PROJECT: Ageing & Longevity',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/program_project/ageing-longevity/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 435485630,
size: 0.5,
source: 4354,
target: 85630,
});
//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: 6816,
label: 'Clementine Schilte',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-clementine-schilte-photo-2022-scaled-e1692277761405-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/clementine-schilte/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 856306816,
size: 0.5,
source: 85630,
target: 6816 });
//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: 4873,
label: 'Miria Ricchetti',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_miria-ricchetti-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/miria-ricchetti/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 856304873,
size: 0.5,
source: 85630,
target: 4873 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 60986,
label: 'Lida Katsimpardi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-dsc1996-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/lida-katsimpardi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 8563060986,
size: 0.5,
source: 85630,
target: 60986 });
// 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: 80984,
label: 'NEWS: SEMINAR ” Parallels between the inflammatory response in wound healing and cancer “',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/12/research.pasteur.fr_paul-martin-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/news/parallels-between-the-inflammatory-response-in-wound-healing-and-cancer/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 435480984,
size: 0.5,
source: 4354,
target: 80984,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 809844354,
size: 0.5,
source: 80984,
target: 4354 });
// 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: 78435,
label: 'NEWS: SEMINAR “Dissection of the gene regulatory network for T-lymphocyte developmental commitment”',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_rothenberg_ellen_175-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/news/seminar-paternal-transmission-of-an-epigenetic-memory-of-germline-from-parents-to-offspring-in-c-elegans/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 435478435,
size: 0.5,
source: 4354,
target: 78435,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 784354354,
size: 0.5,
source: 78435,
target: 4354 });
// 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: 61727,
label: 'NEWS: Elisa Gomez Perdiguero: winner of the 2015 Claude Paoletti Prize',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_elisa-gomez-prix-paoletti-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/news/elisa-gomez-perdiguero-winner-of-the-2015-claude-paoletti-prize/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 435461727,
size: 0.5,
source: 4354,
target: 61727,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 617274354,
size: 0.5,
source: 61727,
target: 4354 });
// 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: 21426,
label: 'PROGRAM_PROJECT: LabEx Revive – Regenerative biology & medicine',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_stem-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/program_project/revive/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 435421426,
size: 0.5,
source: 4354,
target: 21426,
});
//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: 4729,
label: 'Marina Caillet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_marina-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marina-caillet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 214264729,
size: 0.5,
source: 21426,
target: 4729 });
//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: 4876,
label: 'Shahragim Tajbakhsh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-shahragim-tajbakhsh-tajbakhsh-photo2024-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/shahragim-tajbakhsh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 214264876,
size: 0.5,
source: 21426,
target: 4876 });
//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: 4824,
label: 'François Schweisguth',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/05/research_pasteur-fs3-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/francois-schweisguth/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 214264824,
size: 0.5,
source: 21426,
target: 4824 });
//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: 4606,
label: 'Pablo Navarro Gil',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/10/research_pasteur-institut-pasteur_portraits-studio_gcc_162-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/pablo-navarro-gil/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 214264606,
size: 0.5,
source: 21426,
target: 4606 });
//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: 64150,
label: 'Laure Bally-Cuif',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/04/research.pasteur.fr_laure_bally-cuiff-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/laure-bally-cuif/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2142664150,
size: 0.5,
source: 21426,
target: 64150 });
//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: 193569,
label: 'Cecile Martinat (I-Stem, Evry)',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/epartner/cecile-martinat-i-stem-evry/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 21426193569,
size: 0.5,
source: 21426,
target: 193569 });
//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: 194846,
label: 'Alice Jouneau (EPEE – INRAE)',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/epartner/alice-jouneau-embryo-and-pluripotency-epigenetic-and-environment-epee-inrae/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 21426194846,
size: 0.5,
source: 21426,
target: 194846 });
//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: 194872,
label: 'Philippe Menasché (Inserm U970, APHP)',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/01/research_pasteur-menache-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/epartner/philippe-menasche-inserm-u970-hopital-europeen-georges-pompidou/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 21426194872,
size: 0.5,
source: 21426,
target: 194872 });
//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: 194886,
label: 'Raphael Scharfmann (Institut Cochin, Paris)',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/epartner/raphael-scharfmann-institut-cochin-paris/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 21426194886,
size: 0.5,
source: 21426,
target: 194886 });
//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: 194902,
label: 'Frédéric Relaix (Institut Mondor de Recherche Biomédicale – IMRB)',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/01/research_pasteur-fred-relaix-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/epartner/frederic-relaix-institut-mondor-de-recherche-biomedicale-imrb/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 21426194902,
size: 0.5,
source: 21426,
target: 194902 });
// 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: 6113,
label: 'TEAM: Macrophages and Endothelial Cells',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_macrophages-and-endothelial-cells1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/macrophages-and-endothelial-cells/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 43546113,
size: 0.5,
source: 4354,
target: 6113,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8371) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61138371,
size: 0.5,
source: 6113,
target: 8371 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 8370) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61138370,
size: 0.5,
source: 6113,
target: 8370 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 149599) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6113149599,
size: 0.5,
source: 6113,
target: 149599 });
//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: 210362,
label: 'Ramy Elsaid',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/10/research_pasteur-ramy-elsaid-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/ramy-elsaid/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113210362,
size: 0.5,
source: 6113,
target: 210362 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 135482) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6113135482,
size: 0.5,
source: 6113,
target: 135482 });
//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: 174319,
label: 'Clarisabel Garcia',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-clarisabel-garcia-clarisabelgarcia-photo-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/clarisabel-garcia-2/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113174319,
size: 0.5,
source: 6113,
target: 174319 });
//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: 212934,
label: 'Krista Barone',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/11/research_pasteur-enkrista-barone-barone-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/krista-barone/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113212934,
size: 0.5,
source: 6113,
target: 212934 });
//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: 212681,
label: 'Natalie Chan',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/11/research_pasteur-ennatalie-chan-natalie-chan-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/natalie-chan/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113212681,
size: 0.5,
source: 6113,
target: 212681 });
//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: 217190,
label: 'Alésia Arifi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/01/research_pasteur-enalesia-arifi-arifi-alesia-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/alesia-arifi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113217190,
size: 0.5,
source: 6113,
target: 217190 });
//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: 213390,
label: 'Laurie Choux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/11/research_pasteur-ennatalie-chan-choux-laurie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/laurie-choux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6113213390,
size: 0.5,
source: 6113,
target: 213390 });
//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: 8678,
label: 'Cécile Saint Cloment',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_img_0527-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/cecile-saint-cloment/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61138678,
size: 0.5,
source: 6113,
target: 8678 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4354) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61134354,
size: 0.5,
source: 6113,
target: 4354 });
var s = new sigma({
//container: document.getElementById('graph-main'),
graph: g,
renderer: {
// IMPORTANT:
// This works only with the canvas renderer, so the
// renderer type set as "canvas" is necessary here.
container: document.getElementById('graph-main'),
type: 'canvas'
},
settings: {
minNodeSize: 6,
maxNodeSize: 35,
mouseWheelEnabled: false,
font: 'Montserrat',
labelThreshold:25,
borderSize:1,
defaultNodeBorderColor: '#999',
sideMargin:25,
}
});
// We first need to save the original colors of our
// nodes and edges, like this:
s.graph.nodes().forEach(function(n) {
n.originalColor = n.color;
});
s.graph.edges().forEach(function(e) {
e.originalColor = e.color;
});
// When a node is clicked, we check for each node
// if it is a neighbor of the clicked one. If not,
// we set its color as grey, and else, it takes its
// original color.
// We do the same for the edges, and we only keep
// edges that have both extremities colored.
s.bind('clickNode', function(e) {
var nodeId = e.data.node.id,
toKeep = s.graph.neighbors(nodeId);
toKeep[nodeId] = e.data.node;
s.graph.nodes().forEach(function(n) {
if (toKeep[n.id])
n.color = '#35a9f5';
else
n.color = '#dddddd';
});
s.graph.edges().forEach(function(e) {
if (toKeep[e.source] && toKeep[e.target])
e.color = '#35a9f5';
else
e.color = '#dddddd';
});
// Since the data has been modified, we need to
// call the refresh method to make the colors
// update effective.
s.refresh();
});
// When the stage is clicked, we just color each
// node and edge with its original color.
s.bind('clickStage', function(e) {
s.graph.nodes().forEach(function(n) {
n.color = n.originalColor;
});
s.graph.edges().forEach(function(e) {
e.color = e.originalColor;
});
// Same as in the previous event:
s.refresh();
});
s.bind("doubleClickNode", function (e) {
$("#canvas-wrap, .sigma-scene, .sigma-mouse").val();
ajax_load_page( e.data.node.page_url );
});
var c = s.camera;
s.bind("rightClickStage", function (e) {
sigma.misc.animation.camera(c, {
ratio: c.ratio * c.settings('zoomingRatio')
}, {
duration: 200
});
});
// Configure the noverlap layout:
var noverlapListener = s.configNoverlap({
nodeMargin: 10,
scaleNodes: 0.3,
gridSize: 1,
easing: 'quadraticInOut', // animation transition function
duration: 4000 // animation duration. Long here for the purposes of this example only
});
// Bind the events:
noverlapListener.bind('start stop interpolate', function(e) {
//console.log(e.type);
if(e.type === 'start') {
//console.time('noverlap');
}
if(e.type === 'interpolate') {
//console.timeEnd('noverlap');
}
});
// Start the layout:
s.startNoverlap();
//s.refresh();
// Initialize the dragNodes plugin:
var dragListener = sigma.plugins.dragNodes(s, s.renderers[0]);
dragListener.bind('startdrag', function(event) {
});
dragListener.bind('drag', function(event) {
});
dragListener.bind('drop', function(event) {
});
dragListener.bind('dragend', function(event) {
});