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: 4344,
label: 'Bianca Audrain',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_bianca2-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=10
// 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: 168008,
label: 'PROJECT: ANR OM-LipAsy: Outer membrane lipid asymmetry in Veillonella parvula, an atypical diderm Firmicute',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/09/research_pasteur-enom-lipasy-capture-decran-2021-09-28-a-18.08.11-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/om-lipasy/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4344168008,
size: 0.5,
source: 4344,
target: 168008,
});
//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: 4286,
label: 'Simonetta Gribaldo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/10/research_pasteur-photo-simo2-150x150.png',
page_url: 'https://research.pasteur.fr/en/member/simonetta-gribaldo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1680084286,
size: 0.5,
source: 168008,
target: 4286 });
//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: 90107,
label: 'Najwa Taib',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/05/research_pasteur-photo_ntaib-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/najwa-taib/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 16800890107,
size: 0.5,
source: 168008,
target: 90107 });
//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: 1680084148,
size: 0.5,
source: 168008,
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: 4345,
label: 'Sylvie Létoffé',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_sylvie2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sylvie-letoffe/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1680084345,
size: 0.5,
source: 168008,
target: 4345 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1680084344,
size: 0.5,
source: 168008,
target: 4344 });
//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: 148650,
label: 'Basile Beaud',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/10/research_pasteur-8a951152-5fa0-4920-99f6-30c8a2ec3081-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/fr-basile-beaud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 168008148650,
size: 0.5,
source: 168008,
target: 148650 });
//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: 1680084611,
size: 0.5,
source: 168008,
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: 168008117296,
size: 0.5,
source: 168008,
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: 188060,
label: 'Anna Kurowska',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/10/research_pasteur-anna-kurowska-img-0644-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/anna-kurowska/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 168008188060,
size: 0.5,
source: 168008,
target: 188060 });
//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: 4335,
label: 'Christophe Beloin',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_christophe2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/christophe-beloin/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1680084335,
size: 0.5,
source: 168008,
target: 4335 });
// 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: 122746,
label: 'PROJECT: Biofilms formed by anaerobes',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/02/research_pasteur-anaerobiofilm-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/biofilms-formed-by-anaerobes/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4344122746,
size: 0.5,
source: 4344,
target: 122746,
});
//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: 77657,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 12274677657,
size: 0.5,
source: 122746,
target: 77657 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1227464344,
size: 0.5,
source: 122746,
target: 4344 });
//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: 120932,
label: 'Stanislas Thiriet-Rupert',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/07/research_pasteur-stanislas2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-stanislas-thiriet-rupert/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 122746120932,
size: 0.5,
source: 122746,
target: 120932 });
//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: 119197,
label: '',
type: 'image',
url: '',
page_url: '',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 122746119197,
size: 0.5,
source: 122746,
target: 119197 });
//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: 4214,
label: 'Bruno Dupuy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_bruno_id-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/bruno-dupuy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1227464214,
size: 0.5,
source: 122746,
target: 4214 });
//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: 4337,
label: 'Jean-Marc Ghigo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-ghigo-jean-marc-recad.lg_-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/jean-marc-ghigo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1227464337,
size: 0.5,
source: 122746,
target: 4337 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4335) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1227464335,
size: 0.5,
source: 122746,
target: 4335 });
// 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: 101243,
label: 'PROJECT: Molecular Bases of Colonization Resistance',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_mixzd.biofilm-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/molecular-bases-colonization-resistance/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4344101243,
size: 0.5,
source: 4344,
target: 101243,
});
//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: 77661,
label: 'David Perez Pascual',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/?post_type=member&p=77661',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 10124377661,
size: 0.5,
source: 101243,
target: 77661 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1012434344,
size: 0.5,
source: 101243,
target: 4344 });
//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: 95038,
label: 'Sol Vendrell Fernandez',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-sol-vendrell-fernandez-research-pasteur-sol-vendrell-fernandez-img-3812-e1732212162387-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sol-vendrell-fernandez/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 10124395038,
size: 0.5,
source: 101243,
target: 95038 });
//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: 4397,
label: 'Jean-Pierre Levraud',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_jplevraud-portrait-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/jean-pierre-levraud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1012434397,
size: 0.5,
source: 101243,
target: 4397 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1012434337,
size: 0.5,
source: 101243,
target: 4337 });
// 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: 89995,
label: 'NEWS: Biofilm-associated production of 1-Propanol in Enterobacteriacae',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/news/biofilm-microenvironment-induces-a-widespread-adaptive-amino-acid-fermentation-pathway-conferring-strong-fitness-advantage-in-escherichia-coli-plos-genetics-in-press/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434489995,
size: 0.5,
source: 4344,
target: 89995,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4345) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 899954345,
size: 0.5,
source: 89995,
target: 4345 });
//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: 4340,
label: 'Franziska Stressmann',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_franziska2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/franziska-stressmann/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 899954340,
size: 0.5,
source: 89995,
target: 4340 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 899954344,
size: 0.5,
source: 89995,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 899954337,
size: 0.5,
source: 89995,
target: 4337 });
// 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: 27664,
label: 'PROJECT: Mixed Biofilms',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/project/bacterial-interactions-in-in-vitro-biofilms/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434427664,
size: 0.5,
source: 4344,
target: 27664,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 276644344,
size: 0.5,
source: 27664,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4345) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 276644345,
size: 0.5,
source: 27664,
target: 4345 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4340) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 276644340,
size: 0.5,
source: 27664,
target: 4340 });
//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: 4336,
label: 'Joaquin Bernal',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_joaquin2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/joaquin-bernal/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 276644336,
size: 0.5,
source: 27664,
target: 4336 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 77661) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2766477661,
size: 0.5,
source: 27664,
target: 77661 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 77657) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2766477657,
size: 0.5,
source: 27664,
target: 77657 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 276644337,
size: 0.5,
source: 27664,
target: 4337 });
// 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: 27407,
label: 'TOOL: Biofilm Microfermenters',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_microfermenterrond1-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/tool/biofilm-microfermenters/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434427407,
size: 0.5,
source: 4344,
target: 27407,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4335) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 274074335,
size: 0.5,
source: 27407,
target: 4335 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 274074344,
size: 0.5,
source: 27407,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 274074337,
size: 0.5,
source: 27407,
target: 4337 });
// 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: 24154,
label: 'TEAM: Group: Christophe Beloin',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_institutpasteur_420551-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/group-christophe-beloin/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434424154,
size: 0.5,
source: 4344,
target: 24154,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 241544344,
size: 0.5,
source: 24154,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 120932) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 24154120932,
size: 0.5,
source: 24154,
target: 120932 });
//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: 150746,
label: 'Louis Dorison',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/12/research_pasteur-louis-dorison-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/louis-dorison/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 24154150746,
size: 0.5,
source: 24154,
target: 150746 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4335) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 241544335,
size: 0.5,
source: 24154,
target: 4335 });
// 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: 6193,
label: 'TEAM: Genetics of Biofilms',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/01/research_pasteur-unite-biofilm-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/genetics-of-biofilms/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 43446193,
size: 0.5,
source: 4344,
target: 6193,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4335) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61934335,
size: 0.5,
source: 6193,
target: 4335 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61934344,
size: 0.5,
source: 6193,
target: 4344 });
//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: 8320,
label: 'Pascale Sitbon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/02/research_pasteur-pascale3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/pascale-sitbon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61938320,
size: 0.5,
source: 6193,
target: 8320 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 120932) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6193120932,
size: 0.5,
source: 6193,
target: 120932 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 95038) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 619395038,
size: 0.5,
source: 6193,
target: 95038 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 150746) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 6193150746,
size: 0.5,
source: 6193,
target: 150746 });
//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: 25847,
label: 'David Lebeaux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_david-lebeaux-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/david-lebeaux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 619325847,
size: 0.5,
source: 6193,
target: 25847 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61934337,
size: 0.5,
source: 6193,
target: 4337 });
// 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: 30981,
label: 'PROJECT: Biofilm Volatile Compounds',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_smell-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/biofilm-volatile-compounds/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434430981,
size: 0.5,
source: 4344,
target: 30981,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4345) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 309814345,
size: 0.5,
source: 30981,
target: 4345 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 309814344,
size: 0.5,
source: 30981,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 309814337,
size: 0.5,
source: 30981,
target: 4337 });
// 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: 19983,
label: 'PROJECT: Fighting biofilms',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fighting-biofilms3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/fighting-biofilms/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 434419983,
size: 0.5,
source: 4344,
target: 19983,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4344) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199834344,
size: 0.5,
source: 19983,
target: 4344 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4336) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199834336,
size: 0.5,
source: 19983,
target: 4336 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 25847) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1998325847,
size: 0.5,
source: 19983,
target: 25847 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4335) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199834335,
size: 0.5,
source: 19983,
target: 4335 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4337) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 199834337,
size: 0.5,
source: 19983,
target: 4337 });
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) {
});