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: 1555,
label: 'Adeline Mallet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/research_pasteur-adeline-mallet-sans-titre-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=9
// adding node
var x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
g.nodes.push({
id: 212079,
label: 'EVENT: Ultrastructural BioImaging User meeting',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/ultrastructural-bioimaging-user-meeting/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1555212079,
size: 0.5,
source: 1555,
target: 212079,
});
//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: 1546,
label: 'Perrine Bomme',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_image1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/perrine-bomme/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2120791546,
size: 0.5,
source: 212079,
target: 1546 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2120791555,
size: 0.5,
source: 212079,
target: 1555 });
// 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: 188968,
label: 'EVENT: Amira Software Workshop',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/amira-software-workshop/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1555188968,
size: 0.5,
source: 1555,
target: 188968,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1546) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1889681546,
size: 0.5,
source: 188968,
target: 1546 });
//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: 183032,
label: 'Manuel Majrouh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/06/research_pasteur-manuel-majrouh-img-20220808-135540-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/manuel-majrouh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 188968183032,
size: 0.5,
source: 188968,
target: 183032 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1889681555,
size: 0.5,
source: 188968,
target: 1555 });
// 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: 148609,
label: 'EVENT: PhD thesis defense of Adeline Mallet',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/phd-defense-adeline-mallet/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 1555148609,
size: 0.5,
source: 1555,
target: 148609,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1486091555,
size: 0.5,
source: 148609,
target: 1555 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 3949,
label: 'Philippe Bastin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_philippe_bastin-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/philippe-bastin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1486093949,
size: 0.5,
source: 148609,
target: 3949 });
// 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: 93967,
label: 'TEAM: Ultrastructural BioImaging',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/ultrastruc-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/ultrastructural-bioimaging-core-facility/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155593967,
size: 0.5,
source: 1555,
target: 93967,
});
//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: 36272,
label: 'Cidalia Da Agra',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_photocidalia-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/cidalia-da-agra/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 9396736272,
size: 0.5,
source: 93967,
target: 36272 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1546) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 939671546,
size: 0.5,
source: 93967,
target: 1546 });
//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: 68441,
label: 'Anastasia Gazi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/08/research.pasteur.fr_adgaz-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/anastasia-gazi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 9396768441,
size: 0.5,
source: 93967,
target: 68441 });
//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: 1553,
label: 'Olivier Gorgette',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/04/Olivier-Gorgette-IM011-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/olivier-gorgette/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 939671553,
size: 0.5,
source: 93967,
target: 1553 });
//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: 1557,
label: 'Maryse Moya-Nilges',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/research_pasteur-maryse-moya-nilges-maryse-e1670856755775-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/maryse-moya-nilges/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 939671557,
size: 0.5,
source: 93967,
target: 1557 });
//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: 175061,
label: 'Cyril Scandola',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-cyril-scandola-img-2285-1-scaled-e1643290796323-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/cyril-scandola/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 93967175061,
size: 0.5,
source: 93967,
target: 175061 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 183032) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 93967183032,
size: 0.5,
source: 93967,
target: 183032 });
//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: 79182,
label: 'Esthel Penard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/03/research_pasteur-capture-decran-2020-03-24-a-16.34.18-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/esthel-penard/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 9396779182,
size: 0.5,
source: 93967,
target: 79182 });
//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: 1565,
label: 'Christine Schmitt',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/research_pasteur-christine-schmitt-christine-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/christine-schmitt/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 939671565,
size: 0.5,
source: 93967,
target: 1565 });
//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: 2982,
label: 'Catherine Thouvenot',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/03/DSC9318-e1433491323135-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/catherine-thouvenot/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 939672982,
size: 0.5,
source: 93967,
target: 2982 });
//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: 1551,
label: 'Nadège Cayet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-nadege-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/nadege-cayet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 939671551,
size: 0.5,
source: 93967,
target: 1551 });
//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: 212349,
label: 'Loïck Thibonnier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/11/research_pasteur-enloick-thibonnierfrloick-thibonnier-image003-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/loick-thibonnier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 93967212349,
size: 0.5,
source: 93967,
target: 212349 });
//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: 208166,
label: 'Clémentine Vallee',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/09/research_pasteur-vallee-clementine-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/208166/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 93967208166,
size: 0.5,
source: 93967,
target: 208166 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 939671555,
size: 0.5,
source: 93967,
target: 1555 });
// 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: 87421,
label: 'EVENT: Segmentation with Amira',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/segmentation-with-amira/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155587421,
size: 0.5,
source: 1555,
target: 87421,
});
//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: 1563,
label: 'Anna Sartori-Rupp',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/04/research_pasteur-foto-mia-cut-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/anna-sartori-rupp/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 874211563,
size: 0.5,
source: 87421,
target: 1563 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 874211555,
size: 0.5,
source: 87421,
target: 1555 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 68441) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 8742168441,
size: 0.5,
source: 87421,
target: 68441 });
// 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: 85049,
label: 'PROJECT: FIB-SEM to study anterograde/retrograde transport in the flagellum of trypanosomes.',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/fib-sem-to-study-anterograderetrograde-transport-in-the-flagellum-of-trypanosomes/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155585049,
size: 0.5,
source: 1555,
target: 85049,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 850491555,
size: 0.5,
source: 85049,
target: 1555 });
//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: 2810,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 850492810,
size: 0.5,
source: 85049,
target: 2810 });
// 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: 85044,
label: 'PROJECT: Tunnelling Nanotubes (TNTs) characterization by Correlative Light and cryo-Electron Microscopy',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/tnts-characterization-by-cryoem/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155585044,
size: 0.5,
source: 1555,
target: 85044,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1565) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 850441565,
size: 0.5,
source: 85044,
target: 1565 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 2982) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 850442982,
size: 0.5,
source: 85044,
target: 2982 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1553) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 850441553,
size: 0.5,
source: 85044,
target: 1553 });
//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: 183036,
label: 'Djamel Tahir',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/djamel-tahir/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 85044183036,
size: 0.5,
source: 85044,
target: 183036 });
//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: 4506,
label: 'Valérie Choumet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_dsc3750-coupe-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/valerie-choumet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 850444506,
size: 0.5,
source: 85044,
target: 4506 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 850441555,
size: 0.5,
source: 85044,
target: 1555 });
// 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: 83010,
label: 'EVENT: 2nd FBI CLEM course. Correlative microscopies: theory and applications',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/01/research_pasteur-2nd-fbi-clem-course-correlative-microscopies-theory-and-applications-may29flyer-1-150x150.png',
page_url: 'https://research.pasteur.fr/en/event/2nd-fbi-clem-course-correlative-microscopies-theory-and-applications/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155583010,
size: 0.5,
source: 1555,
target: 83010,
});
//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: 84424,
label: 'Jean-Marc Verbavatz',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_jmv2015-square-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/epartner/jean-marc-verbavatz/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 8301084424,
size: 0.5,
source: 83010,
target: 84424 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1563) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 830101563,
size: 0.5,
source: 83010,
target: 1563 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1555) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 830101555,
size: 0.5,
source: 83010,
target: 1555 });
//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: 84238,
label: 'Xavier Heiligenstein',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_xavier-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/epartner/xavier-heiligenstein/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 8301084238,
size: 0.5,
source: 83010,
target: 84238 });
//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: 84658,
label: 'Ilse Hurbain',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_ilse-hurbain-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/epartner/ilse-hurbain/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 8301084658,
size: 0.5,
source: 83010,
target: 84658 });
//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: 84250,
label: 'Graça Raposo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_raposo.png',
page_url: 'https://research.pasteur.fr/en/epartner/graca-raposo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 8301084250,
size: 0.5,
source: 83010,
target: 84250 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 68441) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 8301068441,
size: 0.5,
source: 83010,
target: 68441 });
// 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: 14686,
label: 'PROGRAM_PROJECT: LabEx IBEID – Integrative Biology of Emerging Infectious Diseases',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_labex-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/program_project/integrative-biology-of-emerging-infectious-diseases/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 155514686,
size: 0.5,
source: 1555,
target: 14686,
});
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 203306,
label: 'Cyril Renassia',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/06/research_pasteur-cyril-renassia-photo-cv-2023-cropped-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/cyril-renassia/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 14686203306,
size: 0.5,
source: 14686,
target: 203306 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3949) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 146863949,
size: 0.5,
source: 14686,
target: 3949 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4775,
label: 'Carla Saleh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_ha68-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/carla-saleh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 146864775,
size: 0.5,
source: 14686,
target: 4775 });
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) {
});