Package edu.cmu.tetrad.graph
Class LayoutUtil
java.lang.Object
edu.cmu.tetrad.graph.LayoutUtil
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classLays out a graph by linearly summing repulsive force between all nodes and attractive force between adjacent nodes.static final classLays out a graph by placing springs between the nodes and letting the system settle (one node at a time).
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidarrangeByLayout(Graph graph, HashMap<String, PointXy> layout) static booleanarrangeBySourceGraph(Graph resultGraph, Graph sourceGraph) Arranges the nodes in the result graph according to their positions in the source graph.static voidcircleLayout(Graph graph, int centerx, int centery, int radius) Arranges the nodes in the graph in a circle.static voidfruchtermanReingoldLayout(Graph graph) static voidkamadaKawaiLayout(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy) 
- 
Constructor Details- 
LayoutUtilpublic LayoutUtil()
 
- 
- 
Method Details- 
kamadaKawaiLayoutpublic static void kamadaKawaiLayout(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy) 
- 
fruchtermanReingoldLayout
- 
arrangeByLayout
- 
circleLayoutArranges the nodes in the graph in a circle.- Parameters:
- centerx- The x coordinate for the center of the layout.
- centery- The y coordinate for the center of the layout.
- radius- The radius of the circle in pixels; a good default is 150.
 
- 
arrangeBySourceGraphArranges the nodes in the result graph according to their positions in the source graph.- Returns:
- true if all the nodes were arranged, false if not.
 
 
-