Files
weave-scope/client/app/scripts/charts/topology-utils.js
2015-11-17 22:30:53 +01:00

11 lines
288 B
JavaScript

export function updateNodeDegrees(nodes, edges) {
return nodes.map(node => {
const nodeId = node.get('id');
const degree = edges.count(edge => {
return edge.get('source') === nodeId || edge.get('target') === nodeId;
});
return node.set('degree', degree);
});
}