Undirected graphs
The code was modified in https://github.com/vchilkuri/vchilkuri.github.io/blob/master/src/ccNetViz.js
/* Code for unidirectional graphs GSoC 2017*/
var uniqObj = {};
var uniqObjArray = [];
function checkUniqIdForUnidirectional(el) {
if (el.__uniqid !== undefined) {
el.uniqid = el.__uniqid;
delete el.__uniqid;
} else if (el.uniqid === undefined) {
var sUid = el.source.uniqid || el.source;
var tUid = el.target.uniqid || el.target;
if (sUid > tUid) {
var temp = sUid;
sUid = tUid;
tUid = temp;
}
var index = sUid + ":" + tUid;
if (!uniqObj[index]) {
el.uniqid = ++lastUniqId;
uniqObj[index] = el.uniqid;
uniqObjArray.push(el);
} else {
el.uniqid = uniqObj[index];
}
}
}
/* code for unidirectional graphs ends GSoC 17 */
This method has to be developed further after adding the layout options.