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: 6817,
label: 'Raquel Hurtado Ortiz',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-raquel-hurtado-ortiz-foto-perfil-rho-2-150x150.jpg',
x: 0,
y: 0,
size: 30,
color: '#DDDDDD'
});
var biggest_node_size = 0;
N=14
// 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: 192139,
label: 'COURSE: Biobanking MOOC',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/12/research_pasteur-biobanking-mooc-page-vitrine-bbk4-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/course/biobanking-mooc/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817192139,
size: 0.5,
source: 6817,
target: 192139,
});
//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: 183185,
label: 'Fay Betsou',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/07/research_pasteur-fay-betsou-fay-2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fay-betsou/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 192139183185,
size: 0.5,
source: 192139,
target: 183185 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1921396817,
size: 0.5,
source: 192139,
target: 6817 });
//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: 7063,
label: 'Monica Sala',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-monica-sala-research-pasteur-monica-sala-monicaphoto2020-3-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/monica-sala/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1921397063,
size: 0.5,
source: 192139,
target: 7063 });
//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: 6816,
label: 'Clementine Schilte',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-clementine-schilte-photo-2022-scaled-e1692277761405-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/clementine-schilte/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1921396816,
size: 0.5,
source: 192139,
target: 6816 });
// 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: 176891,
label: 'PROJECT: ISIDORe – Integrated Services for Infectious Diseases Outbreak Research',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2022/02/research_pasteur-map-isidore-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/fr-isidore-integrated-services-for-infectious-diseases-outbreak-research/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817176891,
size: 0.5,
source: 6817,
target: 176891,
});
//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: 6980,
label: 'Dominique Clermont',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_dominique-clermont-bis-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/dominique-clermont/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1768916980,
size: 0.5,
source: 176891,
target: 6980 });
//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: 149334,
label: 'Federica Palma',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/11/research_pasteur-enfederica-palma-federicapalma-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/federica-palma/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 176891149334,
size: 0.5,
source: 176891,
target: 149334 });
//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: 108629,
label: 'Adriana Chiarelli',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/05/research_pasteur-adriana-chiarelli-chiarelli-adriana-2978-copie-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-adriana-chiarelli/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 176891108629,
size: 0.5,
source: 176891,
target: 108629 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1768916817,
size: 0.5,
source: 176891,
target: 6817 });
// 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: 157544,
label: 'PROJECT: Microbial Resource Research Infrastructure (MIRRI-ERIC)',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/04/research_pasteur-microbial-resource-research-infrastructure-mirri-eric-mirri-only-no-eric-vertical-positive-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/microbial-resource-research-infrastructure-mirri-eric/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817157544,
size: 0.5,
source: 6817,
target: 157544,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1575446817,
size: 0.5,
source: 157544,
target: 6817 });
//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: 2495,
label: 'Sylvain Brisse',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/03/9c960524567ea360a3_l_2ae2a-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/sylvain-brisse/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1575442495,
size: 0.5,
source: 157544,
target: 2495 });
//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: 4787,
label: 'Mariana Ferrari',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/05/research_pasteur-mariana-ferrari-ferrari-mariana-2957-150x150.jpeg',
page_url: 'https://research.pasteur.fr/en/member/mariana-ferrari/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1575444787,
size: 0.5,
source: 157544,
target: 4787 });
// 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: 144726,
label: 'PROJECT: IS_MIRRI21 – Implementation and Sustainability of Microbial Resource Research Infrastructure for the 21st century',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/07/research_pasteur-is_mirri21.emf_-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/is-mirri21-implementation-and-sustainability-of-microbial-resource-research-infrastructure-for-the-21st-century/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817144726,
size: 0.5,
source: 6817,
target: 144726,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6980) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1447266980,
size: 0.5,
source: 144726,
target: 6980 });
//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: 165469,
label: 'Martin Boutroux',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2021/08/research_pasteur-martin-boutroux-pasteur-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/martin-boutroux/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 144726165469,
size: 0.5,
source: 144726,
target: 165469 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 2495) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1447262495,
size: 0.5,
source: 144726,
target: 2495 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1447266817,
size: 0.5,
source: 144726,
target: 6817 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 4787) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1447264787,
size: 0.5,
source: 144726,
target: 4787 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 108629) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 144726108629,
size: 0.5,
source: 144726,
target: 108629 });
// 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: 133962,
label: 'NEWS: Our article in Access Microbiology was the most read of the month',
x: x_node,
y: y_node,
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/news/our-article-in-access-microbiology-was-the-most-read-of-the-month/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817133962,
size: 0.5,
source: 6817,
target: 133962,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1339626817,
size: 0.5,
source: 133962,
target: 6817 });
// 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: 127237,
label: 'EVENT: ECCO 2019: XXXVIII Annual Meeting of the European Culture Collections’ Organisation',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/06/research_pasteur-site-web-cbrip-ecco-2019_logo-3-150x150.png',
page_url: 'https://research.pasteur.fr/en/event/ecco-2019-xxxviii-annual-meeting-of-the-european-culture-collections-organisation/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817127237,
size: 0.5,
source: 6817,
target: 127237,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6980) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1272376980,
size: 0.5,
source: 127237,
target: 6980 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1272376817,
size: 0.5,
source: 127237,
target: 6817 });
// 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: 114086,
label: 'PROJECT: Expanding research infrastructure visibility to strengthen strategic partnerships (RI-VIS)',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2018/09/research_pasteur-ec-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/expanding-research-infrastructure-visibility-to-strengthen-strategic-partnerships-ri-vis/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817114086,
size: 0.5,
source: 6817,
target: 114086,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1140866817,
size: 0.5,
source: 114086,
target: 6817 });
// 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: 109556,
label: 'TEAM: National Collection of Cultures of Microorganisms',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2019/08/research_pasteur-cncm_institutpasteur_27853-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/team/national-collection-of-cultures-of-microorganisms/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 6817109556,
size: 0.5,
source: 6817,
target: 109556,
});
//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: 6989,
label: 'Sabine Garconnet',
type: 'image',
url: '',
page_url: 'https://research.pasteur.fr/en/member/sabine-garconnet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1095566989,
size: 0.5,
source: 109556,
target: 6989 });
//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: 8393,
label: 'Patricia Charles',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_charles-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/patricia-charles/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 1095568393,
size: 0.5,
source: 109556,
target: 8393 });
//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: 144721,
label: 'Kshanti Africano-Gomez',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2020/07/research_pasteur-cvafricanogomez-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/fr-kshanti-africano-gomez/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 109556144721,
size: 0.5,
source: 109556,
target: 144721 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 1095566817,
size: 0.5,
source: 109556,
target: 6817 });
// 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: 83391,
label: 'EVENT: 3rd International MIRRI Stakeholder Meeting',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_mirri2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/event/3rd-international-mirri-stakeholder-meeting/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681783391,
size: 0.5,
source: 6817,
target: 83391,
});
//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: 6819,
label: 'Chantal Bizet',
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/07/research.pasteur.fr_institutpasteur_33760-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/member/chantal-bizet/',
x: x_site,
y: y_site,
size: 10,
color: '#dddddd'
});
//link to content
g.edges.push({
id: 833916819,
size: 0.5,
source: 83391,
target: 6819 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 833916817,
size: 0.5,
source: 83391,
target: 6817 });
// 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: 79640,
label: 'EVENT: Best Practices for Biological Resource Centres – Long-term Preservation, Reproductive Technology, Genetic Resources & Containment',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/11/research.pasteur.fr_embric-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/event/best-practices-for-biological-resource-centres-long-term-preservation-reproductive-technology-genetic-resources-containment/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681779640,
size: 0.5,
source: 6817,
target: 79640,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 796406817,
size: 0.5,
source: 79640,
target: 6817 });
// 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: 76523,
label: 'PROJECT: EMBRIC- European Marine Biological Research Infrastructure Cluster',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_embric_logo_big_transparant-150x150.png',
page_url: 'https://research.pasteur.fr/en/project/embric-european-marine-biological-research-infrastructure-cluster/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681776523,
size: 0.5,
source: 6817,
target: 76523,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765236817,
size: 0.5,
source: 76523,
target: 6817 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6819) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765236819,
size: 0.5,
source: 76523,
target: 6819 });
// 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: 76519,
label: 'EVENT: EMBRIC – 1st General Assembly & EB – Naples meeting',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_embric-ga-150x150.png',
page_url: 'https://research.pasteur.fr/en/event/embric-1st-general-assembly-eb-naples-meeting/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681776519,
size: 0.5,
source: 6817,
target: 76519,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6819) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765196819,
size: 0.5,
source: 76519,
target: 6819 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765196817,
size: 0.5,
source: 76519,
target: 6817 });
// 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: 76514,
label: 'NEWS: EMBRIC – 1st General Assembly & EB – Naples meeting',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2016/09/research.pasteur.fr_embric-ga-1-150x150.png',
page_url: 'https://research.pasteur.fr/en/news/embric-1st-general-assembly-eb-naples-meeting/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681776514,
size: 0.5,
source: 6817,
target: 76514,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6819) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765146819,
size: 0.5,
source: 76514,
target: 6819 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 765146817,
size: 0.5,
source: 76514,
target: 6817 });
// adding node
var x_node = Math.cos(2 * 13 * Math.PI / N) * 10;
var y_node = Math.sin(2 * 13 * Math.PI / N) * 10;
g.nodes.push({
id: 37694,
label: 'PROJECT: MIRRI – Microbial Resource Research Infrastructure',
x: x_node,
y: y_node,
type: 'image',
url: 'https://research.pasteur.fr/wp-content/uploads/2015/09/research.pasteur.fr_mirri2-150x150.jpg',
page_url: 'https://research.pasteur.fr/en/project/microbial-resource-research-infrastructure/',
size: 35,
color: '#DDDDDD'
});
//link content to central post
g.edges.push({
id: 681737694,
size: 0.5,
source: 6817,
target: 37694,
});
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6817) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 376946817,
size: 0.5,
source: 37694,
target: 6817 });
//check if content already exist
// update node size depending on the amount of edges
g.nodes.forEach(function(n) {
if (n.id == 6819) {
n.size = n.size + 8;
}
});
//link to content
g.edges.push({
id: 376946819,
size: 0.5,
source: 37694,
target: 6819 });
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) {
});