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: 98100,
label: 'Jerome Wong Ng',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/10/research_pasteur-jerome1-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=3
// 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: 95900,
label: 'TEAM: Physics of Biological Function',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/11/research_pasteur-bandeau-unite-t-gregor-v2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/physics-of-biological-functions/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 9810095900,
size: 0.5,
source: 98100,
target: 95900,
});
//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: 149577,
label: 'Isma Bennabi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/11/research_pasteur-isma-bennabi-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/isma-bennabi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900149577,
size: 0.5,
source: 95900,
target: 149577 });
//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: 227450,
label: 'Andrés Cardona',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/andres-cardona/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900227450,
size: 0.5,
source: 95900,
target: 227450 });
//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: 123756,
label: 'Michele Cerminara',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-michele-cerminara-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-michele-cerminara/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900123756,
size: 0.5,
source: 95900,
target: 123756 });
//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: 74046,
label: 'Corinne Chureau',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/07/research_pasteur-corinne-chureau-pommier-research-pasteur-corinne-chureau-pommier-capture-decran-2023-06-16-a-13.00.01-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/corinne-chureau-pommier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 9590074046,
size: 0.5,
source: 95900,
target: 74046 });
//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: 119254,
label: 'Benjamin Devauchelle',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-capture-decran-2019-03-01-a-14.34.49-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/fr-benjamin-devauchelle/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900119254,
size: 0.5,
source: 95900,
target: 119254 });
//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: 227443,
label: 'Sara Formichetti',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/sara-formichetti/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900227443,
size: 0.5,
source: 95900,
target: 227443 });
//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: 185772,
label: 'Leah Friedman',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/08/research_pasteur-leah-friedman-photo-leah-friedman-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/leah-friedman/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900185772,
size: 0.5,
source: 95900,
target: 185772 });
//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: 140312,
label: 'Marcia Peixoto',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/02/research_pasteur-marcia-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/marcia-peixoto/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900140312,
size: 0.5,
source: 95900,
target: 140312 });
//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: 149582,
label: 'Armin Shoushtarizadeh',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/armin-shoushtarizadeh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900149582,
size: 0.5,
source: 95900,
target: 149582 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 98100) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 9590098100,
size: 0.5,
source: 95900,
target: 98100 });
//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: 123751,
label: 'Benjamin Zoller',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/03/research_pasteur-ben-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/benjamin-zoller/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 95900123751,
size: 0.5,
source: 95900,
target: 123751 });
//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: 95285,
label: 'Thomas Gregor',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-gregor_pic2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thomas-gregor/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 9590095285,
size: 0.5,
source: 95900,
target: 95285 });
// 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: 79077,
label: 'TEAM: Biomaterials and Microfluidics',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_biomaterials-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/biomaterials-and-microfluidics/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 9810079077,
size: 0.5,
source: 98100,
target: 79077,
});
//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: 951,
label: 'Emmanuel Frachon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/research_pasteur-emmanuel-frachon-perso2021-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/emmanuel-frachon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077951,
size: 0.5,
source: 79077,
target: 951 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 98100) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 7907798100,
size: 0.5,
source: 79077,
target: 98100 });
//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: 8391,
label: 'Natacha Haikine',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_haikine-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/natacha-haikine/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 790778391,
size: 0.5,
source: 79077,
target: 8391 });
//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: 157885,
label: 'Viacheslav Rusanov',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/04/research_pasteur-viacheslav-rusanov-slava-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/viacheslav-rusanov/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077157885,
size: 0.5,
source: 79077,
target: 157885 });
//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: 165989,
label: 'Bárbara Fonseca',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/09/research_pasteur-barbara-fonseca-cropped-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/barbara-fonseca/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077165989,
size: 0.5,
source: 79077,
target: 165989 });
//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: 106122,
label: 'Minhee Kim',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/06/research_pasteur-pic-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/minhee-kim/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077106122,
size: 0.5,
source: 79077,
target: 106122 });
//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: 4792,
label: 'Nathalie Sauvonnet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/11/research.pasteur.fr_nathaliesauvonnet-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/nathalie-sauvonnet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 790774792,
size: 0.5,
source: 79077,
target: 4792 });
//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: 8458,
label: 'Valérie Malarde',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_malarde-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/valerie-malarde/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 790778458,
size: 0.5,
source: 79077,
target: 8458 });
//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: 193792,
label: 'Remigiusz Walocha',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/05/research_pasteur-e9587e63-61ed-4bad-8e54-1ebe41dcfd07-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/remigiusz-walocha/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077193792,
size: 0.5,
source: 79077,
target: 193792 });
//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: 199718,
label: 'Matthieu Gélin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2023/04/research_pasteur-mugshot-square-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/matthieu-gelin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077199718,
size: 0.5,
source: 79077,
target: 199718 });
//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: 217235,
label: 'Khadija Oukacha',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/01/research_pasteur-oukacha-khadija-3-e1705660891593-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/khadija-oukacha/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077217235,
size: 0.5,
source: 79077,
target: 217235 });
//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: 219019,
label: 'Raphaelle Liquard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2024/01/research_pasteur-1705656379072-e1705669444211-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/raphaelle-liquard__trashed/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077219019,
size: 0.5,
source: 79077,
target: 219019 });
//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: 220173,
label: 'Pol López Pérez',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/pol-lopez-perez/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077220173,
size: 0.5,
source: 79077,
target: 220173 });
//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: 231515,
label: 'Sophie Oatley',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/sophie-oatley/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 79077231515,
size: 0.5,
source: 79077,
target: 231515 });
//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: 6834,
label: 'Samy Gobaa',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-samy-gobaa-gobaa-samy-1510-e1634550888980-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/samy-gobaa/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 790776834,
size: 0.5,
source: 79077,
target: 6834 });
// 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: 6120,
label: 'TEAM: Synthetic Biology',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_institutpasteur_i03590-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/synthetic-biology/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 981006120,
size: 0.5,
source: 98100,
target: 6120,
});
//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: 3959,
label: 'Florence Depardieu',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florence-depardieu/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61203959,
size: 0.5,
source: 6120,
target: 3959 });
//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: 83412,
label: 'Baptiste Saudemont',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/01/research_pasteur-baptiste-saudemont-profile-pic2-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/fr-baptiste-saudemont/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 612083412,
size: 0.5,
source: 6120,
target: 83412 });
//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: 7050,
label: 'Florence Dumonteil',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-florence-dumonteil-capture-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florence-dumonteil/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61207050,
size: 0.5,
source: 6120,
target: 7050 });
//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: 152723,
label: 'Amandine Maire',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/01/research_pasteur-enamandine-maireframandine-photo-amandine-maire-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/amandine-maire/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120152723,
size: 0.5,
source: 6120,
target: 152723 });
//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: 139052,
label: 'Loic Charpenay',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/02/research_pasteur-loic3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/loic-charpenay/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120139052,
size: 0.5,
source: 6120,
target: 139052 });
//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: 167756,
label: 'Fabien Fuche',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/fabien-fuche-2/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120167756,
size: 0.5,
source: 6120,
target: 167756 });
//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: 187839,
label: 'Paul Rochette',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-paul-rochette-index-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/paul-rochette/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120187839,
size: 0.5,
source: 6120,
target: 187839 });
//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: 175824,
label: 'Elena Lopez Rodriguez',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/02/research_pasteur-elena-lopez-rodriguez-dsc-1721-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/elena-lopez-rodriguez-2/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120175824,
size: 0.5,
source: 6120,
target: 175824 });
//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: 187846,
label: 'Beatriz Beamud',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-beatriz-beamud-bba-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/beatriz-beamud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120187846,
size: 0.5,
source: 6120,
target: 187846 });
//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: 190156,
label: 'Fabienne Benz',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/11/research_pasteur-fabienne-benz-dsc0113-passfotoformat-croped-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fabienne-benz/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120190156,
size: 0.5,
source: 6120,
target: 190156 });
//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: 191658,
label: 'Anna Maikova',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/12/research_pasteur-anna-maikova-img-8448-19-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/anna-maikova/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120191658,
size: 0.5,
source: 6120,
target: 191658 });
//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: 207006,
label: 'Christophe Rouillon',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/christophe-rouillon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120207006,
size: 0.5,
source: 6120,
target: 207006 });
//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: 217437,
label: 'Igor Stzepourginski',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/igor-stzepourginski/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120217437,
size: 0.5,
source: 6120,
target: 217437 });
//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: 226332,
label: 'Catherine Fan',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/catherine-fan/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6120226332,
size: 0.5,
source: 6120,
target: 226332 });
//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/en/member/david-bikard/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61203957,
size: 0.5,
source: 6120,
target: 3957 });
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) {
});