Profile Picture

Layout question

Posted By Luis Mendes 14 Years Ago
Author
Message
Luis Mendes
Posted 14 Years Ago
View Quick Profile
Forum Member

Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 25, Visits: 1

I am setting the layout using the following code but evertime the graph is rendered it renders in a random order, the nodes are placed in different locations evertime. Help? Thanks in advance!!!

 

var layout = new NSpringLayout();

var shapesToLayout = drawingView.Document.ActiveLayer.Children( NFilters.Shape2D );

layout.Layout( shapesToLayout, new NDrawingLayoutContext( drawingView.Document ) );

drawingView.Document.SizeToContent();

 



Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

The force directed layouts (the spring layout you are using is one of them) are non-deterministic layouts, i.e. they may produce different results even when applied on the same input graph. If you want a deterministic layout try one of the others (e.g. Layered Graph Layout, Radial Layout, Orthogonal Layout, etc.).



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic