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: 112337,
label: 'Elric Esposito',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/08/research_pasteur-elric-esposito-eelarge-1-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=4
// 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: 205717,
label: 'EVENT: Inauguration new BSL2 imaging lab',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/inauguration-new-bsl2-imaging-lab/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 112337205717,
size: 0.5,
source: 112337,
target: 205717,
});
//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: 1585,
label: 'Anne Danckaert',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/anne-danckaert/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2057171585,
size: 0.5,
source: 205717,
target: 1585 });
//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: 106754,
label: 'Lesly Raulin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/06/research_pasteur-sans-titre-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/lesly-raulin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 205717106754,
size: 0.5,
source: 205717,
target: 106754 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 112337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 205717112337,
size: 0.5,
source: 205717,
target: 112337 });
//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: 3952,
label: 'Christelle Travaillé',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-christelle-travaille-20240607-145817-e1717766347618-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/christelle-travaille/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2057173952,
size: 0.5,
source: 205717,
target: 3952 });
//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: 165850,
label: 'Nassim Mahtal',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/nassim-mahtal/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 205717165850,
size: 0.5,
source: 205717,
target: 165850 });
//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: 193310,
label: 'Yumi Gosselin',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/yumi-gosselin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 205717193310,
size: 0.5,
source: 205717,
target: 193310 });
//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: 2226,
label: 'Audrey Salles',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/03/research_pasteur-audrey-salles-audrey-202-crop-300-v5-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/audrey-salles/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2057172226,
size: 0.5,
source: 205717,
target: 2226 });
//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: 75430,
label: 'Julien Fernandes',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/10/research_pasteur-photo_jf-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/julien-fernandes/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 20571775430,
size: 0.5,
source: 205717,
target: 75430 });
//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: 2232,
label: 'Nathalie Aulner',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_dsc03316-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/nathalie-aulner/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2057172232,
size: 0.5,
source: 205717,
target: 2232 });
//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: 20571736272,
size: 0.5,
source: 205717,
target: 36272 });
//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: 1589,
label: 'Spencer Shorte',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/spencer-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/spencer-shorte/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2057171589,
size: 0.5,
source: 205717,
target: 1589 });
// 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: 179563,
label: 'NEWS: New publication – The tumor suppressor Adenomatous polyposis coli regulates T lymphocyte migration',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/news/new-publication-the-tumor-suppressor-adenomatous-polyposis-coli-regulates-t-lymphocyte-migration/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 112337179563,
size: 0.5,
source: 112337,
target: 179563,
});
//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: 97313,
label: 'Marta Mastrogiovanni',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/11/research_pasteur-691962-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marta-mastrogiovanni/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 17956397313,
size: 0.5,
source: 179563,
target: 97313 });
//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: 836,
label: 'Thierry Rose',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/Thierry_Rose-e1423234985507-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thierry-rose/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 179563836,
size: 0.5,
source: 179563,
target: 836 });
//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: 8213,
label: 'Céline Cuche',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_celine-cuche-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/celine-cuche/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795638213,
size: 0.5,
source: 179563,
target: 8213 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 112337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 179563112337,
size: 0.5,
source: 179563,
target: 112337 });
//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: 62717,
label: 'Marie Juzans',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=62717',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 17956362717,
size: 0.5,
source: 179563,
target: 62717 });
//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: 8600,
label: 'Hélène Laude',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/10/research_pasteur-photo_helene_laude-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/helene-laude/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795638600,
size: 0.5,
source: 179563,
target: 8600 });
//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: 1041,
label: 'Sophie Goyard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/02/research_pasteur-sophie-goyard-goyard-sophie-0463-scaled-e1666255960637-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sophie-goyard/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795631041,
size: 0.5,
source: 179563,
target: 1041 });
//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: 7878,
label: 'Marie-Noelle Ungeheuer',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_institutpasteur_43070-e1437491181428-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marie-noelle-ungeheuer/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795637878,
size: 0.5,
source: 179563,
target: 7878 });
//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: 3907,
label: 'Andres Alcover',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/05/research_pasteur-andres-dinner-cs-2016-03_coupee_grde3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/andres-alcover/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795633907,
size: 0.5,
source: 179563,
target: 3907 });
//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: 3910,
label: 'Vincenzo Di Bartolo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_vdibartolo_pic-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/vincenzo-di-bartolo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1795633910,
size: 0.5,
source: 179563,
target: 3910 });
// 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: 171833,
label: 'NEWS: New two-photon microscope open for new projects at Photonic Bio Imaging Facility ',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/news/new-two-photon-microscope-open-for-new-projects-at-photonic-bio-imaging-facility/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 112337171833,
size: 0.5,
source: 112337,
target: 171833,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 112337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 171833112337,
size: 0.5,
source: 171833,
target: 112337 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 75430) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 17183375430,
size: 0.5,
source: 171833,
target: 75430 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1589) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1718331589,
size: 0.5,
source: 171833,
target: 1589 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 2232) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1718332232,
size: 0.5,
source: 171833,
target: 2232 });
// 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: 94012,
label: 'TEAM: Photonic BioImaging (UTechS PBI)',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2014/09/Neuron-spark-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/photonic-bioimaging-utechs-pbi/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 11233794012,
size: 0.5,
source: 112337,
target: 94012,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1585) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 940121585,
size: 0.5,
source: 94012,
target: 1585 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 2226) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 940122226,
size: 0.5,
source: 94012,
target: 2226 });
//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: 4783,
label: 'Régis Tournebize',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_dsc02236_rt2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/regis-tournebize/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 940124783,
size: 0.5,
source: 94012,
target: 4783 });
//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: 2255,
label: 'Brigitte David-Watine',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/brigitte-david-watine/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 940122255,
size: 0.5,
source: 94012,
target: 2255 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 36272) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 9401236272,
size: 0.5,
source: 94012,
target: 36272 });
//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: 4199,
label: 'Florian Ruckerl',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/08/research.pasteur.fr_florianr-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florian-ruckerl/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 940124199,
size: 0.5,
source: 94012,
target: 4199 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 75430) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 9401275430,
size: 0.5,
source: 94012,
target: 75430 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 112337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 94012112337,
size: 0.5,
source: 94012,
target: 112337 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 106754) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 94012106754,
size: 0.5,
source: 94012,
target: 106754 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 3952) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 940123952,
size: 0.5,
source: 94012,
target: 3952 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 165850) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 94012165850,
size: 0.5,
source: 94012,
target: 165850 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 193310) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 94012193310,
size: 0.5,
source: 94012,
target: 193310 });
//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: 4976,
label: 'Florian Muller',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-florian-muller-mueller-florian-picture-2023-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/florian-muller/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 940124976,
size: 0.5,
source: 94012,
target: 4976 });
//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: 179429,
label: 'Maria Isabella Gariboldi',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/04/research_pasteur-maria-isabella-gariboldi-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/maria-isabella-gariboldi/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 94012179429,
size: 0.5,
source: 94012,
target: 179429 });
//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: 189004,
label: 'Thomas Defard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/10/research_pasteur-photo-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/thomas-defard/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 94012189004,
size: 0.5,
source: 94012,
target: 189004 });
//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: 4982,
label: 'Christian Weber',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_christianweber-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/christian-weber/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 940124982,
size: 0.5,
source: 94012,
target: 4982 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 1589) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 940121589,
size: 0.5,
source: 94012,
target: 1589 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 2232) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 940122232,
size: 0.5,
source: 94012,
target: 2232 });
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) {
});