react-sigma
Version:
Lightweight but powerful library for drawing network graphs built on top of SigmaJS
17 lines (15 loc) • 407 B
JavaScript
export function propsChanged(prev, next) {
for (var key in prev) {
if (prev[key] !== next[key]) return true;
}
return false;
}
export function sigmaGraphMerge(graph) {
var _this = this;
graph.nodes.forEach(function (node) {
if (!_this.nodesIndex[node.id]) _this.addNode(node);
});
graph.edges.forEach(function (edge) {
if (!_this.edgesIndex[edge.id]) _this.addEdge(edge);
});
}