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
// graph team
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: 6191,
label: 'Archived: Molecular Biology of Gene in Extremophiles',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_molecular-biology-of-gene-in-extremophiles-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
N=9
var x_node = Math.cos(2 * 0 * Math.PI / N) * 2;
var y_node = Math.sin(2 * 0 * Math.PI / N) * 2;
var biggest_node_size = 0;
//check if content already exist
x_site = Math.cos(2 * 0 * Math.PI / N) * 2;
y_site = Math.sin(2 * 0 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 4282,
label: 'Laurent Debarbieux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_ld-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/laurent-debarbieux/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61914282,
size: 0.5,
source: 6191,
target: 4282 });
//check if content already exist
x_site = Math.cos(2 * 1 * Math.PI / N) * 2;
y_site = Math.sin(2 * 1 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 4289,
label: 'David Prangishvili',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_dav-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/david-prangishvili/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61914289,
size: 0.5,
source: 6191,
target: 4289 });
//check if content already exist
x_site = Math.cos(2 * 2 * Math.PI / N) * 2;
y_site = Math.sin(2 * 2 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 78458,
label: 'Virginija Cvirkaite-Krupovic',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/10/research.pasteur.fr_vg-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/virginija-cvirkaite-krupovic/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 619178458,
size: 0.5,
source: 6191,
target: 78458 });
//check if content already exist
x_site = Math.cos(2 * 3 * Math.PI / N) * 2;
y_site = Math.sin(2 * 3 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 7054,
label: 'Ana Cova Rodrigues',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_anacova-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/ana-cova-rodrigues/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61917054,
size: 0.5,
source: 6191,
target: 7054 });
//check if content already exist
x_site = Math.cos(2 * 4 * Math.PI / N) * 2;
y_site = Math.sin(2 * 4 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 126125,
label: 'Diana Paola Baquero Uriza',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/01/research_pasteur-untitled-2-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/diana-paola-baquero-uriza/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6191126125,
size: 0.5,
source: 6191,
target: 126125 });
//check if content already exist
x_site = Math.cos(2 * 5 * Math.PI / N) * 2;
y_site = Math.sin(2 * 5 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 126121,
label: 'Junfeng Liu',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/01/research_pasteur-untitled-5-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/junfeng-liu/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6191126121,
size: 0.5,
source: 6191,
target: 126121 });
//check if content already exist
x_site = Math.cos(2 * 6 * Math.PI / N) * 2;
y_site = Math.sin(2 * 6 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 97577,
label: 'Mathieu De Jode',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=97577',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 619197577,
size: 0.5,
source: 6191,
target: 97577 });
//check if content already exist
x_site = Math.cos(2 * 7 * Math.PI / N) * 2;
y_site = Math.sin(2 * 7 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 109684,
label: 'Quentin Lamy-Besnier',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=109684',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 6191109684,
size: 0.5,
source: 6191,
target: 109684 });
//check if content already exist
x_site = Math.cos(2 * 8 * Math.PI / N) * 2;
y_site = Math.sin(2 * 8 * Math.PI / N) * 2;
// adding site
g.nodes.push({
id: 4287,
label: 'Mart Krupovic',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/05/research_pasteur-mart_krupovic-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/mart-krupovic/',
x: x_site,
y: y_site,
size: 16,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 61914287,
size: 0.5,
source: 6191,
target: 4287 });
// update positions
x_node = Math.cos(2 * 0 * Math.PI / N) * 10;
y_node = Math.sin(2 * 0 * Math.PI / N) * 10;
N=13
// 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: 126787,
label: 'EVENT: DPT Microbiologie – soutenance de thèse Sofia MEDVEDEVA : Natural Diversity of CRISPR spacers',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/dpt-microbiologie-soutenance-de-these-sofia-medvedeva-natural-diversity-of-crispr-spacers/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191126787,
size: 0.5,
source: 6191,
target: 126787 });
//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: 126114,
label: 'Sofia Medvedeva',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/05/research_pasteur-sofia-medvedeva-photo-e1631627744382-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sofia-medvedeva/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 126787126114,
size: 0.5,
source: 126787,
target: 126114 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4287) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1267874287,
size: 0.5,
source: 126787,
target: 4287 });
// 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: 125872,
label: 'EVENT: Seminar DPT Microbiology ‘Works in Progress’ by Anthony WOO : ‘A tale of two viral lineages : evolution of viruses and the cellular universal tree of life.',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/seminar-dpt-microbiology-works-in-progress-by-anthony-woo-a-tale-of-two-viral-lineages-evolution-of-viruses-and-the-cellular-universal-tree-of-life/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191125872,
size: 0.5,
source: 6191,
target: 125872 });
//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: 4118,
label: 'Hilde De Reuse',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/06/research.pasteur.fr_hilde_de_reuse-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/hilde-de-reuse/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1258724118,
size: 0.5,
source: 125872,
target: 4118 });
// 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: 125182,
label: 'EVENT: Thesis defense – Marta MANSOS LOURENCO : Deciphering in vivo efficacy of virulent phages in the mammalian gut.',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/thesis-defense-marta-mansos-lourenco-deciphering-in-vivo-efficacy-of-virulent-phages-in-the-mammalian-gut/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191125182,
size: 0.5,
source: 6191,
target: 125182 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1251824282,
size: 0.5,
source: 125182,
target: 4282 });
// 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: 125192,
label: 'EVENT: Microbiology DPT seminar by Laurent DEBARBIEUX : Tripartite interactions between the host, the bacterium and the bacteriophage (The Good, the Bad and the Ugly ?).',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/microbiology-dpt-seminar-by-laurent-debarbieux-tripartite-interactions-between-the-host-the-bacterium-and-the-bacteriophage-the-good-the-bad-and-the-ugly/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191125192,
size: 0.5,
source: 6191,
target: 125192 });
// 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: 101834,
label: 'EVENT: LUCA and the universal tree of life: an update',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/luca-universal-tree-life-update/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191101834,
size: 0.5,
source: 6191,
target: 101834 });
//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: 4355,
label: 'Ivo Gomperts Boneca',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-ivo-gomperts-boneca-p9090188-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/ivo-gomperts-boneca/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1018344355,
size: 0.5,
source: 101834,
target: 4355 });
//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: 4284,
label: 'Patrick Forterre',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_patrick-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/patrick-forterre/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1018344284,
size: 0.5,
source: 101834,
target: 4284 });
// 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: 100797,
label: 'EVENT: Department of Microbiology – Seminar “Journal Club”',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/department-microbiology-seminar-journal-club-morgan-gaia/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191100797,
size: 0.5,
source: 6191,
target: 100797 });
//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: 4279,
label: 'Pierre Beguin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_pierre_beguin-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/pierre-beguin/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1007974279,
size: 0.5,
source: 100797,
target: 4279 });
//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: 4679,
label: 'Nadia Benaroudj',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/10/research.pasteur.fr_benaroudj-nadia-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/nadia-benaroudj/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 1007974679,
size: 0.5,
source: 100797,
target: 4679 });
// 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: 100786,
label: 'EVENT: Department of Microbiology – Seminar “Journal Club”',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/department-microbiology-seminar-journal-club-pierre-beguin/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6191100786,
size: 0.5,
source: 6191,
target: 100786 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4279) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1007864279,
size: 0.5,
source: 100786,
target: 4279 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4679) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 1007864679,
size: 0.5,
source: 100786,
target: 4679 });
// adding node
var x_node = Math.cos(2 * 7 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 7 * Math.PI / N) * 10;
g.nodes.push({
id: 88785,
label: 'EVENT: “Comprehensive study of new virulent bacteriophages: From transcriptomic and mechanistic characterisations towards evolutionary perspectives” by Anne CHEVALLEREAU',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/event/comprehensive-study-of-new-virulent-bacteriophages-from-transcriptomic-and-mechanistic-characterisations-towards-evolutionary-perspectives-by-anne-chevallereau/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619188785,
size: 0.5,
source: 6191,
target: 88785 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 887854282,
size: 0.5,
source: 88785,
target: 4282 });
//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: 4292,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 887854292,
size: 0.5,
source: 88785,
target: 4292 });
// adding node
var x_node = Math.cos(2 * 8 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 8 * Math.PI / N) * 10;
g.nodes.push({
id: 77652,
label: 'PROJECT: Bacteriophage gene expression by RNA-Seq',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/bacteriophage-gene-expression-by-rna-seq/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619177652,
size: 0.5,
source: 6191,
target: 77652 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4292) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 776524292,
size: 0.5,
source: 77652,
target: 4292 });
//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: 4219,
label: 'Marc Monot',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_marc_icone-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marc-monot/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 776524219,
size: 0.5,
source: 77652,
target: 4219 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 776524282,
size: 0.5,
source: 77652,
target: 4282 });
// adding node
var x_node = Math.cos(2 * 9 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 9 * Math.PI / N) * 10;
g.nodes.push({
id: 67943,
label: 'PROJECT: EVOMOBIL-ERC Grant Agreement no. 340440 Co-evolution of viruses, plasmids and cells in Archaea: pattern and process',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/04/research.pasteur.fr_logo-erc-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/evomobil-erc-grant-agreement-no-340440-co-evolution-of-viruses-plasmids-and-cells-in-archaea-pattern-and-process/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619167943,
size: 0.5,
source: 6191,
target: 67943 });
//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: 4281,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 679434281,
size: 0.5,
source: 67943,
target: 4281 });
//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: 4285,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 679434285,
size: 0.5,
source: 67943,
target: 4285 });
//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: 8290,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 679438290,
size: 0.5,
source: 67943,
target: 8290 });
//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: 4280,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 679434280,
size: 0.5,
source: 67943,
target: 4280 });
//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: 102241,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 67943102241,
size: 0.5,
source: 67943,
target: 102241 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4284) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 679434284,
size: 0.5,
source: 67943,
target: 4284 });
// adding node
var x_node = Math.cos(2 * 10 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 10 * Math.PI / N) * 10;
g.nodes.push({
id: 26638,
label: 'PROJECT: De novo assembly for integration into MicroScope/MaGe platform',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/ldebarbieux-de-novo-assembly/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619126638,
size: 0.5,
source: 6191,
target: 26638 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 266384282,
size: 0.5,
source: 26638,
target: 4282 });
//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: 7760,
label: 'Varun Khanna',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=7760',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 266387760,
size: 0.5,
source: 26638,
target: 7760 });
// adding node
var x_node = Math.cos(2 * 11 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 11 * Math.PI / N) * 10;
g.nodes.push({
id: 25926,
label: 'PROJECT: 16S rDNA data analysis',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/ldebarbieux-16s-data-analysis/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619125926,
size: 0.5,
source: 6191,
target: 25926 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 259264282,
size: 0.5,
source: 25926,
target: 4282 });
//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: 4283,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 259264283,
size: 0.5,
source: 25926,
target: 4283 });
//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: 7758,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 259267758,
size: 0.5,
source: 25926,
target: 7758 });
//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: 7762,
label: 'Stevenn Volant',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_stevennvolant-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/stevenn-volant/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 259267762,
size: 0.5,
source: 25926,
target: 7762 });
//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: 906,
label: 'Marie-Agnès Dillies',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-photomadillies2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/marie-agnes-dillies/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 25926906,
size: 0.5,
source: 25926,
target: 906 });
// adding node
var x_node = Math.cos(2 * 12 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 12 * Math.PI / N) * 10;
g.nodes.push({
id: 24053,
label: 'PROJECT: Variant detection on NGS data',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/ldebarbieux-variant-detection-on-ngs-data/',
size: 24,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 619124053,
size: 0.5,
source: 6191,
target: 24053 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4282) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 240534282,
size: 0.5,
source: 24053,
target: 4282 });
//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: 7763,
label: 'Rachel Torchet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_rachelgrandintorchet-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/rachel-torchet/',
x: x_site,
y: y_site,
size: 10,
color: '#DDDDDD'
});
//link to content
g.edges.push({
id: 240537763,
size: 0.5,
source: 24053,
target: 7763 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 7760) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 240537760,
size: 0.5,
source: 24053,
target: 7760 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4283) {
n.size = n.size + 10;
if ( n.size > biggest_node_size ){
biggest_node_size = n.size;
}
}
});
g.nodes.forEach(function(n) {
if (n.id == 6191) {
if ( n.size < biggest_node_size ){
n.size = biggest_node_size;
}
}
});
//link to content
g.edges.push({
id: 240534283,
size: 0.5,
source: 24053,
target: 4283 });
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: 12,
maxNodeSize: 30,
mouseWheelEnabled: false,
font: 'Montserrat',
labelThreshold:25,
borderSize:1,
defaultNodeBorderColor: '#333',
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;
//console.log(n.id);
//console.log(s.graph.nodes(n.id));
});
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) {
});