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: 4922,
label: 'Sandie Munier',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_sandiemunier-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=8
// 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: 221449,
label: 'EVENT: ReCombinaisons, science, fiction, société',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/recombinaisons-science-fiction-societe/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4922221449,
size: 0.5,
source: 4922,
target: 221449,
});
//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: 8619,
label: 'François Bontems',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_francois_bontems-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/francois-bontems/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2214498619,
size: 0.5,
source: 221449,
target: 8619 });
//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: 49405,
label: 'Fanny Momboisse',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/06/research_pasteur-photo-pasteur-1.jpg',
page_url: 'https://research.pasteur.fr/fr/member/fanny-momboisse/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 22144949405,
size: 0.5,
source: 221449,
target: 49405 });
//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: 4729,
label: 'Marina Caillet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_marina-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/marina-caillet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2214494729,
size: 0.5,
source: 221449,
target: 4729 });
//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: 8377,
label: 'Guy-Franck Richard',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-guy-franck-richard-richard-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/guy-franck-richard/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2214498377,
size: 0.5,
source: 221449,
target: 8377 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2214494922,
size: 0.5,
source: 221449,
target: 4922 });
//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: 4325,
label: 'Philippe Afonso',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-philippe-afonso-unknown-150x150.jpeg',
page_url: 'https://research.pasteur.fr/fr/member/philippe-afonso/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 2214494325,
size: 0.5,
source: 221449,
target: 4325 });
//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: 174732,
label: 'Bérangère Virlon',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-berangere-virlon-virlon-berengere-2314-bv-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/berangere-virlon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 221449174732,
size: 0.5,
source: 221449,
target: 174732 });
//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: 118005,
label: 'Sandrine Royer-Devaux',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/sandrine-royer-devaux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 221449118005,
size: 0.5,
source: 221449,
target: 118005 });
// 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: 112911,
label: 'PROJECT: Trafficking and assembly of influenza virus genomic RNAs',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-influenza-virus-zooms-_web-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/project/trafficking-and-assembly-of-influenza-genomic-rnas/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4922112911,
size: 0.5,
source: 4922,
target: 112911,
});
//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: 68790,
label: 'Catherine Isel-Griffiths',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/05/research.pasteur.fr_catherine-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/catherine-isel-griffiths/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 11291168790,
size: 0.5,
source: 112911,
target: 68790 });
//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: 86836,
label: 'Kuang-Yu Chen',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/03/research.pasteur.fr_photograph-150x150.png',
page_url: 'https://research.pasteur.fr/fr/member/kuang-yu-chen/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 11291186836,
size: 0.5,
source: 112911,
target: 86836 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1129114922,
size: 0.5,
source: 112911,
target: 4922 });
//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: 86825,
label: 'Nicolas Malausse',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/11/research_pasteur-nm_5-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/nicolas-malausse/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 11291186825,
size: 0.5,
source: 112911,
target: 86825 });
//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: 4923,
label: 'Nadia Naffakh',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/08/research.pasteur.fr_photo_web1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/nadia-naffakh/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1129114923,
size: 0.5,
source: 112911,
target: 4923 });
// 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: 112903,
label: 'TOOL: Engineered influenza viruses expressing a tagged polymerase subunit',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-influenza-virus-zooms-_web-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/tool/engineered-influenza-viruses-expressing-a-tagged-polymerase-subunit/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4922112903,
size: 0.5,
source: 4922,
target: 112903,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1129034922,
size: 0.5,
source: 112903,
target: 4922 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4923) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1129034923,
size: 0.5,
source: 112903,
target: 4923 });
// 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: 105183,
label: 'EVENT: HDR Defense by Sandie Munier',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/event/soutenance-habilitation-a-diriger-les-recherches/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 4922105183,
size: 0.5,
source: 4922,
target: 105183,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1051834922,
size: 0.5,
source: 105183,
target: 4922 });
// 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: 39376,
label: 'TOOL: High-throughput protein-protein interaction assay based on a split-luciferase',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_high-throughput-protein-protein-interaction-assay-based-on-a-split-luciferase-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/tool/high-throughput-protein-protein-interaction-assay-based-on-a-split-luciferase/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 492239376,
size: 0.5,
source: 4922,
target: 39376,
});
//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: 4934,
label: 'Patricia Cassonnet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_rimg4902-original-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/patricia-cassonnet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 393764934,
size: 0.5,
source: 39376,
target: 4934 });
//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: 4926,
label: 'Caroline Demeret',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_dscn7482-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/caroline-demeret/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 393764926,
size: 0.5,
source: 39376,
target: 4926 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4923) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 393764923,
size: 0.5,
source: 39376,
target: 4923 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 393764922,
size: 0.5,
source: 39376,
target: 4922 });
//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: 4928,
label: 'Yves Jacob',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/?post_type=member&p=4928',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 393764928,
size: 0.5,
source: 39376,
target: 4928 });
// 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: 32800,
label: 'PROJECT: Molecular mechanism of transcription by influenza virus polymerase',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-influenza-virus-zooms-_web-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/project/nuclear-import-and-assembly-of-the-viral-rna-polymerase-subunits/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 492232800,
size: 0.5,
source: 4922,
target: 32800,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 328004922,
size: 0.5,
source: 32800,
target: 4922 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 68790) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 3280068790,
size: 0.5,
source: 32800,
target: 68790 });
//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: 86831,
label: 'Usama Ashraf',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/03/research.pasteur.fr_img_20170102_121956-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/usama-ashraf/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 3280086831,
size: 0.5,
source: 32800,
target: 86831 });
//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: 126345,
label: 'Tim Krischuns',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/tim-krischuns/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 32800126345,
size: 0.5,
source: 32800,
target: 126345 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4923) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 328004923,
size: 0.5,
source: 32800,
target: 4923 });
// 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: 24396,
label: 'TEAM: Biologie des ARN et Virus Influenza',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/08/research_pasteur-bandeau-groupe-naffakh-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/team/rna-biology-of-influenza-virus/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 492224396,
size: 0.5,
source: 4922,
target: 24396,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 243964922,
size: 0.5,
source: 24396,
target: 4922 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 68790) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2439668790,
size: 0.5,
source: 24396,
target: 68790 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 86831) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2439686831,
size: 0.5,
source: 24396,
target: 86831 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 86836) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2439686836,
size: 0.5,
source: 24396,
target: 86836 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 86825) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 2439686825,
size: 0.5,
source: 24396,
target: 86825 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 126345) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 24396126345,
size: 0.5,
source: 24396,
target: 126345 });
//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: 8293,
label: 'Sylvain Paisant',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_sylvian-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/sylvain-paisant/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 243968293,
size: 0.5,
source: 24396,
target: 8293 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4923) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 243964923,
size: 0.5,
source: 24396,
target: 4923 });
// 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: 6180,
label: 'TEAM: Lyssavirus, épidémiologie et neuropathologie',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research.pasteur.fr_lyssavirus-dynamics-and-host-adaptation-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/team/lyssavirus-epidemiology-and-neuropathology/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 49226180,
size: 0.5,
source: 4922,
target: 6180,
});
//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: 3981,
label: 'Florence Larrous',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/06/research_pasteur-photo-flo-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/florence-larrous/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61803981,
size: 0.5,
source: 6180,
target: 3981 });
//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: 3976,
label: 'Perrine Parize',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-perrine-p1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/perrine-parize/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61803976,
size: 0.5,
source: 6180,
target: 3976 });
//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: 87539,
label: 'Malika Jellaoui',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/09/research_pasteur-mj2-1-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/malika-jellaoui/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 618087539,
size: 0.5,
source: 6180,
target: 87539 });
//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: 7783,
label: 'Lauriane Kergoat',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2017/07/research_pasteur-photo-site-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/lauriane-kergoat/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61807783,
size: 0.5,
source: 6180,
target: 7783 });
//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: 42508,
label: 'Guilherme Dias de Melo',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research_pasteur-guilherme-dias-de-melo-photo-pour-profil-prix-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/guilherme-dias-de-melo/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 618042508,
size: 0.5,
source: 6180,
target: 42508 });
//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: 165290,
label: 'Julien Lannoy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-julien-lannoy-photo-julien-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/julien-lannoy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180165290,
size: 0.5,
source: 6180,
target: 165290 });
//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: 165385,
label: 'Seonhee Kim',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-seonhee-kim-photo-seonhee-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/seonhee-kim/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180165385,
size: 0.5,
source: 6180,
target: 165385 });
//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: 173805,
label: 'Juliette Perrot',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-juliette-perrot-juliette-perrot--150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/juliette-perrot/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180173805,
size: 0.5,
source: 6180,
target: 173805 });
//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: 173823,
label: 'Marilys Castet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/01/research_pasteur-marilys-castet-marilys-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/marilys-castet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180173823,
size: 0.5,
source: 6180,
target: 173823 });
//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: 198678,
label: 'Katherine Worsley-Tonks',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/katherine-worsley-tonks/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180198678,
size: 0.5,
source: 6180,
target: 198678 });
//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: 212348,
label: 'Anthony Coleon',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/anthony-coleon/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180212348,
size: 0.5,
source: 6180,
target: 212348 });
//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: 156790,
label: 'Aurélien Gibaud',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/fr/member/aurelien-gibaud/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180156790,
size: 0.5,
source: 6180,
target: 156790 });
//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: 182053,
label: 'Said Mougari',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/06/research_pasteur-said-mougari-mougari-said-7514-e1721127271732-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/said-mougari/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 6180182053,
size: 0.5,
source: 6180,
target: 182053 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4922) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 61804922,
size: 0.5,
source: 6180,
target: 4922 });
//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: 3977,
label: 'Hervé Bourhy',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_fig50-150x150.jpg',
page_url: 'https://research.pasteur.fr/fr/member/herve-bourhy/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 61803977,
size: 0.5,
source: 6180,
target: 3977 });
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) {
});