Package edu.cmu.tetrad.graph
Class LayoutUtil
java.lang.Object
edu.cmu.tetrad.graph.LayoutUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Lays out a graph by linearly summing repulsive force between all nodes and attractive force between adjacent nodes.static final class
Lays 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 void
arrangeByLayout
(Graph graph, HashMap<String, PointXy> layout) arrangeByLayout.static boolean
arrangeBySourceGraph
(Graph resultGraph, Graph sourceGraph) Arranges the nodes in the result graph according to their positions in the source graph.static void
circleLayout
(Graph graph) Arranges the nodes in the graph in a circle.static void
defaultLayout
(Graph graph) Arranges the nodes in the graph in a circle if there are 20 or fewer nodes, otherwise arranges them in a square.static void
fruchtermanReingoldLayout
(Graph graph) fruchtermanReingoldLayout.static void
kamadaKawaiLayout
(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy) kamadaKawaiLayout.static void
layoutByCausalOrder
(Graph graph) layoutByCausalOrder.static void
squareLayout
(Graph graph) squareLayout.
-
Constructor Details
-
LayoutUtil
public LayoutUtil()Constructor.
-
-
Method Details
-
kamadaKawaiLayout
public static void kamadaKawaiLayout(Graph graph, boolean randomlyInitialized, double naturalEdgeLength, double springConstant, double stopEnergy) kamadaKawaiLayout.
- Parameters:
graph
- aGraph
objectrandomlyInitialized
- a booleannaturalEdgeLength
- a doublespringConstant
- a doublestopEnergy
- a double
-
fruchtermanReingoldLayout
-
arrangeByLayout
-
defaultLayout
Arranges the nodes in the graph in a circle if there are 20 or fewer nodes, otherwise arranges them in a square.- Parameters:
graph
- the graph to be arranged.
-
circleLayout
Arranges the nodes in the graph in a circle.- Parameters:
graph
- the graph to be arranged.
-
squareLayout
-
layoutByCausalOrder
-
arrangeBySourceGraph
-