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: 4616,
label: 'Guillaume Bouvier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/03/research.pasteur.fr_profile_1-1-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=7
// 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: 186667,
label: 'PROJECT: Energir: Energy dependent iron import by Gram-negative bacteria',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/fr-energir-energy-dependent-iron-import-by-gram-negative-bacteria/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4616186667,
size: 0.5,
source: 4616,
target: 186667,
});
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4623,
label: 'Michael Nilges',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/02/research.pasteur.fr_dsc3513-copy-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/michael-nilges/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1866674623,
size: 0.5,
source: 186667,
target: 4623 });
//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: 4046,
label: 'Sébastien Brier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/11/research_pasteur-dsc_1803_hd.jpg-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sebastien-brier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1866674046,
size: 0.5,
source: 186667,
target: 4046 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 62876,
label: 'Marcel Hollenstein',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/01/research.pasteur.fr_thrashmanlessthrash-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marcel-hollenstein/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 18666762876,
size: 0.5,
source: 186667,
target: 62876 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4611,
label: 'Benjamin Bardiaux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_bardiaux-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/benjamin-bardiaux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1866674611,
size: 0.5,
source: 186667,
target: 4611 });
//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: 117296,
label: 'Maylis Lejeune',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/11/research_pasteur-maylis_2017-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/maylis-lejeune/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 186667117296,
size: 0.5,
source: 186667,
target: 117296 });
//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: 70499,
label: 'Olivier Sperandio',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_sperandio-id-photo-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/olivier-sperandio/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 18666770499,
size: 0.5,
source: 186667,
target: 70499 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1866674616,
size: 0.5,
source: 186667,
target: 4616 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 75573,
label: 'Fabienne Levi-Acobas',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/fabienne-levi-acobas/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 18666775573,
size: 0.5,
source: 186667,
target: 75573 });
//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: 4624,
label: 'Riccardo Pellarin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_myself1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/riccardo-pellarin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1866674624,
size: 0.5,
source: 186667,
target: 4624 });
//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: 157457,
label: 'Maximilian Zinke',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/maximilian-zinke/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 186667157457,
size: 0.5,
source: 186667,
target: 157457 });
//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: 4148,
label: 'Nadia Izadi-Pruneyre',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_photo_site-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/nadia-izadi-pruneyre/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1866674148,
size: 0.5,
source: 186667,
target: 4148 });
// 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: 120003,
label: 'PATENT: Docking method based on saturation transfer difference NMR data, and means for its implementation WO 2019/011987',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/patent/docking-method-based-on-saturation-transfer-difference-nmr-data-and-means-for-its-implementation-wo-2019-011987/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4616120003,
size: 0.5,
source: 4616,
target: 120003,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4148) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1200034148,
size: 0.5,
source: 120003,
target: 4148 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1200034616,
size: 0.5,
source: 120003,
target: 4616 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4161,
label: 'Catherine Simenel',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4161',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1200034161,
size: 0.5,
source: 120003,
target: 4161 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1200034623,
size: 0.5,
source: 120003,
target: 4623 });
// 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: 100820,
label: 'PROJECT: Protein synthesis machinery of Trypanosomatid as a therapeutic target',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/protein-synthesis-machinery-trypanosomatid-therapeutic-target/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4616100820,
size: 0.5,
source: 4616,
target: 100820,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1008204616,
size: 0.5,
source: 100820,
target: 4616 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4695,
label: 'Sophie Vichier-Guerre',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_photo-web-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sophie-vichier-guerre/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1008204695,
size: 0.5,
source: 100820,
target: 4695 });
//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: 8305,
label: 'Laurence Dugue',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_laurencephoto-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/laurence-dugue/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1008208305,
size: 0.5,
source: 100820,
target: 8305 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 117296) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 100820117296,
size: 0.5,
source: 100820,
target: 117296 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4148) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1008204148,
size: 0.5,
source: 100820,
target: 4148 });
//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: 4694,
label: 'Sylvie Pochet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_sans-titre2-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/sylvie-pochet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1008204694,
size: 0.5,
source: 100820,
target: 4694 });
// 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: 35717,
label: 'PROJECT: Binding mode of promising antituberculosis clinical compounds to their bacterial target',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/binding-mode-of-promising-antituberculosis-clinical-compounds-to-their-bacterial-target/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 461635717,
size: 0.5,
source: 4616,
target: 35717,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4161) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 357174161,
size: 0.5,
source: 35717,
target: 4161 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 357174616,
size: 0.5,
source: 35717,
target: 4616 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 357174623,
size: 0.5,
source: 35717,
target: 4623 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4148) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 357174148,
size: 0.5,
source: 35717,
target: 4148 });
// 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: 20689,
label: 'PROJECT: ERC-2011-AdG BAYCELLS',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_erc-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/erc-baycells/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 461620689,
size: 0.5,
source: 4616,
target: 20689,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4611) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206894611,
size: 0.5,
source: 20689,
target: 4611 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4610,
label: 'Quang Tru Huynh',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/quang-tru-huynh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206894610,
size: 0.5,
source: 20689,
target: 4610 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4624) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206894624,
size: 0.5,
source: 20689,
target: 4624 });
//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: 4625,
label: 'Silke Wieninger',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4625',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206894625,
size: 0.5,
source: 20689,
target: 4625 });
//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: 4621,
label: 'Mathias Ferber',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4621',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206894621,
size: 0.5,
source: 20689,
target: 4621 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206894616,
size: 0.5,
source: 20689,
target: 4616 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4617,
label: 'Simeon Carstens',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4617',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206894617,
size: 0.5,
source: 20689,
target: 4617 });
//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: 4614,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206894614,
size: 0.5,
source: 20689,
target: 4614 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206894623,
size: 0.5,
source: 20689,
target: 4623 });
// 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: 20687,
label: 'PROJECT: Bip:Bip',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_bipbiplogo2-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/bipbip/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 461620687,
size: 0.5,
source: 4616,
target: 20687,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874623,
size: 0.5,
source: 20687,
target: 4623 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4615,
label: 'Arnaud Blondel',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/01/research_pasteur-id-a_blondel-c-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/arnaud-blondel/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874615,
size: 0.5,
source: 20687,
target: 4615 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4618,
label: 'Pak-Lee Chau',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/pak-lee-chau/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874618,
size: 0.5,
source: 20687,
target: 4618 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4612,
label: 'Thérèse Malliavin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_3ccf6f5-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/therese-malliavin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874612,
size: 0.5,
source: 20687,
target: 4612 });
//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: 4613,
label: 'Edouard Yeramian',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/02/research_pasteur-edouard-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/edouard-yeramian/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874613,
size: 0.5,
source: 20687,
target: 4613 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4611) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874611,
size: 0.5,
source: 20687,
target: 4611 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4610) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874610,
size: 0.5,
source: 20687,
target: 4610 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4627,
label: 'Nathalie Duclert-Savatier',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/nathalie-duclert-savatier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874627,
size: 0.5,
source: 20687,
target: 4627 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4624) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874624,
size: 0.5,
source: 20687,
target: 4624 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4625) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874625,
size: 0.5,
source: 20687,
target: 4625 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4621) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874621,
size: 0.5,
source: 20687,
target: 4621 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874616,
size: 0.5,
source: 20687,
target: 4616 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4620,
label: 'Nathan Desdouits',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4620',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874620,
size: 0.5,
source: 20687,
target: 4620 });
//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: 4619,
label: 'Isidro Cortes Ciriano',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4619',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874619,
size: 0.5,
source: 20687,
target: 4619 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4617) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874617,
size: 0.5,
source: 20687,
target: 4617 });
//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: 4622,
label: 'Mohamed Machat',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4622',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874622,
size: 0.5,
source: 20687,
target: 4622 });
//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: 4626,
label: 'Damien Monet',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=4626',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206874626,
size: 0.5,
source: 20687,
target: 4626 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4614) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 206874614,
size: 0.5,
source: 20687,
target: 4614 });
//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: 8205,
label: 'Audrey Legendre',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/audrey-legendre/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 206878205,
size: 0.5,
source: 20687,
target: 8205 });
// 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: 6151,
label: 'TEAM: Structural Bioinformatics',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_structural-bioinformatics-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/structural-bioinformatics/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 46166151,
size: 0.5,
source: 4616,
target: 6151,
});
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 144602,
label: 'Céline Dormoy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/07/research_pasteur-enceline-dormoyfrceline-dormoy-img-20210727-110618-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-celine-dormoy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6151144602,
size: 0.5,
source: 6151,
target: 144602 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4610) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514610,
size: 0.5,
source: 6151,
target: 4610 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4615) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514615,
size: 0.5,
source: 6151,
target: 4615 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 70499) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 615170499,
size: 0.5,
source: 6151,
target: 70499 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4616) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514616,
size: 0.5,
source: 6151,
target: 4616 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4618) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514618,
size: 0.5,
source: 6151,
target: 4618 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 4147,
label: 'Florence Cordier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/08/research_pasteur-photo_flo_2019.06.25a_crop-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florence-cordier/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61514147,
size: 0.5,
source: 6151,
target: 4147 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4627) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514627,
size: 0.5,
source: 6151,
target: 4627 });
//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: 187636,
label: 'Constantin Bogdan Ciambur',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/09/research_pasteur-constantin-bogdan-ciambur-research-pasteur-constantin-bogdan-ciambur-microsoftteams-image-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/constantin-bogdan-ciambur/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6151187636,
size: 0.5,
source: 6151,
target: 187636 });
//check if content already exist
if (x_node<0){
x_site = x_node + ((Math.random() * 2)-1) - offset_left;
}else{
x_site = x_node + ((Math.random() * 2)-1) + offset_left;
}
if (y_node<0){
y_site = y_node + ((Math.random() * 2)-1) - offset_left;
}else{
y_site = y_node + ((Math.random() * 2)-1) + offset_left;
}
// adding site
g.nodes.push({
id: 231216,
label: 'Federico Croci',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/federico-croci/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6151231216,
size: 0.5,
source: 6151,
target: 231216 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4623) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61514623,
size: 0.5,
source: 6151,
target: 4623 });
var s = new sigma({
//container: document.getElementById('graph-main'),
graph: g,
renderer: {
// IMPORTANT:
// This works only with the canvas renderer, so the
// renderer type set as "canvas" is necessary here.
container: document.getElementById('graph-main'),
type: 'canvas'
},
settings: {
minNodeSize: 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) {
});