mirror of
https://github.com/dataforcanada/d4c-service-main-site.git
synced 2026-06-13 14:00:51 +02:00
Add replication connections for Internet Archive and Zenodo
This commit is contained in:
@@ -185,6 +185,12 @@ sidebar:
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Connections between nodes
|
||||||
|
const connections = [
|
||||||
|
{ source: 'san-francisco', target: 'vancouver', color: '#002147' },
|
||||||
|
{ source: 'geneva', target: 'budapest', color: '#FFFFFF' }
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
const width = 960;
|
const width = 960;
|
||||||
const height = 600;
|
const height = 600;
|
||||||
@@ -209,6 +215,7 @@ sidebar:
|
|||||||
.attr('class', 'graticule')
|
.attr('class', 'graticule')
|
||||||
.attr('d', path);
|
.attr('d', path);
|
||||||
|
|
||||||
|
|
||||||
// Group nodes by location to handle overlapping
|
// Group nodes by location to handle overlapping
|
||||||
const nodesByLocation = {};
|
const nodesByLocation = {};
|
||||||
nodes.forEach(node => {
|
nodes.forEach(node => {
|
||||||
@@ -271,6 +278,23 @@ sidebar:
|
|||||||
.enter().append('path')
|
.enter().append('path')
|
||||||
.attr('class', 'land')
|
.attr('class', 'land')
|
||||||
.attr('d', path);
|
.attr('d', path);
|
||||||
|
// Draw connections
|
||||||
|
const connectionGroup = g.append('g');
|
||||||
|
connections.forEach(conn => {
|
||||||
|
const source = nodes.find(n => n.id === conn.source);
|
||||||
|
const target = nodes.find(n => n.id === conn.target);
|
||||||
|
if (source && target) {
|
||||||
|
connectionGroup.append('path')
|
||||||
|
.datum({
|
||||||
|
type: 'LineString',
|
||||||
|
coordinates: [source.coords, target.coords]
|
||||||
|
})
|
||||||
|
.attr('class', 'connection')
|
||||||
|
.attr('d', path)
|
||||||
|
.attr('stroke', conn.color);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// Draw nodes with offsets for overlapping positions
|
// Draw nodes with offsets for overlapping positions
|
||||||
const nodeGroup = g.append('g');
|
const nodeGroup = g.append('g');
|
||||||
|
|||||||
Reference in New Issue
Block a user