3 ms·
Any easy way to set/get the exact position of nodes? rather than have it automatically generated, or overriding the automatically assigned position.
by muyuu 15y ago
Any easy way to set/get the exact position of nodes? rather than have it automatically generated, or overriding the automatically assigned position.
- anvaka 15y agoJust enumerate the nodes: graph.forEachNode(function(node) { console.dir(node.position); }); By default nodes will not have any position assigned. Only after you run one step of layout algorithm ( https://github.com/anvaka/VivaGraphJS/blob/master/src/Layout/forceDirected.js https://github.com/anvaka/VivaGraphJS/blob/master/src/Layout... ) they get their positions.