Package edu.cmu.tetrad.graph
Class LayoutUtil
java.lang.Object
edu.cmu.tetrad.graph.LayoutUtil
-
Nested Class Summary
Nested 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 Summary
Constructors -
Method Summary
Modifier 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
-
LayoutUtil
public LayoutUtil()
-
-
Method Details
-
kamadaKawaiLayout
public static void kamadaKawaiLayout(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy) -
fruchtermanReingoldLayout
-
arrangeByLayout
-
circleLayout
Arranges the nodes in the graph in a circle.- Parameters:
radius- The radius of the circle in pixels; a good default is 150.centerx- The x coordinate for the center of the layout.centery- The y coordinate for the center of the layout.
-
arrangeBySourceGraph
Arranges 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.
-