VivaGraphJS icon indicating copy to clipboard operation
VivaGraphJS copied to clipboard

positioning first node at the very top pf the graph

Open haghparast opened this issue 9 years ago • 1 comments
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?

haghparast avatar Jun 19 '16 12:06 haghparast

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);