VivaGraphJS
VivaGraphJS copied to clipboard
positioning first node at the very top pf the graph
trafficstars
Hi and thanks for the wonderful library. I am trying to create a function call graph with your library and I need to start the graph with one node at the top. I tried different things but couldn't achieve that. I set the first one to be pinned but it is in the middle of the graph. Any suggestions?
I think you can do for some node named 'input1' in a forcedirected graph (adjust your coordinate choice to fit within charting space)...
...
var layout = Viva.Graph.Layout.forceDirected(graph, settings)
...
layout.setNodePosition('input1', -150, 0);
layout.pinNode(node, true);