JSNetworkX
JSNetworkX copied to clipboard
Fix part of nodes programmatically
Hey,
I need to create 4 nodes at the edges of the screen and see how network grows among them (with auto positioning). Of course I can move them with stickyDrag: true, but this is too time-consuming as I need to make lots of experiments.
Thanks!
Found a hacky way to set node position:
let node = G.node.get(1);
node.__d3datum__.px = 10;
node.__d3datum__.x = 10;
node.__d3datum__.py = 10;
node.__d3datum__.y = 10;
node.__d3datum__.fixed = 1;